define(["exports"],function(_exports){function checkContinuation(uint8array,start,checkLength){var array=uint8array;if(start+checkLength<array.length){for(;checkLength--;)if(128!=(192&array[++start]))return;return 1}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;_exports.default=function(uint8array){for(var out=[],input=uint8array,i=0,length=uint8array.length;i<length;){if(input[i]<128)out.push(String.fromCharCode(input[i]));else{if(!(input[i]<192))if(input[i]<224){if(checkContinuation(input,i,1)){var ucs4=(31&input[i])<<6|63&input[i+1];if(128<=ucs4){out.push(String.fromCharCode(65535&ucs4)),i+=2;continue}}}else if(input[i]<240){if(checkContinuation(input,i,2)){ucs4=(15&input[i])<<12|(63&input[i+1])<<6|63&input[i+2];if(2048<=ucs4&&55296!=(63488&ucs4)){out.push(String.fromCharCode(65535&ucs4)),i+=3;continue}}}else if(input[i]<248&&checkContinuation(input,i,3)){var _ucs2=(7&input[i])<<18|(63&input[i+1])<<12|(63&input[i+2])<<6|63&input[i+3];if(65536<_ucs2&&_ucs2<1114112){_ucs2-=65536,out.push(String.fromCharCode(_ucs2>>>10|55296)),out.push(String.fromCharCode(1023&_ucs2|56320)),i+=4;continue}}out.push(String.fromCharCode(65533))}++i}return out.join("")}});