hyper-console 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ e.cdecl(c,"ESCAPE_REGEX",new RegExp("(\\\\+)(["+c.get("ESCAPE_CHARS").$keys().$j
32
32
  ;return!1!==(e=o.inline_args)&&e!==r&&null!=e?e:o.inline_args=(t=(n=o.$children()).$take_while,t.$$p=(i=function(e){var t;i.$$s;return null==e&&(e=r),t=e.$type()["$!="]("restarg"),!1!==t&&t!==r&&null!=t?e.$type()["$!="]("optarg"):t},i.$$s=o,i.$$arity=1,i),t).call(n)},s.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/restarg"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$[]","$variable","$to_sym","$add_temp","$meta","$line","$working_arguments","$scope"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"RestargNode",n),s=a.$$proto;a.$$scope;s.sexp=r,a.$handle("restarg"),e.defn(a,"$compile",i=function(){var e,t=this,n=r,i=r,o=r;return!1===(n=t.sexp["$[]"](1))||n===r||null==n?r:(i=t.$variable(n.$to_sym()),t.$add_temp(i),(e=t.sexp.$meta()["$[]"]("post"))===r||null==e||e.$$is_boolean&&1!=e?(o=t.sexp.$meta()["$[]"]("offset"),t.$line("var $args_len = arguments.length, $rest_len = $args_len - "+o+";"),t.$line("if ($rest_len < 0) { $rest_len = 0; }"),t.$line(i+" = new Array($rest_len);"),t.$line("for (var $arg_idx = "+o+"; $arg_idx < $args_len; $arg_idx++) {"),t.$line(" "+i+"[$arg_idx - "+o+"] = arguments[$arg_idx];"),t.$line("}")):t.$line(i+" = "+t.$scope().$working_arguments()+";"))},i.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/initialize_kwargs"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$kwargs_initialized","$scope","$helper","$line","$kwargs_initialized="]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"InitializeKwargsNode",n);a.$$proto,a.$$scope;e.defn(a,"$initialize_kw_args_if_needed",i=function(){var e,t,n=this;return(e=n.$scope().$kwargs_initialized())===r||null==e||e.$$is_boolean&&1!=e?(n.$helper("hash2"),n.$line("if ($kwargs == null || !$kwargs.$$is_hash) {"),n.$line(" if ($kwargs == null) {"),n.$line(" $kwargs = $hash2([], {});"),n.$line(" } else {"),n.$line(" throw Opal.ArgumentError.$new('expected kwargs');"),n.$line(" }"),n.$line("}"),e=[!0],t=n.$scope(),t["$kwargs_initialized="].apply(t,e),e[e.length-1]):r},i.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/kwarg"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$initialize_kw_args_if_needed","$to_sym","$[]","$variable","$add_temp","$line","$<<","$used_kwargs","$scope"]),t.$require("opal/nodes/args/initialize_kwargs"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"KwargNode",n),s=a.$$proto;a.$$scope;s.sexp=r,a.$handle("kwarg"),e.defn(a,"$compile",i=function(){var e=this,t=r,n=r;return e.$initialize_kw_args_if_needed(),t=e.sexp["$[]"](1).$to_sym(),n=e.$variable(t),e.$add_temp(n),e.$line("if (!$kwargs.$$smap.hasOwnProperty('"+t+"')) {"),e.$line(" throw Opal.ArgumentError.$new('missing keyword: "+t+"');"),e.$line("}"),e.$line(n+" = $kwargs.$$smap['"+t+"'];"),e.$scope().$used_kwargs()["$<<"](t)},i.$$arity=0)}(s.base,s.get("InitializeKwargsNode"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/kwoptarg"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$initialize_kw_args_if_needed","$to_sym","$[]","$variable","$add_temp","$line","$expr","$<<","$used_kwargs","$scope"]),t.$require("opal/nodes/args/initialize_kwargs"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"KwoptArgNode",n),s=a.$$proto;a.$$scope;s.sexp=r,a.$handle("kwoptarg"),e.defn(a,"$compile",i=function(){var e=this,t=r,n=r,i=r;return e.$initialize_kw_args_if_needed(),t=e.sexp["$[]"](1).$to_sym(),n=e.sexp["$[]"](2),i=e.$variable(t),e.$add_temp(i),e.$line("if (("+i+" = $kwargs.$$smap['"+t+"']) == null) {"),e.$line(" "+i+" = ",e.$expr(n)),e.$line("}"),e.$scope().$used_kwargs()["$<<"](t)},i.$$arity=0)}(s.base,s.get("InitializeKwargsNode"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/kwrestarg"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$initialize_kw_args_if_needed","$[]","$used_kwargs","$variable","$to_sym","$add_temp","$line","$map","$scope","$join"]),t.$require("opal/nodes/args/initialize_kwargs"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s=n=o(t,$super,"KwrestArgNode",n),$=s.$$proto;s.$$scope;$.sexp=r,s.$handle("kwrestarg"),e.defn(s,"$compile",i=function(){var e=this,t=r,n=r,i=r;return e.$initialize_kw_args_if_needed(),t=e.sexp["$[]"](1),n="Opal.kwrestargs($kwargs, "+e.$used_kwargs()+");",!1!==t&&t!==r&&null!=t?(i=e.$variable(t.$to_sym()),e.$add_temp(i),e.$line(i+" = "+n)):r},i.$$arity=0),e.defn(s,"$used_kwargs",a=function(){var e,t,n,i=this,o=r;return o=(e=(t=i.$scope().$used_kwargs()).$map,e.$$p=(n=function(e){n.$$s;return null==e&&(e=r),"'"+e+"': true"},n.$$s=i,n.$$arity=1,n),e).call(t),"{"+o.$join(",")+"}"},a.$$arity=0)}(s.base,s.get("InitializeKwargsNode"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/post_kwargs"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$empty?","$children","$initialize_kw_args","$each","$push","$process","$line","$working_arguments","$scope"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s=n=o(t,$super,"PostKwargsNode",n);s.$$proto,s.$$scope;s.$handle("post_kwargs"),e.defn(s,"$compile",i=function(){var e,t,n,i=this;return(e=i.$children()["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?(i.$initialize_kw_args(),(e=(t=i.$children()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$push(t.$process(e))},n.$$s=i,n.$$arity=1,n),e).call(t)):r},i.$$arity=0),e.defn(s,"$initialize_kw_args",a=function(){var e=this;return e.$line("$kwargs = Opal.extract_kwargs("+e.$scope().$working_arguments()+");")},a.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/args/post_args"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$attr_reader","$each","$[]=","$meta","$type","$===","$<<","$children","$empty?","$working_arguments","$scope","$[]","$working_arguments=","$add_temp","$line","$size","$inline_args","$extract_arguments","$push","$process","$kwargs_sexp","$compile_required_arg","$required_left_args","$compile_optarg","$optargs","$compile_restarg","$required_right_args","$variable","$to_sym","$indent","$restarg","$extract_restarg","$extract_blank_restarg","$s","$kwargs"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s,$,l,u,c,p,d,f=n=o(t,$super,"PostArgsNode",n),h=f.$$proto;f.$$scope;h.sexp=r,f.$handle("post_args"),f.$attr_reader("kwargs"),f.$attr_reader("required_left_args"),f.$attr_reader("optargs"),f.$attr_reader("restarg"),f.$attr_reader("required_right_args"),e.defn(f,"$initialize",i=function(){var t,n,o=this,a=i.$$p,s=r,$=r;for(i.$$p=null,s=[],$=0;$<arguments.length;$++)s[$]=arguments[$];return(n=o,t=e.find_super_dispatcher(o,"initialize",i,!1),t.$$p=a,t).apply(n,s),o.kwargs=[],o.required_left_args=[],o.optargs=[],o.restarg=r,o.required_right_args=[]},i.$$arity=-1),e.defn(f,"$extract_arguments",a=function(){var e,t,n,i=this,o=r;return o=!1,(e=(t=i.$children()).$each,e.$$p=(n=function(e){var t=n.$$s||this,i=r;return null==t.kwargs&&(t.kwargs=r),null==t.optargs&&(t.optargs=r),null==t.required_right_args&&(t.required_right_args=r),null==t.required_left_args&&(t.required_left_args=r),null==e&&(e=r),e.$meta()["$[]="]("post",!0),function(){return i=e.$type(),"kwarg"["$==="](i)||"kwoptarg"["$==="](i)||"kwrestarg"["$==="](i)?t.kwargs["$<<"](e):"restarg"["$==="](i)?(t.restarg=e,o=!0):"optarg"["$==="](i)?(t.optargs["$<<"](e),o=!0):"arg"["$==="](i)||"mlhs"["$==="](i)?!1!==o&&o!==r&&null!=o?t.required_right_args["$<<"](e):t.required_left_args["$<<"](e):r}()},n.$$s=i,n.$$arity=1,n),e).call(t)},a.$$arity=0),e.defn(f,"$compile",s=function(){var e,t,n,i,o,a,s,$,l=this,u=r,c=r;return(e=l.$children()["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?(u=l.$scope().$working_arguments(),(e=l.sexp.$meta()["$[]"]("js_source"))===r||null==e||e.$$is_boolean&&1!=e?(c="arguments",e=["$post_args"],t=l.$scope(),t["$working_arguments="].apply(t,e),e[e.length-1]):(c=l.sexp.$meta()["$[]"]("js_source"),e=[c+"_args"],t=l.$scope(),t["$working_arguments="].apply(t,e),e[e.length-1]),l.$add_temp(""+l.$scope().$working_arguments()),l.$line(l.$scope().$working_arguments()+" = Opal.slice.call("+c+", "+l.$scope().$inline_args().$size()+", "+c+".length);"),l.$extract_arguments(),l.$push(l.$process(l.$kwargs_sexp())),(e=(t=l.$required_left_args()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$compile_required_arg(e)},n.$$s=l,n.$$arity=1,n),e).call(t),(e=(i=l.$optargs()).$each,e.$$p=(o=function(e){var t=o.$$s||this;return null==e&&(e=r),t.$compile_optarg(e)},o.$$s=l,o.$$arity=1,o),e).call(i),l.$compile_restarg(),(e=(a=l.$required_right_args()).$each,e.$$p=(s=function(e){var t=s.$$s||this;return null==e&&(e=r),t.$compile_required_arg(e)},s.$$s=l,s.$$arity=1,s),e).call(a),e=[u],$=l.$scope(),$["$working_arguments="].apply($,e),e[e.length-1]):r},s.$$arity=0),e.defn(f,"$compile_optarg",$=function(e){var t,n,i,o=this,a=r;return a=o.$variable(e["$[]"](1).$to_sym()),o.$add_temp(a),o.$line("if ("+o.$required_right_args().$size()+" < "+o.$scope().$working_arguments()+".length) {"),(t=(n=o).$indent,t.$$p=(i=function(){var e=i.$$s||this;return e.$line(a+" = "+e.$scope().$working_arguments()+".splice(0,1)[0];")},i.$$s=o,i.$$arity=0,i),t).call(n),o.$line("}"),o.$push(o.$process(e))},$.$$arity=1),e.defn(f,"$compile_required_arg",l=function(e){var t=this;return t.$push(t.$process(e))},l.$$arity=1),e.defn(f,"$compile_restarg",u=function(){var e,t,n,i,o,a=this;return(e=a.$restarg())===r||null==e||e.$$is_boolean&&1!=e?r:(a.$line("if ("+a.$required_right_args().$size()+" < "+a.$scope().$working_arguments()+".length) {"),(e=(t=a).$indent,e.$$p=(n=function(){return(n.$$s||this).$extract_restarg()},n.$$s=a,n.$$arity=0,n),e).call(t),a.$line("} else {"),(e=(i=a).$indent,e.$$p=(o=function(){return(o.$$s||this).$extract_blank_restarg()},o.$$s=a,o.$$arity=0,o),e).call(i),a.$line("}"))},u.$$arity=0),e.defn(f,"$extract_restarg",c=function(){var e,t=this,n=r,i=r;return n=t.$scope().$working_arguments()+".splice(0, "+t.$scope().$working_arguments()+".length - "+t.$required_right_args().$size()+");",(e=t.$restarg()["$[]"](1))===r||null==e||e.$$is_boolean&&1!=e?t.$line(n):(i=t.$variable(t.$restarg()["$[]"](1).$to_sym()),t.$add_temp(i),t.$line(i+" = "+n))},c.$$arity=0),e.defn(f,"$extract_blank_restarg",p=function(){var e,t=this,n=r;return(e=t.$restarg()["$[]"](1))===r||null==e||e.$$is_boolean&&1!=e?r:(n=t.$variable(t.$restarg()["$[]"](1).$to_sym()),t.$add_temp(n),t.$line(n+" = [];"))},p.$$arity=0),e.defn(f,"$kwargs_sexp",d=function(){var t,n=this;return(t=n).$s.apply(t,["post_kwargs"].concat(e.to_a(n.$kwargs())))},d.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/node_with_args"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e<t:e["$<"](t)}function i(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var o=e.top,a=e,s=e.nil,$=(e.breaker,e.slice,e.module),l=e.klass,u=e.hash2,c=e.range;return e.add_stubs(["$require","$attr_accessor","$attr_writer","$attr_reader","$[]","$args","$each_with_index","$==","$-","$length","$type","$===","$<<","$any?","$!=","$each","$[]=","$meta","$inline_args","$optimize_args!","$select","$first","$find","$include?","$s","$post_args","$push","$process","$post_args_sexp","$uses_block?","$scope","$identity","$block_name","$add_temp","$line","$inline_args=","$pop","$keyword_args","$all?","$rest_arg","$opt_args","$has_only_optional_kwargs?","$negative_arity","$positive_arity","$children","$size","$has_required_kwargs?","$+","$-@","$map","$build_parameter","$block_arg","$join","$!","$empty?","$<","$>"]),o.$require("opal/nodes/scope"),function(o){var a,p=a=$(o,"Opal"),d=(p.$$proto,p.$$scope);!function(o){var a,p=a=$(o,"Nodes"),d=(p.$$proto,p.$$scope);!function(o,$super){function a(){}var $,p,d,f,h,_,g,m,y,v,b,w,x,k,E,C,T,O,S,N,A,R,P=a=l(o,$super,"NodeWithArgs",a),M=P.$$proto,I=P.$$scope;M.opt_args=M.rest_arg=M.keyword_args=M.in_mlhs=M.arity_checks=s,P.$attr_accessor("mlhs_args"),P.$attr_accessor("used_kwargs"),P.$attr_accessor("mlhs_mapping"),P.$attr_accessor("working_arguments"),P.$attr_writer("inline_args"),P.$attr_accessor("kwargs_initialized"),P.$attr_reader("inline_args","post_args"),e.defn(P,"$initialize",$=function(){var t,n,r=this,i=$.$$p,o=s,a=s;for($.$$p=null,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return(n=r,t=e.find_super_dispatcher(r,"initialize",$,!1),t.$$p=i,t).apply(n,o),r.mlhs_args=u([],{}),r.used_kwargs=[],r.mlhs_mapping=u([],{}),r.working_arguments=s,r.in_mlhs=!1,r.kwargs_initialized=!1,r.inline_args=[],r.post_args=[],r.post_args_started=!1},$.$$arity=-1),e.defn(P,"$split_args",p=function(){var e,n,r,i,o,a=this,$=s;return $=a.$args()["$[]"](c(1,-1,!1)),(e=(n=$).$each_with_index,e.$$p=(r=function(e,n){var i,o,a,l,u=r.$$s||this,c=s;return null==u.post_args_started&&(u.post_args_started=s),null==u.post_args&&(u.post_args=s),null==u.inline_args&&(u.inline_args=s),null==e&&(e=s),null==n&&(n=s),n["$=="](t($.$length(),1)),function(){return c=e.$type(),"arg"["$==="](c)||"mlhs"["$==="](c)||"kwarg"["$==="](c)||"kwoptarg"["$==="](c)||"kwrestarg"["$==="](c)?(i=u.post_args_started)===s||null==i||i.$$is_boolean&&1!=i?u.inline_args["$<<"](e):u.post_args["$<<"](e):"restarg"["$==="](c)?(u.post_args_started=!0,u.post_args["$<<"](e)):"optarg"["$==="](c)?((i=(o=(a=$["$[]"](n,$.$length()))["$any?"],o.$$p=(l=function(e){var t;l.$$s;return null==e&&(e=s),t=e.$type()["$!="]("optarg"),!1!==t&&t!==s&&null!=t?e.$type()["$!="]("restarg"):t},l.$$s=u,l.$$arity=1,l),o).call(a))===s||null==i||i.$$is_boolean&&1!=i||(u.post_args_started=!0),(i=u.post_args_started)===s||null==i||i.$$is_boolean&&1!=i?u.inline_args["$<<"](e):u.post_args["$<<"](e)):s}()},r.$$s=a,r.$$arity=2,r),e).call(n),(e=(i=a.$inline_args()).$each,e.$$p=(o=function(e){o.$$s;return null==e&&(e=s),e.$meta()["$[]="]("inline",!0)},o.$$s=a,o.$$arity=1,o),e).call(i),a["$optimize_args!"]()},p.$$arity=0),e.defn(P,"$opt_args",d=function(){var e,t,n,r,i=this;return!1!==(e=i.opt_args)&&e!==s&&null!=e?e:i.opt_args=(t=(n=i.$args()["$[]"](c(1,-1,!1))).$select,t.$$p=(r=function(e){r.$$s;return null==e&&(e=s),e.$first()["$=="]("optarg")},r.$$s=i,r.$$arity=1,r),t).call(n)},d.$$arity=0),e.defn(P,"$rest_arg",f=function(){var e,t,n,r,i=this;return!1!==(e=i.rest_arg)&&e!==s&&null!=e?e:i.rest_arg=(t=(n=i.$args()["$[]"](c(1,-1,!1))).$find,t.$$p=(r=function(e){r.$$s;return null==e&&(e=s),e.$first()["$=="]("restarg")},r.$$s=i,r.$$arity=1,r),t).call(n)},f.$$arity=0),e.defn(P,"$keyword_args",h=function(){var e,t,n,r,i=this;return!1!==(e=i.keyword_args)&&e!==s&&null!=e?e:i.keyword_args=(t=(n=i.$args()["$[]"](c(1,-1,!1))).$select,t.$$p=(r=function(e){r.$$s;return null==e&&(e=s),["kwarg","kwoptarg","kwrestarg"]["$include?"](e.$first())},r.$$s=i,r.$$arity=1,r),t).call(n)},h.$$arity=0),e.defn(P,"$inline_args_sexp",_=function(){var t,n=this;return(t=n).$s.apply(t,["inline_args"].concat(e.to_a(n.$args()["$[]"](c(1,-1,!1)))))},_.$$arity=0),e.defn(P,"$post_args_sexp",g=function(){var t,n=this;return(t=n).$s.apply(t,["post_args"].concat(e.to_a(n.$post_args())))},g.$$arity=0),e.defn(P,"$compile_inline_args",m=function(){var e,t,n,r=this;return(e=(t=r.$inline_args()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=s),t.$push(t.$process(e))},n.$$s=r,n.$$arity=1,n),e).call(t)},m.$$arity=0),e.defn(P,"$compile_post_args",y=function(){var e=this;return e.$push(e.$process(e.$post_args_sexp()))},y.$$arity=0),e.defn(P,"$compile_block_arg",v=function(){var e,t=this,n=s,r=s;return(e=t.$scope()["$uses_block?"]())===s||null==e||e.$$is_boolean&&1!=e?s:(n=t.$scope().$identity(),r=t.$scope().$block_name(),t.$add_temp("$iter = "+n+".$$p"),t.$add_temp(r+" = $iter || nil"),t.$line(n+".$$p = null;"))},v.$$arity=0),e.defn(P,"$with_inline_args",b=function(t){var n,r,i=this,o=b.$$p,a=o||s,$=s;return b.$$p=null,$=i.$inline_args(),n=[t],r=i,r["$inline_args="].apply(r,n),n[n.length-1],e.yieldX(a,[]),n=[$],r=i,r["$inline_args="].apply(r,n),n[n.length-1]},b.$$arity=1),e.defn(P,"$in_mlhs",w=function(){var t=this,n=w.$$p,r=n||s,i=s;return w.$$p=null,i=t.in_mlhs,t.in_mlhs=!0,e.yieldX(r,[]),t.in_mlhs=i},w.$$arity=0),e.defn(P,"$in_mlhs?",x=function(){return this.in_mlhs},x.$$arity=0),e.defn(P,"$optimize_args!",k=function(){var e,t=this,n=s;return(e=t.$post_args().$length()["$=="](1)?t.$post_args().$first().$type()["$=="]("restarg"):t.$post_args().$length()["$=="](1))===s||null==e||e.$$is_boolean&&1!=e?s:(n=t.$post_args().$pop(),n.$meta()["$[]="]("offset",t.$inline_args().$length()),t.$inline_args()["$<<"](n))},k.$$arity=0),e.defn(P,"$has_only_optional_kwargs?",E=function(){var e,t,n,r,i=this;return e=i.$keyword_args()["$any?"](),!1!==e&&e!==s&&null!=e?(t=(n=i.$keyword_args())["$all?"],t.$$p=(r=function(e){r.$$s;return null==e&&(e=s),["kwoptarg","kwrestarg"]["$include?"](e.$type())},r.$$s=i,r.$$arity=1,r),t).call(n):e},E.$$arity=0),e.defn(P,"$has_required_kwargs?",C=function(){var e,t,n,r=this;return(e=(t=r.$keyword_args())["$any?"],e.$$p=(n=function(e){n.$$s;return null==e&&(e=s),e.$type()["$=="]("kwarg")},n.$$s=r,n.$$arity=1,n),e).call(t)},C.$$arity=0),e.defn(P,"$arity",T=function(){var e,t,n,r=this;return(e=!1!==(t=!1!==(n=r.$rest_arg())&&n!==s&&null!=n?n:r.$opt_args()["$any?"]())&&t!==s&&null!=t?t:r["$has_only_optional_kwargs?"]())===s||null==e||e.$$is_boolean&&1!=e?r.$positive_arity():r.$negative_arity()},T.$$arity=0),e.defn(P,"$negative_arity",O=function(){var e,r,i,o=this,a=s,$=s;return a=(e=(r=o.$args().$children()).$select,e.$$p=(i=function(e){i.$$s;return null==e&&(e=s),["arg","mlhs"]["$include?"](e.$type())},i.$$s=o,i.$$arity=1,i),e).call(r),$=a.$size(),(e=o["$has_required_kwargs?"]())===s||null==e||e.$$is_boolean&&1!=e||($=n($,1)),$=t($["$-@"](),1)},O.$$arity=0),e.defn(P,"$positive_arity",S=function(){var e,r=this,i=s;return i=t(r.$args().$size(),1),i=t(i,r.$keyword_args().$size()),(e=r.$keyword_args()["$any?"]())===s||null==e||e.$$is_boolean&&1!=e||(i=n(i,1)),i},S.$$arity=0),e.defn(P,"$build_parameter",N=function(e,t){return!1!==t&&t!==s&&null!=t?"['"+e+"', '"+t+"']":"['"+e+"']"},N.$$arity=2),e.cdecl(I,"SEXP_TO_PARAMETERS",u(["arg","mlhs","optarg","restarg","kwarg","kwoptarg","kwrestarg"],{arg:"req",mlhs:"req",optarg:"opt",restarg:"rest",kwarg:"keyreq",kwoptarg:"key",kwrestarg:"keyrest"})),e.defn(P,"$parameters_code",A=function(){var e,t,n,r=this,i=s;return i=(e=(t=r.$args().$children()).$map,e.$$p=(n=function(e){var t=n.$$s||this,r=s;return null==e&&(e=s),r=function(){return e.$type()["$=="]("mlhs")?s:e["$[]"](1)}(),t.$build_parameter(I.get("SEXP_TO_PARAMETERS")["$[]"](e.$type()),r)},n.$$s=r,n.$$arity=1,n),e).call(t),(e=r.$block_arg())===s||null==e||e.$$is_boolean&&1!=e||i["$<<"]("['block', '"+r.$block_arg()+"']"),"["+i.$join(", ")+"]"},A.$$arity=0),e.defn(P,"$arity_checks",R=function(){var e,o,a,$=this,l=s,u=s,c=s;return(e=$.arity_checks)===s||null==e||e.$$is_boolean&&1!=e?(l=t($.$args().$size(),1),l=t(l,$.$opt_args().$size()),(e=$.$rest_arg())===s||null==e||e.$$is_boolean&&1!=e||(l=t(l,1)),l=t(l,$.$keyword_args().$size()),(e=!1!==(o=!1!==(a=$.$opt_args()["$empty?"]()["$!"]())&&a!==s&&null!=a?a:$.$keyword_args()["$empty?"]()["$!"]())&&o!==s&&null!=o?o:$.$rest_arg())===s||null==e||e.$$is_boolean&&1!=e||(l=t(l["$-@"](),1)),"var $arity = arguments.length;",$.arity_checks=[],(e=r(l,0))===s||null==e||e.$$is_boolean&&1!=e?$.arity_checks["$<<"]("$arity !== "+l):(u=n(l,1)["$-@"](),c=t($.$args().$size(),1),(e=i(u,0))===s||null==e||e.$$is_boolean&&1!=e||$.arity_checks["$<<"]("$arity < "+u),(e=(o=!1!==c&&c!==s&&null!=c)?$.$rest_arg()["$!"]():c)===s||null==e||e.$$is_boolean&&1!=e||$.arity_checks["$<<"]("$arity > "+c)),$.arity_checks):$.arity_checks},R.$$arity=0)}(d.base,d.get("ScopeNode"))}(d.base)}(a.base)},Opal.modules["opal/nodes/iter"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var n=e.top,r=e,i=e.nil,o=(e.breaker,e.slice,e.module),a=e.klass,s=e.range;return e.add_stubs(["$require","$handle","$children","$attr_accessor","$extract_block_arg","$extract_shadow_args","$split_args","$in_scope","$process","$inline_args_sexp","$identify!","$scope","$add_temp","$compile_block_arg","$compile_shadow_args","$compile_inline_args","$compile_post_args","$compile_norm_args","$arity_check?","$compiler","$compile_arity_check","$stmt","$body","$to_vars","$line","$unshift","$push","$has_break?","$arity","$parameters_code","$has_top_level_mlhs_arg?","$has_trailing_comma_in_args?","$select","$==","$type","$[]","$args","$each","$variable","$norm_args","$block_arg","$to_s","$block_name=","$is_a?","$last","$block_arg=","$to_sym","$pop","$add_local","$shadow_args","$each_with_index","$<<","$delete","$===","$args_sexp","$nil?","$s","$delete_at","$returns","$body_sexp","$keys","$mlhs_mapping","$any?","$meta","$>","$size","$arity_checks","$!","$top?","$def?","$class_scope?","$parent","$mid","$class?","$name","$module?","$identity","$join"]),n.$require("opal/nodes/node_with_args"),function(n){var r,$=r=o(n,"Opal"),l=($.$$proto,$.$$scope);!function(n){var r,$=r=o(n,"Nodes"),l=($.$$proto,$.$$scope);!function(n,$super){function r(){}var o,$,l,u,c,p,d,f,h,_,g,m,y,v=r=a(n,$super,"IterNode",r),b=v.$$proto,w=v.$$scope;b.norm_args=i,v.$handle("iter"),v.$children("args_sexp","body_sexp"),v.$attr_accessor("block_arg","shadow_args"),e.defn(v,"$compile",o=function(){var e,t,n,r=this,o=i,a=i,s=i,$=i;return o=i,r.$extract_block_arg(),r.$extract_shadow_args(),r.$split_args(),a=s=$=i,(e=(t=r).$in_scope,e.$$p=(n=function(){var e,t=n.$$s||this;return o=t.$process(t.$inline_args_sexp()),s=t.$scope()["$identify!"](),t.$add_temp("self = "+s+".$$s || this"),t.$compile_block_arg(),t.$compile_shadow_args(),t.$compile_inline_args(),t.$compile_post_args(),t.$compile_norm_args(),(e=t.$compiler()["$arity_check?"]())===i||null==e||e.$$is_boolean&&1!=e||t.$compile_arity_check(),$=t.$stmt(t.$body()),a=t.$scope().$to_vars()},n.$$s=r,n.$$arity=0,n),e).call(t),r.$line($),r.$unshift(a),r.$unshift("("+s+" = function(",o,"){"),r.$push("}, "+s+".$$s = self,"),(e=r.$compiler()["$has_break?"]())===i||null==e||e.$$is_boolean&&1!=e||r.$push(" "+s+".$$brk = $brk,"),r.$push(" "+s+".$$arity = "+r.$arity()+","),(e=r.$compiler()["$arity_check?"]())===i||null==e||e.$$is_boolean&&1!=e||r.$push(" "+s+".$$parameters = "+r.$parameters_code()+","),(e=r["$has_top_level_mlhs_arg?"]())===i||null==e||e.$$is_boolean&&1!=e||r.$push(" "+s+".$$has_top_level_mlhs_arg = true,"),(e=r["$has_trailing_comma_in_args?"]())===i||null==e||e.$$is_boolean&&1!=e||r.$push(" "+s+".$$has_trailing_comma_in_args = true,"),r.$push(" "+s+")")},o.$$arity=0),e.defn(v,"$norm_args",$=function(){var e,t,n,r,o=this;return!1!==(e=o.norm_args)&&e!==i&&null!=e?e:o.norm_args=(t=(n=o.$args()["$[]"](s(1,-1,!1))).$select,t.$$p=(r=function(e){r.$$s;return null==e&&(e=i),e.$type()["$=="]("arg")},r.$$s=o,r.$$arity=1,r),t).call(n)},$.$$arity=0),e.defn(v,"$compile_norm_args",l=function(){var e,t,n,r=this;return(e=(t=r.$norm_args()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=i),e=t.$variable(e["$[]"](1)),t.$push("if ("+e+" == null) "+e+" = nil;")},n.$$s=r,n.$$arity=1,n),e).call(t)},l.$$arity=0),e.defn(v,"$compile_block_arg",u=function(){var e,t,n=this,r=i,o=i;return(e=n.$block_arg())===i||null==e||e.$$is_boolean&&1!=e?i:(r=n.$variable(n.$block_arg().$to_s()),e=[r],t=n.$scope(),t["$block_name="].apply(t,e),e[e.length-1],n.$scope().$add_temp(r),o=n.$scope()["$identify!"](),n.$line(r+" = "+o+".$$p || nil, "+o+".$$p = null;"))},u.$$arity=0),e.defn(v,"$extract_block_arg",c=function(){var e,t,n,r=this;return n=r.$args()["$is_a?"](w.get("Sexp")),t=!1!==n&&n!==i&&null!=n?r.$args().$last()["$is_a?"](w.get("Sexp")):n,(e=!1!==t&&t!==i&&null!=t?r.$args().$last().$type()["$=="]("block_pass"):t)===i||null==e||e.$$is_boolean&&1!=e?i:(e=[r.$args().$pop()["$[]"](1)["$[]"](1).$to_sym()],t=r,t["$block_arg="].apply(t,e),e[e.length-1])},c.$$arity=0),e.defn(v,"$compile_shadow_args",p=function(){var e,t,n,r=this;return(e=(t=r.$shadow_args()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=i),t.$scope().$add_local(e.$last())},n.$$s=r,n.$$arity=1,n),e).call(t)},p.$$arity=0),e.defn(v,"$extract_shadow_args",d=function(){var e,t,n,r=this;return(e=r.$args()["$is_a?"](w.get("Sexp")))===i||null==e||e.$$is_boolean&&1!=e?i:(r.shadow_args=[],(e=(t=r.$args().$children()).$each_with_index,e.$$p=(n=function(e,t){var r=n.$$s||this;return null==r.shadow_args&&(r.shadow_args=i),null==e&&(e=i),null==t&&(t=i),e.$type()["$=="]("shadowarg")?r.shadow_args["$<<"](r.$args().$delete(e)):i},n.$$s=r,n.$$arity=2,n),e).call(t))},d.$$arity=0),e.defn(v,"$args",f=function(){var t,n,r,o,a=this,s=i,$=i;return s=function(){return(t=!1!==(n=w.get("Fixnum")["$==="](a.$args_sexp()))&&n!==i&&null!=n?n:a.$args_sexp()["$nil?"]())===i||null==t||t.$$is_boolean&&1!=t?(n=a.$args_sexp()["$is_a?"](w.get("Sexp")),(t=!1!==n&&n!==i&&null!=n?a.$args_sexp().$type()["$=="]("lasgn"):n)===i||null==t||t.$$is_boolean&&1!=t?a.$args_sexp()["$[]"](1):a.$s("args",(t=a).$s.apply(t,["arg"].concat(e.to_a(a.$args_sexp()["$[]"](1)))))):a.$s("args")}(),$=!1,(n=(r=s).$each_with_index,n.$$p=(o=function(e,t){var n,r;o.$$s;return null==e&&(e=i),null==t&&(t=i),r=e["$is_a?"](w.get("Sexp")),(n=!1!==r&&r!==i&&null!=r?e.$last()["$=="]("_"):r)===i||null==n||n.$$is_boolean&&1!=n?i:(!1!==$&&$!==i&&null!=$&&s.$delete_at(t),$=!0)},o.$$s=a,o.$$arity=2,o),n).call(r),s},f.$$arity=0),e.defn(v,"$body",h=function(){var e,t=this;return t.$compiler().$returns(!1!==(e=t.$body_sexp())&&e!==i&&null!=e?e:t.$s("nil"))},h.$$arity=0),e.defn(v,"$mlhs_args",_=function(){return this.$scope().$mlhs_mapping().$keys()},_.$$arity=0),e.defn(v,"$has_top_level_mlhs_arg?",g=function(){var e,t,n,r=this;return(e=(t=r.$args().$children())["$any?"],e.$$p=(n=function(e){n.$$s;return null==e&&(e=i),e.$type()["$=="]("mlhs")},n.$$s=r,n.$$arity=1,n),e).call(t)},g.$$arity=0),e.defn(v,"$has_trailing_comma_in_args?",m=function(){return this.$args().$meta()["$[]"]("has_trailing_comma")},m.$$arity=0),e.defn(v,"$compile_arity_check",y=function(){var e,n,r,o,a=this,s=i,$=i,l=i;if((e=t(a.$arity_checks().$size(),0))===i||null==e||e.$$is_boolean&&1!=e)return i;for(s=a.$scope();(n=(!1!==(r=!1!==(o=s["$top?"]())&&o!==i&&null!=o?o:s["$def?"]())&&r!==i&&null!=r?r:s["$class_scope?"]())["$!"]())!==i&&null!=n&&(!n.$$is_boolean||1==n);)s=s.$parent();return $=function(){return(e=s["$top?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=s["$def?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=s["$class?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=s["$module?"]())===i||null==e||e.$$is_boolean&&1!=e?i:"'<module:"+s.$name()+">'":"'<class:"+s.$name()+">'":"'"+s.$mid()+"'":"'<main>'"}(),l=a.$scope().$identity(),a.$line("if ("+l+".$$is_lambda || "+l+".$$define_meth) {"),a.$line(" var $arity = arguments.length;"),a.$line(" if ("+a.$arity_checks().$join(" || ")+") { Opal.block_ac($arity, "+a.$arity()+", "+$+"); }"),a.$line("}")},y.$$arity=0)}(l.base,l.get("NodeWithArgs"))}(l.base)}(r.base)},Opal.modules["opal/nodes/def"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var n=e.top,r=e,i=e.nil,o=(e.breaker,e.slice,e.module),a=e.klass;return e.add_stubs(["$require","$handle","$children","$attr_accessor","$is_a?","$last","$args","$==","$type","$[]","$pop","$extract_block_arg","$split_args","$block_arg","$to_sym","$variable","$in_scope","$mid=","$mid","$scope","$recvr","$defs=","$uses_block!","$add_arg","$block_name=","$process","$inline_args_sexp","$stmt","$returns","$compiler","$stmts","$add_temp","$compile_inline_args","$compile_post_args","$identify!","$identity","$compile_block_arg","$arity_check?","$compile_arity_check","$uses_zuper","$add_local","$line","$unshift","$current_indent","$to_vars","$catch_return","$push","$valid_name?","$arity","$parameters_code","$recv","$iter?","$module?","$class?","$sclass?","$defs","$eval?","$top?","$def?","$raise","$expr?","$wrap","$>","$size","$arity_checks","$inspect","$to_s","$join"]),n.$require("opal/nodes/node_with_args"),function(n){var r,s=r=o(n,"Opal"),$=(s.$$proto,s.$$scope);!function(n){var r,s=r=o(n,"Nodes"),$=(s.$$proto,s.$$scope);!function(n,$super){function r(){}var o,s,$,l=r=a(n,$super,"DefNode",r),u=(l.$$proto,l.$$scope);l.$handle("def"),l.$children("recvr","mid","args","stmts"),l.$attr_accessor("block_arg"),e.defn(l,"$extract_block_arg",o=function(){var e,t,n=this;return t=n.$args().$last()["$is_a?"](u.get("Sexp")),(e=!1!==t&&t!==i&&null!=t?n.$args().$last().$type()["$=="]("blockarg"):t)===i||null==e||e.$$is_boolean&&1!=e?i:n.block_arg=n.$args().$pop()["$[]"](1)},o.$$arity=0),e.defn(l,"$compile",s=function(){var e,t,n,r,o=this,a=i,s=i,$=i,l=i;return o.$extract_block_arg(),o.$split_args(),a=i,s=i,(e=o.$block_arg())===i||null==e||e.$$is_boolean&&1!=e||($=o.$variable(o.$block_arg()).$to_sym()),(e=(t=o).$in_scope,e.$$p=(n=function(){var e,t,r,o=n.$$s||this,l=i;return e=[o.$mid()],t=o.$scope(),t["$mid="].apply(t,e),e[e.length-1],(e=o.$recvr())===i||null==e||e.$$is_boolean&&1!=e||(e=[!0],t=o.$scope(),t["$defs="].apply(t,e),e[e.length-1]),!1!==$&&$!==i&&null!=$&&(o.$scope()["$uses_block!"](),o.$scope().$add_arg($)),e=[!1!==(r=$)&&r!==i&&null!=r?r:"$yield"],t=o.$scope(),t["$block_name="].apply(t,e),e[e.length-1],a=o.$process(o.$inline_args_sexp()),l=o.$stmt(o.$compiler().$returns(o.$stmts())),o.$add_temp("self = this"),o.$compile_inline_args(),o.$compile_post_args(),o.$scope()["$identify!"](),s=o.$scope().$identity(),o.$compile_block_arg(),(e=o.$compiler()["$arity_check?"]())===i||null==e||e.$$is_boolean&&1!=e||o.$compile_arity_check(),(e=o.$scope().$uses_zuper())===i||null==e||e.$$is_boolean&&1!=e||(o.$add_local("$zuper"),o.$add_local("$zuper_index"),o.$add_local("$zuper_length"),o.$line("$zuper = [];"),o.$line(),o.$line("for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) {"),o.$line(" $zuper[$zuper_index] = arguments[$zuper_index];"),o.$line("}")),o.$unshift("\n"+o.$current_indent(),o.$scope().$to_vars()),o.$line(l),(e=o.$scope().$catch_return())===i||null==e||e.$$is_boolean&&1!=e?i:(o.$unshift("try {\n"),o.$line("} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v }"),o.$push(" throw $returner; }"))},n.$$s=o,n.$$arity=0,n),e).call(t),l=function(){return(e=o["$valid_name?"](o.$mid()))===i||null==e||e.$$is_boolean&&1!=e?"":" $$"+o.$mid()}(),o.$unshift(") {"),o.$unshift(a),o.$unshift("function"+l+"("),!1!==s&&s!==i&&null!=s&&o.$unshift(s+" = "),o.$line("}"),o.$push(", "+s+".$$arity = "+o.$arity()),(e=o.$compiler()["$arity_check?"]())===i||null==e||e.$$is_boolean&&1!=e||o.$push(", "+s+".$$parameters = "+o.$parameters_code()),(e=o.$recvr())===i||null==e||e.$$is_boolean&&1!=e?(e=o.$scope()["$iter?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=!1!==(r=o.$scope()["$module?"]())&&r!==i&&null!=r?r:o.$scope()["$class?"]())===i||null==e||e.$$is_boolean&&1!=e?(r=o.$scope()["$sclass?"](),
33
33
  (e=!1!==r&&r!==i&&null!=r?o.$scope().$defs():r)===i||null==e||e.$$is_boolean&&1!=e?(e=o.$scope()["$sclass?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=o.$compiler()["$eval?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=o.$scope()["$top?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=o.$scope()["$def?"]())===i||null==e||e.$$is_boolean&&1!=e?o.$raise("Unsupported use of `def`; please file a bug at https://github.com/opal/opal/issues/new reporting this message."):o.$unshift("Opal.def(self, '$"+o.$mid()+"', "):o.$unshift("Opal.defn(Opal.Object, '$"+o.$mid()+"', "):o.$unshift("Opal.def(self, '$"+o.$mid()+"', "):o.$unshift("Opal.defn(self, '$"+o.$mid()+"', "):o.$unshift("Opal.defs(self, '$"+o.$mid()+"', ")):o.$unshift("Opal.defn(self, '$"+o.$mid()+"', "):o.$unshift("Opal.def(self, '$"+o.$mid()+"', "):o.$unshift("Opal.defs(",o.$recv(o.$recvr()),", '$"+o.$mid()+"', "),o.$push(")"),(e=o["$expr?"]())===i||null==e||e.$$is_boolean&&1!=e?i:o.$wrap("(",", nil) && '"+o.$mid()+"'")},s.$$arity=0),e.defn(l,"$compile_arity_check",$=function(){var e,n=this,r=i;return(e=t(n.$arity_checks().$size(),0))===i||null==e||e.$$is_boolean&&1!=e?i:(r=n.$scope().$mid().$to_s().$inspect(),n.$line("var $arity = arguments.length;"),n.$push(" if ("+n.$arity_checks().$join(" || ")+") { Opal.ac($arity, "+n.$arity()+", this, "+r+"); }"))},$.$$arity=0)}($.base,$.get("NodeWithArgs"))}($.base)}(r.base)},Opal.modules["opal/nodes/if"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$children","$truthy","$falsy","$skip_check_present?","$skip_check_present_not?","$push","$js_truthy","$test","$indent","$line","$stmt","$==","$type","$needs_wrapper?","$wrap","$returns","$compiler","$true_body","$s","$false_body","$expr?","$recv?"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s,$,l,u,c=n=o(t,$super,"IfNode",n),p=(c.$$proto,c.$$scope);c.$handle("if"),c.$children("test","true_body","false_body"),e.cdecl(p,"RUBY_ENGINE_CHECK",["call",["const","RUBY_ENGINE"],"==",["arglist",["str","opal"]]]),e.cdecl(p,"RUBY_ENGINE_CHECK_NOT",["call",["const","RUBY_ENGINE"],"!=",["arglist",["str","opal"]]]),e.cdecl(p,"RUBY_PLATFORM_CHECK",["call",["const","RUBY_PLATFORM"],"==",["arglist",["str","opal"]]]),e.cdecl(p,"RUBY_PLATFORM_CHECK_NOT",["call",["const","RUBY_PLATFORM"],"!=",["arglist",["str","opal"]]]),e.defn(c,"$compile",i=function(){var e,t,n,i,o,a=this,s=r,$=r;return e=[a.$truthy(),a.$falsy()],s=e[0],$=e[1],(e=a["$skip_check_present?"]())===r||null==e||e.$$is_boolean&&1!=e||($=r),(e=a["$skip_check_present_not?"]())===r||null==e||e.$$is_boolean&&1!=e||(s=r),a.$push("if (",a.$js_truthy(a.$test()),") {"),!1!==s&&s!==r&&null!=s&&(e=(t=a).$indent,e.$$p=(n=function(){var e=n.$$s||this;return e.$line(e.$stmt(s))},n.$$s=a,n.$$arity=0,n),e).call(t),!1!==$&&$!==r&&null!=$?$.$type()["$=="]("if")?a.$line("} else ",a.$stmt($)):((e=(i=a).$indent,e.$$p=(o=function(){var e=o.$$s||this;return e.$line("} else {"),e.$line(e.$stmt($))},o.$$s=a,o.$$arity=0,o),e).call(i),a.$line("}")):a.$push("}"),(e=a["$needs_wrapper?"]())===r||null==e||e.$$is_boolean&&1!=e?r:a.$wrap("(function() {","; return nil; })()")},i.$$arity=0),e.defn(c,"$skip_check_present?",a=function(){var e,t=this;return!1!==(e=t.$test()["$=="](p.get("RUBY_ENGINE_CHECK")))&&e!==r&&null!=e?e:t.$test()["$=="](p.get("RUBY_PLATFORM_CHECK"))},a.$$arity=0),e.defn(c,"$skip_check_present_not?",s=function(){var e,t=this;return!1!==(e=t.$test()["$=="](p.get("RUBY_ENGINE_CHECK_NOT")))&&e!==r&&null!=e?e:t.$test()["$=="](p.get("RUBY_PLATFORM_CHECK_NOT"))},s.$$arity=0),e.defn(c,"$truthy",$=function(){var e,t=this;return(e=t["$needs_wrapper?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$true_body():t.$compiler().$returns(!1!==(e=t.$true_body())&&e!==r&&null!=e?e:t.$s("nil"))},$.$$arity=0),e.defn(c,"$falsy",l=function(){var e,t=this;return(e=t["$needs_wrapper?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$false_body():t.$compiler().$returns(!1!==(e=t.$false_body())&&e!==r&&null!=e?e:t.$s("nil"))},l.$$arity=0),e.defn(c,"$needs_wrapper?",u=function(){var e,t=this;return!1!==(e=t["$expr?"]())&&e!==r&&null!=e?e:t["$recv?"]()},u.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/logic"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var n=e.top,r=e,i=e.nil,o=(e.breaker,e.slice,e.module),a=e.klass;return e.add_stubs(["$require","$handle","$children","$in_while?","$push","$expr_or_nil","$value","$wrap","$compile_while","$iter?","$scope","$compile_iter","$error","$[]","$while_loop","$stmt?","$has_break!","$compiler","$line","$break_val","$nil?","$expr","$s","$>","$size","$[]=","$identity","$with_temp","$==","$empty_splat?","$type","$recv","$rhs","$compile_if","$compile_ternary","$raise","$lhs","$indent","$js_truthy_optimize","$find_parent_def","$expr?","$def?","$return_in_iter?","$return_expr_in_def?","$scope_to_catch_return","$catch_return=","$return_val","$to_s"]),n.$require("opal/nodes/base"),function(n){var r,s=r=o(n,"Opal"),$=(s.$$proto,s.$$scope);!function(n){var r,s=r=o(n,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var r,o=n=a(t,$super,"NextNode",n);o.$$proto,o.$$scope;o.$handle("next"),o.$children("value"),e.defn(o,"$compile",r=function(){var e,t=this;return(e=t["$in_while?"]())===i||null==e||e.$$is_boolean&&1!=e?(t.$push(t.$expr_or_nil(t.$value())),t.$wrap("return ",";")):t.$push("continue;")},r.$$arity=0)}($.base,$.get("Base")),function(n,$super){function r(){}var o,s,$,l,u=r=a(n,$super,"BreakNode",r);u.$$proto,u.$$scope;u.$handle("break"),u.$children("value"),e.defn(u,"$compile",o=function(){var e,t=this;return(e=t["$in_while?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=t.$scope()["$iter?"]())===i||null==e||e.$$is_boolean&&1!=e?t.$error("void value expression: cannot use break outside of iter/while"):t.$compile_iter():t.$compile_while()},o.$$arity=0),e.defn(u,"$compile_while",s=function(){var e,t=this;return(e=t.$while_loop()["$[]"]("closure"))===i||null==e||e.$$is_boolean&&1!=e?t.$push("break;"):t.$push("return ",t.$expr_or_nil(t.$value()))},s.$$arity=0),e.defn(u,"$compile_iter",$=function(){var e,t=this;return((e=t["$stmt?"]())===i||null==e||e.$$is_boolean&&1!=e)&&t.$error("break must be used as a statement"),t.$compiler()["$has_break!"](),t.$line("Opal.brk(",t.$break_val(),", $brk)")},$.$$arity=0),e.defn(u,"$break_val",l=function(){var n,r=this;return(n=r.$value()["$nil?"]())===i||null==n||n.$$is_boolean&&1!=n?(n=t(r.$children().$size(),1))===i||null==n||n.$$is_boolean&&1!=n?r.$expr(r.$value()):r.$expr((n=r).$s.apply(n,["array"].concat(e.to_a(r.$children())))):r.$expr(r.$s("nil"))},l.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,o,s,$=n=a(t,$super,"RedoNode",n);$.$$proto,$.$$scope;$.$handle("redo"),e.defn($,"$compile",r=function(){var e,t=this;return(e=t["$in_while?"]())===i||null==e||e.$$is_boolean&&1!=e?(e=t.$scope()["$iter?"]())===i||null==e||e.$$is_boolean&&1!=e?t.$push("REDO()"):t.$compile_iter():t.$compile_while()},r.$$arity=0),e.defn($,"$compile_while",o=function(){var e=this;return e.$while_loop()["$[]="]("use_redo",!0),e.$push(e.$while_loop()["$[]"]("redo_var")+" = true")},o.$$arity=0),e.defn($,"$compile_iter",s=function(){var e=this;return e.$push("return "+e.$scope().$identity()+".apply(null, $slice.call(arguments))")},s.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,o=n=a(t,$super,"NotNode",n);o.$$proto,o.$$scope;o.$handle("not"),o.$children("value"),e.defn(o,"$compile",r=function(){var e,t,n,r=this;return(e=(t=r).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=i),t.$push(t.$expr(t.$value())),t.$wrap("("+e+" = ",", ("+e+" === nil || "+e+" === false || "+e+" == null))")},n.$$s=r,n.$$arity=1,n),e).call(t)},r.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,o,s=n=a(t,$super,"SplatNode",n);s.$$proto,s.$$scope;s.$handle("splat"),s.$children("value"),e.defn(s,"$empty_splat?",r=function(){var e,t=this;return!1!==(e=t.$value()["$=="](["nil"]))&&e!==i&&null!=e?e:t.$value()["$=="](["paren",["nil"]])},r.$$arity=0),e.defn(s,"$compile",o=function(){var e,t=this;return(e=t["$empty_splat?"]())===i||null==e||e.$$is_boolean&&1!=e?t.$value().$type()["$=="]("sym")?t.$push("[",t.$expr(t.$value()),"]"):t.$push("Opal.to_a(",t.$recv(t.$value()),")"):t.$push("[]")},o.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,i,o,s=n=a(t,$super,"BinaryOp",n),$=(s.$$proto,s.$$scope);e.defn(s,"$compile",r=function(){var e=this;return e.$rhs().$type()["$=="]("break")?e.$compile_if():e.$compile_ternary()},r.$$arity=0),e.defn(s,"$compile_ternary",i=function(){return this.$raise($.get("NotImplementedError"))},i.$$arity=0),e.defn(s,"$compile_if",o=function(){return this.$raise($.get("NotImplementedError"))},o.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,o,s=n=a(t,$super,"OrNode",n);s.$$proto,s.$$scope;s.$handle("or"),s.$children("lhs","rhs"),e.defn(s,"$compile_ternary",r=function(){var e,t,n,r=this;return(e=(t=r).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=i),t.$push("((("+e+" = "),t.$push(t.$expr(t.$lhs())),t.$push(") !== false && "+e+" !== nil && "+e+" != null) ? "+e+" : "),t.$push(t.$expr(t.$rhs())),t.$push(")")},n.$$s=r,n.$$arity=1,n),e).call(t)},r.$$arity=0),e.defn(s,"$compile_if",o=function(){var e,t,n,r=this;return(e=(t=r).$with_temp,e.$$p=(n=function(e){var t,r,o,a,s,$=n.$$s||this;return null==e&&(e=i),$.$push("if ("+e+" = ",$.$expr($.$lhs()),", "+e+" !== false && "+e+" !== nil && "+e+" != null) {"),(t=(r=$).$indent,t.$$p=(o=function(){return(o.$$s||this).$line(e)},o.$$s=$,o.$$arity=0,o),t).call(r),$.$line("} else {"),(t=(a=$).$indent,t.$$p=(s=function(){var e=s.$$s||this;return e.$line(e.$expr(e.$rhs()))},s.$$s=$,s.$$arity=0,s),t).call(a),$.$line("}")},n.$$s=r,n.$$arity=1,n),e).call(t)},o.$$arity=0)}($.base,$.get("BinaryOp")),function(t,$super){function n(){}var r,o,s=n=a(t,$super,"AndNode",n);s.$$proto,s.$$scope;s.$handle("and"),s.$children("lhs","rhs"),e.defn(s,"$compile_ternary",r=function(){var e,t,n,r=this,o=i;return o=i,(e=(t=r).$with_temp,e.$$p=(n=function(e){var t,r=n.$$s||this;return null==e&&(e=i),(t=o=r.$js_truthy_optimize(r.$lhs()))===i||null==t||t.$$is_boolean&&1!=t?(r.$push("("+e+" = "),r.$push(r.$expr(r.$lhs())),r.$push(", "+e+" !== false && "+e+" !== nil && "+e+" != null ?"),r.$push(r.$expr(r.$rhs())),r.$push(" : "+e+")")):(r.$push("(("+e+" = ",o),r.$push(") ? "),r.$push(r.$expr(r.$rhs())),r.$push(" : ",r.$expr(r.$lhs()),")"))},n.$$s=r,n.$$arity=1,n),e).call(t)},r.$$arity=0),e.defn(s,"$compile_if",o=function(){var e,t,n,r=this;return(e=(t=r).$with_temp,e.$$p=(n=function(e){var t,r,o,a,s,$=n.$$s||this,l=i;return null==e&&(e=i),(t=l=$.$js_truthy_optimize($.$lhs()))===i||null==t||t.$$is_boolean&&1!=t?$.$push("if ("+e+" = ",$.$expr($.$lhs()),", "+e+" !== false && "+e+" !== nil && "+e+" != null) {"):$.$push("if ("+e+" = ",l,") {"),(t=(r=$).$indent,t.$$p=(o=function(){var e=o.$$s||this;return e.$line(e.$expr(e.$rhs()))},o.$$s=$,o.$$arity=0,o),t).call(r),$.$line("} else {"),(t=(a=$).$indent,t.$$p=(s=function(){var e=s.$$s||this;return e.$line(e.$expr(e.$lhs()))},s.$$s=$,s.$$arity=0,s),t).call(a),$.$line("}")},n.$$s=r,n.$$arity=1,n),e).call(t)},o.$$arity=0)}($.base,$.get("BinaryOp")),function(n,$super){function r(){}var o,s,$,l,u,c=r=a(n,$super,"ReturnNode",r),p=(c.$$proto,c.$$scope);c.$handle("return"),c.$children("value"),e.defn(c,"$return_val",o=function(){var n,r=this;return(n=r.$value()["$nil?"]())===i||null==n||n.$$is_boolean&&1!=n?(n=t(r.$children().$size(),1))===i||null==n||n.$$is_boolean&&1!=n?r.$expr(r.$value()):r.$expr((n=r).$s.apply(n,["array"].concat(e.to_a(r.$children())))):r.$expr(r.$s("nil"))},o.$$arity=0),e.defn(c,"$return_in_iter?",s=function(){var e,t,n=this,r=i;return t=n.$scope()["$iter?"](),(e=!1!==t&&t!==i&&null!=t?r=n.$scope().$find_parent_def():t)===i||null==e||e.$$is_boolean&&1!=e?i:r},s.$$arity=0),e.defn(c,"$return_expr_in_def?",$=function(){var e,t,n=this;return t=n["$expr?"](),(e=!1!==t&&t!==i&&null!=t?n.$scope()["$def?"]():t)===i||null==e||e.$$is_boolean&&1!=e?i:n.$scope()},$.$$arity=0),e.defn(c,"$scope_to_catch_return",l=function(){var e,t=this;return!1!==(e=t["$return_in_iter?"]())&&e!==i&&null!=e?e:t["$return_expr_in_def?"]()},l.$$arity=0),e.defn(c,"$compile",u=function(){var e,t,n=this,r=i;return(e=r=n.$scope_to_catch_return())===i||null==e||e.$$is_boolean&&1!=e?(e=n["$stmt?"]())===i||null==e||e.$$is_boolean&&1!=e?n.$raise(p.get("SyntaxError"),"void value expression: cannot return as an expression"):n.$push("return ",n.$return_val()):(e=[!0],t=r,t["$catch_return="].apply(t,e),e[e.length-1],n.$push("Opal.ret(",n.$return_val(),")"))},u.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,i=n=a(t,$super,"JSReturnNode",n);i.$$proto,i.$$scope;i.$handle("js_return"),i.$children("value"),e.defn(i,"$compile",r=function(){var e=this;return e.$push("return "),e.$push(e.$expr(e.$value()))},r.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,i=n=a(t,$super,"JSTempNode",n);i.$$proto,i.$$scope;i.$handle("js_tmp"),i.$children("value"),e.defn(i,"$compile",r=function(){var e=this;return e.$push(e.$value().$to_s())},r.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,i=n=a(t,$super,"BlockPassNode",n);i.$$proto,i.$$scope;i.$handle("block_pass"),i.$children("value"),e.defn(i,"$compile",r=function(){var e=this;return e.$push(e.$expr(e.$s("call",e.$value(),"to_proc",e.$s("arglist"))))},r.$$arity=0)}($.base,$.get("Base"))}($.base)}(r.base)},Opal.modules["opal/nodes/definitions"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}var r=e.top,i=e,o=e.nil,a=(e.breaker,e.slice,e.module),s=e.klass,$=e.range;return e.add_stubs(["$require","$handle","$children","$push","$process","$value","$each","$[]","$==","$<<","$expr","$s","$to_s","$>","$length","$!=","$first","$line","$mid_to_jsid","$new_name","$old_name","$class?","$scope","$module?","$methods","$!","$stmt?","$type","$body","$stmt","$returns","$compiler","$wrap","$each_with_index","$empty?","$stmt_join","$find_inline_yield","$child_is_expr?","$class_scope?","$current_indent","$raw_expression?","$include?","$===","$[]=","$+","$has_temp?","$add_temp"]),r.$require("opal/nodes/base"),function(r){var i,l=i=a(r,"Opal"),u=(l.$$proto,l.$$scope);!function(r){var i,l=i=a(r,"Nodes"),u=(l.$$proto,l.$$scope);!function(t,$super){function n(){}var r,i=n=s(t,$super,"SvalueNode",n),a=i.$$proto;i.$$scope;a.level=o,i.$handle("svalue"),i.$children("value"),e.defn(i,"$compile",r=function(){var e=this;return e.$push(e.$process(e.$value(),e.level))},r.$$arity=0)}(u.base,u.get("Base")),function(n,$super){function r(){}var i,a=r=s(n,$super,"UndefNode",r);a.$$proto,a.$$scope;a.$handle("undef"),e.defn(a,"$compile",i=function(){var n,r,i,a=this;return(n=(r=a.$children()).$each,n.$$p=(i=function(n){var r,a,s=i.$$s||this,$=o,l=o;return null==n&&(n=o),$=n["$[]"](1),l=[],n["$[]"](0)["$=="]("js_return")&&($=$["$[]"](1),l["$<<"](s.$expr(s.$s("js_return")))),l["$<<"]("Opal.udef(self, '$"+$.$to_s()+"');"),a=t(s.$children().$length(),1),(r=!1!==a&&a!==o&&null!=a?n["$!="](s.$children().$first()):a)===o||null==r||r.$$is_boolean&&1!=r?(a=s).$push.apply(a,e.to_a(l)):(r=s).$line.apply(r,e.to_a(l))},i.$$s=a,i.$$arity=1,i),n).call(r)},i.$$arity=0)}(u.base,u.get("Base")),function(t,$super){function n(){}var r,i,a,$=n=s(t,$super,"AliasNode",n);$.$$proto,$.$$scope;$.$handle("alias"),$.$children("new_name","old_name"),e.defn($,"$new_mid",r=function(){var e=this;return e.$mid_to_jsid(e.$new_name()["$[]"](1).$to_s())},r.$$arity=0),e.defn($,"$old_mid",i=function(){var e=this;return e.$mid_to_jsid(e.$old_name()["$[]"](1).$to_s())},i.$$arity=0),e.defn($,"$compile",a=function(){var e,t,n=this;return(e=!1!==(t=n.$scope()["$class?"]())&&t!==o&&null!=t?t:n.$scope()["$module?"]())===o||null==e||e.$$is_boolean&&1!=e||n.$scope().$methods()["$<<"]("$"+n.$new_name()["$[]"](1)),n.$push("Opal.alias(self, '"+n.$new_name()["$[]"](1)+"', '"+n.$old_name()["$[]"](1)+"')")},a.$$arity=0)}(u.base,u.get("Base")),function(t,$super){function n(){}var r,i=n=s(t,$super,"BeginNode",n),a=i.$$proto;i.$$scope;a.level=o,i.$handle("begin"),i.$children("body"),e.defn(i,"$compile",r=function(){var e,t,n=this;return t=n["$stmt?"]()["$!"](),(e=!1!==t&&t!==o&&null!=t?n.$body().$type()["$=="]("block"):t)===o||null==e||e.$$is_boolean&&1!=e?n.$push(n.$process(n.$body(),n.level)):(n.$push(n.$stmt(n.$compiler().$returns(n.$body()))),n.$wrap("(function() {","})()"))},r.$$arity=0)}(u.base,u.get("Base")),function(t,$super){function n(){}var r,i=n=s(t,$super,"ParenNode",n),a=i.$$proto;i.$$scope;a.level=o,i.$handle("paren"),i.$children("body"),e.defn(i,"$compile",r=function(){var e,t,n,r=this;return r.$body().$type()["$=="]("block")?((e=(t=r.$body().$children()).$each_with_index,e.$$p=(n=function(e,t){var r=n.$$s||this;return null==e&&(e=o),null==t&&(t=o),t["$=="](0)||r.$push(", "),r.$push(r.$expr(e))},n.$$s=r,n.$$arity=2,n),e).call(t),r.$wrap("(",")")):(r.$push(r.$process(r.$body(),r.level)),(e=r["$stmt?"]())===o||null==e||e.$$is_boolean&&1!=e?r.$wrap("(",")"):o)},r.$$arity=0)}(u.base,u.get("Base")),function(t,$super){function r(){}var i,a,l,u,c,p=r=s(t,$super,"BlockNode",r),d=p.$$proto;p.$$scope;d.level=o,p.$handle("block"),e.defn(p,"$compile",i=function(){var e,t,n,r=this;return(e=r.$children()["$empty?"]())===o||null==e||e.$$is_boolean&&1!=e?(e=(t=r.$children()).$each_with_index,e.$$p=(n=function(e,t){var r,i=n.$$s||this,a=o;return null==i.level&&(i.level=o),null==e&&(e=o),null==t&&(t=o),t["$=="](0)||i.$push(i.$stmt_join()),(r=a=i.$find_inline_yield(e))===o||null==r||r.$$is_boolean&&1!=r||(i.$push(i.$compiler().$process(a,i.level)),i.$push(";")),i.$push(i.$compiler().$process(e,i.level)),(r=i["$child_is_expr?"](e))===o||null==r||r.$$is_boolean&&1!=r?o:i.$push(";")},n.$$s=r,n.$$arity=2,n),e).call(t):r.$push("nil")},i.$$arity=0),e.defn(p,"$stmt_join",a=function(){var e,t=this;return(e=t.$scope()["$class_scope?"]())===o||null==e||e.$$is_boolean&&1!=e?"\n"+t.$current_indent():"\n\n"+t.$current_indent()},a.$$arity=0),e.defn(p,"$child_is_expr?",l=function(e){var t,n=this;return t=n["$raw_expression?"](e),!1!==t&&t!==o&&null!=t?["stmt","stmt_closure"]["$include?"](n.level):t},l.$$arity=1),e.defn(p,"$raw_expression?",u=function(e){return["xstr","dxstr"]["$include?"](e.$type())["$!"]()},u.$$arity=1),e.defn(p,"$find_inline_yield",c=function(e){var t,r,i,a,s,l=this,u=o,c=o,p=o;return u=o,c=e.$first(),"js_return"["$==="](c)?(t=u=l.$find_inline_yield(e["$[]"](1)))===o||null==t||t.$$is_boolean&&1!=t||(u=u["$[]"](2)):"array"["$==="](c)?(t=(r=e["$[]"]($(1,-1,!1))).$each_with_index,t.$$p=(i=function(t,r){var a=i.$$s||this;return null==t&&(t=o),null==r&&(r=o),t.$first()["$=="]("yield")?(u=t,e["$[]="](n(r,1),a.$s("js_tmp","$yielded"))):o},i.$$s=l,i.$$arity=2,i),t).call(r):"call"["$==="](c)&&(p=e["$[]"](3),(t=(a=p["$[]"]($(1,-1,!1))).$each_with_index,t.$$p=(s=function(e,t){var r=s.$$s||this;return null==e&&(e=o),null==t&&(t=o),e.$first()["$=="]("yield")?(u=e,p["$[]="](n(t,1),r.$s("js_tmp","$yielded"))):o},s.$$s=l,s.$$arity=2,s),t).call(a)),!1!==u&&u!==o&&null!=u?(((t=l.$scope()["$has_temp?"]("$yielded"))===o||null==t||t.$$is_boolean&&1!=t)&&l.$scope().$add_temp("$yielded"),l.$s("yasgn","$yielded",u)):o},c.$$arity=1)}(u.base,u.get("Base"))}(u.base)}(i.base)},Opal.modules["opal/nodes/yield"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass,a=e.range;return e.add_stubs(["$require","$find_yielding_scope","$uses_block!","$block_name","$yields_single_arg?","$push","$expr","$first","$wrap","$s","$uses_splat?","$scope","$def?","$parent","$!","$==","$size","$any?","$type","$handle","$compile_call","$children","$[]","$yield_args","$var_name"]),t.$require("opal/nodes/base"),function(t){var n,s=n=i(t,"Opal"),$=(s.$$proto,s.$$scope);!function(t){var n,s=n=i(t,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var i,a,s,$,l=n=o(t,$super,"BaseYieldNode",n);l.$$proto,l.$$scope;e.defn(l,"$compile_call",i=function(t){var n,i,o=this,a=r,s=r;return a=o.$find_yielding_scope(),a["$uses_block!"](),s=!1!==(n=a.$block_name())&&n!==r&&null!=n?n:"$yield",(n=o["$yields_single_arg?"](t))===r||null==n||n.$$is_boolean&&1!=n?(o.$push(o.$expr((n=o).$s.apply(n,["arglist"].concat(e.to_a(t))))),(i=o["$uses_splat?"](t))===r||null==i||i.$$is_boolean&&1!=i?o.$wrap("Opal.yieldX("+s+", [","])"):o.$wrap("Opal.yieldX("+s+", ",")")):(o.$push(o.$expr(t.$first())),o.$wrap("Opal.yield1("+s+", ",")"))},i.$$arity=2),e.defn(l,"$find_yielding_scope",a=function(){var e,t,n=this,i=r;for(i=n.$scope();!1!==i&&i!==r&&null!=i&&((e=!1!==(t=i.$block_name())&&t!==r&&null!=t?t:i["$def?"]())===r||null==e||e.$$is_boolean&&1!=e);)i=i.$parent();return i},a.$$arity=0),e.defn(l,"$yields_single_arg?",s=function(e){var t;return t=this["$uses_splat?"](e)["$!"](),!1!==t&&t!==r&&null!=t?e.$size()["$=="](1):t},s.$$arity=1),e.defn(l,"$uses_splat?",$=function(e){var t,n,i,o=this;return(t=(n=e)["$any?"],t.$$p=(i=function(e){i.$$s;return null==e&&(e=r),e.$type()["$=="]("splat")},i.$$s=o,i.$$arity=1,i),t).call(n)},$.$$arity=1)}($.base,$.get("Base")),function(t,$super){function n(){}var i,a=n=o(t,$super,"YieldNode",n),s=a.$$proto;a.$$scope;s.level=r,a.$handle("yield"),e.defn(a,"$compile",i=function(){var e=this;return e.$compile_call(e.$children(),e.level)},i.$$arity=0)}($.base,$.get("BaseYieldNode")),function(t,$super){function n(){}var r,i=n=o(t,$super,"YasgnNode",n);i.$$proto,i.$$scope;i.$handle("yasgn"),i.$children("var_name","yield_args"),e.defn(i,"$compile",r=function(){var t,n=this;return n.$compile_call((t=n).$s.apply(t,e.to_a(n.$yield_args()["$[]"](a(1,-1,!1)))),"stmt"),n.$wrap("("+n.$var_name()+" = ",")")},r.$$arity=0)}($.base,$.get("BaseYieldNode")),function(t,$super){function n(){}var i,a=n=o(t,$super,"ReturnableYieldNode",n),s=a.$$proto;a.$$scope;s.level=r,a.$handle("returnable_yield"),e.defn(a,"$compile",i=function(){var e=this;return e.$compile_call(e.$children(),e.level),e.$wrap("return ",";")},i.$$arity=0)}($.base,$.get("BaseYieldNode"))}($.base)}(n.base)},Opal.modules["opal/nodes/rescue"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass,a=e.range;return e.add_stubs(["$require","$handle","$children","$stmt?","$lhs","$returns","$compiler","$rhs","$line","$expr","$body","$indent","$new","$rescue_val","$wrap","$push","$in_ensure","$process","$body_sexp","$has_rescue_else?","$unshift","$rescue_else_sexp","$scope","$ensr_sexp","$wrap_in_closure?","$begn","$==","$type","$s","$ensr","$recv?","$expr?","$rescue_else_sexp=","$detect","$!=","$[]","$handle_rescue_else_manually?","$body_code","$each_with_index","$!","$in_ensure?","$empty?","$rescue_exprs","$rescue_variable","$[]=","$rescue_body","$===","$include?","$rescue_variable?","$last","$args","$dup","$pop"]),t.$require("opal/nodes/base"),function(t){var n,s=n=i(t,"Opal"),$=(s.$$proto,s.$$scope);!function(t){var n,s=n=i(t,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var i,a,s,$=n=o(t,$super,"RescueModNode",n),l=($.$$proto,$.$$scope);$.$handle("rescue_mod"),$.$children("lhs","rhs"),e.defn($,"$body",i=function(){var e,t=this;return(e=t["$stmt?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$compiler().$returns(t.$lhs()):t.$lhs()},i.$$arity=0),e.defn($,"$rescue_val",a=function(){var e,t=this;return(e=t["$stmt?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$compiler().$returns(t.$rhs()):t.$rhs()},a.$$arity=0),e.defn($,"$compile",s=function(){var e,t,n,i=this;return i.$line("try {",i.$expr(i.$body())," } catch ($err) { "),(e=(t=i).$indent,e.$$p=(n=function(){var e=n.$$s||this;return e.$line("if (Opal.rescue($err, [",e.$expr(l.get("Sexp").$new(["const","StandardError"])),"])) {"),e.$line(e.$expr(e.$rescue_val())),e.$line("} else { throw $err; } }")},n.$$s=i,n.$$arity=0,n),e).call(t),(e=i["$stmt?"]())===r||null==e||e.$$is_boolean&&1!=e?i.$wrap("(function() {","})()"):r},s.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var i,a,s,$,l=n=o(t,$super,"EnsureNode",n);l.$$proto,l.$$scope;l.$handle("ensure"),l.$children("begn","ensr"),e.defn(l,"$compile",i=function(){var e,t,n,i,o,a=this;return a.$push("try {"),(e=(t=a).$in_ensure,e.$$p=(n=function(){var e=n.$$s||this;return null==e.level&&(e.level=r),e.$line(e.$compiler().$process(e.$body_sexp(),e.level))},n.$$s=a,n.$$arity=0,n),e).call(t),a.$line("} finally {"),(e=(i=a).$indent,e.$$p=(o=function(){var e,t,n,i=o.$$s||this;return null==i.level&&(i.level=r),(e=i["$has_rescue_else?"]())===r||null==e||e.$$is_boolean&&1!=e?i.$line(i.$compiler().$process(i.$ensr_sexp(),i.level)):(i.$unshift("var $no_errors = true; "),i.$line("var $rescue_else_result;"),i.$line("if ($no_errors) { "),(e=(t=i).$indent,e.$$p=(n=function(){var e,t,i,o=n.$$s||this;return o.$line("$rescue_else_result = (function() {"),(e=(t=o).$indent,e.$$p=(i=function(){var e=i.$$s||this;return null==e.level&&(e.level=r),e.$line(e.$compiler().$process(e.$compiler().$returns(e.$scope().$rescue_else_sexp()),e.level))},i.$$s=o,i.$$arity=0,i),e).call(t),o.$line("})();")},n.$$s=i,n.$$arity=0,n),e).call(t),i.$line("}"),i.$line(i.$compiler().$process(i.$ensr_sexp(),i.level)),i.$line("if ($no_errors) { return $rescue_else_result; }"))},o.$$s=a,o.$$arity=0,o),e).call(i),a.$line("}"),(e=a["$wrap_in_closure?"]())===r||null==e||e.$$is_boolean&&1!=e?r:a.$wrap("(function() { ","; })()")},i.$$arity=0),e.defn(l,"$body_sexp",a=function(){var e,t=this,n=r;return(e=t["$wrap_in_closure?"]())===r||null==e||e.$$is_boolean&&1!=e?n=t.$begn():(n=t.$compiler().$returns(t.$begn()),n.$type()["$=="]("rescue")?t.$s("js_return",n):n)},a.$$arity=0),e.defn(l,"$ensr_sexp",s=function(){var e,t=this;return!1!==(e=t.$ensr())&&e!==r&&null!=e?e:t.$s("nil")},s.$$arity=0),e.defn(l,"$wrap_in_closure?",$=function(){var e,t,n=this;return!1!==(e=!1!==(t=n["$recv?"]())&&t!==r&&null!=t?t:n["$expr?"]())&&e!==r&&null!=e?e:n["$has_rescue_else?"]()},$.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var i,s,$,l=n=o(t,$super,"RescueNode",n);l.$$proto,l.$$scope;l.$handle("rescue"),l.$children("body"),e.defn(l,"$compile",i=function(){var e,t,n,i,o,s,$,l,u,c,p=this,d=r;return e=[(n=(i=p.$children()["$[]"](a(1,-1,!1))).$detect,n.$$p=(o=function(e){o.$$s;return null==e&&(e=r),e.$type()["$!="]("resbody")},o.$$s=p,o.$$arity=1,o),n).call(i)],t=p.$scope(),t["$rescue_else_sexp="].apply(t,e),e[e.length-1],d=!1,(e=p["$handle_rescue_else_manually?"]())===r||null==e||e.$$is_boolean&&1!=e||p.$line("var $no_errors = true;"),p.$push("try {"),(e=(t=p).$indent,e.$$p=(s=function(){var e=s.$$s||this;return null==e.level&&(e.level=r),e.$line(e.$process(e.$body_code(),e.level))},s.$$s=p,s.$$arity=0,s),e).call(t),p.$line("} catch ($err) {"),(e=(n=p).$indent,e.$$p=($=function(){var e,t,n,i=$.$$s||this;return(e=i["$has_rescue_else?"]())===r||null==e||e.$$is_boolean&&1!=e||i.$line("$no_errors = false;"),(e=(t=i.$children()["$[]"](a(1,-1,!1))).$each_with_index,e.$$p=(n=function(e,t){var i=n.$$s||this;return null==i.level&&(i.level=r),null==e&&(e=r),null==t&&(t=r),e.$type()["$=="]("resbody")?(d=!0,t["$=="](0)||i.$push(" else "),i.$line(i.$process(e,i.level))):r},n.$$s=i,n.$$arity=2,n),e).call(t),i.$push(" else { throw $err; }")},$.$$s=p,$.$$arity=0,$),e).call(n),p.$line("}"),(e=p["$handle_rescue_else_manually?"]())===r||null==e||e.$$is_boolean&&1!=e||(p.$push("finally {"),(e=(l=p).$indent,e.$$p=(u=function(){var e,t,n,i=u.$$s||this;return i.$line("if ($no_errors) { "),(e=(t=i).$indent,e.$$p=(n=function(){var e,t,i,o=n.$$s||this;return o.$line("return (function() {"),(e=(t=o).$indent,e.$$p=(i=function(){var e=i.$$s||this;return null==e.level&&(e.level=r),e.$line(e.$compiler().$process(e.$compiler().$returns(e.$scope().$rescue_else_sexp()),e.level))},i.$$s=o,i.$$arity=0,i),e).call(t),o.$line("})();")},n.$$s=i,n.$$arity=0,n),e).call(t),i.$line("}")},u.$$s=p,u.$$arity=0,u),e).call(l),p.$push("}")),(e=!1!==(c=p["$expr?"]())&&c!==r&&null!=c?c:p["$recv?"]())===r||null==e||e.$$is_boolean&&1!=e?r:p.$wrap("(function() { ","})()")},i.$$arity=0),e.defn(l,"$body_code",s=function(){var e,t=this,n=r;return n=function(){return t.$body().$type()["$=="]("resbody")?t.$s("nil"):t.$body()}(),((e=t["$stmt?"]())===r||null==e||e.$$is_boolean&&1!=e)&&(n=t.$compiler().$returns(n)),n},s.$$arity=0),e.defn(l,"$handle_rescue_else_manually?",$=function(){var e,t=this;return e=t.$scope()["$in_ensure?"]()["$!"](),!1!==e&&e!==r&&null!=e?t.$scope()["$has_rescue_else?"]():e},$.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var i,a,s,$,l,u=n=o(t,$super,"ResBodyNode",n),c=(u.$$proto,u.$$scope);u.$handle("resbody"),u.$children("args","body"),e.defn(u,"$compile",i=function(){var e,t,n,i,o,a=this;return a.$push("if (Opal.rescue($err, ["),(e=a.$rescue_exprs()["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?(e=(t=a.$rescue_exprs()).$each_with_index,e.$$p=(n=function(e,t){var i=n.$$s||this;return null==e&&(e=r),null==t&&(t=r),t["$=="](0)||i.$push(", "),i.$push(i.$expr(e))},n.$$s=a,n.$$arity=2,n),e).call(t):a.$push(a.$expr(c.get("Sexp").$new(["const","StandardError"]))),a.$push("])) {"),(e=(i=a).$indent,e.$$p=(o=function(){var e,t,n,i=o.$$s||this,a=r;return(e=a=i.$rescue_variable())===r||null==e||e.$$is_boolean&&1!=e||(a["$[]="](2,i.$s("js_tmp","$err")),i.$push(i.$expr(a),";")),i.$line("try {"),(e=(t=i).$indent,e.$$p=(n=function(){var e=n.$$s||this;return null==e.level&&(e.level=r),e.$line(e.$process(e.$rescue_body(),e.level))},n.$$s=i,n.$$arity=0,n),e).call(t),i.$line("} finally { Opal.pop_exception() }")},o.$$s=a,o.$$arity=0,o),e).call(i),a.$line("}")},i.$$arity=0),e.defn(u,"$rescue_variable?",a=function(e){var t;return t=c.get("Sexp")["$==="](e),!1!==t&&t!==r&&null!=t?["lasgn","iasgn"]["$include?"](e.$type()):t},a.$$arity=1),e.defn(u,"$rescue_variable",s=function(){var e,t=this;return(e=t["$rescue_variable?"](t.$args().$last()))===r||null==e||e.$$is_boolean&&1!=e?r:t.$args().$last().$dup()},s.$$arity=0),e.defn(u,"$rescue_exprs",$=function(){var e,t=this,n=r;return n=t.$args().$dup(),(e=t["$rescue_variable?"](n.$last()))===r||null==e||e.$$is_boolean&&1!=e||n.$pop(),n.$children()},$.$$arity=0),e.defn(u,"$rescue_body",l=function(){var e,t=this,n=r;return n=!1!==(e=t.$body())&&e!==r&&null!=e?e:t.$s("nil"),((e=t["$stmt?"]())===r||null==e||e.$$is_boolean&&1!=e)&&(n=t.$compiler().$returns(n)),n},l.$$arity=0)}($.base,$.get("Base"))}($.base)}(n.base)};Opal.modules["opal/nodes/case"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass,a=e.range;return e.add_stubs(["$require","$handle","$children","$in_case","$condition","$[]=","$case_stmt","$add_local","$push","$expr","$each_with_index","$==","$type","$needs_closure?","$returns","$compiler","$stmt","$case_parts","$!","$wrap","$stmt?","$[]","$s","$js_truthy","$when_checks","$process","$body_code","$whens","$body"]),t.$require("opal/nodes/base"),function(t){var n,s=n=i(t,"Opal"),$=(s.$$proto,s.$$scope);!function(t){var n,s=n=i(t,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var i,s,$,l,u=n=o(t,$super,"CaseNode",n);u.$$proto,u.$$scope;u.$handle("case"),u.$children("condition"),e.defn(u,"$compile",i=function(){var e,t,n,i=this,o=r;return o=!1,(e=(t=i.$compiler()).$in_case,e.$$p=(n=function(){var e,t,i,a,s=n.$$s||this;return(e=s.$condition())===r||null==e||e.$$is_boolean&&1!=e||(s.$case_stmt()["$[]="]("cond",!0),s.$add_local("$case"),s.$push("$case = ",s.$expr(s.$condition()),";")),(e=(t=s.$case_parts()).$each_with_index,e.$$p=(i=function(e,t){var n,a=i.$$s||this;return null==e&&(e=r),null==t&&(t=r),(n=!1!==e&&e!==r&&null!=e?e.$type()["$=="]("when"):e)===r||null==n||n.$$is_boolean&&1!=n?!1!==e&&e!==r&&null!=e?(o=!0,(n=a["$needs_closure?"]())===r||null==n||n.$$is_boolean&&1!=n||(e=a.$compiler().$returns(e)),a.$push("else {",a.$stmt(e),"}")):r:((n=a["$needs_closure?"]())===r||null==n||n.$$is_boolean&&1!=n||a.$compiler().$returns(e),t["$=="](0)||a.$push("else "),a.$push(a.$stmt(e)))},i.$$s=s,i.$$arity=2,i),e).call(t),a=s["$needs_closure?"](),(e=!1!==a&&a!==r&&null!=a?o["$!"]():a)===r||null==e||e.$$is_boolean&&1!=e||s.$push("else { return nil }"),(e=s["$needs_closure?"]())===r||null==e||e.$$is_boolean&&1!=e?r:s.$wrap("(function() {","})()")},n.$$s=i,n.$$arity=0,n),e).call(t)},i.$$arity=0),e.defn(u,"$needs_closure?",s=function(){return this["$stmt?"]()["$!"]()},s.$$arity=0),e.defn(u,"$case_parts",$=function(){return this.$children()["$[]"](a(1,-1,!1))},$.$$arity=0),e.defn(u,"$case_stmt",l=function(){return this.$compiler().$case_stmt()},l.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}
34
34
  var i,a,s,$,l=n=o(t,$super,"WhenNode",n),u=l.$$proto;l.$$scope;u.level=r,l.$handle("when"),l.$children("whens","body"),e.defn(l,"$compile",i=function(){var e,t,n,i=this;return i.$push("if ("),(e=(t=i.$when_checks()).$each_with_index,e.$$p=(n=function(e,t){var i,o=n.$$s||this,a=r;return null==e&&(e=r),null==t&&(t=r),t["$=="](0)||o.$push(" || "),e.$type()["$=="]("splat")?(o.$push("(function($splt) { for (var i = 0; i < $splt.length; i++) {"),o.$push("if ($splt[i]['$===']($case)) { return true; }"),o.$push("} return false; })(",o.$expr(e["$[]"](1)),")")):(i=o.$case_stmt()["$[]"]("cond"))===r||null==i||i.$$is_boolean&&1!=i?o.$push(o.$js_truthy(e)):(a=o.$s("call",e,"===",o.$s("arglist",o.$s("js_tmp","$case"))),o.$push(o.$expr(a)))},n.$$s=i,n.$$arity=2,n),e).call(t),i.$push(") {",i.$process(i.$body_code(),i.level),"}")},i.$$arity=0),e.defn(l,"$when_checks",a=function(){return this.$whens().$children()},a.$$arity=0),e.defn(l,"$case_stmt",s=function(){return this.$compiler().$case_stmt()},s.$$arity=0),e.defn(l,"$body_code",$=function(){var e,t=this;return!1!==(e=t.$body())&&e!==r&&null!=e?e:t.$s("nil")},$.$$arity=0)}($.base,$.get("Base"))}($.base)}(n.base)},Opal.modules["opal/nodes/super"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$children","$def?","$scope","$uses_block!","$default_compile","$private","$s","$raw_iter","$arglist","$raise","$find_parent_def","$containing_def_scope","$to_s","$mid","$identify!","$defs","$name","$parent","$defined_check_param","$get_super_chain","$join","$map","$implicit_arguments_param","$super_method_invocation","$iter?","$super_block_invocation","$push","$receiver_fragment","$handle","$add_method","$method_missing?","$compiler","$wrap","$==","$uses_zuper=","$formal_block_parameter","$!","$iter","$[]","$<<","$===","$extract_block_arg","$block_arg"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s,$,l,u,c,p,d,f,h,_,g=n=o(t,$super,"BaseSuperNode",n),m=g.$$proto;g.$$scope;m.iter=m.implicit_args=r,g.$children("arglist","raw_iter"),e.defn(g,"$compile",i=function(){var e,t=this;return(e=t.$scope()["$def?"]())===r||null==e||e.$$is_boolean&&1!=e||t.$scope()["$uses_block!"](),t.$default_compile()},i.$$arity=0),g.$private(),e.defn(g,"$recvr",a=function(){return this.$s("self")},a.$$arity=0),e.defn(g,"$iter",s=function(){var e,t,n=this;return!1!==(e=n.iter)&&e!==r&&null!=e?e:n.iter=function(){return(t=n.$raw_iter())===r||null==t||t.$$is_boolean&&1!=t?(t=n.$arglist())===r||null==t||t.$$is_boolean&&1!=t?(n.$scope()["$uses_block!"](),n.$s("js_tmp","$iter")):n.$s("js_tmp","null"):n.$raw_iter()}()},s.$$arity=0),e.defn(g,"$method_jsid",$=function(){return this.$raise("Not implemented, see #add_method")},$.$$arity=0),e.defn(g,"$redefine_this?",l=function(){return!0},l.$$arity=1),e.defn(g,"$arguments_array?",u=function(){var t,n,i,o=this,a=u.$$p,s=r,$=r;for(u.$$p=null,s=[],$=0;$<arguments.length;$++)s[$]=arguments[$];return!1!==(t=(i=o,n=e.find_super_dispatcher(o,"arguments_array?",u,!1),n.$$p=a,n).apply(i,s))&&t!==r&&null!=t?t:o.implicit_args},u.$$arity=0),e.defn(g,"$containing_def_scope",c=function(){var e,t=this;return(e=t.$scope()["$def?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$scope().$find_parent_def():t.$scope()},c.$$arity=0),e.defn(g,"$defined_check_param",p=function(){return"false"},p.$$arity=0),e.defn(g,"$implicit_arguments_param",d=function(){var e;return(e=this.implicit_args)===r||null==e||e.$$is_boolean&&1!=e?"false":"true"},d.$$arity=0),e.defn(g,"$super_method_invocation",f=function(){var e,t=this,n=r,i=r,o=r,a=r;return n=t.$containing_def_scope(),i=n.$mid().$to_s(),o=n["$identify!"](),(e=n.$defs())===r||null==e||e.$$is_boolean&&1!=e?"Opal.find_super_dispatcher(self, '"+i+"', "+o+", "+t.$defined_check_param()+")":(a=function(){return(e=n.$parent().$name())===r||null==e||e.$$is_boolean&&1!=e?"self.$$class.$$proto":"$"+n.$parent().$name()}(),"Opal.find_super_dispatcher(self, '"+i+"', "+o+", "+t.$defined_check_param()+", "+a+")")},f.$$arity=0),e.defn(g,"$super_block_invocation",h=function(){var t,n,i,o=this,a=r,s=r,$=r,l=r;return n=o.$scope().$get_super_chain(),t=e.to_ary(n),a=null==t[0]?r:t[0],s=null==t[1]?r:t[1],$=null==t[2]?r:t[2],l=(t=(n=a).$map,t.$$p=(i=function(e){i.$$s;return null==e&&(e=r),e+".$$def"},i.$$s=o,i.$$arity=1,i),t).call(n).$join(" || "),o.implicit_args.$to_s(),"Opal.find_iter_super_dispatcher(self, "+$+", ("+l+" || "+s+"), "+o.$defined_check_param()+", "+o.$implicit_arguments_param()+")"},h.$$arity=0),e.defn(g,"$add_method",_=function(e){var t,n=this,i=r;return i=function(){return(t=n.$scope()["$def?"]())===r||null==t||t.$$is_boolean&&1!=t?(t=n.$scope()["$iter?"]())===r||null==t||t.$$is_boolean&&1!=t?n.$raise("unexpected compilation error"):n.$super_block_invocation():n.$super_method_invocation()}(),!1!==e&&e!==r&&null!=e?n.$push("("+e+" = ",n.$receiver_fragment(),", ",i,")"):n.$push(i)},_.$$arity=1)}(s.base,s.get("CallNode")),function(t,$super){function n(){}var i,a,s=n=o(t,$super,"DefinedSuperNode",n);s.$$proto,s.$$scope;s.$handle("defined_super"),e.defn(s,"$defined_check_param",i=function(){return"true"},i.$$arity=0),e.defn(s,"$compile",a=function(){var e,t=this;return t.$add_method(r),(e=t.$compiler()["$method_missing?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$wrap("((",') != null ? "super" : nil)'):t.$wrap("(!(",'.$$stub) ? "super" : nil)')},a.$$arity=0)}(s.base,s.get("BaseSuperNode")),function(t,$super){function n(){}var i,a,s=n=o(t,$super,"SuperNode",n),$=s.$$proto,l=s.$$scope;$.arguments_without_block=r,s.$handle("super"),e.defn(s,"$compile",i=function(){var t,n,o=this,a=i.$$p,s=r,$=r,l=r,u=r;for(i.$$p=null,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return o.$arglist()["$=="](r)&&(o.implicit_args=!0,(t=o.$containing_def_scope())===r||null==t||t.$$is_boolean&&1!=t?o.arguments_without_block=[]:(t=[!0],n=o.$containing_def_scope(),n["$uses_zuper="].apply(n,t),t[t.length-1],o.arguments_without_block=[o.$s("js_tmp","$zuper")],n=s=o.$formal_block_parameter(),(t=!1!==n&&n!==r&&null!=n?o.$iter()["$!"]():n)===r||null==t||t.$$is_boolean&&1!=t||($=o.$s("block_pass",o.$s("lvar",s["$[]"](1))),o.arguments_without_block["$<<"]($)))),(n=o,t=e.find_super_dispatcher(o,"compile",i,!1),t.$$p=a,t).apply(n,l)},i.$$arity=0),s.$private(),e.defn(s,"$formal_block_parameter",a=function(){var e=this,t=r;return function(){return t=e.$containing_def_scope(),l.get("Opal").$$scope.get("Nodes").$$scope.get("IterNode")["$==="](t)?e.$containing_def_scope().$extract_block_arg():l.get("Opal").$$scope.get("Nodes").$$scope.get("DefNode")["$==="](t)?e.$containing_def_scope().$block_arg():e.$raise("Don't know what to do with scope "+e.$containing_def_scope())}()},a.$$arity=0)}(s.base,s.get("BaseSuperNode"))}(s.base)}(n.base)},Opal.modules["opal/version"]=function(e){var t=(e.top,e),n=(e.nil,e.breaker,e.slice,e.module);return function(t){var r,i=r=n(t,"Opal"),o=(i.$$proto,i.$$scope);e.cdecl(o,"VERSION","0.10.3")}(t.base)},Opal.modules["opal/nodes/top"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$children","$push","$version_comment","$opening","$in_scope","$stmt","$stmts","$is_a?","$eval?","$compiler","$add_temp","$add_used_helpers","$add_used_operators","$line","$to_vars","$scope","$compile_method_stubs","$compile_irb_vars","$compile_end_construct","$closing","$requirable?","$to_s","$cleanpath","$Pathname","$file","$inspect","$returns","$body","$irb?","$to_a","$helpers","$each","$operator_helpers","$[]","$method_missing?","$method_calls","$join","$map","$empty?","$eof_content"]),t.$require("pathname"),t.$require("opal/version"),t.$require("opal/nodes/scope"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s,$,l,u,c,p,d,f,h=n=o(t,$super,"TopNode",n),_=(h.$$proto,h.$$scope);h.$handle("top"),h.$children("body"),e.defn(h,"$compile",i=function(){var e,t,n,i=this;return i.$push(i.$version_comment()),i.$opening(),(e=(t=i).$in_scope,e.$$p=(n=function(){var e,t=n.$$s||this,i=r;return i=t.$stmt(t.$stmts()),((e=i["$is_a?"](_.get("Array")))===r||null==e||e.$$is_boolean&&1!=e)&&(i=[i]),((e=t.$compiler()["$eval?"]())===r||null==e||e.$$is_boolean&&1!=e)&&t.$add_temp("self = Opal.top"),t.$add_temp(function(){return(e=t.$compiler()["$eval?"]())===r||null==e||e.$$is_boolean&&1!=e?"$scope = Opal":"$scope = (self.$$scope || self.$$class.$$scope)"}()),t.$add_temp("nil = Opal.nil"),t.$add_used_helpers(),t.$add_used_operators(),t.$line(t.$scope().$to_vars()),t.$compile_method_stubs(),t.$compile_irb_vars(),t.$compile_end_construct(),t.$line(i)},n.$$s=i,n.$$arity=0,n),e).call(t),i.$closing()},i.$$arity=0),e.defn(h,"$opening",a=function(){var e,t=this,n=r;return(e=t.$compiler()["$requirable?"]())===r||null==e||e.$$is_boolean&&1!=e?(e=t.$compiler()["$eval?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$line("(function(Opal) {"):t.$line("(function(Opal, self) {"):(n=t.$Pathname(t.$compiler().$file()).$cleanpath().$to_s(),t.$line("Opal.modules["+n.$inspect()+"] = function(Opal) {"))},a.$$arity=0),e.defn(h,"$closing",s=function(){var e,t=this;return(e=t.$compiler()["$requirable?"]())===r||null==e||e.$$is_boolean&&1!=e?(e=t.$compiler()["$eval?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$line("})(Opal);\n"):t.$line("})(Opal, self)"):t.$line("};\n")},s.$$arity=0),e.defn(h,"$stmts",$=function(){var e=this;return e.$compiler().$returns(e.$body())},$.$$arity=0),e.defn(h,"$compile_irb_vars",l=function(){var e,t=this;return(e=t.$compiler()["$irb?"]())===r||null==e||e.$$is_boolean&&1!=e?r:t.$line("if (!Opal.irb_vars) { Opal.irb_vars = {}; }")},l.$$arity=0),e.defn(h,"$add_used_helpers",u=function(){var e,t,n,i=this,o=r;return o=i.$compiler().$helpers().$to_a(),(e=(t=o.$to_a()).$each,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$add_temp("$"+e+" = Opal."+e)},n.$$s=i,n.$$arity=1,n),e).call(t)},u.$$arity=0),e.defn(h,"$add_used_operators",c=function(){var e,t,n,i=this,o=r;return o=i.$compiler().$operator_helpers().$to_a(),(e=(t=o).$each,e.$$p=(n=function(e){var t=n.$$s||this,i=r;return null==e&&(e=r),i=_.get("Nodes").$$scope.get("CallNode").$$scope.get("OPERATORS")["$[]"](e),t.$line("function $rb_"+i+"(lhs, rhs) {"),t.$line(" return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs "+e+" rhs : lhs['$"+e+"'](rhs);"),t.$line("}")},n.$$s=i,n.$$arity=1,n),e).call(t)},c.$$arity=0),e.defn(h,"$compile_method_stubs",p=function(){var e,t,n,i=this,o=r,a=r;return(e=i.$compiler()["$method_missing?"]())===r||null==e||e.$$is_boolean&&1!=e?r:(o=i.$compiler().$method_calls(),a=(e=(t=o.$to_a()).$map,e.$$p=(n=function(e){n.$$s;return null==e&&(e=r),"'$"+e+"'"},n.$$s=i,n.$$arity=1,n),e).call(t).$join(", "),(e=a["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?i.$line("Opal.add_stubs(["+a+"]);"):r)},p.$$arity=0),e.defn(h,"$compile_end_construct",d=function(){var e,t=this,n=r;return(e=n=t.$compiler().$eof_content())===r||null==e||e.$$is_boolean&&1!=e?r:(t.$line("var $__END__ = Opal.Object.$new();"),t.$line("$__END__.$read = function() { return "+n.$inspect()+"; };"))},d.$$arity=0),e.defn(h,"$version_comment",f=function(){return"/* Generated by Opal "+_.get("Opal").$$scope.get("VERSION")+" */"},f.$$arity=0)}(s.base,s.get("ScopeNode"))}(s.base)}(n.base)},Opal.modules["opal/nodes/while"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$children","$with_temp","$js_truthy","$test","$in_while","$wrap_in_closure?","$[]=","$while_loop","$stmt","$body","$uses_redo?","$push","$while_open","$while_close","$line","$compiler","$wrap","$[]","$expr?","$recv?"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a,s,$,l,u=n=o(t,$super,"WhileNode",n);u.$$proto,u.$$scope;u.$handle("while"),u.$children("test","body"),e.defn(u,"$compile",i=function(){var e,t,n,i=this;return(e=(t=i).$with_temp,e.$$p=(n=function(e){var t,i,o,a=n.$$s||this,s=r;return null==e&&(e=r),s=a.$js_truthy(a.$test()),(t=(i=a.$compiler()).$in_while,t.$$p=(o=function(){var t,n=o.$$s||this,i=r;return(t=n["$wrap_in_closure?"]())===r||null==t||t.$$is_boolean&&1!=t||n.$while_loop()["$[]="]("closure",!0),n.$while_loop()["$[]="]("redo_var",e),i=n.$stmt(n.$body()),(t=n["$uses_redo?"]())===r||null==t||t.$$is_boolean&&1!=t?n.$push(n.$while_open(),s,n.$while_close()):(n.$push(e+" = false; "+n.$while_open()+e+" || "),n.$push(s),n.$push(n.$while_close())),(t=n["$uses_redo?"]())===r||null==t||t.$$is_boolean&&1!=t||n.$push(e+" = false;"),n.$line(i,"}")},o.$$s=a,o.$$arity=0,o),t).call(i)},n.$$s=i,n.$$arity=1,n),e).call(t),(e=i["$wrap_in_closure?"]())===r||null==e||e.$$is_boolean&&1!=e?r:i.$wrap("(function() {","; return nil; })()")},i.$$arity=0),e.defn(u,"$while_open",a=function(){return"while ("},a.$$arity=0),e.defn(u,"$while_close",s=function(){return") {"},s.$$arity=0),e.defn(u,"$uses_redo?",$=function(){return this.$while_loop()["$[]"]("use_redo")},$.$$arity=0),e.defn(u,"$wrap_in_closure?",l=function(){var e,t=this;return!1!==(e=t["$expr?"]())&&e!==r&&null!=e?e:t["$recv?"]()},l.$$arity=0)}(s.base,s.get("Base")),function(t,$super){function n(){}var r,i,a=n=o(t,$super,"UntilNode",n);a.$$proto,a.$$scope;a.$handle("until"),e.defn(a,"$while_open",r=function(){return"while (!("},r.$$arity=0),e.defn(a,"$while_close",i=function(){return")) {"},i.$$arity=0)}(s.base,s.get("WhileNode"))}(s.base)}(n.base)},Opal.modules["opal/nodes/for"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$children","$with_temp","$==","$type","$args_sexp","$s","$<<","$body_sexp","$first","$insert","$each","$[]","$===","$add_local","$value","$push","$expr"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"ForNode",n);a.$$proto,a.$$scope;a.$handle("for"),a.$children("value","args_sexp","body_sexp"),e.defn(a,"$compile",i=function(){var e,t,n,i=this;return(e=(t=i).$with_temp,e.$$p=(n=function(e){var t,i,o,a=n.$$s||this,s=r,$=r,l=r;return null==e&&(e=r),a.$args_sexp().$type()["$=="]("array")?(s=a.$s("masgn",a.$args_sexp()),s["$<<"](a.$s("to_ary",a.$s("js_tmp",e)))):s=a.$args_sexp()["$<<"](a.$s("js_tmp",e)),(t=a.$body_sexp())===r||null==t||t.$$is_boolean&&1!=t||(a.$body_sexp().$first()["$=="]("block")?(a.$body_sexp().$insert(1,s),s=a.$body_sexp()):s=a.$s("block",s,a.$body_sexp())),(t=(i=s.$children()).$each,t.$$p=(o=function(e){var t,n,i,a=o.$$s||this,s=r;return null==e&&(e=r),function(){return s=e["$[]"](0),"lasgn"["$==="](s)?a.$add_local(e["$[]"](1)):"masgn"["$==="](s)&&e["$[]"](1)["$[]"](0)["$=="]("array")?(t=(n=e["$[]"](1)["$[]"](1)).$each,t.$$p=(i=function(e){var t=i.$$s||this;return null==e&&(e=r),e["$[]"](0)["$=="]("lasgn")?t.$add_local(e["$[]"](1)):r},i.$$s=a,i.$$arity=1,i),t).call(n):r}()},o.$$s=a,o.$$arity=1,o),t).call(i),$=a.$s("iter",a.$s("lasgn",e),s),l=a.$s("call",a.$value(),"each",a.$s("arglist"),$),a.$push(a.$expr(l))},n.$$s=i,n.$$arity=1,n),e).call(t)},i.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/hash"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass,a=e.hash2;return e.add_stubs(["$require","$handle","$attr_accessor","$each","$==","$type","$has_kwsplat=","$<<","$values","$keys","$children","$all?","$include?","$extract_kv_pairs_and_kwsplats","$has_kwsplat","$compile_merge","$simple_keys?","$compile_hash2","$compile_hash","$helper","$empty?","$expr","$s","$each_with_index","$push","$wrap","$times","$inspect","$to_s","$[]","$[]=","$size","$join","$value"]),t.$require("opal/nodes/base"),function(t){var n,s=n=i(t,"Opal"),$=(s.$$proto,s.$$scope);!function(t){var n,s=n=i(t,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var i,s,$,l,u,c,p,d=n=o(t,$super,"HashNode",n);d.$$proto,d.$$scope;d.$handle("hash"),d.$attr_accessor("has_kwsplat","keys","values"),e.defn(d,"$initialize",i=function(){var t,n,o=this,a=i.$$p,s=r,$=r;for(i.$$p=null,s=[],$=0;$<arguments.length;$++)s[$]=arguments[$];return(n=o,t=e.find_super_dispatcher(o,"initialize",i,!1),t.$$p=a,t).apply(n,s),o.has_kwsplat=!1,o.keys=[],o.values=[]},i.$$arity=-1),e.defn(d,"$extract_kv_pairs_and_kwsplats",s=function(){var e,t,n,i=this,o=r;return o=!1,(e=(t=i.$children()).$each,e.$$p=(n=function(e){var t,i,a=n.$$s||this;return null==e&&(e=r),e.$type()["$=="]("kwsplat")?(t=[!0],i=a,i["$has_kwsplat="].apply(i,t),t[t.length-1]):!1!==o&&o!==r&&null!=o?(a.$values()["$<<"](e),o=!1):(a.$keys()["$<<"](e),o=!0)},n.$$s=i,n.$$arity=1,n),e).call(t),[i.$keys(),i.$values()]},s.$$arity=0),e.defn(d,"$simple_keys?",$=function(){var e,t,n,i=this;return(e=(t=i.$keys())["$all?"],e.$$p=(n=function(e){n.$$s;return null==e&&(e=r),["sym","str"]["$include?"](e.$type())},n.$$s=i,n.$$arity=1,n),e).call(t)},$.$$arity=0),e.defn(d,"$compile",l=function(){var e,t=this;return t.$extract_kv_pairs_and_kwsplats(),(e=t.$has_kwsplat())===r||null==e||e.$$is_boolean&&1!=e?(e=t["$simple_keys?"]())===r||null==e||e.$$is_boolean&&1!=e?t.$compile_hash():t.$compile_hash2():t.$compile_merge()},l.$$arity=0),e.defn(d,"$compile_merge",u=function(){var t,n,i,o,a,s,$=this,l=r,u=r;return $.$helper("hash"),t=[[],[]],l=t[0],u=t[1],(t=(n=$.$children()).$each,t.$$p=(i=function(t){var n,o=i.$$s||this;return null==t&&(t=r),t.$type()["$=="]("kwsplat")?(((n=u["$empty?"]())===r||null==n||n.$$is_boolean&&1!=n)&&l["$<<"](o.$expr((n=o).$s.apply(n,["hash"].concat(e.to_a(u))))),l["$<<"](o.$expr(t)),u=[]):u["$<<"](t)},i.$$s=$,i.$$arity=1,i),t).call(n),((t=u["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t)&&l["$<<"]($.$expr((t=$).$s.apply(t,["hash"].concat(e.to_a(u))))),(o=(a=l).$each_with_index,o.$$p=(s=function(e,t){var n=s.$$s||this;return null==e&&(e=r),null==t&&(t=r),t["$=="](0)?n.$push(e):n.$push(".$merge(",e,")")},s.$$s=$,s.$$arity=2,s),o).call(a)},u.$$arity=0),e.defn(d,"$compile_hash",c=function(){var e,t,n,i=this;return i.$helper("hash"),(e=(t=i.$children()).$each_with_index,e.$$p=(n=function(e,t){var i=n.$$s||this;return null==e&&(e=r),null==t&&(t=r),t["$=="](0)||i.$push(", "),i.$push(i.$expr(e))},n.$$s=i,n.$$arity=2,n),e).call(t),i.$wrap("$hash(",")")},c.$$arity=0),e.defn(d,"$compile_hash2",p=function(){var e,t,n,i,o,s=this,$=r,l=r;return e=[a([],{}),[]],$=e[0],l=e[1],s.$helper("hash2"),(e=(t=s.$keys().$size()).$times,e.$$p=(n=function(e){var t,i=n.$$s||this,o=r;return null==e&&(e=r),o=i.$keys()["$[]"](e)["$[]"](1).$to_s().$inspect(),((t=$["$include?"](o))===r||null==t||t.$$is_boolean&&1!=t)&&l["$<<"](o),$["$[]="](o,i.$expr(i.$values()["$[]"](e)))},n.$$s=s,n.$$arity=1,n),e).call(t),(e=(i=l).$each_with_index,e.$$p=(o=function(e,t){var n=o.$$s||this;return null==e&&(e=r),null==t&&(t=r),t["$=="](0)||n.$push(", "),n.$push(e+": "),n.$push($["$[]"](e))},o.$$s=s,o.$$arity=2,o),e).call(i),s.$wrap("$hash2(["+l.$join(", ")+"], {","})")},p.$$arity=0)}($.base,$.get("Base")),function(t,$super){function n(){}var r,i=n=o(t,$super,"KwSplatNode",n);i.$$proto,i.$$scope;i.$handle("kwsplat"),i.$children("value"),e.defn(i,"$compile",r=function(){var e=this;return e.$push("Opal.to_hash(",e.$expr(e.$value()),")")},r.$$arity=0)}($.base,$.get("Base"))}($.base)}(n.base)},Opal.modules["opal/nodes/array"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$empty?","$children","$push","$each","$==","$type","$expr","$<<","$fragment"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"ArrayNode",n);a.$$proto,a.$$scope;a.$handle("array"),e.defn(a,"$compile",i=function(){var e,t,n,i=this,o=r,a=r,s=r;return(e=i.$children()["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?(e=[[],[]],o=e[0],a=e[1],(e=(t=i.$children()).$each,e.$$p=(n=function(e){var t,i=n.$$s||this,s=r,$=r;return null==e&&(e=r),s=e.$type()["$=="]("splat"),$=i.$expr(e),!1!==s&&s!==r&&null!=s?((t=a["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?((t=o["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?o["$<<"](i.$fragment(".concat(["))["$<<"](a)["$<<"](i.$fragment("])")):o["$<<"](i.$fragment("["))["$<<"](a)["$<<"](i.$fragment("]")),o["$<<"](i.$fragment(".concat("))["$<<"]($)["$<<"](i.$fragment(")"))):(t=o["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?o["$<<"](i.$fragment(".concat("))["$<<"]($)["$<<"](i.$fragment(")")):o["$<<"](i.$fragment("[].concat("))["$<<"]($)["$<<"](i.$fragment(")")),a=[]):(((t=a["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t)&&a["$<<"](i.$fragment(", ")),a["$<<"]($))},n.$$s=i,n.$$arity=1,n),e).call(t),((e=a["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e)&&(s=[i.$fragment("["),a,i.$fragment("]")],(e=o["$empty?"]())===r||null==e||e.$$is_boolean&&1!=e?o.$push([i.$fragment(".concat("),s,i.$fragment(")")]):o=s),i.$push(o)):i.$push("[]")},i.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes/defined"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass,a=e.range;return e.add_stubs(["$require","$handle","$children","$type","$value","$===","$push","$inspect","$to_s","$expr","$s","$[]","$respond_to?","$__send__","$mid_to_jsid","$with_temp","$handle_block_given_call","$compiler","$wrap","$include?"]),t.$require("opal/nodes/base"),function(t){var n,s=n=i(t,"Opal"),$=(s.$$proto,s.$$scope);!function(t){var n,s=n=i(t,"Nodes"),$=(s.$$proto,s.$$scope);!function(t,$super){function n(){}var i,s,$,l,u,c,p,d,f,h,_,g,m=n=o(t,$super,"DefinedNode",n),y=m.$$proto;m.$$scope;y.sexp=r,m.$handle("defined"),m.$children("value"),e.defn(m,"$compile",i=function(){var e,t=this,n=r,i=r;return n=t.$value().$type(),function(){return i=n,"self"["$==="](i)||"nil"["$==="](i)||"false"["$==="](i)||"true"["$==="](i)?t.$push(n.$to_s().$inspect()):"lasgn"["$==="](i)||"iasgn"["$==="](i)||"gasgn"["$==="](i)||"cvdecl"["$==="](i)||"masgn"["$==="](i)||"op_asgn_or"["$==="](i)||"op_asgn_and"["$==="](i)?t.$push("'assignment'"):"paren"["$==="](i)||"not"["$==="](i)?t.$push(t.$expr(t.$s("defined",t.$value()["$[]"](1)))):"lvar"["$==="](i)?t.$push("'local-variable'"):(e=t["$respond_to?"]("compile_"+n))===r||null==e||e.$$is_boolean&&1!=e?t.$push("'expression'"):t.$__send__("compile_"+n)}()},i.$$arity=0),e.defn(m,"$compile_call",s=function(){var e,t,n,i=this,o=r,a=r;return o=i.$mid_to_jsid(i.$value()["$[]"](2).$to_s()),a=function(){return(e=i.$value()["$[]"](1))===r||null==e||e.$$is_boolean&&1!=e?"self":i.$expr(i.$value()["$[]"](1))}(),(e=(t=i).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$push("((("+e+" = ",a,o+") && !"+e+".$$stub) || ",a),t.$push("['$respond_to_missing?']('"+t.$value()["$[]"](2).$to_s()+"') ? 'method' : nil)")},n.$$s=i,n.$$arity=1,n),e).call(t)},s.$$arity=0),e.defn(m,"$compile_ivar",$=function(){var e,t,n,i=this;return(e=(t=i).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this,i=r;return null==e&&(e=r),i=t.$value()["$[]"](1).$to_s()["$[]"](a(1,-1,!1)),t.$push("(("+e+" = self['"+i+"'], "+e+" != null && "+e+" !== nil) ? "),t.$push("'instance-variable' : nil)")},n.$$s=i,n.$$arity=1,n),e).call(t)},$.$$arity=0),e.defn(m,"$compile_super",l=function(){var e=this;return e.$push(e.$expr(e.$s("defined_super",e.$value())))},l.$$arity=0),e.defn(m,"$compile_yield",u=function(){var e=this;return e.$push(e.$compiler().$handle_block_given_call(e.sexp)),e.$wrap("((",') != null ? "yield" : nil)')},u.$$arity=0),e.defn(m,"$compile_xstr",c=function(){var e=this;return e.$push(e.$expr(e.$value())),e.$wrap("(typeof(",') !== "undefined")')},c.$$arity=0),e.alias(m,"compile_dxstr","compile_xstr"),e.defn(m,"$compile_const",p=function(){var e=this;return e.$push("($scope."+e.$value()["$[]"](1)+" != null)")},p.$$arity=0),e.defn(m,"$compile_colon2",d=function(){var e=this;return e.$push("(function(){ try { return (("),e.$push(e.$expr(e.$value())),e.$push(") != null ? 'constant' : nil); } catch (err) { if (err.$$class"),e.$push(" === Opal.NameError) { return nil; } else { throw(err); }}; })()")},d.$$arity=0),e.defn(m,"$compile_colon3",f=function(){var e=this;return e.$push("(Opal.Object.$$scope."+e.$value()["$[]"](1)+" == null ? nil : 'constant')")},f.$$arity=0),e.defn(m,"$compile_cvar",h=function(){var e=this;return e.$push("(Opal.cvars['"+e.$value()["$[]"](1)+"'] != null ? 'class variable' : nil)")},h.$$arity=0),e.defn(m,"$compile_gvar",_=function(){var e,t,n,i=this,o=r;return o=i.$value()["$[]"](1).$to_s()["$[]"](a(1,-1,!1)),(e=["~","!"]["$include?"](o))===r||null==e||e.$$is_boolean&&1!=e?(e=["`","'","+","&"]["$include?"](o))===r||null==e||e.$$is_boolean&&1!=e?i.$push("($gvars["+o.$inspect()+"] != null ? 'global-variable' : nil)"):(e=(t=i).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$push("(("+e+" = $gvars['~'], "+e+" != null && "+e+" !== nil) ? "),t.$push("'global-variable' : nil)")},n.$$s=i,n.$$arity=1,n),e).call(t):i.$push("'global-variable'")},_.$$arity=0),e.defn(m,"$compile_nth_ref",g=function(){var e,t,n,i=this;return(e=(t=i).$with_temp,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=r),t.$push("(("+e+" = $gvars['~'], "+e+" != null && "+e+" != nil) ? "),t.$push("'global-variable' : nil)")},n.$$s=i,n.$$arity=1,n),e).call(t)},g.$$arity=0)}($.base,$.get("Base"))}($.base)}(n.base)},Opal.modules["opal/nodes/masgn"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e>=t:e["$>="](t)}var r=e.top,i=e,o=e.nil,a=(e.breaker,e.slice,e.module),s=e.klass;return e.add_stubs(["$require","$handle","$children","$new_temp","$scope","$==","$type","$rhs","$push","$expr","$compile_masgn","$lhs","$-","$size","$[]","$queue_temp","$raise","$take_while","$!=","$drop","$each_with_index","$compile_assignment","$empty?","$shift","$<<","$dup","$s","$!","$>=","$include?","$[]=","$to_sym","$last"]),r.$require("opal/nodes/base"),function(r){var i,$=i=a(r,"Opal"),l=($.$$proto,$.$$scope);!function(r){var i,$=i=a(r,"Nodes"),l=($.$$proto,$.$$scope);!function(r,$super){function i(){}var a,$,l,u=i=s(r,$super,"MassAssignNode",i),c=(u.$$proto,u.$$scope);e.cdecl(c,"SIMPLE_ASSIGNMENT",["lasgn","iasgn","lvar","gasgn","cdecl"]),u.$handle("masgn"),u.$children("lhs","rhs"),e.defn(u,"$compile",a=function(){var e=this,n=o,r=o;return n=e.$scope().$new_temp(),e.$rhs().$type()["$=="]("array")?(e.$push(n+" = ",e.$expr(e.$rhs())),e.$compile_masgn(e.$lhs().$children(),n,t(e.$rhs().$size(),1)),e.$push(", "+n)):e.$rhs().$type()["$=="]("to_ary")?(r=e.$scope().$new_temp(),e.$push(r+" = ",e.$expr(e.$rhs()["$[]"](1))),e.$push(", "+n+" = Opal.to_ary("+r+")"),e.$compile_masgn(e.$lhs().$children(),n),e.$push(", "+r),e.$scope().$queue_temp(r)):e.$rhs().$type()["$=="]("splat")?(e.$push(n+" = Opal.to_a(",e.$expr(e.$rhs()["$[]"](1)),")"),e.$compile_masgn(e.$lhs().$children(),n),e.$push(", "+n)):e.$raise("unsupported mlhs type"),e.$scope().$queue_temp(n)},a.$$arity=0),e.defn(u,"$compile_masgn",$=function(e,t,n){var r,i,a,s,$,l,u,c=this,p=o,d=o,f=o,h=o,_=o;return null==n&&(n=o),p=(r=(i=e).$take_while,r.$$p=(a=function(e){a.$$s;return null==e&&(e=o),e.$type()["$!="]("splat")},a.$$s=c,a.$$arity=1,a),r).call(i),d=e.$drop(p.$size()),(r=(s=p).$each_with_index,r.$$p=($=function(e,r){var i=$.$$s||this;return null==e&&(e=o),null==r&&(r=o),i.$compile_assignment(e,t,r,n)},$.$$s=c,$.$$arity=2,$),r).call(s),(r=d["$empty?"]())===o||null==r||r.$$is_boolean&&1!=r?(f=d.$shift(),(r=d["$empty?"]())===o||null==r||r.$$is_boolean&&1!=r?(_=c.$scope().$new_temp(),c.$push(", "+_+" = "+t+".length - "+d.$size()),c.$push(", "+_+" = ("+_+" < "+p.$size()+") ? "+p.$size()+" : "+_),(r=h=f["$[]"](1))===o||null==r||r.$$is_boolean&&1!=r||(h=h.$dup()["$<<"](c.$s("js_tmp","$slice.call("+t+", "+p.$size()+", "+_+")")),c.$push(", "),c.$push(c.$expr(h))),(r=(l=d).$each_with_index,r.$$p=(u=function(e,n){var r=u.$$s||this;return null==e&&(e=o),null==n&&(n=o),n["$=="](0)?r.$compile_assignment(e,t,_):r.$compile_assignment(e,t,_+" + "+n)},u.$$s=c,u.$$arity=2,u),r).call(l),c.$scope().$queue_temp(_)):(r=h=f["$[]"](1))===o||null==r||r.$$is_boolean&&1!=r?o:(h=h.$dup()["$<<"](c.$s("js_tmp","$slice.call("+t+", "+p.$size()+")")),c.$push(", "),c.$push(c.$expr(h)))):o},$.$$arity=-3),e.defn(u,"$compile_assignment",l=function(e,t,r,i){var a,s,$=this,l=o,u=o,p=o;if(null==i&&(i=o),l=(a=!1!==(s=i["$!"]())&&s!==o&&null!=s?s:n(r,i))===o||null==a||a.$$is_boolean&&1!=a?$.$s("js_tmp",t+"["+r+"]"):$.$s("js_tmp","("+t+"["+r+"] == null ? nil : "+t+"["+r+"])"),u=e.$dup(),(a=c.get("SIMPLE_ASSIGNMENT")["$include?"](e.$type()))===o||null==a||a.$$is_boolean&&1!=a)if(e.$type()["$=="]("call"))u["$[]="](2,(u["$[]"](2)+"=").$to_sym()),u.$last()["$<<"](l);else if(e.$type()["$=="]("attrasgn"))u.$last()["$<<"](l);else{if(e.$type()["$=="]("array"))return p=$.$scope().$new_temp(),$.$push(", ("+p+" = Opal.to_ary("+l["$[]"](1)+")"),$.$compile_masgn(e.$children(),p),$.$push(")"),$.$scope().$queue_temp(p),o;$.$raise("Bad child node in masgn LHS: "+e+". LHS: "+$.$lhs())}else u["$<<"](l);return $.$push(", "),$.$push($.$expr(u))},l.$$arity=-4)}(l.base,l.get("Base"))}(l.base)}(i.base)},Opal.modules["opal/nodes/arglist"]=function(e){var t=e.top,n=e,r=e.nil,i=(e.breaker,e.slice,e.module),o=e.klass;return e.add_stubs(["$require","$handle","$each","$==","$first","$expr","$empty?","$<<","$fragment","$children","$push"]),t.$require("opal/nodes/base"),function(t){var n,a=n=i(t,"Opal"),s=(a.$$proto,a.$$scope);!function(t){var n,a=n=i(t,"Nodes"),s=(a.$$proto,a.$$scope);!function(t,$super){function n(){}var i,a=n=o(t,$super,"ArglistNode",n);a.$$proto,a.$$scope;a.$handle("arglist"),e.defn(a,"$compile",i=function(){var t,n,i,o=this,a=r,s=r,$=r;return t=[[],[]],a=t[0],s=t[1],(t=(n=o.$children()).$each,t.$$p=(i=function(e){var t,n=i.$$s||this,o=r,$=r;return null==e&&(e=r),o=e.$first()["$=="]("splat"),$=n.$expr(e),!1!==o&&o!==r&&null!=o?((t=s["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?((t=a["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?a["$<<"](n.$fragment(".concat(["))["$<<"](s)["$<<"](n.$fragment("])")):a["$<<"](n.$fragment("["))["$<<"](s)["$<<"](n.$fragment("]")),a["$<<"](n.$fragment(".concat("))["$<<"]($)["$<<"](n.$fragment(")"))):(t=a["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?a["$<<"](n.$fragment(".concat("))["$<<"]($)["$<<"](n.$fragment(")")):a["$<<"]($),s=[]):(((t=s["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t)&&s["$<<"](n.$fragment(", ")),s["$<<"]($))},i.$$s=o,i.$$arity=1,i),t).call(n),((t=s["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t)&&($=s,(t=a["$empty?"]())===r||null==t||t.$$is_boolean&&1!=t?a["$<<"](o.$fragment(".concat("))["$<<"]($)["$<<"](o.$fragment(")")):a=$),(t=o).$push.apply(t,e.to_a(a))},i.$$arity=0)}(s.base,s.get("Base"))}(s.base)}(n.base)},Opal.modules["opal/nodes"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("opal/nodes/base"),t.$require("opal/nodes/literal"),t.$require("opal/nodes/variables"),t.$require("opal/nodes/constants"),t.$require("opal/nodes/call"),t.$require("opal/nodes/call_special"),t.$require("opal/nodes/module"),t.$require("opal/nodes/class"),t.$require("opal/nodes/singleton_class"),t.$require("opal/nodes/inline_args"),t.$require("opal/nodes/args/normarg"),t.$require("opal/nodes/args/optarg"),t.$require("opal/nodes/args/mlhsarg"),t.$require("opal/nodes/args/restarg"),t.$require("opal/nodes/args/kwarg"),t.$require("opal/nodes/args/kwoptarg"),t.$require("opal/nodes/args/kwrestarg"),t.$require("opal/nodes/args/post_kwargs"),t.$require("opal/nodes/args/post_args"),t.$require("opal/nodes/iter"),t.$require("opal/nodes/def"),t.$require("opal/nodes/if"),t.$require("opal/nodes/logic"),t.$require("opal/nodes/definitions"),t.$require("opal/nodes/yield"),t.$require("opal/nodes/rescue"),t.$require("opal/nodes/case"),t.$require("opal/nodes/super"),t.$require("opal/nodes/top"),t.$require("opal/nodes/while"),t.$require("opal/nodes/for"),t.$require("opal/nodes/hash"),t.$require("opal/nodes/array"),t.$require("opal/nodes/defined"),t.$require("opal/nodes/masgn"),t.$require("opal/nodes/arglist")},Opal.modules["opal/compiler"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var r=e.top,i=e,o=e.nil,a=(e.breaker,e.slice,e.module),s=e.hash2,$=e.klass
35
- ;return e.add_stubs(["$require","$compile","$new","$[]","$define_method","$fetch","$!","$include?","$raise","$+","$inspect","$compiler_option","$attr_reader","$attr_accessor","$parse","$file","$message","$backtrace","$s","$eof_content","$lexer","$flatten","$process","$join","$map","$to_proc","$class","$warn","$<<","$helpers","$new_temp","$queue_temp","$push_while","$pop_while","$==","$in_while?","$fragment","$scope","$handlers","$type","$compile_to_fragments","$returns","$===","$pop","$[]=","$>","$length","$=~","$source=","$source","$uses_block!","$block_name","$find_parent_def"]),r.$require("set"),r.$require("opal/parser"),r.$require("opal/fragment"),r.$require("opal/nodes"),function(r){var i,l,u=i=a(r,"Opal"),c=(u.$$proto,u.$$scope);e.defs(u,"$compile",l=function(e,t){return null==t&&(t=s([],{})),c.get("Compiler").$new(e,t).$compile()},l.$$arity=-2),function(r,$super){function i(){}var a,l,u,c,p,d,f,h,_,g,m,y,v,b,w,x,k,E,C,T,O,S,N,A,R,P,M,I,D,L=i=$(r,$super,"Compiler",i),j=L.$$proto,q=L.$$scope;j.parser=j.source=j.sexp=j.fragments=j.helpers=j.operator_helpers=j.method_calls=j.indent=j.unique=j.scope=j.in_ensure=j.break_detected=j.case_stmt=j.handlers=j.requires=j.required_trees=o,e.cdecl(q,"INDENT"," "),e.cdecl(q,"COMPARE",["<",">","<=",">="]),e.defs(L,"$compiler_option",a=function(e,n,r){var i,a,$,l,u=this,c=o,p=o;return null==r&&(r=s([],{})),c=r["$[]"]("as"),p=r["$[]"]("valid_values"),(i=(a=u).$define_method,i.$$p=($=function(){var r,i,a,s=$.$$s||this,l=o;return null==s.options&&(s.options=o),l=(r=(i=s.options).$fetch,r.$$p=(a=function(){a.$$s;return n},a.$$s=s,a.$$arity=0,a),r).call(i,e),(r=!1!==p&&p!==o&&null!=p?p["$include?"](l)["$!"]():p)===o||null==r||r.$$is_boolean&&1!=r||s.$raise(q.get("ArgumentError"),t("invalid value "+l.$inspect()+" for option "+e.$inspect()+" ","(valid values: "+p.$inspect()+")")),l},$.$$s=u,$.$$arity=0,$),i).call(a,!1!==(l=c)&&l!==o&&null!=l?l:e)},a.$$arity=-3),L.$compiler_option("file","(file)"),L.$compiler_option("method_missing",!0,s(["as"],{as:"method_missing?"})),L.$compiler_option("arity_check",!1,s(["as"],{as:"arity_check?"})),L.$compiler_option("freezing",!0,s(["as"],{as:"freezing?"})),L.$compiler_option("tainting",!0,s(["as"],{as:"tainting?"})),L.$compiler_option("irb",!1,s(["as"],{as:"irb?"})),L.$compiler_option("dynamic_require_severity","warning",s(["valid_values"],{valid_values:["error","warning","ignore"]})),L.$compiler_option("requirable",!1,s(["as"],{as:"requirable?"})),L.$compiler_option("inline_operators",!0,s(["as"],{as:"inline_operators?"})),L.$compiler_option("eval",!1,s(["as"],{as:"eval?"})),L.$attr_reader("result"),L.$attr_reader("fragments"),L.$attr_accessor("scope"),L.$attr_reader("case_stmt"),L.$attr_reader("eof_content"),e.defn(L,"$initialize",l=function(e,t){var n=this;return null==t&&(t=s([],{})),n.source=e,n.indent="",n.unique=0,n.options=t},l.$$arity=-2),e.defn(L,"$compile",u=function(){var t,n,r=this,i=o,a=o,s=o;try{return r.parser=q.get("Parser").$new(),i=function(){try{return r.parser.$parse(r.source,r.$file())}catch(t){if(!e.rescue(t,[q.get("StandardError")]))throw t;a=t;try{return r.$raise(q.get("SyntaxError"),a.$message(),a.$backtrace())}finally{e.pop_exception()}}}(),r.sexp=r.$s("top",!1!==(t=i)&&t!==o&&null!=t?t:r.$s("nil")),r.eof_content=r.parser.$lexer().$eof_content(),r.fragments=r.$process(r.sexp).$flatten(),r.result=(t=(n=r.fragments).$map,t.$$p="code".$to_proc(),t).call(n).$join("")}catch(t){if(!e.rescue(t,[q.get("Exception")]))throw t;a=t;try{return s="An error occurred while compiling: "+r.$file()+"\n"+a.$message(),r.$raise(a.$class(),s,a.$backtrace())}finally{e.pop_exception()}}},u.$$arity=0),e.defn(L,"$source_map",c=function(e){var t,n=this;return null==e&&(e=o),q.get("Opal").$$scope.get("SourceMap").$new(n.fragments,!1!==(t=e)&&t!==o&&null!=t?t:n.$file())},c.$$arity=-1),e.defn(L,"$helpers",p=function(){var e,t=this;return!1!==(e=t.helpers)&&e!==o&&null!=e?e:t.helpers=q.get("Set").$new(["breaker","slice"])},p.$$arity=0),e.defn(L,"$operator_helpers",d=function(){var e,t=this;return!1!==(e=t.operator_helpers)&&e!==o&&null!=e?e:t.operator_helpers=q.get("Set").$new()},d.$$arity=0),e.defn(L,"$method_calls",f=function(){var e,t=this;return!1!==(e=t.method_calls)&&e!==o&&null!=e?e:t.method_calls=q.get("Set").$new()},f.$$arity=0),e.defn(L,"$error",h=function(e,t){var n=this;return null==t&&(t=o),n.$raise(q.get("SyntaxError"),e+" :"+n.$file()+":"+t)},h.$$arity=-2),e.defn(L,"$warning",_=function(e,t){var n=this;return null==t&&(t=o),n.$warn("WARNING: "+e+" -- "+n.$file()+":"+t)},_.$$arity=-2),e.defn(L,"$parser_indent",g=function(){return this.indent},g.$$arity=0),e.defn(L,"$s",m=function(){var e,t=arguments.length,n=t-0;n<0&&(n=0),e=new Array(n);for(var r=0;r<t;r++)e[r-0]=arguments[r];return q.get("Sexp").$new(e)},m.$$arity=-1),e.defn(L,"$fragment",y=function(e,t,n){return null==n&&(n=o),q.get("Fragment").$new(e,t,n)},y.$$arity=-3),e.defn(L,"$unique_temp",v=function(){var e=this;return"TMP_"+(e.unique=t(e.unique,1))},v.$$arity=0),e.defn(L,"$helper",b=function(e){return this.$helpers()["$<<"](e)},b.$$arity=1),e.defn(L,"$indent",w=function(){var n=this,r=w.$$p,i=r||o,a=o,s=o;return w.$$p=null,a=n.indent,n.indent=t(n.indent,q.get("INDENT")),n.space="\n"+n.indent,s=e.yieldX(i,[]),n.indent=a,n.space="\n"+n.indent,s},w.$$arity=0),e.defn(L,"$with_temp",x=function(){var t=this,n=x.$$p,r=n||o,i=o,a=o;return x.$$p=null,i=t.scope.$new_temp(),a=e.yield1(r,i),t.scope.$queue_temp(i),a},x.$$arity=0),e.defn(L,"$in_while",k=function(){var t=this,n=k.$$p,r=n||o,i=o;return k.$$p=null,r===o?o:(t.while_loop=t.scope.$push_while(),i=e.yieldX(r,[]),t.scope.$pop_while(),i)},k.$$arity=0),e.defn(L,"$in_ensure",E=function(){var t=this,n=E.$$p,r=n||o,i=o;return E.$$p=null,r===o?o:(t.in_ensure=!0,i=e.yieldX(r,[]),t.in_ensure=!1,i)},E.$$arity=0),e.defn(L,"$in_ensure?",C=function(){return this.in_ensure},C.$$arity=0),e.defn(L,"$has_break?",T=function(){var t=this,n=T.$$p,r=n||o,i=o;return T.$$p=null,r===o?t.break_detected:(t.break_detected=!1,e.yieldX(r,[]),i=t.break_detected,t.break_detected=o,i)},T.$$arity=0),e.defn(L,"$has_break!",O=function(){var e=this;return e.break_detected["$=="](!1)?e.break_detected=!0:o},O.$$arity=0),e.defn(L,"$in_case",S=function(){var t=this,n=S.$$p,r=n||o,i=o;return S.$$p=null,r===o?o:(i=t.case_stmt,t.case_stmt=s([],{}),e.yieldX(r,[]),t.case_stmt=i)},S.$$arity=0),e.defn(L,"$in_while?",N=function(){return this.scope["$in_while?"]()},N.$$arity=0),e.defn(L,"$process",A=function(e,t){var n,r=this,i=o;return null==t&&(t="expr"),e["$=="](o)?r.$fragment("",r.$scope()):(n=i=r.$handlers()["$[]"](e.$type()))===o||null==n||n.$$is_boolean&&1!=n?r.$raise("Unsupported sexp: "+e.$type()):i.$new(e,t,r).$compile_to_fragments()},A.$$arity=-2),e.defn(L,"$handlers",R=function(){var e,t=this;return!1!==(e=t.handlers)&&e!==o&&null!=e?e:t.handlers=q.get("Opal").$$scope.get("Nodes").$$scope.get("Base").$handlers()},R.$$arity=0),e.defn(L,"$requires",P=function(){var e,t=this;return!1!==(e=t.requires)&&e!==o&&null!=e?e:t.requires=[]},P.$$arity=0),e.defn(L,"$required_trees",M=function(){var e,t=this;return!1!==(e=t.required_trees)&&e!==o&&null!=e?e:t.required_trees=[]},M.$$arity=0),e.defn(L,"$returns",I=function(e){var t,r,i=this,a=o,s=o,$=o;return!1===e||e===o||null==e?i.$returns(i.$s("nil")):function(){return a=e.$type(),"undef"["$==="](a)?(s=e.$pop(),e["$<<"](i.$returns(s))):"break"["$==="](a)||"next"["$==="](a)||"redo"["$==="](a)?e:"yield"["$==="](a)?(e["$[]="](0,"returnable_yield"),e):"scope"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"block"["$==="](a)?((t=n(e.$length(),1))===o||null==t||t.$$is_boolean&&1!=t?e["$<<"](i.$returns(i.$s("nil"))):e["$[]="](-1,i.$returns(e["$[]"](-1))),e):"when"["$==="](a)?(e["$[]="](2,i.$returns(e["$[]"](2))),e):"rescue"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),r=e["$[]"](2),(t=!1!==r&&r!==o&&null!=r?e["$[]"](2)["$[]"](0)["$=="]("resbody"):r)===o||null==t||t.$$is_boolean&&1!=t||((t=e["$[]"](2)["$[]"](2))===o||null==t||t.$$is_boolean&&1!=t?e["$[]"](2)["$[]="](2,i.$returns(i.$s("nil"))):e["$[]"](2)["$[]="](2,i.$returns(e["$[]"](2)["$[]"](2)))),e):"ensure"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"begin"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"rescue_mod"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e["$[]="](2,i.$returns(e["$[]"](2))),e):"while"["$==="](a)?e:"return"["$==="](a)||"js_return"["$==="](a)?e:"xstr"["$==="](a)?(((t=/return|;/["$=~"](e["$[]"](1)))===o||null==t||t.$$is_boolean&&1!=t)&&e["$[]="](1,"return "+e["$[]"](1)+";"),e):"dxstr"["$==="](a)?(((t=/return|;|\n/["$=~"](e["$[]"](1)))===o||null==t||t.$$is_boolean&&1!=t)&&e["$[]="](1,"return "+e["$[]"](1)),e):"if"["$==="](a)?(e["$[]="](2,i.$returns(!1!==(t=e["$[]"](2))&&t!==o&&null!=t?t:i.$s("nil"))),e["$[]="](3,i.$returns(!1!==(t=e["$[]"](3))&&t!==o&&null!=t?t:i.$s("nil"))),e):($=i.$s("js_return",e),t=[e.$source()],r=$,r["$source="].apply(r,t),t[t.length-1],$)}()},I.$$arity=1),e.defn(L,"$handle_block_given_call",D=function(e){var t,n,r=this,i=o;return r.scope["$uses_block!"](),(t=r.scope.$block_name())===o||null==t||t.$$is_boolean&&1!=t?(n=i=r.scope.$find_parent_def(),(t=!1!==n&&n!==o&&null!=n?i.$block_name():n)===o||null==t||t.$$is_boolean&&1!=t?r.$fragment("false",i,e):r.$fragment("("+i.$block_name()+" !== nil)",i,e)):r.$fragment("("+r.scope.$block_name()+" !== nil)",r.$scope(),e)},D.$$arity=1)}(c.base,null)}(i.base)},Opal.modules["active_support/core_ext/array/wrap"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.klass);return e.add_stubs(["$nil?","$respond_to?","$to_ary"]),function(t,$super){function i(){}var o,a=i=r(t,$super,"Array",i);a.$$proto,a.$$scope;return e.defs(a,"$wrap",o=function(e){var t;return(t=e["$nil?"]())===n||null==t||t.$$is_boolean&&1!=t?(t=e["$respond_to?"]("to_ary"))===n||null==t||t.$$is_boolean&&1!=t?[e]:!1!==(t=e.$to_ary())&&t!==n&&null!=t?t:[e]:[]},o.$$arity=1),n&&"wrap"}(t.base,null)},Opal.modules["active_support/core_ext/array/grouping"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function i(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var o=(e.top,e),a=e.nil,s=(e.breaker,e.slice,e.klass);return e.add_stubs(["$==","$%","$-","$size","$concat","$dup","$*","$each_slice","$<<","$div","$times","$+","$>","$slice","$!=","$each","$inject","$call","$last"]),function(o,$super){function $(){}var l,u,c,p=$=s(o,$super,"Array",$);p.$$proto,p.$$scope;return e.defn(p,"$in_groups_of",l=function(r,i){var o,s,$,u,c,p=this,d=l.$$p,f=d||a,h=a,_=a,g=a;return null==i&&(i=a),l.$$p=null,i["$=="](!1)?h=p:(_=t(r,p.$size()["$%"](r))["$%"](r),h=p.$dup().$concat(n([i],_))),f!==a?(o=(s=h).$each_slice,o.$$p=($=function(t){$.$$s;return null==t&&(t=a),e.yield1(f,t)},$.$$s=p,$.$$arity=1,$),o).call(s,r):(g=[],(o=(u=h).$each_slice,o.$$p=(c=function(e){c.$$s;return null==e&&(e=a),g["$<<"](e)},c.$$s=p,c.$$arity=1,c),o).call(u,r),g)},l.$$arity=-2),e.defn(p,"$in_groups",u=function(t,n){var o,s,$,l,c,p=this,d=u.$$p,f=d||a,h=a,_=a,g=a,m=a;return null==n&&(n=a),u.$$p=null,h=p.$size().$div(t),_=p.$size()["$%"](t),g=[],m=0,(o=(s=t).$times,o.$$p=($=function(e){var t,o,s,l=$.$$s||this,u=a,c=a;return null==e&&(e=a),u=r(h,function(){return o=i(_,0),(t=!1!==o&&o!==a&&null!=o?i(_,e):o)===a||null==t||t.$$is_boolean&&1!=t?0:1}()),g["$<<"](c=l.$slice(m,u)),s=n["$!="](!1),o=!1!==s&&s!==a&&null!=s?i(_,0):s,(t=!1!==o&&o!==a&&null!=o?u["$=="](h):o)===a||null==t||t.$$is_boolean&&1!=t||c["$<<"](n),m=r(m,u)},$.$$s=p,$.$$arity=1,$),o).call(s),f!==a?(o=(l=g).$each,o.$$p=(c=function(t){c.$$s;return null==t&&(t=a),e.yield1(f,t)},c.$$s=p,c.$$arity=1,c),o).call(l):g},u.$$arity=-2),e.defn(p,"$split",c=function(e){var t,n,r,i=this,o=c.$$p,s=o||a;return null==e&&(e=a),c.$$p=null,(t=(n=i).$inject,t.$$p=(r=function(t,n){var i,o;r.$$s;return null==t&&(t=a),null==n&&(n=a),(i=!1!==(o=!1!==s&&s!==a&&null!=s?s.$call(n):s)&&o!==a&&null!=o?o:e["$=="](n))===a||null==i||i.$$is_boolean&&1!=i?t.$last()["$<<"](n):t["$<<"]([]),t},r.$$s=i,r.$$arity=2,r),t).call(n,[[]])},c.$$arity=-1),a&&"split"}(o.base,null)},Opal.modules["active_support/core_ext/array"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/array/extract_options"),t.$require("active_support/core_ext/array/wrap"),t.$require("active_support/core_ext/array/grouping")},Opal.modules["active_support/core_ext/class"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/class/attribute")},Opal.modules["active_support/core_ext/enumerable"]=function(e){var t=(e.top,e),n=e.nil,r=e.breaker,i=(e.slice,e.module);return e.add_stubs(["$enum_for","$new","$destructure","$[]="]),function(t){var o,a,s=o=i(t,"Enumerable"),$=(s.$$proto,s.$$scope);e.defn(s,"$index_by",a=function(){var e=this,t=a.$$p,i=t||n,o=n;if(a.$$p=null,i===n)return e.$enum_for("index_by");o=$.get("Hash").$new();var s;return e.$each._p=function(){var e=$.get("Opal").$destructure(arguments),t=$opal.$yield1(i,e);if(t===r)return s=r.$v,r;o["$[]="](t,e)},e.$each(),s!==undefined?s:o},a.$$arity=0)}(t.base)},Opal.modules["active_support/core_ext/hash"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/hash/indifferent_access")},Opal.modules["active_support/core_ext/numeric/time"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}var i=(e.top,e),o=(e.nil,e.breaker,e.slice,e.klass);return e.add_stubs(["$*","$hours","$days","$weeks","$-","$current","$+"]),function(i,$super){function a(){}var s,$,l,u,c,p,d,f,h=a=o(i,$super,"Numeric",a);h.$$proto,h.$$scope;return e.defn(h,"$seconds",s=function(){return this},s.$$arity=0),e.alias(h,"second","seconds"),e.defn(h,"$minutes",$=function(){return t(this,60)},$.$$arity=0),e.alias(h,"minute","minutes"),e.defn(h,"$hours",l=function(){return t(this,3600)},l.$$arity=0),e.alias(h,"hour","hours"),e.defn(h,"$days",u=function(){return t(this,24..$hours())},u.$$arity=0),e.alias(h,"day","days"),e.defn(h,"$weeks",c=function(){return t(this,7..$days())},c.$$arity=0),e.alias(h,"week","weeks"),e.defn(h,"$fortnights",p=function(){return t(this,2..$weeks())},p.$$arity=0),e.alias(h,"fortnight","fortnights"),e.defn(h,"$ago",d=function(t){var r=this;return null==t&&(t=e.get("Time").$current()),n(t,r)},d.$$arity=-1),e.alias(h,"until","ago"),e.defn(h,"$since",f=function(t){var n=this;return null==t&&(t=e.get("Time").$current()),r(t,n)},f.$$arity=-1),e.alias(h,"from_now","since")}(i.base,null)},Opal.modules["active_support/core_ext/integer/time"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}var n=e.top,r=e,i=(e.nil,e.breaker,e.slice,e.klass);return e.add_stubs(["$require","$*","$days"]),n.$require("active_support/core_ext/numeric/time"),function(n,$super){function r(){}var o,a,s=r=i(n,$super,"Numeric",r);s.$$proto,s.$$scope;return e.defn(s,"$months",o=function(){return t(this,30..$days())},o.$$arity=0),e.alias(s,"month","months"),e.defn(s,"$years",a=function(){return t(this,365.25.$days())},a.$$arity=0),e.alias(s,"year","years")}(r.base,null)},Opal.modules["active_support/core_ext/integer"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/integer/time")},Opal.modules["active_support/core_ext/kernel"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/kernel/singleton_class")},Opal.modules["active_support/core_ext/module/introspection"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}var n=e.top,r=e,i=e.nil,o=(e.breaker,e.slice,e.klass),a=e.gvars;return e.add_stubs(["$require","$=~","$name","$freeze","$parent_name","$constantize","$split","$empty?","$<<","$*","$pop","$include?","$constants"]),n.$require("active_support/inflector"),function(n,$super){function r(){}var s,$,l,u,c=r=o(n,$super,"Module",r),p=c.$$proto,d=c.$$scope;return p.parent_name=i,e.defn(c,"$parent_name",s=function(){var e,t,n=this;return(e=null!=(t=n.parent_name)&&t!==i?"instance-variable":i)===i||null==e||e.$$is_boolean&&1!=e?n.parent_name=function(){return(e=n.$name()["$=~"](/::[^:]+$/))===i||null==e||e.$$is_boolean&&1!=e?i:((e=a["~"])===i?i:e.$pre_match()).$freeze()}():n.parent_name},s.$$arity=0),e.defn(c,"$parent",$=function(){var e,t=this;return(e=t.$parent_name())===i||null==e||e.$$is_boolean&&1!=e?d.get("Object"):d.get("ActiveSupport").$$scope.get("Inflector").$constantize(t.$parent_name())},$.$$arity=0),e.defn(c,"$parents",l=function(){var e,n,r=this,o=i,a=i;if(o=[],(e=r.$parent_name())!==i&&null!=e&&(!e.$$is_boolean||1==e))for(a=r.$parent_name().$split("::");(n=a["$empty?"]())===i||null==n||n.$$is_boolean&&1!=n;)o["$<<"](d.get("ActiveSupport").$$scope.get("Inflector").$constantize(t(a,"::"))),a.$pop();return((e=o["$include?"](d.get("Object")))===i||null==e||e.$$is_boolean&&1!=e)&&o["$<<"](d.get("Object")),o},l.$$arity=0),e.defn(c,"$local_constants",u=function(){return this.$constants(!1)},u.$$arity=0),i&&"local_constants"}(r.base,null)},Opal.modules["active_support/core_ext/module/delegation"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}var n=(e.top,e),r=e.nil,i=(e.breaker,e.slice,e.klass),o=e.range;return e.add_stubs(["$pop","$is_a?","$[]","$raise","$values_at","$==","$=~","$to_s","$each","$+","$lambda","$start_with?","$__send__","$new","$inspect","$define_method","$to_proc"]),function(n,$super){function a(){}var s,$=a=i(n,$super,"Module",a),l=($.$$proto,$.$$scope);return function(e,$super){function t(){}var n=t=i(e,$super,"DelegationError",t);n.$$proto,n.$$scope}(l.base,l.get("NoMethodError")),e.defn($,"$delegate",s=function(){var n,i,a,s,$=this,u=r,c=r,p=r,d=r,f=r,h=arguments.length,_=h-0;_<0&&(_=0),s=new Array(_);for(var g=0;g<h;g++)s[g-0]=arguments[g];return u=s.$pop(),i=u["$is_a?"](l.get("Hash")),((n=!1!==i&&i!==r&&null!=i?c=u["$[]"]("to"):i)===r||null==n||n.$$is_boolean&&1!=n)&&$.$raise(l.get("ArgumentError"),"Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, to: :greeter)."),i=u.$values_at("prefix","allow_nil"),n=e.to_ary(i),p=null==n[0]?r:n[0],d=null==n[1]?r:n[1],(n=(i=p["$=="](!0))?c["$=~"](/^[^a-z_]/):p["$=="](!0))===r||null==n||n.$$is_boolean&&1!=n||$.$raise(l.get("ArgumentError"),"Can only automatically set the delegation prefix when delegating to a method."),f=function(){return!1!==p&&p!==r&&null!=p?function(){return p["$=="](!0)?c:p}()+"_":""}(),c=c.$to_s(),(n=(i=s).$each,n.$$p=(a=function(n){var i,s,$,u,p,h,_,g,m,y=a.$$s||this,v=r,b=r,w=r,x=r;return null==n&&(n=r),v=function(){return!!((i=n["$=~"](/[^\]]=$/))===r||null==i||i.$$is_boolean&&1!=i)}(),b=t(f,n),w=(i=(s=y).$lambda,i.$$p=($=function(e){var t,n=($.$$s,r);return null==e&&(e=r),(t=c["$start_with?"]("@"))===r||null==t||t.$$is_boolean&&1!=t?e.$__send__(c):(n=c["$[]"](o(1,-1,!1)),e[n])},$.$$s=y,$.$$arity=1,$),i).call(s),x=(i=(u=y).$lambda,i.$$p=(p=function(e){p.$$s;return null==e&&(e=r),l.get("DelegationError").$new(""+e+b+" delegated to "+c+"."+n+" but "+c+" is nil: "+e.$inspect(),b)},p.$$s=y,p.$$arity=1,p),i).call(u),!1!==v&&v!==r&&null!=v?(i=(h=y).$define_method,i.$$p=(_=function(){var t,i,o,a,s=_.$$s||this,$=r;t=_.$$p||r,_.$$p=null;var l=arguments.length,u=l-0;u<0&&(u=0),i=new Array(u);for(var c=0;c<l;c++)i[c-0]=arguments[c];if(!1!==($=w["$[]"](s))&&$!==r&&null!=$);else{if(!1!==d&&d!==r&&null!=d)return r;s.$raise(x["$[]"](s))}return(o=(a=$).$__send__,o.$$p=t.$to_proc(),o).apply(a,[n].concat(e.to_a(i)))},_.$$s=y,_.$$arity=-1,_),i).call(h,b):(i=(g=y).$define_method,i.$$p=(m=function(e){var t=m.$$s||this,i=r;if(null==e&&(e=r),!1!==(i=w["$[]"](t))&&i!==r&&null!=i);else{if(!1!==d&&d!==r&&null!=d)return r;t.$raise(x["$[]"](t))}return i.$__send__(n,e)},m.$$s=y,m.$$arity=1,m),i).call(g,b)},a.$$s=$,a.$$arity=1,a),n).call(i)},s.$$arity=-1),r&&"delegate"}(n.base,null)},Opal.modules["active_support/core_ext/module"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/module/introspection"),t.$require("active_support/core_ext/module/remove_method"),t.$require("active_support/core_ext/module/delegation")},Opal.modules["active_support/core_ext/numeric/calculations"]=function(e){var t=(e.top,e);e.nil,e.breaker,e.slice;return function(t){t.$$scope,t.$$proto;return e.alias(t,"current","now")}(e.get_singleton_class(t.get("Time")))},Opal.modules["active_support/core_ext/numeric"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/numeric/time"),t.$require("active_support/core_ext/numeric/calculations")},Opal.modules["active_support/core_ext/object/blank"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.klass);return e.add_stubs(["$respond_to?","$empty?","$!","$blank?","$present?","$==","$alias_method","$!~"]),function(t,$super){function i(){}var o,a,s,$=i=r(t,$super,"Object",i);$.$$proto,$.$$scope;e.defn($,"$blank?",o=function(){var e,t=this;return(e=t["$respond_to?"]("empty?"))===n||null==e||e.$$is_boolean&&1!=e?t["$!"]():t["$empty?"]()},o.$$arity=0),e.defn($,"$present?",a=function(){return this["$blank?"]()["$!"]()},a.$$arity=0),e.defn($,"$presence",s=function(){var e,t=this;return(e=t["$present?"]())===n||null==e||e.$$is_boolean&&1!=e?n:t},s.$$arity=0)}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"NilClass",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return!0},i.$$arity=0)}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"Boolean",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return this["$=="](!1)},i.$$arity=0)}(t.base,null),function(e,$super){function t(){}var n=t=r(e,$super,"Array",t);n.$$proto,n.$$scope;n.$alias_method("blank?","empty?")}(t.base,null),function(e,$super){function t(){}var n=t=r(e,$super,"Hash",t);n.$$proto,n.$$scope;n.$alias_method("blank?","empty?")}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"String",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return this["$!~"](/[^\s\u3000]/)},i.$$arity=0)}(t.base,null),function(t,$super){function i(){}var o,a=i=r(t,$super,"Numeric",i);a.$$proto,a.$$scope;return e.defn(a,"$blank?",o=function(){return!1},o.$$arity=0),n&&"blank?"}(t.base,null)},Opal.modules["active_support/core_ext/object"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/object/blank"),t.$require("active_support/core_ext/object/try")},Opal.modules["active_support/core_ext"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/array"),t.$require("active_support/core_ext/class"),t.$require("active_support/core_ext/enumerable"),t.$require("active_support/core_ext/hash"),t.$require("active_support/core_ext/integer"),t.$require("active_support/core_ext/kernel"),t.$require("active_support/core_ext/module"),t.$require("active_support/core_ext/numeric"),t.$require("active_support/core_ext/object"),t.$require("active_support/core_ext/string")},Opal.modules.active_support=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext")},Opal.modules.securerandom=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.module);return e.add_stubs(["$gsub"]),function(t){var i,o,a=i=r(t,"SecureRandom");a.$$proto,a.$$scope;e.defs(a,"$uuid",o=function(){var e,t,r,i=this;return(e=(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").$gsub,e.$$p=(r=function(e){r.$$s;null==e&&(e=n);var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)},r.$$s=i,r.$$arity=1,r.$$has_trailing_comma_in_args=!0,r),e).call(t,/[xy]/)},o.$$arity=0)}(t.base)},Opal.modules["hyperloop/console/evaluate"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.klass),i=e.hash2;return e.add_stubs(["$param","$dispatch_to"]),function(e,$super){function t(){}var o,a,s,$=t=r(e,$super,"Evaluate",t),l=($.$$proto,$.$$scope);$.$param(i(["acting_user","nils"],{acting_user:n,nils:!0})),$.$param("target_id"),$.$param("sender_id"),$.$param("context"),$.$param(i(["string"],{string:n})),(o=(a=$).$dispatch_to,o.$$p=(s=function(){s.$$s;return l.get("Hyperloop").$$scope.get("Application")},s.$$s=$,s.$$arity=0,s),o).call(a)}(t.base,t.get("Hyperloop").$$scope.get("ServerOp")),function(e,$super){function t(){}var o,a,s,$=t=r(e,$super,"Response",t),l=($.$$proto,$.$$scope);return $.$param(i(["acting_user","nils"],{acting_user:n,nils:!0})),$.$param("target_id"),$.$param("kind"),$.$param("message"),(o=(a=$).$dispatch_to,o.$$p=(s=function(){s.$$s;return l.get("Hyperloop").$$scope.get("Application")},s.$$s=$,s.$$arity=0,s),o).call(a)}(t.base,t.get("Hyperloop").$$scope.get("ServerOp"))},
35
+ ;return e.add_stubs(["$require","$compile","$new","$[]","$define_method","$fetch","$!","$include?","$raise","$+","$inspect","$compiler_option","$attr_reader","$attr_accessor","$parse","$file","$message","$backtrace","$s","$eof_content","$lexer","$flatten","$process","$join","$map","$to_proc","$class","$warn","$<<","$helpers","$new_temp","$queue_temp","$push_while","$pop_while","$==","$in_while?","$fragment","$scope","$handlers","$type","$compile_to_fragments","$returns","$===","$pop","$[]=","$>","$length","$=~","$source=","$source","$uses_block!","$block_name","$find_parent_def"]),r.$require("set"),r.$require("opal/parser"),r.$require("opal/fragment"),r.$require("opal/nodes"),function(r){var i,l,u=i=a(r,"Opal"),c=(u.$$proto,u.$$scope);e.defs(u,"$compile",l=function(e,t){return null==t&&(t=s([],{})),c.get("Compiler").$new(e,t).$compile()},l.$$arity=-2),function(r,$super){function i(){}var a,l,u,c,p,d,f,h,_,g,m,y,v,b,w,x,k,E,C,T,O,S,N,A,R,P,M,I,D,L=i=$(r,$super,"Compiler",i),j=L.$$proto,q=L.$$scope;j.parser=j.source=j.sexp=j.fragments=j.helpers=j.operator_helpers=j.method_calls=j.indent=j.unique=j.scope=j.in_ensure=j.break_detected=j.case_stmt=j.handlers=j.requires=j.required_trees=o,e.cdecl(q,"INDENT"," "),e.cdecl(q,"COMPARE",["<",">","<=",">="]),e.defs(L,"$compiler_option",a=function(e,n,r){var i,a,$,l,u=this,c=o,p=o;return null==r&&(r=s([],{})),c=r["$[]"]("as"),p=r["$[]"]("valid_values"),(i=(a=u).$define_method,i.$$p=($=function(){var r,i,a,s=$.$$s||this,l=o;return null==s.options&&(s.options=o),l=(r=(i=s.options).$fetch,r.$$p=(a=function(){a.$$s;return n},a.$$s=s,a.$$arity=0,a),r).call(i,e),(r=!1!==p&&p!==o&&null!=p?p["$include?"](l)["$!"]():p)===o||null==r||r.$$is_boolean&&1!=r||s.$raise(q.get("ArgumentError"),t("invalid value "+l.$inspect()+" for option "+e.$inspect()+" ","(valid values: "+p.$inspect()+")")),l},$.$$s=u,$.$$arity=0,$),i).call(a,!1!==(l=c)&&l!==o&&null!=l?l:e)},a.$$arity=-3),L.$compiler_option("file","(file)"),L.$compiler_option("method_missing",!0,s(["as"],{as:"method_missing?"})),L.$compiler_option("arity_check",!1,s(["as"],{as:"arity_check?"})),L.$compiler_option("freezing",!0,s(["as"],{as:"freezing?"})),L.$compiler_option("tainting",!0,s(["as"],{as:"tainting?"})),L.$compiler_option("irb",!1,s(["as"],{as:"irb?"})),L.$compiler_option("dynamic_require_severity","warning",s(["valid_values"],{valid_values:["error","warning","ignore"]})),L.$compiler_option("requirable",!1,s(["as"],{as:"requirable?"})),L.$compiler_option("inline_operators",!0,s(["as"],{as:"inline_operators?"})),L.$compiler_option("eval",!1,s(["as"],{as:"eval?"})),L.$attr_reader("result"),L.$attr_reader("fragments"),L.$attr_accessor("scope"),L.$attr_reader("case_stmt"),L.$attr_reader("eof_content"),e.defn(L,"$initialize",l=function(e,t){var n=this;return null==t&&(t=s([],{})),n.source=e,n.indent="",n.unique=0,n.options=t},l.$$arity=-2),e.defn(L,"$compile",u=function(){var t,n,r=this,i=o,a=o,s=o;try{return r.parser=q.get("Parser").$new(),i=function(){try{return r.parser.$parse(r.source,r.$file())}catch(t){if(!e.rescue(t,[q.get("StandardError")]))throw t;a=t;try{return r.$raise(q.get("SyntaxError"),a.$message(),a.$backtrace())}finally{e.pop_exception()}}}(),r.sexp=r.$s("top",!1!==(t=i)&&t!==o&&null!=t?t:r.$s("nil")),r.eof_content=r.parser.$lexer().$eof_content(),r.fragments=r.$process(r.sexp).$flatten(),r.result=(t=(n=r.fragments).$map,t.$$p="code".$to_proc(),t).call(n).$join("")}catch(t){if(!e.rescue(t,[q.get("Exception")]))throw t;a=t;try{return s="An error occurred while compiling: "+r.$file()+"\n"+a.$message(),r.$raise(a.$class(),s,a.$backtrace())}finally{e.pop_exception()}}},u.$$arity=0),e.defn(L,"$source_map",c=function(e){var t,n=this;return null==e&&(e=o),q.get("Opal").$$scope.get("SourceMap").$new(n.fragments,!1!==(t=e)&&t!==o&&null!=t?t:n.$file())},c.$$arity=-1),e.defn(L,"$helpers",p=function(){var e,t=this;return!1!==(e=t.helpers)&&e!==o&&null!=e?e:t.helpers=q.get("Set").$new(["breaker","slice"])},p.$$arity=0),e.defn(L,"$operator_helpers",d=function(){var e,t=this;return!1!==(e=t.operator_helpers)&&e!==o&&null!=e?e:t.operator_helpers=q.get("Set").$new()},d.$$arity=0),e.defn(L,"$method_calls",f=function(){var e,t=this;return!1!==(e=t.method_calls)&&e!==o&&null!=e?e:t.method_calls=q.get("Set").$new()},f.$$arity=0),e.defn(L,"$error",h=function(e,t){var n=this;return null==t&&(t=o),n.$raise(q.get("SyntaxError"),e+" :"+n.$file()+":"+t)},h.$$arity=-2),e.defn(L,"$warning",_=function(e,t){var n=this;return null==t&&(t=o),n.$warn("WARNING: "+e+" -- "+n.$file()+":"+t)},_.$$arity=-2),e.defn(L,"$parser_indent",g=function(){return this.indent},g.$$arity=0),e.defn(L,"$s",m=function(){var e,t=arguments.length,n=t-0;n<0&&(n=0),e=new Array(n);for(var r=0;r<t;r++)e[r-0]=arguments[r];return q.get("Sexp").$new(e)},m.$$arity=-1),e.defn(L,"$fragment",y=function(e,t,n){return null==n&&(n=o),q.get("Fragment").$new(e,t,n)},y.$$arity=-3),e.defn(L,"$unique_temp",v=function(){var e=this;return"TMP_"+(e.unique=t(e.unique,1))},v.$$arity=0),e.defn(L,"$helper",b=function(e){return this.$helpers()["$<<"](e)},b.$$arity=1),e.defn(L,"$indent",w=function(){var n=this,r=w.$$p,i=r||o,a=o,s=o;return w.$$p=null,a=n.indent,n.indent=t(n.indent,q.get("INDENT")),n.space="\n"+n.indent,s=e.yieldX(i,[]),n.indent=a,n.space="\n"+n.indent,s},w.$$arity=0),e.defn(L,"$with_temp",x=function(){var t=this,n=x.$$p,r=n||o,i=o,a=o;return x.$$p=null,i=t.scope.$new_temp(),a=e.yield1(r,i),t.scope.$queue_temp(i),a},x.$$arity=0),e.defn(L,"$in_while",k=function(){var t=this,n=k.$$p,r=n||o,i=o;return k.$$p=null,r===o?o:(t.while_loop=t.scope.$push_while(),i=e.yieldX(r,[]),t.scope.$pop_while(),i)},k.$$arity=0),e.defn(L,"$in_ensure",E=function(){var t=this,n=E.$$p,r=n||o,i=o;return E.$$p=null,r===o?o:(t.in_ensure=!0,i=e.yieldX(r,[]),t.in_ensure=!1,i)},E.$$arity=0),e.defn(L,"$in_ensure?",C=function(){return this.in_ensure},C.$$arity=0),e.defn(L,"$has_break?",T=function(){var t=this,n=T.$$p,r=n||o,i=o;return T.$$p=null,r===o?t.break_detected:(t.break_detected=!1,e.yieldX(r,[]),i=t.break_detected,t.break_detected=o,i)},T.$$arity=0),e.defn(L,"$has_break!",O=function(){var e=this;return e.break_detected["$=="](!1)?e.break_detected=!0:o},O.$$arity=0),e.defn(L,"$in_case",S=function(){var t=this,n=S.$$p,r=n||o,i=o;return S.$$p=null,r===o?o:(i=t.case_stmt,t.case_stmt=s([],{}),e.yieldX(r,[]),t.case_stmt=i)},S.$$arity=0),e.defn(L,"$in_while?",N=function(){return this.scope["$in_while?"]()},N.$$arity=0),e.defn(L,"$process",A=function(e,t){var n,r=this,i=o;return null==t&&(t="expr"),e["$=="](o)?r.$fragment("",r.$scope()):(n=i=r.$handlers()["$[]"](e.$type()))===o||null==n||n.$$is_boolean&&1!=n?r.$raise("Unsupported sexp: "+e.$type()):i.$new(e,t,r).$compile_to_fragments()},A.$$arity=-2),e.defn(L,"$handlers",R=function(){var e,t=this;return!1!==(e=t.handlers)&&e!==o&&null!=e?e:t.handlers=q.get("Opal").$$scope.get("Nodes").$$scope.get("Base").$handlers()},R.$$arity=0),e.defn(L,"$requires",P=function(){var e,t=this;return!1!==(e=t.requires)&&e!==o&&null!=e?e:t.requires=[]},P.$$arity=0),e.defn(L,"$required_trees",M=function(){var e,t=this;return!1!==(e=t.required_trees)&&e!==o&&null!=e?e:t.required_trees=[]},M.$$arity=0),e.defn(L,"$returns",I=function(e){var t,r,i=this,a=o,s=o,$=o;return!1===e||e===o||null==e?i.$returns(i.$s("nil")):function(){return a=e.$type(),"undef"["$==="](a)?(s=e.$pop(),e["$<<"](i.$returns(s))):"break"["$==="](a)||"next"["$==="](a)||"redo"["$==="](a)?e:"yield"["$==="](a)?(e["$[]="](0,"returnable_yield"),e):"scope"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"block"["$==="](a)?((t=n(e.$length(),1))===o||null==t||t.$$is_boolean&&1!=t?e["$<<"](i.$returns(i.$s("nil"))):e["$[]="](-1,i.$returns(e["$[]"](-1))),e):"when"["$==="](a)?(e["$[]="](2,i.$returns(e["$[]"](2))),e):"rescue"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),r=e["$[]"](2),(t=!1!==r&&r!==o&&null!=r?e["$[]"](2)["$[]"](0)["$=="]("resbody"):r)===o||null==t||t.$$is_boolean&&1!=t||((t=e["$[]"](2)["$[]"](2))===o||null==t||t.$$is_boolean&&1!=t?e["$[]"](2)["$[]="](2,i.$returns(i.$s("nil"))):e["$[]"](2)["$[]="](2,i.$returns(e["$[]"](2)["$[]"](2)))),e):"ensure"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"begin"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e):"rescue_mod"["$==="](a)?(e["$[]="](1,i.$returns(e["$[]"](1))),e["$[]="](2,i.$returns(e["$[]"](2))),e):"while"["$==="](a)?e:"return"["$==="](a)||"js_return"["$==="](a)?e:"xstr"["$==="](a)?(((t=/return|;/["$=~"](e["$[]"](1)))===o||null==t||t.$$is_boolean&&1!=t)&&e["$[]="](1,"return "+e["$[]"](1)+";"),e):"dxstr"["$==="](a)?(((t=/return|;|\n/["$=~"](e["$[]"](1)))===o||null==t||t.$$is_boolean&&1!=t)&&e["$[]="](1,"return "+e["$[]"](1)),e):"if"["$==="](a)?(e["$[]="](2,i.$returns(!1!==(t=e["$[]"](2))&&t!==o&&null!=t?t:i.$s("nil"))),e["$[]="](3,i.$returns(!1!==(t=e["$[]"](3))&&t!==o&&null!=t?t:i.$s("nil"))),e):($=i.$s("js_return",e),t=[e.$source()],r=$,r["$source="].apply(r,t),t[t.length-1],$)}()},I.$$arity=1),e.defn(L,"$handle_block_given_call",D=function(e){var t,n,r=this,i=o;return r.scope["$uses_block!"](),(t=r.scope.$block_name())===o||null==t||t.$$is_boolean&&1!=t?(n=i=r.scope.$find_parent_def(),(t=!1!==n&&n!==o&&null!=n?i.$block_name():n)===o||null==t||t.$$is_boolean&&1!=t?r.$fragment("false",i,e):r.$fragment("("+i.$block_name()+" !== nil)",i,e)):r.$fragment("("+r.scope.$block_name()+" !== nil)",r.$scope(),e)},D.$$arity=1)}(c.base,null)}(i.base)},Opal.modules["active_support/core_ext/array/wrap"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.klass);return e.add_stubs(["$nil?","$respond_to?","$to_ary"]),function(t,$super){function i(){}var o,a=i=r(t,$super,"Array",i);a.$$proto,a.$$scope;return e.defs(a,"$wrap",o=function(e){var t;return(t=e["$nil?"]())===n||null==t||t.$$is_boolean&&1!=t?(t=e["$respond_to?"]("to_ary"))===n||null==t||t.$$is_boolean&&1!=t?[e]:!1!==(t=e.$to_ary())&&t!==n&&null!=t?t:[e]:[]},o.$$arity=1),n&&"wrap"}(t.base,null)},Opal.modules["active_support/core_ext/array/grouping"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function i(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}var o=(e.top,e),a=e.nil,s=(e.breaker,e.slice,e.klass);return e.add_stubs(["$==","$%","$-","$size","$concat","$dup","$*","$each_slice","$<<","$div","$times","$+","$>","$slice","$!=","$each","$inject","$call","$last"]),function(o,$super){function $(){}var l,u,c,p=$=s(o,$super,"Array",$);p.$$proto,p.$$scope;return e.defn(p,"$in_groups_of",l=function(r,i){var o,s,$,u,c,p=this,d=l.$$p,f=d||a,h=a,_=a,g=a;return null==i&&(i=a),l.$$p=null,i["$=="](!1)?h=p:(_=t(r,p.$size()["$%"](r))["$%"](r),h=p.$dup().$concat(n([i],_))),f!==a?(o=(s=h).$each_slice,o.$$p=($=function(t){$.$$s;return null==t&&(t=a),e.yield1(f,t)},$.$$s=p,$.$$arity=1,$),o).call(s,r):(g=[],(o=(u=h).$each_slice,o.$$p=(c=function(e){c.$$s;return null==e&&(e=a),g["$<<"](e)},c.$$s=p,c.$$arity=1,c),o).call(u,r),g)},l.$$arity=-2),e.defn(p,"$in_groups",u=function(t,n){var o,s,$,l,c,p=this,d=u.$$p,f=d||a,h=a,_=a,g=a,m=a;return null==n&&(n=a),u.$$p=null,h=p.$size().$div(t),_=p.$size()["$%"](t),g=[],m=0,(o=(s=t).$times,o.$$p=($=function(e){var t,o,s,l=$.$$s||this,u=a,c=a;return null==e&&(e=a),u=r(h,function(){return o=i(_,0),(t=!1!==o&&o!==a&&null!=o?i(_,e):o)===a||null==t||t.$$is_boolean&&1!=t?0:1}()),g["$<<"](c=l.$slice(m,u)),s=n["$!="](!1),o=!1!==s&&s!==a&&null!=s?i(_,0):s,(t=!1!==o&&o!==a&&null!=o?u["$=="](h):o)===a||null==t||t.$$is_boolean&&1!=t||c["$<<"](n),m=r(m,u)},$.$$s=p,$.$$arity=1,$),o).call(s),f!==a?(o=(l=g).$each,o.$$p=(c=function(t){c.$$s;return null==t&&(t=a),e.yield1(f,t)},c.$$s=p,c.$$arity=1,c),o).call(l):g},u.$$arity=-2),e.defn(p,"$split",c=function(e){var t,n,r,i=this,o=c.$$p,s=o||a;return null==e&&(e=a),c.$$p=null,(t=(n=i).$inject,t.$$p=(r=function(t,n){var i,o;r.$$s;return null==t&&(t=a),null==n&&(n=a),(i=!1!==(o=!1!==s&&s!==a&&null!=s?s.$call(n):s)&&o!==a&&null!=o?o:e["$=="](n))===a||null==i||i.$$is_boolean&&1!=i?t.$last()["$<<"](n):t["$<<"]([]),t},r.$$s=i,r.$$arity=2,r),t).call(n,[[]])},c.$$arity=-1),a&&"split"}(o.base,null)},Opal.modules["active_support/core_ext/array"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/array/extract_options"),t.$require("active_support/core_ext/array/wrap"),t.$require("active_support/core_ext/array/grouping")},Opal.modules["active_support/core_ext/class"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/class/attribute")},Opal.modules["active_support/core_ext/enumerable"]=function(e){var t=(e.top,e),n=e.nil,r=e.breaker,i=(e.slice,e.module);return e.add_stubs(["$enum_for","$new","$destructure","$[]="]),function(t){var o,a,s=o=i(t,"Enumerable"),$=(s.$$proto,s.$$scope);e.defn(s,"$index_by",a=function(){var e=this,t=a.$$p,i=t||n,o=n;if(a.$$p=null,i===n)return e.$enum_for("index_by");o=$.get("Hash").$new();var s;return e.$each._p=function(){var e=$.get("Opal").$destructure(arguments),t=$opal.$yield1(i,e);if(t===r)return s=r.$v,r;o["$[]="](t,e)},e.$each(),s!==undefined?s:o},a.$$arity=0)}(t.base)},Opal.modules["active_support/core_ext/hash"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/hash/indifferent_access")},Opal.modules["active_support/core_ext/numeric/time"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}var i=(e.top,e),o=(e.nil,e.breaker,e.slice,e.klass);return e.add_stubs(["$*","$hours","$days","$weeks","$-","$current","$+"]),function(i,$super){function a(){}var s,$,l,u,c,p,d,f,h=a=o(i,$super,"Numeric",a);h.$$proto,h.$$scope;return e.defn(h,"$seconds",s=function(){return this},s.$$arity=0),e.alias(h,"second","seconds"),e.defn(h,"$minutes",$=function(){return t(this,60)},$.$$arity=0),e.alias(h,"minute","minutes"),e.defn(h,"$hours",l=function(){return t(this,3600)},l.$$arity=0),e.alias(h,"hour","hours"),e.defn(h,"$days",u=function(){return t(this,24..$hours())},u.$$arity=0),e.alias(h,"day","days"),e.defn(h,"$weeks",c=function(){return t(this,7..$days())},c.$$arity=0),e.alias(h,"week","weeks"),e.defn(h,"$fortnights",p=function(){return t(this,2..$weeks())},p.$$arity=0),e.alias(h,"fortnight","fortnights"),e.defn(h,"$ago",d=function(t){var r=this;return null==t&&(t=e.get("Time").$current()),n(t,r)},d.$$arity=-1),e.alias(h,"until","ago"),e.defn(h,"$since",f=function(t){var n=this;return null==t&&(t=e.get("Time").$current()),r(t,n)},f.$$arity=-1),e.alias(h,"from_now","since")}(i.base,null)},Opal.modules["active_support/core_ext/integer/time"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}var n=e.top,r=e,i=(e.nil,e.breaker,e.slice,e.klass);return e.add_stubs(["$require","$*","$days"]),n.$require("active_support/core_ext/numeric/time"),function(n,$super){function r(){}var o,a,s=r=i(n,$super,"Numeric",r);s.$$proto,s.$$scope;return e.defn(s,"$months",o=function(){return t(this,30..$days())},o.$$arity=0),e.alias(s,"month","months"),e.defn(s,"$years",a=function(){return t(this,365.25.$days())},a.$$arity=0),e.alias(s,"year","years")}(r.base,null)},Opal.modules["active_support/core_ext/integer"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/integer/time")},Opal.modules["active_support/core_ext/kernel"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/kernel/singleton_class")},Opal.modules["active_support/core_ext/module/introspection"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e*t:e["$*"](t)}var n=e.top,r=e,i=e.nil,o=(e.breaker,e.slice,e.klass),a=e.gvars;return e.add_stubs(["$require","$=~","$name","$freeze","$parent_name","$constantize","$split","$empty?","$<<","$*","$pop","$include?","$constants"]),n.$require("active_support/inflector"),function(n,$super){function r(){}var s,$,l,u,c=r=o(n,$super,"Module",r),p=c.$$proto,d=c.$$scope;return p.parent_name=i,e.defn(c,"$parent_name",s=function(){var e,t,n=this;return(e=null!=(t=n.parent_name)&&t!==i?"instance-variable":i)===i||null==e||e.$$is_boolean&&1!=e?n.parent_name=function(){return(e=n.$name()["$=~"](/::[^:]+$/))===i||null==e||e.$$is_boolean&&1!=e?i:((e=a["~"])===i?i:e.$pre_match()).$freeze()}():n.parent_name},s.$$arity=0),e.defn(c,"$parent",$=function(){var e,t=this;return(e=t.$parent_name())===i||null==e||e.$$is_boolean&&1!=e?d.get("Object"):d.get("ActiveSupport").$$scope.get("Inflector").$constantize(t.$parent_name())},$.$$arity=0),e.defn(c,"$parents",l=function(){var e,n,r=this,o=i,a=i;if(o=[],(e=r.$parent_name())!==i&&null!=e&&(!e.$$is_boolean||1==e))for(a=r.$parent_name().$split("::");(n=a["$empty?"]())===i||null==n||n.$$is_boolean&&1!=n;)o["$<<"](d.get("ActiveSupport").$$scope.get("Inflector").$constantize(t(a,"::"))),a.$pop();return((e=o["$include?"](d.get("Object")))===i||null==e||e.$$is_boolean&&1!=e)&&o["$<<"](d.get("Object")),o},l.$$arity=0),e.defn(c,"$local_constants",u=function(){return this.$constants(!1)},u.$$arity=0),i&&"local_constants"}(r.base,null)},Opal.modules["active_support/core_ext/module/delegation"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}var n=(e.top,e),r=e.nil,i=(e.breaker,e.slice,e.klass),o=e.range;return e.add_stubs(["$pop","$is_a?","$[]","$raise","$values_at","$==","$=~","$to_s","$each","$+","$lambda","$start_with?","$__send__","$new","$inspect","$define_method","$to_proc"]),function(n,$super){function a(){}var s,$=a=i(n,$super,"Module",a),l=($.$$proto,$.$$scope);return function(e,$super){function t(){}var n=t=i(e,$super,"DelegationError",t);n.$$proto,n.$$scope}(l.base,l.get("NoMethodError")),e.defn($,"$delegate",s=function(){var n,i,a,s,$=this,u=r,c=r,p=r,d=r,f=r,h=arguments.length,_=h-0;_<0&&(_=0),s=new Array(_);for(var g=0;g<h;g++)s[g-0]=arguments[g];return u=s.$pop(),i=u["$is_a?"](l.get("Hash")),((n=!1!==i&&i!==r&&null!=i?c=u["$[]"]("to"):i)===r||null==n||n.$$is_boolean&&1!=n)&&$.$raise(l.get("ArgumentError"),"Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, to: :greeter)."),i=u.$values_at("prefix","allow_nil"),n=e.to_ary(i),p=null==n[0]?r:n[0],d=null==n[1]?r:n[1],(n=(i=p["$=="](!0))?c["$=~"](/^[^a-z_]/):p["$=="](!0))===r||null==n||n.$$is_boolean&&1!=n||$.$raise(l.get("ArgumentError"),"Can only automatically set the delegation prefix when delegating to a method."),f=function(){return!1!==p&&p!==r&&null!=p?function(){return p["$=="](!0)?c:p}()+"_":""}(),c=c.$to_s(),(n=(i=s).$each,n.$$p=(a=function(n){var i,s,$,u,p,h,_,g,m,y=a.$$s||this,v=r,b=r,w=r,x=r;return null==n&&(n=r),v=function(){return!!((i=n["$=~"](/[^\]]=$/))===r||null==i||i.$$is_boolean&&1!=i)}(),b=t(f,n),w=(i=(s=y).$lambda,i.$$p=($=function(e){var t,n=($.$$s,r);return null==e&&(e=r),(t=c["$start_with?"]("@"))===r||null==t||t.$$is_boolean&&1!=t?e.$__send__(c):(n=c["$[]"](o(1,-1,!1)),e[n])},$.$$s=y,$.$$arity=1,$),i).call(s),x=(i=(u=y).$lambda,i.$$p=(p=function(e){p.$$s;return null==e&&(e=r),l.get("DelegationError").$new(""+e+b+" delegated to "+c+"."+n+" but "+c+" is nil: "+e.$inspect(),b)},p.$$s=y,p.$$arity=1,p),i).call(u),!1!==v&&v!==r&&null!=v?(i=(h=y).$define_method,i.$$p=(_=function(){var t,i,o,a,s=_.$$s||this,$=r;t=_.$$p||r,_.$$p=null;var l=arguments.length,u=l-0;u<0&&(u=0),i=new Array(u);for(var c=0;c<l;c++)i[c-0]=arguments[c];if(!1!==($=w["$[]"](s))&&$!==r&&null!=$);else{if(!1!==d&&d!==r&&null!=d)return r;s.$raise(x["$[]"](s))}return(o=(a=$).$__send__,o.$$p=t.$to_proc(),o).apply(a,[n].concat(e.to_a(i)))},_.$$s=y,_.$$arity=-1,_),i).call(h,b):(i=(g=y).$define_method,i.$$p=(m=function(e){var t=m.$$s||this,i=r;if(null==e&&(e=r),!1!==(i=w["$[]"](t))&&i!==r&&null!=i);else{if(!1!==d&&d!==r&&null!=d)return r;t.$raise(x["$[]"](t))}return i.$__send__(n,e)},m.$$s=y,m.$$arity=1,m),i).call(g,b)},a.$$s=$,a.$$arity=1,a),n).call(i)},s.$$arity=-1),r&&"delegate"}(n.base,null)},Opal.modules["active_support/core_ext/module"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/module/introspection"),t.$require("active_support/core_ext/module/remove_method"),t.$require("active_support/core_ext/module/delegation")},Opal.modules["active_support/core_ext/numeric/calculations"]=function(e){var t=(e.top,e);e.nil,e.breaker,e.slice;return function(t){t.$$scope,t.$$proto;return e.alias(t,"current","now")}(e.get_singleton_class(t.get("Time")))},Opal.modules["active_support/core_ext/numeric"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/numeric/time"),t.$require("active_support/core_ext/numeric/calculations")},Opal.modules["active_support/core_ext/object/blank"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.klass);return e.add_stubs(["$respond_to?","$empty?","$!","$blank?","$present?","$==","$alias_method","$!~"]),function(t,$super){function i(){}var o,a,s,$=i=r(t,$super,"Object",i);$.$$proto,$.$$scope;e.defn($,"$blank?",o=function(){var e,t=this;return(e=t["$respond_to?"]("empty?"))===n||null==e||e.$$is_boolean&&1!=e?t["$!"]():t["$empty?"]()},o.$$arity=0),e.defn($,"$present?",a=function(){return this["$blank?"]()["$!"]()},a.$$arity=0),e.defn($,"$presence",s=function(){var e,t=this;return(e=t["$present?"]())===n||null==e||e.$$is_boolean&&1!=e?n:t},s.$$arity=0)}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"NilClass",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return!0},i.$$arity=0)}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"Boolean",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return this["$=="](!1)},i.$$arity=0)}(t.base,null),function(e,$super){function t(){}var n=t=r(e,$super,"Array",t);n.$$proto,n.$$scope;n.$alias_method("blank?","empty?")}(t.base,null),function(e,$super){function t(){}var n=t=r(e,$super,"Hash",t);n.$$proto,n.$$scope;n.$alias_method("blank?","empty?")}(t.base,null),function(t,$super){function n(){}var i,o=n=r(t,$super,"String",n);o.$$proto,o.$$scope;e.defn(o,"$blank?",i=function(){return this["$!~"](/[^\s\u3000]/)},i.$$arity=0)}(t.base,null),function(t,$super){function i(){}var o,a=i=r(t,$super,"Numeric",i);a.$$proto,a.$$scope;return e.defn(a,"$blank?",o=function(){return!1},o.$$arity=0),n&&"blank?"}(t.base,null)},Opal.modules["active_support/core_ext/object"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/object/blank"),t.$require("active_support/core_ext/object/try")},Opal.modules["active_support/core_ext"]=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext/array"),t.$require("active_support/core_ext/class"),t.$require("active_support/core_ext/enumerable"),t.$require("active_support/core_ext/hash"),t.$require("active_support/core_ext/integer"),t.$require("active_support/core_ext/kernel"),t.$require("active_support/core_ext/module"),t.$require("active_support/core_ext/numeric"),t.$require("active_support/core_ext/object"),t.$require("active_support/core_ext/string")},Opal.modules.active_support=function(e){var t=e.top;e.nil,e.breaker,e.slice;return e.add_stubs(["$require"]),t.$require("active_support/core_ext")},Opal.modules.securerandom=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.module);return e.add_stubs(["$gsub"]),function(t){var i,o,a=i=r(t,"SecureRandom");a.$$proto,a.$$scope;e.defs(a,"$uuid",o=function(){var e,t,r,i=this;return(e=(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").$gsub,e.$$p=(r=function(e){r.$$s;null==e&&(e=n);var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)},r.$$s=i,r.$$arity=1,r.$$has_trailing_comma_in_args=!0,r),e).call(t,/[xy]/)},o.$$arity=0)}(t.base)},Opal.modules["hyperloop/console/evaluate"]=function(e){var t=(e.top,e),n=e.nil,r=(e.breaker,e.slice,e.module),i=e.klass,o=e.hash2;return e.add_stubs(["$param","$dispatch_to"]),function(e){var t,a=t=r(e,"Hyperloop"),s=(a.$$proto,a.$$scope);!function(e){var t,a=t=r(e,"Console"),s=(a.$$proto,a.$$scope);!function(e,$super){function t(){}var r,a,s,$=t=i(e,$super,"Evaluate",t),l=($.$$proto,$.$$scope);$.$param(o(["acting_user","nils"],{acting_user:n,nils:!0})),$.$param("target_id"),$.$param("sender_id"),$.$param("context"),$.$param(o(["string"],{string:n})),(r=(a=$).$dispatch_to,r.$$p=(s=function(){s.$$s;return l.get("Hyperloop").$$scope.get("Application")},s.$$s=$,s.$$arity=0,s),r).call(a)}(s.base,s.get("Hyperloop").$$scope.get("ServerOp")),function(e,$super){function t(){}var r,a,s,$=t=i(e,$super,"Response",t),l=($.$$proto,$.$$scope);$.$param(o(["acting_user","nils"],{acting_user:n,nils:!0})),$.$param("target_id"),$.$param("kind"),$.$param("message"),(r=(a=$).$dispatch_to,r.$$p=(s=function(){s.$$s;return l.get("Hyperloop").$$scope.get("Application")},s.$$s=$,s.$$arity=0,s),r).call(a)}(s.base,s.get("Hyperloop").$$scope.get("ServerOp"))}(s.base)}(t.base)},Opal.modules["hyperloop/console/version"]=function(e){var t=(e.top,e),n=(e.nil,e.breaker,e.slice,e.module);return function(t){var r,i=r=n(t,"Hyperloop"),o=(i.$$proto,i.$$scope);!function(t){var r,i=r=n(t,"Console"),o=(i.$$proto,i.$$scope);e.cdecl(o,"VERSION","0.1.2")}(o.base)}(t.base)},
36
36
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
37
37
  function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function o(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function a(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function s(t,n){for(var r=t.split(" "),i=0;i<r.length;i++)r[i]&&!e(r[i]).test(n)&&(n+=" "+r[i]);return n}function $(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function l(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function u(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}function c(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function p(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function d(e){for(;ka.length<=e;)ka.push(f(ka)+" ");return ka[e]}function f(e){return e[e.length-1]}function h(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function _(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function g(){}function m(e,t){var n;return Object.create?n=Object.create(e):(g.prototype=e,n=new g),t&&l(t,n),n}function y(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ea.test(e))}function v(e,t){return t?!!(t.source.indexOf("\\w")>-1&&y(e))||t.test(e):y(e)}function b(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function w(e){return e.charCodeAt(0)>=768&&Ca.test(e)}function x(e,t,n){for(;(n<0?t>0:t<e.length)&&w(e.charAt(t));)t+=n;return t}function k(e,t,n){for(;;){if(Math.abs(t-n)<=1)return e(t)?t:n;var r=Math.floor((t+n)/2);e(r)?n=r:t=r}}function E(e,t,n){var i=this;this.input=n,i.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=r("div",null,"CodeMirror-code"),i.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=r("div",null,"CodeMirror-cursors"),i.measure=r("div",null,"CodeMirror-measure"),i.lineMeasure=r("div",null,"CodeMirror-measure"),i.lineSpace=r("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=r("div",[r("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=r("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=r("div",null,null,"position: absolute; height: "+ya+"px; width: 1px;"),i.gutters=r("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=r("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=r("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),Ko&&Qo<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),Jo||Go&&aa||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function C(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function T(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function O(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function S(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function N(e){if(null==e.parent)return null;for(var t=e.parent,n=c(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function A(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],$=s.height;if(t<$)break;t-=$}return n+a}function R(e,t){return t>=e.first&&t<e.first+e.size}function P(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function M(e,t,n){if(void 0===n&&(n=null),!(this instanceof M))return new M(e,t,n);this.line=e,this.ch=t,this.sticky=n}function I(e,t){return e.line-t.line||e.ch-t.ch}function D(e,t){return e.sticky==t.sticky&&0==I(e,t)}function L(e){return M(e.line,e.ch)}function j(e,t){return I(e,t)<0?t:e}function q(e,t){return I(e,t)<0?e:t}function z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function U(e,t){if(t.line<e.first)return M(e.first,0);var n=e.first+e.size-1;return t.line>n?M(n,C(e,n).text.length):F(t,C(e,t.line).text.length)}function F(e,t){var n=e.ch;return null==n||n>t?M(e.line,t):n<0?M(e.line,0):e}function H(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=U(e,t[r]);return n}function B(){Ta=!0}function W(){Oa=!0}function G(e,t,n){this.marker=e,this.from=t,this.to=n}function V(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Y(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function X(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function K(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var $=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new G(a,o.from,$?null:o.to))}}return r}function Q(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var $=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new G(a,$?null:o.from-t,null==o.to?null:o.to-t))}}return r}function J(e,t){if(t.full)return null;var n=R(e,t.from.line)&&C(e,t.from.line).markedSpans,r=R(e,t.to.line)&&C(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==I(t.from,t.to),s=K(n,i,a),$=Q(r,o,a),l=1==t.text.length,u=f(t.text).length+(l?i:0);if(s)for(var c=0;c<s.length;++c){var p=s[c];if(null==p.to){var d=V($,p.marker);d?l&&(p.to=null==d.to?null:d.to+u):p.to=i}}if($)for(var h=0;h<$.length;++h){var _=$[h];if(null!=_.to&&(_.to+=u),null==_.from){var g=V(s,_.marker);g||(_.from=u,l&&(s||(s=[])).push(_))}else _.from+=u,l&&(s||(s=[])).push(_)}s&&(s=Z(s)),$&&$!=s&&($=Z($));var m=[s];if(!l){var y,v=t.text.length-2;if(v>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(y||(y=[])).push(new G(s[b].marker,null,null));for(var w=0;w<v;++w)m.push(y);m.push($)}return m}function Z(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function ee(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=c(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),$=0;$<i.length;++$){var l=i[$];if(!(I(l.to,s.from)<0||I(l.from,s.to)>0)){var u=[$,1],p=I(l.from,s.from),d=I(l.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:l.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),$+=u.length-3}}return i}function te(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function re(e){return e.inclusiveLeft?-1:0}function ie(e){return e.inclusiveRight?1:0}function oe(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=I(r.from,i.from)||re(e)-re(t);if(o)return-o;var a=I(r.to,i.to)||ie(e)-ie(t);return a||t.id-e.id}function ae(e,t){var n,r=Oa&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||oe(n,i.marker)<0)&&(n=i.marker);return n}function se(e){return ae(e,!0)}function $e(e){return ae(e,!1)}function le(e,t,n,r,i){var o=C(e,t),a=Oa&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var $=a[s];if($.marker.collapsed){var l=$.marker.find(0),u=I(l.from,n)||re($.marker)-re(i),c=I(l.to,r)||ie($.marker)-ie(i);if(!(u>=0&&c<=0||u<=0&&c>=0)&&(u<=0&&($.marker.inclusiveRight&&i.inclusiveLeft?I(l.to,n)>=0:I(l.to,n)>0)||u>=0&&($.marker.inclusiveRight&&i.inclusiveLeft?I(l.from,r)<=0:I(l.from,r)<0)))return!0}}}function ue(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function ce(e){for(var t;t=$e(e);)e=t.find(1,!0).line;return e}function pe(e){for(var t,n;t=$e(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function de(e,t){var n=C(e,t),r=ue(n);return n==r?t:N(r)}function fe(e,t){if(t>e.lastLine())return t;var n,r=C(e,t);if(!he(e,r))return t;for(;n=$e(r);)r=n.find(1,!0).line;return N(r)+1}function he(e,t){var n=Oa&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&_e(e,t,r))return!0}}function _e(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return _e(e,r.line,V(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&_e(e,t,i))return!0}function ge(e){e=ue(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function me(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=se(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=$e(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function ye(e){var t=e.display,n=e.doc;t.maxLine=C(n,n.first),t.maxLineLength=me(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=me(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function ve(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function be(e,t,n){var r;Sa=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Sa=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Sa=i)}return null!=r?r:Sa}function we(e){var t=e.order;return null==t&&(t=e.order=Na(e.text)),t}function xe(e,t,n){var r=x(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ke(e,t,n){var r=xe(e,t.ch,n);return null==r?null:new M(t.line,r,n<0?"after":"before")}function Ee(e,t,n,r,i){if(e){var o=we(n);if(o){var a,s=i<0?f(o):o[0],$=i<0==(1==s.level),l=$?"after":"before";if(s.level>0){var u=Xt(t,n);a=i<0?n.text.length-1:0;var c=Kt(t,u,a).top;a=k(function(e){return Kt(t,u,e).top==c},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=xe(n,a,1,!0))}else a=i<0?s.to:s.from;return new M(r,a,l)}}return new M(r,i<0?n.text.length:0,i<0?"before":"after")}function Ce(e,t,n,r){var i=we(t);if(!i)return ke(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=be(i,n.ch,n.sticky),a=i[o];if(a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return ke(t,n,r);var s,$=function(e,n){return xe(t,e instanceof M?e.ch:e,n)},l=function(n){return e.options.lineWrapping?(s=s||Xt(e,t),hn(e,t,s,n)):{begin:0,end:t.text.length}},u=l("before"==n.sticky?$(n,-1):n.ch);if(a.level%2==1){var c=$(n,-r);if(null!=c&&(r>0?c>=a.from&&c>=u.begin:c<=a.to&&c<=u.end)){var p=r<0?"before":"after";return new M(n.line,c,p)}}var d=function(e,t,r){for(var o=function(e,t){return t?new M(n.line,$(e,1),"before"):new M(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),l=s?r.begin:$(r.end,-1);if(a.from<=l&&l<a.to)return o(l,s);if(l=s?a.from:$(a.to,-1),r.begin<=l&&l<r.end)return o(l,s)}},f=d(o+r,r,u);if(f)return f;var h=r>0?u.end:$(u.begin,-1);return null==h||r>0&&h==t.text.length||!(f=d(r>0?0:i.length-1,r,l(h)))?null:f}function Te(e,t){return e._handlers&&e._handlers[t]||Aa}function Oe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=c(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Se(e,t){var n=Te(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ne(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Se(e,n||t.type,e,t),De(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==c(n,t[r])&&n.push(t[r])}function Re(e,t){return Te(e,t).length>0}function Pe(e){e.prototype.on=function(e,t){Ra(this,e,t)},e.prototype.off=function(e,t){Oe(this,e,t)}}function Me(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Le(e){Me(e),Ie(e)}function je(e){return e.target||e.srcElement}function qe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),sa&&e.ctrlKey&&1==t&&(t=3),t}function ze(e){if(null==ga){var t=r("span","\u200b");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ga=t.offsetWidth<=1&&t.offsetHeight>2&&!(Ko&&Qo<8))}var i=ga?r("span","\u200b"):r("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ue(e){if(null!=ma)return ma;var r=n(e,document.createTextNode("A\u062eA")),i=ca(r,0,1).getBoundingClientRect(),o=ca(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(ma=o.right-i.right<3)}function Fe(e){if(null!=La)return La;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=ca(t,0,1).getBoundingClientRect();return La=Math.abs(i.left-o.left)>1}function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ja[e]=t}function Be(e,t){qa[e]=t}function We(e){if("string"==typeof e&&qa.hasOwnProperty(e))e=qa[e];else if(e&&"string"==typeof e.name&&qa.hasOwnProperty(e.name)){var t=qa[e.name];"string"==typeof t&&(t={name:t}),e=m(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=We(t);var n=ja[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if(za.hasOwnProperty(t.name)){var i=za[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}function Ve(e,t){l(t,za.hasOwnProperty(e)?za[e]:za[e]={})}function Ye(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Xe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}function Qe(e,t,n,r){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=function(n){var r=e.state.overlays[n],a=1,s=0;ot(e,t.text,r.mode,!0,function(e,t){for(var n=a;s<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,s=Math.min(e,o)}if(t)if(r.opaque)i.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n<a;n+=2){var $=i[n+1];i[n+1]=($?$+" ":"")+"overlay "+t}},o)},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Je(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ze(e,N(t)),i=Qe(e,t,t.text.length>e.options.maxHighlightLength?Ye(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ze(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=at(e,t,n),a=o>r.first&&C(r,o-1).stateAfter;return a=a?Ye(r.mode,a):Ke(r.mode),r.iter(o,t,function(n){et(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?Ye(r.mode,a):null,++o}),n&&(r.frontier=o),a}function et(e,t,n,r){var i=e.doc.mode,o=new Ua(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&tt(i,n);!o.eol();)nt(i,o,n),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Xe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function nt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Xe(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function rt(e,t,n,r){var i,o=function(e){return{start:c.start,end:c.pos,string:c.current(),type:i||null,state:e?Ye(a.mode,u):u}},a=e.doc,s=a.mode;t=U(a,t);var $,l=C(a,t.line),u=Ze(e,t.line,n),c=new Ua(l.text,e.options.tabSize);for(r&&($=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=nt(s,c,u),r&&$.push(o(!0));return r?$:o()}function it(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function ot(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var $,l=0,u=null,c=new Ua(t,e.options.tabSize),p=e.options.addModeClass&&[null];for(""==t&&it(tt(n,r),o);!c.eol();){if(c.pos>e.options.maxHighlightLength?(s=!1,a&&et(e,t,r,c.pos),c.pos=t.length,$=null):$=it(nt(n,c,r,p),o),p){var d=p[0].name;d&&($="m-"+($?d+" "+$:d))}if(!s||u!=$){for(;l<c.start;)l=Math.min(c.start,l+5e3),i(l,u);u=$}c.start=c.pos}for(;l<c.pos;){var f=Math.min(c.pos,l+5e3);i(f,u),l=f}}function at(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var $=C(o,s-1);if($.stateAfter&&(!n||s<=o.frontier))return s;var l=u($.text,null,e.options.tabSize);(null==i||r>l)&&(i=s-1,r=l)}return i}function st(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),te(e),ne(e,n);var i=r?r(e):1;i!=e.height&&S(e,i)}function $t(e){e.parent=null,te(e)}function lt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Wa:Ba;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var n=r("span",null,null,Jo?"padding-right: .1px":null),i={pre:r("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Ko||Jo)&&e.getOption("lineWrapping")};n.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,$=void 0;i.pos=0,i.addToken=pt,Ue(e.display.measure)&&($=we(a))&&(i.addToken=ft(i.addToken,$)),i.map=[];_t(a,i,Je(e,a,t!=e.display.externalMeasured&&N(a))),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=s(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=s(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(ze(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Jo){var l=i.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Se(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=s(i.pre.className,i.textClass||"")),i}function ct(e){var t=r("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,n,i,o,a,s){if(t){var $,l=e.splitSpaces?dt(t,e.trailingSpace):t,u=e.cm.state.specialChars,c=!1;if(u.test(t)){$=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var f=u.exec(t),h=f?f.index-p:t.length-p;if(h){var _=document.createTextNode(l.slice(p,p+h));Ko&&Qo<9?$.appendChild(r("span",[_])):$.appendChild(_),e.map.push(e.pos,e.pos+h,_),e.col+=h,e.pos+=h}if(!f)break;p+=h+1;var g=void 0;if("\t"==f[0]){var m=e.cm.options.tabSize,y=m-e.col%m;g=$.appendChild(r("span",d(y),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?(g=$.appendChild(r("span","\r"==f[0]?"\u240d":"\u2424","cm-invalidchar")),g.setAttribute("cm-text",f[0]),e.col+=1):(g=e.cm.options.specialCharPlaceholder(f[0]),g.setAttribute("cm-text",f[0]),Ko&&Qo<9?$.appendChild(r("span",[g])):$.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,$=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,$),Ko&&Qo<9&&(c=!0),e.pos+=t.length;if(e.trailingSpace=32==l.charCodeAt(t.length-1),n||i||o||c||s){var v=n||"";i&&(v+=i),o&&(v+=o);var b=r("span",[$],v,s);return a&&(b.title=a),e.content.appendChild(b)}e.content.appendChild($)}}function dt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o="\xa0"),r+=o,n=" "==o}return r}function ft(e,t){return function(n,r,i,o,a,s,$){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var c=void 0,p=0;p<t.length&&(c=t[p],!(c.to>l&&c.from<=l));p++);if(c.to>=u)return e(n,r,i,o,a,s,$);e(n,r.slice(0,c.to-l),i,o,null,s,$),o=null,r=r.slice(c.to-l),l=c.to}}}function ht(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function _t(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,$,l,u,c,p,d=i.length,f=0,h=1,_="",g=0;;){if(g==f){$=l=u=c=s="",p=null,g=Infinity;for(var m=[],y=void 0,v=0;v<r.length;++v){var b=r[v],w=b.marker;"bookmark"==w.type&&b.from==f&&w.widgetNode?m.push(w):b.from<=f&&(null==b.to||b.to>f||w.collapsed&&b.to==f&&b.from==f)?(null!=b.to&&b.to!=f&&g>b.to&&(g=b.to,l=""),w.className&&($+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&b.from==f&&(u+=" "+w.startStyle),w.endStyle&&b.to==g&&(y||(y=[])).push(w.endStyle,b.to),w.title&&!c&&(c=w.title),w.collapsed&&(!p||oe(p.marker,w)<0)&&(p=b)):b.from>f&&g>b.from&&(g=b.from)}if(y)for(var x=0;x<y.length;x+=2)y[x+1]==g&&(l+=" "+y[x]);if(!p||p.from==f)for(var k=0;k<m.length;++k)ht(t,0,m[k]);if(p&&(p.from||0)==f){if(ht(t,(null==p.to?d+1:p.to)-f,p.marker,null==p.from),null==p.to)return;p.to==f&&(p=!1)}}if(f>=d)break;for(var E=Math.min(d,g);;){if(_){var C=f+_.length;if(!p){var T=C>E?_.slice(0,E-f):_;t.addToken(t,T,a?a+$:$,u,f+T.length==g?l:"",c,s)}if(C>=E){_=_.slice(E-f),f=E;break}f=C,u=""}_=i.slice(o,o=n[h++]),a=lt(n[h++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),lt(n[O+1],t.cm.options))}function gt(e,t,n){this.line=t,this.rest=pe(t),this.size=this.rest?N(f(this.rest))-n+1:1,this.node=this.text=null,this.hidden=he(e,t)}function mt(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new gt(e.doc,C(e.doc,o),o);r=o+a.size,i.push(a)}return i}function yt(e){Ga?Ga.ops.push(e):e.ownsGroup=Ga={ops:[e],delayedCallbacks:[]}}function vt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function bt(e,t){var n=e.ownsGroup;if(n)try{vt(n)}finally{Ga=null,t(n)}}function wt(e,t){var n=Te(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Ga?r=Ga.delayedCallbacks:Va?r=Va:(r=Va=[],setTimeout(xt,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function xt(){var e=Va;Va=null;for(var t=0;t<e.length;++t)e[t]()}function kt(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Ot(e,t):"gutter"==o?Nt(e,t,n,r):"class"==o?St(t):"widget"==o&&At(e,t,r)}t.changes=null}function Et(e){return e.node==e.text&&(e.node=r("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Ko&&Qo<8&&(e.node.style.zIndex=2)),e.node}function Ct(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=Et(e);e.background=n.insertBefore(r("div",null,t),n.firstChild)}}function Tt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ut(e,t)}function Ot(e,t){var n=t.text.className,r=Tt(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,St(t)):n&&(t.text.className=n)}function St(e){Ct(e),e.line.wrapClass?Et(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Nt(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Et(t);t.gutterBackground=r("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var s=Et(t),$=t.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable($),s.insertBefore($,t.text),t.line.gutterClass&&($.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=$.appendChild(r("div",P(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var l=0;l<e.options.gutters.length;++l){var u=e.options.gutters[l],c=a.hasOwnProperty(u)&&a[u];c&&$.appendChild(r("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function At(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);Pt(e,t,n)}function Rt(e,t,n,r){var i=Tt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),St(t),Nt(e,t,n,r),Pt(e,t,r),t.node}function Pt(e,t,n){if(Mt(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Mt(e,t.rest[r],t,n,!1)}function Mt(e,t,n,i,o){if(t.widgets)for(var a=Et(n),s=0,$=t.widgets;s<$.length;++s){var l=$[s],u=r("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),It(l,u,n,i),e.display.input.setUneditable(u),o&&l.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),wt(l,"redraw")}}function It(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Dt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,r("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function Lt(e,t){for(var n=je(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function jt(e){return e.lineSpace.offsetTop}function qt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function zt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=n(e.measure,r("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Ut(e){return ya-e.display.nativeBarWidth}function Ft(e){return e.display.scroller.clientWidth-Ut(e)-e.display.barWidth}function Ht(e){return e.display.scroller.clientHeight-Ut(e)-e.display.barHeight}function Bt(e,t,n){var r=e.options.lineWrapping,i=r&&Ft(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var $=a[s],l=a[s+1];Math.abs($.bottom-l.bottom)>2&&o.push(($.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Wt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(N(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Gt(e,t){t=ue(t);var r=N(t),i=e.display.externalMeasured=new gt(e.doc,t,r);i.lineN=r;var o=i.built=ut(e,i);return i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function Vt(e,t,n,r){return Kt(e,Xt(e,t),n,r)}function Yt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kn(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Xt(e,t){var n=N(t),r=Yt(e,n);r&&!r.text?r=null:r&&r.changes&&(kt(e,r,n,yn(e)),e.curOp.forceUpdate=!0),r||(r=Gt(e,t));var i=Wt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Kt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bt(e,t.view,t.rect),t.hasHeights=!0),o=Zt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Qt(e,t,n){for(var r,i,o,a,s,$,l=0;l<e.length;l+=3)if(s=e[l],$=e[l+1],t<s?(i=0,o=1,a="left"):t<$?(i=t-s,o=i+1):(l==e.length-3||t==$&&e[l+3]>t)&&(o=$-s,i=o-1,t>=$&&(a="right")),null!=i){if(r=e[l+2],s==$&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==$-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:$}}function Jt(e,t){var n=Ya
38
38
  ;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Zt(e,t,n,r){var i,o=Qt(t.map,n,r),a=o.node,s=o.start,$=o.end,l=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&w(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+$<o.coverEnd&&w(t.line.text.charAt(o.coverStart+$));)++$;if(i=Ko&&Qo<9&&0==s&&$==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Jt(ca(a,s,$).getClientRects(),r),i.left||i.right||0==s)break;$=s,s-=1,l="right"}Ko&&Qo<11&&(i=en(e.display.measure,i))}else{s>0&&(l=r="right");var c;i=e.options.lineWrapping&&(c=a.getClientRects()).length>1?c["right"==r?c.length-1:0]:a.getBoundingClientRect()}if(Ko&&Qo<9&&!s&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+mn(e.display),top:p.top,bottom:p.bottom}:Ya}for(var d=i.top-t.rect.top,f=i.bottom-t.rect.top,h=(d+f)/2,_=t.view.measure.heights,g=0;g<_.length-1&&!(h<_[g]);g++);var m=g?_[g-1]:0,y=_[g],v={left:("right"==l?i.right:i.left)-t.rect.left,right:("left"==l?i.left:i.right)-t.rect.left,top:m,bottom:y};return i.left||i.right||(v.bogus=!0),e.options.singleCursorHeightPerLine||(v.rtop=d,v.rbottom=f),v}function en(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function tn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function nn(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)tn(e.display.view[n])}function rn(e){nn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function on(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function an(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function sn(e,t,n,r,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Dt(t.widgets[o]);n.top+=a,n.bottom+=a}if("line"==r)return n;r||(r="local");var s=ge(t);if("local"==r?s+=jt(e.display):s-=e.display.viewOffset,"page"==r||"window"==r){var $=e.display.lineSpace.getBoundingClientRect();s+=$.top+("window"==r?0:an());var l=$.left+("window"==r?0:on());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function $n(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=on(),i-=an();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ln(e,t,n,r,i){return r||(r=C(e.doc,t.line)),sn(e,r,Vt(e,r,t.ch,i),n)}function un(e,t,n,r,i,o){function a(t,a){var s=Kt(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,sn(e,r,s,n)}function s(e,t,n){var r=$[t],i=r.level%2!=0;return a(n?e-1:e,i!=n)}r=r||C(e.doc,t.line),i||(i=Xt(e,r));var $=we(r),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!$)return a("before"==u?l-1:l,"before"==u);var c=be($,l,u),p=Sa,d=s(l,c,"before"==u);return null!=p&&(d.other=s(l,p,"before"!=u)),d}function cn(e,t){var n=0;t=U(e.doc,t),e.options.lineWrapping||(n=mn(e.display)*t.ch);var r=C(e.doc,t.line),i=ge(r)+jt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function pn(e,t,n,r,i){var o=M(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function dn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return pn(r.first,0,null,!0,-1);var i=A(r,n),o=r.first+r.size-1;if(i>o)return pn(r.first+r.size-1,C(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=C(r,i);;){var s=_n(e,a,i,t,n),$=$e(a),l=$&&$.find(0,!0);if(!$||!(s.ch>l.from.ch||s.ch==l.from.ch&&s.xRel>0))return s;i=N(a=l.to.line)}}function fn(e,t,n,r){var i=function(r){return sn(e,t,Kt(e,n,r),"line")},o=t.text.length,a=k(function(e){return i(e-1).bottom<=r},o,0);return o=k(function(e){return i(e).top>r},a,o),{begin:a,end:o}}function hn(e,t,n,r){return fn(e,t,n,sn(e,t,Kt(e,n,r),"line").top)}function _n(e,t,n,r,i){i-=ge(t);var o,a=0,s=t.text.length,$=Xt(e,t);if(we(t)){if(e.options.lineWrapping){var l;l=fn(e,t,$,i),a=l.begin,s=l.end}o=new M(n,a);var u,c,p=un(e,o,"line",t,$).left,d=p<r?1:-1,f=p-r;do{if(u=f,c=o,null==(o=Ce(e,t,o,d))||o.ch<a||s<=("before"==o.sticky?o.ch-1:o.ch)){o=c;break}f=un(e,o,"line",t,$).left-r}while(d<0!=f<0&&Math.abs(f)<=Math.abs(u));if(Math.abs(f)>Math.abs(u)){if(f<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=c}}else{var h=k(function(n){var o=sn(e,t,Kt(e,$,n),"line");return o.top>i?(s=Math.min(n,s),!0):!(o.bottom<=i)&&(o.left>r||!(o.right<r)&&r-o.left<o.right-r)},a,s);h=x(t.text,h,1),o=new M(n,h,h==s?"before":"after")}var _=un(e,o,"line",t,$);return(i<_.top||_.bottom<i)&&(o.outside=!0),o.xRel=r<_.left?-1:r>_.right?1:0,o}function gn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ha){Ha=r("pre");for(var i=0;i<49;++i)Ha.appendChild(document.createTextNode("x")),Ha.appendChild(r("br"));Ha.appendChild(document.createTextNode("x"))}n(e.measure,Ha);var o=Ha.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=r("span","xxxxxxxxxx"),i=r("pre",[t]);n(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function yn(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:vn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function vn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function bn(e){var t=gn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/mn(e.display)-3);return function(i){if(he(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function wn(e){var t=e.doc,n=bn(e);t.iter(function(e){var t=n(e);t!=e.height&&S(e,t)})}function xn(e,t,n,r){var i=e.display;if(!n&&"true"==je(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var $,l=dn(e,o,a);if(r&&1==l.xRel&&($=C(e.doc,l.line).text).length==l.ch){var c=u($,$.length,e.options.tabSize)-$.length;l=M(l.line,Math.max(0,Math.round((o-zt(e.display).left)/mn(e.display))-c))}return l}function kn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function En(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Cn(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(!1!==t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var $=s.empty();($||e.options.showCursorWhenSelecting)&&Tn(e,s.head,i),$||On(e,s,o)}}return r}function Tn(e,t,n){var i=un(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(r("div","\xa0","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=n.appendChild(r("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function On(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),$.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?c-e:n)+"px;\n height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return ln(e,M(t,n),"div",l,r)}var a,$,l=C(s,t),p=l.text.length;return ve(we(l),n||0,null==r?p:r,function(e,t,s){var l,d,f,h=o(e,"left");if(e==t)l=h,d=f=h.left;else{if(l=o(t-1,"right"),"rtl"==s){var _=h;h=l,l=_}d=h.left,f=l.right}null==n&&0==e&&(d=u),l.top-h.top>3&&(i(d,h.top,null,h.bottom),d=u,h.bottom<l.top&&i(d,h.bottom,null,l.top)),null==r&&t==p&&(f=c),(!a||h.top<a.top||h.top==a.top&&h.left<a.left)&&(a=h),(!$||l.bottom>$.bottom||l.bottom==$.bottom&&l.right>$.right)&&($=l),d<u+1&&(d=u),i(d,l.top,f-d,l.bottom)}),{start:a,end:$}}var a=e.display,s=e.doc,$=document.createDocumentFragment(),l=zt(e.display),u=l.left,c=Math.max(a.sizerWidth,Ft(e)-a.sizer.offsetLeft)-l.right,p=t.from(),d=t.to();if(p.line==d.line)o(p.line,p.ch,d.ch);else{var f=C(s,p.line),h=C(s,d.line),_=ue(f)==ue(h),g=o(p.line,p.ch,_?f.text.length+1:null).end,m=o(d.line,_?0:null,d.ch).start;_&&(g.top<m.top-2?(i(g.right,g.top,null,g.bottom),i(u,m.top,m.left,m.bottom)):i(g.right,g.top,m.left-g.right,g.bottom)),g.bottom<m.top&&i(u,g.bottom,null,m.top)}n.appendChild($)}function Sn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Nn(e){e.state.focused||(e.display.input.focus(),Rn(e))}function An(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Pn(e))},100)}function Rn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Se(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Jo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sn(e))}function Pn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Se(e,"blur",e,t),e.state.focused=!1,fa(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Mn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=vn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var $=0;$<s.length;$++)s[$].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function In(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=P(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,s=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Cr(e),!0}return!1}function Dn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=void 0;if(!i.hidden){if(Ko&&Qo<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var $=i.line.height-o;if(o<2&&(o=gn(t)),($>.001||$<-.001)&&(S(i.line,o),Ln(i.line),i.rest))for(var l=0;l<i.rest.length;l++)Ln(i.rest[l])}}}function Ln(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function jn(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-jt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=A(t,r),a=A(t,i);if(n&&n.ensure){var s=n.ensure.from.line,$=n.ensure.to.line;s<o?(o=s,a=A(t,ge(C(t,s))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=a&&(o=A(t,ge(C(t,$))-e.wrapper.clientHeight),a=$)}return{from:o,to:Math.max(a,o+1)}}function qn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Go||kr(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Go&&kr(e),yr(e,100))}function zn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Mn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Un(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Fn(e){var t=Un(e);return t.x*=Ka,t.y*=Ka,t}function Hn(e,t){var n=Un(t),r=n.x,i=n.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,$=a.scrollHeight>a.clientHeight;if(r&&s||i&&$){if(i&&sa&&Jo)e:for(var l=t.target,u=o.view;l!=a;l=l.parentNode)for(var c=0;c<u.length;c++)if(u[c].node==l){e.display.currentWheelTarget=l;break e}if(r&&!Go&&!ta&&null!=Ka)return i&&$&&qn(e,Math.max(0,Math.min(a.scrollTop+i*Ka,a.scrollHeight-a.clientHeight))),zn(e,Math.max(0,Math.min(a.scrollLeft+r*Ka,a.scrollWidth-a.clientWidth))),(!i||i&&$)&&Me(t),void(o.wheelStartX=null);if(i&&null!=Ka){var p=i*Ka,d=e.doc.scrollTop,f=d+o.wrapper.clientHeight;p<0?d=Math.max(0,d+p-50):f=Math.min(e.doc.height,f+p+50),kr(e,{top:d,bottom:f})}Xa<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ka=(Ka*Xa+n)/(Xa+1),++Xa)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function Bn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ut(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Wn(e,t){t||(t=Bn(e));var n=e.display.barWidth,r=e.display.barHeight;Gn(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Dn(e),Gn(e,Bn(e)),n=e.display.barWidth,r=e.display.barHeight}function Gn(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function Vn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&fa(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Za[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ra(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?zn(e,t):qn(e,t)},e),e.display.scrollbars.addClass&&a(e.display.wrapper,e.display.scrollbars.addClass)}function Yn(e,t){if(!Ne(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ia){var a=r("div","\u200b",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jt(e.display))+"px;\n height: "+(t.bottom-t.top+Ut(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Xn(e,t,n,r){null==r&&(r=0);for(var i,o=0;o<5;o++){var a=!1;i=un(e,t);var s=n&&n!=t?un(e,n):i,$=Qn(e,Math.min(i.left,s.left),Math.min(i.top,s.top)-r,Math.max(i.left,s.left),Math.max(i.bottom,s.bottom)+r),l=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=$.scrollTop&&(qn(e,$.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(a=!0)),null!=$.scrollLeft&&(zn(e,$.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function Kn(e,t,n,r,i){var o=Qn(e,t,n,r,i);null!=o.scrollTop&&qn(e,o.scrollTop),null!=o.scrollLeft&&zn(e,o.scrollLeft)}function Qn(e,t,n,r,i){var o=e.display,a=gn(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,$=Ht(e),l={};i-n>$&&(i=n+$);var u=e.doc.height+qt(o),c=n<a,p=i>u-a;if(n<s)l.scrollTop=c?0:n;else if(i>s+$){var d=Math.min(n,(p?u:i)-$);d!=s&&(l.scrollTop=d)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,h=Ft(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),_=r-t>h;return _&&(r=t+h),t<10?l.scrollLeft=0:t<f?l.scrollLeft=Math.max(0,t-(_?0:10)):r>h+f-3&&(l.scrollLeft=r+(_?0:10)-h),l}function Jn(e,t,n){null==t&&null==n||er(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Zn(e){er(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?M(t.line,t.ch-1):t,r=M(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function er(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=cn(e,t.from),r=cn(e,t.to),i=Qn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function tr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++es},yt(e.curOp)}function nr(e){bt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;rr(e)})}function rr(e){for(var t=e.ops,n=0;n<t.length;n++)ir(t[n]);for(var r=0;r<t.length;r++)or(t[r]);for(var i=0;i<t.length;i++)ar(t[i]);for(var o=0;o<t.length;o++)sr(t[o]);for(var a=0;a<t.length;a++)$r(t[a])}function ir(e){var t=e.cm,n=t.display;br(t),e.updateMaxLine&&ye(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ts(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function or(e){e.updatedDisplay=e.mustUpdate&&wr(e.cm,e.update)}function ar(e){var t=e.cm,n=t.display;e.updatedDisplay&&Dn(t),e.barMeasure=Bn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Vt(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ut(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ft(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function sr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&zn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==o()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wn(t,e.barMeasure),e.updatedDisplay&&Tr(t,e.barMeasure),e.selectionChanged&&Sn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Nn(e.cm)}function $r(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&xr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,Mn(t)),e.scrollToPos){var i=Xn(t,U(r,e.scrollToPos.from),U(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Yn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Se(o[s],"hide");if(a)for(var $=0;$<a.length;++$)a[$].lines.length&&Se(a[$],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function lr(e,t){if(e.curOp)return t();tr(e);try{return t()}finally{nr(e)}}function ur(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tr(e);try{return t.apply(e,arguments)}finally{nr(e)}}}function cr(e){return function(){if(this.curOp)return e.apply(this,arguments);tr(this);try{return e.apply(this,arguments)}finally{nr(this)}}}function pr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tr(t);try{return e.apply(this,arguments)}finally{nr(t)}}}function dr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Oa&&de(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)Oa&&fe(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=_r(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var a=_r(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):hr(e)}else{var s=_r(e,t,t,-1),$=_r(e,n,n+r,1);s&&$?(i.view=i.view.slice(0,s.index).concat(mt(e,s.lineN,$.lineN)).concat(i.view.slice($.index)),i.viewTo+=r):hr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[kn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==c(a,n)&&a.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _r(e,t,n,r){var i,o=kn(e,t),a=e.display.view;if(!Oa||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,$=0;$<o;$++)s+=a[$].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;de(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function gr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=mt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=mt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(kn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(mt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,kn(e,n)))),r.viewTo=n}function mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function yr(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,$(vr,e))}function vr(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ye(t.mode,Ze(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength,$=Qe(e,o,s?Ye(t.mode,r):r,!0);o.styles=$.styles;var l=o.styleClasses,u=$.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),p=0;!c&&p<a.length;++p)c=a[p]!=o.styles[p];c&&i.push(t.frontier),o.stateAfter=s?r:Ye(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&et(e,o.text,r),o.stateAfter=t.frontier%5==0?Ye(t.mode,r):null;if(++t.frontier,+new Date>n)return yr(e,e.options.workDelay),!0}),i.length&&lr(e,function(){for(var t=0;t<i.length;t++)fr(e,i[t],"text")})}}function br(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ut(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ut(e)+"px",t.scrollbarsClipped=!0)}function wr(e,n){var r=e.display,i=e.doc;if(n.editorIsHidden)return hr(e),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==mr(e))return!1;In(e)&&(hr(e),n.dims=yn(e));var a=i.first+i.size,s=Math.max(n.visible.from-e.options.viewportMargin,i.first),$=Math.min(a,n.visible.to+e.options.viewportMargin);r.viewFrom<s&&s-r.viewFrom<20&&(s=Math.max(i.first,r.viewFrom)),r.viewTo>$&&r.viewTo-$<20&&($=Math.min(a,r.viewTo)),Oa&&(s=de(e.doc,s),$=fe(e.doc,$));var l=s!=r.viewFrom||$!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;gr(e,s,$),r.viewOffset=ge(C(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=mr(e);if(!l&&0==u&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=o();return u>4&&(r.lineDiv.style.display="none"),Er(e,r.updateLineNumbers,n.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,c&&o()!=c&&c.offsetHeight&&c.focus(),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,yr(e,400)),r.updateLineNumbers=null,!0}function xr(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ft(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qt(e.display)-Ht(e),n.top)}),t.visible=jn(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&wr(e,t);r=!1){Dn(e);var i=Bn(e);En(e),Wn(e,i),Tr(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function kr(e,t){var n=new ts(e,t);if(wr(e,n)){Dn(e),xr(e,n);var r=Bn(e);En(e),Wn(e,r),Tr(e,r),n.finish()}}function Er(e,n,r){function i(t){var n=t.nextSibling;return Jo&&sa&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,a=e.options.lineNumbers,s=o.lineDiv,$=s.firstChild,l=o.view,u=o.viewFrom,p=0;p<l.length;p++){var d=l[p];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;$!=d.node;)$=i($);var f=a&&null!=n&&n<=u&&d.lineNumber;d.changes&&(c(d.changes,"gutter")>-1&&(f=!1),kt(e,d,u,r)),f&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(P(e.options,u)))),$=d.node.nextSibling}else{var h=Rt(e,d,u,r);s.insertBefore(h,$)}u+=d.size}for(;$;)$=i($)}function Cr(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Tr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ut(e)+"px"}function Or(e){var n=e.display.gutters,i=e.options.gutters;t(n);for(var o=0;o<i.length;++o){var a=i[o],s=n.appendChild(r("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}n.style.display=o?"":"none",Cr(e)}function Sr(e){var t=c(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Nr(e,t){var n=e[t];e.sort(function(e,t){return I(e.from(),t.from())}),t=c(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(I(o.to(),i.from())>=0){var a=q(o.from(),i.from()),s=j(o.to(),i.to()),$=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new rs($?s:a,$?a:s))}}return new ns(e,t)}function Ar(e,t){return new ns([new rs(e,t||e)],0)}function Rr(e){return e.text?M(e.from.line+e.text.length-1,f(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Pr(e,t){if(I(e,t.from)<0)return e;if(I(e,t.to)<=0)return Rr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Rr(t).ch-t.to.ch),M(n,r)}function Mr(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new rs(Pr(i.anchor,t),Pr(i.head,t)))}return Nr(n,e.sel.primIndex)}function Ir(e,t,n){return e.line==t.line?M(n.line,e.ch-t.ch+n.ch):M(n.line+(e.line-t.line),e.ch)}function Dr(e,t,n){for(var r=[],i=M(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],$=Ir(s.from,i,o),l=Ir(Rr(s),i,o);if(i=s.to,o=l,"around"==n){var u=e.sel.ranges[a],c=I(u.head,u.anchor)<0;r[a]=new rs(c?l:$,c?$:l)}else r[a]=new rs($,$)}return new ns(r,e.sel.primIndex)}function Lr(e){e.doc.mode=Ge(e.options,e.doc.modeOption),jr(e)}function jr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,yr(e,100),e.state.modeGen++,e.curOp&&dr(e)}function qr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==f(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function zr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){st(e,n,i,r),wt(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Fa(l[o],i(o),r));return n}var s=t.from,$=t.to,l=t.text,u=C(e,s.line),c=C(e,$.line),p=f(l),d=i(l.length-1),h=$.line-s.line;if(t.full)e.insert(0,a(0,l.length)),e.remove(l.length,e.size-l.length);else if(qr(e,t)){var _=a(0,l.length-1);o(c,c.text,d),h&&e.remove(s.line,h),_.length&&e.insert(s.line,_)}else if(u==c)if(1==l.length)o(u,u.text.slice(0,s.ch)+p+u.text.slice($.ch),d);else{var g=a(1,l.length-1);g.push(new Fa(p+u.text.slice($.ch),d,r)),o(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}else if(1==l.length)o(u,u.text.slice(0,s.ch)+l[0]+c.text.slice($.ch),i(0)),e.remove(s.line+1,h);else{o(u,u.text.slice(0,s.ch)+l[0],i(0)),o(c,p+c.text.slice($.ch),d);var m=a(1,l.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,m)}wt(e,"change",e,t)}function Ur(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var $=o&&s.sharedHist;n&&!$||(t(s.doc,$),r(s.doc,e,$))}}}r(e,null,!0)}function Fr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wn(e),Lr(e),e.options.lineWrapping||ye(e),e.options.mode=t.modeOption,dr(e)}function Hr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Br(e,t){var n={from:L(t.from),to:Rr(t),text:T(e,t.from,t.to)};return Qr(e,n,t.from.line,t.to.line+1),Ur(e,function(e){return Qr(e,n,t.from.line,t.to.line+1)},!0),n}function Wr(e){for(;e.length;){if(!f(e).ranges)break;e.pop()}}function Gr(e,t){return t?(Wr(e.done),f(e.done)):e.done.length&&!f(e.done).ranges?f(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),f(e.done)):void 0}function Vr(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Gr(i,i.lastOp==r)))a=f(o.changes),0==I(t.from,t.to)&&0==I(t.from,a.to)?a.to=Rr(t):o.changes.push(Br(e,t));else{var $=f(i.done);for($&&$.ranges||Kr(e.sel,i.done),o={changes:[Br(e,t)],generation:i.generation},
@@ -1903,7 +1903,7 @@ var n,r=e(154);n=r.now?function(){return r.now()}:function(){return Date.now()},
1903
1903
  */
1904
1904
  "use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[48])(48)})}),Opal.loaded(["hyperloop/console/sources/react-dom"]),
1905
1905
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
1906
- function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push($),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var c=0;e.current().length<u;){var p=e.next();if("("==p?c+=1:")"==p&&(c-=1),c<0)break}if(e.backUp(e.current().length-o),0==c)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var f="string",h=!0;e.eat("s")?f="atom":e.eat(/[WQ]/)?f="string":e.eat(/[r]/)?f="string-2":e.eat(/[wxq]/)&&(f="string",h=!1);var _=e.eat(/[^\w\s=]/);return _?(d.propertyIsEnumerable(_)&&(_=d[_]),n(a(_,f,h,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(s(r[1]),e,t);if("0"==i)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return l=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var g=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||g||(l="."),"operator"}return null}return l="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,s){var $,l=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=($=a.next());){if($==e&&(r||!l)){s.tokenize.pop();break}if(n&&"#"==$&&!l){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}l=!l&&"\\"==$}return t}}function s(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function $(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var l,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),p=t(["end","until"]),d={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){l=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=l;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":p.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(l||r&&"comment"!=r)&&(t.lastTok=i),"|"==l&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(l)?t.context={prev:t.context,type:l||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(l))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==l||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==d[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),Opal.loaded(["hyperloop/console/ruby"]),Opal.modules["hyperloop/console/client_components"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}function i(e,t){return"number"==typeof e&&"number"==typeof t?e<t:e["$<"](t)}var o,a,s,$=e.top,l=e,u=e.nil,c=(e.breaker,e.slice,e.klass),p=e.hash2,d=e.range,f=e.hash;return e.add_stubs(["$param","$state","$attr_accessor","$tap","$uuid","$error_message","$mutate","$=~","$evaluate","$[]","$<<","$history","$console_state","$run","$application_window_id","$console_id","$context","$after_mount","$application_window_id=","$params","$context=","$parse","$title","$on_dispatch","$==","$target_id","$kind","$message","$to_json","$after_update","$render","$on","$set_focus","$prevent_default","$DIV","$each","$CodeHistoryItem","$first","$last","$CodeEditor","$attr_reader","$dom_node","$to_s","$!","$item_type","$===","$value","$format_lines","$gsub","$split","$join","$+","$shift","$collect","$include?","$length","$-","$count","$before_mount","$format","$mark_response_lines","$stop_propagation","$editor","$set_focus_at_end","$compact","$lambda","$on_change","$on_key_down","$editor=","$class","$before_unmount","$[]=","$after","$>","$move_history","$<","$parse_error","$to_n","$clear_error","$empty?","$compile","$ready!","$mark_error","$ready?","$DebugConsole","$attr"]),function(t,$super){function n(){}var r,i,o,a,s,$,l,h=n=c(t,$super,"DebugConsole",n),_=(h.$$proto,h.$$scope);h.$param("application_window_id"),h.$param("context"),h.$param("title"),h.$state(p(["history","scope"],{history:[],scope:"shared"})),h.$state(p(["console_state","scope"],{console_state:"waiting_for_code",scope:"shared"})),function(t){var n,r,i,o=t.$$scope;t.$$proto;t.$attr_accessor("application_window_id"),t.$attr_accessor("context"),e.defn(t,"$console_id",n=function(){var e,t,n,r,i,a=this;return null==a.console_id&&(a.console_id=u),!1!==(e=a.console_id)&&e!==u&&null!=e?e:a.console_id=!1!==(t=sessionStorage.getItem("Hyperloop::Console::ConsoleId"))&&t!==u&&null!=t?t:(n=(r=o.get("SecureRandom").$uuid()).$tap,n.$$p=(i=function(e){i.$$s;return null==e&&(e=u),sessionStorage.setItem("Hyperloop::Console::ConsoleId",e)},i.$$s=a,i.$$arity=1,i),n).call(r)},n.$$arity=0),e.defn(t,"$ready!",r=function(e,t){var n,r=this;return null==r.code_to_send&&(r.code_to_send=u),r.code_to_send=e,r.$mutate().$error_message(u),(n=r.code_to_send["$=~"](/.\n$/))===u||null==n||n.$$is_boolean&&1!=n?u:r.$evaluate(t)},r.$$arity=2),e.defn(t,"$evaluate",i=function(e){var t=this;return null==t.code_to_send&&(t.code_to_send=u),t.code_to_send=t.code_to_send["$[]"](d(0,-2,!1)),t.$mutate().$history()["$<<"](p(["eval"],{eval:t.code_to_send})),t.$mutate().$console_state("sending"),o.get("Evaluate").$run(p(["target_id","sender_id","context","string"],{target_id:t.$application_window_id(),sender_id:t.$console_id(),context:t.$context(),string:e}))},i.$$arity=1)}(e.get_singleton_class(h)),(r=(i=h).$after_mount,r.$$p=(o=function(){var e,t,n,r=o.$$s||this;return e=[r.$params().$application_window_id()],t=_.get("DebugConsole"),t["$application_window_id="].apply(t,e),e[e.length-1],e=[r.$params().$context()],t=_.get("DebugConsole"),t["$context="].apply(t,e),e[e.length-1],r.$mutate().$history(_.get("JSON").$parse(!1!==(e=sessionStorage.getItem("Hyperloop::Console.history"))&&e!==u&&null!=e?e:"[]")),document.title=r.$params().$title(),window.scrollTo(window.scrollX,99999),(e=(t=_.get("Response")).$on_dispatch,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=u),e.$target_id()["$=="](_.get("DebugConsole").$console_id())?(t.$mutate().$console_state("waiting_for_code"),t.$mutate().$history()["$<<"](f(e.$kind(),e.$message())),sessionStorage.setItem("Hyperloop::Console.history",t.$state().$history().$to_json())):u},n.$$s=r,n.$$arity=1,n),e).call(t)},o.$$s=h,o.$$arity=0,o),r).call(i),(r=(a=h).$after_update,r.$$p=(s=function(){s.$$s;return window.scrollTo(window.scrollX,99999)},s.$$s=h,s.$$arity=0,s),r).call(a),(r=($=h).$render,r.$$p=(l=function(){var e,t,n,r,i,o,a=l.$$s||this;return(e=(t=(r=(i=a).$DIV,r.$$p=(o=function(){var e,t,n,r=o.$$s||this;return(e=(t=r.$state().$history()).$each,e.$$p=(n=function(e){var t,r=n.$$s||this;return null==e&&(e=u),r.$CodeHistoryItem(p(["item_type","value"],{item_type:e.$first().$first(),value:!1!==(t=e.$first().$last())&&t!==u&&null!=t?t:""}))},n.$$s=r,n.$$arity=1,n),e).call(t),r.$state().$console_state()["$=="]("sending")?u:r.$CodeEditor(p(["history","context"],{history:r.$state().$history(),context:r.$params().$context()}))},o.$$s=a,o.$$arity=0,o),r).call(i,p(["class"],{"class":"card"}))).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=u),_.get("CodeEditor").$set_focus(),e.$prevent_default()},n.$$s=a,n.$$arity=1,n),e).call(t,"mouse_down")},l.$$s=h,l.$$arity=0,l),r).call($,_.get("DIV"),p(["style"],{style:p(["height"],{height:"100vh"})}))}(l.base,l.get("Hyperloop").$$scope.get("Component")),function(e,$super){function t(){}var n,r,i,o=t=c(e,$super,"CodeMirror",t),a=(o.$$proto,o.$$scope);o.$attr_reader("editor"),(n=(r=o).$after_mount,n.$$p=(i=function(){var e=i.$$s||this;return null==e.code&&(e.code=u),null==e.read_only&&(e.read_only=u),e.editor=CodeMirror(e.$dom_node(),{value:e.code.$to_s(),mode:"text/x-ruby",matchBrackets:!0,lineNumbers:!1,indentUnit:2,theme:"github",readOnly:e.read_only["$!"]()["$!"]()})},i.$$s=o,i.$$arity=0,i),n).call(r),o.$render(a.get("DIV"))}(l.base,l.get("Hyperloop").$$scope.get("Component")),function(r,$super){function i(){}var o,a,s,$,l,p,d,f,h,_,g=i=c(r,$super,"CodeHistoryItem",i),m=g.$$proto;g.$$scope;m.editor=u,g.$param("item_type"),g.$param("value"),e.defn(g,"$format",o=function(){var e=this,t=u;return function(){return t=e.$params().$item_type(),"eval"["$==="](t)?e.$params().$value():"exception"["$==="](t)?e.$format_lines("!!",e.$params().$value()):"result"["$==="](t)?e.$format_lines(">>",e.$params().$value()):e.$format_lines(e.$params().$item_type()+":",e.$params().$value())}()},o.$$arity=0),e.defn(g,"$format_lines",a=function(e,n){var r,i,o,a=this,s=u,$=u;return s=e.$gsub(/./," "),$=n.$split("\n"),t([e+" "+$.$shift()],(r=(i=$).$collect,r.$$p=(o=function(e){o.$$s;return null==e&&(e=u),s+" "+e},o.$$s=a,o.$$arity=1,o),r).call(i)).$join("\n")},a.$$arity=2),e.defn(g,"$mark_response_lines",s=function(){var e,r=this,i=u,o=u,a=u;return r.$params().$item_type()["$=="]("eval")?u:(i=r.$params().$value().$split("\n"),o=function(){return(e=["exception","result"]["$include?"](r.$params().$item_type()))===u||null==e||e.$$is_boolean&&1!=e?t(2,r.$params().$item_type().$to_s().$length()):3}(),a=!1!==(e=i["$[]"](-1))&&e!==u&&null!=e?e:"",r.editor.markText({line:0,ch:0},{line:n(i.$count(),1),ch:t(a.$length(),o)},{className:"response-line"}))},s.$$arity=0),($=(l=g).$before_mount,$.$$p=(p=function(){var e=p.$$s||this;return e.code=e.$format(),e.read_only=!0},p.$$s=g,p.$$arity=0,p),$).call(l),($=(d=g).$after_mount,$.$$p=(f=function(){return(f.$$s||this).$mark_response_lines()},f.$$s=g,f.$$arity=0,f),$).call(d),($=(h=g).$render,$.$$p=(_=function(){var e,t,n,r,i,o,a=_.$$s||this;return(e=(t=(r=(i=a).$DIV,r.$$p=(o=function(){o.$$s;return u},o.$$s=a,o.$$arity=0,o),r).call(i)).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=u),e.$stop_propagation()},n.$$s=a,n.$$arity=1,n),e).call(t,"mouse_down")},_.$$s=g,_.$$arity=0,_),$).call(h)}(l.base,l.get("CodeMirror")),function(o,$super){function a(){}var s,$,l,d,f,h,_,g,m,y,v,b,w,x,k,E,C=a=c(o,$super,"CodeEditor",a),T=C.$$proto,O=C.$$scope;T.history=T.history_pos=T.editor=T.error=u,C.$param("history"),C.$param("context"),function(t){var n;t.$$scope,t.$$proto;t.$attr_accessor("editor"),e.defn(t,"$set_focus",n=function(){var e,t=this;return(e=t.$editor())===u||null==e||e.$$is_boolean&&1!=e?u:t.$editor().$set_focus_at_end()},n.$$arity=0)}(e.get_singleton_class(C)),(s=($=C).$before_mount,s.$$p=(l=function(){var e,r,i,o=l.$$s||this;return null==o.history&&(o.history=u),o.history=t((e=(r=o.$params().$history()).$collect,e.$$p=(i=function(e){i.$$s;return null==e&&(e=u),e["$[]"]("eval")},i.$$s=o,i.$$arity=1,i),e).call(r).$compact(),[""]),o.history_pos=n(o.history.$length(),1)},l.$$s=C,l.$$arity=0,l),s).call($),(s=(d=C).$after_mount,s.$$p=(f=function(){var e,t,n,r,i,o,a=f.$$s||this;return null==a.editor&&(a.editor=u),a.editor.on("change",(e=(t=a).$lambda,e.$$p=(n=function(){return(n.$$s||this).$on_change()},n.$$s=a,n.$$arity=0,n),e).call(t)),a.editor.on("keydown",(e=(r=a).$lambda,e.$$p=(i=function(e,t){var n=i.$$s||this;return null==e&&(e=u),null==t&&(t=u),n.$on_key_down(e,t)},i.$$s=a,i.$$arity=2,i),e).call(r)),a.editor.focus(),e=[a],o=a.$class(),o["$editor="].apply(o,e),e[e.length-1]},f.$$s=C,f.$$arity=0,f),s).call(d),(s=(h=C).$before_unmount,s.$$p=(_=function(){var e,t,n=_.$$s||this;return e=[u],t=n.$class(),t["$editor="].apply(t,e),e[e.length-1]},_.$$s=C,_.$$arity=0,_),s).call(h),e.defn(C,"$move_history",g=function(e){var n,r,i,o=this,a=u,s=u;return o.history["$[]="](o.history_pos,o.editor.getValue()),o.history_pos=t(o.history_pos,e),a=o.history["$[]"](o.history_pos),s=a.$split("\n"),o.editor.setValue(a),(n=(r=o).$after,n.$$p=(i=function(){var e,t=i.$$s||this;return null==t.editor&&(t.editor=u),window.scrollTo(window.scrollX,99999),t.editor.setCursor({line:s.$count(),ch:(!1!==(e=s.$last())&&e!==u&&null!=e?e:"").$length()})},i.$$s=o,i.$$arity=0,i),n).call(r,0)},g.$$arity=1),e.defn(C,"$set_focus_at_end",m=function(){var e,t=this,n=u;return t.editor.focus(),n=t.editor.getValue().$split("\n"),t.editor.setCursor({line:n.$count(),ch:(!1!==(e=n.$last())&&e!==u&&null!=e?e:"").$length()})},m.$$arity=0),e.defn(C,"$on_key_down",y=function(e,t){var o,a,s=this;return(o=!1!==(a=t.metaKey)&&a!==u&&null!=a?a:t.ctrlKey)===u||null==o||o.$$is_boolean&&1!=o?t.key["$=="]("ArrowUp")?(o=r(s.history_pos,0))===u||null==o||o.$$is_boolean&&1!=o?u:s.$move_history(-1):t.key["$=="]("ArrowDown")?(o=i(s.history_pos,n(s.history.$length(),1)))===u||null==o||o.$$is_boolean&&1!=o?u:s.$move_history(1):u:t.keyCode["$=="](13)?s.editor.setValue(s.editor.getValue()+"\n"):u},y.$$arity=2),e.defn(C,"$mark_error",v=function(t){var n,r,i=this,o=u,a=u,s=u;return r=i.$parse_error(t),n=e.to_ary(r),o=null==n[0]?u:n[0],a=null==n[1]?u:n[1],s=null==n[2]?u:n[2],i.error=i.editor.markText(o.$to_n(),a.$to_n(),{className:"syntax-error",title:s})},v.$$arity=1),e.defn(C,"$parse_error",b=function(e){var t=this,n=u,r=u;return e=e.$split("\n"),e["$[]"](3).$split(":"),n=t.editor.lineCount(),r=t.editor.getLine(n-1),[p(["line","ch"],{line:0,ch:0}),p(["line","ch"],{line:n,ch:r.$length()}),e["$[]"](2).$split(":(file)")["$[]"](0)]},b.$$arity=1),e.defn(C,"$clear_error",w=function(){var e,t=this;return(e=t.error)===u||null==e||e.$$is_boolean&&1!=e||t.error.clear(),t.error=u},w.$$arity=0),e.defn(C,"$on_change",x=function(){var t,n=this,r=u,i=u,o=u;try{return n.$clear_error(),r=n.editor.getValue(),i=(t=n.$params().$context()["$empty?"]())===u||null==t||t.$$is_boolean&&1!=t?O.get("Opal").$compile(n.$params().$context()+".instance_eval {"+r+"}"):O.get("Opal").$compile(r,p(["irb"],{irb:!0})),O.get("DebugConsole")["$ready!"](r,i)}catch(t){if(!e.rescue(t,[O.get("Exception")]))throw t;o=t;try{return n.$mark_error(o.$message())}finally{e.pop_exception()}}},x.$$arity=0),(s=(k=C).$render,s.$$p=(E=function(){var e,t,n,r,i,o,a=E.$$s||this;return(e=(t=(r=(i=a).$DIV,r.$$p=(o=function(){o.$$s;return u},o.$$s=a,o.$$arity=0,o),r).call(i)).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=u),e.$stop_propagation()},n.$$s=a,n.$$arity=1,n),e).call(t,"mouse_down")},E.$$s=C,E.$$arity=0,E),s).call(k)}(l.base,l.get("CodeMirror")),(o=(a=l.get("Document"))["$ready?"],o.$$p=(s=function(){var e,t,n,r=s.$$s||this,i=u;return i=l.get("Element")["$[]"]("[data-react-class='React.TopLevelRailsComponent']"),(e=(t=i).$render,e.$$p=(n=function(){return(n.$$s||this).$DebugConsole(l.get("JSON").$parse(i.$attr("data-react-props"))["$[]"]("render_params"))},n.$$s=r,n.$$arity=0,n),e).call(t)},s.$$s=$,s.$$arity=0,s),o).call(a)},/*!
1906
+ function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push($),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var c=0;e.current().length<u;){var p=e.next();if("("==p?c+=1:")"==p&&(c-=1),c<0)break}if(e.backUp(e.current().length-o),0==c)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var f="string",h=!0;e.eat("s")?f="atom":e.eat(/[WQ]/)?f="string":e.eat(/[r]/)?f="string-2":e.eat(/[wxq]/)&&(f="string",h=!1);var _=e.eat(/[^\w\s=]/);return _?(d.propertyIsEnumerable(_)&&(_=d[_]),n(a(_,f,h,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(s(r[1]),e,t);if("0"==i)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return l=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var g=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||g||(l="."),"operator"}return null}return l="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,s){var $,l=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=($=a.next());){if($==e&&(r||!l)){s.tokenize.pop();break}if(n&&"#"==$&&!l){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}l=!l&&"\\"==$}return t}}function s(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function $(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var l,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),p=t(["end","until"]),d={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){l=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=l;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":p.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(l||r&&"comment"!=r)&&(t.lastTok=i),"|"==l&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(l)?t.context={prev:t.context,type:l||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(l))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==l||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==d[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),Opal.loaded(["hyperloop/console/ruby"]),Opal.modules["hyperloop/console/client_components"]=function(e){function t(e,t){return"number"==typeof e&&"number"==typeof t?e+t:e["$+"](t)}function n(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e["$-"](t)}function r(e,t){return"number"==typeof e&&"number"==typeof t?e>t:e["$>"](t)}function i(e,t){return"number"==typeof e&&"number"==typeof t?e<t:e["$<"](t)}var o=(e.top,e),a=e.nil,s=(e.breaker,e.slice,e.module),$=e.klass,l=e.hash2,u=e.range,c=e.hash;return e.add_stubs(["$param","$state","$attr_accessor","$tap","$uuid","$error_message","$mutate","$=~","$evaluate","$[]","$<<","$history","$console_state","$run","$application_window_id","$console_id","$context","$after_mount","$application_window_id=","$params","$context=","$parse","$title","$on_dispatch","$==","$target_id","$kind","$message","$to_json","$after_update","$render","$on","$set_focus","$prevent_default","$DIV","$each","$CodeHistoryItem","$first","$last","$CodeEditor","$attr_reader","$dom_node","$to_s","$!","$item_type","$===","$value","$format_lines","$gsub","$split","$join","$+","$shift","$collect","$include?","$length","$-","$count","$before_mount","$format","$mark_response_lines","$stop_propagation","$editor","$set_focus_at_end","$compact","$lambda","$on_change","$on_key_down","$editor=","$class","$before_unmount","$[]=","$after","$>","$move_history","$<","$parse_error","$to_n","$clear_error","$empty?","$compile","$ready!","$mark_error","$ready?","$DebugConsole","$attr"]),function(o){var p,d=p=s(o,"Hyperloop"),f=(d.$$proto,d.$$scope);!function(o){var p,d,f,h,_=p=s(o,"Console"),g=(_.$$proto,_.$$scope);!function(t,$super){function n(){}var r,i,o,s,p,d,f,h=n=$(t,$super,"DebugConsole",n),_=(h.$$proto,h.$$scope);h.$param("application_window_id"),h.$param("context"),h.$param("title"),h.$state(l(["history","scope"],{history:[],scope:"shared"})),h.$state(l(["console_state","scope"],{console_state:"waiting_for_code",scope:"shared"})),function(t){var n,r,i,o=t.$$scope;t.$$proto;t.$attr_accessor("application_window_id"),t.$attr_accessor("context"),e.defn(t,"$console_id",n=function(){var e,t,n,r,i,s=this;return null==s.console_id&&(s.console_id=a),!1!==(e=s.console_id)&&e!==a&&null!=e?e:s.console_id=!1!==(t=sessionStorage.getItem("Hyperloop::Console::ConsoleId"))&&t!==a&&null!=t?t:(n=(r=o.get("SecureRandom").$uuid()).$tap,n.$$p=(i=function(e){i.$$s;return null==e&&(e=a),sessionStorage.setItem("Hyperloop::Console::ConsoleId",e)},i.$$s=s,i.$$arity=1,i),n).call(r)},n.$$arity=0),e.defn(t,"$ready!",r=function(e,t){var n,r=this;return null==r.code_to_send&&(r.code_to_send=a),r.code_to_send=e,r.$mutate().$error_message(a),(n=r.code_to_send["$=~"](/.\n$/))===a||null==n||n.$$is_boolean&&1!=n?a:r.$evaluate(t)},r.$$arity=2),e.defn(t,"$evaluate",i=function(e){var t=this;return null==t.code_to_send&&(t.code_to_send=a),t.code_to_send=t.code_to_send["$[]"](u(0,-2,!1)),t.$mutate().$history()["$<<"](l(["eval"],{eval:t.code_to_send})),t.$mutate().$console_state("sending"),o.get("Evaluate").$run(l(["target_id","sender_id","context","string"],{target_id:t.$application_window_id(),sender_id:t.$console_id(),context:t.$context(),string:e}))},i.$$arity=1)}(e.get_singleton_class(h)),(r=(i=h).$after_mount,r.$$p=(o=function(){var e,t,n,r=o.$$s||this;return e=[r.$params().$application_window_id()],t=_.get("DebugConsole"),t["$application_window_id="].apply(t,e),e[e.length-1],e=[r.$params().$context()],t=_.get("DebugConsole"),t["$context="].apply(t,e),e[e.length-1],r.$mutate().$history(_.get("JSON").$parse(!1!==(e=sessionStorage.getItem("Hyperloop::Console.history"))&&e!==a&&null!=e?e:"[]")),document.title=r.$params().$title(),window.scrollTo(window.scrollX,99999),(e=(t=_.get("Response")).$on_dispatch,e.$$p=(n=function(e){var t=n.$$s||this;return null==e&&(e=a),e.$target_id()["$=="](_.get("DebugConsole").$console_id())?(t.$mutate().$console_state("waiting_for_code"),t.$mutate().$history()["$<<"](c(e.$kind(),e.$message())),sessionStorage.setItem("Hyperloop::Console.history",t.$state().$history().$to_json())):a},n.$$s=r,n.$$arity=1,n),e).call(t)},o.$$s=h,o.$$arity=0,o),r).call(i),(r=(s=h).$after_update,r.$$p=(p=function(){p.$$s;return window.scrollTo(window.scrollX,99999)},p.$$s=h,p.$$arity=0,p),r).call(s),(r=(d=h).$render,r.$$p=(f=function(){var e,t,n,r,i,o,s=f.$$s||this;return(e=(t=(r=(i=s).$DIV,r.$$p=(o=function(){var e,t,n,r=o.$$s||this;return(e=(t=r.$state().$history()).$each,e.$$p=(n=function(e){var t,r=n.$$s||this;return null==e&&(e=a),r.$CodeHistoryItem(l(["item_type","value"],{item_type:e.$first().$first(),value:!1!==(t=e.$first().$last())&&t!==a&&null!=t?t:""}))},n.$$s=r,n.$$arity=1,n),e).call(t),r.$state().$console_state()["$=="]("sending")?a:r.$CodeEditor(l(["history","context"],{history:r.$state().$history(),context:r.$params().$context()}))},o.$$s=s,o.$$arity=0,o),r).call(i,l(["class"],{"class":"card"}))).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=a),_.get("CodeEditor").$set_focus(),e.$prevent_default()},n.$$s=s,n.$$arity=1,n),e).call(t,"mouse_down")},f.$$s=h,f.$$arity=0,f),r).call(d,_.get("DIV"),l(["style"],{style:l(["height"],{height:"100vh"})}))}(g.base,g.get("Hyperloop").$$scope.get("Component")),function(e,$super){function t(){}var n,r,i,o=t=$(e,$super,"CodeMirror",t),s=(o.$$proto,o.$$scope);o.$attr_reader("editor"),(n=(r=o).$after_mount,n.$$p=(i=function(){var e=i.$$s||this;return null==e.code&&(e.code=a),null==e.read_only&&(e.read_only=a),e.editor=CodeMirror(e.$dom_node(),{value:e.code.$to_s(),mode:"text/x-ruby",matchBrackets:!0,lineNumbers:!1,indentUnit:2,theme:"github",readOnly:e.read_only["$!"]()["$!"]()})},i.$$s=o,i.$$arity=0,i),n).call(r),o.$render(s.get("DIV"))}(g.base,g.get("Hyperloop").$$scope.get("Component")),function(r,$super){function i(){}var o,s,l,u,c,p,d,f,h,_,g=i=$(r,$super,"CodeHistoryItem",i),m=g.$$proto;g.$$scope;m.editor=a,g.$param("item_type"),g.$param("value"),e.defn(g,"$format",o=function(){var e=this,t=a;return function(){return t=e.$params().$item_type(),"eval"["$==="](t)?e.$params().$value():"exception"["$==="](t)?e.$format_lines("!!",e.$params().$value()):"result"["$==="](t)?e.$format_lines(">>",e.$params().$value()):e.$format_lines(e.$params().$item_type()+":",e.$params().$value())}()},o.$$arity=0),e.defn(g,"$format_lines",s=function(e,n){var r,i,o,s=this,$=a,l=a;return $=e.$gsub(/./," "),l=n.$split("\n"),t([e+" "+l.$shift()],(r=(i=l).$collect,r.$$p=(o=function(e){o.$$s;return null==e&&(e=a),$+" "+e},o.$$s=s,o.$$arity=1,o),r).call(i)).$join("\n")},s.$$arity=2),e.defn(g,"$mark_response_lines",l=function(){var e,r=this,i=a,o=a,s=a;return r.$params().$item_type()["$=="]("eval")?a:(i=r.$params().$value().$split("\n"),o=function(){return(e=["exception","result"]["$include?"](r.$params().$item_type()))===a||null==e||e.$$is_boolean&&1!=e?t(2,r.$params().$item_type().$to_s().$length()):3}(),s=!1!==(e=i["$[]"](-1))&&e!==a&&null!=e?e:"",r.editor.markText({line:0,ch:0},{line:n(i.$count(),1),ch:t(s.$length(),o)},{className:"response-line"}))},l.$$arity=0),(u=(c=g).$before_mount,u.$$p=(p=function(){var e=p.$$s||this;return e.code=e.$format(),e.read_only=!0},p.$$s=g,p.$$arity=0,p),u).call(c),(u=(d=g).$after_mount,u.$$p=(f=function(){return(f.$$s||this).$mark_response_lines()},f.$$s=g,f.$$arity=0,f),u).call(d),(u=(h=g).$render,u.$$p=(_=function(){var e,t,n,r,i,o,s=_.$$s||this;return(e=(t=(r=(i=s).$DIV,r.$$p=(o=function(){o.$$s;return a},o.$$s=s,o.$$arity=0,o),r).call(i)).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=a),e.$stop_propagation()},n.$$s=s,n.$$arity=1,n),e).call(t,"mouse_down")},_.$$s=g,_.$$arity=0,_),u).call(h)}(g.base,g.get("CodeMirror")),function(o,$super){function s(){}var u,c,p,d,f,h,_,g,m,y,v,b,w,x,k,E,C=s=$(o,$super,"CodeEditor",s),T=C.$$proto,O=C.$$scope;T.history=T.history_pos=T.editor=T.error=a,C.$param("history"),C.$param("context"),function(t){var n;t.$$scope,t.$$proto;t.$attr_accessor("editor"),e.defn(t,"$set_focus",n=function(){var e,t=this;return(e=t.$editor())===a||null==e||e.$$is_boolean&&1!=e?a:t.$editor().$set_focus_at_end()},n.$$arity=0)}(e.get_singleton_class(C)),(u=(c=C).$before_mount,u.$$p=(p=function(){var e,r,i,o=p.$$s||this;return null==o.history&&(o.history=a),o.history=t((e=(r=o.$params().$history()).$collect,e.$$p=(i=function(e){i.$$s;return null==e&&(e=a),e["$[]"]("eval")},i.$$s=o,i.$$arity=1,i),e).call(r).$compact(),[""]),o.history_pos=n(o.history.$length(),1)},p.$$s=C,p.$$arity=0,p),u).call(c),(u=(d=C).$after_mount,u.$$p=(f=function(){var e,t,n,r,i,o,s=f.$$s||this;return null==s.editor&&(s.editor=a),s.editor.on("change",(e=(t=s).$lambda,e.$$p=(n=function(){return(n.$$s||this).$on_change()},n.$$s=s,n.$$arity=0,n),e).call(t)),s.editor.on("keydown",(e=(r=s).$lambda,e.$$p=(i=function(e,t){var n=i.$$s||this;return null==e&&(e=a),null==t&&(t=a),n.$on_key_down(e,t)},i.$$s=s,i.$$arity=2,i),e).call(r)),s.editor.focus(),e=[s],o=s.$class(),o["$editor="].apply(o,e),e[e.length-1]},f.$$s=C,f.$$arity=0,f),u).call(d),(u=(h=C).$before_unmount,u.$$p=(_=function(){var e,t,n=_.$$s||this;return e=[a],t=n.$class(),t["$editor="].apply(t,e),e[e.length-1]},_.$$s=C,_.$$arity=0,_),u).call(h),e.defn(C,"$move_history",g=function(e){var n,r,i,o=this,s=a,$=a;return o.history["$[]="](o.history_pos,o.editor.getValue()),o.history_pos=t(o.history_pos,e),s=o.history["$[]"](o.history_pos),$=s.$split("\n"),o.editor.setValue(s),(n=(r=o).$after,n.$$p=(i=function(){var e,t=i.$$s||this;return null==t.editor&&(t.editor=a),window.scrollTo(window.scrollX,99999),t.editor.setCursor({line:$.$count(),ch:(!1!==(e=$.$last())&&e!==a&&null!=e?e:"").$length()})},i.$$s=o,i.$$arity=0,i),n).call(r,0)},g.$$arity=1),e.defn(C,"$set_focus_at_end",m=function(){var e,t=this,n=a;return t.editor.focus(),n=t.editor.getValue().$split("\n"),t.editor.setCursor({line:n.$count(),ch:(!1!==(e=n.$last())&&e!==a&&null!=e?e:"").$length()})},m.$$arity=0),e.defn(C,"$on_key_down",y=function(e,t){var o,s,$=this;return(o=!1!==(s=t.metaKey)&&s!==a&&null!=s?s:t.ctrlKey)===a||null==o||o.$$is_boolean&&1!=o?t.key["$=="]("ArrowUp")?(o=r($.history_pos,0))===a||null==o||o.$$is_boolean&&1!=o?a:$.$move_history(-1):t.key["$=="]("ArrowDown")?(o=i($.history_pos,n($.history.$length(),1)))===a||null==o||o.$$is_boolean&&1!=o?a:$.$move_history(1):a:t.keyCode["$=="](13)?$.editor.setValue($.editor.getValue()+"\n"):a},y.$$arity=2),e.defn(C,"$mark_error",v=function(t){var n,r,i=this,o=a,s=a,$=a;return r=i.$parse_error(t),n=e.to_ary(r),o=null==n[0]?a:n[0],s=null==n[1]?a:n[1],$=null==n[2]?a:n[2],i.error=i.editor.markText(o.$to_n(),s.$to_n(),{className:"syntax-error",title:$})},v.$$arity=1),e.defn(C,"$parse_error",b=function(e){var t=this,n=a,r=a;return e=e.$split("\n"),e["$[]"](3).$split(":"),n=t.editor.lineCount(),r=t.editor.getLine(n-1),[l(["line","ch"],{line:0,ch:0}),l(["line","ch"],{line:n,ch:r.$length()}),e["$[]"](2).$split(":(file)")["$[]"](0)]},b.$$arity=1),e.defn(C,"$clear_error",w=function(){var e,t=this;return(e=t.error)===a||null==e||e.$$is_boolean&&1!=e||t.error.clear(),t.error=a},w.$$arity=0),e.defn(C,"$on_change",x=function(){var t,n=this,r=a,i=a,o=a;try{return n.$clear_error(),r=n.editor.getValue(),i=(t=n.$params().$context()["$empty?"]())===a||null==t||t.$$is_boolean&&1!=t?O.get("Opal").$compile(n.$params().$context()+".instance_eval {"+r+"}"):O.get("Opal").$compile(r,l(["irb"],{irb:!0})),O.get("DebugConsole")["$ready!"](r,i)}catch(t){if(!e.rescue(t,[O.get("Exception")]))throw t;o=t;try{return n.$mark_error(o.$message())}finally{e.pop_exception()}}},x.$$arity=0),(u=(k=C).$render,u.$$p=(E=function(){var e,t,n,r,i,o,s=E.$$s||this;return(e=(t=(r=(i=s).$DIV,r.$$p=(o=function(){o.$$s;return a},o.$$s=s,o.$$arity=0,o),r).call(i)).$on,e.$$p=(n=function(e){n.$$s;return null==e&&(e=a),e.$stop_propagation()},n.$$s=s,n.$$arity=1,n),e).call(t,"mouse_down")},E.$$s=C,E.$$arity=0,E),u).call(k)}(g.base,g.get("CodeMirror")),(d=(f=g.get("Document"))["$ready?"],d.$$p=(h=function(){var e,t,n,r=h.$$s||this,i=a;return i=g.get("Element")["$[]"]("[data-react-class='React.TopLevelRailsComponent']"),(e=(t=i).$render,e.$$p=(n=function(){n.$$s;return g.get("Hyperloop").$$scope.get("Console").$DebugConsole(g.get("JSON").$parse(i.$attr("data-react-props"))["$[]"]("render_params"))},n.$$s=r,n.$$arity=0,n),e).call(t)},h.$$s=_,h.$$arity=0,h),d).call(f)}(f.base)}(o.base)},/*!
1907
1907
  * Pusher JavaScript Library v3.0.0
1908
1908
  * http://pusher.com/
1909
1909
  *
@@ -1911,4 +1911,4 @@ function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../l
1911
1911
  * Released under the MIT licence.
1912
1912
  */
1913
1913
  function(e,t){"function"==typeof define&&define.amd?define([],function(){return e.Pusher=t()}):"object"==typeof exports?module.exports=t():e.Pusher=t()}(this,function(){return function(){function e(t,n){(null===t||void 0===t)&&e.warn("Warning","You must pass your app key when you instantiate Pusher."),n=n||{};var r=this;this.key=t,this.config=e.Util.extend(e.getGlobalConfig(),n.cluster?e.getClusterConfig(n.cluster):{},n),this.channels=new e.Channels,this.global_emitter=new e.EventsDispatcher,this.sessionID=Math.floor(1e9*Math.random()),this.timeline=new e.Timeline(this.key,this.sessionID,{cluster:this.config.cluster,features:e.Util.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:e.Timeline.INFO,version:e.VERSION}),this.config.disableStats||(this.timelineSender=new e.TimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/jsonp"})),this.connection=new e.ConnectionManager(this.key,e.Util.extend({getStrategy:function(t){return t=e.Util.extend({},r.config,t),e.StrategyBuilder.build(e.getDefaultStrategy(t),t)},timeline:this.timeline,activityTimeout:this.config.activity_timeout,pongTimeout:this.config.pong_timeout,unavailableTimeout:this.config.unavailable_timeout},this.config,{encrypted:this.isEncrypted()})),this.connection.bind("connected",function(){r.subscribeAll(),r.timelineSender&&r.timelineSender.send(r.connection.isEncrypted())}),this.connection.bind("message",function(e){var t=0===e.event.indexOf("pusher_internal:");if(e.channel){var n=r.channel(e.channel);n&&n.handleEvent(e.event,e.data)}t||r.global_emitter.emit(e.event,e.data)}),this.connection.bind("disconnected",function(){r.channels.disconnect()}),this.connection.bind("error",function(t){e.warn("Error",t)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),e.isReady&&r.connect()}var t=e.prototype;e.instances=[],e.isReady=!1,e.debug=function(){e.log&&e.log(e.Util.stringify.apply(this,arguments))},e.warn=function(){var t=e.Util.stringify.apply(this,arguments);window.console&&(window.console.warn?window.console.warn(t):window.console.log&&window.console.log(t)),e.log&&e.log(t)},e.ready=function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()},t.channel=function(e){return this.channels.find(e)},t.allChannels=function(){return this.channels.all()},t.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isEncrypted(),n=this.timelineSender;this.timelineSenderTimer=new e.PeriodicTimer(6e4,function(){n.send(t)})}},t.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},t.bind=function(e,t){return this.global_emitter.bind(e,t),this},t.bind_all=function(e){return this.global_emitter.bind_all(e),this},t.subscribeAll=function(){for(var e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)},t.subscribe=function(e){return e=this.channels.add(e,this),"connected"===this.connection.state&&e.subscribe(),e},t.unsubscribe=function(e){(e=this.channels.remove(e))&&"connected"===this.connection.state&&e.unsubscribe()},t.send_event=function(e,t,n){return this.connection.send_event(e,t,n)},t.isEncrypted=function(){return"https:"===e.Util.getDocument().location.protocol||Boolean(this.config.encrypted)},e.HTTP={},this.Pusher=e}.call(this),function(){function e(e){window.clearTimeout(e)}function t(e){window.clearInterval(e)}function n(e,t,n,r){var i=this;this.clear=t,this.timer=e(function(){null!==i.timer&&(i.timer=r(i.timer))},n)}var r=n.prototype;r.isRunning=function(){return null!==this.timer},r.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},Pusher.Timer=function(t,r){return new n(setTimeout,e,t,function(){return r(),null})},Pusher.PeriodicTimer=function(e,r){return new n(setInterval,t,e,function(e){return r(),e})}}.call(this),function(){Pusher.Util={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(e){return new Pusher.Timer(0,e)},extend:function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)e[n]=r[n]&&r[n].constructor&&r[n].constructor===Object?Pusher.Util.extend(e[n]||{},r[n]):r[n]}return e},stringify:function(){for(var e=["Pusher"],t=0;t<arguments.length;t++)"string"==typeof arguments[t]?e.push(arguments[t]):void 0===window.JSON?e.push(arguments[t].toString()):e.push(JSON.stringify(arguments[t]));return e.join(" : ")},arrayIndexOf:function(e,t){var n=Array.prototype.indexOf;if(null===e)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},objectApply:function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)},keys:function(e){var t=[];return Pusher.Util.objectApply(e,function(e,n){t.push(n)}),t},values:function(e){var t=[];return Pusher.Util.objectApply(e,function(e){t.push(e)}),t},apply:function(e,t,n){for(var r=0;r<e.length;r++)t.call(n||window,e[r],r,e)},map:function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r,e,n));return n},mapObject:function(e,t){var n={};return Pusher.Util.objectApply(e,function(e,r){n[r]=t(e)}),n},filter:function(e,t){t=t||function(e){return!!e};for(var n=[],r=0;r<e.length;r++)t(e[r],r,e,n)&&n.push(e[r]);return n},filterObject:function(e,t){var n={};return Pusher.Util.objectApply(e,function(r,i){(t&&t(r,i,e,n)||Boolean(r))&&(n[i]=r)}),n},flatten:function(e){var t=[];return Pusher.Util.objectApply(e,function(e,n){t.push([n,e])}),t},any:function(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},all:function(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},method:function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){return n[e].apply(n,t.concat(arguments))}},getWindow:function(){return window},getDocument:function(){return document},getLocalStorage:function(){try{return window.localStorage}catch(e){}},getClientFeatures:function(){return Pusher.Util.keys(Pusher.Util.filterObject({ws:Pusher.WSTransport},function(e){return e.isSupported({})}))},addWindowListener:function(e,t){var n=Pusher.Util.getWindow();void 0!==n.addEventListener?n.addEventListener(e,t,!1):n.attachEvent("on"+e,t)},removeWindowListener:function(e,t){var n=Pusher.Util.getWindow();void 0!==n.addEventListener?n.removeEventListener(e,t,!1):n.detachEvent("on"+e,t)},isXHRSupported:function(){var e=window.XMLHttpRequest;return Boolean(e)&&void 0!==(new e).withCredentials},isXDRSupported:function(e){e=e?"https:":"http:";var t=Pusher.Util.getDocument().location.protocol;return Boolean(window.XDomainRequest)&&t===e}}}.call(this),function(){Pusher.VERSION="3.0.0",Pusher.PROTOCOL=7,Pusher.host="ws.pusherapp.com",Pusher.ws_port=80,Pusher.wss_port=443,Pusher.sockjs_host="sockjs.pusher.com",Pusher.sockjs_http_port=80,Pusher.sockjs_https_port=443,Pusher.sockjs_path="/pusher",Pusher.stats_host="stats.pusher.com",Pusher.channel_auth_endpoint="/pusher/auth",Pusher.channel_auth_transport="ajax",Pusher.activity_timeout=12e4,Pusher.pong_timeout=3e4,Pusher.unavailable_timeout=1e4,Pusher.cdn_http="http://js.pusher.com/",Pusher.cdn_https="https://js.pusher.com/",Pusher.dependency_suffix=".min",Pusher.getDefaultStrategy=function(e){return[[":def","ws_options",{hostUnencrypted:e.wsHost+":"+e.wsPort,hostEncrypted:e.wsHost+":"+e.wssPort}],[":def","wss_options",[":extend",":ws_options",{encrypted:!0}]],[":def","sockjs_options",{hostUnencrypted:e.httpHost+":"+e.httpPort,hostEncrypted:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}],[":def","timeouts",{loop:!0,timeout:15e3,timeoutLimit:6e4}],[":def","ws_manager",[":transport_manager",{lives:2,minPingDelay:1e4,maxPingDelay:e.activity_timeout}]],[":def","streaming_manager",[":transport_manager",{lives:2,minPingDelay:1e4,maxPingDelay:e.activity_timeout}]],[":def_transport","ws","ws",3,":ws_options",":ws_manager"],[":def_transport","wss","ws",3,":wss_options",":ws_manager"],[":def_transport","sockjs","sockjs",1,":sockjs_options"],[":def_transport","xhr_streaming","xhr_streaming",1,":sockjs_options",":streaming_manager"],[":def_transport","xdr_streaming","xdr_streaming",1,":sockjs_options",":streaming_manager"],[":def_transport","xhr_polling","xhr_polling",1,":sockjs_options"],[":def_transport","xdr_polling","xdr_polling",1,":sockjs_options"],[":def","ws_loop",[":sequential",":timeouts",":ws"]],[":def","wss_loop",[":sequential",":timeouts",":wss"]],[":def","sockjs_loop",[":sequential",":timeouts",":sockjs"]],[":def","streaming_loop",[":sequential",":timeouts",[":if",[":is_supported",":xhr_streaming"],":xhr_streaming",":xdr_streaming"]]],[":def","polling_loop",[":sequential",":timeouts",[":if",[":is_supported",":xhr_polling"],":xhr_polling",":xdr_polling"]]],[":def","http_loop",[":if",[":is_supported",":streaming_loop"],[":best_connected_ever",":streaming_loop",[":delayed",4e3,[":polling_loop"]]],[":polling_loop"]]],[":def","http_fallback_loop",[":if",[":is_supported",":http_loop"],[":http_loop"],[":sockjs_loop"]]],[":def","strategy",[":cached",18e5,[":first_connected",[":if",[":is_supported",":ws"],e.encrypted?[":best_connected_ever",":ws_loop",[":delayed",2e3,[":http_fallback_loop"]]]:[":best_connected_ever",":ws_loop",[":delayed",2e3,[":wss_loop"]],[":delayed",5e3,[":http_fallback_loop"]]],":http_fallback_loop"]]]]]}}.call(this),function(){Pusher.getGlobalConfig=function(){return{wsHost:Pusher.host,wsPort:Pusher.ws_port,wssPort:Pusher.wss_port,httpHost:Pusher.sockjs_host,httpPort:Pusher.sockjs_http_port,httpsPort:Pusher.sockjs_https_port,httpPath:Pusher.sockjs_path,statsHost:Pusher.stats_host,authEndpoint:Pusher.channel_auth_endpoint,authTransport:Pusher.channel_auth_transport,activity_timeout:Pusher.activity_timeout,pong_timeout:Pusher.pong_timeout,unavailable_timeout:Pusher.unavailable_timeout}},Pusher.getClusterConfig=function(e){return{wsHost:"ws-"+e+".pusher.com",httpHost:"sockjs-"+e+".pusher.com"}}}.call(this),function(){function e(e){var t=function(t){Error.call(this,t),this.name=e};return Pusher.Util.extend(t.prototype,Error.prototype),t}Pusher.Errors={BadEventName:e("BadEventName"),RequestTimedOut:e("RequestTimedOut"),TransportPriorityTooLow:e("TransportPriorityTooLow"),TransportClosed:e("TransportClosed"),UnsupportedTransport:e("UnsupportedTransport"),UnsupportedStrategy:e("UnsupportedStrategy")}}.call(this),function(){function e(e){this.callbacks=new t,this.global_callbacks=[],this.failThrough=e}function t(){this._callbacks={}}var n=e.prototype;n.bind=function(e,t,n){return this.callbacks.add(e,t,n),this},n.bind_all=function(e){return this.global_callbacks.push(e),this},n.unbind=function(e,t,n){return this.callbacks.remove(e,t,n),this},n.unbind_all=function(e,t){return this.callbacks.remove(e,t),this},n.emit=function(e,t){var n;for(n=0;n<this.global_callbacks.length;n++)this.global_callbacks[n](e,t);var r=this.callbacks.get(e);if(r&&0<r.length)for(n=0;n<r.length;n++)r[n].fn.call(r[n].context||window,t);else this.failThrough&&this.failThrough(e,t);return this},t.prototype.get=function(e){return this._callbacks["_"+e]},t.prototype.add=function(e,t,n){e="_"+e,this._callbacks[e]=this._callbacks[e]||[],this._callbacks[e].push({fn:t,context:n})},t.prototype.remove=function(e,t,n){e||t||n?(e=e?["_"+e]:Pusher.Util.keys(this._callbacks),t||n?Pusher.Util.apply(e,function(e){this._callbacks[e]=Pusher.Util.filter(this._callbacks[e]||[],function(e){return t&&t!==e.fn||n&&n!==e.context}),0===this._callbacks[e].length&&delete this._callbacks[e]},this):Pusher.Util.apply(e,function(e){delete this._callbacks[e]},this)):this._callbacks={}},Pusher.EventsDispatcher=e}.call(this),function(){function e(e,t){this.lastId=0,this.prefix=e,this.name=t}var t=e.prototype;t.create=function(e){this.lastId++;var t=this.lastId,n=this.prefix+t,r=this.name+"["+t+"]",i=!1,o=function(){i||(e.apply(null,arguments),i=!0)};return this[t]=o,{number:t,id:n,name:r,callback:o}},t.remove=function(e){delete this[e.number]},Pusher.ScriptReceiverFactory=e,Pusher.ScriptReceivers=new e("_pusher_script_","Pusher.ScriptReceivers")}.call(this),function(){function e(e){this.src=e}var t=e.prototype;t.send=function(e){var t=this,n="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(n)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){("loaded"===t.script.readyState||"complete"===t.script.readyState)&&e.callback(null)},void 0===t.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+n+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var r=document.getElementsByTagName("head")[0];r.insertBefore(t.script,r.firstChild),t.errorScript&&r.insertBefore(t.errorScript,t.script.nextSibling)},t.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.errorScript=this.script=null},Pusher.ScriptRequest=e}.call(this),function(){function e(e){this.options=e,this.receivers=e.receivers||Pusher.ScriptReceivers,this.loading={}}var t=e.prototype;t.load=function(e,t,n){var r=this;if(r.loading[e]&&0<r.loading[e].length)r.loading[e].push(n);else{r.loading[e]=[n];var i=new Pusher.ScriptRequest(r.getPath(e,t)),o=r.receivers.create(function(t){if(r.receivers.remove(o),r.loading[e]){var n=r.loading[e];delete r.loading[e];for(var a=function(e){e||i.cleanup()},s=0;s<n.length;s++)n[s](t,a)}});i.send(o)}},t.getRoot=function(e){var t=Pusher.Util.getDocument().location.protocol;return(e&&e.encrypted||"https:"===t?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version},t.getPath=function(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"},Pusher.DependencyLoader=e}.call(this),function(){function e(){Pusher.ready()}function t(e){document.body?e():setTimeout(function(){t(e)},0)}function n(){t(e)}Pusher.DependenciesReceivers=new Pusher.ScriptReceiverFactory("_pusher_dependencies","Pusher.DependenciesReceivers"),Pusher.Dependencies=new Pusher.DependencyLoader({cdn_http:Pusher.cdn_http,cdn_https:Pusher.cdn_https,version:Pusher.VERSION,suffix:Pusher.dependency_suffix,receivers:Pusher.DependenciesReceivers}),window.JSON?n():Pusher.Dependencies.load("json2",{},n)}(),function(){for(var e=String.fromCharCode,t=0;64>t;t++)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t);var n=function(t){var n=t.charCodeAt(0);return 128>n?t:2048>n?e(192|n>>>6)+e(128|63&n):e(224|n>>>12&15)+e(128|n>>>6&63)+e(128|63&n)},r=function(e){var t=[0,2,1][e.length%3];return e=e.charCodeAt(0)<<16|(1<e.length?e.charCodeAt(1):0)<<8|(2<e.length?e.charCodeAt(2):0),["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>>18),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>>12&63),2<=t?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>>6&63),1<=t?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&e)].join("")},i=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,r)};Pusher.Base64={encode:function(e){return i(e.replace(/[^\x00-\x7F]/g,n))}}}.call(this),function(){function e(e,t){this.url=e,this.data=t}function t(e){return Pusher.Util.mapObject(e,function(e){return"object"==typeof e&&(e=JSON.stringify(e)),encodeURIComponent(Pusher.Base64.encode(e.toString()))})}var n=e.prototype;n.send=function(e){if(!this.request){var n=Pusher.Util.filterObject(this.data,function(e){return void 0!==e}),n=Pusher.Util.map(Pusher.Util.flatten(t(n)),Pusher.Util.method("join","=")).join("&");this.request=new Pusher.ScriptRequest(this.url+"/"+e.number+"?"+n),this.request.send(e)}},n.cleanup=function(){this.request&&this.request.cleanup()},Pusher.JSONPRequest=e}.call(this),function(){function e(e,t,n){this.key=e,this.session=t,this.events=[],this.options=n||{},this.uniqueID=this.sent=0}var t=e.prototype;e.ERROR=3,e.INFO=6,e.DEBUG=7,t.log=function(e,t){e<=this.options.level&&(this.events.push(Pusher.Util.extend({},t,{timestamp:Pusher.Util.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.error=function(t){this.log(e.ERROR,t)},t.info=function(t){this.log(e.INFO,t)},t.debug=function(t){this.log(e.DEBUG,t)},t.isEmpty=function(){return 0===this.events.length},t.send=function(e,t){var n=this,r=Pusher.Util.extend({session:n.session,bundle:n.sent+1,key:n.key,lib:"js",version:n.options.version,cluster:n.options.cluster,features:n.options.features,timeline:n.events},n.options.params);return n.events=[],e(r,function(e,r){e||n.sent++,t&&t(e,r)}),!0},t.generateUniqueID=function(){return++this.uniqueID},Pusher.Timeline=e}.call(this),function(){function e(e,t){this.timeline=e,this.options=t||{}}e.prototype.send=function(e,t){var n=this;n.timeline.isEmpty()||n.timeline.send(function(t,r){var i=new Pusher.JSONPRequest("http"+(e?"s":"")+"://"+(n.host||n.options.host)+n.options.path,t),o=Pusher.ScriptReceivers.create(function(e,t){Pusher.ScriptReceivers.remove(o),i.cleanup(),t&&t.host&&(n.host=t.host),r&&r(e,t)});i.send(o)},t)},Pusher.TimelineSender=e}.call(this),function(){function e(e){this.strategies=e}function t(e,t,n){var i=Pusher.Util.map(e,function(e,r,i,o){return e.connect(t,n(r,o))});return{abort:function(){Pusher.Util.apply(i,r)},forceMinPriority:function(e){Pusher.Util.apply(i,function(t){t.forceMinPriority(e)})}}}function n(e){return Pusher.Util.all(e,function(e){return Boolean(e.error)})}function r(e){!e.error&&!e.aborted&&(e.abort(),e.aborted=!0)}var i=e.prototype;i.isSupported=function(){return Pusher.Util.any(this.strategies,Pusher.Util.method("isSupported"))},i.connect=function(e,r){return t(this.strategies,e,function(e,t){return function(i,o){(t[e].error=i)?n(t)&&r(!0):(Pusher.Util.apply(t,function(e){e.forceMinPriority(o.transport.priority)}),r(null,o))}})},Pusher.BestConnectedEverStrategy=e}.call(this),function(){function e(e,t,n){this.strategy=e,this.transports=t,this.ttl=n.ttl||18e5,this.encrypted=n.encrypted,this.timeline=n.timeline}function t(e){return"pusherTransport"+(e?"Encrypted":"Unencrypted")}function n(e){var n=Pusher.Util.getLocalStorage();if(n)try{var i=n[t(e)];if(i)return JSON.parse(i)}catch(t){r(e)}return null}function r(e){var n=Pusher.Util.getLocalStorage();if(n)try{delete n[t(e)]}catch(e){}}var i=e.prototype;i.isSupported=function(){return this.strategy.isSupported()},i.connect=function(e,i){var o=this.encrypted,a=n(o),s=[this.strategy];if(a&&a.timestamp+this.ttl>=Pusher.Util.now()){var $=this.transports[a.transport];$&&(this.timeline.info({cached:!0,transport:a.transport,latency:a.latency}),s.push(new Pusher.SequentialStrategy([$],{timeout:2*a.latency+1e3,failFast:!0})))}var l=Pusher.Util.now(),u=s.pop().connect(e,function n(a,$){if(a)r(o),0<s.length?(l=Pusher.Util.now(),u=s.pop().connect(e,n)):i(a);else{var c=$.transport.name,p=Pusher.Util.now()-l,d=Pusher.Util.getLocalStorage();if(d)try{d[t(o)]=JSON.stringify({timestamp:Pusher.Util.now(),transport:c,latency:p})}catch(e){}i(null,$)}});return{abort:function(){u.abort()},forceMinPriority:function(t){e=t,u&&u.forceMinPriority(t)}}},Pusher.CachedStrategy=e}.call(this),function(){function e(e,t){this.strategy=e,this.options={delay:t.delay}}var t=e.prototype;t.isSupported=function(){return this.strategy.isSupported()},t.connect=function(e,t){var n,r=this.strategy,i=new Pusher.Timer(this.options.delay,function(){n=r.connect(e,t)});return{abort:function(){i.ensureAborted(),n&&n.abort()},forceMinPriority:function(t){e=t,n&&n.forceMinPriority(t)}}},Pusher.DelayedStrategy=e}.call(this),function(){function e(e){this.strategy=e}var t=e.prototype;t.isSupported=function(){return this.strategy.isSupported()},t.connect=function(e,t){var n=this.strategy.connect(e,function(e,r){r&&n.abort(),t(e,r)});return n},Pusher.FirstConnectedStrategy=e}.call(this),function(){function e(e,t,n){this.test=e,this.trueBranch=t,this.falseBranch=n}var t=e.prototype;t.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.connect=function(e,t){return(this.test()?this.trueBranch:this.falseBranch).connect(e,t)},Pusher.IfStrategy=e}.call(this),function(){function e(e,t){this.strategies=e,this.loop=Boolean(t.loop),this.failFast=Boolean(t.failFast),this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}var t=e.prototype;t.isSupported=function(){return Pusher.Util.any(this.strategies,Pusher.Util.method("isSupported"))},t.connect=function(e,t){var n=this,r=this.strategies,i=0,o=this.timeout,a=null,s=function($,l){l?t(null,l):(i+=1,n.loop&&(i%=r.length),i<r.length?(o&&(o*=2,n.timeoutLimit&&(o=Math.min(o,n.timeoutLimit))),a=n.tryStrategy(r[i],e,{timeout:o,failFast:n.failFast},s)):t(!0))},a=this.tryStrategy(r[i],e,{timeout:o,failFast:this.failFast},s);return{abort:function(){a.abort()},forceMinPriority:function(t){e=t,a&&a.forceMinPriority(t)}}},t.tryStrategy=function(e,t,n,r){var i=null,o=null;return 0<n.timeout&&(i=new Pusher.Timer(n.timeout,function(){o.abort(),r(!0)})),o=e.connect(t,function(e,t){e&&i&&i.isRunning()&&!n.failFast||(i&&i.ensureAborted(),r(e,t))}),{abort:function(){i&&i.ensureAborted(),o.abort()},forceMinPriority:function(e){o.forceMinPriority(e)}}},Pusher.SequentialStrategy=e}.call(this),function(){function e(e,t,n,r){this.name=e,this.priority=t,this.transport=n,this.options=r||{}}function t(e,t){return Pusher.Util.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var n=e.prototype;n.isSupported=function(){return this.transport.isSupported({encrypted:this.options.encrypted})},n.connect=function(e,n){if(!this.isSupported())return t(new Pusher.Errors.UnsupportedStrategy,n);if(this.priority<e)return t(new Pusher.Errors.TransportPriorityTooLow,n);var r=this,i=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),a=null,s=function(){o.unbind("initialized",s),o.connect()},$=function(){a=new Pusher.Handshake(o,function(e){i=!0,c(),n(null,e)})},l=function(e){c(),n(e)},u=function(){c(),n(new Pusher.Errors.TransportClosed(o))},c=function(){o.unbind("initialized",s),o.unbind("open",$),o.unbind("error",l),o.unbind("closed",u)};return o.bind("initialized",s),o.bind("open",$),o.bind("error",l),o.bind("closed",u),o.initialize(),{abort:function(){i||(c(),a?a.close():o.close())},forceMinPriority:function(e){i||r.priority<e&&(a?a.close():o.close())}}},Pusher.TransportStrategy=e}.call(this),function(){function e(e,t,n){return e+(t.encrypted?"s":"")+"://"+(t.encrypted?t.hostEncrypted:t.hostUnencrypted)+n}function t(e,t){return"/app/"+e+"?protocol="+Pusher.PROTOCOL+"&client=js&version="+Pusher.VERSION+(t?"&"+t:"")}Pusher.URLSchemes={ws:{getInitial:function(n,r){return e("ws",r,t(n,"flash=false"))}},sockjs:{getInitial:function(t,n){return e("http",n,n.httpPath||"/pusher","")},getPath:function(e){return t(e)}},http:{getInitial:function(n,r){return e("http",r,(r.httpPath||"/pusher")+t(n))}}}}.call(this),function(){function e(e,t,n,r,i){Pusher.EventsDispatcher.call(this),this.hooks=e,this.name=t,this.priority=n,this.key=r,this.options=i,this.state="new",this.timeline=i.timeline,this.activityTimeout=i.activityTimeout,this.id=this.timeline.generateUniqueID()}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.handlesActivityChecks=function(){return Boolean(this.hooks.handlesActivityChecks)},t.supportsPing=function(){return Boolean(this.hooks.supportsPing)},t.initialize=function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.encrypted?"s":"")})),e.hooks.isInitialized()?e.changeState("initialized"):e.hooks.file?(e.changeState("initializing"),Pusher.Dependencies.load(e.hooks.file,{encrypted:e.options.encrypted},function(t,n){e.hooks.isInitialized()?(e.changeState("initialized"),n(!0)):(t&&e.onError(t),e.onClose(),n(!1))})):e.onClose()},t.connect=function(){var e=this;if(e.socket||"initialized"!==e.state)return!1;var t=e.hooks.urls.getInitial(e.key,e.options);try{e.socket=e.hooks.getSocket(t,e.options)}catch(t){return Pusher.Util.defer(function(){e.onError(t),e.changeState("closed")}),!1}return e.bindListeners(),Pusher.debug("Connecting",{transport:e.name,url:t}),e.changeState("connecting"),!0},t.close=function(){return!!this.socket&&(this.socket.close(),!0)},t.send=function(e){var t=this;return"open"===t.state&&(Pusher.Util.defer(function(){t.socket&&t.socket.send(e)}),!0)},t.ping=function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()},t.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},t.onError=function(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))},t.onClose=function(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},t.onMessage=function(e){this.emit("message",e)},t.onActivity=function(){this.emit("activity")},t.bindListeners=function(){var e=this;e.socket.onopen=function(){e.onOpen()},e.socket.onerror=function(t){e.onError(t)},e.socket.onclose=function(t){e.onClose(t)},e.socket.onmessage=function(t){e.onMessage(t)},e.supportsPing()&&(e.socket.onactivity=function(){e.onActivity()})},t.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},t.changeState=function(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)},t.buildTimelineMessage=function(e){return Pusher.Util.extend({cid:this.id},e)},Pusher.TransportConnection=e}.call(this),function(){function e(e){this.hooks=e}var t=e.prototype;t.isSupported=function(e){return this.hooks.isSupported(e)},t.createConnection=function(e,t,n,r){return new Pusher.TransportConnection(this.hooks,e,t,n,r)},Pusher.Transport=e}.call(this),function(){Pusher.WSTransport=new Pusher.Transport({urls:Pusher.URLSchemes.ws,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(window.WebSocket||window.MozWebSocket)},isSupported:function(){return Boolean(window.WebSocket||window.MozWebSocket)},getSocket:function(e){return new(window.WebSocket||window.MozWebSocket)(e)}}),Pusher.SockJSTransport=new Pusher.Transport({file:"sockjs",urls:Pusher.URLSchemes.sockjs,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(e,t){return new SockJS(e,null,{js_path:Pusher.Dependencies.getPath("sockjs",{encrypted:t.encrypted}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}});var e={urls:Pusher.URLSchemes.http,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return Boolean(Pusher.HTTP.Socket)}},t=Pusher.Util.extend({getSocket:function(e){return Pusher.HTTP.getStreamingSocket(e)}},e),e=Pusher.Util.extend({getSocket:function(e){return Pusher.HTTP.getPollingSocket(e)}},e),n={file:"xhr",isSupported:Pusher.Util.isXHRSupported},r={file:"xdr",isSupported:function(e){return Pusher.Util.isXDRSupported(e.encrypted)}};Pusher.XHRStreamingTransport=new Pusher.Transport(Pusher.Util.extend({},t,n)),Pusher.XDRStreamingTransport=new Pusher.Transport(Pusher.Util.extend({},t,r)),Pusher.XHRPollingTransport=new Pusher.Transport(Pusher.Util.extend({},e,n)),Pusher.XDRPollingTransport=new Pusher.Transport(Pusher.Util.extend({},e,r))}.call(this),function(){function e(e,t,n){this.manager=e,this.transport=t,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}var t=e.prototype;t.createConnection=function(e,t,n,r){var i=this;r=Pusher.Util.extend({},r,{activityTimeout:i.pingDelay});var o=i.transport.createConnection(e,t,n,r),a=null,s=function(){o.unbind("open",s),o.bind("closed",$),a=Pusher.Util.now()},$=function(e){o.unbind("closed",$),1002===e.code||1003===e.code?i.manager.reportDeath():!e.wasClean&&a&&(e=Pusher.Util.now()-a)<2*i.maxPingDelay&&(i.manager.reportDeath(),i.pingDelay=Math.max(e/2,i.minPingDelay))};return o.bind("open",s),o},t.isSupported=function(e){return this.manager.isAlive()&&this.transport.isSupported(e)},Pusher.AssistantToTheTransportManager=e}.call(this),function(){function e(e){this.options=e||{},this.livesLeft=this.options.lives||Infinity}var t=e.prototype;t.getAssistant=function(e){return new Pusher.AssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.isAlive=function(){return 0<this.livesLeft},t.reportDeath=function(){this.livesLeft-=1},Pusher.TransportManager=e}.call(this),function(){function e(e){return function(t){return[e.apply(this,arguments),t]}}function t(e,n){if(0===e.length)return[[],n];var i=r(e[0],n),o=t(e.slice(1),i[1]);return[[i[0]].concat(o[0]),o[1]]}function n(e,n){if("string"==typeof e[0]&&":"===e[0].charAt(0)){var i=n[e[0].slice(1)];if(1<e.length){if("function"!=typeof i)throw"Calling non-function "+e[0];var o=[Pusher.Util.extend({},n)].concat(Pusher.Util.map(e.slice(1),function(e){return r(e,Pusher.Util.extend({},n))[0]}));return i.apply(this,o)}return[i,n]}return t(e,n)}function r(e,t){if("string"==typeof e){var r;if("string"==typeof e&&":"===e.charAt(0)){if(void 0===(r=t[e.slice(1)]))throw"Undefined symbol "+e;r=[r,t]}else r=[e,t];return r}return"object"==typeof e&&e instanceof Array&&0<e.length?n(e,t):[e,t]}var i={ws:Pusher.WSTransport,sockjs:Pusher.SockJSTransport,xhr_streaming:Pusher.XHRStreamingTransport,xdr_streaming:Pusher.XDRStreamingTransport,xhr_polling:Pusher.XHRPollingTransport,xdr_polling:Pusher.XDRPollingTransport},o={isSupported:function(){return!1},connect:function(e,t){var n=Pusher.Util.defer(function(){t(new Pusher.Errors.UnsupportedStrategy)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},a={extend:function(e,t,n){return[Pusher.Util.extend({},t,n),e]},def:function(e,t,n){if(void 0!==e[t])throw"Redefining symbol "+t;return e[t]=n,[void 0,e]},def_transport:function(e,t,n,r,a,s){var $=i[n];if(!$)throw new Pusher.Errors.UnsupportedTransport(n);return n=e.enabledTransports&&-1===Pusher.Util.arrayIndexOf(e.enabledTransports,t)||e.disabledTransports&&-1!==Pusher.Util.arrayIndexOf(e.disabledTransports,t)?o:new Pusher.TransportStrategy(t,r,s?s.getAssistant($):$,Pusher.Util.extend({key:e.key,encrypted:e.encrypted,timeline:e.timeline,ignoreNullOrigin:e.ignoreNullOrigin},a)),r=e.def(e,t,n)[1],r.transports=e.transports||{},r.transports[t]=n,[void 0,r]},transport_manager:e(function(e,t){return new Pusher.TransportManager(t)}),sequential:e(function(e,t){var n=Array.prototype.slice.call(arguments,2);return new Pusher.SequentialStrategy(n,t)}),cached:e(function(e,t,n){return new Pusher.CachedStrategy(n,e.transports,{ttl:t,timeline:e.timeline,encrypted:e.encrypted})}),first_connected:e(function(e,t){return new Pusher.FirstConnectedStrategy(t)}),best_connected_ever:e(function(){var e=Array.prototype.slice.call(arguments,1);return new Pusher.BestConnectedEverStrategy(e)}),delayed:e(function(e,t,n){return new Pusher.DelayedStrategy(n,{delay:t})}),"if":e(function(e,t,n,r){return new Pusher.IfStrategy(t,n,r)}),is_supported:e(function(e,t){return function(){return t.isSupported()}})};Pusher.StrategyBuilder={build:function(e,t){return r(e,Pusher.Util.extend({},a,t))[1].strategy}}}.call(this),function(){Pusher.Protocol={decodeMessage:function(e){try{var t=JSON.parse(e.data);if("string"==typeof t.data)try{t.data=JSON.parse(t.data)}catch(e){if(!(e instanceof SyntaxError))throw e}return t}catch(t){throw{type:"MessageParseError",error:t,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){if(e=this.decodeMessage(e),"pusher:connection_established"===e.event){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:1e3*e.data.activity_timeout}}if("pusher:error"===e.event)return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"},getCloseAction:function(e){return 4e3>e.code?1002<=e.code&&1004>=e.code?"backoff":null:4e3===e.code?"ssl_only":4100>e.code?"refused":4200>e.code?"backoff":4300>e.code?"retry":"refused"},
1914
- getCloseError:function(e){return 1e3!==e.code&&1001!==e.code?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}}}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.send=function(e){return this.transport.send(e)},t.send_event=function(e,t,n){return e={event:e,data:t},n&&(e.channel=n),Pusher.debug("Event sent",e),this.send(Pusher.Protocol.encodeMessage(e))},t.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},t.close=function(){this.transport.close()},t.bindListeners=function(){var e=this,t={message:function(t){var n;try{n=Pusher.Protocol.decodeMessage(t)}catch(n){e.emit("error",{type:"MessageParseError",error:n,data:t.data})}if(void 0!==n){switch(Pusher.debug("Event recd",n),n.event){case"pusher:error":e.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":e.emit("ping");break;case"pusher:pong":e.emit("pong")}e.emit("message",n)}},activity:function(){e.emit("activity")},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(t){n(),t&&t.code&&e.handleCloseEvent(t),e.transport=null,e.emit("closed")}},n=function(){Pusher.Util.objectApply(t,function(t,n){e.transport.unbind(n,t)})};Pusher.Util.objectApply(t,function(t,n){e.transport.bind(n,t)})},t.handleCloseEvent=function(e){var t=Pusher.Protocol.getCloseAction(e);(e=Pusher.Protocol.getCloseError(e))&&this.emit("error",e),t&&this.emit(t)},Pusher.Connection=e}.call(this),function(){function e(e,t){this.transport=e,this.callback=t,this.bindListeners()}var t=e.prototype;t.close=function(){this.unbindListeners(),this.transport.close()},t.bindListeners=function(){var e=this;e.onMessage=function(t){e.unbindListeners();try{var n=Pusher.Protocol.processHandshake(t);"connected"===n.action?e.finish("connected",{connection:new Pusher.Connection(n.id,e.transport),activityTimeout:n.activityTimeout}):(e.finish(n.action,{error:n.error}),e.transport.close())}catch(t){e.finish("error",{error:t}),e.transport.close()}},e.onClosed=function(t){e.unbindListeners();var n=Pusher.Protocol.getCloseAction(t)||"backoff";t=Pusher.Protocol.getCloseError(t),e.finish(n,{error:t})},e.transport.bind("message",e.onMessage),e.transport.bind("closed",e.onClosed)},t.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.finish=function(e,t){this.callback(Pusher.Util.extend({transport:this.transport,action:e},t))},Pusher.Handshake=e}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this),this.key=e,this.options=t||{},this.state="initialized",this.connection=null,this.encrypted=!!t.encrypted,this.timeline=this.options.timeline,this.connectionCallbacks=this.buildConnectionCallbacks(),this.errorCallbacks=this.buildErrorCallbacks(),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var n=this;Pusher.Network.bind("online",function(){n.timeline.info({netinfo:"online"}),("connecting"===n.state||"unavailable"===n.state)&&n.retryIn(0)}),Pusher.Network.bind("offline",function(){n.timeline.info({netinfo:"offline"}),n.connection&&n.sendActivityCheck()}),this.updateStrategy()}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.connect=function(){!this.connection&&!this.runner&&(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))},t.send=function(e){return!!this.connection&&this.connection.send(e)},t.send_event=function(e,t,n){return!!this.connection&&this.connection.send_event(e,t,n)},t.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},t.isEncrypted=function(){return this.encrypted},t.startConnecting=function(){var e=this,t=function(n,r){n?e.runner=e.strategy.connect(0,t):"error"===r.action?(e.emit("error",{type:"HandshakeError",error:r.error}),e.timeline.error({handshakeError:r.error})):(e.abortConnecting(),e.handshakeCallbacks[r.action](r))};e.runner=e.strategy.connect(0,t)},t.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},t.disconnectInternally=function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()},t.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,encrypted:this.encrypted})},t.retryIn=function(e){var t=this;t.timeline.info({action:"retry",delay:e}),0<e&&t.emit("connecting_in",Math.round(e/1e3)),t.retryTimer=new Pusher.Timer(e||0,function(){t.disconnectInternally(),t.connect()})},t.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},t.setUnavailableTimer=function(){var e=this;e.unavailableTimer=new Pusher.Timer(e.options.unavailableTimeout,function(){e.updateState("unavailable")})},t.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.sendActivityCheck=function(){var e=this;e.stopActivityCheck(),e.connection.ping(),e.activityTimer=new Pusher.Timer(e.options.pongTimeout,function(){e.timeline.error({pong_timed_out:e.options.pongTimeout}),e.retryIn(0)})},t.resetActivityCheck=function(){var e=this;e.stopActivityCheck(),e.connection.handlesActivityChecks()||(e.activityTimer=new Pusher.Timer(e.activityTimeout,function(){e.sendActivityCheck()}))},t.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.buildConnectionCallbacks=function(){var e=this;return{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}}},t.buildHandshakeCallbacks=function(e){var t=this;return Pusher.Util.extend({},e,{connected:function(e){t.activityTimeout=Math.min(t.options.activityTimeout,e.activityTimeout,e.connection.activityTimeout||Infinity),t.clearUnavailableTimer(),t.setConnection(e.connection),t.socket_id=t.connection.id,t.updateState("connected",{socket_id:t.socket_id})}})},t.buildErrorCallbacks=function(){function e(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}}var t=this;return{ssl_only:e(function(){t.encrypted=!0,t.updateStrategy(),t.retryIn(0)}),refused:e(function(){t.disconnect()}),backoff:e(function(){t.retryIn(1e3)}),retry:e(function(){t.retryIn(0)})}},t.setConnection=function(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()},t.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);return e=this.connection,this.connection=null,e}},t.updateState=function(e,t){var n=this.state;this.state=e,n!==e&&(Pusher.debug("State changed",n+" -> "+e),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:n,current:e}),this.emit(e,t))},t.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},Pusher.ConnectionManager=e}.call(this),function(){function e(){Pusher.EventsDispatcher.call(this);var e=this;void 0!==window.addEventListener&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}Pusher.Util.extend(e.prototype,Pusher.EventsDispatcher.prototype),e.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},Pusher.NetInfo=e,Pusher.Network=new e}.call(this),function(){function e(){this.reset()}var t=e.prototype;t.get=function(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null},t.each=function(e){var t=this;Pusher.Util.objectApply(t.members,function(n,r){e(t.get(r))})},t.setMyID=function(e){this.myID=e},t.onSubscription=function(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)},t.addMember=function(e){return null===this.get(e.user_id)&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)},t.removeMember=function(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t},t.reset=function(){this.members={},this.count=0,this.me=this.myID=null},Pusher.Members=e}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this,function(t){Pusher.debug("No callbacks on "+e+" for "+t)}),this.name=e,this.pusher=t,this.subscribed=!1}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.authorize=function(e,t){return t(!1,{})},t.trigger=function(e,t){if(0!==e.indexOf("client-"))throw new Pusher.Errors.BadEventName("Event '"+e+"' does not start with 'client-'");return this.pusher.send_event(e,t,this.name)},t.disconnect=function(){this.subscribed=!1},t.handleEvent=function(e,t){0===e.indexOf("pusher_internal:")?"pusher_internal:subscription_succeeded"===e&&(this.subscribed=!0,this.emit("pusher:subscription_succeeded",t)):this.emit(e,t)},t.subscribe=function(){var e=this;e.authorize(e.pusher.connection.socket_id,function(t,n){t?e.handleEvent("pusher:subscription_error",n):e.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:e.name})})},t.unsubscribe=function(){this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},Pusher.Channel=e}.call(this),function(){function e(e,t){Pusher.Channel.call(this,e,t)}var t=e.prototype;Pusher.Util.extend(t,Pusher.Channel.prototype),t.authorize=function(e,t){return new Pusher.Channel.Authorizer(this,this.pusher.config).authorize(e,t)},Pusher.PrivateChannel=e}.call(this),function(){function e(e,t){Pusher.PrivateChannel.call(this,e,t),this.members=new Pusher.Members}var t=e.prototype;Pusher.Util.extend(t,Pusher.PrivateChannel.prototype),t.authorize=function(e,t){var n=this;Pusher.PrivateChannel.prototype.authorize.call(n,e,function(e,r){if(!e){if(void 0===r.channel_data)return Pusher.warn("Invalid auth response for channel '"+n.name+"', expected 'channel_data' field"),void t("Invalid auth response");var i=JSON.parse(r.channel_data);n.members.setMyID(i.user_id)}t(e,r)})},t.handleEvent=function(e,t){switch(e){case"pusher_internal:subscription_succeeded":this.members.onSubscription(t),this.subscribed=!0,this.emit("pusher:subscription_succeeded",this.members);break;case"pusher_internal:member_added":var n=this.members.addMember(t);this.emit("pusher:member_added",n);break;case"pusher_internal:member_removed":(n=this.members.removeMember(t))&&this.emit("pusher:member_removed",n);break;default:Pusher.PrivateChannel.prototype.handleEvent.call(this,e,t)}},t.disconnect=function(){this.members.reset(),Pusher.PrivateChannel.prototype.disconnect.call(this)},Pusher.PresenceChannel=e}.call(this),function(){function e(){this.channels={}}var t=e.prototype;t.add=function(e,t){if(!this.channels[e]){var n,r=this.channels;n=0===e.indexOf("private-")?new Pusher.PrivateChannel(e,t):0===e.indexOf("presence-")?new Pusher.PresenceChannel(e,t):new Pusher.Channel(e,t),r[e]=n}return this.channels[e]},t.all=function(){return Pusher.Util.values(this.channels)},t.find=function(e){return this.channels[e]},t.remove=function(e){var t=this.channels[e];return delete this.channels[e],t},t.disconnect=function(){Pusher.Util.objectApply(this.channels,function(e){e.disconnect()})},Pusher.Channels=e}.call(this),function(){Pusher.Channel.Authorizer=function(e,t){this.channel=e,this.type=t.authTransport,this.options=t,this.authOptions=(t||{}).auth||{}},Pusher.Channel.Authorizer.prototype={composeQuery:function(e){e="socket_id="+encodeURIComponent(e)+"&channel_name="+encodeURIComponent(this.channel.name);for(var t in this.authOptions.params)e+="&"+encodeURIComponent(t)+"="+encodeURIComponent(this.authOptions.params[t]);return e},authorize:function(e,t){return Pusher.authorizers[this.type].call(this,e,t)}};var e=1;Pusher.auth_callbacks={},Pusher.authorizers={ajax:function(e,t){var n;n=Pusher.XHR?new Pusher.XHR:window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),n.open("POST",this.options.authEndpoint,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var r in this.authOptions.headers)n.setRequestHeader(r,this.authOptions.headers[r]);return n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var e,r=!1;try{e=JSON.parse(n.responseText),r=!0}catch(e){t(!0,"JSON returned from webapp was invalid, yet status code was 200. Data was: "+n.responseText)}r&&t(!1,e)}else Pusher.warn("Couldn't get auth info from your webapp",n.status),t(!0,n.status)},n.send(this.composeQuery(e)),n},jsonp:function(t,n){void 0!==this.authOptions.headers&&Pusher.warn("Warn","To send headers with the auth request, you must use AJAX, rather than JSONP.");var r=e.toString();e++;var i=Pusher.Util.getDocument(),o=i.createElement("script");Pusher.auth_callbacks[r]=function(e){n(!1,e)},o.src=this.options.authEndpoint+"?callback="+encodeURIComponent("Pusher.auth_callbacks['"+r+"']")+"&"+this.composeQuery(t),r=i.getElementsByTagName("head")[0]||i.documentElement,r.insertBefore(o,r.firstChild)}}}.call(this),Pusher}),Opal.loaded(["hyperloop/pusher"]),function(e){var t=e.top,n=e,r=(e.nil,e.breaker,e.slice,e.module),i=e.klass;e.add_stubs(["$require"]),t.$require("opal"),t.$require("browser/interval"),t.$require("browser/delay"),t.$require("opal-jquery"),function(t){var n,o=n=r(t,"Hyperloop"),a=(o.$$proto,o.$$scope);!function(t,$super){function n(){}var r=n=i(t,$super,"Component",n),o=(r.$$proto,r.$$scope);e.cdecl(o,"VERSION","0.12.4")}(a.base,null)}(n.base),t.$require("hyper-component"),t.$require("hyper-operation"),t.$require("hyper-store"),t.$require("react/top_level_render"),t.$require("opal/compiler"),t.$require("active_support"),t.$require("securerandom"),t.$require("hyperloop/console/evaluate"),t.$require("hyperloop/console/sources/codemirror"),t.$require("hyperloop/console/sources/jquery-2.1.4"),t.$require("hyperloop/console/sources/react"),t.$require("hyperloop/console/sources/react-dom"),t.$require("hyperloop/console/ruby"),t.$require("hyperloop/console/client_components"),t.$require("hyperloop/pusher")}(Opal);
1914
+ getCloseError:function(e){return 1e3!==e.code&&1001!==e.code?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}}}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.send=function(e){return this.transport.send(e)},t.send_event=function(e,t,n){return e={event:e,data:t},n&&(e.channel=n),Pusher.debug("Event sent",e),this.send(Pusher.Protocol.encodeMessage(e))},t.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},t.close=function(){this.transport.close()},t.bindListeners=function(){var e=this,t={message:function(t){var n;try{n=Pusher.Protocol.decodeMessage(t)}catch(n){e.emit("error",{type:"MessageParseError",error:n,data:t.data})}if(void 0!==n){switch(Pusher.debug("Event recd",n),n.event){case"pusher:error":e.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":e.emit("ping");break;case"pusher:pong":e.emit("pong")}e.emit("message",n)}},activity:function(){e.emit("activity")},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(t){n(),t&&t.code&&e.handleCloseEvent(t),e.transport=null,e.emit("closed")}},n=function(){Pusher.Util.objectApply(t,function(t,n){e.transport.unbind(n,t)})};Pusher.Util.objectApply(t,function(t,n){e.transport.bind(n,t)})},t.handleCloseEvent=function(e){var t=Pusher.Protocol.getCloseAction(e);(e=Pusher.Protocol.getCloseError(e))&&this.emit("error",e),t&&this.emit(t)},Pusher.Connection=e}.call(this),function(){function e(e,t){this.transport=e,this.callback=t,this.bindListeners()}var t=e.prototype;t.close=function(){this.unbindListeners(),this.transport.close()},t.bindListeners=function(){var e=this;e.onMessage=function(t){e.unbindListeners();try{var n=Pusher.Protocol.processHandshake(t);"connected"===n.action?e.finish("connected",{connection:new Pusher.Connection(n.id,e.transport),activityTimeout:n.activityTimeout}):(e.finish(n.action,{error:n.error}),e.transport.close())}catch(t){e.finish("error",{error:t}),e.transport.close()}},e.onClosed=function(t){e.unbindListeners();var n=Pusher.Protocol.getCloseAction(t)||"backoff";t=Pusher.Protocol.getCloseError(t),e.finish(n,{error:t})},e.transport.bind("message",e.onMessage),e.transport.bind("closed",e.onClosed)},t.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.finish=function(e,t){this.callback(Pusher.Util.extend({transport:this.transport,action:e},t))},Pusher.Handshake=e}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this),this.key=e,this.options=t||{},this.state="initialized",this.connection=null,this.encrypted=!!t.encrypted,this.timeline=this.options.timeline,this.connectionCallbacks=this.buildConnectionCallbacks(),this.errorCallbacks=this.buildErrorCallbacks(),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var n=this;Pusher.Network.bind("online",function(){n.timeline.info({netinfo:"online"}),("connecting"===n.state||"unavailable"===n.state)&&n.retryIn(0)}),Pusher.Network.bind("offline",function(){n.timeline.info({netinfo:"offline"}),n.connection&&n.sendActivityCheck()}),this.updateStrategy()}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.connect=function(){!this.connection&&!this.runner&&(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))},t.send=function(e){return!!this.connection&&this.connection.send(e)},t.send_event=function(e,t,n){return!!this.connection&&this.connection.send_event(e,t,n)},t.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},t.isEncrypted=function(){return this.encrypted},t.startConnecting=function(){var e=this,t=function(n,r){n?e.runner=e.strategy.connect(0,t):"error"===r.action?(e.emit("error",{type:"HandshakeError",error:r.error}),e.timeline.error({handshakeError:r.error})):(e.abortConnecting(),e.handshakeCallbacks[r.action](r))};e.runner=e.strategy.connect(0,t)},t.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},t.disconnectInternally=function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()},t.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,encrypted:this.encrypted})},t.retryIn=function(e){var t=this;t.timeline.info({action:"retry",delay:e}),0<e&&t.emit("connecting_in",Math.round(e/1e3)),t.retryTimer=new Pusher.Timer(e||0,function(){t.disconnectInternally(),t.connect()})},t.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},t.setUnavailableTimer=function(){var e=this;e.unavailableTimer=new Pusher.Timer(e.options.unavailableTimeout,function(){e.updateState("unavailable")})},t.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.sendActivityCheck=function(){var e=this;e.stopActivityCheck(),e.connection.ping(),e.activityTimer=new Pusher.Timer(e.options.pongTimeout,function(){e.timeline.error({pong_timed_out:e.options.pongTimeout}),e.retryIn(0)})},t.resetActivityCheck=function(){var e=this;e.stopActivityCheck(),e.connection.handlesActivityChecks()||(e.activityTimer=new Pusher.Timer(e.activityTimeout,function(){e.sendActivityCheck()}))},t.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.buildConnectionCallbacks=function(){var e=this;return{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}}},t.buildHandshakeCallbacks=function(e){var t=this;return Pusher.Util.extend({},e,{connected:function(e){t.activityTimeout=Math.min(t.options.activityTimeout,e.activityTimeout,e.connection.activityTimeout||Infinity),t.clearUnavailableTimer(),t.setConnection(e.connection),t.socket_id=t.connection.id,t.updateState("connected",{socket_id:t.socket_id})}})},t.buildErrorCallbacks=function(){function e(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}}var t=this;return{ssl_only:e(function(){t.encrypted=!0,t.updateStrategy(),t.retryIn(0)}),refused:e(function(){t.disconnect()}),backoff:e(function(){t.retryIn(1e3)}),retry:e(function(){t.retryIn(0)})}},t.setConnection=function(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()},t.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);return e=this.connection,this.connection=null,e}},t.updateState=function(e,t){var n=this.state;this.state=e,n!==e&&(Pusher.debug("State changed",n+" -> "+e),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:n,current:e}),this.emit(e,t))},t.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},Pusher.ConnectionManager=e}.call(this),function(){function e(){Pusher.EventsDispatcher.call(this);var e=this;void 0!==window.addEventListener&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}Pusher.Util.extend(e.prototype,Pusher.EventsDispatcher.prototype),e.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},Pusher.NetInfo=e,Pusher.Network=new e}.call(this),function(){function e(){this.reset()}var t=e.prototype;t.get=function(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null},t.each=function(e){var t=this;Pusher.Util.objectApply(t.members,function(n,r){e(t.get(r))})},t.setMyID=function(e){this.myID=e},t.onSubscription=function(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)},t.addMember=function(e){return null===this.get(e.user_id)&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)},t.removeMember=function(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t},t.reset=function(){this.members={},this.count=0,this.me=this.myID=null},Pusher.Members=e}.call(this),function(){function e(e,t){Pusher.EventsDispatcher.call(this,function(t){Pusher.debug("No callbacks on "+e+" for "+t)}),this.name=e,this.pusher=t,this.subscribed=!1}var t=e.prototype;Pusher.Util.extend(t,Pusher.EventsDispatcher.prototype),t.authorize=function(e,t){return t(!1,{})},t.trigger=function(e,t){if(0!==e.indexOf("client-"))throw new Pusher.Errors.BadEventName("Event '"+e+"' does not start with 'client-'");return this.pusher.send_event(e,t,this.name)},t.disconnect=function(){this.subscribed=!1},t.handleEvent=function(e,t){0===e.indexOf("pusher_internal:")?"pusher_internal:subscription_succeeded"===e&&(this.subscribed=!0,this.emit("pusher:subscription_succeeded",t)):this.emit(e,t)},t.subscribe=function(){var e=this;e.authorize(e.pusher.connection.socket_id,function(t,n){t?e.handleEvent("pusher:subscription_error",n):e.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:e.name})})},t.unsubscribe=function(){this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},Pusher.Channel=e}.call(this),function(){function e(e,t){Pusher.Channel.call(this,e,t)}var t=e.prototype;Pusher.Util.extend(t,Pusher.Channel.prototype),t.authorize=function(e,t){return new Pusher.Channel.Authorizer(this,this.pusher.config).authorize(e,t)},Pusher.PrivateChannel=e}.call(this),function(){function e(e,t){Pusher.PrivateChannel.call(this,e,t),this.members=new Pusher.Members}var t=e.prototype;Pusher.Util.extend(t,Pusher.PrivateChannel.prototype),t.authorize=function(e,t){var n=this;Pusher.PrivateChannel.prototype.authorize.call(n,e,function(e,r){if(!e){if(void 0===r.channel_data)return Pusher.warn("Invalid auth response for channel '"+n.name+"', expected 'channel_data' field"),void t("Invalid auth response");var i=JSON.parse(r.channel_data);n.members.setMyID(i.user_id)}t(e,r)})},t.handleEvent=function(e,t){switch(e){case"pusher_internal:subscription_succeeded":this.members.onSubscription(t),this.subscribed=!0,this.emit("pusher:subscription_succeeded",this.members);break;case"pusher_internal:member_added":var n=this.members.addMember(t);this.emit("pusher:member_added",n);break;case"pusher_internal:member_removed":(n=this.members.removeMember(t))&&this.emit("pusher:member_removed",n);break;default:Pusher.PrivateChannel.prototype.handleEvent.call(this,e,t)}},t.disconnect=function(){this.members.reset(),Pusher.PrivateChannel.prototype.disconnect.call(this)},Pusher.PresenceChannel=e}.call(this),function(){function e(){this.channels={}}var t=e.prototype;t.add=function(e,t){if(!this.channels[e]){var n,r=this.channels;n=0===e.indexOf("private-")?new Pusher.PrivateChannel(e,t):0===e.indexOf("presence-")?new Pusher.PresenceChannel(e,t):new Pusher.Channel(e,t),r[e]=n}return this.channels[e]},t.all=function(){return Pusher.Util.values(this.channels)},t.find=function(e){return this.channels[e]},t.remove=function(e){var t=this.channels[e];return delete this.channels[e],t},t.disconnect=function(){Pusher.Util.objectApply(this.channels,function(e){e.disconnect()})},Pusher.Channels=e}.call(this),function(){Pusher.Channel.Authorizer=function(e,t){this.channel=e,this.type=t.authTransport,this.options=t,this.authOptions=(t||{}).auth||{}},Pusher.Channel.Authorizer.prototype={composeQuery:function(e){e="socket_id="+encodeURIComponent(e)+"&channel_name="+encodeURIComponent(this.channel.name);for(var t in this.authOptions.params)e+="&"+encodeURIComponent(t)+"="+encodeURIComponent(this.authOptions.params[t]);return e},authorize:function(e,t){return Pusher.authorizers[this.type].call(this,e,t)}};var e=1;Pusher.auth_callbacks={},Pusher.authorizers={ajax:function(e,t){var n;n=Pusher.XHR?new Pusher.XHR:window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),n.open("POST",this.options.authEndpoint,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var r in this.authOptions.headers)n.setRequestHeader(r,this.authOptions.headers[r]);return n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var e,r=!1;try{e=JSON.parse(n.responseText),r=!0}catch(e){t(!0,"JSON returned from webapp was invalid, yet status code was 200. Data was: "+n.responseText)}r&&t(!1,e)}else Pusher.warn("Couldn't get auth info from your webapp",n.status),t(!0,n.status)},n.send(this.composeQuery(e)),n},jsonp:function(t,n){void 0!==this.authOptions.headers&&Pusher.warn("Warn","To send headers with the auth request, you must use AJAX, rather than JSONP.");var r=e.toString();e++;var i=Pusher.Util.getDocument(),o=i.createElement("script");Pusher.auth_callbacks[r]=function(e){n(!1,e)},o.src=this.options.authEndpoint+"?callback="+encodeURIComponent("Pusher.auth_callbacks['"+r+"']")+"&"+this.composeQuery(t),r=i.getElementsByTagName("head")[0]||i.documentElement,r.insertBefore(o,r.firstChild)}}}.call(this),Pusher}),Opal.loaded(["hyperloop/pusher"]),function(e){var t=e.top,n=e,r=(e.nil,e.breaker,e.slice,e.module),i=e.klass;e.add_stubs(["$require"]),t.$require("opal"),t.$require("browser/interval"),t.$require("browser/delay"),t.$require("opal-jquery"),function(t){var n,o=n=r(t,"Hyperloop"),a=(o.$$proto,o.$$scope);!function(t,$super){function n(){}var r=n=i(t,$super,"Component",n),o=(r.$$proto,r.$$scope);e.cdecl(o,"VERSION","0.12.4")}(a.base,null)}(n.base),t.$require("hyper-component"),t.$require("hyper-operation"),t.$require("hyper-store"),t.$require("react/top_level_render"),t.$require("opal/compiler"),t.$require("active_support"),t.$require("securerandom"),t.$require("hyperloop/console/evaluate"),t.$require("hyperloop/console/version"),t.$require("hyperloop/console/sources/codemirror"),t.$require("hyperloop/console/sources/jquery-2.1.4"),t.$require("hyperloop/console/sources/react"),t.$require("hyperloop/console/sources/react-dom"),t.$require("hyperloop/console/ruby"),t.$require("hyperloop/console/client_components"),t.$require("hyperloop/pusher")}(Opal);
@@ -1,244 +1,248 @@
1
- class DebugConsole < Hyperloop::Component
2
- param :application_window_id
3
- param :context
4
- param :title
5
-
6
- state history: [], scope: :shared
7
- state console_state: :waiting_for_code, scope: :shared
8
-
9
- class << self
10
- attr_accessor :application_window_id
11
- attr_accessor :context
12
-
13
- def console_id
14
- @console_id ||=
15
- (
16
- `sessionStorage.getItem('Hyperloop::Console::ConsoleId')` ||
17
- SecureRandom.uuid.tap { |id| `sessionStorage.setItem('Hyperloop::Console::ConsoleId', #{id})` }
18
- )
19
- end
20
-
21
- def ready!(code, compiled_code)
22
- @code_to_send = code
23
- mutate.error_message nil
24
- evaluate compiled_code if @code_to_send =~ /.\n$/
25
- end
1
+ module Hyperloop
2
+ module Console
3
+ class DebugConsole < Hyperloop::Component
4
+ param :application_window_id
5
+ param :context
6
+ param :title
7
+
8
+ state history: [], scope: :shared
9
+ state console_state: :waiting_for_code, scope: :shared
10
+
11
+ class << self
12
+ attr_accessor :application_window_id
13
+ attr_accessor :context
14
+
15
+ def console_id
16
+ @console_id ||=
17
+ (
18
+ `sessionStorage.getItem('Hyperloop::Console::ConsoleId')` ||
19
+ SecureRandom.uuid.tap { |id| `sessionStorage.setItem('Hyperloop::Console::ConsoleId', #{id})` }
20
+ )
21
+ end
22
+
23
+ def ready!(code, compiled_code)
24
+ @code_to_send = code
25
+ mutate.error_message nil
26
+ evaluate compiled_code if @code_to_send =~ /.\n$/
27
+ end
28
+
29
+ def evaluate(compiled_code)
30
+ @code_to_send = @code_to_send[0..-2]
31
+ mutate.history << {eval: @code_to_send}
32
+ mutate.console_state :sending
33
+ Evaluate.run target_id: application_window_id, sender_id: console_id, context: context, string: compiled_code
34
+ end
35
+ end
26
36
 
27
- def evaluate(compiled_code)
28
- @code_to_send = @code_to_send[0..-2]
29
- mutate.history << {eval: @code_to_send}
30
- mutate.console_state :sending
31
- Evaluate.run target_id: application_window_id, sender_id: console_id, context: context, string: compiled_code
32
- end
33
- end
37
+ after_mount do
38
+ DebugConsole.application_window_id = params.application_window_id
39
+ DebugConsole.context = params.context
40
+ mutate.history(JSON.parse(`sessionStorage.getItem('Hyperloop::Console.history')` || '[]'))
41
+ `document.title = #{params.title}`
42
+ `window.scrollTo(window.scrollX, 99999)`
34
43
 
35
- after_mount do
36
- DebugConsole.application_window_id = params.application_window_id
37
- DebugConsole.context = params.context
38
- mutate.history(JSON.parse(`sessionStorage.getItem('Hyperloop::Console.history')` || '[]'))
39
- `document.title = #{params.title}`
40
- `window.scrollTo(window.scrollX, 99999)`
41
-
42
- Response.on_dispatch do |p|
43
- next unless p.target_id == DebugConsole.console_id
44
- mutate.console_state :waiting_for_code
45
- mutate.history << {p.kind => p.message}
46
- `sessionStorage.setItem('Hyperloop::Console.history', #{state.history.to_json})`
47
- end
44
+ Response.on_dispatch do |p|
45
+ next unless p.target_id == DebugConsole.console_id
46
+ mutate.console_state :waiting_for_code
47
+ mutate.history << {p.kind => p.message}
48
+ `sessionStorage.setItem('Hyperloop::Console.history', #{state.history.to_json})`
49
+ end
48
50
 
49
- end
51
+ end
50
52
 
51
- after_update do
52
- `window.scrollTo(window.scrollX, 99999)`
53
- end
53
+ after_update do
54
+ `window.scrollTo(window.scrollX, 99999)`
55
+ end
54
56
 
55
- render(DIV, style: { height: '100vh' }) do
56
- # the outer DIV is needed to set fill the window so mouse clicks anywhere
57
- # will go to the last line of the editor
58
- DIV(class: :card) do
59
- state.history.each do |item|
60
- CodeHistoryItem(item_type: item.first.first, value: item.first.last || '')
61
- end
62
- CodeEditor(history: state.history, context: params.context) unless state.console_state == :sending
63
- end.on(:mouse_down) do |e|
64
- CodeEditor.set_focus
65
- e.prevent_default
57
+ render(DIV, style: { height: '100vh' }) do
58
+ # the outer DIV is needed to set fill the window so mouse clicks anywhere
59
+ # will go to the last line of the editor
60
+ DIV(class: :card) do
61
+ state.history.each do |item|
62
+ CodeHistoryItem(item_type: item.first.first, value: item.first.last || '')
63
+ end
64
+ CodeEditor(history: state.history, context: params.context) unless state.console_state == :sending
65
+ end.on(:mouse_down) do |e|
66
+ CodeEditor.set_focus
67
+ e.prevent_default
68
+ end
69
+ end
66
70
  end
67
- end
68
- end
69
71
 
70
- class CodeMirror < Hyperloop::Component
72
+ class CodeMirror < Hyperloop::Component
71
73
 
72
- attr_reader :editor
73
-
74
- after_mount do
75
- @editor = `CodeMirror(#{dom_node}, {
76
- value: #{@code.to_s},
77
- mode: 'text/x-ruby',
78
- matchBrackets: true,
79
- lineNumbers: false,
80
- indentUnit: 2,
81
- theme: 'github',
82
- readOnly: #{!!@read_only}
83
- });`
84
- end
74
+ attr_reader :editor
85
75
 
86
- render(DIV)
76
+ after_mount do
77
+ @editor = `CodeMirror(#{dom_node}, {
78
+ value: #{@code.to_s},
79
+ mode: 'text/x-ruby',
80
+ matchBrackets: true,
81
+ lineNumbers: false,
82
+ indentUnit: 2,
83
+ theme: 'github',
84
+ readOnly: #{!!@read_only}
85
+ });`
86
+ end
87
87
 
88
- end
88
+ render(DIV)
89
89
 
90
- class CodeHistoryItem < CodeMirror
91
-
92
- param :item_type
93
- param :value
94
-
95
- def format
96
- case params.item_type
97
- when :eval
98
- params.value
99
- when :exception
100
- format_lines("!!", params.value)
101
- when :result
102
- format_lines(">>", params.value)
103
- else
104
- format_lines("#{params.item_type}:", params.value)
105
90
  end
106
- end
107
91
 
108
- def format_lines(prefix, value)
109
- fill = prefix.gsub(/./, ' ')
110
- lines = value.split("\n")
111
- (["#{prefix} #{lines.shift}"]+lines.collect do |line|
112
- "#{fill} #{line}"
113
- end).join("\n")
114
- end
92
+ class CodeHistoryItem < CodeMirror
93
+
94
+ param :item_type
95
+ param :value
96
+
97
+ def format
98
+ case params.item_type
99
+ when :eval
100
+ params.value
101
+ when :exception
102
+ format_lines("!!", params.value)
103
+ when :result
104
+ format_lines(">>", params.value)
105
+ else
106
+ format_lines("#{params.item_type}:", params.value)
107
+ end
108
+ end
115
109
 
116
- def mark_response_lines
117
- return if params.item_type == :eval
118
- lines = params.value.split("\n")
119
- padding = [:exception, :result].include?(params.item_type) ? 3 : 2+params.item_type.to_s.length
120
- last_line = lines[-1] || ''
121
- `#{@editor}.markText({line: 0, ch: 0}, {line: #{lines.count-1}, ch: #{last_line.length+padding}}, {className: 'response-line'})`
122
- end
110
+ def format_lines(prefix, value)
111
+ fill = prefix.gsub(/./, ' ')
112
+ lines = value.split("\n")
113
+ (["#{prefix} #{lines.shift}"]+lines.collect do |line|
114
+ "#{fill} #{line}"
115
+ end).join("\n")
116
+ end
123
117
 
124
- before_mount do
125
- @code = format
126
- @read_only = true
127
- end
118
+ def mark_response_lines
119
+ return if params.item_type == :eval
120
+ lines = params.value.split("\n")
121
+ padding = [:exception, :result].include?(params.item_type) ? 3 : 2+params.item_type.to_s.length
122
+ last_line = lines[-1] || ''
123
+ `#{@editor}.markText({line: 0, ch: 0}, {line: #{lines.count-1}, ch: #{last_line.length+padding}}, {className: 'response-line'})`
124
+ end
128
125
 
129
- after_mount do
130
- mark_response_lines
131
- end
126
+ before_mount do
127
+ @code = format
128
+ @read_only = true
129
+ end
132
130
 
133
- render do
134
- DIV {}.on(:mouse_down) { |e| e.stop_propagation }
135
- end
131
+ after_mount do
132
+ mark_response_lines
133
+ end
136
134
 
137
- end
135
+ render do
136
+ DIV {}.on(:mouse_down) { |e| e.stop_propagation }
137
+ end
138
+
139
+ end
138
140
 
139
- class CodeEditor < CodeMirror
140
- param :history
141
- param :context
141
+ class CodeEditor < CodeMirror
142
+ param :history
143
+ param :context
142
144
 
143
- class << self
144
- attr_accessor :editor
145
+ class << self
146
+ attr_accessor :editor
145
147
 
146
- def set_focus
147
- editor.set_focus_at_end if editor
148
- end
149
- end
148
+ def set_focus
149
+ editor.set_focus_at_end if editor
150
+ end
151
+ end
150
152
 
151
- before_mount do
152
- @history = params.history.collect { |item| item[:eval] }.compact + ['']
153
- @history_pos = @history.length-1
154
- end
153
+ before_mount do
154
+ @history = params.history.collect { |item| item[:eval] }.compact + ['']
155
+ @history_pos = @history.length-1
156
+ end
155
157
 
156
- after_mount do
157
- `#{@editor}.on('change', #{lambda {on_change} })`
158
- `#{@editor}.on('keydown', #{lambda { |cm, e| on_key_down(cm, e) } })`
159
- `#{@editor}.focus()`
160
- self.class.editor = self
161
- end
158
+ after_mount do
159
+ `#{@editor}.on('change', #{lambda {on_change} })`
160
+ `#{@editor}.on('keydown', #{lambda { |cm, e| on_key_down(cm, e) } })`
161
+ `#{@editor}.focus()`
162
+ self.class.editor = self
163
+ end
162
164
 
163
- before_unmount do
164
- self.class.editor = nil
165
- end
165
+ before_unmount do
166
+ self.class.editor = nil
167
+ end
166
168
 
167
- def move_history(n)
168
- @history[@history_pos] = `#{@editor}.getValue()`
169
- @history_pos += n
170
- text = @history[@history_pos]
171
- lines = text.split("\n")
172
- `#{@editor}.setValue(#{text})`
169
+ def move_history(n)
170
+ @history[@history_pos] = `#{@editor}.getValue()`
171
+ @history_pos += n
172
+ text = @history[@history_pos]
173
+ lines = text.split("\n")
174
+ `#{@editor}.setValue(#{text})`
175
+
176
+ after(0) do
177
+ `window.scrollTo(window.scrollX, 99999)`
178
+ `#{@editor}.setCursor({line: #{lines.count}, ch: #{(lines.last || '').length}})`
179
+ end
180
+ end
173
181
 
174
- after(0) do
175
- `window.scrollTo(window.scrollX, 99999)`
176
- `#{@editor}.setCursor({line: #{lines.count}, ch: #{(lines.last || '').length}})`
177
- end
178
- end
182
+ def set_focus_at_end
183
+ `#{@editor}.focus()`
184
+ lines = `#{@editor}.getValue()`.split("\n")
185
+ `#{@editor}.setCursor({line: #{lines.count}, ch: #{(lines.last || '').length}})`
186
+ end
179
187
 
180
- def set_focus_at_end
181
- `#{@editor}.focus()`
182
- lines = `#{@editor}.getValue()`.split("\n")
183
- `#{@editor}.setCursor({line: #{lines.count}, ch: #{(lines.last || '').length}})`
184
- end
185
188
 
189
+ def on_key_down(cm, e)
190
+ if `e.metaKey` || `e.ctrlKey`
191
+ return unless `e.keyCode` == 13
192
+ `#{@editor}.setValue(#{@editor}.getValue()+#{"\n"})`
193
+ #on_change
194
+ elsif `e.key` == 'ArrowUp'
195
+ move_history(-1) if @history_pos > 0
196
+ elsif `e.key` == 'ArrowDown'
197
+ move_history(1) if @history_pos < @history.length-1
198
+ end
199
+ end
186
200
 
187
- def on_key_down(cm, e)
188
- if `e.metaKey` || `e.ctrlKey`
189
- return unless `e.keyCode` == 13
190
- `#{@editor}.setValue(#{@editor}.getValue()+#{"\n"})`
191
- #on_change
192
- elsif `e.key` == 'ArrowUp'
193
- move_history(-1) if @history_pos > 0
194
- elsif `e.key` == 'ArrowDown'
195
- move_history(1) if @history_pos < @history.length-1
196
- end
197
- end
201
+ def mark_error(message)
202
+ from, to, title = parse_error(message)
203
+ @error = `#{@editor}.markText(#{from.to_n}, #{to.to_n}, {className: 'syntax-error', title: title})`
204
+ end
198
205
 
199
- def mark_error(message)
200
- from, to, title = parse_error(message)
201
- @error = `#{@editor}.markText(#{from.to_n}, #{to.to_n}, {className: 'syntax-error', title: title})`
202
- end
206
+ def parse_error(message)
207
+ message = message.split("\n")
208
+ position_info = message[3].split(':')
209
+ last_line_number = `#{@editor}.lineCount()`
210
+ last_line = `#{@editor}.getLine(last_line_number-1)`
211
+ [
212
+ {line: 0, ch: 0},
213
+ {line: last_line_number, ch: last_line.length},
214
+ message[2].split(':(file)')[0]
215
+ ]
216
+ end
203
217
 
204
- def parse_error(message)
205
- message = message.split("\n")
206
- position_info = message[3].split(':')
207
- last_line_number = `#{@editor}.lineCount()`
208
- last_line = `#{@editor}.getLine(last_line_number-1)`
209
- [
210
- {line: 0, ch: 0},
211
- {line: last_line_number, ch: last_line.length},
212
- message[2].split(':(file)')[0]
213
- ]
214
- end
218
+ def clear_error
219
+ `#{@error}.clear()` if @error
220
+ @error = nil
221
+ end
215
222
 
216
- def clear_error
217
- `#{@error}.clear()` if @error
218
- @error = nil
219
- end
223
+ def on_change
224
+ clear_error
225
+ code = `#{@editor}.getValue()`
226
+ if params.context.empty?
227
+ compiled_code = Opal.compile(code, irb: true)
228
+ else
229
+ compiled_code = Opal.compile("#{params.context}.instance_eval {#{code}}")
230
+ end
231
+ DebugConsole.ready!(code, compiled_code)
232
+ rescue Exception => e
233
+ mark_error(e.message)
234
+ end
220
235
 
221
- def on_change
222
- clear_error
223
- code = `#{@editor}.getValue()`
224
- if params.context.empty?
225
- compiled_code = Opal.compile(code, irb: true)
226
- else
227
- compiled_code = Opal.compile("#{params.context}.instance_eval {#{code}}")
236
+ render do
237
+ DIV {}.on(:mouse_down) { |e| e.stop_propagation }
238
+ end
228
239
  end
229
- DebugConsole.ready!(code, compiled_code)
230
- rescue Exception => e
231
- mark_error(e.message)
232
- end
233
-
234
- render do
235
- DIV {}.on(:mouse_down) { |e| e.stop_propagation }
236
- end
237
- end
238
240
 
239
- Document.ready? do
240
- mount_point = Element["[data-react-class='React.TopLevelRailsComponent']"]
241
- mount_point.render do
242
- DebugConsole(JSON.parse(mount_point.attr('data-react-props'))[:render_params])
241
+ Document.ready? do
242
+ mount_point = Element["[data-react-class='React.TopLevelRailsComponent']"]
243
+ mount_point.render do
244
+ Hyperloop::Console::DebugConsole(JSON.parse(mount_point.attr('data-react-props'))[:render_params])
245
+ end
246
+ end
243
247
  end
244
248
  end