arango-driver 3.5.0.alpha0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +1073 -0
- data/arango_opal.js +15 -0
- data/lib/arango-driver.rb +61 -0
- data/lib/arango.rb +96 -0
- data/lib/arango/aql.rb +188 -0
- data/lib/arango/collection.rb +575 -0
- data/lib/arango/collection/documents.rb +122 -0
- data/lib/arango/collection/edges.rb +149 -0
- data/lib/arango/collection/importing.rb +57 -0
- data/lib/arango/collection/indexes.rb +53 -0
- data/lib/arango/collection/replication.rb +24 -0
- data/lib/arango/collection/user.rb +28 -0
- data/lib/arango/cursor.rb +67 -0
- data/lib/arango/database.rb +188 -0
- data/lib/arango/database/analyzer.rb +21 -0
- data/lib/arango/database/aql_functions.rb +54 -0
- data/lib/arango/database/aql_queries.rb +114 -0
- data/lib/arango/database/aql_query_cache.rb +27 -0
- data/lib/arango/database/collections.rb +100 -0
- data/lib/arango/database/foxx_services.rb +103 -0
- data/lib/arango/database/graph_access.rb +27 -0
- data/lib/arango/database/http_route.rb +9 -0
- data/lib/arango/database/replication.rb +96 -0
- data/lib/arango/database/stream_transactions.rb +25 -0
- data/lib/arango/database/tasks.rb +67 -0
- data/lib/arango/database/transactions.rb +15 -0
- data/lib/arango/database/user.rb +26 -0
- data/lib/arango/database/view_access.rb +37 -0
- data/lib/arango/document.rb +443 -0
- data/lib/arango/edge.rb +164 -0
- data/lib/arango/error.rb +97 -0
- data/lib/arango/error_db.rb +27 -0
- data/lib/arango/foxx.rb +255 -0
- data/lib/arango/graph.rb +202 -0
- data/lib/arango/graph/basics.rb +39 -0
- data/lib/arango/graph/edge_access.rb +56 -0
- data/lib/arango/graph/vertex_access.rb +33 -0
- data/lib/arango/helper/collection_assignment.rb +13 -0
- data/lib/arango/helper/database_assignment.rb +14 -0
- data/lib/arango/helper/request_method.rb +45 -0
- data/lib/arango/helper/return.rb +21 -0
- data/lib/arango/helper/satisfaction.rb +28 -0
- data/lib/arango/helper/server_assignment.rb +13 -0
- data/lib/arango/helper/traversal.rb +12 -0
- data/lib/arango/index.rb +103 -0
- data/lib/arango/replication.rb +231 -0
- data/lib/arango/request.rb +92 -0
- data/lib/arango/request_batch.rb +174 -0
- data/lib/arango/result.rb +130 -0
- data/lib/arango/search_view.rb +23 -0
- data/lib/arango/server.rb +68 -0
- data/lib/arango/server/administration.rb +296 -0
- data/lib/arango/server/agency.rb +23 -0
- data/lib/arango/server/async.rb +51 -0
- data/lib/arango/server/batch.rb +35 -0
- data/lib/arango/server/config.rb +76 -0
- data/lib/arango/server/databases.rb +71 -0
- data/lib/arango/server/monitoring.rb +17 -0
- data/lib/arango/server/opal_support.rb +95 -0
- data/lib/arango/server/tasks.rb +69 -0
- data/lib/arango/server/user.rb +22 -0
- data/lib/arango/task.rb +223 -0
- data/lib/arango/transaction.rb +113 -0
- data/lib/arango/traversal.rb +212 -0
- data/lib/arango/user.rb +174 -0
- data/lib/arango/version.rb +3 -0
- data/lib/arango/vertex.rb +112 -0
- data/lib/arango/view.rb +124 -0
- data/lib/arango/view/basics.rb +25 -0
- metadata +296 -0
data/arango_opal.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
var arango_opal=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=41)}([function(t,e,r){"use strict";e.a=function(){global.Opal.modules["corelib/comparable"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}t.top;var n=[],i=t.nil,$=(t.const_get_qualified,t.const_get_relative),a=(t.breaker,t.slice,t.module),s=t.truthy;return t.add_stubs(["$>","$<","$===","$raise","$class","$equal?","$<=>"]),function(n,o){var l,u,c,h,f,d,p,_=a(n,"Comparable"),y=[_].concat(o),g=i;function m(n){return t.is_a(n,t.Integer)?n:e(n,0)?1:r(n,0)?-1:0}function v(t,e){var r;g=e,r=i["$==="](g)||(!0)["$==="](g)||(!1)["$==="](g)||$(y,"Integer")["$==="](g)||$(y,"Float")["$==="](g)?e.$inspect():e.$$class,_.$raise($(y,"ArgumentError"),"comparison of "+t.$class()+" with "+r+" failed")}t.def(_,"$==",l=function(e){var r;return!!s(this["$equal?"](e))||this["$<=>"]!=t.Kernel["$<=>"]&&(this.$$comparable?(delete this.$$comparable,!1):!!s(r=this["$<=>"](e))&&0==m(r))},l.$$arity=1),t.def(_,"$>",u=function(t){var e;return s(e=this["$<=>"](t))||v(this,t),m(e)>0},u.$$arity=1),t.def(_,"$>=",c=function(t){var e;return s(e=this["$<=>"](t))||v(this,t),m(e)>=0},c.$$arity=1),t.def(_,"$<",h=function(t){var e;return s(e=this["$<=>"](t))||v(this,t),m(e)<0},h.$$arity=1),t.def(_,"$<=",f=function(t){var e;return s(e=this["$<=>"](t))||v(this,t),m(e)<=0},f.$$arity=1),t.def(_,"$between?",d=function(t,n){return!r(this,t)&&!e(this,n)},d.$$arity=2),t.def(_,"$clamp",p=function(t,e){var r;return r=t["$<=>"](e),s(r)||v(t,e),s(m(r)>0)&&this.$raise($(y,"ArgumentError"),"min argument must be smaller than max argument"),s(m(this["$<=>"](t))<0)?t:s(m(this["$<=>"](e))>0)?e:this},p.$$arity=2)}(n[0],n)}}},function(t,e){t.exports=require("fs")},function(t,e){t.exports=require("path")},function(t,e,r){"use strict";var n=r(0);void 0===global.Opal.modules["corelib/comparable"]&&"function"==typeof n.a&&Object(n.a)();e.a=function(){global.Opal.modules.pathname=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}var r=t.top,n=[],i=t.nil,$=t.const_get_qualified,a=t.const_get_relative,s=(t.breaker,t.slice,t.klass),o=t.truthy,l=t.send,u=t.module;return t.add_stubs(["$require","$include","$quote","$===","$to_s","$path","$respond_to?","$to_path","$is_a?","$nil?","$raise","$class","$==","$attr_reader","$!","$relative?","$chop_basename","$basename","$=~","$new","$source","$[]","$rindex","$sub","$absolute?","$expand_path","$plus","$unshift","$length","$!=","$empty?","$first","$shift","$+","$join","$dirname","$pop","$reverse_each","$directory?","$extname","$<=>","$nonzero?","$proc","$casecmp","$cleanpath","$inspect","$include?","$fill","$map","$entries"]),r.$require("corelib/comparable"),function(r,n,u){var c,h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q=s(r,null,"Pathname"),C=[q].concat(u);q.$$prototype.path=i,q.$include(a(C,"Comparable")),t.const_set(C[0],"SEPARATOR_PAT",new RegExp(a(C,"Regexp").$quote($(a(C,"File"),"SEPARATOR")))),t.def(q,"$initialize",c=function(t){return o(a(C,"Pathname")["$==="](t))?this.path=t.$path().$to_s():o(t["$respond_to?"]("to_path"))?this.path=t.$to_path():o(t["$is_a?"](a(C,"String")))?this.path=t:o(t["$nil?"]())?this.$raise(a(C,"TypeError"),"no implicit conversion of nil into String"):this.$raise(a(C,"TypeError"),"no implicit conversion of "+t.$class()+" into String"),this.path["$=="]("\0")?this.$raise(a(C,"ArgumentError")):i},c.$$arity=1),q.$attr_reader("path"),t.def(q,"$==",h=function(t){return t.$path()["$=="](this.path)},h.$$arity=1),t.def(q,"$absolute?",f=function(){return this["$relative?"]()["$!"]()},f.$$arity=0),t.def(q,"$relative?",d=function(){var e,r,n=i,$=i;for(n=this.path;o($=this.$chop_basename(n));)r=$,n=null==(e=t.to_ary(r))[0]?i:e[0];return n["$=="]("")},d.$$arity=0),t.def(q,"$chop_basename",p=function(t){var e;return e=a(C,"File").$basename(t),o(a(C,"Regexp").$new("^"+$(a(C,"Pathname"),"SEPARATOR_PAT").$source()+"?$")["$=~"](e))?i:[t["$[]"](0,t.$rindex(e)),e]},p.$$arity=1),t.def(q,"$root?",_=function(){return this.path["$=="]("/")},_.$$arity=0),t.def(q,"$parent",y=function(){var t=this,e=i;return(e=t.path.$sub(/\/([^\/]+\/?$)/,""))["$=="]("")&&(e=o(t["$absolute?"]())?"/":"."),a(C,"Pathname").$new(e)},y.$$arity=0),t.def(q,"$sub",g=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),a(C,"Pathname").$new(l(n.path,"sub",t.to_a(r)))},g.$$arity=-1),t.def(q,"$cleanpath",m=function(){return t.normalize(this.path)},m.$$arity=0),t.def(q,"$to_path",v=function(){return this.path},v.$$arity=0),t.def(q,"$hash",b=function(){return this.path},b.$$arity=0),t.def(q,"$expand_path",O=function(){return a(C,"Pathname").$new(a(C,"File").$expand_path(this.path))},O.$$arity=0),t.def(q,"$+",w=function(t){return o(a(C,"Pathname")["$==="](t))||(t=a(C,"Pathname").$new(t)),a(C,"Pathname").$new(this.$plus(this.path,t.$to_s()))},w.$$arity=1),t.def(q,"$plus",E=function(r,n){var $,s,l,u=i,c=i,h=i,f=i,d=i,p=i,_=i,y=i,g=i;for(u=n,c=[],h=[];o(f=this.$chop_basename(u));)l=f,u=null==(s=t.to_ary(l))[0]?i:s[0],d=null==s[1]?i:s[1],c.$unshift(u.$length()),h.$unshift(d);if(o(u["$!="]("")))return n;for(p=r;o(!0);){for(;o(o(l=h["$empty?"]()["$!"]())?h.$first()["$=="]("."):l);)c.$shift(),h.$shift();if(!o(_=this.$chop_basename(p)))break;if(l=_,p=null==(s=t.to_ary(l))[0]?i:s[0],!(y=null==s[1]?i:s[1])["$=="](".")){if(o(o(s=o(l=y["$=="](".."))?l:h["$empty?"]())?s:h.$first()["$!="](".."))){p=e(p,y);break}c.$shift(),h.$shift()}}if(_=this.$chop_basename(p),o(o($=_["$!"]())?new RegExp(a(C,"SEPARATOR_PAT"))["$=~"](a(C,"File").$basename(p)):$))for(;o(o(s=h["$empty?"]()["$!"]())?h.$first()["$=="](".."):s);)c.$shift(),h.$shift();return o(h["$empty?"]()["$!"]())?(g=n["$[]"](t.Range.$new(c.$first(),-1,!1)),o(_)?a(C,"File").$join(p,g):e(p,g)):o(_)?p:a(C,"File").$dirname(p)},E.$$arity=2),t.def(q,"$join",x=function(r){try{var n,$,s,u=this,c=i;return n=t.slice.call(arguments,0,arguments.length),o(($=n)["$empty?"]())?u:(c=$.$pop(),o(a(C,"Pathname")["$==="](c))||(c=a(C,"Pathname").$new(c)),o(c["$absolute?"]())?c:(l($,"reverse_each",[],((s=function(r){null==s.$$s||s.$$s;if(null==r&&(r=i),o(a(C,"Pathname")["$==="](r))||(r=a(C,"Pathname").$new(r)),c=e(r,c),!o(c["$absolute?"]()))return i;t.ret(c)}).$$s=u,s.$$arity=1,s)),e(u,c)))}catch(e){if(e===t.returner)return e.$v;throw e}},x.$$arity=-1),t.def(q,"$split",k=function(){return[this.$dirname(),this.$basename()]},k.$$arity=0),t.def(q,"$dirname",A=function(){return a(C,"Pathname").$new(a(C,"File").$dirname(this.path))},A.$$arity=0),t.def(q,"$basename",M=function(){return a(C,"Pathname").$new(a(C,"File").$basename(this.path))},M.$$arity=0),t.def(q,"$directory?",I=function(){return a(C,"File")["$directory?"](this.path)},I.$$arity=0),t.def(q,"$extname",S=function(){return a(C,"File").$extname(this.path)},S.$$arity=0),t.def(q,"$<=>",N=function(t){return this.$path()["$<=>"](t.$path())},N.$$arity=1),t.alias(q,"eql?","=="),t.alias(q,"===","=="),t.alias(q,"to_str","to_path"),t.alias(q,"to_s","to_path"),t.const_set(C[0],"SAME_PATHS",o($(a(C,"File"),"FNM_SYSCASE")["$nonzero?"]())?l(q,"proc",[],((j=function(t,e){return null==j.$$s||j.$$s,null==t&&(t=i),null==e&&(e=i),t.$casecmp(e)["$=="](0)}).$$s=q,j.$$arity=2,j)):l(q,"proc",[],((R=function(t,e){return null==R.$$s||R.$$s,null==t&&(t=i),null==e&&(e=i),t["$=="](e)}).$$s=q,R.$$arity=2,R))),t.def(q,"$relative_path_from",T=function(r){var n,$,s,u=i,c=i,h=i,f=i,d=i,p=i,_=i;for(s=this.$cleanpath().$to_s(),r=r.$cleanpath().$to_s(),u=s,c=[];o(h=this.$chop_basename(u));)$=h,u=null==(n=t.to_ary($))[0]?i:n[0],f=null==n[1]?i:n[1],o(f["$!="]("."))&&c.$unshift(f);for(d=r,p=[];o(h=this.$chop_basename(d));)$=h,d=null==(n=t.to_ary($))[0]?i:n[0],f=null==n[1]?i:n[1],o(f["$!="]("."))&&p.$unshift(f);for(o(a(C,"SAME_PATHS")["$[]"](u,d))||this.$raise(a(C,"ArgumentError"),"different prefix: "+u.$inspect()+" and "+r.$inspect());o(o(n=o($=c["$empty?"]()["$!"]())?p["$empty?"]()["$!"]():$)?a(C,"SAME_PATHS")["$[]"](c.$first(),p.$first()):n);)c.$shift(),p.$shift();return o(p["$include?"](".."))&&this.$raise(a(C,"ArgumentError"),"base_directory has ..: "+r.$inspect()),p.$fill(".."),_=e(p,c),o(_["$empty?"]())?a(C,"Pathname").$new("."):a(C,"Pathname").$new(l(a(C,"File"),"join",t.to_a(_)))},T.$$arity=1),t.def(q,"$entries",z=function(){var t;return l(a(C,"Dir").$entries(this.path),"map",[],((t=function(e){var r=null==t.$$s?this:t.$$s;return null==e&&(e=i),r.$class().$new(e)}).$$s=this,t.$$arity=1,t))},z.$$arity=0)}(n[0],0,n),function(e,r){var n,i=u(e,"Kernel"),$=[i].concat(r);t.def(i,"$Pathname",n=function(t){return a($,"Pathname").$new(t)},n.$$arity=1)}(n[0],n)}}},function(module,__webpack_exports__,__webpack_require__){"use strict";const opal_code=function(){global.Opal.modules["corelib/module"]=function(Opal){function $rb_lt(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function $rb_gt(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}var self=Opal.top,$nesting=[],nil=Opal.nil,$$$=Opal.const_get_qualified,$$=Opal.const_get_relative,$breaker=Opal.breaker,$slice=Opal.slice,$klass=Opal.klass,$send=Opal.send,$truthy=Opal.truthy,$lambda=Opal.lambda,$range=Opal.range,$hash2=Opal.hash2;return Opal.add_stubs(["$module_eval","$to_proc","$===","$raise","$equal?","$<","$>","$nil?","$attr_reader","$attr_writer","$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"]),function($base,$super,$parent_nesting){var self=$klass($base,$super,"Module"),$nesting=[self].concat($parent_nesting),$Module_allocate$1,$Module_initialize$2,$Module_$eq_eq_eq$3,$Module_$lt$4,$Module_$lt_eq$5,$Module_$gt$6,$Module_$gt_eq$7,$Module_$lt_eq_gt$8,$Module_alias_method$9,$Module_alias_native$10,$Module_ancestors$11,$Module_append_features$12,$Module_attr_accessor$13,$Module_attr_reader$14,$Module_attr_writer$15,$Module_autoload$16,$Module_class_variables$17,$Module_class_variable_get$18,$Module_class_variable_set$19,$Module_class_variable_defined$ques$20,$Module_remove_class_variable$21,$Module_constants$22,$Module_constants$23,$Module_nesting$24,$Module_const_defined$ques$25,$Module_const_get$26,$Module_const_missing$28,$Module_const_set$29,$Module_public_constant$30,$Module_define_method$31,$Module_remove_method$33,$Module_singleton_class$ques$34,$Module_include$35,$Module_included_modules$36,$Module_include$ques$37,$Module_instance_method$38,$Module_instance_methods$39,$Module_included$40,$Module_extended$41,$Module_extend_object$42,$Module_method_added$43,$Module_method_removed$44,$Module_method_undefined$45,$Module_module_eval$46,$Module_module_exec$48,$Module_method_defined$ques$49,$Module_module_function$50,$Module_name$51,$Module_prepend$52,$Module_prepend_features$53,$Module_prepended$54,$Module_remove_const$55,$Module_to_s$56,$Module_undef_method$57,$Module_instance_variables$58,$Module_dup$59,$Module_copy_class_variables$60,$Module_copy_constants$61;return Opal.defs(self,"$allocate",$Module_allocate$1=function(){var t=Opal.allocate_module(nil,(function(){}));return this!==Opal.Module&&Object.setPrototypeOf(t,this.$$prototype),t},$Module_allocate$1.$$arity=0),Opal.def(self,"$initialize",$Module_initialize$2=function(){var t=$Module_initialize$2.$$p,e=t||nil;return t&&($Module_initialize$2.$$p=null),t&&($Module_initialize$2.$$p=null),e!==nil?$send(this,"module_eval",[],e.$to_proc()):nil},$Module_initialize$2.$$arity=0),Opal.def(self,"$===",$Module_$eq_eq_eq$3=function(t){return!$truthy(null==t)&&Opal.is_a(t,this)},$Module_$eq_eq_eq$3.$$arity=1),Opal.def(self,"$<",$Module_$lt$4=function(t){$truthy($$($nesting,"Module")["$==="](t))||this.$raise($$($nesting,"TypeError"),"compared with non class/module");var e,r,n;if(this===t)return!1;for(r=0,n=(e=Opal.ancestors(this)).length;r<n;r++)if(e[r]===t)return!0;for(r=0,n=(e=Opal.ancestors(t)).length;r<n;r++)if(e[r]===this)return!1;return nil},$Module_$lt$4.$$arity=1),Opal.def(self,"$<=",$Module_$lt_eq$5=function(t){var e;return $truthy(e=this["$equal?"](t))?e:$rb_lt(this,t)},$Module_$lt_eq$5.$$arity=1),Opal.def(self,"$>",$Module_$gt$6=function(t){return $truthy($$($nesting,"Module")["$==="](t))||this.$raise($$($nesting,"TypeError"),"compared with non class/module"),$rb_lt(t,this)},$Module_$gt$6.$$arity=1),Opal.def(self,"$>=",$Module_$gt_eq$7=function(t){var e;return $truthy(e=this["$equal?"](t))?e:$rb_gt(this,t)},$Module_$gt_eq$7.$$arity=1),Opal.def(self,"$<=>",$Module_$lt_eq_gt$8=function(t){var e=nil;return this===t?0:$truthy($$($nesting,"Module")["$==="](t))?(e=$rb_lt(this,t),$truthy(e["$nil?"]())?nil:$truthy(e)?-1:1):nil},$Module_$lt_eq_gt$8.$$arity=1),Opal.def(self,"$alias_method",$Module_alias_method$9=function(t,e){return Opal.alias(this,t,e),this},$Module_alias_method$9.$$arity=2),Opal.def(self,"$alias_native",$Module_alias_native$10=function(t,e){return null==e&&(e=t),Opal.alias_native(this,t,e),this},$Module_alias_native$10.$$arity=-2),Opal.def(self,"$ancestors",$Module_ancestors$11=function(){return Opal.ancestors(this)},$Module_ancestors$11.$$arity=0),Opal.def(self,"$append_features",$Module_append_features$12=function(t){return Opal.append_features(this,t),this},$Module_append_features$12.$$arity=1),Opal.def(self,"$attr_accessor",$Module_attr_accessor$13=function(t){var e,r=this;return e=Opal.slice.call(arguments,0,arguments.length),$send(r,"attr_reader",Opal.to_a(e)),$send(r,"attr_writer",Opal.to_a(e))},$Module_attr_accessor$13.$$arity=-1),Opal.alias(self,"attr","attr_accessor"),Opal.def(self,"$attr_reader",$Module_attr_reader$14=function(t){var e,r=this;e=Opal.slice.call(arguments,0,arguments.length);for(var n=r.$$prototype,i=e.length-1;i>=0;i--){var $=e[i],a="$"+$,s=Opal.ivar($),o=function(t){return function(){return null==this[t]?nil:this[t]}}(s);Opal.defineProperty(n,s,nil),o.$$parameters=[],o.$$arity=0,Opal.defn(r,a,o)}return nil},$Module_attr_reader$14.$$arity=-1),Opal.def(self,"$attr_writer",$Module_attr_writer$15=function(t){var e,r=this;e=Opal.slice.call(arguments,0,arguments.length);for(var n=r.$$prototype,i=e.length-1;i>=0;i--){var $=e[i],a="$"+$+"=",s=Opal.ivar($),o=function(t){return function(e){return this[t]=e}}(s);o.$$parameters=[["req"]],o.$$arity=1,Opal.defineProperty(n,s,nil),Opal.defn(r,a,o)}return nil},$Module_attr_writer$15.$$arity=-1),Opal.def(self,"$autoload",$Module_autoload$16=function(t,e){return null==this.$$autoload&&(this.$$autoload={}),Opal.const_cache_version++,this.$$autoload[t]=e,nil},$Module_autoload$16.$$arity=2),Opal.def(self,"$class_variables",$Module_class_variables$17=function(){return Object.keys(Opal.class_variables(this))},$Module_class_variables$17.$$arity=0),Opal.def(self,"$class_variable_get",$Module_class_variable_get$18=function(t){t=$$($nesting,"Opal")["$class_variable_name!"](t);var e=Opal.class_variables(this)[t];return null==e&&this.$raise($$($nesting,"NameError").$new("uninitialized class variable "+t+" in "+this,t)),e},$Module_class_variable_get$18.$$arity=1),Opal.def(self,"$class_variable_set",$Module_class_variable_set$19=function(t,e){return t=$$($nesting,"Opal")["$class_variable_name!"](t),Opal.class_variable_set(this,t,e)},$Module_class_variable_set$19.$$arity=2),Opal.def(self,"$class_variable_defined?",$Module_class_variable_defined$ques$20=function(t){return t=$$($nesting,"Opal")["$class_variable_name!"](t),Opal.class_variables(this).hasOwnProperty(t)},$Module_class_variable_defined$ques$20.$$arity=1),Opal.def(self,"$remove_class_variable",$Module_remove_class_variable$21=function(t){if(t=$$($nesting,"Opal")["$class_variable_name!"](t),Opal.hasOwnProperty.call(this.$$cvars,t)){var e=this.$$cvars[t];return delete this.$$cvars[t],e}this.$raise($$($nesting,"NameError"),"cannot remove "+t+" for "+this)},$Module_remove_class_variable$21.$$arity=1),Opal.def(self,"$constants",$Module_constants$22=function(t){return null==t&&(t=!0),Opal.constants(this,t)},$Module_constants$22.$$arity=-1),Opal.defs(self,"$constants",$Module_constants$23=function(t){if(null==t){var e,r,n,i=(this.$$nesting||[]).concat(Opal.Object),$={};for(r=0,n=i.length;r<n;r++)for(e in i[r].$$const)$[e]=!0;return Object.keys($)}return Opal.constants(this,t)},$Module_constants$23.$$arity=-1),Opal.defs(self,"$nesting",$Module_nesting$24=function(){return this.$$nesting||[]},$Module_nesting$24.$$arity=0),Opal.def(self,"$const_defined?",$Module_const_defined$ques$25=function(t,e){null==e&&(e=!0),t=$$($nesting,"Opal")["$const_name!"](t),$truthy(t["$=~"]($$$($$($nesting,"Opal"),"CONST_NAME_REGEXP")))||this.$raise($$($nesting,"NameError").$new("wrong constant name "+t,t));var r,n,i=[this];for(e&&(i=i.concat(Opal.ancestors(this)),this.$$is_module&&(i=i.concat([Opal.Object]).concat(Opal.ancestors(Opal.Object)))),r=0,n=i.length;r<n;r++)if(null!=i[r].$$const[t])return!0;return!1},$Module_const_defined$ques$25.$$arity=-2),Opal.def(self,"$const_get",$Module_const_get$26=function(t,e){var r;return null==e&&(e=!0),0===(t=$$($nesting,"Opal")["$const_name!"](t)).indexOf("::")&&"::"!==t&&(t=t.slice(2)),$truthy(-1!=t.indexOf("::")&&"::"!=t)?$send(t.$split("::"),"inject",[this],((r=function(t,e){null==r.$$s||r.$$s;return null==t&&(t=nil),null==e&&(e=nil),t.$const_get(e)}).$$s=this,r.$$arity=2,r)):($truthy(t["$=~"]($$$($$($nesting,"Opal"),"CONST_NAME_REGEXP")))||this.$raise($$($nesting,"NameError").$new("wrong constant name "+t,t)),e?$$([this],t):Opal.const_get_local(this,t))},$Module_const_get$26.$$arity=-2),Opal.def(self,"$const_missing",$Module_const_missing$28=function(t){var e,r=this;if(r.$$autoload){var n=r.$$autoload[t];if(n)return r.$require(n),r.$const_get(t)}return e=r["$=="]($$($nesting,"Object"))?t:r+"::"+t,r.$raise($$($nesting,"NameError").$new("uninitialized constant "+e,t))},$Module_const_missing$28.$$arity=1),Opal.def(self,"$const_set",$Module_const_set$29=function(t,e){var r;return t=$$($nesting,"Opal")["$const_name!"](t),$truthy($truthy(r=t["$!~"]($$$($$($nesting,"Opal"),"CONST_NAME_REGEXP")))?r:t["$start_with?"]("::"))&&this.$raise($$($nesting,"NameError").$new("wrong constant name "+t,t)),Opal.const_set(this,t,e),e},$Module_const_set$29.$$arity=2),Opal.def(self,"$public_constant",$Module_public_constant$30=function(t){return nil},$Module_public_constant$30.$$arity=1),Opal.def(self,"$define_method",$Module_define_method$31=function(t,e){var r,n,i=$Module_define_method$31.$$p,$=i||nil,a=this,s=nil;i&&($Module_define_method$31.$$p=null),i&&($Module_define_method$31.$$p=null),$truthy(void 0===e&&$===nil)&&a.$raise($$($nesting,"ArgumentError"),"tried to create a Proc object without a block");var o="$"+t;return($=$truthy(r=$)?r:(s=e,$$($nesting,"Proc")["$==="](s)?e:$$($nesting,"Method")["$==="](s)?e.$to_proc().$$unbound:$$($nesting,"UnboundMethod")["$==="](s)?$lambda(((n=function(t){var r,i=null==n.$$s?this:n.$$s,$=nil;return r=Opal.slice.call(arguments,0,arguments.length),$=e.$bind(i),$send($,"call",Opal.to_a(r))}).$$s=a,n.$$arity=-1,n)):a.$raise($$($nesting,"TypeError"),"wrong argument type "+$.$class()+" (expected Proc/Method)"))).$$jsid=t,$.$$s=null,$.$$def=$,$.$$define_meth=!0,Opal.defn(a,o,$),t},$Module_define_method$31.$$arity=-2),Opal.def(self,"$remove_method",$Module_remove_method$33=function(t){for(var e,r=this,n=0,i=(e=Opal.slice.call(arguments,0,arguments.length)).length;n<i;n++)Opal.rdef(r,"$"+e[n]);return r},$Module_remove_method$33.$$arity=-1),Opal.def(self,"$singleton_class?",$Module_singleton_class$ques$34=function(){return!!this.$$is_singleton},$Module_singleton_class$ques$34.$$arity=0),Opal.def(self,"$include",$Module_include$35=function(t){for(var e,r=this,n=(e=Opal.slice.call(arguments,0,arguments.length)).length-1;n>=0;n--){var i=e[n];i.$$is_module||r.$raise($$($nesting,"TypeError"),"wrong argument type "+i.$class()+" (expected Module)"),i.$append_features(r),i.$included(r)}return r},$Module_include$35.$$arity=-1),Opal.def(self,"$included_modules",$Module_included_modules$36=function(){return Opal.included_modules(this)},$Module_included_modules$36.$$arity=0),Opal.def(self,"$include?",$Module_include$ques$37=function(t){t.$$is_module||this.$raise($$($nesting,"TypeError"),"wrong argument type "+t.$class()+" (expected Module)");var e,r,n,i=Opal.ancestors(this);for(e=0,r=i.length;e<r;e++)if((n=i[e])===t&&n!==this)return!0;return!1},$Module_include$ques$37.$$arity=1),Opal.def(self,"$instance_method",$Module_instance_method$38=function(t){var e=this.$$prototype["$"+t];return e&&!e.$$stub||this.$raise($$($nesting,"NameError").$new("undefined method `"+t+"' for class `"+this.$name()+"'",t)),$$($nesting,"UnboundMethod").$new(this,e.$$owner||this,e,t)},$Module_instance_method$38.$$arity=1),Opal.def(self,"$instance_methods",$Module_instance_methods$39=function(t){return null==t&&(t=!0),$truthy(t)?Opal.instance_methods(this):Opal.own_instance_methods(this)},$Module_instance_methods$39.$$arity=-1),Opal.def(self,"$included",$Module_included$40=function(t){return nil},$Module_included$40.$$arity=1),Opal.def(self,"$extended",$Module_extended$41=function(t){return nil},$Module_extended$41.$$arity=1),Opal.def(self,"$extend_object",$Module_extend_object$42=function(t){return nil},$Module_extend_object$42.$$arity=1),Opal.def(self,"$method_added",$Module_method_added$43=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$Module_method_added$43.$$arity=-1),Opal.def(self,"$method_removed",$Module_method_removed$44=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$Module_method_removed$44.$$arity=-1),Opal.def(self,"$method_undefined",$Module_method_undefined$45=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$Module_method_undefined$45.$$arity=-1),Opal.def(self,"$module_eval",$Module_module_eval$46=function $$module_eval($a){var $iter=$Module_module_eval$46.$$p,block=$iter||nil,$post_args,args,$b,$$47,self=this,string=nil,file=nil,_lineno=nil,default_eval_options=nil,compiling_options=nil,compiled=nil;$iter&&($Module_module_eval$46.$$p=null),$iter&&($Module_module_eval$46.$$p=null),$post_args=Opal.slice.call(arguments,0,arguments.length),args=$post_args,$truthy($truthy($b=block["$nil?"]())?!!Opal.compile:$b)?($truthy($range(1,3,!1)["$cover?"](args.$size()))||$$($nesting,"Kernel").$raise($$($nesting,"ArgumentError"),"wrong number of arguments (0 for 1..3)"),$b=[].concat(Opal.to_a(args)),string=null==$b[0]?nil:$b[0],file=null==$b[1]?nil:$b[1],_lineno=null==$b[2]?nil:$b[2],default_eval_options=$hash2(["file","eval"],{file:$truthy($b=file)?$b:"(eval)",eval:!0}),compiling_options=Opal.hash({arity_check:!1}).$merge(default_eval_options),compiled=$$($nesting,"Opal").$compile(string,compiling_options),block=$send($$($nesting,"Kernel"),"proc",[],($$47=function(){var self=null==$$47.$$s?this:$$47.$$s;return function(self){return eval(compiled)}(self)},$$47.$$s=self,$$47.$$arity=0,$$47))):$truthy(args["$any?"]())&&$$($nesting,"Kernel").$raise($$($nesting,"ArgumentError"),"wrong number of arguments ("+args.$size()+" for 0)\n\n NOTE:If you want to enable passing a String argument please add \"require 'opal-parser'\" to your script\n");var old=block.$$s,result;return block.$$s=null,result=block.apply(self,[self]),block.$$s=old,result},$Module_module_eval$46.$$arity=-1),Opal.alias(self,"class_eval","module_eval"),Opal.def(self,"$module_exec",$Module_module_exec$48=function(t){var e,r=$Module_module_exec$48.$$p,n=r||nil,i=this;r&&($Module_module_exec$48.$$p=null),r&&($Module_module_exec$48.$$p=null),e=Opal.slice.call(arguments,0,arguments.length),n===nil&&i.$raise($$($nesting,"LocalJumpError"),"no block given");var $,a=n.$$s;return n.$$s=null,$=n.apply(i,e),n.$$s=a,$},$Module_module_exec$48.$$arity=-1),Opal.alias(self,"class_exec","module_exec"),Opal.def(self,"$method_defined?",$Module_method_defined$ques$49=function(t){var e=this.$$prototype["$"+t];return!!e&&!e.$$stub},$Module_method_defined$ques$49.$$arity=1),Opal.def(self,"$module_function",$Module_module_function$50=function(t){var e,r=this;if(0===(e=Opal.slice.call(arguments,0,arguments.length)).length)r.$$module_function=!0;else for(var n=0,i=e.length;n<i;n++){var $=e[n],a="$"+$,s=r.$$prototype[a];Opal.defs(r,a,s)}return r},$Module_module_function$50.$$arity=-1),Opal.def(self,"$name",$Module_name$51=function(){if(this.$$full_name)return this.$$full_name;for(var t=[],e=this;e;){if(e.$$name===nil||null==e.$$name)return nil;if(t.unshift(e.$$name),(e=e.$$base_module)===Opal.Object)break}return 0===t.length?nil:this.$$full_name=t.join("::")},$Module_name$51.$$arity=0),Opal.def(self,"$prepend",$Module_prepend$52=function(t){var e,r=this;0===(e=Opal.slice.call(arguments,0,arguments.length)).length&&r.$raise($$($nesting,"ArgumentError"),"wrong number of arguments (given 0, expected 1+)");for(var n=e.length-1;n>=0;n--){var i=e[n];i.$$is_module||r.$raise($$($nesting,"TypeError"),"wrong argument type "+i.$class()+" (expected Module)"),i.$prepend_features(r),i.$prepended(r)}return r},$Module_prepend$52.$$arity=-1),Opal.def(self,"$prepend_features",$Module_prepend_features$53=function(t){return this.$$is_module||this.$raise($$($nesting,"TypeError"),"wrong argument type "+this.$class()+" (expected Module)"),Opal.prepend_features(this,t),this},$Module_prepend_features$53.$$arity=1),Opal.def(self,"$prepended",$Module_prepended$54=function(t){return nil},$Module_prepended$54.$$arity=1),Opal.def(self,"$remove_const",$Module_remove_const$55=function(t){return Opal.const_remove(this,t)},$Module_remove_const$55.$$arity=1),Opal.def(self,"$to_s",$Module_to_s$56=function(){var t;return $truthy(t=Opal.Module.$name.call(this))?t:"#<"+(this.$$is_module?"Module":"Class")+":0x"+this.$__id__().$to_s(16)+">"},$Module_to_s$56.$$arity=0),Opal.def(self,"$undef_method",$Module_undef_method$57=function(t){for(var e,r=this,n=0,i=(e=Opal.slice.call(arguments,0,arguments.length)).length;n<i;n++)Opal.udef(r,"$"+e[n]);return r},$Module_undef_method$57.$$arity=-1),Opal.def(self,"$instance_variables",$Module_instance_variables$58=function(){var t=nil;Opal.Module.$$nesting=$nesting,t=this.$constants();var e=[];for(var r in this)this.hasOwnProperty(r)&&"$"!==r.charAt(0)&&"constructor"!==r&&!t["$include?"](r)&&e.push("@"+r);return e},$Module_instance_variables$58.$$arity=0),Opal.def(self,"$dup",$Module_dup$59=function(){var t=$Module_dup$59.$$p,e=this,r=nil,n=nil,i=nil,$=nil;for(t&&($Module_dup$59.$$p=null),i=0,$=arguments.length,n=new Array($);i<$;i++)n[i]=arguments[i];return(r=$send(e,Opal.find_super_dispatcher(e,"dup",$Module_dup$59,!1),n,t)).$copy_class_variables(e),r.$copy_constants(e),r},$Module_dup$59.$$arity=0),Opal.def(self,"$copy_class_variables",$Module_copy_class_variables$60=function(t){for(var e in t.$$cvars)this.$$cvars[e]=t.$$cvars[e]},$Module_copy_class_variables$60.$$arity=1),Opal.def(self,"$copy_constants",$Module_copy_constants$61=function(t){var e,r=t.$$const;for(e in r)Opal.const_set(this,e,r[e])},$Module_copy_constants$61.$$arity=1),nil&&"copy_constants"}($nesting[0],null,$nesting)}};__webpack_exports__.a=opal_code},function(t,e,r){"use strict";e.a=function(){global.Opal.modules["opal/regexp_anchors"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.module);return t.add_stubs(["$==","$new"]),function(e,$){var a=[i(e,"Opal")].concat($);t.const_set(a[0],"REGEXP_START",n(a,"RUBY_ENGINE")["$=="]("opal")?"^":r),t.const_set(a[0],"REGEXP_END",n(a,"RUBY_ENGINE")["$=="]("opal")?"$":r),t.const_set(a[0],"FORBIDDEN_STARTING_IDENTIFIER_CHARS","\\u0001-\\u002F\\u003A-\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"),t.const_set(a[0],"FORBIDDEN_ENDING_IDENTIFIER_CHARS","\\u0001-\\u0020\\u0022-\\u002F\\u003A-\\u003E\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"),t.const_set(a[0],"INLINE_IDENTIFIER_REGEXP",n(a,"Regexp").$new("[^"+n(a,"FORBIDDEN_STARTING_IDENTIFIER_CHARS")+"]*[^"+n(a,"FORBIDDEN_ENDING_IDENTIFIER_CHARS")+"]")),t.const_set(a[0],"FORBIDDEN_CONST_NAME_CHARS","\\u0001-\\u0020\\u0021-\\u002F\\u003B-\\u003F\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"),t.const_set(a[0],"CONST_NAME_REGEXP",n(a,"Regexp").$new(n(a,"REGEXP_START")+"(::)?[A-Z][^"+n(a,"FORBIDDEN_CONST_NAME_CHARS")+"]*"+n(a,"REGEXP_END")))}(e[0],e)}}},function(t,e){t.exports=require("util")},function(t,e,r){t.exports=d,d.Minimatch=p;var n={sep:"/"};try{n=r(2)}catch(t){}var i=d.GLOBSTAR=p.GLOBSTAR={},$=r(23),a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},s="[^/]",o=s+"*?",l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",u="(?:(?!(?:\\/|^)\\.).)*?",c="().*{}+?[]^$\\!".split("").reduce((function(t,e){return t[e]=!0,t}),{});var h=/\/+/;function f(t,e){t=t||{},e=e||{};var r={};return Object.keys(e).forEach((function(t){r[t]=e[t]})),Object.keys(t).forEach((function(e){r[e]=t[e]})),r}function d(t,e,r){if("string"!=typeof e)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new p(e,r).match(t))}function p(t,e){if(!(this instanceof p))return new p(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),"/"!==n.sep&&(t=t.split(n.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function _(t,e){if(e||(e=this instanceof p?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:$(t)}d.filter=function(t,e){return e=e||{},function(r,n,i){return d(r,t,e)}},d.defaults=function(t){if(!t||!Object.keys(t).length)return d;var e=d,r=function(r,n,i){return e.minimatch(r,n,f(t,i))};return r.Minimatch=function(r,n){return new e.Minimatch(r,f(t,n))},r},p.defaults=function(t){return t&&Object.keys(t).length?d.defaults(t).Minimatch:p},p.prototype.debug=function(){},p.prototype.make=function(){if(this._made)return;var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map((function(t){return t.split(h)})),this.debug(this.pattern,r),r=r.map((function(t,e,r){return t.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((function(t){return-1===t.indexOf(!1)})),this.debug(this.pattern,r),this.set=r},p.prototype.parseNegate=function(){var t=this.pattern,e=!1,r=this.options,n=0;if(r.nonegate)return;for(var i=0,$=t.length;i<$&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.substr(n));this.negate=e},d.braceExpand=function(t,e){return _(t,e)},p.prototype.braceExpand=_,p.prototype.parse=function(t,e){if(t.length>65536)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&"**"===t)return i;if(""===t)return"";var n,$="",l=!!r.nocase,u=!1,h=[],f=[],d=!1,p=-1,_=-1,g="."===t.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this;function v(){if(n){switch(n){case"*":$+=o,l=!0;break;case"?":$+=s,l=!0;break;default:$+="\\"+n}m.debug("clearStateChar %j %j",n,$),n=!1}}for(var b,O=0,w=t.length;O<w&&(b=t.charAt(O));O++)if(this.debug("%s\t%s %s %j",t,O,$,b),u&&c[b])$+="\\"+b,u=!1;else switch(b){case"/":return!1;case"\\":v(),u=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,O,$,b),d){this.debug(" in class"),"!"===b&&O===_+1&&(b="^"),$+=b;continue}m.debug("call clearStateChar %j",n),v(),n=b,r.noext&&v();continue;case"(":if(d){$+="(";continue}if(!n){$+="\\(";continue}h.push({type:n,start:O-1,reStart:$.length,open:a[n].open,close:a[n].close}),$+="!"===n?"(?:(?!(?:":"(?:",this.debug("plType %j %j",n,$),n=!1;continue;case")":if(d||!h.length){$+="\\)";continue}v(),l=!0;var E=h.pop();$+=E.close,"!"===E.type&&f.push(E),E.reEnd=$.length;continue;case"|":if(d||!h.length||u){$+="\\|",u=!1;continue}v(),$+="|";continue;case"[":if(v(),d){$+="\\"+b;continue}d=!0,_=O,p=$.length,$+=b;continue;case"]":if(O===_+1||!d){$+="\\"+b,u=!1;continue}if(d){var x=t.substring(_+1,O);try{RegExp("["+x+"]")}catch(t){var k=this.parse(x,y);$=$.substr(0,p)+"\\["+k[0]+"\\]",l=l||k[1],d=!1;continue}}l=!0,d=!1,$+=b;continue;default:v(),u?u=!1:!c[b]||"^"===b&&d||($+="\\"),$+=b}d&&(x=t.substr(_+1),k=this.parse(x,y),$=$.substr(0,p)+"\\["+k[0],l=l||k[1]);for(E=h.pop();E;E=h.pop()){var A=$.slice(E.reStart+E.open.length);this.debug("setting tail",$,E),A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,e,r){return r||(r="\\"),e+e+r+"|"})),this.debug("tail=%j\n %s",A,A,E,$);var M="*"===E.type?o:"?"===E.type?s:"\\"+E.type;l=!0,$=$.slice(0,E.reStart)+M+"\\("+A}v(),u&&($+="\\\\");var I=!1;switch($.charAt(0)){case".":case"[":case"(":I=!0}for(var S=f.length-1;S>-1;S--){var N=f[S],j=$.slice(0,N.reStart),R=$.slice(N.reStart,N.reEnd-8),T=$.slice(N.reEnd-8,N.reEnd),z=$.slice(N.reEnd);T+=z;var q=j.split("(").length-1,C=z;for(O=0;O<q;O++)C=C.replace(/\)[+*?]?/,"");var P="";""===(z=C)&&e!==y&&(P="$"),$=j+R+z+P+T}""!==$&&l&&($="(?=.)"+$);I&&($=g+$);if(e===y)return[$,l];if(!l)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var F=r.nocase?"i":"";try{var D=new RegExp("^"+$+"$",F)}catch(t){return new RegExp("$.")}return D._glob=t,D._src=$,D};var y={};d.makeRe=function(t,e){return new p(t,e||{}).makeRe()},p.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?o:e.dot?l:u,n=e.nocase?"i":"",$=t.map((function(t){return t.map((function(t){return t===i?r:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src})).join("\\/")})).join("|");$="^(?:"+$+")$",this.negate&&($="^(?!"+$+").*$");try{this.regexp=new RegExp($,n)}catch(t){this.regexp=!1}return this.regexp},d.match=function(t,e,r){var n=new p(e,r=r||{});return t=t.filter((function(t){return n.match(t)})),n.options.nonull&&!t.length&&t.push(e),t},p.prototype.match=function(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"/"!==n.sep&&(t=t.split(n.sep).join("/"));t=t.split(h),this.debug(this.pattern,"split",t);var i,$,a=this.set;for(this.debug(this.pattern,"set",a),$=t.length-1;$>=0&&!(i=t[$]);$--);for($=0;$<a.length;$++){var s=a[$],o=t;if(r.matchBase&&1===s.length&&(o=[i]),this.matchOne(o,s,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},p.prototype.matchOne=function(t,e,r){var n=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var $=0,a=0,s=t.length,o=e.length;$<s&&a<o;$++,a++){this.debug("matchOne loop");var l,u=e[a],c=t[$];if(this.debug(e,u,c),!1===u)return!1;if(u===i){this.debug("GLOBSTAR",[e,u,c]);var h=$,f=a+1;if(f===o){for(this.debug("** at the end");$<s;$++)if("."===t[$]||".."===t[$]||!n.dot&&"."===t[$].charAt(0))return!1;return!0}for(;h<s;){var d=t[h];if(this.debug("\nglobstar while",t,h,e,f,d),this.matchOne(t.slice(h),e.slice(f),r))return this.debug("globstar found match!",h,s,d),!0;if("."===d||".."===d||!n.dot&&"."===d.charAt(0)){this.debug("dot detected!",t,h,e,f);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!r||(this.debug("\n>>> no match, partial?",t,h,e,f),h!==s))}if("string"==typeof u?(l=n.nocase?c.toLowerCase()===u.toLowerCase():c===u,this.debug("string match",u,c,l)):(l=c.match(u),this.debug("pattern match",u,c,l)),!l)return!1}if($===s&&a===o)return!0;if($===s)return r;if(a===o)return $===s-1&&""===t[$];throw new Error("wtf?")}},function(t,e,r){"use strict";function n(t){return"/"===t.charAt(0)}function i(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(t),r=e[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(e[2]||n)}t.exports="win32"===process.platform?i:n,t.exports.posix=n,t.exports.win32=i},function(module,__webpack_exports__,__webpack_require__){"use strict";const opal_code=function(){global.Opal.modules["corelib/basic_object"]=function(Opal){var self=Opal.top,$nesting=[],nil=Opal.nil,$$$=Opal.const_get_qualified,$$=Opal.const_get_relative,$breaker=Opal.breaker,$slice=Opal.slice,$klass=Opal.klass,$truthy=Opal.truthy,$range=Opal.range,$hash2=Opal.hash2,$send=Opal.send;return Opal.add_stubs(["$==","$!","$nil?","$cover?","$size","$raise","$merge","$compile","$proc","$any?","$inspect","$new"]),function($base,$super,$parent_nesting){var self=$klass($base,$super,"BasicObject"),$nesting=[self].concat($parent_nesting),$BasicObject_initialize$1,$BasicObject_$eq_eq$2,$BasicObject_eql$ques$3,$BasicObject___id__$4,$BasicObject___send__$5,$BasicObject_$excl$6,$BasicObject_$not_eq$7,$BasicObject_instance_eval$8,$BasicObject_instance_exec$10,$BasicObject_singleton_method_added$11,$BasicObject_singleton_method_removed$12,$BasicObject_singleton_method_undefined$13,$BasicObject_class$14,$BasicObject_method_missing$15;return Opal.def(self,"$initialize",$BasicObject_initialize$1=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$BasicObject_initialize$1.$$arity=-1),Opal.def(self,"$==",$BasicObject_$eq_eq$2=function(t){return this===t},$BasicObject_$eq_eq$2.$$arity=1),Opal.def(self,"$eql?",$BasicObject_eql$ques$3=function(t){return this["$=="](t)},$BasicObject_eql$ques$3.$$arity=1),Opal.alias(self,"equal?","=="),Opal.def(self,"$__id__",$BasicObject___id__$4=function(){return null!=this.$$id?this.$$id:(Opal.defineProperty(this,"$$id",Opal.uid()),this.$$id)},$BasicObject___id__$4.$$arity=0),Opal.def(self,"$__send__",$BasicObject___send__$5=function(t,e){var r,n=$BasicObject___send__$5.$$p,i=n||nil,$=this;n&&($BasicObject___send__$5.$$p=null),n&&($BasicObject___send__$5.$$p=null),r=Opal.slice.call(arguments,1,arguments.length);var a=$["$"+t];return a?(i!==nil&&(a.$$p=i),a.apply($,r)):(i!==nil&&($.$method_missing.$$p=i),$.$method_missing.apply($,[t].concat(r)))},$BasicObject___send__$5.$$arity=-2),Opal.def(self,"$!",$BasicObject_$excl$6=function(){return!1},$BasicObject_$excl$6.$$arity=0),Opal.def(self,"$!=",$BasicObject_$not_eq$7=function(t){return this["$=="](t)["$!"]()},$BasicObject_$not_eq$7.$$arity=1),Opal.def(self,"$instance_eval",$BasicObject_instance_eval$8=function $$instance_eval($a){var $iter=$BasicObject_instance_eval$8.$$p,block=$iter||nil,$post_args,args,$b,$$9,self=this,string=nil,file=nil,_lineno=nil,default_eval_options=nil,compiling_options=nil,compiled=nil;$iter&&($BasicObject_instance_eval$8.$$p=null),$iter&&($BasicObject_instance_eval$8.$$p=null),$post_args=Opal.slice.call(arguments,0,arguments.length),args=$post_args,$truthy($truthy($b=block["$nil?"]())?!!Opal.compile:$b)?($truthy($range(1,3,!1)["$cover?"](args.$size()))||$$$("::","Kernel").$raise($$$("::","ArgumentError"),"wrong number of arguments (0 for 1..3)"),$b=[].concat(Opal.to_a(args)),string=null==$b[0]?nil:$b[0],file=null==$b[1]?nil:$b[1],_lineno=null==$b[2]?nil:$b[2],default_eval_options=$hash2(["file","eval"],{file:$truthy($b=file)?$b:"(eval)",eval:!0}),compiling_options=Opal.hash({arity_check:!1}).$merge(default_eval_options),compiled=$$$("::","Opal").$compile(string,compiling_options),block=$send($$$("::","Kernel"),"proc",[],($$9=function(){var self=null==$$9.$$s?this:$$9.$$s;return function(self){return eval(compiled)}(self)},$$9.$$s=self,$$9.$$arity=0,$$9))):$truthy(args["$any?"]())&&$$$("::","Kernel").$raise($$$("::","ArgumentError"),"wrong number of arguments ("+args.$size()+" for 0)");var old=block.$$s,result;if(block.$$s=null,self.$$is_a_module){self.$$eval=!0;try{result=block.call(self,self)}finally{self.$$eval=!1}}else result=block.call(self,self);return block.$$s=old,result},$BasicObject_instance_eval$8.$$arity=-1),Opal.def(self,"$instance_exec",$BasicObject_instance_exec$10=function(t){var e,r=$BasicObject_instance_exec$10.$$p,n=r||nil,i=this;r&&($BasicObject_instance_exec$10.$$p=null),r&&($BasicObject_instance_exec$10.$$p=null),e=Opal.slice.call(arguments,0,arguments.length),$truthy(n)||$$$("::","Kernel").$raise($$$("::","ArgumentError"),"no block given");var $,a=n.$$s;if(n.$$s=null,i.$$is_a_module){i.$$eval=!0;try{$=n.apply(i,e)}finally{i.$$eval=!1}}else $=n.apply(i,e);return n.$$s=a,$},$BasicObject_instance_exec$10.$$arity=-1),Opal.def(self,"$singleton_method_added",$BasicObject_singleton_method_added$11=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$BasicObject_singleton_method_added$11.$$arity=-1),Opal.def(self,"$singleton_method_removed",$BasicObject_singleton_method_removed$12=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$BasicObject_singleton_method_removed$12.$$arity=-1),Opal.def(self,"$singleton_method_undefined",$BasicObject_singleton_method_undefined$13=function(t){return Opal.slice.call(arguments,0,arguments.length),nil},$BasicObject_singleton_method_undefined$13.$$arity=-1),Opal.def(self,"$class",$BasicObject_class$14=function(){return this.$$class},$BasicObject_class$14.$$arity=0),Opal.def(self,"$method_missing",$BasicObject_method_missing$15=function(t,e){var r=$BasicObject_method_missing$15.$$p,n=this,i=nil;return r&&($BasicObject_method_missing$15.$$p=null),r&&($BasicObject_method_missing$15.$$p=null),Opal.slice.call(arguments,1,arguments.length),i=$truthy(n.$inspect&&!n.$inspect.$$stub)?"undefined method `"+t+"' for "+n.$inspect()+":"+n.$$class:"undefined method `"+t+"' for "+n.$$class,$$$("::","Kernel").$raise($$$("::","NoMethodError").$new(i,t))},$BasicObject_method_missing$15.$$arity=-2),nil&&"method_missing"}($nesting[0],null,$nesting)}};__webpack_exports__.a=opal_code},,,function(t,e,r){t.exports=m;var n=r(1),i=r(13),$=r(7),a=($.Minimatch,r(26)),s=r(28).EventEmitter,o=r(2),l=r(14),u=r(8),c=r(29),h=r(15),f=(h.alphasort,h.alphasorti,h.setopts),d=h.ownProp,p=r(30),_=(r(6),h.childrenIgnored),y=h.isIgnored,g=r(17);function m(t,e,r){if("function"==typeof e&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return c(t,e)}return new b(t,e,r)}m.sync=c;var v=m.GlobSync=c.GlobSync;function b(t,e,r){if("function"==typeof e&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new v(t,e)}if(!(this instanceof b))return new b(t,e,r);f(this,t,e),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=g(r),this.on("error",r),this.on("end",(function(t){r(null,t)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return s();for(var $=!0,a=0;a<n;a++)this._process(this.minimatch.set[a],a,!1,s);function s(){--i._processing,i._processing<=0&&($?process.nextTick((function(){i._finish()})):i._finish())}$=!1}m.glob=m,m.hasMagic=function(t,e){var r=function(t,e){if(null===e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}({},e);r.noprocess=!0;var n=new b(t,r).minimatch.set;if(!t)return!1;if(n.length>1)return!0;for(var i=0;i<n[0].length;i++)if("string"!=typeof n[0][i])return!0;return!1},m.Glob=b,a(b,s),b.prototype._finish=function(){if(l(this instanceof b),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();h.finish(this),this.emit("end",this.found)}},b.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var t=this.matches.length;if(0===t)return this._finish();for(var e=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n)}function n(){0==--t&&e._finish()}},b.prototype._realpathSet=function(t,e){var r=this.matches[t];if(!r)return e();var n=Object.keys(r),$=this,a=n.length;if(0===a)return e();var s=this.matches[t]=Object.create(null);n.forEach((function(r,n){r=$._makeAbs(r),i.realpath(r,$.realpathCache,(function(n,i){n?"stat"===n.syscall?s[r]=!0:$.emit("error",n):s[i]=!0,0==--a&&($.matches[t]=s,e())}))}))},b.prototype._mark=function(t){return h.mark(this,t)},b.prototype._makeAbs=function(t){return h.makeAbs(this,t)},b.prototype.abort=function(){this.aborted=!0,this.emit("abort")},b.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},b.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var r=t[e];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(e=0;e<n.length;e++){var i=n[e];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},b.prototype._process=function(t,e,r,n){if(l(this instanceof b),l("function"==typeof n),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([t,e,r,n]);else{for(var i,a=0;"string"==typeof t[a];)a++;switch(a){case t.length:return void this._processSimple(t.join("/"),e,n);case 0:i=null;break;default:i=t.slice(0,a).join("/")}var s,o=t.slice(a);null===i?s=".":u(i)||u(t.join("/"))?(i&&u(i)||(i="/"+i),s=i):s=i;var c=this._makeAbs(s);if(_(this,s))return n();o[0]===$.GLOBSTAR?this._processGlobStar(i,s,c,o,e,r,n):this._processReaddir(i,s,c,o,e,r,n)}},b.prototype._processReaddir=function(t,e,r,n,i,$,a){var s=this;this._readdir(r,$,(function(o,l){return s._processReaddir2(t,e,r,n,i,$,l,a)}))},b.prototype._processReaddir2=function(t,e,r,n,i,$,a,s){if(!a)return s();for(var l=n[0],u=!!this.minimatch.negate,c=l._glob,h=this.dot||"."===c.charAt(0),f=[],d=0;d<a.length;d++){if("."!==(_=a[d]).charAt(0)||h)(u&&!t?!_.match(l):_.match(l))&&f.push(_)}var p=f.length;if(0===p)return s();if(1===n.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(d=0;d<p;d++){var _=f[d];t&&(_="/"!==t?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=o.join(this.root,_)),this._emitMatch(i,_)}return s()}n.shift();for(d=0;d<p;d++){_=f[d];t&&(_="/"!==t?t+"/"+_:t+_),this._process([_].concat(n),i,$,s)}s()},b.prototype._emitMatch=function(t,e){if(!this.aborted&&!y(this,e))if(this.paused)this._emitQueue.push([t,e]);else{var r=u(e)?e:this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0;var i=this.statCache[r];i&&this.emit("stat",e,i),this.emit("match",e)}}},b.prototype._readdirInGlobStar=function(t,e){if(!this.aborted){if(this.follow)return this._readdir(t,!1,e);var r=this,i=p("lstat\0"+t,(function(n,i){if(n&&"ENOENT"===n.code)return e();var $=i&&i.isSymbolicLink();r.symlinks[t]=$,$||!i||i.isDirectory()?r._readdir(t,!1,e):(r.cache[t]="FILE",e())}));i&&n.lstat(t,i)}},b.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=p("readdir\0"+t+"\0"+e,r))){if(e&&!d(this.symlinks,t))return this._readdirInGlobStar(t,r);if(d(this.cache,t)){var i=this.cache[t];if(!i||"FILE"===i)return r();if(Array.isArray(i))return r(null,i)}n.readdir(t,function(t,e,r){return function(n,i){n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}(this,t,r))}},b.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];i="/"===t?t+i:t+"/"+i,this.cache[i]=!0}return this.cache[t]=e,r(null,e)}},b.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(t);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=e.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e)}return r()}},b.prototype._processGlobStar=function(t,e,r,n,i,$,a){var s=this;this._readdir(r,$,(function(o,l){s._processGlobStar2(t,e,r,n,i,$,l,a)}))},b.prototype._processGlobStar2=function(t,e,r,n,i,$,a,s){if(!a)return s();var o=n.slice(1),l=t?[t]:[],u=l.concat(o);this._process(u,i,!1,s);var c=this.symlinks[r],h=a.length;if(c&&$)return s();for(var f=0;f<h;f++){if("."!==a[f].charAt(0)||this.dot){var d=l.concat(a[f],o);this._process(d,i,!0,s);var p=l.concat(a[f],n);this._process(p,i,!0,s)}}s()},b.prototype._processSimple=function(t,e,r){var n=this;this._stat(t,(function(i,$){n._processSimple2(t,e,i,$,r)}))},b.prototype._processSimple2=function(t,e,r,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(t&&u(t)&&!this.nomount){var $=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=o.join(this.root,t):(t=o.resolve(this.root,t),$&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),i()},b.prototype._stat=function(t,e){var r=this._makeAbs(t),i="/"===t.slice(-1);if(t.length>this.maxLength)return e();if(!this.stat&&d(this.cache,r)){var $=this.cache[r];if(Array.isArray($)&&($="DIR"),!i||"DIR"===$)return e(null,$);if(i&&"FILE"===$)return e()}var a=this.statCache[r];if(void 0!==a){if(!1===a)return e(null,a);var s=a.isDirectory()?"DIR":"FILE";return i&&"FILE"===s?e():e(null,s,a)}var o=this,l=p("stat\0"+r,(function(i,$){if($&&$.isSymbolicLink())return n.stat(r,(function(n,i){n?o._stat2(t,r,null,$,e):o._stat2(t,r,n,i,e)}));o._stat2(t,r,i,$,e)}));l&&n.lstat(r,l)},b.prototype._stat2=function(t,e,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[e]=!1,i();var $="/"===t.slice(-1);if(this.statCache[e]=n,"/"===e.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var a=!0;return n&&(a=n.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||a,$&&"FILE"===a?i():i(null,a,n)}},function(t,e,r){t.exports=u,u.realpath=u,u.sync=c,u.realpathSync=c,u.monkeypatch=function(){n.realpath=u,n.realpathSync=c},u.unmonkeypatch=function(){n.realpath=i,n.realpathSync=$};var n=r(1),i=n.realpath,$=n.realpathSync,a=process.version,s=/^v[0-5]\./.test(a),o=r(22);function l(t){return t&&"realpath"===t.syscall&&("ELOOP"===t.code||"ENOMEM"===t.code||"ENAMETOOLONG"===t.code)}function u(t,e,r){if(s)return i(t,e,r);"function"==typeof e&&(r=e,e=null),i(t,e,(function(n,i){l(n)?o.realpath(t,e,r):r(n,i)}))}function c(t,e){if(s)return $(t,e);try{return $(t,e)}catch(r){if(l(r))return o.realpathSync(t,e);throw r}}},function(t,e){t.exports=require("assert")},function(t,e,r){function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.alphasort=l,e.alphasorti=o,e.setopts=function(t,e,r){r||(r={});if(r.matchBase&&-1===e.indexOf("/")){if(r.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=!1!==r.strict,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0);t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.absolute=!!r.absolute,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),function(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]);t.ignore.length&&(t.ignore=t.ignore.map(u))}(t,r),t.changedCwd=!1;var $=process.cwd();n(r,"cwd")?(t.cwd=i.resolve(r.cwd),t.changedCwd=t.cwd!==$):t.cwd=$;t.root=r.root||i.resolve(t.cwd,"/"),t.root=i.resolve(t.root),"win32"===process.platform&&(t.root=t.root.replace(/\\/g,"/"));t.cwdAbs=a(t.cwd)?t.cwd:c(t,t.cwd),"win32"===process.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/"));t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new s(e,r),t.options=t.minimatch.options},e.ownProp=n,e.makeAbs=c,e.finish=function(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;n<i;n++){var $=t.matches[n];if($&&0!==Object.keys($).length){var a=Object.keys($);e?r.push.apply(r,a):a.forEach((function(t){r[t]=!0}))}else if(t.nonull){var s=t.minimatch.globSet[n];e?r.push(s):r[s]=!0}}e||(r=Object.keys(r));t.nosort||(r=r.sort(t.nocase?o:l));if(t.mark){for(n=0;n<r.length;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter((function(e){var r=!/\/$/.test(e),n=t.cache[e]||t.cache[c(t,e)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r})))}t.ignore.length&&(r=r.filter((function(e){return!h(t,e)})));t.found=r},e.mark=function(t,e){var r=c(t,e),n=t.cache[r],i=e;if(n){var $="DIR"===n||Array.isArray(n),a="/"===e.slice(-1);if($&&!a?i+="/":!$&&a&&(i=i.slice(0,-1)),i!==e){var s=c(t,i);t.statCache[s]=t.statCache[r],t.cache[s]=t.cache[r]}}return i},e.isIgnored=h,e.childrenIgnored=function(t,e){return!!t.ignore.length&&t.ignore.some((function(t){return!(!t.gmatcher||!t.gmatcher.match(e))}))};var i=r(2),$=r(7),a=r(8),s=$.Minimatch;function o(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function l(t,e){return t.localeCompare(e)}function u(t){var e=null;if("/**"===t.slice(-3)){var r=t.replace(/(\/\*\*)+$/,"");e=new s(r,{dot:!0})}return{matcher:new s(t,{dot:!0}),gmatcher:e}}function c(t,e){var r=e;return r="/"===e.charAt(0)?i.join(t.root,e):a(e)||""===e?e:t.changedCwd?i.resolve(t.cwd,e):i.resolve(e),"win32"===process.platform&&(r=r.replace(/\\/g,"/")),r}function h(t,e){return!!t.ignore.length&&t.ignore.some((function(t){return t.matcher.match(e)||!(!t.gmatcher||!t.gmatcher.match(e))}))}},function(t,e){t.exports=function t(e,r){if(e&&r)return t(e)(r);if("function"!=typeof e)throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){n[t]=e[t]}));return n;function n(){for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];var n=e.apply(this,t),i=t[t.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(t){n[t]=i[t]})),n}}},function(t,e,r){var n=r(16);function i(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function $(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}t.exports=n(i),t.exports.strict=n($),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return $(this)},configurable:!0})}))},function(t,e,r){"use strict";r(20);var n=function(){global.Opal.modules["corelib/helpers"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.module),$=t.truthy;return t.add_stubs(["$new","$class","$===","$respond_to?","$raise","$type_error","$__send__","$coerce_to","$nil?","$<=>","$coerce_to!","$!=","$[]","$upcase"]),function(e,a){var s,o,l,u,c,h,f,d,p,_,y,g,m,v,b=i(e,"Opal"),O=[b].concat(a);t.defs(b,"$bridge",s=function(e,r){return t.bridge(e,r)},s.$$arity=2),t.defs(b,"$type_error",o=function(t,e,i,a){var s;return null==i&&(i=r),null==a&&(a=r),$($(s=i)?a:s)?n(O,"TypeError").$new("can't convert "+t.$class()+" into "+e+" ("+t.$class()+"#"+i+" gives "+a.$class()+")"):n(O,"TypeError").$new("no implicit conversion of "+t.$class()+" into "+e)},o.$$arity=-3),t.defs(b,"$coerce_to",l=function(t,e,r){return $(e["$==="](t))?t:($(t["$respond_to?"](r))||this.$raise(this.$type_error(t,e)),t.$__send__(r))},l.$$arity=3),t.defs(b,"$coerce_to!",u=function(t,e,r){var n;return n=this.$coerce_to(t,e,r),$(e["$==="](n))||this.$raise(this.$type_error(t,e,r,n)),n},u.$$arity=3),t.defs(b,"$coerce_to?",c=function(t,e,n){var i=r;return $(t["$respond_to?"](n))?(i=this.$coerce_to(t,e,n),$(i["$nil?"]())?r:($(e["$==="](i))||this.$raise(this.$type_error(t,e,n,i)),i)):r},c.$$arity=3),t.defs(b,"$try_convert",h=function(t,e,n){return $(e["$==="](t))?t:$(t["$respond_to?"](n))?t.$__send__(n):r},h.$$arity=3),t.defs(b,"$compare",f=function(t,e){var i;return i=t["$<=>"](e),$(i===r)&&this.$raise(n(O,"ArgumentError"),"comparison of "+t.$class()+" with "+e.$class()+" failed"),i},f.$$arity=2),t.defs(b,"$destructure",d=function(t){if(1==t.length)return t[0];if(t.$$is_array)return t;for(var e=new Array(t.length),r=0,n=e.length;r<n;r++)e[r]=t[r];return e},d.$$arity=1),t.defs(b,"$respond_to?",p=function(t,e,r){return null==r&&(r=!1),!(null==t||!t.$$class)&&t["$respond_to?"](e,r)},p.$$arity=-3),t.defs(b,"$inspect_obj",_=function(e){return t.inspect(e)},_.$$arity=1),t.defs(b,"$instance_variable_name!",y=function(t){return t=n(O,"Opal")["$coerce_to!"](t,n(O,"String"),"to_str"),$(/^@[a-zA-Z_][a-zA-Z0-9_]*?$/.test(t))||this.$raise(n(O,"NameError").$new("'"+t+"' is not allowed as an instance variable name",t)),t},y.$$arity=1),t.defs(b,"$class_variable_name!",g=function(t){return t=n(O,"Opal")["$coerce_to!"](t,n(O,"String"),"to_str"),$(t.length<3||"@@"!==t.slice(0,2))&&this.$raise(n(O,"NameError").$new("`"+t+"' is not allowed as a class variable name",t)),t},g.$$arity=1),t.defs(b,"$const_name!",m=function(t){return t=n(O,"Opal")["$coerce_to!"](t,n(O,"String"),"to_str"),$(t["$[]"](0)["$!="](t["$[]"](0).$upcase()))&&this.$raise(n(O,"NameError"),"wrong constant name "+t),t},m.$$arity=1),t.defs(b,"$pristine",v=function(e,n){for(var i,$,a,s=(i=t.slice.call(arguments,1,arguments.length)).length-1;s>=0;s--)$=i[s],(a=e.$$prototype["$"+$])&&!a.$$stub&&(a.$$pristine=!0);return r},v.$$arity=-2)}(e[0],e)}},i=r(4);void 0===global.Opal.modules["corelib/module"]&&"function"==typeof i.a&&Object(i.a)();var $=function(){global.Opal.modules["corelib/class"]=function(t){var e=t.top,r=[],n=t.nil,i=(t.const_get_qualified,t.const_get_relative),$=(t.breaker,t.slice,t.klass),a=t.send;return t.add_stubs(["$require","$class_eval","$to_proc","$initialize_copy","$allocate","$name","$to_s"]),e.$require("corelib/module"),function(e,r,s){var o,l,u,c,h,f,d,p=$(e,null,"Class"),_=[p].concat(s);return t.defs(p,"$new",o=function(e){var r=o.$$p,$=r||n;if(r&&(o.$$p=null),r&&(o.$$p=null),null==e&&(e=i(_,"Object")),!e.$$is_class)throw t.TypeError.$new("superclass must be a Class");var s=t.allocate_class(n,e);return e.$inherited(s),$!==n&&a(s,"class_eval",[],$.$to_proc()),s},o.$$arity=-1),t.def(p,"$allocate",l=function(){var e=new this.$$constructor;return e.$$id=t.uid(),e},l.$$arity=0),t.def(p,"$inherited",u=function(t){return n},u.$$arity=1),t.def(p,"$initialize_dup",c=function(t){this.$initialize_copy(t),this.$$name=null,this.$$full_name=null},c.$$arity=1),t.def(p,"$new",h=function(e){var r,i=h.$$p,$=i||n,a=this;i&&(h.$$p=null),i&&(h.$$p=null),r=t.slice.call(arguments,0,arguments.length);var s=a.$allocate();return t.send(s,s.$initialize,r,$),s},h.$$arity=-1),t.def(p,"$superclass",f=function(){return this.$$super||n},f.$$arity=0),t.def(p,"$to_s",d=function(){var e=d.$$p;e&&(d.$$p=null);var r=this.$$singleton_of;return r&&r.$$is_a_module?"#<Class:"+r.$name()+">":r?"#<Class:#<"+r.$$class.$name()+":0x"+t.id(r).$to_s(16)+">>":a(this,t.find_super_dispatcher(this,"to_s",d,!1),[],null)},d.$$arity=0),n&&"to_s"}(r[0],0,r)}},a=r(9);var s=function(){global.Opal.modules["corelib/kernel"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t<=e:t["$<="](e)}t.top;var r=[],n=t.nil,i=t.const_get_qualified,$=t.const_get_relative,a=(t.breaker,t.slice,t.module),s=t.truthy,o=t.gvars,l=t.hash2,u=t.send,c=t.klass;return t.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","$coerce_to","$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","$[]","$exception","$is_a?","$rand","$respond_to_missing?","$try_convert!","$expand_path","$join","$start_with?","$new_seed","$srand","$sym","$arg","$open","$include"]),function(r,c){var h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct,ht,ft,dt,pt,_t,yt,gt,mt,vt,bt,Ot,wt=a(r,"Kernel"),Et=[wt].concat(c);t.def(wt,"$method_missing",h=function(e,r){var n,i=h.$$p,a=this;return i&&(h.$$p=null),i&&(h.$$p=null),n=t.slice.call(arguments,1,arguments.length),a.$raise($(Et,"NoMethodError").$new("undefined method `"+e+"' for "+a.$inspect(),e,n))},h.$$arity=-2),t.def(wt,"$=~",f=function(t){return!1},f.$$arity=1),t.def(wt,"$!~",d=function(t){return this["$=~"](t)["$!"]()},d.$$arity=1),t.def(wt,"$===",p=function(t){var e;return s(e=this.$object_id()["$=="](t.$object_id()))?e:this["$=="](t)},p.$$arity=1),t.def(wt,"$<=>",_=function(t){this.$$comparable=!0;var e=this["$=="](t);return e&&e!==n?0:n},_.$$arity=1),t.def(wt,"$method",y=function(t){var e=this["$"+t];return e&&!e.$$stub||this.$raise($(Et,"NameError").$new("undefined method `"+t+"' for class `"+this.$class()+"'",t)),$(Et,"Method").$new(this,e.$$owner||this.$class(),e,t)},y.$$arity=1),t.def(wt,"$methods",g=function(e){return null==e&&(e=!0),s(e)?t.methods(this):t.own_methods(this)},g.$$arity=-1),t.def(wt,"$public_methods",m=function(e){return null==e&&(e=!0),s(e)?t.methods(this):t.receiver_methods(this)},m.$$arity=-1),t.def(wt,"$Array",v=function(t){var e;return t===n?[]:t.$$is_array?t:(e=$(Et,"Opal")["$coerce_to?"](t,$(Et,"Array"),"to_ary"))!==n?e:(e=$(Et,"Opal")["$coerce_to?"](t,$(Et,"Array"),"to_a"))!==n?e:[t]},v.$$arity=1),t.def(wt,"$at_exit",b=function(){var t,e=b.$$p,r=e||n;return null==o.__at_exit__&&(o.__at_exit__=n),e&&(b.$$p=null),e&&(b.$$p=null),o.__at_exit__=s(t=o.__at_exit__)?t:[],o.__at_exit__["$<<"](r)},b.$$arity=0),t.def(wt,"$caller",O=function(e){return t.slice.call(arguments,0,arguments.length),[]},O.$$arity=-1),t.def(wt,"$class",w=function(){return this.$$class},w.$$arity=0),t.def(wt,"$copy_instance_variables",E=function(t){var e,r,n,i=Object.keys(t);for(e=0,r=i.length;e<r;e++)"$"!==(n=i[e]).charAt(0)&&t.hasOwnProperty(n)&&(this[n]=t[n])},E.$$arity=1),t.def(wt,"$copy_singleton_methods",x=function(e){var r,n,i,$;if(e.hasOwnProperty("$$meta")){var a=t.get_singleton_class(e),s=t.get_singleton_class(this);for(r=0,$=(i=Object.getOwnPropertyNames(a.$$prototype)).length;r<$;r++)n=i[r],t.is_method(n)&&(s.$$prototype[n]=a.$$prototype[n]);s.$$const=Object.assign({},a.$$const),Object.setPrototypeOf(s.$$prototype,Object.getPrototypeOf(a.$$prototype))}for(r=0,$=(i=Object.getOwnPropertyNames(e)).length;r<$;r++)"$"===(n=i[r]).charAt(0)&&"$"!==n.charAt(1)&&e.hasOwnProperty(n)&&(this[n]=e[n])},x.$$arity=1),t.def(wt,"$clone",k=function(e){var r=n;if(null==e)e=l([],{});else if(!e.$$is_hash)throw t.ArgumentError.$new("expected kwargs");return null==e.$$smap.freeze&&!0,(r=this.$class().$allocate()).$copy_instance_variables(this),r.$copy_singleton_methods(this),r.$initialize_clone(this),r},k.$$arity=-1),t.def(wt,"$initialize_clone",A=function(t){return this.$initialize_copy(t)},A.$$arity=1),t.def(wt,"$define_singleton_method",M=function(t,e){var r=M.$$p,i=r||n;return r&&(M.$$p=null),r&&(M.$$p=null),u(this.$singleton_class(),"define_method",[t,e],i.$to_proc())},M.$$arity=-2),t.def(wt,"$dup",I=function(){var t=n;return(t=this.$class().$allocate()).$copy_instance_variables(this),t.$initialize_dup(this),t},I.$$arity=0),t.def(wt,"$initialize_dup",S=function(t){return this.$initialize_copy(t)},S.$$arity=1),t.def(wt,"$enum_for",N=function(e,r){var i,a,s,o=N.$$p,l=o||n,c=this;return o&&(N.$$p=null),o&&(N.$$p=null),(i=t.slice.call(arguments,0,arguments.length)).length>0&&(a=i[0],i.splice(0,1)),null==a&&(a="each"),s=i,u($(Et,"Enumerator"),"for",[c,a].concat(t.to_a(s)),l.$to_proc())},N.$$arity=-1),t.alias(wt,"to_enum","enum_for"),t.def(wt,"$equal?",j=function(t){return this===t},j.$$arity=1),t.def(wt,"$exit",R=function(e){var r;for(null==o.__at_exit__&&(o.__at_exit__=n),null==e&&(e=!0),o.__at_exit__=s(r=o.__at_exit__)?r:[];!s(o.__at_exit__["$empty?"]());)o.__at_exit__.$pop().$call();return e=e.$$is_boolean?e?0:1:$(Et,"Opal").$coerce_to(e,$(Et,"Integer"),"to_int"),t.exit(e),n},R.$$arity=-1),t.def(wt,"$extend",T=function(e){var r,n=this;r=t.slice.call(arguments,0,arguments.length);for(var i=n.$singleton_class(),a=r.length-1;a>=0;a--){var s=r[a];s.$$is_module||n.$raise($(Et,"TypeError"),"wrong argument type "+s.$class()+" (expected Module)"),s.$append_features(i),s.$extend_object(n),s.$extended(n)}return n},T.$$arity=-1),t.def(wt,"$hash",z=function(){return this.$__id__()},z.$$arity=0),t.def(wt,"$initialize_copy",q=function(t){return n},q.$$arity=1),t.def(wt,"$inspect",C=function(){return this.$to_s()},C.$$arity=0),t.def(wt,"$instance_of?",P=function(t){return t.$$is_class||t.$$is_module||this.$raise($(Et,"TypeError"),"class or module required"),this.$$class===t},P.$$arity=1),t.def(wt,"$instance_variable_defined?",F=function(e){return e=$(Et,"Opal")["$instance_variable_name!"](e),t.hasOwnProperty.call(this,e.substr(1))},F.$$arity=1),t.def(wt,"$instance_variable_get",D=function(e){e=$(Et,"Opal")["$instance_variable_name!"](e);var r=this[t.ivar(e.substr(1))];return null==r?n:r},D.$$arity=1),t.def(wt,"$instance_variable_set",L=function(e,r){return e=$(Et,"Opal")["$instance_variable_name!"](e),this[t.ivar(e.substr(1))]=r},L.$$arity=2),t.def(wt,"$remove_instance_variable",B=function(e){e=$(Et,"Opal")["$instance_variable_name!"](e);var r,n=t.ivar(e.substr(1));return this.hasOwnProperty(n)?(r=this[n],delete this[n],r):this.$raise($(Et,"NameError"),"instance variable "+e+" not defined")},B.$$arity=1),t.def(wt,"$instance_variables",U=function(){var t,e=[];for(var r in this)this.hasOwnProperty(r)&&"$"!==r.charAt(0)&&(t="$"===r.substr(-1)?r.slice(0,r.length-1):r,e.push("@"+t));return e},U.$$arity=0),t.def(wt,"$Integer",G=function(t,e){var r,i,a,s=this;return t.$$is_string?"0"===t?0:(void 0===e?e=0:(1===(e=$(Et,"Opal").$coerce_to(e,$(Et,"Integer"),"to_int"))||e<0||e>36)&&s.$raise($(Et,"ArgumentError"),"invalid radix "+e),i=(i=(i=t.toLowerCase()).replace(/(\d)_(?=\d)/g,"$1")).replace(/^(\s*[+-]?)(0[bodx]?)/,(function(r,n,i){switch(i){case"0b":if(0===e||2===e)return e=2,n;case"0":case"0o":if(0===e||8===e)return e=8,n;case"0d":if(0===e||10===e)return e=10,n;case"0x":if(0===e||16===e)return e=16,n}s.$raise($(Et,"ArgumentError"),'invalid value for Integer(): "'+t+'"')})),a="0-"+((e=0===e?10:e)<=10?e-1:"9a-"+String.fromCharCode(e-11+97)),new RegExp("^\\s*[+-]?["+a+"]+\\s*$").test(i)||s.$raise($(Et,"ArgumentError"),'invalid value for Integer(): "'+t+'"'),r=parseInt(i,e),isNaN(r)&&s.$raise($(Et,"ArgumentError"),'invalid value for Integer(): "'+t+'"'),r):(void 0!==e&&s.$raise($(Et,"ArgumentError"),"base specified for non string value"),t===n&&s.$raise($(Et,"TypeError"),"can't convert nil into Integer"),t.$$is_number?((t===1/0||t===-1/0||isNaN(t))&&s.$raise($(Et,"FloatDomainError"),t),Math.floor(t)):t["$respond_to?"]("to_int")&&(r=t.$to_int())!==n?r:$(Et,"Opal")["$coerce_to!"](t,$(Et,"Integer"),"to_i"))},G.$$arity=-2),t.def(wt,"$Float",H=function(t){var e;return t===n&&this.$raise($(Et,"TypeError"),"can't convert nil into Float"),t.$$is_string?(e=(e=t.toString()).replace(/(\d)_(?=\d)/g,"$1"),/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(e)?this.$Integer(e):(/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(e)||this.$raise($(Et,"ArgumentError"),'invalid value for Float(): "'+t+'"'),parseFloat(e))):$(Et,"Opal")["$coerce_to!"](t,$(Et,"Float"),"to_f")},H.$$arity=1),t.def(wt,"$Hash",X=function(t){var e;return s(s(e=t["$nil?"]())?e:t["$=="]([]))?l([],{}):s($(Et,"Hash")["$==="](t))?t:$(Et,"Opal")["$coerce_to!"](t,$(Et,"Hash"),"to_hash")},X.$$arity=1),t.def(wt,"$is_a?",Y=function(e){return e.$$is_class||e.$$is_module||this.$raise($(Et,"TypeError"),"class or module required"),t.is_a(this,e)},Y.$$arity=1),t.def(wt,"$itself",K=function(){return this},K.$$arity=0),t.alias(wt,"kind_of?","is_a?"),t.def(wt,"$lambda",V=function(){var e=V.$$p,r=e||n;return e&&(V.$$p=null),e&&(V.$$p=null),t.lambda(r)},V.$$arity=0),t.def(wt,"$load",Z=function(e){return e=$(Et,"Opal")["$coerce_to!"](e,$(Et,"String"),"to_str"),t.load(e)},Z.$$arity=1),t.def(wt,"$loop",J=function(){var e,r=J.$$p,a=r||n,o=n;if(r&&(J.$$p=null),a===n)return u(this,"enum_for",["loop"],((e=function(){null==e.$$s||e.$$s;return i($(Et,"Float"),"INFINITY")}).$$s=this,e.$$arity=0,e));for(;s(!0);)try{t.yieldX(a,[])}catch(e){if(!t.rescue(e,[$(Et,"StopIteration")]))throw e;o=e;try{return o.$result()}finally{t.pop_exception()}}return this},J.$$arity=0),t.def(wt,"$nil?",Q=function(){return!1},Q.$$arity=0),t.alias(wt,"object_id","__id__"),t.def(wt,"$printf",W=function(e){var r,i,$=this;return r=t.slice.call(arguments,0,arguments.length),s((i=r)["$any?"]())&&$.$print(u($,"format",t.to_a(i))),n},W.$$arity=-1),t.def(wt,"$proc",tt=function(){var t=tt.$$p,e=t||n;return t&&(tt.$$p=null),t&&(tt.$$p=null),s(e)||this.$raise($(Et,"ArgumentError"),"tried to create Proc object without a block"),e.$$is_lambda=!1,e},tt.$$arity=0),t.def(wt,"$puts",et=function(e){var r;return null==o.stdout&&(o.stdout=n),r=t.slice.call(arguments,0,arguments.length),u(o.stdout,"puts",t.to_a(r))},et.$$arity=-1),t.def(wt,"$p",rt=function(r){var i,$,a,l=this;return i=t.slice.call(arguments,0,arguments.length),u($=i,"each",[],((a=function(t){null==a.$$s||a.$$s;return null==o.stdout&&(o.stdout=n),null==t&&(t=n),o.stdout.$puts(t.$inspect())}).$$s=l,a.$$arity=1,a)),s(e($.$length(),1))?$["$[]"](0):$},rt.$$arity=-1),t.def(wt,"$print",nt=function(e){var r;return null==o.stdout&&(o.stdout=n),r=t.slice.call(arguments,0,arguments.length),u(o.stdout,"print",t.to_a(r))},nt.$$arity=-1),t.def(wt,"$warn",it=function(e){var r,i;return null==o.VERBOSE&&(o.VERBOSE=n),null==o.stderr&&(o.stderr=n),r=t.slice.call(arguments,0,arguments.length),s(s(i=o.VERBOSE["$nil?"]())?i:r["$empty?"]())?n:u(o.stderr,"puts",t.to_a(r))},it.$$arity=-1),t.def(wt,"$raise",$t=function(e,r,i){if(null==o["!"]&&(o["!"]=n),null==r&&(r=n),null==i&&(i=n),null==e&&o["!"]!==n)throw o["!"];throw null==e?e=$(Et,"RuntimeError").$new():e.$$is_string?e=$(Et,"RuntimeError").$new(e):e.$$is_class&&e["$respond_to?"]("exception")?e=e.$exception(r):e["$is_a?"]($(Et,"Exception"))||(e=$(Et,"TypeError").$new("exception class/object expected")),o["!"]!==n&&t.exceptions.push(o["!"]),o["!"]=e,e},$t.$$arity=-1),t.alias(wt,"fail","raise"),t.def(wt,"$rand",at=function(t){return void 0===t?i($(Et,"Random"),"DEFAULT").$rand():(t.$$is_number&&(t<0&&(t=Math.abs(t)),t%1!=0&&(t=t.$to_i()),0===t&&(t=void 0)),i($(Et,"Random"),"DEFAULT").$rand(t))},at.$$arity=-1),t.def(wt,"$respond_to?",st=function(t,e){if(null==e&&(e=!1),s(this["$respond_to_missing?"](t,e)))return!0;var r=this["$"+t];return"function"==typeof r&&!r.$$stub},st.$$arity=-2),t.def(wt,"$respond_to_missing?",ot=function(t,e){return null==e&&(e=!1),!1},ot.$$arity=-2),t.def(wt,"$require",lt=function(e){return e=$(Et,"Opal")["$coerce_to!"](e,$(Et,"String"),"to_str"),t.require(e)},lt.$$arity=1),t.def(wt,"$require_relative",ut=function(e){return $(Et,"Opal")["$try_convert!"](e,$(Et,"String"),"to_str"),e=$(Et,"File").$expand_path($(Et,"File").$join(t.current_file,"..",e)),t.require(e)},ut.$$arity=1),t.def(wt,"$require_tree",ct=function(e){var r=[];for(var n in e=$(Et,"File").$expand_path(e),"."===(e=t.normalize(e))&&(e=""),t.modules)n["$start_with?"](e)&&r.push([n,t.require(n)]);return r},ct.$$arity=1),t.alias(wt,"send","__send__"),t.alias(wt,"public_send","__send__"),t.def(wt,"$singleton_class",ht=function(){return t.get_singleton_class(this)},ht.$$arity=0),t.def(wt,"$sleep",ft=function(e){null==e&&(e=n),e===n&&this.$raise($(Et,"TypeError"),"can't convert NilClass into time interval"),e.$$is_number||this.$raise($(Et,"TypeError"),"can't convert "+e.$class()+" into time interval"),e<0&&this.$raise($(Et,"ArgumentError"),"time interval must be positive");for(var r=t.global.performance?function(){return performance.now()}:function(){return new Date},i=r();r()-i<=1e3*e;);return e},ft.$$arity=-1),t.def(wt,"$srand",dt=function(t){return null==t&&(t=$(Et,"Random").$new_seed()),$(Et,"Random").$srand(t)},dt.$$arity=-1),t.def(wt,"$String",pt=function(t){var e;return s(e=$(Et,"Opal")["$coerce_to?"](t,$(Et,"String"),"to_str"))?e:$(Et,"Opal")["$coerce_to!"](t,$(Et,"String"),"to_s")},pt.$$arity=1),t.def(wt,"$tap",_t=function(){var e=_t.$$p,r=e||n;return e&&(_t.$$p=null),e&&(_t.$$p=null),t.yield1(r,this),this},_t.$$arity=0),t.def(wt,"$to_proc",yt=function(){return this},yt.$$arity=0),t.def(wt,"$to_s",gt=function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+">"},gt.$$arity=0),t.def(wt,"$catch",mt=function(e){var r=mt.$$p,i=r||n,a=n;r&&(mt.$$p=null);try{return t.yieldX(i,[])}catch(r){if(!t.rescue(r,[$(Et,"UncaughtThrowError")]))throw r;a=r;try{return a.$sym()["$=="](e)?a.$arg():this.$raise()}finally{t.pop_exception()}}},mt.$$arity=1),t.def(wt,"$throw",vt=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),n.$raise($(Et,"UncaughtThrowError"),r)},vt.$$arity=-1),t.def(wt,"$open",bt=function(e){var r,i=bt.$$p,a=i||n;return i&&(bt.$$p=null),i&&(bt.$$p=null),r=t.slice.call(arguments,0,arguments.length),u($(Et,"File"),"open",t.to_a(r),a.$to_proc())},bt.$$arity=-1),t.def(wt,"$yield_self",Ot=function(){var e,r=Ot.$$p,i=r||n;return r&&(Ot.$$p=null),i===n?u(this,"enum_for",["yield_self"],((e=function(){null==e.$$s||e.$$s;return 1}).$$s=this,e.$$arity=0,e)):t.yield1(i,this)},Ot.$$arity=0)}(r[0],r),function(t,e,r){var n=c(t,null,"Object"),i=[n].concat(r);return n.$include($(i,"Kernel"))}(r[0],0,r)}};var o=function(){global.Opal.modules["corelib/error"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.send,a=t.truthy,s=t.module,o=t.hash2;return t.add_stubs(["$new","$clone","$to_s","$empty?","$class","$raise","$+","$attr_reader","$[]","$>","$length","$inspect"]),function(e,s,o){var l,u,c,h,f,d,p,_,y,g,m=i(e,s,"Exception"),v=[m].concat(o);m.$$prototype.message=r,t.defs(m,"$new",l=function(e){var n,i=this,$=(n=t.slice.call(arguments,0,arguments.length)).length>0?n[0]:r,a=new i.$$constructor($);return a.name=i.$$name,a.message=$,t.send(a,a.$initialize,n),t.config.enable_stack_trace&&Error.captureStackTrace&&Error.captureStackTrace(a,g),a},l.$$arity=-1),g=m.$new,t.defs(m,"$exception",u=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),$(n,"new",t.to_a(r))},u.$$arity=-1),t.def(m,"$initialize",c=function(e){var n,i=this;return n=t.slice.call(arguments,0,arguments.length),i.message=n.length>0?n[0]:r},c.$$arity=-1),t.def(m,"$backtrace",h=function(){if(this.backtrace)return this.backtrace;var t=this.stack;return"string"==typeof t?t.split("\n").slice(0,15):t?t.slice(0,15):[]},h.$$arity=0),t.def(m,"$exception",f=function(t){if(null==t&&(t=r),t===r||this===t)return this;var e=this.$clone();return e.message=t,e.stack=this.stack,e},f.$$arity=-1),t.def(m,"$message",d=function(){return this.$to_s()},d.$$arity=0),t.def(m,"$inspect",p=function(){var t=r;return t=this.$to_s(),a(t["$empty?"]())?this.$class().$to_s():"#<"+this.$class().$to_s()+": "+this.$to_s()+">"},p.$$arity=0),t.def(m,"$set_backtrace",_=function(t){var e,i,$=!0;if(t===r)this.backtrace=r,this.stack="";else if(t.$$is_string)this.backtrace=[t],this.stack=t;else{if(t.$$is_array){for(e=0,i=t.length;e<i;e++)if(!t[e].$$is_string){$=!1;break}}else $=!1;!1===$&&this.$raise(n(v,"TypeError"),"backtrace must be Array of String"),this.backtrace=t,this.stack=t.join("\n")}return t},_.$$arity=1),t.def(m,"$to_s",y=function(){var t,e;return a(t=a(e=this.message)?this.message.$to_s():e)?t:this.$class().$to_s()},y.$$arity=0)}(e[0],Error,e),function(t,e,r){[i(t,e,"ScriptError")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"SyntaxError")].concat(r)}(e[0],n(e,"ScriptError"),e),function(t,e,r){[i(t,e,"LoadError")].concat(r)}(e[0],n(e,"ScriptError"),e),function(t,e,r){[i(t,e,"NotImplementedError")].concat(r)}(e[0],n(e,"ScriptError"),e),function(t,e,r){[i(t,e,"SystemExit")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"NoMemoryError")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"SignalException")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"Interrupt")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"SecurityError")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"StandardError")].concat(r)}(e[0],n(e,"Exception"),e),function(t,e,r){[i(t,e,"EncodingError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"ZeroDivisionError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"NameError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"NoMethodError")].concat(r)}(e[0],n(e,"NameError"),e),function(t,e,r){[i(t,e,"RuntimeError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"FrozenError")].concat(r)}(e[0],n(e,"RuntimeError"),e),function(t,e,r){[i(t,e,"LocalJumpError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"TypeError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"ArgumentError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"IndexError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"StopIteration")].concat(r)}(e[0],n(e,"IndexError"),e),function(t,e,r){[i(t,e,"KeyError")].concat(r)}(e[0],n(e,"IndexError"),e),function(t,e,r){[i(t,e,"RangeError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"FloatDomainError")].concat(r)}(e[0],n(e,"RangeError"),e),function(t,e,r){[i(t,e,"IOError")].concat(r)}(e[0],n(e,"StandardError"),e),function(t,e,r){[i(t,e,"SystemCallError")].concat(r)}(e[0],n(e,"StandardError"),e),function(e,o){var l=[s(e,"Errno")].concat(o);!function(e,n,s){var o,l=i(e,n,"EINVAL");[l].concat(s);t.defs(l,"$new",o=function(e){var n,i,s=o.$$p,l=r;return s&&(o.$$p=null),null==e&&(e=r),l="Invalid argument",a(e)&&(i=" - "+e,l="number"==typeof(n=l)&&"number"==typeof i?n+i:n["$+"](i)),$(this,t.find_super_dispatcher(this,"new",o,!1,this.$$class.$$prototype),[l],null)},o.$$arity=-1)}(l[0],n(l,"SystemCallError"),l)}(e[0],e),function(e,n,s){var o,l=i(e,n,"UncaughtThrowError");[l].concat(s);l.$$prototype.sym=r,l.$attr_reader("sym","arg"),t.def(l,"$initialize",o=function(e){var r,n,i=o.$$p;return i&&(o.$$p=null),this.sym=e["$[]"](0),a((r=e.$length(),n=1,"number"==typeof r&&"number"==typeof n?r>n:r["$>"](n)))&&(this.arg=e["$[]"](1)),$(this,t.find_super_dispatcher(this,"initialize",o,!1),["uncaught throw "+this.sym.$inspect()],null)},o.$$arity=1)}(e[0],n(e,"ArgumentError"),e),function(e,n,a){var s,o=i(e,null,"NameError");[o].concat(a);o.$attr_reader("name"),t.def(o,"$initialize",s=function(e,n){var i=s.$$p;return i&&(s.$$p=null),null==n&&(n=r),$(this,t.find_super_dispatcher(this,"initialize",s,!1),[e],null),this.name=n},s.$$arity=-2)}(e[0],0,e),function(e,n,a){var s,o=i(e,null,"NoMethodError");[o].concat(a);o.$attr_reader("args"),t.def(o,"$initialize",s=function(e,n,i){var a=s.$$p;return a&&(s.$$p=null),null==n&&(n=r),null==i&&(i=[]),$(this,t.find_super_dispatcher(this,"initialize",s,!1),[e,n],null),this.args=i},s.$$arity=-2)}(e[0],0,e),function(t,e,r){var n=i(t,null,"StopIteration");[n].concat(r);n.$attr_reader("result")}(e[0],0,e),function(e,s,l){var u,c,h,f=i(e,null,"KeyError"),d=[f].concat(l);f.$$prototype.receiver=f.$$prototype.key=r,t.def(f,"$initialize",u=function(e,n){var i,a,s=u.$$p;if(s&&(u.$$p=null),null==n)n=o([],{});else if(!n.$$is_hash)throw t.ArgumentError.$new("expected kwargs");return null==(i=n.$$smap.receiver)&&(i=r),null==(a=n.$$smap.key)&&(a=r),$(this,t.find_super_dispatcher(this,"initialize",u,!1),[e],null),this.receiver=i,this.key=a},u.$$arity=-2),t.def(f,"$receiver",c=function(){var t;return a(t=this.receiver)?t:this.$raise(n(d,"ArgumentError"),"no receiver is available")},c.$$arity=0),t.def(f,"$key",h=function(){var t;return a(t=this.key)?t:this.$raise(n(d,"ArgumentError"),"no key is available")},h.$$arity=0)}(e[0],0,e),function(t,e){var r=[s(t,"JS")].concat(e);!function(t,e,r){[i(t,null,"Error")].concat(r)}(r[0],0,r)}(e[0],e)}};var l=function(){global.Opal.modules["corelib/constants"]=function(t){t.top;var e=[],r=(t.nil,t.const_get_qualified,t.const_get_relative);t.breaker,t.slice;return t.const_set(e[0],"RUBY_PLATFORM","opal"),t.const_set(e[0],"RUBY_ENGINE","opal"),t.const_set(e[0],"RUBY_VERSION","2.5.3"),t.const_set(e[0],"RUBY_ENGINE_VERSION","1.0.0"),t.const_set(e[0],"RUBY_RELEASE_DATE","2019-05-12"),t.const_set(e[0],"RUBY_PATCHLEVEL",0),t.const_set(e[0],"RUBY_REVISION",0),t.const_set(e[0],"RUBY_COPYRIGHT","opal - Copyright (C) 2013-2019 Adam Beynon and the Opal contributors"),t.const_set(e[0],"RUBY_DESCRIPTION","opal "+r(e,"RUBY_ENGINE_VERSION")+" ("+r(e,"RUBY_RELEASE_DATE")+" revision "+r(e,"RUBY_REVISION")+")")}};void 0===global.Opal.modules["corelib/helpers"]&&"function"==typeof n&&n(),void 0===global.Opal.modules["corelib/module"]&&"function"==typeof i.a&&Object(i.a)(),void 0===global.Opal.modules["corelib/class"]&&"function"==typeof $&&$(),void 0===global.Opal.modules["corelib/basic_object"]&&"function"==typeof a.a&&Object(a.a)(),void 0===global.Opal.modules["corelib/kernel"]&&"function"==typeof s&&s(),void 0===global.Opal.modules["corelib/error"]&&"function"==typeof o&&o(),void 0===global.Opal.modules["corelib/constants"]&&"function"==typeof l&&l();var u=function(){global.Opal.modules["opal/base"]=function(t){var e=t.top;t.nil,t.const_get_qualified,t.const_get_relative,t.breaker,t.slice;return t.add_stubs(["$require"]),e.$require("corelib/runtime"),e.$require("corelib/helpers"),e.$require("corelib/module"),e.$require("corelib/class"),e.$require("corelib/basic_object"),e.$require("corelib/kernel"),e.$require("corelib/error"),e.$require("corelib/constants")}};var c=function(){global.Opal.modules["corelib/nil"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}t.top;var r=[],n=t.nil,i=(t.const_get_qualified,t.const_get_relative),$=(t.breaker,t.slice,t.klass),a=t.hash2,s=t.truthy;return t.add_stubs(["$raise","$name","$new","$>","$length","$Rational"]),function(r,o,l){var u,c,h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M=$(r,null,"NilClass"),I=[M].concat(l);M.$$prototype.$$meta=M,function(e,r){var n,$=[e].concat(r);t.def(e,"$allocate",n=function(){return this.$raise(i($,"TypeError"),"allocator undefined for "+this.$name())},n.$$arity=0),t.udef(e,"$new")}(t.get_singleton_class(M),I),t.def(M,"$!",u=function(){return!0},u.$$arity=0),t.def(M,"$&",c=function(t){return!1},c.$$arity=1),t.def(M,"$|",h=function(t){return!1!==t&&t!==n},h.$$arity=1),t.def(M,"$^",f=function(t){return!1!==t&&t!==n},f.$$arity=1),t.def(M,"$==",d=function(t){return t===n},d.$$arity=1),t.def(M,"$dup",p=function(){return n},p.$$arity=0),t.def(M,"$clone",_=function(e){if(null==e)e=a([],{});else if(!e.$$is_hash)throw t.ArgumentError.$new("expected kwargs");return null==e.$$smap.freeze&&!0,n},_.$$arity=-1),t.def(M,"$inspect",y=function(){return"nil"},y.$$arity=0),t.def(M,"$nil?",g=function(){return!0},g.$$arity=0),t.def(M,"$singleton_class",m=function(){return i(I,"NilClass")},m.$$arity=0),t.def(M,"$to_a",v=function(){return[]},v.$$arity=0),t.def(M,"$to_h",b=function(){return t.hash()},b.$$arity=0),t.def(M,"$to_i",O=function(){return 0},O.$$arity=0),t.alias(M,"to_f","to_i"),t.def(M,"$to_s",w=function(){return""},w.$$arity=0),t.def(M,"$to_c",E=function(){return i(I,"Complex").$new(0,0)},E.$$arity=0),t.def(M,"$rationalize",x=function(r){var n,$=this;return n=t.slice.call(arguments,0,arguments.length),s(e(n.$length(),1))&&$.$raise(i(I,"ArgumentError")),$.$Rational(0,1)},x.$$arity=-1),t.def(M,"$to_r",k=function(){return this.$Rational(0,1)},k.$$arity=0),t.def(M,"$instance_variables",A=function(){return[]},A.$$arity=0)}(r[0],0,r),t.const_set(r[0],"NIL",n)}};var h=function(){global.Opal.modules["corelib/boolean"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.hash2;return t.add_stubs(["$raise","$name"]),function(e,a,s){var o,l,u,c,h,f,d,p,_,y,g=i(e,a,"Boolean"),m=[g].concat(s);t.defineProperty(g.$$prototype,"$$is_boolean",!0),t.defineProperty(g.$$prototype,"$$meta",g),function(e,r){var i,$=[e].concat(r);t.def(e,"$allocate",i=function(){return this.$raise(n($,"TypeError"),"allocator undefined for "+this.$name())},i.$$arity=0),t.udef(e,"$new")}(t.get_singleton_class(g),m),t.def(g,"$__id__",o=function(){return this.valueOf()?2:0},o.$$arity=0),t.alias(g,"object_id","__id__"),t.def(g,"$!",l=function(){return 1!=this},l.$$arity=0),t.def(g,"$&",u=function(t){return 1==this&&(!1!==t&&t!==r)},u.$$arity=1),t.def(g,"$|",c=function(t){return 1==this||!1!==t&&t!==r},c.$$arity=1),t.def(g,"$^",h=function(t){return 1==this?!1===t||t===r:!1!==t&&t!==r},h.$$arity=1),t.def(g,"$==",f=function(t){return 1==this===t.valueOf()},f.$$arity=1),t.alias(g,"equal?","=="),t.alias(g,"eql?","=="),t.def(g,"$singleton_class",d=function(){return n(m,"Boolean")},d.$$arity=0),t.def(g,"$to_s",p=function(){return 1==this?"true":"false"},p.$$arity=0),t.def(g,"$dup",_=function(){return this},_.$$arity=0),t.def(g,"$clone",y=function(e){if(null==e)e=$([],{});else if(!e.$$is_hash)throw t.ArgumentError.$new("expected kwargs");return null==e.$$smap.freeze&&!0,this},y.$$arity=-1)}(e[0],Boolean,e),t.const_set(e[0],"TrueClass",n(e,"Boolean")),t.const_set(e[0],"FalseClass",n(e,"Boolean")),t.const_set(e[0],"TRUE",!0),t.const_set(e[0],"FALSE",!1)}},f=r(0);var d=function(){global.Opal.modules["corelib/regexp"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.send,a=t.truthy,s=t.gvars;return t.add_stubs(["$nil?","$[]","$raise","$escape","$options","$to_str","$new","$join","$coerce_to!","$!","$match","$coerce_to?","$begin","$coerce_to","$=~","$attr_reader","$===","$inspect","$to_a"]),function(t,e,r){[i(t,e,"RegexpError")].concat(r)}(e[0],n(e,"StandardError"),e),function(e,o,l){var u,c,h,f,d,p,_,y,g,m,v=i(e,o,"Regexp"),b=[v].concat(l);t.const_set(b[0],"IGNORECASE",1),t.const_set(b[0],"EXTENDED",2),t.const_set(b[0],"MULTILINE",4),t.defineProperty(v.$$prototype,"$$is_regexp",!0),function(e,i){var o,l,u,c,h,f=[e].concat(i);t.def(e,"$allocate",o=function(){var e=o.$$p,n=this,i=r,a=r,s=r,l=r;for(e&&(o.$$p=null),s=0,l=arguments.length,a=new Array(l);s<l;s++)a[s]=arguments[s];return(i=$(n,t.find_super_dispatcher(n,"allocate",o,!1),a,e)).uninitialized=!0,i},o.$$arity=0),t.def(e,"$escape",l=function(e){return t.escape_regexp(e)},l.$$arity=1),t.def(e,"$last_match",u=function(t){return null==s["~"]&&(s["~"]=r),null==t&&(t=r),a(t["$nil?"]())?s["~"]:s["~"]["$[]"](t)},u.$$arity=-1),t.alias(e,"quote","escape"),t.def(e,"$union",c=function(e){var r,i,$,a,s,o,l=this;if(0==(r=t.slice.call(arguments,0,arguments.length)).length)return/(?!)/;if(1==r.length&&r[0].$$is_regexp)return r[0];i=r[0].$$is_array,r.length>1&&i&&l.$raise(n(f,"TypeError"),"no implicit conversion of Array into String"),i&&(r=r[0]),s=void 0,$=[];for(var u=0;u<r.length;u++)(a=r[u]).$$is_string?$.push(l.$escape(a)):a.$$is_regexp?(o=a.$options(),null!=s&&s!=o&&l.$raise(n(f,"TypeError"),"All expressions must use the same options"),s=o,$.push("("+a.source+")")):$.push(l.$escape(a.$to_str()));return l.$new($.$join("|"),s)},c.$$arity=-1),t.def(e,"$new",h=function(t,e){if(t.$$is_regexp)return new RegExp(t);if("\\"===(t=n(f,"Opal")["$coerce_to!"](t,n(f,"String"),"to_str")).charAt(t.length-1)&&"\\"!==t.charAt(t.length-2)&&this.$raise(n(f,"RegexpError"),"too short escape sequence: /"+t+"/"),void 0===e||e["$!"]())return new RegExp(t);if(e.$$is_number){var r="";n(f,"IGNORECASE")&e&&(r+="i"),n(f,"MULTILINE")&e&&(r+="m"),e=r}else e="i";return new RegExp(t,e)},h.$$arity=-2)}(t.get_singleton_class(v),b),t.def(v,"$==",u=function(t){return t instanceof RegExp&&this.toString()===t.toString()},u.$$arity=1),t.def(v,"$===",c=function(t){return this.$match(n(b,"Opal")["$coerce_to?"](t,n(b,"String"),"to_str"))!==r},c.$$arity=1),t.def(v,"$=~",h=function(t){var e;return null==s["~"]&&(s["~"]=r),a(e=this.$match(t))?s["~"].$begin(0):e},h.$$arity=1),t.alias(v,"eql?","=="),t.def(v,"$inspect",f=function(){var t=this.toString(),e=/^\/(.*)\/([^\/]*)$/.exec(t);if(e){for(var r=e[1],n=e[2],i=r.split(""),$=i.length,a=!1,s="",o=0;o<$;o++){var l=i[o];a||"/"!=l||(s=s.concat("\\")),s=s.concat(l),a="\\"==l&&!a}return"/"+s+"/"+n}return t},f.$$arity=0),t.def(v,"$match",d=function(e,i){var $=d.$$p,a=$||r;if(null==s["~"]&&(s["~"]=r),$&&(d.$$p=null),$&&(d.$$p=null),this.uninitialized&&this.$raise(n(b,"TypeError"),"uninitialized Regexp"),void 0===i){if(e===r)return s["~"]=r;var o=this.exec(n(b,"Opal").$coerce_to(e,n(b,"String"),"to_str"));return o?(s["~"]=n(b,"MatchData").$new(this,o),a===r?s["~"]:t.yield1(a,s["~"])):s["~"]=r}if(i=n(b,"Opal").$coerce_to(i,n(b,"Integer"),"to_int"),e===r)return s["~"]=r;if(e=n(b,"Opal").$coerce_to(e,n(b,"String"),"to_str"),i<0&&(i+=e.length)<0)return s["~"]=r;for(var l,u=t.global_regexp(this);;){if(null===(l=u.exec(e)))return s["~"]=r;if(l.index>=i)return s["~"]=n(b,"MatchData").$new(u,l),a===r?s["~"]:t.yield1(a,s["~"]);u.lastIndex=l.index+1}},d.$$arity=-2),t.def(v,"$match?",p=function(e,i){var $;return this.uninitialized&&this.$raise(n(b,"TypeError"),"uninitialized Regexp"),void 0===i?e!==r&&this.test(n(b,"Opal").$coerce_to(e,n(b,"String"),"to_str")):(i=n(b,"Opal").$coerce_to(i,n(b,"Integer"),"to_int"),e!==r&&(e=n(b,"Opal").$coerce_to(e,n(b,"String"),"to_str"),!(i<0&&(i+=e.length)<0)&&!(null===($=t.global_regexp(this).exec(e))||$.index<i)))},p.$$arity=-2),t.def(v,"$~",_=function(){return null==s._&&(s._=r),this["$=~"](s._)},_.$$arity=0),t.def(v,"$source",y=function(){return this.source},y.$$arity=0),t.def(v,"$options",g=function(){this.uninitialized&&this.$raise(n(b,"TypeError"),"uninitialized Regexp");var t=0;return this.multiline&&(t|=n(b,"MULTILINE")),this.ignoreCase&&(t|=n(b,"IGNORECASE")),t},g.$$arity=0),t.def(v,"$casefold?",m=function(){return this.ignoreCase},m.$$arity=0),t.alias(v,"to_s","source")}(e[0],RegExp,e),function(e,o,l){var u,c,h,f,d,p,_,y,g,m,v,b,O=i(e,null,"MatchData"),w=[O].concat(l);return O.$$prototype.matches=r,O.$attr_reader("post_match","pre_match","regexp","string"),t.def(O,"$initialize",u=function(t,e){s["~"]=this,this.regexp=t,this.begin=e.index,this.string=e.input,this.pre_match=e.input.slice(0,e.index),this.post_match=e.input.slice(e.index+e[0].length),this.matches=[];for(var n=0,i=e.length;n<i;n++){var $=e[n];null==$?this.matches.push(r):this.matches.push($)}},u.$$arity=2),t.def(O,"$[]",c=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),$(n.matches,"[]",t.to_a(r))},c.$$arity=-1),t.def(O,"$offset",h=function(t){return 0!==t&&this.$raise(n(w,"ArgumentError"),"MatchData#offset only supports 0th element"),[this.begin,this.begin+this.matches[t].length]},h.$$arity=1),t.def(O,"$==",f=function(t){var e,r,i,$;return!!a(n(w,"MatchData")["$==="](t))&&(a(e=a(r=a(i=a($=this.string==t.string)?this.regexp.toString()==t.regexp.toString():$)?this.pre_match==t.pre_match:i)?this.post_match==t.post_match:r)?this.begin==t.begin:e)},f.$$arity=1),t.alias(O,"eql?","=="),t.def(O,"$begin",d=function(t){return 0!==t&&this.$raise(n(w,"ArgumentError"),"MatchData#begin only supports 0th element"),this.begin},d.$$arity=1),t.def(O,"$end",p=function(t){return 0!==t&&this.$raise(n(w,"ArgumentError"),"MatchData#end only supports 0th element"),this.begin+this.matches[t].length},p.$$arity=1),t.def(O,"$captures",_=function(){return this.matches.slice(1)},_.$$arity=0),t.def(O,"$inspect",y=function(){for(var t="#<MatchData "+this.matches[0].$inspect(),e=1,r=this.matches.length;e<r;e++)t+=" "+e+":"+this.matches[e].$inspect();return t+">"},y.$$arity=0),t.def(O,"$length",g=function(){return this.matches.length},g.$$arity=0),t.alias(O,"size","length"),t.def(O,"$to_a",m=function(){return this.matches},m.$$arity=0),t.def(O,"$to_s",v=function(){return this.matches[0]},v.$$arity=0),t.def(O,"$values_at",b=function(e){var i,$=this;i=t.slice.call(arguments,0,arguments.length);var a,s,o,l=[];for(a=0;a<i.length;a++)i[a].$$is_range&&((s=i[a].$to_a()).unshift(a,1),Array.prototype.splice.apply(i,s)),(o=n(w,"Opal")["$coerce_to!"](i[a],n(w,"Integer"),"to_int"))<0&&(o+=$.matches.length)<0?l.push(r):l.push($.matches[o]);return l},b.$$arity=-1),r&&"values_at"}(e[0],0,e)}};void 0===global.Opal.modules["corelib/comparable"]&&"function"==typeof f.a&&Object(f.a)(),void 0===global.Opal.modules["corelib/regexp"]&&"function"==typeof d&&d();var p=function(){global.Opal.modules["corelib/string"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}var n=t.top,i=[],$=t.nil,a=t.const_get_qualified,s=t.const_get_relative,o=(t.breaker,t.slice,t.klass),l=t.truthy,u=t.send,c=t.gvars;return t.add_stubs(["$require","$include","$coerce_to?","$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"]),n.$require("corelib/comparable"),n.$require("corelib/regexp"),function(n,i,h){var f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct,ht,ft,dt,pt,_t,yt,gt,mt,vt,bt,Ot,wt,Et,xt,kt,At,Mt,It,St,Nt,jt,Rt,Tt,zt=o(n,i,"String"),qt=[zt].concat(h);function Ct(t){function e(t){var e,r,n,i,$,a,o="",l=t.length;for(e=0;e<l;e++)if("-"===(r=t.charAt(e))&&e>0&&e<l-1&&!n){for((i=t.charCodeAt(e-1))>($=t.charCodeAt(e+1))&&zt.$raise(s(qt,"ArgumentError"),'invalid range "'+i+"-"+$+'" in string transliteration'),a=i+1;a<$+1;a++)o+=String.fromCharCode(a);n=!0,e++}else n="\\"===r,o+=r;return o}function r(t,e){if(0===t.length)return e;var r,n,i="",$=t.length;for(r=0;r<$;r++)n=t.charAt(r),-1!==e.indexOf(n)&&(i+=n);return i}var n,i,$,a,o,l,u="",c="";for(n=0,i=t.length;n<i;n++)a="^"===($=s(qt,"Opal").$coerce_to(t[n],s(qt,"String"),"to_str")).charAt(0)&&$.length>1,$=e(a?$.slice(1):$),a?c=r(c,$):u=r(u,$);if(u.length>0&&c.length>0){for(l="",n=0,i=u.length;n<i;n++)o=u.charAt(n),-1===c.indexOf(o)&&(l+=o);u=l,c=""}return u.length>0?"["+s(qt,"Regexp").$escape(u)+"]":c.length>0?"[^"+s(qt,"Regexp").$escape(c)+"]":null}zt.$include(s(qt,"Comparable")),t.defineProperty(zt.$$prototype,"$$is_string",!0),t.defineProperty(zt.$$prototype,"$$cast",(function(t){var e=this.$$class;return e.$$constructor===String?t:new e.$$constructor(t)})),t.def(zt,"$__id__",f=function(){return this.toString()},f.$$arity=0),t.alias(zt,"object_id","__id__"),t.defs(zt,"$try_convert",d=function(t){return s(qt,"Opal")["$coerce_to?"](t,s(qt,"String"),"to_str")},d.$$arity=1),t.defs(zt,"$new",p=function(t){return null==t&&(t=""),t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str"),new this.$$constructor(t)},p.$$arity=-1),t.def(zt,"$initialize",_=function(t){return void 0===t?this:this.$raise(s(qt,"NotImplementedError"),"Mutable strings are not supported in Opal.")},_.$$arity=-1),t.def(zt,"$%",y=function(e){var r=this;return l(s(qt,"Array")["$==="](e))?u(r,"format",[r].concat(t.to_a(e))):r.$format(r,e)},y.$$arity=1),t.def(zt,"$*",g=function(t){if((t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int"))<0&&this.$raise(s(qt,"ArgumentError"),"negative argument"),0===t)return this.$$cast("");var e="",r=this.toString();for(r.length*t>=1<<28&&this.$raise(s(qt,"RangeError"),"multiply count must not overflow maximum string size");1==(1&t)&&(e+=r),0!==(t>>>=1);)r+=r;return this.$$cast(e)},g.$$arity=1),t.def(zt,"$+",m=function(t){return this+(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str")).$to_s()},m.$$arity=1),t.def(zt,"$<=>",v=function(t){if(l(t["$respond_to?"]("to_str")))return this>(t=t.$to_str().$to_s())?1:this<t?-1:0;var e=t["$<=>"](this);return e===$?$:e>0?-1:e<0?1:0},v.$$arity=1),t.def(zt,"$==",b=function(t){return t.$$is_string?this.toString()===t.toString():!!s(qt,"Opal")["$respond_to?"](t,"to_str")&&t["$=="](this)},b.$$arity=1),t.alias(zt,"eql?","=="),t.alias(zt,"===","=="),t.def(zt,"$=~",O=function(t){return t.$$is_string&&this.$raise(s(qt,"TypeError"),"type mismatch: String given"),t["$=~"](this)},O.$$arity=1),t.def(zt,"$[]",w=function(t,e){var r,n=this.length;if(t.$$is_range)return r=t.excl,e=s(qt,"Opal").$coerce_to(t.end,s(qt,"Integer"),"to_int"),t=s(qt,"Opal").$coerce_to(t.begin,s(qt,"Integer"),"to_int"),Math.abs(t)>n?$:(t<0&&(t+=n),e<0&&(e+=n),r||(e+=1),(e-=t)<0&&(e=0),this.$$cast(this.substr(t,e)));if(t.$$is_string)return null!=e&&this.$raise(s(qt,"TypeError")),-1!==this.indexOf(t)?this.$$cast(t):$;if(t.$$is_regexp){var i=this.match(t);return null===i?(c["~"]=$,$):(c["~"]=s(qt,"MatchData").$new(t,i),null==e?this.$$cast(i[0]):(e=s(qt,"Opal").$coerce_to(e,s(qt,"Integer"),"to_int"))<0&&-e<i.length?this.$$cast(i[e+=i.length]):e>=0&&e<i.length?this.$$cast(i[e]):$)}return(t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int"))<0&&(t+=n),null==e?t>=n||t<0?$:this.$$cast(this.substr(t,1)):(e=s(qt,"Opal").$coerce_to(e,s(qt,"Integer"),"to_int"))<0?$:t>n||t<0?$:this.$$cast(this.substr(t,e))},w.$$arity=-2),t.alias(zt,"byteslice","[]"),t.def(zt,"$b",E=function(){return this.$force_encoding("binary")},E.$$arity=0),t.def(zt,"$capitalize",x=function(){return this.$$cast(this.charAt(0).toUpperCase()+this.substr(1).toLowerCase())},x.$$arity=0),t.def(zt,"$casecmp",k=function(t){var e=this;if(!l(t["$respond_to?"]("to_str")))return $;t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str").$to_s();var r=/^[\x00-\x7F]*$/;return r.test(e)&&r.test(t)&&(e=e.toLowerCase(),t=t.toLowerCase()),e["$<=>"](t)},k.$$arity=1),t.def(zt,"$casecmp?",A=function(t){var e=this.$casecmp(t);return e===$?$:0===e},A.$$arity=1),t.def(zt,"$center",M=function(t,n){if(null==n&&(n=" "),t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int"),n=s(qt,"Opal").$coerce_to(n,s(qt,"String"),"to_str").$to_s(),l(n["$empty?"]())&&this.$raise(s(qt,"ArgumentError"),"zero width padding"),l(t<=this.length))return this;var i=this.$ljust(e(r(t,this.length),2).$ceil(),n),$=this.$rjust(e(r(t,this.length),2).$floor(),n);return this.$$cast($+i.slice(this.length))},M.$$arity=-2),t.def(zt,"$chars",I=function(){var t=I.$$p,e=t||$;return t&&(I.$$p=null),t&&(I.$$p=null),l(e)?u(this,"each_char",[],e.$to_proc()):this.$each_char().$to_a()},I.$$arity=0),t.def(zt,"$chomp",S=function(t){var e;if(null==c["/"]&&(c["/"]=$),null==t&&(t=c["/"]),l(t===$||0===this.length))return this;if("\n"===(t=s(qt,"Opal")["$coerce_to!"](t,s(qt,"String"),"to_str").$to_s()))e=this.replace(/\r?\n?$/,"");else if(""===t)e=this.replace(/(\r?\n)+$/,"");else if(this.length>=t.length){this.substr(this.length-t.length,t.length)===t&&(e=this.substr(0,this.length-t.length))}return null!=e?this.$$cast(e):this},S.$$arity=-1),t.def(zt,"$chop",N=function(){var t,e=this.length;return t=e<=1?"":"\n"===this.charAt(e-1)&&"\r"===this.charAt(e-2)?this.substr(0,e-2):this.substr(0,e-1),this.$$cast(t)},N.$$arity=0),t.def(zt,"$chr",j=function(){return this.charAt(0)},j.$$arity=0),t.def(zt,"$clone",R=function(){var t=$;return(t=this.slice()).$copy_singleton_methods(this),t.$initialize_clone(this),t},R.$$arity=0),t.def(zt,"$dup",T=function(){var t=$;return(t=this.slice()).$initialize_dup(this),t},T.$$arity=0),t.def(zt,"$count",z=function(e){var r,n=this;0===(r=t.slice.call(arguments,0,arguments.length)).length&&n.$raise(s(qt,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");var i=Ct(r);return null===i?0:n.length-n.replace(new RegExp(i,"g"),"").length},z.$$arity=-1),t.def(zt,"$delete",q=function(e){var r,n=this;0===(r=t.slice.call(arguments,0,arguments.length)).length&&n.$raise(s(qt,"ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");var i=Ct(r);return null===i?n:n.$$cast(n.replace(new RegExp(i,"g"),""))},q.$$arity=-1),t.def(zt,"$delete_prefix",C=function(t){return t.$$is_string||(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str")),this.slice(0,t.length)===t?this.$$cast(this.slice(t.length)):this},C.$$arity=1),t.def(zt,"$delete_suffix",P=function(t){return t.$$is_string||(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str")),this.slice(this.length-t.length)===t?this.$$cast(this.slice(0,this.length-t.length)):this},P.$$arity=1),t.def(zt,"$downcase",F=function(){return this.$$cast(this.toLowerCase())},F.$$arity=0),t.def(zt,"$each_char",D=function(){var e,r=D.$$p,n=r||$;if(r&&(D.$$p=null),r&&(D.$$p=null),n===$)return u(this,"enum_for",["each_char"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i=0,a=this.length;i<a;i++)t.yield1(n,this.charAt(i));return this},D.$$arity=0),t.def(zt,"$each_line",L=function(e){var r,n,i,a,o,l,u,h=L.$$p,f=h||$;if(null==c["/"]&&(c["/"]=$),h&&(L.$$p=null),h&&(L.$$p=null),null==e&&(e=c["/"]),f===$)return this.$enum_for("each_line",e);if(e===$)return t.yield1(f,this),this;if(0===(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str")).length){for(n=0,i=(r=this.split(/(\n{2,})/)).length;n<i;n+=2)if(r[n]||r[n+1]){var d=(r[n]||"")+(r[n+1]||"");t.yield1(f,this.$$cast(d))}return this}for(o=this.$chomp(e),l=this.length!=o.length,n=0,a=(u=o.split(e)).length;n<a;n++)n<a-1||l?t.yield1(f,this.$$cast(u[n]+e)):t.yield1(f,this.$$cast(u[n]));return this},L.$$arity=-1),t.def(zt,"$empty?",B=function(){return 0===this.length},B.$$arity=0),t.def(zt,"$end_with?",U=function(e){for(var r,n=this,i=0,$=(r=t.slice.call(arguments,0,arguments.length)).length;i<$;i++){var a=s(qt,"Opal").$coerce_to(r[i],s(qt,"String"),"to_str").$to_s();if(n.length>=a.length&&n.substr(n.length-a.length,a.length)==a)return!0}return!1},U.$$arity=-1),t.alias(zt,"equal?","==="),t.def(zt,"$gsub",G=function(e,r){var n=G.$$p,i=n||$,a=this;if(n&&(G.$$p=null),n&&(G.$$p=null),void 0===r&&i===$)return a.$enum_for("gsub",e);var o,l,u,h="",f=$,d=0;for(e.$$is_regexp?e=t.global_multiline_regexp(e):(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str"),e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));;){if(null===(o=e.exec(a))){c["~"]=$,h+=a.slice(d);break}f=s(qt,"MatchData").$new(e,o),void 0===r?(u=e.lastIndex,l=i(o[0]),e.lastIndex=u):r.$$is_hash?l=r["$[]"](o[0]).$to_s():(r.$$is_string||(r=s(qt,"Opal").$coerce_to(r,s(qt,"String"),"to_str")),l=r.replace(/([\\]+)([0-9+&`'])/g,(function(t,e,r){if(e.length%2==0)return t;switch(r){case"+":for(var n=o.length-1;n>0;n--)if(void 0!==o[n])return e.slice(1)+o[n];return"";case"&":return e.slice(1)+o[0];case"`":return e.slice(1)+a.slice(0,o.index);case"'":return e.slice(1)+a.slice(o.index+o[0].length);default:return e.slice(1)+(o[r]||"")}})).replace(/\\\\/g,"\\")),e.lastIndex===o.index?(h+=l+a.slice(d,o.index+1),e.lastIndex+=1):h+=a.slice(d,o.index)+l,d=e.lastIndex}return c["~"]=f,a.$$cast(h)},G.$$arity=-2),t.def(zt,"$hash",H=function(){return this.toString()},H.$$arity=0),t.def(zt,"$hex",X=function(){return this.$to_i(16)},X.$$arity=0),t.def(zt,"$include?",Y=function(t){return t.$$is_string||(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str")),-1!==this.indexOf(t)},Y.$$arity=1),t.def(zt,"$index",K=function(e,r){var n,i,a;if(void 0===r)r=0;else if((r=s(qt,"Opal").$coerce_to(r,s(qt,"Integer"),"to_int"))<0&&(r+=this.length)<0)return $;if(e.$$is_regexp)for(a=t.global_multiline_regexp(e);;){if(null===(i=a.exec(this))){c["~"]=$,n=-1;break}if(i.index>=r){c["~"]=s(qt,"MatchData").$new(a,i),n=i.index;break}a.lastIndex=i.index+1}else n=0===(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str")).length&&r>this.length?-1:this.indexOf(e,r);return-1===n?$:n},K.$$arity=-2),t.def(zt,"$inspect",V=function(){var t={"":"\\a","":"\\e","\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\v":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+this.replace(/[\\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,(function(e){return t[e]||"\\u"+("0000"+e.charCodeAt(0).toString(16).toUpperCase()).slice(-4)})).replace(/\#[\$\@\{]/g,"\\$&")+'"'},V.$$arity=0),t.def(zt,"$intern",Z=function(){return this.toString()},Z.$$arity=0),t.def(zt,"$lines",J=function(t){var e=J.$$p,r=e||$,n=$;return null==c["/"]&&(c["/"]=$),e&&(J.$$p=null),e&&(J.$$p=null),null==t&&(t=c["/"]),n=u(this,"each_line",[t],r.$to_proc()),l(r)?this:n.$to_a()},J.$$arity=-1),t.def(zt,"$length",Q=function(){return this.length},Q.$$arity=0),t.def(zt,"$ljust",W=function(t,e){if(null==e&&(e=" "),t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int"),e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str").$to_s(),l(e["$empty?"]())&&this.$raise(s(qt,"ArgumentError"),"zero width padding"),l(t<=this.length))return this;var r=-1,n="";for(t-=this.length;++r<t;)n+=e;return this.$$cast(this+n.slice(0,t))},W.$$arity=-2),t.def(zt,"$lstrip",tt=function(){return this.replace(/^\s*/,"")},tt.$$arity=0),t.def(zt,"$ascii_only?",et=function(){return!this.$encoding()["$=="](a(s(qt,"Encoding"),"UTF_16BE"))&&/^[\x00-\x7F]*$/.test(this)},et.$$arity=0),t.def(zt,"$match",rt=function(t,e){var r,n=rt.$$p,i=n||$;return n&&(rt.$$p=null),n&&(rt.$$p=null),l(l(r=s(qt,"String")["$==="](t))?r:t["$respond_to?"]("to_str"))&&(t=s(qt,"Regexp").$new(t.$to_str())),l(s(qt,"Regexp")["$==="](t))||this.$raise(s(qt,"TypeError"),"wrong argument type "+t.$class()+" (expected Regexp)"),u(t,"match",[this,e],i.$to_proc())},rt.$$arity=-2),t.def(zt,"$match?",nt=function(t,e){var r;return l(l(r=s(qt,"String")["$==="](t))?r:t["$respond_to?"]("to_str"))&&(t=s(qt,"Regexp").$new(t.$to_str())),l(s(qt,"Regexp")["$==="](t))||this.$raise(s(qt,"TypeError"),"wrong argument type "+t.$class()+" (expected Regexp)"),t["$match?"](this,e)},nt.$$arity=-2),t.def(zt,"$next",it=function(){var t=this.length;if(0===t)return this.$$cast("");for(var e,r=this,n=this.search(/[a-zA-Z0-9]/),i=!1;t--;){if((e=this.charCodeAt(t))>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)switch(e){case 57:i=!0,e=48;break;case 90:i=!0,e=65;break;case 122:i=!0,e=97;break;default:i=!1,e+=1}else-1===n?255===e?(i=!0,e=0):(i=!1,e+=1):i=!0;if(r=r.slice(0,t)+String.fromCharCode(e)+r.slice(t+1),i&&(0===t||t===n)){switch(e){case 65:case 97:break;default:e+=1}r=0===t?String.fromCharCode(e)+r:r.slice(0,t)+String.fromCharCode(e)+r.slice(t),i=!1}if(!i)break}return this.$$cast(r)},it.$$arity=0),t.def(zt,"$oct",$t=function(){var t,e=this,r=8;return/^\s*_/.test(e)?0:(e=e.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,(function(t,e,n,i){switch(i.charAt(0)){case"+":case"-":return t;case"0":if("x"===i.charAt(1)&&"0x"===n)return t}switch(n){case"0b":r=2;break;case"0":case"0o":r=8;break;case"0d":r=10;break;case"0x":r=16}return e+i})),t=parseInt(e.replace(/_(?!_)/g,""),r),isNaN(t)?0:t)},$t.$$arity=0),t.def(zt,"$ord",at=function(){return this.charCodeAt(0)},at.$$arity=0),t.def(zt,"$partition",st=function(t){var e,r;return t.$$is_regexp?null===(r=t.exec(this))?e=-1:(s(qt,"MatchData").$new(t,r),t=r[0],e=r.index):(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str"),e=this.indexOf(t)),-1===e?[this,"",""]:[this.slice(0,e),this.slice(e,e+t.length),this.slice(e+t.length)]},st.$$arity=1),t.def(zt,"$reverse",ot=function(){return this.split("").reverse().join("")},ot.$$arity=0),t.def(zt,"$rindex",lt=function(e,r){var n,i,a,o;if(void 0===r)r=this.length;else if((r=s(qt,"Opal").$coerce_to(r,s(qt,"Integer"),"to_int"))<0&&(r+=this.length)<0)return $;if(e.$$is_regexp){for(i=null,a=t.global_multiline_regexp(e);!(null===(o=a.exec(this))||o.index>r);)i=o,a.lastIndex=i.index+1;null===i?(c["~"]=$,n=-1):(s(qt,"MatchData").$new(a,i),n=i.index)}else e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str"),n=this.lastIndexOf(e,r);return-1===n?$:n},lt.$$arity=-2),t.def(zt,"$rjust",ut=function(t,e){if(null==e&&(e=" "),t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int"),e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str").$to_s(),l(e["$empty?"]())&&this.$raise(s(qt,"ArgumentError"),"zero width padding"),l(t<=this.length))return this;var r=Math.floor(t-this.length),n=Math.floor(r/e.length),i=Array(n+1).join(e),$=r-i.length;return this.$$cast(i+e.slice(0,$)+this)},ut.$$arity=-2),t.def(zt,"$rpartition",ct=function(e){var r,n,i,$;if(e.$$is_regexp){for(n=null,i=t.global_multiline_regexp(e);null!==($=i.exec(this));)n=$,i.lastIndex=n.index+1;null===n?r=-1:(s(qt,"MatchData").$new(i,n),e=n[0],r=n.index)}else e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str"),r=this.lastIndexOf(e);return-1===r?["","",this]:[this.slice(0,r),this.slice(r,r+e.length),this.slice(r+e.length)]},ct.$$arity=1),t.def(zt,"$rstrip",ht=function(){return this.replace(/[\s\u0000]*$/,"")},ht.$$arity=0),t.def(zt,"$scan",ft=function(e){var r=ft.$$p,n=r||$;r&&(ft.$$p=null),r&&(ft.$$p=null);var i,a=[],o=$;for(e.$$is_regexp?e=t.global_multiline_regexp(e):(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str"),e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));null!=(i=e.exec(this));)o=s(qt,"MatchData").$new(e,i),n===$?1==i.length?a.push(i[0]):a.push(o.$captures()):1==i.length?n(i[0]):n.call(this,o.$captures()),e.lastIndex===i.index&&(e.lastIndex+=1);return c["~"]=o,n!==$?this:a},ft.$$arity=1),t.alias(zt,"size","length"),t.alias(zt,"slice","[]"),t.def(zt,"$split",dt=function(e,r){var n,i=this;if(null==c[";"]&&(c[";"]=$),0===i.length)return[];if(void 0===r)r=0;else if(1===(r=s(qt,"Opal")["$coerce_to!"](r,s(qt,"Integer"),"to_int")))return[i];void 0!==e&&e!==$||(e=l(n=c[";"])?n:" ");var a,o,u,h=[],f=i.toString(),d=0;if(e.$$is_regexp?e=t.global_multiline_regexp(e):" "===(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str").$to_s())?(e=/\s+/gm,f=f.replace(/^\s+/,"")):e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"),1===(h=f.split(e)).length&&h[0]===f)return[i.$$cast(h[0])];for(;-1!==(o=h.indexOf(void 0));)h.splice(o,1);function p(){for(o=0;o<h.length;o++)h[o]=i.$$cast(h[o])}if(0===r){for(;""===h[h.length-1];)h.length-=1;return p(),h}if(a=e.exec(f),r<0){if(null!==a&&""===a[0]&&-1===e.source.indexOf("(?="))for(o=0,u=a.length;o<u;o++)h.push("");return p(),h}if(null!==a&&""===a[0])return h.splice(r-1,h.length-1,h.slice(r-1).join("")),p(),h;if(r>=h.length)return p(),h;for(o=0;null!==a&&(o++,d=e.lastIndex,o+1!==r);)a=e.exec(f);return h.splice(r-1,h.length-1,f.slice(d)),p(),h},dt.$$arity=-1),t.def(zt,"$squeeze",pt=function(e){var r,n=this;if(0===(r=t.slice.call(arguments,0,arguments.length)).length)return n.$$cast(n.replace(/(.)\1+/g,"$1"));var i=Ct(r);return null===i?n:n.$$cast(n.replace(new RegExp("("+i+")\\1+","g"),"$1"))},pt.$$arity=-1),t.def(zt,"$start_with?",_t=function(e){for(var r,n=this,i=0,$=(r=t.slice.call(arguments,0,arguments.length)).length;i<$;i++){var a=s(qt,"Opal").$coerce_to(r[i],s(qt,"String"),"to_str").$to_s();if(0===n.indexOf(a))return!0}return!1},_t.$$arity=-1),t.def(zt,"$strip",yt=function(){return this.replace(/^\s*/,"").replace(/[\s\u0000]*$/,"")},yt.$$arity=0),t.def(zt,"$sub",gt=function(t,e){var r=gt.$$p,n=r||$,i=this;r&&(gt.$$p=null),r&&(gt.$$p=null),t.$$is_regexp||(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str"),t=new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));var a,o=t.exec(i);return null===o?(c["~"]=$,a=i.toString()):(s(qt,"MatchData").$new(t,o),void 0===e?(n===$&&i.$raise(s(qt,"ArgumentError"),"wrong number of arguments (1 for 2)"),a=i.slice(0,o.index)+n(o[0])+i.slice(o.index+o[0].length)):e.$$is_hash?a=i.slice(0,o.index)+e["$[]"](o[0]).$to_s()+i.slice(o.index+o[0].length):(e=(e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str")).replace(/([\\]+)([0-9+&`'])/g,(function(t,e,r){if(e.length%2==0)return t;switch(r){case"+":for(var n=o.length-1;n>0;n--)if(void 0!==o[n])return e.slice(1)+o[n];return"";case"&":return e.slice(1)+o[0];case"`":return e.slice(1)+i.slice(0,o.index);case"'":return e.slice(1)+i.slice(o.index+o[0].length);default:return e.slice(1)+(o[r]||"")}})).replace(/\\\\/g,"\\"),a=i.slice(0,o.index)+e+i.slice(o.index+o[0].length))),i.$$cast(a)},gt.$$arity=-2),t.alias(zt,"succ","next"),t.def(zt,"$sum",mt=function(t){null==t&&(t=16),t=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int");for(var e=0,r=this.length,n=0;n<r;n++)e+=this.charCodeAt(n);return t<=0?e:e&Math.pow(2,t)-1},mt.$$arity=-1),t.def(zt,"$swapcase",vt=function(){var t=this.replace(/([a-z]+)|([A-Z]+)/g,(function(t,e,r){return e?t.toUpperCase():t.toLowerCase()}));return this.constructor===String?t:this.$class().$new(t)},vt.$$arity=0),t.def(zt,"$to_f",bt=function(){if("_"===this.charAt(0))return 0;var t=parseFloat(this.replace(/_/g,""));return isNaN(t)||t==1/0||t==-1/0?0:t},bt.$$arity=0),t.def(zt,"$to_i",Ot=function(t){null==t&&(t=10);var e,r=this.toLowerCase(),n=s(qt,"Opal").$coerce_to(t,s(qt,"Integer"),"to_int");return(1===n||n<0||n>36)&&this.$raise(s(qt,"ArgumentError"),"invalid radix "+n),/^\s*_/.test(r)?0:(r=r.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/,(function(t,e,r,i){switch(i.charAt(0)){case"+":case"-":return t;case"0":if("x"===i.charAt(1)&&"0x"===r&&(0===n||16===n))return t}switch(r){case"0b":if(0===n||2===n)return n=2,e+i;break;case"0":case"0o":if(0===n||8===n)return n=8,e+i;break;case"0d":if(0===n||10===n)return n=10,e+i;break;case"0x":if(0===n||16===n)return n=16,e+i}return t})),e=parseInt(r.replace(/_(?!_)/g,""),n),isNaN(e)?0:e)},Ot.$$arity=-1),t.def(zt,"$to_proc",wt=function(){var e,n,i=wt.$$p;return i&&(wt.$$p=null),n=r("$",this.valueOf()),u(this,"proc",[],((e=function(r){var i,a=null==e.$$s?this:e.$$s,o=e.$$p,l=o||$;o&&(e.$$p=null),0===(i=t.slice.call(arguments,0,arguments.length)).length&&a.$raise(s(qt,"ArgumentError"),"no receiver given");var u=i[0];null==u&&(u=$);var c=u[n];return c?("function"==typeof l&&(c.$$p=l),1===i.length?c.call(u):c.apply(u,i.slice(1))):u.$method_missing.apply(u,i)}).$$s=this,e.$$arity=-1,e))},wt.$$arity=0),t.def(zt,"$to_s",Et=function(){return this.toString()},Et.$$arity=0),t.alias(zt,"to_str","to_s"),t.alias(zt,"to_sym","intern"),t.def(zt,"$tr",xt=function(t,e){var r,n,i,$,a,o,l;if(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str").$to_s(),e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str").$to_s(),0==t.length||t===e)return this;var u={},c=t.split(""),h=c.length,f=e.split(""),d=f.length,p=!1,_=null;"^"===c[0]&&c.length>1&&(p=!0,c.shift(),_=f[d-1],h-=1);var y=[],g=null;for(n=!1,r=0;r<h;r++)if($=c[r],null==g)g=$,y.push($);else if("-"===$)"-"===g?(y.push("-"),y.push("-")):r==h-1?y.push("-"):n=!0;else if(n){for((a=g.charCodeAt(0))>(o=$.charCodeAt(0))&&this.$raise(s(qt,"ArgumentError"),'invalid range "'+String.fromCharCode(a)+"-"+String.fromCharCode(o)+'" in string transliteration'),i=a+1;i<o;i++)y.push(String.fromCharCode(i));y.push($),n=null,g=null}else y.push($);if(h=(c=y).length,p)for(r=0;r<h;r++)u[c[r]]=!0;else{if(d>0){var m=[],v=null;for(n=!1,r=0;r<d;r++)if($=f[r],null==v)v=$,m.push($);else if("-"===$)"-"===v?(m.push("-"),m.push("-")):r==d-1?m.push("-"):n=!0;else if(n){for((a=v.charCodeAt(0))>(o=$.charCodeAt(0))&&this.$raise(s(qt,"ArgumentError"),'invalid range "'+String.fromCharCode(a)+"-"+String.fromCharCode(o)+'" in string transliteration'),i=a+1;i<o;i++)m.push(String.fromCharCode(i));m.push($),n=null,v=null}else m.push($);d=(f=m).length}var b=h-d;if(b>0){var O=d>0?f[d-1]:"";for(r=0;r<b;r++)f.push(O)}for(r=0;r<h;r++)u[c[r]]=f[r]}var w="";for(r=0,l=this.length;r<l;r++){var E=u[$=this.charAt(r)];w+=p?null==E?_:$:null!=E?E:$}return this.$$cast(w)},xt.$$arity=2),t.def(zt,"$tr_s",kt=function(t,e){var r,n,i,$,a,o,l;if(t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str").$to_s(),e=s(qt,"Opal").$coerce_to(e,s(qt,"String"),"to_str").$to_s(),0==t.length)return this;var u={},c=t.split(""),h=c.length,f=e.split(""),d=f.length,p=!1,_=null;"^"===c[0]&&c.length>1&&(p=!0,c.shift(),_=f[d-1],h-=1);var y=[],g=null;for(n=!1,r=0;r<h;r++)if($=c[r],null==g)g=$,y.push($);else if("-"===$)"-"===g?(y.push("-"),y.push("-")):r==h-1?y.push("-"):n=!0;else if(n){for((a=g.charCodeAt(0))>(o=$.charCodeAt(0))&&this.$raise(s(qt,"ArgumentError"),'invalid range "'+String.fromCharCode(a)+"-"+String.fromCharCode(o)+'" in string transliteration'),i=a+1;i<o;i++)y.push(String.fromCharCode(i));y.push($),n=null,g=null}else y.push($);if(h=(c=y).length,p)for(r=0;r<h;r++)u[c[r]]=!0;else{if(d>0){var m=[];for(n=!1,r=0;r<d;r++)if($=f[r],null==g)g=$,m.push($);else if("-"===$)r==d-1?m.push("-"):n=!0;else if(n){for((a=g.charCodeAt(0))>(o=$.charCodeAt(0))&&this.$raise(s(qt,"ArgumentError"),'invalid range "'+String.fromCharCode(a)+"-"+String.fromCharCode(o)+'" in string transliteration'),i=a+1;i<o;i++)m.push(String.fromCharCode(i));m.push($),n=null,g=null}else m.push($);d=(f=m).length}var v=h-d;if(v>0){var b=d>0?f[d-1]:"";for(r=0;r<v;r++)f.push(b)}for(r=0;r<h;r++)u[c[r]]=f[r]}var O="",w=null;for(r=0,l=this.length;r<l;r++){var E=u[$=this.charAt(r)];p?null==E?null==w&&(O+=_,w=!0):(O+=$,w=null):null!=E?null!=w&&w===E||(O+=E,w=E):(O+=$,w=null)}return this.$$cast(O)},kt.$$arity=2),t.def(zt,"$upcase",At=function(){return this.$$cast(this.toUpperCase())},At.$$arity=0),t.def(zt,"$upto",Mt=function(t,e){var r=Mt.$$p,n=r||$;if(r&&(Mt.$$p=null),r&&(Mt.$$p=null),null==e&&(e=!1),n===$)return this.$enum_for("upto",t,e);t=s(qt,"Opal").$coerce_to(t,s(qt,"String"),"to_str");var i,a,o=this.toString();if(1===o.length&&1===t.length)for(i=o.charCodeAt(0),a=t.charCodeAt(0);i<=a&&(!e||i!==a);)n(String.fromCharCode(i)),i+=1;else if(parseInt(o,10).toString()===o&&parseInt(t,10).toString()===t)for(i=parseInt(o,10),a=parseInt(t,10);i<=a&&(!e||i!==a);)n(i.toString()),i+=1;else for(;o.length<=t.length&&o<=t&&(!e||o!==t);)n(o),o=o.$succ();return this},Mt.$$arity=-2),t.def(zt,"$instance_variables",It=function(){return[]},It.$$arity=0),t.defs(zt,"$_load",St=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),u(n,"new",t.to_a(r))},St.$$arity=-1),t.def(zt,"$unicode_normalize",Nt=function(t){return this.toString()},Nt.$$arity=-1),t.def(zt,"$unicode_normalized?",jt=function(t){return!0},jt.$$arity=-1),t.def(zt,"$unpack",Rt=function(t){return this.$raise("To use String#unpack, you must first require 'corelib/string/unpack'.")},Rt.$$arity=1),t.def(zt,"$unpack1",Tt=function(t){return this.$raise("To use String#unpack1, you must first require 'corelib/string/unpack'.")},Tt.$$arity=1)}(i[0],String,i),t.const_set(i[0],"Symbol",s(i,"String"))}};var _=function(){global.Opal.modules["corelib/enumerable"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function $(t,e){return"number"==typeof t&&"number"==typeof e?t<=e:t["$<="](e)}t.top;var a=[],s=t.nil,o=t.const_get_qualified,l=t.const_get_relative,u=(t.breaker,t.slice,t.module),c=t.truthy,h=t.send,f=t.falsy,d=t.hash2,p=t.lambda;return t.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!","$>","$*","$coerce_to","$try_convert","$<","$+","$-","$ceil","$/","$size","$__send__","$length","$<=","$[]","$push","$<<","$[]=","$===","$inspect","$<=>","$first","$reverse","$sort","$to_proc","$compare","$call","$dup","$to_a","$sort!","$map!","$key?","$values","$zip"]),function(a,_){var y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct=u(a,"Enumerable"),ht=[ct].concat(_);function ft(t){return 0===t.length&&(t=[s]),t.length>1&&(t=[t]),t}t.def(ct,"$all?",y=function(e){try{var r,n,i,$=y.$$p,a=$||s;return $&&(y.$$p=null),$&&(y.$$p=null),c(void 0!==e)?h(this,"each",[],((r=function(n){null==r.$$s||r.$$s;var i=s;if(i=ft(t.slice.call(arguments,0,arguments.length)),c(h(e,"public_send",["==="].concat(t.to_a(i)))))return s;t.ret(!1)}).$$s=this,r.$$arity=-1,r)):h(this,"each",[],a!==s?((n=function(e){var r;null==n.$$s||n.$$s;if(r=t.slice.call(arguments,0,arguments.length),c(t.yieldX(a,t.to_a(r))))return s;t.ret(!1)}).$$s=this,n.$$arity=-1,n):((i=function(e){var r;null==i.$$s||i.$$s;if(r=t.slice.call(arguments,0,arguments.length),c(l(ht,"Opal").$destructure(r)))return s;t.ret(!1)}).$$s=this,i.$$arity=-1,i)),!0}catch(e){if(e===t.returner)return e.$v;throw e}},y.$$arity=-1),t.def(ct,"$any?",g=function(e){try{var r,n,i,$=g.$$p,a=$||s;return $&&(g.$$p=null),$&&(g.$$p=null),c(void 0!==e)?h(this,"each",[],((r=function(n){null==r.$$s||r.$$s;var i=s;if(i=ft(t.slice.call(arguments,0,arguments.length)),!c(h(e,"public_send",["==="].concat(t.to_a(i)))))return s;t.ret(!0)}).$$s=this,r.$$arity=-1,r)):h(this,"each",[],a!==s?((n=function(e){var r;null==n.$$s||n.$$s;if(r=t.slice.call(arguments,0,arguments.length),!c(t.yieldX(a,t.to_a(r))))return s;t.ret(!0)}).$$s=this,n.$$arity=-1,n):((i=function(e){var r;null==i.$$s||i.$$s;if(r=t.slice.call(arguments,0,arguments.length),!c(l(ht,"Opal").$destructure(r)))return s;t.ret(!0)}).$$s=this,i.$$arity=-1,i)),!1}catch(e){if(e===t.returner)return e.$v;throw e}},g.$$arity=-1),t.def(ct,"$chunk",m=function(){var e,r,n=m.$$p,i=n||s;return n&&(m.$$p=null),n&&(m.$$p=null),i===s?h(this,"to_enum",["chunk"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e)):h(o("::","Enumerator"),"new",[],((r=function(e){var n=null==r.$$s?this:r.$$s;null==e&&(e=s);var $=s,a=[];function o(){a.length>0&&e.$yield($,a)}n.$each.$$p=function(e){var r=t.yield1(i,e);r===s?(o(),a=[],$=s):($===s||$===r?a.push(e):(o(),a=[e]),$=r)},n.$each(),o()}).$$s=this,r.$$arity=1,r))},m.$$arity=0),t.def(ct,"$chunk_while",v=function(){var e,r=v.$$p,n=r||s;return r&&(v.$$p=null),r&&(v.$$p=null),n!==s||this.$raise(l(ht,"ArgumentError"),"no block given"),h(this,"slice_when",[],((e=function(r,i){null==e.$$s||e.$$s;return null==r&&(r=s),null==i&&(i=s),t.yieldX(n,[r,i])["$!"]()}).$$s=this,e.$$arity=2,e))},v.$$arity=0),t.def(ct,"$collect",b=function(){var e,r=b.$$p,n=r||s;if(r&&(b.$$p=null),r&&(b.$$p=null),n===s)return h(this,"enum_for",["collect"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e));var i=[];return this.$each.$$p=function(){var e=t.yieldX(n,arguments);i.push(e)},this.$each(),i},b.$$arity=0),t.def(ct,"$collect_concat",O=function(){var e,r,n=O.$$p,i=n||s;return n&&(O.$$p=null),n&&(O.$$p=null),i===s?h(this,"enum_for",["collect_concat"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e)):h(this,"map",[],(r=function(e){null==r.$$s||r.$$s;return null==e&&(e=s),t.yield1(i,e)},r.$$s=this,r.$$arity=1,r)).$flatten(1)},O.$$arity=0),t.def(ct,"$count",w=function(e){var r,n,i,$=w.$$p,a=$||s,o=s;return $&&(w.$$p=null),$&&(w.$$p=null),o=0,null!=e&&a!==s&&this.$warn("warning: given block not used"),c(null!=e)?a=h(this,"proc",[],((r=function(n){var i;null==r.$$s||r.$$s;return i=t.slice.call(arguments,0,arguments.length),l(ht,"Opal").$destructure(i)["$=="](e)}).$$s=this,r.$$arity=-1,r)):c(a["$nil?"]())&&(a=h(this,"proc",[],((n=function(){null==n.$$s||n.$$s;return!0}).$$s=this,n.$$arity=0,n))),h(this,"each",[],((i=function(e){var r;null==i.$$s||i.$$s;return r=t.slice.call(arguments,0,arguments.length),c(t.yieldX(a,r))?o++:s}).$$s=this,i.$$arity=-1,i)),o},w.$$arity=-1),t.def(ct,"$cycle",E=function(r){var n,i=E.$$p,$=i||s;if(i&&(E.$$p=null),i&&(E.$$p=null),null==r&&(r=s),$===s)return h(this,"enum_for",["cycle",r],((n=function(){var t,i,$=null==n.$$s?this:n.$$s;return c(r["$nil?"]())?c($["$respond_to?"]("size"))?o(l(ht,"Float"),"INFINITY"):s:(r=l(ht,"Opal")["$coerce_to!"](r,l(ht,"Integer"),"to_int"),c(e(r,0))?(t=$.$enumerator_size(),i=r,"number"==typeof t&&"number"==typeof i?t*i:t["$*"](i)):0)}).$$s=this,n.$$arity=0,n));if(c(r["$nil?"]()));else if(r=l(ht,"Opal")["$coerce_to!"](r,l(ht,"Integer"),"to_int"),c(r<=0))return s;var a,u,f=[];if(this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);t.yield1($,e);f.push(e)},this.$each(),0===f.length)return s;if(r===s)for(;;)for(a=0,u=f.length;a<u;a++)t.yield1($,f[a]);else for(;r>1;){for(a=0,u=f.length;a<u;a++)t.yield1($,f[a]);r--}},E.$$arity=-1),t.def(ct,"$detect",x=function(e){try{var r,n=x.$$p,i=n||s;return n&&(x.$$p=null),n&&(x.$$p=null),i===s?this.$enum_for("detect",e):(h(this,"each",[],((r=function(e){null==r.$$s||r.$$s;var n,$=s;if(n=t.slice.call(arguments,0,arguments.length),$=l(ht,"Opal").$destructure(n),!c(t.yield1(i,$)))return s;t.ret($)}).$$s=this,r.$$arity=-1,r)),void 0!==e?"function"==typeof e?e():e:s)}catch(e){if(e===t.returner)return e.$v;throw e}},x.$$arity=-1),t.def(ct,"$drop",k=function(t){t=l(ht,"Opal").$coerce_to(t,l(ht,"Integer"),"to_int"),c(t<0)&&this.$raise(l(ht,"ArgumentError"),"attempt to drop negative size");var e=[],r=0;return this.$each.$$p=function(){t<=r&&e.push(l(ht,"Opal").$destructure(arguments)),r++},this.$each(),e},k.$$arity=1),t.def(ct,"$drop_while",A=function(){var e=A.$$p,r=e||s;if(e&&(A.$$p=null),e&&(A.$$p=null),r===s)return this.$enum_for("drop_while");var n=[],i=!0;return this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);if(i){var $=t.yield1(r,e);f($)&&(i=!1,n.push(e))}else n.push(e)},this.$each(),n},A.$$arity=0),t.def(ct,"$each_cons",M=function(e){var $,a=M.$$p,o=a||s,u=this;if(a&&(M.$$p=null),a&&(M.$$p=null),c(1!=arguments.length)&&u.$raise(l(ht,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)"),e=l(ht,"Opal").$try_convert(e,l(ht,"Integer"),"to_int"),c(e<=0)&&u.$raise(l(ht,"ArgumentError"),"invalid size"),o===s)return h(u,"enum_for",["each_cons",e],(($=function(){var t,a=null==$.$$s?this:$.$$s,o=s;return o=a.$enumerator_size(),c(o["$nil?"]())?s:c(c(t=o["$=="](0))?t:r(o,e))?0:n(i(o,e),1)}).$$s=u,$.$$arity=0,$));var f=[],d=s;return u.$each.$$p=function(){var r=l(ht,"Opal").$destructure(arguments);f.push(r),f.length>e&&f.shift(),f.length==e&&t.yield1(o,f.slice(0,e))},u.$each(),d},M.$$arity=1),t.def(ct,"$each_entry",I=function(e){var r,n,i=I.$$p,$=i||s,a=this;return i&&(I.$$p=null),i&&(I.$$p=null),r=t.slice.call(arguments,0,arguments.length),$===s?h(a,"to_enum",["each_entry"].concat(t.to_a(r)),((n=function(){return(null==n.$$s?this:n.$$s).$enumerator_size()}).$$s=a,n.$$arity=0,n)):(a.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);t.yield1($,e)},a.$each.apply(a,r),a)},I.$$arity=-1),t.def(ct,"$each_slice",S=function(e){var r,n=S.$$p,i=n||s;if(n&&(S.$$p=null),n&&(S.$$p=null),e=l(ht,"Opal").$coerce_to(e,l(ht,"Integer"),"to_int"),c(e<=0)&&this.$raise(l(ht,"ArgumentError"),"invalid slice size"),i===s)return h(this,"enum_for",["each_slice",e],((r=function(){var t,n,i=null==r.$$s?this:r.$$s;return c(i["$respond_to?"]("size"))?(t=i.$size(),n=e,"number"==typeof t&&"number"==typeof n?t/n:t["$/"](n)).$ceil():s}).$$s=this,r.$$arity=0,r));var $=[];return this.$each.$$p=function(){var r=l(ht,"Opal").$destructure(arguments);$.push(r),$.length===e&&(t.yield1(i,$),$=[])},this.$each(),$.length>0&&t.yield1(i,$),s},S.$$arity=1),t.def(ct,"$each_with_index",N=function(e){var r,n,i=N.$$p,$=i||s,a=this;if(i&&(N.$$p=null),i&&(N.$$p=null),r=t.slice.call(arguments,0,arguments.length),$===s)return h(a,"enum_for",["each_with_index"].concat(t.to_a(r)),((n=function(){return(null==n.$$s?this:n.$$s).$enumerator_size()}).$$s=a,n.$$arity=0,n));var o,u=0;return a.$each.$$p=function(){var t=l(ht,"Opal").$destructure(arguments);$(t,u),u++},a.$each.apply(a,r),void 0!==o?o:a},N.$$arity=-1),t.def(ct,"$each_with_object",j=function(t){var e,r=j.$$p,n=r||s;return r&&(j.$$p=null),r&&(j.$$p=null),n===s?h(this,"enum_for",["each_with_object",t],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e)):(this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);n(e,t)},this.$each(),t)},j.$$arity=1),t.def(ct,"$entries",R=function(e){var r,n=this;r=t.slice.call(arguments,0,arguments.length);var i=[];return n.$each.$$p=function(){i.push(l(ht,"Opal").$destructure(arguments))},n.$each.apply(n,r),i},R.$$arity=-1),t.alias(ct,"find","detect"),t.def(ct,"$find_all",T=function(){var e,r=T.$$p,n=r||s;if(r&&(T.$$p=null),r&&(T.$$p=null),n===s)return h(this,"enum_for",["find_all"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e));var i=[];return this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),r=t.yield1(n,e);c(r)&&i.push(e)},this.$each(),i},T.$$arity=0),t.def(ct,"$find_index",z=function(e){try{var r,n,i=z.$$p,$=i||s,a=s;return i&&(z.$$p=null),i&&(z.$$p=null),c(void 0===e&&$===s)?this.$enum_for("find_index"):(null!=e&&$!==s&&this.$warn("warning: given block not used"),a=0,c(null!=e)?h(this,"each",[],((r=function(n){var i;null==r.$$s||r.$$s;return i=t.slice.call(arguments,0,arguments.length),l(ht,"Opal").$destructure(i)["$=="](e)&&t.ret(a),a+=1}).$$s=this,r.$$arity=-1,r)):h(this,"each",[],((n=function(e){var r;null==n.$$s||n.$$s;return r=t.slice.call(arguments,0,arguments.length),c(t.yieldX($,t.to_a(r)))&&t.ret(a),a+=1}).$$s=this,n.$$arity=-1,n)),s)}catch(e){if(e===t.returner)return e.$v;throw e}},z.$$arity=-1),t.def(ct,"$first",q=function(e){try{var r,n,i=s,$=s;return c(void 0===e)?h(this,"each",[],((r=function(e){null==r.$$s||r.$$s;null==e&&(e=s),t.ret(e)}).$$s=this,r.$$arity=1,r)):(i=[],e=l(ht,"Opal").$coerce_to(e,l(ht,"Integer"),"to_int"),c(e<0)&&this.$raise(l(ht,"ArgumentError"),"attempt to take negative size"),c(0==e)?[]:($=0,h(this,"each",[],((n=function(r){var a;null==n.$$s||n.$$s;if(a=t.slice.call(arguments,0,arguments.length),i.push(l(ht,"Opal").$destructure(a)),!c(e<=++$))return s;t.ret(i)}).$$s=this,n.$$arity=-1,n)),i))}catch(e){if(e===t.returner)return e.$v;throw e}},q.$$arity=-1),t.alias(ct,"flat_map","collect_concat"),t.def(ct,"$grep",C=function(r){var n,i=C.$$p,a=i||s,o=s;return i&&(C.$$p=null),i&&(C.$$p=null),o=[],h(this,"each",[],((n=function(i){null==n.$$s||n.$$s;var l,u=s;return u=ft(l=t.slice.call(arguments,0,arguments.length)),c(h(r,"__send__",["==="].concat(t.to_a(u))))?(a!==s?(c(e(l.$length(),1))&&(l=[l]),l=t.yieldX(a,t.to_a(l))):c($(l.$length(),1))&&(l=l["$[]"](0)),o.$push(l)):s}).$$s=this,n.$$arity=-1,n)),o},C.$$arity=1),t.def(ct,"$grep_v",P=function(r){var n,i=P.$$p,a=i||s,o=s;return i&&(P.$$p=null),i&&(P.$$p=null),o=[],h(this,"each",[],((n=function(i){null==n.$$s||n.$$s;var l,u=s;return u=ft(l=t.slice.call(arguments,0,arguments.length)),c(h(r,"__send__",["==="].concat(t.to_a(u))))?s:(a!==s?(c(e(l.$length(),1))&&(l=[l]),l=t.yieldX(a,t.to_a(l))):c($(l.$length(),1))&&(l=l["$[]"](0)),o.$push(l))}).$$s=this,n.$$arity=-1,n)),o},P.$$arity=1),t.def(ct,"$group_by",F=function(){var e,r,n=F.$$p,$=n||s,a=s,o=s;return n&&(F.$$p=null),n&&(F.$$p=null),$===s?h(this,"enum_for",["group_by"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e)):(a=d([],{}),this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),n=t.yield1($,e);(c(r=a["$[]"](n))?r:(o=[n,[]],h(a,"[]=",t.to_a(o)),o[i(o.length,1)]))["$<<"](e)},this.$each(),a)},F.$$arity=0),t.def(ct,"$include?",D=function(e){try{var r;return h(this,"each",[],((r=function(n){var i;null==r.$$s||r.$$s;if(i=t.slice.call(arguments,0,arguments.length),!l(ht,"Opal").$destructure(i)["$=="](e))return s;t.ret(!0)}).$$s=this,r.$$arity=-1,r)),!1}catch(e){if(e===t.returner)return e.$v;throw e}},D.$$arity=1),t.def(ct,"$inject",L=function(e,r){var n=L.$$p,i=n||s;n&&(L.$$p=null),n&&(L.$$p=null);var $=e;return i!==s&&void 0===r?this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);void 0!==$?(e=t.yieldX(i,[$,e]),$=e):$=e}:(void 0===r&&(l(ht,"Symbol")["$==="](e)||this.$raise(l(ht,"TypeError"),e.$inspect()+" is not a Symbol"),r=e,$=void 0),this.$each.$$p=function(){var t=l(ht,"Opal").$destructure(arguments);$=void 0!==$?$.$__send__(r,t):t}),this.$each(),null==$?s:$},L.$$arity=-1),t.def(ct,"$lazy",B=function(){var e;return h(o(l(ht,"Enumerator"),"Lazy"),"new",[this,this.$enumerator_size()],((e=function(r,n){var i;null==e.$$s||e.$$s;return null==r&&(r=s),i=t.slice.call(arguments,1,arguments.length),h(r,"yield",t.to_a(i))}).$$s=this,e.$$arity=-2,e))},B.$$arity=0),t.def(ct,"$enumerator_size",U=function(){return c(this["$respond_to?"]("size"))?this.$size():s},U.$$arity=0),t.alias(ct,"map","collect"),t.def(ct,"$max",G=function(e){var r,n,i=G.$$p,$=i||s,a=this;return i&&(G.$$p=null),i&&(G.$$p=null),void 0===e||e===s?(a.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments);void 0!==r?((n=$!==s?t.yieldX($,[e,r]):e["$<=>"](r))===s&&a.$raise(l(ht,"ArgumentError"),"comparison failed"),n>0&&(r=e)):r=e},a.$each(),void 0===r?s:r):(e=l(ht,"Opal").$coerce_to(e,l(ht,"Integer"),"to_int"),h(a,"sort",[],$.$to_proc()).$reverse().$first(e))},G.$$arity=-1),t.def(ct,"$max_by",H=function(){var e,r,n,i=H.$$p,$=i||s;return i&&(H.$$p=null),i&&(H.$$p=null),c($)?(this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),i=t.yield1($,e);if(void 0===r)return r=e,void(n=i);i["$<=>"](n)>0&&(r=e,n=i)},this.$each(),void 0===r?s:r):h(this,"enum_for",["max_by"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e))},H.$$arity=0),t.alias(ct,"member?","include?"),t.def(ct,"$min",X=function(){var t,e=X.$$p,r=e||s,n=this;return e&&(X.$$p=null),e&&(X.$$p=null),n.$each.$$p=r!==s?function(){var e=l(ht,"Opal").$destructure(arguments);if(void 0!==t){var i=r(e,t);i===s&&n.$raise(l(ht,"ArgumentError"),"comparison failed"),i<0&&(t=e)}else t=e}:function(){var e=l(ht,"Opal").$destructure(arguments);void 0!==t?l(ht,"Opal").$compare(e,t)<0&&(t=e):t=e},n.$each(),void 0===t?s:t},X.$$arity=0),t.def(ct,"$min_by",Y=function(){var e,r,n,i=Y.$$p,$=i||s;return i&&(Y.$$p=null),i&&(Y.$$p=null),c($)?(this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),i=t.yield1($,e);if(void 0===r)return r=e,void(n=i);i["$<=>"](n)<0&&(r=e,n=i)},this.$each(),void 0===r?s:r):h(this,"enum_for",["min_by"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e))},Y.$$arity=0),t.def(ct,"$minmax",K=function(){var t,e,r=K.$$p,n=r||s,i=this;r&&(K.$$p=null),r&&(K.$$p=null),n=c(t=n)?t:h(i,"proc",[],((e=function(t,r){null==e.$$s||e.$$s;return null==t&&(t=s),null==r&&(r=s),t["$<=>"](r)}).$$s=i,e.$$arity=2,e));var $=s,a=s,o=!0;return i.$each.$$p=function(){var t=l(ht,"Opal").$destructure(arguments);if(o)$=a=t,o=!1;else{var e=n.$call($,t);e===s?i.$raise(l(ht,"ArgumentError"),"comparison failed"):e>0&&($=t);var r=n.$call(a,t);r===s?i.$raise(l(ht,"ArgumentError"),"comparison failed"):r<0&&(a=t)}},i.$each(),[$,a]},K.$$arity=0),t.def(ct,"$minmax_by",V=function(){var t=V.$$p;return t&&(V.$$p=null),t&&(V.$$p=null),this.$raise(l(ht,"NotImplementedError"))},V.$$arity=0),t.def(ct,"$none?",Z=function(e){try{var r,n,i,$=Z.$$p,a=$||s;return $&&(Z.$$p=null),$&&(Z.$$p=null),c(void 0!==e)?h(this,"each",[],((r=function(n){null==r.$$s||r.$$s;var i=s;if(i=ft(t.slice.call(arguments,0,arguments.length)),!c(h(e,"public_send",["==="].concat(t.to_a(i)))))return s;t.ret(!1)}).$$s=this,r.$$arity=-1,r)):h(this,"each",[],a!==s?((n=function(e){var r;null==n.$$s||n.$$s;if(r=t.slice.call(arguments,0,arguments.length),!c(t.yieldX(a,t.to_a(r))))return s;t.ret(!1)}).$$s=this,n.$$arity=-1,n):((i=function(e){null==i.$$s||i.$$s;var r,n=s;if(r=t.slice.call(arguments,0,arguments.length),n=l(ht,"Opal").$destructure(r),!c(n))return s;t.ret(!1)}).$$s=this,i.$$arity=-1,i)),!0}catch(e){if(e===t.returner)return e.$v;throw e}},Z.$$arity=-1),t.def(ct,"$one?",J=function(r){try{var i,$,a,o=J.$$p,u=o||s,f=s;return o&&(J.$$p=null),o&&(J.$$p=null),f=0,c(void 0!==r)?h(this,"each",[],((i=function($){null==i.$$s||i.$$s;var a=s;return a=ft(t.slice.call(arguments,0,arguments.length)),c(h(r,"public_send",["==="].concat(t.to_a(a))))?(f=n(f,1),c(e(f,1))?void t.ret(!1):s):s}).$$s=this,i.$$arity=-1,i)):h(this,"each",[],u!==s?(($=function(r){var i;null==$.$$s||$.$$s;return i=t.slice.call(arguments,0,arguments.length),c(t.yieldX(u,t.to_a(i)))?(f=n(f,1),c(e(f,1))?void t.ret(!1):s):s}).$$s=this,$.$$arity=-1,$):((a=function(r){var i;null==a.$$s||a.$$s;return i=t.slice.call(arguments,0,arguments.length),c(l(ht,"Opal").$destructure(i))?(f=n(f,1),c(e(f,1))?void t.ret(!1):s):s}).$$s=this,a.$$arity=-1,a)),f["$=="](1)}catch(e){if(e===t.returner)return e.$v;throw e}},J.$$arity=-1),t.def(ct,"$partition",Q=function(){var e,r=Q.$$p,n=r||s;if(r&&(Q.$$p=null),r&&(Q.$$p=null),n===s)return h(this,"enum_for",["partition"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e));var i=[],$=[];return this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),r=t.yield1(n,e);c(r)?i.push(e):$.push(e)},this.$each(),[i,$]},Q.$$arity=0),t.alias(ct,"reduce","inject"),t.def(ct,"$reject",W=function(){var e,r=W.$$p,n=r||s;if(r&&(W.$$p=null),r&&(W.$$p=null),n===s)return h(this,"enum_for",["reject"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e));var i=[];return this.$each.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),r=t.yield1(n,e);f(r)&&i.push(e)},this.$each(),i},W.$$arity=0),t.def(ct,"$reverse_each",tt=function(){var e,r=tt.$$p,n=r||s;if(r&&(tt.$$p=null),r&&(tt.$$p=null),n===s)return h(this,"enum_for",["reverse_each"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e));var i=[];this.$each.$$p=function(){i.push(arguments)},this.$each();for(var $=i.length-1;$>=0;$--)t.yieldX(n,i[$]);return i},tt.$$arity=0),t.alias(ct,"select","find_all"),t.def(ct,"$slice_before",et=function(e){var r,n=et.$$p,i=n||s,$=this;return n&&(et.$$p=null),n&&(et.$$p=null),c(void 0===e&&i===s)&&$.$raise(l(ht,"ArgumentError"),"both pattern and block are given"),c(void 0!==e&&i!==s||arguments.length>1)&&$.$raise(l(ht,"ArgumentError"),"wrong number of arguments ("+arguments.length+" expected 1)"),h(l(ht,"Enumerator"),"new",[],((r=function(n){var $=null==r.$$s?this:r.$$s;null==n&&(n=s);var a=[];$.$each.$$p=i!==s?void 0===e?function(){var e=l(ht,"Opal").$destructure(arguments),r=t.yield1(i,e);c(r)&&a.length>0&&(n["$<<"](a),a=[]),a.push(e)}:function(){var t=l(ht,"Opal").$destructure(arguments),r=i(t,e.$dup());c(r)&&a.length>0&&(n["$<<"](a),a=[]),a.push(t)}:function(){var t=l(ht,"Opal").$destructure(arguments),r=e["$==="](t);c(r)&&a.length>0&&(n["$<<"](a),a=[]),a.push(t)},$.$each(),a.length>0&&n["$<<"](a)}).$$s=$,r.$$arity=1,r))},et.$$arity=-1),t.def(ct,"$slice_after",rt=function(e){var r,n,i=rt.$$p,$=i||s,a=this;return i&&(rt.$$p=null),i&&(rt.$$p=null),c(void 0===e&&$===s)&&a.$raise(l(ht,"ArgumentError"),"both pattern and block are given"),c(void 0!==e&&$!==s||arguments.length>1)&&a.$raise(l(ht,"ArgumentError"),"wrong number of arguments ("+arguments.length+" expected 1)"),c(void 0!==e)&&($=h(a,"proc",[],((r=function(t){null==r.$$s||r.$$s;return null==t&&(t=s),e["$==="](t)}).$$s=a,r.$$arity=1,r))),h(l(ht,"Enumerator"),"new",[],((n=function(e){var r,i=null==n.$$s?this:n.$$s;null==e&&(e=s),i.$each.$$p=function(){var n=l(ht,"Opal").$destructure(arguments),i=t.yield1($,n);null==r&&(r=[]),c(i)?(r.push(n),e.$yield(r),r=null):r.push(n)},i.$each(),null!=r&&e.$yield(r)}).$$s=a,n.$$arity=1,n))},rt.$$arity=-1),t.def(ct,"$slice_when",nt=function(){var e,r=nt.$$p,n=r||s;return r&&(nt.$$p=null),r&&(nt.$$p=null),n!==s||this.$raise(l(ht,"ArgumentError"),"wrong number of arguments (0 for 1)"),h(l(ht,"Enumerator"),"new",[],((e=function(r){var i=null==e.$$s?this:e.$$s;null==r&&(r=s);var $=s,a=s;i.$each_cons.$$p=function(){var e=l(ht,"Opal").$destructure(arguments),i=e[0],o=e[1],u=t.yieldX(n,[i,o]);a=o,$===s&&($=[]),c(u)?($.push(i),r.$yield($),$=[]):$.push(i)},i.$each_cons(2),$!==s&&($.push(a),r.$yield($))}).$$s=this,e.$$arity=1,e))},nt.$$arity=0),t.def(ct,"$sort",it=function(){var t,e,r=it.$$p,n=r||s;return r&&(it.$$p=null),r&&(it.$$p=null),e=this.$to_a(),n!==s||(n=p(((t=function(e,r){null==t.$$s||t.$$s;return null==e&&(e=s),null==r&&(r=s),e["$<=>"](r)}).$$s=this,t.$$arity=2,t))),h(e,"sort",[],n.$to_proc())},it.$$arity=0),t.def(ct,"$sort_by",$t=function(){var e,r,n,i,$,a=$t.$$p,o=a||s;return a&&($t.$$p=null),a&&($t.$$p=null),o===s?h(this,"enum_for",["sort_by"],((e=function(){return(null==e.$$s?this:e.$$s).$enumerator_size()}).$$s=this,e.$$arity=0,e)):($=h(this,"map",[],((r=function(){null==r.$$s||r.$$s;var e=s;return e=l(ht,"Opal").$destructure(arguments),[t.yield1(o,e),e]}).$$s=this,r.$$arity=0,r)),h($,"sort!",[],((n=function(t,e){null==n.$$s||n.$$s;return null==t&&(t=s),null==e&&(e=s),t[0]["$<=>"](e[0])}).$$s=this,n.$$arity=2,n)),h($,"map!",[],((i=function(t){null==i.$$s||i.$$s;return null==t&&(t=s),t[1]}).$$s=this,i.$$arity=1,i)))},$t.$$arity=0),t.def(ct,"$sum",at=function(e){var r,i=at.$$p,$=i||s,a=s;return i&&(at.$$p=null),null==e&&(e=0),a=e,h(this,"each",[],((r=function(e){null==r.$$s||r.$$s;var i,o,u=s;return i=t.slice.call(arguments,0,arguments.length),o=i,u=$!==s?t.yieldX($,t.to_a(o)):l(ht,"Opal").$destructure(o),a=n(a,u)}).$$s=this,r.$$arity=-1,r)),a},at.$$arity=-1),t.def(ct,"$take",st=function(t){return this.$first(t)},st.$$arity=1),t.def(ct,"$take_while",ot=function(){try{var e,r=ot.$$p,n=r||s,i=s;return r&&(ot.$$p=null),r&&(ot.$$p=null),c(n)?(i=[],h(this,"each",[],((e=function(r){null==e.$$s||e.$$s;var $,a=s;return $=t.slice.call(arguments,0,arguments.length),a=l(ht,"Opal").$destructure($),c(t.yield1(n,a))||t.ret(i),i.push(a)}).$$s=this,e.$$arity=-1,e))):this.$enum_for("take_while")}catch(e){if(e===t.returner)return e.$v;throw e}},ot.$$arity=0),t.def(ct,"$uniq",lt=function(){var e,r=lt.$$p,n=r||s,$=s;return r&&(lt.$$p=null),r&&(lt.$$p=null),$=d([],{}),h(this,"each",[],((e=function(r){null==e.$$s||e.$$s;var a,o=s,u=s,f=s;return a=t.slice.call(arguments,0,arguments.length),o=l(ht,"Opal").$destructure(a),u=n!==s?t.yield1(n,o):o,c($["$key?"](u))?s:(f=[u,o],h($,"[]=",t.to_a(f)),f[i(f.length,1)])}).$$s=this,e.$$arity=-1,e)),$.$values()},lt.$$arity=0),t.alias(ct,"to_a","entries"),t.def(ct,"$zip",ut=function(e){var r,n=ut.$$p,i=this;return n&&(ut.$$p=null),n&&(ut.$$p=null),r=t.slice.call(arguments,0,arguments.length),h(i.$to_a(),"zip",t.to_a(r))},ut.$$arity=-1)}(a[0],a)}};void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_();var y=function(){global.Opal.modules["corelib/enumerator"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}var n=t.top,i=[],$=t.nil,a=(t.const_get_qualified,t.const_get_relative),s=t.breaker,o=t.slice,l=t.klass,u=t.truthy,c=t.send,h=t.falsy;return t.add_stubs(["$require","$include","$allocate","$new","$to_proc","$coerce_to","$nil?","$empty?","$+","$class","$__send__","$===","$call","$enum_for","$size","$destructure","$inspect","$any?","$[]","$raise","$yield","$each","$enumerator_size","$respond_to?","$try_convert","$<","$for"]),n.$require("corelib/enumerable"),function(n,i,f){var d,p,_,y,g,m,v=l(n,null,"Enumerator"),b=[v].concat(f);return v.$$prototype.size=v.$$prototype.args=v.$$prototype.object=v.$$prototype.method=$,v.$include(a(b,"Enumerable")),v.$$prototype.$$is_enumerator=!0,t.defs(v,"$for",d=function(e,r,n){var i,a,s,o=d.$$p,l=o||$,u=this;o&&(d.$$p=null),o&&(d.$$p=null),(i=t.slice.call(arguments,1,arguments.length)).length>0&&(a=i[0],i.splice(0,1)),null==a&&(a="each"),s=i;var c=u.$allocate();return c.object=e,c.size=l,c.method=a,c.args=s,c},d.$$arity=-2),t.def(v,"$initialize",p=function(e){var r=p.$$p,n=r||$,i=this;return r&&(p.$$p=null),r&&(p.$$p=null),t.slice.call(arguments,0,arguments.length),u(n)?(i.object=c(a(b,"Generator"),"new",[],n.$to_proc()),i.method="each",i.args=[],i.size=arguments[0]||$,u(i.size)?i.size=a(b,"Opal").$coerce_to(i.size,a(b,"Integer"),"to_int"):$):(i.object=arguments[0],i.method=arguments[1]||"each",i.args=o.call(arguments,2),i.size=$)},p.$$arity=-1),t.def(v,"$each",_=function(r){var n,i,a=_.$$p,s=a||$,o=this;return a&&(_.$$p=null),a&&(_.$$p=null),n=t.slice.call(arguments,0,arguments.length),u(u(i=s["$nil?"]())?n["$empty?"]():i)?o:(n=e(o.args,n),u(s["$nil?"]())?c(o.$class(),"new",[o.object,o.method].concat(t.to_a(n))):c(o.object,"__send__",[o.method].concat(t.to_a(n)),s.$to_proc()))},_.$$arity=-1),t.def(v,"$size",y=function(){return u(a(b,"Proc")["$==="](this.size))?c(this.size,"call",t.to_a(this.args)):this.size},y.$$arity=0),t.def(v,"$with_index",g=function(t){var e,r=g.$$p,n=r||$;if(r&&(g.$$p=null),r&&(g.$$p=null),null==t&&(t=0),t=u(t)?a(b,"Opal").$coerce_to(t,a(b,"Integer"),"to_int"):0,!u(n))return c(this,"enum_for",["with_index",t],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));var i=t;return this.$each.$$p=function(){var t=a(b,"Opal").$destructure(arguments),e=n(t,i);return i++,e},this.$each()},g.$$arity=-1),t.alias(v,"with_object","each_with_object"),t.def(v,"$inspect",m=function(){var t=$;return t="#<"+this.$class()+": "+this.object.$inspect()+":"+this.method,u(this.args["$any?"]())&&(t=e(t,"("+this.args.$inspect()["$[]"](a(b,"Range").$new(1,-2))+")")),e(t,">")},m.$$arity=0),function(e,r,n){var i,o,h=l(e,null,"Generator"),f=[h].concat(n);h.$$prototype.block=$,h.$include(a(f,"Enumerable")),t.def(h,"$initialize",i=function(){var t=i.$$p,e=t||$;return t&&(i.$$p=null),t&&(i.$$p=null),u(e)||this.$raise(a(f,"LocalJumpError"),"no block given"),this.block=e},i.$$arity=0),t.def(h,"$each",o=function(e){var r,n=o.$$p,i=n||$,l=this,u=$;n&&(o.$$p=null),n&&(o.$$p=null),r=t.slice.call(arguments,0,arguments.length),u=c(a(f,"Yielder"),"new",[],i.$to_proc());try{r.unshift(u),t.yieldX(l.block,r)}catch(t){if(t===s)return s.$v;throw t}return l},o.$$arity=-1)}(b[0],0,b),function(e,r,n){var i,a,o,u=l(e,null,"Yielder");[u].concat(n);u.$$prototype.block=$,t.def(u,"$initialize",i=function(){var t=i.$$p,e=t||$;return t&&(i.$$p=null),t&&(i.$$p=null),this.block=e},i.$$arity=0),t.def(u,"$yield",a=function(e){var r,n=this;r=t.slice.call(arguments,0,arguments.length);var i=t.yieldX(n.block,r);if(i===s)throw s;return i},a.$$arity=-1),t.def(u,"$<<",o=function(e){var r,n=this;return r=t.slice.call(arguments,0,arguments.length),c(n,"yield",t.to_a(r)),n},o.$$arity=-1)}(b[0],0,b),function(n,i,s){var o,f,d,p,_,y,g,m,v,b,O,w,E,x=l(n,i,"Lazy"),k=[x].concat(s);return x.$$prototype.enumerator=$,function(t,e,r){[l(t,e,"StopLazyError")].concat(r)}(k[0],a(k,"Exception"),k),t.def(x,"$initialize",o=function(e,r){var n,i=o.$$p,s=i||$;return i&&(o.$$p=null),i&&(o.$$p=null),null==r&&(r=$),s!==$||this.$raise(a(k,"ArgumentError"),"tried to call lazy new without a block"),this.enumerator=e,c(this,t.find_super_dispatcher(this,"initialize",o,!1),[r],((n=function(r,i){var o,l,u=null==n.$$s?this:n.$$s;null==r&&(r=$),o=t.slice.call(arguments,1,arguments.length);try{return c(e,"each",t.to_a(o),((l=function(e){var n;null==l.$$s||l.$$s;(n=t.slice.call(arguments,0,arguments.length)).unshift(r),t.yieldX(s,n)}).$$s=u,l.$$arity=-1,l))}catch(e){if(!t.rescue(e,[a(k,"Exception")]))throw e;try{return $}finally{t.pop_exception()}}}).$$s=this,n.$$arity=-2,n))},o.$$arity=-2),t.alias(x,"force","to_a"),t.def(x,"$lazy",f=function(){return this},f.$$arity=0),t.def(x,"$collect",d=function(){var e,r=d.$$p,n=r||$;return r&&(d.$$p=null),r&&(d.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy map without a block"),c(a(k,"Lazy"),"new",[this,this.$enumerator_size()],((e=function(r,i){var a;null==e.$$s||e.$$s;null==r&&(r=$),a=t.slice.call(arguments,1,arguments.length);var s=t.yieldX(n,a);r.$yield(s)}).$$s=this,e.$$arity=-2,e))},d.$$arity=0),t.def(x,"$collect_concat",p=function(){var e,r=p.$$p,n=r||$;return r&&(p.$$p=null),r&&(p.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy map without a block"),c(a(k,"Lazy"),"new",[this,$],((e=function(r,i){var s,o,l,u=null==e.$$s?this:e.$$s;null==r&&(r=$),s=t.slice.call(arguments,1,arguments.length);var h=t.yieldX(n,s);if(h["$respond_to?"]("force")&&h["$respond_to?"]("each"))c(h,"each",[],((o=function(t){null==o.$$s||o.$$s;return null==t&&(t=$),r.$yield(t)}).$$s=u,o.$$arity=1,o));else{var f=a(k,"Opal").$try_convert(h,a(k,"Array"),"to_ary");f===$?r.$yield(h):c(h,"each",[],((l=function(t){null==l.$$s||l.$$s;return null==t&&(t=$),r.$yield(t)}).$$s=u,l.$$arity=1,l))}}).$$s=this,e.$$arity=-2,e))},p.$$arity=0),t.def(x,"$drop",_=function(n){var i,s,o,l=$;return n=a(k,"Opal").$coerce_to(n,a(k,"Integer"),"to_int"),u(r(n,0))&&this.$raise(a(k,"ArgumentError"),"attempt to drop negative size"),s=this.$enumerator_size(),o=u(a(k,"Integer")["$==="](s))&&u(r(n,s))?n:s,l=0,c(a(k,"Lazy"),"new",[this,o],((i=function(a,s){var o;null==i.$$s||i.$$s;return null==a&&(a=$),o=t.slice.call(arguments,1,arguments.length),u(r(l,n))?l=e(l,1):c(a,"yield",t.to_a(o))}).$$s=this,i.$$arity=-2,i))},_.$$arity=1),t.def(x,"$drop_while",y=function(){var e,r=y.$$p,n=r||$,i=$;return r&&(y.$$p=null),r&&(y.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy drop_while without a block"),i=!0,c(a(k,"Lazy"),"new",[this,$],((e=function(r,a){var s;null==e.$$s||e.$$s;if(null==r&&(r=$),s=t.slice.call(arguments,1,arguments.length),!u(i))return c(r,"yield",t.to_a(s));var o=t.yieldX(n,s);h(o)&&(i=!1,c(r,"yield",t.to_a(s)))}).$$s=this,e.$$arity=-2,e))},y.$$arity=0),t.def(x,"$enum_for",g=function(e,r){var n,i,a,s=g.$$p,o=s||$,l=this;return s&&(g.$$p=null),s&&(g.$$p=null),(n=t.slice.call(arguments,0,arguments.length)).length>0&&(i=n[0],n.splice(0,1)),null==i&&(i="each"),a=n,c(l.$class(),"for",[l,i].concat(t.to_a(a)),o.$to_proc())},g.$$arity=-1),t.def(x,"$find_all",m=function(){var e,r=m.$$p,n=r||$;return r&&(m.$$p=null),r&&(m.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy select without a block"),c(a(k,"Lazy"),"new",[this,$],((e=function(r,i){var a;null==e.$$s||e.$$s;null==r&&(r=$),a=t.slice.call(arguments,1,arguments.length);var s=t.yieldX(n,a);u(s)&&c(r,"yield",t.to_a(a))}).$$s=this,e.$$arity=-2,e))},m.$$arity=0),t.alias(x,"flat_map","collect_concat"),t.def(x,"$grep",v=function(e){var r,n,i=v.$$p,s=i||$;return i&&(v.$$p=null),i&&(v.$$p=null),u(s)?c(a(k,"Lazy"),"new",[this,$],((r=function(n,i){var o;null==r.$$s||r.$$s;null==n&&(n=$),o=t.slice.call(arguments,1,arguments.length);var l=a(k,"Opal").$destructure(o),c=e["$==="](l);u(c)&&(c=t.yield1(s,l),n.$yield(t.yield1(s,l)))}).$$s=this,r.$$arity=-2,r)):c(a(k,"Lazy"),"new",[this,$],((n=function(r,i){var s;null==n.$$s||n.$$s;null==r&&(r=$),s=t.slice.call(arguments,1,arguments.length);var o=a(k,"Opal").$destructure(s),l=e["$==="](o);u(l)&&r.$yield(o)}).$$s=this,n.$$arity=-2,n))},v.$$arity=1),t.alias(x,"map","collect"),t.alias(x,"select","find_all"),t.def(x,"$reject",b=function(){var e,r=b.$$p,n=r||$;return r&&(b.$$p=null),r&&(b.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy reject without a block"),c(a(k,"Lazy"),"new",[this,$],((e=function(r,i){var a;null==e.$$s||e.$$s;null==r&&(r=$),a=t.slice.call(arguments,1,arguments.length);var s=t.yieldX(n,a);h(s)&&c(r,"yield",t.to_a(a))}).$$s=this,e.$$arity=-2,e))},b.$$arity=0),t.def(x,"$take",O=function(n){var i,s,o,l=$;return n=a(k,"Opal").$coerce_to(n,a(k,"Integer"),"to_int"),u(r(n,0))&&this.$raise(a(k,"ArgumentError"),"attempt to take negative size"),s=this.$enumerator_size(),o=u(a(k,"Integer")["$==="](s))&&u(r(n,s))?n:s,l=0,c(a(k,"Lazy"),"new",[this,o],((i=function(s,o){var h,f=null==i.$$s?this:i.$$s;return null==s&&(s=$),h=t.slice.call(arguments,1,arguments.length),u(r(l,n))?(c(s,"yield",t.to_a(h)),l=e(l,1)):f.$raise(a(k,"StopLazyError"))}).$$s=this,i.$$arity=-2,i))},O.$$arity=1),t.def(x,"$take_while",w=function(){var e,r=w.$$p,n=r||$;return r&&(w.$$p=null),r&&(w.$$p=null),u(n)||this.$raise(a(k,"ArgumentError"),"tried to call lazy take_while without a block"),c(a(k,"Lazy"),"new",[this,$],((e=function(r,i){var s,o=null==e.$$s?this:e.$$s;null==r&&(r=$),s=t.slice.call(arguments,1,arguments.length);var l=t.yieldX(n,s);u(l)?c(r,"yield",t.to_a(s)):o.$raise(a(k,"StopLazyError"))}).$$s=this,e.$$arity=-2,e))},w.$$arity=0),t.alias(x,"to_enum","enum_for"),t.def(x,"$inspect",E=function(){return"#<"+this.$class()+": "+this.enumerator.$inspect()+">"},E.$$arity=0),$&&"inspect"}(b[0],v,b)}(i[0],0,i)}};void 0===global.Opal.modules["corelib/comparable"]&&"function"==typeof f.a&&Object(f.a)();var g=function(){global.Opal.modules["corelib/numeric"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t*e:t["$*"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}var $=t.top,a=[],s=t.nil,o=t.const_get_qualified,l=t.const_get_relative,u=(t.breaker,t.slice,t.klass),c=t.truthy,h=t.hash2;return t.add_stubs(["$require","$include","$instance_of?","$class","$Float","$respond_to?","$coerce","$__send__","$===","$raise","$equal?","$-","$*","$div","$<","$-@","$ceil","$to_f","$denominator","$to_r","$==","$floor","$/","$%","$Complex","$zero?","$numerator","$abs","$arg","$coerce_to!","$round","$to_i","$truncate","$>"]),$.$require("corelib/comparable"),function($,a,f){var d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J=u($,null,"Numeric"),Q=[J].concat(f);return J.$include(l(Q,"Comparable")),t.def(J,"$coerce",d=function(t){return c(t["$instance_of?"](this.$class()))?[t,this]:[this.$Float(t),this.$Float(this)]},d.$$arity=1),t.def(J,"$__coerced__",p=function(e,r){var n,i,$=this,a=s,o=s,u=s;return c(r["$respond_to?"]("coerce"))?(i=r.$coerce($),a=null==(n=t.to_ary(i))[0]?s:n[0],o=null==n[1]?s:n[1],a.$__send__(e,o)):"+"["$==="](u=e)||"-"["$==="](u)||"*"["$==="](u)||"/"["$==="](u)||"%"["$==="](u)||"&"["$==="](u)||"|"["$==="](u)||"^"["$==="](u)||"**"["$==="](u)?$.$raise(l(Q,"TypeError"),r.$class()+" can't be coerced into Numeric"):">"["$==="](u)||">="["$==="](u)||"<"["$==="](u)||"<="["$==="](u)||"<=>"["$==="](u)?$.$raise(l(Q,"ArgumentError"),"comparison of "+$.$class()+" with "+r.$class()+" failed"):s},p.$$arity=2),t.def(J,"$<=>",_=function(t){return c(this["$equal?"](t))?0:s},_.$$arity=1),t.def(J,"$+@",y=function(){return this},y.$$arity=0),t.def(J,"$-@",g=function(){return e(0,this)},g.$$arity=0),t.def(J,"$%",m=function(t){return e(this,r(t,this.$div(t)))},m.$$arity=1),t.def(J,"$abs",v=function(){return n(this,0)?this["$-@"]():this},v.$$arity=0),t.def(J,"$abs2",b=function(){return r(this,this)},b.$$arity=0),t.def(J,"$angle",O=function(){return n(this,0)?o(l(Q,"Math"),"PI"):0},O.$$arity=0),t.alias(J,"arg","angle"),t.def(J,"$ceil",w=function(t){return null==t&&(t=0),this.$to_f().$ceil(t)},w.$$arity=-1),t.def(J,"$conj",E=function(){return this},E.$$arity=0),t.alias(J,"conjugate","conj"),t.def(J,"$denominator",x=function(){return this.$to_r().$denominator()},x.$$arity=0),t.def(J,"$div",k=function(t){return t["$=="](0)&&this.$raise(l(Q,"ZeroDivisionError"),"divided by o"),i(this,t).$floor()},k.$$arity=1),t.def(J,"$divmod",A=function(t){return[this.$div(t),this["$%"](t)]},A.$$arity=1),t.def(J,"$fdiv",M=function(t){return i(this.$to_f(),t)},M.$$arity=1),t.def(J,"$floor",I=function(t){return null==t&&(t=0),this.$to_f().$floor(t)},I.$$arity=-1),t.def(J,"$i",S=function(){return this.$Complex(0,this)},S.$$arity=0),t.def(J,"$imag",N=function(){return 0},N.$$arity=0),t.alias(J,"imaginary","imag"),t.def(J,"$integer?",j=function(){return!1},j.$$arity=0),t.alias(J,"magnitude","abs"),t.alias(J,"modulo","%"),t.def(J,"$nonzero?",R=function(){return c(this["$zero?"]())?s:this},R.$$arity=0),t.def(J,"$numerator",T=function(){return this.$to_r().$numerator()},T.$$arity=0),t.alias(J,"phase","arg"),t.def(J,"$polar",z=function(){return[this.$abs(),this.$arg()]},z.$$arity=0),t.def(J,"$quo",q=function(t){return i(l(Q,"Opal")["$coerce_to!"](this,l(Q,"Rational"),"to_r"),t)},q.$$arity=1),t.def(J,"$real",C=function(){return this},C.$$arity=0),t.def(J,"$real?",P=function(){return!0},P.$$arity=0),t.def(J,"$rect",F=function(){return[this,0]},F.$$arity=0),t.alias(J,"rectangular","rect"),t.def(J,"$round",D=function(t){return this.$to_f().$round(t)},D.$$arity=-1),t.def(J,"$to_c",L=function(){return this.$Complex(this,0)},L.$$arity=0),t.def(J,"$to_int",B=function(){return this.$to_i()},B.$$arity=0),t.def(J,"$truncate",U=function(t){return null==t&&(t=0),this.$to_f().$truncate(t)},U.$$arity=-1),t.def(J,"$zero?",G=function(){return this["$=="](0)},G.$$arity=0),t.def(J,"$positive?",H=function(){var t,e;return e=0,"number"==typeof(t=this)&&"number"==typeof e?t>e:t["$>"](e)},H.$$arity=0),t.def(J,"$negative?",X=function(){return n(this,0)},X.$$arity=0),t.def(J,"$dup",Y=function(){return this},Y.$$arity=0),t.def(J,"$clone",K=function(e){if(null==e)e=h([],{});else if(!e.$$is_hash)throw t.ArgumentError.$new("expected kwargs");return null==e.$$smap.freeze&&!0,this},K.$$arity=-1),t.def(J,"$finite?",V=function(){return!0},V.$$arity=0),t.def(J,"$infinite?",Z=function(){return s},Z.$$arity=0),s&&"infinite?"}(a[0],0,a)}};void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_(),void 0===global.Opal.modules["corelib/numeric"]&&"function"==typeof g&&g();var m=function(){global.Opal.modules["corelib/array"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}var r=t.top,n=[],i=t.nil,$=t.const_get_qualified,a=t.const_get_relative,s=(t.breaker,t.slice,t.klass),o=t.truthy,l=t.hash2,u=t.send,c=t.gvars;return t.add_stubs(["$require","$include","$to_a","$warn","$raise","$replace","$respond_to?","$to_ary","$coerce_to","$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","$begin","$end","$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"]),r.$require("corelib/enumerable"),r.$require("corelib/numeric"),function(r,n,h){var f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct,ht,ft,dt,pt,_t,yt,gt,mt,vt,bt,Ot,wt,Et,xt,kt,At,Mt,It,St,Nt,jt,Rt,Tt,zt,qt,Ct,Pt,Ft,Dt,Lt,Bt,Ut,Gt,Ht,Xt,Yt,Kt,Vt,Zt,Jt,Qt=s(r,n,"Array"),Wt=[Qt].concat(h);function te(e,r){return r.$$name===t.Array?e:r.$allocate().$replace(e.$to_a())}function ee(t,e){return t===e||0===e?1:e>0&&t>e?ee(t-1,e-1)+ee(t-1,e):0}return Qt.$include(a(Wt,"Enumerable")),t.defineProperty(Qt.$$prototype,"$$is_array",!0),t.defs(Qt,"$[]",f=function(e){var r=this;return te(t.slice.call(arguments,0,arguments.length),r)},f.$$arity=-1),t.def(Qt,"$initialize",d=function(t,e){var r,n,s=d.$$p,o=s||i,l=this;if(s&&(d.$$p=null),s&&(d.$$p=null),null==t&&(t=i),null==e&&(e=i),e!==i&&o!==i&&l.$warn("warning: block supersedes default value argument"),t>$(a(Wt,"Integer"),"MAX")&&l.$raise(a(Wt,"ArgumentError"),"array size too big"),arguments.length>2&&l.$raise(a(Wt,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..2)"),0===arguments.length)return l.splice(0,l.length),l;if(1===arguments.length){if(t.$$is_array)return l.$replace(t.$to_a()),l;if(t["$respond_to?"]("to_ary"))return l.$replace(t.$to_ary()),l}if((t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&l.$raise(a(Wt,"ArgumentError"),"negative array size"),l.splice(0,l.length),o===i)for(r=0;r<t;r++)l.push(e);else for(r=0;r<t;r++)n=o(r),l[r]=n;return l},d.$$arity=-1),t.defs(Qt,"$try_convert",p=function(t){return a(Wt,"Opal")["$coerce_to?"](t,a(Wt,"Array"),"to_ary")},p.$$arity=1),t.def(Qt,"$&",_=function(e){e=o(a(Wt,"Array")["$==="](e))?e.$to_a():a(Wt,"Opal").$coerce_to(e,a(Wt,"Array"),"to_ary").$to_a();var r,n,i,$=[],s=l([],{});for(r=0,n=e.length;r<n;r++)t.hash_put(s,e[r],!0);for(r=0,n=this.length;r<n;r++)i=this[r],void 0!==t.hash_delete(s,i)&&$.push(i);return $},_.$$arity=1),t.def(Qt,"$|",y=function(e){e=o(a(Wt,"Array")["$==="](e))?e.$to_a():a(Wt,"Opal").$coerce_to(e,a(Wt,"Array"),"to_ary").$to_a();var r,n,i=l([],{});for(r=0,n=this.length;r<n;r++)t.hash_put(i,this[r],!0);for(r=0,n=e.length;r<n;r++)t.hash_put(i,e[r],!0);return i.$keys()},y.$$arity=1),t.def(Qt,"$*",g=function(t){if(o(t["$respond_to?"]("to_str")))return this.$join(t.$to_str());t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),o(t<0)&&this.$raise(a(Wt,"ArgumentError"),"negative argument");for(var e=[],r=this.$to_a(),n=0;n<t;n++)e=e.concat(r);return te(e,this.$class())},g.$$arity=1),t.def(Qt,"$+",m=function(t){return t=o(a(Wt,"Array")["$==="](t))?t.$to_a():a(Wt,"Opal").$coerce_to(t,a(Wt,"Array"),"to_ary").$to_a(),this.concat(t)},m.$$arity=1),t.def(Qt,"$-",v=function(e){if(e=o(a(Wt,"Array")["$==="](e))?e.$to_a():a(Wt,"Opal").$coerce_to(e,a(Wt,"Array"),"to_ary").$to_a(),o(0===this.length))return[];if(o(0===e.length))return this.slice();var r,n,i,$=[],s=l([],{});for(r=0,n=e.length;r<n;r++)t.hash_put(s,e[r],!0);for(r=0,n=this.length;r<n;r++)i=this[r],void 0===t.hash_get(s,i)&&$.push(i);return $},v.$$arity=1),t.def(Qt,"$<<",b=function(t){return this.push(t),this},b.$$arity=1),t.def(Qt,"$<=>",O=function(t){if(o(a(Wt,"Array")["$==="](t)))t=t.$to_a();else{if(!o(t["$respond_to?"]("to_ary")))return i;t=t.$to_ary().$to_a()}if(this.$hash()===t.$hash())return 0;for(var e=Math.min(this.length,t.length),r=0;r<e;r++){var n=this[r]["$<=>"](t[r]);if(0!==n)return n}return this.length["$<=>"](t.length)},O.$$arity=1),t.def(Qt,"$==",w=function(t){var e={};return function t(r,n){var i,$,s,o;if(r===n)return!0;if(!n.$$is_array)return!!a(Wt,"Opal")["$respond_to?"](n,"to_ary")&&n["$=="](r);if(r.$$constructor!==Array&&(r=r.$to_a()),n.$$constructor!==Array&&(n=n.$to_a()),r.length!==n.length)return!1;for(e[r.$object_id()]=!0,i=0,$=r.length;i<$;i++)if(s=r[i],o=n[i],s.$$is_array){if(o.$$is_array&&o.length!==s.length)return!1;if(!e.hasOwnProperty(s.$object_id())&&!t(s,o))return!1}else if(!s["$=="](o))return!1;return!0}(this,t)},w.$$arity=1),t.def(Qt,"$[]",E=function(e,r){return e.$$is_range?function(e,r){var n,$,a,s=e.length;return n=r.excl,$=t.Opal.$coerce_to(r.begin,t.Integer,"to_int"),a=t.Opal.$coerce_to(r.end,t.Integer,"to_int"),$<0&&($+=s)<0?i:$>s?i:a<0&&(a+=s)<0?[]:(n||(a+=1),te(e.slice($,a),e.$class()))}(this,e):function(e,r,n){var $=e.length;return(r=t.Opal.$coerce_to(r,t.Integer,"to_int"))<0&&(r+=$)<0?i:void 0===n?r>=$||r<0?i:e[r]:(n=t.Opal.$coerce_to(n,t.Integer,"to_int"))<0||r>$||r<0?i:te(e.slice(r,r+n),e.$class())}(this,e,r)},E.$$arity=-2),t.def(Qt,"$[]=",x=function(t,e,r){var n,$,s=i,l=i,u=this.length;if(o(a(Wt,"Range")["$==="](t))){s=o(a(Wt,"Array")["$==="](e))?e.$to_a():o(e["$respond_to?"]("to_ary"))?e.$to_ary().$to_a():[e];var c=t.excl,h=a(Wt,"Opal").$coerce_to(t.begin,a(Wt,"Integer"),"to_int"),f=a(Wt,"Opal").$coerce_to(t.end,a(Wt,"Integer"),"to_int");if(h<0&&(h+=u)<0&&this.$raise(a(Wt,"RangeError"),t.$inspect()+" out of range"),f<0&&(f+=u),c||(f+=1),h>u)for(n=u;n<h;n++)this[n]=i;return f<0?this.splice.apply(this,[h,0].concat(s)):this.splice.apply(this,[h,f-h].concat(s)),e}if(o(void 0===r)?l=1:(l=e,e=r,s=o(a(Wt,"Array")["$==="](e))?e.$to_a():o(e["$respond_to?"]("to_ary"))?e.$to_ary().$to_a():[e]),t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),l=a(Wt,"Opal").$coerce_to(l,a(Wt,"Integer"),"to_int"),t<0&&($=t,(t+=u)<0&&this.$raise(a(Wt,"IndexError"),"index "+$+" too small for array; minimum "+-this.length)),l<0&&this.$raise(a(Wt,"IndexError"),"negative length ("+l+")"),t>u)for(n=u;n<t;n++)this[n]=i;return void 0===r?this[t]=e:this.splice.apply(this,[t,l].concat(s)),e},x.$$arity=-3),t.def(Qt,"$any?",k=function(e){var r=k.$$p,n=this,$=i,a=i,s=i;for(r&&(k.$$p=null),a=0,s=arguments.length,$=new Array(s);a<s;a++)$[a]=arguments[a];return r&&(k.$$p=null),0!==n.length&&u(n,t.find_super_dispatcher(n,"any?",k,!1),$,r)},k.$$arity=-1),t.def(Qt,"$assoc",A=function(t){for(var e,r=0,n=this.length;r<n;r++)if((e=this[r]).length&&e[0]["$=="](t))return e;return i},A.$$arity=1),t.def(Qt,"$at",M=function(t){return(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&(t+=this.length),t<0||t>=this.length?i:this[t]},M.$$arity=1),t.def(Qt,"$bsearch_index",I=function(){var e=I.$$p,r=e||i;if(e&&(I.$$p=null),e&&(I.$$p=null),r===i)return this.$enum_for("bsearch_index");for(var n,$,s,o=0,l=this.length,u=!1,c=i;o<l;){if($=this[n=o+Math.floor((l-o)/2)],!0===(s=t.yield1(r,$)))c=n,u=!0;else if(!1===s||s===i)u=!1;else if(s.$$is_number){if(0===s)return n;u=s<0}else this.$raise(a(Wt,"TypeError"),"wrong argument type "+s.$class()+" (must be numeric, true, false or nil)");u?l=n:o=n+1}return c},I.$$arity=0),t.def(Qt,"$bsearch",S=function(){var t,e=S.$$p,r=e||i;return e&&(S.$$p=null),e&&(S.$$p=null),r===i?this.$enum_for("bsearch"):null!=(t=u(this,"bsearch_index",[],r.$to_proc()))&&t.$$is_number?this[t]:t},S.$$arity=0),t.def(Qt,"$cycle",N=function(r){var n,s,l,c,h=N.$$p,f=h||i;if(h&&(N.$$p=null),h&&(N.$$p=null),null==r&&(r=i),f===i)return u(this,"enum_for",["cycle",r],((n=function(){var t,i,s=null==n.$$s?this:n.$$s;return o(r["$nil?"]())?$(a(Wt,"Float"),"INFINITY"):(r=a(Wt,"Opal")["$coerce_to!"](r,a(Wt,"Integer"),"to_int"),o(e(r,0))?(t=s.$enumerator_size(),i=r,"number"==typeof t&&"number"==typeof i?t*i:t["$*"](i)):0)}).$$s=this,n.$$arity=0,n));if(o(o(s=this["$empty?"]())?s:r["$=="](0)))return i;if(r===i)for(;;)for(l=0,c=this.length;l<c;l++)t.yield1(f,this[l]);else{if((r=a(Wt,"Opal")["$coerce_to!"](r,a(Wt,"Integer"),"to_int"))<=0)return this;for(;r>0;){for(l=0,c=this.length;l<c;l++)t.yield1(f,this[l]);r--}}return this},N.$$arity=-1),t.def(Qt,"$clear",j=function(){return this.splice(0,this.length),this},j.$$arity=0),t.def(Qt,"$count",R=function(e){var r,n=R.$$p,$=n||i,a=this,s=i,l=i,c=i;for(n&&(R.$$p=null),l=0,c=arguments.length,s=new Array(c);l<c;l++)s[l]=arguments[l];return n&&(R.$$p=null),null==e&&(e=i),o(o(r=e)?r:$)?u(a,t.find_super_dispatcher(a,"count",R,!1),s,n):a.$size()},R.$$arity=-1),t.def(Qt,"$initialize_copy",T=function(t){return this.$replace(t)},T.$$arity=1),t.def(Qt,"$collect",z=function(){var e,r=z.$$p,n=r||i;if(r&&(z.$$p=null),r&&(z.$$p=null),n===i)return u(this,"enum_for",["collect"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var $=[],a=0,s=this.length;a<s;a++){var o=t.yield1(n,this[a]);$.push(o)}return $},z.$$arity=0),t.def(Qt,"$collect!",q=function(){var e,r=q.$$p,n=r||i;if(r&&(q.$$p=null),r&&(q.$$p=null),n===i)return u(this,"enum_for",["collect!"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var $=0,a=this.length;$<a;$++){var s=t.yield1(n,this[$]);this[$]=s}return this},q.$$arity=0),t.def(Qt,"$combination",C=function(e){var r,n,$,s,o,l,c,h,f,d=C.$$p,p=d||i;if(d&&(C.$$p=null),n=a(Wt,"Opal")["$coerce_to!"](e,a(Wt,"Integer"),"to_int"),p===i)return u(this,"enum_for",["combination",n],((r=function(){return ee((null==r.$$s?this:r.$$s).length,n)}).$$s=this,r.$$arity=0,r));if(0===n)t.yield1(p,[]);else if(1===n)for($=0,s=this.length;$<s;$++)t.yield1(p,[this[$]]);else if(n===this.length)t.yield1(p,this.slice());else if(n>=0&&n<this.length){for(o=[],$=0;$<=n+1;$++)o.push(0);for(l=[],c=0,h=!1,o[0]=-1;!h;){for(l[c]=this[o[c+1]];c<n-1;)f=o[++c+1]=o[c]+1,l[c]=this[f];t.yield1(p,l.slice()),c++;do{h=0===c,o[c]++,c--}while(o[c+1]+n===this.length+c+1)}}return this},C.$$arity=1),t.def(Qt,"$repeated_combination",P=function(e){var r,n,$=P.$$p,s=$||i;if($&&(P.$$p=null),n=a(Wt,"Opal")["$coerce_to!"](e,a(Wt,"Integer"),"to_int"),s===i)return u(this,"enum_for",["repeated_combination",n],((r=function(){return ee((null==r.$$s?this:r.$$s).length+n-1,n)}).$$s=this,r.$$arity=0,r));return n>=0&&function e(r,n,i,$){if(i.length!=r)for(var a=n;a<$.length;a++)i.push($[a]),e(r,a,i,$),i.pop();else{var o=i.slice();t.yield1(s,o)}}(n,0,[],this),this},P.$$arity=1),t.def(Qt,"$compact",F=function(){for(var t,e=[],r=0,n=this.length;r<n;r++)(t=this[r])!==i&&e.push(t);return e},F.$$arity=0),t.def(Qt,"$compact!",D=function(){for(var t=this.length,e=0,r=this.length;e<r;e++)this[e]===i&&(this.splice(e,1),r--,e--);return this.length===t?i:this},D.$$arity=0),t.def(Qt,"$concat",L=function(e){var r,n,$,s,l=this;return r=t.slice.call(arguments,0,arguments.length),n=u(n=r,"map",[],(($=function(t){var e=null==$.$$s?this:$.$$s;return null==t&&(t=i),t=o(a(Wt,"Array")["$==="](t))?t.$to_a():a(Wt,"Opal").$coerce_to(t,a(Wt,"Array"),"to_ary").$to_a(),o(t["$equal?"](e))&&(t=t.$dup()),t}).$$s=l,$.$$arity=1,$)),u(n,"each",[],((s=function(t){var e=null==s.$$s?this:s.$$s;null==t&&(t=i);for(var r=0,n=t.length;r<n;r++)e.push(t[r])}).$$s=l,s.$$arity=1,s)),l},L.$$arity=-1),t.def(Qt,"$delete",B=function(e){var r=B.$$p,n=r||i;r&&(B.$$p=null);for(var $=this.length,a=0,s=$;a<s;a++)this[a]["$=="](e)&&(this.splice(a,1),s--,a--);return this.length===$?n!==i?t.yieldX(n,[]):i:e},B.$$arity=1),t.def(Qt,"$delete_at",U=function(t){if((t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&(t+=this.length),t<0||t>=this.length)return i;var e=this[t];return this.splice(t,1),e},U.$$arity=1),t.def(Qt,"$delete_if",G=function(){var t,e=G.$$p,r=e||i;if(e&&(G.$$p=null),e&&(G.$$p=null),r===i)return u(this,"enum_for",["delete_if"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));for(var n,$=0,a=this.length;$<a;$++)!1!==(n=r(this[$]))&&n!==i&&(this.splice($,1),a--,$--);return this},G.$$arity=0),t.def(Qt,"$dig",H=function(e,r){var n,$=this,s=i;return n=t.slice.call(arguments,1,arguments.length),(s=$["$[]"](e))===i||0===n.length?s:(o(s["$respond_to?"]("dig"))||$.$raise(a(Wt,"TypeError"),s.$class()+" does not have #dig method"),u(s,"dig",t.to_a(n)))},H.$$arity=-2),t.def(Qt,"$drop",X=function(t){return t<0&&this.$raise(a(Wt,"ArgumentError")),this.slice(t)},X.$$arity=1),t.def(Qt,"$dup",Y=function(){var e=Y.$$p,r=this,n=i,$=i,a=i;for(e&&(Y.$$p=null),$=0,a=arguments.length,n=new Array(a);$<a;$++)n[$]=arguments[$];return r.$$class===t.Array&&r.$$class.$allocate.$$pristine&&r.$copy_instance_variables.$$pristine&&r.$initialize_dup.$$pristine?r.slice(0):u(r,t.find_super_dispatcher(r,"dup",Y,!1),n,e)},Y.$$arity=0),t.def(Qt,"$each",K=function(){var e,r=K.$$p,n=r||i;if(r&&(K.$$p=null),r&&(K.$$p=null),n===i)return u(this,"enum_for",["each"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var $=0,a=this.length;$<a;$++)t.yield1(n,this[$]);return this},K.$$arity=0),t.def(Qt,"$each_index",V=function(){var e,r=V.$$p,n=r||i;if(r&&(V.$$p=null),r&&(V.$$p=null),n===i)return u(this,"enum_for",["each_index"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var $=0,a=this.length;$<a;$++)t.yield1(n,$);return this},V.$$arity=0),t.def(Qt,"$empty?",Z=function(){return 0===this.length},Z.$$arity=0),t.def(Qt,"$eql?",J=function(t){var e={};return function t(r,n){var i,$,a,s;if(!n.$$is_array)return!1;if(n=n.$to_a(),r.length!==n.length)return!1;for(e[r.$object_id()]=!0,i=0,$=r.length;i<$;i++)if(a=r[i],s=n[i],a.$$is_array){if(s.$$is_array&&s.length!==a.length)return!1;if(!e.hasOwnProperty(a.$object_id())&&!t(a,s))return!1}else if(!a["$eql?"](s))return!1;return!0}(this,t)},J.$$arity=1),t.def(Qt,"$fetch",Q=function(t,e){var r=Q.$$p,n=r||i;r&&(Q.$$p=null),r&&(Q.$$p=null);var $=t;return(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&(t+=this.length),t>=0&&t<this.length?this[t]:(n!==i&&null!=e&&this.$warn("warning: block supersedes default value argument"),n!==i?n($):null!=e?e:void(0===this.length?this.$raise(a(Wt,"IndexError"),"index "+$+" outside of array bounds: 0...0"):this.$raise(a(Wt,"IndexError"),"index "+$+" outside of array bounds: -"+this.length+"..."+this.length)))},Q.$$arity=-2),t.def(Qt,"$fill",W=function(e){var r,n,$,s,l,u=W.$$p,c=u||i,h=this,f=i,d=i,p=i,_=i,y=i;if(u&&(W.$$p=null),u&&(W.$$p=null),r=t.slice.call(arguments,0,arguments.length),o(c)?(o(r.length>2)&&h.$raise(a(Wt,"ArgumentError"),"wrong number of arguments ("+r.$length()+" for 0..2)"),$=r,f=null==(n=t.to_ary($))[0]?i:n[0],d=null==n[1]?i:n[1]):(o(0==r.length)?h.$raise(a(Wt,"ArgumentError"),"wrong number of arguments (0 for 1..3)"):o(r.length>3)&&h.$raise(a(Wt,"ArgumentError"),"wrong number of arguments ("+r.$length()+" for 1..3)"),$=r,p=null==(n=t.to_ary($))[0]?i:n[0],f=null==n[1]?i:n[1],d=null==n[2]?i:n[2]),o(a(Wt,"Range")["$==="](f))){if(o(d)&&h.$raise(a(Wt,"TypeError"),"length invalid with range"),_=a(Wt,"Opal").$coerce_to(f.$begin(),a(Wt,"Integer"),"to_int"),o(_<0)&&(_+=this.length),o(_<0)&&h.$raise(a(Wt,"RangeError"),f.$inspect()+" out of range"),y=a(Wt,"Opal").$coerce_to(f.$end(),a(Wt,"Integer"),"to_int"),o(y<0)&&(y+=this.length),o(f["$exclude_end?"]())||(y+=1),o(y<=_))return h}else if(o(f))if(_=a(Wt,"Opal").$coerce_to(f,a(Wt,"Integer"),"to_int"),o(_<0)&&(_+=this.length),o(_<0)&&(_=0),o(d)){if(y=a(Wt,"Opal").$coerce_to(d,a(Wt,"Integer"),"to_int"),o(0==y))return h;y+=_}else y=this.length;else _=0,y=this.length;if(o(_>this.length))for(s=this.length;s<y;s++)h[s]=i;if(o(y>this.length)&&(this.length=y),o(c))for(this.length;_<y;_++)l=c(_),h[_]=l;else for(this.length;_<y;_++)h[_]=p;return h},W.$$arity=-1),t.def(Qt,"$first",tt=function(t){return null==t?0===this.length?i:this[0]:((t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&this.$raise(a(Wt,"ArgumentError"),"negative array size"),this.slice(0,t))},tt.$$arity=-1),t.def(Qt,"$flatten",et=function(t){var e=this;return void 0!==t&&(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int")),te(function t(r,n){var $,s,o,l,u=[];for($=0,s=(r=r.$to_a()).length;$<s;$++)if(o=r[$],a(Wt,"Opal")["$respond_to?"](o,"to_ary",!0))if((l=o.$to_ary())!==i)switch(l.$$is_array||e.$raise(a(Wt,"TypeError")),l===e&&e.$raise(a(Wt,"ArgumentError")),n){case void 0:u=u.concat(t(l));break;case 0:u.push(l);break;default:u.push.apply(u,t(l,n-1))}else u.push(o);else u.push(o);return u}(e,t),e.$class())},et.$$arity=-1),t.def(Qt,"$flatten!",rt=function(t){var e=this.$flatten(t);if(this.length==e.length){for(var r=0,n=this.length;r<n&&this[r]===e[r];r++);if(r==n)return i}return this.$replace(e),this},rt.$$arity=-1),t.def(Qt,"$hash",nt=function(){var e,r,n,i=void 0===t.hash_ids,$=["A"],a=this.$object_id();try{if(i&&(t.hash_ids=Object.create(null)),t.hash_ids[a])return"self";for(n in t.hash_ids)if(e=t.hash_ids[n],this["$eql?"](e))return"self";for(t.hash_ids[a]=this,r=0;r<this.length;r++)e=this[r],$.push(e.$hash());return $.join(",")}finally{i&&(t.hash_ids=void 0)}},nt.$$arity=0),t.def(Qt,"$include?",it=function(t){for(var e=0,r=this.length;e<r;e++)if(this[e]["$=="](t))return!0;return!1},it.$$arity=1),t.def(Qt,"$index",$t=function(t){var e,r,n,$=$t.$$p,a=$||i;if($&&($t.$$p=null),$&&($t.$$p=null),null!=t&&a!==i&&this.$warn("warning: given block not used"),null!=t){for(e=0,r=this.length;e<r;e++)if(this[e]["$=="](t))return e}else{if(a===i)return this.$enum_for("index");for(e=0,r=this.length;e<r;e++)if(!1!==(n=a(this[e]))&&n!==i)return e}return i},$t.$$arity=-1),t.def(Qt,"$insert",at=function(e,r){var n,$=this;if(n=t.slice.call(arguments,1,arguments.length),e=a(Wt,"Opal").$coerce_to(e,a(Wt,"Integer"),"to_int"),n.length>0){if(e<0&&(e+=$.length+1)<0&&$.$raise(a(Wt,"IndexError"),e+" is out of bounds"),e>$.length)for(var s=$.length;s<e;s++)$.push(i);$.splice.apply($,[e,0].concat(n))}return $},at.$$arity=-2),t.def(Qt,"$inspect",st=function(){for(var t=[],e=this.$__id__(),r=0,n=this.length;r<n;r++){var i=this["$[]"](r);i.$__id__()===e?t.push("[...]"):t.push(i.$inspect())}return"["+t.join(", ")+"]"},st.$$arity=0),t.def(Qt,"$join",ot=function(e){if(null==c[","]&&(c[","]=i),null==e&&(e=i),o(0===this.length))return"";o(e===i)&&(e=c[","]);var r,n,$,s,l=[];for(r=0,n=this.length;r<n;r++)$=this[r],a(Wt,"Opal")["$respond_to?"]($,"to_str")&&(s=$.$to_str())!==i?l.push(s.$to_s()):a(Wt,"Opal")["$respond_to?"]($,"to_ary")&&((s=$.$to_ary())===this&&this.$raise(a(Wt,"ArgumentError")),s!==i)?l.push(s.$join(e)):a(Wt,"Opal")["$respond_to?"]($,"to_s")&&(s=$.$to_s())!==i?l.push(s):this.$raise(a(Wt,"NoMethodError").$new(t.inspect($)+" doesn't respond to #to_str, #to_ary or #to_s","to_str"));return e===i?l.join(""):l.join(a(Wt,"Opal")["$coerce_to!"](e,a(Wt,"String"),"to_str").$to_s())},ot.$$arity=-1),t.def(Qt,"$keep_if",lt=function(){var t,e=lt.$$p,r=e||i;if(e&&(lt.$$p=null),e&&(lt.$$p=null),r===i)return u(this,"enum_for",["keep_if"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));for(var n,$=0,a=this.length;$<a;$++)!1!==(n=r(this[$]))&&n!==i||(this.splice($,1),a--,$--);return this},lt.$$arity=0),t.def(Qt,"$last",ut=function(t){return null==t?0===this.length?i:this[this.length-1]:((t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&this.$raise(a(Wt,"ArgumentError"),"negative array size"),t>this.length&&(t=this.length),this.slice(this.length-t,this.length))},ut.$$arity=-1),t.def(Qt,"$length",ct=function(){return this.length},ct.$$arity=0),t.alias(Qt,"map","collect"),t.alias(Qt,"map!","collect!"),t.def(Qt,"$max",ht=function(t){var e=ht.$$p,r=e||i;return e&&(ht.$$p=null),e&&(ht.$$p=null),u(this.$each(),"max",[t],r.$to_proc())},ht.$$arity=-1),t.def(Qt,"$min",ft=function(){var t=ft.$$p,e=t||i;return t&&(ft.$$p=null),t&&(ft.$$p=null),u(this.$each(),"min",[],e.$to_proc())},ft.$$arity=0),t.def(Qt,"$permutation",dt=function(e){var r,n,$,s,o=dt.$$p,l=o||i,c=this,h=i,f=i;if(o&&(dt.$$p=null),o&&(dt.$$p=null),l===i)return u(c,"enum_for",["permutation",e],((r=function(){var t=null==r.$$s?this:r.$$s;return function(t,e){for(var r=e>=0?1:0;e;)r*=t,t--,e--;return r}(t.length,void 0===e?t.length:e)}).$$s=c,r.$$arity=0,r));if((e=void 0===e?c.length:a(Wt,"Opal").$coerce_to(e,a(Wt,"Integer"),"to_int"))<0||c.length<e);else if(0===e)t.yield1(l,[]);else if(1===e)for(var d=0;d<c.length;d++)t.yield1(l,[c[d]]);else h=a(Wt,"Array").$new(e),f=a(Wt,"Array").$new(c.length,!1),n=function(e,r,i,$,a){c=this;for(var o=0;o<c.length;o++)if($["$[]"](o)["$!"]())if(r[i]=o,i<e-1)$[o]=!0,n.call(c,e,r,i+1,$,a),$[o]=!1;else{s=[];for(var l=0;l<r.length;l++)s.push(c[r[l]]);t.yield1(a,s)}},l!==i?($=c.slice(),n.call($,e,h,0,f,l)):n.call(c,e,h,0,f,l);return c},dt.$$arity=-1),t.def(Qt,"$repeated_permutation",pt=function(e){var r,n,$=pt.$$p,s=$||i;if($&&(pt.$$p=null),n=a(Wt,"Opal")["$coerce_to!"](e,a(Wt,"Integer"),"to_int"),s===i)return u(this,"enum_for",["repeated_permutation",n],((r=function(){var t,e,i=null==r.$$s?this:r.$$s;return o((e=0,"number"==typeof(t=n)&&"number"==typeof e?t>=e:t["$>="](e)))?i.$size()["$**"](n):0}).$$s=this,r.$$arity=0,r));return function e(r,n,i){if(n.length!=r)for(var $=0;$<i.length;$++)n.push(i[$]),e(r,n,i),n.pop();else{var a=n.slice();t.yield1(s,a)}}(n,[],this.slice()),this},pt.$$arity=1),t.def(Qt,"$pop",_t=function(t){return o(void 0===t)?o(0===this.length)?i:this.pop():(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),o(t<0)&&this.$raise(a(Wt,"ArgumentError"),"negative array size"),o(0===this.length)?[]:o(t>this.length)?this.splice(0,this.length):this.splice(this.length-t,this.length))},_t.$$arity=-1),t.def(Qt,"$product",yt=function(e){var r,n,$=yt.$$p,s=$||i,o=this;$&&(yt.$$p=null),$&&(yt.$$p=null),r=t.slice.call(arguments,0,arguments.length);var l,u,c,h,f=s!==i?null:[],d=(n=r).length+1,p=new Array(d),_=new Array(d),y=new Array(d),g=1;for(y[0]=o,l=1;l<d;l++)y[l]=a(Wt,"Opal").$coerce_to(n[l-1],a(Wt,"Array"),"to_ary");for(l=0;l<d;l++){if(0===(h=y[l].length))return f||o;(g*=h)>2147483647&&o.$raise(a(Wt,"RangeError"),"too big to product"),_[l]=h,p[l]=0}t:for(;;){for(c=[],l=0;l<d;l++)c.push(y[l][p[l]]);for(f?f.push(c):t.yield1(s,c),p[u=d-1]++;p[u]===_[u];){if(p[u]=0,--u<0)break t;p[u]++}}return f||o},yt.$$arity=-1),t.def(Qt,"$push",gt=function(e){for(var r,n=this,i=0,$=(r=t.slice.call(arguments,0,arguments.length)).length;i<$;i++)n.push(r[i]);return n},gt.$$arity=-1),t.alias(Qt,"append","push"),t.def(Qt,"$rassoc",mt=function(t){for(var e,r=0,n=this.length;r<n;r++)if((e=this[r]).length&&void 0!==e[1]&&e[1]["$=="](t))return e;return i},mt.$$arity=1),t.def(Qt,"$reject",vt=function(){var t,e=vt.$$p,r=e||i;if(e&&(vt.$$p=null),e&&(vt.$$p=null),r===i)return u(this,"enum_for",["reject"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));for(var n,$=[],a=0,s=this.length;a<s;a++)!1!==(n=r(this[a]))&&n!==i||$.push(this[a]);return $},vt.$$arity=0),t.def(Qt,"$reject!",bt=function(){var t,e,r=bt.$$p,n=r||i;return r&&(bt.$$p=null),r&&(bt.$$p=null),n===i?u(this,"enum_for",["reject!"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t)):(e=this.$length(),u(this,"delete_if",[],n.$to_proc()),this.$length()["$=="](e)?i:this)},bt.$$arity=0),t.def(Qt,"$replace",Ot=function(t){return t=o(a(Wt,"Array")["$==="](t))?t.$to_a():a(Wt,"Opal").$coerce_to(t,a(Wt,"Array"),"to_ary").$to_a(),this.splice(0,this.length),this.push.apply(this,t),this},Ot.$$arity=1),t.def(Qt,"$reverse",wt=function(){return this.slice(0).reverse()},wt.$$arity=0),t.def(Qt,"$reverse!",Et=function(){return this.reverse()},Et.$$arity=0),t.def(Qt,"$reverse_each",xt=function(){var t,e=xt.$$p,r=e||i;return e&&(xt.$$p=null),e&&(xt.$$p=null),r===i?u(this,"enum_for",["reverse_each"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t)):(u(this.$reverse(),"each",[],r.$to_proc()),this)},xt.$$arity=0),t.def(Qt,"$rindex",kt=function(t){var e,r,n=kt.$$p,$=n||i;if(n&&(kt.$$p=null),n&&(kt.$$p=null),null!=t&&$!==i&&this.$warn("warning: given block not used"),null!=t){for(e=this.length-1;e>=0&&!(e>=this.length);e--)if(this[e]["$=="](t))return e}else if($!==i){for(e=this.length-1;e>=0&&!(e>=this.length);e--)if(!1!==(r=$(this[e]))&&r!==i)return e}else if(null==t)return this.$enum_for("rindex");return i},kt.$$arity=-1),t.def(Qt,"$rotate",At=function(t){var e,r,n,i;return null==t&&(t=1),t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),1===this.length?this.slice():0===this.length?[]:(r=t%(e=this.slice()).length,n=e.slice(r),i=e.slice(0,r),n.concat(i))},At.$$arity=-1),t.def(Qt,"$rotate!",Mt=function(t){var e;return null==t&&(t=1),0===this.length||1===this.length?this:(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),e=this.$rotate(t),this.$replace(e))},Mt.$$arity=-1),function(e,r,n){var $,l,u=s(e,null,"SampleRandom"),c=[u].concat(n);u.$$prototype.rng=i,t.def(u,"$initialize",$=function(t){return this.rng=t},$.$$arity=1),t.def(u,"$rand",l=function(t){var e;return e=a(c,"Opal").$coerce_to(this.rng.$rand(t),a(c,"Integer"),"to_int"),o(e<0)&&this.$raise(a(c,"RangeError"),"random value must be >= 0"),o(e<t)||this.$raise(a(c,"RangeError"),"random value must be less than Array size"),e},l.$$arity=1)}(Wt[0],0,Wt),t.def(Qt,"$sample",It=function(t,e){var r,n,$,s,l,u,c,h,f,d=i,p=i;if(o(void 0===t))return this.$at(a(Wt,"Kernel").$rand(this.length));if(o(void 0===e)?o(d=a(Wt,"Opal")["$coerce_to?"](t,a(Wt,"Hash"),"to_hash"))?(e=d,t=i):(e=i,t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int")):(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),e=a(Wt,"Opal").$coerce_to(e,a(Wt,"Hash"),"to_hash")),o(o(r=t)?t<0:r)&&this.$raise(a(Wt,"ArgumentError"),"count must be greater than 0"),o(e)&&(p=e["$[]"]("random")),p=o(o(r=p)?p["$respond_to?"]("rand"):r)?a(Wt,"SampleRandom").$new(p):a(Wt,"Kernel"),!o(t))return this[p.$rand(this.length)];switch(t>this.length&&(t=this.length),t){case 0:return[];case 1:return[this[p.$rand(this.length)]];case 2:return(l=p.$rand(this.length))===(u=p.$rand(this.length))&&(u=0===l?l+1:l-1),[this[l],this[u]];default:if(this.length/t>3){for(n=!1,$=0,l=1,(s=a(Wt,"Array").$new(t))[0]=p.$rand(this.length);l<t;){for(c=p.$rand(this.length),u=0;u<l;){for(;c===s[u];){if(++$>100){n=!0;break}c=p.$rand(this.length)}if(n)break;u++}if(n)break;s[l]=c,l++}if(!n){for(l=0;l<t;)s[l]=this[s[l]],l++;return s}}s=this.slice();for(var _=0;_<t;_++)h=p.$rand(this.length),f=s[_],s[_]=s[h],s[h]=f;return t===this.length?s:s["$[]"](0,t)}},It.$$arity=-1),t.def(Qt,"$select",St=function(){var e,r=St.$$p,n=r||i;if(r&&(St.$$p=null),r&&(St.$$p=null),n===i)return u(this,"enum_for",["select"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var $,a,s=[],o=0,l=this.length;o<l;o++)$=this[o],a=t.yield1(n,$),t.truthy(a)&&s.push($);return s},St.$$arity=0),t.def(Qt,"$select!",Nt=function(){var t,e=Nt.$$p,r=e||i;if(e&&(Nt.$$p=null),e&&(Nt.$$p=null),r===i)return u(this,"enum_for",["select!"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));var n=this.length;return u(this,"keep_if",[],r.$to_proc()),this.length===n?i:this},Nt.$$arity=0),t.def(Qt,"$shift",jt=function(t){return o(void 0===t)?o(0===this.length)?i:this.shift():(t=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),o(t<0)&&this.$raise(a(Wt,"ArgumentError"),"negative array size"),o(0===this.length)?[]:this.splice(0,t))},jt.$$arity=-1),t.alias(Qt,"size","length"),t.def(Qt,"$shuffle",Rt=function(t){return this.$dup().$to_a()["$shuffle!"](t)},Rt.$$arity=-1),t.def(Qt,"$shuffle!",Tt=function(t){var e,r,n,$=this.length;for(void 0!==t&&(t=a(Wt,"Opal")["$coerce_to?"](t,a(Wt,"Hash"),"to_hash"))!==i&&(t=t["$[]"]("random"))!==i&&t["$respond_to?"]("rand")&&(e=t);$;)e?((r=e.$rand($).$to_int())<0&&this.$raise(a(Wt,"RangeError"),"random number too small "+r),r>=$&&this.$raise(a(Wt,"RangeError"),"random number too big "+r)):r=this.$rand($),n=this[--$],this[$]=this[r],this[r]=n;return this},Tt.$$arity=-1),t.alias(Qt,"slice","[]"),t.def(Qt,"$slice!",zt=function(t,e){var r=i,n=i,$=i,s=i,l=i;if(r=i,o(void 0===e))if(o(a(Wt,"Range")["$==="](t))){n=t,r=this["$[]"](n),$=a(Wt,"Opal").$coerce_to(n.$begin(),a(Wt,"Integer"),"to_int"),s=a(Wt,"Opal").$coerce_to(n.$end(),a(Wt,"Integer"),"to_int"),$<0&&($+=this.length),s<0?s+=this.length:s>=this.length&&(s=this.length-1,n.excl&&(s+=1));var u=s-$;n.excl?s-=1:u+=1,$<this.length&&$>=0&&s<this.length&&s>=0&&u>0&&this.splice($,u)}else{if((l=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"))<0&&(l+=this.length),l<0||l>=this.length)return i;r=this[l],0===l?this.shift():this.splice(l,1)}else{if(l=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),(e=a(Wt,"Opal").$coerce_to(e,a(Wt,"Integer"),"to_int"))<0)return i;r=this["$[]"](l,e),l<0&&(l+=this.length),l+e>this.length&&(e=this.length-l),l<this.length&&l>=0&&this.splice(l,e)}return r},zt.$$arity=-2),t.def(Qt,"$sort",qt=function(){var t=qt.$$p,r=t||i,n=this;return t&&(qt.$$p=null),t&&(qt.$$p=null),o(n.length>1)?(r===i&&(r=function(t,e){return t["$<=>"](e)}),n.slice().sort((function(t,$){var s,o,l=r(t,$);return l===i&&n.$raise(a(Wt,"ArgumentError"),"comparison of "+t.$inspect()+" with "+$.$inspect()+" failed"),e(l,0)?1:(o=0,("number"==typeof(s=l)&&"number"==typeof o?s<o:s["$<"](o))?-1:0)}))):n},qt.$$arity=0),t.def(Qt,"$sort!",Ct=function(){var t,e=Ct.$$p,r=e||i;e&&(Ct.$$p=null),e&&(Ct.$$p=null),t=r!==i?u(this.slice(),"sort",[],r.$to_proc()):this.slice().$sort(),this.length=0;for(var n=0,$=t.length;n<$;n++)this.push(t[n]);return this},Ct.$$arity=0),t.def(Qt,"$sort_by!",Pt=function(){var t,e=Pt.$$p,r=e||i;return e&&(Pt.$$p=null),e&&(Pt.$$p=null),r===i?u(this,"enum_for",["sort_by!"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t)):this.$replace(u(this,"sort_by",[],r.$to_proc()))},Pt.$$arity=0),t.def(Qt,"$take",Ft=function(t){return t<0&&this.$raise(a(Wt,"ArgumentError")),this.slice(0,t)},Ft.$$arity=1),t.def(Qt,"$take_while",Dt=function(){var t=Dt.$$p,e=t||i;t&&(Dt.$$p=null),t&&(Dt.$$p=null);for(var r,n,$=[],a=0,s=this.length;a<s;a++){if(!1===(n=e(r=this[a]))||n===i)return $;$.push(r)}return $},Dt.$$arity=0),t.def(Qt,"$to_a",Lt=function(){return this},Lt.$$arity=0),t.alias(Qt,"to_ary","to_a"),t.def(Qt,"$to_h",Bt=function(){var e,r,n,i,$=this.length,s=l([],{});for(e=0;e<$;e++)(r=a(Wt,"Opal")["$coerce_to?"](this[e],a(Wt,"Array"),"to_ary")).$$is_array||this.$raise(a(Wt,"TypeError"),"wrong element type "+r.$class()+" at "+e+" (expected array)"),2!==r.length&&this.$raise(a(Wt,"ArgumentError"),"wrong array length at "+e+" (expected 2, was "+r.$length()+")"),n=r[0],i=r[1],t.hash_put(s,n,i);return s},Bt.$$arity=0),t.alias(Qt,"to_s","inspect"),t.def(Qt,"$transpose",Ut=function(){var e,r=i,n=i;return o(this["$empty?"]())?[]:(r=[],n=i,u(this,"each",[],((e=function($){var s,l,c=null==e.$$s?this:e.$$s;return null==$&&($=i),$=o(a(Wt,"Array")["$==="]($))?$.$to_a():a(Wt,"Opal").$coerce_to($,a(Wt,"Array"),"to_ary").$to_a(),n=o(s=n)?s:$.length,o($.length["$!="](n))&&c.$raise(a(Wt,"IndexError"),"element size differs ("+$.length+" should be "+n+")"),u($.length,"times",[],((l=function(e){null==l.$$s||l.$$s;var n,a,s,c=i;return null==e&&(e=i),(o(n=r["$[]"](e))?n:(c=[e,[]],u(r,"[]=",t.to_a(c)),c[(a=c.length,s=1,"number"==typeof a&&"number"==typeof s?a-s:a["$-"](s))]))["$<<"]($.$at(e))}).$$s=c,l.$$arity=1,l))}).$$s=this,e.$$arity=1,e)),r)},Ut.$$arity=0),t.def(Qt,"$uniq",Gt=function(){var e=Gt.$$p,r=e||i;e&&(Gt.$$p=null),e&&(Gt.$$p=null);var n,$,a,s,o=l([],{});if(r===i)for(n=0,$=this.length;n<$;n++)a=this[n],void 0===t.hash_get(o,a)&&t.hash_put(o,a,a);else for(n=0,$=this.length;n<$;n++)a=this[n],s=t.yield1(r,a),void 0===t.hash_get(o,s)&&t.hash_put(o,s,a);return te(o.$values(),this.$class())},Gt.$$arity=0),t.def(Qt,"$uniq!",Ht=function(){var e=Ht.$$p,r=e||i;e&&(Ht.$$p=null),e&&(Ht.$$p=null);var n,$,a,s,o=this.length,u=l([],{});for(n=0,$=o;n<$;n++)a=this[n],s=r===i?a:t.yield1(r,a),void 0!==t.hash_get(u,s)?(this.splice(n,1),$--,n--):t.hash_put(u,s,a);return this.length===o?i:this},Ht.$$arity=0),t.def(Qt,"$unshift",Xt=function(e){for(var r,n=this,i=(r=t.slice.call(arguments,0,arguments.length)).length-1;i>=0;i--)n.unshift(r[i]);return n},Xt.$$arity=-1),t.alias(Qt,"prepend","unshift"),t.def(Qt,"$values_at",Yt=function(e){var r,n,$=this,s=i;return r=t.slice.call(arguments,0,arguments.length),s=[],u(r,"each",[],((n=function(t){var e,r=null==n.$$s?this:n.$$s,$=i,l=i,c=i;return null==t&&(t=i),o(t["$is_a?"](a(Wt,"Range")))?($=a(Wt,"Opal").$coerce_to(t.$last(),a(Wt,"Integer"),"to_int"),(l=a(Wt,"Opal").$coerce_to(t.$first(),a(Wt,"Integer"),"to_int"))<0?(l+=r.length,i):($<0&&($+=r.length),t["$exclude_end?"]()&&$--,$<l?i:u(l,"upto",[$],((e=function(t){var r=null==e.$$s?this:e.$$s;return null==t&&(t=i),s["$<<"](r.$at(t))}).$$s=r,e.$$arity=1,e)))):(c=a(Wt,"Opal").$coerce_to(t,a(Wt,"Integer"),"to_int"),s["$<<"](r.$at(c)))}).$$s=$,n.$$arity=1,n)),s},Yt.$$arity=-1),t.def(Qt,"$zip",Kt=function(e){var r,n,$=Kt.$$p,s=$||i,l=this;$&&(Kt.$$p=null),$&&(Kt.$$p=null),r=t.slice.call(arguments,0,arguments.length);var u,c,h,f,d,p=[],_=l.length;for(f=0,d=r.length;f<d;f++)(c=r[f]).$$is_array||(c.$$is_enumerator?c.$size()===1/0?r[f]=c.$take(_):r[f]=c.$to_a():r[f]=(o(n=a(Wt,"Opal")["$coerce_to?"](c,a(Wt,"Array"),"to_ary"))?n:a(Wt,"Opal")["$coerce_to!"](c,a(Wt,"Enumerator"),"each")).$to_a());for(h=0;h<_;h++){for(u=[l[h]],f=0,d=r.length;f<d;f++)null==(c=r[f][h])&&(c=i),u[f+1]=c;p[h]=u}if(s!==i){for(h=0;h<_;h++)s(p[h]);return i}return p},Kt.$$arity=-1),t.defs(Qt,"$inherited",Vt=function(t){t.$$prototype.$to_a=function(){return this.slice(0,this.length)}},Vt.$$arity=1),t.def(Qt,"$instance_variables",Zt=function(){var e,r=Zt.$$p,n=this,$=i,a=i,s=i;for(r&&(Zt.$$p=null),a=0,s=arguments.length,$=new Array(s);a<s;a++)$[a]=arguments[a];return u(u(n,t.find_super_dispatcher(n,"instance_variables",Zt,!1),$,r),"reject",[],((e=function(t){var r;null==e.$$s||e.$$s;return null==t&&(t=i),o(r=/^@\d+$/.test(t))?r:t["$=="]("@length")}).$$s=n,e.$$arity=1,e))},Zt.$$arity=0),a(Wt,"Opal").$pristine(Qt.$singleton_class(),"allocate"),a(Wt,"Opal").$pristine(Qt,"copy_instance_variables","initialize_dup"),t.def(Qt,"$pack",Jt=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise("To use Array#pack, you must first require 'corelib/array/pack'.")},Jt.$$arity=-1),i&&"pack"}(n[0],Array,n)}};void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_();var v=function(){global.Opal.modules["corelib/hash"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>=e:t["$>="](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}var n=t.top,i=[],$=t.nil,a=(t.const_get_qualified,t.const_get_relative),s=(t.breaker,t.slice,t.klass),o=t.send,l=t.hash2,u=t.truthy;return t.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=","$proc"]),n.$require("corelib/enumerable"),function(n,i,c){var h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct,ht,ft,dt,pt,_t,yt,gt,mt,vt,bt=s(n,null,"Hash"),Ot=[bt].concat(c);return bt.$include(a(Ot,"Enumerable")),bt.$$prototype.$$is_hash=!0,t.defs(bt,"$[]",h=function(e){var r,n,i,s=this,o=(r=t.slice.call(arguments,0,arguments.length)).length;if(1===o){if((n=a(Ot,"Opal")["$coerce_to?"](r["$[]"](0),a(Ot,"Hash"),"to_hash"))!==$)return s.$allocate()["$merge!"](n);for((r=a(Ot,"Opal")["$coerce_to?"](r["$[]"](0),a(Ot,"Array"),"to_ary"))===$&&s.$raise(a(Ot,"ArgumentError"),"odd number of arguments for Hash"),o=r.length,n=s.$allocate(),i=0;i<o;i++)if(r[i].$$is_array)switch(r[i].length){case 1:n.$store(r[i][0],$);break;case 2:n.$store(r[i][0],r[i][1]);break;default:s.$raise(a(Ot,"ArgumentError"),"invalid number of elements ("+r[i].length+" for 1..2)")}return n}for(o%2!=0&&s.$raise(a(Ot,"ArgumentError"),"odd number of arguments for Hash"),n=s.$allocate(),i=0;i<o;i+=2)n.$store(r[i],r[i+1]);return n},h.$$arity=-1),t.defs(bt,"$allocate",f=function(){var e=new this.$$constructor;return t.hash_init(e),e.$$none=$,e.$$proc=$,e},f.$$arity=0),t.defs(bt,"$try_convert",d=function(t){return a(Ot,"Opal")["$coerce_to?"](t,a(Ot,"Hash"),"to_hash")},d.$$arity=1),t.def(bt,"$initialize",p=function(t){var e=p.$$p,r=e||$;return e&&(p.$$p=null),e&&(p.$$p=null),void 0!==t&&r!==$&&this.$raise(a(Ot,"ArgumentError"),"wrong number of arguments (1 for 0)"),this.$$none=void 0===t?$:t,this.$$proc=r,this},p.$$arity=-1),t.def(bt,"$==",_=function(e){if(this===e)return!0;if(!e.$$is_hash)return!1;if(this.$$keys.length!==e.$$keys.length)return!1;for(var r,n,i,$=0,a=this.$$keys,s=a.length;$<s;$++)if((r=a[$]).$$is_string?(n=this.$$smap[r],i=e.$$smap[r]):(n=r.value,i=t.hash_get(e,r.key)),void 0===i||!n["$eql?"](i))return!1;return!0},_.$$arity=1),t.def(bt,"$>=",y=function(t){var e,r=$;return t=a(Ot,"Opal")["$coerce_to!"](t,a(Ot,"Hash"),"to_hash"),!(this.$$keys.length<t.$$keys.length)&&(r=!0,o(t,"each",[],((e=function(t,n){var i,a=null==e.$$s?this:e.$$s;null==t&&(t=$),null==n&&(n=$),null!=(i=a.$fetch(t,null))&&i===n||(r=!1)}).$$s=this,e.$$arity=2,e)),r)},y.$$arity=1),t.def(bt,"$>",g=function(t){return t=a(Ot,"Opal")["$coerce_to!"](t,a(Ot,"Hash"),"to_hash"),!(this.$$keys.length<=t.$$keys.length)&&e(this,t)},g.$$arity=1),t.def(bt,"$<",m=function(t){var e,r;return t=a(Ot,"Opal")["$coerce_to!"](t,a(Ot,"Hash"),"to_hash"),r=this,"number"==typeof(e=t)&&"number"==typeof r?e>r:e["$>"](r)},m.$$arity=1),t.def(bt,"$<=",v=function(t){return e(t=a(Ot,"Opal")["$coerce_to!"](t,a(Ot,"Hash"),"to_hash"),this)},v.$$arity=1),t.def(bt,"$[]",b=function(e){var r=t.hash_get(this,e);return void 0!==r?r:this.$default(e)},b.$$arity=1),t.def(bt,"$[]=",O=function(e,r){return t.hash_put(this,e,r),r},O.$$arity=2),t.def(bt,"$assoc",w=function(t){for(var e,r=0,n=this.$$keys,i=n.length;r<i;r++)if((e=n[r]).$$is_string){if(e["$=="](t))return[e,this.$$smap[e]]}else if(e.key["$=="](t))return[e.key,e.value];return $},w.$$arity=1),t.def(bt,"$clear",E=function(){return t.hash_init(this),this},E.$$arity=0),t.def(bt,"$clone",x=function(){var e=new this.$$class;return t.hash_init(e),t.hash_clone(this,e),e},x.$$arity=0),t.def(bt,"$compact",k=function(){for(var e,r,n=t.hash(),i=0,a=this.$$keys,s=a.length;i<s;i++)(e=a[i]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),r!==$&&t.hash_put(n,e,r);return n},k.$$arity=0),t.def(bt,"$compact!",A=function(){for(var e,r,n=!1,i=0,a=this.$$keys,s=a.length;i<s;i++)(e=a[i]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),r===$&&void 0!==t.hash_delete(this,e)&&(n=!0,s--,i--);return n?this:$},A.$$arity=0),t.def(bt,"$compare_by_identity",M=function(){var e,r,n,i,$=this.$$keys;if(this.$$by_identity)return this;if(0===this.$$keys.length)return this.$$by_identity=!0,this;for(i=l([],{}).$compare_by_identity(),e=0,r=$.length;e<r;e++)(n=$[e]).$$is_string||(n=n.key),t.hash_put(i,n,t.hash_get(this,n));return this.$$by_identity=!0,this.$$map=i.$$map,this.$$smap=i.$$smap,this},M.$$arity=0),t.def(bt,"$compare_by_identity?",I=function(){return!0===this.$$by_identity},I.$$arity=0),t.def(bt,"$default",S=function(t){return void 0!==t&&this.$$proc!==$&&void 0!==this.$$proc?this.$$proc.$call(this,t):void 0===this.$$none?$:this.$$none},S.$$arity=-1),t.def(bt,"$default=",N=function(t){return this.$$proc=$,this.$$none=t,t},N.$$arity=1),t.def(bt,"$default_proc",j=function(){return void 0!==this.$$proc?this.$$proc:$},j.$$arity=0),t.def(bt,"$default_proc=",R=function(t){var e=t;return e!==$&&(e=a(Ot,"Opal")["$coerce_to!"](e,a(Ot,"Proc"),"to_proc"))["$lambda?"]()&&2!==e.$arity().$abs()&&this.$raise(a(Ot,"TypeError"),"default_proc takes two arguments"),this.$$none=$,this.$$proc=e,t},R.$$arity=1),t.def(bt,"$delete",T=function(e){var r=T.$$p,n=r||$;r&&(T.$$p=null),r&&(T.$$p=null);var i=t.hash_delete(this,e);return void 0!==i?i:n!==$?t.yield1(n,e):$},T.$$arity=1),t.def(bt,"$delete_if",z=function(){var e,r=z.$$p,n=r||$;if(r&&(z.$$p=null),r&&(z.$$p=null),!u(n))return o(this,"enum_for",["delete_if"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=0,c=this.$$keys,h=c.length;l<h;l++)(i=c[l]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$&&void 0!==t.hash_delete(this,i)&&(h--,l--);return this},z.$$arity=0),t.alias(bt,"dup","clone"),t.def(bt,"$dig",q=function(e,r){var n,i=this,s=$;return n=t.slice.call(arguments,1,arguments.length),(s=i["$[]"](e))===$||0===n.length?s:(u(s["$respond_to?"]("dig"))||i.$raise(a(Ot,"TypeError"),s.$class()+" does not have #dig method"),o(s,"dig",t.to_a(n)))},q.$$arity=-2),t.def(bt,"$each",C=function(){var e,r=C.$$p,n=r||$;if(r&&(C.$$p=null),r&&(C.$$p=null),!u(n))return o(this,"enum_for",["each"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s=0,l=this.$$keys,c=l.length;s<c;s++)(i=l[s]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),t.yield1(n,[i,a]);return this},C.$$arity=0),t.def(bt,"$each_key",P=function(){var t,e=P.$$p,r=e||$;if(e&&(P.$$p=null),e&&(P.$$p=null),!u(r))return o(this,"enum_for",["each_key"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));for(var n,i=0,a=this.$$keys,s=a.length;i<s;i++)r((n=a[i]).$$is_string?n:n.key);return this},P.$$arity=0),t.alias(bt,"each_pair","each"),t.def(bt,"$each_value",F=function(){var t,e=F.$$p,r=e||$;if(e&&(F.$$p=null),e&&(F.$$p=null),!u(r))return o(this,"enum_for",["each_value"],((t=function(){return(null==t.$$s?this:t.$$s).$size()}).$$s=this,t.$$arity=0,t));for(var n,i=0,a=this.$$keys,s=a.length;i<s;i++)r((n=a[i]).$$is_string?this.$$smap[n]:n.value);return this},F.$$arity=0),t.def(bt,"$empty?",D=function(){return 0===this.$$keys.length},D.$$arity=0),t.alias(bt,"eql?","=="),t.def(bt,"$fetch",L=function(e,r){var n=L.$$p,i=n||$;n&&(L.$$p=null),n&&(L.$$p=null);var s=t.hash_get(this,e);return void 0!==s?s:i!==$?i(e):void 0!==r?r:this.$raise(a(Ot,"KeyError").$new("key not found: "+e.$inspect(),l(["key","receiver"],{key:e,receiver:this})))},L.$$arity=-2),t.def(bt,"$fetch_values",B=function(e){var r,n,i=B.$$p,a=i||$,s=this;return i&&(B.$$p=null),i&&(B.$$p=null),r=t.slice.call(arguments,0,arguments.length),o(r,"map",[],((n=function(t){var e=null==n.$$s?this:n.$$s;return null==t&&(t=$),o(e,"fetch",[t],a.$to_proc())}).$$s=s,n.$$arity=1,n))},B.$$arity=-1),t.def(bt,"$flatten",U=function(t){null==t&&(t=1),t=a(Ot,"Opal")["$coerce_to!"](t,a(Ot,"Integer"),"to_int");for(var e,r,n=[],i=0,$=this.$$keys,s=$.length;i<s;i++)if((e=$[i]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),n.push(e),r.$$is_array){if(1===t){n.push(r);continue}n=n.concat(r.$flatten(t-2))}else n.push(r);return n},U.$$arity=-1),t.def(bt,"$has_key?",G=function(e){return void 0!==t.hash_get(this,e)},G.$$arity=1),t.def(bt,"$has_value?",H=function(t){for(var e,r=0,n=this.$$keys,i=n.length;r<i;r++)if(((e=n[r]).$$is_string?this.$$smap[e]:e.value)["$=="](t))return!0;return!1},H.$$arity=1),t.def(bt,"$hash",X=function(){var e,r,n=void 0===t.hash_ids,i=this.$object_id(),$=["Hash"];try{if(n&&(t.hash_ids=Object.create(null)),t[i])return"self";for(e in t.hash_ids)if(r=t.hash_ids[e],this["$eql?"](r))return"self";t.hash_ids[i]=this;for(var a=0,s=this.$$keys,o=s.length;a<o;a++)(e=s[a]).$$is_string?$.push([e,this.$$smap[e].$hash()]):$.push([e.key_hash,e.value.$hash()]);return $.sort().join()}finally{n&&(t.hash_ids=void 0)}},X.$$arity=0),t.alias(bt,"include?","has_key?"),t.def(bt,"$index",Y=function(t){for(var e,r,n=0,i=this.$$keys,a=i.length;n<a;n++)if((e=i[n]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),r["$=="](t))return e;return $},Y.$$arity=1),t.def(bt,"$indexes",K=function(e){for(var r,n,i,$=this,a=[],s=0,o=(r=t.slice.call(arguments,0,arguments.length)).length;s<o;s++)n=r[s],void 0!==(i=t.hash_get($,n))?a.push(i):a.push($.$default());return a},K.$$arity=-1),t.alias(bt,"indices","indexes"),t.def(bt,"$inspect",V=function(){var t=void 0===vt,e=this.$object_id(),r=[];try{if(t&&(vt={}),vt.hasOwnProperty(e))return"{...}";vt[e]=!0;for(var n,i,$=0,a=this.$$keys,s=a.length;$<s;$++)(n=a[$]).$$is_string?i=this.$$smap[n]:(i=n.value,n=n.key),r.push(n.$inspect()+"=>"+i.$inspect());return"{"+r.join(", ")+"}"}finally{t&&(vt=void 0)}},V.$$arity=0),t.def(bt,"$invert",Z=function(){for(var e,r,n=t.hash(),i=0,$=this.$$keys,a=$.length;i<a;i++)(e=$[i]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),t.hash_put(n,r,e);return n},Z.$$arity=0),t.def(bt,"$keep_if",J=function(){var e,r=J.$$p,n=r||$;if(r&&(J.$$p=null),r&&(J.$$p=null),!u(n))return o(this,"enum_for",["keep_if"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=0,c=this.$$keys,h=c.length;l<h;l++)(i=c[l]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$||void 0!==t.hash_delete(this,i)&&(h--,l--);return this},J.$$arity=0),t.alias(bt,"key","index"),t.alias(bt,"key?","has_key?"),t.def(bt,"$keys",Q=function(){for(var t,e=[],r=0,n=this.$$keys,i=n.length;r<i;r++)(t=n[r]).$$is_string?e.push(t):e.push(t.key);return e},Q.$$arity=0),t.def(bt,"$length",W=function(){return this.$$keys.length},W.$$arity=0),t.alias(bt,"member?","has_key?"),t.def(bt,"$merge",tt=function(t){var e=tt.$$p,r=e||$;return e&&(tt.$$p=null),e&&(tt.$$p=null),o(this.$dup(),"merge!",[t],r.$to_proc())},tt.$$arity=1),t.def(bt,"$merge!",et=function(e){var r=et.$$p,n=r||$;r&&(et.$$p=null),r&&(et.$$p=null),e.$$is_hash||(e=a(Ot,"Opal")["$coerce_to!"](e,a(Ot,"Hash"),"to_hash"));var i,s,o,l,u=e.$$keys,c=u.length;if(n===$){for(i=0;i<c;i++)(s=u[i]).$$is_string?l=e.$$smap[s]:(l=s.value,s=s.key),t.hash_put(this,s,l);return this}for(i=0;i<c;i++)(s=u[i]).$$is_string?l=e.$$smap[s]:(l=s.value,s=s.key),void 0!==(o=t.hash_get(this,s))?t.hash_put(this,s,n(s,o,l)):t.hash_put(this,s,l);return this},et.$$arity=1),t.def(bt,"$rassoc",rt=function(t){for(var e,r,n=0,i=this.$$keys,a=i.length;n<a;n++)if((e=i[n]).$$is_string?r=this.$$smap[e]:(r=e.value,e=e.key),r["$=="](t))return[e,r];return $},rt.$$arity=1),t.def(bt,"$rehash",nt=function(){return t.hash_rehash(this),this},nt.$$arity=0),t.def(bt,"$reject",it=function(){var e,r=it.$$p,n=r||$;if(r&&(it.$$p=null),r&&(it.$$p=null),!u(n))return o(this,"enum_for",["reject"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=t.hash(),c=0,h=this.$$keys,f=h.length;c<f;c++)(i=h[c]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$||t.hash_put(l,i,a);return l},it.$$arity=0),t.def(bt,"$reject!",$t=function(){var e,r=$t.$$p,n=r||$;if(r&&($t.$$p=null),r&&($t.$$p=null),!u(n))return o(this,"enum_for",["reject!"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=!1,c=0,h=this.$$keys,f=h.length;c<f;c++)(i=h[c]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$&&void 0!==t.hash_delete(this,i)&&(l=!0,f--,c--);return l?this:$},$t.$$arity=0),t.def(bt,"$replace",at=function(e){var n=$;e=a(Ot,"Opal")["$coerce_to!"](e,a(Ot,"Hash"),"to_hash"),t.hash_init(this);for(var i,s,l=0,c=e.$$keys,h=c.length;l<h;l++)(i=c[l]).$$is_string?s=e.$$smap[i]:(s=i.value,i=i.key),t.hash_put(this,i,s);return u(e.$default_proc())?(n=[e.$default_proc()],o(this,"default_proc=",t.to_a(n)),n[r(n.length,1)]):(n=[e.$default()],o(this,"default=",t.to_a(n)),n[r(n.length,1)]),this},at.$$arity=1),t.def(bt,"$select",st=function(){var e,r=st.$$p,n=r||$;if(r&&(st.$$p=null),r&&(st.$$p=null),!u(n))return o(this,"enum_for",["select"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=t.hash(),c=0,h=this.$$keys,f=h.length;c<f;c++)(i=h[c]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$&&t.hash_put(l,i,a);return l},st.$$arity=0),t.def(bt,"$select!",ot=function(){var e,r=ot.$$p,n=r||$;if(r&&(ot.$$p=null),r&&(ot.$$p=null),!u(n))return o(this,"enum_for",["select!"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s,l=$,c=0,h=this.$$keys,f=h.length;c<f;c++)(i=h[c]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),!1!==(s=n(i,a))&&s!==$||(void 0!==t.hash_delete(this,i)&&(f--,c--),l=this);return l},ot.$$arity=0),t.def(bt,"$shift",lt=function(){var e,r=this.$$keys;return r.length>0?[e=(e=r[0]).$$is_string?e:e.key,t.hash_delete(this,e)]:this.$default($)},lt.$$arity=0),t.alias(bt,"size","length"),t.def(bt,"$slice",ut=function(e){var r,n=this;r=t.slice.call(arguments,0,arguments.length);for(var i=t.hash(),$=0,a=r.length;$<a;$++){var s=r[$],o=t.hash_get(n,s);void 0!==o&&t.hash_put(i,s,o)}return i},ut.$$arity=-1),t.alias(bt,"store","[]="),t.def(bt,"$to_a",ct=function(){for(var t,e,r=[],n=0,i=this.$$keys,$=i.length;n<$;n++)(t=i[n]).$$is_string?e=this.$$smap[t]:(e=t.value,t=t.key),r.push([t,e]);return r},ct.$$arity=0),t.def(bt,"$to_h",ht=function(){if(this.$$class===t.Hash)return this;var e=new t.Hash;return t.hash_init(e),t.hash_clone(this,e),e},ht.$$arity=0),t.def(bt,"$to_hash",ft=function(){return this},ft.$$arity=0),t.def(bt,"$to_proc",dt=function(){var t;return o(this,"proc",[],((t=function(e){var r=null==t.$$s?this:t.$$s;return null==e&&r.$raise(a(Ot,"ArgumentError"),"no key given"),r["$[]"](e)}).$$s=this,t.$$arity=-1,t))},dt.$$arity=0),t.alias(bt,"to_s","inspect"),t.def(bt,"$transform_keys",pt=function(){var e,r=pt.$$p,n=r||$;if(r&&(pt.$$p=null),r&&(pt.$$p=null),!u(n))return o(this,"enum_for",["transform_keys"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s=t.hash(),l=0,c=this.$$keys,h=c.length;l<h;l++)(i=c[l]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),i=t.yield1(n,i),t.hash_put(s,i,a);return s},pt.$$arity=0),t.def(bt,"$transform_keys!",_t=function(){var e,r=_t.$$p,n=r||$;if(r&&(_t.$$p=null),r&&(_t.$$p=null),!u(n))return o(this,"enum_for",["transform_keys!"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));var i,a,s,l,c=t.slice.call(this.$$keys),h=c.length;for(i=0;i<h;i++)(a=c[i]).$$is_string?s=this.$$smap[a]:(s=a.value,a=a.key),l=t.yield1(n,a),t.hash_delete(this,a),t.hash_put(this,l,s);return this},_t.$$arity=0),t.def(bt,"$transform_values",yt=function(){var e,r=yt.$$p,n=r||$;if(r&&(yt.$$p=null),r&&(yt.$$p=null),!u(n))return o(this,"enum_for",["transform_values"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s=t.hash(),l=0,c=this.$$keys,h=c.length;l<h;l++)(i=c[l]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),a=t.yield1(n,a),t.hash_put(s,i,a);return s},yt.$$arity=0),t.def(bt,"$transform_values!",gt=function(){var e,r=gt.$$p,n=r||$;if(r&&(gt.$$p=null),r&&(gt.$$p=null),!u(n))return o(this,"enum_for",["transform_values!"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e));for(var i,a,s=0,l=this.$$keys,c=l.length;s<c;s++)(i=l[s]).$$is_string?a=this.$$smap[i]:(a=i.value,i=i.key),a=t.yield1(n,a),t.hash_put(this,i,a);return this},gt.$$arity=0),t.alias(bt,"update","merge!"),t.alias(bt,"value?","has_value?"),t.alias(bt,"values_at","indexes"),t.def(bt,"$values",mt=function(){for(var t,e=[],r=0,n=this.$$keys,i=n.length;r<i;r++)(t=n[r]).$$is_string?e.push(this.$$smap[t]):e.push(t.value);return e},mt.$$arity=0),$&&"values"}(i[0],0,i)}};void 0===global.Opal.modules["corelib/numeric"]&&"function"==typeof g&&g();var b=function(){global.Opal.modules["corelib/number"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function $(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}function a(t,e){return"number"==typeof t&&"number"==typeof e?t*e:t["$*"](e)}var s=t.top,o=[],l=t.nil,u=t.const_get_qualified,c=t.const_get_relative,h=(t.breaker,t.slice,t.klass),f=t.truthy,d=t.send,p=t.hash2;return t.add_stubs(["$require","$bridge","$raise","$name","$class","$Float","$respond_to?","$coerce_to!","$__coerced__","$===","$!","$>","$**","$new","$<","$to_f","$==","$nan?","$infinite?","$enum_for","$+","$-","$gcd","$lcm","$%","$/","$frexp","$to_i","$ldexp","$rationalize","$*","$<<","$to_r","$truncate","$-@","$size","$<=","$>=","$<=>","$compare","$any?"]),s.$require("corelib/numeric"),function(s,o,_){var y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt,nt,it,$t,at,st,ot,lt,ut,ct,ht,ft,dt,pt,_t,yt,gt,mt,vt,bt,Ot,wt,Et,xt,kt,At,Mt,It,St,Nt,jt,Rt,Tt,zt=h(s,o,"Number"),qt=[zt].concat(_);c(qt,"Opal").$bridge(Number,zt),Object.defineProperty(Number.prototype,"$$is_number",{value:!0}),Object.defineProperty(Number.prototype,"$$is_number_class",{value:!0}),Object.defineProperty(zt,"$$is_number",{value:!0}),Object.defineProperty(zt,"$$is_number_class",{value:!0}),function(e,r){var n,i=[e].concat(r);t.def(e,"$allocate",n=function(){return this.$raise(c(i,"TypeError"),"allocator undefined for "+this.$name())},n.$$arity=0),t.udef(e,"$new")}(t.get_singleton_class(zt),qt),t.def(zt,"$coerce",y=function(t){if(t===l)this.$raise(c(qt,"TypeError"),"can't convert "+t.$class()+" into Float");else{if(t.$$is_string)return[this.$Float(t),this];if(t["$respond_to?"]("to_f"))return[c(qt,"Opal")["$coerce_to!"](t,c(qt,"Float"),"to_f"),this];if(t.$$is_number)return[t,this];this.$raise(c(qt,"TypeError"),"can't convert "+t.$class()+" into Float")}},y.$$arity=1),t.def(zt,"$__id__",g=function(){return 2*this+1},g.$$arity=0),t.alias(zt,"object_id","__id__"),t.def(zt,"$+",m=function(t){return t.$$is_number?this+t:this.$__coerced__("+",t)},m.$$arity=1),t.def(zt,"$-",v=function(t){return t.$$is_number?this-t:this.$__coerced__("-",t)},v.$$arity=1),t.def(zt,"$*",b=function(t){return t.$$is_number?this*t:this.$__coerced__("*",t)},b.$$arity=1),t.def(zt,"$/",O=function(t){return t.$$is_number?this/t:this.$__coerced__("/",t)},O.$$arity=1),t.alias(zt,"fdiv","/"),t.def(zt,"$%",w=function(t){return t.$$is_number?t==-1/0?t:0!=t?t<0||this<0?(this%t+t)%t:this%t:void this.$raise(c(qt,"ZeroDivisionError"),"divided by 0"):this.$__coerced__("%",t)},w.$$arity=1),t.def(zt,"$&",E=function(t){return t.$$is_number?this&t:this.$__coerced__("&",t)},E.$$arity=1),t.def(zt,"$|",x=function(t){return t.$$is_number?this|t:this.$__coerced__("|",t)},x.$$arity=1),t.def(zt,"$^",k=function(t){return t.$$is_number?this^t:this.$__coerced__("^",t)},k.$$arity=1),t.def(zt,"$<",A=function(t){return t.$$is_number?this<t:this.$__coerced__("<",t)},A.$$arity=1),t.def(zt,"$<=",M=function(t){return t.$$is_number?this<=t:this.$__coerced__("<=",t)},M.$$arity=1),t.def(zt,"$>",I=function(t){return t.$$is_number?this>t:this.$__coerced__(">",t)},I.$$arity=1),t.def(zt,"$>=",S=function(t){return t.$$is_number?this>=t:this.$__coerced__(">=",t)},S.$$arity=1);t.def(zt,"$<=>",N=function(e){try{return function(t,e){return e.$$is_number?isNaN(t)||isNaN(e)?l:t>e?1:t<e?-1:0:t.$__coerced__("<=>",e)}(this,e)}catch(e){if(!t.rescue(e,[c(qt,"ArgumentError")]))throw e;try{return l}finally{t.pop_exception()}}},N.$$arity=1),t.def(zt,"$<<",j=function(t){return(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int"))>0?this<<t:this>>-t},j.$$arity=1),t.def(zt,"$>>",R=function(t){return(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int"))>0?this>>t:this<<-t},R.$$arity=1),t.def(zt,"$[]",T=function(t){return(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int"))<0?0:t>=32?this<0?1:0:this>>t&1},T.$$arity=1),t.def(zt,"$+@",z=function(){return+this},z.$$arity=0),t.def(zt,"$-@",q=function(){return-this},q.$$arity=0),t.def(zt,"$~",C=function(){return~this},C.$$arity=0),t.def(zt,"$**",P=function(t){var n,i;return f(c(qt,"Integer")["$==="](t))?f(f(n=c(qt,"Integer")["$==="](this)["$!"]())?n:e(t,0))?Math.pow(this,t):c(qt,"Rational").$new(this,1)["$**"](t):f((n=r(this,0))?f(i=c(qt,"Float")["$==="](t))?i:c(qt,"Rational")["$==="](t):r(this,0))?c(qt,"Complex").$new(this,0)["$**"](t.$to_f()):f(null!=t.$$is_number)?Math.pow(this,t):this.$__coerced__("**",t)},P.$$arity=1),t.def(zt,"$===",F=function(t){return t.$$is_number?this.valueOf()===t.valueOf():!!t["$respond_to?"]("==")&&t["$=="](this)},F.$$arity=1),t.def(zt,"$==",D=function(t){return t.$$is_number?this.valueOf()===t.valueOf():!!t["$respond_to?"]("==")&&t["$=="](this)},D.$$arity=1),t.def(zt,"$abs",L=function(){return Math.abs(this)},L.$$arity=0),t.def(zt,"$abs2",B=function(){return Math.abs(this*this)},B.$$arity=0),t.def(zt,"$allbits?",U=function(t){return(this&(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int")))==t},U.$$arity=1),t.def(zt,"$anybits?",G=function(t){return 0!=(this&(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int")))},G.$$arity=1),t.def(zt,"$angle",H=function(){return f(this["$nan?"]())?this:0==this?1/this>0?0:Math.PI:this<0?Math.PI:0},H.$$arity=0),t.alias(zt,"arg","angle"),t.alias(zt,"phase","angle"),t.def(zt,"$bit_length",X=function(){if(f(c(qt,"Integer")["$==="](this))||this.$raise(c(qt,"NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length")),0===this||-1===this)return 0;for(var t=0,e=this<0?~this:this;0!=e;)t+=1,e>>>=1;return t},X.$$arity=0),t.def(zt,"$ceil",Y=function(t){null==t&&(t=0);var e=this.$to_f();if(e%1==0&&t>=0)return e;var r=Math.pow(10,t),n=Math.ceil(e*r)/r;return e%1==0&&(n=Math.round(n)),n},Y.$$arity=-1),t.def(zt,"$chr",K=function(t){return String.fromCharCode(this)},K.$$arity=-1),t.def(zt,"$denominator",V=function(){var e,r=V.$$p,n=this,i=l,$=l,a=l;for(r&&(V.$$p=null),$=0,a=arguments.length,i=new Array(a);$<a;$++)i[$]=arguments[$];return f(f(e=n["$nan?"]())?e:n["$infinite?"]())?1:d(n,t.find_super_dispatcher(n,"denominator",V,!1),i,r)},V.$$arity=0),t.def(zt,"$downto",Z=function(t){var r,$=Z.$$p,a=$||l;if($&&(Z.$$p=null),$&&(Z.$$p=null),a===l)return d(this,"enum_for",["downto",t],((r=function(){var $=null==r.$$s?this:r.$$s;return f(c(qt,"Numeric")["$==="](t))||$.$raise(c(qt,"ArgumentError"),"comparison of "+$.$class()+" with "+t.$class()+" failed"),f(e(t,$))?0:n(i($,t),1)}).$$s=this,r.$$arity=0,r));t.$$is_number||this.$raise(c(qt,"ArgumentError"),"comparison of "+this.$class()+" with "+t.$class()+" failed");for(var s=this;s>=t;s--)a(s);return this},Z.$$arity=1),t.alias(zt,"eql?","=="),t.def(zt,"$equal?",J=function(t){var e;return f(e=this["$=="](t))?e:isNaN(this)&&isNaN(t)},J.$$arity=1),t.def(zt,"$even?",Q=function(){return this%2==0},Q.$$arity=0),t.def(zt,"$floor",W=function(t){null==t&&(t=0);var e=this.$to_f();if(e%1==0&&t>=0)return e;var r=Math.pow(10,t),n=Math.floor(e*r)/r;return e%1==0&&(n=Math.round(n)),n},W.$$arity=-1),t.def(zt,"$gcd",tt=function(t){f(c(qt,"Integer")["$==="](t))||this.$raise(c(qt,"TypeError"),"not an integer");for(var e=Math.abs(this),r=Math.abs(t);e>0;){var n=e;e=r%e,r=n}return r},tt.$$arity=1),t.def(zt,"$gcdlcm",et=function(t){return[this.$gcd(t),this.$lcm(t)]},et.$$arity=1),t.def(zt,"$integer?",rt=function(){return this%1==0},rt.$$arity=0),t.def(zt,"$is_a?",nt=function(e){var r=nt.$$p,n=this,i=l,$=l,a=l;for(r&&(nt.$$p=null),$=0,a=arguments.length,i=new Array(a);$<a;$++)i[$]=arguments[$];return!!f(e["$=="](c(qt,"Integer"))?c(qt,"Integer")["$==="](n):e["$=="](c(qt,"Integer")))||(!!f(e["$=="](c(qt,"Integer"))?c(qt,"Integer")["$==="](n):e["$=="](c(qt,"Integer")))||(!!f(e["$=="](c(qt,"Float"))?c(qt,"Float")["$==="](n):e["$=="](c(qt,"Float")))||d(n,t.find_super_dispatcher(n,"is_a?",nt,!1),i,r)))},nt.$$arity=1),t.alias(zt,"kind_of?","is_a?"),t.def(zt,"$instance_of?",it=function(e){var r=it.$$p,n=this,i=l,$=l,a=l;for(r&&(it.$$p=null),$=0,a=arguments.length,i=new Array(a);$<a;$++)i[$]=arguments[$];return!!f(e["$=="](c(qt,"Integer"))?c(qt,"Integer")["$==="](n):e["$=="](c(qt,"Integer")))||(!!f(e["$=="](c(qt,"Integer"))?c(qt,"Integer")["$==="](n):e["$=="](c(qt,"Integer")))||(!!f(e["$=="](c(qt,"Float"))?c(qt,"Float")["$==="](n):e["$=="](c(qt,"Float")))||d(n,t.find_super_dispatcher(n,"instance_of?",it,!1),i,r)))},it.$$arity=1),t.def(zt,"$lcm",$t=function(t){return f(c(qt,"Integer")["$==="](t))||this.$raise(c(qt,"TypeError"),"not an integer"),0==this||0==t?0:Math.abs(this*t/this.$gcd(t))},$t.$$arity=1),t.alias(zt,"magnitude","abs"),t.alias(zt,"modulo","%"),t.def(zt,"$next",at=function(){return this+1},at.$$arity=0),t.def(zt,"$nobits?",st=function(t){return 0==(this&(t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int")))},st.$$arity=1),t.def(zt,"$nonzero?",ot=function(){return 0==this?l:this},ot.$$arity=0),t.def(zt,"$numerator",lt=function(){var e,r=lt.$$p,n=this,i=l,$=l,a=l;for(r&&(lt.$$p=null),$=0,a=arguments.length,i=new Array(a);$<a;$++)i[$]=arguments[$];return f(f(e=n["$nan?"]())?e:n["$infinite?"]())?n:d(n,t.find_super_dispatcher(n,"numerator",lt,!1),i,r)},lt.$$arity=0),t.def(zt,"$odd?",ut=function(){return this%2!=0},ut.$$arity=0),t.def(zt,"$ord",ct=function(){return this},ct.$$arity=0),t.def(zt,"$pow",ht=function(t,e){return 0==this&&this.$raise(c(qt,"ZeroDivisionError"),"divided by 0"),void 0===e?this["$**"](t):(c(qt,"Integer")["$==="](t)||this.$raise(c(qt,"TypeError"),"Integer#pow() 2nd argument not allowed unless a 1st argument is integer"),t<0&&this.$raise(c(qt,"TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified"),c(qt,"Integer")["$==="](e)||this.$raise(c(qt,"TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers"),0===e&&this.$raise(c(qt,"ZeroDivisionError"),"divided by 0"),this["$**"](t)["$%"](e))},ht.$$arity=-2),t.def(zt,"$pred",ft=function(){return this-1},ft.$$arity=0),t.def(zt,"$quo",dt=function(e){var r=dt.$$p,n=this,i=l,a=l,s=l;for(r&&(dt.$$p=null),a=0,s=arguments.length,i=new Array(s);a<s;a++)i[a]=arguments[a];return f(c(qt,"Integer")["$==="](n))?d(n,t.find_super_dispatcher(n,"quo",dt,!1),i,r):$(n,e)},dt.$$arity=1),t.def(zt,"$rationalize",pt=function(e){var r,n,$=this,s=l,o=l;return arguments.length>1&&$.$raise(c(qt,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)"),f(c(qt,"Integer")["$==="]($))?c(qt,"Rational").$new($,1):f($["$infinite?"]())?$.$raise(c(qt,"FloatDomainError"),"Infinity"):f($["$nan?"]())?$.$raise(c(qt,"FloatDomainError"),"NaN"):f(null==e)?(n=c(qt,"Math").$frexp($),s=null==(r=t.to_ary(n))[0]?l:r[0],o=null==r[1]?l:r[1],s=c(qt,"Math").$ldexp(s,u(c(qt,"Float"),"MANT_DIG")).$to_i(),o=i(o,u(c(qt,"Float"),"MANT_DIG")),c(qt,"Rational").$new(a(2,s),1["$<<"](i(1,o))).$rationalize(c(qt,"Rational").$new(1,1["$<<"](i(1,o))))):$.$to_r().$rationalize(e)},pt.$$arity=-1),t.def(zt,"$remainder",_t=function(t){return i(this,a(t,$(this,t).$truncate()))},_t.$$arity=1),t.def(zt,"$round",yt=function(a){var s,o,h,d,p=l;if(f(c(qt,"Integer")["$==="](this))){if(f(null==a))return this;if(f(f(s=c(qt,"Float")["$==="](a))?a["$infinite?"]():s)&&this.$raise(c(qt,"RangeError"),"Infinity"),a=c(qt,"Opal")["$coerce_to!"](a,c(qt,"Integer"),"to_int"),f(r(a,u(c(qt,"Integer"),"MIN")))&&this.$raise(c(qt,"RangeError"),"out of bounds"),f(a>=0))return this;if(.415241*(a=a["$-@"]())-.125>this.$size())return 0;var _=Math.pow(10,a),y=Math.floor((Math.abs(y)+_/2)/_)*_;return this<0?-y:y}if(f(f(s=this["$nan?"]())?null==a:s)&&this.$raise(c(qt,"FloatDomainError"),"NaN"),a=c(qt,"Opal")["$coerce_to!"](a||0,c(qt,"Integer"),"to_int"),f((d=0,"number"==typeof(h=a)&&"number"==typeof d?h<=d:h["$<="](d))))f(this["$nan?"]())?this.$raise(c(qt,"RangeError"),"NaN"):f(this["$infinite?"]())&&this.$raise(c(qt,"FloatDomainError"),"Infinity");else{if(a["$=="](0))return Math.round(this);if(f(f(s=this["$nan?"]())?s:this["$infinite?"]()))return this}return o=c(qt,"Math").$frexp(this),null==(s=t.to_ary(o))[0]?l:s[0],p=null==s[1]?l:s[1],f(function(t,e){return"number"==typeof t&&"number"==typeof e?t>=e:t["$>="](e)}(a,i(n(u(c(qt,"Float"),"DIG"),2),f(e(p,0))?$(p,4):i($(p,3),1))))?this:f(r(a,(f(e(p,0))?n($(p,3),1):$(p,4))["$-@"]()))?0:Math.round(this*Math.pow(10,a))/Math.pow(10,a)},yt.$$arity=-1),t.def(zt,"$step",gt=function(e,r,n){var i,$,a,s,o,h,f,_=gt.$$p,y=_||l,g=this,m=l,v=l;if(_&&(gt.$$p=null),_&&(gt.$$p=null),i=t.slice.call(arguments,0,arguments.length),null==($=t.extract_kwargs(i)))$=p([],{});else if(!$.$$is_hash)throw t.ArgumentError.$new("expected kwargs");function b(){void 0!==o&&(a=o),void 0===a&&(a=l),s===l&&g.$raise(c(qt,"TypeError"),"step must be numeric"),0===s&&g.$raise(c(qt,"ArgumentError"),"step can't be 0"),void 0!==h&&(s=h),s!==l&&null!=s||(s=1);var t=s["$<=>"](0);t===l&&g.$raise(c(qt,"ArgumentError"),"0 can't be coerced into "+s.$class()),a!==l&&null!=a||(a=t>0?u(c(qt,"Float"),"INFINITY"):u(c(qt,"Float"),"INFINITY")["$-@"]()),c(qt,"Opal").$compare(g,a)}function O(){if(s>0&&g>a||s<0&&g<a)return 0;if(s===1/0||s===-1/0)return 1;var t=Math.abs,e=Math.floor,r=(t(g)+t(a)+t(a-g))/t(s)*u(c(qt,"Float"),"EPSILON");return r===1/0||r===-1/0?0:(r>.5&&(r=.5),e((a-g)/s+r)+1)}function w(){if(b(),0===s)return 1/0;if(s%1!=0)return O();if(s>0&&g>a||s<0&&g<a)return 0;var t=Math.ceil,e=Math.abs;return t((e(g-a)+1)/e(s))}if(i.length>0&&(a=i[0],i.splice(0,1)),i.length>0&&(s=i[0],i.splice(0,1)),o=$.$$smap.to,h=$.$$smap.by,void 0!==a&&void 0!==o&&g.$raise(c(qt,"ArgumentError"),"to is given twice"),void 0!==s&&void 0!==h&&g.$raise(c(qt,"ArgumentError"),"step is given twice"),y===l)return m=[],v=p([],{}),void 0!==a&&m.push(a),void 0!==s&&m.push(s),void 0!==o&&t.hash_put(v,"to",o),void 0!==h&&t.hash_put(v,"by",h),v["$any?"]()&&m.push(v),d(g,"enum_for",["step"].concat(t.to_a(m)),((f=function(){null==f.$$s||f.$$s;return w()}).$$s=g,f.$$arity=0,f));if(b(),0===s)for(;;)y(g);if(g%1!=0||a%1!=0||s%1!=0){var E=O();if(E>0)if(s===1/0||s===-1/0)y(g);else{var x,k=0;if(s>0)for(;k<E;)a<(x=k*s+g)&&(x=a),y(x),k+=1;else for(;k<E;)a>(x=k*s+g)&&(x=a),y(x),k+=1}}else{var A=g;if(s>0)for(;A<=a;)y(A),A+=s;else for(;A>=a;)y(A),A+=s}return g},gt.$$arity=-1),t.alias(zt,"succ","next"),t.def(zt,"$times",mt=function(){var t,e=mt.$$p,r=e||l;if(e&&(mt.$$p=null),e&&(mt.$$p=null),!f(r))return d(this,"enum_for",["times"],((t=function(){return null==t.$$s?this:t.$$s}).$$s=this,t.$$arity=0,t));for(var n=0;n<this;n++)r(n);return this},mt.$$arity=0),t.def(zt,"$to_f",vt=function(){return this},vt.$$arity=0),t.def(zt,"$to_i",bt=function(){return parseInt(this,10)},bt.$$arity=0),t.alias(zt,"to_int","to_i"),t.def(zt,"$to_r",Ot=function(){var e,r,n=l,$=l;return f(c(qt,"Integer")["$==="](this))?c(qt,"Rational").$new(this,1):(r=c(qt,"Math").$frexp(this),n=null==(e=t.to_ary(r))[0]?l:e[0],$=null==e[1]?l:e[1],n=c(qt,"Math").$ldexp(n,u(c(qt,"Float"),"MANT_DIG")).$to_i(),$=i($,u(c(qt,"Float"),"MANT_DIG")),a(n,u(c(qt,"Float"),"RADIX")["$**"]($)).$to_r())},Ot.$$arity=0),t.def(zt,"$to_s",wt=function(t){var n;return null==t&&(t=10),t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int"),f(f(n=r(t,2))?n:e(t,36))&&this.$raise(c(qt,"ArgumentError"),"invalid radix "+t),this.toString(t)},wt.$$arity=-1),t.def(zt,"$truncate",Et=function(t){null==t&&(t=0);var e=this.$to_f();if(e%1==0&&t>=0)return e;var r=Math.pow(10,t),n=parseInt(e*r,10)/r;return e%1==0&&(n=Math.round(n)),n},Et.$$arity=-1),t.alias(zt,"inspect","to_s"),t.def(zt,"$digits",xt=function(t){if(null==t&&(t=10),r(this,0)&&this.$raise(u(c(qt,"Math"),"DomainError"),"out of domain"),t=c(qt,"Opal")["$coerce_to!"](t,c(qt,"Integer"),"to_int"),f(r(t,2))&&this.$raise(c(qt,"ArgumentError"),"invalid radix "+t),0===this)return[0];for(var e=this,n=[];0!==e;)n.push(e%t),e=parseInt(e/t,10);return n},xt.$$arity=-1),t.def(zt,"$divmod",kt=function(e){var r,n=kt.$$p,i=this,$=l,a=l,s=l;for(n&&(kt.$$p=null),a=0,s=arguments.length,$=new Array(s);a<s;a++)$[a]=arguments[a];return f(f(r=i["$nan?"]())?r:e["$nan?"]())?i.$raise(c(qt,"FloatDomainError"),"NaN"):f(i["$infinite?"]())?i.$raise(c(qt,"FloatDomainError"),"Infinity"):d(i,t.find_super_dispatcher(i,"divmod",kt,!1),$,n)},kt.$$arity=1),t.def(zt,"$upto",At=function(t){var e,$=At.$$p,a=$||l;if($&&(At.$$p=null),$&&(At.$$p=null),a===l)return d(this,"enum_for",["upto",t],((e=function(){var $=null==e.$$s?this:e.$$s;return f(c(qt,"Numeric")["$==="](t))||$.$raise(c(qt,"ArgumentError"),"comparison of "+$.$class()+" with "+t.$class()+" failed"),f(r(t,$))?0:n(i(t,$),1)}).$$s=this,e.$$arity=0,e));t.$$is_number||this.$raise(c(qt,"ArgumentError"),"comparison of "+this.$class()+" with "+t.$class()+" failed");for(var s=this;s<=t;s++)a(s);return this},At.$$arity=1),t.def(zt,"$zero?",Mt=function(){return 0==this},Mt.$$arity=0),t.def(zt,"$size",It=function(){return 4},It.$$arity=0),t.def(zt,"$nan?",St=function(){return isNaN(this)},St.$$arity=0),t.def(zt,"$finite?",Nt=function(){return this!=1/0&&this!=-1/0&&!isNaN(this)},Nt.$$arity=0),t.def(zt,"$infinite?",jt=function(){return this==1/0?1:this==-1/0?-1:l},jt.$$arity=0),t.def(zt,"$positive?",Rt=function(){return 0!=this&&(this==1/0||1/this>0)},Rt.$$arity=0),t.def(zt,"$negative?",Tt=function(){return this==-1/0||1/this<0},Tt.$$arity=0)}(o[0],c(o,"Numeric"),o),t.const_set(o[0],"Fixnum",c(o,"Number")),function(e,r,n){var i=h(e,r,"Integer"),$=[i].concat(n);Object.defineProperty(i,"$$is_number_class",{value:!0}),function(e,r){var n,i,$,a=[e].concat(r);t.def(e,"$allocate",n=function(){return this.$raise(c(a,"TypeError"),"allocator undefined for "+this.$name())},n.$$arity=0),t.udef(e,"$new"),t.def(e,"$===",i=function(t){return!!t.$$is_number&&t%1==0},i.$$arity=1),t.def(e,"$sqrt",$=function(t){return(t=c(a,"Opal")["$coerce_to!"](t,c(a,"Integer"),"to_int"))<0&&this.$raise(u(c(a,"Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"'),parseInt(Math.sqrt(t),10)},$.$$arity=1)}(t.get_singleton_class(i),$),t.const_set($[0],"MAX",Math.pow(2,30)-1),t.const_set($[0],"MIN",-Math.pow(2,30))}(o[0],c(o,"Numeric"),o),function(e,r,n){var i=h(e,r,"Float"),$=[i].concat(n);return Object.defineProperty(i,"$$is_number_class",{value:!0}),function(e,r){var n,i,$=[e].concat(r);t.def(e,"$allocate",n=function(){return this.$raise(c($,"TypeError"),"allocator undefined for "+this.$name())},n.$$arity=0),t.udef(e,"$new"),t.def(e,"$===",i=function(t){return!!t.$$is_number},i.$$arity=1)}(t.get_singleton_class(i),$),t.const_set($[0],"INFINITY",1/0),t.const_set($[0],"MAX",Number.MAX_VALUE),t.const_set($[0],"MIN",Number.MIN_VALUE),t.const_set($[0],"NAN",NaN),t.const_set($[0],"DIG",15),t.const_set($[0],"MANT_DIG",53),t.const_set($[0],"RADIX",2),t.const_set($[0],"EPSILON",Number.EPSILON||2220446049250313e-31)}(o[0],c(o,"Numeric"),o)}};void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_();var O=function(){global.Opal.modules["corelib/range"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t<=e:t["$<="](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}var $=t.top,a=[],s=t.nil,o=t.const_get_qualified,l=t.const_get_relative,u=(t.breaker,t.slice,t.klass),c=t.truthy,h=t.send;return t.add_stubs(["$require","$include","$attr_reader","$raise","$<=>","$include?","$<=","$<","$enum_for","$upto","$to_proc","$respond_to?","$class","$succ","$!","$==","$===","$exclude_end?","$eql?","$begin","$end","$last","$to_a","$>","$-","$abs","$to_i","$coerce_to!","$ceil","$/","$size","$loop","$+","$*","$>=","$each_with_index","$%","$bsearch","$inspect","$[]","$hash"]),$.$require("corelib/enumerable"),function($,a,f){var d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j=u($,null,"Range"),R=[j].concat(f);return j.$$prototype.begin=j.$$prototype.end=j.$$prototype.excl=s,j.$include(l(R,"Enumerable")),j.$$prototype.$$is_range=!0,j.$attr_reader("begin","end"),t.def(j,"$initialize",d=function(t,e,r){return null==r&&(r=!1),c(this.begin)&&this.$raise(l(R,"NameError"),"'initialize' called twice"),c(t["$<=>"](e))||this.$raise(l(R,"ArgumentError"),"bad value for range"),this.begin=t,this.end=e,this.excl=r},d.$$arity=-3),t.def(j,"$==",p=function(t){return!!t.$$is_range&&(this.excl===t.excl&&this.begin==t.begin&&this.end==t.end)},p.$$arity=1),t.def(j,"$===",_=function(t){return this["$include?"](t)},_.$$arity=1),t.def(j,"$cover?",y=function(t){var n,i,$;return i=this.begin["$<=>"](t),!!c(c(n=i)?e(i,0):n)&&($=t["$<=>"](this.end),c(this.excl)?c(n=$)?r($,0):n:c(n=$)?e($,0):n)},y.$$arity=1),t.def(j,"$each",g=function(){var e,n,i,$,a=g.$$p,o=a||s,u=this,f=s;if(a&&(g.$$p=null),a&&(g.$$p=null),o===s)return u.$enum_for("each");if(u.begin.$$is_number&&u.end.$$is_number){for(u.begin%1==0&&u.end%1==0||u.$raise(l(R,"TypeError"),"can't iterate from Float"),i=u.begin,$=u.end+(c(u.excl)?0:1);i<$;i++)o(i);return u}if(u.begin.$$is_string&&u.end.$$is_string)return h(u.begin,"upto",[u.end,u.excl],o.$to_proc()),u;for(f=u.begin,n=u.end,c(f["$respond_to?"]("succ"))||u.$raise(l(R,"TypeError"),"can't iterate from "+f.$class());c(r(f["$<=>"](n),0));)t.yield1(o,f),f=f.$succ();return c(c(e=u.excl["$!"]())?f["$=="](n):e)&&t.yield1(o,f),u},g.$$arity=0),t.def(j,"$eql?",m=function(t){var e,r;return!!c(l(R,"Range")["$==="](t))&&(c(e=c(r=this.excl["$==="](t["$exclude_end?"]()))?this.begin["$eql?"](t.$begin()):r)?this.end["$eql?"](t.$end()):e)},m.$$arity=1),t.def(j,"$exclude_end?",v=function(){return this.excl},v.$$arity=0),t.def(j,"$first",b=function(e){var r=b.$$p,n=this,i=s,$=s,a=s;for(r&&(b.$$p=null),$=0,a=arguments.length,i=new Array(a);$<a;$++)i[$]=arguments[$];return c(null==e)?n.begin:h(n,t.find_super_dispatcher(n,"first",b,!1),i,r)},b.$$arity=-1),t.alias(j,"include?","cover?"),t.def(j,"$last",O=function(t){return c(null==t)?this.end:this.$to_a().$last(t)},O.$$arity=-1),t.def(j,"$max",w=function(){var e,r=w.$$p,i=r||s,$=this,a=s,o=s,l=s;for(r&&(w.$$p=null),o=0,l=arguments.length,a=new Array(l);o<l;o++)a[o]=arguments[o];return i!==s?h($,t.find_super_dispatcher($,"max",w,!1),a,r):c(n($.begin,$.end))?s:c(c(e=$.excl)?$.begin["$=="]($.end):e)?s:$.excl?$.end-1:$.end},w.$$arity=0),t.alias(j,"member?","cover?"),t.def(j,"$min",E=function(){var e,r=E.$$p,i=r||s,$=this,a=s,o=s,l=s;for(r&&(E.$$p=null),o=0,l=arguments.length,a=new Array(l);o<l;o++)a[o]=arguments[o];return i!==s?h($,t.find_super_dispatcher($,"min",E,!1),a,r):c(n($.begin,$.end))?s:c(c(e=$.excl)?$.begin["$=="]($.end):e)?s:$.begin},E.$$arity=0),t.def(j,"$size",x=function(){var t,e,n,i,$=s,a=s;return $=this.begin,a=this.end,c(this.excl)&&(i=1,a="number"==typeof(n=a)&&"number"==typeof i?n-i:n["$-"](i)),c(c(t=l(R,"Numeric")["$==="]($))?l(R,"Numeric")["$==="](a):t)?c(r(a,$))?0:(e=o(l(R,"Float"),"INFINITY"),c([$.$abs(),a.$abs()]["$include?"](e))?e:(Math.abs(a-$)+1).$to_i()):s},x.$$arity=0),t.def(j,"$step",k=function(e){var r,$,a,u=k.$$p,f=u||s,d=this,p=s;function _(){e.$$is_number||(e=l(R,"Opal")["$coerce_to!"](e,l(R,"Integer"),"to_int")),e<0?d.$raise(l(R,"ArgumentError"),"step can't be negative"):0===e&&d.$raise(l(R,"ArgumentError"),"step can't be 0")}function y(){if(!d.begin["$respond_to?"]("succ"))return s;if(d.begin.$$is_string&&d.end.$$is_string)return s;if(e%1==0)return(r=d.$size(),n=e,"number"==typeof r&&"number"==typeof n?r/n:r["$/"](n)).$ceil();var t,r,n,i=d.begin,$=d.end,a=Math.abs,u=Math.floor,c=(a(i)+a($)+a($-i))/a(e)*o(l(R,"Float"),"EPSILON");return c>.5&&(c=.5),d.excl?(t=u(($-i)/e-c))*e+i<$&&t++:t=u(($-i)/e+c)+1,t}return u&&(k.$$p=null),null==e&&(e=1),f===s?h(d,"enum_for",["step",e],((r=function(){null==r.$$s||r.$$s;return _(),y()}).$$s=d,r.$$arity=0,r)):(_(),c(d.begin.$$is_number&&d.end.$$is_number)?(p=0,function(){var r=t.new_brk();try{h(d,"loop",[],(($=function(){var a,o,l,u=null==$.$$s?this:$.$$s;return null==u.begin&&(u.begin=s),null==u.excl&&(u.excl=s),null==u.end&&(u.end=s),a=i(u.begin,(l=e,"number"==typeof(o=p)&&"number"==typeof l?o*l:o["$*"](l))),c(u.excl)?c(function(t,e){return"number"==typeof t&&"number"==typeof e?t>=e:t["$>="](e)}(a,u.end))&&t.brk(s,r):c(n(a,u.end))&&t.brk(s,r),t.yield1(f,a),p=i(p,1)}).$$s=d,$.$$brk=r,$.$$arity=0,$))}catch(t){if(t===r)return t.$v;throw t}}()):(d.begin.$$is_string&&d.end.$$is_string&&e%1!=0&&d.$raise(l(R,"TypeError"),"no implicit conversion to float from string"),h(d,"each_with_index",[],((a=function(r,n){null==a.$$s||a.$$s;return null==r&&(r=s),null==n&&(n=s),n["$%"](e)["$=="](0)?t.yield1(f,r):s}).$$s=d,a.$$arity=2,a))),d)},k.$$arity=-1),t.def(j,"$bsearch",A=function(){var t=A.$$p,e=t||s;return t&&(A.$$p=null),t&&(A.$$p=null),e===s?this.$enum_for("bsearch"):(c(this.begin.$$is_number&&this.end.$$is_number)||this.$raise(l(R,"TypeError"),"can't do binary search for "+this.begin.$class()),h(this.$to_a(),"bsearch",[],e.$to_proc()))},A.$$arity=0),t.def(j,"$to_s",M=function(){var t=this;return t.begin+(c(t.excl)?"...":"..")+t.end},M.$$arity=0),t.def(j,"$inspect",I=function(){var t=this;return t.begin.$inspect()+(c(t.excl)?"...":"..")+t.end.$inspect()},I.$$arity=0),t.def(j,"$marshal_load",S=function(t){return this.begin=t["$[]"]("begin"),this.end=t["$[]"]("end"),this.excl=t["$[]"]("excl")},S.$$arity=1),t.def(j,"$hash",N=function(){return[this.begin,this.end,this.excl].$hash()},N.$$arity=0),s&&"hash"}(a[0],0,a)}};var w=function(){global.Opal.modules["corelib/proc"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice),$=t.klass,a=t.truthy;return t.add_stubs(["$raise","$coerce_to!"]),function(e,s,o){var l,u,c,h,f,d,p,_,y,g,m=$(e,s,"Proc"),v=[m].concat(o);return t.defineProperty(m.$$prototype,"$$is_proc",!0),t.defineProperty(m.$$prototype,"$$is_lambda",!1),t.defs(m,"$new",l=function(){var t=l.$$p,e=t||r;return t&&(l.$$p=null),t&&(l.$$p=null),a(e)||this.$raise(n(v,"ArgumentError"),"tried to create a Proc object without a block"),e},l.$$arity=0),t.def(m,"$call",u=function(e){var n,i=u.$$p,$=i||r,a=this;i&&(u.$$p=null),i&&(u.$$p=null),n=t.slice.call(arguments,0,arguments.length),$!==r&&(a.$$p=$);var s,o=a.$$brk;if(o)try{s=a.$$is_lambda?a.apply(null,n):t.yieldX(a,n)}catch(t){if(t===o)return o.$v;throw t}else s=a.$$is_lambda?a.apply(null,n):t.yieldX(a,n);return s},u.$$arity=-1),t.alias(m,"[]","call"),t.alias(m,"===","call"),t.alias(m,"yield","call"),t.def(m,"$to_proc",c=function(){return this},c.$$arity=0),t.def(m,"$lambda?",h=function(){return!!this.$$is_lambda},h.$$arity=0),t.def(m,"$arity",f=function(){return this.$$is_curried?-1:this.$$arity},f.$$arity=0),t.def(m,"$source_location",d=function(){return this.$$is_curried,r},d.$$arity=0),t.def(m,"$binding",p=function(){return this.$$is_curried&&this.$raise(n(v,"ArgumentError"),"Can't create Binding"),r},p.$$arity=0),t.def(m,"$parameters",_=function(){if(this.$$is_curried)return[["rest"]];if(this.$$parameters){if(this.$$is_lambda)return this.$$parameters;var t,e,r=[];for(t=0,e=this.$$parameters.length;t<e;t++){var n=this.$$parameters[t];"req"===n[0]&&(n=["opt",n[1]]),r.push(n)}return r}return[]},_.$$arity=0),t.def(m,"$curry",y=function(t){var e=this;function r(){var $,a=i.call(arguments),s=a.length;return s>t&&e.$$is_lambda&&!e.$$is_curried&&e.$raise(n(v,"ArgumentError"),"wrong number of arguments ("+s+" for "+t+")"),s>=t?e.$call.apply(e,a):(($=function(){return r.apply(null,a.concat(i.call(arguments)))}).$$is_lambda=e.$$is_lambda,$.$$is_curried=!0,$)}return void 0===t?t=e.length:(t=n(v,"Opal")["$coerce_to!"](t,n(v,"Integer"),"to_int"),e.$$is_lambda&&t!==e.length&&e.$raise(n(v,"ArgumentError"),"wrong number of arguments ("+t+" for "+e.length+")")),r.$$is_lambda=e.$$is_lambda,r.$$is_curried=!0,r},y.$$arity=-1),t.def(m,"$dup",g=function(){var t=this.$$original_proc||this,e=function(){return t.apply(this,arguments)};for(var r in this)this.hasOwnProperty(r)&&(e[r]=this[r]);return e},g.$$arity=0),t.alias(m,"clone","dup")}(e[0],Function,e)}};var E=function(){global.Opal.modules["corelib/method"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.truthy;return t.add_stubs(["$attr_reader","$arity","$new","$class","$join","$source_location","$raise"]),function(e,a,s){var o,l,u,c,h,f,d,p,_,y=i(e,null,"Method"),g=[y].concat(s);y.$$prototype.method=y.$$prototype.receiver=y.$$prototype.owner=y.$$prototype.name=r,y.$attr_reader("owner","receiver","name"),t.def(y,"$initialize",o=function(t,e,r,n){return this.receiver=t,this.owner=e,this.name=n,this.method=r},o.$$arity=4),t.def(y,"$arity",l=function(){return this.method.$arity()},l.$$arity=0),t.def(y,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0),t.def(y,"$source_location",c=function(){var t;return $(t=this.method.$$source_location)?t:["(eval)",0]},c.$$arity=0),t.def(y,"$comments",h=function(){var t;return $(t=this.method.$$comments)?t:[]},h.$$arity=0),t.def(y,"$call",f=function(e){var n,i=f.$$p,$=i||r,a=this;return i&&(f.$$p=null),i&&(f.$$p=null),n=t.slice.call(arguments,0,arguments.length),a.method.$$p=$,a.method.apply(a.receiver,n)},f.$$arity=-1),t.alias(y,"[]","call"),t.def(y,"$unbind",d=function(){return n(g,"UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)},d.$$arity=0),t.def(y,"$to_proc",p=function(){var t=this.$call.bind(this);return t.$$unbound=this.method,t.$$is_lambda=!0,t.$$arity=this.method.$$arity,t.$$parameters=this.method.$$parameters,t},p.$$arity=0),t.def(y,"$inspect",_=function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},_.$$arity=0)}(e[0],0,e),function(e,a,s){var o,l,u,c,h,f,d,p=i(e,null,"UnboundMethod"),_=[p].concat(s);return p.$$prototype.method=p.$$prototype.owner=p.$$prototype.name=p.$$prototype.source=r,p.$attr_reader("source","owner","name"),t.def(p,"$initialize",o=function(t,e,r,n){return this.source=t,this.owner=e,this.method=r,this.name=n},o.$$arity=4),t.def(p,"$arity",l=function(){return this.method.$arity()},l.$$arity=0),t.def(p,"$parameters",u=function(){return this.method.$$parameters},u.$$arity=0),t.def(p,"$source_location",c=function(){var t;return $(t=this.method.$$source_location)?t:["(eval)",0]},c.$$arity=0),t.def(p,"$comments",h=function(){var t;return $(t=this.method.$$comments)?t:[]},h.$$arity=0),t.def(p,"$bind",f=function(e){if(this.owner.$$is_module||t.is_a(e,this.owner))return n(_,"Method").$new(e,this.owner,this.method,this.name);this.$raise(n(_,"TypeError"),"can't bind singleton method to a different class (expected "+e+".kind_of?("+this.owner+" to be true)")},f.$$arity=1),t.def(p,"$inspect",d=function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"},d.$$arity=0),r&&"inspect"}(e[0],0,e)}};var x=function(){global.Opal.modules["corelib/variables"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.gvars),$=t.hash2;return t.add_stubs(["$new"]),i["&"]=i["~"]=i["`"]=i["'"]=r,i.LOADED_FEATURES=i['"']=t.loaded_features,i.LOAD_PATH=i[":"]=[],i["/"]="\n",i[","]=r,t.const_set(e[0],"ARGV",[]),t.const_set(e[0],"ARGF",n(e,"Object").$new()),t.const_set(e[0],"ENV",$([],{})),i.VERBOSE=!1,i.DEBUG=!1,i.SAFE=0}},k=r(5);void 0===global.Opal.modules["opal/base"]&&"function"==typeof u&&u(),void 0===global.Opal.modules["corelib/nil"]&&"function"==typeof c&&c(),void 0===global.Opal.modules["corelib/boolean"]&&"function"==typeof h&&h(),void 0===global.Opal.modules["corelib/string"]&&"function"==typeof p&&p(),void 0===global.Opal.modules["corelib/comparable"]&&"function"==typeof f.a&&Object(f.a)(),void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_(),void 0===global.Opal.modules["corelib/enumerator"]&&"function"==typeof y&&y(),void 0===global.Opal.modules["corelib/array"]&&"function"==typeof m&&m(),void 0===global.Opal.modules["corelib/hash"]&&"function"==typeof v&&v(),void 0===global.Opal.modules["corelib/number"]&&"function"==typeof b&&b(),void 0===global.Opal.modules["corelib/range"]&&"function"==typeof O&&O(),void 0===global.Opal.modules["corelib/proc"]&&"function"==typeof w&&w(),void 0===global.Opal.modules["corelib/method"]&&"function"==typeof E&&E(),void 0===global.Opal.modules["corelib/regexp"]&&"function"==typeof d&&d(),void 0===global.Opal.modules["corelib/variables"]&&"function"==typeof x&&x(),void 0===global.Opal.modules["opal/regexp_anchors"]&&"function"==typeof k.a&&Object(k.a)();var A=function(){global.Opal.modules["opal/mini"]=function(t){var e=t.top;t.nil,t.const_get_qualified,t.const_get_relative,t.breaker,t.slice;return t.add_stubs(["$require"]),e.$require("opal/base"),e.$require("corelib/nil"),e.$require("corelib/boolean"),e.$require("corelib/string"),e.$require("corelib/comparable"),e.$require("corelib/enumerable"),e.$require("corelib/enumerator"),e.$require("corelib/array"),e.$require("corelib/hash"),e.$require("corelib/number"),e.$require("corelib/range"),e.$require("corelib/proc"),e.$require("corelib/method"),e.$require("corelib/regexp"),e.$require("corelib/variables"),e.$require("opal/regexp_anchors")}};var M=function(){global.Opal.modules["corelib/kernel/format"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.module),$=t.truthy,a=t.gvars;return t.add_stubs(["$==","$length","$respond_to?","$[]","$coerce_to?","$nil?","$to_a","$raise","$to_int","$fetch","$Integer","$Float","$to_ary","$to_str","$coerce_to","$inspect","$to_s"]),function(e,s){var o,l=i(e,"Kernel"),u=[l].concat(s);t.def(l,"$format",o=function(e,i){var s,o,l=this,c=r;null==a.DEBUG&&(a.DEBUG=r),s=t.slice.call(arguments,1,arguments.length),$((o=s).$length()["$=="](1)?o["$[]"](0)["$respond_to?"]("to_ary"):o.$length()["$=="](1))&&(c=n(u,"Opal")["$coerce_to?"](o["$[]"](0),n(u,"Array"),"to_ary"),$(c["$nil?"]())||(o=c.$to_a()));var h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M="",I=0,S=e.length,N=1,j=0,R=0,T=1,z=2,q=4,C=8,P=16,F=32,D=64,L=128;function B(){A&F&&l.$raise(n(u,"ArgumentError"),"flag after width"),A&L&&l.$raise(n(u,"ArgumentError"),"flag after precision")}function U(){A&F&&l.$raise(n(u,"ArgumentError"),"width given twice"),A&L&&l.$raise(n(u,"ArgumentError"),"width after precision")}function G(t){return t>=o.length&&l.$raise(n(u,"ArgumentError"),"too few arguments"),o[t]}function H(){switch(j){case-1:l.$raise(n(u,"ArgumentError"),"unnumbered("+N+") mixed with numbered");case-2:l.$raise(n(u,"ArgumentError"),"unnumbered("+N+") mixed with named")}return G((j=N++)-1)}function X(t){return j>0&&l.$raise(n(u,"ArgumentError"),"numbered("+t+") after unnumbered("+j+")"),-2===j&&l.$raise(n(u,"ArgumentError"),"numbered("+t+") after named"),t<1&&l.$raise(n(u,"ArgumentError"),"invalid index - "+t+"$"),j=-1,G(t-1)}function Y(){return void 0===k?H():k}function K(t){for(var r,i="";;f++){if(f===S&&l.$raise(n(u,"ArgumentError"),"malformed format string - %*[0-9]"),e.charCodeAt(f)<48||e.charCodeAt(f)>57)return f--,(r=parseInt(i,10)||0)>2147483647&&l.$raise(n(u,"ArgumentError"),t+" too big"),r;i+=e.charAt(f)}}function V(t){var r,n=K(t);return"$"===e.charAt(f+1)?(f++,r=X(n)):r=H(),r.$to_int()}for(f=e.indexOf("%");-1!==f;f=e.indexOf("%",f)){switch(p=void 0,A=R,y=-1,g=-1,k=void 0,h=f,f++,e.charAt(f)){case"%":I=f;case"":case"\n":case"\0":f++;continue}t:for(;f<S;f++)switch(e.charAt(f)){case" ":B(),A|=P;continue t;case"#":B(),A|=T;continue t;case"+":B(),A|=q;continue t;case"-":B(),A|=z;continue t;case"0":B(),A|=C;continue t;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(m=K("width"),"$"===e.charAt(f+1)){if(f+2===S){p="%",f++;break t}void 0!==k&&l.$raise(n(u,"ArgumentError"),"value given twice - %"+m+"$"),k=X(m),f++}else U(),A|=F,y=m;continue t;case"<":case"{":for(b="<"===e.charAt(f)?">":"}",v="",f++;;f++){if(f===S&&l.$raise(n(u,"ArgumentError"),"malformed name - unmatched parenthesis"),e.charAt(f)===b){if(j>0&&l.$raise(n(u,"ArgumentError"),"named "+v+" after unnumbered("+j+")"),-1===j&&l.$raise(n(u,"ArgumentError"),"named "+v+" after numbered"),j=-2,void 0!==o[0]&&o[0].$$is_hash||l.$raise(n(u,"ArgumentError"),"one hash required"),k=o[0].$fetch(v),">"===b)continue t;if(p=k.toString(),-1!==g&&(p=p.slice(0,g)),A&z)for(;p.length<y;)p+=" ";else for(;p.length<y;)p=" "+p;break t}v+=e.charAt(f)}case"*":f++,U(),A|=F,(y=V("width"))<0&&(A|=z,y=-y);continue t;case".":if(A&L&&l.$raise(n(u,"ArgumentError"),"precision given twice"),A|=D|L,g=0,f++,"*"===e.charAt(f)){f++,(g=V("precision"))<0&&(A&=~D);continue t}g=K("precision");continue t;case"d":case"i":case"u":if((d=l.$Integer(Y()))>=0){for(p=d.toString();p.length<g;)p="0"+p;if(A&z)for((A&q||A&P)&&(p=(A&q?"+":" ")+p);p.length<y;)p+=" ";else if(A&C&&-1===g){for(;p.length<y-(A&q||A&P?1:0);)p="0"+p;(A&q||A&P)&&(p=(A&q?"+":" ")+p)}else for((A&q||A&P)&&(p=(A&q?"+":" ")+p);p.length<y;)p=" "+p}else{for(p=(-d).toString();p.length<g;)p="0"+p;if(A&z)for(p="-"+p;p.length<y;)p+=" ";else if(A&C&&-1===g){for(;p.length<y-1;)p="0"+p;p="-"+p}else for(p="-"+p;p.length<y;)p=" "+p}break t;case"b":case"B":case"o":case"x":case"X":switch(e.charAt(f)){case"b":case"B":O=2,w="0b",E=/^1+/,x="1";break;case"o":O=8,w="0",E=/^3?7+/,x="7";break;case"x":case"X":O=16,w="0x",E=/^f+/,x="f"}if((d=l.$Integer(Y()))>=0){for(p=d.toString(O);p.length<g;)p="0"+p;if(A&z)for((A&q||A&P)&&(p=(A&q?"+":" ")+p),A&T&&0!==d&&(p=w+p);p.length<y;)p+=" ";else if(A&C&&-1===g){for(;p.length<y-(A&q||A&P?1:0)-(A&T&&0!==d?w.length:0);)p="0"+p;A&T&&0!==d&&(p=w+p),(A&q||A&P)&&(p=(A&q?"+":" ")+p)}else for(A&T&&0!==d&&(p=w+p),(A&q||A&P)&&(p=(A&q?"+":" ")+p);p.length<y;)p=" "+p}else if(A&q||A&P){for(p=(-d).toString(O);p.length<g;)p="0"+p;if(A&z)for(A&T&&(p=w+p),p="-"+p;p.length<y;)p+=" ";else if(A&C&&-1===g){for(;p.length<y-1-(A&T?2:0);)p="0"+p;A&T&&(p=w+p),p="-"+p}else for(A&T&&(p=w+p),p="-"+p;p.length<y;)p=" "+p}else{for(p=(d>>>0).toString(O).replace(E,x);p.length<g-2;)p=x+p;if(A&z)for(p=".."+p,A&T&&(p=w+p);p.length<y;)p+=" ";else if(A&C&&-1===g){for(;p.length<y-2-(A&T?w.length:0);)p=x+p;p=".."+p,A&T&&(p=w+p)}else for(p=".."+p,A&T&&(p=w+p);p.length<y;)p=" "+p}e.charAt(f)===e.charAt(f).toUpperCase()&&(p=p.toUpperCase());break t;case"f":case"e":case"E":case"g":case"G":if((d=l.$Float(Y()))>=0||isNaN(d)){if(d===1/0)p="Inf";else switch(e.charAt(f)){case"f":p=d.toFixed(-1===g?6:g);break;case"e":case"E":p=d.toExponential(-1===g?6:g);break;case"g":case"G":p=d.toExponential(),(_=parseInt(p.split("e")[1],10))<-4||_>=(-1===g?6:g)||(p=d.toPrecision(-1===g?A&T?6:void 0:g))}if(A&z)for((A&q||A&P)&&(p=(A&q?"+":" ")+p);p.length<y;)p+=" ";else if(A&C&&d!==1/0&&!isNaN(d)){for(;p.length<y-(A&q||A&P?1:0);)p="0"+p;(A&q||A&P)&&(p=(A&q?"+":" ")+p)}else for((A&q||A&P)&&(p=(A&q?"+":" ")+p);p.length<y;)p=" "+p}else{if(d===-1/0)p="Inf";else switch(e.charAt(f)){case"f":p=(-d).toFixed(-1===g?6:g);break;case"e":case"E":p=(-d).toExponential(-1===g?6:g);break;case"g":case"G":p=(-d).toExponential(),(_=parseInt(p.split("e")[1],10))<-4||_>=(-1===g?6:g)||(p=(-d).toPrecision(-1===g?A&T?6:void 0:g))}if(A&z)for(p="-"+p;p.length<y;)p+=" ";else if(A&C&&d!==-1/0){for(;p.length<y-1;)p="0"+p;p="-"+p}else for(p="-"+p;p.length<y;)p=" "+p}e.charAt(f)!==e.charAt(f).toUpperCase()||d===1/0||d===-1/0||isNaN(d)||(p=p.toUpperCase()),p=p.replace(/([eE][-+]?)([0-9])$/,"$10$2");break t;case"a":case"A":l.$raise(n(u,"NotImplementedError"),"`A` and `a` format field types are not implemented in Opal yet");case"c":if((d=Y())["$respond_to?"]("to_ary")&&(d=d.$to_ary()[0]),1!==(p=d["$respond_to?"]("to_str")?d.$to_str():String.fromCharCode(n(u,"Opal").$coerce_to(d,n(u,"Integer"),"to_int"))).length&&l.$raise(n(u,"ArgumentError"),"%c requires a character"),A&z)for(;p.length<y;)p+=" ";else for(;p.length<y;)p=" "+p;break t;case"p":if(p=Y().$inspect(),-1!==g&&(p=p.slice(0,g)),A&z)for(;p.length<y;)p+=" ";else for(;p.length<y;)p=" "+p;break t;case"s":if(p=Y().$to_s(),-1!==g&&(p=p.slice(0,g)),A&z)for(;p.length<y;)p+=" ";else for(;p.length<y;)p=" "+p;break t;default:l.$raise(n(u,"ArgumentError"),"malformed format string - %"+e.charAt(f))}void 0===p&&l.$raise(n(u,"ArgumentError"),"malformed format string - %"),M+=e.slice(I,h)+p,I=f+1}return a.DEBUG&&j>=0&&N<o.length&&l.$raise(n(u,"ArgumentError"),"too many arguments for format string"),M+e.slice(I)},o.$$arity=-2),t.alias(l,"sprintf","format")}(e[0],e)}};void 0===global.Opal.modules["corelib/string"]&&"function"==typeof p&&p();var I=function(){global.Opal.modules["corelib/string/encoding"]=function(t){var e,r,n,i,$,a=t.top,s=[],o=t.nil,l=t.const_get_qualified,u=t.const_get_relative,c=(t.breaker,t.slice,t.klass),h=t.hash2,f=t.truthy,d=t.send;return t.add_stubs(["$require","$+","$[]","$new","$to_proc","$each","$const_set","$sub","$==","$default_external","$upcase","$raise","$attr_accessor","$attr_reader","$register","$length","$bytes","$to_a","$each_byte","$bytesize","$enum_for","$each_codepoint","$force_encoding","$dup","$coerce_to!","$find","$getbyte"]),a.$require("corelib/string"),function(e,r,n){var i,$,a,s,l,p,_,y,g,m,v=c(e,null,"Encoding"),b=[v].concat(n);v.$$prototype.ascii=v.$$prototype.dummy=v.$$prototype.name=o,t.defineProperty(v,"$$register",{}),t.defs(v,"$register",i=function(t,e){var r,n,$,a,s,l=i.$$p,c=l||o,p=o,_=o;return l&&(i.$$p=null),l&&(i.$$p=null),null==e&&(e=h([],{})),a=[t],s=f(r=e["$[]"]("aliases"))?r:[],p="number"==typeof a&&"number"==typeof s?a+s:a["$+"](s),$=d(u(b,"Class"),"new",[this],c.$to_proc()).$new(t,p,!!f(r=e["$[]"]("ascii"))&&r,!!f(r=e["$[]"]("dummy"))&&r),_=this.$$register,d(p,"each",[],((n=function(t){var e=null==n.$$s?this:n.$$s;return null==t&&(t=o),e.$const_set(t.$sub("-","_"),$),_["$$"+t]=$}).$$s=this,n.$$arity=1,n))},i.$$arity=-2),t.defs(v,"$find",$=function(t){var e,r,n;return t["$=="]("default_external")?this.$default_external():(r=this.$$register,n=f(e=r["$$"+t])?e:r["$$"+t.$upcase()],f(n)||this.$raise(u(b,"ArgumentError"),"unknown encoding name - "+t),n)},$.$$arity=1),function(t,e){[t].concat(e);t.$attr_accessor("default_external")}(t.get_singleton_class(v),b),v.$attr_reader("name","names"),t.def(v,"$initialize",a=function(t,e,r,n){return this.name=t,this.names=e,this.ascii=r,this.dummy=n},a.$$arity=4),t.def(v,"$ascii_compatible?",s=function(){return this.ascii},s.$$arity=0),t.def(v,"$dummy?",l=function(){return this.dummy},l.$$arity=0),t.def(v,"$to_s",p=function(){return this.name},p.$$arity=0),t.def(v,"$inspect",_=function(){var t=this;return"#<Encoding:"+t.name+(f(t.dummy)?" (dummy)":o)+">"},_.$$arity=0),t.def(v,"$each_byte",y=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(u(b,"NotImplementedError"))},y.$$arity=-1),t.def(v,"$getbyte",g=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(u(b,"NotImplementedError"))},g.$$arity=-1),t.def(v,"$bytesize",m=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(u(b,"NotImplementedError"))},m.$$arity=-1),function(t,e,r){[c(t,e,"EncodingError")].concat(r)}(b[0],u(b,"StandardError"),b),function(t,e,r){[c(t,e,"CompatibilityError")].concat(r)}(b[0],u(b,"EncodingError"),b)}(s[0],0,s),d(u(s,"Encoding"),"register",["UTF-8",h(["aliases","ascii"],{aliases:["CP65001"],ascii:!0})],((e=function(){var r,n,i=null==e.$$s?this:e.$$s;return t.def(i,"$each_byte",r=function(e){var n=r.$$p,i=n||o;n&&(r.$$p=null),n&&(r.$$p=null);for(var $=0,a=e.length;$<a;$++){var s=e.charCodeAt($);if(s<=127)t.yield1(i,s);else for(var l=encodeURIComponent(e.charAt($)).substr(1).split("%"),u=0,c=l.length;u<c;u++)t.yield1(i,parseInt(l[u],16))}},r.$$arity=1),t.def(i,"$bytesize",n=function(t){return t.$bytes().$length()},n.$$arity=1),o&&"bytesize"}).$$s=a,e.$$arity=0,e)),d(u(s,"Encoding"),"register",["UTF-16LE"],((r=function(){var e,n,i=null==r.$$s?this:r.$$s;return t.def(i,"$each_byte",e=function(r){var n=e.$$p,i=n||o;n&&(e.$$p=null),n&&(e.$$p=null);for(var $=0,a=r.length;$<a;$++){var s=r.charCodeAt($);t.yield1(i,255&s),t.yield1(i,s>>8)}},e.$$arity=1),t.def(i,"$bytesize",n=function(t){return t.$bytes().$length()},n.$$arity=1),o&&"bytesize"}).$$s=a,r.$$arity=0,r)),d(u(s,"Encoding"),"register",["UTF-16BE"],((n=function(){var e,r,i=null==n.$$s?this:n.$$s;return t.def(i,"$each_byte",e=function(r){var n=e.$$p,i=n||o;n&&(e.$$p=null),n&&(e.$$p=null);for(var $=0,a=r.length;$<a;$++){var s=r.charCodeAt($);t.yield1(i,s>>8),t.yield1(i,255&s)}},e.$$arity=1),t.def(i,"$bytesize",r=function(t){return t.$bytes().$length()},r.$$arity=1),o&&"bytesize"}).$$s=a,n.$$arity=0,n)),d(u(s,"Encoding"),"register",["UTF-32LE"],((i=function(){var e,r,n=null==i.$$s?this:i.$$s;return t.def(n,"$each_byte",e=function(r){var n=e.$$p,i=n||o;n&&(e.$$p=null),n&&(e.$$p=null);for(var $=0,a=r.length;$<a;$++){var s=r.charCodeAt($);t.yield1(i,255&s),t.yield1(i,s>>8)}},e.$$arity=1),t.def(n,"$bytesize",r=function(t){return t.$bytes().$length()},r.$$arity=1),o&&"bytesize"}).$$s=a,i.$$arity=0,i)),d(u(s,"Encoding"),"register",["ASCII-8BIT",h(["aliases","ascii","dummy"],{aliases:["BINARY","US-ASCII","ASCII"],ascii:!0,dummy:!0})],(($=function(){var e,r,n=null==$.$$s?this:$.$$s;return t.def(n,"$each_byte",e=function(r){var n=e.$$p,i=n||o;n&&(e.$$p=null),n&&(e.$$p=null);for(var $=0,a=r.length;$<a;$++){var s=r.charCodeAt($);t.yield1(i,255&s),t.yield1(i,s>>8)}},e.$$arity=1),t.def(n,"$bytesize",r=function(t){return t.$bytes().$length()},r.$$arity=1),o&&"bytesize"}).$$s=a,$.$$arity=0,$)),function(e,r,n){var i,$,a,s,h,f,p,_,y,g=c(e,null,"String"),m=[g].concat(n);return g.$$prototype.encoding=o,g.$attr_reader("encoding"),Object.defineProperty(String.prototype,"encoding",{value:l(u(m,"Encoding"),"UTF_16LE"),writable:!0}),t.def(g,"$bytes",i=function(){return this.$each_byte().$to_a()},i.$$arity=0),t.def(g,"$bytesize",$=function(){return this.encoding.$bytesize(this)},$.$$arity=0),t.def(g,"$each_byte",a=function(){var t=a.$$p,e=t||o;return t&&(a.$$p=null),t&&(a.$$p=null),e===o?this.$enum_for("each_byte"):(d(this.encoding,"each_byte",[this],e.$to_proc()),this)},a.$$arity=0),t.def(g,"$each_codepoint",s=function(){var e=s.$$p,r=e||o;if(e&&(s.$$p=null),e&&(s.$$p=null),r===o)return this.$enum_for("each_codepoint");for(var n=0,i=this.length;n<i;n++)t.yield1(r,this.codePointAt(n));return this},s.$$arity=0),t.def(g,"$codepoints",h=function(){var t=h.$$p,e=t||o;return t&&(h.$$p=null),t&&(h.$$p=null),e!==o?d(this,"each_codepoint",[],e.$to_proc()):this.$each_codepoint().$to_a()},h.$$arity=0),t.def(g,"$encode",f=function(t){return this.$dup().$force_encoding(t)},f.$$arity=1),t.def(g,"$force_encoding",p=function(t){var e=this;return t===e.encoding?e:(t=u(m,"Opal")["$coerce_to!"](t,u(m,"String"),"to_s"),(t=u(m,"Encoding").$find(t))===e.encoding?e:("string"==typeof e&&(e=new String(e)),e.encoding=t,e))},p.$$arity=1),t.def(g,"$getbyte",_=function(t){return this.encoding.$getbyte(this,t)},_.$$arity=1),t.def(g,"$valid_encoding?",y=function(){return!0},y.$$arity=0),o&&"valid_encoding?"}(s[0],0,s)}};var S=function(){global.Opal.modules["corelib/math"]=function(t){t.top;var e=[],r=(t.nil,t.const_get_qualified),n=t.const_get_relative,i=(t.breaker,t.slice,t.module),$=t.truthy;return t.add_stubs(["$new","$raise","$Float","$type_error","$Integer","$module_function","$checked","$float!","$===","$gamma","$-","$integer!","$/","$infinite?"]),function(e,a){var s,o,l,u,c,h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q=i(e,"Math"),C=[q].concat(a);t.const_set(C[0],"E",Math.E),t.const_set(C[0],"PI",Math.PI),t.const_set(C[0],"DomainError",n(C,"Class").$new(n(C,"StandardError"))),t.defs(q,"$checked",s=function(e,r){var i,$=this;if(i=t.slice.call(arguments,1,arguments.length),isNaN(i[0])||2==i.length&&isNaN(i[1]))return NaN;var a=Math[e].apply(null,i);return isNaN(a)&&$.$raise(n(C,"DomainError"),'Numerical argument is out of domain - "'+e+'"'),a},s.$$arity=-2),t.defs(q,"$float!",o=function(e){try{return this.$Float(e)}catch(r){if(!t.rescue(r,[n(C,"ArgumentError")]))throw r;try{return this.$raise(n(C,"Opal").$type_error(e,n(C,"Float")))}finally{t.pop_exception()}}},o.$$arity=1),t.defs(q,"$integer!",l=function(e){try{return this.$Integer(e)}catch(r){if(!t.rescue(r,[n(C,"ArgumentError")]))throw r;try{return this.$raise(n(C,"Opal").$type_error(e,n(C,"Integer")))}finally{t.pop_exception()}}},l.$$arity=1),q.$module_function(),t.def(q,"$acos",u=function(t){return n(C,"Math").$checked("acos",n(C,"Math")["$float!"](t))},u.$$arity=1),$(void 0!==Math.acosh)||(Math.acosh=function(t){return Math.log(t+Math.sqrt(t*t-1))}),t.def(q,"$acosh",c=function(t){return n(C,"Math").$checked("acosh",n(C,"Math")["$float!"](t))},c.$$arity=1),t.def(q,"$asin",h=function(t){return n(C,"Math").$checked("asin",n(C,"Math")["$float!"](t))},h.$$arity=1),$(void 0!==Math.asinh)||(Math.asinh=function(t){return Math.log(t+Math.sqrt(t*t+1))}),t.def(q,"$asinh",f=function(t){return n(C,"Math").$checked("asinh",n(C,"Math")["$float!"](t))},f.$$arity=1),t.def(q,"$atan",d=function(t){return n(C,"Math").$checked("atan",n(C,"Math")["$float!"](t))},d.$$arity=1),t.def(q,"$atan2",p=function(t,e){return n(C,"Math").$checked("atan2",n(C,"Math")["$float!"](t),n(C,"Math")["$float!"](e))},p.$$arity=2),$(void 0!==Math.atanh)||(Math.atanh=function(t){return.5*Math.log((1+t)/(1-t))}),t.def(q,"$atanh",_=function(t){return n(C,"Math").$checked("atanh",n(C,"Math")["$float!"](t))},_.$$arity=1),$(void 0!==Math.cbrt)||(Math.cbrt=function(t){if(0==t)return 0;if(t<0)return-Math.cbrt(-t);for(var e=t,r=0;e<.125;)e*=8,r--;for(;e>1;)e*=.125,r++;for(e=(-.46946116*e+1.072302)*e+.3812513;r<0;)e*=.5,r++;for(;r>0;)e*=2,r--;return e=2/3*(e=2/3*(e=2/3*(e=2/3*e+1/3*t/(e*e))+1/3*t/(e*e))+1/3*t/(e*e))+1/3*t/(e*e)}),t.def(q,"$cbrt",y=function(t){return n(C,"Math").$checked("cbrt",n(C,"Math")["$float!"](t))},y.$$arity=1),t.def(q,"$cos",g=function(t){return n(C,"Math").$checked("cos",n(C,"Math")["$float!"](t))},g.$$arity=1),$(void 0!==Math.cosh)||(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),t.def(q,"$cosh",m=function(t){return n(C,"Math").$checked("cosh",n(C,"Math")["$float!"](t))},m.$$arity=1),$(void 0!==Math.erf)||t.defineProperty(Math,"erf",(function(t){var e=1;t<0&&(e=-1);var r=1/(1+.3275911*(t=Math.abs(t)));return e*(1-((((1.061405429*r-1.453152027)*r+1.421413741)*r-.284496736)*r+.254829592)*r*Math.exp(-t*t))})),t.def(q,"$erf",v=function(t){return n(C,"Math").$checked("erf",n(C,"Math")["$float!"](t))},v.$$arity=1),$(void 0!==Math.erfc)||t.defineProperty(Math,"erfc",(function(t){var e=Math.abs(t),r=1/(.5*e+1),n=-e*e-1.26551223+r*(r*(r*(r*(r*(r*(r*(r*(.17087277*r-.82215223)+1.48851587)-1.13520398)+.27886807)-.18628806)+.09678418)+.37409196)+1.00002368),i=r*Math.exp(n);return t<0?2-i:i})),t.def(q,"$erfc",b=function(t){return n(C,"Math").$checked("erfc",n(C,"Math")["$float!"](t))},b.$$arity=1),t.def(q,"$exp",O=function(t){return n(C,"Math").$checked("exp",n(C,"Math")["$float!"](t))},O.$$arity=1),t.def(q,"$frexp",w=function(t){if(t=n(C,"Math")["$float!"](t),isNaN(t))return[NaN,0];var e=Math.floor(Math.log(Math.abs(t))/Math.log(2))+1;return[t/Math.pow(2,e),e]},w.$$arity=1),t.def(q,"$gamma",E=function(t){var e,r,i,$,a,s,o,l,u;t=n(C,"Math")["$float!"](t);var c,h,f=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];if(isNaN(t))return NaN;if(0===t&&1/t<0)return-1/0;if(-1!==t&&t!==-1/0||this.$raise(n(C,"DomainError"),'Numerical argument is out of domain - "gamma"'),n(C,"Integer")["$==="](t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for($=t-2,a=t-1;$>1;)a*=$,$--;return 0==a&&(a=1),a}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*n(C,"Math").$gamma((h=t,"number"==typeof(c=1)&&"number"==typeof h?c-h:c["$-"](h))));if(t>=171.35)return 1/0;if(t>85)return u=(l=(o=(s=t*t)*t)*t)*t,Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*s)-139/(51840*o)-571/(2488320*l)+163879/(209018880*u)+5246819/(75246796800*u*t));for(t-=1,i=f[0],e=1;e<f.length;++e)i+=f[e]/(t+e);return r=t+4.7421875+.5,Math.sqrt(2*Math.PI)*Math.pow(r,t+.5)*Math.exp(-r)*i},E.$$arity=1),$(void 0!==Math.hypot)||(Math.hypot=function(t,e){return Math.sqrt(t*t+e*e)}),t.def(q,"$hypot",x=function(t,e){return n(C,"Math").$checked("hypot",n(C,"Math")["$float!"](t),n(C,"Math")["$float!"](e))},x.$$arity=2),t.def(q,"$ldexp",k=function(t,e){return t=n(C,"Math")["$float!"](t),e=n(C,"Math")["$integer!"](e),isNaN(e)&&this.$raise(n(C,"RangeError"),"float NaN out of range of integer"),t*Math.pow(2,e)},k.$$arity=2),t.def(q,"$lgamma",A=function(t){return-1==t?[1/0,1]:[Math.log(Math.abs(n(C,"Math").$gamma(t))),n(C,"Math").$gamma(t)<0?-1:1]},A.$$arity=1),t.def(q,"$log",M=function(t,e){var r,i;return $(n(C,"String")["$==="](t))&&this.$raise(n(C,"Opal").$type_error(t,n(C,"Float"))),$(null==e)?n(C,"Math").$checked("log",n(C,"Math")["$float!"](t)):($(n(C,"String")["$==="](e))&&this.$raise(n(C,"Opal").$type_error(e,n(C,"Float"))),r=n(C,"Math").$checked("log",n(C,"Math")["$float!"](t)),i=n(C,"Math").$checked("log",n(C,"Math")["$float!"](e)),"number"==typeof r&&"number"==typeof i?r/i:r["$/"](i))},M.$$arity=-2),$(void 0!==Math.log10)||(Math.log10=function(t){return Math.log(t)/Math.LN10}),t.def(q,"$log10",I=function(t){return $(n(C,"String")["$==="](t))&&this.$raise(n(C,"Opal").$type_error(t,n(C,"Float"))),n(C,"Math").$checked("log10",n(C,"Math")["$float!"](t))},I.$$arity=1),$(void 0!==Math.log2)||(Math.log2=function(t){return Math.log(t)/Math.LN2}),t.def(q,"$log2",S=function(t){return $(n(C,"String")["$==="](t))&&this.$raise(n(C,"Opal").$type_error(t,n(C,"Float"))),n(C,"Math").$checked("log2",n(C,"Math")["$float!"](t))},S.$$arity=1),t.def(q,"$sin",N=function(t){return n(C,"Math").$checked("sin",n(C,"Math")["$float!"](t))},N.$$arity=1),$(void 0!==Math.sinh)||(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),t.def(q,"$sinh",j=function(t){return n(C,"Math").$checked("sinh",n(C,"Math")["$float!"](t))},j.$$arity=1),t.def(q,"$sqrt",R=function(t){return n(C,"Math").$checked("sqrt",n(C,"Math")["$float!"](t))},R.$$arity=1),t.def(q,"$tan",T=function(t){return t=n(C,"Math")["$float!"](t),$(t["$infinite?"]())?r(n(C,"Float"),"NAN"):n(C,"Math").$checked("tan",n(C,"Math")["$float!"](t))},T.$$arity=1),$(void 0!==Math.tanh)||(Math.tanh=function(t){return t==1/0?1:t==-1/0?-1:(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),t.def(q,"$tanh",z=function(t){return n(C,"Math").$checked("tanh",n(C,"Math")["$float!"](t))},z.$$arity=1)}(e[0],e)}};void 0===global.Opal.modules["corelib/numeric"]&&"function"==typeof g&&g();var N=function(){global.Opal.modules["corelib/complex"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t*e:t["$*"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}var $=t.top,a=[],s=t.nil,o=t.const_get_qualified,l=t.const_get_relative,u=(t.breaker,t.slice,t.klass),c=t.truthy,h=t.module;return t.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"]),$.$require("corelib/numeric"),function($,a,h){var f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G=u($,a,"Complex"),H=[G].concat(h);G.$$prototype.real=G.$$prototype.imag=s,t.defs(G,"$rect",f=function(t,e){var r,n,i;return null==e&&(e=0),c(c(r=c(n=c(i=l(H,"Numeric")["$==="](t))?t["$real?"]():i)?l(H,"Numeric")["$==="](e):n)?e["$real?"]():r)||this.$raise(l(H,"TypeError"),"not a real"),this.$new(t,e)},f.$$arity=-2),function(e,r){[e].concat(r);t.alias(e,"rectangular","rect")}(t.get_singleton_class(G),H),t.defs(G,"$polar",d=function(t,r){var n,i,$;return null==r&&(r=0),c(c(n=c(i=c($=l(H,"Numeric")["$==="](t))?t["$real?"]():$)?l(H,"Numeric")["$==="](r):i)?r["$real?"]():n)||this.$raise(l(H,"TypeError"),"not a real"),this.$new(e(t,l(H,"Math").$cos(r)),e(t,l(H,"Math").$sin(r)))},d.$$arity=-2),G.$attr_reader("real","imag"),t.def(G,"$initialize",p=function(t,e){return null==e&&(e=0),this.real=t,this.imag=e},p.$$arity=-2),t.def(G,"$coerce",_=function(t){var e;return c(l(H,"Complex")["$==="](t))?[t,this]:c(c(e=l(H,"Numeric")["$==="](t))?t["$real?"]():e)?[l(H,"Complex").$new(t,0),this]:this.$raise(l(H,"TypeError"),t.$class()+" can't be coerced into Complex")},_.$$arity=1),t.def(G,"$==",y=function(t){var e;return c(l(H,"Complex")["$==="](t))?(e=this.real["$=="](t.$real()))?this.imag["$=="](t.$imag()):this.real["$=="](t.$real()):c(c(e=l(H,"Numeric")["$==="](t))?t["$real?"]():e)?(e=this.real["$=="](t))?this.imag["$=="](0):this.real["$=="](t):t["$=="](this)},y.$$arity=1),t.def(G,"$-@",g=function(){return this.$Complex(this.real["$-@"](),this.imag["$-@"]())},g.$$arity=0),t.def(G,"$+",m=function(t){var e;return c(l(H,"Complex")["$==="](t))?this.$Complex(r(this.real,t.$real()),r(this.imag,t.$imag())):c(c(e=l(H,"Numeric")["$==="](t))?t["$real?"]():e)?this.$Complex(r(this.real,t),this.imag):this.$__coerced__("+",t)},m.$$arity=1),t.def(G,"$-",v=function(t){var e;return c(l(H,"Complex")["$==="](t))?this.$Complex(n(this.real,t.$real()),n(this.imag,t.$imag())):c(c(e=l(H,"Numeric")["$==="](t))?t["$real?"]():e)?this.$Complex(n(this.real,t),this.imag):this.$__coerced__("-",t)},v.$$arity=1),t.def(G,"$*",b=function(t){var i;return c(l(H,"Complex")["$==="](t))?this.$Complex(n(e(this.real,t.$real()),e(this.imag,t.$imag())),r(e(this.real,t.$imag()),e(this.imag,t.$real()))):c(c(i=l(H,"Numeric")["$==="](t))?t["$real?"]():i)?this.$Complex(e(this.real,t),e(this.imag,t)):this.$__coerced__("*",t)},b.$$arity=1),t.def(G,"$/",O=function(t){var r,n,$,a;return c(l(H,"Complex")["$==="](t))?c(c(r=c(n=c($=c(a=l(H,"Number")["$==="](this.real))?this.real["$nan?"]():a)?$:c(a=l(H,"Number")["$==="](this.imag))?this.imag["$nan?"]():a)?n:c($=l(H,"Number")["$==="](t.$real()))?t.$real()["$nan?"]():$)?r:c(n=l(H,"Number")["$==="](t.$imag()))?t.$imag()["$nan?"]():n)?l(H,"Complex").$new(o(l(H,"Float"),"NAN"),o(l(H,"Float"),"NAN")):i(e(this,t.$conj()),t.$abs2()):c(c(r=l(H,"Numeric")["$==="](t))?t["$real?"]():r)?this.$Complex(this.real.$quo(t),this.imag.$quo(t)):this.$__coerced__("/",t)},O.$$arity=1),t.def(G,"$**",w=function($){var a,o,u,h,f,d,p=s,_=s,y=s,g=s,m=s,v=s,b=s,O=s,w=s,E=s,x=s;if($["$=="](0))return l(H,"Complex").$new(1,0);if(c(l(H,"Complex")["$==="]($)))return o=this.$polar(),p=null==(a=t.to_ary(o))[0]?s:a[0],_=null==a[1]?s:a[1],y=$.$real(),g=$.$imag(),m=l(H,"Math").$exp(n(e(y,l(H,"Math").$log(p)),e(g,_))),v=r(e(_,y),e(g,l(H,"Math").$log(p))),l(H,"Complex").$polar(m,v);if(c(l(H,"Integer")["$==="]($))){if(c((d=0,"number"==typeof(f=$)&&"number"==typeof d?f>d:f["$>"](d)))){for(O=b=this,w=n($,1);c(w["$!="](0));){for(u=w.$divmod(2),E=null==(o=t.to_ary(u))[0]?s:o[0],x=null==o[1]?s:o[1];x["$=="](0);)b=this.$Complex(n(e(b.$real(),b.$real()),e(b.$imag(),b.$imag())),e(e(2,b.$real()),b.$imag())),h=(w=E).$divmod(2),E=null==(u=t.to_ary(h))[0]?s:u[0],x=null==u[1]?s:u[1];O=e(O,b),w=n(w,1)}return O}return i(l(H,"Rational").$new(1,1),this)["$**"]($["$-@"]())}return c(c(a=l(H,"Float")["$==="]($))?a:l(H,"Rational")["$==="]($))?(o=this.$polar(),p=null==(a=t.to_ary(o))[0]?s:a[0],_=null==a[1]?s:a[1],l(H,"Complex").$polar(p["$**"]($),e(_,$))):this.$__coerced__("**",$)},w.$$arity=1),t.def(G,"$abs",E=function(){return l(H,"Math").$hypot(this.real,this.imag)},E.$$arity=0),t.def(G,"$abs2",x=function(){return r(e(this.real,this.real),e(this.imag,this.imag))},x.$$arity=0),t.def(G,"$angle",k=function(){return l(H,"Math").$atan2(this.imag,this.real)},k.$$arity=0),t.alias(G,"arg","angle"),t.def(G,"$conj",A=function(){return this.$Complex(this.real,this.imag["$-@"]())},A.$$arity=0),t.alias(G,"conjugate","conj"),t.def(G,"$denominator",M=function(){return this.real.$denominator().$lcm(this.imag.$denominator())},M.$$arity=0),t.alias(G,"divide","/"),t.def(G,"$eql?",I=function(t){var e,r;return c(e=c(r=l(H,"Complex")["$==="](t))?this.real.$class()["$=="](this.imag.$class()):r)?this["$=="](t):e},I.$$arity=1),t.def(G,"$fdiv",S=function(t){return c(l(H,"Numeric")["$==="](t))||this.$raise(l(H,"TypeError"),t.$class()+" can't be coerced into Complex"),i(this,t)},S.$$arity=1),t.def(G,"$finite?",N=function(){var t;return c(t=this.real["$finite?"]())?this.imag["$finite?"]():t},N.$$arity=0),t.def(G,"$hash",j=function(){return"Complex:"+this.real+":"+this.imag},j.$$arity=0),t.alias(G,"imaginary","imag"),t.def(G,"$infinite?",R=function(){var t;return c(t=this.real["$infinite?"]())?t:this.imag["$infinite?"]()},R.$$arity=0),t.def(G,"$inspect",T=function(){return"("+this+")"},T.$$arity=0),t.alias(G,"magnitude","abs"),t.udef(G,"$negative?"),t.def(G,"$numerator",z=function(){var t;return t=this.$denominator(),this.$Complex(e(this.real.$numerator(),i(t,this.real.$denominator())),e(this.imag.$numerator(),i(t,this.imag.$denominator())))},z.$$arity=0),t.alias(G,"phase","arg"),t.def(G,"$polar",q=function(){return[this.$abs(),this.$arg()]},q.$$arity=0),t.udef(G,"$positive?"),t.alias(G,"quo","/"),t.def(G,"$rationalize",C=function(t){var e=this;return arguments.length>1&&e.$raise(l(H,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)"),c(e.imag["$!="](0))&&e.$raise(l(H,"RangeError"),"can't' convert "+e+" into Rational"),e.$real().$rationalize(t)},C.$$arity=-1),t.def(G,"$real?",P=function(){return!1},P.$$arity=0),t.def(G,"$rect",F=function(){return[this.real,this.imag]},F.$$arity=0),t.alias(G,"rectangular","rect"),t.def(G,"$to_f",D=function(){return this.imag["$=="](0)||this.$raise(l(H,"RangeError"),"can't convert "+this+" into Float"),this.real.$to_f()},D.$$arity=0),t.def(G,"$to_i",L=function(){return this.imag["$=="](0)||this.$raise(l(H,"RangeError"),"can't convert "+this+" into Integer"),this.real.$to_i()},L.$$arity=0),t.def(G,"$to_r",B=function(){return this.imag["$=="](0)||this.$raise(l(H,"RangeError"),"can't convert "+this+" into Rational"),this.real.$to_r()},B.$$arity=0),t.def(G,"$to_s",U=function(){var t,e,n,i=this,$=s;return $=r($=i.real.$inspect(),c(c(t=c(e=c(n=l(H,"Number")["$==="](i.imag))?i.imag["$nan?"]():n)?e:i.imag["$positive?"]())?t:i.imag["$zero?"]())?"+":"-"),$=r($,i.imag.$abs().$inspect()),c(c(t=l(H,"Number")["$==="](i.imag))?c(e=i.imag["$nan?"]())?e:i.imag["$infinite?"]():t)&&($=r($,"*")),r($,"i")},U.$$arity=0),t.const_set(H[0],"I",G.$new(0,1))}(a[0],l(a,"Numeric"),a),function(e,r){var n,i=h(e,"Kernel"),$=[i].concat(r);t.def(i,"$Complex",n=function(t,e){return null==e&&(e=s),c(e)?l($,"Complex").$new(t,e):l($,"Complex").$new(t,0)},n.$$arity=-2)}(a[0],a),function(e,r,n){var i,$=u(e,null,"String");[$].concat(n);return t.def($,"$to_c",i=function(){var t,e,r=this,n=r,i=/[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/;n.match(i);function $(){return i.test(n)}function a(){var t=n.match(i)[0];return n=n.slice(t.length),t.replace(/_/g,"")}function s(){if($()){var t=parseFloat(a());if("/"===n[0]){if(n=n.slice(1),$()){var e=parseFloat(a());return r.$Rational(t,e)}return n="/"+n,t}return t}return null}return(t=s())?(e=s())?r.$Complex(t,e):"i"===n[0]?r.$Complex(0,t):r.$Complex(t,0):"i"===n[0]?r.$Complex(0,1):"-"===n[0]&&"i"===n[1]?r.$Complex(0,-1):"+"===n[0]&&"i"===n[1]?r.$Complex(0,1):r.$Complex(0,0)},i.$$arity=0),s&&"to_c"}(a[0],0,a)}};void 0===global.Opal.modules["corelib/numeric"]&&"function"==typeof g&&g();var j=function(){global.Opal.modules["corelib/rational"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t*e:t["$*"](e)}function $(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function a(t,e){return"number"==typeof t&&"number"==typeof e?t<=e:t["$<="](e)}var s=t.top,o=[],l=t.nil,u=t.const_get_qualified,c=t.const_get_relative,h=(t.breaker,t.slice,t.klass),f=t.truthy,d=t.module;return t.add_stubs(["$require","$to_i","$==","$raise","$<","$-@","$new","$gcd","$/","$nil?","$===","$reduce","$to_r","$equal?","$!","$coerce_to!","$to_f","$numerator","$denominator","$<=>","$-","$*","$__coerced__","$+","$Rational","$>","$**","$abs","$ceil","$with_precision","$floor","$<=","$truncate","$send","$convert"]),s.$require("corelib/numeric"),function(s,o,d){var p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L=h(s,o,"Rational"),B=[L].concat(d);L.$$prototype.num=L.$$prototype.den=l,t.defs(L,"$reduce",p=function(t,n){var i;if(t=t.$to_i(),(n=n.$to_i())["$=="](0))this.$raise(c(B,"ZeroDivisionError"),"divided by 0");else if(f(e(n,0)))t=t["$-@"](),n=n["$-@"]();else if(n["$=="](1))return this.$new(t,n);return i=t.$gcd(n),this.$new(r(t,i),r(n,i))},p.$$arity=2),t.defs(L,"$convert",_=function(t,e){var n,i;return f(f(n=t["$nil?"]())?n:e["$nil?"]())&&this.$raise(c(B,"TypeError"),"cannot convert nil into Rational"),f(f(n=c(B,"Integer")["$==="](t))?c(B,"Integer")["$==="](e):n)?this.$reduce(t,e):(f(f(n=f(i=c(B,"Float")["$==="](t))?i:c(B,"String")["$==="](t))?n:c(B,"Complex")["$==="](t))&&(t=t.$to_r()),f(f(n=f(i=c(B,"Float")["$==="](e))?i:c(B,"String")["$==="](e))?n:c(B,"Complex")["$==="](e))&&(e=e.$to_r()),f(f(n=e["$equal?"](1))?c(B,"Integer")["$==="](t)["$!"]():n)?c(B,"Opal")["$coerce_to!"](t,c(B,"Rational"),"to_r"):f(f(n=c(B,"Numeric")["$==="](t))?c(B,"Numeric")["$==="](e):n)?r(t,e):this.$reduce(t,e))},_.$$arity=2),t.def(L,"$initialize",y=function(t,e){return this.num=t,this.den=e},y.$$arity=2),t.def(L,"$numerator",g=function(){return this.num},g.$$arity=0),t.def(L,"$denominator",m=function(){return this.den},m.$$arity=0),t.def(L,"$coerce",v=function(t){var e=this,r=l;return r=t,c(B,"Rational")["$==="](r)?[t,e]:c(B,"Integer")["$==="](r)?[t.$to_r(),e]:c(B,"Float")["$==="](r)?[t,e.$to_f()]:l},v.$$arity=1),t.def(L,"$==",b=function(t){var e=this,r=l;return r=t,c(B,"Rational")["$==="](r)?e.num["$=="](t.$numerator())?e.den["$=="](t.$denominator()):e.num["$=="](t.$numerator()):c(B,"Integer")["$==="](r)?e.num["$=="](t)?e.den["$=="](1):e.num["$=="](t):c(B,"Float")["$==="](r)?e.$to_f()["$=="](t):t["$=="](e)},b.$$arity=1),t.def(L,"$<=>",O=function(t){var e=this,r=l;return r=t,c(B,"Rational")["$==="](r)?n(i(e.num,t.$denominator()),i(e.den,t.$numerator()))["$<=>"](0):c(B,"Integer")["$==="](r)?n(e.num,i(e.den,t))["$<=>"](0):c(B,"Float")["$==="](r)?e.$to_f()["$<=>"](t):e.$__coerced__("<=>",t)},O.$$arity=1),t.def(L,"$+",w=function(t){var e=this,r=l,n=l,a=l;return r=t,c(B,"Rational")["$==="](r)?(n=$(i(e.num,t.$denominator()),i(e.den,t.$numerator())),a=i(e.den,t.$denominator()),e.$Rational(n,a)):c(B,"Integer")["$==="](r)?e.$Rational($(e.num,i(t,e.den)),e.den):c(B,"Float")["$==="](r)?$(e.$to_f(),t):e.$__coerced__("+",t)},w.$$arity=1),t.def(L,"$-",E=function(t){var e=this,r=l,$=l,a=l;return r=t,c(B,"Rational")["$==="](r)?($=n(i(e.num,t.$denominator()),i(e.den,t.$numerator())),a=i(e.den,t.$denominator()),e.$Rational($,a)):c(B,"Integer")["$==="](r)?e.$Rational(n(e.num,i(t,e.den)),e.den):c(B,"Float")["$==="](r)?n(e.$to_f(),t):e.$__coerced__("-",t)},E.$$arity=1),t.def(L,"$*",x=function(t){var e=this,r=l,n=l,$=l;return r=t,c(B,"Rational")["$==="](r)?(n=i(e.num,t.$numerator()),$=i(e.den,t.$denominator()),e.$Rational(n,$)):c(B,"Integer")["$==="](r)?e.$Rational(i(e.num,t),e.den):c(B,"Float")["$==="](r)?i(e.$to_f(),t):e.$__coerced__("*",t)},x.$$arity=1),t.def(L,"$/",k=function(t){var e=this,n=l,$=l,a=l;return n=t,c(B,"Rational")["$==="](n)?($=i(e.num,t.$denominator()),a=i(e.den,t.$numerator()),e.$Rational($,a)):c(B,"Integer")["$==="](n)?t["$=="](0)?r(e.$to_f(),0):e.$Rational(e.num,i(e.den,t)):c(B,"Float")["$==="](n)?r(e.$to_f(),t):e.$__coerced__("/",t)},k.$$arity=1),t.def(L,"$**",A=function(t){var r,n,i=this,$=l;return $=t,c(B,"Integer")["$==="]($)?f(i["$=="](0)?e(t,0):i["$=="](0))?u(c(B,"Float"),"INFINITY"):f((n=0,"number"==typeof(r=t)&&"number"==typeof n?r>n:r["$>"](n)))?i.$Rational(i.num["$**"](t),i.den["$**"](t)):f(e(t,0))?i.$Rational(i.den["$**"](t["$-@"]()),i.num["$**"](t["$-@"]())):i.$Rational(1,1):c(B,"Float")["$==="]($)?i.$to_f()["$**"](t):c(B,"Rational")["$==="]($)?t["$=="](0)?i.$Rational(1,1):t.$denominator()["$=="](1)?f(e(t,0))?i.$Rational(i.den["$**"](t.$numerator().$abs()),i.num["$**"](t.$numerator().$abs())):i.$Rational(i.num["$**"](t.$numerator()),i.den["$**"](t.$numerator())):f(i["$=="](0)?e(t,0):i["$=="](0))?i.$raise(c(B,"ZeroDivisionError"),"divided by 0"):i.$to_f()["$**"](t):i.$__coerced__("**",t)},A.$$arity=1),t.def(L,"$abs",M=function(){return this.$Rational(this.num.$abs(),this.den.$abs())},M.$$arity=0),t.def(L,"$ceil",I=function(t){return null==t&&(t=0),t["$=="](0)?r(this.num["$-@"](),this.den)["$-@"]().$ceil():this.$with_precision("ceil",t)},I.$$arity=-1),t.alias(L,"divide","/"),t.def(L,"$floor",S=function(t){return null==t&&(t=0),t["$=="](0)?r(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",t)},S.$$arity=-1),t.def(L,"$hash",N=function(){return"Rational:"+this.num+":"+this.den},N.$$arity=0),t.def(L,"$inspect",j=function(){return"("+this+")"},j.$$arity=0),t.alias(L,"quo","/"),t.def(L,"$rationalize",R=function(t){var e=this;if(arguments.length>1&&e.$raise(c(B,"ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)"),null==t)return e;for(var i,s,o,l,u,h=t.$abs(),f=n(e,h),d=$(e,h),p=0,_=1,y=1,g=0;!a(o=f.$ceil(),d);)i=(l=o-1)*_+p,s=l*g+y,u=r(1,n(d,l)),d=r(1,n(f,l)),f=u,p=_,y=g,_=i,g=s;return e.$Rational(o*_+p,o*g+y)},R.$$arity=-1),t.def(L,"$round",T=function(t){var n=l;return null==t&&(t=0),t["$=="](0)?this.num["$=="](0)?0:this.den["$=="](1)?this.num:(n=r($(i(this.num.$abs(),2),this.den),i(this.den,2)).$truncate(),f(e(this.num,0))?n["$-@"]():n):this.$with_precision("round",t)},T.$$arity=-1),t.def(L,"$to_f",z=function(){return r(this.num,this.den)},z.$$arity=0),t.def(L,"$to_i",q=function(){return this.$truncate()},q.$$arity=0),t.def(L,"$to_r",C=function(){return this},C.$$arity=0),t.def(L,"$to_s",P=function(){return this.num+"/"+this.den},P.$$arity=0),t.def(L,"$truncate",F=function(t){return null==t&&(t=0),t["$=="](0)?f(e(this.num,0))?this.$ceil():this.$floor():this.$with_precision("truncate",t)},F.$$arity=-1),t.def(L,"$with_precision",D=function(t,n){var $,a=l;return f(c(B,"Integer")["$==="](n))||this.$raise(c(B,"TypeError"),"not an Integer"),a=i(this,$=10["$**"](n)),f(e(n,1))?r(a.$send(t),$).$to_i():this.$Rational(a.$send(t),$)},D.$$arity=2)}(o[0],c(o,"Numeric"),o),function(e,r){var n,i=d(e,"Kernel"),$=[i].concat(r);t.def(i,"$Rational",n=function(t,e){return null==e&&(e=1),c($,"Rational").$convert(t,e)},n.$$arity=-2)}(o[0],o),function(e,r,n){var i,$=h(e,null,"String");[$].concat(n);return t.def($,"$to_r",i=function(){var t,e,r=this.trimLeft(),n=/^[+-]?[\d_]+(\.[\d_]+)?/;r.match(n);function i(){return n.test(r)}function $(){var t=r.match(n)[0];return r=r.slice(t.length),t.replace(/_/g,"")}return i()?(t=parseFloat($()),"/"===r[0]?(r=r.slice(1),i()?(e=parseFloat($()),this.$Rational(t,e)):this.$Rational(t,1)):this.$Rational(t,1)):this.$Rational(0,1)},i.$$arity=0),l&&"to_r"}(o[0],0,o)}};void 0===global.Opal.modules["corelib/comparable"]&&"function"==typeof f.a&&Object(f.a)();var R=function(){global.Opal.modules["corelib/time"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t/e:t["$/"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t<=e:t["$<="](e)}var $=t.top,a=[],s=t.nil,o=(t.const_get_qualified,t.const_get_relative),l=(t.breaker,t.slice),u=t.klass,c=t.truthy,h=t.range;return t.add_stubs(["$require","$include","$===","$raise","$coerce_to!","$respond_to?","$to_str","$to_i","$new","$<=>","$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"]),$.$require("corelib/comparable"),function($,a,f){var d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z,q,C,P,F,D,L,B,U,G,H,X,Y,K,V,Z,J,Q,W,tt,et,rt=u($,a,"Time"),nt=[rt].concat(f);rt.$include(o(nt,"Comparable"));var it=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],at=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],st=["January","February","March","April","May","June","July","August","September","October","November","December"];function ot(t,e,r,n,i,$){if(t=t.$$is_string?parseInt(t,10):o(nt,"Opal")["$coerce_to!"](t,o(nt,"Integer"),"to_int"),e===s)e=1;else if(!e.$$is_number)if(e["$respond_to?"]("to_str"))switch((e=e.$to_str()).toLowerCase()){case"jan":e=1;break;case"feb":e=2;break;case"mar":e=3;break;case"apr":e=4;break;case"may":e=5;break;case"jun":e=6;break;case"jul":e=7;break;case"aug":e=8;break;case"sep":e=9;break;case"oct":e=10;break;case"nov":e=11;break;case"dec":e=12;break;default:e=e.$to_i()}else e=o(nt,"Opal")["$coerce_to!"](e,o(nt,"Integer"),"to_int");return(e<1||e>12)&&rt.$raise(o(nt,"ArgumentError"),"month out of range: "+e),e-=1,((r=r===s?1:r.$$is_string?parseInt(r,10):o(nt,"Opal")["$coerce_to!"](r,o(nt,"Integer"),"to_int"))<1||r>31)&&rt.$raise(o(nt,"ArgumentError"),"day out of range: "+r),((n=n===s?0:n.$$is_string?parseInt(n,10):o(nt,"Opal")["$coerce_to!"](n,o(nt,"Integer"),"to_int"))<0||n>24)&&rt.$raise(o(nt,"ArgumentError"),"hour out of range: "+n),((i=i===s?0:i.$$is_string?parseInt(i,10):o(nt,"Opal")["$coerce_to!"](i,o(nt,"Integer"),"to_int"))<0||i>59)&&rt.$raise(o(nt,"ArgumentError"),"min out of range: "+i),$===s?$=0:$.$$is_number||($=$.$$is_string?parseInt($,10):o(nt,"Opal")["$coerce_to!"]($,o(nt,"Integer"),"to_int")),($<0||$>60)&&rt.$raise(o(nt,"ArgumentError"),"sec out of range: "+$),[t,e,r,n,i,$]}return t.defs(rt,"$at",d=function(t,e){var r;return o(nt,"Time")["$==="](t)?(void 0!==e&&this.$raise(o(nt,"TypeError"),"can't convert Time into an exact number"),(r=new Date(t.getTime())).is_utc=t.is_utc,r):(t.$$is_number||(t=o(nt,"Opal")["$coerce_to!"](t,o(nt,"Integer"),"to_int")),void 0===e?new Date(1e3*t):(e.$$is_number||(e=o(nt,"Opal")["$coerce_to!"](e,o(nt,"Integer"),"to_int")),new Date(1e3*t+e/1e3)))},d.$$arity=-2),t.defs(rt,"$new",p=function(t,e,r,n,i,$,a){var l,u;return null==e&&(e=s),null==r&&(r=s),null==n&&(n=s),null==i&&(i=s),null==$&&($=s),null==a&&(a=s),void 0===t?new Date:(a!==s&&this.$raise(o(nt,"ArgumentError"),"Opal does not support explicitly specifying UTC offset for Time"),t=(l=ot(t,e,r,n,i,$))[0],e=l[1],r=l[2],n=l[3],i=l[4],$=l[5],u=new Date(t,e,r,n,i,0,1e3*$),t<100&&u.setFullYear(t),u)},p.$$arity=-1),t.defs(rt,"$local",_=function(t,e,r,n,i,$,a,o,u,c){var h,f;return null==e&&(e=s),null==r&&(r=s),null==n&&(n=s),null==i&&(i=s),null==$&&($=s),null==a&&(a=s),null==o&&(o=s),null==u&&(u=s),null==c&&(c=s),10===arguments.length&&(t=(h=l.call(arguments))[5],e=h[4],r=h[3],n=h[2],i=h[1],$=h[0]),t=(h=ot(t,e,r,n,i,$))[0],e=h[1],r=h[2],n=h[3],i=h[4],$=h[5],f=new Date(t,e,r,n,i,0,1e3*$),t<100&&f.setFullYear(t),f},_.$$arity=-2),t.defs(rt,"$gm",y=function(t,e,r,n,i,$,a,o,u,c){var h,f;return null==e&&(e=s),null==r&&(r=s),null==n&&(n=s),null==i&&(i=s),null==$&&($=s),null==a&&(a=s),null==o&&(o=s),null==u&&(u=s),null==c&&(c=s),10===arguments.length&&(t=(h=l.call(arguments))[5],e=h[4],r=h[3],n=h[2],i=h[1],$=h[0]),t=(h=ot(t,e,r,n,i,$))[0],e=h[1],r=h[2],n=h[3],i=h[4],$=h[5],f=new Date(Date.UTC(t,e,r,n,i,0,1e3*$)),t<100&&f.setUTCFullYear(t),f.is_utc=!0,f},y.$$arity=-2),function(e,r){[e].concat(r);t.alias(e,"mktime","local"),t.alias(e,"utc","gm")}(t.get_singleton_class(rt),nt),t.defs(rt,"$now",g=function(){return this.$new()},g.$$arity=0),t.def(rt,"$+",m=function(t){c(o(nt,"Time")["$==="](t))&&this.$raise(o(nt,"TypeError"),"time + time?"),t.$$is_number||(t=o(nt,"Opal")["$coerce_to!"](t,o(nt,"Integer"),"to_int"));var e=new Date(this.getTime()+1e3*t);return e.is_utc=this.is_utc,e},m.$$arity=1),t.def(rt,"$-",v=function(t){if(c(o(nt,"Time")["$==="](t)))return(this.getTime()-t.getTime())/1e3;t.$$is_number||(t=o(nt,"Opal")["$coerce_to!"](t,o(nt,"Integer"),"to_int"));var e=new Date(this.getTime()-1e3*t);return e.is_utc=this.is_utc,e},v.$$arity=1),t.def(rt,"$<=>",b=function(t){var e,r,n=s;return c(o(nt,"Time")["$==="](t))?this.$to_f()["$<=>"](t.$to_f()):(n=t["$<=>"](this),c(n["$nil?"]())?s:c((r=0,"number"==typeof(e=n)&&"number"==typeof r?e>r:e["$>"](r)))?-1:c(function(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}(n,0))?1:0)},b.$$arity=1),t.def(rt,"$==",O=function(t){var e;return c(e=o(nt,"Time")["$==="](t))?this.$to_f()===t.$to_f():e},O.$$arity=1),t.def(rt,"$asctime",w=function(){return this.$strftime("%a %b %e %H:%M:%S %Y")},w.$$arity=0),t.alias(rt,"ctime","asctime"),t.def(rt,"$day",E=function(){return this.is_utc?this.getUTCDate():this.getDate()},E.$$arity=0),t.def(rt,"$yday",x=function(){var t;return t=o(nt,"Time").$new(this.$year()).$to_i(),86400,e(r(n(o(nt,"Time").$new(this.$year(),this.$month(),this.$day()).$to_i(),t),86400).$round(),1)},x.$$arity=0),t.def(rt,"$isdst",k=function(){var t=new Date(this.getFullYear(),0,1),e=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),e.getTimezoneOffset())},k.$$arity=0),t.alias(rt,"dst?","isdst"),t.def(rt,"$dup",A=function(){var t=s;return(t=new Date(this.getTime())).$copy_instance_variables(this),t.$initialize_dup(this),t},A.$$arity=0),t.def(rt,"$eql?",M=function(t){var e;return c(e=t["$is_a?"](o(nt,"Time")))?this["$<=>"](t)["$zero?"]():e},M.$$arity=1),t.def(rt,"$friday?",I=function(){return 5==this.$wday()},I.$$arity=0),t.def(rt,"$hash",S=function(){return"Time:"+this.getTime()},S.$$arity=0),t.def(rt,"$hour",N=function(){return this.is_utc?this.getUTCHours():this.getHours()},N.$$arity=0),t.def(rt,"$inspect",j=function(){return c(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")},j.$$arity=0),t.alias(rt,"mday","day"),t.def(rt,"$min",R=function(){return this.is_utc?this.getUTCMinutes():this.getMinutes()},R.$$arity=0),t.def(rt,"$mon",T=function(){return(this.is_utc?this.getUTCMonth():this.getMonth())+1},T.$$arity=0),t.def(rt,"$monday?",z=function(){return 1==this.$wday()},z.$$arity=0),t.alias(rt,"month","mon"),t.def(rt,"$saturday?",q=function(){return 6==this.$wday()},q.$$arity=0),t.def(rt,"$sec",C=function(){return this.is_utc?this.getUTCSeconds():this.getSeconds()},C.$$arity=0),t.def(rt,"$succ",P=function(){var t=new Date(this.getTime()+1e3);return t.is_utc=this.is_utc,t},P.$$arity=0),t.def(rt,"$usec",F=function(){return 1e3*this.getMilliseconds()},F.$$arity=0),t.def(rt,"$zone",D=function(){var t,e=this.toString();return"GMT"==(t=-1==e.indexOf("(")?e.match(/[A-Z]{3,4}/)[0]:e.match(/\((.+)\)(?:\s|$)/)[1])&&/(GMT\W*\d{4})/.test(e)?RegExp.$1:t},D.$$arity=0),t.def(rt,"$getgm",L=function(){var t=new Date(this.getTime());return t.is_utc=!0,t},L.$$arity=0),t.alias(rt,"getutc","getgm"),t.def(rt,"$gmtime",B=function(){return this.is_utc=!0,this},B.$$arity=0),t.alias(rt,"utc","gmtime"),t.def(rt,"$gmt?",U=function(){return!0===this.is_utc},U.$$arity=0),t.def(rt,"$gmt_offset",G=function(){return this.is_utc?0:60*-this.getTimezoneOffset()},G.$$arity=0),t.def(rt,"$strftime",H=function(t){var e=this;return t.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,(function(t,r,n,i,$){var a="",s=-1!==r.indexOf("0"),o=-1===r.indexOf("-"),l=-1!==r.indexOf("_"),u=-1!==r.indexOf("^"),c=-1!==r.indexOf("#"),f=(r.match(":")||[]).length;switch(n=parseInt(n,10),s&&l&&(r.indexOf("0")<r.indexOf("_")?s=!1:l=!1),$){case"Y":a+=e.$year();break;case"C":s=!l,a+=Math.round(e.$year()/100);break;case"y":s=!l,a+=e.$year()%100;break;case"m":s=!l,a+=e.$mon();break;case"B":a+=st[e.$mon()-1];break;case"b":case"h":l=!s,a+=at[e.$mon()-1];break;case"d":s=!l,a+=e.$day();break;case"e":l=!s,a+=e.$day();break;case"j":a+=e.$yday();break;case"H":s=!l,a+=e.$hour();break;case"k":l=!s,a+=e.$hour();break;case"I":s=!l,a+=e.$hour()%12||12;break;case"l":l=!s,a+=e.$hour()%12||12;break;case"P":a+=e.$hour()>=12?"pm":"am";break;case"p":a+=e.$hour()>=12?"PM":"AM";break;case"M":s=!l,a+=e.$min();break;case"S":s=!l,a+=e.$sec();break;case"L":s=!l,n=isNaN(n)?3:n,a+=e.getMilliseconds();break;case"N":n=isNaN(n)?9:n,a=(a+=e.getMilliseconds().toString().$rjust(3,"0")).$ljust(n,"0");break;case"z":var d=e.getTimezoneOffset(),p=Math.floor(Math.abs(d)/60),_=Math.abs(d)%60;a+=d<0?"+":"-",a+=p<10?"0":"",a+=p,f>0&&(a+=":"),a+=_<10?"0":"",a+=_,f>1&&(a+=":00");break;case"Z":a+=e.$zone();break;case"A":a+=it[e.$wday()];break;case"a":a+=$t[e.$wday()];break;case"u":a+=e.$wday()+1;break;case"w":a+=e.$wday();break;case"V":a+=e.$cweek_cyear()["$[]"](0).$to_s().$rjust(2,"0");break;case"G":a+=e.$cweek_cyear()["$[]"](1);break;case"g":a+=e.$cweek_cyear()["$[]"](1)["$[]"](h(-2,-1,!1));break;case"s":a+=e.$to_i();break;case"n":a+="\n";break;case"t":a+="\t";break;case"%":a+="%";break;case"c":a+=e.$strftime("%a %b %e %T %Y");break;case"D":case"x":a+=e.$strftime("%m/%d/%y");break;case"F":a+=e.$strftime("%Y-%m-%d");break;case"v":a+=e.$strftime("%e-%^b-%4Y");break;case"r":a+=e.$strftime("%I:%M:%S %p");break;case"R":a+=e.$strftime("%H:%M");break;case"T":case"X":a+=e.$strftime("%H:%M:%S");break;default:return t}return u&&(a=a.toUpperCase()),c&&(a=a.replace(/[A-Z]/,(function(t){t.toLowerCase()})).replace(/[a-z]/,(function(t){t.toUpperCase()}))),o&&(s||l)&&(a=a.$rjust(isNaN(n)?2:n,l?" ":"0")),a}))},H.$$arity=1),t.def(rt,"$sunday?",X=function(){return 0==this.$wday()},X.$$arity=0),t.def(rt,"$thursday?",Y=function(){return 4==this.$wday()},Y.$$arity=0),t.def(rt,"$to_a",K=function(){return[this.$sec(),this.$min(),this.$hour(),this.$day(),this.$month(),this.$year(),this.$wday(),this.$yday(),this.$isdst(),this.$zone()]},K.$$arity=0),t.def(rt,"$to_f",V=function(){return this.getTime()/1e3},V.$$arity=0),t.def(rt,"$to_i",Z=function(){return parseInt(this.getTime()/1e3,10)},Z.$$arity=0),t.alias(rt,"to_s","inspect"),t.def(rt,"$tuesday?",J=function(){return 2==this.$wday()},J.$$arity=0),t.alias(rt,"tv_sec","to_i"),t.alias(rt,"tv_usec","usec"),t.alias(rt,"utc?","gmt?"),t.alias(rt,"gmtoff","gmt_offset"),t.alias(rt,"utc_offset","gmt_offset"),t.def(rt,"$wday",Q=function(){return this.is_utc?this.getUTCDay():this.getDay()},Q.$$arity=0),t.def(rt,"$wednesday?",W=function(){return 3==this.$wday()},W.$$arity=0),t.def(rt,"$year",tt=function(){return this.is_utc?this.getUTCFullYear():this.getFullYear()},tt.$$arity=0),t.def(rt,"$cweek_cyear",et=function(){var t,$=s,a=s,l=s,u=s,h=s;return $=o(nt,"Time").$new(this.$year(),1,1).$wday(),0,a=this.$year(),c(c(t=i($,4))?$["$!="](0):t)?l=n($,1):(l=n(n($,7),1))["$=="](-8)&&(l=-1),u=r(e(this.$yday(),l),7).$ceil(),c(i(u,0))?o(nt,"Time").$new(n(this.$year(),1),12,31).$cweek_cyear():(u["$=="](53)&&(h=o(nt,"Time").$new(this.$year(),12,31).$wday(),c(c(t=i(h,3))?h["$!="](0):t)&&(u=1,a=e(a,1))),[u,a])},et.$$arity=0),s&&"cweek_cyear"}(a[0],Date,a)}};void 0===global.Opal.modules["corelib/enumerable"]&&"function"==typeof _&&_();var T=function(){global.Opal.modules["corelib/struct"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t>e:t["$>"](e)}function r(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}function n(t,e){return"number"==typeof t&&"number"==typeof e?t<e:t["$<"](e)}function i(t,e){return"number"==typeof t&&"number"==typeof e?t>=e:t["$>="](e)}function $(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}var a=t.top,s=[],o=t.nil,l=(t.const_get_qualified,t.const_get_relative),u=(t.breaker,t.slice,t.klass),c=t.hash2,h=t.truthy,f=t.send;return t.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","$each_with_object","$flatten","$to_a","$respond_to?","$dig"]),a.$require("corelib/enumerable"),function(a,s,d){var p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T=u(a,null,"Struct"),z=[T].concat(d);return T.$include(l(z,"Enumerable")),t.defs(T,"$new",p=function(e,r,n){var i,$,a,s,u,d,_=p.$$p,y=_||o,g=this,m=o;if(_&&(p.$$p=null),_&&(p.$$p=null),i=t.slice.call(arguments,1,arguments.length),null==($=t.extract_kwargs(i)))$=c([],{});else if(!$.$$is_hash)throw t.ArgumentError.$new("expected kwargs");if(a=i,null==(s=$.$$smap.keyword_init)&&(s=!1),h(e))try{e=l(z,"Opal")["$const_name!"](e)}catch(r){if(!t.rescue(r,[l(z,"TypeError"),l(z,"NameError")]))throw r;try{a.$unshift(e),e=o}finally{t.pop_exception()}}return f(a,"map",[],((u=function(t){null==u.$$s||u.$$s;return null==t&&(t=o),l(z,"Opal")["$coerce_to!"](t,l(z,"String"),"to_str")}).$$s=g,u.$$arity=1,u)),m=f(l(z,"Class"),"new",[g],((d=function(){var e,r=null==d.$$s?this:d.$$s;return f(a,"each",[],((e=function(t){var r=null==e.$$s?this:e.$$s;return null==t&&(t=o),r.$define_struct_attribute(t)}).$$s=r,e.$$arity=1,e)),function(e,r){var n;[e].concat(r);return t.def(e,"$new",n=function(e){var r,n=this,i=o;return r=t.slice.call(arguments,0,arguments.length),(i=n.$allocate()).$$data={},f(i,"initialize",t.to_a(r)),i},n.$$arity=-1),e.$alias_method("[]","new")}(t.get_singleton_class(r),z)}).$$s=g,d.$$arity=0,d)),h(y)&&f(m,"module_eval",[],y.$to_proc()),m.$$keyword_init=s,h(e)&&l(z,"Struct").$const_set(e,m),m},p.$$arity=-2),t.defs(T,"$define_struct_attribute",_=function(t){var e,r;return this["$=="](l(z,"Struct"))&&this.$raise(l(z,"ArgumentError"),"you cannot define attributes to the Struct class"),this.$members()["$<<"](t),f(this,"define_method",[t],((e=function(){return(null==e.$$s?this:e.$$s).$$data[t]}).$$s=this,e.$$arity=0,e)),f(this,"define_method",[t+"="],((r=function(e){var n=null==r.$$s?this:r.$$s;return null==e&&(e=o),n.$$data[t]=e}).$$s=this,r.$$arity=1,r))},_.$$arity=1),t.defs(T,"$members",y=function(){var t;return null==this.members&&(this.members=o),this["$=="](l(z,"Struct"))&&this.$raise(l(z,"ArgumentError"),"the Struct class has no members"),this.members=h(t=this.members)?t:[]},y.$$arity=0),t.defs(T,"$inherited",g=function(t){var e,r;return null==this.members&&(this.members=o),r=this.members,f(t,"instance_eval",[],((e=function(){return(null==e.$$s?this:e.$$s).members=r}).$$s=this,e.$$arity=0,e))},g.$$arity=1),t.def(T,"$initialize",m=function(n){var i,$,a,s,u,d=this,p=o,_=o;return i=t.slice.call(arguments,0,arguments.length),$=i,h(d.$class().$$keyword_init)?(p=h(a=$.$last())?a:c([],{}),h(h(a=e($.$length(),1))?a:1===$.length&&!p.$$is_hash)&&d.$raise(l(z,"ArgumentError"),"wrong number of arguments (given "+$.$length()+", expected 0)"),_=r(p.$keys(),d.$class().$members()),h(_["$any?"]())&&d.$raise(l(z,"ArgumentError"),"unknown keywords: "+_.$join(", ")),f(d.$class().$members(),"each",[],((s=function(e){var n,i=null==s.$$s?this:s.$$s;return null==e&&(e=o),n=[e,p["$[]"](e)],f(i,"[]=",t.to_a(n)),n[r(n.length,1)]}).$$s=d,s.$$arity=1,s))):(h(e($.$length(),d.$class().$members().$length()))&&d.$raise(l(z,"ArgumentError"),"struct size differs"),f(d.$class().$members(),"each_with_index",[],((u=function(e,n){var i,a=null==u.$$s?this:u.$$s;return null==e&&(e=o),null==n&&(n=o),i=[e,$["$[]"](n)],f(a,"[]=",t.to_a(i)),i[r(i.length,1)]}).$$s=d,u.$$arity=2,u)))},m.$$arity=-1),t.def(T,"$members",v=function(){return this.$class().$members()},v.$$arity=0),t.def(T,"$hash",b=function(){return l(z,"Hash").$new(this.$$data).$hash()},b.$$arity=0),t.def(T,"$[]",O=function(t){return h(l(z,"Integer")["$==="](t))?(h(n(t,this.$class().$members().$size()["$-@"]()))&&this.$raise(l(z,"IndexError"),"offset "+t+" too small for struct(size:"+this.$class().$members().$size()+")"),h(i(t,this.$class().$members().$size()))&&this.$raise(l(z,"IndexError"),"offset "+t+" too large for struct(size:"+this.$class().$members().$size()+")"),t=this.$class().$members()["$[]"](t)):h(l(z,"String")["$==="](t))?this.$$data.hasOwnProperty(t)||this.$raise(l(z,"NameError").$new("no member '"+t+"' in struct",t)):this.$raise(l(z,"TypeError"),"no implicit conversion of "+t.$class()+" into Integer"),t=l(z,"Opal")["$coerce_to!"](t,l(z,"String"),"to_str"),this.$$data[t]},O.$$arity=1),t.def(T,"$[]=",w=function(t,e){return h(l(z,"Integer")["$==="](t))?(h(n(t,this.$class().$members().$size()["$-@"]()))&&this.$raise(l(z,"IndexError"),"offset "+t+" too small for struct(size:"+this.$class().$members().$size()+")"),h(i(t,this.$class().$members().$size()))&&this.$raise(l(z,"IndexError"),"offset "+t+" too large for struct(size:"+this.$class().$members().$size()+")"),t=this.$class().$members()["$[]"](t)):h(l(z,"String")["$==="](t))?h(this.$class().$members()["$include?"](t.$to_sym()))||this.$raise(l(z,"NameError").$new("no member '"+t+"' in struct",t)):this.$raise(l(z,"TypeError"),"no implicit conversion of "+t.$class()+" into Integer"),t=l(z,"Opal")["$coerce_to!"](t,l(z,"String"),"to_str"),this.$$data[t]=e},w.$$arity=2),t.def(T,"$==",E=function(t){if(!h(t["$instance_of?"](this.$class())))return!1;var e={},r={};return function t(n,i){var $,a,s;for($ in e[n.$__id__()]=!0,r[i.$__id__()]=!0,n.$$data)if(a=n.$$data[$],s=i.$$data[$],l(z,"Struct")["$==="](a)){if(!(e.hasOwnProperty(a.$__id__())&&r.hasOwnProperty(s.$__id__())||t(a,s)))return!1}else if(!a["$=="](s))return!1;return!0}(this,t)},E.$$arity=1),t.def(T,"$eql?",x=function(t){if(!h(t["$instance_of?"](this.$class())))return!1;var e={},r={};return function t(n,i){var $,a,s;for($ in e[n.$__id__()]=!0,r[i.$__id__()]=!0,n.$$data)if(a=n.$$data[$],s=i.$$data[$],l(z,"Struct")["$==="](a)){if(!(e.hasOwnProperty(a.$__id__())&&r.hasOwnProperty(s.$__id__())||t(a,s)))return!1}else if(!a["$eql?"](s))return!1;return!0}(this,t)},x.$$arity=1),t.def(T,"$each",k=function(){var e,r,n=k.$$p,i=n||o;return n&&(k.$$p=null),i===o?f(this,"enum_for",["each"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e)):(f(this.$class().$members(),"each",[],((r=function(e){var n=null==r.$$s?this:r.$$s;return null==e&&(e=o),t.yield1(i,n["$[]"](e))}).$$s=this,r.$$arity=1,r)),this)},k.$$arity=0),t.def(T,"$each_pair",A=function(){var e,r,n=A.$$p,i=n||o;return n&&(A.$$p=null),i===o?f(this,"enum_for",["each_pair"],((e=function(){return(null==e.$$s?this:e.$$s).$size()}).$$s=this,e.$$arity=0,e)):(f(this.$class().$members(),"each",[],((r=function(e){var n=null==r.$$s?this:r.$$s;return null==e&&(e=o),t.yield1(i,[e,n["$[]"](e)])}).$$s=this,r.$$arity=1,r)),this)},A.$$arity=0),t.def(T,"$length",M=function(){return this.$class().$members().$length()},M.$$arity=0),t.alias(T,"size","length"),t.def(T,"$to_a",I=function(){var t;return f(this.$class().$members(),"map",[],((t=function(e){var r=null==t.$$s?this:t.$$s;return null==e&&(e=o),r["$[]"](e)}).$$s=this,t.$$arity=1,t))},I.$$arity=0),t.alias(T,"values","to_a"),t.def(T,"$inspect",S=function(){var t,e,r=o;return r="#<struct ",h(h(t=l(z,"Struct")["$==="](this))?this.$class().$name():t)&&(r=$(r,this.$class()+" ")),r=$(r,f(this.$each_pair(),"map",[],(e=function(t,r){null==e.$$s||e.$$s;return null==t&&(t=o),null==r&&(r=o),t+"="+r.$inspect()},e.$$s=this,e.$$arity=2,e)).$join(", ")),r=$(r,">")},S.$$arity=0),t.alias(T,"to_s","inspect"),t.def(T,"$to_h",N=function(){var e;return f(this.$class().$members(),"each_with_object",[c([],{})],((e=function(n,i){var $,a=null==e.$$s?this:e.$$s;return null==n&&(n=o),null==i&&(i=o),$=[n,a["$[]"](n)],f(i,"[]=",t.to_a($)),$[r($.length,1)]}).$$s=this,e.$$arity=2,e))},N.$$arity=0),t.def(T,"$values_at",j=function(e){var r,n,i,$=this;r=t.slice.call(arguments,0,arguments.length);for(var a=[],s=0,u=(n=f(n=r,"map",[],(i=function(t){null==i.$$s||i.$$s;return null==t&&(t=o),t.$$is_range?t.$to_a():t},i.$$s=$,i.$$arity=1,i)).$flatten()).length;s<u;s++)n[s].$$is_number||$.$raise(l(z,"TypeError"),"no implicit conversion of "+n[s].$class()+" into Integer"),a.push($["$[]"](n[s]));return a},j.$$arity=-1),t.def(T,"$dig",R=function(e,r){var n,i=this,$=o;return n=t.slice.call(arguments,1,arguments.length),($=h(e.$$is_string&&i.$$data.hasOwnProperty(e))&&i.$$data[e]||o)===o||0===n.length?$:(h($["$respond_to?"]("dig"))||i.$raise(l(z,"TypeError"),$.$class()+" does not have #dig method"),f($,"dig",t.to_a(n)))},R.$$arity=-2),o&&"dig"}(s[0],0,s)}};var z=function(){global.Opal.modules["corelib/io"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}t.top;var r=[],n=t.nil,i=t.const_get_qualified,$=t.const_get_relative,a=(t.breaker,t.slice,t.klass),s=t.module,o=t.send,l=t.gvars,u=t.truthy,c=n;t.add_stubs(["$attr_accessor","$size","$write","$join","$map","$String","$empty?","$concat","$chomp","$getbyte","$getc","$raise","$new","$write_proc=","$-","$extend"]),function(e,r,i){var c,h,f,d,p=a(e,null,"IO"),_=[p].concat(i);p.$$prototype.tty=p.$$prototype.closed=n,t.const_set(_[0],"SEEK_SET",0),t.const_set(_[0],"SEEK_CUR",1),t.const_set(_[0],"SEEK_END",2),t.def(p,"$tty?",c=function(){return this.tty},c.$$arity=0),t.def(p,"$closed?",h=function(){return this.closed},h.$$arity=0),p.$attr_accessor("write_proc"),t.def(p,"$write",f=function(t){return this.write_proc(t),t.$size()},f.$$arity=1),p.$attr_accessor("sync","tty"),t.def(p,"$flush",d=function(){return n},d.$$arity=0),function(e,r){var i,$,a,c=s(e,"Writable");[c].concat(r);t.def(c,"$<<",i=function(t){return this.$write(t),this},i.$$arity=1),t.def(c,"$print",$=function(e){var r,i,$=this;return null==l[","]&&(l[","]=n),r=t.slice.call(arguments,0,arguments.length),$.$write(o(r,"map",[],(i=function(t){var e=null==i.$$s?this:i.$$s;return null==t&&(t=n),e.$String(t)},i.$$s=$,i.$$arity=1,i)).$join(l[","])),n},$.$$arity=-1),t.def(c,"$puts",a=function(e){var r,i,$=this,a=n;return null==l["/"]&&(l["/"]=n),r=t.slice.call(arguments,0,arguments.length),a=l["/"],u(r["$empty?"]())?$.$write(l["/"]):$.$write(o(r,"map",[],(i=function(t){var e=null==i.$$s?this:i.$$s;return null==t&&(t=n),e.$String(t).$chomp()},i.$$s=$,i.$$arity=1,i)).$concat([n]).$join(a)),n},a.$$arity=-1)}(_[0],_),function(e,r){var i,a,o,u,c=s(e,"Readable"),h=[c].concat(r);t.def(c,"$readbyte",i=function(){return this.$getbyte()},i.$$arity=0),t.def(c,"$readchar",a=function(){return this.$getc()},a.$$arity=0),t.def(c,"$readline",o=function(t){return null==l["/"]&&(l["/"]=n),null==t&&(t=l["/"]),this.$raise($(h,"NotImplementedError"))},o.$$arity=-1),t.def(c,"$readpartial",u=function(t,e){return null==e&&(e=n),this.$raise($(h,"NotImplementedError"))},u.$$arity=-2)}(_[0],_)}(r[0],0,r),t.const_set(r[0],"STDERR",l.stderr=$(r,"IO").$new()),t.const_set(r[0],"STDIN",l.stdin=$(r,"IO").$new()),t.const_set(r[0],"STDOUT",l.stdout=$(r,"IO").$new());var h=t.global.console;return c=["object"==typeof process&&"object"==typeof process.stdout?function(t){process.stdout.write(t)}:function(t){h.log(t)}],o($(r,"STDOUT"),"write_proc=",t.to_a(c)),c[e(c.length,1)],c=["object"==typeof process&&"object"==typeof process.stderr?function(t){process.stderr.write(t)}:function(t){h.warn(t)}],o($(r,"STDERR"),"write_proc=",t.to_a(c)),c[e(c.length,1)],$(r,"STDOUT").$extend(i($(r,"IO"),"Writable")),$(r,"STDERR").$extend(i($(r,"IO"),"Writable"))}};var q=function(){global.Opal.modules["corelib/main"]=function(t){var e,r,n=t.top,i=[],$=t.nil,a=(t.const_get_qualified,t.const_get_relative);t.breaker,t.slice;return t.add_stubs(["$include"]),t.defs(n,"$to_s",e=function(){return"main"},e.$$arity=0),t.defs(n,"$include",r=function(t){return a(i,"Object").$include(t)},r.$$arity=1),$&&"include"}};var C=function(){global.Opal.modules["corelib/dir"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.truthy;return t.add_stubs(["$[]"]),function(e,a,s){var o=i(e,null,"Dir"),l=[o].concat(s);return function(e,i){var a,s,o,l=[e].concat(i);return t.def(e,"$chdir",a=function(e){var n=a.$$p,i=n||r,$=r;return n&&(a.$$p=null),function(){try{return $=t.current_dir,t.current_dir=e,t.yieldX(i,[])}finally{t.current_dir=$}}()},a.$$arity=1),t.def(e,"$pwd",s=function(){return t.current_dir||"."},s.$$arity=0),t.alias(e,"getwd","pwd"),t.def(e,"$home",o=function(){var t;return $(t=n(l,"ENV")["$[]"]("HOME"))?t:"."},o.$$arity=0),r&&"home"}(t.get_singleton_class(o),l)}(e[0],0,e)}};var P=function(){global.Opal.modules["corelib/file"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t+e:t["$+"](e)}t.top;var r=[],n=t.nil,i=(t.const_get_qualified,t.const_get_relative),$=(t.breaker,t.slice,t.klass),a=t.truthy,s=t.range,o=t.send;return t.add_stubs(["$respond_to?","$to_path","$pwd","$split","$sub","$+","$unshift","$join","$home","$raise","$start_with?","$absolute_path","$coerce_to!","$basename","$empty?","$rindex","$[]","$nil?","$==","$-","$length","$gsub","$find","$=~","$map","$each_with_index","$flatten","$reject","$to_proc","$end_with?"]),function(r,l,u){var c=$(r,l,"File"),h=[c].concat(u),f=n;return t.const_set(h[0],"Separator",t.const_set(h[0],"SEPARATOR","/")),t.const_set(h[0],"ALT_SEPARATOR",n),t.const_set(h[0],"PATH_SEPARATOR",":"),t.const_set(h[0],"FNM_SYSCASE",0),f=/^[a-zA-Z]:(?:\\|\/)/,function(r,$){var l,u,c,h,d,p,_,y,g,m=[r].concat($);function v(t){return a(t["$respond_to?"]("to_path"))&&(t=t.$to_path()),t=i(m,"Opal")["$coerce_to!"](t,i(m,"String"),"to_str")}function b(){return i(m,"ALT_SEPARATOR")===n?t.escape_regexp(i(m,"SEPARATOR")):t.escape_regexp(e(i(m,"SEPARATOR"),i(m,"ALT_SEPARATOR")))}return t.def(r,"$absolute_path",l=function(t,r){var $,s,o,l,u,c,h=n,d=n,p=n,_=n,y=n;null==r&&(r=n),s=i(m,"SEPARATOR"),o=b(),h=[],t=a(t["$respond_to?"]("to_path"))?t.$to_path():t,r=a($=r)?$:i(m,"Dir").$pwd(),l=t.substr(0,s.length)===s||f.test(t),u=r.substr(0,s.length)===s||f.test(r),a(l)?(d=t.$split(new RegExp("["+o+"]")),p=f.test(t)?"":t.$sub(new RegExp("^(["+o+"]+).*$"),"\\1"),_=!0):(d=e(r.$split(new RegExp("["+o+"]")),t.$split(new RegExp("["+o+"]"))),p=f.test(r)?"":r.$sub(new RegExp("^(["+o+"]+).*$"),"\\1"),_=u);for(var g=0,v=d.length;g<v;g++)(c=d[g])===n||""===c&&(0===h.length||_)||"."===c&&(0===h.length||_)||(".."===c?h.pop():h.push(c));return _||"."===d[0]||h.$unshift("."),y=h.$join(s),a(_)&&(y=e(p,y)),y},l.$$arity=-2),t.def(r,"$expand_path",u=function(t,r){var $,s,o=n,l=n,u=n;return null==r&&(r=n),$=i(m,"SEPARATOR"),s=b(),a("~"===t[0]||r&&"~"===r[0])&&(o=i(m,"Dir").$home(),a(o)||this.$raise(i(m,"ArgumentError"),"couldn't find HOME environment -- expanding `~'"),l=f.test(o)?"":o.$sub(new RegExp("^(["+s+"]+).*$"),"\\1"),a(o["$start_with?"](l))||this.$raise(i(m,"ArgumentError"),"non-absolute home"),o=e(o,$),u=new RegExp("^\\~(?:"+$+"|$)"),t=t.$sub(u,o),a(r)&&(r=r.$sub(u,o))),this.$absolute_path(t,r)},u.$$arity=-2),t.alias(r,"realpath","expand_path"),t.def(r,"$dirname",c=function(t){var e;e=b();var r=(t=v(t)).match(new RegExp("^["+e+"]"));return""===(t=(t=(t=t.replace(new RegExp("["+e+"]+$"),"")).replace(new RegExp("[^"+e+"]+$"),"")).replace(new RegExp("["+e+"]+$"),""))?r?"/":".":t},c.$$arity=1),t.def(r,"$basename",h=function(e,r){var $;return null==r&&(r=n),$=b(),0==(e=v(e)).length?e:(r=r!==n?i(m,"Opal")["$coerce_to!"](r,i(m,"String"),"to_str"):null,e=(e=e.replace(new RegExp("(.)["+$+"]*$"),"$1")).replace(new RegExp("^(?:.*["+$+"])?([^"+$+"]+)$"),"$1"),".*"===r?e=e.replace(/\.[^\.]+$/,""):null!==r&&(r=t.escape_regexp(r),e=e.replace(new RegExp(r+"$"),"")),e)},h.$$arity=-2),t.def(r,"$extname",d=function(r){var i,$,o,l=n,u=n;return r=v(r),l=this.$basename(r),a(l["$empty?"]())?"":(u=l["$[]"](s(1,-1,!1)).$rindex("."),a(a(i=u["$nil?"]())?i:e(u,1)["$=="](($=l.$length(),o=1,"number"==typeof $&&"number"==typeof o?$-o:$["$-"](o))))?"":l["$[]"](t.Range.$new(e(u,1),-1,!1)))},d.$$arity=1),t.def(r,"$exist?",p=function(e){return null!=t.modules[e]},p.$$arity=1),t.alias(r,"exists?","exist?"),t.def(r,"$directory?",_=function(e){var r,$=n;for(var a in $=[],t.modules)$.push(a);return e=e.$gsub(new RegExp("(^."+i(m,"SEPARATOR")+"+|"+i(m,"SEPARATOR")+"+$)")),o($,"find",[],((r=function(t){null==r.$$s||r.$$s;return null==t&&(t=n),t["$=~"](new RegExp("^"+e))}).$$s=this,r.$$arity=1,r))},_.$$arity=1),t.def(r,"$join",y=function(r){var $,s,l,u,c=this,h=n;return $=t.slice.call(arguments,0,arguments.length),a((s=$)["$empty?"]())?"":(h="",s=o(s.$flatten().$each_with_index(),"map",[],((l=function(t,r){null==l.$$s||l.$$s;return null==t&&(t=n),null==r&&(r=n),a(r["$=="](0)?t["$empty?"]():r["$=="](0))?i(m,"SEPARATOR"):a(s.$length()["$=="](e(r,1))?t["$empty?"]():s.$length()["$=="](e(r,1)))?i(m,"SEPARATOR"):t}).$$s=c,l.$$arity=2,l)),s=o(s,"reject",[],"empty?".$to_proc()),o(s,"each_with_index",[],((u=function(t,r){null==u.$$s||u.$$s;var $,o=n;return null==t&&(t=n),null==r&&(r=n),o=s["$[]"](e(r,1)),a(o["$nil?"]())?h=""+h+t:(a(a($=t["$end_with?"](i(m,"SEPARATOR")))?o["$start_with?"](i(m,"SEPARATOR")):$)&&(t=t.$sub(new RegExp(i(m,"SEPARATOR")+"+$"),"")),h=a(a($=t["$end_with?"](i(m,"SEPARATOR")))?$:o["$start_with?"](i(m,"SEPARATOR")))?""+h+t:""+h+t+i(m,"SEPARATOR"))}).$$s=c,u.$$arity=2,u)),h)},y.$$arity=-1),t.def(r,"$split",g=function(t){return t.$split(i(m,"SEPARATOR"))},g.$$arity=1),n&&"split"}(t.get_singleton_class(c),h)}(r[0],i(r,"IO"),r)}};var F=function(){global.Opal.modules["corelib/process"]=function(t){t.top;var e=[],r=t.nil,n=t.const_get_qualified,i=t.const_get_relative,$=(t.breaker,t.slice,t.klass),a=t.truthy;return t.add_stubs(["$const_set","$size","$<<","$__register_clock__","$to_f","$now","$new","$[]","$raise"]),function(e,s,o){var l,u,c,h,f=$(e,null,"Process"),d=[f].concat(o),p=r;if(f.__clocks__=[],t.defs(f,"$__register_clock__",l=function(t,e){return null==this.__clocks__&&(this.__clocks__=r),this.$const_set(t,this.__clocks__.$size()),this.__clocks__["$<<"](e)},l.$$arity=2),f.$__register_clock__("CLOCK_REALTIME",(function(){return Date.now()})),p=!1,t.global.performance)p=function(){return performance.now()};else if(t.global.process&&process.hrtime){var _=process.hrtime();p=function(){var t=process.hrtime(_),e=t[1]/1e3|0;return 1e3*t[0]+e/1e3}}a(p)&&f.$__register_clock__("CLOCK_MONOTONIC",p),t.defs(f,"$pid",u=function(){return 0},u.$$arity=0),t.defs(f,"$times",c=function(){var t;return t=i(d,"Time").$now().$to_f(),n(i(d,"Benchmark"),"Tms").$new(t,t,t,t,t)},c.$$arity=0),t.defs(f,"$clock_gettime",h=function(t,e){var $=r;null==this.__clocks__&&(this.__clocks__=r),null==e&&(e="float_second"),a($=this.__clocks__["$[]"](t))||this.$raise(n(i(d,"Errno"),"EINVAL"),"clock_gettime("+t+") "+this.__clocks__["$[]"](t));var s=$();switch(e){case"float_second":return s/1e3;case"float_millisecond":return s/1;case"float_microsecond":return 1e3*s;case"second":return s/1e3|0;case"millisecond":return s/1|0;case"microsecond":return 1e3*s|0;case"nanosecond":return 1e6*s|0;default:this.$raise(i(d,"ArgumentError"),"unexpected unit: "+e)}},h.$$arity=-2)}(e[0],0,e),function(e,n,i){var a,s=$(e,null,"Signal");[s].concat(i);t.defs(s,"$trap",a=function(e){return t.slice.call(arguments,0,arguments.length),r},a.$$arity=-1)}(e[0],0,e),function(e,n,i){var a,s=$(e,null,"GC");[s].concat(i);return t.defs(s,"$start",a=function(){return r},a.$$arity=0),r&&"start"}(e[0],0,e)}};var D=function(){global.Opal.modules["corelib/random"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.klass),$=t.truthy,a=t.send;return t.add_stubs(["$attr_reader","$new_seed","$coerce_to!","$reseed","$rand","$seed","$<","$raise","$encode","$join","$new","$chr","$===","$==","$state","$const_defined?","$const_set"]),function(e,s,o){var l,u,c,h,f,d,p,_,y,g,m=i(e,null,"Random"),v=[m].concat(o);return m.$attr_reader("seed","state"),t.def(m,"$initialize",l=function(t){return null==t&&(t=n(v,"Random").$new_seed()),t=n(v,"Opal")["$coerce_to!"](t,n(v,"Integer"),"to_int"),this.state=t,this.$reseed(t)},l.$$arity=-1),t.def(m,"$reseed",u=function(e){return this.seed=e,this.$rng=t.$$rand.reseed(e)},u.$$arity=1),t.defs(m,"$new_seed",c=function(){return t.$$rand.new_seed()},c.$$arity=0),t.defs(m,"$rand",h=function(t){return n(v,"DEFAULT").$rand(t)},h.$$arity=-1),t.defs(m,"$srand",f=function(t){var e;return null==t&&(t=n(v,"Random").$new_seed()),t=n(v,"Opal")["$coerce_to!"](t,n(v,"Integer"),"to_int"),e=n(v,"DEFAULT").$seed(),n(v,"DEFAULT").$reseed(t),e},f.$$arity=-1),t.defs(m,"$urandom",d=function(t){var e,r,i;return t=n(v,"Opal")["$coerce_to!"](t,n(v,"Integer"),"to_int"),$((i=0,"number"==typeof(r=t)&&"number"==typeof i?r<i:r["$<"](i)))&&this.$raise(n(v,"ArgumentError"),"negative string size (or size too big)"),a(n(v,"Array"),"new",[t],(e=function(){return(null==e.$$s?this:e.$$s).$rand(255).$chr()},e.$$s=this,e.$$arity=0,e)).$join().$encode("ASCII-8BIT")},d.$$arity=1),t.def(m,"$==",p=function(t){return!!$(n(v,"Random")["$==="](t))&&(this.$seed()["$=="](t.$seed())?this.$state()["$=="](t.$state()):this.$seed()["$=="](t.$seed()))},p.$$arity=1),t.def(m,"$bytes",_=function(t){var e;return t=n(v,"Opal")["$coerce_to!"](t,n(v,"Integer"),"to_int"),a(n(v,"Array"),"new",[t],(e=function(){return(null==e.$$s?this:e.$$s).$rand(255).$chr()},e.$$s=this,e.$$arity=0,e)).$join().$encode("ASCII-8BIT")},_.$$arity=1),t.def(m,"$rand",y=function(e){var i=this;function $(){return i.state++,t.$$rand.rand(i.$rng)}function a(){return Math.floor($()*e)}return null==e?$():e.$$is_range?function(){var t=e.begin,n=e.end;if(t===r||n===r)return r;var $=n-t;return $<0?r:0===$?t:(n%1!=0||t%1!=0||e.excl||$++,i.$rand($)+t)}():e.$$is_number?(e<=0&&i.$raise(n(v,"ArgumentError"),"invalid argument - "+e),e%1==0?a():$()*e):((e=n(v,"Opal")["$coerce_to!"](e,n(v,"Integer"),"to_int"))<=0&&i.$raise(n(v,"ArgumentError"),"invalid argument - "+e),a())},y.$$arity=-1),t.defs(m,"$generator=",g=function(e){return t.$$rand=e,$(this["$const_defined?"]("DEFAULT"))?n(v,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))},g.$$arity=1),r&&"generator="}(e[0],0,e)}};var L=function(){global.Opal.modules["corelib/random/mersenne_twister"]=function(t){t.top;var e=[],r=(t.nil,t.const_get_qualified,t.const_get_relative),n=(t.breaker,t.slice,t.klass),i=t.send;t.add_stubs(["$generator=","$-"]);var $=function(){var t=624,e=397,r=function(t,e){return function(t,e){return 2147483648&t|2147483647&e}(t,e)>>>1^(1&e?2567483615:0)};function n(n){var i;return--n.left<=0&&function(n){var i,$=0,a=n.state;for(n.left=t,n.next=0,i=t-e+1;--i;$++)a[$]=a[$+e]^r(a[$+0],a[$+1]);for(i=e;--i;$++)a[$]=a[$+(e-t)]^r(a[$+0],a[$+1]);a[$]=a[$+(e-t)]^r(a[$+0],a[0])}(n),i=n.state[n.next++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,(i^=i>>>18)>>>0}return{genrand_real:function(t){return function(t,e){return(67108864*(t>>>=5)+(e>>>=6))*(1/9007199254740992)}(n(t),n(t))},init:function(e){var r={left:0,next:t,state:new Array(t)};return function(e,r){var n;for(e.state[0]=r>>>0,n=1;n<t;n++)e.state[n]=1812433253*(e.state[n-1]^e.state[n-1]>>30>>>0)+n,e.state[n]&=4294967295;e.left=1,e.next=t}(r,e),r}}}();return function(e,a,s){var o,l,u,c=n(e,null,"Random"),h=[c].concat(s),f=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1;return t.const_set(h[0],"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*f)},reseed:function(t){return $.init(t)},rand:function(t){return $.genrand_real(t)}}),o=[r(h,"MERSENNE_TWISTER_GENERATOR")],i(c,"generator=",t.to_a(o)),o[(l=o.length,u=1,"number"==typeof l&&"number"==typeof u?l-u:l["$-"](u))]}(e[0],0,e)}};var B=function(){global.Opal.modules["corelib/unsupported"]=function(t){var e,r,n=t.top,i=[],$=t.nil,a=(t.const_get_qualified,t.const_get_relative),s=(t.breaker,t.slice,t.klass),o=t.module;t.add_stubs(["$raise","$warn","$%"]);var l={};function u(e){switch(t.config.unsupported_features_severity){case"error":a(i,"Kernel").$raise(a(i,"NotImplementedError"),e);break;case"warning":!function(t){if(l[t])return;l[t]=!0,n.$warn(t)}(e)}}return function(e,r,n){var i,$,o,l,u,c,h,f,d,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I=s(e,null,"String"),S=[I].concat(n),N="String#%s not supported. Mutable String methods are not supported in Opal.";t.def(I,"$<<",i=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("<<"))},i.$$arity=-1),t.def(I,"$capitalize!",$=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("capitalize!"))},$.$$arity=-1),t.def(I,"$chomp!",o=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("chomp!"))},o.$$arity=-1),t.def(I,"$chop!",l=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("chop!"))},l.$$arity=-1),t.def(I,"$downcase!",u=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("downcase!"))},u.$$arity=-1),t.def(I,"$gsub!",c=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("gsub!"))},c.$$arity=-1),t.def(I,"$lstrip!",h=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("lstrip!"))},h.$$arity=-1),t.def(I,"$next!",f=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("next!"))},f.$$arity=-1),t.def(I,"$reverse!",d=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("reverse!"))},d.$$arity=-1),t.def(I,"$slice!",p=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("slice!"))},p.$$arity=-1),t.def(I,"$squeeze!",_=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("squeeze!"))},_.$$arity=-1),t.def(I,"$strip!",y=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("strip!"))},y.$$arity=-1),t.def(I,"$sub!",g=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("sub!"))},g.$$arity=-1),t.def(I,"$succ!",m=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("succ!"))},m.$$arity=-1),t.def(I,"$swapcase!",v=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("swapcase!"))},v.$$arity=-1),t.def(I,"$tr!",b=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("tr!"))},b.$$arity=-1),t.def(I,"$tr_s!",O=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("tr_s!"))},O.$$arity=-1),t.def(I,"$upcase!",w=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("upcase!"))},w.$$arity=-1),t.def(I,"$prepend",E=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("prepend"))},E.$$arity=-1),t.def(I,"$[]=",x=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("[]="))},x.$$arity=-1),t.def(I,"$clear",k=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("clear"))},k.$$arity=-1),t.def(I,"$encode!",A=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("encode!"))},A.$$arity=-1),t.def(I,"$unicode_normalize!",M=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a(S,"NotImplementedError"),N["$%"]("unicode_normalize!"))},M.$$arity=-1)}(i[0],0,i),function(e,r){var n,i,$=o(e,"Kernel"),a=([$].concat(r),"Object freezing is not supported by Opal");t.def($,"$freeze",n=function(){return u(a),this},n.$$arity=0),t.def($,"$frozen?",i=function(){return u(a),!1},i.$$arity=0)}(i[0],i),function(e,r){var n,i,$,a=o(e,"Kernel"),s=([a].concat(r),"Object tainting is not supported by Opal");t.def(a,"$taint",n=function(){return u(s),this},n.$$arity=0),t.def(a,"$untaint",i=function(){return u(s),this},i.$$arity=0),t.def(a,"$tainted?",$=function(){return u(s),!1},$.$$arity=0)}(i[0],i),function(e,r,n){var i,a,o,l,u=s(e,null,"Module");[u].concat(n);t.def(u,"$public",i=function(e){var r=this;return 0===t.slice.call(arguments,0,arguments.length).length&&(r.$$module_function=!1),$},i.$$arity=-1),t.alias(u,"private","public"),t.alias(u,"protected","public"),t.alias(u,"nesting","public"),t.def(u,"$private_class_method",a=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r},a.$$arity=-1),t.alias(u,"public_class_method","private_class_method"),t.def(u,"$private_method_defined?",o=function(t){return!1},o.$$arity=1),t.def(u,"$private_constant",l=function(e){return t.slice.call(arguments,0,arguments.length),$},l.$$arity=-1),t.alias(u,"protected_method_defined?","private_method_defined?"),t.alias(u,"public_instance_methods","instance_methods"),t.alias(u,"public_instance_method","instance_method"),t.alias(u,"public_method_defined?","method_defined?")}(i[0],0,i),function(e,r){var n,i=o(e,"Kernel");[i].concat(r);t.def(i,"$private_methods",n=function(e){return t.slice.call(arguments,0,arguments.length),[]},n.$$arity=-1),t.alias(i,"private_instance_methods","private_methods")}(i[0],i),function(e,r){var n,i=o(e,"Kernel"),$=[i].concat(r);t.def(i,"$eval",n=function(e){var r=this;return t.slice.call(arguments,0,arguments.length),r.$raise(a($,"NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. See https://github.com/opal/opal/blob/"+a($,"RUBY_ENGINE_VERSION")+"/docs/opal_parser.md for details.")},n.$$arity=-1)}(i[0],i),t.defs(n,"$public",e=function(e){return t.slice.call(arguments,0,arguments.length),$},e.$$arity=-1),t.defs(n,"$private",r=function(e){return t.slice.call(arguments,0,arguments.length),$},r.$$arity=-1),$&&"private"}};void 0===global.Opal.modules["opal/base"]&&"function"==typeof u&&u(),void 0===global.Opal.modules["opal/mini"]&&"function"==typeof A&&A(),void 0===global.Opal.modules["corelib/kernel/format"]&&"function"==typeof M&&M(),void 0===global.Opal.modules["corelib/string/encoding"]&&"function"==typeof I&&I(),void 0===global.Opal.modules["corelib/math"]&&"function"==typeof S&&S(),void 0===global.Opal.modules["corelib/complex"]&&"function"==typeof N&&N(),void 0===global.Opal.modules["corelib/rational"]&&"function"==typeof j&&j(),void 0===global.Opal.modules["corelib/time"]&&"function"==typeof R&&R(),void 0===global.Opal.modules["corelib/struct"]&&"function"==typeof T&&T(),void 0===global.Opal.modules["corelib/io"]&&"function"==typeof z&&z(),void 0===global.Opal.modules["corelib/main"]&&"function"==typeof q&&q(),void 0===global.Opal.modules["corelib/dir"]&&"function"==typeof C&&C(),void 0===global.Opal.modules["corelib/file"]&&"function"==typeof P&&P(),void 0===global.Opal.modules["corelib/process"]&&"function"==typeof F&&F(),void 0===global.Opal.modules["corelib/random"]&&"function"==typeof D&&D(),void 0===global.Opal.modules["corelib/random/mersenne_twister"]&&"function"==typeof L&&L(),void 0===global.Opal.modules["corelib/unsupported"]&&"function"==typeof B&&B();e.a=function(){global.Opal.modules.opal=function(t){var e=t.top;t.nil,t.const_get_qualified,t.const_get_relative,t.breaker,t.slice;return t.add_stubs(["$require"]),e.$require("opal/base"),e.$require("opal/mini"),e.$require("corelib/kernel/format"),e.$require("corelib/string/encoding"),e.$require("corelib/math"),e.$require("corelib/complex"),e.$require("corelib/rational"),e.$require("corelib/time"),e.$require("corelib/struct"),e.$require("corelib/io"),e.$require("corelib/main"),e.$require("corelib/dir"),e.$require("corelib/file"),e.$require("corelib/process"),e.$require("corelib/random"),e.$require("corelib/random/mersenne_twister.js"),e.$require("corelib/unsupported")}}},function(t,e,r){"use strict";var n=function(){global.Opal.modules["nodejs/kernel"]=function(t){t.top;var e=[],n=(t.nil,t.const_get_qualified,t.const_get_relative),i=(t.breaker,t.slice,t.module);return t.add_stubs(["$warn","$to_str"]),t.exit=process.exit,function(e,$){var a,s,o=i(e,"Kernel"),l=[o].concat($);t.const_set(l[0],"NODE_REQUIRE",r(21)),t.def(o,"$caller",a=function(e){var r;t.slice.call(arguments,0,arguments.length);try{var n=Error("my error");throw n}catch(t){r=t.stack}return r.$split("\n").slice(3)},a.$$arity=-1),t.def(o,"$node_require",s=function(t){return this.$warn("[DEPRECATION] node_require is deprecated. Please use `require('module')` instead."),n(l,"NODE_REQUIRE")(t.$to_str())},s.$$arity=1)}(e[0],e),t.const_set(e[0],"ARGV",process.argv.slice(2))}};var i=function(){global.Opal.modules["nodejs/file"]=function(t){var e=t.top,n=[],i=t.nil,$=t.const_get_qualified,a=t.const_get_relative,s=(t.breaker,t.slice,t.klass),o=t.truthy,l=t.gvars;t.add_stubs(["$raise","$warn","$const_get","$new","$const_defined?","$const_set","$include","$size","$respond_to?","$path","$join","$call","$exist?","$realpath","$!=","$close","$to_path","$pwd","$to_str","$include?","$delete","$match?","$sub","$attr_reader","$to_a","$each_line","$to_enum","$read","$chomp"]);var u,c={},h=["EACCES","EISDIR","EMFILE","ENOENT","EPERM"];function f(r){switch(t.config.unsupported_features_severity){case"error":a(n,"Kernel").$raise(a(n,"NotImplementedError"),r);break;case"warning":!function(t){if(c[t])return;c[t]=!0,e.$warn(t)}(r)}}function d(t){try{return t()}catch(t){if(h.indexOf(t.code)>=0)throw a(n,"Errno").$const_get(t.code).$new(t.message);throw t}}for(var p=0,_=h.length;p<_;p++)u=h[p],a(n,"Errno")["$const_defined?"](u)||a(n,"Errno").$const_set(u,a(n,"Class").$new(a(n,"SystemCallError")));return function(e,n,u){var c,h,p,_,y,g,m,v,b,O,w,E,x,k,A,M,I,S,N,j,R,T,z=s(e,n,"File"),q=[z].concat(u);null==z.__fs__&&(z.__fs__=i),null==z.__path__&&(z.__path__=i),null==z.__util__&&(z.__util__=i),z.$$prototype.eof=z.$$prototype.binary_flag=z.$$prototype.path=z.$$prototype.fd=i,z.$include($($("::","IO"),"Writable")),z.$include($($("::","IO"),"Readable")),z.__fs__=r(1),z.__path__=r(2),z.__util__=r(6);var C=z.__fs__,P=z.__path__,F=z.__util__,D="undefined"!=typeof TextEncoder?TextEncoder:F.TextEncoder,L=new("undefined"!=typeof TextDecoder?TextDecoder:F.TextDecoder)("utf8"),B=new D;o(P.sep!==a(q,"Separator"))&&t.const_set(q[0],"ALT_SEPARATOR",P.sep),t.defs(z,"$read",c=function(t){return d((function(){return C.readFileSync(t).toString()}))},c.$$arity=1),t.defs(z,"$write",h=function(t,e){return d((function(){return C.writeFileSync(t,e)})),e.$size()},h.$$arity=2),t.defs(z,"$exist?",p=function(t){return o(t["$respond_to?"]("path"))&&(t=t.$path()),d((function(){return C.existsSync(t)}))},p.$$arity=1),t.defs(z,"$realpath",_=function(e,r,n){var $=_.$$p,a=$||i;if($&&(_.$$p=null),$&&(_.$$p=null),null==r&&(r=i),null==n&&(n=i),o(r)&&(e=this.$join(r,e)),a===i)return d((function(){return C.realpathSync(e,n)}));C.realpath(e,n,(function(e,r){e?t.IOError.$new(e.message):a.$call(r)}))},_.$$arity=-2),t.defs(z,"$join",y=function(e){var r;return r=t.slice.call(arguments,0,arguments.length),P.posix.join.apply(P,r)},y.$$arity=-1),t.defs(z,"$directory?",g=function(t){var e=i,r=i;return!!o(this["$exist?"](t))&&(e=d((function(){return!!C.lstatSync(t).isDirectory()})),o(e)||(r=this.$realpath(t),o(r["$!="](t))&&(e=d((function(){return!!C.lstatSync(r).isDirectory()})))),e)},g.$$arity=1),t.defs(z,"$file?",m=function(t){var e=i,r=i;return!!o(this["$exist?"](t))&&(e=d((function(){return!!C.lstatSync(t).isFile()})),o(e)||(r=this.$realpath(t),o(r["$!="](t))&&(e=d((function(){return!!C.lstatSync(r).isFile()})))),e)},m.$$arity=1),t.defs(z,"$readable?",v=function(t){return!!o(this["$exist?"](t))&&"\n try {\n __fs__.accessSync(path, __fs__.R_OK);\n return true;\n } catch (error) {\n return false;\n }\n "},v.$$arity=1),t.defs(z,"$size",b=function(t){return d((function(){return C.lstatSync(t).size}))},b.$$arity=1),t.defs(z,"$open",O=function(e,r){var n=O.$$p,$=n||i,a=i;return n&&(O.$$p=null),null==r&&(r="r"),a=this.$new(e,r),$!==i?function(){try{return t.yield1($,a)}finally{a.$close()}}():a},O.$$arity=-2),t.defs(z,"$stat",w=function(t){return o(t["$respond_to?"]("path"))&&(t=t.$path()),$(a(q,"File"),"Stat").$new(t)},w.$$arity=1),t.defs(z,"$mtime",E=function(t){return d((function(){return C.statSync(t).mtime}))},E.$$arity=1),t.defs(z,"$symlink?",x=function(t){return d((function(){return C.lstatSync(t).isSymbolicLink()}))},x.$$arity=1),t.defs(z,"$absolute_path",k=function(t,e){var r;return null==e&&(e=i),t=o(t["$respond_to?"]("to_path"))?t.$to_path():t,e=o(r=e)?r:a(q,"Dir").$pwd(),P.normalize(P.resolve(e.$to_str(),t.$to_str())).split(P.sep).join(P.posix.sep)},k.$$arity=-2),t.def(z,"$initialize",A=function(t,e){var r=i;return null==e&&(e="r"),this.binary_flag=e["$include?"]("b"),e=e.$delete("b"),o((r=/:(.*)/)["$match?"](e))&&(f("Encoding option (:encoding) is unsupported by Node.js openSync method and will be removed."),e=e.$sub(r,"")),this.path=t,this.flags=e,this.fd=d((function(){return C.openSync(t,e)}))},A.$$arity=-2),z.$attr_reader("path"),t.def(z,"$read",M=function(){var t=this,e=i;if(o(t.eof))return"";if(o(t.binary_flag)){var r=d((function(){return C.readFileSync(t.path)}));e=function(t){for(var e=0;e<t.length;)if(9===t[e]||10===t[e]||13===t[e]||32<=t[e]&&t[e]<=126)e+=1;else if(194<=t[e]&&t[e]<=223&&128<=t[e+1]&&t[e+1]<=191)e+=2;else if(224===t[e]&&160<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191||(225<=t[e]&&t[e]<=236||238===t[e]||239===t[e])&&128<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191||237===t[e]&&128<=t[e+1]&&t[e+1]<=159&&128<=t[e+2]&&t[e+2]<=191)e+=3;else{if(!(240===t[e]&&144<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191||241<=t[e]&&t[e]<=243&&128<=t[e+1]&&t[e+1]<=191&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191||244===t[e]&&128<=t[e+1]&&t[e+1]<=143&&128<=t[e+2]&&t[e+2]<=191&&128<=t[e+3]&&t[e+3]<=191))return!1;e+=4}return!0}(r)?r.toString("utf8"):L.decode(B.encode(r.toString("binary")))}else e=d((function(){return C.readFileSync(t.path).toString("utf8")}));return t.eof=!0,t.lineno=e.$size(),e},M.$$arity=0),t.def(z,"$readlines",I=function(t){return null==l["/"]&&(l["/"]=i),null==t&&(t=l["/"]),this.$each_line(t).$to_a()},I.$$arity=-1),t.def(z,"$each_line",S=function(e){var r=S.$$p,n=r||i,$=this,s=i;if(null==l["/"]&&(l["/"]=i),r&&(S.$$p=null),r&&(S.$$p=null),null==e&&(e=l["/"]),o($.eof))return n!==i?$:[].$to_enum();if(n!==i){s=a(q,"File").$read($.path),$.eof=!1,$.lineno=0;for(var u=s.$chomp(),c=s.length!=u.length,h=u.split(e),f=0,d=h.length;f<d;f++)$.lineno+=1,f<d-1||c?t.yield1(n,h[f]+e):t.yield1(n,h[f]);return $.eof=!0,$}return $.$read().$each_line(e)},S.$$arity=-1),t.def(z,"$write",N=function(t){var e=this;return d((function(){return C.writeSync(e.fd,t)}))},N.$$arity=1),t.def(z,"$flush",j=function(){var t=this;return d((function(){return C.fsyncSync(t.fd)}))},j.$$arity=0),t.def(z,"$close",R=function(){var t=this;return d((function(){return C.closeSync(t.fd)}))},R.$$arity=0),t.def(z,"$mtime",T=function(){var t=this;return d((function(){return C.statSync(t.path).mtime}))},T.$$arity=0)}(n[0],a(n,"IO"),n),function(e,n,$){var a,o,l,u=s(e,null,"Stat");[u].concat($);null==u.__fs__&&(u.__fs__=i),u.$$prototype.path=i,u.__fs__=r(1);var c=u.__fs__;return t.def(u,"$initialize",a=function(t){return this.path=t},a.$$arity=1),t.def(u,"$file?",o=function(){var t=this;return d((function(){return c.statSync(t.path).isFile()}))},o.$$arity=0),t.def(u,"$mtime",l=function(){var t=this;return d((function(){return c.statSync(t.path).mtime}))},l.$$arity=0),i&&"mtime"}(a(n,"File"),0,n)}};var $=function(){global.Opal.modules["nodejs/dir"]=function(t){t.top;var e=[],n=t.nil,i=(t.const_get_qualified,t.const_get_relative),$=(t.breaker,t.slice,t.klass),a=t.truthy,s=t.send;return t.add_stubs(["$respond_to?","$flat_map","$to_path","$coerce_to!"]),function(e,o,l){var u=$(e,null,"Dir"),c=[u].concat(l);null==u.__glob__&&(u.__glob__=n),null==u.__fs__&&(u.__fs__=n),null==u.__path__&&(u.__path__=n),null==u.__os__&&(u.__os__=n),u.__glob__=r(12),u.__fs__=r(1),u.__path__=r(2),u.__os__=r(31);var h=u.__glob__,f=u.__fs__,d=u.__path__,p=u.__os__;return function(e,r){var $,o,l,u,c,_,y,g=[e].concat(r);return t.def(e,"$[]",$=function(t){return h.sync(t)},$.$$arity=1),t.def(e,"$pwd",o=function(){return process.cwd().split(d.sep).join(d.posix.sep)},o.$$arity=0),t.def(e,"$home",l=function(){return p.homedir()},l.$$arity=0),t.def(e,"$chdir",u=function(t){return process.chdir(t)},u.$$arity=1),t.def(e,"$mkdir",c=function(t){return f.mkdirSync(t)},c.$$arity=1),t.def(e,"$entries",_=function(t){for(var e=[],r=f.readdirSync(t),n=0,i=r.length;n<i;n++)e.push(r[n]);return e},_.$$arity=1),t.def(e,"$glob",y=function(t){var e;return a(t["$respond_to?"]("each"))||(t=[t]),s(t,"flat_map",[],((e=function(t){null==e.$$s||e.$$s;return null==t&&(t=n),a(t["$respond_to?"]("to_path"))&&(t=t.$to_path()),t=i(g,"Opal")["$coerce_to!"](t,i(g,"String"),"to_str"),h.sync(t)}).$$s=this,e.$$arity=1,e))},y.$$arity=1),t.alias(e,"getwd","pwd")}(t.get_singleton_class(u),c)}(e[0],0,e)}};var a=function(){global.Opal.modules["nodejs/io"]=function(t){function e(t,e){return"number"==typeof t&&"number"==typeof e?t-e:t["$-"](e)}var n,i,$=t.top,a=[],s=t.nil,o=(t.const_get_qualified,t.const_get_relative),l=(t.breaker,t.slice,t.klass),u=t.lambda,c=t.send,h=s;return t.add_stubs(["$attr_reader","$write","$read","$write_proc=","$-","$tty="]),function(e,n,i){var $,a,u,c,h=l(e,null,"IO"),f=[h].concat(i);null==h.__fs__&&(h.__fs__=s),h.__fs__=r(1);var d=h.__fs__;h.$attr_reader("eof"),h.$attr_reader("lineno"),t.def(h,"$initialize",$=function(){return this.eof=!1,this.lineno=0},$.$$arity=0),t.defs(h,"$write",a=function(t,e){return o(f,"File").$write(t,e)},a.$$arity=2),t.defs(h,"$read",u=function(t){return o(f,"File").$read(t)},u.$$arity=1),t.defs(h,"$binread",c=function(e){return function(e){try{return e()}catch(e){if("EACCES"===e.code||"EISDIR"===e.code||"EMFILE"===e.code||"ENOENT"===e.code||"EPERM"===e.code)throw t.IOError.$new(e.message);throw e}}((function(){return d.readFileSync(e).toString("binary")}))},c.$$arity=1)}(a[0],0,a),h=[u((n=function(t){null==n.$$s||n.$$s;return null==t&&(t=s),process.stdout.write(t)},n.$$s=$,n.$$arity=1,n))],c(o(a,"STDOUT"),"write_proc=",t.to_a(h)),h[e(h.length,1)],h=[u((i=function(t){null==i.$$s||i.$$s;return null==t&&(t=s),process.stderr.write(t)},i.$$s=$,i.$$arity=1,i))],c(o(a,"STDERR"),"write_proc=",t.to_a(h)),h[e(h.length,1)],h=[!0],c(o(a,"STDOUT"),"tty=",t.to_a(h)),h[e(h.length,1)],h=[!0],c(o(a,"STDERR"),"tty=",t.to_a(h)),h[e(h.length,1)]}};var s=function(){global.Opal.modules["nodejs/open-uri"]=function(t){t.top;var e=[],n=t.nil,i=(t.const_get_qualified,t.const_get_relative,t.breaker,t.slice,t.module);return function(e,$){var a,s,o=i(e,"OpenURI");[o].concat($);null==o.__xmlhttprequest__&&(o.__xmlhttprequest__=n),o.__xmlhttprequest__=r(32);var l=o.__xmlhttprequest__.XMLHttpRequest;t.defs(o,"$request",a=function(t){var e=new l;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(),e},a.$$arity=1),t.defs(o,"$data",s=function(t){for(var e=t.response,r=new Uint8Array(e),n=[],i=0;i<r.byteLength;i++)n.push(r[i]);return n},s.$$arity=1)}(e[0],e)}},o=r(3);void 0===global.Opal.modules.pathname&&"function"==typeof o.a&&Object(o.a)();var l=function(){global.Opal.modules["nodejs/pathname"]=function(t){var e=t.top,n=[],i=t.nil,$=(t.const_get_qualified,t.const_get_relative),a=(t.breaker,t.slice,t.klass);return t.add_stubs(["$require","$include","$to_str","$!","$absolute?"]),e.$require("pathname"),function(e,n,s){var o,l,u,c=a(e,null,"Pathname"),h=[c].concat(s);null==c.__path__&&(c.__path__=i),c.$$prototype.path=i,c.$include($(h,"Comparable")),c.__path__=r(2);var f=c.__path__;return t.def(c,"$absolute?",o=function(){return f.isAbsolute(this.path.$to_str())},o.$$arity=0),t.def(c,"$relative?",l=function(){return this["$absolute?"]()["$!"]()},l.$$arity=0),t.def(c,"$to_path",u=function(){return this.path},u.$$arity=0),i&&"to_path"}(n[0],0,n)}};var u=function(){global.Opal.modules["nodejs/env"]=function(t){t.top;var e=[],r=t.nil,n=(t.const_get_qualified,t.const_get_relative);t.breaker,t.slice;return t.add_stubs(["$new","$to_s"]),t.const_set(e[0],"ENV",n(e,"Object").$new()),function(e,n){var i,$,a,s,o,l,u;[e].concat(n);return t.def(e,"$[]",i=function(t){return process.env[t]||r},i.$$arity=1),t.def(e,"$[]=",$=function(t,e){return process.env[t.$to_s()]=e.$to_s()},$.$$arity=2),t.def(e,"$key?",a=function(t){return process.env.hasOwnProperty(t)},a.$$arity=1),t.alias(e,"has_key?","key?"),t.alias(e,"include?","key?"),t.alias(e,"member?","key?"),t.def(e,"$empty?",s=function(){return 0===Object.keys(process.env).length},s.$$arity=0),t.def(e,"$keys",o=function(){return Object.keys(process.env)},o.$$arity=0),t.def(e,"$delete",l=function(t){var e=process.env[t]||r;return delete process.env[t],e},l.$$arity=1),t.def(e,"$to_s",u=function(){return"ENV"},u.$$arity=0),r&&"to_s"}(t.get_singleton_class(n(e,"ENV")),e)}};void 0===global.Opal.modules["nodejs/kernel"]&&"function"==typeof n&&n(),void 0===global.Opal.modules["nodejs/file"]&&"function"==typeof i&&i(),void 0===global.Opal.modules["nodejs/dir"]&&"function"==typeof $&&$(),void 0===global.Opal.modules["nodejs/io"]&&"function"==typeof a&&a(),void 0===global.Opal.modules["nodejs/open-uri"]&&"function"==typeof s&&s(),void 0===global.Opal.modules["nodejs/pathname"]&&"function"==typeof l&&l(),void 0===global.Opal.modules["nodejs/env"]&&"function"==typeof u&&u();e.a=function(){global.Opal.modules.nodejs=function(t){var e,r=t.top,n=[],i=(t.nil,t.const_get_qualified,t.const_get_relative,t.breaker,t.slice,t.module);return t.add_stubs(["$require"]),e=n,[i(n[0],"NodeJS")].concat(e),r.$require("nodejs/kernel"),r.$require("nodejs/file"),r.$require("nodejs/dir"),r.$require("nodejs/io"),r.$require("nodejs/open-uri"),r.$require("nodejs/pathname"),r.$require("nodejs/env")}}},function(t,e){(function(){var t,e,r,n,i,$,a=this;if("undefined"!=typeof global&&(a=global),"undefined"!=typeof window&&(a=window),"log"in(t="object"==typeof a.console?a.console:null==a.console?a.console={}:{})||(t.log=function(){}),"warn"in t||(t.warn=t.log),void 0!==a.Opal)return t.warn("Opal already loaded. Loading twice can cause troubles, please fix your setup."),a.Opal;var s=a.Opal={};s.global=a,a.Opal=s,s.config={missing_require_severity:"error",unsupported_features_severity:"warning",enable_stack_trace:!0};var o=Object.hasOwnProperty,l=Function.prototype.bind,u=Object.setPrototypeOf,c=Array.prototype.slice,h=Array.prototype.splice,f=4;function d(e,r,n){if("string"==typeof e)throw t.trace(),new s.TypeError("Opal.$defineProperty called on non-object (primitive string)");Object.defineProperty(e,r,{value:n,enumerable:!1,configurable:!0,writable:!0})}function p(t,e){if(t)return t.$$const[e]}function _(t,e){var r,n,i;if(null!=t)for(r=0,n=(i=s.ancestors(t)).length;r<n;r++)if(i[r].$$const&&o.call(i[r].$$const,e))return i[r].$$const[e]}function y(t,e,r){if(!r)return(t||n).$const_missing(e)}function g(t){return t.hasOwnProperty("$$iclass")&&t.hasOwnProperty("$$root")}function m(t){var e=v(t);return t.$$is_module&&t.$$iclasses.push(e),e}function v(t){var e={},r=t.$$prototype;r.hasOwnProperty("$$dummy")&&(r=r.$$define_methods_on);var n,i=Object.getOwnPropertyNames(r),$=i.length;for(n=0;n<$;n++){var a=i[n];d(e,a,r[a])}return d(e,"$$iclass",!0),d(e,"$$module",t),e}function b(t){var e=t.length,r=t[0];if(d(r,"$$root",!0),1===e)return{first:r,last:r};for(var n=r,i=1;i<e;i++){var $=t[i];u(n,$),n=$}return{first:t[0],last:t[e-1]}}function O(t){if(!t.hasOwnProperty("$$dummy"))return t.hasOwnProperty("$$iclass")?t.$$module:t.hasOwnProperty("$$class")?t.$$class:void 0}function w(t){return"function"==typeof t&&!t.$$stub}s.uid=function(){return f+=2},s.id=function(t){return t.$$is_number?2*t+1:null!=t.$$id?t.$$id:(d(t,"$$id",s.uid()),t.$$id)},s.gvars={},s.exit=function(e){s.gvars.DEBUG&&t.log("Exited with status "+e)},s.exceptions=[],s.pop_exception=function(){s.gvars["!"]=s.exceptions.pop()||e},s.inspect=function(t){return void 0===t?"undefined":null===t?"null":t.$$class?t.$inspect():t.toString()},s.defineProperty=d,s.slice=c,s.truthy=function(t){return t!==e&&null!=t&&(!t.$$is_boolean||1==t)},s.falsy=function(t){return t===e||null==t||t.$$is_boolean&&0==t},s.const_get_local=function(t,e,r){var i;if(null!=t){if("::"===t&&(t=n),!t.$$is_module&&!t.$$is_class)throw new s.TypeError(t.toString()+" is not a class/module");return null!=(i=p(t,e))?i:null!=(i=y(t,e,r))?i:void 0}},s.const_get_qualified=function(t,e,r){var i,$,a,o=s.const_cache_version;if(null!=t){if("::"===t&&(t=n),!t.$$is_module&&!t.$$is_class)throw new s.TypeError(t.toString()+" is not a class/module");return null==($=t.$$const_cache)&&(d(t,"$$const_cache",Object.create(null)),$=t.$$const_cache),null==(a=$[e])||a[0]!==o?(null!=(i=p(t,e))||(i=_(t,e)),$[e]=[o,i]):i=a[1],null!=i?i:y(t,e,r)}},s.const_cache_version=1,s.const_get_relative=function(t,e,r){var i,$,a,o=t[0],l=s.const_cache_version;return null==($=t.$$const_cache)&&(d(t,"$$const_cache",Object.create(null)),$=t.$$const_cache),null==(a=$[e])||a[0]!==l?(null!=(i=p(o,e))||null!=(i=function(t,e){var r,n,i;if(0!==t.length)for(r=0,n=t.length;r<n;r++)if(null!=(i=t[r].$$const[e]))return i}(t,e))||null!=(i=_(o,e))||(i=function(t,e){if(null==t||t.$$is_module)return _(n,e)}(o,e)),$[e]=[l,i]):i=a[1],null!=i?i:y(o,e,r)},s.const_set=function(t,r,i){return null!=t&&"::"!==t||(t=n),i.$$is_a_module&&(null!=i.$$name&&i.$$name!==e||(i.$$name=r),null==i.$$base_module&&(i.$$base_module=t)),t.$$const=t.$$const||Object.create(null),t.$$const[r]=i,t.$$=t.$$const,s.const_cache_version++,t===n&&(s[r]=i),d(t,r,i),i},s.constants=function(t,e){null==e&&(e=!0);var r,i,$,a,o=[t],l={};for(e&&(o=o.concat(s.ancestors(t))),e&&t.$$is_module&&(o=o.concat([s.Object]).concat(s.ancestors(s.Object))),i=0,$=o.length;i<$&&(r=o[i],t===n||r!=n);i++)for(a in r.$$const)l[a]=!0;return Object.keys(l)},s.const_remove=function(t,r){if(s.const_cache_version++,null!=t.$$const[r]){var n=t.$$const[r];return delete t.$$const[r],n}if(null!=t.$$autoload&&null!=t.$$autoload[r])return delete t.$$autoload[r],e;throw s.NameError.$new("constant "+t+"::"+t.$name()+" not defined")},s.allocate_class=function(t,e){var r,n;return n=null!=e&&e.$$bridge?function(){var t=c.call(arguments),n=new(l.apply(e.$$constructor,[null].concat(t)));return u(n,r.$$prototype),n}:function(){},t&&d(n,"displayName","::"+t),d(r=n,"$$name",t),d(r,"$$constructor",n),d(r,"$$prototype",n.prototype),d(r,"$$const",{}),d(r,"$$is_class",!0),d(r,"$$is_a_module",!0),d(r,"$$super",e),d(r,"$$cvars",{}),d(r,"$$own_included_modules",[]),d(r,"$$own_prepended_modules",[]),d(r,"$$ancestors",[]),d(r,"$$ancestors_cache_version",null),d(r.$$prototype,"$$class",r),s.Class&&u(r,s.Class.prototype),null!=e&&(u(r.$$prototype,e.$$prototype),e.$$meta&&s.build_class_singleton_class(r)),r},s.klass=function(t,e,r){var i;null==t?t=n:t.$$is_class||t.$$is_module||(t=t.$$class),null==e||e.hasOwnProperty("$$is_class")||(i=e,e=n);var $=function(t,e){var r=p(t,e);if(r){if(!r.$$is_class)throw s.TypeError.$new(e+" is not a class");return r}}(t,r);return $?(e&&function(t,e){if(t.$$super!==e)throw s.TypeError.$new("superclass mismatch for class "+t.$$name)}($,e),$):(null==e&&(e=n),$=s.allocate_class(r,e),s.const_set(t,r,$),e.$inherited&&e.$inherited($),i&&s.bridge(i,$),$)},s.allocate_module=function(t){var e=function(){};t&&d(e,"displayName",t+".$$constructor");var r=e;return t&&d(e,"displayName",t+".constructor"),d(r,"$$name",t),d(r,"$$prototype",e.prototype),d(r,"$$const",{}),d(r,"$$is_module",!0),d(r,"$$is_a_module",!0),d(r,"$$cvars",{}),d(r,"$$iclasses",[]),d(r,"$$own_included_modules",[]),d(r,"$$own_prepended_modules",[]),d(r,"$$ancestors",[r]),d(r,"$$ancestors_cache_version",null),u(r,s.Module.prototype),r},s.module=function(t,e){var r;return null==t?t=n:t.$$is_class||t.$$is_module||(t=t.$$class),(r=function(t,e){var r=p(t,e);if(null==r&&t===n&&(r=_(n,e)),r&&!r.$$is_module&&r!==n)throw s.TypeError.$new(e+" is not a module");return r}(t,e))?r:(r=s.allocate_module(e),s.const_set(t,e,r),r)},s.get_singleton_class=function(t){return t.$$meta?t.$$meta:t.hasOwnProperty("$$is_class")?s.build_class_singleton_class(t):t.hasOwnProperty("$$is_module")?s.build_module_singletin_class(t):s.build_object_singleton_class(t)},s.build_class_singleton_class=function(t){var e,n;return t.$$meta?t.$$meta:(e=t===r?$:s.get_singleton_class(t.$$super),d(n=s.allocate_class(null,e,(function(){})),"$$is_singleton",!0),d(n,"$$singleton_of",t),d(t,"$$meta",n),u(t,n.$$prototype),d(t,"$$class",s.Class),n)},s.build_module_singletin_class=function(t){if(t.$$meta)return t.$$meta;var e=s.allocate_class(null,s.Module,(function(){}));return d(e,"$$is_singleton",!0),d(e,"$$singleton_of",t),d(t,"$$meta",e),u(t,e.$$prototype),d(t,"$$class",s.Module),e},s.build_object_singleton_class=function(t){var r=t.$$class,n=s.allocate_class(e,r,(function(){}));return"string"==typeof t&&(t=new String(t)),d(n,"$$is_singleton",!0),d(n,"$$singleton_of",t),delete n.$$prototype.$$class,d(t,"$$meta",n),u(t,t.$$meta.$$prototype),n},s.is_method=function(t){return"$"===t[0]&&"$"!==t[1]},s.instance_methods=function(t){for(var e=[],r=[],n=s.ancestors(t),i=0,$=n.length;i<$;i++){var a=n[i].$$prototype;a.hasOwnProperty("$$dummy")&&(a=a.$$define_methods_on);for(var o=Object.getOwnPropertyNames(a),l=0,u=o.length;l<u;l++){var c=o[l];if(s.is_method(c)){var h=c.slice(1),f=a[c];f.$$stub&&-1===e.indexOf(h)&&e.push(h),f.$$stub||-1!==r.indexOf(h)||-1!==e.indexOf(h)||r.push(h)}}}return r},s.own_instance_methods=function(t){var e=[],r=t.$$prototype;r.hasOwnProperty("$$dummy")&&(r=r.$$define_methods_on);for(var n=Object.getOwnPropertyNames(r),i=0,$=n.length;i<$;i++){var a=n[i];if(s.is_method(a))if(!r[a].$$stub){var o=a.slice(1);e.push(o)}}return e},s.methods=function(t){return s.instance_methods(s.get_singleton_class(t))},s.own_methods=function(t){return s.own_instance_methods(s.get_singleton_class(t))},s.receiver_methods=function(t){var e=s.get_singleton_class(t),r=s.own_instance_methods(e),n=s.own_instance_methods(e.$$super);return r.concat(n)},s.class_variables=function(t){var e,r=s.ancestors(t),n={};for(e=r.length-1;e>=0;e--){var i=r[e];for(var $ in i.$$cvars)n[$]=i.$$cvars[$]}return n},s.class_variable_set=function(t,e,r){var n,i=s.ancestors(t);for(n=i.length-2;n>=0;n--){var $=i[n];if(o.call($.$$cvars,e))return $.$$cvars[e]=r,r}return t.$$cvars[e]=r,r},s.append_features=function(t,e){var r=s.ancestors(t),n=[];if(-1!==r.indexOf(e))throw s.ArgumentError.$new("cyclic include detected");for(var i=0,$=r.length;i<$;i++){var a=m(r[i]);d(a,"$$included",!0),n.push(a)}var o,l,c=s.ancestors(e),h=b(n);if(-1===c.indexOf(t))o=e.$$prototype,l=Object.getPrototypeOf(e.$$prototype);else{for(var f=e.$$prototype,p=Object.getPrototypeOf(f);null!=p&&(!g(p)||p.$$module!==t);)f=p,p=Object.getPrototypeOf(p);for(var _=Object.getPrototypeOf(p||f);_.hasOwnProperty("$$iclass")&&!g(_);)_=Object.getPrototypeOf(_);o=f,l=_}u(o,h.first),u(h.last,l),e.$$own_included_modules=function(t){for(var e,r=[],n=Object.getPrototypeOf(t.$$prototype);n&&!n.hasOwnProperty("$$class");)(e=O(n))&&r.push(e),n=Object.getPrototypeOf(n);return r}(e),s.const_cache_version++},s.prepend_features=function(t,e){var r=s.ancestors(t),n=[];if(-1!==r.indexOf(e))throw s.ArgumentError.$new("cyclic prepend detected");for(var i=0,$=r.length;i<$;i++){var a=m(r[i]);d(a,"$$prepended",!0),n.push(a)}var o,l,c,h=b(n),f=e.$$prototype,p=Object.getPrototypeOf(f);if(f.hasOwnProperty("$$dummy")?o=f.$$define_methods_on:(o=v(e),function(t){for(var e=t.$$prototype,r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n];s.is_method(i)&&delete e[i]}}(e),d(f,"$$dummy",!0),d(f,"$$define_methods_on",o),u(f,o),u(o,p)),-1!==s.ancestors(e).indexOf(t))throw s.RuntimeError.$new("Prepending a module multiple times is not supported");for(l=f,c=Object.getPrototypeOf(f);null!=c&&!c.hasOwnProperty("$$root")&&c!==o&&c.hasOwnProperty("$$iclass");)c=Object.getPrototypeOf(c);u(l,h.first),u(h.last,c),e.$$own_prepended_modules=function(t){var e,r=[],n=Object.getPrototypeOf(t.$$prototype);if(t.$$prototype.hasOwnProperty("$$dummy"))for(;n&&n!==t.$$prototype.$$define_methods_on;)(e=O(n))&&r.push(e),n=Object.getPrototypeOf(n);return r}(e),s.const_cache_version++},s.bridge=function(t,e){if(t.hasOwnProperty("$$bridge"))throw s.ArgumentError.$new("already bridged");d(t,"$$bridge",e),u(t.prototype,(e.$$super||s.Object).$$prototype),d(e,"$$prototype",t.prototype),d(e.$$prototype,"$$class",e),d(e,"$$constructor",t),d(e,"$$bridge",!0)},s.ancestors=function(t){if(!t)return[];if(t.$$ancestors_cache_version===s.const_cache_version)return t.$$ancestors;var e,r,n,i=[];for(e=0,n=(r=function(t){return t.$$own_prepended_modules.concat([t]).concat(t.$$own_included_modules)}(t)).length;e<n;e++)i.push(r[e]);if(t.$$super)for(e=0,n=(r=s.ancestors(t.$$super)).length;e<n;e++)i.push(r[e]);return t.$$ancestors_cache_version=s.const_cache_version,t.$$ancestors=i,i},s.included_modules=function(t){for(var e=[],r=null,n=Object.getPrototypeOf(t.$$prototype);n&&Object.getPrototypeOf(n);n=Object.getPrototypeOf(n))(r=O(n))&&r.$$is_module&&n.$$iclass&&n.$$included&&e.push(r);return e},s.add_stubs=function(t){for(var e=s.BasicObject.$$prototype,r=0,n=t.length;r<n;r++){var i=t[r],$=e[i];(null==$||$.$$stub)&&s.add_stub_for(e,i)}},s.add_stub_for=function(t,e){d(t,e,s.stub_for(e))},s.stub_for=function(t){function e(){this.$method_missing.$$p=e.$$p,e.$$p=null;for(var r=new Array(arguments.length),n=0,i=r.length;n<i;n++)r[n]=arguments[n];return this.$method_missing.apply(this,[t.slice(1)].concat(r))}return e.$$stub=!0,e},s.ac=function(t,e,r,n){var i="";throw r.$$is_a_module?i+=r.$$name+".":i+=r.$$class.$$name+"#",i+=n,s.ArgumentError.$new("["+i+"] wrong number of arguments("+t+" for "+e+")")},s.block_ac=function(t,e,r){var n="`block in "+r+"'";throw s.ArgumentError.$new(n+": wrong number of arguments ("+t+" for "+e+")")},s.find_super_dispatcher=function(t,e,r,n,i){for(var $,a,o="$"+e,l=($=t.hasOwnProperty("$$meta")?s.ancestors(t.$$meta):s.ancestors(t.$$class)).indexOf(r.$$owner)+1;l<$.length;l++){var u=$[l].$$prototype;if(u.hasOwnProperty("$$dummy")&&(u=u.$$define_methods_on),u.hasOwnProperty(o)){var c=u[o];c.$$stub||(a=c);break}}if(!n&&null==a&&s.Kernel.$method_missing===t.$method_missing)throw s.NoMethodError.$new("super: no superclass method `"+e+"' for "+t,e);return a},s.find_iter_super_dispatcher=function(t,e,r,n,i){var $=e;if(!r)throw s.RuntimeError.$new("super called outside of method");if(i&&r.$$define_meth)throw s.RuntimeError.$new("implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly");return r.$$def&&($=r.$$jsid),s.find_super_dispatcher(t,$,r,n)},s.ret=function(t){throw s.returner.$v=t,s.returner},s.brk=function(t,e){throw e.$v=t,e},s.new_brk=function(){return new Error("unexpected break")},s.yield1=function(t,e){if("function"!=typeof t)throw s.LocalJumpError.$new("no block given");var r=t.$$has_top_level_mlhs_arg,n=t.$$has_trailing_comma_in_args;return(t.length>1||(r||n)&&1===t.length)&&(e=s.to_ary(e)),(t.length>1||n&&1===t.length)&&e.$$is_array?t.apply(null,e):t(e)},s.yieldX=function(t,e){if("function"!=typeof t)throw s.LocalJumpError.$new("no block given");if(t.length>1&&1===e.length&&e[0].$$is_array)return t.apply(null,e[0]);if(!e.$$is_array){for(var r=new Array(e.length),n=0,i=r.length;n<i;n++)r[n]=e[n];return t.apply(null,r)}return t.apply(null,e)},s.rescue=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if(n.$$is_array){var i=s.rescue(t,n);if(i)return i}else{if(n===s.JS.Error)return n;if(n["$==="](t))return n}}return null},s.is_a=function(t,e){if(null!=e&&t.$$meta===e||t.$$class===e)return!0;if(t.$$is_number&&e.$$is_number_class)return!0;var r,n,i=s.ancestors(t.$$is_class?s.get_singleton_class(t):t.$$meta||t.$$class);for(r=0,n=i.length;r<n;r++)if(i[r]===e)return!0;return!1},s.to_hash=function(t){if(t.$$is_hash)return t;if(t["$respond_to?"]("to_hash",!0)){var e=t.$to_hash();if(e.$$is_hash)return e;throw s.TypeError.$new("Can't convert "+t.$$class+" to Hash ("+t.$$class+"#to_hash gives "+e.$$class+")")}throw s.TypeError.$new("no implicit conversion of "+t.$$class+" into Hash")},s.to_ary=function(t){if(t.$$is_array)return t;if(t["$respond_to?"]("to_ary",!0)){var r=t.$to_ary();if(r===e)return[t];if(r.$$is_array)return r;throw s.TypeError.$new("Can't convert "+t.$$class+" to Array ("+t.$$class+"#to_ary gives "+r.$$class+")")}return[t]},s.to_a=function(t){if(t.$$is_array)return t.slice();if(t["$respond_to?"]("to_a",!0)){var r=t.$to_a();if(r===e)return[t];if(r.$$is_array)return r;throw s.TypeError.$new("Can't convert "+t.$$class+" to Array ("+t.$$class+"#to_a gives "+r.$$class+")")}return[t]},s.extract_kwargs=function(t){var e=t[t.length-1];return null!=e&&e["$respond_to?"]("to_hash",!0)?(h.call(t,t.length-1,1),e.$to_hash()):s.hash2([],{})},s.kwrestargs=function(t,e){var r,n=[],i={},$=t.$$smap;for(r in $)e[r]||(n.push(r),i[r]=$[r]);return s.hash2(n,i)},s.send=function(t,e,r,n){var i="string"==typeof e?t["$"+e]:e;return null!=i?("function"==typeof n&&(i.$$p=n),i.apply(t,r)):t.$method_missing.apply(t,[e].concat(r))},s.lambda=function(t){return t.$$is_lambda=!0,t},s.def=function(t,e,r){t===s.top?s.defn(s.Object,e,r):!t.$$eval&&t.$$is_a_module?s.defn(t,e,r):s.defs(t,e,r)},s.defn=function(t,e,r){r.displayName=e,r.$$owner=t;var n=t.$$prototype;if(n.hasOwnProperty("$$dummy")&&(n=n.$$define_methods_on),d(n,e,r),t.$$is_module){t.$$module_function&&s.defs(t,e,r);for(var i=0,$=t.$$iclasses,a=$.length;i<a;i++){d($[i],e,r)}}var o=t.$$singleton_of;!t.$method_added||t.$method_added.$$stub||o?o&&o.$singleton_method_added&&!o.$singleton_method_added.$$stub&&o.$singleton_method_added(e.substr(1)):t.$method_added(e.substr(1))},s.defs=function(t,e,r){if(t.$$is_string||t.$$is_number)throw s.TypeError.$new("can't define singleton");s.defn(s.get_singleton_class(t),e,r)},s.rdef=function(t,e){if(!o.call(t.$$prototype,e))throw s.NameError.$new("method '"+e.substr(1)+"' not defined in "+t.$name());delete t.$$prototype[e],t.$$is_singleton?t.$$prototype.$singleton_method_removed&&!t.$$prototype.$singleton_method_removed.$$stub&&t.$$prototype.$singleton_method_removed(e.substr(1)):t.$method_removed&&!t.$method_removed.$$stub&&t.$method_removed(e.substr(1))},s.udef=function(t,e){if(!t.$$prototype[e]||t.$$prototype[e].$$stub)throw s.NameError.$new("method '"+e.substr(1)+"' not defined in "+t.$name());s.add_stub_for(t.$$prototype,e),t.$$is_singleton?t.$$prototype.$singleton_method_undefined&&!t.$$prototype.$singleton_method_undefined.$$stub&&t.$$prototype.$singleton_method_undefined(e.substr(1)):t.$method_undefined&&!t.$method_undefined.$$stub&&t.$method_undefined(e.substr(1))},s.alias=function(t,e,r){var n,i="$"+e,$="$"+r,a=t.$$prototype["$"+r];if(t.$$eval)return s.alias(s.get_singleton_class(t),e,r);if(!w(a)){for(var o=t.$$super;"function"!=typeof a&&o;)a=o[$],o=o.$$super;if(!w(a)&&t.$$is_module&&(a=s.Object.$$prototype[$]),!w(a))throw s.NameError.$new("undefined method `"+r+"' for class `"+t.$name()+"'")}return a.$$alias_of&&(a=a.$$alias_of),(n=function(){var t,e,r,i=n.$$p;for(t=new Array(arguments.length),e=0,r=arguments.length;e<r;e++)t[e]=arguments[e];return null!=i&&(n.$$p=null),s.send(this,a,t,i)}).displayName=e,Object.defineProperty(n,"length",{writable:!0}),n.length=a.length,n.$$arity=a.$$arity,n.$$parameters=a.$$parameters,n.$$source_location=a.$$source_location,n.$$alias_of=a,n.$$alias_name=e,s.defn(t,i,n),t},s.alias_native=function(t,e,r){var n="$"+e,i=t.$$prototype[r];if("function"!=typeof i||i.$$stub)throw s.NameError.$new("undefined native method `"+r+"' for class `"+t.$name()+"'");return s.defn(t,n,i),t},s.hash_init=function(t){t.$$smap=Object.create(null),t.$$map=Object.create(null),t.$$keys=[]},s.hash_clone=function(t,e){e.$$none=t.$$none,e.$$proc=t.$$proc;for(var r,n,i=0,$=t.$$keys,a=t.$$smap,o=$.length;i<o;i++)(r=$[i]).$$is_string?n=a[r]:(n=r.value,r=r.key),s.hash_put(e,r,n)},s.hash_put=function(t,e,r){if(e.$$is_string)return o.call(t.$$smap,e)||t.$$keys.push(e),void(t.$$smap[e]=r);var n,i,$;if(n=t.$$by_identity?s.id(e):e.$hash(),!o.call(t.$$map,n))return i={key:e,key_hash:n,value:r},t.$$keys.push(i),void(t.$$map[n]=i);for(i=t.$$map[n];i;){if(e===i.key||e["$eql?"](i.key)){$=void 0,i.value=r;break}$=i,i=i.next}$&&(i={key:e,key_hash:n,value:r},t.$$keys.push(i),$.next=i)},s.hash_get=function(t,e){if(e.$$is_string)return o.call(t.$$smap,e)?t.$$smap[e]:void 0;var r,n;if(r=t.$$by_identity?s.id(e):e.$hash(),o.call(t.$$map,r))for(n=t.$$map[r];n;){if(e===n.key||e["$eql?"](n.key))return n.value;n=n.next}},s.hash_delete=function(t,e){var r,n,i=t.$$keys,$=i.length;if(e.$$is_string){if(!o.call(t.$$smap,e))return;for(r=0;r<$;r++)if(i[r]===e){i.splice(r,1);break}return n=t.$$smap[e],delete t.$$smap[e],n}var a=e.$hash();if(o.call(t.$$map,a))for(var s,l=t.$$map[a];l;){if(e===l.key||e["$eql?"](l.key)){for(n=l.value,r=0;r<$;r++)if(i[r]===l){i.splice(r,1);break}return s&&l.next?s.next=l.next:s?delete s.next:l.next?t.$$map[a]=l.next:delete t.$$map[a],n}s=l,l=l.next}},s.hash_rehash=function(t){for(var e,r,n,i=0,$=t.$$keys.length;i<$;i++)if(!t.$$keys[i].$$is_string&&(e=t.$$keys[i].key.$hash())!==t.$$keys[i].key_hash){for(r=t.$$map[t.$$keys[i].key_hash],n=void 0;r;){if(r===t.$$keys[i]){n&&r.next?n.next=r.next:n?delete n.next:r.next?t.$$map[t.$$keys[i].key_hash]=r.next:delete t.$$map[t.$$keys[i].key_hash];break}n=r,r=r.next}if(t.$$keys[i].key_hash=e,o.call(t.$$map,e)){for(r=t.$$map[e],n=void 0;r;){if(r===t.$$keys[i]){n=void 0;break}n=r,r=r.next}n&&(n.next=t.$$keys[i])}else t.$$map[e]=t.$$keys[i]}},s.hash=function(){var t,e,r,n,i,$,a=arguments.length;if(1===a&&arguments[0].$$is_hash)return arguments[0];if(e=new s.Hash,s.hash_init(e),1===a&&arguments[0].$$is_array){for(n=(t=arguments[0]).length,r=0;r<n;r++){if(2!==t[r].length)throw s.ArgumentError.$new("value not of length 2: "+t[r].$inspect());i=t[r][0],$=t[r][1],s.hash_put(e,i,$)}return e}if(1===a){for(i in t=arguments[0])o.call(t,i)&&($=t[i],s.hash_put(e,i,$));return e}if(a%2!=0)throw s.ArgumentError.$new("odd number of arguments for Hash");for(r=0;r<a;r+=2)i=arguments[r],$=arguments[r+1],s.hash_put(e,i,$);return e},s.hash2=function(t,e){var r=new s.Hash;return r.$$smap=e,r.$$map=Object.create(null),r.$$keys=t,r},s.range=function(t,e,r){var n=new s.Range;return n.begin=t,n.end=e,n.excl=r,n},s.ivar=function(t){return"constructor"===t||"displayName"===t||"__count__"===t||"__noSuchMethod__"===t||"__parent__"===t||"__proto__"===t||"hasOwnProperty"===t||"valueOf"===t?t+"$":t},s.escape_regexp=function(t){return t.replace(/([-[\]\/{}()*+?.^$\\| ])/g,"\\$1").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\f]/g,"\\f").replace(/[\t]/g,"\\t")},s.global_regexp=function(t){return t.global?t:(null==t.$$g?t.$$g=new RegExp(t.source,(t.multiline?"gm":"g")+(t.ignoreCase?"i":"")):t.$$g.lastIndex=null,t.$$g)},s.global_multiline_regexp=function(t){var e;if(t.multiline){if(t.global)return t;e=null!=t.$$g?t.$$g:t.$$g=new RegExp(t.source,"gm"+(t.ignoreCase?"i":""))}else e=null!=t.$$gm?t.$$gm:t.$$gm=new RegExp(t.source,"gm"+(t.ignoreCase?"i":""));return e.lastIndex=null,e},s.modules={},s.loaded_features=["corelib/runtime"],s.current_dir=".",s.require_table={"corelib/runtime":!0},s.normalize=function(t){var e,r,n=[];"."!==s.current_dir&&(t=s.current_dir.replace(/\/*$/,"/")+t);for(var i=0,$=(e=(t=(t=t.replace(/^\.\//,"")).replace(/\.(rb|opal|js)$/,"")).split("/")).length;i<$;i++)""!==(r=e[i])&&(".."===r?n.pop():n.push(r));return n.join("/")},s.loaded=function(t){var e,r,n;for(e=0,r=t.length;e<r;e++)n=s.normalize(t[e]),s.require_table[n]||(s.loaded_features.push(n),s.require_table[n]=!0)},s.load=function(e){e=s.normalize(e),s.loaded([e]);var r=s.modules[e];if(r)r(s);else{var n=s.config.missing_require_severity,i="cannot load such file -- "+e;if("error"===n)throw s.LoadError?s.LoadError.$new(i):i;"warning"===n&&t.warn("WARNING: LoadError: "+i)}return!0},s.require=function(t){return t=s.normalize(t),!s.require_table[t]&&s.load(t)},s.BasicObject=r=s.allocate_class("BasicObject",null,(function(){})),s.Object=n=s.allocate_class("Object",s.BasicObject,(function(){})),s.Module=i=s.allocate_class("Module",s.Object,(function(){})),s.Class=$=s.allocate_class("Class",s.Module,(function(){})),u(s.BasicObject,s.Class.$$prototype),u(s.Object,s.Class.$$prototype),u(s.Module,s.Class.$$prototype),u(s.Class,s.Class.$$prototype),r.$$const.BasicObject=r,s.const_set(n,"BasicObject",r),s.const_set(n,"Object",n),s.const_set(n,"Module",i),s.const_set(n,"Class",$),r.$$class=$,n.$$class=$,i.$$class=$,$.$$class=$,d(n.$$prototype,"toString",(function(){var t=this.$to_s();return t.$$is_string&&"object"==typeof t?t.valueOf():t})),d(n.$$prototype,"$require",s.require),s.$$=n.$$,s.top=new n,s.top.$to_s=s.top.$inspect=function(){return"main"},s.NilClass=s.allocate_class("NilClass",s.Object,(function(){})),s.const_set(n,"NilClass",s.NilClass),(e=s.nil=new s.NilClass).$$id=4,e.call=e.apply=function(){throw s.LocalJumpError.$new("no block given")},s.breaker=new Error("unexpected break (old)"),s.returner=new Error("unexpected return"),TypeError.$$super=Error}).call()},function(t,e){function r(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}r.keys=function(){return[]},r.resolve=r,t.exports=r,r.id=21},function(t,e,r){var n=r(2),i="win32"===process.platform,$=r(1),a=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function s(t){return"function"==typeof t?t:function(){var t;if(a){var e=new Error;t=function(t){t&&(e.message=t.message,r(t=e))}}else t=r;return t;function r(t){if(t){if(process.throwDeprecation)throw t;if(!process.noDeprecation){var e="fs: missing callback "+(t.stack||t.message);process.traceDeprecation?console.trace(e):console.error(e)}}}}()}n.normalize;if(i)var o=/(.*?)(?:[\/\\]+|$)/g;else o=/(.*?)(?:[\/]+|$)/g;if(i)var l=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else l=/^[\/]*/;e.realpathSync=function(t,e){if(t=n.resolve(t),e&&Object.prototype.hasOwnProperty.call(e,t))return e[t];var r,a,s,u,c=t,h={},f={};function d(){var e=l.exec(t);r=e[0].length,a=e[0],s=e[0],u="",i&&!f[s]&&($.lstatSync(s),f[s]=!0)}for(d();r<t.length;){o.lastIndex=r;var p=o.exec(t);if(u=a,a+=p[0],s=u+p[1],r=o.lastIndex,!(f[s]||e&&e[s]===s)){var _;if(e&&Object.prototype.hasOwnProperty.call(e,s))_=e[s];else{var y=$.lstatSync(s);if(!y.isSymbolicLink()){f[s]=!0,e&&(e[s]=s);continue}var g=null;if(!i){var m=y.dev.toString(32)+":"+y.ino.toString(32);h.hasOwnProperty(m)&&(g=h[m])}null===g&&($.statSync(s),g=$.readlinkSync(s)),_=n.resolve(u,g),e&&(e[s]=_),i||(h[m]=g)}t=n.resolve(_,t.slice(r)),d()}}return e&&(e[c]=t),t},e.realpath=function(t,e,r){if("function"!=typeof r&&(r=s(e),e=null),t=n.resolve(t),e&&Object.prototype.hasOwnProperty.call(e,t))return process.nextTick(r.bind(null,null,e[t]));var a,u,c,h,f=t,d={},p={};function _(){var e=l.exec(t);a=e[0].length,u=e[0],c=e[0],h="",i&&!p[c]?$.lstat(c,(function(t){if(t)return r(t);p[c]=!0,y()})):process.nextTick(y)}function y(){if(a>=t.length)return e&&(e[f]=t),r(null,t);o.lastIndex=a;var n=o.exec(t);return h=u,u+=n[0],c=h+n[1],a=o.lastIndex,p[c]||e&&e[c]===c?process.nextTick(y):e&&Object.prototype.hasOwnProperty.call(e,c)?v(e[c]):$.lstat(c,g)}function g(t,n){if(t)return r(t);if(!n.isSymbolicLink())return p[c]=!0,e&&(e[c]=c),process.nextTick(y);if(!i){var a=n.dev.toString(32)+":"+n.ino.toString(32);if(d.hasOwnProperty(a))return m(null,d[a],c)}$.stat(c,(function(t){if(t)return r(t);$.readlink(c,(function(t,e){i||(d[a]=e),m(t,e)}))}))}function m(t,i,$){if(t)return r(t);var a=n.resolve(h,i);e&&(e[$]=a),v(a)}function v(e){t=n.resolve(e,t.slice(a)),_()}_()}},function(t,e,r){var n=r(24),i=r(25);t.exports=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return function t(e,r){var $=[];var a=i("{","}",e);if(!a||/\$$/.test(a.pre))return[e];var o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body);var l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body);var c=o||l;var _=a.body.indexOf(",")>=0;if(!c&&!_)return a.post.match(/,.*\}/)?(e=a.pre+"{"+a.body+s+a.post,t(e)):[e];var y;if(c)y=a.body.split(/\.\./);else{if(1===(y=function t(e){if(!e)return[""];var r=[];var n=i("{","}",e);if(!n)return e.split(",");var $=n.pre;var a=n.body;var s=n.post;var o=$.split(",");o[o.length-1]+="{"+a+"}";var l=t(s);s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l));r.push.apply(r,o);return r}(a.body)).length)if(1===(y=t(y[0],!1).map(h)).length)return(m=a.post.length?t(a.post,!1):[""]).map((function(t){return a.pre+y[0]+t}))}var g=a.pre;var m=a.post.length?t(a.post,!1):[""];var v;if(c){var b=u(y[0]),O=u(y[1]),w=Math.max(y[0].length,y[1].length),E=3==y.length?Math.abs(u(y[2])):1,x=d;O<b&&(E*=-1,x=p);var k=y.some(f);v=[];for(var A=b;x(A,O);A+=E){var M;if(l)"\\"===(M=String.fromCharCode(A))&&(M="");else if(M=String(A),k){var I=w-M.length;if(I>0){var S=new Array(I+1).join("0");M=A<0?"-"+S+M.slice(1):S+M}}v.push(M)}}else v=n(y,(function(e){return t(e,!1)}));for(var N=0;N<v.length;N++)for(var j=0;j<m.length;j++){var R=g+v[N]+m[j];(!r||c||R)&&$.push(R)}return $}(function(t){return t.split("\\\\").join($).split("\\{").join(a).split("\\}").join(s).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(c)};var $="\0SLASH"+Math.random()+"\0",a="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function u(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function c(t){return t.split($).join("\\").split(a).join("{").split(s).join("}").split(o).join(",").split(l).join(".")}function h(t){return"{"+t+"}"}function f(t){return/^-?0\d/.test(t)}function d(t,e){return t<=e}function p(t,e){return t>=e}},function(t,e){t.exports=function(t,e){for(var n=[],i=0;i<t.length;i++){var $=e(t[i],i);r($)?n.push.apply(n,$):n.push($)}return n};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";function n(t,e,r){t instanceof RegExp&&(t=i(t,r)),e instanceof RegExp&&(e=i(e,r));var n=$(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function i(t,e){var r=e.match(t);return r?r[0]:null}function $(t,e,r){var n,i,$,a,s,o=r.indexOf(t),l=r.indexOf(e,o+1),u=o;if(o>=0&&l>0){for(n=[],$=r.length;u>=0&&!s;)u==o?(n.push(u),o=r.indexOf(t,u+1)):1==n.length?s=[n.pop(),l]:((i=n.pop())<$&&($=i,a=l),l=r.indexOf(e,u+1)),u=o<l&&o>=0?o:l;n.length&&(s=[$,a])}return s}t.exports=n,n.range=$},function(t,e,r){try{var n=r(6);if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(e){t.exports=r(27)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){t.exports=require("events")},function(t,e,r){t.exports=d,d.GlobSync=p;var n=r(1),i=r(13),$=r(7),a=($.Minimatch,r(12).Glob,r(6),r(2)),s=r(14),o=r(8),l=r(15),u=(l.alphasort,l.alphasorti,l.setopts),c=l.ownProp,h=l.childrenIgnored,f=l.isIgnored;function d(t,e){if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new p(t,e).found}function p(t,e){if(!t)throw new Error("must provide pattern");if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof p))return new p(t,e);if(u(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}p.prototype._finish=function(){if(s(this instanceof p),this.realpath){var t=this;this.matches.forEach((function(e,r){var n=t.matches[r]=Object.create(null);for(var $ in e)try{$=t._makeAbs($),n[i.realpathSync($,t.realpathCache)]=!0}catch(e){if("stat"!==e.syscall)throw e;n[t._makeAbs($)]=!0}}))}l.finish(this)},p.prototype._process=function(t,e,r){s(this instanceof p);for(var n,i=0;"string"==typeof t[i];)i++;switch(i){case t.length:return void this._processSimple(t.join("/"),e);case 0:n=null;break;default:n=t.slice(0,i).join("/")}var a,l=t.slice(i);null===n?a=".":o(n)||o(t.join("/"))?(n&&o(n)||(n="/"+n),a=n):a=n;var u=this._makeAbs(a);h(this,a)||(l[0]===$.GLOBSTAR?this._processGlobStar(n,a,u,l,e,r):this._processReaddir(n,a,u,l,e,r))},p.prototype._processReaddir=function(t,e,r,n,i,$){var s=this._readdir(r,$);if(s){for(var o=n[0],l=!!this.minimatch.negate,u=o._glob,c=this.dot||"."===u.charAt(0),h=[],f=0;f<s.length;f++){if("."!==(_=s[f]).charAt(0)||c)(l&&!t?!_.match(o):_.match(o))&&h.push(_)}var d=h.length;if(0!==d)if(1!==n.length||this.mark||this.stat){n.shift();for(f=0;f<d;f++){var p;_=h[f];p=t?[t,_]:[_],this._process(p.concat(n),i,$)}}else{this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<d;f++){var _=h[f];t&&(_="/"!==t.slice(-1)?t+"/"+_:t+_),"/"!==_.charAt(0)||this.nomount||(_=a.join(this.root,_)),this._emitMatch(i,_)}}}},p.prototype._emitMatch=function(t,e){if(!f(this,e)){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}}},p.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r;try{r=n.lstatSync(t)}catch(t){if("ENOENT"===t.code)return null}var i=r&&r.isSymbolicLink();return this.symlinks[t]=i,i||!r||r.isDirectory()?e=this._readdir(t,!1):this.cache[t]="FILE",e},p.prototype._readdir=function(t,e){if(e&&!c(this.symlinks,t))return this._readdirInGlobStar(t);if(c(this.cache,t)){var r=this.cache[t];if(!r||"FILE"===r)return null;if(Array.isArray(r))return r}try{return this._readdirEntries(t,n.readdirSync(t))}catch(e){return this._readdirError(t,e),null}},p.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var n=e[r];n="/"===t?t+n:t+"/"+n,this.cache[n]=!0}return this.cache[t]=e,e},p.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(t);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(e.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=e.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e)}},p.prototype._processGlobStar=function(t,e,r,n,i,$){var a=this._readdir(r,$);if(a){var s=n.slice(1),o=t?[t]:[],l=o.concat(s);this._process(l,i,!1);var u=a.length;if(!this.symlinks[r]||!$)for(var c=0;c<u;c++){if("."!==a[c].charAt(0)||this.dot){var h=o.concat(a[c],s);this._process(h,i,!0);var f=o.concat(a[c],n);this._process(f,i,!0)}}}},p.prototype._processSimple=function(t,e){var r=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),r){if(t&&o(t)&&!this.nomount){var n=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=a.join(this.root,t):(t=a.resolve(this.root,t),n&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t)}},p.prototype._stat=function(t){var e=this._makeAbs(t),r="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&c(this.cache,e)){var i=this.cache[e];if(Array.isArray(i)&&(i="DIR"),!r||"DIR"===i)return i;if(r&&"FILE"===i)return!1}var $=this.statCache[e];if(!$){var a;try{a=n.lstatSync(e)}catch(t){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[e]=!1,!1}if(a&&a.isSymbolicLink())try{$=n.statSync(e)}catch(t){$=a}else $=a}this.statCache[e]=$;i=!0;return $&&(i=$.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||i,(!r||"FILE"!==i)&&i},p.prototype._mark=function(t){return l.mark(this,t)},p.prototype._makeAbs=function(t){return l.makeAbs(this,t)}},function(t,e,r){var n=r(16),i=Object.create(null),$=r(17);function a(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n]=t[n];return r}t.exports=n((function(t,e){return i[t]?(i[t].push(e),null):(i[t]=[e],function(t){return $((function e(){var r=i[t],n=r.length,$=a(arguments);try{for(var s=0;s<n;s++)r[s].apply(null,$)}finally{r.length>n?(r.splice(0,n),process.nextTick((function(){e.apply(null,$)}))):delete i[t]}}))}(t))}))},function(t,e){t.exports=require("os")},function(t,e,r){(function(t){
|
2
|
+
/**
|
3
|
+
* Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
|
4
|
+
*
|
5
|
+
* This can be used with JS designed for browsers to improve reuse of code and
|
6
|
+
* allow the use of existing libraries.
|
7
|
+
*
|
8
|
+
* Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
|
9
|
+
*
|
10
|
+
* @author Dan DeFelippi <dan@driverdan.com>
|
11
|
+
* @contributor David Ellis <d.f.ellis@ieee.org>
|
12
|
+
* @contributor Guillaume Grossetie <ggrossetie@yuzutech.fr>
|
13
|
+
* @license MIT
|
14
|
+
*/
|
15
|
+
const n=r(33),i=r(1);r(2);e.XMLHttpRequest=function(){"use strict";const e=this,$=r(34),a=r(35);let s,o,l={},u=!1;const c={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"};let h={};const f={},d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],p=["TRACE","TRACK","CONNECT"];let _=!1,y=!1;const g={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1,this.responseType="";this.open=function(t,e,r,n,i){if(this.abort(),y=!1,!function(t){return t&&-1===p.indexOf(t)}(t))throw new Error("SecurityError: Request method not allowed");l={method:t,url:e.toString(),async:"boolean"!=typeof r||r,user:n||null,password:i||null},m(this.OPENED)},this.setDisableHeaderCheck=function(t){u=t},this.setRequestHeader=function(t,e){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(function(t){return u||t&&-1===d.indexOf(t.toLowerCase())}(t)){if(_)throw new Error("INVALID_STATE_ERR: send flag is true");t=f[t.toLowerCase()]||t,f[t.toLowerCase()]=t,h[t]=h[t]?h[t]+", "+e:e}else console.warn('Refused to set unsafe header "'+t+'"')},this.getResponseHeader=function(t){return"string"==typeof t&&this.readyState>this.OPENED&&o&&o.headers&&o.headers[t.toLowerCase()]&&!y?o.headers[t.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||y)return"";let t="";for(let e in o.headers)"set-cookie"!==e&&"set-cookie2"!==e&&(t+=e+": "+o.headers[e]+"\r\n");return t.substr(0,t.length-2)},this.getRequestHeader=function(t){return"string"==typeof t&&f[t.toLowerCase()]?h[f[t.toLowerCase()]]:""},this.send=function(u){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(_)throw new Error("INVALID_STATE_ERR: send has already been called");let d=!1,p=!1;const g=n.parse(l.url);let v;switch(g.protocol){case"https:":d=!0,v=g.hostname;break;case"http:":v=g.hostname;break;case"file:":p=!0;break;case void 0:case null:case"":v="localhost";break;default:throw new Error("Protocol not supported.")}if(p){if("GET"!==l.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(l.async)i.readFile(g.pathname,"utf8",(function(t,r){t?e.handleError(t):(e.status=200,e.responseText=r,m(e.DONE))}));else try{this.responseText=i.readFileSync(g.pathname,"utf8"),this.status=200,m(e.DONE)}catch(t){this.handleError(t)}return}const b=g.port||(d?443:80),O=g.pathname+(g.search?g.search:"");for(let t in c)f[t.toLowerCase()]||(h[t]=c[t]);if(h.Host=v,"["===g.host[0]&&(h.Host="["+h.Host+"]"),d&&443===b||80===b||(h.Host+=":"+g.port),l.user){void 0===l.password&&(l.password="");const t=Buffer.from(l.user+":"+l.password);h.Authorization="Basic "+t.toString("base64")}"GET"===l.method||"HEAD"===l.method?u=null:u?(h["Content-Length"]=Buffer.isBuffer(u)?u.length:Buffer.byteLength(u),this.getRequestHeader("Content-Type")||(h["Content-Type"]="text/plain;charset=UTF-8")):"POST"===l.method&&(h["Content-Length"]=0);const w={host:v,port:b,path:O,method:l.method,headers:h,agent:!1,withCredentials:e.withCredentials},E=this.responseType||"text";if(y=!1,l.async){var x=d?a.request:$.request;_=!0,e.dispatchEvent("readystatechange");const t=function t(i){if(301!==(o=i).statusCode&&302!==o.statusCode&&303!==o.statusCode&&307!==o.statusCode)o.setEncoding("utf8"),m(e.HEADERS_RECEIVED),e.status=o.statusCode,o.on("data",(function(t){t&&(e.responseText+=t),_&&m(e.LOADING)})),o.on("end",(function(){_&&(m(e.DONE),_=!1)})),o.on("error",(function(t){e.handleError(t)}));else{l.url=o.headers.location;const i=n.parse(l.url);v=i.hostname;const $={hostname:i.hostname,port:i.port,path:i.path,method:303===o.statusCode?"GET":l.method,headers:h,withCredentials:e.withCredentials};(s=x($,t).on("error",r)).end()}},r=function(t){e.handleError(t)};s=x(w,t).on("error",r),u&&s.write(u),s.end(),e.dispatchEvent("loadstart")}else{const n="text"===E?"utf8":"binary",i=r(36).execSync(`"${process.argv[0]}" "${t}/request.js" --ssl="${d}" --encoding="${n}" --request-options=${JSON.stringify(JSON.stringify(w))}`,{stdio:"pipe"}),$=JSON.parse(i.toString("utf8"));$.error?e.handleError($.error):(o=$.data,e.status=$.data.statusCode,"binary"===n?e.response=Uint8Array.from($.data.binary.data).buffer:e.responseText=$.data.text,m(e.DONE))}},this.handleError=function(t){this.status=0,this.statusText=t,this.responseText=t.stack,y=!0,m(this.DONE),this.dispatchEvent("error")},this.abort=function(){s&&(s.abort(),s=null),h=c,this.status=0,this.responseText="",this.responseXML="",y=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!_||this.readyState===this.DONE||(_=!1,m(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},this.addEventListener=function(t,e){t in g||(g[t]=[]),g[t].push(e)},this.removeEventListener=function(t,e){t in g&&(g[t]=g[t].filter((function(t){return t!==e})))},this.dispatchEvent=function(t){if("function"==typeof e["on"+t]&&e["on"+t](),t in g)for(let r=0,n=g[t].length;r<n;r++)g[t][r].call(e)};const m=function(t){t!==e.LOADING&&e.readyState===t||(e.readyState=t,(l.async||e.readyState<e.OPENED||e.readyState===e.DONE)&&e.dispatchEvent("readystatechange"),e.readyState!==e.DONE||y||(e.dispatchEvent("load"),e.dispatchEvent("loadend")))}}}).call(this,"/")},function(t,e){t.exports=require("url")},function(t,e){t.exports=require("http")},function(t,e){t.exports=require("https")},function(t,e){t.exports=require("child_process")},function(t,e,r){"use strict"},,,,function(t,e,r){"use strict";r.r(e);var n=r(18),i=r(19);r(37);Object(n.a)(),Opal.load("opal"),Object(i.a)(),Opal.load("nodejs"),Opal.load("promise"),e.default=Opal}]);
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "typhoeus"
|
2
|
+
require "oj"
|
3
|
+
require "json"
|
4
|
+
require "opal"
|
5
|
+
require "parser"
|
6
|
+
require "unparser"
|
7
|
+
require "method_source"
|
8
|
+
require "active_support/core_ext/string"
|
9
|
+
require "isomorfeus/promise"
|
10
|
+
require "arango"
|
11
|
+
require "arango/helper/request_method"
|
12
|
+
require "arango/helper/satisfaction"
|
13
|
+
require "arango/helper/server_assignment"
|
14
|
+
require "arango/helper/database_assignment"
|
15
|
+
require "arango/helper/collection_assignment"
|
16
|
+
require "arango/helper/return"
|
17
|
+
require "arango/helper/traversal"
|
18
|
+
require "arango/result"
|
19
|
+
require "arango/request"
|
20
|
+
require "arango/request_batch"
|
21
|
+
require "arango/server/administration"
|
22
|
+
require "arango/server/async"
|
23
|
+
require "arango/server/config"
|
24
|
+
require "arango/server/databases"
|
25
|
+
require "arango/server/monitoring"
|
26
|
+
require "arango/server/tasks"
|
27
|
+
require "arango/server/opal_support"
|
28
|
+
require "arango/server"
|
29
|
+
require "arango/database/aql_functions"
|
30
|
+
require "arango/database/collections"
|
31
|
+
require "arango/database/foxx_services"
|
32
|
+
require "arango/database/graph_access"
|
33
|
+
require "arango/database/http_route"
|
34
|
+
require "arango/database/aql_queries"
|
35
|
+
require "arango/database/aql_query_cache"
|
36
|
+
require "arango/database/replication"
|
37
|
+
require "arango/database/stream_transactions"
|
38
|
+
require "arango/database/tasks"
|
39
|
+
require "arango/database/transactions"
|
40
|
+
require "arango/database/view_access"
|
41
|
+
require "arango/database"
|
42
|
+
require "arango/aql"
|
43
|
+
require "arango/collection/documents"
|
44
|
+
require "arango/collection/importing"
|
45
|
+
require "arango/collection/indexes"
|
46
|
+
require "arango/collection/replication"
|
47
|
+
require "arango/collection"
|
48
|
+
require "arango/replication"
|
49
|
+
require "arango/document"
|
50
|
+
require "arango/edge"
|
51
|
+
require "arango/error"
|
52
|
+
require 'arango/error_db'
|
53
|
+
require "arango/foxx"
|
54
|
+
require "arango/graph"
|
55
|
+
require "arango/index"
|
56
|
+
require "arango/task"
|
57
|
+
require "arango/transaction"
|
58
|
+
require "arango/traversal"
|
59
|
+
require "arango/user"
|
60
|
+
require "arango/vertex"
|
61
|
+
require "arango/view"
|
data/lib/arango.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
module Arango
|
2
|
+
def self.current_database
|
3
|
+
@current_database
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.current_database=(d)
|
7
|
+
@current_database = d
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.current_server
|
11
|
+
@current_server
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.current_server=(s)
|
15
|
+
@current_server = s
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.connect_to(username: "root", password:, host: "localhost", warning: true, port: "8529", return_output: false,
|
19
|
+
timeout: 5, tls: false, database: nil)
|
20
|
+
@current_server = Arango::Server.new(username: username, password: password, host: host, warning: warning, port: port,
|
21
|
+
return_output: return_output, timeout: timeout, tls: tls)
|
22
|
+
@current_database = @current_server.get_database(database) if database
|
23
|
+
@current_server
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.request_class_method(target_class, method_name, &block)
|
27
|
+
promise_method_name = "batch_#{method_name}".to_sym
|
28
|
+
target_class.define_singleton_method(method_name) do |*args|
|
29
|
+
request_hash = instance_exec(*args, &block)
|
30
|
+
db = if args.last.key?(:collection)
|
31
|
+
args.last[:collection].database
|
32
|
+
elsif args.last.key?(:database)
|
33
|
+
args.last[:database]
|
34
|
+
end
|
35
|
+
db.execute_request(request_hash)
|
36
|
+
end
|
37
|
+
target_class.define_singleton_method(promise_method_name) do |*args|
|
38
|
+
request_hash = instance_exec(*args, &block)
|
39
|
+
db = if args.last.key?(:collection)
|
40
|
+
args.last[:collection].database
|
41
|
+
elsif args.last.key?(:database)
|
42
|
+
args.last[:database]
|
43
|
+
end
|
44
|
+
db.batch_request(request_hash)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.multi_request_class_method(target_class, method_name, &block)
|
49
|
+
promise_method_name = "batch_#{method_name}".to_sym
|
50
|
+
target_class.define_singleton_method(method_name) do |*args|
|
51
|
+
requests = instance_exec(*args, &block)
|
52
|
+
db = if args.last.key?(:collection)
|
53
|
+
args.last[:collection].database
|
54
|
+
elsif args.last.key?(:database)
|
55
|
+
args.last[:database]
|
56
|
+
end
|
57
|
+
db.execute_requests(requests)
|
58
|
+
end
|
59
|
+
target_class.define_singleton_method(promise_method_name) do |*args|
|
60
|
+
requests = instance_exec(*args, &block)
|
61
|
+
promises = []
|
62
|
+
db = if args.last.key?(:collection)
|
63
|
+
args.last[:collection].database
|
64
|
+
elsif args.last.key?(:database)
|
65
|
+
args.last[:database]
|
66
|
+
end
|
67
|
+
requests.each do |request_hash|
|
68
|
+
promises << db.batch_request(request_hash)
|
69
|
+
end
|
70
|
+
Promise.when(*promises).then { |values| values.last }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.aql_request_class_method(target_class, method_name, &block)
|
75
|
+
promise_method_name = "batch_#{method_name}".to_sym
|
76
|
+
target_class.define_singleton_method(method_name) do |*args|
|
77
|
+
request_hash = instance_exec(*args, &block)
|
78
|
+
db = if args.last.key?(:collection)
|
79
|
+
args.last[:collection].database
|
80
|
+
elsif args.last.key?(:database)
|
81
|
+
args.last[:database]
|
82
|
+
end
|
83
|
+
request_hash.delete(:database)
|
84
|
+
db.execute_aql(request_hash)
|
85
|
+
end
|
86
|
+
target_class.define_singleton_method(promise_method_name) do |*args|
|
87
|
+
request_hash = instance_exec(*args, &block)
|
88
|
+
db = if args.last.key?(:collection)
|
89
|
+
args.last[:collection].database
|
90
|
+
elsif args.last.key?(:database)
|
91
|
+
args.last[:database]
|
92
|
+
end
|
93
|
+
db.batch_execute_aql(request_hash)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
data/lib/arango/aql.rb
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
# === AQL ===
|
2
|
+
|
3
|
+
module Arango
|
4
|
+
class AQL
|
5
|
+
include Arango::Helper::Satisfaction
|
6
|
+
include Arango::Helper::Return
|
7
|
+
extend Arango::Helper::RequestMethod
|
8
|
+
class << self
|
9
|
+
|
10
|
+
# id: the query’s id
|
11
|
+
# query: the query string (potentially truncated)
|
12
|
+
# bindVars: the bind parameter values used by the query
|
13
|
+
# started: the date and time when the query was started
|
14
|
+
# runTime: the query’s run time up to the point the list of queries was queried
|
15
|
+
# state: the query’s current execution state (as a string)
|
16
|
+
# stream: whether or not the query uses a streaming cursor
|
17
|
+
def from_result_hash(query_hash)
|
18
|
+
new_query_hash = query_hash.transform_keys { |k| k.to_s.underscore.to_sym }
|
19
|
+
new_query_hash[:query_id] = query_hash.delete(:id)
|
20
|
+
Arango::AQL.new(**new_query_hash)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(query:, database:, batch_size: nil, bind_vars: nil, cache: nil, count: nil, fail_on_warning: nil, full_count: nil,
|
25
|
+
intermediate_commit_count: nil, intermediate_commit_size: nil, max_plans: nil, max_transaction_size: nil,
|
26
|
+
max_warning_count: nil, memory_limit: nil, optimizer_rules: nil, profile: nil, satellite_sync_wait: nil,
|
27
|
+
skip_inaccessible_collections: nil, ttl: nil,
|
28
|
+
query_id: nil, run_time: nil, started: nil, state: nil, stream: nil,
|
29
|
+
block: nil, &ruby_block)
|
30
|
+
block = ruby_block if block_given?
|
31
|
+
satisfy_class?(query, [String])
|
32
|
+
@query = query
|
33
|
+
@database = database
|
34
|
+
@arango_server = database.arango_server
|
35
|
+
|
36
|
+
@block = block
|
37
|
+
|
38
|
+
@count = count
|
39
|
+
@batch_size = batch_size
|
40
|
+
@cache = cache
|
41
|
+
@memory_limit = memory_limit
|
42
|
+
@ttl = ttl
|
43
|
+
@bind_vars = bind_vars
|
44
|
+
|
45
|
+
@has_more = false
|
46
|
+
@id = nil # cursor id
|
47
|
+
@query_id = query_id
|
48
|
+
@result = nil
|
49
|
+
|
50
|
+
@run_time = run_time
|
51
|
+
@started = started
|
52
|
+
@state = state
|
53
|
+
@stream = stream
|
54
|
+
|
55
|
+
@options = {}
|
56
|
+
set_option(fail_on_warning, 'failOnWarning', :fail_on_warning) if fail_on_warning
|
57
|
+
set_option(full_count, 'fullCount', :full_count) if full_count
|
58
|
+
set_option(intermediate_commit_count, 'intermediateCommitCount', :intermediate_commit_count) if intermediate_commit_count
|
59
|
+
set_option(intermediate_commit_size, 'intermediateCommitSize', :intermediate_commit_size) if intermediate_commit_size
|
60
|
+
set_option(max_plans, 'maxPlans', :max_plans) if max_plans
|
61
|
+
set_option(max_transaction_size, 'maxTransactionSize', :max_transaction_size) if max_transaction_size
|
62
|
+
set_option(max_warning_count, 'maxWarningCount', :max_warning_count) if max_warning_count
|
63
|
+
set_option(profile, 'profile', :profile) if profile
|
64
|
+
set_option(satellite_sync_wait, 'satelliteSyncWait', :satellite_sync_wait) if satellite_sync_wait
|
65
|
+
set_option(skip_inaccessible_collections, 'skipInaccessibleCollections', :skip_inaccessible_collections) if skip_inaccessible_collections
|
66
|
+
send(:optimizer_rules=, optimizer_rules) if optimizer_rules
|
67
|
+
end
|
68
|
+
|
69
|
+
def optimizer_rules=(attrs)
|
70
|
+
@optimizer_rules = attrs
|
71
|
+
if attrs.nil?
|
72
|
+
@options.delete('optimizer.rules')
|
73
|
+
else
|
74
|
+
@options['optimizer.rules'] = attrs
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
%w[failOnWarning fullCount intermediateCommitCount intermediateCommitSize maxPlans maxTransactionSize maxWarningCount
|
79
|
+
profile satelliteSyncWait skipInaccessibleCollections].each do |param_name|
|
80
|
+
var_name = param_name.underscore.to_sym
|
81
|
+
attr_reader var_name
|
82
|
+
define_method("#{var_name}=") do |value|
|
83
|
+
set_option(value, param_name, var_name)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
attr_accessor :batch_size, :bind_vars, :cache, :count, :options, :query, :ttl
|
88
|
+
|
89
|
+
attr_reader :arango_server, :cached, :database, :extra, :id, :id_cache, :optimizer_rules, :result
|
90
|
+
attr_reader :run_time, :started, :state, :stream
|
91
|
+
|
92
|
+
def has_more?
|
93
|
+
@has_more
|
94
|
+
end
|
95
|
+
|
96
|
+
def to_h
|
97
|
+
{
|
98
|
+
batchSize: @batch_size,
|
99
|
+
bindVars: @bind_vars,
|
100
|
+
cache: @cache,
|
101
|
+
count: @count,
|
102
|
+
database: @database.name,
|
103
|
+
idCache: @id_cache,
|
104
|
+
memoryLimit: @memory_limit,
|
105
|
+
options: @options,
|
106
|
+
query: @query,
|
107
|
+
result: @result,
|
108
|
+
ttl: @ttl
|
109
|
+
}.delete_if{|_,v| v.nil?}
|
110
|
+
end
|
111
|
+
|
112
|
+
def request
|
113
|
+
body = {
|
114
|
+
batchSize: @batch_size,
|
115
|
+
bindVars: @bind_vars,
|
116
|
+
cache: @cache,
|
117
|
+
count: @count,
|
118
|
+
memoryLimit: @memory_limit,
|
119
|
+
options: @options,
|
120
|
+
query: @query,
|
121
|
+
ttl: @ttl
|
122
|
+
}
|
123
|
+
{ post: "_api/cursor", body: body, block: ->(result) {
|
124
|
+
set_instance_vars(result)
|
125
|
+
@block ? @block.call(self, result) : self
|
126
|
+
}}
|
127
|
+
end
|
128
|
+
|
129
|
+
request_method :execute do
|
130
|
+
request
|
131
|
+
end
|
132
|
+
|
133
|
+
request_method :next do
|
134
|
+
if @has_more
|
135
|
+
{ put: "_api/cursor/#{@id}", block: ->(result) { set_instance_vars(result); self }}
|
136
|
+
else
|
137
|
+
raise Arango::Error.new err: :no_other_aql_next, data: { hasMore: false }
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
request_method :drop do
|
142
|
+
{ delete: "_api/cursor/#{@id}", block: ->(result) { result.response_code == 200 }}
|
143
|
+
end
|
144
|
+
alias delete drop
|
145
|
+
alias destroy drop
|
146
|
+
alias batch_delete batch_drop
|
147
|
+
alias batch_destroy batch_drop
|
148
|
+
|
149
|
+
request_method :kill do
|
150
|
+
{ delete: "_api/query/#{@query_id}", block: ->(result) { result.response_code == 200 }}
|
151
|
+
end
|
152
|
+
|
153
|
+
# === PROPERTY QUERY ===
|
154
|
+
|
155
|
+
request_method :explain do
|
156
|
+
body = {
|
157
|
+
query: @query,
|
158
|
+
options: @options,
|
159
|
+
bindVars: @bind_vars
|
160
|
+
}
|
161
|
+
{ post: "_api/explain", body: body, block: ->(result) { result }}
|
162
|
+
end
|
163
|
+
|
164
|
+
request_method :parse do
|
165
|
+
{ post: "_api/query", body: {query: @query} , block: ->(result) { result }}
|
166
|
+
end
|
167
|
+
|
168
|
+
private
|
169
|
+
|
170
|
+
def set_option(attrs, name, var_name)
|
171
|
+
instance_variable_set("@#{var_name}", attrs)
|
172
|
+
if attrs.nil?
|
173
|
+
@options.delete(name)
|
174
|
+
else
|
175
|
+
@options[name] = attrs
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def set_instance_vars(result)
|
180
|
+
@cached = result[:cached]
|
181
|
+
@extra = result[:extra]
|
182
|
+
@has_more = result[:hasMore]
|
183
|
+
@id = result[:id]
|
184
|
+
@count = result[:count]
|
185
|
+
@result = result[:result]
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
@@ -0,0 +1,575 @@
|
|
1
|
+
# === COLLECTION ===
|
2
|
+
|
3
|
+
module Arango
|
4
|
+
class Collection
|
5
|
+
include Arango::Helper::Satisfaction
|
6
|
+
include Arango::Helper::Return
|
7
|
+
extend Arango::Helper::RequestMethod
|
8
|
+
|
9
|
+
include Arango::Collection::Documents
|
10
|
+
include Arango::Collection::Indexes
|
11
|
+
|
12
|
+
STATES = %i[unknown new_born unloaded loaded being_unloaded deleted loading] # do not sort, index is used
|
13
|
+
TYPES = %i[unknown unknown document edge] # do not sort, index is used
|
14
|
+
|
15
|
+
class << self
|
16
|
+
# Takes a hash and instantiates a Arango::Collection object from it.
|
17
|
+
# @param collection_hash [Hash]
|
18
|
+
# @return [Arango::Collection]
|
19
|
+
def from_h(collection_hash, database: nil)
|
20
|
+
collection_hash = collection_hash.transform_keys { |k| k.to_s.underscore.to_sym }
|
21
|
+
collection_hash.merge!(database: database) if database
|
22
|
+
%i[code error].each { |key| collection_hash.delete(key) }
|
23
|
+
instance_variable_hash = {}
|
24
|
+
%i[cache_enabled globally_unique_id id object_id].each do |key|
|
25
|
+
instance_variable_hash[key] = collection_hash.delete(key)
|
26
|
+
end
|
27
|
+
collection = Arango::Collection.new(collection_hash.delete(:name), **collection_hash)
|
28
|
+
instance_variable_hash.each do |k,v|
|
29
|
+
collection.instance_variable_set("@#{k}", v)
|
30
|
+
end
|
31
|
+
collection
|
32
|
+
end
|
33
|
+
|
34
|
+
# Takes a Arango::Result and instantiates a Arango::Collection object from it.
|
35
|
+
# @param collection_result [Arango::Result]
|
36
|
+
# @param properties_result [Arango::Result]
|
37
|
+
# @return [Arango::Collection]
|
38
|
+
def from_results(collection_result, properties_result, database: nil)
|
39
|
+
hash = {}.merge(collection_result.to_h)
|
40
|
+
%i[cache_enabled globally_unique_id id key_options object_id wait_for_sync].each do |key|
|
41
|
+
hash[key] = properties_result[key]
|
42
|
+
end
|
43
|
+
from_h(hash, database: database)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Retrieves all collections from the database.
|
47
|
+
# @param exclude_system [Boolean] Optional, default true, exclude system collections.
|
48
|
+
# @param database [Arango::Database]
|
49
|
+
# @return [Array<Arango::Collection>]
|
50
|
+
Arango.request_class_method(Arango::Collection, :all) do |exclude_system: true, database: Arango.current_database|
|
51
|
+
query = { excludeSystem: exclude_system }
|
52
|
+
{ get: '_api/collection', query: query, block: ->(result) { result.result.map { |c| from_h(c.to_h, database: database) }}}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Get collection from the database.
|
56
|
+
# @param name [String] The name of the collection.
|
57
|
+
# @param database [Arango::Database]
|
58
|
+
# @return [Arango::Database]
|
59
|
+
Arango.multi_request_class_method(Arango::Collection, :get) do |name, database: Arango.current_database|
|
60
|
+
requests = []
|
61
|
+
first_get_result = nil
|
62
|
+
requests << { get: "/_api/collection/#{name}", block: ->(result) { first_get_result = result }}
|
63
|
+
requests << { get: "/_api/collection/#{name}/properties", block: ->(result) { from_results(first_get_result, result, database: database) }}
|
64
|
+
requests
|
65
|
+
end
|
66
|
+
alias fetch get
|
67
|
+
alias retrieve get
|
68
|
+
alias batch_fetch batch_get
|
69
|
+
alias batch_retrieve batch_get
|
70
|
+
|
71
|
+
# Retrieves a list of all collections.
|
72
|
+
# @param exclude_system [Boolean] Optional, default true, exclude system collections.
|
73
|
+
# @param database [Arango::Database]
|
74
|
+
# @return [Array<String>] List of collection names.
|
75
|
+
Arango.request_class_method(Arango::Collection, :list) do |exclude_system: true, database: Arango.current_database|
|
76
|
+
query = { excludeSystem: exclude_system }
|
77
|
+
{ get: '_api/collection', query: query, block: ->(result) { result.result.map { |c| c[:name] }}}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Removes a collection.
|
81
|
+
# @param name [String] The name of the collection.
|
82
|
+
# @param database [Arango::Database]
|
83
|
+
# @return nil
|
84
|
+
Arango.request_class_method(Arango::Collection, :drop) do |name, database: Arango.current_database|
|
85
|
+
{ delete: "_api/collection/#{name}" , block: ->(_) { nil }}
|
86
|
+
end
|
87
|
+
alias delete drop
|
88
|
+
alias destroy drop
|
89
|
+
alias batch_delete batch_drop
|
90
|
+
alias batch_destroy batch_drop
|
91
|
+
|
92
|
+
# Check if collection exists.
|
93
|
+
# @param name [String] Name of the collection
|
94
|
+
# @param database [Arango::Database]
|
95
|
+
# @return [Boolean]
|
96
|
+
Arango.request_class_method(Arango::Collection, :exist?) do |name, exclude_system: true, database: Arango.current_database|
|
97
|
+
query = { excludeSystem: exclude_system }
|
98
|
+
{ get: '_api/collection', query: query, block: ->(result) { result.result.map { |c| c[:name] }.include?(name) }}
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Instantiate a new collection.
|
103
|
+
# For param description see the attributes descriptions. All params except name and database are optional.
|
104
|
+
# @param name [String] The name of the collection.
|
105
|
+
# @param type [Symbol]
|
106
|
+
# @param database [Arango::Database]
|
107
|
+
# @param status
|
108
|
+
# @param distribute_shards_like
|
109
|
+
# @param do_compact
|
110
|
+
# @param index_buckets
|
111
|
+
# @param is_system
|
112
|
+
# @param is_volatile
|
113
|
+
# @param journal_size
|
114
|
+
# @param key_options
|
115
|
+
# @param number_of_shards
|
116
|
+
# @param replication_factor
|
117
|
+
# @param shard_keys
|
118
|
+
# @param sharding_strategy
|
119
|
+
# @param smart_join_attribute
|
120
|
+
# @param wait_for_sync
|
121
|
+
# @param wait_for_sync_replication
|
122
|
+
# @param enforce_replication_factor
|
123
|
+
# @return [Arango::Collection]
|
124
|
+
def initialize(name, database: Arango.current_database, graph: nil, type: :document,
|
125
|
+
status: nil,
|
126
|
+
distribute_shards_like: nil, do_compact: nil, enforce_replication_factor: nil, index_buckets: nil, is_system: false,
|
127
|
+
is_volatile: false, journal_size: nil, key_options: nil, number_of_shards: nil, replication_factor: nil, shard_keys: nil,
|
128
|
+
sharding_strategy: nil, smart_join_attribute: nil, wait_for_sync: nil, wait_for_sync_replication: nil)
|
129
|
+
send(:database=, database)
|
130
|
+
# assign_graph(graph)
|
131
|
+
@aql = nil
|
132
|
+
@batch_proc = nil
|
133
|
+
@name = name
|
134
|
+
@name_changed = false
|
135
|
+
@original_name = name
|
136
|
+
@distribute_shards_like = distribute_shards_like
|
137
|
+
@do_compact = do_compact
|
138
|
+
@enforce_replication_factor = enforce_replication_factor
|
139
|
+
@index_buckets = index_buckets
|
140
|
+
@is_system = is_system
|
141
|
+
@is_volatile = is_volatile
|
142
|
+
@journal_size = journal_size
|
143
|
+
@journal_size_changed = false
|
144
|
+
@key_options = key_options
|
145
|
+
@number_of_shards = number_of_shards
|
146
|
+
@replication_factor = replication_factor
|
147
|
+
@shard_keys = shard_keys
|
148
|
+
@sharding_strategy = sharding_strategy
|
149
|
+
@smart_join_attribute = smart_join_attribute
|
150
|
+
_set_status(status)
|
151
|
+
_set_type(type)
|
152
|
+
@wait_for_sync = wait_for_sync
|
153
|
+
@wait_for_sync_changed = false
|
154
|
+
@wait_for_sync_replication = wait_for_sync_replication
|
155
|
+
end
|
156
|
+
|
157
|
+
attr_accessor :database
|
158
|
+
attr_reader :graph
|
159
|
+
|
160
|
+
# @return [Boolean]
|
161
|
+
attr_reader :cache_enabled
|
162
|
+
|
163
|
+
# In an Enterprise Edition cluster, this attribute binds the specifics of sharding for the newly created collection to follow that of a specified
|
164
|
+
# existing collection.
|
165
|
+
# Note: Using this parameter has consequences for the prototype collection. It can no longer be dropped,
|
166
|
+
# before the sharding-imitating collections are dropped. Equally, backups and restores of imitating collections alone will generate warnings
|
167
|
+
# (which can be overridden) about missing sharding prototype.
|
168
|
+
# (The default is ”“)
|
169
|
+
# Can only be set by calling the constructor with the distribute_shards_like param.
|
170
|
+
# @return [String]
|
171
|
+
attr_reader :distribute_shards_like
|
172
|
+
|
173
|
+
# Whether or not the collection will be compacted (default is true) This option is meaningful for the MMFiles storage engine only.
|
174
|
+
# Can only be set by calling the constructor with the do_compact param.
|
175
|
+
# @return [Boolean]
|
176
|
+
attr_reader :do_compact
|
177
|
+
|
178
|
+
# Default is 1 which means the server will check if there are enough replicas available at creation time and
|
179
|
+
# bail out otherwise. Set to 0 to disable this extra check.
|
180
|
+
# Can only be set by calling the constructor with the enforce_replication_factor param.
|
181
|
+
# @return [Integer]
|
182
|
+
attr_reader :enforce_replication_factor
|
183
|
+
|
184
|
+
# @return [String]
|
185
|
+
attr_reader :globally_unique_id
|
186
|
+
|
187
|
+
# @return [String]
|
188
|
+
attr_reader :id
|
189
|
+
|
190
|
+
# The number of buckets into which indexes using a hash table are split. The default is 16 and this number
|
191
|
+
# has to be a power of 2 and less than or equal to 1024.
|
192
|
+
# This option is meaningful for the MMFiles storage engine only.
|
193
|
+
# Can only be set by calling the constructor with the index_buckets param.
|
194
|
+
# @return [Integer]
|
195
|
+
attr_reader :index_buckets
|
196
|
+
|
197
|
+
# If true, create a system collection. In this case collection-name should start with an underscore.
|
198
|
+
# End users should normally create non-system collections only. API implementors may be required to create system collections in
|
199
|
+
# very special occasions, but normally a regular collection will do. (The default is false)
|
200
|
+
# Can only be set by calling the constructor with the is_system param.
|
201
|
+
# @return [Boolean]
|
202
|
+
attr_reader :is_system
|
203
|
+
|
204
|
+
# If true then the collection data is kept in-memory only and not made persistent. Unloading the collection will cause the collection data to
|
205
|
+
# be discarded. Stopping or re-starting the server will also cause full loss of data in the collection.
|
206
|
+
# Setting this option will make the resulting collection be slightly faster than regular collections because ArangoDB does not enforce any
|
207
|
+
# synchronization to disk and does not calculate any CRC checksums for datafiles (as there are no datafiles). This option should therefore
|
208
|
+
# be used for cache-type collections only, and not for data that cannot be re-created otherwise. (The default is false)
|
209
|
+
# This option is meaningful for the MMFiles storage engine only.
|
210
|
+
# Can only be set by calling the constructor with the is_volatile param.
|
211
|
+
# @return [Boolean]
|
212
|
+
attr_reader :is_volatile
|
213
|
+
|
214
|
+
# The maximal size of a journal or datafile in bytes. The value must be at least 1048576 (1 MiB). (The default is a configuration parameter).
|
215
|
+
# This option is meaningful for the MMFiles storage engine only.
|
216
|
+
# @return [Integer] or nil
|
217
|
+
attr_reader :journal_size
|
218
|
+
|
219
|
+
# The name of the collection.
|
220
|
+
# @return [String]
|
221
|
+
attr_reader :name
|
222
|
+
|
223
|
+
# In a cluster, this value determines the number of shards to create for the collection. In a single server setup, this option is meaningless.
|
224
|
+
# (The default is 1)
|
225
|
+
# Can only be set by calling the constructor with the number_of_shards param.
|
226
|
+
# @return [Integer]
|
227
|
+
attr_reader :number_of_shards
|
228
|
+
|
229
|
+
# In a cluster, this attribute determines how many copies of each shard are kept on different DBServers.
|
230
|
+
# The value 1 means that only one copy (no synchronous replication) is kept.
|
231
|
+
# A value of k means that k-1 replicas are kept. Any two copies reside on different DBServers.
|
232
|
+
# Replication between them is synchronous, that is, every write operation to the “leader” copy will be replicated to all “follower” replicas,
|
233
|
+
# before the write operation is reported successful.
|
234
|
+
# (The default is 1)
|
235
|
+
# Can only be set by calling the constructor with the replication_factor param.
|
236
|
+
# @return [Integer]
|
237
|
+
attr_reader :replication_factor
|
238
|
+
|
239
|
+
# In a cluster, this attribute determines which document attributes are used to determine the target shard for documents.
|
240
|
+
# Documents are sent to shards based on the values of their shard key attributes.
|
241
|
+
# The values of all shard key attributes in a document are hashed, and the hash value is used to determine the target shard.
|
242
|
+
# Note: Values of shard key attributes cannot be changed once set. This option is meaningless in a single server setup.
|
243
|
+
# (The default is [ “_key” ])
|
244
|
+
# Can only be set by calling the constructor with the shard_keys param.
|
245
|
+
# @return [Array<String>]
|
246
|
+
attr_reader :shard_keys
|
247
|
+
|
248
|
+
# In an Enterprise Edition cluster, this attribute determines an attribute of the collection that must contain the shard key value of the
|
249
|
+
# referred-to smart join collection. Additionally, the shard key for a document in this collection must contain the value of this attribute,
|
250
|
+
# followed by a colon, followed by the actual primary key of the document.
|
251
|
+
# This feature can only be used in the Enterprise Edition and requires the distributeShardsLike attribute of the collection to be set to the name
|
252
|
+
# of another collection. It also requires the shardKeys attribute of the collection to be set to a single shard key attribute,
|
253
|
+
# with an additional ‘:’ at the end. A further restriction is that whenever documents are stored or updated in the collection,
|
254
|
+
# the value stored in the smartJoinAttribute must be a string.
|
255
|
+
# Can only be set by calling the constructor with the smart_join_attribute param.
|
256
|
+
# @return [String]
|
257
|
+
attr_reader :smart_join_attribute
|
258
|
+
|
259
|
+
# If true then the data is synchronized to disk before returning from a document create, update, replace or removal operation. (default: false)
|
260
|
+
# @return [Boolean]
|
261
|
+
attr_reader :wait_for_sync
|
262
|
+
|
263
|
+
# Default is true which means the server will only report success back to the client if all replicas have created the collection.
|
264
|
+
# Set to false if you want faster server responses and don’t care about full replication.
|
265
|
+
# Can only be set by calling the constructor with the wait_for_sync_replication param.
|
266
|
+
# @return [Boolean]
|
267
|
+
attr_reader :wait_for_sync_replication
|
268
|
+
|
269
|
+
# The collections ArangoDB object_id, not to be confused with the collections ruby object_id.
|
270
|
+
# @return [String]
|
271
|
+
def arango_object_id
|
272
|
+
@object_id
|
273
|
+
end
|
274
|
+
|
275
|
+
# Additional options for key generation. If specified, then key_options should be a Hash containing the following attributes:
|
276
|
+
# - type: specifies the type of the key generator. The currently available generators are traditional, autoincrement, uuid and padded.
|
277
|
+
# - allow_user_keys: if set to true, then it is allowed to supply own key values in the _key attribute of a document.
|
278
|
+
# If set to false, then the key generator will solely be responsible for generating keys and supplying own key values in the _key attribute
|
279
|
+
# of documents is considered an error.
|
280
|
+
# - increment: increment value for autoincrement key generator. Not used for other key generator types.
|
281
|
+
# - offset: Initial offset value for autoincrement key generator. Not used for other key generator types.
|
282
|
+
# Can only be set by calling the constructor with the key_options param.
|
283
|
+
# @return [Arango::Result]
|
284
|
+
def key_options
|
285
|
+
Arango::Result.new(@key_options)
|
286
|
+
end
|
287
|
+
|
288
|
+
# This attribute specifies the name of the sharding strategy to use for the collection. Since ArangoDB 3.4 there are different sharding strategies
|
289
|
+
# to select from when creating a new collection.
|
290
|
+
# The selected shardingStrategy value will remain fixed for the collection and cannot be changed afterwards.
|
291
|
+
# This is important to make the collection keep its sharding settings and always find documents already distributed to shards using the same
|
292
|
+
# initial sharding algorithm.
|
293
|
+
# The available sharding strategies are:
|
294
|
+
# - community_compat: default sharding used by ArangoDB Community Edition before version 3.4
|
295
|
+
# - enterprise_compat: default sharding used by ArangoDB Enterprise Edition before version 3.4
|
296
|
+
# - enterprise_smart_edge_compat: default sharding used by smart edge collections in ArangoDB Enterprise Edition before version 3.4
|
297
|
+
# - hash: default sharding used for new collections starting from version 3.4 (excluding smart edge collections)
|
298
|
+
# - enterprise_hash_smart_edge: default sharding used for new smart edge collections starting from version 3.4
|
299
|
+
# If no sharding strategy is specified, the default will be hash for all collections, and enterprise_hash_smart_edge for all smart edge
|
300
|
+
# collections (requires the Enterprise Edition of ArangoDB). Manually overriding the sharding strategy does not yet provide a benefit,
|
301
|
+
# but it may later in case other sharding strategies are added.
|
302
|
+
# Can only be set by calling the constructor with the sharding_strategy param and is only available when creating the collection.
|
303
|
+
# Usually its just nil.
|
304
|
+
# @return [Symbol, NilClass]
|
305
|
+
def sharding_strategy
|
306
|
+
@sharding_strategy.to_s.underscore.to_sym if @sharding_strategy
|
307
|
+
end
|
308
|
+
|
309
|
+
# The status of the collection as symbol, one of:
|
310
|
+
# - :unknown
|
311
|
+
# - :new_born
|
312
|
+
# - :unloaded
|
313
|
+
# - :loaded
|
314
|
+
# - :being_unloaded
|
315
|
+
# - :deleted
|
316
|
+
# - :loading
|
317
|
+
# @return [Symbol]
|
318
|
+
def status
|
319
|
+
STATES[@status]
|
320
|
+
end
|
321
|
+
|
322
|
+
# The type of the collection to create. The following values for type are valid:
|
323
|
+
# - document collection, use the :document symbol
|
324
|
+
# - edge collection, use the :edge symbol
|
325
|
+
# The default collection type is :document.
|
326
|
+
# Can only be set by calling the constructor with the type param.
|
327
|
+
# @return [Symbol]
|
328
|
+
def type
|
329
|
+
TYPES[@type]
|
330
|
+
end
|
331
|
+
|
332
|
+
def journal_size=(n)
|
333
|
+
@journal_size_changed = true
|
334
|
+
@journal_size = n
|
335
|
+
end
|
336
|
+
|
337
|
+
def name=(n)
|
338
|
+
@name_changed = true
|
339
|
+
@name = n
|
340
|
+
end
|
341
|
+
|
342
|
+
def arango_server
|
343
|
+
@database.arango_server
|
344
|
+
end
|
345
|
+
|
346
|
+
def wait_for_sync=(boolean)
|
347
|
+
@wait_for_sync_changed = true
|
348
|
+
@wait_for_sync = boolean
|
349
|
+
end
|
350
|
+
|
351
|
+
# Stores the collection in the database.
|
352
|
+
# @return [Arango::Collection] self
|
353
|
+
request_method :create do
|
354
|
+
@name_changed = false
|
355
|
+
@journal_size_changed = false
|
356
|
+
@wait_for_sync_changed = false
|
357
|
+
|
358
|
+
body = {}
|
359
|
+
%i[distributeShardsLike doCompact indexBuckets isSystem isVolatile journalSize name numberOfShards replicationFactor shardingStrategy shardKeys
|
360
|
+
smartJoinAttribute type waitForSync].each do |key|
|
361
|
+
body[key] = instance_variable_get("@#{key.to_s.underscore}")
|
362
|
+
end
|
363
|
+
|
364
|
+
if @key_options && @key_options.class == Hash
|
365
|
+
key_options_hash = @key_options.transform_keys { |key| key.to_s.camelize(:lower).to_sym }
|
366
|
+
key_options_hash.delete_if{|_,v| v.nil?}
|
367
|
+
body[:keyOptions] = key_options_hash unless key_options_hash.empty?
|
368
|
+
end
|
369
|
+
|
370
|
+
query = nil
|
371
|
+
if @enforce_replication_factor || @wait_for_sync_replication
|
372
|
+
query = {}
|
373
|
+
query[:enforceReplicationFactor] = @enforce_replication_factor unless @enforce_replication_factor.nil?
|
374
|
+
query[:waitForSyncReplication] = @wait_for_sync_replication unless @wait_for_sync_replication.nil?
|
375
|
+
end
|
376
|
+
{ post: '_api/collection', body: body, query: query, block: ->(result) { _update_attributes(result); self }}
|
377
|
+
end
|
378
|
+
|
379
|
+
# Drops a collection.
|
380
|
+
# @return [NilClass]
|
381
|
+
request_method :drop do
|
382
|
+
{ delete: "_api/collection/#{@name}", query: { isSystem: @is_system }, block: ->(_) { nil }}
|
383
|
+
end
|
384
|
+
alias delete drop
|
385
|
+
alias destroy drop
|
386
|
+
alias batch_delete batch_drop
|
387
|
+
alias batch_destroy batch_drop
|
388
|
+
|
389
|
+
# Truncates a collection.
|
390
|
+
# @return [Arango::Collection] self
|
391
|
+
request_method :truncate do
|
392
|
+
{ put: "_api/collection/#{@name}/truncate", block: ->(_) { self }}
|
393
|
+
end
|
394
|
+
|
395
|
+
# Counts the documents in a collection
|
396
|
+
# @return [Integer]
|
397
|
+
request_method :size do
|
398
|
+
{ get: "_api/collection/#{@name}/count", block: ->(result) { result.count }}
|
399
|
+
end
|
400
|
+
alias count size
|
401
|
+
alias length size
|
402
|
+
alias batch_count batch_size
|
403
|
+
alias batch_length batch_size
|
404
|
+
|
405
|
+
# Fetch the statistics of a collection
|
406
|
+
# @return [Hash]
|
407
|
+
request_method :statistics do
|
408
|
+
{ get: "_api/collection/#{@name}/figures", block: ->(result) { Arango::Result.new(result.figures) }}
|
409
|
+
end
|
410
|
+
|
411
|
+
# Return the shard ids of a collection
|
412
|
+
# Note: This method only works on a cluster coordinator.
|
413
|
+
# @param details [Boolean] If set to true, the return value will also contain the responsible servers for the collections’ shards.
|
414
|
+
# @return [Array, Hash]
|
415
|
+
def shards(details: false)
|
416
|
+
@database.request(get: "_api/collection/#{@name}/shards", query: { details: details }).shards if @database.arango_server.coordinator?
|
417
|
+
end
|
418
|
+
|
419
|
+
# Retrieve the collections revision id
|
420
|
+
# @return [String]
|
421
|
+
request_method :revision do
|
422
|
+
{ get: "_api/collection/#{@name}/revision", block: -> (result) { result.revision }}
|
423
|
+
end
|
424
|
+
|
425
|
+
# Returns a checksum for the specified collection
|
426
|
+
# @param with_revisions [Boolean] Whether or not to include document revision ids in the checksum calculation, optional, default: false.
|
427
|
+
# @param with_data [Boolean] Whether or not to include document body data in the checksum calculation, optional, default: false.
|
428
|
+
request_method :checksum do |with_revisions: false, with_data: false|
|
429
|
+
query = {
|
430
|
+
withRevisions: with_revisions,
|
431
|
+
withData: with_data
|
432
|
+
}
|
433
|
+
{ get: "_api/collection/#{@name}/checksum", query: query, block: ->(result) { result.checksum } }
|
434
|
+
end
|
435
|
+
|
436
|
+
# Loads a collection into ArangoDBs memory. Returns the collection on success.
|
437
|
+
# @return [Arango::Collection] self
|
438
|
+
def load_into_memory
|
439
|
+
result = @database.request(put: "_api/collection/#{@name}/load", body: { count: false }).status
|
440
|
+
_set_status(result)
|
441
|
+
self
|
442
|
+
end
|
443
|
+
|
444
|
+
# Unloads a collection into ArangoDBs memory. Returns the collection on success.
|
445
|
+
# @return [Arango::Collection] self
|
446
|
+
def unload_from_memory
|
447
|
+
result = @database.request(put: "_api/collection/#{@name}/unload").status
|
448
|
+
_set_status(result)
|
449
|
+
self
|
450
|
+
end
|
451
|
+
|
452
|
+
# Load Indexes into Memory
|
453
|
+
# Note: For the time being this function is only useful on RocksDB storage engine, as in MMFiles engine all indexes are in memory anyways.
|
454
|
+
# @return [Arango::Collection] self
|
455
|
+
def load_indexes_into_memory
|
456
|
+
@database.request(put: "_api/collection/#{@name}/loadIndexesIntoMemory") if @database.arango_server.rocksdb?
|
457
|
+
self
|
458
|
+
end
|
459
|
+
|
460
|
+
# Rotates the journal of a collection. Collection must have a journal.
|
461
|
+
# Note: This method is specific for the MMFiles storage engine, and there it is not available in a cluster.
|
462
|
+
# @return [Arango::Collection] self
|
463
|
+
def rotate_journal
|
464
|
+
@database.request(put: "_api/collection/#{@name}/rotate") if @database.arango_server.mmfiles?
|
465
|
+
self
|
466
|
+
end
|
467
|
+
|
468
|
+
# recalculates the document count of a collection
|
469
|
+
# Note: This function is only useful on RocksDB storage engine.
|
470
|
+
# @return [Arango::Collection] self
|
471
|
+
def recalculate_count
|
472
|
+
@database.request(put: "_api/collection/#{@name}/recalculateCount") if @database.arango_server.rocksdb?
|
473
|
+
self
|
474
|
+
end
|
475
|
+
|
476
|
+
# Reload collection properties and name from the database, reverting any changes.
|
477
|
+
# @return [Arango::Collection] self
|
478
|
+
request_method :reload do
|
479
|
+
request_name = @name_changed ? @original_name : @name
|
480
|
+
@name_changed = false
|
481
|
+
@journal_size_changed = false
|
482
|
+
@wait_for_sync_changed = false
|
483
|
+
{ get: "_api/collection/#{request_name}/properties", block: ->(result) { _update_attributes(result); self }}
|
484
|
+
end
|
485
|
+
alias refresh reload
|
486
|
+
alias retrieve reload
|
487
|
+
alias revert reload
|
488
|
+
alias batch_refresh batch_reload
|
489
|
+
alias batch_retrieve batch_reload
|
490
|
+
alias batch_revert batch_reload
|
491
|
+
|
492
|
+
# Save changed collection properties and name changed, to the database.
|
493
|
+
# Note: except for wait_for_sync, journal_size and name, collection properties cannot be changed once a collection is created.
|
494
|
+
# @return [Arango::Collection] self
|
495
|
+
multi_request_method :save do
|
496
|
+
requests = []
|
497
|
+
if @name_changed
|
498
|
+
request_name = @name_changed ? @original_name : @name
|
499
|
+
@name_changed = false
|
500
|
+
# @database.request(put: "_api/collection/#{request_name}/rename", body: { name: @name })
|
501
|
+
requests << { put: "_api/collection/#{request_name}/rename", body: { name: @name }, block: -> (_) { self }}
|
502
|
+
@original_name = @name
|
503
|
+
end
|
504
|
+
if @journal_size_changed || @wait_for_sync_changed
|
505
|
+
body = {}
|
506
|
+
body[:journalSize] = @journal_size if @journal_size_changed && @database.arango_server.mmfiles?
|
507
|
+
body[:waitForSync] = @wait_for_sync if @wait_for_sync_changed
|
508
|
+
@journal_size_changed = false
|
509
|
+
@wait_for_sync_changed = false
|
510
|
+
# result = @database.request(get: "_api/collection/#{@name}/properties", body: body)
|
511
|
+
requests << { get: "_api/collection/#{@name}/properties", body: body, block: -> (result) {
|
512
|
+
@journal_size = result.journal_size if result.key?(:journal_size)
|
513
|
+
@wait_for_sync = result.wait_for_sync if result.key?(:wait_for_sync)
|
514
|
+
self
|
515
|
+
}}
|
516
|
+
end
|
517
|
+
requests
|
518
|
+
end
|
519
|
+
alias update save
|
520
|
+
alias batch_update batch_save
|
521
|
+
|
522
|
+
# Request next batch from a batched request.
|
523
|
+
# @return value depending on original batched request.
|
524
|
+
def next_batch
|
525
|
+
return unless has_more?
|
526
|
+
result = @aql.next
|
527
|
+
final_result = if @batch_proc
|
528
|
+
@batch_proc.call(result)
|
529
|
+
else
|
530
|
+
result
|
531
|
+
end
|
532
|
+
unless @aql.has_more?
|
533
|
+
@aql = nil
|
534
|
+
@batch_proc = nil
|
535
|
+
end
|
536
|
+
final_result
|
537
|
+
end
|
538
|
+
|
539
|
+
# Check if more results are available for a betched request.
|
540
|
+
# @return [Boolean]
|
541
|
+
def has_more?
|
542
|
+
return false unless @aql
|
543
|
+
@aql.has_more?
|
544
|
+
end
|
545
|
+
|
546
|
+
private
|
547
|
+
|
548
|
+
def _set_status(s)
|
549
|
+
if s.class == Symbol && STATES.include?(s)
|
550
|
+
@status = STATES.index(s)
|
551
|
+
elsif s.class == Integer && s >= 0 && s <= 6
|
552
|
+
@status = s
|
553
|
+
else
|
554
|
+
@status = STATES[0]
|
555
|
+
end
|
556
|
+
end
|
557
|
+
|
558
|
+
def _set_type(t)
|
559
|
+
if t.class == Symbol && TYPES.include?(t)
|
560
|
+
@type = TYPES.index(t)
|
561
|
+
@type = 2 if @type < 2
|
562
|
+
elsif t.class == Integer && t >= 2 && t <= 3
|
563
|
+
@type = t
|
564
|
+
else
|
565
|
+
@type = 2
|
566
|
+
end
|
567
|
+
end
|
568
|
+
|
569
|
+
def _update_attributes(result)
|
570
|
+
%i[cacheEnabled globallyUniqueId id isSystem keyOptions name objectId status type waitForSync].each do |key|
|
571
|
+
instance_variable_set("@#{key.to_s.underscore}", result[key]) if result.key?(key)
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
end
|