7 lines
202 KiB
JavaScript
7 lines
202 KiB
JavaScript
|
(function(){(function(global,factory){if(typeof exports==="object"&&typeof module!=="undefined"){factory(module.exports)}else if(typeof define==="function"&&define.amd){define(factory)}else{factory(global)}})(this,function(exports){var Module={TOTAL_MEMORY:8*1024*1024,TOTAL_STACK:2*1024*1024,preRun:[],postRun:[],print:function(text){console.log(text)},printErr:function(text){text=Array.prototype.slice.call(arguments).join(" ");if(text.indexOf("pre-main prep time")>=0){return}console.error(text)}};var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}else{return scriptDirectory+path}}if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;ret=tryParseAsDataURI(filename);if(!ret){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename)}return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);Module["quit"]=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)}}Module["readBinary"]=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=function(status){quit(status)}}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}Module["read"]=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(dat
|
||
|
;memoryInitializer="data:application/oct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AECAwABAgMAAQABAAEAAQABAgMAAQIDAAECAwABAgMAAQIDAAECAwABAgMAAQIDAAECAwABAgMAAQIDAAECAwABAgMAAQIDAAECAwABAAEAAQIDAAEAAQABAAEAAABdBGUEbQR1BI0ElQSdBKUErQS1BLsEwwTLBNME2wTjBOkE8QT5BAEFBAUMBRQFHAUkBSwFKAUwBTgFQAVFBU0FVQVdBWEFaQVxBXkFgQWJBYUFjQWSBZoFoAWoBbAFuAXABcgF0AXYBd0F5QXoBfAF+AUABgYGDgYNBhUGHQYlBjUGLQY9BkUGfQRVBl0GTQZtBm8GdwZlBocGjQaVBn8GpQarBrMGnQbDBskG0Qa7BuEG5wbvBtkG/wYHBw8H9wYfByUHLQcXBz0HQwdLBzUHWwdgB2gHUwd4B38HhwdwBwkGjweXB30EnwenB68HfQS3B78HxwfMB9QH2wfjB30EyAXrB/MH+wcDCFUFEwgLCMgFyAXIBcgFyAXIBcgFyAXIBcgFGwjIBSMIJwgvCMgFNQjIBTsIQwhLCFUFVQVTCFsIyAXIBcgFyAXIBcgFyAXIBcgFyAXIBcgFyAXIBcgFyAXIBcgFYAhoCMgFyAVwCHgIgAiICJAIyAWYCKAIqAi4CMgFwAjCCMoIsAjIBc0I4QjVCN0I6QjIBfEI9wj/CAcJyAUXCR8JJwkPCX0EfQQ3CToJQgkvCVIJSgnIBVkJyAVoCWEJcAl4CXwJhAmMCf0ElAmXCZ0JpAmXCSQFrAmtBK0ErQStBLQJrQStBK0ExAnMCdQJ3AnkCegJ8Am8CQgKEAr4CQAKGAogCi
|
||
|
;var tempDoublePtr=71104;var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var adj=EXCEPTIONS.infos[ptr].adjusted;var len=adj.length;for(var i=0;i<len;i++){if(adj[i]===adjusted){return ptr}}}return adjusted},addRef:function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++},decRef:function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}},clearRef:function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0}};function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}throw ptr}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(setTempRet0(0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i<typeArray.length;i++){if(typeArray[i]&&Module["___cxa_can_catch"](typeArray[i],throwntype,thrown)){thrown=HEAP32[thrown>>2];info.adjusted.push(thrown);return(setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(setTempRet0(throwntype),thrown)|0}function ___gxx_personality_v0(){}function _emscripten_get_heap_size(){return HEAP8.length}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){try{var newBuffer=new ArrayBuffer(size);if(newBuffer.byteLength!=size)return false;new Int8Array(newBuffer).set(HEAP8)}catch(e){return false}buffer=newBuffer;Module["_emscripten_replace_memory"](newBuffer);return true}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=16777216;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT){return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize<requestedSize){if(newSize<=536870912){newSize=alignUp(2*newSize,PAGE_MULTIPLE)}else{newSize=Math.min(alignUp((3*newSize+2147483648)/4,PAGE_MULTIPLE),LIMIT)}}if(!emscripten_realloc_buffer(newSize)){return false}updateGlobalBufferViews();return true}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}var ASSERTIONS=false;function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){if(ASSERTIONS){}chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}var decodeBase64=typeof ato
|
||
|
function va(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var i=0;i=c[e+492>>2]|0;if(1<<(d[(c[(c[e>>2]|0)+72>>2]|0)+f>>0]|0)&7864320|0)return;b[e+496+(i<<4)+6>>1]=b[e+496+(i<<4)+4>>1]|0;a[e+496+(i<<4)+8>>0]=h;h=((h&127)>(g&127)?h:g)&1;a[e+496+(i<<4)+10>>0]=h;a[e+496+(i<<4)+9>>0]=h;c[e+496+(i<<4)+12>>2]=h&255;c[e+496+(i<<4)>>2]=f;return}function wa(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;g=d+492|0;h=c[g>>2]|0;f=d+496+(h<<4)|0;a[d+496+(h<<4)+10>>0]=10;d=b[d+496+(h<<4)+6>>1]|0;c[g>>2]=h+1;b[f+22>>1]=d;b[f+20>>1]=d;a[f+24>>0]=e;e=e&1;a[f+26>>0]=e;a[f+25>>0]=e;c[f+28>>2]=e&255;c[f+16>>2]=0;return}function xa(b){b=b|0;var d=0,e=0;e=b+492|0;d=(c[e>>2]|0)+-1|0;c[e>>2]=d;a[b+496+(d<<4)+10>>0]=10;return}function ya(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=c[d+492>>2]|0;q=d+484|0;m=c[q>>2]|0;j=a[d+496+(o<<4)+8>>0]&1;h=j&255;i=b[m+(f*24|0)+12>>1]|0;if(!(j<<24>>24))if(!(i&1))l=4;else{p=0;k=0}else if(!(i&2))l=4;else{p=1;k=0}do{if((l|0)==4){if(i&3){p=c[m+(f*24|0)+16>>2]|0;p=(p|0)==(h|0)?j:p&255;k=(e[d+496+(o<<4)+4>>1]|0|0)!=(f|0);break}b[d+496+(o<<4)+6>>1]=f;q=10;return q|0}}while(0);n=m+(f*24|0)|0;a[(c[(c[d>>2]|0)+72>>2]|0)+(c[n>>2]|0)>>0]=p;a[(c[(c[d>>2]|0)+72>>2]|0)+g>>0]=p;Aa(d,f,c[n>>2]|0,p);if(!k){i=d+496+(o<<4)+6|0;h=b[d+496+(o<<4)+4>>1]|0;j=f&65535;while(1){b[i>>1]=j;if((j&65535)<=(h&65535)){h=p;l=21;break}if((c[(c[q>>2]|0)+(((j&65535)+-1|0)*24|0)>>2]|0)==(c[n>>2]|0))j=j+-1<<16>>16;else{h=p;l=21;break}}if((l|0)==21)return h|0}c[m+(f*24|0)+4>>2]=0-g;j=d+496+(o<<4)+4|0;h=f;while(1){i=h+-1|0;if((h|0)<=(e[j>>1]|0|0))break;h=c[q>>2]|0;if((c[h+(i*24|0)>>2]|0)!=(c[n>>2]|0))break;c[h+(i*24|0)+4>>2]=0;h=i}i=d+496+(o<<4)+6|0;while(1){f=f+1|0;if((f|0)>=(e[i>>1]|0|0)){h=p;l=21;break}h=c[q>>2]|0;if((c[h+(f*24|0)>>2]|0)>=(g|0)){h=p;l=21;break}h=h+(f*24|0)+4|0;if((c[h>>2]|0)>0)c[h>>2]=0}if((l|0)==21)return h|0;return 0}function za(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=c[a+492>>2]|0;m=a+496+(l<<4)+6|0;g=e[m>>1]|0;k=a+488|0;if((c[k>>2]|0)>(g|0))h=c[a+484>>2]|0;else{j=c[a>>2]|0;i=j+52|0;j=j+28|0;if(!((aa(i,j,1,g*48|0)|0)<<24>>24)){m=0;return m|0}g=a+484|0;h=c[g>>2]|0;if((h|0)==(a+4|0))ec(c[i>>2]|0,h|0,480)|0;h=c[i>>2]|0;c[g>>2]=h;c[k>>2]=((c[j>>2]|0)>>>0)/24|0;g=e[m>>1]|0}c[h+(g*24|0)>>2]=f;c[h+(g*24|0)+4>>2]=d&65535;c[h+(g*24|0)+16>>2]=c[a+496+(l<<4)+12>>2];c[h+(g*24|0)+8>>2]=c[a+496+(l<<4)>>2];b[h+(g*24|0)+12>>1]=0;b[m>>1]=(b[m>>1]|0)+1<<16>>16;m=1;return m|0}function Aa(b,d,f,g){b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[(c[b>>2]|0)+72>>2]|0;h=d+1|0;i=g&255;j=b+496+(c[b+492>>2]<<4)+6|0;d=(c[b+484>>2]|0)+(h*24|0)|0;while(1){if((h|0)>=(e[j>>1]|0|0)){d=9;break}k=d+4|0;if((c[k>>2]|0)<=-1){if((c[d+8>>2]|0)>(f|0)){d=9;break}l=c[d>>2]|0;if((l|0)>(f|0)){if((c[d+16>>2]|0)==(i|0)){d=9;break}a[m+l>>0]=g;n=0-(c[k>>2]|0)|0;a[m+n>>0]=g;c[k>>2]=0;Aa(b,h,l,g);Aa(b,h,n,g)}}d=d+24|0;h=h+1|0}if((d|0)==9)return}function Ba(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0;h=c[a+96>>2]|0;i=c[a+100>>2]|0;g=0;b=10;while(1){if((g|0)>=(i|0))break;f=g+1|0;d=e[h+(g<<1)>>1]|0;if((f|0)==(i|0)|(d&64512|0)!=55296)g=f;else{k=e[h+(f<<1)>>1]|0;j=(k&64512|0)==56320;d=j?(d<<10)+-56613888+k|0:d;g=j?g+2|0:f}d=pa(a,d)|0;f=d&255;a:do{if(b<<24>>24==10){switch(f<<24>>24){case 13:case 1:case 0:break;default:{b=10;break a}}b=f}else b=(d&255|0)==7?10:b}while(0)}return b|0}function Ca(a){a=a|0;var b=0,d=0,e=0;d=c[a+132>>2]|0;e=a+136|0;b=c[e>>2]|0;if((b|0)!=(a+140|0)){b=a+56|0;if(!((aa(b,a+32|0,1,d<<4)|0)<<24>>24)){e=0;return e|0}c[e>>2]=c[b>>2];e=1;return e|0}if((d|0)<11){e=1;return e|0}d=a+56|0;if(!((aa(d,a+32|0,1,160)|0)<<24>>24)){e=0;return e|0}a=c[d>>2]|0;c[e>>2]=a;d=a+80|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0}while((a|0)<(d|0));e=1;return e|0}function Da(a){a=a|0;var b=0;do{if(!a)a=0;else{b=c[a>>2]|0;if((b|0)!=(a|0)){if(!b){a=0;break}if((c[b>>2]|0)!=(b|0)){a=0;break}}a=c[a+12>>2]|0}}while(0);return a|0}function Ea(a){a=a|0;var b=0;do{if(!a)a=0;else{b=c[a>>2]|0;if((b|0)!=(a|0)){if(!b){a=0;break}if((c[b>>2]|0)!=(b|0)){a=0;break}}a=c[a+132>>2]|0}}while(0);return a|0}function Fa(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if(!e)return;if(($(c[e>>2]
|
||
|
;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){b=0;break}}while(1){f=b+20|0;d=c[f>>2]|0;if(!d){f=b+16|0;d=c[f>>2]|0;if(!d)break;else{b=d;a=f}}else{b=d;a=f}}c[a>>2]=0}else{s=c[i+8>>2]|0;c[s+12>>2]=b;c[b+8>>2]=s}}while(0);do{if(g){a=c[i+28>>2]|0;d=70680+(a<<2)|0;if((i|0)==(c[d>>2]|0)){c[d>>2]=b;if(!b){e=e&~(1<<a);c[17595]=e;break}}else{s=g+16|0;c[((c[s>>2]|0)==(i|0)?s:g+20|0)>>2]=b;if(!b)break}c[b+24>>2]=g;a=c[i+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b}a=c[i+20>>2]|0;if(a){c[b+20>>2]=a;c[a+24>>2]=b}}}while(0);b:do{if(h>>>0<16){s=h+k|0;c[i+4>>2]=s|3;s=i+s+4|0;c[s>>2]=c[s>>2]|1}else{c[i+4>>2]=k|3;c[l+4>>2]=h|1;c[l+h>>2]=h;b=h>>>3;if(h>>>0<256){d=70416+(b<<1<<2)|0;a=c[17594]|0;b=1<<b;if(!(a&b)){c[17594]=a|b;b=d;a=d+8|0}else{a=d+8|0;b=c[a>>2]|0}c[a>>2]=l;c[b+12>>2]=l;c[l+8>>2]=b;c[l+12>>2]=d;break}b=h>>>8;if(b)if(h>>>0>16777215)d=31;else{r=(b+1048320|0)>>>16&8;s=b<<r;q=(s+520192|0)>>>16&4;s=s<<q;d=(s+245760|0)>>>16&2;d=14-(q|r|d)+(s<<d>>>15)|0;d=h>>>(d+7|0)&1|d<<1}else d=0;b=70680+(d<<2)|0;c[l+28>>2]=d;a=l+16|0;c[a+4>>2]=0;c[a>>2]=0;a=1<<d;if(!(a&e)){c[17595]=a|e;c[b>>2]=l;c[l+24>>2]=b;c[l+12>>2]=l;c[l+8>>2]=l;break}b=c[b>>2]|0;c:do{if((c[b+4>>2]&-8|0)!=(h|0)){e=h<<((d|0)==31?0:25-(d>>>1)|0);while(1){d=b+16+(e>>>31<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(h|0)){b=a;break c}else{e=e<<1;b=a}}c[d>>2]=l;c[l+24>>2]=b;c[l+12>>2]=l;c[l+8>>2]=l;break b}}while(0);r=b+8|0;s=c[r>>2]|0;c[s+12>>2]=l;c[r>>2]=l;c[l+8>>2]=s;c[l+12>>2]=b;c[l+24>>2]=0}}while(0);s=i+8|0;E=t;return s|0}else m=k}else m=k}else m=-1}while(0);d=c[17596]|0;if(d>>>0>=m>>>0){b=d-m|0;a=c[17599]|0;if(b>>>0>15){s=a+m|0;c[17599]=s;c[17596]=b;c[s+4>>2]=b|1;c[a+d>>2]=b;c[a+4>>2]=m|3}else{c[17596]=0;c[17599]=0;c[a+4>>2]=d|3;s=a+d+4|0;c[s>>2]=c[s>>2]|1}s=a+8|0;E=t;return s|0}h=c[17597]|0;if(h>>>0>m>>>0){q=h-m|0;c[17597]=q;s=c[17600]|0;r=s+m|0;c[17600]=r;c[r+4>>2]=q|1;c[s+4>>2]=m|3;s=s+8|0;E=t;return s|0}if(!(c[17712]|0)){c[17714]=4096;c[17713]=4096;c[17715]=-1;c[17716]=-1;c[17717]=0;c[17705]=0;c[17712]=n&-16^1431655768;a=4096}else a=c[17714]|0;i=m+48|0;j=m+47|0;g=a+j|0;f=0-a|0;k=g&f;if(k>>>0<=m>>>0){s=0;E=t;return s|0}a=c[17704]|0;if(a|0?(l=c[17702]|0,n=l+k|0,n>>>0<=l>>>0|n>>>0>a>>>0):0){s=0;E=t;return s|0}d:do{if(!(c[17705]&4)){e=c[17600]|0;e:do{if(e){a=70824;while(1){d=c[a>>2]|0;if(d>>>0<=e>>>0?(q=a+4|0,(d+(c[q>>2]|0)|0)>>>0>e>>>0):0)break;a=c[a+8>>2]|0;if(!a){r=128;break e}}b=g-h&f;if(b>>>0<2147483647){e=gc(b|0)|0;if((e|0)==((c[a>>2]|0)+(c[q>>2]|0)|0)){if((e|0)!=(-1|0))break d}else r=136}else b=0}else r=128}while(0);do{if((r|0)==128){a=gc(0)|0;if((a|0)!=(-1|0)?(b=a,o=c[17713]|0,p=o+-1|0,b=((p&b|0)==0?0:(p+b&0-o)-b|0)+k|0,o=c[17702]|0,p=b+o|0,b>>>0>m>>>0&b>>>0<2147483647):0){q=c[17704]|0;if(q|0?p>>>0<=o>>>0|p>>>0>q>>>0:0){b=0;break}e=gc(b|0)|0;if((e|0)==(a|0)){e=a;break d}else r=136}else b=0}}while(0);do{if((r|0)==136){d=0-b|0;if(!(i>>>0>b>>>0&(b>>>0<2147483647&(e|0)!=(-1|0))))if((e|0)==(-1|0)){b=0;break}else break d;a=c[17714]|0;a=j-b+a&0-a;if(a>>>0>=2147483647)break d;if((gc(a|0)|0)==(-1|0)){gc(d|0)|0;b=0;break}else{b=a+b|0;break d}}}while(0);c[17705]=c[17705]|4;r=143}else{b=0;r=143}}while(0);if((r|0)==143){if(k>>>0>=2147483647){s=0;E=t;return s|0}e=gc(k|0)|0;q=gc(0)|0;a=q-e|0;d=a>>>0>(m+40|0)>>>0;if((e|0)==(-1|0)|d^1|e>>>0<q>>>0&((e|0)!=(-1|0)&(q|0)!=(-1|0))^1){s=0;E=t;return s|0}else b=d?a:b}a=(c[17702]|0)+b|0;c[17702]=a;if(a>>>0>(c[17703]|0)>>>0)c[17703]=a;j=c[17600]|0;f:do{if(j){a=70824;while(1){d=c[a>>2]|0;f=a+4|0;g=c[f>>2]|0;if((e|0)==(d+g|0)){r=154;break}h=c[a+8>>2]|0;if(!h)break;else a=h}if(((r|0)==154?(c[a+12>>2]&8|0)==0:0)?e>>>0>j>>>0&d>>>0<=j>>>0:0){c[f>>2]=g+b;s=(c[17597]|0)+b|0;q=j+8|0;q=(q&7|0)==0?0:0-q&7;r=j+q|0;q=s-q|0;c[17600]=r;c[17597]=q;c[r+4>>2]=q|1;c[j+s+4>>2]=40;c[17601]=c[17716];break}if(e>>>0<(c[17598]|0)>>>0)c[17598]=e;f=e+b|0;a=70824;while(1){if((c[a>>2]|0)==(f|0)){r=162;break}d=c[a+8>>2]|0;if(!d)break;else a=d}if((r|0)==162?(c[a+12>>2]&8|0)==0:0){c[a>>2]=e;l=a+4|0;c[l>>2]=(c[l>>2]|0)+b;l=e+8|0;l=e+((l&7|0)==0?0:0-l&7)|0;b=f+8|0;b=f+((b&7|0)==0?0:0-b&7)|0;k=l+m|0;i=b-l-m|0;c[l+4>>2]=m|3;g:do{if((j|0)==(b|0)){s=(c[17597]|0)+i|0;c[17597]=s;c[1760
|
||
|
;for(var i=0,list=mergedParagraphLineBreakPoints;i<list.length;i+=1){var lineBreakPoint=list[i];var returnStringPtr=Module.ccall("bidi_getLine","number",["number","number"],[lineStartIndex,lineBreakPoint]);if(returnStringPtr===0){Module._free(stringInputPtr);return[]}lines.push(Module.UTF16ToString(returnStringPtr));Module._free(returnStringPtr);lineStartIndex=lineBreakPoint}Module._free(stringInputPtr);return lines}function createInt32Ptr(){return Module._malloc(4)}function consumeInt32Ptr(ptr){var heapView=new Int32Array(Module.HEAPU8.buffer,ptr,1);var result=heapView[0];Module._free(ptr);return result}function writeReverse(stringInputPtr,logicalStart,logicalEnd){var returnStringPtr=Module.ccall("bidi_writeReverse","number",["number","number","number"],[stringInputPtr,logicalStart,logicalEnd-logicalStart]);if(returnStringPtr===0){return null}var reversed=Module.UTF16ToString(returnStringPtr);Module._free(returnStringPtr);return reversed}function processStyledBidirectionalText(text,styleIndices,lineBreakPoints){var nDataBytes=(text.length+1)*2;var stringInputPtr=Module._malloc(nDataBytes);var paragraphCount=setParagraph(text,stringInputPtr,nDataBytes);if(!paragraphCount){return[{text:text,styleIndices:styleIndices}]}var mergedParagraphLineBreakPoints=mergeParagraphLineBreakPoints(lineBreakPoints,paragraphCount);var lineStartIndex=0;var lines=[];for(var i$1=0,list=mergedParagraphLineBreakPoints;i$1<list.length;i$1+=1){var lineBreakPoint=list[i$1];var lineText="";var lineStyleIndices=[];var runCount=Module.ccall("bidi_setLine","number",["number","number"],[lineStartIndex,lineBreakPoint]);if(!runCount){Module._free(stringInputPtr);return[]}for(var i=0;i<runCount;i++){var logicalStartPtr=createInt32Ptr();var logicalLengthPtr=createInt32Ptr();var isReversed=Module.ccall("bidi_getVisualRun","number",["number","number","number"],[i,logicalStartPtr,logicalLengthPtr]);var logicalStart=lineStartIndex+consumeInt32Ptr(logicalStartPtr);var logicalLength=consumeInt32Ptr(logicalLengthPtr);var logicalEnd=logicalStart+logicalLength;if(isReversed){var styleRunStart=logicalEnd;var currentStyleIndex=styleIndices[styleRunStart-1];for(var j=logicalEnd-1;j>=logicalStart;j--){if(currentStyleIndex!==styleIndices[j]||j===logicalStart){var styleRunEnd=j===logicalStart?j:j+1;var reversed=writeReverse(stringInputPtr,styleRunEnd,styleRunStart);if(!reversed){Module._free(stringInputPtr);return[]}lineText+=reversed;for(var k=0;k<reversed.length;k++){lineStyleIndices.push(currentStyleIndex)}currentStyleIndex=styleIndices[j];styleRunStart=styleRunEnd}}}else{lineText+=text.substring(logicalStart,logicalEnd);lineStyleIndices=lineStyleIndices.concat(styleIndices.slice(logicalStart,logicalEnd))}}lines.push([lineText,lineStyleIndices]);lineStartIndex=lineBreakPoint}Module._free(stringInputPtr);return lines}self.registerRTLTextPlugin({applyArabicShaping:applyArabicShaping,processBidirectionalText:processBidirectionalText,processStyledBidirectionalText:processStyledBidirectionalText})})})();
|