From 1fe7e70158a6467204d46101fd568279e793b3a1 Mon Sep 17 00:00:00 2001 From: Gabor Bata Date: Thu, 11 Mar 2021 11:06:46 +0100 Subject: [PATCH] Fixed processing repl command --- README.md | 16 +- bin/todo.rb | 2 +- node/README.md | 55 ++ node/package.json | 34 +- node/todo.js | 1434 +++++++++++++++++++++++---------------------- node/todo.js.rb | 57 +- todo.gemspec | 4 +- web/app.js | 2 +- web/app.js.rb | 2 +- web/todo.js.rb | 6 +- 10 files changed, 871 insertions(+), 741 deletions(-) create mode 100644 node/README.md diff --git a/README.md b/README.md index b910296..ae9844b 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,21 @@ new [ ], done [x], started [>], blocked [!], priority * gem install todo-jsonl ``` +## Requirements + +Ruby 2.5 or newer, or JRuby + ## Demo -Web: [todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage -(created with [opal](https://github.com/opal/opal) and [vanilla-terminal](https://github.com/soyjavi/vanilla-terminal)) +[todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage Screencast: -![todo](todo.gif) +![todo](https://raw.githubusercontent.com/gaborbata/todo/master/todo.gif) -## Requirements +## Other versions -Ruby 2.5 or newer, or JRuby +* [todo for Node.js](https://github.com/gaborbata/todo/tree/master/node) + compiled with [Opal](https://github.com/opal/opal) +* [todo for web](http://gaborbata.github.io/todo/) using browser local storage, + created with [Opal](https://github.com/opal/opal) and [Vanilla Terminal](https://github.com/soyjavi/vanilla-terminal) diff --git a/bin/todo.rb b/bin/todo.rb index 7f3fc7e..6e52ffb 100644 --- a/bin/todo.rb +++ b/bin/todo.rb @@ -359,7 +359,7 @@ def start_repl execute(command == 'repl' ? [] : command.split(/\s+/)) end print "\ntodo> " - command = STDIN.gets.chomp + command = STDIN.gets.chomp.strip end end diff --git a/node/README.md b/node/README.md new file mode 100644 index 0000000..8473693 --- /dev/null +++ b/node/README.md @@ -0,0 +1,55 @@ +# todo for Node.js + +todo list manager inspired by [todo.txt](http://todotxt.org) using the [jsonl](http://jsonlines.org) format + +The Node.js version is compiled with [Opal](https://github.com/opal/opal) from the original [todo](https://github.com/gaborbata/todo) Ruby script, +with some JavaScript-specific modifications, optimized with [Closure Compiler](https://github.com/google/closure-compiler) + +``` +Usage: todo + +Commands: +* add add new task +* start [text] mark task as started, with optional note +* done [text] mark task as completed, with optional note +* block [text] mark task as blocked, with optional note +* reset [text] reset task to new state, with optional note +* prio [text] toggle high priority flag, with optional note +* due [date] set/unset due date (in YYYY-MM-DD format) + +* append append text to task title +* rename rename task +* del delete task +* note add note to task +* delnote delete all notes from task + +* list [regex...] list tasks (only active tasks by default) +* show show all task details +* repl enter read-eval-print loop mode +* cleanup [regex...] cleanup completed tasks by regex +* help this help screen + +With list command the following pre-defined regex patterns can be also used: +:active, :done, :blocked, :started, :new, :all, :today, :tomorrow, :next7days + +Due dates can be also added via tags in task title: "due:YYYY-MM-DD" + +Legend: +new [ ], done [x], started [>], blocked [!], priority * +``` + +`todo.jsonl` file stores the todo data which is saved into the `$HOME` folder of the current user. + +## How to install + +``` +npm install -g todo-jsonl +``` + +## Demo + +[todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage + +Screencast: + +![todo](https://raw.githubusercontent.com/gaborbata/todo/master/todo.gif) diff --git a/node/package.json b/node/package.json index 17f9aba..6da1d8a 100644 --- a/node/package.json +++ b/node/package.json @@ -1,14 +1,40 @@ { "name": "todo-jsonl", - "version": "0.1.29", + "version": "0.1.30", "description": "todo list manager inspired by todo.txt using the jsonl format", + "main": "todo.js", + "bin": { + "todo": "todo.js" + }, "scripts": { "start": "node todo.js", - "build": "npm run compile && npm run optimize && mv todo.min.js todo.js", + "todo": "node todo.js", + "build": "npm run compile && npm run optimize && echo #!/usr/bin/env node > todo.js && cat todo.min.js >> todo.js && rm todo.min.js", "compile": "opal --require date --require json --compile todo.js.rb | grep -v \"//# sourceMappingURL\" > todo.js", - "optimize": "java -jar closure-compiler.jar --isolation_mode IIFE --warning_level QUIET --js todo.js --js_output_file todo.min.js" + "optimize": "java -jar closure-compiler.jar --isolation_mode IIFE --warning_level QUIET --js todo.js --js_output_file todo.min.js", + "test": "echo \"no test specified\" && exit 0" + }, + "engines": { + "node": ">=8.10.0" }, + "keywords": [ + "cli", + "todo", + "command-line", + "manager", + "todolist", + "todotxt", + "todoapp", + "jsonlines", + "jsonl", + "ruby", + "opal" + ], "author": "Gabor Bata", "license": "MIT", - "repository": "github:gaborbata/todo" + "homepage": "https://github.com/gaborbata/todo", + "repository": { + "type": "git", + "url": "https://github.com/gaborbata/todo.git" + } } diff --git a/node/todo.js b/node/todo.js index 778da38..192d173 100644 --- a/node/todo.js +++ b/node/todo.js @@ -1,743 +1,747 @@ -(function(){var cb=cb||{};cb.scope={};cb.ASSUME_ES5=!1;cb.ASSUME_NO_NATIVE_MAP=!1;cb.ASSUME_NO_NATIVE_SET=!1;cb.SIMPLE_FROUND_POLYFILL=!1;cb.ISOLATE_POLYFILLS=!1;cb.FORCE_POLYFILL_PROMISE=!1;cb.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;cb.defineProperty=cb.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,y,K){if(a==Array.prototype||a==Object.prototype)return a;a[y]=K.value;return a}; -cb.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var y=0;yw||56319y||57343w||56319y||57343J&&(J=Math.max(J+w,0));J $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(G,x){G=p(G,"Opal");var k=[G].concat(x),m,u,c,l,H,e,n,J,D,R,ia;a.defs(G,"$bridge",m=function(ea,ma){return a.bridge(ea,ma)},m.$$arity=2);a.defs(G,"$coerce_to!",u=function(ea,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);f=A(ea,ma,b,f);d(ma["$==="](f))|| -this.$raise(w(ea,ma,b,f));return f},u.$$arity=-4);a.defs(G,"$coerce_to?",c=function(ea,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);if(!d(ea["$respond_to?"](b)))return K;f=A(ea,ma,b,f);if(d(f["$nil?"]()))return K;d(ma["$==="](f))||this.$raise(w(ea,ma,b,f));return f},c.$$arity=-4);a.defs(G,"$try_convert",l=function(ea,ma,b){return d(ma["$==="](ea))?ea:d(ea["$respond_to?"](b))?ea.$__send__(b):K},l.$$arity=3);a.defs(G,"$compare",H=function(ea,ma){var b=ea["$<=>"](ma);d(b===K)&&this.$raise(t(k, -"ArgumentError"),"comparison of "+ea.$class()+" with "+ma.$class()+" failed");return b},H.$$arity=2);a.defs(G,"$destructure",e=function(ea){if(1==ea.length)return ea[0];if(ea.$$is_array)return ea;for(var ma=Array(ea.length),b=0,h=ma.length;bea.length||"@@"!==ea.slice(0,2))&&this.$raise(t(k,"NameError").$new("`"+ea+"' is not allowed as a class variable name",ea));return ea},D.$$arity=1);a.defs(G,"$const_name!",R=function(ea){ea=t(k,"Opal")["$coerce_to!"](ea, -t(k,"String"),"to_str");d(ea["$[]"](0)["$!="](ea["$[]"](0).$upcase()))&&this.$raise(t(k,"NameError"),"wrong constant name "+ea);return ea},R.$$arity=1);a.defs(G,"$pristine",ia=function(ea,ma){var b=a.slice.call(arguments,1,arguments.length);for(var h,f=b.length-1;0<=f;f--)h=b[f],(h=ea.$$prototype["$"+h])&&!h.$$stub&&(h.$$pristine=!0);return K},ia.$$arity=-2)}(y[0],y)}; -Opal.modules["corelib/module"]=function(a){function y(l,H){return"number"===typeof l&&"number"===typeof H?l $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); -return function(l,$super,e){l=G(l,$super,"Module");var n=[l].concat(e),J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb,W,ya,Da,Va,ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T,fa,ka;a.defs(l,"$allocate",J=function(){var g=a.allocate_module(t,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},J.$$arity=0);a.def(l,"$initialize",D=function(){var g=D.$$p,C=g||t;g&&(D.$$p=null);g&&(D.$$p=null);return C!==t?x(this,"module_eval", -[],C.$to_proc()):t},D.$$arity=0);a.def(l,"$===",R=function(g){return p(null==g)?!1:a.is_a(g,this)},R.$$arity=1);a.def(l,"$<",ia=function(g){p(A(n,"Module")["$==="](g))||this.$raise(A(n,"TypeError"),"compared with non class/module");var C;if(this===g)return!1;var M=0;var ba=a.ancestors(this);for(C=ba.length;M",ma=function(g){p(A(n,"Module")["$==="](g))||this.$raise(A(n,"TypeError"),"compared with non class/module");return y(g,this)},ma.$$arity=1);a.def(l,"$>=",b=function(g){var C;return p(C=this["$equal?"](g))?C:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(l,"$<=>",h=function(g){if(this===g)return 0;if(!p(A(n,"Module")["$==="](g)))return t;g=y(this,g);return p(g["$nil?"]())?t:p(g)?-1:1},h.$$arity=1);a.def(l,"$alias_method",f= -function(g,C){g=d(g,A(n,"String"),"to_str");C=d(C,A(n,"String"),"to_str");a.alias(this,g,C);return this},f.$$arity=2);a.def(l,"$alias_native",q=function(g,C){null==C&&(C=g);a.alias_native(this,g,C);return this},q.$$arity=-2);a.def(l,"$ancestors",z=function(){return a.ancestors(this)},z.$$arity=0);a.def(l,"$append_features",E=function(g){a.append_features(this,g);return this},E.$$arity=1);a.def(l,"$attr_accessor",F=function(g){var C=a.slice.call(arguments,0,arguments.length);x(this,"attr_reader",a.to_a(C)); -return x(this,"attr_writer",a.to_a(C))},F.$$arity=-1);a.def(l,"$attr",L=function(g){var C=a.slice.call(arguments,0,arguments.length);return 2!=C.length||!0!==C[1]&&!1!==C[1]?x(this,"attr_reader",a.to_a(C)):(this.$warn("optional boolean argument is obsoleted",k(["uplevel"],{uplevel:1})),C[1]?this.$attr_accessor(C[0]):this.$attr_reader(C[0]),t)},L.$$arity=-1);a.def(l,"$attr_reader",ca=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ba=C.length-1;0<=ba;ba--){var v= -C[ba],U="$"+v;v=a.ivar(v);var qa=function(Ja){return function(){return null==this[Ja]?t:this[Ja]}}(v);a.defineProperty(M,v,t);qa.$$parameters=[];qa.$$arity=0;a.defn(this,U,qa)}return t},ca.$$arity=-1);a.def(l,"$attr_writer",va=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var M=this.$$prototype,ba=C.length-1;0<=ba;ba--){var v=C[ba],U="$"+v+"=";v=a.ivar(v);var qa=function(Ja){return function(jb){return this[Ja]=jb}}(v);qa.$$parameters=[["req"]];qa.$$arity=1;a.defineProperty(M,v, -t);a.defn(this,U,qa)}return t},va.$$arity=-1);a.def(l,"$autoload",Oa=function(g,C){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=C;return t},Oa.$$arity=2);a.def(l,"$class_variables",wa=function(){return Object.keys(a.class_variables(this))},wa.$$arity=0);a.def(l,"$class_variable_get",Ba=function(g){g=A(n,"Opal")["$class_variable_name!"](g);var C=a.class_variables(this)[g];null==C&&this.$raise(A(n,"NameError").$new("uninitialized class variable "+g+" in "+this, -g));return C},Ba.$$arity=1);a.def(l,"$class_variable_set",Ka=function(g,C){g=A(n,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,C)},Ka.$$arity=2);a.def(l,"$class_variable_defined?",na=function(g){g=A(n,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(l,"$remove_class_variable",S=function(g){g=A(n,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var C=this.$$cvars[g];delete this.$$cvars[g]; -return C}this.$raise(A(n,"NameError"),"cannot remove "+g+" for "+this)},S.$$arity=1);a.def(l,"$constants",ta=function(g){null==g&&(g=!0);return a.constants(this,g)},ta.$$arity=-1);a.defs(l,"$constants",ja=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var C,M={},ba;var v=0;for(ba=g.length;v"},Z.$$arity=0);a.def(l,"$undef_method",P=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var M=0,ba=C.length;M":D?"#>":d(this,a.find_super_dispatcher(this,"to_s",J,!1,!0),"to_s",[],null)},J.$$arity=0),t)&&"to_s"}(K[0],null,K)}; -Opal.modules["corelib/basic_object"]=function(a){var y=[],K=a.nil,t=a.$$$,w=a.klass,A=a.truthy,p=a.range,d=a.hash2,G=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(x,$super,m){x=w(x,$super,"BasicObject");[x].concat(m);var u,c,l,H,e,n,J,D,R,ia,ea,ma,b,h;a.def(x,"$initialize",u=function(f){a.slice.call(arguments,0,arguments.length);return K},u.$$arity=-1);a.def(x,"$==",c=function(f){return this===f},c.$$arity=1);a.def(x,"$eql?", -l=function(f){return this["$=="](f)},l.$$arity=1);a.alias(x,"equal?","==");a.def(x,"$__id__",H=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},H.$$arity=0);a.def(x,"$__send__",e=function(f,q){var z=e.$$p,E=z||K;z&&(e.$$p=null);z&&(e.$$p=null);z=a.slice.call(arguments,1,arguments.length);var F=this["$"+f];if(F)return E!==K&&(F.$$p=E),F.apply(this,z);E!==K&&(this.$method_missing.$$p=E);return this.$method_missing.apply(this,[f].concat(z))},e.$$arity= --2);a.def(x,"$!",n=function(){return!1},n.$$arity=0);a.def(x,"$!=",J=function(f){return this["$=="](f)["$!"]()},J.$$arity=1);a.def(x,"$instance_eval",D=function(f){var q=D.$$p,z=q||K,E,F,L=K,ca=E=K,va=ca=K,Oa=ca=K;q&&(D.$$p=null);q&&(D.$$p=null);E=a.slice.call(arguments,0,arguments.length);A(A(L=z["$nil?"]())?!!a.compile:L)?(A(p(1,3,!1)["$cover?"](E.$size()))||t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),z=[].concat(a.to_a(E)),E=null==z[0]?K:z[0],ca=null== -z[1]?K:z[1],z,ca=d(["file","eval"],{file:A(va=ca)?va:"(eval)",eval:!0}),ca=a.hash({arity_check:!1}).$merge(ca),Oa=t("::","Opal").$compile(E,ca),z=G(t("::","Kernel"),"proc",[],(F=function(){return function(){return eval(Oa)}(null==F.$$s?this:F.$$s)},F.$$s=this,F.$$arity=0,F))):A(E["$any?"]())&&t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments ("+E.$size()+" for 0)");va=z.$$s;z.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var wa=z.call(this,this)}finally{this.$$eval=!1}}else wa= -z.call(this,this);z.$$s=va;return wa},D.$$arity=-1);a.def(x,"$instance_exec",R=function(f){var q=R.$$p,z=q||K;q&&(R.$$p=null);q&&(R.$$p=null);q=a.slice.call(arguments,0,arguments.length);A(z)||t("::","Kernel").$raise(t("::","ArgumentError"),"no block given");var E=z.$$s;z.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var F=z.apply(this,q)}finally{this.$$eval=!1}}else F=z.apply(this,q);z.$$s=E;return F},R.$$arity=-1);a.def(x,"$singleton_method_added",ia=function(f){a.slice.call(arguments,0,arguments.length); -return K},ia.$$arity=-1);a.def(x,"$singleton_method_removed",ea=function(f){a.slice.call(arguments,0,arguments.length);return K},ea.$$arity=-1);a.def(x,"$singleton_method_undefined",ma=function(f){a.slice.call(arguments,0,arguments.length);return K},ma.$$arity=-1);a.def(x,"$method_missing",b=function(f,q){var z=b.$$p;z&&(b.$$p=null);z&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);z=A(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: -"undefined method `"+f+"' for "+this.$$class;return t("::","Kernel").$raise(t("::","NoMethodError").$new(z,f))},b.$$arity=-2);return(a.def(x,"$respond_to_missing?",h=function(){return!1},h.$$arity=-2),K)&&"respond_to_missing?"}(y[0],null,y)}; -Opal.modules["corelib/kernel"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c<=l:c["$<="](l)}var K=[],t=a.nil,w=a.$$$,A=a.$$,p=a.truthy,d=a.coerce_to,G=a.module,x=a.gvars,k=a.hash2,m=a.send,u=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, -l){c=G(c,"Kernel");var H=[c].concat(l),e,n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb,W,ya,Da,Va,ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T,fa,ka,g,C,M,ba;a.def(c,"$method_missing",e=function(v,U){var qa=e.$$p;qa&&(e.$$p=null);qa&&(e.$$p=null);qa=a.slice.call(arguments,1,arguments.length);return this.$raise(A(H,"NoMethodError").$new("undefined method `"+v+"' for "+this.$inspect(),v,qa))},e.$$arity=-2);a.def(c,"$=~",n=function(){return!1},n.$$arity= -1);a.def(c,"$!~",J=function(v){return this["$=~"](v)["$!"]()},J.$$arity=1);a.def(c,"$===",D=function(v){var U;return p(U=this.$object_id()["$=="](v.$object_id()))?U:this["$=="](v)},D.$$arity=1);a.def(c,"$<=>",R=function(v){this.$$comparable=!0;return(v=this["$=="](v))&&v!==t?0:t},R.$$arity=1);a.def(c,"$method",ia=function(v){var U=this["$"+v];U&&!U.$$stub||this.$raise(A(H,"NameError").$new("undefined method `"+v+"' for class `"+this.$class()+"'",v));return A(H,"Method").$new(this,U.$$owner||this.$class(), -U,v)},ia.$$arity=1);a.def(c,"$methods",ea=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.own_methods(this)},ea.$$arity=-1);a.def(c,"$public_methods",ma=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.receiver_methods(this)},ma.$$arity=-1);a.def(c,"$Array",b=function(v){if(v===t)return[];if(v.$$is_array)return v;var U=A(H,"Opal")["$coerce_to?"](v,A(H,"Array"),"to_ary");if(U!==t)return U;U=A(H,"Opal")["$coerce_to?"](v,A(H,"Array"),"to_a");return U!==t?U:[v]},b.$$arity=1);a.def(c, -"$at_exit",h=function(){var v=h.$$p,U=v||t,qa=t;null==x.__at_exit__&&(x.__at_exit__=t);v&&(h.$$p=null);v&&(h.$$p=null);x.__at_exit__=p(qa=x.__at_exit__)?qa:[];x.__at_exit__["$<<"](U);return U},h.$$arity=0);a.def(c,"$caller",f=function(v,U){null==U&&(U=t);v=(Error().stack||"").split("\n");var qa=[];for(var Ja=3,jb=v.length;JaU||36=U?U-1:"9a-"+String.fromCharCode(97+(U-11)));(new RegExp("^\\s*[+-]?["+jb+"]+\\s*$")).test(Ja)||qa.$raise(A(H,"ArgumentError"),'invalid value for Integer(): "'+v+'"');Ja=parseInt(Ja,U);isNaN(Ja)&&qa.$raise(A(H,"ArgumentError"),'invalid value for Integer(): "'+ -v+'"');return Ja},la.$$arity=-2);a.def(c,"$Float",xa=function(v){v===t&&this.$raise(A(H,"TypeError"),"can't convert nil into Float");if(v.$$is_string){var U=v.toString();U=U.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(U))return this.$Integer(U);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(U)||this.$raise(A(H,"ArgumentError"),'invalid value for Float(): "'+v+'"');return parseFloat(U)}return A(H,"Opal")["$coerce_to!"](v,A(H,"Float"),"to_f")},xa.$$arity=1);a.def(c, -"$Hash",Ea=function(v){var U=t;return p(p(U=v["$nil?"]())?U:v["$=="]([]))?k([],{}):p(A(H,"Hash")["$==="](v))?v:A(H,"Opal")["$coerce_to!"](v,A(H,"Hash"),"to_hash")},Ea.$$arity=1);a.def(c,"$is_a?",Fa=function(v){v.$$is_class||v.$$is_module||this.$raise(A(H,"TypeError"),"class or module required");return a.is_a(this,v)},Fa.$$arity=1);a.def(c,"$itself",Sa=function(){return this},Sa.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Ra=function(){var v=Ra.$$p,U=v||t;v&&(Ra.$$p=null);v&&(Ra.$$p= -null);return a.lambda(U)},Ra.$$arity=0);a.def(c,"$load",Na=function(v){v=A(H,"Opal")["$coerce_to!"](v,A(H,"String"),"to_str");return a.load(v)},Na.$$arity=1);a.def(c,"$loop",Qa=function(){var v,U=Qa.$$p,qa=U||t,Ja=t;U&&(Qa.$$p=null);if(qa===t)return m(this,"enum_for",["loop"],(v=function(){return w(A(H,"Float"),"INFINITY")},v.$$s=this,v.$$arity=0,v));for(;p(!0);)try{a.yieldX(qa,[])}catch(jb){if(a.rescue(jb,[A(H,"StopIteration")])){Ja=jb;try{return Ja.$result()}finally{a.pop_exception()}}else throw jb; -}return this},Qa.$$arity=0);a.def(c,"$nil?",lb=function(){return!1},lb.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",W=function(v){var U=a.slice.call(arguments,0,arguments.length);p(U["$any?"]())&&this.$print(m(this,"format",a.to_a(U)));return t},W.$$arity=-1);a.def(c,"$proc",ya=function(){var v=ya.$$p,U=v||t;v&&(ya.$$p=null);v&&(ya.$$p=null);p(U)||this.$raise(A(H,"ArgumentError"),"tried to create Proc object without a block");U.$$is_lambda=!1;return U},ya.$$arity=0);a.def(c,"$puts", -Da=function(v){null==x.stdout&&(x.stdout=t);var U=a.slice.call(arguments,0,arguments.length);return m(x.stdout,"puts",a.to_a(U))},Da.$$arity=-1);a.def(c,"$p",Va=function(v){var U;var qa=a.slice.call(arguments,0,arguments.length);m(qa,"each",[],(U=function(Ja){null==x.stdout&&(x.stdout=t);null==Ja&&(Ja=t);return x.stdout.$puts(Ja.$inspect())},U.$$s=this,U.$$arity=1,U));return p(y(qa.$length(),1))?qa["$[]"](0):qa},Va.$$arity=-1);a.def(c,"$print",ib=function(v){null==x.stdout&&(x.stdout=t);var U=a.slice.call(arguments, -0,arguments.length);return m(x.stdout,"print",a.to_a(U))},ib.$$arity=-1);a.def(c,"$warn",db=function(v,U){var qa,Ja=t,jb=t;null==x.VERBOSE&&(x.VERBOSE=t);null==x.stderr&&(x.stderr=t);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=k([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=t);p(mb)&&(mb=A(H,"Opal")["$coerce_to!"](mb,A(H,"Integer"),"to_str"),p("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(A(H, -"ArgumentError"),"negative level ("+mb+")"),Ja=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),p(Ja)&&(Ja=""+Ja+": "),ob=m(ob,"map",[],(qa=function(sb){null==sb&&(sb=t);return""+Ja+"warning: "+sb},qa.$$s=this,qa.$$arity=1,qa)));return p(p(jb=x.VERBOSE["$nil?"]())?jb:ob["$empty?"]())?t:m(x.stderr,"puts",a.to_a(ob))},db.$$arity=-1);a.def(c,"$raise",$a=function(v,U){null==x["!"]&&(x["!"]=t);null==U&&(U=t);if(null==v&&x["!"]!==t)throw x["!"];null==v?v=A(H,"RuntimeError").$new():v.$$is_string? -v=A(H,"RuntimeError").$new(v):v.$$is_class&&v["$respond_to?"]("exception")?v=v.$exception(U):v["$is_a?"](A(H,"Exception"))||(v=A(H,"TypeError").$new("exception class/object expected"));x["!"]!==t&&a.exceptions.push(x["!"]);x["!"]=v;throw v;},$a.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",ab=function(v){if(void 0===v)return w(A(H,"Random"),"DEFAULT").$rand();v.$$is_number&&(0>v&&(v=Math.abs(v)),0!==v%1&&(v=v.$to_i()),0===v&&(v=void 0));return w(A(H,"Random"),"DEFAULT").$rand(v)},ab.$$arity= --1);a.def(c,"$respond_to?",Aa=function(v,U){null==U&&(U=!1);var qa=this["$"+v];return"function"!==typeof qa||qa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](v,U):!0},Aa.$$arity=-2);a.def(c,"$respond_to_missing?",ua=function(){return!1},ua.$$arity=-2);A(H,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",La=function(v){v=A(H,"Opal")["$coerce_to!"](v,A(H,"String"),"to_str");return a.require(v)},La.$$arity=1);a.def(c,"$require_relative", -Ta=function(v){A(H,"Opal")["$try_convert!"](v,A(H,"String"),"to_str");v=A(H,"File").$expand_path(A(H,"File").$join(a.current_file,"..",v));return a.require(v)},Ta.$$arity=1);a.def(c,"$require_tree",Ya=function(v){var U=[];v=A(H,"File").$expand_path(v);v=a.normalize(v);"."===v&&(v="");for(var qa in a.modules)qa["$start_with?"](v)&&U.push([qa,a.require(qa)]);return U},Ya.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Ga=function(){return a.get_singleton_class(this)}, -Ga.$$arity=0);a.def(c,"$sleep",Z=function(v){null==v&&(v=t);v===t&&this.$raise(A(H,"TypeError"),"can't convert NilClass into time interval");v.$$is_number||this.$raise(A(H,"TypeError"),"can't convert "+v.$class()+" into time interval");0>v&&this.$raise(A(H,"ArgumentError"),"time interval must be positive");for(var U=a.global.performance?function(){return performance.now()}:function(){return new Date},qa=U();U()-qa<=1E3*v;);return Math.round(v)},Z.$$arity=-1);a.def(c,"$srand",P=function(v){null==v&& -(v=A(H,"Random").$new_seed());return A(H,"Random").$srand(v)},P.$$arity=-1);a.def(c,"$String",aa=function(v){var U;return p(U=A(H,"Opal")["$coerce_to?"](v,A(H,"String"),"to_str"))?U:A(H,"Opal")["$coerce_to!"](v,A(H,"String"),"to_s")},aa.$$arity=1);a.def(c,"$tap",T=function(){var v=T.$$p,U=v||t;v&&(T.$$p=null);v&&(T.$$p=null);a.yield1(U,this);return this},T.$$arity=0);a.def(c,"$to_proc",fa=function(){return this},fa.$$arity=0);a.def(c,"$to_s",ka=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+ -">"},ka.$$arity=0);a.def(c,"$catch",g=function(v){var U=g.$$p,qa=U||t;U&&(g.$$p=null);try{return a.yieldX(qa,[])}catch(Ja){if(a.rescue(Ja,[A(H,"UncaughtThrowError")])){U=Ja;try{return U.$sym()["$=="](v)?U.$arg():this.$raise()}finally{a.pop_exception()}}else throw Ja;}},g.$$arity=1);a.def(c,"$throw",C=function(v){var U=a.slice.call(arguments,0,arguments.length);return this.$raise(A(H,"UncaughtThrowError"),U)},C.$$arity=-1);a.def(c,"$open",M=function(v){var U=M.$$p,qa=U||t;U&&(M.$$p=null);U&&(M.$$p= -null);U=a.slice.call(arguments,0,arguments.length);return m(A(H,"File"),"open",a.to_a(U),qa.$to_proc())},M.$$arity=-1);a.def(c,"$yield_self",ba=function(){var v,U=ba.$$p,qa=U||t;U&&(ba.$$p=null);return qa===t?m(this,"enum_for",["yield_self"],(v=function(){return 1},v.$$s=this,v.$$arity=0,v)):a.yield1(qa,this)},ba.$$arity=0);a.alias(c,"then","yield_self");A(H,"Opal").$pristine(c,"method_missing")})(K[0],K);return function(c,$super,H){c=u(c,$super,"Object");H=[c].concat(H);return c.$include(A(H,"Kernel"))}(K[0], -null,K)}; -Opal.modules["corelib/error"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.klass,A=a.send,p=a.truthy,d=a.module,G=a.send2,x=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(k,$super,u){k=w(k,$super,"Exception");var c=[k].concat(u),l,H,e,n,J,D,R,ia,ea;k.$$prototype.message=K;a.defs(k,"$new",l=function(b){var h=a.slice.call(arguments,0,arguments.length);var f=0"},R.$$arity=0);a.def(k,"$set_backtrace",ia=function(b){var h= -!0,f;if(b===K)this.backtrace=K,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var q=0;for(f=b.length;q"](1);p(H)&&(this.arg=l["$[]"](1));return G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),K)&&"initialize"})(y[0],t(y,"ArgumentError"),y);(function(k,$super,u){k=w(k,$super,"NameError");[k].concat(u);var c;k.$attr_reader("name"); -return(a.def(k,"$initialize",c=function(l,H){c.$$p&&(c.$$p=null);null==H&&(H=K);G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l],null);return this.name=H},c.$$arity=-2),K)&&"initialize"})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"NoMethodError");[k].concat(u);var c;k.$attr_reader("args");return(a.def(k,"$initialize",c=function(l,H,e){c.$$p&&(c.$$p=null);null==H&&(H=K);null==e&&(e=[]);G(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l,H],null); -return this.args=e},c.$$arity=-2),K)&&"initialize"})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"StopIteration");[k].concat(u);return k.$attr_reader("result")})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"KeyError");var c=[k].concat(u),l,H,e;k.$$prototype.receiver=k.$$prototype.key=K;a.def(k,"$initialize",l=function(n,J){l.$$p&&(l.$$p=null);if(null==J)J=x([],{});else if(!J.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var D=J.$$smap.receiver;null==D&&(D=K);J=J.$$smap.key;null== -J&&(J=K);G(this,a.find_super_dispatcher(this,"initialize",l,!1,!0),"initialize",[n],null);this.receiver=D;return this.key=J},l.$$arity=-2);a.def(k,"$receiver",H=function(){var n;return p(n=this.receiver)?n:this.$raise(t(c,"ArgumentError"),"no receiver is available")},H.$$arity=0);return(a.def(k,"$key",e=function(){var n;return p(n=this.key)?n:this.$raise(t(c,"ArgumentError"),"no key is available")},e.$$arity=0),K)&&"key"})(y[0],null,y);return function(k,m){k=[d(k,"JS")].concat(m);[w(k[0],null,"Error")].concat(k)}(y[0], +Opal.modules["corelib/helpers"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.type_error,z=a.coerce_to,p=a.module,d=a.truthy;a.add_stubs("$=== $raise $respond_to? $nil? $__send__ $<=> $class $coerce_to! $new $!= $[] $upcase".split(" "));return function(H,x){H=p(H,"Opal");var k=[H].concat(x),m,u,c,l,I,e,n,L,D,R,ja;a.defs(H,"$bridge",m=function(da,ma){return a.bridge(da,ma)},m.$$arity=2);a.defs(H,"$coerce_to!",u=function(da,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);f=z(da,ma,b,f);d(ma["$==="](f))|| +this.$raise(w(da,ma,b,f));return f},u.$$arity=-4);a.defs(H,"$coerce_to?",c=function(da,ma,b,h){var f=a.slice.call(arguments,3,arguments.length);if(!d(da["$respond_to?"](b)))return J;f=z(da,ma,b,f);if(d(f["$nil?"]()))return J;d(ma["$==="](f))||this.$raise(w(da,ma,b,f));return f},c.$$arity=-4);a.defs(H,"$try_convert",l=function(da,ma,b){return d(ma["$==="](da))?da:d(da["$respond_to?"](b))?da.$__send__(b):J},l.$$arity=3);a.defs(H,"$compare",I=function(da,ma){var b=da["$<=>"](ma);d(b===J)&&this.$raise(t(k, +"ArgumentError"),"comparison of "+da.$class()+" with "+ma.$class()+" failed");return b},I.$$arity=2);a.defs(H,"$destructure",e=function(da){if(1==da.length)return da[0];if(da.$$is_array)return da;for(var ma=Array(da.length),b=0,h=ma.length;bda.length||"@@"!==da.slice(0,2))&&this.$raise(t(k,"NameError").$new("`"+da+"' is not allowed as a class variable name",da));return da},D.$$arity=1);a.defs(H,"$const_name!",R=function(da){da=t(k,"Opal")["$coerce_to!"](da, +t(k,"String"),"to_str");d(da["$[]"](0)["$!="](da["$[]"](0).$upcase()))&&this.$raise(t(k,"NameError"),"wrong constant name "+da);return da},R.$$arity=1);a.defs(H,"$pristine",ja=function(da,ma){var b=a.slice.call(arguments,1,arguments.length);for(var h,f=b.length-1;0<=f;f--)h=b[f],(h=da.$$prototype["$"+h])&&!h.$$stub&&(h.$$pristine=!0);return J},ja.$$arity=-2)}(y[0],y)}; +Opal.modules["corelib/module"]=function(a){function y(l,I){return"number"===typeof l&&"number"===typeof I?l $nil? $attr_reader $attr_writer $warn $attr_accessor $class_variable_name! $new $const_name! $=~ $inject $split $const_get $== $!~ $start_with? $bind $call $class $append_features $included $name $cover? $size $merge $compile $proc $any? $prepend_features $prepended $to_s $__id__ $constants $include? $copy_class_variables $copy_constants".split(" ")); +return function(l,$super,e){l=H(l,$super,"Module");var n=[l].concat(e),L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra,W,za,Ca,Va,ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T,fa,la;a.defs(l,"$allocate",L=function(){var g=a.allocate_module(t,function(){});this!==a.Module&&Object.setPrototypeOf(g,this.$$prototype);return g},L.$$arity=0);a.def(l,"$initialize",D=function(){var g=D.$$p,C=g||t;g&&(D.$$p=null);g&&(D.$$p=null);return C!==t?x(this,"module_eval", +[],C.$to_proc()):t},D.$$arity=0);a.def(l,"$===",R=function(g){return p(null==g)?!1:a.is_a(g,this)},R.$$arity=1);a.def(l,"$<",ja=function(g){p(z(n,"Module")["$==="](g))||this.$raise(z(n,"TypeError"),"compared with non class/module");var C;if(this===g)return!1;var N=0;var aa=a.ancestors(this);for(C=aa.length;N",ma=function(g){p(z(n,"Module")["$==="](g))||this.$raise(z(n,"TypeError"),"compared with non class/module");return y(g,this)},ma.$$arity=1);a.def(l,"$>=",b=function(g){var C;return p(C=this["$equal?"](g))?C:"number"===typeof this&&"number"===typeof g?this>g:this["$>"](g)},b.$$arity=1);a.def(l,"$<=>",h=function(g){if(this===g)return 0;if(!p(z(n,"Module")["$==="](g)))return t;g=y(this,g);return p(g["$nil?"]())?t:p(g)?-1:1},h.$$arity=1);a.def(l,"$alias_method",f= +function(g,C){g=d(g,z(n,"String"),"to_str");C=d(C,z(n,"String"),"to_str");a.alias(this,g,C);return this},f.$$arity=2);a.def(l,"$alias_native",q=function(g,C){null==C&&(C=g);a.alias_native(this,g,C);return this},q.$$arity=-2);a.def(l,"$ancestors",A=function(){return a.ancestors(this)},A.$$arity=0);a.def(l,"$append_features",E=function(g){a.append_features(this,g);return this},E.$$arity=1);a.def(l,"$attr_accessor",G=function(g){var C=a.slice.call(arguments,0,arguments.length);x(this,"attr_reader",a.to_a(C)); +return x(this,"attr_writer",a.to_a(C))},G.$$arity=-1);a.def(l,"$attr",M=function(g){var C=a.slice.call(arguments,0,arguments.length);return 2!=C.length||!0!==C[1]&&!1!==C[1]?x(this,"attr_reader",a.to_a(C)):(this.$warn("optional boolean argument is obsoleted",k(["uplevel"],{uplevel:1})),C[1]?this.$attr_accessor(C[0]):this.$attr_reader(C[0]),t)},M.$$arity=-1);a.def(l,"$attr_reader",ba=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var N=this.$$prototype,aa=C.length-1;0<=aa;aa--){var v= +C[aa],U="$"+v;v=a.ivar(v);var oa=function(Ka){return function(){return null==this[Ka]?t:this[Ka]}}(v);a.defineProperty(N,v,t);oa.$$parameters=[];oa.$$arity=0;a.defn(this,U,oa)}return t},ba.$$arity=-1);a.def(l,"$attr_writer",ua=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var N=this.$$prototype,aa=C.length-1;0<=aa;aa--){var v=C[aa],U="$"+v+"=";v=a.ivar(v);var oa=function(Ka){return function(jb){return this[Ka]=jb}}(v);oa.$$parameters=[["req"]];oa.$$arity=1;a.defineProperty(N,v, +t);a.defn(this,U,oa)}return t},ua.$$arity=-1);a.def(l,"$autoload",Oa=function(g,C){null==this.$$autoload&&(this.$$autoload={});a.const_cache_version++;this.$$autoload[g]=C;return t},Oa.$$arity=2);a.def(l,"$class_variables",xa=function(){return Object.keys(a.class_variables(this))},xa.$$arity=0);a.def(l,"$class_variable_get",Ba=function(g){g=z(n,"Opal")["$class_variable_name!"](g);var C=a.class_variables(this)[g];null==C&&this.$raise(z(n,"NameError").$new("uninitialized class variable "+g+" in "+this, +g));return C},Ba.$$arity=1);a.def(l,"$class_variable_set",La=function(g,C){g=z(n,"Opal")["$class_variable_name!"](g);return a.class_variable_set(this,g,C)},La.$$arity=2);a.def(l,"$class_variable_defined?",na=function(g){g=z(n,"Opal")["$class_variable_name!"](g);return a.class_variables(this).hasOwnProperty(g)},na.$$arity=1);a.def(l,"$remove_class_variable",S=function(g){g=z(n,"Opal")["$class_variable_name!"](g);if(a.hasOwnProperty.call(this.$$cvars,g)){var C=this.$$cvars[g];delete this.$$cvars[g]; +return C}this.$raise(z(n,"NameError"),"cannot remove "+g+" for "+this)},S.$$arity=1);a.def(l,"$constants",sa=function(g){null==g&&(g=!0);return a.constants(this,g)},sa.$$arity=-1);a.defs(l,"$constants",ya=function(g){if(null==g){g=(this.$$nesting||[]).concat(a.Object);var C,N={},aa;var v=0;for(aa=g.length;v"},Y.$$arity=0);a.def(l,"$undef_method",Q=function(g){var C=a.slice.call(arguments,0,arguments.length);for(var N=0,aa=C.length;N":D?"#>":d(this,a.find_super_dispatcher(this,"to_s",L,!1,!0),"to_s",[],null)},L.$$arity=0),t)&&"to_s"}(J[0],null,J)}; +Opal.modules["corelib/basic_object"]=function(a){var y=[],J=a.nil,t=a.$$$,w=a.klass,z=a.truthy,p=a.range,d=a.hash2,H=a.send;a.add_stubs("$== $! $nil? $cover? $size $raise $merge $compile $proc $any? $inspect $new".split(" "));return function(x,$super,m){x=w(x,$super,"BasicObject");[x].concat(m);var u,c,l,I,e,n,L,D,R,ja,da,ma,b,h;a.def(x,"$initialize",u=function(f){a.slice.call(arguments,0,arguments.length);return J},u.$$arity=-1);a.def(x,"$==",c=function(f){return this===f},c.$$arity=1);a.def(x,"$eql?", +l=function(f){return this["$=="](f)},l.$$arity=1);a.alias(x,"equal?","==");a.def(x,"$__id__",I=function(){if(null!=this.$$id)return this.$$id;a.defineProperty(this,"$$id",a.uid());return this.$$id},I.$$arity=0);a.def(x,"$__send__",e=function(f,q){var A=e.$$p,E=A||J;A&&(e.$$p=null);A&&(e.$$p=null);A=a.slice.call(arguments,1,arguments.length);var G=this["$"+f];if(G)return E!==J&&(G.$$p=E),G.apply(this,A);E!==J&&(this.$method_missing.$$p=E);return this.$method_missing.apply(this,[f].concat(A))},e.$$arity= +-2);a.def(x,"$!",n=function(){return!1},n.$$arity=0);a.def(x,"$!=",L=function(f){return this["$=="](f)["$!"]()},L.$$arity=1);a.def(x,"$instance_eval",D=function(f){var q=D.$$p,A=q||J,E,G,M=J,ba=E=J,ua=ba=J,Oa=ba=J;q&&(D.$$p=null);q&&(D.$$p=null);E=a.slice.call(arguments,0,arguments.length);z(z(M=A["$nil?"]())?!!a.compile:M)?(z(p(1,3,!1)["$cover?"](E.$size()))||t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),A=[].concat(a.to_a(E)),E=null==A[0]?J:A[0],ba=null== +A[1]?J:A[1],A,ba=d(["file","eval"],{file:z(ua=ba)?ua:"(eval)",eval:!0}),ba=a.hash({arity_check:!1}).$merge(ba),Oa=t("::","Opal").$compile(E,ba),A=H(t("::","Kernel"),"proc",[],(G=function(){return function(){return eval(Oa)}(null==G.$$s?this:G.$$s)},G.$$s=this,G.$$arity=0,G))):z(E["$any?"]())&&t("::","Kernel").$raise(t("::","ArgumentError"),"wrong number of arguments ("+E.$size()+" for 0)");ua=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var xa=A.call(this,this)}finally{this.$$eval=!1}}else xa= +A.call(this,this);A.$$s=ua;return xa},D.$$arity=-1);a.def(x,"$instance_exec",R=function(f){var q=R.$$p,A=q||J;q&&(R.$$p=null);q&&(R.$$p=null);q=a.slice.call(arguments,0,arguments.length);z(A)||t("::","Kernel").$raise(t("::","ArgumentError"),"no block given");var E=A.$$s;A.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var G=A.apply(this,q)}finally{this.$$eval=!1}}else G=A.apply(this,q);A.$$s=E;return G},R.$$arity=-1);a.def(x,"$singleton_method_added",ja=function(f){a.slice.call(arguments,0,arguments.length); +return J},ja.$$arity=-1);a.def(x,"$singleton_method_removed",da=function(f){a.slice.call(arguments,0,arguments.length);return J},da.$$arity=-1);a.def(x,"$singleton_method_undefined",ma=function(f){a.slice.call(arguments,0,arguments.length);return J},ma.$$arity=-1);a.def(x,"$method_missing",b=function(f,q){var A=b.$$p;A&&(b.$$p=null);A&&(b.$$p=null);a.slice.call(arguments,1,arguments.length);A=z(this.$inspect&&!this.$inspect.$$stub)?"undefined method `"+f+"' for "+this.$inspect()+":"+this.$$class: +"undefined method `"+f+"' for "+this.$$class;return t("::","Kernel").$raise(t("::","NoMethodError").$new(A,f))},b.$$arity=-2);return(a.def(x,"$respond_to_missing?",h=function(){return!1},h.$$arity=-2),J)&&"respond_to_missing?"}(y[0],null,y)}; +Opal.modules["corelib/kernel"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c<=l:c["$<="](l)}var J=[],t=a.nil,w=a.$$$,z=a.$$,p=a.truthy,d=a.coerce_to,H=a.module,x=a.gvars,k=a.hash2,m=a.send,u=a.klass;a.add_stubs("$raise $new $inspect $! $=~ $== $object_id $class $coerce_to? $<< $allocate $copy_instance_variables $copy_singleton_methods $initialize_clone $initialize_copy $define_method $singleton_class $to_proc $initialize_dup $for $empty? $pop $call $append_features $extend_object $extended $__id__ $to_s $instance_variable_name! $respond_to? $to_int $coerce_to! $Integer $nil? $=== $enum_for $result $any? $print $format $puts $each $<= $length $[] $< $first $caller $+ $map $exception $is_a? $rand $respond_to_missing? $pristine $try_convert! $expand_path $join $start_with? $new_seed $srand $sym $arg $open $include".split(" "));(function(c, +l){c=H(c,"Kernel");var I=[c].concat(l),e,n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra,W,za,Ca,Va,ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T,fa,la,g,C,N,aa;a.def(c,"$method_missing",e=function(v,U){var oa=e.$$p;oa&&(e.$$p=null);oa&&(e.$$p=null);oa=a.slice.call(arguments,1,arguments.length);return this.$raise(z(I,"NoMethodError").$new("undefined method `"+v+"' for "+this.$inspect(),v,oa))},e.$$arity=-2);a.def(c,"$=~",n=function(){return!1},n.$$arity= +1);a.def(c,"$!~",L=function(v){return this["$=~"](v)["$!"]()},L.$$arity=1);a.def(c,"$===",D=function(v){var U;return p(U=this.$object_id()["$=="](v.$object_id()))?U:this["$=="](v)},D.$$arity=1);a.def(c,"$<=>",R=function(v){this.$$comparable=!0;return(v=this["$=="](v))&&v!==t?0:t},R.$$arity=1);a.def(c,"$method",ja=function(v){var U=this["$"+v];U&&!U.$$stub||this.$raise(z(I,"NameError").$new("undefined method `"+v+"' for class `"+this.$class()+"'",v));return z(I,"Method").$new(this,U.$$owner||this.$class(), +U,v)},ja.$$arity=1);a.def(c,"$methods",da=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.own_methods(this)},da.$$arity=-1);a.def(c,"$public_methods",ma=function(v){null==v&&(v=!0);return p(v)?a.methods(this):a.receiver_methods(this)},ma.$$arity=-1);a.def(c,"$Array",b=function(v){if(v===t)return[];if(v.$$is_array)return v;var U=z(I,"Opal")["$coerce_to?"](v,z(I,"Array"),"to_ary");if(U!==t)return U;U=z(I,"Opal")["$coerce_to?"](v,z(I,"Array"),"to_a");return U!==t?U:[v]},b.$$arity=1);a.def(c, +"$at_exit",h=function(){var v=h.$$p,U=v||t,oa=t;null==x.__at_exit__&&(x.__at_exit__=t);v&&(h.$$p=null);v&&(h.$$p=null);x.__at_exit__=p(oa=x.__at_exit__)?oa:[];x.__at_exit__["$<<"](U);return U},h.$$arity=0);a.def(c,"$caller",f=function(v,U){null==U&&(U=t);v=(Error().stack||"").split("\n");var oa=[];for(var Ka=3,jb=v.length;KaU||36=U?U-1:"9a-"+String.fromCharCode(97+(U-11)));(new RegExp("^\\s*[+-]?["+jb+"]+\\s*$")).test(Ka)||oa.$raise(z(I,"ArgumentError"),'invalid value for Integer(): "'+v+'"');Ka=parseInt(Ka,U);isNaN(Ka)&&oa.$raise(z(I,"ArgumentError"),'invalid value for Integer(): "'+ +v+'"');return Ka},ia.$$arity=-2);a.def(c,"$Float",wa=function(v){v===t&&this.$raise(z(I,"TypeError"),"can't convert nil into Float");if(v.$$is_string){var U=v.toString();U=U.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(U))return this.$Integer(U);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(U)||this.$raise(z(I,"ArgumentError"),'invalid value for Float(): "'+v+'"');return parseFloat(U)}return z(I,"Opal")["$coerce_to!"](v,z(I,"Float"),"to_f")},wa.$$arity=1);a.def(c, +"$Hash",Ha=function(v){var U=t;return p(p(U=v["$nil?"]())?U:v["$=="]([]))?k([],{}):p(z(I,"Hash")["$==="](v))?v:z(I,"Opal")["$coerce_to!"](v,z(I,"Hash"),"to_hash")},Ha.$$arity=1);a.def(c,"$is_a?",Ea=function(v){v.$$is_class||v.$$is_module||this.$raise(z(I,"TypeError"),"class or module required");return a.is_a(this,v)},Ea.$$arity=1);a.def(c,"$itself",Qa=function(){return this},Qa.$$arity=0);a.alias(c,"kind_of?","is_a?");a.def(c,"$lambda",Sa=function(){var v=Sa.$$p,U=v||t;v&&(Sa.$$p=null);v&&(Sa.$$p= +null);return a.lambda(U)},Sa.$$arity=0);a.def(c,"$load",Ia=function(v){v=z(I,"Opal")["$coerce_to!"](v,z(I,"String"),"to_str");return a.load(v)},Ia.$$arity=1);a.def(c,"$loop",kb=function(){var v,U=kb.$$p,oa=U||t,Ka=t;U&&(kb.$$p=null);if(oa===t)return m(this,"enum_for",["loop"],(v=function(){return w(z(I,"Float"),"INFINITY")},v.$$s=this,v.$$arity=0,v));for(;p(!0);)try{a.yieldX(oa,[])}catch(jb){if(a.rescue(jb,[z(I,"StopIteration")])){Ka=jb;try{return Ka.$result()}finally{a.pop_exception()}}else throw jb; +}return this},kb.$$arity=0);a.def(c,"$nil?",Ra=function(){return!1},Ra.$$arity=0);a.alias(c,"object_id","__id__");a.def(c,"$printf",W=function(v){var U=a.slice.call(arguments,0,arguments.length);p(U["$any?"]())&&this.$print(m(this,"format",a.to_a(U)));return t},W.$$arity=-1);a.def(c,"$proc",za=function(){var v=za.$$p,U=v||t;v&&(za.$$p=null);v&&(za.$$p=null);p(U)||this.$raise(z(I,"ArgumentError"),"tried to create Proc object without a block");U.$$is_lambda=!1;return U},za.$$arity=0);a.def(c,"$puts", +Ca=function(v){null==x.stdout&&(x.stdout=t);var U=a.slice.call(arguments,0,arguments.length);return m(x.stdout,"puts",a.to_a(U))},Ca.$$arity=-1);a.def(c,"$p",Va=function(v){var U;var oa=a.slice.call(arguments,0,arguments.length);m(oa,"each",[],(U=function(Ka){null==x.stdout&&(x.stdout=t);null==Ka&&(Ka=t);return x.stdout.$puts(Ka.$inspect())},U.$$s=this,U.$$arity=1,U));return p(y(oa.$length(),1))?oa["$[]"](0):oa},Va.$$arity=-1);a.def(c,"$print",ib=function(v){null==x.stdout&&(x.stdout=t);var U=a.slice.call(arguments, +0,arguments.length);return m(x.stdout,"print",a.to_a(U))},ib.$$arity=-1);a.def(c,"$warn",db=function(v,U){var oa,Ka=t,jb=t;null==x.VERBOSE&&(x.VERBOSE=t);null==x.stderr&&(x.stderr=t);var ob=a.slice.call(arguments,0,arguments.length);var mb=a.extract_kwargs(ob);if(null==mb)mb=k([],{});else if(!mb.$$is_hash)throw a.ArgumentError.$new("expected kwargs");mb=mb.$$smap.uplevel;null==mb&&(mb=t);p(mb)&&(mb=z(I,"Opal")["$coerce_to!"](mb,z(I,"Integer"),"to_str"),p("number"===typeof mb?0>mb:mb["$<"](0))&&this.$raise(z(I, +"ArgumentError"),"negative level ("+mb+")"),Ka=this.$caller("number"===typeof mb?mb+2:mb["$+"](2),1).$first(),p(Ka)&&(Ka=""+Ka+": "),ob=m(ob,"map",[],(oa=function(sb){null==sb&&(sb=t);return""+Ka+"warning: "+sb},oa.$$s=this,oa.$$arity=1,oa)));return p(p(jb=x.VERBOSE["$nil?"]())?jb:ob["$empty?"]())?t:m(x.stderr,"puts",a.to_a(ob))},db.$$arity=-1);a.def(c,"$raise",Xa=function(v,U){null==x["!"]&&(x["!"]=t);null==U&&(U=t);if(null==v&&x["!"]!==t)throw x["!"];null==v?v=z(I,"RuntimeError").$new():v.$$is_string? +v=z(I,"RuntimeError").$new(v):v.$$is_class&&v["$respond_to?"]("exception")?v=v.$exception(U):v["$is_a?"](z(I,"Exception"))||(v=z(I,"TypeError").$new("exception class/object expected"));x["!"]!==t&&a.exceptions.push(x["!"]);x["!"]=v;throw v;},Xa.$$arity=-1);a.alias(c,"fail","raise");a.def(c,"$rand",bb=function(v){if(void 0===v)return w(z(I,"Random"),"DEFAULT").$rand();v.$$is_number&&(0>v&&(v=Math.abs(v)),0!==v%1&&(v=v.$to_i()),0===v&&(v=void 0));return w(z(I,"Random"),"DEFAULT").$rand(v)},bb.$$arity= +-1);a.def(c,"$respond_to?",Aa=function(v,U){null==U&&(U=!1);var oa=this["$"+v];return"function"!==typeof oa||oa.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](v,U):!0},Aa.$$arity=-2);a.def(c,"$respond_to_missing?",ta=function(){return!1},ta.$$arity=-2);z(I,"Opal").$pristine(c,"respond_to?","respond_to_missing?");a.def(c,"$require",Ma=function(v){v=z(I,"Opal")["$coerce_to!"](v,z(I,"String"),"to_str");return a.require(v)},Ma.$$arity=1);a.def(c,"$require_relative", +Ta=function(v){z(I,"Opal")["$try_convert!"](v,z(I,"String"),"to_str");v=z(I,"File").$expand_path(z(I,"File").$join(a.current_file,"..",v));return a.require(v)},Ta.$$arity=1);a.def(c,"$require_tree",Za=function(v){var U=[];v=z(I,"File").$expand_path(v);v=a.normalize(v);"."===v&&(v="");for(var oa in a.modules)oa["$start_with?"](v)&&U.push([oa,a.require(oa)]);return U},Za.$$arity=1);a.alias(c,"send","__send__");a.alias(c,"public_send","__send__");a.def(c,"$singleton_class",Fa=function(){return a.get_singleton_class(this)}, +Fa.$$arity=0);a.def(c,"$sleep",Y=function(v){null==v&&(v=t);v===t&&this.$raise(z(I,"TypeError"),"can't convert NilClass into time interval");v.$$is_number||this.$raise(z(I,"TypeError"),"can't convert "+v.$class()+" into time interval");0>v&&this.$raise(z(I,"ArgumentError"),"time interval must be positive");for(var U=a.global.performance?function(){return performance.now()}:function(){return new Date},oa=U();U()-oa<=1E3*v;);return Math.round(v)},Y.$$arity=-1);a.def(c,"$srand",Q=function(v){null==v&& +(v=z(I,"Random").$new_seed());return z(I,"Random").$srand(v)},Q.$$arity=-1);a.def(c,"$String",Z=function(v){var U;return p(U=z(I,"Opal")["$coerce_to?"](v,z(I,"String"),"to_str"))?U:z(I,"Opal")["$coerce_to!"](v,z(I,"String"),"to_s")},Z.$$arity=1);a.def(c,"$tap",T=function(){var v=T.$$p,U=v||t;v&&(T.$$p=null);v&&(T.$$p=null);a.yield1(U,this);return this},T.$$arity=0);a.def(c,"$to_proc",fa=function(){return this},fa.$$arity=0);a.def(c,"$to_s",la=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+ +">"},la.$$arity=0);a.def(c,"$catch",g=function(v){var U=g.$$p,oa=U||t;U&&(g.$$p=null);try{return a.yieldX(oa,[])}catch(Ka){if(a.rescue(Ka,[z(I,"UncaughtThrowError")])){U=Ka;try{return U.$sym()["$=="](v)?U.$arg():this.$raise()}finally{a.pop_exception()}}else throw Ka;}},g.$$arity=1);a.def(c,"$throw",C=function(v){var U=a.slice.call(arguments,0,arguments.length);return this.$raise(z(I,"UncaughtThrowError"),U)},C.$$arity=-1);a.def(c,"$open",N=function(v){var U=N.$$p,oa=U||t;U&&(N.$$p=null);U&&(N.$$p= +null);U=a.slice.call(arguments,0,arguments.length);return m(z(I,"File"),"open",a.to_a(U),oa.$to_proc())},N.$$arity=-1);a.def(c,"$yield_self",aa=function(){var v,U=aa.$$p,oa=U||t;U&&(aa.$$p=null);return oa===t?m(this,"enum_for",["yield_self"],(v=function(){return 1},v.$$s=this,v.$$arity=0,v)):a.yield1(oa,this)},aa.$$arity=0);a.alias(c,"then","yield_self");z(I,"Opal").$pristine(c,"method_missing")})(J[0],J);return function(c,$super,I){c=u(c,$super,"Object");I=[c].concat(I);return c.$include(z(I,"Kernel"))}(J[0], +null,J)}; +Opal.modules["corelib/error"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.klass,z=a.send,p=a.truthy,d=a.module,H=a.send2,x=a.hash2;a.add_stubs("$new $clone $to_s $empty? $class $raise $+ $attr_reader $[] $> $length $inspect".split(" "));(function(k,$super,u){k=w(k,$super,"Exception");var c=[k].concat(u),l,I,e,n,L,D,R,ja,da;k.$$prototype.message=J;a.defs(k,"$new",l=function(b){var h=a.slice.call(arguments,0,arguments.length);var f=0"},R.$$arity=0);a.def(k,"$set_backtrace",ja=function(b){var h= +!0,f;if(b===J)this.backtrace=J,this.stack="";else if(b.$$is_string)this.backtrace=[b],this.stack=b;else{if(b.$$is_array){var q=0;for(f=b.length;q"](1);p(I)&&(this.arg=l["$[]"](1));return H(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",["uncaught throw "+this.sym.$inspect()],null)},c.$$arity=1),J)&&"initialize"})(y[0],t(y,"ArgumentError"),y);(function(k,$super,u){k=w(k,$super,"NameError");[k].concat(u);var c;k.$attr_reader("name"); +return(a.def(k,"$initialize",c=function(l,I){c.$$p&&(c.$$p=null);null==I&&(I=J);H(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l],null);return this.name=I},c.$$arity=-2),J)&&"initialize"})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"NoMethodError");[k].concat(u);var c;k.$attr_reader("args");return(a.def(k,"$initialize",c=function(l,I,e){c.$$p&&(c.$$p=null);null==I&&(I=J);null==e&&(e=[]);H(this,a.find_super_dispatcher(this,"initialize",c,!1,!0),"initialize",[l,I],null); +return this.args=e},c.$$arity=-2),J)&&"initialize"})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"StopIteration");[k].concat(u);return k.$attr_reader("result")})(y[0],null,y);(function(k,$super,u){k=w(k,$super,"KeyError");var c=[k].concat(u),l,I,e;k.$$prototype.receiver=k.$$prototype.key=J;a.def(k,"$initialize",l=function(n,L){l.$$p&&(l.$$p=null);if(null==L)L=x([],{});else if(!L.$$is_hash)throw a.ArgumentError.$new("expected kwargs");var D=L.$$smap.receiver;null==D&&(D=J);L=L.$$smap.key;null== +L&&(L=J);H(this,a.find_super_dispatcher(this,"initialize",l,!1,!0),"initialize",[n],null);this.receiver=D;return this.key=L},l.$$arity=-2);a.def(k,"$receiver",I=function(){var n;return p(n=this.receiver)?n:this.$raise(t(c,"ArgumentError"),"no receiver is available")},I.$$arity=0);return(a.def(k,"$key",e=function(){var n;return p(n=this.key)?n:this.$raise(t(c,"ArgumentError"),"no key is available")},e.$$arity=0),J)&&"key"})(y[0],null,y);return function(k,m){k=[d(k,"JS")].concat(m);[w(k[0],null,"Error")].concat(k)}(y[0], y)}; -Opal.modules["corelib/constants"]=function(a){var y=[],K=a.$$;a.const_set(y[0],"RUBY_PLATFORM","opal");a.const_set(y[0],"RUBY_ENGINE","opal");a.const_set(y[0],"RUBY_VERSION","3.0.0");a.const_set(y[0],"RUBY_ENGINE_VERSION","1.1.1");a.const_set(y[0],"RUBY_RELEASE_DATE","2021-02-23");a.const_set(y[0],"RUBY_PATCHLEVEL",0);a.const_set(y[0],"RUBY_REVISION","0");a.const_set(y[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2021 Adam Beynon and the Opal contributors");return a.const_set(y[0],"RUBY_DESCRIPTION","opal "+ -K(y,"RUBY_ENGINE_VERSION")+" ("+K(y,"RUBY_RELEASE_DATE")+" revision "+K(y,"RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(a){var y=a.top;a.add_stubs(["$require"]);y.$require("corelib/runtime");y.$require("corelib/helpers");y.$require("corelib/module");y.$require("corelib/class");y.$require("corelib/basic_object");y.$require("corelib/kernel");y.$require("corelib/error");return y.$require("corelib/constants")}; -Opal.modules["corelib/nil"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.klass,A=a.hash2,p=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(d,$super,x){d=w(d,$super,"NilClass");var k=[d].concat(x),m,u,c,l,H,e,n,J,D,R,ia,ea,ma,b,h,f,q,z;d.$$prototype.$$meta=d;(function(E,F){var L=[E].concat(F),ca;a.def(E,"$allocate",ca=function(){return this.$raise(t(L,"TypeError"),"allocator undefined for "+this.$name())},ca.$$arity=0);a.udef(E,"$new");return K})(a.get_singleton_class(d), -k);a.def(d,"$!",m=function(){return!0},m.$$arity=0);a.def(d,"$&",u=function(){return!1},u.$$arity=1);a.def(d,"$|",c=function(E){return!1!==E&&E!==K},c.$$arity=1);a.def(d,"$^",l=function(E){return!1!==E&&E!==K},l.$$arity=1);a.def(d,"$==",H=function(E){return E===K},H.$$arity=1);a.def(d,"$dup",e=function(){return K},e.$$arity=0);a.def(d,"$clone",n=function(E){if(null==E)A([],{});else if(!E.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return K},n.$$arity=-1);a.def(d,"$inspect",J=function(){return"nil"}, -J.$$arity=0);a.def(d,"$nil?",D=function(){return!0},D.$$arity=0);a.def(d,"$singleton_class",R=function(){return t(k,"NilClass")},R.$$arity=0);a.def(d,"$to_a",ia=function(){return[]},ia.$$arity=0);a.def(d,"$to_h",ea=function(){return a.hash()},ea.$$arity=0);a.def(d,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(d,"to_f","to_i");a.def(d,"$to_s",b=function(){return""},b.$$arity=0);a.def(d,"$to_c",h=function(){return t(k,"Complex").$new(0,0)},h.$$arity=0);a.def(d,"$rationalize",f=function(E){var F= -a.slice.call(arguments,0,arguments.length).$length();F="number"===typeof F?1"](1);p(F)&&this.$raise(t(k,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(d,"$to_r",q=function(){return this.$Rational(0,1)},q.$$arity=0);return(a.def(d,"$instance_variables",z=function(){return[]},z.$$arity=0),K)&&"instance_variables"})(y[0],null,y);return a.const_set(y[0],"NIL",K)}; -Opal.modules["corelib/boolean"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.klass,A=a.hash2;a.add_stubs(["$raise","$name"]);(function(p,$super,G){p=w(p,$super,"Boolean");var x=[p].concat(G),k,m,u,c,l,H,e,n,J,D;a.defineProperty(p.$$prototype,"$$is_boolean",!0);a.defineProperty(p.$$prototype,"$$meta",p);(function(R,ia){var ea=[R].concat(ia),ma;a.def(R,"$allocate",ma=function(){return this.$raise(t(ea,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return K})(a.get_singleton_class(p), -x);a.def(p,"$__id__",k=function(){return this.valueOf()?2:0},k.$$arity=0);a.alias(p,"object_id","__id__");a.def(p,"$!",m=function(){return 1!=this},m.$$arity=0);a.def(p,"$&",u=function(R){return 1==this?!1!==R&&R!==K:!1},u.$$arity=1);a.def(p,"$|",c=function(R){return 1==this?!0:!1!==R&&R!==K},c.$$arity=1);a.def(p,"$^",l=function(R){return 1==this?!1===R||R===K:!1!==R&&R!==K},l.$$arity=1);a.def(p,"$==",H=function(R){return 1==this===R.valueOf()},H.$$arity=1);a.alias(p,"equal?","==");a.alias(p,"eql?", -"==");a.def(p,"$singleton_class",e=function(){return t(x,"Boolean")},e.$$arity=0);a.def(p,"$to_s",n=function(){return 1==this?"true":"false"},n.$$arity=0);a.def(p,"$dup",J=function(){return this},J.$$arity=0);return(a.def(p,"$clone",D=function(R){if(null==R)A([],{});else if(!R.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},D.$$arity=-1),K)&&"clone"})(y[0],Boolean,y);a.const_set(y[0],"TrueClass",t(y,"Boolean"));a.const_set(y[0],"FalseClass",t(y,"Boolean"));a.const_set(y[0],"TRUE", +Opal.modules["corelib/constants"]=function(a){var y=[],J=a.$$;a.const_set(y[0],"RUBY_PLATFORM","opal");a.const_set(y[0],"RUBY_ENGINE","opal");a.const_set(y[0],"RUBY_VERSION","3.0.0");a.const_set(y[0],"RUBY_ENGINE_VERSION","1.1.1");a.const_set(y[0],"RUBY_RELEASE_DATE","2021-02-23");a.const_set(y[0],"RUBY_PATCHLEVEL",0);a.const_set(y[0],"RUBY_REVISION","0");a.const_set(y[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2021 Adam Beynon and the Opal contributors");return a.const_set(y[0],"RUBY_DESCRIPTION","opal "+ +J(y,"RUBY_ENGINE_VERSION")+" ("+J(y,"RUBY_RELEASE_DATE")+" revision "+J(y,"RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(a){var y=a.top;a.add_stubs(["$require"]);y.$require("corelib/runtime");y.$require("corelib/helpers");y.$require("corelib/module");y.$require("corelib/class");y.$require("corelib/basic_object");y.$require("corelib/kernel");y.$require("corelib/error");return y.$require("corelib/constants")}; +Opal.modules["corelib/nil"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.klass,z=a.hash2,p=a.truthy;a.add_stubs("$raise $name $new $> $length $Rational".split(" "));(function(d,$super,x){d=w(d,$super,"NilClass");var k=[d].concat(x),m,u,c,l,I,e,n,L,D,R,ja,da,ma,b,h,f,q,A;d.$$prototype.$$meta=d;(function(E,G){var M=[E].concat(G),ba;a.def(E,"$allocate",ba=function(){return this.$raise(t(M,"TypeError"),"allocator undefined for "+this.$name())},ba.$$arity=0);a.udef(E,"$new");return J})(a.get_singleton_class(d), +k);a.def(d,"$!",m=function(){return!0},m.$$arity=0);a.def(d,"$&",u=function(){return!1},u.$$arity=1);a.def(d,"$|",c=function(E){return!1!==E&&E!==J},c.$$arity=1);a.def(d,"$^",l=function(E){return!1!==E&&E!==J},l.$$arity=1);a.def(d,"$==",I=function(E){return E===J},I.$$arity=1);a.def(d,"$dup",e=function(){return J},e.$$arity=0);a.def(d,"$clone",n=function(E){if(null==E)z([],{});else if(!E.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return J},n.$$arity=-1);a.def(d,"$inspect",L=function(){return"nil"}, +L.$$arity=0);a.def(d,"$nil?",D=function(){return!0},D.$$arity=0);a.def(d,"$singleton_class",R=function(){return t(k,"NilClass")},R.$$arity=0);a.def(d,"$to_a",ja=function(){return[]},ja.$$arity=0);a.def(d,"$to_h",da=function(){return a.hash()},da.$$arity=0);a.def(d,"$to_i",ma=function(){return 0},ma.$$arity=0);a.alias(d,"to_f","to_i");a.def(d,"$to_s",b=function(){return""},b.$$arity=0);a.def(d,"$to_c",h=function(){return t(k,"Complex").$new(0,0)},h.$$arity=0);a.def(d,"$rationalize",f=function(E){var G= +a.slice.call(arguments,0,arguments.length).$length();G="number"===typeof G?1"](1);p(G)&&this.$raise(t(k,"ArgumentError"));return this.$Rational(0,1)},f.$$arity=-1);a.def(d,"$to_r",q=function(){return this.$Rational(0,1)},q.$$arity=0);return(a.def(d,"$instance_variables",A=function(){return[]},A.$$arity=0),J)&&"instance_variables"})(y[0],null,y);return a.const_set(y[0],"NIL",J)}; +Opal.modules["corelib/boolean"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.klass,z=a.hash2;a.add_stubs(["$raise","$name"]);(function(p,$super,H){p=w(p,$super,"Boolean");var x=[p].concat(H),k,m,u,c,l,I,e,n,L,D;a.defineProperty(p.$$prototype,"$$is_boolean",!0);a.defineProperty(p.$$prototype,"$$meta",p);(function(R,ja){var da=[R].concat(ja),ma;a.def(R,"$allocate",ma=function(){return this.$raise(t(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return J})(a.get_singleton_class(p), +x);a.def(p,"$__id__",k=function(){return this.valueOf()?2:0},k.$$arity=0);a.alias(p,"object_id","__id__");a.def(p,"$!",m=function(){return 1!=this},m.$$arity=0);a.def(p,"$&",u=function(R){return 1==this?!1!==R&&R!==J:!1},u.$$arity=1);a.def(p,"$|",c=function(R){return 1==this?!0:!1!==R&&R!==J},c.$$arity=1);a.def(p,"$^",l=function(R){return 1==this?!1===R||R===J:!1!==R&&R!==J},l.$$arity=1);a.def(p,"$==",I=function(R){return 1==this===R.valueOf()},I.$$arity=1);a.alias(p,"equal?","==");a.alias(p,"eql?", +"==");a.def(p,"$singleton_class",e=function(){return t(x,"Boolean")},e.$$arity=0);a.def(p,"$to_s",n=function(){return 1==this?"true":"false"},n.$$arity=0);a.def(p,"$dup",L=function(){return this},L.$$arity=0);return(a.def(p,"$clone",D=function(R){if(null==R)z([],{});else if(!R.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},D.$$arity=-1),J)&&"clone"})(y[0],Boolean,y);a.const_set(y[0],"TrueClass",t(y,"Boolean"));a.const_set(y[0],"FalseClass",t(y,"Boolean"));a.const_set(y[0],"TRUE", !0);return a.const_set(y[0],"FALSE",!1)}; -Opal.modules["corelib/comparable"]=function(a){function y(x,k){return"number"===typeof x&&"number"===typeof k?x>k:x["$>"](k)}function K(x,k){return"number"===typeof x&&"number"===typeof k?x $< $=== $raise $class $<=> $equal?".split(" "));return function(x,k){function m(ma){return a.is_a(ma,a.Integer)?ma:y(ma,0)?1:K(ma,0)?-1:0}function u(ma,b){var h=ma["$<=>"](b);p(h)&&(ea=b,b=w["$==="](ea)||(!0)["$==="](ea)||(!1)["$==="](ea)|| -A(l,"Integer")["$==="](ea)||A(l,"Float")["$==="](ea)?b.$inspect():b.$$class,c.$raise(A(l,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return m(h)}var c=d(x,"Comparable"),l=[c].concat(k),H,e,n,J,D,R,ia,ea=w;a.def(c,"$==",H=function(ma){var b;return G(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):G(b=this["$<=>"](ma))?0==m(b):!1},H.$$arity=1);a.def(c,"$>",e=function(ma){return 0=", -n=function(ma){return 0<=u(this,ma)},n.$$arity=1);a.def(c,"$<",J=function(ma){return 0>u(this,ma)},J.$$arity=1);a.def(c,"$<=",D=function(ma){return 0>=u(this,ma)},D.$$arity=1);a.def(c,"$between?",R=function(ma,b){return K(this,ma)||y(this,b)?!1:!0},R.$$arity=2);a.def(c,"$clamp",ia=function(ma,b){null==b&&(b=w);if(b===w){a.is_a(ma,a.Range)||this.$raise(A(l,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var h=ma.excl;b=ma.end;ma=ma.begin;b!==w&&h&&this.$raise(A(l,"ArgumentError"), -"cannot clamp with an exclusive range")}ma!==w&&b!==w&&0h)return ma}return b!==w&&(h=u(this,b),0h&&(h+=b.length,0>h))return G["~"]=K;for(var z=a.global_regexp(this);;){f=z.exec(b);if(null===f)return G["~"]=K;if(f.index>= -h)return G["~"]=t(c,"MatchData").$new(z,f),q===K?G["~"]:a.yield1(q,G["~"]);z.lastIndex=f.index+1}},J.$$arity=-2);a.def(k,"$match?",D=function(b,h){this.uninitialized&&this.$raise(t(c,"TypeError"),"uninitialized Regexp");if(void 0===h)return b===K?!1:this.test(w(b,t(c,"String"),"to_str"));h=w(h,t(c,"Integer"),"to_int");if(b===K)return!1;b=w(b,t(c,"String"),"to_str");if(0>h&&(h+=b.length,0>h))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ia.$$arity=0);a.def(k,"$length",ea=function(){return this.matches.length},ea.$$arity=0);a.alias(k,"size","length");a.def(k,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(k,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(k,"$values_at",h=function(f){var q=a.slice.call(arguments,0,arguments.length);var z,E=[];for(z=0;zF&&(F+=this.matches.length,0>F)){E.push(K);continue}E.push(this.matches[F])}return E},h.$$arity=-1),K)&&"values_at"}(y[0],null,y)}; -Opal.modules["corelib/string"]=function(a){function y(l,H){return"number"===typeof l&&"number"===typeof H?l/H:l["$/"](H)}function K(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var t=a.top,w=[],A=a.nil,p=a.$$$,d=a.$$,G=a.coerce_to,x=a.respond_to,k=a.klass,m=a.truthy,u=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); -t.$require("corelib/comparable");t.$require("corelib/regexp");(function(l,$super,e){function n(B){function N(Ua){var Xa="",gb,qb=Ua.length;for(gb=0;gbnb&&J.$raise(d(D,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbB&&this.$raise(d(D,"ArgumentError"),"negative argument");if(0===B)return this.$$cast("");var N="",sa=this.toString();for(268435456<=sa.length*B&&this.$raise(d(D,"RangeError"),"multiply count must not overflow maximum string size");;){1===(B&1)&&(N+=sa);B>>>=1;if(0===B)break;sa+=sa}return this.$$cast(N)},h.$$arity=1);a.def(J,"$+",f=function(B){B=G(B,d(D,"String"), -"to_str");return this+B.$to_s()},f.$$arity=1);a.def(J,"$<=>",q=function(B){if(m(B["$respond_to?"]("to_str")))return B=B.$to_str().$to_s(),this>B?1:this"](this);return B===A?A:0B?1:0},q.$$arity=1);a.def(J,"$==",z=function(B){return B.$$is_string?this.toString()===B.toString():x(B,"$to_str")?B["$=="](this):!1},z.$$arity=1);a.alias(J,"eql?","==");a.alias(J,"===","==");a.def(J,"$=~",E=function(B){B.$$is_string&&this.$raise(d(D,"TypeError"),"type mismatch: String given");return B["$=~"](this)}, -E.$$arity=1);a.def(J,"$[]",F=function(B,N){var sa=this.length;if(B.$$is_range){var Ha=B.excl;N=G(B.end,d(D,"Integer"),"to_int");B=G(B.begin,d(D,"Integer"),"to_int");if(Math.abs(B)>sa)return A;0>B&&(B+=sa);0>N&&(N+=sa);Ha||(N+=1);N-=B;0>N&&(N=0);return this.$$cast(this.substr(B,N))}if(B.$$is_string)return null!=N&&this.$raise(d(D,"TypeError")),-1!==this.indexOf(B)?this.$$cast(B):A;if(B.$$is_regexp){sa=this.match(B);if(null===sa)return c["~"]=A;c["~"]=d(D,"MatchData").$new(B,sa);if(null==N)return this.$$cast(sa[0]); -N=G(N,d(D,"Integer"),"to_int");return 0>N&&-NB&&(B+=sa);if(null==N)return B>=sa||0>B?A:this.$$cast(this.substr(B,1));N=G(N,d(D,"Integer"),"to_int");return 0>N||B>sa||0>B?A:this.$$cast(this.substr(B,N))},F.$$arity=-2);a.alias(J,"byteslice","[]");a.def(J,"$b",L=function(){return this.$force_encoding("binary")},L.$$arity=0);a.def(J,"$capitalize",ca=function(){return this.$$cast(this.charAt(0).toUpperCase()+ -this.substr(1).toLowerCase())},ca.$$arity=0);a.def(J,"$casecmp",va=function(B){var N=this;if(!m(B["$respond_to?"]("to_str")))return A;B=G(B,d(D,"String"),"to_str").$to_s();var sa=/^[\x00-\x7F]*$/;sa.test(N)&&sa.test(B)&&(N=N.toLowerCase(),B=B.toLowerCase());return N["$<=>"](B)},va.$$arity=1);a.def(J,"$casecmp?",Oa=function(B){B=this.$casecmp(B);return B===A?A:0===B},Oa.$$arity=1);a.def(J,"$center",wa=function(B,N){null==N&&(N=" ");B=G(B,d(D,"Integer"),"to_int");N=G(N,d(D,"String"),"to_str").$to_s(); -m(N["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(m(B<=this.length))return this;var sa=this.$ljust(y(K(B,this.length),2).$ceil(),N);B=this.$rjust(y(K(B,this.length),2).$floor(),N);return this.$$cast(B+sa.slice(this.length))},wa.$$arity=-2);a.def(J,"$chars",Ba=function(){var B=Ba.$$p,N=B||A;B&&(Ba.$$p=null);B&&(Ba.$$p=null);return m(N)?u(this,"each_char",[],N.$to_proc()):this.$each_char().$to_a()},Ba.$$arity=0);a.def(J,"$chomp",Ka=function(B){null==c["/"]&&(c["/"]=A);null== -B&&(B=c["/"]);if(m(B===A||0===this.length))return this;B=d(D,"Opal")["$coerce_to!"](B,d(D,"String"),"to_str").$to_s();var N;"\n"===B?N=this.replace(/\r?\n?$/,""):""===B?N=this.replace(/(\r?\n)+$/,""):this.length>=B.length&&this.substr(this.length-B.length,B.length)===B&&(N=this.substr(0,this.length-B.length));return null!=N?this.$$cast(N):this},Ka.$$arity=-1);a.def(J,"$chop",na=function(){var B=this.length;B=1>=B?"":"\n"===this.charAt(B-1)&&"\r"===this.charAt(B-2)?this.substr(0,B-2):this.substr(0, -B-1);return this.$$cast(B)},na.$$arity=0);a.def(J,"$chr",S=function(){return this.charAt(0)},S.$$arity=0);a.def(J,"$clone",ta=function(){var B=new String(this);B.$copy_singleton_methods(this);B.$initialize_clone(this);return B},ta.$$arity=0);a.def(J,"$dup",ja=function(){var B=new String(this);B.$initialize_dup(this);return B},ja.$$arity=0);a.def(J,"$count",oa=function(B){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); -N=n(N);return null===N?0:this.length-this.replace(new RegExp(N,"g"),"").length},oa.$$arity=-1);a.def(J,"$delete",V=function(B){var N=a.slice.call(arguments,0,arguments.length);0===N.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");N=n(N);return null===N?this:this.$$cast(this.replace(new RegExp(N,"g"),""))},V.$$arity=-1);a.def(J,"$delete_prefix",Q=function(B){B.$$is_string||(B=G(B,d(D,"String"),"to_str"));return this.slice(0,B.length)===B?this.$$cast(this.slice(B.length)): -this},Q.$$arity=1);a.def(J,"$delete_suffix",Y=function(B){B.$$is_string||(B=G(B,d(D,"String"),"to_str"));return this.slice(this.length-B.length)===B?this.$$cast(this.slice(0,this.length-B.length)):this},Y.$$arity=1);a.def(J,"$downcase",pa=function(){return this.$$cast(this.toLowerCase())},pa.$$arity=0);a.def(J,"$each_char",za=function(){var B=za.$$p,N=B||A,sa;B&&(za.$$p=null);B&&(za.$$p=null);if(N===A)return u(this,"enum_for",["each_char"],(sa=function(){return(null==sa.$$s?this:sa.$$s).$size()}, -sa.$$s=this,sa.$$arity=0,sa));B=0;for(var Ha=this.length;B=Ca.length&&this.substr(this.length- -Ca.length,Ca.length)==Ca)return!0}return!1},Ea.$$arity=-1);a.alias(J,"equal?","===");a.def(J,"$gsub",Fa=function(B,N){var sa=Fa.$$p,Ha=sa||A,Ca=this;sa&&(Fa.$$p=null);sa&&(Fa.$$p=null);if(void 0===N&&Ha===A)return Ca.$enum_for("gsub",B);sa="";var Ia=A,Wa=0;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=G(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var hb;;){var eb=B.exec(Ca);if(null===eb){c["~"]=A;sa+=Ca.slice(Wa);break}Ia=d(D,"MatchData").$new(B,eb); -if(void 0===N){hb=B.lastIndex;var Ua=Ha(eb[0]);B.lastIndex=hb}else N.$$is_hash?Ua=N["$[]"](eb[0]).$to_s():(N.$$is_string||(N=G(N,d(D,"String"),"to_str")),Ua=N.replace(/([\\]+)([0-9+&`'])/g,function(Xa,gb,qb){if(0===gb.length%2)return Xa;switch(qb){case "+":for(Xa=eb.length-1;0N&&(N+=this.length,0>N))return A;if(B.$$is_regexp)for(sa=a.global_multiline_regexp(B);;){B=sa.exec(this);if(null===B){c["~"]=A;N=-1;break}if(B.index>=N){c["~"]=d(D,"MatchData").$new(sa,B);N=B.index;break}sa.lastIndex=B.index+1}else B=G(B,d(D,"String"),"to_str"),N=0===B.length&&N>this.length?-1:this.indexOf(B,N);return-1===N?A:N},Qa.$$arity=-2);a.def(J,"$inspect",lb=function(){var B={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", -"\n":"\\n","\f":"\\f","\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(N){return B[N]||"\\u"+("0000"+N.charCodeAt(0).toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'},lb.$$arity=0);a.def(J,"$intern",W=function(){return this.toString()},W.$$arity=0);a.def(J,"$lines",ya=function(B){var N=ya.$$p,sa=N||A;null==c["/"]&&(c["/"]=A);N&& -(ya.$$p=null);N&&(ya.$$p=null);null==B&&(B=c["/"]);B=u(this,"each_line",[B],sa.$to_proc());return m(sa)?this:B.$to_a()},ya.$$arity=-1);a.def(J,"$length",Da=function(){return this.length},Da.$$arity=0);a.def(J,"$ljust",Va=function(B,N){null==N&&(N=" ");B=G(B,d(D,"Integer"),"to_int");N=G(N,d(D,"String"),"to_str").$to_s();m(N["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(m(B<=this.length))return this;var sa=-1,Ha="";for(B-=this.length;++sa=Ca||65<=Ca&&90>=Ca||97<=Ca&&122>=Ca)switch(Ca){case 57:Ha=!0;Ca=48;break;case 90:Ha=!0;Ca=65;break;case 122:Ha=!0;Ca=97;break;default:Ha=!1,Ca+=1}else-1===sa?255===Ca?(Ha=!0,Ca=0):(Ha=!1,Ca+=1):Ha=!0;N=N.slice(0,B)+String.fromCharCode(Ca)+N.slice(B+1);if(Ha&&(0===B||B===sa)){switch(Ca){case 65:break;case 97:break;default:Ca+=1}N=0===B?String.fromCharCode(Ca)+N:N.slice(0,B)+String.fromCharCode(Ca)+N.slice(B);Ha=!1}if(!Ha)break}return this.$$cast(N)}, -Aa.$$arity=0);a.def(J,"$oct",ua=function(){var B=this;var N=8;if(/^\s*_/.test(B))return 0;B=B.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(sa,Ha,Ca,Ia){switch(Ia.charAt(0)){case "+":case "-":return sa;case "0":if("x"===Ia.charAt(1)&&"0x"===Ca)return sa}switch(Ca){case "0b":N=2;break;case "0":case "0o":N=8;break;case "0d":N=10;break;case "0x":N=16}return Ha+Ia});B=parseInt(B.replace(/_(?!_)/g,""),N);return isNaN(B)?0:B},ua.$$arity=0);a.def(J,"$ord",La=function(){return this.charCodeAt(0)},La.$$arity= -0);a.def(J,"$partition",Ta=function(B){if(B.$$is_regexp){var N=B.exec(this);null===N?N=-1:(d(D,"MatchData").$new(B,N),B=N[0],N=N.index)}else B=G(B,d(D,"String"),"to_str"),N=this.indexOf(B);return-1===N?[this,"",""]:[this.slice(0,N),this.slice(N,N+B.length),this.slice(N+B.length)]},Ta.$$arity=1);a.def(J,"$reverse",Ya=function(){return this.split("").reverse().join("")},Ya.$$arity=0);a.def(J,"$rindex",Ga=function(B,N){if(void 0===N)N=this.length;else if(N=G(N,d(D,"Integer"),"to_int"),0>N&&(N+=this.length, -0>N))return A;if(B.$$is_regexp){var sa=null;for(B=a.global_multiline_regexp(B);;){var Ha=B.exec(this);if(null===Ha||Ha.index>N)break;sa=Ha;B.lastIndex=sa.index+1}null===sa?(c["~"]=A,N=-1):(d(D,"MatchData").$new(B,sa),N=sa.index)}else B=G(B,d(D,"String"),"to_str"),N=this.lastIndexOf(B,N);return-1===N?A:N},Ga.$$arity=-2);a.def(J,"$rjust",Z=function(B,N){null==N&&(N=" ");B=G(B,d(D,"Integer"),"to_int");N=G(N,d(D,"String"),"to_str").$to_s();m(N["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding"); -if(m(B<=this.length))return this;B=Math.floor(B-this.length);var sa=Array(Math.floor(B/N.length)+1).join(N);return this.$$cast(sa+N.slice(0,B-sa.length)+this)},Z.$$arity=-2);a.def(J,"$rpartition",P=function(B){var N;if(B.$$is_regexp){var sa=null;for(N=a.global_multiline_regexp(B);;){var Ha=N.exec(this);if(null===Ha)break;sa=Ha;N.lastIndex=sa.index+1}null===sa?sa=-1:(d(D,"MatchData").$new(N,sa),B=sa[0],sa=sa.index)}else B=G(B,d(D,"String"),"to_str"),sa=this.lastIndexOf(B);return-1===sa?["","",this]: -[this.slice(0,sa),this.slice(sa,sa+B.length),this.slice(sa+B.length)]},P.$$arity=1);a.def(J,"$rstrip",aa=function(){return this.replace(/[\s\u0000]*$/,"")},aa.$$arity=0);a.def(J,"$scan",T=function(B){var N=T.$$p,sa=N||A;N&&(T.$$p=null);N&&(T.$$p=null);N=[];var Ha=A,Ca;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=G(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Ca=B.exec(this));)Ha=d(D,"MatchData").$new(B,Ca),sa===A?1==Ca.length?N.push(Ca[0]):N.push(Ha.$captures()): -1==Ca.length?sa(Ca[0]):sa.call(this,Ha.$captures()),B.lastIndex===Ca.index&&(B.lastIndex+=1);c["~"]=Ha;return sa!==A?this:N},T.$$arity=1);a.alias(J,"size","length");a.alias(J,"slice","[]");a.def(J,"$split",fa=function(B,N){function sa(){for(hb=0;hbN){if(null!==eb&&""===eb[0]&&-1===B.source.indexOf("(?="))for(hb=0,B=eb.length;hb< -B;hb++)Ia.push("");sa();return Ia}if(null!==eb&&""===eb[0])return Ia.splice(N-1,Ia.length-1,Ia.slice(N-1).join("")),sa(),Ia;if(N>=Ia.length)return sa(),Ia;for(hb=0;null!==eb;){hb++;Wa=B.lastIndex;if(hb+1===N)break;eb=B.exec(Ca)}Ia.splice(N-1,Ia.length-1,Ca.slice(Wa));sa();return Ia},fa.$$arity=-1);a.def(J,"$squeeze",ka=function(B){var N=a.slice.call(arguments,0,arguments.length);if(0===N.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));N=n(N);return null===N?this:this.$$cast(this.replace(new RegExp("("+ -N+")\\1+","g"),"$1"))},ka.$$arity=-1);a.def(J,"$start_with?",g=function(B){var N=a.slice.call(arguments,0,arguments.length);for(var sa=0,Ha=N.length;sa=B?N:N&Math.pow(2,B)-1},ba.$$arity=-1);a.def(J,"$swapcase",v=function(){var B=this.replace(/([a-z]+)|([A-Z]+)/g,function(N,sa){return sa?N.toUpperCase():N.toLowerCase()});return this.constructor===String?B:this.$class().$new(B)},v.$$arity=0);a.def(J,"$to_f",U=function(){if("_"===this.charAt(0))return 0;var B=parseFloat(this.replace(/_/g,""));return isNaN(B)||Infinity==B||-Infinity==B?0:B},U.$$arity=0);a.def(J,"$to_i",qa=function(B){null==B&&(B=10);var N= -this.toLowerCase(),sa=G(B,d(D,"Integer"),"to_int");(1===sa||0>sa||36Xa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Xa)+'" in string transliteration');for(Ua+=1;UaXa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Xa)+'" in string transliteration');for(Ua+=1;UaXa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Xa)+'" in string transliteration');for(Ua+=1;UaXa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Xa)+'" in string transliteration');for(Ua+=1;Uan:e["$>"](n)}function K(e,n){return"number"===typeof e&&"number"===typeof n?e+n:e["$+"](n)}function t(e,n){return"number"===typeof e&&"number"===typeof n?e-n:e["$-"](n)}function w(e,n){return"number"===typeof e&&"number"===typeof n?e<=n:e["$<="](n)}var A=[],p=a.nil,d=a.$$$,G=a.$$,x=a.falsy,k=a.truthy,m=a.coerce_to,u=a.module,c=a.send,l=a.hash2,H=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); -return function(e,n){function J(Z){0===Z.length&&(Z=[p]);1=Z)))return p;var fa=[],ka;this.$each.$$p=function(){var g=G(D,"Opal").$destructure(arguments);a.yield1(aa,g);fa.push(g)};this.$each();if(0===fa.length)return p;if(Z===p)for(;;)for(P=0,ka=fa.length;PZ)&&this.$raise(G(D,"ArgumentError"),"attempt to drop negative size");var P=[],aa=0;this.$each.$$p=function(){Z<=aa&&P.push(G(D,"Opal").$destructure(arguments));aa++};this.$each();return P},E.$$arity=1);a.def(e,"$drop_while",F=function(){var Z=F.$$p,P=Z||p;Z&&(F.$$p=null);Z&&(F.$$p=null);if(P===p)return this.$enum_for("drop_while");var aa=[],T=!0;this.$each.$$p=function(){var fa=G(D,"Opal").$destructure(arguments); -if(T){var ka=a.yield1(P,fa);x(ka)&&(T=!1,aa.push(fa))}else aa.push(fa)};this.$each();return aa},F.$$arity=0);a.def(e,"$each_cons",L=function(Z){var P=L.$$p,aa=P||p,T;P&&(L.$$p=null);P&&(L.$$p=null);k(1!=arguments.length)&&this.$raise(G(D,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");Z=G(D,"Opal").$try_convert(Z,G(D,"Integer"),"to_int");k(0>=Z)&&this.$raise(G(D,"ArgumentError"),"invalid size");if(aa===p)return c(this,"enum_for",["each_cons",Z],(T=function(){var ka=p;var g= -(null==T.$$s?this:T.$$s).$enumerator_size();return k(g["$nil?"]())?p:k(k(ka=g["$=="](0))?ka:"number"===typeof g&&"number"===typeof Z?gZ&&fa.shift();fa.length==Z&&a.yield1(aa,fa.slice(0,Z))};this.$each();return p},L.$$arity=1);a.def(e,"$each_entry",ca=function(Z){var P=ca.$$p,aa=P||p,T;P&&(ca.$$p=null);P&&(ca.$$p=null);P=a.slice.call(arguments, -0,arguments.length);if(aa===p)return c(this,"to_enum",["each_entry"].concat(a.to_a(P)),(T=function(){return(null==T.$$s?this:T.$$s).$enumerator_size()},T.$$s=this,T.$$arity=0,T));this.$each.$$p=function(){var fa=G(D,"Opal").$destructure(arguments);a.yield1(aa,fa)};this.$each.apply(this,P);return this},ca.$$arity=-1);a.def(e,"$each_slice",va=function(Z){var P=va.$$p,aa=P||p,T;P&&(va.$$p=null);P&&(va.$$p=null);Z=m(Z,G(D,"Integer"),"to_int");k(0>=Z)&&this.$raise(G(D,"ArgumentError"),"invalid slice size"); -if(aa===p)return c(this,"enum_for",["each_slice",Z],(T=function(){var ka=null==T.$$s?this:T.$$s;return k(ka["$respond_to?"]("size"))?(ka=ka.$size(),("number"===typeof ka&&"number"===typeof Z?ka/Z:ka["$/"](Z)).$ceil()):p},T.$$s=this,T.$$arity=0,T));var fa=[];this.$each.$$p=function(){var ka=G(D,"Opal").$destructure(arguments);fa.push(ka);fa.length===Z&&(a.yield1(aa,fa),fa=[])};this.$each();0Z)&&this.$raise(G(D,"ArgumentError"),"attempt to take negative size");if(k(0==Z))return[];fa=0;c(this,"each",[],(aa=function(ka){var g=a.slice.call(arguments,0,arguments.length);T.push(G(D,"Opal").$destructure(g));if(k(Z<=++fa))a.ret(T);else return p},aa.$$s=this,aa.$$arity=-1,aa));return T}catch(ka){if(ka===a.returner)return ka.$v;throw ka;}},ta.$$arity=-1);a.alias(e,"flat_map","collect_concat");a.def(e,"$grep",ja=function(Z){var P=ja.$$p,aa=P||p,T,fa= -p;P&&(ja.$$p=null);P&&(ja.$$p=null);fa=[];c(this,"each",[],(T=function(ka){var g=a.slice.call(arguments,0,arguments.length);var C=J(g);if(!k(c(Z,"__send__",["==="].concat(a.to_a(C)))))return p;aa!==p?(k(y(g.$length(),1))&&(g=[g]),g=a.yieldX(aa,a.to_a(g))):k(w(g.$length(),1))&&(g=g["$[]"](0));return fa.$push(g)},T.$$s=this,T.$$arity=-1,T));return fa},ja.$$arity=1);a.def(e,"$grep_v",oa=function(Z){var P=oa.$$p,aa=P||p,T,fa=p;P&&(oa.$$p=null);P&&(oa.$$p=null);fa=[];c(this,"each",[],(T=function(ka){var g= -a.slice.call(arguments,0,arguments.length);var C=J(g);if(k(c(Z,"__send__",["==="].concat(a.to_a(C)))))return p;aa!==p?(k(y(g.$length(),1))&&(g=[g]),g=a.yieldX(aa,a.to_a(g))):k(w(g.$length(),1))&&(g=g["$[]"](0));return fa.$push(g)},T.$$s=this,T.$$arity=-1,T));return fa},oa.$$arity=1);a.def(e,"$group_by",V=function(){var Z=V.$$p,P=Z||p,aa,T=p,fa=p,ka=p;Z&&(V.$$p=null);Z&&(V.$$p=null);if(P===p)return c(this,"enum_for",["group_by"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s= -this,aa.$$arity=0,aa));T=l([],{});this.$each.$$p=function(){var g=G(D,"Opal").$destructure(arguments),C=a.yield1(P,g);k(fa=T["$[]"](C))?C=fa:(ka=[C,[]],c(T,"[]=",a.to_a(ka)),C=ka[t(ka.length,1)]);C["$<<"](g)};this.$each();return T},V.$$arity=0);a.def(e,"$include?",Q=function(Z){try{var P;c(this,"each",[],(P=function(aa){var T=a.slice.call(arguments,0,arguments.length);if(G(D,"Opal").$destructure(T)["$=="](Z))a.ret(!0);else return p},P.$$s=this,P.$$arity=-1,P));return!1}catch(aa){if(aa===a.returner)return aa.$v; -throw aa;}},Q.$$arity=1);a.def(e,"$inject",Y=function(Z,P){var aa=Y.$$p,T=aa||p;aa&&(Y.$$p=null);aa&&(Y.$$p=null);var fa=Z;T!==p&&void 0===P?this.$each.$$p=function(){var ka=G(D,"Opal").$destructure(arguments);void 0!==fa&&(ka=a.yieldX(T,[fa,ka]));fa=ka}:(void 0===P&&(G(D,"Symbol")["$==="](Z)||this.$raise(G(D,"TypeError"),""+Z.$inspect()+" is not a Symbol"),P=Z,fa=void 0),this.$each.$$p=function(){var ka=G(D,"Opal").$destructure(arguments);fa=void 0===fa?ka:fa.$__send__(P,ka)});this.$each();return void 0== -fa?p:fa},Y.$$arity=-1);a.def(e,"$lazy",pa=function(){var Z;return c(d(G(D,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(Z=function(P,aa){null==P&&(P=p);var T=a.slice.call(arguments,1,arguments.length);return c(P,"yield",a.to_a(T))},Z.$$s=this,Z.$$arity=-2,Z))},pa.$$arity=0);a.def(e,"$enumerator_size",za=function(){return k(this["$respond_to?"]("size"))?this.$size():p},za.$$arity=0);a.alias(e,"map","collect");a.def(e,"$max",la=function(Z){var P=la.$$p,aa=P||p,T=this;P&&(la.$$p=null); -P&&(la.$$p=null);if(void 0===Z||Z===p){var fa,ka;T.$each.$$p=function(){var g=G(D,"Opal").$destructure(arguments);void 0===fa?fa=g:(ka=aa!==p?a.yieldX(aa,[g,fa]):g["$<=>"](fa),ka===p&&T.$raise(G(D,"ArgumentError"),"comparison failed"),0"](ka)&&(fa=g,ka=C)};this.$each();return void 0===fa?p:fa},xa.$$arity=-1);a.alias(e,"member?","include?");a.def(e,"$min",Ea=function(Z){var P=Ea.$$p,aa=P||p,T,fa=this;P&&(Ea.$$p= -null);P&&(Ea.$$p=null);null==Z&&(Z=p);if(!k(Z["$nil?"]()))return aa!==p?c(fa,"sort",[],(T=function(g,C){null==g&&(g=p);null==C&&(C=p);return a.yieldX(aa,[g,C])},T.$$s=fa,T.$$arity=2,T)).$take(Z):fa.$sort().$take(Z);var ka;fa.$each.$$p=aa!==p?function(){var g=G(D,"Opal").$destructure(arguments);if(void 0===ka)ka=g;else{var C=aa(g,ka);C===p&&fa.$raise(G(D,"ArgumentError"),"comparison failed");0>C&&(ka=g)}}:function(){var g=G(D,"Opal").$destructure(arguments);void 0===ka?ka=g:0>G(D,"Opal").$compare(g, -ka)&&(ka=g)};fa.$each();return void 0===ka?p:ka},Ea.$$arity=-1);a.def(e,"$min_by",Fa=function(Z){var P=Fa.$$p,aa=P||p,T;P&&(Fa.$$p=null);P&&(Fa.$$p=null);null==Z&&(Z=p);if(!k(aa))return c(this,"enum_for",["min_by",Z],(T=function(){return(null==T.$$s?this:T.$$s).$enumerator_size()},T.$$s=this,T.$$arity=0,T));if(!k(Z["$nil?"]()))return c(this,"sort_by",[],aa.$to_proc()).$take(Z);var fa,ka;this.$each.$$p=function(){var g=G(D,"Opal").$destructure(arguments),C=a.yield1(aa,g);void 0===fa?(fa=g,ka=C):0> -C["$<=>"](ka)&&(fa=g,ka=C)};this.$each();return void 0===fa?p:fa},Fa.$$arity=-1);a.def(e,"$minmax",Sa=function(){var Z=Sa.$$p,P=Z||p,aa,T=this,fa=p;Z&&(Sa.$$p=null);Z&&(Sa.$$p=null);P=function(){return k(fa=P)?fa:c(T,"proc",[],(aa=function(M,ba){null==M&&(M=p);null==ba&&(ba=p);return M["$<=>"](ba)},aa.$$s=T,aa.$$arity=2,aa))}();var ka=p,g=p,C=!0;T.$each.$$p=function(){var M=G(D,"Opal").$destructure(arguments);if(C)ka=g=M,C=!1;else{var ba=P.$call(ka,M);ba===p?T.$raise(G(D,"ArgumentError"),"comparison failed"): -0ba&&(g=M)}};T.$each();return[ka,g]},Sa.$$arity=0);a.def(e,"$minmax_by",Ra=function(){var Z=Ra.$$p,P=Z||p,aa;Z&&(Ra.$$p=null);Z&&(Ra.$$p=null);if(!k(P))return c(this,"enum_for",["minmax_by"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var T=p,fa=p,ka,g;this.$each.$$p=function(){var C=G(D,"Opal").$destructure(arguments),M=a.yield1(P,C);if(void 0===ka||0>M["$<=>"](ka))T= -C,ka=M;if(void 0===g||0"](g))fa=C,g=M};this.$each();return[T,fa]},Ra.$$arity=0);a.def(e,"$none?",Na=function(Z){try{var P=Na.$$p,aa=P||p,T,fa,ka;P&&(Na.$$p=null);P&&(Na.$$p=null);k(void 0!==Z)?c(this,"each",[],(T=function(g){var C=a.slice.call(arguments,0,arguments.length);C=J(C);if(k(c(Z,"public_send",["==="].concat(a.to_a(C)))))a.ret(!1);else return p},T.$$s=this,T.$$arity=-1,T)):aa!==p?c(this,"each",[],(fa=function(g){var C=a.slice.call(arguments,0,arguments.length);if(k(a.yieldX(aa,a.to_a(C))))a.ret(!1); -else return p},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(ka=function(g){var C=a.slice.call(arguments,0,arguments.length);C=G(D,"Opal").$destructure(C);if(k(C))a.ret(!1);else return p},ka.$$s=this,ka.$$arity=-1,ka));return!0}catch(g){if(g===a.returner)return g.$v;throw g;}},Na.$$arity=-1);a.def(e,"$one?",Qa=function(Z){try{var P=Qa.$$p,aa=P||p,T,fa,ka,g=p;P&&(Qa.$$p=null);P&&(Qa.$$p=null);g=0;k(void 0!==Z)?c(this,"each",[],(T=function(C){var M=a.slice.call(arguments,0,arguments.length);M=J(M); -if(k(c(Z,"public_send",["==="].concat(a.to_a(M)))))if(g=K(g,1),k(y(g,1)))a.ret(!1);else return p;else return p},T.$$s=this,T.$$arity=-1,T)):aa!==p?c(this,"each",[],(fa=function(C){var M=a.slice.call(arguments,0,arguments.length);if(!k(a.yieldX(aa,a.to_a(M))))return p;g=K(g,1);if(k(y(g,1)))a.ret(!1);else return p},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(ka=function(C){var M=a.slice.call(arguments,0,arguments.length);if(!k(G(D,"Opal").$destructure(M)))return p;g=K(g,1);if(k(y(g,1)))a.ret(!1); -else return p},ka.$$s=this,ka.$$arity=-1,ka));return g["$=="](1)}catch(C){if(C===a.returner)return C.$v;throw C;}},Qa.$$arity=-1);a.def(e,"$partition",lb=function(){var Z=lb.$$p,P=Z||p,aa;Z&&(lb.$$p=null);Z&&(lb.$$p=null);if(P===p)return c(this,"enum_for",["partition"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var T=[],fa=[];this.$each.$$p=function(){var ka=G(D,"Opal").$destructure(arguments),g=a.yield1(P,ka);k(g)?T.push(ka):fa.push(ka)};this.$each(); -return[T,fa]},lb.$$arity=0);a.alias(e,"reduce","inject");a.def(e,"$reject",W=function(){var Z=W.$$p,P=Z||p,aa;Z&&(W.$$p=null);Z&&(W.$$p=null);if(P===p)return c(this,"enum_for",["reject"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var T=[];this.$each.$$p=function(){var fa=G(D,"Opal").$destructure(arguments),ka=a.yield1(P,fa);x(ka)&&T.push(fa)};this.$each();return T},W.$$arity=0);a.def(e,"$reverse_each",ya=function(){var Z=ya.$$p,P=Z||p,aa;Z&&(ya.$$p= -null);Z&&(ya.$$p=null);if(P===p)return c(this,"enum_for",["reverse_each"],(aa=function(){return(null==aa.$$s?this:aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));var T=[];this.$each.$$p=function(){T.push(arguments)};this.$each();for(Z=T.length-1;0<=Z;Z--)a.yieldX(P,T[Z]);return T},ya.$$arity=0);a.alias(e,"select","find_all");a.def(e,"$slice_before",Da=function(Z){var P=Da.$$p,aa=P||p,T;P&&(Da.$$p=null);P&&(Da.$$p=null);k(void 0===Z&&aa===p)&&this.$raise(G(D,"ArgumentError"),"both pattern and block are given"); -k(void 0!==Z&&aa!==p||1"](ka)},aa.$$s=this,aa.$$arity=2,aa)));return c(T,"sort",[],P.$to_proc())},db.$$arity=0);a.def(e,"$sort_by",$a=function(){var Z=$a.$$p,P=Z||p,aa,T,fa,ka,g=p;Z&&($a.$$p=null);Z&&($a.$$p=null);if(P===p)return c(this,"enum_for",["sort_by"],(aa=function(){return(null==aa.$$s?this: -aa.$$s).$enumerator_size()},aa.$$s=this,aa.$$arity=0,aa));g=c(this,"map",[],(T=function(){var C=G(D,"Opal").$destructure(arguments);return[a.yield1(P,C),C]},T.$$s=this,T.$$arity=0,T));c(g,"sort!",[],(fa=function(C,M){null==C&&(C=p);null==M&&(M=p);return C[0]["$<=>"](M[0])},fa.$$s=this,fa.$$arity=2,fa));return c(g,"map!",[],(ka=function(C){null==C&&(C=p);return C[1]},ka.$$s=this,ka.$$arity=1,ka))},$a.$$arity=0);a.def(e,"$sum",ab=function(Z){var P,aa=ab.$$p,T=aa||p,fa=p;aa&&(ab.$$p=null);null==Z&&(Z= -0);fa=Z;c(this,"each",[],(P=function(ka){var g=a.slice.call(arguments,0,arguments.length);g=T!==p?a.yieldX(T,a.to_a(g)):G(D,"Opal").$destructure(g);return fa=K(fa,g)},P.$$s=this,P.$$arity=-1,P));return fa},ab.$$arity=-1);a.def(e,"$take",Aa=function(Z){return this.$first(Z)},Aa.$$arity=1);a.def(e,"$take_while",ua=function(){try{var Z=ua.$$p,P=Z||p,aa,T=p;Z&&(ua.$$p=null);Z&&(ua.$$p=null);if(!k(P))return this.$enum_for("take_while");T=[];return c(this,"each",[],(aa=function(fa){var ka=a.slice.call(arguments, -0,arguments.length);ka=G(D,"Opal").$destructure(ka);k(a.yield1(P,ka))||a.ret(T);return T.push(ka)},aa.$$s=this,aa.$$arity=-1,aa))}catch(fa){if(fa===a.returner)return fa.$v;throw fa;}},ua.$$arity=0);a.def(e,"$uniq",La=function(){var Z=La.$$p,P=Z||p,aa,T=p;Z&&(La.$$p=null);Z&&(La.$$p=null);T=l([],{});c(this,"each",[],(aa=function(fa){var ka=a.slice.call(arguments,0,arguments.length);ka=G(D,"Opal").$destructure(ka);var g=P!==p?a.yield1(P,ka):ka;if(k(T["$key?"](g)))return p;ka=[g,ka];c(T,"[]=",a.to_a(ka)); -return ka[t(ka.length,1)]},aa.$$s=this,aa.$$arity=-1,aa));return T.$values()},La.$$arity=0);a.def(e,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(e,"to_a","entries");a.def(e,"$to_h",Ya=function(Z){var P=Ya.$$p,aa=P||p,T=this;P&&(Ya.$$p=null);P&&(Ya.$$p=null);P=a.slice.call(arguments,0,arguments.length);if(aa!==p)return c(c(T,"map",[],aa.$to_proc()),"to_h",a.to_a(P));var fa=l([],{});T.$each.$$p=function(){var ka= -G(D,"Opal").$destructure(arguments);ka=G(D,"Opal")["$coerce_to?"](ka,G(D,"Array"),"to_ary");ka.$$is_array||T.$raise(G(D,"TypeError"),"wrong element type "+ka.$class()+" (expected array)");2!==ka.length&&T.$raise(G(D,"ArgumentError"),"wrong array length (expected 2, was "+ka.$length()+")");a.hash_put(fa,ka[0],ka[1])};T.$each.apply(T,P);return fa},Ya.$$arity=-1);a.def(e,"$zip",Ga=function(Z){var P=Ga.$$p;P&&(Ga.$$p=null);P&&(Ga.$$p=null);P=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(), -"zip",a.to_a(P))},Ga.$$arity=-1)}(A[0],A)}; -Opal.modules["corelib/enumerator"]=function(a){function y(H,e){return"number"===typeof H&&"number"===typeof e?H+e:H["$+"](e)}function K(H,e){return"number"===typeof H&&"number"===typeof e?H")},h.$$arity=0);(function(f,$super,z){f=u(f,$super,"Generator");var E=[f].concat(z),F,L;f.$$prototype.block=A;f.$include(p(E,"Enumerable"));a.def(f,"$initialize",F=function(){var ca=F.$$p,va=ca||A;ca&&(F.$$p=null);ca&&(F.$$p=null);k(va)||this.$raise(p(E,"LocalJumpError"),"no block given");return this.block=va},F.$$arity=0);return(a.def(f,"$each",L=function(ca){var va=L.$$p,Oa=va||A;va&&(L.$$p=null);va&&(L.$$p=null); -va=a.slice.call(arguments,0,arguments.length);Oa=c(p(E,"Yielder"),"new",[],Oa.$to_proc());try{va.unshift(Oa),a.yieldX(this.block,va)}catch(wa){if(wa===d)return d.$v;throw wa;}return this},L.$$arity=-1),A)&&"each"})(J[0],null,J);(function(f,$super,z){f=u(f,$super,"Yielder");[f].concat(z);var E,F,L;f.$$prototype.block=A;a.def(f,"$initialize",E=function(){var ca=E.$$p,va=ca||A;ca&&(E.$$p=null);ca&&(E.$$p=null);return this.block=va},E.$$arity=0);a.def(f,"$yield",F=function(ca){var va=a.slice.call(arguments, -0,arguments.length);va=a.yieldX(this.block,va);if(va===d)throw d;return va},F.$$arity=-1);return(a.def(f,"$<<",L=function(ca){var va=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(va));return this},L.$$arity=-1),A)&&"<<"})(J[0],null,J);(function(f,$super,z){f=u(f,$super,"Lazy");var E=[f].concat(z),F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa;f.$$prototype.enumerator=A;(function(V,$super,Y){[u(V,$super,"StopLazyError")].concat(Y);return A})(E[0],p(E,"Exception"),E);a.def(f,"$initialize",F= -function(V,Q){var Y=F.$$p,pa=Y||A,za;Y&&(F.$$p=null);Y&&(F.$$p=null);null==Q&&(Q=A);pa===A&&this.$raise(p(E,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=V;return l(this,a.find_super_dispatcher(this,"initialize",F,!1,!0),"initialize",[Q],(za=function(la,xa){var Ea=null==za.$$s?this:za.$$s,Fa;null==la&&(la=A);var Sa=a.slice.call(arguments,1,arguments.length);try{return c(V,"each",a.to_a(Sa),(Fa=function(Ra){var Na=a.slice.call(arguments,0,arguments.length);Na.unshift(la); -a.yieldX(pa,Na)},Fa.$$s=Ea,Fa.$$arity=-1,Fa))}catch(Ra){if(a.rescue(Ra,[p(E,"Exception")]))try{return A}finally{a.pop_exception()}else throw Ra;}},za.$$s=this,za.$$arity=-2,za))},F.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",L=function(){return this},L.$$arity=0);a.def(f,"$collect",ca=function(){var V=ca.$$p,Q=V||A,Y;V&&(ca.$$p=null);V&&(ca.$$p=null);k(Q)||this.$raise(p(E,"ArgumentError"),"tried to call lazy map without a block");return c(p(E,"Lazy"),"new",[this,this.$enumerator_size()], -(Y=function(pa,za){null==pa&&(pa=A);var la=a.slice.call(arguments,1,arguments.length);la=a.yieldX(Q,la);pa.$yield(la)},Y.$$s=this,Y.$$arity=-2,Y))},ca.$$arity=0);a.def(f,"$collect_concat",va=function(){var V=va.$$p,Q=V||A,Y;V&&(va.$$p=null);V&&(va.$$p=null);k(Q)||this.$raise(p(E,"ArgumentError"),"tried to call lazy map without a block");return c(p(E,"Lazy"),"new",[this,A],(Y=function(pa,za){var la=null==Y.$$s?this:Y.$$s,xa,Ea;null==pa&&(pa=A);var Fa=a.slice.call(arguments,1,arguments.length);Fa=a.yieldX(Q, -Fa);Fa["$respond_to?"]("force")&&Fa["$respond_to?"]("each")?c(Fa,"each",[],(xa=function(Sa){null==Sa&&(Sa=A);return pa.$yield(Sa)},xa.$$s=la,xa.$$arity=1,xa)):p(E,"Opal").$try_convert(Fa,p(E,"Array"),"to_ary")===A?pa.$yield(Fa):c(Fa,"each",[],(Ea=function(Sa){null==Sa&&(Sa=A);return pa.$yield(Sa)},Ea.$$s=la,Ea.$$arity=1,Ea))},Y.$$s=this,Y.$$arity=-2,Y))},va.$$arity=0);a.def(f,"$drop",Oa=function(V){var Q,Y=A,pa=Y=A;V=m(V,p(E,"Integer"),"to_int");k(K(V,0))&&this.$raise(p(E,"ArgumentError"),"attempt to drop negative size"); -Y=this.$enumerator_size();Y=k(p(E,"Integer")["$==="](Y))?k(K(V,Y))?V:Y:Y;pa=0;return c(p(E,"Lazy"),"new",[this,Y],(Q=function(za,la){null==za&&(za=A);var xa=a.slice.call(arguments,1,arguments.length);return k(K(pa,V))?pa=y(pa,1):c(za,"yield",a.to_a(xa))},Q.$$s=this,Q.$$arity=-2,Q))},Oa.$$arity=1);a.def(f,"$drop_while",wa=function(){var V=wa.$$p,Q=V||A,Y,pa=A;V&&(wa.$$p=null);V&&(wa.$$p=null);k(Q)||this.$raise(p(E,"ArgumentError"),"tried to call lazy drop_while without a block");pa=!0;return c(p(E, -"Lazy"),"new",[this,A],(Y=function(za,la){null==za&&(za=A);var xa=a.slice.call(arguments,1,arguments.length);if(k(pa)){var Ea=a.yieldX(Q,xa);x(Ea)&&(pa=!1,c(za,"yield",a.to_a(xa)))}else return c(za,"yield",a.to_a(xa))},Y.$$s=this,Y.$$arity=-2,Y))},wa.$$arity=0);a.def(f,"$enum_for",Ba=function(V,Q){var Y=Ba.$$p,pa=Y||A;Y&&(Ba.$$p=null);Y&&(Ba.$$p=null);Y=a.slice.call(arguments,0,arguments.length);if(0"},oa.$$arity=0),A)&&"inspect"})(J[0],H,J);return function(f,$super,z){[u(f,$super,"ArithmeticSequence")].concat(z);return A}(J[0],H,J)}(w[0],null,w)}; -Opal.modules["corelib/numeric"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function K(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c".split(" ")); -A.$require("corelib/comparable");return function(c,$super,H){c=k(c,$super,"Numeric");var e=[c].concat(H),n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra;c.$include(x(e,"Comparable"));a.def(c,"$coerce",n=function(Na){return m(Na["$instance_of?"](this.$class()))?[Na,this]:[this.$Float(Na),this.$Float(this)]},n.$$arity=1);a.def(c,"$__coerced__",J=function(Na,Qa){if(m(Qa["$respond_to?"]("coerce"))){Qa=Qa.$coerce(this);var lb=a.to_ary(Qa);var W=null==lb[0]? -d:lb[0];lb=null==lb[1]?d:lb[1];Qa;return W.$__send__(Na,lb)}return"+"["$==="](Na)||"-"["$==="](Na)||"*"["$==="](Na)||"/"["$==="](Na)||"%"["$==="](Na)||"&"["$==="](Na)||"|"["$==="](Na)||"^"["$==="](Na)||"**"["$==="](Na)?this.$raise(x(e,"TypeError"),""+Qa.$class()+" can't be coerced into Numeric"):">"["$==="](Na)||">="["$==="](Na)||"<"["$==="](Na)||"<="["$==="](Na)||"<=>"["$==="](Na)?this.$raise(x(e,"ArgumentError"),"comparison of "+this.$class()+" with "+Qa.$class()+" failed"):d},J.$$arity=2);a.def(c, -"$<=>",D=function(Na){return m(this["$equal?"](Na))?0:d},D.$$arity=1);a.def(c,"$+@",R=function(){return this},R.$$arity=0);a.def(c,"$-@",ia=function(){return y(0,this)},ia.$$arity=0);a.def(c,"$%",ea=function(Na){return y(this,K(Na,this.$div(Na)))},ea.$$arity=1);a.def(c,"$abs",ma=function(){return t(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return K(this,this)},b.$$arity=0);a.def(c,"$angle",h=function(){return t(this,0)?G(x(e,"Math"),"PI"):0},h.$$arity=0);a.alias(c,"arg", -"angle");a.def(c,"$ceil",f=function(Na){null==Na&&(Na=0);return this.$to_f().$ceil(Na)},f.$$arity=-1);a.def(c,"$conj",q=function(){return this},q.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",z=function(){return this.$to_r().$denominator()},z.$$arity=0);a.def(c,"$div",E=function(Na){Na["$=="](0)&&this.$raise(x(e,"ZeroDivisionError"),"divided by o");return w(this,Na).$floor()},E.$$arity=1);a.def(c,"$divmod",F=function(Na){return[this.$div(Na),this["$%"](Na)]},F.$$arity=1);a.def(c, -"$fdiv",L=function(Na){return w(this.$to_f(),Na)},L.$$arity=1);a.def(c,"$floor",ca=function(Na){null==Na&&(Na=0);return this.$to_f().$floor(Na)},ca.$$arity=-1);a.def(c,"$i",va=function(){return this.$Complex(0,this)},va.$$arity=0);a.def(c,"$imag",Oa=function(){return 0},Oa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",wa=function(){return!1},wa.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Ba=function(){return m(this["$zero?"]())?d:this},Ba.$$arity= -0);a.def(c,"$numerator",Ka=function(){return this.$to_r().$numerator()},Ka.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",na=function(){return[this.$abs(),this.$arg()]},na.$$arity=0);a.def(c,"$quo",S=function(Na){return w(x(e,"Opal")["$coerce_to!"](this,x(e,"Rational"),"to_r"),Na)},S.$$arity=1);a.def(c,"$real",ta=function(){return this},ta.$$arity=0);a.def(c,"$real?",ja=function(){return!0},ja.$$arity=0);a.def(c,"$rect",oa=function(){return[this,0]},oa.$$arity=0);a.alias(c,"rectangular","rect"); -a.def(c,"$round",V=function(Na){return this.$to_f().$round(Na)},V.$$arity=-1);a.def(c,"$to_c",Q=function(){return this.$Complex(this,0)},Q.$$arity=0);a.def(c,"$to_int",Y=function(){return this.$to_i()},Y.$$arity=0);a.def(c,"$truncate",pa=function(Na){null==Na&&(Na=0);return this.$to_f().$truncate(Na)},pa.$$arity=-1);a.def(c,"$zero?",za=function(){return this["$=="](0)},za.$$arity=0);a.def(c,"$positive?",la=function(){return"number"===typeof this?0"](0)},la.$$arity=0);a.def(c,"$negative?", -xa=function(){return t(this,0)},xa.$$arity=0);a.def(c,"$dup",Ea=function(){return this},Ea.$$arity=0);a.def(c,"$clone",Fa=function(Na){if(null==Na)u([],{});else if(!Na.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Fa.$$arity=-1);a.def(c,"$finite?",Sa=function(){return!0},Sa.$$arity=0);return(a.def(c,"$infinite?",Ra=function(){return d},Ra.$$arity=0),d)&&"infinite?"}(p[0],null,p)}; -Opal.modules["corelib/array"]=function(a){function y(ia,ea){return"number"===typeof ia&&"number"===typeof ea?ia>ea:ia["$>"](ea)}var K=a.top,t=[],w=a.nil,A=a.$$$,p=a.$$,d=a.truthy,G=a.falsy,x=a.hash_ids,k=a.yield1,m=a.hash_get,u=a.hash_put,c=a.hash_delete,l=a.coerce_to,H=a.respond_to,e=a.klass,n=a.hash2,J=a.send2,D=a.send,R=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); -K.$require("corelib/enumerable");K.$require("corelib/numeric");return function(ia,$super,ma){function b(r,I){return I.$$name===a.Array?r:I.$allocate().$replace(r.$to_a())}function h(r,I,O){for(var da,ha=null,ra=Array(r.length),Pa=0,fb=0,Za=r.length;Paha&&(ha+=O,0>ha)||ha>O)return w;if(0>I&&(I+=O,0>I))return[];da||(I+=1);O=r.slice(ha,I);return b(O,r.$class())}function q(r,I,O){var da=r.length;I=l(I,a.Integer,"to_int");if(0>I&&(I+=da,0>I))return w;if(void 0===O)return I>=da||0>I?w:r[I];O=l(O,a.Integer,"to_int");if(0>O||I>da||0>I)return w;I=r.slice(I,I+O);return b(I,r.$class())}function z(r,I){return r===I||0===I?1:0I?z(r-1,I-1)+z(r-1,I):0}var E=e(ia,$super,"Array"),F=[E].concat(ma),L,ca,va,Oa,wa,Ba,Ka,na, -S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb,W,ya,Da,Va,ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T,fa,ka,g,C,M,ba,v,U,qa,Ja,jb,ob,mb,sb,tb,wb,xb,ub,X,Ma,bb,B,N,sa,Ha,Ca,Ia,Wa,hb,eb,Ua,Xa,gb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;E.$include(p(F,"Enumerable"));a.defineProperty(E.$$prototype,"$$is_array",!0);a.defs(E,"$[]",L=function(r){var I=a.slice.call(arguments,0,arguments.length);return b(I,this)},L.$$arity=-1);a.def(E,"$initialize",ca=function(r,I){var O=ca.$$p,da=O||w;O&&(ca.$$p=null); -O&&(ca.$$p=null);null==r&&(r=w);null==I&&(I=w);I!==w&&da!==w&&this.$warn("warning: block supersedes default value argument");r>A(p(F,"Integer"),"MAX")&&this.$raise(p(F,"ArgumentError"),"array size too big");2r&&this.$raise(p(F,"ArgumentError"),"negative array size");this.splice(0,this.length);if(da===w)for(O=0;Or)&&this.$raise(p(F, -"ArgumentError"),"negative argument");for(var I=[],O=this.$to_a(),da=0;da",ta=function(r){if(d(p(F,"Array")["$==="](r)))r=r.$to_a();else if(d(r["$respond_to?"]("to_ary")))r=r.$to_ary().$to_a();else return w;if(this.$hash()===r.$hash())return 0;for(var I=Math.min(this.length,r.length),O=0;O"](r[O]);if(0!==da)return da}return this.length["$<=>"](r.length)},ta.$$arity= -1);a.def(E,"$==",ja=function(r){function I(da,ha){var ra;if(da===ha)return!0;if(!ha.$$is_array)return H(ha,"$to_ary")?ha["$=="](da):!1;da.$$constructor!==Array&&(da=da.$to_a());ha.$$constructor!==Array&&(ha=ha.$to_a());if(da.length!==ha.length)return!1;O[da.$object_id()]=!0;var Pa=0;for(ra=da.length;PaO&&(O+=ha,0>O&&this.$raise(p(F,"RangeError"),""+r.$inspect()+" out of range"));0>Pa&&(Pa+=ha);ra|| -(Pa+=1);if(O>ha)for(;haPa?this.splice.apply(this,[O,0].concat(da)):this.splice.apply(this,[O,Pa-O].concat(da))}else{d(void 0===O)?Pa=1:(Pa=I,I=O,da=d(p(F,"Array")["$==="](I))?I.$to_a():d(I["$respond_to?"]("to_ary"))?I.$to_ary().$to_a():[I]);r=l(r,p(F,"Integer"),"to_int");Pa=l(Pa,p(F,"Integer"),"to_int");0>r&&(ra=r,r+=ha,0>r&&this.$raise(p(F,"IndexError"),"index "+ra+" too small for array; minimum "+-this.length));0>Pa&&this.$raise(p(F,"IndexError"),"negative length ("+Pa+")"); -if(r>ha)for(;har&&(r+=this.length);return 0>r||r>=this.length?w:this[r]},pa.$$arity=1);a.def(E,"$bsearch_index",za=function(){var r=za.$$p,I=r||w;r&&(za.$$p=null);r&&(za.$$p=null);if(I===w)return this.$enum_for("bsearch_index");r=0;for(var O=this.length,da,ha,ra=!1,Pa=w;rha}else this.$raise(p(F, -"TypeError"),"wrong argument type "+ha.$class()+" (must be numeric, true, false or nil)");ra?O=da:r=da+1}return Pa},za.$$arity=0);a.def(E,"$bsearch",la=function(){var r=la.$$p,I=r||w;r&&(la.$$p=null);r&&(la.$$p=null);if(I===w)return this.$enum_for("bsearch");r=D(this,"bsearch_index",[],I.$to_proc());return null!=r&&r.$$is_number?this[r]:r},la.$$arity=0);a.def(E,"$cycle",xa=function(r){var I=xa.$$p,O=I||w,da,ha=w;I&&(xa.$$p=null);I&&(xa.$$p=null);null==r&&(r=w);if(O===w)return D(this,"enum_for",["cycle", -r],(da=function(){var ra=null==da.$$s?this:da.$$s;if(d(r["$nil?"]()))return A(p(F,"Float"),"INFINITY");r=p(F,"Opal")["$coerce_to!"](r,p(F,"Integer"),"to_int");return d(y(r,0))?(ra=ra.$enumerator_size(),"number"===typeof ra&&"number"===typeof r?ra*r:ra["$*"](r)):0},da.$$s=this,da.$$arity=0,da));if(d(d(ha=this["$empty?"]())?ha:r["$=="](0)))return w;if(r===w)for(;;)for(I=0,ha=this.length;I=r)return this;for(;0r&&(r+=this.length);if(0>r||r>= -this.length)return w;var I=this[r];this.splice(r,1);return I},ib.$$arity=1);a.def(E,"$delete_if",db=function(){var r=db.$$p,I=r||w,O;r&&(db.$$p=null);r&&(db.$$p=null);if(I===w)return D(this,"enum_for",["delete_if"],(O=function(){return(null==O.$$s?this:O.$$s).$size()},O.$$s=this,O.$$arity=0,O));h(this,G,I);return this},db.$$arity=0);a.alias(E,"difference","-");a.def(E,"$dig",$a=function(r,I){var O=a.slice.call(arguments,1,arguments.length);var da=this["$[]"](r);if(da===w||0===O.length)return da;d(da["$respond_to?"]("dig"))|| -this.$raise(p(F,"TypeError"),""+da.$class()+" does not have #dig method");return D(da,"dig",a.to_a(O))},$a.$$arity=-2);a.def(E,"$drop",ab=function(r){0>r&&this.$raise(p(F,"ArgumentError"));return this.slice(r)},ab.$$arity=1);a.def(E,"$dup",Aa=function(){var r=Aa.$$p,I;r&&(Aa.$$p=null);var O=0;var da=arguments.length;for(I=Array(da);Or&&(r+=this.length);if(0<=r&&rha)&&(ha+=this.length),d(0>ha)&&this.$raise(p(F,"RangeError"),""+I.$inspect()+" out of range"), -ra=l(I.end,p(F,"Integer"),"to_int"),d(0>ra)&&(ra+=this.length),d(I["$exclude_end?"]())||(ra+=1),d(ra<=ha))return this}else if(d(I))if(ha=l(I,p(F,"Integer"),"to_int"),d(0>ha)&&(ha+=this.length),d(0>ha)&&(ha=0),d(ra)){ra=l(ra,p(F,"Integer"),"to_int");if(d(0==ra))return this;ra+=ha}else ra=this.length;else ha=0,ra=this.length;if(d(ha>this.length))for(I=this.length;Ithis.length)&&(this.length=ra);if(d(O))for(;har&&this.$raise(p(F,"ArgumentError"),"negative array size");return this.slice(0,r)},P.$$arity=-1);a.def(E,"$flatten",aa=function(r){function I(da,ha){var ra=[],Pa;da=da.$to_a();var fb=0;for(Pa=da.length;fbr&&(r+=this.length+1,0>r&&this.$raise(p(F,"IndexError"),""+r+" is out of bounds"));if(r>this.length)for(var da=this.length;dar&&this.$raise(p(F,"ArgumentError"),"negative array size");r>this.length&&(r=this.length);return this.slice(this.length-r,this.length)},U.$$arity=-1);a.def(E,"$length",qa=function(){return this.length}, -qa.$$arity=0);a.alias(E,"map","collect");a.alias(E,"map!","collect!");a.def(E,"$max",Ja=function(r){var I=Ja.$$p,O=I||w;I&&(Ja.$$p=null);I&&(Ja.$$p=null);return D(this.$each(),"max",[r],O.$to_proc())},Ja.$$arity=-1);a.def(E,"$min",jb=function(){var r=jb.$$p,I=r||w;r&&(jb.$$p=null);r&&(jb.$$p=null);return D(this.$each(),"min",[],I.$to_proc())},jb.$$arity=0);a.def(E,"$permutation",ob=function(r){var I=ob.$$p,O=I||w,da,ha=this,ra=w,Pa=w;I&&(ob.$$p=null);I&&(ob.$$p=null);if(O===w)return D(ha,"enum_for", -["permutation",r],(da=function(){var kb=null==da.$$s?this:da.$$s,vb=kb.length;kb=void 0===r?kb.length:r;for(var yb=0<=kb?1:0;kb;)yb*=vb,vb--,kb--;return yb},da.$$s=ha,da.$$arity=0,da));var fb;r=void 0===r?ha.length:l(r,p(F,"Integer"),"to_int");if(!(0>r||ha.length="](0))?Pa.$size()["$**"](ra):0},O.$$s=this,O.$$arity=0,O));I(ra,[],this.slice());return this},mb.$$arity=1);a.def(E,"$pop",sb=function(r){if(d(void 0===r))return d(0===this.length)?w:this.pop();r=l(r,p(F,"Integer"),"to_int");d(0>r)&&this.$raise(p(F,"ArgumentError"),"negative array size");return d(0===this.length)?[]:d(1===r)?[this.pop()]:d(r> -this.length)?this.splice(0,this.length):this.splice(this.length-r,this.length)},sb.$$arity=-1);a.def(E,"$product",tb=function(r){var I=tb.$$p,O=I||w;I&&(tb.$$p=null);I&&(tb.$$p=null);var da=a.slice.call(arguments,0,arguments.length);I=O!==w?null:[];var ha=da.length+1,ra=Array(ha),Pa=Array(ha),fb=Array(ha),Za;var kb=1;fb[0]=this;for(Za=1;Za--Za)break a;ra[Za]++}}return I||this},tb.$$arity=-1);a.def(E,"$push",wb=function(r){var I=a.slice.call(arguments,0,arguments.length);for(var O=0,da=I.length;O=this.length);I--){if(this[I]["$=="](r))return I}else if(O!==w)for(I=this.length-1;0<=I&&!(I>=this.length);I--){if(r=O(this[I]),!1!==r&&r!==w)return I}else if(null==r)return this.$enum_for("rindex");return w},sa.$$arity=-1);a.def(E,"$rotate",Ha=function(r){null==r&&(r=1);r=l(r,p(F,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var I=this.slice();var O=r%I.length;r=I.slice(O);I=I.slice(0,O);return r.concat(I)},Ha.$$arity=-1); -a.def(E,"$rotate!",Ca=function(r){null==r&&(r=1);if(0===this.length||1===this.length)return this;r=l(r,p(F,"Integer"),"to_int");r=this.$rotate(r);return this.$replace(r)},Ca.$$arity=-1);(function(r,$super,O){r=e(r,$super,"SampleRandom");var da=[r].concat(O),ha,ra;r.$$prototype.rng=w;a.def(r,"$initialize",ha=function(Pa){return this.rng=Pa},ha.$$arity=1);return(a.def(r,"$rand",ra=function(Pa){var fb=l(this.rng.$rand(Pa),p(da,"Integer"),"to_int");d(0>fb)&&this.$raise(p(da,"RangeError"),"random value must be >= 0"); -d(fbr:O)&&this.$raise(p(F,"ArgumentError"),"count must be greater than 0"); -d(I)&&(da=I["$[]"]("random"));da=d(d(ha=da)?da["$respond_to?"]("rand"):ha)?p(F,"SampleRandom").$new(da):p(F,"Kernel");if(!d(r))return this[da.$rand(this.length)];r>this.length&&(r=this.length);switch(r){case 0:return[];case 1:return[this[da.$rand(this.length)]];case 2:var ra=da.$rand(this.length);var Pa=da.$rand(this.length);ra===Pa&&(Pa=0===ra?ra+1:ra-1);return[this[ra],this[Pa]];default:if(3r)&&this.$raise(p(F,"ArgumentError"),"negative array size");return d(0===this.length)?[]:this.splice(0,r)},eb.$$arity=-1);a.alias(E,"size","length");a.def(E,"$shuffle",Ua=function(r){return this.$dup().$to_a()["$shuffle!"](r)},Ua.$$arity=-1);a.def(E,"$shuffle!",Xa=function(r){var I,O=this.length;void 0!== -r&&(r=p(F,"Opal")["$coerce_to?"](r,p(F,"Hash"),"to_hash"),r!==w&&(r=r["$[]"]("random"),r!==w&&r["$respond_to?"]("rand")&&(I=r)));for(;O;){I?(r=I.$rand(O).$to_int(),0>r&&this.$raise(p(F,"RangeError"),"random number too small "+r),r>=O&&this.$raise(p(F,"RangeError"),"random number too big "+r)):r=this.$rand(O);var da=this[--O];this[O]=this[r];this[r]=da}return this},Xa.$$arity=-1);a.alias(E,"slice","[]");a.def(E,"$slice!",gb=function(r,I){if(d(void 0===I))if(d(p(F,"Range")["$==="](r))){var O=this["$[]"](r); -I=l(r.begin,p(F,"Integer"),"to_int");var da=l(r.end,p(F,"Integer"),"to_int");0>I&&(I+=this.length);0>da?da+=this.length:da>=this.length&&(da=this.length-1,r.excl&&(da+=1));var ha=da-I;r.excl?--da:ha+=1;Ir&&(r+=this.length);if(0>r||r>=this.length)return w;O=this[r];0===r?this.shift():this.splice(r,1)}else{r=l(r,p(F,"Integer"),"to_int");I=l(I,p(F,"Integer"),"to_int");if(0>I)return w;O=this["$[]"](r, -I);0>r&&(r+=this.length);r+I>this.length&&(I=this.length-r);r"](ha)});return O.slice().sort(function(da,ha){var ra=I(da,ha);ra===w&&O.$raise(p(F,"ArgumentError"),"comparison of "+da.$inspect()+" with "+ha.$inspect()+" failed");return y(ra,0)?1:("number"===typeof ra?0>ra:ra["$<"](0))? --1:0})},qb.$$arity=0);a.def(E,"$sort!",nb=function(){var r=nb.$$p,I=r||w;r&&(nb.$$p=null);r&&(nb.$$p=null);r=I!==w?D(this.slice(),"sort",[],I.$to_proc()):this.slice().$sort();I=this.length=0;for(var O=r.length;Ir&&this.$raise(p(F,"ArgumentError"));return this.slice(0,r)},Gb.$$arity=1);a.def(E,"$take_while",Ab=function(){var r=Ab.$$p,I=r||w;r&&(Ab.$$p=null);r&&(Ab.$$p=null);r=[];for(var O=0,da=this.length,ha,ra;OZa)return Za+=ra.length,w;0>fb&&(fb+=ra.length);ha["$exclude_end?"]()&&fb--;return fbk:x["$>"](k)}function J(x,k){return"number"===typeof x&&"number"===typeof k?x $< $=== $raise $class $<=> $equal?".split(" "));return function(x,k){function m(ma){return a.is_a(ma,a.Integer)?ma:y(ma,0)?1:J(ma,0)?-1:0}function u(ma,b){var h=ma["$<=>"](b);p(h)&&(da=b,b=w["$==="](da)||(!0)["$==="](da)||(!1)["$==="](da)|| +z(l,"Integer")["$==="](da)||z(l,"Float")["$==="](da)?b.$inspect():b.$$class,c.$raise(z(l,"ArgumentError"),"comparison of "+ma.$class()+" with "+b+" failed"));return m(h)}var c=d(x,"Comparable"),l=[c].concat(k),I,e,n,L,D,R,ja,da=w;a.def(c,"$==",I=function(ma){var b;return H(this["$equal?"](ma))?!0:this["$<=>"]==a.Kernel["$<=>"]?!1:this.$$comparable?(delete this.$$comparable,!1):H(b=this["$<=>"](ma))?0==m(b):!1},I.$$arity=1);a.def(c,"$>",e=function(ma){return 0=", +n=function(ma){return 0<=u(this,ma)},n.$$arity=1);a.def(c,"$<",L=function(ma){return 0>u(this,ma)},L.$$arity=1);a.def(c,"$<=",D=function(ma){return 0>=u(this,ma)},D.$$arity=1);a.def(c,"$between?",R=function(ma,b){return J(this,ma)||y(this,b)?!1:!0},R.$$arity=2);a.def(c,"$clamp",ja=function(ma,b){null==b&&(b=w);if(b===w){a.is_a(ma,a.Range)||this.$raise(z(l,"TypeError"),"wrong argument type "+ma.$class()+" (expected Range)");var h=ma.excl;b=ma.end;ma=ma.begin;b!==w&&h&&this.$raise(z(l,"ArgumentError"), +"cannot clamp with an exclusive range")}ma!==w&&b!==w&&0h)return ma}return b!==w&&(h=u(this,b),0h&&(h+=b.length,0>h))return H["~"]=J;for(var A=a.global_regexp(this);;){f=A.exec(b);if(null===f)return H["~"]=J;if(f.index>= +h)return H["~"]=t(c,"MatchData").$new(A,f),q===J?H["~"]:a.yield1(q,H["~"]);A.lastIndex=f.index+1}},L.$$arity=-2);a.def(k,"$match?",D=function(b,h){this.uninitialized&&this.$raise(t(c,"TypeError"),"uninitialized Regexp");if(void 0===h)return b===J?!1:this.test(w(b,t(c,"String"),"to_str"));h=w(h,t(c,"Integer"),"to_int");if(b===J)return!1;b=w(b,t(c,"String"),"to_str");if(0>h&&(h+=b.length,0>h))return!1;b=a.global_regexp(this).exec(b);return null===b||b.index"},ja.$$arity=0);a.def(k,"$length",da=function(){return this.matches.length},da.$$arity=0);a.alias(k,"size","length");a.def(k,"$to_a",ma=function(){return this.matches},ma.$$arity=0);a.def(k,"$to_s",b=function(){return this.matches[0]},b.$$arity=0);return(a.def(k,"$values_at",h=function(f){var q=a.slice.call(arguments,0,arguments.length);var A,E=[];for(A=0;AG&&(G+=this.matches.length,0>G)){E.push(J);continue}E.push(this.matches[G])}return E},h.$$arity=-1),J)&&"values_at"}(y[0],null,y)}; +Opal.modules["corelib/string"]=function(a){function y(l,I){return"number"===typeof l&&"number"===typeof I?l/I:l["$/"](I)}function J(l,I){return"number"===typeof l&&"number"===typeof I?l+I:l["$+"](I)}var t=a.top,w=[],z=a.nil,p=a.$$$,d=a.$$,H=a.coerce_to,x=a.respond_to,k=a.klass,m=a.truthy,u=a.send,c=a.gvars;a.add_stubs("$require $include $coerce_to? $raise $=== $format $to_s $respond_to? $to_str $<=> $== $=~ $new $force_encoding $casecmp $empty? $ljust $ceil $/ $+ $rjust $floor $to_a $each_char $to_proc $coerce_to! $copy_singleton_methods $initialize_clone $initialize_dup $enum_for $size $chomp $[] $to_i $each_line $encoding $class $match $match? $captures $proc $succ $escape $include? $upcase $unicode_normalize".split(" ")); +t.$require("corelib/comparable");t.$require("corelib/regexp");(function(l,$super,e){function n(B){function O(Ua){var Ya="",gb,qb=Ua.length;for(gb=0;gbnb&&L.$raise(d(D,"ArgumentError"),'invalid range "'+pb+"-"+nb+'" in string transliteration');for(pb+=1;pbB&&this.$raise(d(D,"ArgumentError"),"negative argument");if(0===B)return this.$$cast("");var O="",ra=this.toString();for(268435456<=ra.length*B&&this.$raise(d(D,"RangeError"),"multiply count must not overflow maximum string size");;){1===(B&1)&&(O+=ra);B>>>=1;if(0===B)break;ra+=ra}return this.$$cast(O)},h.$$arity=1);a.def(L,"$+",f=function(B){B=H(B,d(D,"String"), +"to_str");return this+B.$to_s()},f.$$arity=1);a.def(L,"$<=>",q=function(B){if(m(B["$respond_to?"]("to_str")))return B=B.$to_str().$to_s(),this>B?1:this"](this);return B===z?z:0B?1:0},q.$$arity=1);a.def(L,"$==",A=function(B){return B.$$is_string?this.toString()===B.toString():x(B,"$to_str")?B["$=="](this):!1},A.$$arity=1);a.alias(L,"eql?","==");a.alias(L,"===","==");a.def(L,"$=~",E=function(B){B.$$is_string&&this.$raise(d(D,"TypeError"),"type mismatch: String given");return B["$=~"](this)}, +E.$$arity=1);a.def(L,"$[]",G=function(B,O){var ra=this.length;if(B.$$is_range){var Ga=B.excl;O=H(B.end,d(D,"Integer"),"to_int");B=H(B.begin,d(D,"Integer"),"to_int");if(Math.abs(B)>ra)return z;0>B&&(B+=ra);0>O&&(O+=ra);Ga||(O+=1);O-=B;0>O&&(O=0);return this.$$cast(this.substr(B,O))}if(B.$$is_string)return null!=O&&this.$raise(d(D,"TypeError")),-1!==this.indexOf(B)?this.$$cast(B):z;if(B.$$is_regexp){ra=this.match(B);if(null===ra)return c["~"]=z;c["~"]=d(D,"MatchData").$new(B,ra);if(null==O)return this.$$cast(ra[0]); +O=H(O,d(D,"Integer"),"to_int");return 0>O&&-OB&&(B+=ra);if(null==O)return B>=ra||0>B?z:this.$$cast(this.substr(B,1));O=H(O,d(D,"Integer"),"to_int");return 0>O||B>ra||0>B?z:this.$$cast(this.substr(B,O))},G.$$arity=-2);a.alias(L,"byteslice","[]");a.def(L,"$b",M=function(){return this.$force_encoding("binary")},M.$$arity=0);a.def(L,"$capitalize",ba=function(){return this.$$cast(this.charAt(0).toUpperCase()+ +this.substr(1).toLowerCase())},ba.$$arity=0);a.def(L,"$casecmp",ua=function(B){var O=this;if(!m(B["$respond_to?"]("to_str")))return z;B=H(B,d(D,"String"),"to_str").$to_s();var ra=/^[\x00-\x7F]*$/;ra.test(O)&&ra.test(B)&&(O=O.toLowerCase(),B=B.toLowerCase());return O["$<=>"](B)},ua.$$arity=1);a.def(L,"$casecmp?",Oa=function(B){B=this.$casecmp(B);return B===z?z:0===B},Oa.$$arity=1);a.def(L,"$center",xa=function(B,O){null==O&&(O=" ");B=H(B,d(D,"Integer"),"to_int");O=H(O,d(D,"String"),"to_str").$to_s(); +m(O["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(m(B<=this.length))return this;var ra=this.$ljust(y(J(B,this.length),2).$ceil(),O);B=this.$rjust(y(J(B,this.length),2).$floor(),O);return this.$$cast(B+ra.slice(this.length))},xa.$$arity=-2);a.def(L,"$chars",Ba=function(){var B=Ba.$$p,O=B||z;B&&(Ba.$$p=null);B&&(Ba.$$p=null);return m(O)?u(this,"each_char",[],O.$to_proc()):this.$each_char().$to_a()},Ba.$$arity=0);a.def(L,"$chomp",La=function(B){null==c["/"]&&(c["/"]=z);null== +B&&(B=c["/"]);if(m(B===z||0===this.length))return this;B=d(D,"Opal")["$coerce_to!"](B,d(D,"String"),"to_str").$to_s();var O;"\n"===B?O=this.replace(/\r?\n?$/,""):""===B?O=this.replace(/(\r?\n)+$/,""):this.length>=B.length&&this.substr(this.length-B.length,B.length)===B&&(O=this.substr(0,this.length-B.length));return null!=O?this.$$cast(O):this},La.$$arity=-1);a.def(L,"$chop",na=function(){var B=this.length;B=1>=B?"":"\n"===this.charAt(B-1)&&"\r"===this.charAt(B-2)?this.substr(0,B-2):this.substr(0, +B-1);return this.$$cast(B)},na.$$arity=0);a.def(L,"$chr",S=function(){return this.charAt(0)},S.$$arity=0);a.def(L,"$clone",sa=function(){var B=new String(this);B.$copy_singleton_methods(this);B.$initialize_clone(this);return B},sa.$$arity=0);a.def(L,"$dup",ya=function(){var B=new String(this);B.$initialize_dup(this);return B},ya.$$arity=0);a.def(L,"$count",pa=function(B){var O=a.slice.call(arguments,0,arguments.length);0===O.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)"); +O=n(O);return null===O?0:this.length-this.replace(new RegExp(O,"g"),"").length},pa.$$arity=-1);a.def(L,"$delete",ea=function(B){var O=a.slice.call(arguments,0,arguments.length);0===O.length&&this.$raise(d(D,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");O=n(O);return null===O?this:this.$$cast(this.replace(new RegExp(O,"g"),""))},ea.$$arity=-1);a.def(L,"$delete_prefix",F=function(B){B.$$is_string||(B=H(B,d(D,"String"),"to_str"));return this.slice(0,B.length)===B?this.$$cast(this.slice(B.length)): +this},F.$$arity=1);a.def(L,"$delete_suffix",V=function(B){B.$$is_string||(B=H(B,d(D,"String"),"to_str"));return this.slice(this.length-B.length)===B?this.$$cast(this.slice(0,this.length-B.length)):this},V.$$arity=1);a.def(L,"$downcase",ka=function(){return this.$$cast(this.toLowerCase())},ka.$$arity=0);a.def(L,"$each_char",va=function(){var B=va.$$p,O=B||z,ra;B&&(va.$$p=null);B&&(va.$$p=null);if(O===z)return u(this,"enum_for",["each_char"],(ra=function(){return(null==ra.$$s?this:ra.$$s).$size()}, +ra.$$s=this,ra.$$arity=0,ra));B=0;for(var Ga=this.length;B=Da.length&&this.substr(this.length- +Da.length,Da.length)==Da)return!0}return!1},Ha.$$arity=-1);a.alias(L,"equal?","===");a.def(L,"$gsub",Ea=function(B,O){var ra=Ea.$$p,Ga=ra||z,Da=this;ra&&(Ea.$$p=null);ra&&(Ea.$$p=null);if(void 0===O&&Ga===z)return Da.$enum_for("gsub",B);ra="";var Ja=z,Wa=0;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=H(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var hb;;){var eb=B.exec(Da);if(null===eb){c["~"]=z;ra+=Da.slice(Wa);break}Ja=d(D,"MatchData").$new(B,eb); +if(void 0===O){hb=B.lastIndex;var Ua=Ga(eb[0]);B.lastIndex=hb}else O.$$is_hash?Ua=O["$[]"](eb[0]).$to_s():(O.$$is_string||(O=H(O,d(D,"String"),"to_str")),Ua=O.replace(/([\\]+)([0-9+&`'])/g,function(Ya,gb,qb){if(0===gb.length%2)return Ya;switch(qb){case "+":for(Ya=eb.length-1;0O&&(O+=this.length,0>O))return z;if(B.$$is_regexp)for(ra=a.global_multiline_regexp(B);;){B=ra.exec(this);if(null===B){c["~"]=z;O=-1;break}if(B.index>=O){c["~"]=d(D,"MatchData").$new(ra,B);O=B.index;break}ra.lastIndex=B.index+1}else B=H(B,d(D,"String"),"to_str"),O=0===B.length&&O>this.length?-1:this.indexOf(B,O);return-1===O?z:O},kb.$$arity=-2);a.def(L,"$inspect",Ra=function(){var B={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t", +"\n":"\\n","\f":"\\f","\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(O){return B[O]||"\\u"+("0000"+O.charCodeAt(0).toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'},Ra.$$arity=0);a.def(L,"$intern",W=function(){return this.toString()},W.$$arity=0);a.def(L,"$lines",za=function(B){var O=za.$$p,ra=O||z;null==c["/"]&&(c["/"]=z);O&& +(za.$$p=null);O&&(za.$$p=null);null==B&&(B=c["/"]);B=u(this,"each_line",[B],ra.$to_proc());return m(ra)?this:B.$to_a()},za.$$arity=-1);a.def(L,"$length",Ca=function(){return this.length},Ca.$$arity=0);a.def(L,"$ljust",Va=function(B,O){null==O&&(O=" ");B=H(B,d(D,"Integer"),"to_int");O=H(O,d(D,"String"),"to_str").$to_s();m(O["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding");if(m(B<=this.length))return this;var ra=-1,Ga="";for(B-=this.length;++ra=Da||65<=Da&&90>=Da||97<=Da&&122>=Da)switch(Da){case 57:Ga=!0;Da=48;break;case 90:Ga=!0;Da=65;break;case 122:Ga=!0;Da=97;break;default:Ga=!1,Da+=1}else-1===ra?255===Da?(Ga=!0,Da=0):(Ga=!1,Da+=1):Ga=!0;O=O.slice(0,B)+String.fromCharCode(Da)+O.slice(B+1);if(Ga&&(0===B||B===ra)){switch(Da){case 65:break;case 97:break;default:Da+=1}O=0===B?String.fromCharCode(Da)+O:O.slice(0,B)+String.fromCharCode(Da)+O.slice(B);Ga=!1}if(!Ga)break}return this.$$cast(O)}, +Aa.$$arity=0);a.def(L,"$oct",ta=function(){var B=this;var O=8;if(/^\s*_/.test(B))return 0;B=B.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(ra,Ga,Da,Ja){switch(Ja.charAt(0)){case "+":case "-":return ra;case "0":if("x"===Ja.charAt(1)&&"0x"===Da)return ra}switch(Da){case "0b":O=2;break;case "0":case "0o":O=8;break;case "0d":O=10;break;case "0x":O=16}return Ga+Ja});B=parseInt(B.replace(/_(?!_)/g,""),O);return isNaN(B)?0:B},ta.$$arity=0);a.def(L,"$ord",Ma=function(){return this.charCodeAt(0)},Ma.$$arity= +0);a.def(L,"$partition",Ta=function(B){if(B.$$is_regexp){var O=B.exec(this);null===O?O=-1:(d(D,"MatchData").$new(B,O),B=O[0],O=O.index)}else B=H(B,d(D,"String"),"to_str"),O=this.indexOf(B);return-1===O?[this,"",""]:[this.slice(0,O),this.slice(O,O+B.length),this.slice(O+B.length)]},Ta.$$arity=1);a.def(L,"$reverse",Za=function(){return this.split("").reverse().join("")},Za.$$arity=0);a.def(L,"$rindex",Fa=function(B,O){if(void 0===O)O=this.length;else if(O=H(O,d(D,"Integer"),"to_int"),0>O&&(O+=this.length, +0>O))return z;if(B.$$is_regexp){var ra=null;for(B=a.global_multiline_regexp(B);;){var Ga=B.exec(this);if(null===Ga||Ga.index>O)break;ra=Ga;B.lastIndex=ra.index+1}null===ra?(c["~"]=z,O=-1):(d(D,"MatchData").$new(B,ra),O=ra.index)}else B=H(B,d(D,"String"),"to_str"),O=this.lastIndexOf(B,O);return-1===O?z:O},Fa.$$arity=-2);a.def(L,"$rjust",Y=function(B,O){null==O&&(O=" ");B=H(B,d(D,"Integer"),"to_int");O=H(O,d(D,"String"),"to_str").$to_s();m(O["$empty?"]())&&this.$raise(d(D,"ArgumentError"),"zero width padding"); +if(m(B<=this.length))return this;B=Math.floor(B-this.length);var ra=Array(Math.floor(B/O.length)+1).join(O);return this.$$cast(ra+O.slice(0,B-ra.length)+this)},Y.$$arity=-2);a.def(L,"$rpartition",Q=function(B){var O;if(B.$$is_regexp){var ra=null;for(O=a.global_multiline_regexp(B);;){var Ga=O.exec(this);if(null===Ga)break;ra=Ga;O.lastIndex=ra.index+1}null===ra?ra=-1:(d(D,"MatchData").$new(O,ra),B=ra[0],ra=ra.index)}else B=H(B,d(D,"String"),"to_str"),ra=this.lastIndexOf(B);return-1===ra?["","",this]: +[this.slice(0,ra),this.slice(ra,ra+B.length),this.slice(ra+B.length)]},Q.$$arity=1);a.def(L,"$rstrip",Z=function(){return this.replace(/[\s\u0000]*$/,"")},Z.$$arity=0);a.def(L,"$scan",T=function(B){var O=T.$$p,ra=O||z;O&&(T.$$p=null);O&&(T.$$p=null);O=[];var Ga=z,Da;B.$$is_regexp?B=a.global_multiline_regexp(B):(B=H(B,d(D,"String"),"to_str"),B=new RegExp(B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=(Da=B.exec(this));)Ga=d(D,"MatchData").$new(B,Da),ra===z?1==Da.length?O.push(Da[0]):O.push(Ga.$captures()): +1==Da.length?ra(Da[0]):ra.call(this,Ga.$captures()),B.lastIndex===Da.index&&(B.lastIndex+=1);c["~"]=Ga;return ra!==z?this:O},T.$$arity=1);a.alias(L,"size","length");a.alias(L,"slice","[]");a.def(L,"$split",fa=function(B,O){function ra(){for(hb=0;hbO){if(null!==eb&&""===eb[0]&&-1===B.source.indexOf("(?="))for(hb=0,B=eb.length;hb< +B;hb++)Ja.push("");ra();return Ja}if(null!==eb&&""===eb[0])return Ja.splice(O-1,Ja.length-1,Ja.slice(O-1).join("")),ra(),Ja;if(O>=Ja.length)return ra(),Ja;for(hb=0;null!==eb;){hb++;Wa=B.lastIndex;if(hb+1===O)break;eb=B.exec(Da)}Ja.splice(O-1,Ja.length-1,Da.slice(Wa));ra();return Ja},fa.$$arity=-1);a.def(L,"$squeeze",la=function(B){var O=a.slice.call(arguments,0,arguments.length);if(0===O.length)return this.$$cast(this.replace(/(.)\1+/g,"$1"));O=n(O);return null===O?this:this.$$cast(this.replace(new RegExp("("+ +O+")\\1+","g"),"$1"))},la.$$arity=-1);a.def(L,"$start_with?",g=function(B){var O=a.slice.call(arguments,0,arguments.length);for(var ra=0,Ga=O.length;ra=B?O:O&Math.pow(2,B)-1},aa.$$arity=-1);a.def(L,"$swapcase",v=function(){var B=this.replace(/([a-z]+)|([A-Z]+)/g,function(O,ra){return ra?O.toUpperCase():O.toLowerCase()});return this.constructor===String?B:this.$class().$new(B)},v.$$arity=0);a.def(L,"$to_f",U=function(){if("_"===this.charAt(0))return 0;var B=parseFloat(this.replace(/_/g,""));return isNaN(B)||Infinity==B||-Infinity==B?0:B},U.$$arity=0);a.def(L,"$to_i",oa=function(B){null==B&&(B=10);var O= +this.toLowerCase(),ra=H(B,d(D,"Integer"),"to_int");(1===ra||0>ra||36Ya&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;UaYa&&this.$raise(d(D,"ArgumentError"),'invalid range "'+String.fromCharCode(Ua)+"-"+String.fromCharCode(Ya)+'" in string transliteration');for(Ua+=1;Uan:e["$>"](n)}function J(e,n){return"number"===typeof e&&"number"===typeof n?e+n:e["$+"](n)}function t(e,n){return"number"===typeof e&&"number"===typeof n?e-n:e["$-"](n)}function w(e,n){return"number"===typeof e&&"number"===typeof n?e<=n:e["$<="](n)}var z=[],p=a.nil,d=a.$$$,H=a.$$,x=a.falsy,k=a.truthy,m=a.coerce_to,u=a.module,c=a.send,l=a.hash2,I=a.lambda;a.add_stubs("$each $public_send $destructure $to_enum $enumerator_size $new $yield $raise $slice_when $! $enum_for $flatten $map $warn $proc $== $nil? $respond_to? $coerce_to! $> $* $try_convert $< $+ $- $ceil $/ $size $select $to_proc $__send__ $length $<= $[] $push $<< $[]= $=== $inspect $<=> $first $reverse $sort $take $sort_by $compare $call $dup $to_a $sort! $map! $key? $values $transform_values $group_by $to_h $coerce_to? $class $zip".split(" ")); +return function(e,n){function L(Y){0===Y.length&&(Y=[p]);1=Y)))return p;var fa=[],la;this.$each.$$p=function(){var g=H(D,"Opal").$destructure(arguments);a.yield1(Z,g);fa.push(g)};this.$each();if(0===fa.length)return p;if(Y===p)for(;;)for(Q=0,la=fa.length;QY)&&this.$raise(H(D,"ArgumentError"),"attempt to drop negative size");var Q=[],Z=0;this.$each.$$p=function(){Y<=Z&&Q.push(H(D,"Opal").$destructure(arguments));Z++};this.$each();return Q},E.$$arity=1);a.def(e,"$drop_while",G=function(){var Y=G.$$p,Q=Y||p;Y&&(G.$$p=null);Y&&(G.$$p=null);if(Q===p)return this.$enum_for("drop_while");var Z=[],T=!0;this.$each.$$p=function(){var fa=H(D,"Opal").$destructure(arguments); +if(T){var la=a.yield1(Q,fa);x(la)&&(T=!1,Z.push(fa))}else Z.push(fa)};this.$each();return Z},G.$$arity=0);a.def(e,"$each_cons",M=function(Y){var Q=M.$$p,Z=Q||p,T;Q&&(M.$$p=null);Q&&(M.$$p=null);k(1!=arguments.length)&&this.$raise(H(D,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");Y=H(D,"Opal").$try_convert(Y,H(D,"Integer"),"to_int");k(0>=Y)&&this.$raise(H(D,"ArgumentError"),"invalid size");if(Z===p)return c(this,"enum_for",["each_cons",Y],(T=function(){var la=p;var g=(null== +T.$$s?this:T.$$s).$enumerator_size();return k(g["$nil?"]())?p:k(k(la=g["$=="](0))?la:"number"===typeof g&&"number"===typeof Y?gY&&fa.shift();fa.length==Y&&a.yield1(Z,fa.slice(0,Y))};this.$each();return p},M.$$arity=1);a.def(e,"$each_entry",ba=function(Y){var Q=ba.$$p,Z=Q||p,T;Q&&(ba.$$p=null);Q&&(ba.$$p=null);Q=a.slice.call(arguments,0,arguments.length); +if(Z===p)return c(this,"to_enum",["each_entry"].concat(a.to_a(Q)),(T=function(){return(null==T.$$s?this:T.$$s).$enumerator_size()},T.$$s=this,T.$$arity=0,T));this.$each.$$p=function(){var fa=H(D,"Opal").$destructure(arguments);a.yield1(Z,fa)};this.$each.apply(this,Q);return this},ba.$$arity=-1);a.def(e,"$each_slice",ua=function(Y){var Q=ua.$$p,Z=Q||p,T;Q&&(ua.$$p=null);Q&&(ua.$$p=null);Y=m(Y,H(D,"Integer"),"to_int");k(0>=Y)&&this.$raise(H(D,"ArgumentError"),"invalid slice size");if(Z===p)return c(this, +"enum_for",["each_slice",Y],(T=function(){var la=null==T.$$s?this:T.$$s;return k(la["$respond_to?"]("size"))?(la=la.$size(),("number"===typeof la&&"number"===typeof Y?la/Y:la["$/"](Y)).$ceil()):p},T.$$s=this,T.$$arity=0,T));var fa=[];this.$each.$$p=function(){var la=H(D,"Opal").$destructure(arguments);fa.push(la);fa.length===Y&&(a.yield1(Z,fa),fa=[])};this.$each();0Y)&&this.$raise(H(D,"ArgumentError"),"attempt to take negative size");if(k(0==Y))return[];fa=0;c(this,"each",[],(Z=function(la){var g=a.slice.call(arguments,0,arguments.length);T.push(H(D,"Opal").$destructure(g));if(k(Y<=++fa))a.ret(T);else return p},Z.$$s=this,Z.$$arity=-1,Z));return T}catch(la){if(la===a.returner)return la.$v;throw la;}},sa.$$arity=-1);a.alias(e,"flat_map","collect_concat");a.def(e,"$grep",ya=function(Y){var Q=ya.$$p,Z=Q||p,T,fa=p;Q&&(ya.$$p=null);Q&& +(ya.$$p=null);fa=[];c(this,"each",[],(T=function(la){var g=a.slice.call(arguments,0,arguments.length);var C=L(g);if(!k(c(Y,"__send__",["==="].concat(a.to_a(C)))))return p;Z!==p?(k(y(g.$length(),1))&&(g=[g]),g=a.yieldX(Z,a.to_a(g))):k(w(g.$length(),1))&&(g=g["$[]"](0));return fa.$push(g)},T.$$s=this,T.$$arity=-1,T));return fa},ya.$$arity=1);a.def(e,"$grep_v",pa=function(Y){var Q=pa.$$p,Z=Q||p,T,fa=p;Q&&(pa.$$p=null);Q&&(pa.$$p=null);fa=[];c(this,"each",[],(T=function(la){var g=a.slice.call(arguments, +0,arguments.length);var C=L(g);if(k(c(Y,"__send__",["==="].concat(a.to_a(C)))))return p;Z!==p?(k(y(g.$length(),1))&&(g=[g]),g=a.yieldX(Z,a.to_a(g))):k(w(g.$length(),1))&&(g=g["$[]"](0));return fa.$push(g)},T.$$s=this,T.$$arity=-1,T));return fa},pa.$$arity=1);a.def(e,"$group_by",ea=function(){var Y=ea.$$p,Q=Y||p,Z,T=p,fa=p,la=p;Y&&(ea.$$p=null);Y&&(ea.$$p=null);if(Q===p)return c(this,"enum_for",["group_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z)); +T=l([],{});this.$each.$$p=function(){var g=H(D,"Opal").$destructure(arguments),C=a.yield1(Q,g);k(fa=T["$[]"](C))?C=fa:(la=[C,[]],c(T,"[]=",a.to_a(la)),C=la[t(la.length,1)]);C["$<<"](g)};this.$each();return T},ea.$$arity=0);a.def(e,"$include?",F=function(Y){try{var Q;c(this,"each",[],(Q=function(Z){var T=a.slice.call(arguments,0,arguments.length);if(H(D,"Opal").$destructure(T)["$=="](Y))a.ret(!0);else return p},Q.$$s=this,Q.$$arity=-1,Q));return!1}catch(Z){if(Z===a.returner)return Z.$v;throw Z;}}, +F.$$arity=1);a.def(e,"$inject",V=function(Y,Q){var Z=V.$$p,T=Z||p;Z&&(V.$$p=null);Z&&(V.$$p=null);var fa=Y;T!==p&&void 0===Q?this.$each.$$p=function(){var la=H(D,"Opal").$destructure(arguments);void 0!==fa&&(la=a.yieldX(T,[fa,la]));fa=la}:(void 0===Q&&(H(D,"Symbol")["$==="](Y)||this.$raise(H(D,"TypeError"),""+Y.$inspect()+" is not a Symbol"),Q=Y,fa=void 0),this.$each.$$p=function(){var la=H(D,"Opal").$destructure(arguments);fa=void 0===fa?la:fa.$__send__(Q,la)});this.$each();return void 0==fa?p:fa}, +V.$$arity=-1);a.def(e,"$lazy",ka=function(){var Y;return c(d(H(D,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],(Y=function(Q,Z){null==Q&&(Q=p);var T=a.slice.call(arguments,1,arguments.length);return c(Q,"yield",a.to_a(T))},Y.$$s=this,Y.$$arity=-2,Y))},ka.$$arity=0);a.def(e,"$enumerator_size",va=function(){return k(this["$respond_to?"]("size"))?this.$size():p},va.$$arity=0);a.alias(e,"map","collect");a.def(e,"$max",ia=function(Y){var Q=ia.$$p,Z=Q||p,T=this;Q&&(ia.$$p=null);Q&&(ia.$$p= +null);if(void 0===Y||Y===p){var fa,la;T.$each.$$p=function(){var g=H(D,"Opal").$destructure(arguments);void 0===fa?fa=g:(la=Z!==p?a.yieldX(Z,[g,fa]):g["$<=>"](fa),la===p&&T.$raise(H(D,"ArgumentError"),"comparison failed"),0"](la)&&(fa=g,la=C)};this.$each();return void 0===fa?p:fa},wa.$$arity=-1);a.alias(e,"member?","include?");a.def(e,"$min",Ha=function(Y){var Q=Ha.$$p,Z=Q||p,T,fa=this;Q&&(Ha.$$p= +null);Q&&(Ha.$$p=null);null==Y&&(Y=p);if(!k(Y["$nil?"]()))return Z!==p?c(fa,"sort",[],(T=function(g,C){null==g&&(g=p);null==C&&(C=p);return a.yieldX(Z,[g,C])},T.$$s=fa,T.$$arity=2,T)).$take(Y):fa.$sort().$take(Y);var la;fa.$each.$$p=Z!==p?function(){var g=H(D,"Opal").$destructure(arguments);if(void 0===la)la=g;else{var C=Z(g,la);C===p&&fa.$raise(H(D,"ArgumentError"),"comparison failed");0>C&&(la=g)}}:function(){var g=H(D,"Opal").$destructure(arguments);void 0===la?la=g:0>H(D,"Opal").$compare(g,la)&& +(la=g)};fa.$each();return void 0===la?p:la},Ha.$$arity=-1);a.def(e,"$min_by",Ea=function(Y){var Q=Ea.$$p,Z=Q||p,T;Q&&(Ea.$$p=null);Q&&(Ea.$$p=null);null==Y&&(Y=p);if(!k(Z))return c(this,"enum_for",["min_by",Y],(T=function(){return(null==T.$$s?this:T.$$s).$enumerator_size()},T.$$s=this,T.$$arity=0,T));if(!k(Y["$nil?"]()))return c(this,"sort_by",[],Z.$to_proc()).$take(Y);var fa,la;this.$each.$$p=function(){var g=H(D,"Opal").$destructure(arguments),C=a.yield1(Z,g);void 0===fa?(fa=g,la=C):0>C["$<=>"](la)&& +(fa=g,la=C)};this.$each();return void 0===fa?p:fa},Ea.$$arity=-1);a.def(e,"$minmax",Qa=function(){var Y=Qa.$$p,Q=Y||p,Z,T=this,fa=p;Y&&(Qa.$$p=null);Y&&(Qa.$$p=null);Q=function(){return k(fa=Q)?fa:c(T,"proc",[],(Z=function(N,aa){null==N&&(N=p);null==aa&&(aa=p);return N["$<=>"](aa)},Z.$$s=T,Z.$$arity=2,Z))}();var la=p,g=p,C=!0;T.$each.$$p=function(){var N=H(D,"Opal").$destructure(arguments);if(C)la=g=N,C=!1;else{var aa=Q.$call(la,N);aa===p?T.$raise(H(D,"ArgumentError"),"comparison failed"):0aa&&(g=N)}};T.$each();return[la,g]},Qa.$$arity=0);a.def(e,"$minmax_by",Sa=function(){var Y=Sa.$$p,Q=Y||p,Z;Y&&(Sa.$$p=null);Y&&(Sa.$$p=null);if(!k(Q))return c(this,"enum_for",["minmax_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var T=p,fa=p,la,g;this.$each.$$p=function(){var C=H(D,"Opal").$destructure(arguments),N=a.yield1(Q,C);if(void 0===la||0>N["$<=>"](la))T=C,la= +N;if(void 0===g||0"](g))fa=C,g=N};this.$each();return[T,fa]},Sa.$$arity=0);a.def(e,"$none?",Ia=function(Y){try{var Q=Ia.$$p,Z=Q||p,T,fa,la;Q&&(Ia.$$p=null);Q&&(Ia.$$p=null);k(void 0!==Y)?c(this,"each",[],(T=function(g){var C=a.slice.call(arguments,0,arguments.length);C=L(C);if(k(c(Y,"public_send",["==="].concat(a.to_a(C)))))a.ret(!1);else return p},T.$$s=this,T.$$arity=-1,T)):Z!==p?c(this,"each",[],(fa=function(g){var C=a.slice.call(arguments,0,arguments.length);if(k(a.yieldX(Z,a.to_a(C))))a.ret(!1); +else return p},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(g){var C=a.slice.call(arguments,0,arguments.length);C=H(D,"Opal").$destructure(C);if(k(C))a.ret(!1);else return p},la.$$s=this,la.$$arity=-1,la));return!0}catch(g){if(g===a.returner)return g.$v;throw g;}},Ia.$$arity=-1);a.def(e,"$one?",kb=function(Y){try{var Q=kb.$$p,Z=Q||p,T,fa,la,g=p;Q&&(kb.$$p=null);Q&&(kb.$$p=null);g=0;k(void 0!==Y)?c(this,"each",[],(T=function(C){var N=a.slice.call(arguments,0,arguments.length);N=L(N); +if(k(c(Y,"public_send",["==="].concat(a.to_a(N)))))if(g=J(g,1),k(y(g,1)))a.ret(!1);else return p;else return p},T.$$s=this,T.$$arity=-1,T)):Z!==p?c(this,"each",[],(fa=function(C){var N=a.slice.call(arguments,0,arguments.length);if(!k(a.yieldX(Z,a.to_a(N))))return p;g=J(g,1);if(k(y(g,1)))a.ret(!1);else return p},fa.$$s=this,fa.$$arity=-1,fa)):c(this,"each",[],(la=function(C){var N=a.slice.call(arguments,0,arguments.length);if(!k(H(D,"Opal").$destructure(N)))return p;g=J(g,1);if(k(y(g,1)))a.ret(!1); +else return p},la.$$s=this,la.$$arity=-1,la));return g["$=="](1)}catch(C){if(C===a.returner)return C.$v;throw C;}},kb.$$arity=-1);a.def(e,"$partition",Ra=function(){var Y=Ra.$$p,Q=Y||p,Z;Y&&(Ra.$$p=null);Y&&(Ra.$$p=null);if(Q===p)return c(this,"enum_for",["partition"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var T=[],fa=[];this.$each.$$p=function(){var la=H(D,"Opal").$destructure(arguments),g=a.yield1(Q,la);k(g)?T.push(la):fa.push(la)};this.$each(); +return[T,fa]},Ra.$$arity=0);a.alias(e,"reduce","inject");a.def(e,"$reject",W=function(){var Y=W.$$p,Q=Y||p,Z;Y&&(W.$$p=null);Y&&(W.$$p=null);if(Q===p)return c(this,"enum_for",["reject"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var T=[];this.$each.$$p=function(){var fa=H(D,"Opal").$destructure(arguments),la=a.yield1(Q,fa);x(la)&&T.push(fa)};this.$each();return T},W.$$arity=0);a.def(e,"$reverse_each",za=function(){var Y=za.$$p,Q=Y||p,Z;Y&&(za.$$p=null); +Y&&(za.$$p=null);if(Q===p)return c(this,"enum_for",["reverse_each"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()},Z.$$s=this,Z.$$arity=0,Z));var T=[];this.$each.$$p=function(){T.push(arguments)};this.$each();for(Y=T.length-1;0<=Y;Y--)a.yieldX(Q,T[Y]);return T},za.$$arity=0);a.alias(e,"select","find_all");a.def(e,"$slice_before",Ca=function(Y){var Q=Ca.$$p,Z=Q||p,T;Q&&(Ca.$$p=null);Q&&(Ca.$$p=null);k(void 0===Y&&Z===p)&&this.$raise(H(D,"ArgumentError"),"both pattern and block are given"); +k(void 0!==Y&&Z!==p||1"](la)},Z.$$s=this,Z.$$arity=2,Z)));return c(T,"sort",[],Q.$to_proc())},db.$$arity=0);a.def(e,"$sort_by",Xa=function(){var Y=Xa.$$p,Q=Y||p,Z,T,fa,la,g=p;Y&&(Xa.$$p=null);Y&&(Xa.$$p=null);if(Q===p)return c(this,"enum_for",["sort_by"],(Z=function(){return(null==Z.$$s?this:Z.$$s).$enumerator_size()}, +Z.$$s=this,Z.$$arity=0,Z));g=c(this,"map",[],(T=function(){var C=H(D,"Opal").$destructure(arguments);return[a.yield1(Q,C),C]},T.$$s=this,T.$$arity=0,T));c(g,"sort!",[],(fa=function(C,N){null==C&&(C=p);null==N&&(N=p);return C[0]["$<=>"](N[0])},fa.$$s=this,fa.$$arity=2,fa));return c(g,"map!",[],(la=function(C){null==C&&(C=p);return C[1]},la.$$s=this,la.$$arity=1,la))},Xa.$$arity=0);a.def(e,"$sum",bb=function(Y){var Q,Z=bb.$$p,T=Z||p,fa=p;Z&&(bb.$$p=null);null==Y&&(Y=0);fa=Y;c(this,"each",[],(Q=function(la){var g= +a.slice.call(arguments,0,arguments.length);g=T!==p?a.yieldX(T,a.to_a(g)):H(D,"Opal").$destructure(g);return fa=J(fa,g)},Q.$$s=this,Q.$$arity=-1,Q));return fa},bb.$$arity=-1);a.def(e,"$take",Aa=function(Y){return this.$first(Y)},Aa.$$arity=1);a.def(e,"$take_while",ta=function(){try{var Y=ta.$$p,Q=Y||p,Z,T=p;Y&&(ta.$$p=null);Y&&(ta.$$p=null);if(!k(Q))return this.$enum_for("take_while");T=[];return c(this,"each",[],(Z=function(fa){var la=a.slice.call(arguments,0,arguments.length);la=H(D,"Opal").$destructure(la); +k(a.yield1(Q,la))||a.ret(T);return T.push(la)},Z.$$s=this,Z.$$arity=-1,Z))}catch(fa){if(fa===a.returner)return fa.$v;throw fa;}},ta.$$arity=0);a.def(e,"$uniq",Ma=function(){var Y=Ma.$$p,Q=Y||p,Z,T=p;Y&&(Ma.$$p=null);Y&&(Ma.$$p=null);T=l([],{});c(this,"each",[],(Z=function(fa){var la=a.slice.call(arguments,0,arguments.length);la=H(D,"Opal").$destructure(la);var g=Q!==p?a.yield1(Q,la):la;if(k(T["$key?"](g)))return p;la=[g,la];c(T,"[]=",a.to_a(la));return la[t(la.length,1)]},Z.$$s=this,Z.$$arity=-1, +Z));return T.$values()},Ma.$$arity=0);a.def(e,"$tally",Ta=function(){return c(c(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc())},Ta.$$arity=0);a.alias(e,"to_a","entries");a.def(e,"$to_h",Za=function(Y){var Q=Za.$$p,Z=Q||p,T=this;Q&&(Za.$$p=null);Q&&(Za.$$p=null);Q=a.slice.call(arguments,0,arguments.length);if(Z!==p)return c(c(T,"map",[],Z.$to_proc()),"to_h",a.to_a(Q));var fa=l([],{});T.$each.$$p=function(){var la=H(D,"Opal").$destructure(arguments);la=H(D,"Opal")["$coerce_to?"](la, +H(D,"Array"),"to_ary");la.$$is_array||T.$raise(H(D,"TypeError"),"wrong element type "+la.$class()+" (expected array)");2!==la.length&&T.$raise(H(D,"ArgumentError"),"wrong array length (expected 2, was "+la.$length()+")");a.hash_put(fa,la[0],la[1])};T.$each.apply(T,Q);return fa},Za.$$arity=-1);a.def(e,"$zip",Fa=function(Y){var Q=Fa.$$p;Q&&(Fa.$$p=null);Q&&(Fa.$$p=null);Q=a.slice.call(arguments,0,arguments.length);return c(this.$to_a(),"zip",a.to_a(Q))},Fa.$$arity=-1)}(z[0],z)}; +Opal.modules["corelib/enumerator"]=function(a){function y(I,e){return"number"===typeof I&&"number"===typeof e?I+e:I["$+"](e)}function J(I,e){return"number"===typeof I&&"number"===typeof e?I")},h.$$arity=0);(function(f,$super,A){f=u(f,$super,"Generator");var E=[f].concat(A),G,M;f.$$prototype.block=z;f.$include(p(E,"Enumerable"));a.def(f,"$initialize",G=function(){var ba=G.$$p,ua=ba||z;ba&&(G.$$p=null);ba&&(G.$$p=null);k(ua)||this.$raise(p(E,"LocalJumpError"),"no block given");return this.block=ua},G.$$arity=0);return(a.def(f,"$each",M=function(ba){var ua=M.$$p, +Oa=ua||z;ua&&(M.$$p=null);ua&&(M.$$p=null);ua=a.slice.call(arguments,0,arguments.length);Oa=c(p(E,"Yielder"),"new",[],Oa.$to_proc());try{ua.unshift(Oa),a.yieldX(this.block,ua)}catch(xa){if(xa===d)return d.$v;throw xa;}return this},M.$$arity=-1),z)&&"each"})(L[0],null,L);(function(f,$super,A){f=u(f,$super,"Yielder");[f].concat(A);var E,G,M;f.$$prototype.block=z;a.def(f,"$initialize",E=function(){var ba=E.$$p,ua=ba||z;ba&&(E.$$p=null);ba&&(E.$$p=null);return this.block=ua},E.$$arity=0);a.def(f,"$yield", +G=function(ba){var ua=a.slice.call(arguments,0,arguments.length);ua=a.yieldX(this.block,ua);if(ua===d)throw d;return ua},G.$$arity=-1);return(a.def(f,"$<<",M=function(ba){var ua=a.slice.call(arguments,0,arguments.length);c(this,"yield",a.to_a(ua));return this},M.$$arity=-1),z)&&"<<"})(L[0],null,L);(function(f,$super,A){f=u(f,$super,"Lazy");var E=[f].concat(A),G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa;f.$$prototype.enumerator=z;(function(ea,$super,V){[u(ea,$super,"StopLazyError")].concat(V);return z})(E[0], +p(E,"Exception"),E);a.def(f,"$initialize",G=function(ea,F){var V=G.$$p,ka=V||z,va;V&&(G.$$p=null);V&&(G.$$p=null);null==F&&(F=z);ka===z&&this.$raise(p(E,"ArgumentError"),"tried to call lazy new without a block");this.enumerator=ea;return l(this,a.find_super_dispatcher(this,"initialize",G,!1,!0),"initialize",[F],(va=function(ia,wa){var Ha=null==va.$$s?this:va.$$s,Ea;null==ia&&(ia=z);var Qa=a.slice.call(arguments,1,arguments.length);try{return c(ea,"each",a.to_a(Qa),(Ea=function(Sa){var Ia=a.slice.call(arguments, +0,arguments.length);Ia.unshift(ia);a.yieldX(ka,Ia)},Ea.$$s=Ha,Ea.$$arity=-1,Ea))}catch(Sa){if(a.rescue(Sa,[p(E,"Exception")]))try{return z}finally{a.pop_exception()}else throw Sa;}},va.$$s=this,va.$$arity=-2,va))},G.$$arity=-2);a.alias(f,"force","to_a");a.def(f,"$lazy",M=function(){return this},M.$$arity=0);a.def(f,"$collect",ba=function(){var ea=ba.$$p,F=ea||z,V;ea&&(ba.$$p=null);ea&&(ba.$$p=null);k(F)||this.$raise(p(E,"ArgumentError"),"tried to call lazy map without a block");return c(p(E,"Lazy"), +"new",[this,this.$enumerator_size()],(V=function(ka,va){null==ka&&(ka=z);var ia=a.slice.call(arguments,1,arguments.length);ia=a.yieldX(F,ia);ka.$yield(ia)},V.$$s=this,V.$$arity=-2,V))},ba.$$arity=0);a.def(f,"$collect_concat",ua=function(){var ea=ua.$$p,F=ea||z,V;ea&&(ua.$$p=null);ea&&(ua.$$p=null);k(F)||this.$raise(p(E,"ArgumentError"),"tried to call lazy map without a block");return c(p(E,"Lazy"),"new",[this,z],(V=function(ka,va){var ia=null==V.$$s?this:V.$$s,wa,Ha;null==ka&&(ka=z);var Ea=a.slice.call(arguments, +1,arguments.length);Ea=a.yieldX(F,Ea);Ea["$respond_to?"]("force")&&Ea["$respond_to?"]("each")?c(Ea,"each",[],(wa=function(Qa){null==Qa&&(Qa=z);return ka.$yield(Qa)},wa.$$s=ia,wa.$$arity=1,wa)):p(E,"Opal").$try_convert(Ea,p(E,"Array"),"to_ary")===z?ka.$yield(Ea):c(Ea,"each",[],(Ha=function(Qa){null==Qa&&(Qa=z);return ka.$yield(Qa)},Ha.$$s=ia,Ha.$$arity=1,Ha))},V.$$s=this,V.$$arity=-2,V))},ua.$$arity=0);a.def(f,"$drop",Oa=function(ea){var F,V=z,ka=V=z;ea=m(ea,p(E,"Integer"),"to_int");k(J(ea,0))&&this.$raise(p(E, +"ArgumentError"),"attempt to drop negative size");V=this.$enumerator_size();V=k(p(E,"Integer")["$==="](V))?k(J(ea,V))?ea:V:V;ka=0;return c(p(E,"Lazy"),"new",[this,V],(F=function(va,ia){null==va&&(va=z);var wa=a.slice.call(arguments,1,arguments.length);return k(J(ka,ea))?ka=y(ka,1):c(va,"yield",a.to_a(wa))},F.$$s=this,F.$$arity=-2,F))},Oa.$$arity=1);a.def(f,"$drop_while",xa=function(){var ea=xa.$$p,F=ea||z,V,ka=z;ea&&(xa.$$p=null);ea&&(xa.$$p=null);k(F)||this.$raise(p(E,"ArgumentError"),"tried to call lazy drop_while without a block"); +ka=!0;return c(p(E,"Lazy"),"new",[this,z],(V=function(va,ia){null==va&&(va=z);var wa=a.slice.call(arguments,1,arguments.length);if(k(ka)){var Ha=a.yieldX(F,wa);x(Ha)&&(ka=!1,c(va,"yield",a.to_a(wa)))}else return c(va,"yield",a.to_a(wa))},V.$$s=this,V.$$arity=-2,V))},xa.$$arity=0);a.def(f,"$enum_for",Ba=function(ea,F){var V=Ba.$$p,ka=V||z;V&&(Ba.$$p=null);V&&(Ba.$$p=null);V=a.slice.call(arguments,0,arguments.length);if(0"},pa.$$arity=0),z)&&"inspect"})(L[0],I,L);return function(f,$super,A){[u(f,$super,"ArithmeticSequence")].concat(A);return z}(L[0],I,L)}(w[0],null,w)}; +Opal.modules["corelib/numeric"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function J(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c".split(" ")); +z.$require("corelib/comparable");return function(c,$super,I){c=k(c,$super,"Numeric");var e=[c].concat(I),n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa;c.$include(x(e,"Comparable"));a.def(c,"$coerce",n=function(Ia){return m(Ia["$instance_of?"](this.$class()))?[Ia,this]:[this.$Float(Ia),this.$Float(this)]},n.$$arity=1);a.def(c,"$__coerced__",L=function(Ia,kb){if(m(kb["$respond_to?"]("coerce"))){kb=kb.$coerce(this);var Ra=a.to_ary(kb);var W=null==Ra[0]? +d:Ra[0];Ra=null==Ra[1]?d:Ra[1];kb;return W.$__send__(Ia,Ra)}return"+"["$==="](Ia)||"-"["$==="](Ia)||"*"["$==="](Ia)||"/"["$==="](Ia)||"%"["$==="](Ia)||"&"["$==="](Ia)||"|"["$==="](Ia)||"^"["$==="](Ia)||"**"["$==="](Ia)?this.$raise(x(e,"TypeError"),""+kb.$class()+" can't be coerced into Numeric"):">"["$==="](Ia)||">="["$==="](Ia)||"<"["$==="](Ia)||"<="["$==="](Ia)||"<=>"["$==="](Ia)?this.$raise(x(e,"ArgumentError"),"comparison of "+this.$class()+" with "+kb.$class()+" failed"):d},L.$$arity=2);a.def(c, +"$<=>",D=function(Ia){return m(this["$equal?"](Ia))?0:d},D.$$arity=1);a.def(c,"$+@",R=function(){return this},R.$$arity=0);a.def(c,"$-@",ja=function(){return y(0,this)},ja.$$arity=0);a.def(c,"$%",da=function(Ia){return y(this,J(Ia,this.$div(Ia)))},da.$$arity=1);a.def(c,"$abs",ma=function(){return t(this,0)?this["$-@"]():this},ma.$$arity=0);a.def(c,"$abs2",b=function(){return J(this,this)},b.$$arity=0);a.def(c,"$angle",h=function(){return t(this,0)?H(x(e,"Math"),"PI"):0},h.$$arity=0);a.alias(c,"arg", +"angle");a.def(c,"$ceil",f=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$ceil(Ia)},f.$$arity=-1);a.def(c,"$conj",q=function(){return this},q.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",A=function(){return this.$to_r().$denominator()},A.$$arity=0);a.def(c,"$div",E=function(Ia){Ia["$=="](0)&&this.$raise(x(e,"ZeroDivisionError"),"divided by o");return w(this,Ia).$floor()},E.$$arity=1);a.def(c,"$divmod",G=function(Ia){return[this.$div(Ia),this["$%"](Ia)]},G.$$arity=1);a.def(c, +"$fdiv",M=function(Ia){return w(this.$to_f(),Ia)},M.$$arity=1);a.def(c,"$floor",ba=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$floor(Ia)},ba.$$arity=-1);a.def(c,"$i",ua=function(){return this.$Complex(0,this)},ua.$$arity=0);a.def(c,"$imag",Oa=function(){return 0},Oa.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$integer?",xa=function(){return!1},xa.$$arity=0);a.alias(c,"magnitude","abs");a.alias(c,"modulo","%");a.def(c,"$nonzero?",Ba=function(){return m(this["$zero?"]())?d:this},Ba.$$arity= +0);a.def(c,"$numerator",La=function(){return this.$to_r().$numerator()},La.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",na=function(){return[this.$abs(),this.$arg()]},na.$$arity=0);a.def(c,"$quo",S=function(Ia){return w(x(e,"Opal")["$coerce_to!"](this,x(e,"Rational"),"to_r"),Ia)},S.$$arity=1);a.def(c,"$real",sa=function(){return this},sa.$$arity=0);a.def(c,"$real?",ya=function(){return!0},ya.$$arity=0);a.def(c,"$rect",pa=function(){return[this,0]},pa.$$arity=0);a.alias(c,"rectangular","rect"); +a.def(c,"$round",ea=function(Ia){return this.$to_f().$round(Ia)},ea.$$arity=-1);a.def(c,"$to_c",F=function(){return this.$Complex(this,0)},F.$$arity=0);a.def(c,"$to_int",V=function(){return this.$to_i()},V.$$arity=0);a.def(c,"$truncate",ka=function(Ia){null==Ia&&(Ia=0);return this.$to_f().$truncate(Ia)},ka.$$arity=-1);a.def(c,"$zero?",va=function(){return this["$=="](0)},va.$$arity=0);a.def(c,"$positive?",ia=function(){return"number"===typeof this?0"](0)},ia.$$arity=0);a.def(c,"$negative?", +wa=function(){return t(this,0)},wa.$$arity=0);a.def(c,"$dup",Ha=function(){return this},Ha.$$arity=0);a.def(c,"$clone",Ea=function(Ia){if(null==Ia)u([],{});else if(!Ia.$$is_hash)throw a.ArgumentError.$new("expected kwargs");return this},Ea.$$arity=-1);a.def(c,"$finite?",Qa=function(){return!0},Qa.$$arity=0);return(a.def(c,"$infinite?",Sa=function(){return d},Sa.$$arity=0),d)&&"infinite?"}(p[0],null,p)}; +Opal.modules["corelib/array"]=function(a){function y(ja,da){return"number"===typeof ja&&"number"===typeof da?ja>da:ja["$>"](da)}var J=a.top,t=[],w=a.nil,z=a.$$$,p=a.$$,d=a.truthy,H=a.falsy,x=a.hash_ids,k=a.yield1,m=a.hash_get,u=a.hash_put,c=a.hash_delete,l=a.coerce_to,I=a.respond_to,e=a.klass,n=a.hash2,L=a.send2,D=a.send,R=a.gvars;a.add_stubs("$require $include $to_a $warn $raise $replace $respond_to? $to_ary $coerce_to? $=== $join $to_str $class $hash $<=> $== $object_id $inspect $enum_for $bsearch_index $to_proc $nil? $coerce_to! $> $* $enumerator_size $empty? $size $map $equal? $dup $each $[] $dig $eql? $length $exclude_end? $flatten $__id__ $to_s $new $max $min $! $>= $** $delete_if $reverse $rotate $rand $at $keep_if $shuffle! $< $sort $sort_by $!= $times $[]= $- $<< $values $is_a? $last $first $upto $reject $pristine $singleton_class".split(" ")); +J.$require("corelib/enumerable");J.$require("corelib/numeric");return function(ja,$super,ma){function b(r,K){return K.$$name===a.Array?r:K.$allocate().$replace(r.$to_a())}function h(r,K,P){for(var ca,ha=null,qa=Array(r.length),Pa=0,fb=0,$a=r.length;Pa<$a;Pa++){if(!ha)try{ca=k(P,r[Pa])}catch(lb){ha=lb}if(ha||K(ca))qa[fb]=r[Pa],fb+=1}fb!==Pa&&(r.splice.apply(r,[0,qa.length].concat(qa)),r.splice(fb,qa.length));if(ha)throw ha;}function f(r,K){var P=r.length;var ca=K.excl;var ha=l(K.begin,a.Integer,"to_int"); +K=l(K.end,a.Integer,"to_int");if(0>ha&&(ha+=P,0>ha)||ha>P)return w;if(0>K&&(K+=P,0>K))return[];ca||(K+=1);P=r.slice(ha,K);return b(P,r.$class())}function q(r,K,P){var ca=r.length;K=l(K,a.Integer,"to_int");if(0>K&&(K+=ca,0>K))return w;if(void 0===P)return K>=ca||0>K?w:r[K];P=l(P,a.Integer,"to_int");if(0>P||K>ca||0>K)return w;K=r.slice(K,K+P);return b(K,r.$class())}function A(r,K){return r===K||0===K?1:0K?A(r-1,K-1)+A(r-1,K):0}var E=e(ja,$super,"Array"),G=[E].concat(ma),M,ba,ua,Oa,xa,Ba,La,na, +S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra,W,za,Ca,Va,ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T,fa,la,g,C,N,aa,v,U,oa,Ka,jb,ob,mb,sb,tb,wb,xb,ub,X,Na,cb,B,O,ra,Ga,Da,Ja,Wa,hb,eb,Ua,Ya,gb,qb,nb,pb,Gb,Ab,Jb,Bb,Kb,Cb,Db,Lb,Mb,Eb,Nb,Fb,Ob;E.$include(p(G,"Enumerable"));a.defineProperty(E.$$prototype,"$$is_array",!0);a.defs(E,"$[]",M=function(r){var K=a.slice.call(arguments,0,arguments.length);return b(K,this)},M.$$arity=-1);a.def(E,"$initialize",ba=function(r,K){var P=ba.$$p,ca=P||w;P&&(ba.$$p=null); +P&&(ba.$$p=null);null==r&&(r=w);null==K&&(K=w);K!==w&&ca!==w&&this.$warn("warning: block supersedes default value argument");r>z(p(G,"Integer"),"MAX")&&this.$raise(p(G,"ArgumentError"),"array size too big");2r&&this.$raise(p(G,"ArgumentError"),"negative array size");this.splice(0,this.length);if(ca===w)for(P=0;Pr)&&this.$raise(p(G, +"ArgumentError"),"negative argument");for(var K=[],P=this.$to_a(),ca=0;ca",sa=function(r){if(d(p(G,"Array")["$==="](r)))r=r.$to_a();else if(d(r["$respond_to?"]("to_ary")))r=r.$to_ary().$to_a();else return w;if(this.$hash()===r.$hash())return 0;for(var K=Math.min(this.length,r.length),P=0;P"](r[P]);if(0!==ca)return ca}return this.length["$<=>"](r.length)},sa.$$arity= +1);a.def(E,"$==",ya=function(r){function K(ca,ha){var qa;if(ca===ha)return!0;if(!ha.$$is_array)return I(ha,"$to_ary")?ha["$=="](ca):!1;ca.$$constructor!==Array&&(ca=ca.$to_a());ha.$$constructor!==Array&&(ha=ha.$to_a());if(ca.length!==ha.length)return!1;P[ca.$object_id()]=!0;var Pa=0;for(qa=ca.length;PaP&&(P+=ha,0>P&&this.$raise(p(G,"RangeError"),""+r.$inspect()+" out of range"));0>Pa&&(Pa+=ha);qa|| +(Pa+=1);if(P>ha)for(;haPa?this.splice.apply(this,[P,0].concat(ca)):this.splice.apply(this,[P,Pa-P].concat(ca))}else{d(void 0===P)?Pa=1:(Pa=K,K=P,ca=d(p(G,"Array")["$==="](K))?K.$to_a():d(K["$respond_to?"]("to_ary"))?K.$to_ary().$to_a():[K]);r=l(r,p(G,"Integer"),"to_int");Pa=l(Pa,p(G,"Integer"),"to_int");0>r&&(qa=r,r+=ha,0>r&&this.$raise(p(G,"IndexError"),"index "+qa+" too small for array; minimum "+-this.length));0>Pa&&this.$raise(p(G,"IndexError"),"negative length ("+Pa+")"); +if(r>ha)for(;har&&(r+=this.length);return 0>r||r>=this.length?w:this[r]},ka.$$arity=1);a.def(E,"$bsearch_index",va=function(){var r=va.$$p,K=r||w;r&&(va.$$p=null);r&&(va.$$p=null);if(K===w)return this.$enum_for("bsearch_index");r=0;for(var P=this.length,ca,ha,qa=!1,Pa=w;rha}else this.$raise(p(G, +"TypeError"),"wrong argument type "+ha.$class()+" (must be numeric, true, false or nil)");qa?P=ca:r=ca+1}return Pa},va.$$arity=0);a.def(E,"$bsearch",ia=function(){var r=ia.$$p,K=r||w;r&&(ia.$$p=null);r&&(ia.$$p=null);if(K===w)return this.$enum_for("bsearch");r=D(this,"bsearch_index",[],K.$to_proc());return null!=r&&r.$$is_number?this[r]:r},ia.$$arity=0);a.def(E,"$cycle",wa=function(r){var K=wa.$$p,P=K||w,ca,ha=w;K&&(wa.$$p=null);K&&(wa.$$p=null);null==r&&(r=w);if(P===w)return D(this,"enum_for",["cycle", +r],(ca=function(){var qa=null==ca.$$s?this:ca.$$s;if(d(r["$nil?"]()))return z(p(G,"Float"),"INFINITY");r=p(G,"Opal")["$coerce_to!"](r,p(G,"Integer"),"to_int");return d(y(r,0))?(qa=qa.$enumerator_size(),"number"===typeof qa&&"number"===typeof r?qa*r:qa["$*"](r)):0},ca.$$s=this,ca.$$arity=0,ca));if(d(d(ha=this["$empty?"]())?ha:r["$=="](0)))return w;if(r===w)for(;;)for(K=0,ha=this.length;K=r)return this;for(;0r&&(r+=this.length);if(0>r||r>= +this.length)return w;var K=this[r];this.splice(r,1);return K},ib.$$arity=1);a.def(E,"$delete_if",db=function(){var r=db.$$p,K=r||w,P;r&&(db.$$p=null);r&&(db.$$p=null);if(K===w)return D(this,"enum_for",["delete_if"],(P=function(){return(null==P.$$s?this:P.$$s).$size()},P.$$s=this,P.$$arity=0,P));h(this,H,K);return this},db.$$arity=0);a.alias(E,"difference","-");a.def(E,"$dig",Xa=function(r,K){var P=a.slice.call(arguments,1,arguments.length);var ca=this["$[]"](r);if(ca===w||0===P.length)return ca;d(ca["$respond_to?"]("dig"))|| +this.$raise(p(G,"TypeError"),""+ca.$class()+" does not have #dig method");return D(ca,"dig",a.to_a(P))},Xa.$$arity=-2);a.def(E,"$drop",bb=function(r){0>r&&this.$raise(p(G,"ArgumentError"));return this.slice(r)},bb.$$arity=1);a.def(E,"$dup",Aa=function(){var r=Aa.$$p,K;r&&(Aa.$$p=null);var P=0;var ca=arguments.length;for(K=Array(ca);Pr&&(r+=this.length);if(0<=r&&rha)&&(ha+=this.length),d(0>ha)&&this.$raise(p(G,"RangeError"),""+K.$inspect()+" out of range"), +qa=l(K.end,p(G,"Integer"),"to_int"),d(0>qa)&&(qa+=this.length),d(K["$exclude_end?"]())||(qa+=1),d(qa<=ha))return this}else if(d(K))if(ha=l(K,p(G,"Integer"),"to_int"),d(0>ha)&&(ha+=this.length),d(0>ha)&&(ha=0),d(qa)){qa=l(qa,p(G,"Integer"),"to_int");if(d(0==qa))return this;qa+=ha}else qa=this.length;else ha=0,qa=this.length;if(d(ha>this.length))for(K=this.length;Kthis.length)&&(this.length=qa);if(d(P))for(;har&&this.$raise(p(G,"ArgumentError"),"negative array size");return this.slice(0,r)},Q.$$arity=-1);a.def(E,"$flatten",Z=function(r){function K(ca,ha){var qa=[],Pa;ca=ca.$to_a();var fb=0;for(Pa=ca.length;fbr&&(r+=this.length+1,0>r&&this.$raise(p(G,"IndexError"),""+r+" is out of bounds"));if(r>this.length)for(var ca=this.length;car&&this.$raise(p(G,"ArgumentError"),"negative array size");r>this.length&&(r=this.length);return this.slice(this.length-r,this.length)},U.$$arity=-1);a.def(E,"$length",oa=function(){return this.length}, +oa.$$arity=0);a.alias(E,"map","collect");a.alias(E,"map!","collect!");a.def(E,"$max",Ka=function(r){var K=Ka.$$p,P=K||w;K&&(Ka.$$p=null);K&&(Ka.$$p=null);return D(this.$each(),"max",[r],P.$to_proc())},Ka.$$arity=-1);a.def(E,"$min",jb=function(){var r=jb.$$p,K=r||w;r&&(jb.$$p=null);r&&(jb.$$p=null);return D(this.$each(),"min",[],K.$to_proc())},jb.$$arity=0);a.def(E,"$permutation",ob=function(r){var K=ob.$$p,P=K||w,ca,ha=this,qa=w,Pa=w;K&&(ob.$$p=null);K&&(ob.$$p=null);if(P===w)return D(ha,"enum_for", +["permutation",r],(ca=function(){var lb=null==ca.$$s?this:ca.$$s,vb=lb.length;lb=void 0===r?lb.length:r;for(var yb=0<=lb?1:0;lb;)yb*=vb,vb--,lb--;return yb},ca.$$s=ha,ca.$$arity=0,ca));var fb;r=void 0===r?ha.length:l(r,p(G,"Integer"),"to_int");if(!(0>r||ha.length="](0))?Pa.$size()["$**"](qa):0},P.$$s=this,P.$$arity=0,P));K(qa,[],this.slice());return this},mb.$$arity=1);a.def(E,"$pop",sb=function(r){if(d(void 0===r))return d(0===this.length)?w:this.pop();r=l(r,p(G,"Integer"),"to_int");d(0>r)&&this.$raise(p(G,"ArgumentError"),"negative array size");return d(0===this.length)?[]:d(1===r)?[this.pop()]:d(r> +this.length)?this.splice(0,this.length):this.splice(this.length-r,this.length)},sb.$$arity=-1);a.def(E,"$product",tb=function(r){var K=tb.$$p,P=K||w;K&&(tb.$$p=null);K&&(tb.$$p=null);var ca=a.slice.call(arguments,0,arguments.length);K=P!==w?null:[];var ha=ca.length+1,qa=Array(ha),Pa=Array(ha),fb=Array(ha),$a;var lb=1;fb[0]=this;for($a=1;$a--$a)break a;qa[$a]++}}return K||this},tb.$$arity=-1);a.def(E,"$push",wb=function(r){var K=a.slice.call(arguments,0,arguments.length);for(var P=0,ca=K.length;P=this.length);K--){if(this[K]["$=="](r))return K}else if(P!==w)for(K=this.length-1;0<=K&&!(K>=this.length);K--){if(r=P(this[K]),!1!==r&&r!==w)return K}else if(null==r)return this.$enum_for("rindex");return w},ra.$$arity=-1);a.def(E,"$rotate",Ga=function(r){null==r&&(r=1);r=l(r,p(G,"Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var K=this.slice();var P=r%K.length;r=K.slice(P);K=K.slice(0,P);return r.concat(K)},Ga.$$arity=-1); +a.def(E,"$rotate!",Da=function(r){null==r&&(r=1);if(0===this.length||1===this.length)return this;r=l(r,p(G,"Integer"),"to_int");r=this.$rotate(r);return this.$replace(r)},Da.$$arity=-1);(function(r,$super,P){r=e(r,$super,"SampleRandom");var ca=[r].concat(P),ha,qa;r.$$prototype.rng=w;a.def(r,"$initialize",ha=function(Pa){return this.rng=Pa},ha.$$arity=1);return(a.def(r,"$rand",qa=function(Pa){var fb=l(this.rng.$rand(Pa),p(ca,"Integer"),"to_int");d(0>fb)&&this.$raise(p(ca,"RangeError"),"random value must be >= 0"); +d(fbr:P)&&this.$raise(p(G,"ArgumentError"),"count must be greater than 0"); +d(K)&&(ca=K["$[]"]("random"));ca=d(d(ha=ca)?ca["$respond_to?"]("rand"):ha)?p(G,"SampleRandom").$new(ca):p(G,"Kernel");if(!d(r))return this[ca.$rand(this.length)];r>this.length&&(r=this.length);switch(r){case 0:return[];case 1:return[this[ca.$rand(this.length)]];case 2:var qa=ca.$rand(this.length);var Pa=ca.$rand(this.length);qa===Pa&&(Pa=0===qa?qa+1:qa-1);return[this[qa],this[Pa]];default:if(3r)&&this.$raise(p(G,"ArgumentError"),"negative array size");return d(0===this.length)?[]:this.splice(0,r)},eb.$$arity=-1);a.alias(E,"size","length");a.def(E,"$shuffle",Ua=function(r){return this.$dup().$to_a()["$shuffle!"](r)},Ua.$$arity=-1);a.def(E,"$shuffle!",Ya=function(r){var K,P=this.length;void 0!== +r&&(r=p(G,"Opal")["$coerce_to?"](r,p(G,"Hash"),"to_hash"),r!==w&&(r=r["$[]"]("random"),r!==w&&r["$respond_to?"]("rand")&&(K=r)));for(;P;){K?(r=K.$rand(P).$to_int(),0>r&&this.$raise(p(G,"RangeError"),"random number too small "+r),r>=P&&this.$raise(p(G,"RangeError"),"random number too big "+r)):r=this.$rand(P);var ca=this[--P];this[P]=this[r];this[r]=ca}return this},Ya.$$arity=-1);a.alias(E,"slice","[]");a.def(E,"$slice!",gb=function(r,K){if(d(void 0===K))if(d(p(G,"Range")["$==="](r))){var P=this["$[]"](r); +K=l(r.begin,p(G,"Integer"),"to_int");var ca=l(r.end,p(G,"Integer"),"to_int");0>K&&(K+=this.length);0>ca?ca+=this.length:ca>=this.length&&(ca=this.length-1,r.excl&&(ca+=1));var ha=ca-K;r.excl?--ca:ha+=1;Kr&&(r+=this.length);if(0>r||r>=this.length)return w;P=this[r];0===r?this.shift():this.splice(r,1)}else{r=l(r,p(G,"Integer"),"to_int");K=l(K,p(G,"Integer"),"to_int");if(0>K)return w;P=this["$[]"](r, +K);0>r&&(r+=this.length);r+K>this.length&&(K=this.length-r);r"](ha)});return P.slice().sort(function(ca,ha){var qa=K(ca,ha);qa===w&&P.$raise(p(G,"ArgumentError"),"comparison of "+ca.$inspect()+" with "+ha.$inspect()+" failed");return y(qa,0)?1:("number"===typeof qa?0>qa:qa["$<"](0))? +-1:0})},qb.$$arity=0);a.def(E,"$sort!",nb=function(){var r=nb.$$p,K=r||w;r&&(nb.$$p=null);r&&(nb.$$p=null);r=K!==w?D(this.slice(),"sort",[],K.$to_proc()):this.slice().$sort();K=this.length=0;for(var P=r.length;Kr&&this.$raise(p(G,"ArgumentError"));return this.slice(0,r)},Gb.$$arity=1);a.def(E,"$take_while",Ab=function(){var r=Ab.$$p,K=r||w;r&&(Ab.$$p=null);r&&(Ab.$$p=null);r=[];for(var P=0,ca=this.length,ha,qa;P$a)return $a+=qa.length,w;0>fb&&(fb+=qa.length);ha["$exclude_end?"]()&&fb--;return fb<$a?w:D($a,"upto",[fb],(Pa=function(lb){var vb=null==Pa.$$s?this:Pa.$$s;null==lb&&(lb=w);return P["$<<"](vb.$at(lb))}, +Pa.$$s=qa,Pa.$$arity=1,Pa))}fb=l(ha,p(G,"Integer"),"to_int");return P["$<<"](qa.$at(fb))},K.$$s=this,K.$$arity=1,K));return P},Mb.$$arity=-1);a.def(E,"$zip",Eb=function(r){var K=Eb.$$p,P=K||w,ca=w;K&&(Eb.$$p=null);K&&(Eb.$$p=null);K=a.slice.call(arguments,0,arguments.length);var ha=[],qa=this.length,Pa,fb;var $a=0;for(fb=K.length;$a=m:k["$>="](m)}var K=a.top,t=[],w=a.nil,A=a.$$,p=a.klass,d=a.send,G=a.hash2,x=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));K.$require("corelib/enumerable"); -return function(k,$super,u){k=p(k,$super,"Hash");var c=[k].concat(u),l,H,e,n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb,W,ya,Da,Va,ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T,fa;k.$include(A(c,"Enumerable"));k.$$prototype.$$is_hash=!0;a.defs(k,"$[]",l=function(g){var C=a.slice.call(arguments,0,arguments.length);var M=C.length,ba;if(1===M){var v=A(c,"Opal")["$coerce_to?"](C["$[]"](0),A(c,"Hash"),"to_hash");if(v!==w)return this.$allocate()["$merge!"](v); -C=A(c,"Opal")["$coerce_to?"](C["$[]"](0),A(c,"Array"),"to_ary");C===w&&this.$raise(A(c,"ArgumentError"),"odd number of arguments for Hash");M=C.length;v=this.$allocate();for(ba=0;ba=",D=function(g){var C,M=w;g=A(c,"Opal")["$coerce_to!"](g,A(c,"Hash"),"to_hash");if(this.$$keys.length",R=function(g){g=A(c,"Opal")["$coerce_to!"](g,A(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:y(this,g)},R.$$arity=1);a.def(k,"$<",ia=function(g){g=A(c,"Opal")["$coerce_to!"](g,A(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ia.$$arity= -1);a.def(k,"$<=",ea=function(g){g=A(c,"Opal")["$coerce_to!"](g,A(c,"Hash"),"to_hash");return y(g,this)},ea.$$arity=1);a.def(k,"$[]",ma=function(g){var C=a.hash_get(this,g);return void 0!==C?C:this.$default(g)},ma.$$arity=1);a.def(k,"$[]=",b=function(g,C){a.hash_put(this,g,C);return C},b.$$arity=2);a.def(k,"$assoc",h=function(g){for(var C=0,M=this.$$keys,ba=M.length,v;C"+qa.$inspect());return"{"+M.join(", ")+"}"}finally{g&&(ka=void 0)}},Fa.$$arity=0);a.def(k,"$invert",Sa=function(){for(var g=a.hash(),C=0,M=this.$$keys,ba=M.length,v,U;CJ:n["$>"](J)}function K(n,J){return"number"===typeof n&&"number"===typeof J?n $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));d.$require("corelib/numeric");(function(n,$super,D){n=u(n,$super,"Number");var R=[n].concat(D),ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa, -wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb,W,ya,Da,Va,ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T,fa,ka,g,C,M,ba,v,U,qa,Ja,jb,ob,mb,sb,tb,wb,xb,ub;m(R,"Opal").$bridge(Number,n);a.defineProperty(n.$$prototype,"$$is_number",!0);n.$$is_number_class=!0;(function(X,Ma){var bb=[X].concat(Ma),B;a.def(X,"$allocate",B=function(){return this.$raise(m(bb,"TypeError"),"allocator undefined for "+this.$name())},B.$$arity=0);a.udef(X,"$new");return x})(a.get_singleton_class(n),R);a.def(n,"$coerce", -ia=function(X){if(X!==x){if(X.$$is_string)return[this.$Float(X),this];if(X["$respond_to?"]("to_f"))return[m(R,"Opal")["$coerce_to!"](X,m(R,"Float"),"to_f"),this];if(X.$$is_number)return[X,this]}this.$raise(m(R,"TypeError"),"can't convert "+X.$class()+" into Float")},ia.$$arity=1);a.def(n,"$__id__",ea=function(){return 2*this+1},ea.$$arity=0);a.alias(n,"object_id","__id__");a.def(n,"$+",ma=function(X){return X.$$is_number?this+X:this.$__coerced__("+",X)},ma.$$arity=1);a.def(n,"$-",b=function(X){return X.$$is_number? -this-X:this.$__coerced__("-",X)},b.$$arity=1);a.def(n,"$*",h=function(X){return X.$$is_number?this*X:this.$__coerced__("*",X)},h.$$arity=1);a.def(n,"$/",f=function(X){return X.$$is_number?this/X:this.$__coerced__("/",X)},f.$$arity=1);a.alias(n,"fdiv","/");a.def(n,"$%",q=function(X){if(X.$$is_number){if(-Infinity==X)return X;if(0==X)this.$raise(m(R,"ZeroDivisionError"),"divided by 0");else return 0>X||0>this?(this%X+X)%X:this%X}else return this.$__coerced__("%",X)},q.$$arity=1);a.def(n,"$&",z=function(X){return X.$$is_number? -this&X:this.$__coerced__("&",X)},z.$$arity=1);a.def(n,"$|",E=function(X){return X.$$is_number?this|X:this.$__coerced__("|",X)},E.$$arity=1);a.def(n,"$^",F=function(X){return X.$$is_number?this^X:this.$__coerced__("^",X)},F.$$arity=1);a.def(n,"$<",L=function(X){return X.$$is_number?this",va=function(X){return X.$$is_number?this>X:this.$__coerced__(">", -X)},va.$$arity=1);a.def(n,"$>=",Oa=function(X){return X.$$is_number?this>=X:this.$__coerced__(">=",X)},Oa.$$arity=1);a.def(n,"$<=>",wa=function(X){try{return X.$$is_number?isNaN(this)||isNaN(X)?x:this>X?1:this",X)}catch(Ma){if(a.rescue(Ma,[m(R,"ArgumentError")]))try{return x}finally{a.pop_exception()}else throw Ma;}},wa.$$arity=1);a.def(n,"$<<",Ba=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>-X},Ba.$$arity=1);a.def(n,"$>>", -Ka=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>X:this<<-X},Ka.$$arity=1);a.def(n,"$[]",na=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>X?0:32<=X?0>this?1:0:this>>X&1},na.$$arity=1);a.def(n,"$+@",S=function(){return+this},S.$$arity=0);a.def(n,"$-@",ta=function(){return-this},ta.$$arity=0);a.def(n,"$~",ja=function(){return~this},ja.$$arity=0);a.def(n,"$**",oa=function(X){var Ma=x,bb=x,B=x;return c(m(R,"Integer")["$==="](X))?c(c(Ma= -m(R,"Integer")["$==="](this)["$!"]())?Ma:y(X,0))?Math.pow(this,X):m(R,"Rational").$new(this,1)["$**"](X):c(c(bb=K(this,0))?c(B=m(R,"Float")["$==="](X))?B:m(R,"Rational")["$==="](X):bb)?m(R,"Complex").$new(this,0)["$**"](X.$to_f()):c(null!=X.$$is_number)?Math.pow(this,X):this.$__coerced__("**",X)},oa.$$arity=1);a.def(n,"$===",V=function(X){return X.$$is_number?this.valueOf()===X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},V.$$arity=1);a.def(n,"$==",Q=function(X){return X.$$is_number?this.valueOf()=== -X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},Q.$$arity=1);a.def(n,"$abs",Y=function(){return Math.abs(this)},Y.$$arity=0);a.def(n,"$abs2",pa=function(){return Math.abs(this*this)},pa.$$arity=0);a.def(n,"$allbits?",za=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return(this&X)==X},za.$$arity=1);a.def(n,"$anybits?",la=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0!==(this&X)},la.$$arity=1);a.def(n,"$angle",xa=function(){return c(this["$nan?"]())? -this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},xa.$$arity=0);a.alias(n,"arg","angle");a.alias(n,"phase","angle");a.def(n,"$bit_length",Ea=function(){c(m(R,"Integer")["$==="](this))||this.$raise(m(R,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var X=0,Ma=0>this?~this:this;0!=Ma;)X+=1,Ma>>>=1;return X},Ea.$$arity=0);a.def(n,"$ceil",Fa=function(X){null==X&&(X=0);var Ma=this.$to_f();if(0===Ma%1&&0<=X)return Ma;X=Math.pow(10, -X);X=Math.ceil(Ma*X)/X;0===Ma%1&&(X=Math.round(X));return X},Fa.$$arity=-1);a.def(n,"$chr",Sa=function(){return String.fromCharCode(this)},Sa.$$arity=-1);a.def(n,"$denominator",Ra=function(){var X=Ra.$$p,Ma=x,bb;X&&(Ra.$$p=null);var B=0;var N=arguments.length;for(bb=Array(N);B=X;Ma--)bb(Ma);return this},Na.$$arity=1);a.alias(n,"eql?","=="); -a.def(n,"$equal?",Qa=function(X){var Ma;return c(Ma=this["$=="](X))?Ma:isNaN(this)&&isNaN(X)},Qa.$$arity=1);a.def(n,"$even?",lb=function(){return 0===this%2},lb.$$arity=0);a.def(n,"$floor",W=function(X){null==X&&(X=0);var Ma=this.$to_f();if(0===Ma%1&&0<=X)return Ma;X=Math.pow(10,X);X=Math.floor(Ma*X)/X;0===Ma%1&&(X=Math.round(X));return X},W.$$arity=-1);a.def(n,"$gcd",ya=function(X){c(m(R,"Integer")["$==="](X))||this.$raise(m(R,"TypeError"),"not an integer");var Ma=Math.abs(this);for(X=Math.abs(X);0< -Ma;){var bb=Ma;Ma=X%Ma;X=bb}return X},ya.$$arity=1);a.def(n,"$gcdlcm",Da=function(X){return[this.$gcd(X),this.$lcm(X)]},Da.$$arity=1);a.def(n,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(n,"$is_a?",ib=function(X){var Ma=ib.$$p,bb=x,B=x,N=x,sa;Ma&&(ib.$$p=null);var Ha=0;var Ca=arguments.length;for(sa=Array(Ca);HaX&&this.$raise(m(R,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");m(R,"Integer")["$==="](Ma)||this.$raise(m(R,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); -0===Ma&&this.$raise(m(R,"ZeroDivisionError"),"divided by 0");return this["$**"](X)["$%"](Ma)},Ga.$$arity=-2);a.def(n,"$pred",Z=function(){return this-1},Z.$$arity=0);a.def(n,"$quo",P=function(X){var Ma=P.$$p,bb;Ma&&(P.$$p=null);var B=0;var N=arguments.length;for(bb=Array(N);Bthis.$size())return 0;X=Math.pow(10,X);X*=Math.floor((Math.abs(this)+X/2)/X);return 0>this?-X:X}c(c(bb=this["$nan?"]())?null==X:bb)&&this.$raise(m(R,"FloatDomainError"),"NaN");X=m(R,"Opal")["$coerce_to!"](X||0,m(R,"Integer"),"to_int");if(c("number"===typeof X?0>=X:X["$<="](0)))c(this["$nan?"]())?this.$raise(m(R,"RangeError"),"NaN"):c(this["$infinite?"]())&& -this.$raise(m(R,"FloatDomainError"),"Infinity");else{if(X["$=="](0))return Math.round(this);if(c(c(B=this["$nan?"]())?B:this["$infinite?"]()))return this}bb=m(R,"Math").$frexp(this);Ma=a.to_ary(bb);Ma=null==Ma[1]?x:Ma[1];bb;bb=w(t(k(m(R,"Float"),"DIG"),2),c(y(Ma,0))?A(Ma,4):w(A(Ma,3),1));bb="number"===typeof X&&"number"===typeof bb?X>=bb:X["$>="](bb);return c(bb)?this:c(K(X,(c(y(Ma,0))?t(A(Ma,3),1):A(Ma,4))["$-@"]()))?0:Math.round(this*Math.pow(10,X))/Math.pow(10,X)},fa.$$arity=-1);a.def(n,"$step", -ka=function(X,Ma,bb){function B(){void 0!==gb&&(Ua=gb);void 0===Ua&&(Ua=x);Xa===x&&hb.$raise(m(R,"TypeError"),"step must be numeric");0===Xa&&hb.$raise(m(R,"ArgumentError"),"step can't be 0");void 0!==qb&&(Xa=qb);if(Xa===x||null==Xa)Xa=1;var nb=Xa["$<=>"](0);nb===x&&hb.$raise(m(R,"ArgumentError"),"0 can't be coerced into "+Xa.$class());if(Ua===x||null==Ua)Ua=0Ua||0>Xa&&hbUa||0>Xa&&hbIa&&(Ia=Ua),Ca(Ia),Ha+=1}else if(Wa=hb,0= -Ua;)Ca(Wa),Wa+=Xa;return hb},ka.$$arity=-1);a.alias(n,"succ","next");a.def(n,"$times",g=function(){var X=g.$$p,Ma=X||x,bb;X&&(g.$$p=null);X&&(g.$$p=null);if(!c(Ma))return H(this,"enum_for",["times"],(bb=function(){return null==bb.$$s?this:bb.$$s},bb.$$s=this,bb.$$arity=0,bb));for(X=0;X=m:k["$>="](m)}var J=a.top,t=[],w=a.nil,z=a.$$,p=a.klass,d=a.send,H=a.hash2,x=a.truthy;a.add_stubs("$require $include $coerce_to? $[] $merge! $allocate $raise $coerce_to! $each $fetch $>= $> $== $compare_by_identity $lambda? $abs $arity $enum_for $size $respond_to? $class $dig $new $inspect $map $to_proc $flatten $eql? $default $dup $default_proc $default_proc= $- $default= $to_h $proc".split(" "));J.$require("corelib/enumerable"); +return function(k,$super,u){k=p(k,$super,"Hash");var c=[k].concat(u),l,I,e,n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra,W,za,Ca,Va,ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T,fa;k.$include(z(c,"Enumerable"));k.$$prototype.$$is_hash=!0;a.defs(k,"$[]",l=function(g){var C=a.slice.call(arguments,0,arguments.length);var N=C.length,aa;if(1===N){var v=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Hash"),"to_hash");if(v!==w)return this.$allocate()["$merge!"](v); +C=z(c,"Opal")["$coerce_to?"](C["$[]"](0),z(c,"Array"),"to_ary");C===w&&this.$raise(z(c,"ArgumentError"),"odd number of arguments for Hash");N=C.length;v=this.$allocate();for(aa=0;aa=",D=function(g){var C,N=w;g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");if(this.$$keys.length",R=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return this.$$keys.length<=g.$$keys.length?!1:y(this,g)},R.$$arity=1);a.def(k,"$<",ja=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return"number"===typeof g&&"number"===typeof this?g>this:g["$>"](this)},ja.$$arity= +1);a.def(k,"$<=",da=function(g){g=z(c,"Opal")["$coerce_to!"](g,z(c,"Hash"),"to_hash");return y(g,this)},da.$$arity=1);a.def(k,"$[]",ma=function(g){var C=a.hash_get(this,g);return void 0!==C?C:this.$default(g)},ma.$$arity=1);a.def(k,"$[]=",b=function(g,C){a.hash_put(this,g,C);return C},b.$$arity=2);a.def(k,"$assoc",h=function(g){for(var C=0,N=this.$$keys,aa=N.length,v;C"+oa.$inspect());return"{"+N.join(", ")+"}"}finally{g&&(la=void 0)}},Ea.$$arity=0);a.def(k,"$invert",Qa=function(){for(var g=a.hash(),C=0,N=this.$$keys,aa=N.length,v,U;CL:n["$>"](L)}function J(n,L){return"number"===typeof n&&"number"===typeof L?n $** $new $< $to_f $== $nan? $infinite? $enum_for $+ $- $gcd $lcm $% $/ $frexp $to_i $ldexp $rationalize $* $<< $to_r $truncate $-@ $size $<= $>= $<=> $compare $any?".split(" "));d.$require("corelib/numeric");(function(n,$super,D){n=u(n,$super,"Number");var R=[n].concat(D),ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa, +xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra,W,za,Ca,Va,ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T,fa,la,g,C,N,aa,v,U,oa,Ka,jb,ob,mb,sb,tb,wb,xb,ub;m(R,"Opal").$bridge(Number,n);a.defineProperty(n.$$prototype,"$$is_number",!0);n.$$is_number_class=!0;(function(X,Na){var cb=[X].concat(Na),B;a.def(X,"$allocate",B=function(){return this.$raise(m(cb,"TypeError"),"allocator undefined for "+this.$name())},B.$$arity=0);a.udef(X,"$new");return x})(a.get_singleton_class(n),R);a.def(n,"$coerce", +ja=function(X){if(X!==x){if(X.$$is_string)return[this.$Float(X),this];if(X["$respond_to?"]("to_f"))return[m(R,"Opal")["$coerce_to!"](X,m(R,"Float"),"to_f"),this];if(X.$$is_number)return[X,this]}this.$raise(m(R,"TypeError"),"can't convert "+X.$class()+" into Float")},ja.$$arity=1);a.def(n,"$__id__",da=function(){return 2*this+1},da.$$arity=0);a.alias(n,"object_id","__id__");a.def(n,"$+",ma=function(X){return X.$$is_number?this+X:this.$__coerced__("+",X)},ma.$$arity=1);a.def(n,"$-",b=function(X){return X.$$is_number? +this-X:this.$__coerced__("-",X)},b.$$arity=1);a.def(n,"$*",h=function(X){return X.$$is_number?this*X:this.$__coerced__("*",X)},h.$$arity=1);a.def(n,"$/",f=function(X){return X.$$is_number?this/X:this.$__coerced__("/",X)},f.$$arity=1);a.alias(n,"fdiv","/");a.def(n,"$%",q=function(X){if(X.$$is_number){if(-Infinity==X)return X;if(0==X)this.$raise(m(R,"ZeroDivisionError"),"divided by 0");else return 0>X||0>this?(this%X+X)%X:this%X}else return this.$__coerced__("%",X)},q.$$arity=1);a.def(n,"$&",A=function(X){return X.$$is_number? +this&X:this.$__coerced__("&",X)},A.$$arity=1);a.def(n,"$|",E=function(X){return X.$$is_number?this|X:this.$__coerced__("|",X)},E.$$arity=1);a.def(n,"$^",G=function(X){return X.$$is_number?this^X:this.$__coerced__("^",X)},G.$$arity=1);a.def(n,"$<",M=function(X){return X.$$is_number?this",ua=function(X){return X.$$is_number?this>X:this.$__coerced__(">", +X)},ua.$$arity=1);a.def(n,"$>=",Oa=function(X){return X.$$is_number?this>=X:this.$__coerced__(">=",X)},Oa.$$arity=1);a.def(n,"$<=>",xa=function(X){try{return X.$$is_number?isNaN(this)||isNaN(X)?x:this>X?1:this",X)}catch(Na){if(a.rescue(Na,[m(R,"ArgumentError")]))try{return x}finally{a.pop_exception()}else throw Na;}},xa.$$arity=1);a.def(n,"$<<",Ba=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>-X},Ba.$$arity=1);a.def(n,"$>>", +La=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>X:this<<-X},La.$$arity=1);a.def(n,"$[]",na=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0>X?0:32<=X?0>this?1:0:this>>X&1},na.$$arity=1);a.def(n,"$+@",S=function(){return+this},S.$$arity=0);a.def(n,"$-@",sa=function(){return-this},sa.$$arity=0);a.def(n,"$~",ya=function(){return~this},ya.$$arity=0);a.def(n,"$**",pa=function(X){var Na=x,cb=x,B=x;return c(m(R,"Integer")["$==="](X))?c(c(Na= +m(R,"Integer")["$==="](this)["$!"]())?Na:y(X,0))?Math.pow(this,X):m(R,"Rational").$new(this,1)["$**"](X):c(c(cb=J(this,0))?c(B=m(R,"Float")["$==="](X))?B:m(R,"Rational")["$==="](X):cb)?m(R,"Complex").$new(this,0)["$**"](X.$to_f()):c(null!=X.$$is_number)?Math.pow(this,X):this.$__coerced__("**",X)},pa.$$arity=1);a.def(n,"$===",ea=function(X){return X.$$is_number?this.valueOf()===X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},ea.$$arity=1);a.def(n,"$==",F=function(X){return X.$$is_number?this.valueOf()=== +X.valueOf():X["$respond_to?"]("==")?X["$=="](this):!1},F.$$arity=1);a.def(n,"$abs",V=function(){return Math.abs(this)},V.$$arity=0);a.def(n,"$abs2",ka=function(){return Math.abs(this*this)},ka.$$arity=0);a.def(n,"$allbits?",va=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return(this&X)==X},va.$$arity=1);a.def(n,"$anybits?",ia=function(X){X=m(R,"Opal")["$coerce_to!"](X,m(R,"Integer"),"to_int");return 0!==(this&X)},ia.$$arity=1);a.def(n,"$angle",wa=function(){return c(this["$nan?"]())? +this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0},wa.$$arity=0);a.alias(n,"arg","angle");a.alias(n,"phase","angle");a.def(n,"$bit_length",Ha=function(){c(m(R,"Integer")["$==="](this))||this.$raise(m(R,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var X=0,Na=0>this?~this:this;0!=Na;)X+=1,Na>>>=1;return X},Ha.$$arity=0);a.def(n,"$ceil",Ea=function(X){null==X&&(X=0);var Na=this.$to_f();if(0===Na%1&&0<=X)return Na;X=Math.pow(10, +X);X=Math.ceil(Na*X)/X;0===Na%1&&(X=Math.round(X));return X},Ea.$$arity=-1);a.def(n,"$chr",Qa=function(){return String.fromCharCode(this)},Qa.$$arity=-1);a.def(n,"$denominator",Sa=function(){var X=Sa.$$p,Na=x,cb;X&&(Sa.$$p=null);var B=0;var O=arguments.length;for(cb=Array(O);B=X;Na--)cb(Na);return this},Ia.$$arity=1);a.alias(n,"eql?","=="); +a.def(n,"$equal?",kb=function(X){var Na;return c(Na=this["$=="](X))?Na:isNaN(this)&&isNaN(X)},kb.$$arity=1);a.def(n,"$even?",Ra=function(){return 0===this%2},Ra.$$arity=0);a.def(n,"$floor",W=function(X){null==X&&(X=0);var Na=this.$to_f();if(0===Na%1&&0<=X)return Na;X=Math.pow(10,X);X=Math.floor(Na*X)/X;0===Na%1&&(X=Math.round(X));return X},W.$$arity=-1);a.def(n,"$gcd",za=function(X){c(m(R,"Integer")["$==="](X))||this.$raise(m(R,"TypeError"),"not an integer");var Na=Math.abs(this);for(X=Math.abs(X);0< +Na;){var cb=Na;Na=X%Na;X=cb}return X},za.$$arity=1);a.def(n,"$gcdlcm",Ca=function(X){return[this.$gcd(X),this.$lcm(X)]},Ca.$$arity=1);a.def(n,"$integer?",Va=function(){return 0===this%1},Va.$$arity=0);a.def(n,"$is_a?",ib=function(X){var Na=ib.$$p,cb=x,B=x,O=x,ra;Na&&(ib.$$p=null);var Ga=0;var Da=arguments.length;for(ra=Array(Da);GaX&&this.$raise(m(R,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");m(R,"Integer")["$==="](Na)||this.$raise(m(R,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"); +0===Na&&this.$raise(m(R,"ZeroDivisionError"),"divided by 0");return this["$**"](X)["$%"](Na)},Fa.$$arity=-2);a.def(n,"$pred",Y=function(){return this-1},Y.$$arity=0);a.def(n,"$quo",Q=function(X){var Na=Q.$$p,cb;Na&&(Q.$$p=null);var B=0;var O=arguments.length;for(cb=Array(O);Bthis.$size())return 0;X=Math.pow(10,X);X*=Math.floor((Math.abs(this)+X/2)/X);return 0>this?-X:X}c(c(cb=this["$nan?"]())?null==X:cb)&&this.$raise(m(R,"FloatDomainError"),"NaN");X=m(R,"Opal")["$coerce_to!"](X||0,m(R,"Integer"),"to_int");if(c("number"===typeof X?0>=X:X["$<="](0)))c(this["$nan?"]())?this.$raise(m(R,"RangeError"),"NaN"):c(this["$infinite?"]())&& +this.$raise(m(R,"FloatDomainError"),"Infinity");else{if(X["$=="](0))return Math.round(this);if(c(c(B=this["$nan?"]())?B:this["$infinite?"]()))return this}cb=m(R,"Math").$frexp(this);Na=a.to_ary(cb);Na=null==Na[1]?x:Na[1];cb;cb=w(t(k(m(R,"Float"),"DIG"),2),c(y(Na,0))?z(Na,4):w(z(Na,3),1));cb="number"===typeof X&&"number"===typeof cb?X>=cb:X["$>="](cb);return c(cb)?this:c(J(X,(c(y(Na,0))?t(z(Na,3),1):z(Na,4))["$-@"]()))?0:Math.round(this*Math.pow(10,X))/Math.pow(10,X)},fa.$$arity=-1);a.def(n,"$step", +la=function(X,Na,cb){function B(){void 0!==gb&&(Ua=gb);void 0===Ua&&(Ua=x);Ya===x&&hb.$raise(m(R,"TypeError"),"step must be numeric");0===Ya&&hb.$raise(m(R,"ArgumentError"),"step can't be 0");void 0!==qb&&(Ya=qb);if(Ya===x||null==Ya)Ya=1;var nb=Ya["$<=>"](0);nb===x&&hb.$raise(m(R,"ArgumentError"),"0 can't be coerced into "+Ya.$class());if(Ua===x||null==Ua)Ua=0Ua||0>Ya&&hbUa||0>Ya&&hbJa&&(Ja=Ua),Da(Ja),Ga+=1}else if(Wa=hb,0= +Ua;)Da(Wa),Wa+=Ya;return hb},la.$$arity=-1);a.alias(n,"succ","next");a.def(n,"$times",g=function(){var X=g.$$p,Na=X||x,cb;X&&(g.$$p=null);X&&(g.$$p=null);if(!c(Na))return I(this,"enum_for",["times"],(cb=function(){return null==cb.$$s?this:cb.$$s},cb.$$s=this,cb.$$arity=0,cb));for(X=0;X1/this},ub.$$arity=0),x)&&"negative?"})(G[0],m(G,"Numeric"),G);a.const_set(G[0],"Fixnum",m(G,"Number"));(function(n,$super,D){n=u(n,$super,"Integer");D=[n].concat(D);n.$$is_number_class=!0;n.$$is_integer_class=!0;(function(R,ia){var ea=[R].concat(ia),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(m(ea,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$sqrt",b=function(h){h=m(ea,"Opal")["$coerce_to!"](h, -m(ea,"Integer"),"to_int");0>h&&this.$raise(k(m(ea,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(h),10)},b.$$arity=1),x)&&"sqrt"})(a.get_singleton_class(n),D);a.const_set(D[0],"MAX",Math.pow(2,30)-1);return a.const_set(D[0],"MIN",-Math.pow(2,30))})(G[0],m(G,"Numeric"),G);return function(n,$super,D){n=u(n,$super,"Float");D=[n].concat(D);n.$$is_number_class=!0;(function(R,ia){var ea=[R].concat(ia),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(m(ea, -"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$===",b=function(h){return!!h.$$is_number},b.$$arity=1),x)&&"==="})(a.get_singleton_class(n),D);a.const_set(D[0],"INFINITY",Infinity);a.const_set(D[0],"MAX",Number.MAX_VALUE);a.const_set(D[0],"MIN",Number.MIN_VALUE);a.const_set(D[0],"NAN",NaN);a.const_set(D[0],"DIG",15);a.const_set(D[0],"MANT_DIG",53);a.const_set(D[0],"RADIX",2);return a.const_set(D[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(G[0], -m(G,"Numeric"),G)}; -Opal.modules["corelib/range"]=function(a){function y(l,H){return"number"===typeof l&&"number"===typeof H?l<=H:l["$<="](H)}function K(l,H){return"number"===typeof l&&"number"===typeof H?lH:l["$>"](H)}function w(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var A=a.top,p=[],d=a.nil,G=a.$$$,x=a.$$,k=a.klass,m=a.truthy,u=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));A.$require("corelib/enumerable"); -return function(l,$super,e){l=k(l,$super,"Range");var n=[l].concat(e),J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa;l.$$prototype.begin=l.$$prototype.end=l.$$prototype.excl=d;l.$include(x(n,"Enumerable"));l.$$prototype.$$is_range=!0;l.$attr_reader("begin","end");a.def(l,"$initialize",J=function(wa,Ba,Ka){null==Ka&&(Ka=!1);m(this.begin)&&this.$raise(x(n,"NameError"),"'initialize' called twice");m(wa["$<=>"](Ba))||this.$raise(x(n,"ArgumentError"),"bad value for range");this.begin=wa;this.end=Ba;return this.excl= -Ka},J.$$arity=-3);a.def(l,"$===",D=function(wa){return this["$include?"](wa)},D.$$arity=1);a.def(l,"$cover?",R=function(wa){var Ba=d,Ka=d,na=d;var S=this.begin["$<=>"](wa);if(!m(m(Ba=S)?y(S,0):Ba))return!1;wa=wa["$<=>"](this.end);return m(this.excl)?m(Ka=wa)?K(wa,0):Ka:m(na=wa)?y(wa,0):na},R.$$arity=1);a.def(l,"$each",ia=function(){var wa=ia.$$p,Ba=wa||d,Ka,na=d,S=d,ta=d;wa&&(ia.$$p=null);wa&&(ia.$$p=null);if(Ba===d)return u(this,"enum_for",["each"],(Ka=function(){return(null==Ka.$$s?this:Ka.$$s).$size()}, -Ka.$$s=this,Ka.$$arity=0,Ka));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(x(n,"TypeError"),"can't iterate from Float");wa=this.begin;for(na=this.end+(m(this.excl)?0:1);wa"](S), -0));)a.yield1(Ba,na),na=na.$succ();m(m(ta=this.excl["$!"]())?na["$=="](S):ta)&&a.yield1(Ba,na);return this},ia.$$arity=0);a.def(l,"$eql?",ea=function(wa){var Ba=d,Ka=d;return m(x(n,"Range")["$==="](wa))?m(Ba=m(Ka=this.excl["$==="](wa["$exclude_end?"]()))?this.begin["$eql?"](wa.$begin()):Ka)?this.end["$eql?"](wa.$end()):Ba:!1},ea.$$arity=1);a.alias(l,"==","eql?");a.def(l,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(l,"$first",b=function(wa){var Ba=b.$$p,Ka;Ba&&(b.$$p=null);var na= -0;var S=arguments.length;for(Ka=Array(S);nawa?V.$raise(x(n, -"ArgumentError"),"step can't be negative"):0===wa&&V.$raise(x(n,"ArgumentError"),"step can't be 0")}function Ka(){if(!V.begin["$respond_to?"]("succ")||V.begin.$$is_string&&V.end.$$is_string)return d;if(0===wa%1){var Y=V.$size();return("number"===typeof Y&&"number"===typeof wa?Y/wa:Y["$/"](wa)).$ceil()}Y=V.begin;var pa=V.end,za=Math.abs,la=Math.floor;za=(za(Y)+za(pa)+za(pa-Y))/za(wa)*G(x(n,"Float"),"EPSILON");.5=pa:za["$>="](pa),m(pa)&&a.brk(d,Y)):m(t(za,pa.end))&&a.brk(d,Y);a.yield1(oa,za);return Q=w(Q,1)},S.$$s=V,S.$$brk=Y,S.$$arity=0,S))}catch(pa){if(pa===Y)return pa.$v;throw pa;}}()):(V.begin.$$is_string&&V.end.$$is_string&&0!==wa%1&&V.$raise(x(n,"TypeError"),"no implicit conversion to float from string"),u(V,"each_with_index",[],(ta=function(Y,pa){null==Y&&(Y=d);null==pa&&(pa=d);return pa["$%"](wa)["$=="](0)?a.yield1(oa,Y):d},ta.$$s=V,ta.$$arity= -2,ta)));return V},E.$$arity=-1);a.def(l,"$bsearch",F=function(){var wa=F.$$p,Ba=wa||d;wa&&(F.$$p=null);wa&&(F.$$p=null);if(Ba===d)return this.$enum_for("bsearch");m(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(x(n,"TypeError"),"can't do binary search for "+this.begin.$class());return u(this.$to_a(),"bsearch",[],Ba.$to_proc())},F.$$arity=0);a.def(l,"$to_s",L=function(){return""+this.begin+(m(this.excl)?"...":"..")+this.end},L.$$arity=0);a.def(l,"$inspect",ca=function(){return""+this.begin.$inspect()+ -(m(this.excl)?"...":"..")+this.end.$inspect()},ca.$$arity=0);a.def(l,"$marshal_load",va=function(wa){this.begin=wa["$[]"]("begin");this.end=wa["$[]"]("end");return this.excl=wa["$[]"]("excl")},va.$$arity=1);return(a.def(l,"$hash",Oa=function(){return[this.begin,this.end,this.excl].$hash()},Oa.$$arity=0),d)&&"hash"}(p[0],null,p)}; -Opal.modules["corelib/proc"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.slice,A=a.klass,p=a.truthy,d=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(G,$super,k){G=A(G,$super,"Proc");var m=[G].concat(k),u,c,l,H,e,n,J,D,R,ia,ea,ma;a.defineProperty(G.$$prototype,"$$is_proc",!0);a.defineProperty(G.$$prototype,"$$is_lambda",!1);a.defs(G,"$new",u=function(){var b=u.$$p,h=b||K;b&&(u.$$p=null);b&&(u.$$p=null);p(h)||this.$raise(t(m,"ArgumentError"),"tried to create a Proc object without a block"); -return h},u.$$arity=0);a.def(G,"$call",c=function(b){var h=c.$$p,f=h||K;h&&(c.$$p=null);h&&(c.$$p=null);h=a.slice.call(arguments,0,arguments.length);f!==K&&(this.$$p=f);if(f=this.$$brk)try{var q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h)}catch(z){if(z===f)return f.$v;throw z;}else q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h);return q},c.$$arity=-1);a.alias(G,"[]","call");a.alias(G,"===","call");a.alias(G,"yield","call");a.def(G,"$>>",l=function(b){var h;l.$$p&&(l.$$p=null);return d(this, -"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,z=h.$$p,E=z||K;z&&(h.$$p=null);z=a.slice.call(arguments,0,arguments.length);q=d(q,"call",a.to_a(z),E.$to_proc());return b.$call(q)},h.$$s=this,h.$$arity=-1,h))},l.$$arity=1);a.def(G,"$<<",H=function(b){var h;H.$$p&&(H.$$p=null);return d(this,"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,z=h.$$p,E=z||K;z&&(h.$$p=null);z=a.slice.call(arguments,0,arguments.length);E=d(b,"call",a.to_a(z),E.$to_proc());return q.$call(E)},h.$$s=this,h.$$arity= --1,h))},H.$$arity=1);a.def(G,"$to_proc",e=function(){return this},e.$$arity=0);a.def(G,"$lambda?",n=function(){return!!this.$$is_lambda},n.$$arity=0);a.def(G,"$arity",J=function(){return this.$$is_curried?-1:this.$$arity},J.$$arity=0);a.def(G,"$source_location",D=function(){return K},D.$$arity=0);a.def(G,"$binding",R=function(){this.$$is_curried&&this.$raise(t(m,"ArgumentError"),"Can't create Binding");return K},R.$$arity=0);a.def(G,"$parameters",ia=function(){if(this.$$is_curried)return[["rest"]]; -if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],h;var f=0;for(h=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+z+" for "+b+")");if(z>=b)return f.$call.apply(f,q);z=function(){return h.apply(null,q.concat(w.call(arguments)))}; -z.$$is_lambda=f.$$is_lambda;z.$$is_curried=!0;return z}var f=this;void 0===b?b=f.length:(b=t(m,"Opal")["$coerce_to!"](b,t(m,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));h.$$is_lambda=f.$$is_lambda;h.$$is_curried=!0;return h},ea.$$arity=-1);a.def(G,"$dup",ma=function(){function b(){return h.apply(this,arguments)}var h=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, -ma.$$arity=0);return a.alias(G,"clone","dup")}(y[0],Function,y)}; -Opal.modules["corelib/method"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.klass,A=a.truthy;a.add_stubs("$attr_reader $arity $>> $<< $new $class $join $source_location $raise".split(" "));(function(p,$super,G){p=w(p,$super,"Method");var x=[p].concat(G),k,m,u,c,l,H,e,n,J,D,R;p.$$prototype.method=p.$$prototype.receiver=p.$$prototype.owner=p.$$prototype.name=K;p.$attr_reader("owner","receiver","name");a.def(p,"$initialize",k=function(ia,ea,ma,b){this.receiver=ia;this.owner=ea;this.name=b;return this.method= -ma},k.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0);a.def(p,"$source_location",c=function(){var ia;return A(ia=this.method.$$source_location)?ia:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",l=function(){var ia;return A(ia=this.method.$$comments)?ia:[]},l.$$arity=0);a.def(p,"$call",H=function(ia){var ea=H.$$p,ma=ea||K;ea&&(H.$$p=null);ea&&(H.$$p=null);ea=a.slice.call(arguments,0, -arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,ea)},H.$$arity=-1);a.alias(p,"[]","call");a.def(p,"$>>",e=function(ia){return this.method["$>>"](ia)},e.$$arity=1);a.def(p,"$<<",n=function(ia){return this.method["$<<"](ia)},n.$$arity=1);a.def(p,"$unbind",J=function(){return t(x,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},J.$$arity=0);a.def(p,"$to_proc",D=function(){var ia=this.$call.bind(this);ia.$$unbound=this.method;ia.$$is_lambda=!0; -ia.$$arity=this.method.$$arity;ia.$$parameters=this.method.$$parameters;return ia},D.$$arity=0);return(a.def(p,"$inspect",R=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},R.$$arity=0),K)&&"inspect"})(y[0],null,y);return function(p,$super,G){p=w(p,$super,"UnboundMethod");var x=[p].concat(G),k,m,u,c,l,H,e;p.$$prototype.method=p.$$prototype.owner=p.$$prototype.name=p.$$prototype.source=K;p.$attr_reader("source", -"owner","name");a.def(p,"$initialize",k=function(n,J,D,R){this.source=n;this.owner=J;this.method=D;return this.name=R},k.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0);a.def(p,"$source_location",c=function(){var n;return A(n=this.method.$$source_location)?n:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",l=function(){var n;return A(n=this.method.$$comments)?n:[]},l.$$arity=0);a.def(p, -"$bind",H=function(n){if(this.owner.$$is_module||a.is_a(n,this.owner))return t(x,"Method").$new(n,this.owner,this.method,this.name);this.$raise(t(x,"TypeError"),"can't bind singleton method to a different class (expected "+n+".kind_of?("+this.owner+" to be true)")},H.$$arity=1);return(a.def(p,"$inspect",e=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},e.$$arity=0),K)&&"inspect"}(y[0],null,y)}; -Opal.modules["corelib/variables"]=function(a){var y=[],K=a.nil,t=a.$$,w=a.gvars,A=a.hash2;a.add_stubs(["$new"]);w["&"]=w["~"]=w["`"]=w["'"]=K;w.LOADED_FEATURES=w['"']=a.loaded_features;w.LOAD_PATH=w[":"]=[];w["/"]="\n";w[","]=K;a.const_set(y[0],"ARGV",[]);a.const_set(y[0],"ARGF",t(y,"Object").$new());a.const_set(y[0],"ENV",A([],{}));w.VERBOSE=!1;w.DEBUG=!1;return w.SAFE=0}; -Opal.modules["corelib/io"]=function(a){function y(u,c){return"number"===typeof u&&"number"===typeof c?u-c:u["$-"](c)}var K=[],t=a.nil,w=a.$$$,A=a.$$,p=a.klass,d=a.module,G=a.gvars,x=a.send,k=t;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(u,$super,l){u=p(u,$super,"IO");l=[u].concat(l);var H,e,n,J;u.$$prototype.tty=u.$$prototype.closed=t;a.const_set(l[0],"SEEK_SET",0);a.const_set(l[0],"SEEK_CUR",1);a.const_set(l[0], -"SEEK_END",2);a.def(u,"$tty?",H=function(){return this.tty},H.$$arity=0);a.def(u,"$closed?",e=function(){return this.closed},e.$$arity=0);u.$attr_accessor("write_proc");a.def(u,"$write",n=function(D){this.write_proc(D);return D.$size()},n.$$arity=1);u.$attr_accessor("sync","tty");a.def(u,"$flush",J=function(){return t},J.$$arity=0);(function(D,R){D=d(D,"Writable");[D].concat(R);var ia,ea,ma;a.def(D,"$<<",ia=function(b){this.$write(b);return this},ia.$$arity=1);a.def(D,"$print",ea=function(b){null== -G[","]&&(G[","]=t);var h=a.slice.call(arguments,0,arguments.length);for(var f=0,q=h.length;f1/this},ub.$$arity=0),x)&&"negative?"})(H[0],m(H,"Numeric"),H);a.const_set(H[0],"Fixnum",m(H,"Number"));(function(n,$super,D){n=u(n,$super,"Integer");D=[n].concat(D);n.$$is_number_class=!0;n.$$is_integer_class=!0;(function(R,ja){var da=[R].concat(ja),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(m(da,"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$sqrt",b=function(h){h=m(da,"Opal")["$coerce_to!"](h, +m(da,"Integer"),"to_int");0>h&&this.$raise(k(m(da,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(h),10)},b.$$arity=1),x)&&"sqrt"})(a.get_singleton_class(n),D);a.const_set(D[0],"MAX",Math.pow(2,30)-1);return a.const_set(D[0],"MIN",-Math.pow(2,30))})(H[0],m(H,"Numeric"),H);return function(n,$super,D){n=u(n,$super,"Float");D=[n].concat(D);n.$$is_number_class=!0;(function(R,ja){var da=[R].concat(ja),ma,b;a.def(R,"$allocate",ma=function(){return this.$raise(m(da, +"TypeError"),"allocator undefined for "+this.$name())},ma.$$arity=0);a.udef(R,"$new");return(a.def(R,"$===",b=function(h){return!!h.$$is_number},b.$$arity=1),x)&&"==="})(a.get_singleton_class(n),D);a.const_set(D[0],"INFINITY",Infinity);a.const_set(D[0],"MAX",Number.MAX_VALUE);a.const_set(D[0],"MIN",Number.MIN_VALUE);a.const_set(D[0],"NAN",NaN);a.const_set(D[0],"DIG",15);a.const_set(D[0],"MANT_DIG",53);a.const_set(D[0],"RADIX",2);return a.const_set(D[0],"EPSILON",Number.EPSILON||2.220446049250313E-16)}(H[0], +m(H,"Numeric"),H)}; +Opal.modules["corelib/range"]=function(a){function y(l,I){return"number"===typeof l&&"number"===typeof I?l<=I:l["$<="](I)}function J(l,I){return"number"===typeof l&&"number"===typeof I?lI:l["$>"](I)}function w(l,I){return"number"===typeof l&&"number"===typeof I?l+I:l["$+"](I)}var z=a.top,p=[],d=a.nil,H=a.$$$,x=a.$$,k=a.klass,m=a.truthy,u=a.send,c=a.send2;a.add_stubs("$require $include $attr_reader $raise $<=> $include? $<= $< $enum_for $size $upto $to_proc $respond_to? $class $succ $! $== $=== $exclude_end? $eql? $begin $end $last $to_a $> $- $abs $to_i $coerce_to! $ceil $/ $loop $+ $* $>= $each_with_index $% $bsearch $inspect $[] $hash".split(" "));z.$require("corelib/enumerable"); +return function(l,$super,e){l=k(l,$super,"Range");var n=[l].concat(e),L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa;l.$$prototype.begin=l.$$prototype.end=l.$$prototype.excl=d;l.$include(x(n,"Enumerable"));l.$$prototype.$$is_range=!0;l.$attr_reader("begin","end");a.def(l,"$initialize",L=function(xa,Ba,La){null==La&&(La=!1);m(this.begin)&&this.$raise(x(n,"NameError"),"'initialize' called twice");m(xa["$<=>"](Ba))||this.$raise(x(n,"ArgumentError"),"bad value for range");this.begin=xa;this.end=Ba;return this.excl= +La},L.$$arity=-3);a.def(l,"$===",D=function(xa){return this["$include?"](xa)},D.$$arity=1);a.def(l,"$cover?",R=function(xa){var Ba=d,La=d,na=d;var S=this.begin["$<=>"](xa);if(!m(m(Ba=S)?y(S,0):Ba))return!1;xa=xa["$<=>"](this.end);return m(this.excl)?m(La=xa)?J(xa,0):La:m(na=xa)?y(xa,0):na},R.$$arity=1);a.def(l,"$each",ja=function(){var xa=ja.$$p,Ba=xa||d,La,na=d,S=d,sa=d;xa&&(ja.$$p=null);xa&&(ja.$$p=null);if(Ba===d)return u(this,"enum_for",["each"],(La=function(){return(null==La.$$s?this:La.$$s).$size()}, +La.$$s=this,La.$$arity=0,La));if(this.begin.$$is_number&&this.end.$$is_number){0===this.begin%1&&0===this.end%1||this.$raise(x(n,"TypeError"),"can't iterate from Float");xa=this.begin;for(na=this.end+(m(this.excl)?0:1);xa"](S), +0));)a.yield1(Ba,na),na=na.$succ();m(m(sa=this.excl["$!"]())?na["$=="](S):sa)&&a.yield1(Ba,na);return this},ja.$$arity=0);a.def(l,"$eql?",da=function(xa){var Ba=d,La=d;return m(x(n,"Range")["$==="](xa))?m(Ba=m(La=this.excl["$==="](xa["$exclude_end?"]()))?this.begin["$eql?"](xa.$begin()):La)?this.end["$eql?"](xa.$end()):Ba:!1},da.$$arity=1);a.alias(l,"==","eql?");a.def(l,"$exclude_end?",ma=function(){return this.excl},ma.$$arity=0);a.def(l,"$first",b=function(xa){var Ba=b.$$p,La;Ba&&(b.$$p=null);var na= +0;var S=arguments.length;for(La=Array(S);naxa?ea.$raise(x(n, +"ArgumentError"),"step can't be negative"):0===xa&&ea.$raise(x(n,"ArgumentError"),"step can't be 0")}function La(){if(!ea.begin["$respond_to?"]("succ")||ea.begin.$$is_string&&ea.end.$$is_string)return d;if(0===xa%1){var V=ea.$size();return("number"===typeof V&&"number"===typeof xa?V/xa:V["$/"](xa)).$ceil()}V=ea.begin;var ka=ea.end,va=Math.abs,ia=Math.floor;va=(va(V)+va(ka)+va(ka-V))/va(xa)*H(x(n,"Float"),"EPSILON");.5=ka:va["$>="](ka),m(ka)&&a.brk(d,V)):m(t(va,ka.end))&&a.brk(d,V);a.yield1(pa,va);return F=w(F,1)},S.$$s=ea,S.$$brk=V,S.$$arity=0,S))}catch(ka){if(ka===V)return ka.$v;throw ka;}}()):(ea.begin.$$is_string&&ea.end.$$is_string&&0!==xa%1&&ea.$raise(x(n,"TypeError"),"no implicit conversion to float from string"),u(ea,"each_with_index",[],(sa=function(V,ka){null==V&&(V=d);null==ka&&(ka=d);return ka["$%"](xa)["$=="](0)?a.yield1(pa,V): +d},sa.$$s=ea,sa.$$arity=2,sa)));return ea},E.$$arity=-1);a.def(l,"$bsearch",G=function(){var xa=G.$$p,Ba=xa||d;xa&&(G.$$p=null);xa&&(G.$$p=null);if(Ba===d)return this.$enum_for("bsearch");m(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(x(n,"TypeError"),"can't do binary search for "+this.begin.$class());return u(this.$to_a(),"bsearch",[],Ba.$to_proc())},G.$$arity=0);a.def(l,"$to_s",M=function(){return""+this.begin+(m(this.excl)?"...":"..")+this.end},M.$$arity=0);a.def(l,"$inspect",ba= +function(){return""+this.begin.$inspect()+(m(this.excl)?"...":"..")+this.end.$inspect()},ba.$$arity=0);a.def(l,"$marshal_load",ua=function(xa){this.begin=xa["$[]"]("begin");this.end=xa["$[]"]("end");return this.excl=xa["$[]"]("excl")},ua.$$arity=1);return(a.def(l,"$hash",Oa=function(){return[this.begin,this.end,this.excl].$hash()},Oa.$$arity=0),d)&&"hash"}(p[0],null,p)}; +Opal.modules["corelib/proc"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.slice,z=a.klass,p=a.truthy,d=a.send;a.add_stubs(["$raise","$proc","$call","$to_proc","$coerce_to!"]);return function(H,$super,k){H=z(H,$super,"Proc");var m=[H].concat(k),u,c,l,I,e,n,L,D,R,ja,da,ma;a.defineProperty(H.$$prototype,"$$is_proc",!0);a.defineProperty(H.$$prototype,"$$is_lambda",!1);a.defs(H,"$new",u=function(){var b=u.$$p,h=b||J;b&&(u.$$p=null);b&&(u.$$p=null);p(h)||this.$raise(t(m,"ArgumentError"),"tried to create a Proc object without a block"); +return h},u.$$arity=0);a.def(H,"$call",c=function(b){var h=c.$$p,f=h||J;h&&(c.$$p=null);h&&(c.$$p=null);h=a.slice.call(arguments,0,arguments.length);f!==J&&(this.$$p=f);if(f=this.$$brk)try{var q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h)}catch(A){if(A===f)return f.$v;throw A;}else q=this.$$is_lambda?this.apply(null,h):a.yieldX(this,h);return q},c.$$arity=-1);a.alias(H,"[]","call");a.alias(H,"===","call");a.alias(H,"yield","call");a.def(H,"$>>",l=function(b){var h;l.$$p&&(l.$$p=null);return d(this, +"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,E=A||J;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);q=d(q,"call",a.to_a(A),E.$to_proc());return b.$call(q)},h.$$s=this,h.$$arity=-1,h))},l.$$arity=1);a.def(H,"$<<",I=function(b){var h;I.$$p&&(I.$$p=null);return d(this,"proc",[],(h=function(f){var q=null==h.$$s?this:h.$$s,A=h.$$p,E=A||J;A&&(h.$$p=null);A=a.slice.call(arguments,0,arguments.length);E=d(b,"call",a.to_a(A),E.$to_proc());return q.$call(E)},h.$$s=this,h.$$arity= +-1,h))},I.$$arity=1);a.def(H,"$to_proc",e=function(){return this},e.$$arity=0);a.def(H,"$lambda?",n=function(){return!!this.$$is_lambda},n.$$arity=0);a.def(H,"$arity",L=function(){return this.$$is_curried?-1:this.$$arity},L.$$arity=0);a.def(H,"$source_location",D=function(){return J},D.$$arity=0);a.def(H,"$binding",R=function(){this.$$is_curried&&this.$raise(t(m,"ArgumentError"),"Can't create Binding");return J},R.$$arity=0);a.def(H,"$parameters",ja=function(){if(this.$$is_curried)return[["rest"]]; +if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var b=[],h;var f=0;for(h=this.$$parameters.length;fb&&f.$$is_lambda&&!f.$$is_curried&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+A+" for "+b+")");if(A>=b)return f.$call.apply(f,q);A=function(){return h.apply(null,q.concat(w.call(arguments)))}; +A.$$is_lambda=f.$$is_lambda;A.$$is_curried=!0;return A}var f=this;void 0===b?b=f.length:(b=t(m,"Opal")["$coerce_to!"](b,t(m,"Integer"),"to_int"),f.$$is_lambda&&b!==f.length&&f.$raise(t(m,"ArgumentError"),"wrong number of arguments ("+b+" for "+f.length+")"));h.$$is_lambda=f.$$is_lambda;h.$$is_curried=!0;return h},da.$$arity=-1);a.def(H,"$dup",ma=function(){function b(){return h.apply(this,arguments)}var h=this.$$original_proc||this,f;for(f in this)this.hasOwnProperty(f)&&(b[f]=this[f]);return b}, +ma.$$arity=0);return a.alias(H,"clone","dup")}(y[0],Function,y)}; +Opal.modules["corelib/method"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.klass,z=a.truthy;a.add_stubs("$attr_reader $arity $>> $<< $new $class $join $source_location $raise".split(" "));(function(p,$super,H){p=w(p,$super,"Method");var x=[p].concat(H),k,m,u,c,l,I,e,n,L,D,R;p.$$prototype.method=p.$$prototype.receiver=p.$$prototype.owner=p.$$prototype.name=J;p.$attr_reader("owner","receiver","name");a.def(p,"$initialize",k=function(ja,da,ma,b){this.receiver=ja;this.owner=da;this.name=b;return this.method= +ma},k.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0);a.def(p,"$source_location",c=function(){var ja;return z(ja=this.method.$$source_location)?ja:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",l=function(){var ja;return z(ja=this.method.$$comments)?ja:[]},l.$$arity=0);a.def(p,"$call",I=function(ja){var da=I.$$p,ma=da||J;da&&(I.$$p=null);da&&(I.$$p=null);da=a.slice.call(arguments,0, +arguments.length);this.method.$$p=ma;return this.method.apply(this.receiver,da)},I.$$arity=-1);a.alias(p,"[]","call");a.def(p,"$>>",e=function(ja){return this.method["$>>"](ja)},e.$$arity=1);a.def(p,"$<<",n=function(ja){return this.method["$<<"](ja)},n.$$arity=1);a.def(p,"$unbind",L=function(){return t(x,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},L.$$arity=0);a.def(p,"$to_proc",D=function(){var ja=this.$call.bind(this);ja.$$unbound=this.method;ja.$$is_lambda=!0; +ja.$$arity=this.method.$$arity;ja.$$parameters=this.method.$$parameters;return ja},D.$$arity=0);return(a.def(p,"$inspect",R=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},R.$$arity=0),J)&&"inspect"})(y[0],null,y);return function(p,$super,H){p=w(p,$super,"UnboundMethod");var x=[p].concat(H),k,m,u,c,l,I,e;p.$$prototype.method=p.$$prototype.owner=p.$$prototype.name=p.$$prototype.source=J;p.$attr_reader("source", +"owner","name");a.def(p,"$initialize",k=function(n,L,D,R){this.source=n;this.owner=L;this.method=D;return this.name=R},k.$$arity=4);a.def(p,"$arity",m=function(){return this.method.$arity()},m.$$arity=0);a.def(p,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0);a.def(p,"$source_location",c=function(){var n;return z(n=this.method.$$source_location)?n:["(eval)",0]},c.$$arity=0);a.def(p,"$comments",l=function(){var n;return z(n=this.method.$$comments)?n:[]},l.$$arity=0);a.def(p, +"$bind",I=function(n){if(this.owner.$$is_module||a.is_a(n,this.owner))return t(x,"Method").$new(n,this.owner,this.method,this.name);this.$raise(t(x,"TypeError"),"can't bind singleton method to a different class (expected "+n+".kind_of?("+this.owner+" to be true)")},I.$$arity=1);return(a.def(p,"$inspect",e=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},e.$$arity=0),J)&&"inspect"}(y[0],null,y)}; +Opal.modules["corelib/variables"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.gvars,z=a.hash2;a.add_stubs(["$new"]);w["&"]=w["~"]=w["`"]=w["'"]=J;w.LOADED_FEATURES=w['"']=a.loaded_features;w.LOAD_PATH=w[":"]=[];w["/"]="\n";w[","]=J;a.const_set(y[0],"ARGV",[]);a.const_set(y[0],"ARGF",t(y,"Object").$new());a.const_set(y[0],"ENV",z([],{}));w.VERBOSE=!1;w.DEBUG=!1;return w.SAFE=0}; +Opal.modules["corelib/io"]=function(a){function y(u,c){return"number"===typeof u&&"number"===typeof c?u-c:u["$-"](c)}var J=[],t=a.nil,w=a.$$$,z=a.$$,p=a.klass,d=a.module,H=a.gvars,x=a.send,k=t;a.add_stubs("$attr_accessor $size $write $String $chomp $getbyte $getc $raise $new $write_proc= $- $extend".split(" "));(function(u,$super,l){u=p(u,$super,"IO");l=[u].concat(l);var I,e,n,L;u.$$prototype.tty=u.$$prototype.closed=t;a.const_set(l[0],"SEEK_SET",0);a.const_set(l[0],"SEEK_CUR",1);a.const_set(l[0], +"SEEK_END",2);a.def(u,"$tty?",I=function(){return this.tty},I.$$arity=0);a.def(u,"$closed?",e=function(){return this.closed},e.$$arity=0);u.$attr_accessor("write_proc");a.def(u,"$write",n=function(D){this.write_proc(D);return D.$size()},n.$$arity=1);u.$attr_accessor("sync","tty");a.def(u,"$flush",L=function(){return t},L.$$arity=0);(function(D,R){D=d(D,"Writable");[D].concat(R);var ja,da,ma;a.def(D,"$<<",ja=function(b){this.$write(b);return this},ja.$$arity=1);a.def(D,"$print",da=function(b){null== +H[","]&&(H[","]=t);var h=a.slice.call(arguments,0,arguments.length);for(var f=0,q=h.length;f=h.length&&ea.$raise(t(k,"ArgumentError"),"too few arguments");return h[oa]}function n(){switch(F){case -1:ea.$raise(t(k,"ArgumentError"),"unnumbered("+E+") mixed with numbered");case -2:ea.$raise(t(k,"ArgumentError"),"unnumbered("+E+") mixed with named")}F=E++;return e(F-1)}function J(oa){0oa&&ea.$raise(t(k,"ArgumentError"),"invalid index - "+oa+"$");F=-1;return e(oa-1)}function D(){return void 0===Oa?n():Oa}function R(oa){var V;for(V="";;f++){f===q&&ea.$raise(t(k,"ArgumentError"),"malformed format string - %*[0-9]");if(48>u.charCodeAt(f)||57":"}";Ba="";for(f++;;f++){f===q&&ea.$raise(t(k,"ArgumentError"),"malformed name - unmatched parenthesis");if(u.charAt(f)===Ka)if(0"===Ka)continue a;else{L=Oa.toString();-1!==va&&(L=L.slice(0,va));if(ca&2)for(;L.lengthz&&(ca|=2,z=-z);continue a;case ".":ca&128&&ea.$raise(t(k,"ArgumentError"),"precision given twice");ca|=192;va=0;f++;if("*"===u.charAt(f)){f++;va=ia("precision");0>va&&(ca&=-65);continue a}va=R("precision");continue a;case "d":case "i":case "u":Ba=ea.$Integer(D());if(0<=Ba){for(L=Ba.toString();L.length>>0).toString(na).replace(ta,ja);L.lengthKa||Ka>=(-1===va?6:va)||(L=Ba.toPrecision(-1===va?ca&1?6:void 0:va))}if(ca&2){if(ca&4||ca&16)L=(ca&4?"+":" ")+L;for(;L.lengthKa||Ka>=(-1===va?6:va)||(L=(-Ba).toPrecision(-1===va?ca&1?6:void 0:va))}if(ca&2)for(L="-"+L;L.length"},q.$$arity=0);a.def(n,"$each_byte",z=function(F){a.slice.call(arguments,0,arguments.length); -return this.$raise(m(R,"NotImplementedError"))},z.$$arity=-1);a.def(n,"$bytesize",E=function(F){a.slice.call(arguments,0,arguments.length);return this.$raise(m(R,"NotImplementedError"))},E.$$arity=-1);(function(F,$super,ca){[u(F,$super,"EncodingError")].concat(ca);return x})(R[0],m(R,"StandardError"),R);return function(F,$super,ca){[u(F,$super,"CompatibilityError")].concat(ca);return x}(R[0],m(R,"EncodingError"),R)})(G[0],null,G);H(m(G,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], -ascii:!0})],(K=function(){var n=null==K.$$s?this:K.$$s,J,D;a.def(n,"$each_byte",J=function(R){var ia=J.$$p,ea=ia||x;ia&&(J.$$p=null);ia&&(J.$$p=null);ia=Infinity;for(var ma,b=R.length,h=null,f=0;fma){if(!h){if(56319ma){-1<(ia-=3)&&(a.yield1(ea,239),a.yield1(ea,191), -a.yield1(ea,189));h=ma;continue}ma=(h-55296<<10|ma-56320)+65536}else h&&-1<(ia-=3)&&(a.yield1(ea,239),a.yield1(ea,191),a.yield1(ea,189));h=null;if(128>ma){if(0>--ia)break;a.yield1(ea,ma)}else if(2048>ma){if(0>(ia-=2))break;a.yield1(ea,ma>>6|192);a.yield1(ea,ma&63|128)}else if(65536>ma){if(0>(ia-=3))break;a.yield1(ea,ma>>12|224);a.yield1(ea,ma>>6&63|128);a.yield1(ea,ma&63|128)}else if(1114112>ma){if(0>(ia-=4))break;a.yield1(ea,ma>>18|240);a.yield1(ea,ma>>12&63|128);a.yield1(ea,ma>>6&63|128);a.yield1(ea, -ma&63|128)}}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},K.$$s=d,K.$$arity=0,K));H(m(G,"Encoding"),"register",["UTF-16LE"],(t=function(){var n=null==t.$$s?this:t.$$s,J,D;a.def(n,"$each_byte",J=function(R){var ia=J.$$p,ea=ia||x;ia&&(J.$$p=null);ia&&(J.$$p=null);ia=0;for(var ma=R.length;ia>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()}, -D.$$arity=1),x)&&"bytesize"},t.$$s=d,t.$$arity=0,t));H(m(G,"Encoding"),"register",["UTF-16BE"],(w=function(){var n=null==w.$$s?this:w.$$s,J,D;a.def(n,"$each_byte",J=function(R){var ia=J.$$p,ea=ia||x;ia&&(J.$$p=null);ia&&(J.$$p=null);ia=0;for(var ma=R.length;ia>8);a.yield1(ea,b&255)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},w.$$s=d,w.$$arity=0,w));H(m(G,"Encoding"),"register",["UTF-32LE"], -(A=function(){var n=null==A.$$s?this:A.$$s,J,D;a.def(n,"$each_byte",J=function(R){var ia=J.$$p,ea=ia||x;ia&&(J.$$p=null);ia&&(J.$$p=null);ia=0;for(var ma=R.length;ia>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},A.$$s=d,A.$$arity=0,A));H(m(G,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], -(p=function(){var n=null==p.$$s?this:p.$$s,J,D;a.def(n,"$each_byte",J=function(R){var ia=J.$$p,ea=ia||x;ia&&(J.$$p=null);ia&&(J.$$p=null);ia=0;for(var ma=R.length;ia>8)}},J.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},p.$$s=d,p.$$arity=0,p));(function(n,$super,D){n=u(n,$super,"String");var R=[n].concat(D),ia,ea,ma,b,h,f,q,z,E;n.$$prototype.bytes=n.$$prototype.internal_encoding= -x;n.$attr_reader("encoding");n.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",x);a.defineProperty(String.prototype,"encoding",k(m(R,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",k(m(R,"Encoding"),"UTF_8"));a.def(n,"$bytes",ia=function(){var F=x;this.bytes=l(F=this.bytes)?F:this.$each_byte().$to_a();return this.bytes.$dup()},ia.$$arity=0);a.def(n,"$bytesize",ea=function(){return this.internal_encoding.$bytesize(this)},ea.$$arity=0);a.def(n, -"$each_byte",ma=function(){var F=ma.$$p,L=F||x;F&&(ma.$$p=null);F&&(ma.$$p=null);if(L===x)return this.$enum_for("each_byte");H(this.internal_encoding,"each_byte",[this],L.$to_proc());return this},ma.$$arity=0);a.def(n,"$each_codepoint",b=function(){var F=b.$$p,L=F||x;F&&(b.$$p=null);F&&(b.$$p=null);if(L===x)return this.$enum_for("each_codepoint");F=0;for(var ca=this.length;FS)return-Math.cbrt(-S);for(var ta=S,ja=0;.125>ta;)ta*=8,ja--;for(;1ja;)ta*=.5,ja++;for(;0S&&(ta=-1);S=Math.abs(S);var ja=1/(1+.3275911*S);return ta*(1-((((1.061405429*ja+-1.453152027)*ja+1.421413741)*ja+-.284496736)*ja+.254829592)*ja*Math.exp(-S*S))});a.def(d,"$erf",ma=function(S){return t(x,"Math").$checked("erf",t(x,"Math")["$float!"](S))},ma.$$arity=1);p("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(S){var ta=Math.abs(S),ja=1/(.5*ta+1);ta=ja*Math.exp(-ta*ta-1.26551223+ja*(ja*(ja*(ja*(ja*(ja*(ja*(ja*(.17087277*ja+-.82215223)+1.48851587)+ --1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>S?2-ta:ta});a.def(d,"$erfc",b=function(S){return t(x,"Math").$checked("erfc",t(x,"Math")["$float!"](S))},b.$$arity=1);a.def(d,"$exp",h=function(S){return t(x,"Math").$checked("exp",t(x,"Math")["$float!"](S))},h.$$arity=1);a.def(d,"$frexp",f=function(S){S=t(x,"Math")["$float!"](S);if(isNaN(S))return[NaN,0];var ta=Math.floor(Math.log(Math.abs(S))/Math.log(2))+1;return[S/Math.pow(2,ta),ta]},f.$$arity=1);a.def(d,"$gamma", -q=function(S){S=t(x,"Math")["$float!"](S);var ta=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3.399464998481189E-5,4.652362892704858E-5,-9.837447530487956E-5,1.580887032249125E-4,-2.1026444172410488E-4,2.1743961811521265E-4,-1.643181065367639E-4,8.441822398385275E-5,-2.6190838401581408E-5,3.6899182659531625E-6];if(isNaN(S))return NaN;if(0===S&&0>1/S)return-Infinity;-1!==S&&-Infinity!==S||this.$raise(t(x,"DomainError"),'Numerical argument is out of domain - "gamma"'); -if(t(x,"Integer")["$==="](S)){if(0>=S)return isFinite(S)?Infinity:NaN;if(171S)return Math.PI/(Math.sin(Math.PI*S)*t(x,"Math").$gamma("number"===typeof S?1-S:1["$-"](S)));if(171.35<=S)return Infinity;if(85t(x,"Math").$gamma(S)?-1:1]},F.$$arity=1);a.def(d,"$log",L=function(S,ta){p(t(x,"String")["$==="](S))&&this.$raise(w(S,t(x,"Float")));if(p(null==ta))return t(x,"Math").$checked("log",t(x,"Math")["$float!"](S));p(t(x,"String")["$==="](ta))&&this.$raise(w(ta,t(x,"Float")));S=t(x,"Math").$checked("log",t(x,"Math")["$float!"](S));ta=t(x,"Math").$checked("log",t(x, -"Math")["$float!"](ta));return"number"===typeof S&&"number"===typeof ta?S/ta:S["$/"](ta)},L.$$arity=-2);p("undefined"!==typeof Math.log10)||(Math.log10=function(S){return Math.log(S)/Math.LN10});a.def(d,"$log10",ca=function(S){p(t(x,"String")["$==="](S))&&this.$raise(w(S,t(x,"Float")));return t(x,"Math").$checked("log10",t(x,"Math")["$float!"](S))},ca.$$arity=1);p("undefined"!==typeof Math.log2)||(Math.log2=function(S){return Math.log(S)/Math.LN2});a.def(d,"$log2",va=function(S){p(t(x,"String")["$==="](S))&& -this.$raise(w(S,t(x,"Float")));return t(x,"Math").$checked("log2",t(x,"Math")["$float!"](S))},va.$$arity=1);a.def(d,"$sin",Oa=function(S){return t(x,"Math").$checked("sin",t(x,"Math")["$float!"](S))},Oa.$$arity=1);p("undefined"!==typeof Math.sinh)||(Math.sinh=function(S){return(Math.exp(S)-Math.exp(-S))/2});a.def(d,"$sinh",wa=function(S){return t(x,"Math").$checked("sinh",t(x,"Math")["$float!"](S))},wa.$$arity=1);a.def(d,"$sqrt",Ba=function(S){return t(x,"Math").$checked("sqrt",t(x,"Math")["$float!"](S))}, -Ba.$$arity=1);a.def(d,"$tan",Ka=function(S){S=t(x,"Math")["$float!"](S);return p(S["$infinite?"]())?K(t(x,"Float"),"NAN"):t(x,"Math").$checked("tan",t(x,"Math")["$float!"](S))},Ka.$$arity=1);p("undefined"!==typeof Math.tanh)||(Math.tanh=function(S){return Infinity==S?1:-Infinity==S?-1:(Math.exp(S)-Math.exp(-S))/(Math.exp(S)+Math.exp(-S))});a.def(d,"$tanh",na=function(S){return t(x,"Math").$checked("tanh",t(x,"Math")["$float!"](S))},na.$$arity=1)}(y[0],y)}; -Opal.modules["corelib/complex"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function K(c,l){return"number"===typeof c&&"number"===typeof l?c+l:c["$+"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function w(c,l){return"number"===typeof c&&"number"===typeof l?c/l:c["$/"](l)}var A=a.top,p=[],d=a.nil,G=a.$$$,x=a.$$,k=a.klass,m=a.truthy,u=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); -A.$require("corelib/numeric");(function(c,$super,H){c=k(c,$super,"Complex");var e=[c].concat(H),n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za;c.$$prototype.real=c.$$prototype.imag=d;a.defs(c,"$rect",n=function(la,xa){var Ea=d,Fa=d,Sa=d;null==xa&&(xa=0);m(m(Ea=m(Fa=m(Sa=x(e,"Numeric")["$==="](la))?la["$real?"]():Sa)?x(e,"Numeric")["$==="](xa):Fa)?xa["$real?"]():Ea)||this.$raise(x(e,"TypeError"),"not a real");return this.$new(la,xa)},n.$$arity=-2);(function(la,xa){[la].concat(xa); -return a.alias(la,"rectangular","rect")})(a.get_singleton_class(c),e);a.defs(c,"$polar",J=function(la,xa){var Ea=d,Fa=d,Sa=d;null==xa&&(xa=0);m(m(Ea=m(Fa=m(Sa=x(e,"Numeric")["$==="](la))?la["$real?"]():Sa)?x(e,"Numeric")["$==="](xa):Fa)?xa["$real?"]():Ea)||this.$raise(x(e,"TypeError"),"not a real");return this.$new(y(la,x(e,"Math").$cos(xa)),y(la,x(e,"Math").$sin(xa)))},J.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",D=function(la,xa){null==xa&&(xa=0);this.real=la;return this.imag= -xa},D.$$arity=-2);a.def(c,"$coerce",R=function(la){var xa=d;return m(x(e,"Complex")["$==="](la))?[la,this]:m(m(xa=x(e,"Numeric")["$==="](la))?la["$real?"]():xa)?[x(e,"Complex").$new(la,0),this]:this.$raise(x(e,"TypeError"),""+la.$class()+" can't be coerced into Complex")},R.$$arity=1);a.def(c,"$==",ia=function(la){var xa=d,Ea=d,Fa=d;return m(x(e,"Complex")["$==="](la))?m(xa=this.real["$=="](la.$real()))?this.imag["$=="](la.$imag()):xa:m(m(Ea=x(e,"Numeric")["$==="](la))?la["$real?"]():Ea)?m(Fa=this.real["$=="](la))? -this.imag["$=="](0):Fa:la["$=="](this)},ia.$$arity=1);a.def(c,"$-@",ea=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},ea.$$arity=0);a.def(c,"$+",ma=function(la){var xa=d;return m(x(e,"Complex")["$==="](la))?this.$Complex(K(this.real,la.$real()),K(this.imag,la.$imag())):m(m(xa=x(e,"Numeric")["$==="](la))?la["$real?"]():xa)?this.$Complex(K(this.real,la),this.imag):this.$__coerced__("+",la)},ma.$$arity=1);a.def(c,"$-",b=function(la){var xa=d;return m(x(e,"Complex")["$==="](la))? -this.$Complex(t(this.real,la.$real()),t(this.imag,la.$imag())):m(m(xa=x(e,"Numeric")["$==="](la))?la["$real?"]():xa)?this.$Complex(t(this.real,la),this.imag):this.$__coerced__("-",la)},b.$$arity=1);a.def(c,"$*",h=function(la){var xa=d;return m(x(e,"Complex")["$==="](la))?this.$Complex(t(y(this.real,la.$real()),y(this.imag,la.$imag())),K(y(this.real,la.$imag()),y(this.imag,la.$real()))):m(m(xa=x(e,"Numeric")["$==="](la))?la["$real?"]():xa)?this.$Complex(y(this.real,la),y(this.imag,la)):this.$__coerced__("*", -la)},h.$$arity=1);a.def(c,"$/",f=function(la){var xa=d,Ea=d,Fa=d,Sa=d,Ra=d,Na=d,Qa=d,lb=d;return m(x(e,"Complex")["$==="](la))?m(m(xa=m(Ea=m(Fa=m(Sa=x(e,"Number")["$==="](this.real))?this.real["$nan?"]():Sa)?Fa:m(Ra=x(e,"Number")["$==="](this.imag))?this.imag["$nan?"]():Ra)?Ea:m(Na=x(e,"Number")["$==="](la.$real()))?la.$real()["$nan?"]():Na)?xa:m(Qa=x(e,"Number")["$==="](la.$imag()))?la.$imag()["$nan?"]():Qa)?x(e,"Complex").$new(G(x(e,"Float"),"NAN"),G(x(e,"Float"),"NAN")):w(y(this,la.$conj()),la.$abs2()): -m(m(lb=x(e,"Numeric")["$==="](la))?la["$real?"]():lb)?this.$Complex(this.real.$quo(la),this.imag.$quo(la)):this.$__coerced__("/",la)},f.$$arity=1);a.def(c,"$**",q=function(la){var xa=d;if(la["$=="](0))return x(e,"Complex").$new(1,0);if(m(x(e,"Complex")["$==="](la))){xa=this.$polar();var Ea=a.to_ary(xa);var Fa=null==Ea[0]?d:Ea[0];Ea=null==Ea[1]?d:Ea[1];xa;xa=la.$real();var Sa=la.$imag();la=x(e,"Math").$exp(t(y(xa,x(e,"Math").$log(Fa)),y(Sa,Ea)));xa=K(y(Ea,xa),y(Sa,x(e,"Math").$log(Fa)));return x(e, -"Complex").$polar(la,xa)}if(m(x(e,"Integer")["$==="](la))){if(m("number"===typeof la?0"](0))){Ea=Fa=this;for(Sa=t(la,1);m(Sa["$!="](0));){la=Sa.$divmod(2);xa=a.to_ary(la);var Ra=null==xa[0]?d:xa[0];var Na=null==xa[1]?d:xa[1];for(la;Na["$=="](0);)Fa=this.$Complex(t(y(Fa.$real(),Fa.$real()),y(Fa.$imag(),Fa.$imag())),y(y(2,Fa.$real()),Fa.$imag())),Sa=Ra,xa=Sa.$divmod(2),la=a.to_ary(xa),Ra=null==la[0]?d:la[0],Na=null==la[1]?d:la[1],xa;Ea=y(Ea,Fa);Sa=t(Sa,1)}return Ea}return w(x(e,"Rational").$new(1, -1),this)["$**"](la["$-@"]())}return m(m(xa=x(e,"Float")["$==="](la))?xa:x(e,"Rational")["$==="](la))?(xa=this.$polar(),Ea=a.to_ary(xa),Fa=null==Ea[0]?d:Ea[0],Ea=null==Ea[1]?d:Ea[1],xa,x(e,"Complex").$polar(Fa["$**"](la),y(Ea,la))):this.$__coerced__("**",la)},q.$$arity=1);a.def(c,"$abs",z=function(){return x(e,"Math").$hypot(this.real,this.imag)},z.$$arity=0);a.def(c,"$abs2",E=function(){return K(y(this.real,this.real),y(this.imag,this.imag))},E.$$arity=0);a.def(c,"$angle",F=function(){return x(e, -"Math").$atan2(this.imag,this.real)},F.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",L=function(){return this.$Complex(this.real,this.imag["$-@"]())},L.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",ca=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},ca.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",va=function(la){var xa=d,Ea=d;return m(xa=m(Ea=x(e,"Complex")["$==="](la))?this.real.$class()["$=="](this.imag.$class()):Ea)?this["$=="](la):xa},va.$$arity= -1);a.def(c,"$fdiv",Oa=function(la){m(x(e,"Numeric")["$==="](la))||this.$raise(x(e,"TypeError"),""+la.$class()+" can't be coerced into Complex");return w(this,la)},Oa.$$arity=1);a.def(c,"$finite?",wa=function(){var la;return m(la=this.real["$finite?"]())?this.imag["$finite?"]():la},wa.$$arity=0);a.def(c,"$hash",Ba=function(){return"Complex:"+this.real+":"+this.imag},Ba.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$infinite?",Ka=function(){var la;return m(la=this.real["$infinite?"]())?la:this.imag["$infinite?"]()}, -Ka.$$arity=0);a.def(c,"$inspect",na=function(){return"("+this+")"},na.$$arity=0);a.alias(c,"magnitude","abs");a.udef(c,"$negative?");a.def(c,"$numerator",S=function(){var la=this.$denominator();return this.$Complex(y(this.real.$numerator(),w(la,this.real.$denominator())),y(this.imag.$numerator(),w(la,this.imag.$denominator())))},S.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",ta=function(){return[this.$abs(),this.$arg()]},ta.$$arity=0);a.udef(c,"$positive?");a.alias(c,"quo","/");a.def(c,"$rationalize", -ja=function(la){1 $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));p.$require("corelib/numeric");(function(l,$super,e){l=m(l,$super,"Rational");var n=[l].concat(e),J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V;l.$$prototype.num=l.$$prototype.den=G;a.defs(l,"$reduce",J=function(Q,Y){Q=Q.$to_i(); -Y=Y.$to_i();if(Y["$=="](0))this.$raise(k(n,"ZeroDivisionError"),"divided by 0");else if(u(y(Y,0)))Q=Q["$-@"](),Y=Y["$-@"]();else if(Y["$=="](1))return this.$new(Q,Y);var pa=Q.$gcd(Y);return this.$new(K(Q,pa),K(Y,pa))},J.$$arity=2);a.defs(l,"$convert",D=function(Q,Y){var pa=G,za=G,la=G,xa=G,Ea=G,Fa=G,Sa=G,Ra=G;u(u(pa=Q["$nil?"]())?pa:Y["$nil?"]())&&this.$raise(k(n,"TypeError"),"cannot convert nil into Rational");if(u(u(za=k(n,"Integer")["$==="](Q))?k(n,"Integer")["$==="](Y):za))return this.$reduce(Q, -Y);u(u(la=u(xa=k(n,"Float")["$==="](Q))?xa:k(n,"String")["$==="](Q))?la:k(n,"Complex")["$==="](Q))&&(Q=Q.$to_r());u(u(Ea=u(Fa=k(n,"Float")["$==="](Y))?Fa:k(n,"String")["$==="](Y))?Ea:k(n,"Complex")["$==="](Y))&&(Y=Y.$to_r());return u(u(Sa=Y["$equal?"](1))?k(n,"Integer")["$==="](Q)["$!"]():Sa)?k(n,"Opal")["$coerce_to!"](Q,k(n,"Rational"),"to_r"):u(u(Ra=k(n,"Numeric")["$==="](Q))?k(n,"Numeric")["$==="](Y):Ra)?K(Q,Y):this.$reduce(Q,Y)},D.$$arity=2);a.def(l,"$initialize",R=function(Q,Y){this.num=Q;return this.den= -Y},R.$$arity=2);a.def(l,"$numerator",ia=function(){return this.num},ia.$$arity=0);a.def(l,"$denominator",ea=function(){return this.den},ea.$$arity=0);a.def(l,"$coerce",ma=function(Q){return k(n,"Rational")["$==="](Q)?[Q,this]:k(n,"Integer")["$==="](Q)?[Q.$to_r(),this]:k(n,"Float")["$==="](Q)?[Q,this.$to_f()]:G},ma.$$arity=1);a.def(l,"$==",b=function(Q){var Y=G,pa=G;return k(n,"Rational")["$==="](Q)?u(Y=this.num["$=="](Q.$numerator()))?this.den["$=="](Q.$denominator()):Y:k(n,"Integer")["$==="](Q)? -u(pa=this.num["$=="](Q))?this.den["$=="](1):pa:k(n,"Float")["$==="](Q)?this.$to_f()["$=="](Q):Q["$=="](this)},b.$$arity=1);a.def(l,"$<=>",h=function(Q){return k(n,"Rational")["$==="](Q)?t(w(this.num,Q.$denominator()),w(this.den,Q.$numerator()))["$<=>"](0):k(n,"Integer")["$==="](Q)?t(this.num,w(this.den,Q))["$<=>"](0):k(n,"Float")["$==="](Q)?this.$to_f()["$<=>"](Q):this.$__coerced__("<=>",Q)},h.$$arity=1);a.def(l,"$+",f=function(Q){if(k(n,"Rational")["$==="](Q)){var Y=A(w(this.num,Q.$denominator()), -w(this.den,Q.$numerator()));Q=w(this.den,Q.$denominator());Y=this.$Rational(Y,Q)}else Y=k(n,"Integer")["$==="](Q)?this.$Rational(A(this.num,w(Q,this.den)),this.den):k(n,"Float")["$==="](Q)?A(this.$to_f(),Q):this.$__coerced__("+",Q);return Y},f.$$arity=1);a.def(l,"$-",q=function(Q){if(k(n,"Rational")["$==="](Q)){var Y=t(w(this.num,Q.$denominator()),w(this.den,Q.$numerator()));Q=w(this.den,Q.$denominator());Y=this.$Rational(Y,Q)}else Y=k(n,"Integer")["$==="](Q)?this.$Rational(t(this.num,w(Q,this.den)), -this.den):k(n,"Float")["$==="](Q)?t(this.$to_f(),Q):this.$__coerced__("-",Q);return Y},q.$$arity=1);a.def(l,"$*",z=function(Q){if(k(n,"Rational")["$==="](Q)){var Y=w(this.num,Q.$numerator());Q=w(this.den,Q.$denominator());Y=this.$Rational(Y,Q)}else Y=k(n,"Integer")["$==="](Q)?this.$Rational(w(this.num,Q),this.den):k(n,"Float")["$==="](Q)?w(this.$to_f(),Q):this.$__coerced__("*",Q);return Y},z.$$arity=1);a.def(l,"$/",E=function(Q){if(k(n,"Rational")["$==="](Q)){var Y=w(this.num,Q.$denominator());Q= -w(this.den,Q.$numerator());Y=this.$Rational(Y,Q)}else Y=k(n,"Integer")["$==="](Q)?Q["$=="](0)?K(this.$to_f(),0):this.$Rational(this.num,w(this.den,Q)):k(n,"Float")["$==="](Q)?K(this.$to_f(),Q):this.$__coerced__("/",Q);return Y},E.$$arity=1);a.def(l,"$**",F=function(Q){var Y=G,pa=G;return k(n,"Integer")["$==="](Q)?u(u(Y=this["$=="](0))?y(Q,0):Y)?x(k(n,"Float"),"INFINITY"):u("number"===typeof Q?0"](0))?this.$Rational(this.num["$**"](Q),this.den["$**"](Q)):u(y(Q,0))?this.$Rational(this.den["$**"](Q["$-@"]()), -this.num["$**"](Q["$-@"]())):this.$Rational(1,1):k(n,"Float")["$==="](Q)?this.$to_f()["$**"](Q):k(n,"Rational")["$==="](Q)?Q["$=="](0)?this.$Rational(1,1):Q.$denominator()["$=="](1)?u(y(Q,0))?this.$Rational(this.den["$**"](Q.$numerator().$abs()),this.num["$**"](Q.$numerator().$abs())):this.$Rational(this.num["$**"](Q.$numerator()),this.den["$**"](Q.$numerator())):u(u(pa=this["$=="](0))?y(Q,0):pa)?this.$raise(k(n,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](Q):this.$__coerced__("**",Q)}, -F.$$arity=1);a.def(l,"$abs",L=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},L.$$arity=0);a.def(l,"$ceil",ca=function(Q){null==Q&&(Q=0);return Q["$=="](0)?K(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",Q)},ca.$$arity=-1);a.alias(l,"divide","/");a.def(l,"$floor",va=function(Q){null==Q&&(Q=0);return Q["$=="](0)?K(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",Q)},va.$$arity=-1);a.def(l,"$hash",Oa=function(){return"Rational:"+ -this.num+":"+this.den},Oa.$$arity=0);a.def(l,"$inspect",wa=function(){return"("+this+")"},wa.$$arity=0);a.alias(l,"quo","/");a.def(l,"$rationalize",Ba=function(Q){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); -A.$require("corelib/comparable");return function(c,$super,H){function e(Aa,ua,La,Ta,Ya,Ga){Aa=Aa.$$is_string?parseInt(Aa,10):G(J,"Opal")["$coerce_to!"](Aa,G(J,"Integer"),"to_int");if(ua===d)ua=1;else if(!ua.$$is_number)if(ua["$respond_to?"]("to_str"))switch(ua=ua.$to_str(),ua.toLowerCase()){case "jan":ua=1;break;case "feb":ua=2;break;case "mar":ua=3;break;case "apr":ua=4;break;case "may":ua=5;break;case "jun":ua=6;break;case "jul":ua=7;break;case "aug":ua=8;break;case "sep":ua=9;break;case "oct":ua= -10;break;case "nov":ua=11;break;case "dec":ua=12;break;default:ua=ua.$to_i()}else ua=G(J,"Opal")["$coerce_to!"](ua,G(J,"Integer"),"to_int");(1>ua||12La||31Ta||24Ya||59Ga||60Aa&&ua.setFullYear(Aa);return ua},R.$$arity=-1);a.defs(n,"$local",ia=function(Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T){null==ua&&(ua=d);null==La&&(La=d);null==Ta&&(Ta=d);null==Ya&&(Ya=d);null==Ga&&(Ga=d);null==Z&&(Z=d);null==P&&(P=d);null==aa&&(aa=d);null==T&&(T=d);if(10===arguments.length){var fa= -x.call(arguments);Aa=fa[5];ua=fa[4];La=fa[3];Ta=fa[2];Ya=fa[1];Ga=fa[0]}fa=e(Aa,ua,La,Ta,Ya,Ga);Aa=fa[0];ua=fa[1];La=fa[2];Ta=fa[3];Ya=fa[4];Ga=fa[5];fa=new Date(Aa,ua,La,Ta,Ya,0,1E3*Ga);100>Aa&&fa.setFullYear(Aa);return fa},ia.$$arity=-2);a.defs(n,"$gm",ea=function(Aa,ua,La,Ta,Ya,Ga,Z,P,aa,T){null==ua&&(ua=d);null==La&&(La=d);null==Ta&&(Ta=d);null==Ya&&(Ya=d);null==Ga&&(Ga=d);null==Z&&(Z=d);null==P&&(P=d);null==aa&&(aa=d);null==T&&(T=d);if(10===arguments.length){var fa=x.call(arguments);Aa=fa[5]; -ua=fa[4];La=fa[3];Ta=fa[2];Ya=fa[1];Ga=fa[0]}fa=e(Aa,ua,La,Ta,Ya,Ga);Aa=fa[0];ua=fa[1];La=fa[2];Ta=fa[3];Ya=fa[4];Ga=fa[5];fa=new Date(Date.UTC(Aa,ua,La,Ta,Ya,0,1E3*Ga));100>Aa&&fa.setUTCFullYear(Aa);fa.is_utc=!0;return fa},ea.$$arity=-2);(function(Aa,ua){[Aa].concat(ua);a.alias(Aa,"mktime","local");return a.alias(Aa,"utc","gm")})(a.get_singleton_class(n),J);a.defs(n,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(n,"$+",b=function(Aa){m(G(J,"Time")["$==="](Aa))&&this.$raise(G(J,"TypeError"), -"time + time?");Aa.$$is_number||(Aa=G(J,"Opal")["$coerce_to!"](Aa,G(J,"Integer"),"to_int"));Aa=new Date(this.getTime()+1E3*Aa);Aa.is_utc=this.is_utc;return Aa},b.$$arity=1);a.def(n,"$-",h=function(Aa){if(m(G(J,"Time")["$==="](Aa)))return(this.getTime()-Aa.getTime())/1E3;Aa.$$is_number||(Aa=G(J,"Opal")["$coerce_to!"](Aa,G(J,"Integer"),"to_int"));Aa=new Date(this.getTime()-1E3*Aa);Aa.is_utc=this.is_utc;return Aa},h.$$arity=1);a.def(n,"$<=>",f=function(Aa){if(m(G(J,"Time")["$==="](Aa)))return this.$to_f()["$<=>"](Aa.$to_f()); -Aa=Aa["$<=>"](this);return m(Aa["$nil?"]())?d:m("number"===typeof Aa?0"](0))?-1:m("number"===typeof Aa?0>Aa:Aa["$<"](0))?1:0},f.$$arity=1);a.def(n,"$==",q=function(Aa){var ua;return m(ua=G(J,"Time")["$==="](Aa))?this.$to_f()===Aa.$to_f():ua},q.$$arity=1);a.def(n,"$asctime",z=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},z.$$arity=0);a.alias(n,"ctime","asctime");a.def(n,"$day",E=function(){return this.is_utc?this.getUTCDate():this.getDate()},E.$$arity=0);a.def(n,"$yday",F=function(){var Aa= -G(J,"Time").$new(this.$year()).$to_i();var ua=G(J,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return y(K(t(ua,Aa),86400).$round(),1)},F.$$arity=0);a.def(n,"$isdst",L=function(){var Aa=new Date(this.getFullYear(),0,1),ua=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](Aa)["$zero?"]():ua},va.$$arity=1);a.def(n,"$friday?",Oa=function(){return 5==this.$wday()},Oa.$$arity=0);a.def(n,"$hash",wa=function(){return"Time:"+this.getTime()},wa.$$arity=0);a.def(n,"$hour",Ba=function(){return this.is_utc?this.getUTCHours():this.getHours()},Ba.$$arity=0);a.def(n,"$inspect",Ka=function(){return m(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, -Ka.$$arity=0);a.alias(n,"mday","day");a.def(n,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(n,"$mon",S=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},S.$$arity=0);a.def(n,"$monday?",ta=function(){return 1==this.$wday()},ta.$$arity=0);a.alias(n,"month","mon");a.def(n,"$saturday?",ja=function(){return 6==this.$wday()},ja.$$arity=0);a.def(n,"$sec",oa=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},oa.$$arity= -0);a.def(n,"$succ",V=function(){var Aa=new Date(this.getTime()+1E3);Aa.is_utc=this.is_utc;return Aa},V.$$arity=0);a.def(n,"$usec",Q=function(){return 1E3*this.getMilliseconds()},Q.$$arity=0);a.def(n,"$zone",Y=function(){var Aa=this.toString();var ua=-1==Aa.indexOf("(")?Aa.match(/[A-Z]{3,4}/)[0]:Aa.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ua&&/(GMT\W*\d{4})/.test(Aa)?RegExp.$1:ua},Y.$$arity=0);a.def(n,"$getgm",pa=function(){var Aa=new Date(this.getTime());Aa.is_utc=!0;return Aa},pa.$$arity=0);a.alias(n, -"getutc","getgm");a.def(n,"$gmtime",za=function(){this.is_utc=!0;return this},za.$$arity=0);a.alias(n,"utc","gmtime");a.def(n,"$gmt?",la=function(){return!0===this.is_utc},la.$$arity=0);a.def(n,"$gmt_offset",xa=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},xa.$$arity=0);a.def(n,"$strftime",Ea=function(Aa){var ua=this;return Aa.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(La,Ta,Ya,Ga,Z){Ga="";var P=-1!==Ta.indexOf("0"),aa=-1===Ta.indexOf("-"),T=-1!==Ta.indexOf("_"),fa=-1!== -Ta.indexOf("^"),ka=-1!==Ta.indexOf("#"),g=(Ta.match(":")||[]).length;Ya=parseInt(Ya,10);P&&T&&(Ta.indexOf("0")La?"+":"-")+(10>Ta?"0":"")+Ta;0Z?"0":"";Ga+=Z;1H:l["$>"](H)}function K(l,H){return"number"===typeof l&&"number"===typeof H?l-H:l["$-"](H)}function t(l,H){return"number"===typeof l&&"number"===typeof H?l=H:l["$>="](H)}function A(l,H){return"number"===typeof l&&"number"===typeof H?l+H:l["$+"](H)}var p=a.top,d=[],G=a.nil,x=a.$$,k=a.klass,m=a.hash2,u=a.truthy,c=a.send; +Opal.modules["corelib/kernel/format"]=function(a){var y=[],J=a.nil,t=a.$$,w=a.coerce_to,z=a.module,p=a.truthy,d=a.gvars;a.add_stubs("$== $length $respond_to? $[] $coerce_to? $nil? $to_a $raise $to_int $fetch $Integer $Float $to_ary $to_str $inspect $to_s".split(" "));return function(H,x){H=z(H,"Kernel");var k=[H].concat(x),m;a.def(H,"$format",m=function(u,c){function l(){ba&32&&da.$raise(t(k,"ArgumentError"),"flag after width");ba&128&&da.$raise(t(k,"ArgumentError"),"flag after precision")}function I(){ba& +32&&da.$raise(t(k,"ArgumentError"),"width given twice");ba&128&&da.$raise(t(k,"ArgumentError"),"width after precision")}function e(pa){pa>=h.length&&da.$raise(t(k,"ArgumentError"),"too few arguments");return h[pa]}function n(){switch(G){case -1:da.$raise(t(k,"ArgumentError"),"unnumbered("+E+") mixed with numbered");case -2:da.$raise(t(k,"ArgumentError"),"unnumbered("+E+") mixed with named")}G=E++;return e(G-1)}function L(pa){0pa&&da.$raise(t(k,"ArgumentError"),"invalid index - "+pa+"$");G=-1;return e(pa-1)}function D(){return void 0===Oa?n():Oa}function R(pa){var ea;for(ea="";;f++){f===q&&da.$raise(t(k,"ArgumentError"),"malformed format string - %*[0-9]");if(48>u.charCodeAt(f)||57":"}";Ba="";for(f++;;f++){f===q&&da.$raise(t(k,"ArgumentError"),"malformed name - unmatched parenthesis");if(u.charAt(f)===La)if(0"===La)continue a;else{M=Oa.toString();-1!==ua&&(M=M.slice(0,ua));if(ba& +2)for(;M.lengthA&&(ba|=2,A=-A);continue a;case ".":ba&128&&da.$raise(t(k,"ArgumentError"),"precision given twice");ba|=192;ua=0;f++;if("*"===u.charAt(f)){f++;ua=ja("precision");0>ua&&(ba&=-65);continue a}ua=R("precision");continue a;case "d":case "i":case "u":Ba=da.$Integer(D());if(0<=Ba){for(M=Ba.toString();M.length>>0).toString(na).replace(sa,ya);M.lengthLa||La>=(-1===ua?6:ua)||(M=Ba.toPrecision(-1===ua?ba&1?6:void 0:ua))}if(ba&2){if(ba&4||ba&16)M=(ba&4?"+":" ")+M;for(;M.lengthLa||La>=(-1===ua?6:ua)||(M=(-Ba).toPrecision(-1===ua?ba&1?6:void 0:ua))}if(ba&2)for(M="-"+M;M.length"},q.$$arity=0);a.def(n,"$each_byte",A=function(G){a.slice.call(arguments,0,arguments.length); +return this.$raise(m(R,"NotImplementedError"))},A.$$arity=-1);a.def(n,"$bytesize",E=function(G){a.slice.call(arguments,0,arguments.length);return this.$raise(m(R,"NotImplementedError"))},E.$$arity=-1);(function(G,$super,ba){[u(G,$super,"EncodingError")].concat(ba);return x})(R[0],m(R,"StandardError"),R);return function(G,$super,ba){[u(G,$super,"CompatibilityError")].concat(ba);return x}(R[0],m(R,"EncodingError"),R)})(H[0],null,H);I(m(H,"Encoding"),"register",["UTF-8",c(["aliases","ascii"],{aliases:["CP65001"], +ascii:!0})],(J=function(){var n=null==J.$$s?this:J.$$s,L,D;a.def(n,"$each_byte",L=function(R){var ja=L.$$p,da=ja||x;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=Infinity;for(var ma,b=R.length,h=null,f=0;fma){if(!h){if(56319ma){-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191), +a.yield1(da,189));h=ma;continue}ma=(h-55296<<10|ma-56320)+65536}else h&&-1<(ja-=3)&&(a.yield1(da,239),a.yield1(da,191),a.yield1(da,189));h=null;if(128>ma){if(0>--ja)break;a.yield1(da,ma)}else if(2048>ma){if(0>(ja-=2))break;a.yield1(da,ma>>6|192);a.yield1(da,ma&63|128)}else if(65536>ma){if(0>(ja-=3))break;a.yield1(da,ma>>12|224);a.yield1(da,ma>>6&63|128);a.yield1(da,ma&63|128)}else if(1114112>ma){if(0>(ja-=4))break;a.yield1(da,ma>>18|240);a.yield1(da,ma>>12&63|128);a.yield1(da,ma>>6&63|128);a.yield1(da, +ma&63|128)}}},L.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},J.$$s=d,J.$$arity=0,J));I(m(H,"Encoding"),"register",["UTF-16LE"],(t=function(){var n=null==t.$$s?this:t.$$s,L,D;a.def(n,"$each_byte",L=function(R){var ja=L.$$p,da=ja||x;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()}, +D.$$arity=1),x)&&"bytesize"},t.$$s=d,t.$$arity=0,t));I(m(H,"Encoding"),"register",["UTF-16BE"],(w=function(){var n=null==w.$$s?this:w.$$s,L,D;a.def(n,"$each_byte",L=function(R){var ja=L.$$p,da=ja||x;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8);a.yield1(da,b&255)}},L.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},w.$$s=d,w.$$arity=0,w));I(m(H,"Encoding"),"register",["UTF-32LE"], +(z=function(){var n=null==z.$$s?this:z.$$s,L,D;a.def(n,"$each_byte",L=function(R){var ja=L.$$p,da=ja||x;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},z.$$s=d,z.$$arity=0,z));I(m(H,"Encoding"),"register",["ASCII-8BIT",c(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})], +(p=function(){var n=null==p.$$s?this:p.$$s,L,D;a.def(n,"$each_byte",L=function(R){var ja=L.$$p,da=ja||x;ja&&(L.$$p=null);ja&&(L.$$p=null);ja=0;for(var ma=R.length;ja>8)}},L.$$arity=1);return(a.def(n,"$bytesize",D=function(R){return R.$bytes().$length()},D.$$arity=1),x)&&"bytesize"},p.$$s=d,p.$$arity=0,p));(function(n,$super,D){n=u(n,$super,"String");var R=[n].concat(D),ja,da,ma,b,h,f,q,A,E;n.$$prototype.bytes=n.$$prototype.internal_encoding= +x;n.$attr_reader("encoding");n.$attr_reader("internal_encoding");a.defineProperty(String.prototype,"bytes",x);a.defineProperty(String.prototype,"encoding",k(m(R,"Encoding"),"UTF_8"));a.defineProperty(String.prototype,"internal_encoding",k(m(R,"Encoding"),"UTF_8"));a.def(n,"$bytes",ja=function(){var G=x;this.bytes=l(G=this.bytes)?G:this.$each_byte().$to_a();return this.bytes.$dup()},ja.$$arity=0);a.def(n,"$bytesize",da=function(){return this.internal_encoding.$bytesize(this)},da.$$arity=0);a.def(n, +"$each_byte",ma=function(){var G=ma.$$p,M=G||x;G&&(ma.$$p=null);G&&(ma.$$p=null);if(M===x)return this.$enum_for("each_byte");I(this.internal_encoding,"each_byte",[this],M.$to_proc());return this},ma.$$arity=0);a.def(n,"$each_codepoint",b=function(){var G=b.$$p,M=G||x;G&&(b.$$p=null);G&&(b.$$p=null);if(M===x)return this.$enum_for("each_codepoint");G=0;for(var ba=this.length;GS)return-Math.cbrt(-S);for(var sa=S,ya=0;.125>sa;)sa*=8,ya--;for(;1ya;)sa*=.5,ya++;for(;0S&&(sa=-1);S=Math.abs(S);var ya=1/(1+.3275911*S);return sa*(1-((((1.061405429*ya+-1.453152027)*ya+1.421413741)*ya+-.284496736)*ya+.254829592)*ya*Math.exp(-S*S))});a.def(d,"$erf",ma=function(S){return t(x,"Math").$checked("erf",t(x,"Math")["$float!"](S))},ma.$$arity=1);p("undefined"!==typeof Math.erfc)||a.defineProperty(Math,"erfc",function(S){var sa=Math.abs(S),ya=1/(.5*sa+1);sa=ya*Math.exp(-sa*sa-1.26551223+ya*(ya*(ya*(ya*(ya*(ya*(ya*(ya*(.17087277*ya+-.82215223)+1.48851587)+ +-1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));return 0>S?2-sa:sa});a.def(d,"$erfc",b=function(S){return t(x,"Math").$checked("erfc",t(x,"Math")["$float!"](S))},b.$$arity=1);a.def(d,"$exp",h=function(S){return t(x,"Math").$checked("exp",t(x,"Math")["$float!"](S))},h.$$arity=1);a.def(d,"$frexp",f=function(S){S=t(x,"Math")["$float!"](S);if(isNaN(S))return[NaN,0];var sa=Math.floor(Math.log(Math.abs(S))/Math.log(2))+1;return[S/Math.pow(2,sa),sa]},f.$$arity=1);a.def(d,"$gamma", +q=function(S){S=t(x,"Math")["$float!"](S);var sa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3.399464998481189E-5,4.652362892704858E-5,-9.837447530487956E-5,1.580887032249125E-4,-2.1026444172410488E-4,2.1743961811521265E-4,-1.643181065367639E-4,8.441822398385275E-5,-2.6190838401581408E-5,3.6899182659531625E-6];if(isNaN(S))return NaN;if(0===S&&0>1/S)return-Infinity;-1!==S&&-Infinity!==S||this.$raise(t(x,"DomainError"),'Numerical argument is out of domain - "gamma"'); +if(t(x,"Integer")["$==="](S)){if(0>=S)return isFinite(S)?Infinity:NaN;if(171S)return Math.PI/(Math.sin(Math.PI*S)*t(x,"Math").$gamma("number"===typeof S?1-S:1["$-"](S)));if(171.35<=S)return Infinity;if(85t(x,"Math").$gamma(S)?-1:1]},G.$$arity=1);a.def(d,"$log",M=function(S,sa){p(t(x,"String")["$==="](S))&&this.$raise(w(S,t(x,"Float")));if(p(null==sa))return t(x,"Math").$checked("log",t(x,"Math")["$float!"](S));p(t(x,"String")["$==="](sa))&&this.$raise(w(sa,t(x,"Float")));S=t(x,"Math").$checked("log",t(x,"Math")["$float!"](S));sa=t(x,"Math").$checked("log",t(x, +"Math")["$float!"](sa));return"number"===typeof S&&"number"===typeof sa?S/sa:S["$/"](sa)},M.$$arity=-2);p("undefined"!==typeof Math.log10)||(Math.log10=function(S){return Math.log(S)/Math.LN10});a.def(d,"$log10",ba=function(S){p(t(x,"String")["$==="](S))&&this.$raise(w(S,t(x,"Float")));return t(x,"Math").$checked("log10",t(x,"Math")["$float!"](S))},ba.$$arity=1);p("undefined"!==typeof Math.log2)||(Math.log2=function(S){return Math.log(S)/Math.LN2});a.def(d,"$log2",ua=function(S){p(t(x,"String")["$==="](S))&& +this.$raise(w(S,t(x,"Float")));return t(x,"Math").$checked("log2",t(x,"Math")["$float!"](S))},ua.$$arity=1);a.def(d,"$sin",Oa=function(S){return t(x,"Math").$checked("sin",t(x,"Math")["$float!"](S))},Oa.$$arity=1);p("undefined"!==typeof Math.sinh)||(Math.sinh=function(S){return(Math.exp(S)-Math.exp(-S))/2});a.def(d,"$sinh",xa=function(S){return t(x,"Math").$checked("sinh",t(x,"Math")["$float!"](S))},xa.$$arity=1);a.def(d,"$sqrt",Ba=function(S){return t(x,"Math").$checked("sqrt",t(x,"Math")["$float!"](S))}, +Ba.$$arity=1);a.def(d,"$tan",La=function(S){S=t(x,"Math")["$float!"](S);return p(S["$infinite?"]())?J(t(x,"Float"),"NAN"):t(x,"Math").$checked("tan",t(x,"Math")["$float!"](S))},La.$$arity=1);p("undefined"!==typeof Math.tanh)||(Math.tanh=function(S){return Infinity==S?1:-Infinity==S?-1:(Math.exp(S)-Math.exp(-S))/(Math.exp(S)+Math.exp(-S))});a.def(d,"$tanh",na=function(S){return t(x,"Math").$checked("tanh",t(x,"Math")["$float!"](S))},na.$$arity=1)}(y[0],y)}; +Opal.modules["corelib/complex"]=function(a){function y(c,l){return"number"===typeof c&&"number"===typeof l?c*l:c["$*"](l)}function J(c,l){return"number"===typeof c&&"number"===typeof l?c+l:c["$+"](l)}function t(c,l){return"number"===typeof c&&"number"===typeof l?c-l:c["$-"](l)}function w(c,l){return"number"===typeof c&&"number"===typeof l?c/l:c["$/"](l)}var z=a.top,p=[],d=a.nil,H=a.$$$,x=a.$$,k=a.klass,m=a.truthy,u=a.module;a.add_stubs("$require $=== $real? $raise $new $* $cos $sin $attr_reader $class $== $real $imag $Complex $-@ $+ $__coerced__ $- $nan? $/ $conj $abs2 $quo $polar $exp $log $> $!= $divmod $** $hypot $atan2 $lcm $denominator $finite? $infinite? $numerator $abs $arg $rationalize $to_f $to_i $to_r $inspect $positive? $zero? $Rational".split(" ")); +z.$require("corelib/numeric");(function(c,$super,I){c=k(c,$super,"Complex");var e=[c].concat(I),n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va;c.$$prototype.real=c.$$prototype.imag=d;a.defs(c,"$rect",n=function(ia,wa){var Ha=d,Ea=d,Qa=d;null==wa&&(wa=0);m(m(Ha=m(Ea=m(Qa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():Qa)?x(e,"Numeric")["$==="](wa):Ea)?wa["$real?"]():Ha)||this.$raise(x(e,"TypeError"),"not a real");return this.$new(ia,wa)},n.$$arity=-2);(function(ia,wa){[ia].concat(wa); +return a.alias(ia,"rectangular","rect")})(a.get_singleton_class(c),e);a.defs(c,"$polar",L=function(ia,wa){var Ha=d,Ea=d,Qa=d;null==wa&&(wa=0);m(m(Ha=m(Ea=m(Qa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():Qa)?x(e,"Numeric")["$==="](wa):Ea)?wa["$real?"]():Ha)||this.$raise(x(e,"TypeError"),"not a real");return this.$new(y(ia,x(e,"Math").$cos(wa)),y(ia,x(e,"Math").$sin(wa)))},L.$$arity=-2);c.$attr_reader("real","imag");a.def(c,"$initialize",D=function(ia,wa){null==wa&&(wa=0);this.real=ia;return this.imag= +wa},D.$$arity=-2);a.def(c,"$coerce",R=function(ia){var wa=d;return m(x(e,"Complex")["$==="](ia))?[ia,this]:m(m(wa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():wa)?[x(e,"Complex").$new(ia,0),this]:this.$raise(x(e,"TypeError"),""+ia.$class()+" can't be coerced into Complex")},R.$$arity=1);a.def(c,"$==",ja=function(ia){var wa=d,Ha=d,Ea=d;return m(x(e,"Complex")["$==="](ia))?m(wa=this.real["$=="](ia.$real()))?this.imag["$=="](ia.$imag()):wa:m(m(Ha=x(e,"Numeric")["$==="](ia))?ia["$real?"]():Ha)?m(Ea=this.real["$=="](ia))? +this.imag["$=="](0):Ea:ia["$=="](this)},ja.$$arity=1);a.def(c,"$-@",da=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},da.$$arity=0);a.def(c,"$+",ma=function(ia){var wa=d;return m(x(e,"Complex")["$==="](ia))?this.$Complex(J(this.real,ia.$real()),J(this.imag,ia.$imag())):m(m(wa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():wa)?this.$Complex(J(this.real,ia),this.imag):this.$__coerced__("+",ia)},ma.$$arity=1);a.def(c,"$-",b=function(ia){var wa=d;return m(x(e,"Complex")["$==="](ia))? +this.$Complex(t(this.real,ia.$real()),t(this.imag,ia.$imag())):m(m(wa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():wa)?this.$Complex(t(this.real,ia),this.imag):this.$__coerced__("-",ia)},b.$$arity=1);a.def(c,"$*",h=function(ia){var wa=d;return m(x(e,"Complex")["$==="](ia))?this.$Complex(t(y(this.real,ia.$real()),y(this.imag,ia.$imag())),J(y(this.real,ia.$imag()),y(this.imag,ia.$real()))):m(m(wa=x(e,"Numeric")["$==="](ia))?ia["$real?"]():wa)?this.$Complex(y(this.real,ia),y(this.imag,ia)):this.$__coerced__("*", +ia)},h.$$arity=1);a.def(c,"$/",f=function(ia){var wa=d,Ha=d,Ea=d,Qa=d,Sa=d,Ia=d,kb=d,Ra=d;return m(x(e,"Complex")["$==="](ia))?m(m(wa=m(Ha=m(Ea=m(Qa=x(e,"Number")["$==="](this.real))?this.real["$nan?"]():Qa)?Ea:m(Sa=x(e,"Number")["$==="](this.imag))?this.imag["$nan?"]():Sa)?Ha:m(Ia=x(e,"Number")["$==="](ia.$real()))?ia.$real()["$nan?"]():Ia)?wa:m(kb=x(e,"Number")["$==="](ia.$imag()))?ia.$imag()["$nan?"]():kb)?x(e,"Complex").$new(H(x(e,"Float"),"NAN"),H(x(e,"Float"),"NAN")):w(y(this,ia.$conj()),ia.$abs2()): +m(m(Ra=x(e,"Numeric")["$==="](ia))?ia["$real?"]():Ra)?this.$Complex(this.real.$quo(ia),this.imag.$quo(ia)):this.$__coerced__("/",ia)},f.$$arity=1);a.def(c,"$**",q=function(ia){var wa=d;if(ia["$=="](0))return x(e,"Complex").$new(1,0);if(m(x(e,"Complex")["$==="](ia))){wa=this.$polar();var Ha=a.to_ary(wa);var Ea=null==Ha[0]?d:Ha[0];Ha=null==Ha[1]?d:Ha[1];wa;wa=ia.$real();var Qa=ia.$imag();ia=x(e,"Math").$exp(t(y(wa,x(e,"Math").$log(Ea)),y(Qa,Ha)));wa=J(y(Ha,wa),y(Qa,x(e,"Math").$log(Ea)));return x(e, +"Complex").$polar(ia,wa)}if(m(x(e,"Integer")["$==="](ia))){if(m("number"===typeof ia?0"](0))){Ha=Ea=this;for(Qa=t(ia,1);m(Qa["$!="](0));){ia=Qa.$divmod(2);wa=a.to_ary(ia);var Sa=null==wa[0]?d:wa[0];var Ia=null==wa[1]?d:wa[1];for(ia;Ia["$=="](0);)Ea=this.$Complex(t(y(Ea.$real(),Ea.$real()),y(Ea.$imag(),Ea.$imag())),y(y(2,Ea.$real()),Ea.$imag())),Qa=Sa,wa=Qa.$divmod(2),ia=a.to_ary(wa),Sa=null==ia[0]?d:ia[0],Ia=null==ia[1]?d:ia[1],wa;Ha=y(Ha,Ea);Qa=t(Qa,1)}return Ha}return w(x(e,"Rational").$new(1, +1),this)["$**"](ia["$-@"]())}return m(m(wa=x(e,"Float")["$==="](ia))?wa:x(e,"Rational")["$==="](ia))?(wa=this.$polar(),Ha=a.to_ary(wa),Ea=null==Ha[0]?d:Ha[0],Ha=null==Ha[1]?d:Ha[1],wa,x(e,"Complex").$polar(Ea["$**"](ia),y(Ha,ia))):this.$__coerced__("**",ia)},q.$$arity=1);a.def(c,"$abs",A=function(){return x(e,"Math").$hypot(this.real,this.imag)},A.$$arity=0);a.def(c,"$abs2",E=function(){return J(y(this.real,this.real),y(this.imag,this.imag))},E.$$arity=0);a.def(c,"$angle",G=function(){return x(e, +"Math").$atan2(this.imag,this.real)},G.$$arity=0);a.alias(c,"arg","angle");a.def(c,"$conj",M=function(){return this.$Complex(this.real,this.imag["$-@"]())},M.$$arity=0);a.alias(c,"conjugate","conj");a.def(c,"$denominator",ba=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},ba.$$arity=0);a.alias(c,"divide","/");a.def(c,"$eql?",ua=function(ia){var wa=d,Ha=d;return m(wa=m(Ha=x(e,"Complex")["$==="](ia))?this.real.$class()["$=="](this.imag.$class()):Ha)?this["$=="](ia):wa},ua.$$arity= +1);a.def(c,"$fdiv",Oa=function(ia){m(x(e,"Numeric")["$==="](ia))||this.$raise(x(e,"TypeError"),""+ia.$class()+" can't be coerced into Complex");return w(this,ia)},Oa.$$arity=1);a.def(c,"$finite?",xa=function(){var ia;return m(ia=this.real["$finite?"]())?this.imag["$finite?"]():ia},xa.$$arity=0);a.def(c,"$hash",Ba=function(){return"Complex:"+this.real+":"+this.imag},Ba.$$arity=0);a.alias(c,"imaginary","imag");a.def(c,"$infinite?",La=function(){var ia;return m(ia=this.real["$infinite?"]())?ia:this.imag["$infinite?"]()}, +La.$$arity=0);a.def(c,"$inspect",na=function(){return"("+this+")"},na.$$arity=0);a.alias(c,"magnitude","abs");a.udef(c,"$negative?");a.def(c,"$numerator",S=function(){var ia=this.$denominator();return this.$Complex(y(this.real.$numerator(),w(ia,this.real.$denominator())),y(this.imag.$numerator(),w(ia,this.imag.$denominator())))},S.$$arity=0);a.alias(c,"phase","arg");a.def(c,"$polar",sa=function(){return[this.$abs(),this.$arg()]},sa.$$arity=0);a.udef(c,"$positive?");a.alias(c,"quo","/");a.def(c,"$rationalize", +ya=function(ia){1 $- $* $__coerced__ $+ $Rational $> $** $abs $ceil $with_precision $floor $<= $truncate $send $convert".split(" "));p.$require("corelib/numeric");(function(l,$super,e){l=m(l,$super,"Rational");var n=[l].concat(e),L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea;l.$$prototype.num=l.$$prototype.den=H;a.defs(l,"$reduce",L=function(F,V){F=F.$to_i(); +V=V.$to_i();if(V["$=="](0))this.$raise(k(n,"ZeroDivisionError"),"divided by 0");else if(u(y(V,0)))F=F["$-@"](),V=V["$-@"]();else if(V["$=="](1))return this.$new(F,V);var ka=F.$gcd(V);return this.$new(J(F,ka),J(V,ka))},L.$$arity=2);a.defs(l,"$convert",D=function(F,V){var ka=H,va=H,ia=H,wa=H,Ha=H,Ea=H,Qa=H,Sa=H;u(u(ka=F["$nil?"]())?ka:V["$nil?"]())&&this.$raise(k(n,"TypeError"),"cannot convert nil into Rational");if(u(u(va=k(n,"Integer")["$==="](F))?k(n,"Integer")["$==="](V):va))return this.$reduce(F, +V);u(u(ia=u(wa=k(n,"Float")["$==="](F))?wa:k(n,"String")["$==="](F))?ia:k(n,"Complex")["$==="](F))&&(F=F.$to_r());u(u(Ha=u(Ea=k(n,"Float")["$==="](V))?Ea:k(n,"String")["$==="](V))?Ha:k(n,"Complex")["$==="](V))&&(V=V.$to_r());return u(u(Qa=V["$equal?"](1))?k(n,"Integer")["$==="](F)["$!"]():Qa)?k(n,"Opal")["$coerce_to!"](F,k(n,"Rational"),"to_r"):u(u(Sa=k(n,"Numeric")["$==="](F))?k(n,"Numeric")["$==="](V):Sa)?J(F,V):this.$reduce(F,V)},D.$$arity=2);a.def(l,"$initialize",R=function(F,V){this.num=F;return this.den= +V},R.$$arity=2);a.def(l,"$numerator",ja=function(){return this.num},ja.$$arity=0);a.def(l,"$denominator",da=function(){return this.den},da.$$arity=0);a.def(l,"$coerce",ma=function(F){return k(n,"Rational")["$==="](F)?[F,this]:k(n,"Integer")["$==="](F)?[F.$to_r(),this]:k(n,"Float")["$==="](F)?[F,this.$to_f()]:H},ma.$$arity=1);a.def(l,"$==",b=function(F){var V=H,ka=H;return k(n,"Rational")["$==="](F)?u(V=this.num["$=="](F.$numerator()))?this.den["$=="](F.$denominator()):V:k(n,"Integer")["$==="](F)? +u(ka=this.num["$=="](F))?this.den["$=="](1):ka:k(n,"Float")["$==="](F)?this.$to_f()["$=="](F):F["$=="](this)},b.$$arity=1);a.def(l,"$<=>",h=function(F){return k(n,"Rational")["$==="](F)?t(w(this.num,F.$denominator()),w(this.den,F.$numerator()))["$<=>"](0):k(n,"Integer")["$==="](F)?t(this.num,w(this.den,F))["$<=>"](0):k(n,"Float")["$==="](F)?this.$to_f()["$<=>"](F):this.$__coerced__("<=>",F)},h.$$arity=1);a.def(l,"$+",f=function(F){if(k(n,"Rational")["$==="](F)){var V=z(w(this.num,F.$denominator()), +w(this.den,F.$numerator()));F=w(this.den,F.$denominator());V=this.$Rational(V,F)}else V=k(n,"Integer")["$==="](F)?this.$Rational(z(this.num,w(F,this.den)),this.den):k(n,"Float")["$==="](F)?z(this.$to_f(),F):this.$__coerced__("+",F);return V},f.$$arity=1);a.def(l,"$-",q=function(F){if(k(n,"Rational")["$==="](F)){var V=t(w(this.num,F.$denominator()),w(this.den,F.$numerator()));F=w(this.den,F.$denominator());V=this.$Rational(V,F)}else V=k(n,"Integer")["$==="](F)?this.$Rational(t(this.num,w(F,this.den)), +this.den):k(n,"Float")["$==="](F)?t(this.$to_f(),F):this.$__coerced__("-",F);return V},q.$$arity=1);a.def(l,"$*",A=function(F){if(k(n,"Rational")["$==="](F)){var V=w(this.num,F.$numerator());F=w(this.den,F.$denominator());V=this.$Rational(V,F)}else V=k(n,"Integer")["$==="](F)?this.$Rational(w(this.num,F),this.den):k(n,"Float")["$==="](F)?w(this.$to_f(),F):this.$__coerced__("*",F);return V},A.$$arity=1);a.def(l,"$/",E=function(F){if(k(n,"Rational")["$==="](F)){var V=w(this.num,F.$denominator());F= +w(this.den,F.$numerator());V=this.$Rational(V,F)}else V=k(n,"Integer")["$==="](F)?F["$=="](0)?J(this.$to_f(),0):this.$Rational(this.num,w(this.den,F)):k(n,"Float")["$==="](F)?J(this.$to_f(),F):this.$__coerced__("/",F);return V},E.$$arity=1);a.def(l,"$**",G=function(F){var V=H,ka=H;return k(n,"Integer")["$==="](F)?u(u(V=this["$=="](0))?y(F,0):V)?x(k(n,"Float"),"INFINITY"):u("number"===typeof F?0"](0))?this.$Rational(this.num["$**"](F),this.den["$**"](F)):u(y(F,0))?this.$Rational(this.den["$**"](F["$-@"]()), +this.num["$**"](F["$-@"]())):this.$Rational(1,1):k(n,"Float")["$==="](F)?this.$to_f()["$**"](F):k(n,"Rational")["$==="](F)?F["$=="](0)?this.$Rational(1,1):F.$denominator()["$=="](1)?u(y(F,0))?this.$Rational(this.den["$**"](F.$numerator().$abs()),this.num["$**"](F.$numerator().$abs())):this.$Rational(this.num["$**"](F.$numerator()),this.den["$**"](F.$numerator())):u(u(ka=this["$=="](0))?y(F,0):ka)?this.$raise(k(n,"ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](F):this.$__coerced__("**",F)}, +G.$$arity=1);a.def(l,"$abs",M=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},M.$$arity=0);a.def(l,"$ceil",ba=function(F){null==F&&(F=0);return F["$=="](0)?J(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",F)},ba.$$arity=-1);a.alias(l,"divide","/");a.def(l,"$floor",ua=function(F){null==F&&(F=0);return F["$=="](0)?J(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",F)},ua.$$arity=-1);a.def(l,"$hash",Oa=function(){return"Rational:"+ +this.num+":"+this.den},Oa.$$arity=0);a.def(l,"$inspect",xa=function(){return"("+this+")"},xa.$$arity=0);a.alias(l,"quo","/");a.def(l,"$rationalize",Ba=function(F){1 $to_f $nil? $> $< $strftime $year $month $day $+ $round $/ $- $copy_instance_variables $initialize_dup $is_a? $zero? $wday $utc? $mon $yday $hour $min $sec $rjust $ljust $zone $to_s $[] $cweek_cyear $isdst $<= $!= $== $ceil".split(" ")); +z.$require("corelib/comparable");return function(c,$super,I){function e(Aa,ta,Ma,Ta,Za,Fa){Aa=Aa.$$is_string?parseInt(Aa,10):H(L,"Opal")["$coerce_to!"](Aa,H(L,"Integer"),"to_int");if(ta===d)ta=1;else if(!ta.$$is_number)if(ta["$respond_to?"]("to_str"))switch(ta=ta.$to_str(),ta.toLowerCase()){case "jan":ta=1;break;case "feb":ta=2;break;case "mar":ta=3;break;case "apr":ta=4;break;case "may":ta=5;break;case "jun":ta=6;break;case "jul":ta=7;break;case "aug":ta=8;break;case "sep":ta=9;break;case "oct":ta= +10;break;case "nov":ta=11;break;case "dec":ta=12;break;default:ta=ta.$to_i()}else ta=H(L,"Opal")["$coerce_to!"](ta,H(L,"Integer"),"to_int");(1>ta||12Ma||31Ta||24Za||59Fa||60Aa&&ta.setFullYear(Aa);return ta},R.$$arity=-1);a.defs(n,"$local",ja=function(Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T){null==ta&&(ta=d);null==Ma&&(Ma=d);null==Ta&&(Ta=d);null==Za&&(Za=d);null==Fa&&(Fa=d);null==Y&&(Y=d);null==Q&&(Q=d);null==Z&&(Z=d);null==T&&(T=d);if(10===arguments.length){var fa= +x.call(arguments);Aa=fa[5];ta=fa[4];Ma=fa[3];Ta=fa[2];Za=fa[1];Fa=fa[0]}fa=e(Aa,ta,Ma,Ta,Za,Fa);Aa=fa[0];ta=fa[1];Ma=fa[2];Ta=fa[3];Za=fa[4];Fa=fa[5];fa=new Date(Aa,ta,Ma,Ta,Za,0,1E3*Fa);100>Aa&&fa.setFullYear(Aa);return fa},ja.$$arity=-2);a.defs(n,"$gm",da=function(Aa,ta,Ma,Ta,Za,Fa,Y,Q,Z,T){null==ta&&(ta=d);null==Ma&&(Ma=d);null==Ta&&(Ta=d);null==Za&&(Za=d);null==Fa&&(Fa=d);null==Y&&(Y=d);null==Q&&(Q=d);null==Z&&(Z=d);null==T&&(T=d);if(10===arguments.length){var fa=x.call(arguments);Aa=fa[5];ta= +fa[4];Ma=fa[3];Ta=fa[2];Za=fa[1];Fa=fa[0]}fa=e(Aa,ta,Ma,Ta,Za,Fa);Aa=fa[0];ta=fa[1];Ma=fa[2];Ta=fa[3];Za=fa[4];Fa=fa[5];fa=new Date(Date.UTC(Aa,ta,Ma,Ta,Za,0,1E3*Fa));100>Aa&&fa.setUTCFullYear(Aa);fa.is_utc=!0;return fa},da.$$arity=-2);(function(Aa,ta){[Aa].concat(ta);a.alias(Aa,"mktime","local");return a.alias(Aa,"utc","gm")})(a.get_singleton_class(n),L);a.defs(n,"$now",ma=function(){return this.$new()},ma.$$arity=0);a.def(n,"$+",b=function(Aa){m(H(L,"Time")["$==="](Aa))&&this.$raise(H(L,"TypeError"), +"time + time?");Aa.$$is_number||(Aa=H(L,"Opal")["$coerce_to!"](Aa,H(L,"Integer"),"to_int"));Aa=new Date(this.getTime()+1E3*Aa);Aa.is_utc=this.is_utc;return Aa},b.$$arity=1);a.def(n,"$-",h=function(Aa){if(m(H(L,"Time")["$==="](Aa)))return(this.getTime()-Aa.getTime())/1E3;Aa.$$is_number||(Aa=H(L,"Opal")["$coerce_to!"](Aa,H(L,"Integer"),"to_int"));Aa=new Date(this.getTime()-1E3*Aa);Aa.is_utc=this.is_utc;return Aa},h.$$arity=1);a.def(n,"$<=>",f=function(Aa){if(m(H(L,"Time")["$==="](Aa)))return this.$to_f()["$<=>"](Aa.$to_f()); +Aa=Aa["$<=>"](this);return m(Aa["$nil?"]())?d:m("number"===typeof Aa?0"](0))?-1:m("number"===typeof Aa?0>Aa:Aa["$<"](0))?1:0},f.$$arity=1);a.def(n,"$==",q=function(Aa){var ta;return m(ta=H(L,"Time")["$==="](Aa))?this.$to_f()===Aa.$to_f():ta},q.$$arity=1);a.def(n,"$asctime",A=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},A.$$arity=0);a.alias(n,"ctime","asctime");a.def(n,"$day",E=function(){return this.is_utc?this.getUTCDate():this.getDate()},E.$$arity=0);a.def(n,"$yday",G=function(){var Aa= +H(L,"Time").$new(this.$year()).$to_i();var ta=H(L,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i();return y(J(t(ta,Aa),86400).$round(),1)},G.$$arity=0);a.def(n,"$isdst",M=function(){var Aa=new Date(this.getFullYear(),0,1),ta=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()"](Aa)["$zero?"]():ta},ua.$$arity=1);a.def(n,"$friday?",Oa=function(){return 5==this.$wday()},Oa.$$arity=0);a.def(n,"$hash",xa=function(){return"Time:"+this.getTime()},xa.$$arity=0);a.def(n,"$hour",Ba=function(){return this.is_utc?this.getUTCHours():this.getHours()},Ba.$$arity=0);a.def(n,"$inspect",La=function(){return m(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")}, +La.$$arity=0);a.alias(n,"mday","day");a.def(n,"$min",na=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},na.$$arity=0);a.def(n,"$mon",S=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},S.$$arity=0);a.def(n,"$monday?",sa=function(){return 1==this.$wday()},sa.$$arity=0);a.alias(n,"month","mon");a.def(n,"$saturday?",ya=function(){return 6==this.$wday()},ya.$$arity=0);a.def(n,"$sec",pa=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},pa.$$arity= +0);a.def(n,"$succ",ea=function(){var Aa=new Date(this.getTime()+1E3);Aa.is_utc=this.is_utc;return Aa},ea.$$arity=0);a.def(n,"$usec",F=function(){return 1E3*this.getMilliseconds()},F.$$arity=0);a.def(n,"$zone",V=function(){var Aa=this.toString();var ta=-1==Aa.indexOf("(")?Aa.match(/[A-Z]{3,4}/)[0]:Aa.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==ta&&/(GMT\W*\d{4})/.test(Aa)?RegExp.$1:ta},V.$$arity=0);a.def(n,"$getgm",ka=function(){var Aa=new Date(this.getTime());Aa.is_utc=!0;return Aa},ka.$$arity=0);a.alias(n, +"getutc","getgm");a.def(n,"$gmtime",va=function(){this.is_utc=!0;return this},va.$$arity=0);a.alias(n,"utc","gmtime");a.def(n,"$gmt?",ia=function(){return!0===this.is_utc},ia.$$arity=0);a.def(n,"$gmt_offset",wa=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},wa.$$arity=0);a.def(n,"$strftime",Ha=function(Aa){var ta=this;return Aa.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(Ma,Ta,Za,Fa,Y){Fa="";var Q=-1!==Ta.indexOf("0"),Z=-1===Ta.indexOf("-"),T=-1!==Ta.indexOf("_"),fa=-1!== +Ta.indexOf("^"),la=-1!==Ta.indexOf("#"),g=(Ta.match(":")||[]).length;Za=parseInt(Za,10);Q&&T&&(Ta.indexOf("0")Ma?"+":"-")+(10>Ta?"0":"")+Ta;0Y?"0":"";Fa+=Y;1I:l["$>"](I)}function J(l,I){return"number"===typeof l&&"number"===typeof I?l-I:l["$-"](I)}function t(l,I){return"number"===typeof l&&"number"===typeof I?l=I:l["$>="](I)}function z(l,I){return"number"===typeof l&&"number"===typeof I?l+I:l["$+"](I)}var p=a.top,d=[],H=a.nil,x=a.$$,k=a.klass,m=a.hash2,u=a.truthy,c=a.send; a.add_stubs("$require $include $const_name! $unshift $map $coerce_to! $new $each $define_struct_attribute $allocate $initialize $alias_method $module_eval $to_proc $const_set $== $raise $<< $members $define_method $instance_eval $class $last $> $length $- $keys $any? $join $[] $[]= $each_with_index $hash $=== $< $-@ $size $>= $include? $to_sym $instance_of? $__id__ $eql? $enum_for $name $+ $each_pair $inspect $to_h $args $each_with_object $flatten $to_a $respond_to? $dig".split(" "));p.$require("corelib/enumerable"); -return function(l,$super,e){l=k(l,$super,"Struct");var n=[l].concat(e),J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka;l.$include(x(n,"Enumerable"));a.defs(l,"$new",J=function(na,S,ta){var ja=J.$$p,oa=ja||G,V,Q;var Y=G;ja&&(J.$$p=null);ja&&(J.$$p=null);var pa=a.slice.call(arguments,1,arguments.length);Y=a.extract_kwargs(pa);if(null==Y)Y=m([],{});else if(!Y.$$is_hash)throw a.ArgumentError.$new("expected kwargs");ja=Y.$$smap.keyword_init;null==ja&&(ja=!1);if(u(na))try{na=x(n,"Opal")["$const_name!"](na)}catch(za){if(a.rescue(za, -[x(n,"TypeError"),x(n,"NameError")]))try{pa.$unshift(na),na=G}finally{a.pop_exception()}else throw za;}c(pa,"map",[],(V=function(za){null==za&&(za=G);return x(n,"Opal")["$coerce_to!"](za,x(n,"String"),"to_str")},V.$$s=this,V.$$arity=1,V));Y=c(x(n,"Class"),"new",[this],(Q=function(){var za=null==Q.$$s?this:Q.$$s,la;c(pa,"each",[],(la=function(xa){var Ea=null==la.$$s?this:la.$$s;null==xa&&(xa=G);return Ea.$define_struct_attribute(xa)},la.$$s=za,la.$$arity=1,la));return function(xa,Ea){[xa].concat(Ea); -var Fa;a.def(xa,"$new",Fa=function(Sa){var Ra=a.slice.call(arguments,0,arguments.length);var Na=this.$allocate();Na.$$data={};c(Na,"initialize",a.to_a(Ra));return Na},Fa.$$arity=-1);return xa.$alias_method("[]","new")}(a.get_singleton_class(za),n)},Q.$$s=this,Q.$$arity=0,Q));u(oa)&&c(Y,"module_eval",[],oa.$to_proc());Y.$$keyword_init=ja;u(na)&&x(n,"Struct").$const_set(na,Y);return Y},J.$$arity=-2);a.defs(l,"$define_struct_attribute",D=function(na){var S,ta;this["$=="](x(n,"Struct"))&&this.$raise(x(n, -"ArgumentError"),"you cannot define attributes to the Struct class");this.$members()["$<<"](na);c(this,"define_method",[na],(S=function(){return(null==S.$$s?this:S.$$s).$$data[na]},S.$$s=this,S.$$arity=0,S));return c(this,"define_method",[""+na+"="],(ta=function(ja){var oa=null==ta.$$s?this:ta.$$s;null==ja&&(ja=G);return oa.$$data[na]=ja},ta.$$s=this,ta.$$arity=1,ta))},D.$$arity=1);a.defs(l,"$members",R=function(){var na=G;null==this.members&&(this.members=G);this["$=="](x(n,"Struct"))&&this.$raise(x(n, -"ArgumentError"),"the Struct class has no members");return this.members=u(na=this.members)?na:[]},R.$$arity=0);a.defs(l,"$inherited",ia=function(na){var S,ta=G;null==this.members&&(this.members=G);ta=this.members;return c(na,"instance_eval",[],(S=function(){return(null==S.$$s?this:S.$$s).members=ta},S.$$s=this,S.$$arity=0,S))},ia.$$arity=1);a.def(l,"$initialize",ea=function(na){var S,ta,ja=G,oa=G,V=G,Q=G;var Y=a.slice.call(arguments,0,arguments.length);if(u(this.$class().$$keyword_init))return ja= -u(oa=Y.$last())?oa:m([],{}),u(u(V=y(Y.$length(),1))?V:1===Y.length&&!ja.$$is_hash)&&this.$raise(x(n,"ArgumentError"),"wrong number of arguments (given "+Y.$length()+", expected 0)"),Q=K(ja.$keys(),this.$class().$members()),u(Q["$any?"]())&&this.$raise(x(n,"ArgumentError"),"unknown keywords: "+Q.$join(", ")),c(this.$class().$members(),"each",[],(S=function(pa){var za=null==S.$$s?this:S.$$s;null==pa&&(pa=G);pa=[pa,ja["$[]"](pa)];c(za,"[]=",a.to_a(pa));return pa[K(pa.length,1)]},S.$$s=this,S.$$arity= -1,S));u(y(Y.$length(),this.$class().$members().$length()))&&this.$raise(x(n,"ArgumentError"),"struct size differs");return c(this.$class().$members(),"each_with_index",[],(ta=function(pa,za){var la=null==ta.$$s?this:ta.$$s;null==pa&&(pa=G);null==za&&(za=G);pa=[pa,Y["$[]"](za)];c(la,"[]=",a.to_a(pa));return pa[K(pa.length,1)]},ta.$$s=this,ta.$$arity=2,ta))},ea.$$arity=-1);a.def(l,"$initialize_copy",ma=function(na){this.$$data={};var S=Object.keys(na.$$data),ta;var ja=0;for(ta=S.length;ja")},Oa.$$arity=0);a.alias(l,"to_s","inspect");a.def(l,"$to_h",wa=function(){var na= -wa.$$p,S=na||G,ta;na&&(wa.$$p=null);na&&(wa.$$p=null);return S!==G?c(c(this,"map",[],S.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[m([],{})],(ta=function(ja,oa){var V=null==ta.$$s?this:ta.$$s;null==ja&&(ja=G);null==oa&&(oa=G);ja=[ja,V["$[]"](ja)];c(oa,"[]=",a.to_a(ja));return ja[K(ja.length,1)]},ta.$$s=this,ta.$$arity=2,ta))},wa.$$arity=0);a.def(l,"$values_at",Ba=function(na){var S;var ta=a.slice.call(arguments,0,arguments.length);ta=c(ta,"map",[],(S=function(V){null== -V&&(V=G);return V.$$is_range?V.$to_a():V},S.$$s=this,S.$$arity=1,S)).$flatten();S=[];for(var ja=0,oa=ta.length;jaia:ia["$<"](0))&&this.$raise(t(k,"ArgumentError"),"negative string size (or size too big)");return p(t(k,"Array"),"new",[ia],(ea=function(){return(null==ea.$$s?this:ea.$$s).$rand(255).$chr()},ea.$$s=this,ea.$$arity=0,ea)).$join().$encode("ASCII-8BIT")},e.$$arity=1);a.def(d,"$==",n=function(ia){var ea;return A(t(k,"Random")["$==="](ia))?A(ea=this.$seed()["$=="](ia.$seed()))? -this.$state()["$=="](ia.$state()):ea:!1},n.$$arity=1);a.def(d,"$bytes",J=function(ia){var ea;ia=t(k,"Opal")["$coerce_to!"](ia,t(k,"Integer"),"to_int");return p(t(k,"Array"),"new",[ia],(ea=function(){return(null==ea.$$s?this:ea.$$s).$rand(255).$chr()},ea.$$s=this,ea.$$arity=0,ea)).$join().$encode("ASCII-8BIT")},J.$$arity=1);a.def(d,"$rand",D=function(ia){function ea(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var h=ia.begin,f=ia.end;if(h===K||f===K)return K;var q=f-h;if(0>q)return K;if(0=== -q)return h;0!==f%1||0!==h%1||ia.excl||q++;return b.$rand(q)+h}var b=this;if(null==ia)return ea();if(ia.$$is_range)return ma();if(ia.$$is_number)return 0>=ia&&b.$raise(t(k,"ArgumentError"),"invalid argument - "+ia),0===ia%1?Math.floor(ea()*ia):ea()*ia;ia=t(k,"Opal")["$coerce_to!"](ia,t(k,"Integer"),"to_int");0>=ia&&b.$raise(t(k,"ArgumentError"),"invalid argument - "+ia);return Math.floor(ea()*ia)},D.$$arity=-1);return(a.defs(d,"$generator=",R=function(ia){a.$$rand=ia;return A(this["$const_defined?"]("DEFAULT"))? -t(k,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},R.$$arity=1),K)&&"generator="}(y[0],null,y)}; -Opal.modules["corelib/random/mersenne_twister"]=function(a){function y(G,x){return"number"===typeof G&&"number"===typeof x?G-x:G["$-"](x)}var K=[],t=a.nil,w=a.$$,A=a.klass,p=a.send,d=t;a.add_stubs(["$generator=","$-"]);d=function(){function G(k,m){return(k&2147483648|m&2147483647)>>>1^(m&1?2567483615:0)}function x(k){if(0>=--k.left){var m=0,u=k.state,c;k.left=624;k.next=0;for(c=228;--c;m++)u[m]=u[m+397]^G(u[m+0],u[m+1]);for(c=397;--c;m++)u[m]=u[m+-227]^G(u[m+0],u[m+1]);u[m]=u[m+-227]^G(u[m+0],u[0])}k= -k.state[k.next++];k^=k>>>11;k^=k<<7&2636928640;k^=k<<15&4022730752;return(k^k>>>18)>>>0}return{genrand_real:function(k){var m=x(k);k=x(k);return 1.1102230246251565E-16*(67108864*(m>>>5)+(k>>>6))},init:function(k){var m={left:0,next:624,state:Array(624)};m.state[0]=k>>>0;for(k=1;624>k;k++)m.state[k]=1812433253*(m.state[k-1]^m.state[k-1]>>30>>>0)+k,m.state[k]&=4294967295;m.left=1;m.next=624;return m}}}();return function(G,$super,k){G=A(G,$super,"Random");k=[G].concat(k);var m=t,u=Number.MAX_SAFE_INTEGER|| -Math.pow(2,53)-1;a.const_set(k[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*u)},reseed:function(c){return d.init(c)},rand:function(c){return d.genrand_real(c)}});m=[w(k,"MERSENNE_TWISTER_GENERATOR")];p(G,"generator=",a.to_a(m));return m[y(m.length,1)]}(K[0],null,K)}; -Opal.modules["corelib/unsupported"]=function(a){function y(m){switch(a.config.unsupported_features_severity){case "error":d(A,"Kernel").$raise(d(A,"NotImplementedError"),m);break;case "warning":k[m]||(k[m]=!0,w.$warn(m))}}var K,t,w=a.top,A=[],p=a.nil,d=a.$$,G=a.klass,x=a.module;a.add_stubs(["$raise","$warn","$%"]);var k={};(function(m,$super,c){m=G(m,$super,"String");var l=[m].concat(c),H,e,n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka;a.def(m,"$<<",H=function(na){a.slice.call(arguments,0,arguments.length); -return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},H.$$arity=-1);a.def(m,"$capitalize!",e=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},e.$$arity=-1);a.def(m,"$chomp!",n=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"), -"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},n.$$arity=-1);a.def(m,"$chop!",J=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},J.$$arity=-1);a.def(m,"$downcase!",D=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, -D.$$arity=-1);a.def(m,"$gsub!",R=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},R.$$arity=-1);a.def(m,"$lstrip!",ia=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ia.$$arity=-1);a.def(m,"$next!",ea=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},ea.$$arity=-1);a.def(m,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},ma.$$arity=-1);a.def(m,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l, +this.$raise(x(n,"TypeError"),"no implicit conversion of "+na.$class()+" into Integer");na=x(n,"Opal")["$coerce_to!"](na,x(n,"String"),"to_str");return this.$$data[na]=S},q.$$arity=2);a.def(l,"$==",A=function(na){function S(pa,ea){var F;sa[pa.$__id__()]=!0;ya[ea.$__id__()]=!0;for(F in pa.$$data){var V=pa.$$data[F];var ka=ea.$$data[F];if(x(n,"Struct")["$==="](V)){if(!(sa.hasOwnProperty(V.$__id__())&&ya.hasOwnProperty(ka.$__id__())||S(V,ka)))return!1}else if(!V["$=="](ka))return!1}return!0}if(!u(na["$instance_of?"](this.$class())))return!1; +var sa={},ya={};return S(this,na)},A.$$arity=1);a.def(l,"$eql?",E=function(na){function S(pa,ea){var F;sa[pa.$__id__()]=!0;ya[ea.$__id__()]=!0;for(F in pa.$$data){var V=pa.$$data[F];var ka=ea.$$data[F];if(x(n,"Struct")["$==="](V)){if(!(sa.hasOwnProperty(V.$__id__())&&ya.hasOwnProperty(ka.$__id__())||S(V,ka)))return!1}else if(!V["$eql?"](ka))return!1}return!0}if(!u(na["$instance_of?"](this.$class())))return!1;var sa={},ya={};return S(this,na)},E.$$arity=1);a.def(l,"$each",G=function(){var na,S,sa= +G.$$p,ya=sa||H;sa&&(G.$$p=null);if(ya===H)return c(this,"enum_for",["each"],(na=function(){return(null==na.$$s?this:na.$$s).$size()},na.$$s=this,na.$$arity=0,na));c(this.$class().$members(),"each",[],(S=function(pa){var ea=null==S.$$s?this:S.$$s;null==pa&&(pa=H);return a.yield1(ya,ea["$[]"](pa))},S.$$s=this,S.$$arity=1,S));return this},G.$$arity=0);a.def(l,"$each_pair",M=function(){var na,S,sa=M.$$p,ya=sa||H;sa&&(M.$$p=null);if(ya===H)return c(this,"enum_for",["each_pair"],(na=function(){return(null== +na.$$s?this:na.$$s).$size()},na.$$s=this,na.$$arity=0,na));c(this.$class().$members(),"each",[],(S=function(pa){var ea=null==S.$$s?this:S.$$s;null==pa&&(pa=H);return a.yield1(ya,[pa,ea["$[]"](pa)])},S.$$s=this,S.$$arity=1,S));return this},M.$$arity=0);a.def(l,"$length",ba=function(){return this.$class().$members().$length()},ba.$$arity=0);a.alias(l,"size","length");a.def(l,"$to_a",ua=function(){var na;return c(this.$class().$members(),"map",[],(na=function(S){var sa=null==na.$$s?this:na.$$s;null== +S&&(S=H);return sa["$[]"](S)},na.$$s=this,na.$$arity=1,na))},ua.$$arity=0);a.alias(l,"values","to_a");a.def(l,"$inspect",Oa=function(){var na,S=H,sa=H;S="#")},Oa.$$arity=0);a.alias(l,"to_s","inspect");a.def(l,"$to_h",xa= +function(){var na=xa.$$p,S=na||H,sa;na&&(xa.$$p=null);na&&(xa.$$p=null);return S!==H?c(c(this,"map",[],S.$to_proc()),"to_h",a.to_a(this.$args())):c(this.$class().$members(),"each_with_object",[m([],{})],(sa=function(ya,pa){var ea=null==sa.$$s?this:sa.$$s;null==ya&&(ya=H);null==pa&&(pa=H);ya=[ya,ea["$[]"](ya)];c(pa,"[]=",a.to_a(ya));return ya[J(ya.length,1)]},sa.$$s=this,sa.$$arity=2,sa))},xa.$$arity=0);a.def(l,"$values_at",Ba=function(na){var S;var sa=a.slice.call(arguments,0,arguments.length);sa= +c(sa,"map",[],(S=function(ea){null==ea&&(ea=H);return ea.$$is_range?ea.$to_a():ea},S.$$s=this,S.$$arity=1,S)).$flatten();S=[];for(var ya=0,pa=sa.length;yaja:ja["$<"](0))&&this.$raise(t(k,"ArgumentError"),"negative string size (or size too big)");return p(t(k,"Array"),"new",[ja],(da=function(){return(null==da.$$s?this:da.$$s).$rand(255).$chr()},da.$$s=this,da.$$arity=0,da)).$join().$encode("ASCII-8BIT")},e.$$arity=1);a.def(d,"$==",n=function(ja){var da;return z(t(k,"Random")["$==="](ja))?z(da=this.$seed()["$=="](ja.$seed()))? +this.$state()["$=="](ja.$state()):da:!1},n.$$arity=1);a.def(d,"$bytes",L=function(ja){var da;ja=t(k,"Opal")["$coerce_to!"](ja,t(k,"Integer"),"to_int");return p(t(k,"Array"),"new",[ja],(da=function(){return(null==da.$$s?this:da.$$s).$rand(255).$chr()},da.$$s=this,da.$$arity=0,da)).$join().$encode("ASCII-8BIT")},L.$$arity=1);a.def(d,"$rand",D=function(ja){function da(){b.state++;return a.$$rand.rand(b.$rng)}function ma(){var h=ja.begin,f=ja.end;if(h===J||f===J)return J;var q=f-h;if(0>q)return J;if(0=== +q)return h;0!==f%1||0!==h%1||ja.excl||q++;return b.$rand(q)+h}var b=this;if(null==ja)return da();if(ja.$$is_range)return ma();if(ja.$$is_number)return 0>=ja&&b.$raise(t(k,"ArgumentError"),"invalid argument - "+ja),0===ja%1?Math.floor(da()*ja):da()*ja;ja=t(k,"Opal")["$coerce_to!"](ja,t(k,"Integer"),"to_int");0>=ja&&b.$raise(t(k,"ArgumentError"),"invalid argument - "+ja);return Math.floor(da()*ja)},D.$$arity=-1);return(a.defs(d,"$generator=",R=function(ja){a.$$rand=ja;return z(this["$const_defined?"]("DEFAULT"))? +t(k,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},R.$$arity=1),J)&&"generator="}(y[0],null,y)}; +Opal.modules["corelib/random/mersenne_twister"]=function(a){function y(H,x){return"number"===typeof H&&"number"===typeof x?H-x:H["$-"](x)}var J=[],t=a.nil,w=a.$$,z=a.klass,p=a.send,d=t;a.add_stubs(["$generator=","$-"]);d=function(){function H(k,m){return(k&2147483648|m&2147483647)>>>1^(m&1?2567483615:0)}function x(k){if(0>=--k.left){var m=0,u=k.state,c;k.left=624;k.next=0;for(c=228;--c;m++)u[m]=u[m+397]^H(u[m+0],u[m+1]);for(c=397;--c;m++)u[m]=u[m+-227]^H(u[m+0],u[m+1]);u[m]=u[m+-227]^H(u[m+0],u[0])}k= +k.state[k.next++];k^=k>>>11;k^=k<<7&2636928640;k^=k<<15&4022730752;return(k^k>>>18)>>>0}return{genrand_real:function(k){var m=x(k);k=x(k);return 1.1102230246251565E-16*(67108864*(m>>>5)+(k>>>6))},init:function(k){var m={left:0,next:624,state:Array(624)};m.state[0]=k>>>0;for(k=1;624>k;k++)m.state[k]=1812433253*(m.state[k-1]^m.state[k-1]>>30>>>0)+k,m.state[k]&=4294967295;m.left=1;m.next=624;return m}}}();return function(H,$super,k){H=z(H,$super,"Random");k=[H].concat(k);var m=t,u=Number.MAX_SAFE_INTEGER|| +Math.pow(2,53)-1;a.const_set(k[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*u)},reseed:function(c){return d.init(c)},rand:function(c){return d.genrand_real(c)}});m=[w(k,"MERSENNE_TWISTER_GENERATOR")];p(H,"generator=",a.to_a(m));return m[y(m.length,1)]}(J[0],null,J)}; +Opal.modules["corelib/unsupported"]=function(a){function y(m){switch(a.config.unsupported_features_severity){case "error":d(z,"Kernel").$raise(d(z,"NotImplementedError"),m);break;case "warning":k[m]||(k[m]=!0,w.$warn(m))}}var J,t,w=a.top,z=[],p=a.nil,d=a.$$,H=a.klass,x=a.module;a.add_stubs(["$raise","$warn","$%"]);var k={};(function(m,$super,c){m=H(m,$super,"String");var l=[m].concat(c),I,e,n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La;a.def(m,"$<<",I=function(na){a.slice.call(arguments,0,arguments.length); +return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("<<"))},I.$$arity=-1);a.def(m,"$capitalize!",e=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("capitalize!"))},e.$$arity=-1);a.def(m,"$chomp!",n=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"), +"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chomp!"))},n.$$arity=-1);a.def(m,"$chop!",L=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("chop!"))},L.$$arity=-1);a.def(m,"$downcase!",D=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("downcase!"))}, +D.$$arity=-1);a.def(m,"$gsub!",R=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("gsub!"))},R.$$arity=-1);a.def(m,"$lstrip!",ja=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("lstrip!"))},ja.$$arity=-1);a.def(m,"$next!",da=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("next!"))},da.$$arity=-1);a.def(m,"$reverse!",ma=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("reverse!"))},ma.$$arity=-1);a.def(m,"$slice!",b=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l, "NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("slice!"))},b.$$arity=-1);a.def(m,"$squeeze!",h=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("squeeze!"))},h.$$arity=-1);a.def(m,"$strip!",f=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("strip!"))}, -f.$$arity=-1);a.def(m,"$sub!",q=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},q.$$arity=-1);a.def(m,"$succ!",z=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},z.$$arity=-1);a.def(m,"$swapcase!",E=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},E.$$arity=-1);a.def(m,"$tr!",F=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},F.$$arity=-1);a.def(m,"$tr_s!",L=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l, -"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},L.$$arity=-1);a.def(m,"$upcase!",ca=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},ca.$$arity=-1);a.def(m,"$prepend",va=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, -va.$$arity=-1);a.def(m,"$[]=",Oa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Oa.$$arity=-1);a.def(m,"$clear",wa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},wa.$$arity=-1);a.def(m,"$encode!",Ba=function(na){a.slice.call(arguments, -0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Ba.$$arity=-1);return(a.def(m,"$unicode_normalize!",Ka=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},Ka.$$arity=-1),p)&&"unicode_normalize!"})(A[0],null,A);(function(m,u){m=x(m, -"Kernel");[m].concat(u);var c,l;a.def(m,"$freeze",c=function(){y("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(m,"$frozen?",l=function(){y("Object freezing is not supported by Opal");return!1},l.$$arity=0)})(A[0],A);(function(m,u){m=x(m,"Kernel");[m].concat(u);var c,l,H;a.def(m,"$taint",c=function(){y("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(m,"$untaint",l=function(){y("Object tainting is not supported by Opal");return this},l.$$arity= -0);a.def(m,"$tainted?",H=function(){y("Object tainting is not supported by Opal");return!1},H.$$arity=0)})(A[0],A);(function(m,$super,c){m=G(m,$super,"Module");[m].concat(c);var l,H,e,n;a.def(m,"$public",l=function(J){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return p},l.$$arity=-1);a.alias(m,"private","public");a.alias(m,"protected","public");a.alias(m,"nesting","public");a.def(m,"$private_class_method",H=function(J){a.slice.call(arguments,0,arguments.length); -return this},H.$$arity=-1);a.alias(m,"public_class_method","private_class_method");a.def(m,"$private_method_defined?",e=function(){return!1},e.$$arity=1);a.def(m,"$private_constant",n=function(J){a.slice.call(arguments,0,arguments.length);return p},n.$$arity=-1);a.alias(m,"protected_method_defined?","private_method_defined?");a.alias(m,"public_instance_methods","instance_methods");a.alias(m,"public_instance_method","instance_method");return a.alias(m,"public_method_defined?","method_defined?")})(A[0], -null,A);(function(m,u){m=x(m,"Kernel");[m].concat(u);var c;a.def(m,"$private_methods",c=function(l){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(m,"private_instance_methods","private_methods")})(A[0],A);(function(m,u){m=x(m,"Kernel");var c=[m].concat(u),l;a.def(m,"$eval",l=function(H){a.slice.call(arguments,0,arguments.length);return this.$raise(d(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ -(d(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},l.$$arity=-1)})(A[0],A);a.defs(w,"$public",K=function(m){a.slice.call(arguments,0,arguments.length);return p},K.$$arity=-1);return(a.defs(w,"$private",t=function(m){a.slice.call(arguments,0,arguments.length);return p},t.$$arity=-1),p)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); +f.$$arity=-1);a.def(m,"$sub!",q=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("sub!"))},q.$$arity=-1);a.def(m,"$succ!",A=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("succ!"))},A.$$arity=-1);a.def(m,"$swapcase!",E=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("swapcase!"))},E.$$arity=-1);a.def(m,"$tr!",G=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr!"))},G.$$arity=-1);a.def(m,"$tr_s!",M=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l, +"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("tr_s!"))},M.$$arity=-1);a.def(m,"$upcase!",ba=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("upcase!"))},ba.$$arity=-1);a.def(m,"$prepend",ua=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("prepend"))}, +ua.$$arity=-1);a.def(m,"$[]=",Oa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("[]="))},Oa.$$arity=-1);a.def(m,"$clear",xa=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("clear"))},xa.$$arity=-1);a.def(m,"$encode!",Ba=function(na){a.slice.call(arguments, +0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("encode!"))},Ba.$$arity=-1);return(a.def(m,"$unicode_normalize!",La=function(na){a.slice.call(arguments,0,arguments.length);return this.$raise(d(l,"NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"]("unicode_normalize!"))},La.$$arity=-1),p)&&"unicode_normalize!"})(z[0],null,z);(function(m,u){m=x(m, +"Kernel");[m].concat(u);var c,l;a.def(m,"$freeze",c=function(){y("Object freezing is not supported by Opal");return this},c.$$arity=0);a.def(m,"$frozen?",l=function(){y("Object freezing is not supported by Opal");return!1},l.$$arity=0)})(z[0],z);(function(m,u){m=x(m,"Kernel");[m].concat(u);var c,l,I;a.def(m,"$taint",c=function(){y("Object tainting is not supported by Opal");return this},c.$$arity=0);a.def(m,"$untaint",l=function(){y("Object tainting is not supported by Opal");return this},l.$$arity= +0);a.def(m,"$tainted?",I=function(){y("Object tainting is not supported by Opal");return!1},I.$$arity=0)})(z[0],z);(function(m,$super,c){m=H(m,$super,"Module");[m].concat(c);var l,I,e,n;a.def(m,"$public",l=function(L){0===a.slice.call(arguments,0,arguments.length).length&&(this.$$module_function=!1);return p},l.$$arity=-1);a.alias(m,"private","public");a.alias(m,"protected","public");a.alias(m,"nesting","public");a.def(m,"$private_class_method",I=function(L){a.slice.call(arguments,0,arguments.length); +return this},I.$$arity=-1);a.alias(m,"public_class_method","private_class_method");a.def(m,"$private_method_defined?",e=function(){return!1},e.$$arity=1);a.def(m,"$private_constant",n=function(L){a.slice.call(arguments,0,arguments.length);return p},n.$$arity=-1);a.alias(m,"protected_method_defined?","private_method_defined?");a.alias(m,"public_instance_methods","instance_methods");a.alias(m,"public_instance_method","instance_method");return a.alias(m,"public_method_defined?","method_defined?")})(z[0], +null,z);(function(m,u){m=x(m,"Kernel");[m].concat(u);var c;a.def(m,"$private_methods",c=function(l){a.slice.call(arguments,0,arguments.length);return[]},c.$$arity=-1);a.alias(m,"private_instance_methods","private_methods")})(z[0],z);(function(m,u){m=x(m,"Kernel");var c=[m].concat(u),l;a.def(m,"$eval",l=function(I){a.slice.call(arguments,0,arguments.length);return this.$raise(d(c,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+ +(d(c,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details."))},l.$$arity=-1)})(z[0],z);a.defs(w,"$public",J=function(m){a.slice.call(arguments,0,arguments.length);return p},J.$$arity=-1);return(a.defs(w,"$private",t=function(m){a.slice.call(arguments,0,arguments.length);return p},t.$$arity=-1),p)&&"private"};var rb=Opal.top;Opal.add_stubs(["$require"]);rb.$require("opal/base");rb.$require("opal/mini");rb.$require("corelib/kernel/format");rb.$require("corelib/string/encoding");rb.$require("corelib/math"); rb.$require("corelib/complex");rb.$require("corelib/rational");rb.$require("corelib/time");rb.$require("corelib/struct");rb.$require("corelib/io");rb.$require("corelib/main");rb.$require("corelib/dir");rb.$require("corelib/file");rb.$require("corelib/process");rb.$require("corelib/random");rb.$require("corelib/random/mersenne_twister");rb.$require("corelib/unsupported"); -(function(a){function y(u,c){return"number"===typeof u&&"number"===typeof c?u+c:u["$+"](c)}function K(u,c){return"number"===typeof u&&"number"===typeof c?u-c:u["$-"](c)}function t(u,c){return"number"===typeof u&&"number"===typeof c?u $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(u,$super,l){function H(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}u=G(u,$super,"Date");var e=[u].concat(l),n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb;u.$$prototype.date=A;u.$include(d(e,"Comparable"));(function(W,$super,Da){W=G(W,$super,"Infinity");var Va=[W].concat(Da),ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z;W.$$prototype.d=A;W.$include(d(Va,"Comparable"));a.def(W,"$initialize",ib=function(P){null== -P&&(P=1);return this.d=P["$<=>"](0)},ib.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",$a=function(){return!1},$a.$$arity=0);a.def(W,"$infinite?",ab=function(){return this.$d()["$nonzero?"]()},ab.$$arity=0);a.def(W,"$nan?",Aa=function(){return this.$d()["$zero?"]()},Aa.$$arity=0);a.def(W,"$abs",ua=function(){return this.$class().$new()},ua.$$arity=0);a.def(W,"$-@",La=function(){return this.$class().$new(this.$d()["$-@"]())},La.$$arity=0); -a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Ya=function(P){var aa,T,fa=this,ka=A,g=A,C=A;return function(){ka=P;if(d(Va,"Infinity")["$==="](ka))return fa.$d()["$<=>"](P.$d());if(d(Va,"Numeric")["$==="](ka))return fa.$d();try{return T=P.$coerce(fa),aa=a.to_ary(T),g=null==aa[0]?A:aa[0],C=null==aa[1]?A:aa[1],T,g["$<=>"](C)}catch(M){if(a.rescue(M,[d(Va,"NoMethodError")]))try{return A}finally{a.pop_exception()}else throw M;}}()},Ya.$$arity=1); -a.def(W,"$coerce",Ga=function(P){var aa=Ga.$$p,T;aa&&(Ga.$$p=null);var fa=0;var ka=arguments.length;for(T=Array(ka);fa"](0);return k(P)?p(d(Va,"Float"),"INFINITY"):p(d(Va,"Float"),"INFINITY")["$-@"]()},Z.$$arity= -0),A)&&"to_f"})(e[0],d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",y([A],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Da=[W].concat(ya),Va,ib,db,$a;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(ab){var Aa=this.$allocate();Aa.date=ab;return Aa},Va.$$arity=1);a.def(W,"$parse",ib=function(ab,Aa){function ua(ba){return ba[1]}function La(ba){return ba[2]}function Ta(ba){return ba[3]}function Ya(ba){return ba[4]}function Ga(ba){return function(v){v=ba(v);return 69<=v?v+1900:v+2E3}}function Z(ba){return function(v){v=ba(v).toLowerCase(); -return d(Da,"ABBR_MONTHNAMES").indexOf(v)+1}}function P(ba){return function(v){v=ba(v);return parseInt(v,10)}}function aa(ba){return function(v){v=ba(v);return m(d(Da,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==Aa&&(Aa=!0);var T=new Date,fa=T.getDate(),ka=T.getMonth(),g=T.getFullYear(),C=T.getDay();T=d(Da,"MONTHNAMES").$compact().$join("|");T=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ua)},{regexp:/^(\d{2})(\d{2})$/, -year:g,month:P(ua),day:P(La)},{regexp:/^(\d{2})(\d{3})$/,year:Ga(P(ua)),month:0,day:P(La)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ga(P(ua)),month:P(La),day:P(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:P(ua),month:0,day:P(La)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:P(ua),month:P(La),day:P(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:P(La),month:Z(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:P(Ta),month:Z(La),day:P(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, -year:P(Ta),month:Z(ua),day:P(La)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:P(ua),month:Z(La),day:P(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:P(ua),month:P(La),day:P(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ba){return function(v){v=ba(v);return Aa?v+2E3:v}}(P(ua)),month:P(La),day:P(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:P(Ta),month:P(La),day:P(ua)},{regexp:new RegExp("^("+ -d(Da,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ba){return function(v){v=ba(v);v=m(d(Da,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return fa-C+v}}(ua)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(Ya),month:aa(ua),day:P(La)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:aa(ua),day:P(La)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:P(Ya),month:aa(Ta),day:P(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ua),month:aa(La),day:P(Ta)}];var M;for(M=0;M=ab&&ka.setFullYear(ab),this.$wrap(ka);return this.$raise(d(Da,"ArgumentError"),"invalid date")}, -ib.$$arity=-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",$a=function(ab){return 0===(new Date(ab,1,29)).getMonth()-1},$a.$$arity=1),A)&&"gregorian_leap?"})(a.get_singleton_class(u),e);a.def(u,"$initialize",n=function(W,ya,Da,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Da&&(Da=1);null==Va&&d(e,"ITALY");1582===W&&10===ya&&4Da&&(Da=4);return this.date=new Date(W,ya-1,Da)},n.$$arity=-1);a.def(u,"$-",J=function(W){if(W.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(d(e,"TypeError"))},J.$$arity=1);a.def(u,"$+",D=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(u,"$<",R=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",ea=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},ea.$$arity=1);a.def(u,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(u,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return A}, -b.$$arity=1);a.def(u,"$>>",h=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var ya=this.$clone(),Da=ya.date,Va=Da.getDate();Da.setDate(1);Da.setMonth(Da.getMonth()+W);Da.setDate(Math.min(Va,H(Da.getFullYear(),Da.getMonth())));return ya},h.$$arity=1);a.def(u,"$<<",f=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(u,"eql?","==");a.def(u,"$clone",q=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(u, -"$day",z=function(){return this.date.getDate()},z.$$arity=0);a.def(u,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(u,"$jd",F=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Da=this.date.getFullYear();var Va=1;1585>=Da&&(Va=0);var ib=-1*Math.floor(7*(Math.floor((W+9)/12)+Da)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Da+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);ib=ib+Math.floor(275*W/9)+ya+Va*db;return ib+1721027+2*Va+367* -Da-.5+.5},F.$$arity=0);a.def(u,"$julian?",L=function(){return this.dateDa&&(Da="0"+Da);10>W&&(W="0"+W);return ya+"-"+Da+"-"+W},Y.$$arity=0);a.def(u,"$to_time",pa=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},pa.$$arity=0);a.def(u,"$to_n",za=function(){return this.date},za.$$arity=0);a.def(u,"$tuesday?",la=function(){return this.$wday()["$=="](2)},la.$$arity=0);a.def(u,"$step", -xa=function(W,ya){var Da=xa.$$p,Va=Da||A,ib,db,$a=A;$a=$a=A;Da&&(xa.$$p=null);Da&&(xa.$$p=null);null==ya&&(ya=1);$a=K(W,this).$to_i();$a=k(t("number"===typeof $a&&"number"===typeof ya?$a*ya:$a["$*"](ya),0))?[]:k(t($a,0))?m(a.Range.$new(0,$a["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,$a,!1).$step(ya.$abs());$a=m($a,"map",[],(ib=function(ab){var Aa=null==ib.$$s?this:ib.$$s;null==ab&&(ab=A);return y(Aa,ab)},ib.$$s=this,ib.$$arity=1,ib));return Va!==A?(m($a,"each", -[],(db=function(ab){null==ab&&(ab=A);return a.yield1(Va,ab)},db.$$s=this,db.$$arity=1,db)),this):$a},xa.$$arity=-2);a.def(u,"$upto",Ea=function(W){var ya=Ea.$$p,Da=ya||A;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return m(this,"step",[W,1],Da.$to_proc())},Ea.$$arity=1);a.def(u,"$downto",Fa=function(W){var ya=Fa.$$p,Da=ya||A;ya&&(Fa.$$p=null);ya&&(Fa.$$p=null);return m(this,"step",[W,-1],Da.$to_proc())},Fa.$$arity=1);a.def(u,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(u,"$wednesday?", -Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(u,"$year",Na=function(){return this.date.getFullYear()},Na.$$arity=0);a.def(u,"$cwday",Qa=function(){return this.date.getDay()||7},Qa.$$arity=0);a.def(u,"$cweek",lb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},lb.$$arity=0)}(w[0],null,w)})(Opal); -(function(a){function y(m,u){return"number"===typeof m&&"number"===typeof u?m-u:m["$-"](u)}var K=[],t=a.nil,w=a.$$$,A=a.$$,p=a.module,d=a.klass,G=a.send,x=a.hash2,k=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(m,u){function c(f){try{return JSON.parse(f)}catch(q){H.$raise(w(A(e,"JSON"),"ParserError"),q.message)}} -function l(f,q){var z;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return t;case "object":if(!f)return t;if(f.$$is_array){var E=q.array_class.$new();var F=0;for(z=f.length;F $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); -return function(u,$super,l){function H(W,ya){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][ya]}u=G(u,$super,"Date");var e=[u].concat(l),n,J,D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta,ja,oa,V,Q,Y,pa,za,la,xa,Ea,Fa,Sa,Ra,Na,Qa,lb;u.$$prototype.date=A;u.$include(d(e,"Comparable"));(function(W,$super,Da){W=G(W,$super,"Infinity");var Va=[W].concat(Da),ib,db,$a,ab,Aa,ua,La,Ta,Ya,Ga,Z;W.$$prototype.d=A;W.$include(d(Va,"Comparable"));a.def(W,"$initialize",ib=function(P){null== -P&&(P=1);return this.d=P["$<=>"](0)},ib.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",$a=function(){return!1},$a.$$arity=0);a.def(W,"$infinite?",ab=function(){return this.$d()["$nonzero?"]()},ab.$$arity=0);a.def(W,"$nan?",Aa=function(){return this.$d()["$zero?"]()},Aa.$$arity=0);a.def(W,"$abs",ua=function(){return this.$class().$new()},ua.$$arity=0);a.def(W,"$-@",La=function(){return this.$class().$new(this.$d()["$-@"]())},La.$$arity=0); -a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Ya=function(P){var aa,T,fa=this,ka=A,g=A,C=A;return function(){ka=P;if(d(Va,"Infinity")["$==="](ka))return fa.$d()["$<=>"](P.$d());if(d(Va,"Numeric")["$==="](ka))return fa.$d();try{return T=P.$coerce(fa),aa=a.to_ary(T),g=null==aa[0]?A:aa[0],C=null==aa[1]?A:aa[1],T,g["$<=>"](C)}catch(M){if(a.rescue(M,[d(Va,"NoMethodError")]))try{return A}finally{a.pop_exception()}else throw M;}}()},Ya.$$arity=1); -a.def(W,"$coerce",Ga=function(P){var aa=Ga.$$p,T;aa&&(Ga.$$p=null);var fa=0;var ka=arguments.length;for(T=Array(ka);fa"](0);return k(P)?p(d(Va,"Float"),"INFINITY"):p(d(Va,"Float"),"INFINITY")["$-@"]()},Z.$$arity= -0),A)&&"to_f"})(e[0],d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",y([A],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); -a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,ya){var Da=[W].concat(ya),Va,ib,db,$a;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(ab){var Aa=this.$allocate();Aa.date=ab;return Aa},Va.$$arity=1);a.def(W,"$parse",ib=function(ab,Aa){function ua(ba){return ba[1]}function La(ba){return ba[2]}function Ta(ba){return ba[3]}function Ya(ba){return ba[4]}function Ga(ba){return function(v){v=ba(v);return 69<=v?v+1900:v+2E3}}function Z(ba){return function(v){v=ba(v).toLowerCase(); -return d(Da,"ABBR_MONTHNAMES").indexOf(v)+1}}function P(ba){return function(v){v=ba(v);return parseInt(v,10)}}function aa(ba){return function(v){v=ba(v);return m(d(Da,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==Aa&&(Aa=!0);var T=new Date,fa=T.getDate(),ka=T.getMonth(),g=T.getFullYear(),C=T.getDay();T=d(Da,"MONTHNAMES").$compact().$join("|");T=[{regexp:/^(\d{2})$/,year:g,month:ka,day:P(ua)},{regexp:/^(\d{3})$/,year:g,month:0,day:P(ua)},{regexp:/^(\d{2})(\d{2})$/, -year:g,month:P(ua),day:P(La)},{regexp:/^(\d{2})(\d{3})$/,year:Ga(P(ua)),month:0,day:P(La)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Ga(P(ua)),month:P(La),day:P(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:P(ua),month:0,day:P(La)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:P(ua),month:P(La),day:P(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:P(La),month:Z(ua),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:P(Ta),month:Z(La),day:P(ua)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, -year:P(Ta),month:Z(ua),day:P(La)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:P(ua),month:Z(La),day:P(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:P(ua),month:P(La),day:P(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(ba){return function(v){v=ba(v);return Aa?v+2E3:v}}(P(ua)),month:P(La),day:P(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:P(Ta),month:P(La),day:P(ua)},{regexp:new RegExp("^("+ -d(Da,"DAYNAMES").$join("|")+")$","i"),year:g,month:ka,day:function(ba){return function(v){v=ba(v);v=m(d(Da,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return fa-C+v}}(ua)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:P(Ya),month:aa(ua),day:P(La)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:aa(ua),day:P(La)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", -"i"),year:P(Ya),month:aa(Ta),day:P(ua)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:P(ua),month:aa(La),day:P(Ta)}];var M;for(M=0;M=ab&&ka.setFullYear(ab),this.$wrap(ka);return this.$raise(d(Da,"ArgumentError"),"invalid date")}, -ib.$$arity=-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",$a=function(ab){return 0===(new Date(ab,1,29)).getMonth()-1},$a.$$arity=1),A)&&"gregorian_leap?"})(a.get_singleton_class(u),e);a.def(u,"$initialize",n=function(W,ya,Da,Va){null==W&&(W=-4712);null==ya&&(ya=1);null==Da&&(Da=1);null==Va&&d(e,"ITALY");1582===W&&10===ya&&4Da&&(Da=4);return this.date=new Date(W,ya-1,Da)},n.$$arity=-1);a.def(u,"$-",J=function(W){if(W.$$is_number){var ya= -this.$clone();ya.date.setDate(this.date.getDate()-W);return ya}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(d(e,"TypeError"))},J.$$arity=1);a.def(u,"$+",D=function(W){if(W.$$is_number){var ya=this.$clone();ya.date.setDate(this.date.getDate()+W);return ya}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(u,"$<",R=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya",ea=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>W},ea.$$arity=1);a.def(u,"$>=",ma=function(W){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return ya>=W},ma.$$arity=1);a.def(u,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var ya=this.date;W=W.date;ya.setHours(0,0,0,0);W.setHours(0,0,0,0);return yaW?1:0}return A}, -b.$$arity=1);a.def(u,"$>>",h=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var ya=this.$clone(),Da=ya.date,Va=Da.getDate();Da.setDate(1);Da.setMonth(Da.getMonth()+W);Da.setDate(Math.min(Va,H(Da.getFullYear(),Da.getMonth())));return ya},h.$$arity=1);a.def(u,"$<<",f=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(u,"eql?","==");a.def(u,"$clone",q=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(u, -"$day",z=function(){return this.date.getDate()},z.$$arity=0);a.def(u,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(u,"$jd",F=function(){var W=this.date.getMonth()+1,ya=this.date.getDate(),Da=this.date.getFullYear();var Va=1;1585>=Da&&(Va=0);var ib=-1*Math.floor(7*(Math.floor((W+9)/12)+Da)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Da+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);ib=ib+Math.floor(275*W/9)+ya+Va*db;return ib+1721027+2*Va+367* -Da-.5+.5},F.$$arity=0);a.def(u,"$julian?",L=function(){return this.dateDa&&(Da="0"+Da);10>W&&(W="0"+W);return ya+"-"+Da+"-"+W},Y.$$arity=0);a.def(u,"$to_time",pa=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},pa.$$arity=0);a.def(u,"$to_n",za=function(){return this.date},za.$$arity=0);a.def(u,"$tuesday?",la=function(){return this.$wday()["$=="](2)},la.$$arity=0);a.def(u,"$step", -xa=function(W,ya){var Da=xa.$$p,Va=Da||A,ib,db,$a=A;$a=$a=A;Da&&(xa.$$p=null);Da&&(xa.$$p=null);null==ya&&(ya=1);$a=K(W,this).$to_i();$a=k(t("number"===typeof $a&&"number"===typeof ya?$a*ya:$a["$*"](ya),0))?[]:k(t($a,0))?m(a.Range.$new(0,$a["$-@"](),!1).$step(ya.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,$a,!1).$step(ya.$abs());$a=m($a,"map",[],(ib=function(ab){var Aa=null==ib.$$s?this:ib.$$s;null==ab&&(ab=A);return y(Aa,ab)},ib.$$s=this,ib.$$arity=1,ib));return Va!==A?(m($a,"each", -[],(db=function(ab){null==ab&&(ab=A);return a.yield1(Va,ab)},db.$$s=this,db.$$arity=1,db)),this):$a},xa.$$arity=-2);a.def(u,"$upto",Ea=function(W){var ya=Ea.$$p,Da=ya||A;ya&&(Ea.$$p=null);ya&&(Ea.$$p=null);return m(this,"step",[W,1],Da.$to_proc())},Ea.$$arity=1);a.def(u,"$downto",Fa=function(W){var ya=Fa.$$p,Da=ya||A;ya&&(Fa.$$p=null);ya&&(Fa.$$p=null);return m(this,"step",[W,-1],Da.$to_proc())},Fa.$$arity=1);a.def(u,"$wday",Sa=function(){return this.date.getDay()},Sa.$$arity=0);a.def(u,"$wednesday?", -Ra=function(){return this.$wday()["$=="](3)},Ra.$$arity=0);a.def(u,"$year",Na=function(){return this.date.getFullYear()},Na.$$arity=0);a.def(u,"$cwday",Qa=function(){return this.date.getDay()||7},Qa.$$arity=0);a.def(u,"$cweek",lb=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},lb.$$arity=0)}(w[0],null,w)}; -(function(a){function y(H,e){return"number"===typeof H&&"number"===typeof e?H+e:H["$+"](e)}function K(H,e){return"number"===typeof H&&"number"===typeof e?H>e:H["$>"](e)}function t(H,e){return"number"===typeof H&&"number"===typeof e?H $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $show $puts $usage $cleanup $colorize $private $keys $map $select $parse $strftime $today $downcase $lambda $match $== $! $each $split $strip $chomp $[]= $- $has_key? $sort $generate $gsub $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $push $max $size $to_s $filter_tasks $sort_by $start_with? $abs $rjust $kind_of? $to_a $index $execute $new".split(" ")); -A.$require("json");A.$require("date");(function(H,$super,n){H=k(H,$super,"Todo");var J=[H].concat(n),D,R,ia,ea,ma,b,h,f,q,z,E,F,L,ca,va,Oa,wa,Ba,Ka,na,S,ta;H.$$prototype.queries=H.$$prototype.today=H.$$prototype.due_date_days=d;a.const_set(J[0],"COLOR_CODES",m("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(J[0],"STATES",m(["new","done","started","blocked","default"],{"new":"[ ]",done:"[x]",started:"[>]", -blocked:"[!]","default":"[?]"}));a.const_set(J[0],"ORDER",m(["new","done","started","blocked","default"],{"new":3,done:4,started:2,blocked:1,"default":100}));a.const_set(J[0],"COLORS",m(["new","done","started","blocked","default"],{"new":"white",done:"blue",started:"green",blocked:"yellow","default":"magenta"}));a.const_set(J[0],"DATE_FORMAT","%Y-%m-%d");a.const_set(J[0],"DUE_DATE_DAYS_SIMPLE",["today","tomorrow"]);a.const_set(J[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(J[0], -"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(J[0],"PRIORITY_FLAG","*");a.const_set(J[0],"TODO_FILE",require("path").join(require("os").homedir(),"/todo.jsonl"));a.def(H,"$execute",D=function(ja){var oa=d,V=d,Q=d,Y=d,pa=d,za=d,la=d,xa=d,Ea=d,Fa=d,Sa=d,Ra=d;try{this.$setup(),oa=ja.$first(),V=u(Q=ja["$[]"](c(1,-1,!1)))?Q:[],Y=oa,"add"["$==="](Y)?(u(u(pa=V["$nil?"]())?pa:V["$empty?"]())&&this.$raise(y(oa," command requires at least one parameter")),this.$add(V.$join(" "))):"start"["$==="](Y)? -u(K(V.$length(),0))?this.$change_state(V.$first().$to_i(),"started",(u(za=V["$[]"](c(1,-1,!1)))?za:[]).$join(" ")):this.$list(d,[":started"]):"done"["$==="](Y)?u(K(V.$length(),0))?this.$change_state(V.$first().$to_i(),"done",(u(la=V["$[]"](c(1,-1,!1)))?la:[]).$join(" ")):this.$list(d,[":done"]):"block"["$==="](Y)?u(K(V.$length(),0))?this.$change_state(V.$first().$to_i(),"blocked",(u(xa=V["$[]"](c(1,-1,!1)))?xa:[]).$join(" ")):this.$list(d,[":blocked"]):"reset"["$==="](Y)?u(K(V.$length(),0))?this.$change_state(V.$first().$to_i(), -"new",(u(Ea=V["$[]"](c(1,-1,!1)))?Ea:[]).$join(" ")):this.$list(d,[":new"]):"prio"["$==="](Y)?(u(t(V.$length(),1))&&this.$raise(y(oa," command requires at least one parameter")),this.$set_priority(V.$first().$to_i(),(u(Fa=V["$[]"](c(1,-1,!1)))?Fa:[]).$join(" "))):"due"["$==="](Y)?(u(t(V.$length(),1))&&this.$raise(y(oa," command requires at least one parameter")),this.$due_date(V.$first().$to_i(),(u(Sa=V["$[]"](c(1,-1,!1)))?Sa:[]).$join(" "))):"append"["$==="](Y)?(u(t(V.$length(),2))&&this.$raise(y(oa, -" command requires at least two parameters")),this.$append(V.$first().$to_i(),V["$[]"](c(1,-1,!1)).$join(" "))):"rename"["$==="](Y)?(u(t(V.$length(),2))&&this.$raise(y(oa," command requires at least two parameters")),this.$rename(V.$first().$to_i(),V["$[]"](c(1,-1,!1)).$join(" "))):"del"["$==="](Y)?(u(V.$length()["$!="](1))&&this.$raise(y(oa," command requires exactly one parameter")),this.$delete(V.$first().$to_i())):"note"["$==="](Y)?(u(t(V.$length(),2))&&this.$raise(y(oa," command requires at least two parameters")), -this.$add_note(V.$first().$to_i(),V["$[]"](c(1,-1,!1)).$join(" "))):"delnote"["$==="](Y)?(u(V.$length()["$!="](1))&&this.$raise(y(oa," command requires exactly one parameter")),this.$delete_note(V.$first().$to_i())):"list"["$==="](Y)?this.$list(d,V):"show"["$==="](Y)?(u(V.$length()["$!="](1))&&this.$raise(y(oa," command requires exactly one parameter")),this.$show(V.$first().$to_i())):"help"["$==="](Y)?(u(K(V.$length(),0))&&this.$raise(y(oa," command has no parameters")),this.$puts(this.$usage())): -"cleanup"["$==="](Y)?(u(u(Ra=V["$nil?"]())?Ra:V["$empty?"]())&&this.$raise(y(oa," command requires at least one parameter")),this.$cleanup(V)):this.$list(d,ja)}catch(Na){if(a.rescue(Na,[G(x(J,"JS"),"Error"),x(J,"RuntimeError")])){ja=Na;try{this.$puts(""+this.$colorize("ERROR:","red")+" "+ja)}finally{a.pop_exception()}}else throw Na;}return this},D.$$arity=1);H.$private();a.def(H,"$usage",R=function(){var ja,oa;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote delete all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined regex patterns can be also used:\n"+ -this.queries.$keys().$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\n\nLegend:\n'+l(l(x(J,"STATES"),"select",[],(ja=function(V){null==V&&(V=d);return V["$!="]("default")},ja.$$s=this,ja.$$arity=2,ja)),"map",[],(oa=function(V,Q){null==V&&(V=d);null==Q&&(Q=d);return""+V+" "+Q},oa.$$s=this,oa.$$arity=2,oa)).$join(", ")+", priority "+x(J,"PRIORITY_FLAG")+"\n\nTodo file: "+x(J,"TODO_FILE")+"\n"},R.$$arity=0);a.def(H,"$setup",ia=function(){var ja,oa,V,Q,Y,pa,za,la, -xa,Ea,Fa,Sa,Ra=d,Na=d;this.today=x(J,"Date").$parse(x(J,"Date").$today().$strftime(x(J,"DATE_FORMAT")));Ra=l(c(0,6,!1),"map",[],(ja=function(Qa){var lb=null==ja.$$s?this:ja.$$s;null==lb.today&&(lb.today=d);null==Qa&&(Qa=d);return y(lb.today,Qa)},ja.$$s=this,ja.$$arity=1,ja));this.due_date_days=l(Ra,"map",[],(oa=function(Qa){null==Qa&&(Qa=d);return Qa.$strftime("%A").$downcase()},oa.$$s=this,oa.$$arity=1,oa));Na=l(Ra,"map",[],(V=function(Qa){null==Qa&&(Qa=d);return Qa.$strftime(x(J,"DATE_FORMAT"))}, -V.$$s=this,V.$$arity=1,V));return this.queries=m(":active :done :blocked :started :new :all :today :tomorrow :next7days".split(" "),{":active":l(this,"lambda",[],(Q=function(Qa){null==Qa&&(Qa=d);return/(new|started|blocked)/.$match(Qa["$[]"]("state"))},Q.$$s=this,Q.$$arity=1,Q)),":done":l(this,"lambda",[],(Y=function(Qa){null==Qa&&(Qa=d);return"done"["$=="](Qa["$[]"]("state"))},Y.$$s=this,Y.$$arity=1,Y)),":blocked":l(this,"lambda",[],(pa=function(Qa){null==Qa&&(Qa=d);return"blocked"["$=="](Qa["$[]"]("state"))}, -pa.$$s=this,pa.$$arity=1,pa)),":started":l(this,"lambda",[],(za=function(Qa){null==Qa&&(Qa=d);return"started"["$=="](Qa["$[]"]("state"))},za.$$s=this,za.$$arity=1,za)),":new":l(this,"lambda",[],(la=function(Qa){null==Qa&&(Qa=d);return"new"["$=="](Qa["$[]"]("state"))},la.$$s=this,la.$$arity=1,la)),":all":l(this,"lambda",[],(xa=function(Qa){null==Qa&&(Qa=d);return/\w+/.$match(Qa["$[]"]("state"))},xa.$$s=this,xa.$$arity=1,xa)),":today":l(this,"lambda",[],(Ea=function(Qa){null==Qa&&(Qa=d);return Na["$[]"](0)["$=="](Qa["$[]"]("due"))}, -Ea.$$s=this,Ea.$$arity=1,Ea)),":tomorrow":l(this,"lambda",[],(Fa=function(Qa){null==Qa&&(Qa=d);return Na["$[]"](1)["$=="](Qa["$[]"]("due"))},Fa.$$s=this,Fa.$$arity=1,Fa)),":next7days":l(this,"lambda",[],(Sa=function(Qa){null==Qa&&(Qa=d);return a.regexp(["(",Na.$join("|"),")"]).$match(Qa["$[]"]("due"))},Sa.$$s=this,Sa.$$arity=1,Sa))})},ia.$$arity=0);a.def(H,"$load_tasks",ea=function(ja){var oa,V=d,Q=d,Y=d,pa=d;null==ja&&(ja=d);V=0;Q=m([],{});Y=require("fs").existsSync(x(J,"TODO_FILE"))?require("fs").readFileSync(x(J, -"TODO_FILE"),"utf8"):"";u(Y["$empty?"]()["$!"]())&&l(Y.$split("\n"),"each",[],(oa=function(za){null==za&&(za=d);if(za.$strip()["$=="](""))return d;V=y(V,1);za=[V,x(J,"JSON").$parse(za.$chomp(),m(["symbolize_names"],{symbolize_names:!0}))];l(Q,"[]=",a.to_a(za));return za[w(za.length,1)]},oa.$$s=this,oa.$$arity=1,oa));u(u(pa=ja)?Q["$has_key?"](ja)["$!"]():pa)&&this.$raise(""+ja+": No such todo");return Q},ea.$$arity=-1);a.def(H,"$write_tasks",ma=function(ja){var oa,V=d;V=y(l(ja.$keys().$sort(),"map", -[],(oa=function(Q){null==Q&&(Q=d);return x(J,"JSON").$generate(ja["$[]"](Q))},oa.$$s=this,oa.$$arity=1,oa)).$join("\n"),"\n");return require("fs").writeFileSync(x(J,"TODO_FILE"),V,{encoding:"utf8"})},ma.$$arity=1);a.def(H,"$postprocess_tags",b=function(ja){var oa=ja["$[]"]("title").$match(x(J,"DUE_DATE_TAG_PATTERN"));if(u(oa)){var V=["title",ja["$[]"]("title").$gsub(x(J,"DUE_DATE_TAG_PATTERN"),"")];l(ja,"[]=",a.to_a(V));V[w(V.length,1)];V=["due",this.$convert_due_date(oa["$[]"](2))];l(ja,"[]=",a.to_a(V)); -V[w(V.length,1)]}return u(ja["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):d},b.$$arity=1);a.def(H,"$add",h=function(ja){ja=m(["state","title","modified"],{state:"new",title:ja,modified:this.today.$strftime(x(J,"DATE_FORMAT"))});this.$postprocess_tags(ja);var oa=require("fs").existsSync(x(J,"TODO_FILE"))?require("fs").readFileSync(x(J,"TODO_FILE"),"utf8"):"";oa+=x(J,"JSON").$generate(ja)+"\n";require("fs").writeFileSync(x(J,"TODO_FILE"),oa,{encoding:"utf8"});return this.$list()}, -h.$$arity=1);a.def(H,"$update_task",f=function(ja,oa,V){var Q=this.$load_tasks(ja);V.$call(Q["$[]"](ja));V=["modified",this.today.$strftime(x(J,"DATE_FORMAT"))];l(Q["$[]"](ja),"[]=",a.to_a(V));V[w(V.length,1)];this.$write_tasks(Q);return"show"["$==="](oa)?this.$show(ja,Q):"list"["$==="](oa)?this.$list(Q):d},f.$$arity=3);a.def(H,"$append",q=function(ja,oa){var V;null==oa&&(oa="");return this.$update_task(ja,"list",l(this,"lambda",[],(V=function(Q){var Y=null==V.$$s?this:V.$$s;null==Q&&(Q=d);var pa= -["title",[Q["$[]"]("title"),oa].$join(" ")];l(Q,"[]=",a.to_a(pa));pa[w(pa.length,1)];return Y.$postprocess_tags(Q)},V.$$s=this,V.$$arity=1,V)))},q.$$arity=-2);a.def(H,"$rename",z=function(ja,oa){var V;return this.$update_task(ja,"list",l(this,"lambda",[],(V=function(Q){var Y=null==V.$$s?this:V.$$s;null==Q&&(Q=d);var pa=["title",oa];l(Q,"[]=",a.to_a(pa));pa[w(pa.length,1)];return Y.$postprocess_tags(Q)},V.$$s=this,V.$$arity=1,V)))},z.$$arity=2);a.def(H,"$delete",E=function(ja){var oa=this.$load_tasks(ja); -oa.$delete(ja);this.$write_tasks(oa);return this.$list()},E.$$arity=1);a.def(H,"$change_state",F=function(ja,oa,V){var Q;null==V&&(V=d);return this.$update_task(ja,"list",l(this,"lambda",[],(Q=function(Y){var pa=d;null==Y&&(Y=d);var za=["state",oa];l(Y,"[]=",a.to_a(za));za[w(za.length,1)];return u(u(pa=V["$nil?"]()["$!"]())?V["$empty?"]()["$!"]():pa)?(u(za=Y["$[]"]("note"))?za:(za=["note",[]],l(Y,"[]=",a.to_a(za)),za[w(za.length,1)]),Y["$[]"]("note").$push(V)):d},Q.$$s=this,Q.$$arity=1,Q)))},F.$$arity= --3);a.def(H,"$set_priority",L=function(ja,oa){var V;null==oa&&(oa=d);return this.$update_task(ja,"list",l(this,"lambda",[],(V=function(Q){var Y=d;null==Q&&(Q=d);var pa=["priority",Q["$[]"]("priority")["$!"]()];l(Q,"[]=",a.to_a(pa));pa[w(pa.length,1)];u(Q["$[]"]("priority")["$!"]())&&Q.$delete("priority");return u(u(Y=oa["$nil?"]()["$!"]())?oa["$empty?"]()["$!"]():Y)?(u(pa=Q["$[]"]("note"))?pa:(pa=["note",[]],l(Q,"[]=",a.to_a(pa)),pa[w(pa.length,1)]),Q["$[]"]("note").$push(oa)):d},V.$$s=this,V.$$arity= -1,V)))},L.$$arity=-2);a.def(H,"$due_date",ca=function(ja,oa){var V;null==oa&&(oa="");return this.$update_task(ja,"list",l(this,"lambda",[],(V=function(Q){var Y=null==V.$$s?this:V.$$s;null==Q&&(Q=d);Y=["due",Y.$convert_due_date(oa)];l(Q,"[]=",a.to_a(Y));Y[w(Y.length,1)];return u(Q["$[]"]("due")["$nil?"]())?Q.$delete("due"):d},V.$$s=this,V.$$arity=1,V)))},ca.$$arity=-2);a.def(H,"$list",va=function(ja,oa){var V,Q,Y=d,pa=d,za=d,la=d;null==ja&&(ja=d);null==oa&&(oa=d);ja=u(Y=ja)?Y:this.$load_tasks();pa= -[ja.$keys().$max().$to_s().$size(),4].$max();oa=u(u(za=oa["$nil?"]())?za:oa["$empty?"]())?[":active"]:oa;la=this.$filter_tasks(ja,oa);la=l(la,"sort_by",[],(V=function(xa,Ea){var Fa=d,Sa=d,Ra=d;null==xa&&(xa=d);null==Ea&&(Ea=d);return[u(u(Fa=Ea["$[]"]("priority"))?Ea["$[]"]("state")["$!="]("done"):Fa)?0:1,x(J,"ORDER")["$[]"](u(Sa=Ea["$[]"]("state"))?Sa:"default"),u(Ra=Ea["$[]"]("due"))?Ra:"n/a",xa]},V.$$s=this,V.$$arity=2,V));l(la,"each",[],(Q=function(xa,Ea){var Fa=null==Q.$$s?this:Q.$$s,Sa,Ra=d, -Na=d,Qa=d,lb=Qa=d,W=d,ya=d,Da=d,Va=Ra=d,ib=d;null==Fa.today&&(Fa.today=d);null==Fa.due_date_days&&(Fa.due_date_days=d);null==xa&&(xa=d);null==Ea&&(Ea=d);Ra=u(Na=Ea["$[]"]("state"))?Na:"default";Qa=x(J,"COLORS")["$[]"](Ra);Qa=Fa.$colorize(x(J,"STATES")["$[]"](Ra),Qa);lb=l(Ea["$[]"]("title"),"gsub",[x(J,"CONTEXT_TAG_PATTERN")],(Sa=function(db){var $a=null==Sa.$$s?this:Sa.$$s;null==db&&(db=d);return y(u(db["$start_with?"](" "))?" ":"",$a.$colorize(db.$strip(),"cyan"))},Sa.$$s=Fa,Sa.$$arity=1,Sa));W= -u(Ea["$[]"]("priority"))?Fa.$colorize(x(J,"PRIORITY_FLAG"),"red"):" ";ya="";u(u(Da=Ea["$[]"]("due"))?Ra["$!="]("done"):Da)&&(Ra=w(x(J,"Date").$parse(Ea["$[]"]("due")),Fa.today).$to_i(),u(t(Ra,0))?ya=Fa.$colorize("("+Ra.$abs()+"d overdue)","red"):u(u(Va=Ra["$=="](0))?Va:Ra["$=="](1))?ya=Fa.$colorize("("+x(J,"DUE_DATE_DAYS_SIMPLE")["$[]"](Ra)+")","yellow"):u(K(Ra,1))&&(ya=Fa.$colorize("("+(u(ib=Fa.due_date_days["$[]"](Ra))?ib:Ea["$[]"]("due"))+")","magenta")),ya=y(" ",ya));return Fa.$puts(""+xa.$to_s().$rjust(pa, -" ")+":"+W+Qa+" "+lb+ya)},Q.$$s=this,Q.$$arity=2,Q));return u(la["$empty?"]())?this.$puts("No todos found"):d},va.$$arity=-1);a.def(H,"$add_note",Oa=function(ja,oa){var V;return this.$update_task(ja,"show",l(this,"lambda",[],(V=function(Q){var Y;null==Q&&(Q=d);u(Y=Q["$[]"]("note"))?Y:(Y=["note",[]],l(Q,"[]=",a.to_a(Y)),Y[w(Y.length,1)]);return Q["$[]"]("note").$push(oa)},V.$$s=this,V.$$arity=1,V)))},Oa.$$arity=2);a.def(H,"$delete_note",wa=function(ja){var oa;return this.$update_task(ja,"show",l(this, -"lambda",[],(oa=function(V){null==V&&(V=d);return V.$delete("note")},oa.$$s=this,oa.$$arity=1,oa)))},wa.$$arity=1);a.def(H,"$show",Ba=function(ja,oa){var V,Q=d;null==oa&&(oa=d);oa=u(Q=oa)?Q:this.$load_tasks(ja);return l(oa["$[]"](ja),"each",[],(V=function(Y,pa){var za=null==V.$$s?this:V.$$s;null==Y&&(Y=d);null==pa&&(pa=d);pa=u(pa["$kind_of?"](x(J,"Array")))?y("\n",pa.$join("\n")):pa;return za.$puts(""+za.$colorize(y(Y.$to_s().$rjust(10," "),":"),"cyan")+" "+pa)},V.$$s=this,V.$$arity=2,V))},Ba.$$arity= --2);a.def(H,"$cleanup",Ka=function(ja){var oa,V=d,Q=d;V=this.$load_tasks();ja=y([":done"],ja.$to_a());Q=this.$filter_tasks(V,ja);l(Q.$keys(),"each",[],(oa=function(Y){null==Y&&(Y=d);return V.$delete(Y)},oa.$$s=this,oa.$$arity=1,oa));this.$write_tasks(V);return this.$puts("Deleted "+Q.$size()+" todo(s)")},Ka.$$arity=1);a.def(H,"$filter_tasks",na=function(ja,oa){var V,Q=d;Q=m([],{});l(ja,"each",[],(V=function(Y,pa){var za=null==V.$$s?this:V.$$s,la,xa=d,Ea=d;null==Y&&(Y=d);null==pa&&(pa=d);xa=!0;l(oa, -"each",[],(la=function(Fa){var Sa=null==la.$$s?this:la.$$s;null==Sa.queries&&(Sa.queries=d);null==Fa&&(Fa=d);return u(u(Sa.queries["$[]"](Fa))?Sa.queries["$[]"](Fa).$call(pa):a.regexp([Fa],"i").$match(pa["$[]"]("title")))?d:xa=!1},la.$$s=za,la.$$arity=1,la));return u(xa)?(Ea=[Y,pa],l(Q,"[]=",a.to_a(Ea)),Ea[w(Ea.length,1)]):d},V.$$s=this,V.$$arity=2,V));return Q},na.$$arity=2);a.def(H,"$colorize",S=function(ja,oa){return"\u001b["+x(J,"COLOR_CODES")["$[]"](oa)+"m"+ja+"\u001b[0m"},S.$$arity=2);return(a.def(H, -"$convert_due_date",ta=function(ja){var oa,V=this,Q=d,Y=Q=d,pa=d,za=d;Q=d;Q=function(){return u(Y=u(pa=V.due_date_days.$index(ja.$to_s().$downcase()))?pa:x(J,"DUE_DATE_DAYS_SIMPLE").$index(ja.$to_s().$downcase()))?Y:l(V.due_date_days,"map",[],(oa=function(la){null==la&&(la=d);return la["$[]"](c(0,2,!1))},oa.$$s=V,oa.$$arity=1,oa)).$index(ja.$to_s().$downcase())}();return Q=u(Q)?y(V.today,Q).$strftime(x(J,"DATE_FORMAT")):u(u(za=ja["$nil?"]())?za:ja["$empty?"]())?d:x(J,"Date").$parse(ja).$strftime(x(J, -"DATE_FORMAT"))},ta.$$arity=1),d)&&"convert_due_date"})(p[0],null,p);return x(p,"Todo").$new().$execute(process.argv.slice(2))})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); +(function(a){function y(u,c){return"number"===typeof u&&"number"===typeof c?u+c:u["$+"](c)}function J(u,c){return"number"===typeof u&&"number"===typeof c?u-c:u["$-"](c)}function t(u,c){return"number"===typeof u&&"number"===typeof c?u $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(u,$super,l){function I(W,za){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][za]}u=H(u,$super,"Date");var e=[u].concat(l),n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra;u.$$prototype.date=z;u.$include(d(e,"Comparable"));(function(W,$super,Ca){W=H(W,$super,"Infinity");var Va=[W].concat(Ca),ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y;W.$$prototype.d=z;W.$include(d(Va,"Comparable"));a.def(W,"$initialize",ib=function(Q){null== +Q&&(Q=1);return this.d=Q["$<=>"](0)},ib.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",Xa=function(){return!1},Xa.$$arity=0);a.def(W,"$infinite?",bb=function(){return this.$d()["$nonzero?"]()},bb.$$arity=0);a.def(W,"$nan?",Aa=function(){return this.$d()["$zero?"]()},Aa.$$arity=0);a.def(W,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(W,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); +a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(Q){var Z,T,fa=this,la=z,g=z,C=z;return function(){la=Q;if(d(Va,"Infinity")["$==="](la))return fa.$d()["$<=>"](Q.$d());if(d(Va,"Numeric")["$==="](la))return fa.$d();try{return T=Q.$coerce(fa),Z=a.to_ary(T),g=null==Z[0]?z:Z[0],C=null==Z[1]?z:Z[1],T,g["$<=>"](C)}catch(N){if(a.rescue(N,[d(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw N;}}()},Za.$$arity=1);a.def(W, +"$coerce",Fa=function(Q){var Z=Fa.$$p,T;Z&&(Fa.$$p=null);var fa=0;var la=arguments.length;for(T=Array(la);fa"](0);return k(Q)?p(d(Va,"Float"),"INFINITY"):p(d(Va,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),z)&&"to_f"})(e[0], +d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",y([z],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,za){var Ca=[W].concat(za),Va,ib,db,Xa;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(bb){var Aa=this.$allocate();Aa.date=bb;return Aa},Va.$$arity=1);a.def(W,"$parse",ib=function(bb,Aa){function ta(aa){return aa[1]}function Ma(aa){return aa[2]}function Ta(aa){return aa[3]}function Za(aa){return aa[4]}function Fa(aa){return function(v){v=aa(v);return 69<=v?v+1900:v+2E3}}function Y(aa){return function(v){v=aa(v).toLowerCase(); +return d(Ca,"ABBR_MONTHNAMES").indexOf(v)+1}}function Q(aa){return function(v){v=aa(v);return parseInt(v,10)}}function Z(aa){return function(v){v=aa(v);return m(d(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==Aa&&(Aa=!0);var T=new Date,fa=T.getDate(),la=T.getMonth(),g=T.getFullYear(),C=T.getDay();T=d(Ca,"MONTHNAMES").$compact().$join("|");T=[{regexp:/^(\d{2})$/,year:g,month:la,day:Q(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:Q(ta)},{regexp:/^(\d{2})(\d{2})$/, +year:g,month:Q(ta),day:Q(Ma)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(Q(ta)),month:0,day:Q(Ma)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(Q(ta)),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:Q(ta),month:0,day:Q(Ma)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:Q(ta),month:Q(Ma),day:Q(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:Q(Ma),month:Y(ta),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:Q(Ta),month:Y(Ma),day:Q(ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, +year:Q(Ta),month:Y(ta),day:Q(Ma)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:Q(ta),month:Y(Ma),day:Q(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:Q(ta),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(aa){return function(v){v=aa(v);return Aa?v+2E3:v}}(Q(ta)),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:Q(Ta),month:Q(Ma),day:Q(ta)},{regexp:new RegExp("^("+ +d(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(aa){return function(v){v=aa(v);v=m(d(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return fa-C+v}}(ta)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:Q(Za),month:Z(ta),day:Q(Ma)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:Z(ta),day:Q(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:Q(Za),month:Z(Ta),day:Q(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:Q(ta),month:Z(Ma),day:Q(Ta)}];var N;for(N=0;N=bb&&la.setFullYear(bb),this.$wrap(la);return this.$raise(d(Ca,"ArgumentError"),"invalid date")},ib.$$arity= +-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Xa=function(bb){return 0===(new Date(bb,1,29)).getMonth()-1},Xa.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(u),e);a.def(u,"$initialize",n=function(W,za,Ca,Va){null==W&&(W=-4712);null==za&&(za=1);null==Ca&&(Ca=1);null==Va&&d(e,"ITALY");1582===W&&10===za&&4Ca&&(Ca=4);return this.date=new Date(W,za-1,Ca)},n.$$arity=-1);a.def(u,"$-",L=function(W){if(W.$$is_number){var za= +this.$clone();za.date.setDate(this.date.getDate()-W);return za}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(d(e,"TypeError"))},L.$$arity=1);a.def(u,"$+",D=function(W){if(W.$$is_number){var za=this.$clone();za.date.setDate(this.date.getDate()+W);return za}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(u,"$<",R=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za",da=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za>W},da.$$arity=1);a.def(u,"$>=",ma=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za>=W},ma.$$arity=1);a.def(u,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return zaW?1:0}return z}, +b.$$arity=1);a.def(u,"$>>",h=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var za=this.$clone(),Ca=za.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+W);Ca.setDate(Math.min(Va,I(Ca.getFullYear(),Ca.getMonth())));return za},h.$$arity=1);a.def(u,"$<<",f=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(u,"eql?","==");a.def(u,"$clone",q=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(u, +"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(u,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(u,"$jd",G=function(){var W=this.date.getMonth()+1,za=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var ib=-1*Math.floor(7*(Math.floor((W+9)/12)+Ca)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ca+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);ib=ib+Math.floor(275*W/9)+za+Va*db;return ib+1721027+2*Va+367* +Ca-.5+.5},G.$$arity=0);a.def(u,"$julian?",M=function(){return this.dateCa&&(Ca="0"+Ca);10>W&&(W="0"+W);return za+"-"+Ca+"-"+W},V.$$arity=0);a.def(u,"$to_time",ka=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},ka.$$arity=0);a.def(u,"$to_n",va=function(){return this.date},va.$$arity=0);a.def(u,"$tuesday?",ia=function(){return this.$wday()["$=="](2)},ia.$$arity=0);a.def(u,"$step", +wa=function(W,za){var Ca=wa.$$p,Va=Ca||z,ib,db,Xa=z;Xa=Xa=z;Ca&&(wa.$$p=null);Ca&&(wa.$$p=null);null==za&&(za=1);Xa=J(W,this).$to_i();Xa=k(t("number"===typeof Xa&&"number"===typeof za?Xa*za:Xa["$*"](za),0))?[]:k(t(Xa,0))?m(a.Range.$new(0,Xa["$-@"](),!1).$step(za.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Xa,!1).$step(za.$abs());Xa=m(Xa,"map",[],(ib=function(bb){var Aa=null==ib.$$s?this:ib.$$s;null==bb&&(bb=z);return y(Aa,bb)},ib.$$s=this,ib.$$arity=1,ib));return Va!==z?(m(Xa,"each", +[],(db=function(bb){null==bb&&(bb=z);return a.yield1(Va,bb)},db.$$s=this,db.$$arity=1,db)),this):Xa},wa.$$arity=-2);a.def(u,"$upto",Ha=function(W){var za=Ha.$$p,Ca=za||z;za&&(Ha.$$p=null);za&&(Ha.$$p=null);return m(this,"step",[W,1],Ca.$to_proc())},Ha.$$arity=1);a.def(u,"$downto",Ea=function(W){var za=Ea.$$p,Ca=za||z;za&&(Ea.$$p=null);za&&(Ea.$$p=null);return m(this,"step",[W,-1],Ca.$to_proc())},Ea.$$arity=1);a.def(u,"$wday",Qa=function(){return this.date.getDay()},Qa.$$arity=0);a.def(u,"$wednesday?", +Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(u,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(u,"$cwday",kb=function(){return this.date.getDay()||7},kb.$$arity=0);a.def(u,"$cweek",Ra=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},Ra.$$arity=0)}(w[0],null,w)})(Opal); +(function(a){function y(m,u){return"number"===typeof m&&"number"===typeof u?m-u:m["$-"](u)}var J=[],t=a.nil,w=a.$$$,z=a.$$,p=a.module,d=a.klass,H=a.send,x=a.hash2,k=a.truthy;a.add_stubs("$raise $new $push $[]= $- $[] $create_id $json_create $const_get $attr_accessor $create_id= $=== $parse $generate $from_object $merge $to_json $responds_to? $to_io $write $to_s $to_a $strftime".split(" "));(function(m,u){function c(f){try{return JSON.parse(f)}catch(q){I.$raise(w(z(e,"JSON"),"ParserError"),q.message)}} +function l(f,q){var A;switch(typeof f){case "string":return f;case "number":return f;case "boolean":return!!f;case "null":return t;case "object":if(!f)return t;if(f.$$is_array){var E=q.array_class.$new();var G=0;for(A=f.length;G $attr_reader $nonzero? $d $zero? $new $class $-@ $+@ $=== $coerce $== $> $+ $allocate $join $compact $map $to_proc $downcase $wrap $raise $clone $jd $>> $wday $year $month $day $- $to_s $to_i $< $* $reverse $step $abs $each".split(" ")); +return function(u,$super,l){function I(W,za){return[31,0===W%4&&0!==W%100||0===W%400?29:28,31,30,31,30,31,31,30,31,30,31][za]}u=H(u,$super,"Date");var e=[u].concat(l),n,L,D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya,pa,ea,F,V,ka,va,ia,wa,Ha,Ea,Qa,Sa,Ia,kb,Ra;u.$$prototype.date=z;u.$include(d(e,"Comparable"));(function(W,$super,Ca){W=H(W,$super,"Infinity");var Va=[W].concat(Ca),ib,db,Xa,bb,Aa,ta,Ma,Ta,Za,Fa,Y;W.$$prototype.d=z;W.$include(d(Va,"Comparable"));a.def(W,"$initialize",ib=function(Q){null== +Q&&(Q=1);return this.d=Q["$<=>"](0)},ib.$$arity=-1);W.$attr_reader("d");a.def(W,"$zero?",db=function(){return!1},db.$$arity=0);a.def(W,"$finite?",Xa=function(){return!1},Xa.$$arity=0);a.def(W,"$infinite?",bb=function(){return this.$d()["$nonzero?"]()},bb.$$arity=0);a.def(W,"$nan?",Aa=function(){return this.$d()["$zero?"]()},Aa.$$arity=0);a.def(W,"$abs",ta=function(){return this.$class().$new()},ta.$$arity=0);a.def(W,"$-@",Ma=function(){return this.$class().$new(this.$d()["$-@"]())},Ma.$$arity=0); +a.def(W,"$+@",Ta=function(){return this.$class().$new(this.$d()["$+@"]())},Ta.$$arity=0);a.def(W,"$<=>",Za=function(Q){var Z,T,fa=this,la=z,g=z,C=z;return function(){la=Q;if(d(Va,"Infinity")["$==="](la))return fa.$d()["$<=>"](Q.$d());if(d(Va,"Numeric")["$==="](la))return fa.$d();try{return T=Q.$coerce(fa),Z=a.to_ary(T),g=null==Z[0]?z:Z[0],C=null==Z[1]?z:Z[1],T,g["$<=>"](C)}catch(N){if(a.rescue(N,[d(Va,"NoMethodError")]))try{return z}finally{a.pop_exception()}else throw N;}}()},Za.$$arity=1);a.def(W, +"$coerce",Fa=function(Q){var Z=Fa.$$p,T;Z&&(Fa.$$p=null);var fa=0;var la=arguments.length;for(T=Array(la);fa"](0);return k(Q)?p(d(Va,"Float"),"INFINITY"):p(d(Va,"Float"),"INFINITY")["$-@"]()},Y.$$arity=0),z)&&"to_f"})(e[0], +d(e,"Numeric"),e);a.const_set(e[0],"JULIAN",d(e,"Infinity").$new());a.const_set(e[0],"GREGORIAN",d(e,"Infinity").$new()["$-@"]());a.const_set(e[0],"ITALY",2299161);a.const_set(e[0],"ENGLAND",2361222);a.const_set(e[0],"MONTHNAMES",y([z],"January February March April May June July August September October November December".split(" ")));a.const_set(e[0],"ABBR_MONTHNAMES","jan feb mar apr may jun jul aug sep oct nov dec".split(" "));a.const_set(e[0],"DAYNAMES","Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")); +a.const_set(e[0],"ABBR_DAYNAMES","Sun Mon Tue Wed Thu Fri Sat".split(" "));(function(W,za){var Ca=[W].concat(za),Va,ib,db,Xa;a.alias(W,"civil","new");a.def(W,"$wrap",Va=function(bb){var Aa=this.$allocate();Aa.date=bb;return Aa},Va.$$arity=1);a.def(W,"$parse",ib=function(bb,Aa){function ta(aa){return aa[1]}function Ma(aa){return aa[2]}function Ta(aa){return aa[3]}function Za(aa){return aa[4]}function Fa(aa){return function(v){v=aa(v);return 69<=v?v+1900:v+2E3}}function Y(aa){return function(v){v=aa(v).toLowerCase(); +return d(Ca,"ABBR_MONTHNAMES").indexOf(v)+1}}function Q(aa){return function(v){v=aa(v);return parseInt(v,10)}}function Z(aa){return function(v){v=aa(v);return m(d(Ca,"MONTHNAMES").$compact(),"map",[],"downcase".$to_proc()).indexOf(v.$downcase())+1}}null==Aa&&(Aa=!0);var T=new Date,fa=T.getDate(),la=T.getMonth(),g=T.getFullYear(),C=T.getDay();T=d(Ca,"MONTHNAMES").$compact().$join("|");T=[{regexp:/^(\d{2})$/,year:g,month:la,day:Q(ta)},{regexp:/^(\d{3})$/,year:g,month:0,day:Q(ta)},{regexp:/^(\d{2})(\d{2})$/, +year:g,month:Q(ta),day:Q(Ma)},{regexp:/^(\d{2})(\d{3})$/,year:Fa(Q(ta)),month:0,day:Q(Ma)},{regexp:/^(\d{2})(\d{2})(\d{2})$/,year:Fa(Q(ta)),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{4})(\d{3})$/,year:Q(ta),month:0,day:Q(Ma)},{regexp:/^(\d{4})(\d{2})(\d{2})$/,year:Q(ta),month:Q(Ma),day:Q(Ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{3,4})$/,year:Q(Ma),month:Y(ta),day:1},{regexp:/^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,year:Q(Ta),month:Y(Ma),day:Q(ta)},{regexp:/^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, +year:Q(Ta),month:Y(ta),day:Q(Ma)},{regexp:/^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,year:Q(ta),month:Y(Ma),day:Q(Ta)},{regexp:/^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:Q(ta),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,year:function(aa){return function(v){v=aa(v);return Aa?v+2E3:v}}(Q(ta)),month:Q(Ma),day:Q(Ta)},{regexp:/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,year:Q(Ta),month:Q(Ma),day:Q(ta)},{regexp:new RegExp("^("+ +d(Ca,"DAYNAMES").$join("|")+")$","i"),year:g,month:la,day:function(aa){return function(v){v=aa(v);v=m(d(Ca,"DAYNAMES"),"map",[],"downcase".$to_proc()).indexOf(v.$downcase());return fa-C+v}}(ta)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$","i"),year:Q(Za),month:Z(ta),day:Q(Ma)},{regexp:new RegExp("^("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)","i"),year:g,month:Z(ta),day:Q(Ma)},{regexp:new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\-?\\d{3,4})$", +"i"),year:Q(Za),month:Z(Ta),day:Q(ta)},{regexp:new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-]("+T+")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$","i"),year:Q(ta),month:Z(Ma),day:Q(Ta)}];var N;for(N=0;N=bb&&la.setFullYear(bb),this.$wrap(la);return this.$raise(d(Ca,"ArgumentError"),"invalid date")},ib.$$arity= +-2);a.def(W,"$today",db=function(){return this.$wrap(new Date)},db.$$arity=0);return(a.def(W,"$gregorian_leap?",Xa=function(bb){return 0===(new Date(bb,1,29)).getMonth()-1},Xa.$$arity=1),z)&&"gregorian_leap?"})(a.get_singleton_class(u),e);a.def(u,"$initialize",n=function(W,za,Ca,Va){null==W&&(W=-4712);null==za&&(za=1);null==Ca&&(Ca=1);null==Va&&d(e,"ITALY");1582===W&&10===za&&4Ca&&(Ca=4);return this.date=new Date(W,za-1,Ca)},n.$$arity=-1);a.def(u,"$-",L=function(W){if(W.$$is_number){var za= +this.$clone();za.date.setDate(this.date.getDate()-W);return za}if(W.date)return Math.round((this.date-W.date)/864E5);this.$raise(d(e,"TypeError"))},L.$$arity=1);a.def(u,"$+",D=function(W){if(W.$$is_number){var za=this.$clone();za.date.setDate(this.date.getDate()+W);return za}this.$raise(d(e,"TypeError"))},D.$$arity=1);a.def(u,"$<",R=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za",da=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za>W},da.$$arity=1);a.def(u,"$>=",ma=function(W){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return za>=W},ma.$$arity=1);a.def(u,"$<=>",b=function(W){if(W.$$is_number)return this.$jd()["$<=>"](W);if(d(e,"Date")["$==="](W)){var za=this.date;W=W.date;za.setHours(0,0,0,0);W.setHours(0,0,0,0);return zaW?1:0}return z}, +b.$$arity=1);a.def(u,"$>>",h=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));var za=this.$clone(),Ca=za.date,Va=Ca.getDate();Ca.setDate(1);Ca.setMonth(Ca.getMonth()+W);Ca.setDate(Math.min(Va,I(Ca.getFullYear(),Ca.getMonth())));return za},h.$$arity=1);a.def(u,"$<<",f=function(W){W.$$is_number||this.$raise(d(e,"TypeError"));return this["$>>"](-W)},f.$$arity=1);a.alias(u,"eql?","==");a.def(u,"$clone",q=function(){return d(e,"Date").$wrap(new Date(this.date.getTime()))},q.$$arity=0);a.def(u, +"$day",A=function(){return this.date.getDate()},A.$$arity=0);a.def(u,"$friday?",E=function(){return this.$wday()["$=="](5)},E.$$arity=0);a.def(u,"$jd",G=function(){var W=this.date.getMonth()+1,za=this.date.getDate(),Ca=this.date.getFullYear();var Va=1;1585>=Ca&&(Va=0);var ib=-1*Math.floor(7*(Math.floor((W+9)/12)+Ca)/4);var db=1;0>W-9&&(db=-1);db=Math.floor(Ca+db*Math.floor(Math.abs(W-9)/7));db=-1*Math.floor(3*(Math.floor(db/100)+1)/4);ib=ib+Math.floor(275*W/9)+za+Va*db;return ib+1721027+2*Va+367* +Ca-.5+.5},G.$$arity=0);a.def(u,"$julian?",M=function(){return this.dateCa&&(Ca="0"+Ca);10>W&&(W="0"+W);return za+"-"+Ca+"-"+W},V.$$arity=0);a.def(u,"$to_time",ka=function(){return d(e,"Time").$new(this.$year(),this.$month(),this.$day())},ka.$$arity=0);a.def(u,"$to_n",va=function(){return this.date},va.$$arity=0);a.def(u,"$tuesday?",ia=function(){return this.$wday()["$=="](2)},ia.$$arity=0);a.def(u,"$step", +wa=function(W,za){var Ca=wa.$$p,Va=Ca||z,ib,db,Xa=z;Xa=Xa=z;Ca&&(wa.$$p=null);Ca&&(wa.$$p=null);null==za&&(za=1);Xa=J(W,this).$to_i();Xa=k(t("number"===typeof Xa&&"number"===typeof za?Xa*za:Xa["$*"](za),0))?[]:k(t(Xa,0))?m(a.Range.$new(0,Xa["$-@"](),!1).$step(za.$abs()),"map",[],"-@".$to_proc()).$reverse():a.Range.$new(0,Xa,!1).$step(za.$abs());Xa=m(Xa,"map",[],(ib=function(bb){var Aa=null==ib.$$s?this:ib.$$s;null==bb&&(bb=z);return y(Aa,bb)},ib.$$s=this,ib.$$arity=1,ib));return Va!==z?(m(Xa,"each", +[],(db=function(bb){null==bb&&(bb=z);return a.yield1(Va,bb)},db.$$s=this,db.$$arity=1,db)),this):Xa},wa.$$arity=-2);a.def(u,"$upto",Ha=function(W){var za=Ha.$$p,Ca=za||z;za&&(Ha.$$p=null);za&&(Ha.$$p=null);return m(this,"step",[W,1],Ca.$to_proc())},Ha.$$arity=1);a.def(u,"$downto",Ea=function(W){var za=Ea.$$p,Ca=za||z;za&&(Ea.$$p=null);za&&(Ea.$$p=null);return m(this,"step",[W,-1],Ca.$to_proc())},Ea.$$arity=1);a.def(u,"$wday",Qa=function(){return this.date.getDay()},Qa.$$arity=0);a.def(u,"$wednesday?", +Sa=function(){return this.$wday()["$=="](3)},Sa.$$arity=0);a.def(u,"$year",Ia=function(){return this.date.getFullYear()},Ia.$$arity=0);a.def(u,"$cwday",kb=function(){return this.date.getDay()||7},kb.$$arity=0);a.def(u,"$cweek",Ra=function(){var W=new Date(this.date);W.setHours(0,0,0);W.setDate(W.getDate()+4-(W.getDay()||7));return Math.ceil(((W-new Date(W.getFullYear(),0,1))/864E5+1)/7)},Ra.$$arity=0)}(w[0],null,w)}; +(function(a){function y(I,e){return"number"===typeof I&&"number"===typeof e?I+e:I["$+"](e)}function J(I,e){return"number"===typeof I&&"number"===typeof e?I>e:I["$>"](e)}function t(I,e){return"number"===typeof I&&"number"===typeof e?I $length $change_state $to_i $list $< $set_priority $due_date $append $rename $!= $delete $add_note $delete_note $show $puts $usage $start_repl $cleanup $colorize $private $keys $map $select $parse $strftime $today $downcase $lambda $match $== $! $each $split $strip $chomp $[]= $- $has_key? $sort $generate $gsub $convert_due_date $postprocess_tags $load_tasks $call $write_tasks $update_task $push $max $size $to_s $filter_tasks $sort_by $start_with? $abs $rjust $kind_of? $execute $to_a $index $new".split(" ")); +z.$require("json");z.$require("date");(function(I,$super,n){I=k(I,$super,"Todo");var L=[I].concat(n),D,R,ja,da,ma,b,h,f,q,A,E,G,M,ba,ua,Oa,xa,Ba,La,na,S,sa,ya;I.$$prototype.queries=I.$$prototype.today=I.$$prototype.due_date_days=d;a.const_set(L[0],"COLOR_CODES",m("black red green yellow blue magenta cyan white".split(" "),{black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}));a.const_set(L[0],"STATES",m(["new","done","started","blocked","default"],{"new":"[ ]",done:"[x]",started:"[>]", +blocked:"[!]","default":"[?]"}));a.const_set(L[0],"ORDER",m(["new","done","started","blocked","default"],{"new":3,done:4,started:2,blocked:1,"default":100}));a.const_set(L[0],"COLORS",m(["new","done","started","blocked","default"],{"new":"white",done:"blue",started:"green",blocked:"yellow","default":"magenta"}));a.const_set(L[0],"DATE_FORMAT","%Y-%m-%d");a.const_set(L[0],"DUE_DATE_DAYS_SIMPLE",["today","tomorrow"]);a.const_set(L[0],"DUE_DATE_TAG_PATTERN",/(^| )due:([a-zA-Z0-9-]+)/);a.const_set(L[0], +"CONTEXT_TAG_PATTERN",/(^| )[@+][\w-]+/);a.const_set(L[0],"PRIORITY_FLAG","*");a.const_set(L[0],"TODO_FILE",require("path").join(require("os").homedir(),"/todo.jsonl"));a.def(I,"$execute",D=function(pa){var ea=d,F=d,V=d,ka=d,va=d,ia=d,wa=d,Ha=d,Ea=d,Qa=d,Sa=d,Ia=d;try{this.$setup(),ea=pa.$first(),F=u(V=pa["$[]"](c(1,-1,!1)))?V:[],ka=ea,"add"["$==="](ka)?(u(u(va=F["$nil?"]())?va:F["$empty?"]())&&this.$raise(y(ea," command requires at least one parameter")),this.$add(F.$join(" "))):"start"["$==="](ka)? +u(J(F.$length(),0))?this.$change_state(F.$first().$to_i(),"started",(u(ia=F["$[]"](c(1,-1,!1)))?ia:[]).$join(" ")):this.$list(d,[":started"]):"done"["$==="](ka)?u(J(F.$length(),0))?this.$change_state(F.$first().$to_i(),"done",(u(wa=F["$[]"](c(1,-1,!1)))?wa:[]).$join(" ")):this.$list(d,[":done"]):"block"["$==="](ka)?u(J(F.$length(),0))?this.$change_state(F.$first().$to_i(),"blocked",(u(Ha=F["$[]"](c(1,-1,!1)))?Ha:[]).$join(" ")):this.$list(d,[":blocked"]):"reset"["$==="](ka)?u(J(F.$length(),0))?this.$change_state(F.$first().$to_i(), +"new",(u(Ea=F["$[]"](c(1,-1,!1)))?Ea:[]).$join(" ")):this.$list(d,[":new"]):"prio"["$==="](ka)?(u(t(F.$length(),1))&&this.$raise(y(ea," command requires at least one parameter")),this.$set_priority(F.$first().$to_i(),(u(Qa=F["$[]"](c(1,-1,!1)))?Qa:[]).$join(" "))):"due"["$==="](ka)?(u(t(F.$length(),1))&&this.$raise(y(ea," command requires at least one parameter")),this.$due_date(F.$first().$to_i(),(u(Sa=F["$[]"](c(1,-1,!1)))?Sa:[]).$join(" "))):"append"["$==="](ka)?(u(t(F.$length(),2))&&this.$raise(y(ea, +" command requires at least two parameters")),this.$append(F.$first().$to_i(),F["$[]"](c(1,-1,!1)).$join(" "))):"rename"["$==="](ka)?(u(t(F.$length(),2))&&this.$raise(y(ea," command requires at least two parameters")),this.$rename(F.$first().$to_i(),F["$[]"](c(1,-1,!1)).$join(" "))):"del"["$==="](ka)?(u(F.$length()["$!="](1))&&this.$raise(y(ea," command requires exactly one parameter")),this.$delete(F.$first().$to_i())):"note"["$==="](ka)?(u(t(F.$length(),2))&&this.$raise(y(ea," command requires at least two parameters")), +this.$add_note(F.$first().$to_i(),F["$[]"](c(1,-1,!1)).$join(" "))):"delnote"["$==="](ka)?(u(F.$length()["$!="](1))&&this.$raise(y(ea," command requires exactly one parameter")),this.$delete_note(F.$first().$to_i())):"list"["$==="](ka)?this.$list(d,F):"show"["$==="](ka)?(u(F.$length()["$!="](1))&&this.$raise(y(ea," command requires exactly one parameter")),this.$show(F.$first().$to_i())):"help"["$==="](ka)?(u(J(F.$length(),0))&&this.$raise(y(ea," command has no parameters")),this.$puts(this.$usage())): +"repl"["$==="](ka)?(u(J(F.$length(),0))&&this.$raise(y(ea," command has no parameters")),this.$start_repl()):"cleanup"["$==="](ka)?(u(u(Ia=F["$nil?"]())?Ia:F["$empty?"]())&&this.$raise(y(ea," command requires at least one parameter")),this.$cleanup(F)):this.$list(d,pa)}catch(kb){if(a.rescue(kb,[H(x(L,"JS"),"Error"),x(L,"RuntimeError")])){pa=kb;try{this.$puts(""+this.$colorize("ERROR:","red")+" "+pa)}finally{a.pop_exception()}}else throw kb;}return this},D.$$arity=1);I.$private();a.def(I,"$usage", +R=function(){var pa,ea;return"Usage: todo \n\nCommands:\n* add add new task\n* start [text] mark task as started, with optional note\n* done [text] mark task as completed, with optional note\n* block [text] mark task as blocked, with optional note\n* reset [text] reset task to new state, with optional note\n* prio [text] toggle high priority flag, with optional note\n* due [date] set/unset due date (in YYYY-MM-DD format)\n\n* append append text to task title\n* rename rename task\n* del delete task\n* note add note to task\n* delnote delete all notes from task\n\n* list [regex...] list tasks (only active tasks by default)\n* show show all task details\n* repl enter read-eval-print loop mode\n* cleanup [regex...] cleanup completed tasks by regex\n* help this help screen\n\nWith list command the following pre-defined regex patterns can be also used:\n"+ +this.queries.$keys().$join(", ")+'\n\nDue dates can be also added via tags in task title: "due:YYYY-MM-DD"\n\nLegend:\n'+l(l(x(L,"STATES"),"select",[],(pa=function(F){null==F&&(F=d);return F["$!="]("default")},pa.$$s=this,pa.$$arity=2,pa)),"map",[],(ea=function(F,V){null==F&&(F=d);null==V&&(V=d);return""+F+" "+V},ea.$$s=this,ea.$$arity=2,ea)).$join(", ")+", priority "+x(L,"PRIORITY_FLAG")+"\n\nTodo file: "+x(L,"TODO_FILE")+"\n"},R.$$arity=0);a.def(I,"$setup",ja=function(){var pa,ea,F,V,ka,va,ia,wa, +Ha,Ea,Qa,Sa,Ia=d,kb=d;this.today=x(L,"Date").$parse(x(L,"Date").$today().$strftime(x(L,"DATE_FORMAT")));Ia=l(c(0,6,!1),"map",[],(pa=function(Ra){var W=null==pa.$$s?this:pa.$$s;null==W.today&&(W.today=d);null==Ra&&(Ra=d);return y(W.today,Ra)},pa.$$s=this,pa.$$arity=1,pa));this.due_date_days=l(Ia,"map",[],(ea=function(Ra){null==Ra&&(Ra=d);return Ra.$strftime("%A").$downcase()},ea.$$s=this,ea.$$arity=1,ea));kb=l(Ia,"map",[],(F=function(Ra){null==Ra&&(Ra=d);return Ra.$strftime(x(L,"DATE_FORMAT"))},F.$$s= +this,F.$$arity=1,F));return this.queries=m(":active :done :blocked :started :new :all :today :tomorrow :next7days".split(" "),{":active":l(this,"lambda",[],(V=function(Ra){null==Ra&&(Ra=d);return/(new|started|blocked)/.$match(Ra["$[]"]("state"))},V.$$s=this,V.$$arity=1,V)),":done":l(this,"lambda",[],(ka=function(Ra){null==Ra&&(Ra=d);return"done"["$=="](Ra["$[]"]("state"))},ka.$$s=this,ka.$$arity=1,ka)),":blocked":l(this,"lambda",[],(va=function(Ra){null==Ra&&(Ra=d);return"blocked"["$=="](Ra["$[]"]("state"))}, +va.$$s=this,va.$$arity=1,va)),":started":l(this,"lambda",[],(ia=function(Ra){null==Ra&&(Ra=d);return"started"["$=="](Ra["$[]"]("state"))},ia.$$s=this,ia.$$arity=1,ia)),":new":l(this,"lambda",[],(wa=function(Ra){null==Ra&&(Ra=d);return"new"["$=="](Ra["$[]"]("state"))},wa.$$s=this,wa.$$arity=1,wa)),":all":l(this,"lambda",[],(Ha=function(Ra){null==Ra&&(Ra=d);return/\w+/.$match(Ra["$[]"]("state"))},Ha.$$s=this,Ha.$$arity=1,Ha)),":today":l(this,"lambda",[],(Ea=function(Ra){null==Ra&&(Ra=d);return kb["$[]"](0)["$=="](Ra["$[]"]("due"))}, +Ea.$$s=this,Ea.$$arity=1,Ea)),":tomorrow":l(this,"lambda",[],(Qa=function(Ra){null==Ra&&(Ra=d);return kb["$[]"](1)["$=="](Ra["$[]"]("due"))},Qa.$$s=this,Qa.$$arity=1,Qa)),":next7days":l(this,"lambda",[],(Sa=function(Ra){null==Ra&&(Ra=d);return a.regexp(["(",kb.$join("|"),")"]).$match(Ra["$[]"]("due"))},Sa.$$s=this,Sa.$$arity=1,Sa))})},ja.$$arity=0);a.def(I,"$load_tasks",da=function(pa){var ea,F=d,V=d,ka=d,va=d;null==pa&&(pa=d);F=0;V=m([],{});ka=function(){var ia=require("fs");return ia.existsSync(x(L, +"TODO_FILE"))?ia.readFileSync(x(L,"TODO_FILE"),"utf8"):""}.call();u(ka["$empty?"]()["$!"]())&&l(ka.$split("\n"),"each",[],(ea=function(ia){null==ia&&(ia=d);if(ia.$strip()["$=="](""))return d;F=y(F,1);ia=[F,x(L,"JSON").$parse(ia.$chomp(),m(["symbolize_names"],{symbolize_names:!0}))];l(V,"[]=",a.to_a(ia));return ia[w(ia.length,1)]},ea.$$s=this,ea.$$arity=1,ea));u(u(va=pa)?V["$has_key?"](pa)["$!"]():va)&&this.$raise(""+pa+": No such todo");return V},da.$$arity=-1);a.def(I,"$write_tasks",ma=function(pa){var ea, +F=d;F=y(l(pa.$keys().$sort(),"map",[],(ea=function(V){null==V&&(V=d);return x(L,"JSON").$generate(pa["$[]"](V))},ea.$$s=this,ea.$$arity=1,ea)).$join("\n"),"\n");return require("fs").writeFileSync(x(L,"TODO_FILE"),F,"utf8")},ma.$$arity=1);a.def(I,"$postprocess_tags",b=function(pa){var ea=pa["$[]"]("title").$match(x(L,"DUE_DATE_TAG_PATTERN"));if(u(ea)){var F=["title",pa["$[]"]("title").$gsub(x(L,"DUE_DATE_TAG_PATTERN"),"")];l(pa,"[]=",a.to_a(F));F[w(F.length,1)];F=["due",this.$convert_due_date(ea["$[]"](2))]; +l(pa,"[]=",a.to_a(F));F[w(F.length,1)]}return u(pa["$[]"]("title")["$empty?"]())?this.$raise("title must not be empty"):d},b.$$arity=1);a.def(I,"$add",h=function(pa){pa=m(["state","title","modified"],{state:"new",title:pa,modified:this.today.$strftime(x(L,"DATE_FORMAT"))});this.$postprocess_tags(pa);var ea=require("fs");var F=ea.existsSync(x(L,"TODO_FILE"))?ea.readFileSync(x(L,"TODO_FILE"),"utf8"):"";F+=x(L,"JSON").$generate(pa)+"\n";ea.writeFileSync(x(L,"TODO_FILE"),F,"utf8");return this.$list()}, +h.$$arity=1);a.def(I,"$update_task",f=function(pa,ea,F){var V=this.$load_tasks(pa);F.$call(V["$[]"](pa));F=["modified",this.today.$strftime(x(L,"DATE_FORMAT"))];l(V["$[]"](pa),"[]=",a.to_a(F));F[w(F.length,1)];this.$write_tasks(V);return"show"["$==="](ea)?this.$show(pa,V):"list"["$==="](ea)?this.$list(V):d},f.$$arity=3);a.def(I,"$append",q=function(pa,ea){var F;null==ea&&(ea="");return this.$update_task(pa,"list",l(this,"lambda",[],(F=function(V){var ka=null==F.$$s?this:F.$$s;null==V&&(V=d);var va= +["title",[V["$[]"]("title"),ea].$join(" ")];l(V,"[]=",a.to_a(va));va[w(va.length,1)];return ka.$postprocess_tags(V)},F.$$s=this,F.$$arity=1,F)))},q.$$arity=-2);a.def(I,"$rename",A=function(pa,ea){var F;return this.$update_task(pa,"list",l(this,"lambda",[],(F=function(V){var ka=null==F.$$s?this:F.$$s;null==V&&(V=d);var va=["title",ea];l(V,"[]=",a.to_a(va));va[w(va.length,1)];return ka.$postprocess_tags(V)},F.$$s=this,F.$$arity=1,F)))},A.$$arity=2);a.def(I,"$delete",E=function(pa){var ea=this.$load_tasks(pa); +ea.$delete(pa);this.$write_tasks(ea);return this.$list()},E.$$arity=1);a.def(I,"$change_state",G=function(pa,ea,F){var V;null==F&&(F=d);return this.$update_task(pa,"list",l(this,"lambda",[],(V=function(ka){var va=d;null==ka&&(ka=d);var ia=["state",ea];l(ka,"[]=",a.to_a(ia));ia[w(ia.length,1)];return u(u(va=F["$nil?"]()["$!"]())?F["$empty?"]()["$!"]():va)?(u(ia=ka["$[]"]("note"))?ia:(ia=["note",[]],l(ka,"[]=",a.to_a(ia)),ia[w(ia.length,1)]),ka["$[]"]("note").$push(F)):d},V.$$s=this,V.$$arity=1,V)))}, +G.$$arity=-3);a.def(I,"$set_priority",M=function(pa,ea){var F;null==ea&&(ea=d);return this.$update_task(pa,"list",l(this,"lambda",[],(F=function(V){var ka=d;null==V&&(V=d);var va=["priority",V["$[]"]("priority")["$!"]()];l(V,"[]=",a.to_a(va));va[w(va.length,1)];u(V["$[]"]("priority")["$!"]())&&V.$delete("priority");return u(u(ka=ea["$nil?"]()["$!"]())?ea["$empty?"]()["$!"]():ka)?(u(va=V["$[]"]("note"))?va:(va=["note",[]],l(V,"[]=",a.to_a(va)),va[w(va.length,1)]),V["$[]"]("note").$push(ea)):d},F.$$s= +this,F.$$arity=1,F)))},M.$$arity=-2);a.def(I,"$due_date",ba=function(pa,ea){var F;null==ea&&(ea="");return this.$update_task(pa,"list",l(this,"lambda",[],(F=function(V){var ka=null==F.$$s?this:F.$$s;null==V&&(V=d);ka=["due",ka.$convert_due_date(ea)];l(V,"[]=",a.to_a(ka));ka[w(ka.length,1)];return u(V["$[]"]("due")["$nil?"]())?V.$delete("due"):d},F.$$s=this,F.$$arity=1,F)))},ba.$$arity=-2);a.def(I,"$list",ua=function(pa,ea){var F,V,ka=d,va=d,ia=d,wa=d;null==pa&&(pa=d);null==ea&&(ea=d);pa=u(ka=pa)? +ka:this.$load_tasks();va=[pa.$keys().$max().$to_s().$size(),4].$max();ea=u(u(ia=ea["$nil?"]())?ia:ea["$empty?"]())?[":active"]:ea;wa=this.$filter_tasks(pa,ea);wa=l(wa,"sort_by",[],(F=function(Ha,Ea){var Qa=d,Sa=d,Ia=d;null==Ha&&(Ha=d);null==Ea&&(Ea=d);return[u(u(Qa=Ea["$[]"]("priority"))?Ea["$[]"]("state")["$!="]("done"):Qa)?0:1,x(L,"ORDER")["$[]"](u(Sa=Ea["$[]"]("state"))?Sa:"default"),u(Ia=Ea["$[]"]("due"))?Ia:"n/a",Ha]},F.$$s=this,F.$$arity=2,F));l(wa,"each",[],(V=function(Ha,Ea){var Qa=null== +V.$$s?this:V.$$s,Sa,Ia=d,kb=d,Ra=d,W=Ra=d,za=d,Ca=d,Va=d,ib=Ia=d,db=d;null==Qa.today&&(Qa.today=d);null==Qa.due_date_days&&(Qa.due_date_days=d);null==Ha&&(Ha=d);null==Ea&&(Ea=d);Ia=u(kb=Ea["$[]"]("state"))?kb:"default";Ra=x(L,"COLORS")["$[]"](Ia);Ra=Qa.$colorize(x(L,"STATES")["$[]"](Ia),Ra);W=l(Ea["$[]"]("title"),"gsub",[x(L,"CONTEXT_TAG_PATTERN")],(Sa=function(Xa){var bb=null==Sa.$$s?this:Sa.$$s;null==Xa&&(Xa=d);return y(u(Xa["$start_with?"](" "))?" ":"",bb.$colorize(Xa.$strip(),"cyan"))},Sa.$$s= +Qa,Sa.$$arity=1,Sa));za=u(Ea["$[]"]("priority"))?Qa.$colorize(x(L,"PRIORITY_FLAG"),"red"):" ";Ca="";u(u(Va=Ea["$[]"]("due"))?Ia["$!="]("done"):Va)&&(Ia=w(x(L,"Date").$parse(Ea["$[]"]("due")),Qa.today).$to_i(),u(t(Ia,0))?Ca=Qa.$colorize("("+Ia.$abs()+"d overdue)","red"):u(u(ib=Ia["$=="](0))?ib:Ia["$=="](1))?Ca=Qa.$colorize("("+x(L,"DUE_DATE_DAYS_SIMPLE")["$[]"](Ia)+")","yellow"):u(J(Ia,1))&&(Ca=Qa.$colorize("("+(u(db=Qa.due_date_days["$[]"](Ia))?db:Ea["$[]"]("due"))+")","magenta")),Ca=y(" ",Ca));return Qa.$puts(""+ +Ha.$to_s().$rjust(va," ")+":"+za+Ra+" "+W+Ca)},V.$$s=this,V.$$arity=2,V));return u(wa["$empty?"]())?this.$puts("No todos found"):d},ua.$$arity=-1);a.def(I,"$add_note",Oa=function(pa,ea){var F;return this.$update_task(pa,"show",l(this,"lambda",[],(F=function(V){var ka;null==V&&(V=d);u(ka=V["$[]"]("note"))?ka:(ka=["note",[]],l(V,"[]=",a.to_a(ka)),ka[w(ka.length,1)]);return V["$[]"]("note").$push(ea)},F.$$s=this,F.$$arity=1,F)))},Oa.$$arity=2);a.def(I,"$delete_note",xa=function(pa){var ea;return this.$update_task(pa, +"show",l(this,"lambda",[],(ea=function(F){null==F&&(F=d);return F.$delete("note")},ea.$$s=this,ea.$$arity=1,ea)))},xa.$$arity=1);a.def(I,"$show",Ba=function(pa,ea){var F,V=d;null==ea&&(ea=d);ea=u(V=ea)?V:this.$load_tasks(pa);return l(ea["$[]"](pa),"each",[],(F=function(ka,va){var ia=null==F.$$s?this:F.$$s;null==ka&&(ka=d);null==va&&(va=d);va=u(va["$kind_of?"](x(L,"Array")))?y("\n",va.$join("\n")):va;return ia.$puts(""+ia.$colorize(y(ka.$to_s().$rjust(10," "),":"),"cyan")+" "+va)},F.$$s=this,F.$$arity= +2,F))},Ba.$$arity=-2);a.def(I,"$start_repl",La=function(){function pa(){V.question("\ntodo> ",function(ka){try{ka=ka.trim(),["exit","quit"].includes(ka)?V.close():(["clear","cls"].includes(ka)?process.stdout.write("\u001b[H\u001b[2J"):F(ka),pa())}catch(va){throw V.close(),va;}})}var ea,F=d;F=l(this,"lambda",[],(ea=function(ka){var va=null==ea.$$s?this:ea.$$s;null==ka&&(ka=d);return va.$execute(ka["$=="]("repl")?[]:ka.$split(/\s+/))},ea.$$s=this,ea.$$arity=1,ea));var V=require("readline").createInterface({input:process.stdin, +output:process.stdout});F("");pa()},La.$$arity=0);a.def(I,"$cleanup",na=function(pa){var ea,F=d,V=d;F=this.$load_tasks();pa=y([":done"],pa.$to_a());V=this.$filter_tasks(F,pa);l(V.$keys(),"each",[],(ea=function(ka){null==ka&&(ka=d);return F.$delete(ka)},ea.$$s=this,ea.$$arity=1,ea));this.$write_tasks(F);return this.$puts("Deleted "+V.$size()+" todo(s)")},na.$$arity=1);a.def(I,"$filter_tasks",S=function(pa,ea){var F,V=d;V=m([],{});l(pa,"each",[],(F=function(ka,va){var ia=null==F.$$s?this:F.$$s,wa,Ha= +d,Ea=d;null==ka&&(ka=d);null==va&&(va=d);Ha=!0;l(ea,"each",[],(wa=function(Qa){var Sa=null==wa.$$s?this:wa.$$s;null==Sa.queries&&(Sa.queries=d);null==Qa&&(Qa=d);return u(u(Sa.queries["$[]"](Qa))?Sa.queries["$[]"](Qa).$call(va):a.regexp([Qa],"i").$match(va["$[]"]("title")))?d:Ha=!1},wa.$$s=ia,wa.$$arity=1,wa));return u(Ha)?(Ea=[ka,va],l(V,"[]=",a.to_a(Ea)),Ea[w(Ea.length,1)]):d},F.$$s=this,F.$$arity=2,F));return V},S.$$arity=2);a.def(I,"$colorize",sa=function(pa,ea){return"\u001b["+x(L,"COLOR_CODES")["$[]"](ea)+ +"m"+pa+"\u001b[0m"},sa.$$arity=2);return(a.def(I,"$convert_due_date",ya=function(pa){var ea,F=this,V=d,ka=V=d,va=d,ia=d;V=d;V=function(){return u(ka=u(va=F.due_date_days.$index(pa.$to_s().$downcase()))?va:x(L,"DUE_DATE_DAYS_SIMPLE").$index(pa.$to_s().$downcase()))?ka:l(F.due_date_days,"map",[],(ea=function(wa){null==wa&&(wa=d);return wa["$[]"](c(0,2,!1))},ea.$$s=F,ea.$$arity=1,ea)).$index(pa.$to_s().$downcase())}();return V=u(V)?y(F.today,V).$strftime(x(L,"DATE_FORMAT")):u(u(ia=pa["$nil?"]())?ia: +pa["$empty?"]())?d:x(L,"Date").$parse(pa).$strftime(x(L,"DATE_FORMAT"))},ya.$$arity=1),d)&&"convert_due_date"})(p[0],null,p);return x(p,"Todo").$new().$execute(process.argv.slice(2))})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); diff --git a/node/todo.js.rb b/node/todo.js.rb index f0c50c3..0fd5dac 100644 --- a/node/todo.js.rb +++ b/node/todo.js.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# todo.js.rb for nodejs - todo list manager inspired by todo.txt using the jsonl format. +# todo.js.rb for Node.js - todo list manager inspired by todo.txt using the jsonl format. # # Copyright (c) 2020-2021 Gabor Bata # @@ -117,6 +117,9 @@ def execute(arguments) when 'help' raise action + ' command has no parameters' if args.length > 0 puts usage + when 'repl' + raise action + ' command has no parameters' if args.length > 0 + start_repl when 'cleanup' raise action + ' command requires at least one parameter' if args.nil? || args.empty? cleanup(args) @@ -152,6 +155,7 @@ def usage * list [regex...] list tasks (only active tasks by default) * show show all task details + * repl enter read-eval-print loop mode * cleanup [regex...] cleanup completed tasks by regex * help this help screen @@ -190,8 +194,9 @@ def load_tasks(item_to_check = nil) count = 0 tasks = {} todo_jsonl = `function() { - if (require('fs').existsSync(#{TODO_FILE})) { - return require('fs').readFileSync(#{TODO_FILE}, 'utf8'); + var fs = require('fs'); + if (fs.existsSync(#{TODO_FILE})) { + return fs.readFileSync(#{TODO_FILE}, 'utf8'); } else { return ''; } @@ -209,7 +214,7 @@ def load_tasks(item_to_check = nil) def write_tasks(tasks) todo_jsonl = tasks.keys.sort.map do |key| JSON.generate(tasks[key]) end.join("\n") + "\n" - `require('fs').writeFileSync(#{TODO_FILE}, todo_jsonl, {encoding: 'utf8'})` + `require('fs').writeFileSync(#{TODO_FILE}, todo_jsonl, 'utf8')` end def postprocess_tags(task) @@ -228,16 +233,16 @@ def add(text) modified: @today.strftime(DATE_FORMAT) } postprocess_tags(task) - ` - let todo_jsonl; - if (require('fs').existsSync(#{TODO_FILE})) { - todo_jsonl = require('fs').readFileSync(#{TODO_FILE}, 'utf8'); + var fs = require('fs'); + var todo_jsonl; + if (fs.existsSync(#{TODO_FILE})) { + todo_jsonl = fs.readFileSync(#{TODO_FILE}, 'utf8'); } else { todo_jsonl = ''; } todo_jsonl += #{JSON.generate(task)} + "\n"; - require('fs').writeFileSync(#{TODO_FILE}, todo_jsonl, {encoding: 'utf8'}); + fs.writeFileSync(#{TODO_FILE}, todo_jsonl, 'utf8'); ` list end @@ -356,6 +361,40 @@ def show(item, tasks = nil) end end + def start_repl + execute_command = lambda do |command| + execute(command == 'repl' ? [] : command.split(/\s+/)) + end + ` + var readline = require('readline').createInterface({ + input: process.stdin, + output: process.stdout + }); + + function readCommand() { + readline.question("\ntodo> ", function(command) { + try { + command = command.trim(); + if (['exit', 'quit'].includes(command)) { + readline.close(); + } else if (['clear', 'cls'].includes(command)) { + process.stdout.write('\u001b[H\u001b[2J'); + readCommand(); + } else { + execute_command(command); + readCommand(); + } + } catch(error) { + readline.close(); + throw error; + } + }); + } + execute_command(''); + readCommand(); + ` + end + def cleanup(patterns) tasks = load_tasks patterns = [':done'] + patterns.to_a diff --git a/todo.gemspec b/todo.gemspec index 98edc15..5132fba 100644 --- a/todo.gemspec +++ b/todo.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'todo-jsonl' - s.version = '0.1.29' - s.date = '2021-03-10' + s.version = '0.1.30' + s.date = '2021-03-11' s.summary = 'todo list manager inspired by todo.txt using the jsonl format' s.authors = ['Gabor Bata'] s.homepage = 'https://github.com/gaborbata/todo' diff --git a/web/app.js b/web/app.js index 2fef3b3..72869ff 100644 --- a/web/app.js +++ b/web/app.js @@ -753,6 +753,6 @@ M=d,ja=d;M=this.$load_tasks();ka=w([":done"],ka.$to_a());ja=this.$filter_tasks(M null==Da.$$s?this:Da.$$s;null==Ha.queries&&(Ha.queries=d);null==Pa&&(Pa=d);return v(v(Ha.queries["$[]"](Pa))?Ha.queries["$[]"](Pa).$call(ea):a.regexp([Pa],"i").$match(ea["$[]"]("title")))?d:Ga=!1},Da.$$s=ua,Da.$$arity=1,Da));return v(Ga)?(Ra=[sa,ea],l(ja,"[]=",a.to_a(Ra)),Ra[t(Ra.length,1)]):d},M.$$s=this,M.$$arity=2,M));return ja},ra.$$arity=2);a.def(H,"$colorize",xa=function(ka,N){return"e["+z(J,"COLOR_CODES")["$[]"](N)+"m"+ka+"e[0m"},xa.$$arity=2);return(a.def(H,"$convert_due_date",Ja=function(ka){var N, M=this,ja=d,sa=ja=d,ea=d,ua=d;ja=d;ja=function(){return v(sa=v(ea=M.due_date_days.$index(ka.$to_s().$downcase()))?ea:z(J,"DUE_DATE_DAYS_SIMPLE").$index(ka.$to_s().$downcase()))?sa:l(M.due_date_days,"map",[],(N=function(Da){null==Da&&(Da=d);return Da["$[]"](c(0,2,!1))},N.$$s=M,N.$$arity=1,N)).$index(ka.$to_s().$downcase())}();return ja=v(ja)?w(M.today,ja).$strftime(z(J,"DATE_FORMAT")):v(v(ua=ka["$nil?"]())?ua:ka["$empty?"]())?d:z(J,"Date").$parse(ka).$strftime(z(J,"DATE_FORMAT"))},Ja.$$arity=1),d)&& "convert_due_date"}(q[0],null,q)}; -(function(a){var w,F=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,d=a.send,G=t,z=t;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));F.$require("./todo.js.rb");G=q(p,"Todo").$new();z=d(F,"lambda",[],(w=function(f,h,v){null==f&&(f=t);null==h&&(h=t);null==v&&(v=t);var c=f.output,l=G,H=l.$execute;h=[h];v="number"===typeof h&&"number"===typeof v?h+v:h["$+"](v);return c.call(f,H.call(l,v).$to_html())},w.$$s=F,w.$$arity=3,w));(new VanillaTerminal({welcome:'todo list manager REPL v0.1.29
Type "help" or "copyright" for more information.

',defaultCallback:z, +(function(a){var w,F=a.top,p=[],t=a.nil,y=a.$$$,q=a.$$,d=a.send,G=t,z=t;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));F.$require("./todo.js.rb");G=q(p,"Todo").$new();z=d(F,"lambda",[],(w=function(f,h,v){null==f&&(f=t);null==h&&(h=t);null==v&&(v=t);var c=f.output,l=G,H=l.$execute;h=[h];v="number"===typeof h&&"number"===typeof v?h+v:h["$+"](v);return c.call(f,H.call(l,v).$to_html())},w.$$s=F,w.$$arity=3,w));(new VanillaTerminal({welcome:'todo list manager REPL v0.1.30
Type "help" or "copyright" for more information.

',defaultCallback:z, prompt:"todo",commands:{cls:function(f){f.clear()},copyright:function(f){f.output('todo-jsonl - Copyright (c) 2020-2021 Gabor Bata
opal - Copyright (c) 2013-2021 Adam Beynon and the Opal contributors
vanilla-terminal - Copyright (c) 2018 Javier Jimenez Villar
')},wipe:function(f){f.prompt("Are you sure remove all your todo data? y/n",function(h){"Y"===h.trim().toUpperCase()&&(localStorage.removeItem(y(q(p,"Todo"),"TODO_FILE")),f.history=[],f.historyCursor=0,f.output("todo data wiped"))})}}})).output(G.$execute(["list"]).$to_html())})(Opal); var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); diff --git a/web/app.js.rb b/web/app.js.rb index 8085120..17df833 100644 --- a/web/app.js.rb +++ b/web/app.js.rb @@ -8,7 +8,7 @@ ` var term = new VanillaTerminal({ - 'welcome': 'todo list manager REPL v0.1.29
Type "help" or "copyright" for more information.

', + 'welcome': 'todo list manager REPL v0.1.30
Type "help" or "copyright" for more information.

', 'defaultCallback': default_callback, 'prompt': 'todo', 'commands': { diff --git a/web/todo.js.rb b/web/todo.js.rb index 7d7ba6e..c19e3d7 100644 --- a/web/todo.js.rb +++ b/web/todo.js.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# todo.js.rb - todo list manager inspired by todo.txt using the jsonl format. +# todo.js.rb for web - todo list manager inspired by todo.txt using the jsonl format. # # Copyright (c) 2020-2021 Gabor Bata # @@ -70,7 +70,7 @@ class Todo CONTEXT_TAG_PATTERN = /(^| )[@+][\w-]+/ PRIORITY_FLAG = '*' TODO_FILE = "todo.jsonl" - + def execute(arguments) @text_buffer = [] begin @@ -205,7 +205,7 @@ def setup def load_tasks(item_to_check = nil) count = 0 tasks = {} - + todo_jsonl = `window.localStorage.getItem(#{TODO_FILE}) || ''` if !todo_jsonl.empty? todo_jsonl.split("\n").each do |line|