You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
848 KiB
JavaScript

var __BRYTHON__=__BRYTHON__||{};try{eval("async function* f(){}")}catch(err){console.warn("Your browser is not fully supported. If you are using "+"Microsoft Edge, please upgrade to the latest version")}(function($B){$B.isWebWorker="undefined"!==typeof WorkerGlobalScope&&"function"===typeof importScripts&&navigator instanceof WorkerNavigator;$B.isNode=typeof process!=="undefined"&&process.release.name==="node"&&process.__nwjs!==1;var _window;if($B.isNode){_window={location:{href:"",origin:"",pathname:""},navigator:{userLanguage:""}}}else{_window=self}var href=_window.location.href;$B.protocol=href.split(":")[0];$B.BigInt=_window.BigInt;$B.indexedDB=_window.indexedDB;var $path;if($B.brython_path===undefined){var this_url;if($B.isWebWorker){this_url=_window.location.href;if(this_url.startsWith("blob:")){this_url=this_url.substr(5)}}else{var scripts=document.getElementsByTagName("script");this_url=scripts[scripts.length-1].src}var elts=this_url.split("/");elts.pop();$path=$B.brython_path=elts.join("/")+"/"}else{if(!$B.brython_path.endsWith("/")){$B.brython_path+="/"}$path=$B.brython_path}var parts_re=new RegExp("(.*?)://(.*?)/(.*)"),mo=parts_re.exec($B.brython_path);if(mo){$B.full_url={protocol:mo[1],host:mo[2],address:mo[3]}}var path=_window.location.origin+_window.location.pathname,path_elts=path.split("/");path_elts.pop();var $script_dir=$B.script_dir=path_elts.join("/");$B.__ARGV=[];$B.webworkers={};$B.file_cache={};$B.url2name={};$B.$py_src={};$B.path=[$path+"Lib",$path+"libs",$script_dir,$path+"Lib/site-packages"];$B.async_enabled=false;if($B.async_enabled){$B.block={}}$B.imported={};$B.precompiled={};$B.frames_stack=[];$B.builtins=Object.create(null);$B.builtins_scope={id:"__builtins__",module:"__builtins__",binding:{}};$B.builtin_funcs={};$B.builtin_classes=[];$B.__getattr__=function(attr){return this[attr]};$B.__setattr__=function(attr,value){if(["debug","stdout","stderr"].indexOf(attr)>-1){$B[attr]=value}else{throw $B.builtins.AttributeError.$factory("__BRYTHON__ object has no attribute "+attr)}};$B.language=_window.navigator.userLanguage||_window.navigator.language;$B.locale="C";var date=new Date;var formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"short"}),short=formatter.format(date);formatter=new Intl.DateTimeFormat($B.language,{timeZoneName:"long"});var long=formatter.format(date);var ix=0,minlen=Math.min(short.length,long.length);while(ix<minlen&&short[ix]==long[ix]){ix++}$B.tz_name=long.substr(ix).trim();$B.PyCF_ONLY_AST=1024;if($B.isWebWorker){$B.charset="utf-8"}else{$B.charset=document.characterSet||document.inputEncoding||"utf-8"}$B.max_int=Math.pow(2,53)-1;$B.min_int=-$B.max_int;$B.max_float=new Number(Number.MAX_VALUE);$B.min_float=new Number(Number.MIN_VALUE);$B.max_array_size=2**32-1;$B.recursion_limit=200;$B.pep657=true;$B.special_string_repr={8:"\\x08",9:"\\t",10:"\\n",11:"\\x0b",12:"\\x0c",13:"\\r",92:"\\\\",160:"\\xa0"};$B.$py_next_hash=Math.pow(2,53)-1;$B.$py_UUID=0;$B.lambda_magic=Math.random().toString(36).substr(2,8);$B.set_func_names=function(klass,module){if(klass.$infos){var name=klass.$infos.__name__;klass.$infos.__module__=module;klass.$infos.__qualname__=name}else{var name=klass.__name__;klass.$infos={__name__:name,__module__:module,__qualname__:name}}klass.__module__=module;for(var attr in klass){if(typeof klass[attr]=="function"){klass[attr].$infos={__doc__:klass[attr].__doc__||"",__module__:module,__qualname__:name+"."+attr,__name__:attr};if(klass[attr].$type=="classmethod"){klass[attr].__class__=$B.method}}}};var has_storage=typeof Storage!=="undefined";if(has_storage){$B.has_local_storage=false;try{if(localStorage){$B.local_storage=localStorage;$B.has_local_storage=true}}catch(err){}$B.has_session_storage=false;try{if(sessionStorage){$B.session_storage=sessionStorage;$B.has_session_storage=true}}catch(err){}}else{$B.has_local_storage=false;$B.has_session_storage=false}$B.globals=function(){return $B.frames_stack[$B.frames_stack.length-1][3]};$B.scripts={};$B.$options={};$B.builtins_repr_check=function(builtin,args){var $=$B.args("__repr__",1,{self:null},["self"],args,{