define var ENCODEINTO_BUILD = false ; ( function ( window ) { "use strict" ; var fromCharCode = String . fromCharCode ; var Object_prototype_toString = { } . toString ; var sharedArrayBufferString = Object_prototype_toString . call ( window [ "SharedArrayBuffer" ] ) ; var undefinedObjectString = Object_prototype_toString ( ) ; var NativeUint8Array = window . Uint8Array ; var patchedU8Array = NativeUint8Array || Array ; var nativeArrayBuffer = NativeUint8Array ? ArrayBuffer : patchedU8Array ; var arrayBuffer_isView = nativeArrayBuffer . isView || function ( x ) { return x && "length" in x ; } ; var arrayBufferString = Object_prototype_toString . call ( nativeArrayBuffer . prototype ) ; var window_encodeURIComponent = encodeURIComponent ; var window_parseInt = parseInt ; var TextEncoderPrototype = TextEncoder [ "prototype" ] ; var GlobalTextEncoder = window [ "TextEncoder" ] ; var decoderRegexp = /[\xc0-\xff][\x80-\xbf]+|[\x80-\xff]/g ; var encoderRegexp = /[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g ; var tmpBufferU16 = new ( NativeUint8Array ? Uint16Array : patchedU8Array ) ( 32 ) ; var globalTextEncoderPrototype ; var globalTextEncoderInstance ; function TextDecoder ( ) { } TextDecoder [ "prototype" ] [ "decode" ] = function ( inputArrayOrBuffer ) { var inputAs8 = inputArrayOrBuffer , asObjectString ; if ( ! arrayBuffer_isView ( inputAs8 ) ) { asObjectString = Object_prototype_toString . call ( inputAs8 ) ; if ( asObjectString !== arrayBufferString && asObjectString !== sharedArrayBufferString && asObjectString !== undefinedObjectString ) throw TypeError ( "Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'" ) ; inputAs8 = NativeUint8Array ? new patchedU8Array ( inputAs8 ) : inputAs8 || [ ] ; } var resultingString = "" , tmpStr = "" , index = 0 , len = inputAs8 . length | 0 , lenMinus32 = ( len - 32 ) | 0 , nextEnd = 0 , nextStop = 0 , cp0 = 0 , codePoint = 0 , minBits = 0 , cp1 = 0 , pos = 0 , tmp = - 1 ; for ( ; index < len ; ) { nextEnd = index <= lenMinus32 ? 32 : ( len - index ) | 0 ; for ( ; pos < nextEnd ; index = ( index + 1 ) | 0 , pos = ( pos + 1 ) | 0 ) { cp0 = inputAs8 [ index ] & 0xff ; switch ( cp0 >> 4 ) { case 15 : cp1 = inputAs8 [ ( index = ( index + 1 ) | 0 ) ] & 0xff ; if ( cp1 >> 6 !== 0b10 || 0b11110111 < cp0 ) { index = ( index - 1 ) | 0 ; break ; } codePoint = ( ( cp0 & 0b111 ) << 6 ) | ( cp1 & 0b00111111 ) ; minBits = 5 ; cp0 = 0x100 ; case 14 : cp1 = inputAs8 [ ( index = ( index + 1 ) | 0 ) ] & 0xff ; codePoint <<= 6 ; codePoint |= ( ( cp0 & 0b1111 ) << 6 ) | ( cp1 & 0b00111111 ) ; minBits = cp1 >> 6 === 0b10 ? ( minBits + 4 ) | 0 : 24 ; cp0 = ( cp0 + 0x100 ) & 0x300 ; case 13 : case 12 : cp1 = inputAs8 [ ( index = ( index + 1 ) | 0 ) ] & 0xff ; codePoint <<= 6 ; codePoint |= ( ( cp0 & 0b11111 ) << 6 ) | ( cp1 & 0b00111111 ) ; minBits = ( minBits + 7 ) | 0 ; if ( index < len && cp1 >> 6 === 0b10 && codePoint >> minBits && codePoint < 0x110000 ) { cp0 = codePoint ; codePoint = ( codePoint - 0x10000 ) | 0 ; if ( 0 <= codePoint ) { tmp = ( ( codePoint >> 10 ) + 0xd800 ) | 0 ; cp0 = ( ( codePoint & 0x3ff ) + 0xdc00 ) | 0 ; if ( pos < 31 ) { tmpBufferU16 [ pos ] = tmp ; pos = ( pos + 1 ) | 0 ; tmp = - 1 ; } else { cp1 = tmp ; tmp = cp0 ; cp0 = cp1 ; } } else nextEnd = ( nextEnd + 1 ) | 0 ; } else { cp0 >>= 8 ; index = ( index - cp0 - 1 ) | 0 ; cp0 = 0xfffd ; } minBits = 0 ; codePoint = 0 ; nextEnd = index <= lenMinus32 ? 32 : ( len - index ) | 0 ; default : tmpBufferU16 [ pos ] = cp0 ; continue ; case 11 : case 10 : case 9 : case 8 : } tmpBufferU16 [ pos ] = 0xfffd ; } tmpStr += fromCharCode ( tmpBufferU16 [ 0 ] , tmpBufferU16 [ 1 ] , tmpBufferU16 [ 2 ] , tmpBufferU16 [ 3 ] , tmpBufferU16 [ 4 ] , tmpBufferU16 [ 5 ] , tmpBufferU16 [ 6 ] , tmpBufferU16 [ 7 ] , tmpBufferU16 [ 8 ] , tmpBufferU16 [ 9 ] , tmpBufferU16 [ 10 ] , tmpBufferU16 [ 11 ] , tmpBufferU16 [ 12 ] , tmpBufferU16 [ 13 ] , tmpBufferU16 [ 14 ] , tmpBufferU16 [ 15 ] , tmpBufferU16 [ 16 ] , tmpBufferU16 [ 17 ] , tmpBufferU16 [ 18 ] , tmpBufferU16 [ 19 ] , tmpBufferU16 [ 20 ] , tmpBufferU16 [ 21 ] , tmpBufferU16 [ 22 ] , tmpBufferU16 [ 23 ] , tmpBufferU16 [ 24 ] , tmpBufferU16 [ 25 ] , tmpBufferU16 [ 26 ] , tmpBufferU16 [ 27 ] , tmpBufferU16 [ 28 ] , tmpBufferU16 [ 29 ] , tmpBufferU16 [ 30 ] , tmpBufferU16 [ 31 ] ) ; if ( pos < 32 ) tmpStr = tmpStr . slice ( 0 , ( pos - 32 ) | 0 ) ; if ( index < len ) { tmpBufferU16 [ 0 ] = tmp ; pos = ~ tmp >>> 31 ; tmp = - 1 ; if ( tmpStr . length < resultingString . length ) continue ; } else if ( tmp !== - 1 ) { tmpStr += fromCharCode ( tmp ) ; } resultingString += tmpStr ; tmpStr = "" ; } return resultingString ; } ; function encoderReplacer ( nonAsciiChars ) { var point = nonAsciiChars . charCodeAt ( 0 ) | 0 ; if ( 0xd800 <= point ) { if ( point <= 0xdbff ) { var nextcode = nonAsciiChars . charCodeAt ( 1 ) | 0 ; if ( 0xdc00 <= nextcode && nextcode <= 0xdfff ) { point = ( ( point << 10 ) + nextcode - 0x35fdc00 ) | 0 ; if ( point > 0xffff ) return fromCharCode ( ( 0x1e << 3 ) | ( point >> 18 ) , ( 0x2 << 6 ) | ( ( point >> 12 ) & 0x3f ) , ( 0x2 << 6 ) | ( ( point >> 6 ) & 0x3f ) , ( 0x2 << 6 ) | ( point & 0x3f ) ) ; } else point = 65533 ; } else if ( point <= 0xdfff ) { point = 65533 ; } } if ( point <= 0x07ff ) { return fromCharCode ( ( 0x6 << 5 ) | ( point >> 6 ) , ( 0x2 << 6 ) | ( point & 0x3f ) ) ; } else return fromCharCode ( ( 0xe << 4 ) | ( point >> 12 ) , ( 0x2 << 6 ) | ( ( point >> 6 ) & 0x3f ) , ( 0x2 << 6 ) | ( point & 0x3f ) ) ; } function TextEncoder ( ) { } TextEncoderPrototype [ "encode" ] = function ( inputString ) { var encodedString = inputString === void 0 ? "" : "" + inputString , len = encodedString . length | 0 ; var result = new patchedU8Array ( ( ( len << 1 ) + 8 ) | 0 ) , tmpResult ; var i = 0 , pos = 0 , point = 0 , nextcode = 0 ; var upgradededArraySize = ! NativeUint8Array ; for ( i = 0 ; i < len ; i = ( i + 1 ) | 0 , pos = ( pos + 1 ) | 0 ) { point = encodedString . charCodeAt ( i ) | 0 ; if ( point <= 0x007f ) { result [ pos ] = point ; } else if ( point <= 0x07ff ) { result [ pos ] = ( 0x6 << 5 ) | ( point >> 6 ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( point & 0x3f ) ; } else { widenCheck : { if ( 0xd800 <= point ) { if ( point <= 0xdbff ) { nextcode = encodedString . charCodeAt ( ( i = ( i + 1 ) | 0 ) ) | 0 ; if ( 0xdc00 <= nextcode && nextcode <= 0xdfff ) { point = ( ( point << 10 ) + nextcode - 0x35fdc00 ) | 0 ; if ( point > 0xffff ) { result [ pos ] = ( 0x1e << 3 ) | ( point >> 18 ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( ( point >> 12 ) & 0x3f ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( ( point >> 6 ) & 0x3f ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( point & 0x3f ) ; continue ; } break widenCheck ; } point = 65533 ; } else if ( point <= 0xdfff ) { point = 65533 ; } } if ( ! upgradededArraySize && i << 1 < pos && i << 1 < ( ( pos - 7 ) | 0 ) ) { upgradededArraySize = true ; tmpResult = new patchedU8Array ( len * 3 ) ; tmpResult . set ( result ) ; result = tmpResult ; } } result [ pos ] = ( 0xe << 4 ) | ( point >> 12 ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( ( point >> 6 ) & 0x3f ) ; result [ ( pos = ( pos + 1 ) | 0 ) ] = ( 0x2 << 6 ) | ( point & 0x3f ) ; } } return NativeUint8Array ? result . subarray ( 0 , pos ) : result . slice ( 0 , pos ) ; } ; function polyfill_encodeInto ( inputString , u8Arr ) { var encodedString = inputString === void 0 ? "" : ( "" + inputString ) . replace ( encoderRegexp , encoderReplacer ) ; var len = encodedString . length | 0 , i = 0 , char = 0 , read = 0 , u8ArrLen = u8Arr . length | 0 , inputLength = inputString . length | 0 ; if ( u8ArrLen < len ) len = u8ArrLen ; putChars : { for ( ; i < len ; i = ( i + 1 ) | 0 ) { char = encodedString . charCodeAt ( i ) | 0 ; switch ( char >> 4 ) { case 0 : case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : read = ( read + 1 ) | 0 ; case 8 : case 9 : case 10 : case 11 : break ; case 12 : case 13 : if ( ( ( i + 1 ) | 0 ) < u8ArrLen ) { read = ( read + 1 ) | 0 ; break ; } case 14 : if ( ( ( i + 2 ) | 0 ) < u8ArrLen ) { read = ( read + 1 ) | 0 ; break ; } case 15 : if ( ( ( i + 3 ) | 0 ) < u8ArrLen ) { read = ( read + 1 ) | 0 ; break ; } default : break putChars ; } u8Arr [ i ] = char ; } } return { written : i , read : inputLength < read ? inputLength : read } ; } if ( ENCODEINTO_BUILD ) { TextEncoderPrototype [ "encodeInto" ] = polyfill_encodeInto ; } if ( ! GlobalTextEncoder ) { window [ "TextDecoder" ] = TextDecoder ; window [ "TextEncoder" ] = TextEncoder ; } else if ( ENCODEINTO_BUILD && ! ( globalTextEncoderPrototype = GlobalTextEncoder [ "prototype" ] ) [ "encodeInto" ] ) { globalTextEncoderInstance = new GlobalTextEncoder ( ) ; globalTextEncoderPrototype [ "encodeInto" ] = function ( string , u8arr ) { var strLen = string . length | 0 , u8Len = u8arr . length | 0 ; if ( strLen < u8Len >> 1 ) { var res8 = globalTextEncoderInstance [ "encode" ] ( string ) ; var res8Len = res8 . length | 0 ; if ( res8Len < u8Len ) { u8arr . set ( res8 ) ; return { read : strLen , written : res8 . length | 0 } ; } } return polyfill_encodeInto ( string , u8arr ) ; } ; } } ) ( typeof global == "" + void 0 ? ( typeof self == "" + void 0 ? this : self ) : global ) ; export { } ;