UNPKG

gitbook-parsers

Version:

Includes GitBook parsers and normalize output

2 lines 822 kB
!function(){var define=void 0;!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self),o.gitbookParsers=e()}}(function(){var define,module,exports;return function e(o,f,n){function d(t,l){if(!f[t]){if(!o[t]){var u="function"==typeof require&&require;if(!l&&u)return u(t,!0);if(i)return i(t,!0);var s=new Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}var p=f[t]={exports:{}};o[t][0].call(p.exports,function(e){var f=o[t][1][e];return d(f?f:e)},p,p.exports,e,o,f,n)}return f[t].exports}for(var i="function"==typeof require&&require,t=0;t<n.length;t++)d(n[t]);return d}({1:[function(e,o,f){function n(e){return i.chain(e).map(function(e){return e.id=d(e.name),e}).sortBy(function(e){return e.name.toLowerCase()}).value()}function d(e){return e.toLowerCase().replace(/[\/\\\?\%\*\:\;\|\"\'\\<\\>\#\$\(\)\!\.\@]/g,"").replace(/ /g,"_").trim()}var i=e("lodash");o.exports={entryId:d,normalize:n}},{lodash:113}],2:[function(e,o,f){function n(e){return u.wrap(e,function(e){var o=Array.prototype.slice.call(arguments,1);return l().then(function(){return e.apply(null,o)})})}function d(e){var o=e.parser,f={name:e.name,extensions:e.extensions};f.glossary=n(u.compose(r.normalize,o.glossary)),f.glossary.toText=n(o.glossary.toText);var d=n(o.summary);return f.summary=function(e,o){return d(e).then(function(e){return p.normalize(e,o)})},f.summary.toText=n(o.summary.toText),f.langs=n(u.compose(y.normalize,o.langs)),f.langs.toText=n(o.langs.toText),f.readme=n(o.readme),f.page=n(o.page),f.page.prepare=n(o.page.prepare||u.identity),f}function i(e){return u.find(a,function(o){return o.name==e||u.contains(o.extensions,e)})}function t(e){return i(s.extname(e))}var l=e("q"),u=e("lodash"),s=e("path"),p=e("./summary"),r=e("./glossary"),y=e("./langs"),a=u.chain([{name:"markdown",extensions:[".md",".markdown",".mdown"],parser:e("gitbook-markdown")},{name:"asciidoc",extensions:[".adoc",".asciidoc"],parser:e("gitbook-asciidoc")},{name:"restructuredtext",extensions:[".rst"],parser:e("gitbook-restructuredtext")}]).map(function(e){return e.parser&&e.parser.summary&&e.parser.page&&e.parser.glossary&&e.parser.readme?d(e):null}).compact().value();o.exports={all:a,extensions:u.flatten(u.pluck(a,"extensions")),get:i,getForFile:t,glossary:{entryId:r.entryId}}},{"./glossary":1,"./langs":3,"./summary":4,"gitbook-asciidoc":57,"gitbook-markdown":64,"gitbook-restructuredtext":11,lodash:113,path:118,q:121}],3:[function(e,o,f){function n(e){return d.chain(e).filter(function(e){return Boolean(e.path)}).map(function(e){return{title:e.title.trim(),path:e.path,lang:i.basename(e.path)}}).value()}var d=e("lodash"),i=e("path");o.exports={normalize:n}},{lodash:113,path:118}],4:[function(e,o,f){function n(e,o){var f=l.find(e,function(e){return d(e.path)==d(o.entryPoint)});return f?e:[{path:o.entryPoint,title:o.entryPointTitle}].concat(e)}function d(e){return e?s.normalize(e).replace(/\\/g,"/").replace(/^\/+/,""):e}function i(e,o,f,n,t){n=n||0,t=t||{};var u=n;return l.chain(e).map(function(e){if(e.path=d(e.path),e.path){if(t[e.path])return null;t[e.path]=!0}return e.level=(f?[f||"",u]:[u]).join("."),e.external=p(e.path),e.exists=e.path?e.external||!o.files||!!l.find(o.files,function(o){return d(o)==e.path}):!1,u+=1,{path:e.path,title:e.title.trim(),level:e.level,articles:i(e.articles||[],o,e.level,1,t),exists:e.exists,external:e.external,introduction:e.path==o.entryPoint}}).compact().value()}function t(e,o){return o=l.defaults(o||{},{entryPoint:"README.md",entryPointTitle:"Introduction",files:null}),l.isArray(e)&&(e={chapters:e}),e.chapters=n(e.chapters,o),e.chapters=i(e.chapters,o),e}var l=e("lodash"),u=e("url"),s=e("path"),p=function(e){try{return Boolean(u.parse(e).protocol)}catch(o){}return!1};o.exports={normalize:t}},{lodash:113,path:118,url:137}],5:[function(e,o,f){!function(){function e(e){this.message=e}var o="undefined"!=typeof f?f:this,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.prototype=new Error,e.prototype.name="InvalidCharacterError",o.btoa||(o.btoa=function(o){for(var f,d,i=0,t=n,l="";o.charAt(0|i)||(t="=",i%1);l+=t.charAt(63&f>>8-i%1*8)){if(d=o.charCodeAt(i+=.75),d>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");f=f<<8|d}return l}),o.atob||(o.atob=function(o){if(o=o.replace(/=+$/,""),o.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var f,d,i=0,t=0,l="";d=o.charAt(t++);~d&&(f=i%4?64*f+d:d,i++%4)?l+=String.fromCharCode(255&f>>(-2*i&6)):0)d=n.indexOf(d);return l})}()},{}],6:[function(require,module,exports){module.exports=function(opalParam,xmlHttpRequestParam){var Opal=opalParam||require("opal-npm-wrapper").Opal;if(xmlHttpRequestParam!==!1){var XMLHttpRequest=xmlHttpRequestParam||require("xmlhttprequest").XMLHttpRequest;XMLHttpRequest.prototype.overrideMimeType=function(){}}return{Opal:Opal,Asciidoctor:function(loadExtensions){return function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice),d=e.klass,i=e.module;return function(o,i){function t(){}var l,u,s,p=t=d(o,i,"Set",t),r=p._proto,y=p._scope;return r.hash=f,p.$include(y.Enumerable),e.defs(p,"$[]",function(e){var o=this;return e=n.call(arguments,0),o.$new(e)}),r.$initialize=l=function(e){var o,n,d,i=this,t=l._p,u=t||f;return null==e&&(e=f),l._p=null,i.hash=y.Hash.$new(),(o=e["$nil?"]())===f||o._isBoolean&&1!=o?u!==!1&&u!==f?(o=(n=i).$do_with_enum,o._p=(d=function(e){var o=d._s||this;return null==e&&(e=f),o.$add(u["$[]"](e))},d._s=i,d),o).call(n,e):i.$merge(e):f},r["$=="]=function(e){var o,n,d,i=this;return(o=i["$equal?"](e))===f||o._isBoolean&&1!=o?(o=e["$instance_of?"](i.$class()))===f||o._isBoolean&&1!=o?(n=e["$is_a?"](y.Set),(o=n!==!1&&n!==f?i.$size()["$=="](e.$size()):n)===f||o._isBoolean&&1!=o?!1:(o=(n=e)["$all?"],o._p=(d=function(e){var o=d._s||this;return null==o.hash&&(o.hash=f),null==e&&(e=f),o.hash["$include?"](e)},d._s=i,d),o).call(n)):i.hash["$=="](e.$instance_variable_get("@hash")):!0},r.$add=function(e){var o=this;return o.hash["$[]="](e,!0),o},e.defn(p,"$<<",r.$add),r["$add?"]=function(e){var o,n=this;return(o=n["$include?"](e))===f||o._isBoolean&&1!=o?n.$add(e):f},r.$each=u=function(){var e,o,n=this,d=u._p,i=d||f;return u._p=null,i===f?n.$enum_for("each"):((e=(o=n.hash).$each_key,e._p=i.$to_proc(),e).call(o),n)},r["$empty?"]=function(){var e=this;return e.hash["$empty?"]()},r.$clear=function(){var e=this;return e.hash.$clear(),e},r["$include?"]=function(e){var o=this;return o.hash["$include?"](e)},e.defn(p,"$member?",r["$include?"]),r.$merge=function(e){var o,n,d,i=this;return(o=(n=i).$do_with_enum,o._p=(d=function(e){var o=d._s||this;return null==e&&(e=f),o.$add(e)},d._s=i,d),o).call(n,e),i},r.$do_with_enum=s=function(e){var o,n,d=s._p,i=d||f;return s._p=null,(o=(n=e).$each,o._p=i.$to_proc(),o).call(n)},r.$size=function(){var e=this;return e.hash.$size()},e.defn(p,"$length",r.$size),r.$to_a=function(){var e=this;return e.hash.$keys()},f&&"to_a"}(o,null),function(o){var d,t=i(o,"Enumerable"),l=t._proto,u=t._scope;l.$to_set=d=function(e,o){var i,t,l=this,s=d._p,p=s||f;return o=n.call(arguments,1),null==e&&(e=u.Set),d._p=null,(i=(t=e).$new,i._p=p.$to_proc(),i).apply(t,[l].concat(o))},e.donate(t,["$to_set"])}(o)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.module);return function(o){var d=n(o,"Comparable"),i=d._proto,t=d._scope;e.defs(d,"$normalize",function(e){var o;return(o=t.Integer["$==="](e))===f||o._isBoolean&&1!=o?e["$>"](0)?1:e["$<"](0)?-1:0:e}),i["$=="]=function(o){var n,d=this,i=f;try{return(n=d["$equal?"](o))===f||n._isBoolean&&1!=n?(n=i=d["$<=>"](o))===f||n._isBoolean&&1!=n?!1:t.Comparable.$normalize(i)["$=="](0):!0}catch(l){if(e.$rescue(l,[t.StandardError]))return!1;throw l}},i["$>"]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),t.Comparable.$normalize(d)["$>"](0)},i["$>="]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),t.Comparable.$normalize(d)["$>="](0)},i["$<"]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),t.Comparable.$normalize(d)["$<"](0)},i["$<="]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),t.Comparable.$normalize(d)["$<="](0)},i["$between?"]=function(e,o){var f=this;return f["$<"](e)?!1:f["$>"](o)?!1:!0},e.donate(d,["$==","$>","$>=","$<","$<=","$between?"])}(o)}(Opal),function($opal){var self=$opal.top,$scope=$opal,nil=$opal.nil,$breaker=$opal.breaker,$slice=$opal.slice,$klass=$opal.klass,$gvars=$opal.gvars;return function($base,$super){function $String(){}var self=$String=$klass($base,$super,"String",$String),def=self._proto,$scope=self._scope,TMP_1,TMP_2,TMP_3,TMP_4,TMP_5,TMP_6,TMP_7;return def.length=nil,self.$include($scope.Comparable),def._isString=!0,$opal.defs(self,"$try_convert",function(e){try{return e.$to_str()}catch(o){return nil}}),$opal.defs(self,"$new",function(e){return null==e&&(e=""),new String(e)}),def["$%"]=function(e){var o,f=this;return(o=$scope.Array["$==="](e))===nil||o._isBoolean&&1!=o?f.$format(f,e):(o=f).$format.apply(o,[f].concat(e))},def["$*"]=function(e){var o=this;if(1>e)return"";for(var f="",n=o;e>0;)1&e&&(f+=n),e>>=1,n+=n;return f},def["$+"]=function(e){var o=this;return e=$scope.Opal.$coerce_to(e,$scope.String,"to_str"),o+e.$to_s()},def["$<=>"]=function(e){var o,f=this;if((o=e["$respond_to?"]("to_str"))===nil||o._isBoolean&&1!=o){var n=e["$<=>"](f);return n===nil?nil:n>0?-1:0>n?1:0}return e=e.$to_str().$to_s(),f>e?1:e>f?-1:0},def["$=="]=function(e){var o,f=this;return(o=$scope.String["$==="](e))===nil||o._isBoolean&&1!=o?!1:f.$to_s()==e.$to_s()},$opal.defn(self,"$eql?",def["$=="]),$opal.defn(self,"$===",def["$=="]),def["$=~"]=function(e){var o=this;return e._isString&&o.$raise($scope.TypeError,"type mismatch: String given"),e["$=~"](o)},def["$[]"]=function(e,o){var f=this,n=f.length;if(e._isRange){var d=e.exclude,o=e.end,e=e.begin;return 0>e&&(e+=n),0>o&&(o+=n),d||(o+=1),e>n?nil:(o-=e,0>o&&(o=0),f.substr(e,o))}return 0>e&&(e+=f.length),null==o?e>=f.length||0>e?nil:f.substr(e,1):e>f.length||0>e?nil:f.substr(e,o)},def.$capitalize=function(){var e=this;return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()},def.$casecmp=function(e){var o=this;return e=$scope.Opal.$coerce_to(e,$scope.String,"to_str").$to_s(),o.toLowerCase()["$<=>"](e.toLowerCase())},def.$center=function(e,o){var f,n=this;if(null==o&&(o=" "),e=$scope.Opal.$coerce_to(e,$scope.Integer,"to_int"),o=$scope.Opal.$coerce_to(o,$scope.String,"to_str").$to_s(),(f=o["$empty?"]())===nil||f._isBoolean&&1!=f||n.$raise($scope.ArgumentError,"zero width padding"),(f=e<=n.length)!==nil&&(!f._isBoolean||1==f))return n;var d=n.$ljust(e["$+"](n.length)["$/"](2).$ceil(),o),i=n.$rjust(e["$+"](n.length)["$/"](2).$floor(),o);return i+d.slice(n.length)},def.$chars=TMP_1=function(){var e,o,f=this,n=TMP_1._p,d=n||nil;return TMP_1._p=null,d===!1||d===nil?f.$each_char().$to_a():(e=(o=f).$each_char,e._p=d.$to_proc(),e).call(o)},def.$chomp=function(e){var o,f=this;if(null==$gvars["/"]&&($gvars["/"]=nil),null==e&&(e=$gvars["/"]),(o=e===nil||0===f.length)!==nil&&(!o._isBoolean||1==o))return f;if(e=$scope.Opal["$coerce_to!"](e,$scope.String,"to_str").$to_s(),"\n"===e)return f.replace(/\r?\n?$/,"");if(""===e)return f.replace(/(\r?\n)+$/,"");if(f.length>e.length){var n=f.substr(f.length-e.length,e.length);if(n===e)return f.substr(0,f.length-e.length)}return f},def.$chop=function(){var e=this,o=e.length;return 1>=o?"":"\n"===e.charAt(o-1)&&"\r"===e.charAt(o-2)?e.substr(0,o-2):e.substr(0,o-1)},def.$chr=function(){var e=this;return e.charAt(0)},def.$clone=function(){var e=this,o=nil;return o=e.slice(),o.$initialize_clone(e),o},def.$dup=function(){var e=this,o=nil;return o=e.slice(),o.$initialize_dup(e),o},def.$count=function(e){var o=this;return(o.length-o.replace(new RegExp(e,"g"),"").length)/e.length},$opal.defn(self,"$dup",def.$clone),def.$downcase=function(){var e=this;return e.toLowerCase()},def.$each_char=TMP_2=function(){var e,o=this,f=TMP_2._p,n=f||nil;if(TMP_2._p=null,n===nil)return o.$enum_for("each_char");for(var d=0,i=o.length;i>d;d++)(e=$opal.$yield1(n,o.charAt(d)))===$breaker?$breaker.$v:e;return o},def.$each_line=TMP_3=function(e){var o,f=this,n=TMP_3._p,d=n||nil;if(null==$gvars["/"]&&($gvars["/"]=nil),null==e&&(e=$gvars["/"]),TMP_3._p=null,d===nil)return f.$split(e);for(var i=f.$chomp(),t=f.length!=i.length,l=i.split(e),u=0,s=l.length;s>u;u++)s-1>u||t?(o=$opal.$yield1(d,l[u]+e))===$breaker?$breaker.$v:o:(o=$opal.$yield1(d,l[u]))===$breaker?$breaker.$v:o;return f},def["$empty?"]=function(){var e=this;return 0===e.length},def["$end_with?"]=function(e){var o=this;e=$slice.call(arguments,0);for(var f=0,n=e.length;n>f;f++){var d=$scope.Opal.$coerce_to(e[f],$scope.String,"to_str").$to_s();if(o.length>=d.length&&o.substr(o.length-d.length,d.length)==d)return!0}return!1},$opal.defn(self,"$eql?",def["$=="]),$opal.defn(self,"$equal?",def["$==="]),def.$gsub=TMP_4=function(e,o){var f,n,d=this,i=TMP_4._p,t=i||nil;TMP_4._p=null,(f=(n=$scope.String["$==="](e))!==!1&&n!==nil?n:e["$respond_to?"]("to_str"))===nil||f._isBoolean&&1!=f||(e=new RegExp(""+$scope.Regexp.$escape(e.$to_str()))),((f=$scope.Regexp["$==="](e))===nil||f._isBoolean&&1!=f)&&d.$raise($scope.TypeError,"wrong argument type "+e.$class()+" (expected Regexp)");var e=e.toString(),l=e.substr(e.lastIndexOf("/")+1)+"g",u=e.substr(1,e.lastIndexOf("/")-1);return d.$sub._p=t,d.$sub(new RegExp(u,l),o)},def.$hash=function(){var e=this;return e.toString()},def.$hex=function(){var e=this;return e.$to_i(16)},def["$include?"]=function(e){var o,f=this;return e._isString?-1!==f.indexOf(e):(((o=e["$respond_to?"]("to_str"))===nil||o._isBoolean&&1!=o)&&f.$raise($scope.TypeError,"no implicit conversion of "+e.$class().$name()+" into String"),-1!==f.indexOf(e.$to_str()))},def.$index=function(e,o){var f,n=this,d=nil;if(null==o&&(o=nil),(f=$scope.String["$==="](e))===nil||f._isBoolean&&1!=f?(f=e["$respond_to?"]("to_str"))===nil||f._isBoolean&&1!=f?(f=$scope.Regexp["$==="](e)["$!"]())===nil||f._isBoolean&&1!=f||n.$raise($scope.TypeError,"type mismatch: "+e.$class()+" given"):e=e.$to_str().$to_s():e=e.$to_s(),d=-1,o!==!1&&o!==nil){o=$scope.Opal.$coerce_to(o,$scope.Integer,"to_int");var i=n.length;if(0>o&&(o+=i),o>i)return nil;d=(f=$scope.Regexp["$==="](e))===nil||f._isBoolean&&1!=f?n.substr(o).indexOf(e):(f=e["$=~"](n.substr(o)))!==!1&&f!==nil?f:-1,-1!==d&&(d+=o)}else d=(f=$scope.Regexp["$==="](e))===nil||f._isBoolean&&1!=f?n.indexOf(e):(f=e["$=~"](n))!==!1&&f!==nil?f:-1;return(f=-1===d)===nil||f._isBoolean&&1!=f?d:nil},def.$inspect=function(){var e=this,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(e)?'"'+e.replace(o,function(e){var o=f[e];return"string"==typeof o?o:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},def.$intern=function(){var e=this;return e},def.$lines=function(e){var o=this;return null==$gvars["/"]&&($gvars["/"]=nil),null==e&&(e=$gvars["/"]),o.$each_line(e).$to_a()},def.$length=function(){var e=this;return e.length},def.$ljust=function(e,o){var f,n=this;if(null==o&&(o=" "),e=$scope.Opal.$coerce_to(e,$scope.Integer,"to_int"),o=$scope.Opal.$coerce_to(o,$scope.String,"to_str").$to_s(),(f=o["$empty?"]())===nil||f._isBoolean&&1!=f||n.$raise($scope.ArgumentError,"zero width padding"),(f=e<=n.length)!==nil&&(!f._isBoolean||1==f))return n;var d=-1,i="";for(e-=n.length;++d<e;)i+=o;return n+i.slice(0,e)},def.$lstrip=function(){var e=this;return e.replace(/^\s*/,"")},def.$match=TMP_5=function(e,o){var f,n,d=this,i=TMP_5._p,t=i||nil;return TMP_5._p=null,(f=(n=$scope.String["$==="](e))!==!1&&n!==nil?n:e["$respond_to?"]("to_str"))===nil||f._isBoolean&&1!=f||(e=new RegExp(""+$scope.Regexp.$escape(e.$to_str()))),((f=$scope.Regexp["$==="](e))===nil||f._isBoolean&&1!=f)&&d.$raise($scope.TypeError,"wrong argument type "+e.$class()+" (expected Regexp)"),(f=(n=e).$match,f._p=t.$to_proc(),f).call(n,d,o)},def.$next=function(){var e=this;if(0===e.length)return"";var o=e.substr(0,e.length-1),f=String.fromCharCode(e.charCodeAt(e.length-1)+1);return o+f},def.$ord=function(){var e=this;return e.charCodeAt(0)},def.$partition=function(e){var o=this,f=o.split(e),n=f[0].length===o.length?"":e;return[f[0],n,f.slice(1).join(e.toString())]},def.$reverse=function(){var e=this;return e.split("").reverse().join("")},def.$rindex=function(e,o){var f=this,n=null==e?Opal.NilClass:e.constructor;if(n!=String&&n!=RegExp){var d="type mismatch: "+n+" given";f.$raise($scope.TypeError.$new(d))}if(0==f.length)return 0==e.length?0:nil;var i=-1;return null!=o?(0>o&&(o=f.length+o),n==String?i=f.lastIndexOf(e,o):(i=f.substr(0,o+1).$reverse().search(e),-1!==i&&(i=o-i))):n==String?i=f.lastIndexOf(e):(i=f.$reverse().search(e),-1!==i&&(i=f.length-1-i)),-1===i?nil:i},def.$rjust=function(e,o){var f,n=this;if(null==o&&(o=" "),e=$scope.Opal.$coerce_to(e,$scope.Integer,"to_int"),o=$scope.Opal.$coerce_to(o,$scope.String,"to_str").$to_s(),(f=o["$empty?"]())===nil||f._isBoolean&&1!=f||n.$raise($scope.ArgumentError,"zero width padding"),(f=e<=n.length)!==nil&&(!f._isBoolean||1==f))return n;var d=Math.floor(e-n.length),i=Math.floor(d/o.length),t=Array(i+1).join(o),l=d-t.length;return t+o.slice(0,l)+n},def.$rstrip=function(){var e=this;return e.replace(/\s*$/,"")},def.$scan=TMP_6=function(e){var o=this,f=TMP_6._p,n=f||nil;TMP_6._p=null,e.global?e.lastIndex=0:e=new RegExp(e.source,"g"+(e.multiline?"m":"")+(e.ignoreCase?"i":""));for(var d,i=[];null!=(d=e.exec(o));)$scope.MatchData.$new(e,d),n===nil?i.push(1==d.length?d[0]:d.slice(1)):1==d.length?n(d[0]):n.apply(o,d.slice(1));return n!==nil?o:i},$opal.defn(self,"$size",def.$length),$opal.defn(self,"$slice",def["$[]"]),def.$split=function(pattern,limit){var self=this,$a;null==$gvars[";"]&&($gvars[";"]=nil),null==pattern&&(pattern=($a=$gvars[";"])!==!1&&$a!==nil?$a:" "),(pattern===nil||void 0===pattern)&&(pattern=$gvars[";"]);var result=[];if(void 0!==limit&&(limit=$scope.Opal["$coerce_to!"](limit,$scope.Integer,"to_int")),0===self.length)return[];if(1===limit)return[self];if(pattern&&pattern._isRegexp){var pattern_str=pattern.toString(),blank_pattern="/^/"==pattern_str.substr(0,3)||"/(?:)/"==pattern_str.substr(0,6);if(void 0===limit||0===limit)result=self.split(blank_pattern?/(?:)/:pattern);else{pattern.global||(pattern=eval(pattern_str+"g"));var match_data,prev_index=0;for(pattern.lastIndex=0;null!==(match_data=pattern.exec(self));){var segment=self.slice(prev_index,match_data.index);if(result.push(segment),prev_index=pattern.lastIndex,0===match_data[0].length){blank_pattern&&(pattern=/(?:)/),result=self.split(pattern),void 0!==limit&&0>limit&&blank_pattern&&result.push(""),prev_index=void 0;break}if(void 0!==limit&&limit>1&&result.length+1==limit)break}void 0!==prev_index&&result.push(self.slice(prev_index,self.length))}}else{var splitted=0,start=0,lim=0;pattern=pattern===nil||void 0===pattern?" ":$scope.Opal.$try_convert(pattern,$scope.String,"to_str").$to_s();for(var string=" "==pattern?self.replace(/[\r\n\t\v]\s+/g," "):self,cursor=-1;(cursor=string.indexOf(pattern,start))>-1&&cursor<string.length&&splitted+1!==limit;)" "!=pattern||cursor!=start?(result.push(string.substr(start,pattern.length?cursor-start:1)),splitted++,start=cursor+(pattern.length?pattern.length:1)):start=cursor+1;string.length>0&&(0>limit||string.length>start)&&result.push(string.length==start?"":string.substr(start,string.length))}if(void 0===limit||0===limit)for(;""===result[result.length-1];)result.length=result.length-1;if(limit>0){var tail=result.slice(limit-1).join("");result.splice(limit-1,result.length-1,tail)}return result},def.$squeeze=function(e){var o=this;if(e=$slice.call(arguments,0),0===e.length)return o.replace(/(.)\1+/g,"$1");for(var f=$scope.Opal.$coerce_to(e[0],$scope.String,"to_str").$chars(),n=1,d=e.length;d>n;n++)f=f["$&"]($scope.Opal.$coerce_to(e[n],$scope.String,"to_str").$chars());return 0===f.length?o:o.replace(new RegExp("(["+$scope.Regexp.$escape(f.$join())+"])\\1+","g"),"$1")},def["$start_with?"]=function(e){var o=this;e=$slice.call(arguments,0);for(var f=0,n=e.length;n>f;f++){var d=$scope.Opal.$coerce_to(e[f],$scope.String,"to_str").$to_s();if(0===o.indexOf(d))return!0}return!1},def.$strip=function(){var e=this;return e.replace(/^\s*/,"").replace(/\s*$/,"")},def.$sub=TMP_7=function(e,o){var f=this,n=TMP_7._p,d=n||nil;return TMP_7._p=null,"string"==typeof o?(o=o.replace(/\\([1-9])/g,"$$$1"),f.replace(e,o)):d!==nil?f.replace(e,function(){for(var e=[],o=0,f=arguments.length;f>o;o++){var n=arguments[o];e.push(void 0==n?nil:n)}return e.pop(),e.pop(),e.length,$gvars["&"]=e[0],$gvars["~"]=e,d(e[0])}):void 0!==o?o["$is_a?"]($scope.Hash)?f.replace(e,function(){var e=o["$[]"](f.$str());return null==e?nil:f.$value().$to_s()}):(o=$scope.String.$try_convert(o),null==o&&f.$raise($scope.TypeError,"can't convert "+o.$class()+" into String"),f.replace(e,o)):(o=o.toString().replace(/\\([1-9])/g,"$$$1"),f.replace(e,o))},$opal.defn(self,"$succ",def.$next),def.$sum=function(e){var o=this;null==e&&(e=16);for(var f=0,n=0,d=o.length;d>n;n++)f+=o.charCodeAt(n)%((1<<e)-1);return f},def.$swapcase=function(){var e=this,o=e.replace(/([a-z]+)|([A-Z]+)/g,function(e,o){return o?e.toUpperCase():e.toLowerCase()});return e.constructor===String?o:e.$class().$new(o)},def.$to_f=function(){var e=this;if("_"===e.charAt(0))return 0;var o=parseFloat(e.replace(/_/g,""));return isNaN(o)||1/0==o||o==-1/0?0:o},def.$to_i=function(e){var o=this;null==e&&(e=10);var f=parseInt(o,e);return isNaN(f)?0:f},def.$to_proc=function(){var e,o,f,n=this;return(e=(o=n).$proc,e._p=(f=function(e,o){var n,d=f._s||this;return null==e&&(e=nil),o=$slice.call(arguments,1),(n=e).$send.apply(n,[d].concat(o))},f._s=n,f),e).call(o)},def.$to_s=function(){var e=this;return e.toString()},$opal.defn(self,"$to_str",def.$to_s),$opal.defn(self,"$to_sym",def.$intern),def.$tr=function(e,o){var f=this;if(0==e.length||e===o)return f;var n={},d=e.split(""),i=d.length,t=o.split(""),l=t.length,u=!1,s=null;"^"===d[0]&&(u=!0,d.shift(),s=t[l-1],i-=1);for(var p=[],r=null,y=!1,a=0;i>a;a++){var c=d[a];if(null==r)r=c,p.push(c);else if("-"===c)"-"===r?(p.push("-"),p.push("-")):a==i-1?p.push("-"):y=!0;else if(y){for(var b=r.charCodeAt(0)+1,w=c.charCodeAt(0),g=b;w>g;g++)p.push(String.fromCharCode(g));p.push(c),y=null,r=null}else p.push(c)}if(d=p,i=d.length,u)for(var a=0;i>a;a++)n[d[a]]=!0;else{if(l>0){for(var m=[],x=null,y=!1,a=0;l>a;a++){var c=t[a];if(null==r)r=c,m.push(c);else if("-"===c)"-"===x?(m.push("-"),m.push("-")):a==l-1?m.push("-"):y=!0;else if(y){for(var b=r.charCodeAt(0)+1,w=c.charCodeAt(0),g=b;w>g;g++)m.push(String.fromCharCode(g));m.push(c),y=null,r=null}else m.push(c)}t=m,l=t.length}var j=i-l;if(j>0)for(var k=l>0?t[l-1]:"",a=0;j>a;a++)t.push(k);for(var a=0;i>a;a++)n[d[a]]=t[a]}for(var v="",a=0,P=f.length;P>a;a++){var c=f.charAt(a),h=n[c];v+=u?null==h?s:c:null!=h?h:c}return v},def.$tr_s=function(e,o){var f=this;if(0==e.length)return f;var n={},d=e.split(""),i=d.length,t=o.split(""),l=t.length,u=!1,s=null;"^"===d[0]&&(u=!0,d.shift(),s=t[l-1],i-=1);for(var p=[],r=null,y=!1,a=0;i>a;a++){var c=d[a];if(null==r)r=c,p.push(c);else if("-"===c)"-"===r?(p.push("-"),p.push("-")):a==i-1?p.push("-"):y=!0;else if(y){for(var b=r.charCodeAt(0)+1,w=c.charCodeAt(0),g=b;w>g;g++)p.push(String.fromCharCode(g));p.push(c),y=null,r=null}else p.push(c)}if(d=p,i=d.length,u)for(var a=0;i>a;a++)n[d[a]]=!0;else{if(l>0){for(var m=[],x=null,y=!1,a=0;l>a;a++){var c=t[a];if(null==r)r=c,m.push(c);else if("-"===c)"-"===x?(m.push("-"),m.push("-")):a==l-1?m.push("-"):y=!0;else if(y){for(var b=r.charCodeAt(0)+1,w=c.charCodeAt(0),g=b;w>g;g++)m.push(String.fromCharCode(g));m.push(c),y=null,r=null}else m.push(c)}t=m,l=t.length}var j=i-l;if(j>0)for(var k=l>0?t[l-1]:"",a=0;j>a;a++)t.push(k);for(var a=0;i>a;a++)n[d[a]]=t[a]}for(var v="",P=null,a=0,h=f.length;h>a;a++){var c=f.charAt(a),q=n[c];u?null==q?null==P&&(v+=s,P=!0):(v+=c,P=null):null!=q?(null==P||P!==q)&&(v+=q,P=q):(v+=c,P=null)}return v},def.$upcase=function(){var e=this;return e.toUpperCase()},def.$freeze=function(){var e=this;return e},def["$frozen?"]=function(){return!0},nil&&"frozen?"}(self,null),$opal.cdecl($scope,"Symbol",$scope.String)}(Opal),function(e){var o,f,n,d,i,t,l,u=e.top,s=e,p=e.nil,r=e.breaker,y=(e.slice,e.klass),a=e.hash2;return function(o,f){function n(){}var d,i=n=y(o,f,"Encoding",n),t=i._proto,l=i._scope;return t.ascii=t.dummy=t.name=p,e.defs(i,"$register",d=function(e,o){var f,n,i,t,u=this,s=d._p,r=s||p,y=p,c=p;return null==o&&(o=a([],{})),d._p=null,y=[e]["$+"]((f=o["$[]"]("aliases"))!==!1&&f!==p?f:[]),c=(f=(n=l.Class).$new,f._p=r.$to_proc(),f).call(n,u).$new(e,y,(f=o["$[]"]("ascii"))!==!1&&f!==p?f:!1,(f=o["$[]"]("dummy"))!==!1&&f!==p?f:!1),(f=(i=y).$each,f._p=(t=function(e){var o=t._s||this;return null==e&&(e=p),o.$const_set(e.$sub("-","_"),c)},t._s=u,t),f).call(i)}),e.defs(i,"$find",function(o){try{var f,n,d,i=this;return(f=i["$==="](o))===p||f._isBoolean&&1!=f?((f=(n=i.$constants()).$each,f._p=(d=function(f){var n,i,t=d._s||this,l=p;return null==f&&(f=p),l=t.$const_get(f),(n=(i=l.$name()["$=="](o))!==!1&&i!==p?i:l.$names()["$include?"](o))===p||n._isBoolean&&1!=n?p:void e.$return(l)},d._s=i,d),f).call(n),i.$raise(l.ArgumentError,"unknown encoding name - "+o)):o}catch(t){if(t===e.returner)return t.$v;throw t}}),function(e){return e._scope,e._proto,e.$attr_accessor("default_external")}(i.$singleton_class()),i.$attr_reader("name","names"),t.$initialize=function(e,o,f,n){var d=this;return d.name=e,d.names=o,d.ascii=f,d.dummy=n},t["$ascii_compatible?"]=function(){var e=this;return e.ascii},t["$dummy?"]=function(){var e=this;return e.dummy},t.$to_s=function(){var e=this;return e.name},t.$inspect=function(){var e,o=this;return"#<Encoding:"+o.name+function(){return(e=o.dummy)===p||e._isBoolean&&1!=e?p:" (dummy)"}()+">"},t.$each_byte=function(){var e=this;return e.$raise(l.NotImplementedError)},t.$getbyte=function(){var e=this;return e.$raise(l.NotImplementedError)},t.$bytesize=function(){var e=this;return e.$raise(l.NotImplementedError)},p&&"bytesize"}(u,null),(o=(f=s.Encoding).$register,o._p=(n=function(){var o,f=n._s||this;return e.defn(f,"$each_byte",o=function(f){var n,d=o._p,i=d||p;o._p=null;for(var t=0,l=f.length;l>t;t++){var u=f.charCodeAt(t);if(127>=u)(n=e.$yield1(i,u))===r?r.$v:n;else for(var s=encodeURIComponent(f.charAt(t)).substr(1).split("%"),y=0,a=s.length;a>y;y++)(n=e.$yield1(i,parseInt(s[y],16)))===r?r.$v:n}}),e.defn(f,"$bytesize",function(){var e=this;return e.$bytes().$length()}),p&&"bytesize"},n._s=u,n),o).call(f,"UTF-8",a(["aliases","ascii"],{aliases:["CP65001"],ascii:!0})),(o=(d=s.Encoding).$register,o._p=(i=function(){var o,f=i._s||this;return e.defn(f,"$each_byte",o=function(f){var n,d=o._p,i=d||p;o._p=null;for(var t=0,l=f.length;l>t;t++){var u=f.charCodeAt(t);(n=e.$yield1(i,255&u))===r?r.$v:n,(n=e.$yield1(i,u>>8))===r?r.$v:n}}),e.defn(f,"$bytesize",function(){var e=this;return e.$bytes().$length()}),p&&"bytesize"},i._s=u,i),o).call(d,"UTF-16LE"),(o=(t=s.Encoding).$register,o._p=(l=function(){var o,f=l._s||this;return e.defn(f,"$each_byte",o=function(f){var n,d=o._p,i=d||p;o._p=null;for(var t=0,l=f.length;l>t;t++)(n=e.$yield1(i,255&f.charCodeAt(t)))===r?r.$v:n}),e.defn(f,"$bytesize",function(){var e=this;return e.$bytes().$length()}),p&&"bytesize"},l._s=u,l),o).call(t,"ASCII-8BIT",a(["aliases","ascii"],{aliases:["BINARY"],ascii:!0})),function(e,o){function f(){}var n,d=f=y(e,o,"String",f),i=d._proto,t=d._scope;return i.encoding=p,i.encoding=t.Encoding._scope.UTF_16LE,i.$bytes=function(){var e=this;return e.$each_byte().$to_a()},i.$bytesize=function(){var e=this;return e.encoding.$bytesize(e)},i.$each_byte=n=function(){var e,o,f=this,d=n._p,i=d||p;return n._p=null,i===p?f.$enum_for("each_byte"):((e=(o=f.encoding).$each_byte,e._p=i.$to_proc(),e).call(o,f),f)},i.$encoding=function(){var e=this;return e.encoding},i.$force_encoding=function(e){var o=this;if(e=t.Encoding.$find(e),e["$=="](o.encoding))return o;var f=new String(o);return f.encoding=e,f},i.$getbyte=function(e){var o=this;return o.encoding.$getbyte(o,e)},p&&"getbyte"}(u,null)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.klass);return function(o,d){function i(){}var t=i=n(o,d,"StringScanner",i),l=t._proto;return t._scope,l.pos=l.string=l.working=l.prev_pos=l.matched=l.match=f,t.$attr_reader("pos"),t.$attr_reader("matched"),l.$initialize=function(e){var o=this;return o.string=e,o.pos=0,o.matched=f,o.working=e,o.match=[]},l["$bol?"]=function(){var e=this;return 0===e.pos||"\n"===e.string.charAt(e.pos-1)},l.$scan=function(e){var o=this,e=new RegExp("^"+e.toString().substring(1,e.toString().length-1)),n=e.exec(o.working);return null==n?o.matched=f:"object"==typeof n?(o.prev_pos=o.pos,o.pos+=n[0].length,o.working=o.working.substring(n[0].length),o.matched=n[0],o.match=n,n[0]):"string"==typeof n?(o.pos+=n.length,o.working=o.working.substring(n.length),n):f},l["$[]"]=function(e){var o=this,n=o.match;return 0>e&&(e+=n.length),0>e||e>=n.length?f:n[e]},l.$check=function(e){var o=this,n=new RegExp("^"+e.toString().substring(1,e.toString().length-1)),d=n.exec(o.working);return o.matched=null==d?f:d[0]},l.$peek=function(e){var o=this;return o.working.substring(0,e)},l["$eos?"]=function(){var e=this;return 0===e.working.length},l.$skip=function(e){var o=this;e=new RegExp("^"+e.source);var n=e.exec(o.working);if(null==n)return o.matched=f;var d=n[0],i=d.length;return o.matched=d,o.prev_pos=o.pos,o.pos+=i,o.working=o.working.substring(i),i},l.$get_byte=function(){var e=this,o=f;return e.pos<e.string.length?(e.prev_pos=e.pos,e.pos+=1,o=e.matched=e.working.substring(0,1),e.working=e.working.substring(1)):e.matched=f,o},e.defn(t,"$getch",l.$get_byte),l["$pos="]=function(e){var o=this;return 0>e&&(e+=o.string.$length()),o.pos=e,o.working=o.string.slice(e)},l.$rest=function(){var e=this;return e.working},l.$terminate=function(){var e=this;return e.match=f,e["$pos="](e.string.$length())},l.$unscan=function(){var e=this;return e.pos=e.prev_pos,e.prev_pos=f,e.match=f,e},f&&"unscan"}(o,null)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.module);return function(o){var d=n(o,"Comparable"),i=d._proto,t=d._scope;i["$=="]=function(o){var n,d=this,i=f;try{return(n=d["$equal?"](o))===f||n._isBoolean&&1!=n?(n=i=d["$<=>"](o))===f||n._isBoolean&&1!=n?!1:0==i:!0}catch(l){if(e.$rescue(l,[t.StandardError]))return!1;throw l}},i["$>"]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),d>0},i["$>="]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),d>=0},i["$<"]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),0>d},i["$<="]=function(e){var o,n=this,d=f;return((o=d=n["$<=>"](e))===f||o._isBoolean&&1!=o)&&n.$raise(t.ArgumentError,"comparison of "+n.$class()+" with "+e.$class()+" failed"),0>=d},e.donate(d,["$==","$>","$>=","$<","$<="])}(o)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.klass);return function(o,d){function i(){}var t=i=n(o,d,"Dir",i),l=(t._proto,t._scope);return e.defs(t,"$pwd",function(){var e;return(e=l.ENV["$[]"]("PWD"))!==!1&&e!==f?e:"."; }),e.defs(t,"$getwd",function(){var e;return(e=l.ENV["$[]"]("PWD"))!==!1&&e!==f?e:"."}),e.defs(t,"$home",function(){return l.ENV["$[]"]("HOME")}),f&&"home"}(o,null)}(Opal),function(e){var o=e.top,f=e,n=e.nil,d=(e.breaker,e.slice,e.klass);return function(e,o){function f(){}var i=f=d(e,o,"SecurityError",f);return i._proto,i._scope,n}(o,f.Exception)}(Opal),function(e){var o=e.top,f=e.nil,n=e.breaker,d=e.slice,i=e.klass,t=e.gvars,l=e.range;return function(o,t){function l(){}var u,s=l=i(o,t,"Kernel",l),p=s._proto,r=s._scope;return p.$open=u=function(o,i){var t,l,s=u._p,p=s||f,y=f;return i=d.call(arguments,1),u._p=null,y=(t=r.File).$new.apply(t,[o].concat(i)),p!==f?(l=e.$yield1(p,y),l===n?l:l):y},f&&"open"}(o,null),function(o,u){function s(){}var p,r=s=i(o,u,"File",s),y=r._proto,a=r._scope;return y.eof=y.path=f,e.cdecl(a,"SEPARATOR","/"),e.cdecl(a,"ALT_SEPARATOR",f),r.$attr_reader("eof"),r.$attr_reader("lineno"),r.$attr_reader("path"),y.$initialize=function(e,o){var n=this;return null==o&&(o="r"),n.path=e,n.contents=f,n.eof=!1,n.lineno=0},y.$read=function(){var e,o=this,n=f;return(e=o.eof)===f||e._isBoolean&&1!=e?(n=a.File.$read(o.path),o.eof=!0,o.lineno=n.$size(),n):""},y.$each_line=p=function(o){var d,i=this,l=p._p,u=l||f,s=f;if(null==t["/"]&&(t["/"]=f),null==o&&(o=t["/"]),p._p=null,(d=i.eof)!==f&&(!d._isBoolean||1==d))return function(){return u!==f?i:[].$to_enum()}();if(u!==f){s=a.File.$read(i.path),i.eof=!1,i.lineno=0;for(var r=s.$chomp(),y=s.length!=r.length,c=r.split(o),b=0,w=c.length;w>b;b++)i.lineno+=1,w-1>b||y?(d=e.$yield1(u,c[b]+o))===n?n.$v:d:(d=e.$yield1(u,c[b]))===n?n.$v:d;return i.eof=!0,i}return i.$read().$each_line()},e.defs(r,"$expand_path",function(e){return e}),e.defs(r,"$join",function(e){return e=d.call(arguments,0),e["$*"](a.SEPARATOR)}),e.defs(r,"$basename",function(e){var o,n=f;return(o=n=e.$rindex(a.SEPARATOR))===f||o._isBoolean&&1!=o?e:e["$[]"](l(n["$+"](1),-1,!1))}),e.defs(r,"$dirname",function(e){var o,n=f;return(o=n=e.$rindex(a.SEPARATOR))===f||o._isBoolean&&1!=o?".":e["$[]"](l(0,n["$-"](1),!1))}),e.defs(r,"$extname",function(e){var o,n=f;return(o=e["$nil_or_empty?"]())===f||o._isBoolean&&1!=o?(n=e["$[]"](l(1,-1,!1)).$rindex("."),(o=n["$nil?"]())===f||o._isBoolean&&1!=o?e["$[]"](l(n["$+"](1),-1,!1)):""):""}),e.defs(r,"$file?",function(){return!0}),e.defs(r,"$read",function(e){var o=f;return function(){if(o=a.JAVASCRIPT_PLATFORM,"node"["$==="](o))return require("fs").readFileSync(e,"utf8");if("java-nashorn"["$==="](o)){var f=Java.type("java.nio.file.Paths"),n=Java.type("java.nio.file.Files"),d=n.readAllLines(f.get(e),Java.type("java.nio.charset.StandardCharsets").UTF_8),i=[];return d.forEach(function(e){i.push(e)}),i.join("\n")}if("browser"["$==="](o)){var i="",t=-1;try{var l=new XMLHttpRequest;l.open("GET",e,!1),l.addEventListener("load",function(){t=this.status,(0==t||200==t)&&(i=this.responseText)}),l.overrideMimeType("text/plain"),l.send()}catch(u){t=0}if(404==t||0==t&&""==i)throw a.IOError.$new("No such file or directory: "+e);return i}return"standalone"["$==="](o)?read(e):""}()}),f&&"read"}(o,null)}(Opal),function(e){var o,f=(e.top,e);return e.nil,e.breaker,e.slice,o="undefined"!=typeof module&&module.exports?"node":"undefined"!=typeof XMLHttpRequest?"browser":"undefined"!=typeof Java&&Java.type?"java-nashorn":"undefined"!=typeof java?"java-rhino":"standalone",e.cdecl(f,"JAVASCRIPT_PLATFORM",o),!0}(Opal),function(e){var o=e.top,f=(e.nil,e.breaker,e.slice,e.module);return function(o){var n=f(o,"Asciidoctor"),d=(n._proto,n._scope);e.cdecl(d,"VERSION","1.5.2")}(o)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.module),d=e.klass,i=e.hash2,t=e.gvars;return function(o){var l=n(o,"Asciidoctor");l._proto,l._scope,!function(o,n){function l(){}var u=l=d(o,n,"Timings",l),s=u._proto;return u._scope,s.timers=s.log=f,s.$initialize=function(){var e=this;return e.log=i([],{}),e.timers=i([],{})},s.$start=function(o){var f,n=this;return n.timers["$[]="](o,(null==(f=e.Object._scope.Time)?e.cm("Time"):f).$now())},s.$record=function(o){var f,n=this;return n.log["$[]="](o,(null==(f=e.Object._scope.Time)?e.cm("Time"):f).$now()["$-"](n.timers.$delete(o)))},s.$read_parse=function(){var e,o=this,n=f;return(n=((e=o.log["$[]"]("read"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("parse"))!==!1&&e!==f?e:0))["$>"](0)?n:f},s.$convert=function(){var e,o=this;return(e=o.log["$[]"]("convert"))!==!1&&e!==f?e:0},s.$read_parse_convert=function(){var e,o=this,n=f;return(n=((e=o.log["$[]"]("read"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("parse"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("convert"))!==!1&&e!==f?e:0))["$>"](0)?n:f},s.$total=function(){var e,o=this,n=f;return(n=((e=o.log["$[]"]("read"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("parse"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("convert"))!==!1&&e!==f?e:0)["$+"]((e=o.log["$[]"]("write"))!==!1&&e!==f?e:0))["$>"](0)?n:f},s.$print_report=function(e,o){var n=this;return null==t.stdout&&(t.stdout=f),null==e&&(e=t.stdout),null==o&&(o=f),o!==!1&&o!==f&&e.$puts("Input file: "+o),e.$puts(" Time to read and parse source: "+"%05.5f"["$%"](n.$read_parse().$to_i())),e.$puts(" Time to convert document: "+"%05.5f"["$%"](n.$convert().$to_i())),e.$puts(" Total time (read, parse and convert): "+"%05.5f"["$%"](n.$read_parse_convert().$to_i()))},f&&"print_report"}(l,null)}(o)}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.klass);return function(o,d){function i(){}var t,l=i=n(o,d,"NilClass",i),u=l._proto;return l._scope,(t=l["$respond_to?"]("nil_or_empty?"))===f||t._isBoolean&&1!=t?e.defn(l,"$nil_or_empty?",u["$nil?"]):f}(o,null),function(o,d){function i(){}var t,l=i=n(o,d,"String",i),u=l._proto;return l._scope,(t=l["$respond_to?"]("nil_or_empty?"))===f||t._isBoolean&&1!=t?e.defn(l,"$nil_or_empty?",u["$empty?"]):f}(o,null),function(o,d){function i(){}var t,l=i=n(o,d,"Array",i),u=l._proto;return l._scope,(t=l["$respond_to?"]("nil_or_empty?"))===f||t._isBoolean&&1!=t?e.defn(l,"$nil_or_empty?",u["$empty?"]):f}(o,null),function(o,d){function i(){}var t,l=i=n(o,d,"Hash",i),u=l._proto;return l._scope,(t=l["$respond_to?"]("nil_or_empty?"))===f||t._isBoolean&&1!=t?e.defn(l,"$nil_or_empty?",u["$empty?"]):f}(o,null),function(o,d){function i(){}var t,l=i=n(o,d,"Numeric",i),u=l._proto;return l._scope,(t=l["$respond_to?"]("nil_or_empty?"))===f||t._isBoolean&&1!=t?e.defn(l,"$nil_or_empty?",u["$nil?"]):f}(o,null)}(Opal),function(e){var o=(e.top,e),f=e.nil;return e.breaker,e.slice,o.RUBY_ENGINE["$=="]("opal")?f:void 0}(Opal),function(e){var o=e.top,f=e.nil,n=(e.breaker,e.slice,e.module),d=e.range,i=e.gvars;return function(o){var t=n(o,"Asciidoctor");t._proto,t._scope,!function(o){var t=n(o,"Helpers"),l=(t._proto,t._scope);e.defs(t,"$require_library",function(o,n){var d,i=this,t=f;null==n&&(n=!0);try{return!0}catch(l){if(e.$rescue(l,[null==(d=e.Object._scope.LoadError)?e.cm("LoadError"):d]))return t=l,i.$fail(n!==!1&&n!==f?"asciidoctor: FAILED: required gem '"+function(){return n["$=="](!0)?o:n}()+"' is not installed. Processing aborted.":"asciidoctor: FAILED: "+t.$message().$chomp(".")+". Processing aborted.");throw l}}),e.defs(t,"$normalize_lines",function(o){var f,n=this;return o.$class()["$=="](null==(f=e.Object._scope.String)?e.cm("String"):f)?n.$normalize_lines_from_string(o):n.$normalize_lines_array(o)}),e.defs(t,"$normalize_lines_array",function(o){var n,i,t,u,s,p,r,y,a,c=this,b=f,w=f,g=f,m=f;return(n=o["$empty?"]())===f||n._isBoolean&&1!=n?(b=(w=o["$[]"](0))["$[]"](d(0,2,!1)).$bytes().$to_a(),(n=l.COERCE_ENCODING)===f||n._isBoolean&&1!=n?(b["$=="](l.BOM_BYTES_UTF_8)&&o["$[]="](0,w["$[]"](d(3,-1,!1))),(n=(y=o).$map,n._p=(a=function(e){return a._s||this,null==e&&(e=f),e.$rstrip()},a._s=c,a),n).call(y)):(g=(null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_8,(m=b["$[]"](d(0,1,!1)))["$=="](l.BOM_BYTES_UTF_16LE)?(n=(i=o.$join().$force_encoding((null==(u=e.Object._scope.Encoding)?e.cm("Encoding"):u)._scope.UTF_16LE)["$[]"](d(1,-1,!1)).$encode(g).$lines()).$map,n._p=(t=function(e){return t._s||this,null==e&&(e=f),e.$rstrip()},t._s=c,t),n).call(i):m["$=="](l.BOM_BYTES_UTF_16BE)?(o["$[]="](0,w.$force_encoding((null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_16BE)["$[]"](d(1,-1,!1))),(n=(u=o).$map,n._p=(s=function(o){var n;return s._s||this,null==o&&(o=f),""+o.$force_encoding((null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_16BE).$encode(g).$rstrip()},s._s=c,s),n).call(u)):(b["$[]"](d(0,2,!1))["$=="](l.BOM_BYTES_UTF_8)&&o["$[]="](0,w.$force_encoding(g)["$[]"](d(1,-1,!1))),(n=(p=o).$map,n._p=(r=function(e){return r._s||this,null==e&&(e=f),e.$encoding()["$=="](g)?e.$rstrip():e.$force_encoding(g).$rstrip()},r._s=c,r),n).call(p)))):[]}),e.defs(t,"$normalize_lines_from_string",function(o){var n,i,t,u=this,s=f,p=f,r=f;return(n=o["$nil_or_empty?"]())===f||n._isBoolean&&1!=n?((n=l.COERCE_ENCODING)===f||n._isBoolean&&1!=n?o["$[]"](d(0,2,!1)).$bytes().$to_a()["$=="](l.BOM_BYTES_UTF_8)&&(o=o["$[]"](d(3,-1,!1))):(s=(null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_8,p=o["$[]"](d(0,2,!1)).$bytes().$to_a(),(r=p["$[]"](d(0,1,!1)))["$=="](l.BOM_BYTES_UTF_16LE)?o=o.$force_encoding((null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_16LE)["$[]"](d(1,-1,!1)).$encode(s):r["$=="](l.BOM_BYTES_UTF_16BE)?o=o.$force_encoding((null==(n=e.Object._scope.Encoding)?e.cm("Encoding"):n)._scope.UTF_16BE)["$[]"](d(1,-1,!1)).$encode(s):p["$[]"](d(0,2,!1))["$=="](l.BOM_BYTES_UTF_8)?o=function(){return o.$encoding()["$=="](s)?o["$[]"](d(1,-1,!1)):o.$force_encoding(s)["$[]"](d(1,-1,!1))}():o.$encoding()["$=="](s)||(o=o.$force_encoding(s))),(n=(i=o.$each_line()).$map,n._p=(t=function(e){return t._s||this,null==e&&(e=f),e.$rstrip()},t._s=u,t),n).call(i)):[]}),e.cdecl(l,"REGEXP_ENCODE_URI_CHARS",/[^\w\-.!~*';:@=+$,()\[\]]/),e.defs(t,"$encode_uri",function(e){var o,n,d,t=this;return(o=(n=e).$gsub,o._p=(d=function(){var e,o,n,t=d._s||this;return null==i["&"]&&(i["&"]=f),(e=(o=i["&"].$each_byte()).$map,e._p=(n=function(e){var o=n._s||this;return null==e&&(e=f),o.$sprintf("%%%02X",e)},n._s=t,n),e).call(o).$join()},d._s=t,d),o).call(n,l.REGEXP_ENCODE_URI_CHARS)}),e.defs(t,"$rootname",function(o){var n,i,t=f;return(n=(t=(null==(i=e.Object._scope.File)?e.cm("File"):i).$extname(o))["$empty?"]())===f||n._isBoolean&&1!=n?o["$[]"](d(0,t.$length()["$-@"](),!0)):o}),e.defs(t,"$mkdir_p",function(o){var n,d,i,t=this,l=f;return(n=(null==(d=e.Object._scope.File)?e.cm("File"):d)["$directory?"](o))===f||n._isBoolean&&1!=n?(l=(null==(n=e.Object._scope.File)?e.cm("File"):n).$dirname(o),d=(null==(i=e.Object._scope.File)?e.cm("File"):i)["$directory?"](l=(null==(i=e.Object._scope.File)?e.cm("File"):i).$dirname(o))["$!"](),(n=d!==!1&&d!==f?l["$=="](".")["$!"]():d)===f||n._isBoolean&&1!=n||t.$mkdir_p(l),(null==(n=e.Object._scope.Dir)?e.cm("Dir"):n).$mkdir(o)):f})}(t)}(o)}(Opal),function(e){var o=e.top,f=e.nil,n=e.breaker,d=e.slice,i=e.module,t=e.hash2,l=e.gvars,u=e.range;return function(o){var s=i(o,"Asciidoctor");s._proto,s._scope,!function(o){var s=i(o,"Substitutors"),p=s._proto,r=s._scope;e.cdecl(r,"SPECIAL_CHARS",t(["&","<",">"],{"&":"&amp;","<":"&lt;",">":"&gt;"})),e.cdecl(r,"SPECIAL_CHARS_PATTERN",new RegExp("["+r.SPECIAL_CHARS.$keys().$join()+"]")),e.cdecl(r,"SUBS",t(["basic","normal","verbatim","title","header","pass"],{basic:["specialcharacters"],normal:["specialcharacters","quotes","attributes","replacements","macros","post_replacements"],verbatim:["specialcharacters","callouts"],title:["specialcharacters","quotes","replacements","macros","attributes","post_replacements"],header:["specialcharacters","attributes"],pass:[]})),e.cdecl(r,"COMPOSITE_SUBS",t(["none","normal","verbatim","specialchars"],{none:[],normal:r.SUBS["$[]"]("normal"),verbatim:r.SUBS["$[]"]("verbatim"),specialchars:["specialcharacters"]})),e.cdecl(r,"SUB_SYMBOLS",t(["a","m","n","p","q","r","c","v"],{a:"attributes",m:"macros",n:"normal",p:"post_replacements",q:"quotes",r:"replacements",c:"specialcharacters",v:"verbatim"})),e.cdecl(r,"SUB_OPTIONS",t(["block","inline"],{block:r.COMPOSITE_SUBS.$keys()["$+"](r.SUBS["$[]"]("normal"))["$+"](["callouts"]),inline:r.COMPOSITE_SUBS.$keys()["$+"](r.SUBS["$[]"]("normal"))})),e.cdecl(r,"SUB_HIGHLIGHT",["coderay","pygments"]),e.cdecl(r,"PASS_START","–"),e.cdecl(r,"PASS_END","—"),e.cdecl(r,"PASS_MATCH",/\u0096(\d+)\u0097/),e.cdecl(r,"PASS_MATCH_HI",/<span[^>]*>\u0096<\/span>[^\d]*(\d+)[^\d]*<span[^>]*>\u0097<\/span>/),s.$attr_reader("passthroughs"),p.$apply_subs=function(o,n,d){var i,t,l,u,s,p=this,y=f,a=f,c=f,b=f;return null==p.passthroughs&&(p.passthroughs=f),null==n&&(n="normal"),null==d&&(d=!1),(i=n["$!"]())===f||i._isBoolean&&1!=i?(n["$=="]("normal")?n=r.SUBS["$[]"]("normal"):d!==!1&&d!==f&&((i=n["$is_a?"](null==(t=e.Object._scope.Symbol)?e.cm("Symbol"):t))===f||i._isBoolean&&1!=i?(y=[],(i=(t=n).$each,i._p=(l=function(e){var o;return l._s||this,null==e&&(e=f),(o=r.COMPOSITE_SUBS["$has_key?"](e))===f||o._isBoolean&&1!=o?y["$<<"](e):y=y["$+"](r.COMPOSITE_SUBS["$[]"](e))},l._s=p,l),i).call(t),n=y):n=(i=r.COMPOSITE_SUBS["$[]"](n))!==!1&&i!==f?i:[n]),(i=n["$empty?"]())===f||i._isBoolean&&1!=i?(a=function(){return(i=c=o["$is_a?"](null==(u=e.Object._scope.Array)?e.cm("Array"):u))===f||i._isBoolean&&1!=i?o:o["$*"](r.EOL)}(),(i=b=n["$include?"]("macros"))===f||i._isBoolean&&1!=i||(a=p.$extract_passthroughs(a),(i=p.passthroughs["$empty?"]())===f||i._isBoolean&&1!=i||(b=!1)),(i=(u=n).$each,i._p=(s=function(e){var o,d=s._s||this,i=f;return null==e&&(e=f),function(){return i=e,"specialcharacters"["$==="](i)?a=d.$sub_specialcharacters(a):"quotes"["$==="](i)?a=d.$sub_quotes(a):"attributes"["$==="](i)?a=d.$sub_attributes(a.$split(r.EOL))["$*"](r.EOL):"replacements"["$==="](i)?a=d.$sub_replacements(a):"macros"["$==="](i)?a=d.$sub_macros(a):"highlight"["$==="](i)?a=d.$highlight_source(a,n["$include?"]("callouts")):"callouts"["$==="](i)?(o=n["$include?"]("highlight"))===f||o._isBoolean&&1!=o?a=d.$sub_callouts(a):f:"post_replacements"["$==="](i)?a=d.$sub_post_replacements(a):d.$warn("asciidoctor: WARNING: unknown substitution type "+e)}()},s._s=p,s),i).call(u),b!==!1&&b!==f&&(a=p.$restore_passthroughs(a)),c!==!1&&c!==f?a.$split(r.EOL):a):o):o},p.$apply_normal_subs=function(o){var n,d,i=this;return i.$apply_subs(function(){return(n=o["$is_a?"](null==(d=e.Object._scope.Array)?e.cm("Array"):d))===f||n._isBoolean&&1!=n?o:o["$*"](r.EOL)}())},p.$apply_title_subs=function(e){var o=this;return o.$apply_subs(e,r.SUBS["$[]"]("title"))},p.$apply_header_subs=function(e){var o=this;return o.$apply_subs(e,r.SUBS["$[]"]("header"))},p.$extract_passthroughs=function(o){var n,d,i,s,p,y,a,c,b=this,w=f,g=f,m=f,x=f;return null==b.document&&(b.document=f),w=b.document.$compat_mode(),(n=(d=(i=o["$include?"]("++"))!==!1&&i!==f?i:o["$include?"]("$$"))!==!1&&d!==f?d:o["$include?"]("ss:"))===f||n._isBoolean&&1!=n||(o=(n=(d=o).$gsub,n._p=(s=function(){var o,n,d=s._s||this,i=f,p=f,y=f,a=f,c=f,b=f,g=f,m=f,x=f;if(null==d.passthroughs&&(d.passthroughs=f),null==l["~"]&&(l["~"]=f),i=l["~"],p=f,(o=(y=i["$[]"](4))["$nil_or_empty?"]())===f||o._isBoolean&&1!=o){if((o=(n=w!==!1&&w!==f)?y["$=="]("++"):n)!==f&&(!o._isBoolean||1==o))return function(){return(o=i["$[]"](2)["$nil_or_empty?"]())===f||o._isBoolean&&1!=o?""+i["$[]"](1)+"["+i["$[]"](2)+"]"+i["$[]"](3)+"++"+d.$extract_passthroughs(i["$[]"](5))+"++":""+i["$[]"](1)+i["$[]"](3)+"++"+d.$extract_passthroughs(i["$[]"](5))+"++"}();if(c=i["$[]"](2),(o=null==(n=e.Object._scope.RUBY_ENGINE_OPAL)?e.cm("RUBY_ENGINE_OPAL"):n)===f||o._isBoolean&&1!=o||c["$=="]("")&&(c=f),b=i["$[]"](3).$size(),g=i["$[]"](5),m=!1,c!==!1&&c!==f){if(b["$>"](0))return""+i["$[]"](1)+"["+c+"]"+"\\"["$*"](b["$-"](1))+y+i["$[]"](5)+y+")";i["$[]"](1)["$=="]("\\")?(p="["+c+"]",c=f):((o=(n=y["$=="]("++"))?c["$end_with?"]("x-"):n)===f||o._isBoolean&&1!=o||(m=!0,c=c["$[]"](u(0,-2,!0))),c=d.$parse_attributes(c))}else if(b["$>"](0))return""+i["$[]"](1)+"["+c+"]"+"\\"["$*"](b["$-"](1))+y+i["$[]"](5)+y;x=function(){return y["$=="]("+++")?[]:["specialcharacters"]}(),a=d.passthroughs.$size(),c!==!1&&c!==f?m!==!1&&m!==f?d.passthroughs["$[]="](a,t(["text","subs","type","attributes"],{text:g,subs:r.SUBS["$[]"]("normal"),type:"monospaced",attributes:c})):d.passthroughs["$[]="](a,t(["text","subs","type","attributes"],{text:g,subs:x,type:"unquoted",attributes:c})):d.passthroughs["$[]="](a,t(["text","subs"],{text:g,subs:x}))}else{if(i["$[]"](6)["$=="]("\\"))return i["$[]"](0)["$[]"](u(1,-1,!1));d.passthroughs["$[]="](a=d.passthroughs.$size(),t(["text","subs"],{text:d.$unescape_brackets(i["$[]"](8)),subs:function(){return(o=i["$[]"](7)["$nil_or_empty?"]())===f||o._isBoolean&&1!=o?d.$resolve_pass_subs(i["$[]"](7)):[]}()}))}return""+p+r.PASS_START+a+r.PASS_END},s._s=b,s),n).call(d,r.PassInlineMacroRx)),n=e.to_ary(r.PassInlineRx["$[]"](w)),g=null==n[0]?f:n[0],m=null==n[1]?f:n[1],x=null==n[2]?f:n[2],(n=(i=o["$include?"](g))!==!1&&i!==f?i:(p=m!==!1&&m!==f)?o["$include?"](m):p)===f||n._isBoolean&&1!=n||(o=(n=(i=o).$gsub,n._p=(y=function(){var o,n,d=y._s||this,i=f,s=f,p=f,a=f,c=f,b=f,g=f,m=f,x=f;if(null==d.passthroughs&&(d.passthroughs=f),null==l["~"]&&(l["~"]=f),i=l["~"],s=i["$[]"](1),p=i["$[]"](2),a=function(){return(o=i["$[]"](3)["$start_with?"]("\\"))===f||o._isBoolean&&1!=o?f:"\\"}(),c=i["$[]"](4),b=i["$[]"](5),(o=null==(n=e.Object._scope.RUBY_ENGINE_OPAL)?e.cm("RUBY_ENGINE_OPAL"):n)===f||o._isBoolean&&1!=o||p["$=="]("")&&(p=f),w!==!1&&w!==f?g=!0:(o=g=(n=p!==!1&&p!==f)?p["$end_with?"]("x-"):n)===f||o._isBoolean&&1!=o||(p=p["$[]"](u(0,-2,!0))),p!==!1&&p!==f){if((o=(n=c["$=="]("`"))?g["$!"]():n)!==f&&(!o._isBoolean||1==o))return""+s+"["+p+"]"+a+"`"+d.$extract_passthroughs(b)+"`";if(a!==!1&&a!==f)return""+s+"["+p+"]"+i["$[]"](3)["$[]"](u(1,-1,!1));s["$=="]("\\")?(s="["+p+"]",p=f):p=d.$parse_attributes(p)}else{if(!((o=(n=c["$=="]("`"))?g["$!"]():n)===f||o._isBoolean&&1!=o))return""+s+a+"`"+d.$extract_passthroughs(b)+"`";if(a!==!1&&a!==f)return""+s+i["$[]"](3)["$[]"](u(1,-1,!1))}return m=d.passthroughs.$size(),w!==!1&&w!==