@asciidoctor/core 3.0.4 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/build/browser/index.js +24156 -0
- package/build/node/index.cjs +24737 -0
- package/{dist/css/asciidoctor.css → data/asciidoctor-default.css} +54 -53
- package/package.json +55 -97
- package/src/abstract_block.js +857 -0
- package/src/abstract_node.js +954 -0
- package/src/attribute_entry.js +12 -0
- package/src/attribute_list.js +380 -0
- package/src/block.js +168 -0
- package/src/browser/asset.js +22 -0
- package/src/browser/reader.js +138 -0
- package/src/browser.js +121 -0
- package/src/callouts.js +85 -0
- package/src/compliance.js +54 -0
- package/src/constants.js +665 -0
- package/src/convert.js +370 -0
- package/src/converter/composite.js +83 -0
- package/src/converter/docbook5.js +1031 -0
- package/src/converter/html5.js +1893 -0
- package/src/converter/manpage.js +935 -0
- package/src/converter/template.js +459 -0
- package/src/converter.js +478 -0
- package/src/data/stylesheet-data.js +2 -0
- package/src/document.js +2134 -0
- package/src/extensions.js +1952 -0
- package/src/footnote.js +28 -0
- package/src/helpers.js +355 -0
- package/src/index.js +138 -0
- package/src/inline.js +158 -0
- package/src/list.js +240 -0
- package/src/load.js +276 -0
- package/src/logging.js +526 -0
- package/src/parser.js +3661 -0
- package/src/path_resolver.js +472 -0
- package/src/reader.js +1755 -0
- package/src/rx.js +829 -0
- package/src/section.js +354 -0
- package/src/stylesheets.js +30 -0
- package/src/substitutors.js +2241 -0
- package/src/syntaxHighlighter/highlightjs.js +90 -0
- package/src/syntaxHighlighter/html_pipeline.js +33 -0
- package/src/syntax_highlighter.js +304 -0
- package/src/table.js +952 -0
- package/src/timings.js +78 -0
- package/types/abstract_block.d.ts +346 -0
- package/types/abstract_node.d.ts +471 -0
- package/types/attribute_entry.d.ts +7 -0
- package/types/attribute_list.d.ts +52 -0
- package/types/block.d.ts +55 -0
- package/types/browser/asset.d.ts +7 -0
- package/types/browser/reader.d.ts +29 -0
- package/types/callouts.d.ts +36 -0
- package/types/compliance.d.ts +23 -0
- package/types/constants.d.ts +268 -0
- package/types/convert.d.ts +34 -0
- package/types/converter/composite.d.ts +20 -0
- package/types/converter/docbook5.d.ts +41 -0
- package/types/converter/html5.d.ts +51 -0
- package/types/converter/manpage.d.ts +59 -0
- package/types/converter/template.d.ts +83 -0
- package/types/converter.d.ts +150 -0
- package/types/data/stylesheet-data.d.ts +2 -0
- package/types/document.d.ts +495 -0
- package/types/extensions.d.ts +876 -0
- package/types/footnote.d.ts +18 -0
- package/types/helpers.d.ts +146 -0
- package/types/index.d.cts +75 -0
- package/types/index.d.ts +73 -3731
- package/types/inline.d.ts +69 -0
- package/types/list.d.ts +114 -0
- package/types/load.d.ts +39 -0
- package/types/logging.d.ts +187 -0
- package/types/parser.d.ts +114 -0
- package/types/path_resolver.d.ts +103 -0
- package/types/reader.d.ts +184 -0
- package/types/rx.d.ts +513 -0
- package/types/section.d.ts +122 -0
- package/types/stylesheets.d.ts +10 -0
- package/types/substitutors.d.ts +208 -0
- package/types/syntaxHighlighter/highlightjs.d.ts +33 -0
- package/types/syntaxHighlighter/html_pipeline.d.ts +16 -0
- package/types/syntax_highlighter.d.ts +167 -0
- package/types/table.d.ts +231 -0
- package/types/timings.d.ts +25 -0
- package/types/tsconfig.json +9 -0
- package/LICENSE +0 -21
- package/dist/browser/asciidoctor.js +0 -47654
- package/dist/browser/asciidoctor.min.js +0 -1452
- package/dist/graalvm/asciidoctor.js +0 -47402
- package/dist/node/asciidoctor.cjs +0 -21567
- package/dist/node/asciidoctor.js +0 -23037
|
@@ -1,1452 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Asciidoctor.js 3.0.4 | MIT | https://github.com/asciidoctor/asciidoctor.js
|
|
3
|
-
*/
|
|
4
|
-
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(b){var n=0;return function(){return n<b.length?{done:!1,value:b[n++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var n="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return n?n.call(b):$jscomp.arrayIterator(b)};$jscomp.arrayFromIterator=function(b){for(var n,x=[];!(n=b.next()).done;)x.push(n.value);return x};
|
|
5
|
-
$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,n,x){b!=Array.prototype&&b!=Object.prototype&&(b[n]=x.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);
|
|
6
|
-
$jscomp.polyfill=function(b,n,x,D){if(n){x=$jscomp.global;b=b.split(".");for(D=0;D<b.length-1;D++){var q=b[D];q in x||(x[q]={});x=x[q]}b=b[b.length-1];D=x[b];n=n(D);n!=D&&null!=n&&$jscomp.defineProperty(x,b,{configurable:!0,writable:!0,value:n})}};$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0},n={};try{return n.__proto__=b,n.a}catch(x){}return!1};
|
|
7
|
-
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(b,n){b.__proto__=n;if(b.__proto__!==n)throw new TypeError(b+" is not extensible");return b}:null;$jscomp.polyfill("Object.setPrototypeOf",function(b){return b||$jscomp.setPrototypeOf},"es6","es5");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
|
|
8
|
-
$jscomp.Symbol=function(){var b=0;return function(n){return $jscomp.SYMBOL_PREFIX+(n||"")+b++}}();$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.iterator;b||(b=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&$jscomp.defineProperty(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
|
|
9
|
-
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.asyncIterator;b||(b=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(b){$jscomp.initSymbolIterator();b={next:b};b[$jscomp.global.Symbol.iterator]=function(){return this};return b};
|
|
10
|
-
$jscomp.iteratorFromArray=function(b,n){$jscomp.initSymbolIterator();b instanceof String&&(b+="");var x=0,D={next:function(){if(x<b.length){var q=x++;return{value:n(q,b[q]),done:!1}}D.next=function(){return{done:!0,value:void 0}};return D.next()}};D[Symbol.iterator]=function(){return D};return D};$jscomp.polyfill("Array.prototype.keys",function(b){return b?b:function(){return $jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");
|
|
11
|
-
$jscomp.owns=function(b,n){return Object.prototype.hasOwnProperty.call(b,n)};$jscomp.assign="function"==typeof Object.assign?Object.assign:function(b,n){for(var x=1;x<arguments.length;x++){var D=arguments[x];if(D)for(var q in D)$jscomp.owns(D,q)&&(b[q]=D[q])}return b};$jscomp.polyfill("Object.assign",function(b){return b||$jscomp.assign},"es6","es3");$jscomp.polyfill("Array.prototype.values",function(b){return b?b:function(){return $jscomp.iteratorFromArray(this,function(b,x){return x})}},"es8","es3");
|
|
12
|
-
$jscomp.polyfill("Number.EPSILON",function(b){return Math.pow(2,-52)},"es6","es3");$jscomp.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6","es3");$jscomp.checkStringArgs=function(b,n,x){if(null==b)throw new TypeError("The 'this' value for String.prototype."+x+" must not be null or undefined");if(n instanceof RegExp)throw new TypeError("First argument to String.prototype."+x+" must not be a regular expression");return b+""};
|
|
13
|
-
$jscomp.polyfill("String.prototype.endsWith",function(b){return b?b:function(b,x){var n=$jscomp.checkStringArgs(this,b,"endsWith");b+="";void 0===x&&(x=n.length);x=Math.max(0,Math.min(x|0,n.length));for(var q=b.length;0<q&&0<x;)if(n[--x]!=b[--q])return!1;return 0>=q}},"es6","es3");
|
|
14
|
-
$jscomp.polyfill("String.prototype.codePointAt",function(b){return b?b:function(b){var n=$jscomp.checkStringArgs(this,null,"codePointAt"),D=n.length;b=Number(b)||0;if(0<=b&&b<D){b|=0;var q=n.charCodeAt(b);if(55296>q||56319<q||b+1===D)return q;b=n.charCodeAt(b+1);return 56320>b||57343<b?q:1024*(q-55296)+b+9216}}},"es6","es3");
|
|
15
|
-
$jscomp.polyfill("String.prototype.repeat",function(b){return b?b:function(b){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var D="";b;)if(b&1&&(D+=n),b>>>=1)n+=n;return D}},"es6","es3");$jscomp.stringPadding=function(b,n){b=void 0!==b?String(b):" ";return 0<n&&b?b.repeat(Math.ceil(n/b.length)).substring(0,n):""};
|
|
16
|
-
$jscomp.polyfill("String.prototype.padStart",function(b){return b?b:function(b,x){var n=$jscomp.checkStringArgs(this,null,"padStart");return $jscomp.stringPadding(x,b-n.length)+n}},"es8","es3");$jscomp.polyfill("Object.is",function(b){return b?b:function(b,x){return b===x?0!==b||1/b===1/x:b!==b&&x!==x}},"es6","es3");
|
|
17
|
-
$jscomp.polyfill("Array.prototype.includes",function(b){return b?b:function(b,x){var n=this;n instanceof String&&(n=String(n));var q=n.length;x=x||0;for(0>x&&(x=Math.max(x+q,0));x<q;x++){var E=n[x];if(E===b||Object.is(E,b))return!0}return!1}},"es7","es3");$jscomp.polyfill("String.prototype.includes",function(b){return b?b:function(b,x){return-1!==$jscomp.checkStringArgs(this,b,"includes").indexOf(b,x||0)}},"es6","es3");
|
|
18
|
-
$jscomp.polyfill("Array.from",function(b){return b?b:function(b,x,D){x=null!=x?x:function(b){return b};var n=[],E="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof E){b=E.call(b);for(var B=0;!(E=b.next()).done;)n.push(x.call(D,E.value,B++))}else for(E=b.length,B=0;B<E;B++)n.push(x.call(D,b[B],B));return n}},"es6","es3");
|
|
19
|
-
(function(b){function n(){return F+=2}function x(a,c){a||(a=l.Exception||Error);if(g&&g.$raise)2<arguments.length?g.$raise(a.$new.apply(a,y(arguments,1))):g.$raise(a,c);else{if(a.$new)throw a.$new(c);throw new a(c);}}function D(a,c,e){"string"===typeof a?a[c]=e:Object.defineProperty(a,c,{value:e,enumerable:!1,configurable:!0,writable:!0})}function q(a){var c;var e=0;for(c=l.tracers_for_class.length;e<c;e++){var r=l.tracers_for_class[e];r.trace_object=a;r.block.$call(r)}}function E(a,c){if(!a.$$autoload[c].loaded){a.$$autoload[c].loaded=
|
|
20
|
-
!0;try{l.Kernel.$require(a.$$autoload[c].path)}catch(wa){throw a.$$autoload[c].exception=wa,wa;}a.$$autoload[c].required=!0;if(null!=a.$$const[c])return a.$$autoload[c].success=!0,a.$$const[c]}else if(a.$$autoload[c].loaded&&!a.$$autoload[c].required&&a.$$autoload[c].exception)throw a.$$autoload[c].exception;}function B(a,c){if(a){if(null!=a.$$const[c])return a.$$const[c];if(a.$$autoload&&a.$$autoload[c])return E(a,c)}}function A(a,c){var u;if(null!=a){var e=P(a);a=0;for(u=e.length;a<u;a++){if(e[a].$$const&&
|
|
21
|
-
ha(e[a].$$const,c))return e[a].$$const[c];if(e[a].$$autoload&&e[a].$$autoload[c])return E(e[a],c)}}}function z(a,u,e){var r=!0;if(null==a||"::"===a)a=c;if(e.$$is_a_module){if(null==e.$$name||e.$$name===ja)e.$$name=u;null==e.$$base_module&&(e.$$base_module=a)}a.$$const=a.$$const||Object.create(null);if(u in a.$$const||"$$autoload"in a&&u in a.$$autoload)r=!1;a.$$const[u]=e;a.$$=a.$$const;l.const_cache_version++;a===c&&(l[u]=e);D(a,u,e);r&&a.$const_added&&!a.$const_added.$$pristine&&a.$const_added(u);
|
|
22
|
-
return e}function m(a,c,f){var u=null!=c&&c.$$bridge?function(){var a=y(arguments);a=new (e.apply(c.$$constructor,[null].concat(a)));S(a,u.$$prototype);return a}:function(){};a&&a!==ja&&D(u,"displayName","::"+a);D(u,"$$name",a);D(u,"$$constructor",u);D(u,"$$prototype",u.prototype);D(u,"$$const",{});D(u,"$$is_class",!0);D(u,"$$is_a_module",!0);D(u,"$$super",c);D(u,"$$cvars",{});D(u,"$$own_included_modules",[]);D(u,"$$own_prepended_modules",[]);D(u,"$$ancestors",[]);D(u,"$$ancestors_cache_version",
|
|
23
|
-
null);D(u,"$$subclasses",[]);D(u.$$prototype,"$$class",u);l.Class&&S(u,l.Class.prototype);if(null!=c){S(u.$$prototype,c.$$prototype);if(!0!==f)if("undefined"!==typeof WeakRef){var b=[];for(a=0;a<c.$$subclasses.length;a++)f=c.$$subclasses[a],void 0!==f.deref()&&b.push(f);b.push(new WeakRef(u));c.$$subclasses=b}else c.$$subclasses.push(u);c.$$meta&&l.build_class_singleton_class(u)}return u}function v(a){var c=function(){};a&&D(c,"displayName",a+".constructor");D(c,"$$name",a);D(c,"$$prototype",c.prototype);
|
|
24
|
-
D(c,"$$const",{});D(c,"$$is_module",!0);D(c,"$$is_a_module",!0);D(c,"$$cvars",{});D(c,"$$iclasses",[]);D(c,"$$own_included_modules",[]);D(c,"$$own_prepended_modules",[]);D(c,"$$ancestors",[c]);D(c,"$$ancestors_cache_version",null);S(c,l.Module.prototype);return c}function G(a,c){a.hasOwnProperty("$$meta")?a.$$meta=c:D(a,"$$meta",c);a.$$frozen?a.$$meta.$freeze():S(a,c.$$prototype)}function I(a){return a.hasOwnProperty("$$iclass")&&a.hasOwnProperty("$$root")}function K(a){var c=M(a);a.$$is_module&&
|
|
25
|
-
a.$$iclasses.push(c);return c}function M(a){var c={},e=a.$$prototype;e.hasOwnProperty("$$dummy")&&(e=e.$$define_methods_on);var r=Object.getOwnPropertyNames(e),l=r.length,f;for(f=0;f<l;f++){var b=r[f];D(c,b,e[b])}D(c,"$$iclass",!0);D(c,"$$module",a);return c}function t(a){var c=a.length,e=a[0];D(e,"$$root",!0);if(1===c)return{first:e,last:e};for(var r=1;r<c;r++){var l=a[r];S(e,l);e=l}return{first:a[0],last:a[c-1]}}function J(a){if(!a.hasOwnProperty("$$dummy")){if(a.hasOwnProperty("$$iclass"))return a.$$module;
|
|
26
|
-
if(a.hasOwnProperty("$$class"))return a.$$class}}function P(a){if(!a)return[];if(a.$$ancestors_cache_version===l.const_cache_version)return a.$$ancestors;var c=[],e;var r=0;var f=a.$$own_prepended_modules.concat([a]).concat(a.$$own_included_modules);for(e=f.length;r<e;r++)c.push(f[r]);if(a.$$super)for(r=0,f=P(a.$$super),e=f.length;r<e;r++)c.push(f[r]);a.$$ancestors_cache_version=l.const_cache_version;return a.$$ancestors=c}function R(a){return a.hasOwnProperty("$$meta")&&null!==a.$$meta?P(a.$$meta):
|
|
27
|
-
P(a.$$class)}function W(a,c){"number"===typeof c?a.$$arity=c:"object"===typeof c&&Object.assign(a,c)}function N(a){return ea[a]||(ea[a]="$"+a)}function H(a){return"function"===typeof a&&!a.$$stub}function L(a){a.$$frozen&&x(l.FrozenError,"can't modify frozen "+a.$class()+": "+a,l.hash2(["receiver"],{receiver:a}))}function U(a,c){return"number"===typeof a&&"number"===typeof c}function a(a,c){return"number"===typeof a&&"number"===typeof c||"string"===typeof a&&"string"===typeof c}function k(a){return function(){return a}}
|
|
28
|
-
function d(){var a=y(arguments),e=d.$$p;d.$$p=null;return l.send(c,"define_method",a,e)}"undefined"!==typeof globalThis?b=globalThis:"undefined"!==typeof global?b=global:"undefined"!==typeof window&&(b=window);null==b.console&&(b.console={});var f="object"===typeof b.console?b.console:{};"log"in f||(f.log=function(){});"warn"in f||(f.warn=f.log);if("undefined"!==typeof b.Opal)return f.warn("Opal already loaded. Loading twice can cause troubles, please fix your setup."),b.Opal;var h,c,p,T,g,l=b.Opal=
|
|
29
|
-
{};l.global=b;l.config={missing_require_severity:"error",unsupported_features_severity:"warning",experimental_features_severity:"warning",enable_stack_trace:!0};b=Function.prototype.call;var e=Function.prototype.bind,ha=Object.hasOwn||b.bind(Object.prototype.hasOwnProperty),S=Object.setPrototypeOf,y=b.bind(Array.prototype.slice),O=b.bind(Array.prototype.splice),F=4;l.uid=n;l.id=function(a){if(a.$$is_number)return 2*a+1;null==a.$$id&&D(a,"$$id",n());return a.$$id};var Z=l.gvars={};l.exit=function(a){Z.DEBUG&&
|
|
30
|
-
f.log("Exited with status "+a)};l.exceptions=[];l.pop_exception=function(){var a=l.exceptions.pop();a?(Z["!"]=a,Z["@"]=a.$backtrace()):Z["!"]=Z["@"]=ja};l.prop=D;l.defineProperty=l.prop;l.slice=y;var la=l.truthy=function(a){return!1!==a&&ja!==a&&void 0!==a&&null!==a&&(!(a instanceof Boolean)||!0===a.valueOf())};l.falsy=function(a){return!la(a)};l.type_error=function(a,c,e,r){a=a.$$class;r&&e?(r=r.$$class,x(l.TypeError,"can't convert "+a+" into "+c+" ("+a+"#"+e+" gives "+r+")")):x(l.TypeError,"no implicit conversion of "+
|
|
31
|
-
a+" into "+c)};l.coerce_to=function(a,c,e,r){if("to_int"===e&&c===l.Integer&&a.$$is_number)return 0>a?Math.ceil(a):Math.floor(a);if("to_str"===e&&c===l.String&&a.$$is_string||l.is_a(a,c))return a;if(a["$respond_to?"].$$pristine&&a.$method_missing.$$pristine)return e=a[N(e)],(null==e||e.$$stub)&&l.type_error(a,c),e.apply(a,r);a["$respond_to?"](e)||l.type_error(a,c);null==r&&(r=[]);return l.send(a,e,r)};l.respond_to=function(a,c,e){if(null==a||!a.$$class)return!1;e=!!e;var u=a[c];if(a["$respond_to?"].$$pristine){if("function"===
|
|
32
|
-
typeof u&&!u.$$stub)return!0;if(!a["$respond_to_missing?"].$$pristine)return l.send(a,a["$respond_to_missing?"],[c.substr(1),e])}else return l.send(a,a["$respond_to?"],[c.substr(1),e])};l.trace_class=!1;l.tracers_for_class=[];l.const_get_local=function(a,e,f){if(null!=a){"::"===a&&(a=c);a.$$is_module||a.$$is_class||x(l.TypeError,a.toString()+" is not a class/module");var u=B(a,e);return null!=u||f?u:(a||c).$const_missing(e)}};l.const_get_qualified=function(a,e,f){var u,b=l.const_cache_version;if(null==
|
|
33
|
-
e){var d=B(c,a);return null!=d?d:l.const_get_qualified(c,a,f)}if(null!=a)return"::"===a&&(a=c),a.$$is_module||a.$$is_class||x(l.TypeError,a.toString()+" is not a class/module"),null==(u=a.$$const_cache)&&(D(a,"$$const_cache",Object.create(null)),u=a.$$const_cache),d=u[e],null==d||d[0]!==b?(null!=(d=B(a,e))||null!=(d=A(a,e)),u[e]=[b,d]):d=d[1],null!=d||f?d:(a||c).$const_missing(e)};l.const_cache_version=1;l.const_get_relative=function(a,e,f){var u=a[0],b=l.const_cache_version,d;null==(d=a.$$const_cache)&&
|
|
34
|
-
(D(a,"$$const_cache",Object.create(null)),d=a.$$const_cache);var g=d[e];if(null==g||g[0]!==b){var ka;if(!(ka=null!=(g=B(u,e)))){a:{if(0!==a.length)for(g=0,ka=a.length;g<ka;g++){var h=a[g].$$const[e];if(null!=h){a=h;break a}else if(a[g].$$autoload&&a[g].$$autoload[e]){a=E(a[g],e);break a}}a=void 0}ka=null!=(g=a)}ka||null!=(g=A(u,e))||(a=null==u||u.$$is_module?A(c,e):void 0,null!=(g=a));d[e]=[b,g]}else g=g[1];return null!=g||f?g:(u||c).$const_missing(e)};l.const_set=z;l.constants=function(a,e){null==
|
|
35
|
-
e&&(e=!0);var u=[a],r,f={},b;e&&(u=u.concat(P(a)));e&&a.$$is_module&&(u=u.concat([l.Object]).concat(P(l.Object)));var d=0;for(r=u.length;d<r;d++){e=u[d];if(a!==c&&e==c)break;for(b in e.$$const)f[b]=!0;if(e.$$autoload)for(b in e.$$autoload)f[b]=!0}return Object.keys(f)};l.const_remove=function(a,c){l.const_cache_version++;if(null!=a.$$const[c]){var e=a.$$const[c];delete a.$$const[c];return e}if(a.$$autoload&&a.$$autoload[c])return delete a.$$autoload[c],ja;x(l.NameError,"constant "+a+"::"+a.$name()+
|
|
36
|
-
" not defined")};l.const_get_relative_factory=function(a){return function(c,e){return l.$$(a,c,e)}};l.$$=l.const_get_relative;l.$$$=l.const_get_qualified;l.$r=l.const_get_relative_factory;l.allocate_class=m;l.klass=function(a,e,f){null==a||"::"==a?a=c:a.$$is_class||a.$$is_module||(a=a.$$class);if(null!=e&&(!e.hasOwnProperty||e.hasOwnProperty&&!e.hasOwnProperty("$$is_class")))if(e.constructor&&"Function"==e.constructor.name){var u=e;e=c}else x(l.TypeError,"superclass must be a Class ("+(e.constructor&&
|
|
37
|
-
(e.constructor.name||e.constructor.$$name)||typeof e)+" given)");var b;(b=B(a,f))?b.$$is_class||x(l.TypeError,f+" is not a class"):b=void 0;null!=b?e&&b.$$super!==e&&x(l.TypeError,"superclass mismatch for class "+b.$$name):(null==e&&(e=c),b=m(f,e),z(a,f,b),e.$inherited&&e.$inherited(b),u&&l.bridge(u,b));l.trace_class&&q(b);return b};l.allocate_module=v;l.module=function(a,e){null==a||"::"==a?a=c:a.$$is_class||a.$$is_module||(a=a.$$class);var u=a;var f=B(u,e);null==f&&u===c&&(f=A(c,e));f&&(f.$$is_module||
|
|
38
|
-
f===c||x(l.TypeError,e+" is not a module"));u=f;null==u&&(u=v(e),z(a,e,u));l.trace_class&&q(u);return u};l.get_singleton_class=function(a){a.$$is_number&&x(l.TypeError,"can't define singleton");return a.$$meta?a.$$meta:a.hasOwnProperty("$$is_class")?l.build_class_singleton_class(a):a.hasOwnProperty("$$is_module")?l.build_module_singleton_class(a):l.build_object_singleton_class(a)};l.build_class_singleton_class=function(a){if(a.$$meta)return a.$$meta;var c=a===h?p:l.get_singleton_class(a.$$super);
|
|
39
|
-
c=m(null,c,!0);D(c,"$$is_singleton",!0);D(c,"$$singleton_of",a);G(a,c);D(a,"$$class",l.Class);return c};l.build_module_singleton_class=function(a){if(a.$$meta)return a.$$meta;var c=m(null,l.Module,!0);D(c,"$$is_singleton",!0);D(c,"$$singleton_of",a);G(a,c);D(a,"$$class",l.Module);return c};l.build_object_singleton_class=function(a){var c=m(ja,a.$$class,!0);D(c,"$$is_singleton",!0);D(c,"$$singleton_of",a);delete c.$$prototype.$$class;G(a,c);return c};l.is_method=function(a){return"$"===a[0]&&"$"!==
|
|
40
|
-
a[1]};l.instance_methods=function(a){var c=[],e=[];a=P(a);for(var f=0,b=a.length;f<b;f++){var d=a[f].$$prototype;d.hasOwnProperty("$$dummy")&&(d=d.$$define_methods_on);for(var g=Object.getOwnPropertyNames(d),ka=0,h=g.length;ka<h;ka++){var F=g[ka];if(l.is_method(F)){var p=F.slice(1);F=d[F];F.$$stub&&-1===c.indexOf(p)&&c.push(p);F.$$stub||-1!==e.indexOf(p)||-1!==c.indexOf(p)||e.push(p)}}}return e};l.own_instance_methods=function(a){var c=[];a=a.$$prototype;a.hasOwnProperty("$$dummy")&&(a=a.$$define_methods_on);
|
|
41
|
-
for(var e=Object.getOwnPropertyNames(a),f=0,b=e.length;f<b;f++){var d=e[f];l.is_method(d)&&!a[d].$$stub&&(d=d.slice(1),c.push(d))}return c};l.methods=function(a){return l.instance_methods(a.$$meta||a.$$class)};l.own_methods=function(a){return a.$$meta?l.own_instance_methods(a.$$meta):[]};l.receiver_methods=function(a){var c=l.get_singleton_class(a);a=l.own_instance_methods(c);c=l.own_instance_methods(c.$$super);return a.concat(c)};l.class_variables=function(a){a=P(a);var c,e={};for(c=a.length-1;0<=
|
|
42
|
-
c;c--){var f=a[c],l;for(l in f.$$cvars)e[l]=f.$$cvars[l]}return e};l.class_variable_set=function(a,c,e){var f=P(a),u;for(u=f.length-2;0<=u;u--){var l=f[u];if(ha(l.$$cvars,c))return l.$$cvars[c]=e}return a.$$cvars[c]=e};l.class_variable_get=function(a,c,e){if(ha(a.$$cvars,c))return a.$$cvars[c];var f=P(a),u,b=f.length;for(u=0;u<b;u++){var d=f[u];if(ha(d.$$cvars,c))return d.$$cvars[c]}e||x(l.NameError,"uninitialized class variable "+c+" in "+a.$name());return ja};l.append_features=function(a,c){var e=
|
|
43
|
-
P(a),f=[];-1!==e.indexOf(c)&&x(l.ArgumentError,"cyclic include detected");for(var u=0,b=e.length;u<b;u++){var d=K(e[u]);D(d,"$$included",!0);f.push(d)}e=P(c);f=t(f);if(-1===e.indexOf(a))a=c.$$prototype,e=Object.getPrototypeOf(c.$$prototype);else{e=c.$$prototype;for(u=Object.getPrototypeOf(e);null!=u&&(u.$$module!==a||!I(u));)e=u,u=Object.getPrototypeOf(u);if(u){for(u=Object.getPrototypeOf(u);u.hasOwnProperty("$$iclass")&&!I(u);)u=Object.getPrototypeOf(u);a=e;e=u}else a=c.$$prototype,e=Object.getPrototypeOf(c.$$prototype)}S(a,
|
|
44
|
-
f.first);S(f.last,e);a=[];for(e=Object.getPrototypeOf(c.$$prototype);e&&!e.hasOwnProperty("$$class");)(f=J(e))&&a.push(f),e=Object.getPrototypeOf(e);c.$$own_included_modules=a;l.const_cache_version++};l.prepend_features=function(a,c){var e=P(a),f=[];-1!==e.indexOf(c)&&x(l.ArgumentError,"cyclic prepend detected");for(var u=0,b=e.length;u<b;u++){var d=K(e[u]);D(d,"$$prepended",!0);f.push(d)}e=t(f);f=c.$$prototype;u=Object.getPrototypeOf(f);var g;if(f.hasOwnProperty("$$dummy"))b=f.$$define_methods_on;
|
|
45
|
-
else{b=M(c);d=c.$$prototype;for(var h=Object.getOwnPropertyNames(d),F=0;F<h.length;F++){var p=h[F];l.is_method(p)&&delete d[p]}D(f,"$$dummy",!0);D(f,"$$define_methods_on",b);S(f,b);S(b,u)}if(-1===P(c).indexOf(a)){var ka=f;for(g=Object.getPrototypeOf(f);null!=g&&!g.hasOwnProperty("$$root")&&g!==b&&g.hasOwnProperty("$$iclass");)g=Object.getPrototypeOf(g)}else x(l.RuntimeError,"Prepending a module multiple times is not supported");S(ka,e.first);S(e.last,g);a=[];g=Object.getPrototypeOf(c.$$prototype);
|
|
46
|
-
if(c.$$prototype.hasOwnProperty("$$dummy"))for(;g&&g!==c.$$prototype.$$define_methods_on;)(ka=J(g))&&a.push(ka),g=Object.getPrototypeOf(g);c.$$own_prepended_modules=a;l.const_cache_version++};l.bridge=function(a,c){a.hasOwnProperty("$$bridge")&&x(l.ArgumentError,"already bridged");D(a,"$$bridge",c);S(a.prototype,(c.$$super||l.Object).$$prototype);D(c,"$$prototype",a.prototype);D(c.$$prototype,"$$class",c);D(c,"$$constructor",a);D(c,"$$bridge",!0)};l.ancestors=P;l.included_modules=function(a){for(var c=
|
|
47
|
-
[],e=Object.getPrototypeOf(a.$$prototype);e&&Object.getPrototypeOf(e);e=Object.getPrototypeOf(e))(a=J(e))&&a.$$is_module&&e.$$iclass&&e.$$included&&c.push(a);return c};l.add_stubs=function(a){var c=l.BasicObject.$$prototype;a=a.split(",");for(var e=0,f=a.length;e<f;e++){var b=N(a[e]);var d=c[b];(null==d||d.$$stub)&&l.add_stub_for(c,b)}};l.add_stub_for=function(a,c){D(a,c,l.stub_for(c))};l.stub_for=function(a){function c(){this.$method_missing.$$p=c.$$p;c.$$p=null;for(var e=Array(arguments.length),
|
|
48
|
-
f=0,l=e.length;f<l;f++)e[f]=arguments[f];return this.$method_missing.apply(this,[a.slice(1)].concat(e))}c.$$stub=!0;return c};l.ac=function(a,c,e,f){var b="";b=e.$$is_a_module?b+(e.$$name+"."):b+(e.$$class.$$name+"#");x(l.ArgumentError,"["+(b+f)+"] wrong number of arguments (given "+a+", expected "+c+")")};l.block_ac=function(a,c,e){x(l.ArgumentError,"`block in "+e+"': wrong number of arguments (given "+a+", expected "+c+")")};l.find_super=function(a,c,e,f,b){var u=N(c);var d=R(a);for(e=d.indexOf(e.$$owner)+
|
|
49
|
-
1;e<d.length;e++){var r=d[e].$$prototype;r.hasOwnProperty("$$dummy")&&(r=r.$$define_methods_on);if(r.hasOwnProperty(u)){var g=r[u];break}}!f&&g&&g.$$stub&&a.$method_missing.$$pristine&&x(l.NoMethodError,"super: no superclass method `"+c+"' for "+a,c);return g.$$stub&&!b?null:g};l.find_block_super=function(a,c,e,f,b){e||x(l.RuntimeError,"super called outside of method");b&&e.$$define_meth&&x(l.RuntimeError,"implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly");
|
|
50
|
-
e.$$def&&(c=e.$$jsid);return l.find_super(a,c,e,f)};l.find_super_dispatcher=l.find_super;l.find_iter_super_dispatcher=l.find_block_super;l.yield1=function(a,c){"function"!==typeof a&&x(l.LocalJumpError,"no block given");var e=a.$$has_top_level_mlhs_arg,f=a.$$has_trailing_comma_in_args;if(1<a.length||(e||f)&&1===a.length)c=l.to_ary(c);return(1<a.length||f&&1===a.length)&&c.$$is_array?a.apply(null,c):a(c)};l.yieldX=function(a,c){"function"!==typeof a&&x(l.LocalJumpError,"no block given");if(1<a.length&&
|
|
51
|
-
1===c.length&&c[0].$$is_array)return a.apply(null,c[0]);if(!c.$$is_array){for(var e=Array(c.length),f=0,b=e.length;f<b;f++)e[f]=c[f];return a.apply(null,e)}return a.apply(null,c)};l.rescue=function(a,c){for(var e=0;e<c.length;e++){var f=c[e];if(f.$$is_array){if(f=l.rescue(a,f))return f}else if(f===l.JS.Error||f["$==="](a))return f}return null};l.is_a=function(a,c){return null!=c&&a.$$meta===c||a.$$class===c?!0:a.$$is_number&&c.$$is_number_class?c.$$is_integer_class?0===a%1:!0:-1!==P(a.$$is_class?
|
|
52
|
-
l.get_singleton_class(a):a.$$meta||a.$$class).indexOf(c)};l.to_hash=function(a){if(a.$$is_hash)return a;if(a["$respond_to?"]("to_hash",!0)){var c=a.$to_hash();if(c.$$is_hash)return c;x(l.TypeError,"Can't convert "+a.$$class+" to Hash ("+a.$$class+"#to_hash gives "+c.$$class+")")}else x(l.TypeError,"no implicit conversion of "+a.$$class+" into Hash")};l.to_ary=function(a){if(a.$$is_array)return a;if(a["$respond_to?"]("to_ary",!0)){var c=a.$to_ary();if(c===ja)return[a];if(c.$$is_array)return c;x(l.TypeError,
|
|
53
|
-
"Can't convert "+a.$$class+" to Array ("+a.$$class+"#to_ary gives "+c.$$class+")")}else return[a]};l.to_a=function(a){if(a.$$is_array)return a.slice();if(a["$respond_to?"]("to_a",!0)){var c=a.$to_a();if(c===ja)return[a];if(c.$$is_array)return c;x(l.TypeError,"Can't convert "+a.$$class+" to Array ("+a.$$class+"#to_a gives "+c.$$class+")")}else return[a]};l.extract_kwargs=function(a){var c=a[a.length-1];if(null!=c&&l.respond_to(c,"$to_hash",!0))return O(a,a.length-1),c};l.kwrestargs=function(a,c){var e=
|
|
54
|
-
[],f={},b;a=a.$$smap;for(b in a)c[b]||(e.push(b),f[b]=a[b]);return l.hash2(e,f)};var ea={};l.jsid=N;l.send=function(a,c,e,f,b){if("function"===typeof c){var d=c;c=null}else"string"===typeof c?d=a[N(c)]:x(l.NameError,"Passed method should be a string or a function");return l.send2(a,d,c,e,f,b)};l.send2=function(a,c,e,f,b,l){null==c&&null!=e&&a.$method_missing&&(c=a.$method_missing,f=[e].concat(f));W(b,l);"function"===typeof b&&(c.$$p=b);return c.apply(a,f)};l.refined_send=function(a,c,e,f,b,d){var u,
|
|
55
|
-
g,r;var h=R(c);for(u=0;u<h.length;u++){var F=l.id(h[u]);for(g=0;g<a.length;g++){var p=a[g];for(r=p.length-1;0<=r;r--){var y=p[r];if("undefined"!==typeof y.$$refine_modules&&(y=y.$$refine_modules,"undefined"!==typeof y[F]&&(y=y[F],"undefined"!==typeof y.$$prototype[N(e)])))return a=y.$$prototype[N(e)],l.send2(c,a,e,f,b,d)}}}return l.send(c,e,f,b,d)};l.lambda=function(a,c){a.$$is_lambda=!0;W(a,c);return a};l.def=function(a,c,e,f){W(e,f);return a===l.top?l.defn(l.Object,c,e):!a.$$eval&&a.$$is_a_module?
|
|
56
|
-
l.defn(a,c,e):l.defs(a,c,e)};l.defn=function(a,c,e){L(a);e.displayName=c;e.$$owner=a;var f=c.substr(1),b=a.$$prototype;b.hasOwnProperty("$$dummy")&&(b=b.$$define_methods_on);D(b,c,e);if(a.$$is_module){a.$$module_function&&l.defs(a,c,e);b=0;for(var d=a.$$iclasses,g=d.length;b<g;b++)D(d[b],c,e)}c=a.$$singleton_of;!a.$method_added||a.$method_added.$$stub||c?c&&c.$singleton_method_added&&!c.$singleton_method_added.$$stub&&c.$singleton_method_added(f):a.$method_added(f);return f};l.defs=function(a,c,e,
|
|
57
|
-
f){W(e,f);(a.$$is_string||a.$$is_number)&&x(l.TypeError,"can't define singleton");return l.defn(l.get_singleton_class(a),c,e)};l.rdef=function(a,c){ha(a.$$prototype,c)||x(l.NameError,"method '"+c.substr(1)+"' not defined in "+a.$name());delete a.$$prototype[c];a.$$is_singleton?a.$$prototype.$singleton_method_removed&&!a.$$prototype.$singleton_method_removed.$$stub&&a.$$prototype.$singleton_method_removed(c.substr(1)):a.$method_removed&&!a.$method_removed.$$stub&&a.$method_removed(c.substr(1))};l.udef=
|
|
58
|
-
function(a,c){a.$$prototype[c]&&!a.$$prototype[c].$$stub||x(l.NameError,"method '"+c.substr(1)+"' not defined in "+a.$name());l.add_stub_for(a.$$prototype,c);a.$$is_singleton?a.$$prototype.$singleton_method_undefined&&!a.$$prototype.$singleton_method_undefined.$$stub&&a.$$prototype.$singleton_method_undefined(c.substr(1)):a.$method_undefined&&!a.$method_undefined.$$stub&&a.$method_undefined(c.substr(1))};l.alias=function(a,c,e){var f=N(c),b=N(e);"undefined"===typeof a.$$prototype&&(a=l.Object);var d=
|
|
59
|
-
a.$$prototype[b];if(a.$$eval)return l.alias(l.get_singleton_class(a),c,e);if(!H(d)){for(var g=a.$$super;"function"!==typeof d&&g;)d=g[b],g=g.$$super;!H(d)&&a.$$is_module&&(d=l.Object.$$prototype[b]);H(d)||x(l.NameError,"undefined method `"+e+"' for class `"+a.$name()+"'")}d.$$alias_of&&(d=d.$$alias_of);var u=function(){var a=u.$$p,c;var e=Array(arguments.length);var f=0;for(c=arguments.length;f<c;f++)e[f]=arguments[f];u.$$p=null;return l.send(this,d,e,a)};try{Object.defineProperty(u,"length",{value:d.length})}catch(na){}u.displayName=
|
|
60
|
-
c;u.$$arity=null==d.$$arity?d.length:d.$$arity;u.$$parameters=d.$$parameters;u.$$source_location=d.$$source_location;u.$$alias_of=d;u.$$alias_name=c;l.defn(a,f,u);return a};l.alias_gvar=function(a,c){Object.defineProperty(Z,a,{configurable:!0,enumerable:!0,get:function(){return Z[c]},set:function(a){Z[c]=a}});return ja};l.alias_native=function(a,c,e){c=N(c);var f=a.$$prototype[e];("function"!==typeof f||f.$$stub)&&x(l.NameError,"undefined native method `"+e+"' for class `"+a.$name()+"'");l.defn(a,
|
|
61
|
-
c,f);return a};l.hash_init=function(a){a.$$smap=Object.create(null);a.$$map=Object.create(null);a.$$keys=[]};l.hash_clone=function(a,c){c.$$none=a.$$none;c.$$proc=a.$$proc;var e=0,f=a.$$keys;a=a.$$smap;for(var b=f.length,d,g;e<b;e++)d=f[e],d.$$is_string?g=a[d]:(g=d.value,d=d.key),l.hash_put(c,d,g)};l.hash_put=function(a,c,e){if(c.$$is_string)ha(a.$$smap,c)||a.$$keys.push(c),a.$$smap[c]=e;else{var f;var b=a.$$by_identity?l.id(c):c.$hash();if(ha(a.$$map,b)){for(f=a.$$map[b];f;){if(c===f.key||c["$eql?"](f.key)){var d=
|
|
62
|
-
void 0;f.value=e;break}d=f;f=f.next}d&&(f={key:c,key_hash:b,value:e},a.$$keys.push(f),d.next=f)}else f={key:c,key_hash:b,value:e},a.$$keys.push(f),a.$$map[b]=f}};l.hash_get=function(a,c){if(c.$$is_string){if(ha(a.$$smap,c))return a.$$smap[c]}else{var e=a.$$by_identity?l.id(c):c.$hash();if(ha(a.$$map,e))for(a=a.$$map[e];a;){if(c===a.key||c["$eql?"](a.key))return a.value;a=a.next}}};l.hash_delete=function(a,c){var e,f=a.$$keys,b=f.length;if(c.$$is_string){"string"!==typeof c&&(c=c.valueOf());if(!ha(a.$$smap,
|
|
63
|
-
c))return;for(e=0;e<b;e++){var l=f[e];l.$$is_string&&"string"!==typeof l&&(l=l.valueOf());if(l===c){f.splice(e,1);break}}l=a.$$smap[c];delete a.$$smap[c];return l}var d=c.$hash();if(ha(a.$$map,d))for(var g=a.$$map[d],u;g;){if(c===g.key||c["$eql?"](g.key)){l=g.value;for(e=0;e<b;e++)if(f[e]===g){f.splice(e,1);break}u&&g.next?u.next=g.next:u?delete u.next:g.next?a.$$map[d]=g.next:delete a.$$map[d];return l}u=g;g=g.next}};l.hash_rehash=function(a){for(var c=0,e=a.$$keys.length,f,b,l;c<e;c++)if(!a.$$keys[c].$$is_string&&
|
|
64
|
-
(f=a.$$keys[c].key.$hash(),f!==a.$$keys[c].key_hash)){b=a.$$map[a.$$keys[c].key_hash];for(l=void 0;b;){if(b===a.$$keys[c]){l&&b.next?l.next=b.next:l?delete l.next:b.next?a.$$map[a.$$keys[c].key_hash]=b.next:delete a.$$map[a.$$keys[c].key_hash];break}l=b;b=b.next}a.$$keys[c].key_hash=f;if(ha(a.$$map,f)){b=a.$$map[f];for(l=void 0;b;){if(b===a.$$keys[c]){l=void 0;break}l=b;b=b.next}l&&(l.next=a.$$keys[c])}else a.$$map[f]=a.$$keys[c]}};l.hash=function(){var a=arguments.length,c;if(1===a&&arguments[0].$$is_hash)return arguments[0];
|
|
65
|
-
var e=new l.Hash;l.hash_init(e);if(1===a){a=arguments[0];if(arguments[0].$$is_array){var f=a.length;for(c=0;c<f;c++){2!==a[c].length&&x(l.ArgumentError,"value not of length 2: "+a[c].$inspect());var b=a[c][0];var d=a[c][1];l.hash_put(e,b,d)}}else for(b in a=arguments[0],a)ha(a,b)&&(d=a[b],l.hash_put(e,b,d));return e}0!==a%2&&x(l.ArgumentError,"odd number of arguments for Hash");for(c=0;c<a;c+=2)b=arguments[c],d=arguments[c+1],l.hash_put(e,b,d);return e};l.hash2=function(a,c){var e=new l.Hash;e.$$smap=
|
|
66
|
-
c;e.$$map=Object.create(null);e.$$keys=a;return e};l.range=function(a,c,e){var f=new l.Range;f.begin=a;f.end=c;f.excl=e;return f};var ra="constructor displayName __count__ __noSuchMethod__ __parent__ __proto__ hasOwnProperty valueOf".split(" ");l.ivar=function(a){-1!==ra.indexOf(a)&&(a+="$");return a};l.deny_frozen_access=L;l.freeze=function(a){D(a,"$$frozen",!0);a.hasOwnProperty("$$id")||D(a,"$$id",n());a.hasOwnProperty("$$meta")?a.$$meta.$freeze():D(a,"$$meta",null);a.hasOwnProperty("$$comparable")||
|
|
67
|
-
D(a,"$$comparable",null);Object.seal(a);return a};l.freeze_props=function(a){var c;for(c in a){var e=typeof c;("string"!==e&&"object"!==e||"$"!==c[0])&&(e=Object.getOwnPropertyDescriptor(a,c))&&e.enumerable&&e.writable&&function(){var e=a[c];Object.defineProperty(a,c,{get:function(){return e},set:function(c){L(a)},enumerable:!0})}()}};l.escape_regexp=function(a){return a.replace(/([-[\]\/{}()*+?.^$\\| ])/g,"\\$1").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\f]/g,"\\f").replace(/[\t]/g,
|
|
68
|
-
"\\t")};l.global_regexp=function(a){if(a.global)return a;null==a.$$g?a.$$g=new RegExp(a.source,(a.multiline?"gm":"g")+(a.ignoreCase?"i":"")):a.$$g.lastIndex=null;return a.$$g};l.global_multiline_regexp=function(a){if(a.global&&a.multiline)return a;var c="gm"+(a.ignoreCase?"i":"");a.multiline?(null==a.$$g&&(a.$$g=new RegExp(a.source,c)),a=a.$$g):(null==a.$$gm&&(a.$$gm=new RegExp(a.source,c)),a=a.$$gm);a.lastIndex=null;return a};l.regexp=function(a,c){for(var e,f="undefined"!==typeof c&&c&&0<=c.indexOf("i"),
|
|
69
|
-
b=0,d=a.length;b<d;b++)e=a[b],e instanceof RegExp&&(e.ignoreCase!==f&&l.Kernel.$warn("ignore case doesn't match for "+e.source.$inspect(),l.hash({uplevel:1})),e=e.source),""===e&&(e="(?:"+e+")"),a[b]=e;return c?new RegExp(a.join(""),c):new RegExp(a.join(""))};l.modules={};l.loaded_features=["corelib/runtime"];l.current_dir=".";l.require_table={"corelib/runtime":!0};l.normalize=function(a){var c=[];"."!==l.current_dir&&(a=l.current_dir.replace(/\/*$/,"/")+a);a=a.replace(/^\.\//,"");a=a.replace(/\.(rb|opal|js)$/,
|
|
70
|
-
"");a=a.split("/");for(var e=0,f=a.length;e<f;e++){var b=a[e];""!==b&&(".."===b?c.pop():c.push(b))}return c.join("/")};l.loaded=function(a){var c;var e=0;for(c=a.length;e<c;e++){var f=l.normalize(a[e]);l.require_table[f]||(l.loaded_features.push(f),l.require_table[f]=!0)}};l.load_normalized=function(a){l.loaded([a]);var c=l.modules[a];if(c){if(a=c(l),"undefined"!==typeof Promise&&a instanceof Promise)return a.then(k(!0))}else c=l.config.missing_require_severity,a="cannot load such file -- "+a,"error"===
|
|
71
|
-
c?x(l.LoadError,a):"warning"===c&&f.warn("WARNING: LoadError: "+a);return!0};l.load=function(a){a=l.normalize(a);return l.load_normalized(a)};l.require=function(a){a=l.normalize(a);return l.require_table[a]?!1:l.load_normalized(a)};l.encodings=Object.create(null);l.set_encoding=function(a,c,e){"undefined"===typeof e&&(e="encoding");"string"!==typeof a&&!0!==a.$$frozen||x(l.FrozenError,"can't modify frozen String");c=l.find_encoding(c);if(c===a[e])return a;a[e]=c;return a};l.find_encoding=function(a){var c=
|
|
72
|
-
l.encodings;(c=c[a]||c[a.toUpperCase()])||x(l.ArgumentError,"unknown encoding name - "+a);return c};l.enc=function(a,c){a=new String(a);a=l.set_encoding(a,c);a.internal_encoding=a.encoding;return a};l.binary=function(a){a=new String(a);return l.set_encoding(a,"binary","internal_encoding")};l.last_promise=null;l.promise_unhandled_exception=!1;l.queue=function(a){if(l.last_promise)return l.last_promise=l.last_promise.then(function(){if(!l.promise_unhandled_exception)return a(l)})["catch"](function(a){l.respond_to(a,
|
|
73
|
-
"$full_message")&&(a=a.$full_message());f.error(a);l.promise_unhandled_exception=!0;l.exit(1)}),l.last_promise;var c=a(l);"function"===typeof Promise&&"object"===typeof c&&c instanceof Promise&&(l.last_promise=c);return c};l.rb_plus=function(a,c){return U(a,c)?a+c:a["$+"](c)};l.rb_minus=function(a,c){return U(a,c)?a-c:a["$-"](c)};l.rb_times=function(a,c){return U(a,c)?a*c:a["$*"](c)};l.rb_divide=function(a,c){return U(a,c)?a/c:a["$/"](c)};l.rb_lt=function(a,c){return U(a,c)?a<c:a["$<"](c)};l.rb_gt=
|
|
74
|
-
function(a,c){return U(a,c)?a>c:a["$>"](c)};l.rb_le=function(a,c){return U(a,c)?a<=c:a["$<="](c)};l.rb_ge=function(a,c){return U(a,c)?a>=c:a["$>="](c)};l.eqeq=function(c,e){return a(c,e)?c===e:la(c["$=="](e))};l.eqeqeq=function(c,e){return a(c,e)?c===e:la(c["$==="](e))};l.neqeq=function(c,e){return a(c,e)?c!==e:la(c["$!="](e))};l.not=function(a){return void 0===a||null===a||!1===a||ja===a?!0:!0===a||a["$!"].$$pristine?!1:la(a["$!"]())};l.return_val=k;l.return_self=function(){return this};l.return_ivar=
|
|
75
|
-
function(a){return function(){return null==this[a]?ja:this[a]}};l.assign_ivar=function(a){return function(c){L(this);return this[a]=c}};l.assign_ivar_val=function(a,c){return function(){L(this);return this[a]=c}};l.ensure_kwargs=function(a){if(null==a)return l.hash2([],{});if(a.$$is_hash)return a;x(l.ArgumentError,"expected kwargs")};l.get_kwarg=function(a,c){ha(a.$$smap,c)||x(l.ArgumentError,"missing keyword: "+c);return a.$$smap[c]};l.large_array_unpack=function(a){a=a.split(",");var c=a.length,
|
|
76
|
-
e;for(e=0;e<c;e++)switch(a[e][0]){case void 0:a[e]=ja;break;case "-":case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":a[e]=+a[e]}return a};l.BasicObject=h=m("BasicObject",null);l.Object=c=m("Object",l.BasicObject);l.Module=b=m("Module",l.Object);l.Class=p=m("Class",l.Module);l.Opal=T=v("Opal");l.Kernel=g=v("Kernel");S(l.BasicObject,l.Class.$$prototype);S(l.Object,l.Class.$$prototype);S(l.Module,l.Class.$$prototype);S(l.Class,l.Class.$$prototype);h.$$const.BasicObject=
|
|
77
|
-
h;z(c,"BasicObject",h);z(c,"Object",c);z(c,"Module",b);z(c,"Class",p);z(c,"Opal",T);z(c,"Kernel",g);h.$$class=p;c.$$class=p;b.$$class=p;p.$$class=p;T.$$class=b;g.$$class=b;D(c.$$prototype,"toString",function(){var a=this.$to_s();return a.$$is_string&&"object"===typeof a?a.valueOf():a});D(c.$$prototype,"$require",l.require);l.top=new c;l.top.$to_s=l.top.$inspect=k("main");l.top.$define_method=d;l.NilClass=m("NilClass",l.Object);z(c,"NilClass",l.NilClass);var ja=l.nil=new l.NilClass;ja.$$id=4;ja.call=
|
|
78
|
-
ja.apply=function(){x(l.LocalJumpError,"no block given")};ja.$$frozen=!0;ja.$$comparable=!1;Object.seal(ja);l.thrower=function(a){var c=Error("unexpected "+a);c.$thrower_type=a;c.$throw=function(a){null==a&&(a=ja);c.$v=a;throw c;};return c};l.t_eval_return=l.thrower("return");TypeError.$$super=Error;l.file_sources={}}).call(this);Opal.loaded(["corelib/runtime.js"]);
|
|
79
|
-
Opal.modules["corelib/helpers"]=function(b){var n=b.type_error,x=b.coerce_to,D=b.module,q=b.defs,E=b.slice,B=b.eqeqeq,A=b.Kernel,z=b.truthy,m=b.Opal,v=b.nil,G=b.$$$;b.add_stubs("===,raise,respond_to?,nil?,__send__,<=>,class,coerce_to!,new,to_s,__id__");return function(I){I=D(I,"Opal");q(I,"$bridge",function(m,n){return b.bridge(m,n)});q(I,"$coerce_to!",function(b,m,q,v){var t=E(arguments,3);t=x(b,m,q,t);B(m,t)||A.$raise(n(b,m,q,t));return t},-4);q(I,"$coerce_to?",function(b,m,q,G){var t=E(arguments,
|
|
80
|
-
3);if(!z(b["$respond_to?"](q)))return v;t=x(b,m,q,t);if(z(t["$nil?"]()))return v;B(m,t)||A.$raise(n(b,m,q,t));return t},-4);q(I,"$try_convert",function(b,m,n){return B(m,b)?b:z(b["$respond_to?"](n))?b.$__send__(n):v});q(I,"$compare",function(b,m){var n=b["$<=>"](m);z(n===v)&&A.$raise(G("ArgumentError"),"comparison of "+b.$class()+" with "+m.$class()+" failed");return n});q(I,"$destructure",function(b){if(1==b.length)return b[0];if(b.$$is_array)return b;for(var m=Array(b.length),n=0,q=m.length;n<q;n++)m[n]=
|
|
81
|
-
b[n];return m});q(I,"$respond_to?",function(b,m,n){null==n&&(n=!1);return null!=b&&b.$$class?b["$respond_to?"](m,n):!1},-3);q(I,"$instance_variable_name!",function(b){b=m["$coerce_to!"](b,G("String"),"to_str");z(/^@[a-zA-Z_][a-zA-Z0-9_]*?$/.test(b))||A.$raise(G("NameError").$new("'"+b+"' is not allowed as an instance variable name",b));return b});q(I,"$class_variable_name!",function(b){b=m["$coerce_to!"](b,G("String"),"to_str");z(3>b.length||"@@"!==b.slice(0,2))&&A.$raise(G("NameError").$new("`"+
|
|
82
|
-
b+"' is not allowed as a class variable name",b));return b});q(I,"$const_name?",function(b){"string"!==typeof b&&(b=m["$coerce_to!"](b,G("String"),"to_str"));return b[0]===b[0].toUpperCase()});q(I,"$const_name!",function(b){z(G("::","String","skip_raise")?"constant":v)&&(b=m["$coerce_to!"](b,G("String"),"to_str"));b&&b[0]==b[0].toUpperCase()||this.$raise(G("NameError"),"wrong constant name "+b);return b});q(I,"$pristine",function(m,n){var t=E(arguments,1);for(var q,x=t.length-1;0<=x;x--)q=t[x],(q=
|
|
83
|
-
m.$$prototype[b.jsid(q)])&&!q.$$stub&&(q.$$pristine=!0);return v},-2);var K=[];return q(I,"$inspect",function(m){var n=!1;return function(){try{try{if(null===m)return"null";if(void 0===m)return"undefined";if("undefined"===typeof m.$$class)return Object.prototype.toString.apply(m);if("function"!==typeof m.$inspect||m.$inspect.$$stub||-1!==K.indexOf(m.$__id__()))return"#<"+m.$$class+":0x"+m.$__id__().$to_s(16)+">";K.push(m.$__id__());n=!0;return m.$inspect()}catch(J){if(b.rescue(J,[G("Exception")]))try{return"#<"+
|
|
84
|
-
m.$$class+":0x"+m.$__id__().$to_s(16)+">"}finally{b.pop_exception()}else throw J;}}finally{n&&K.pop()}}()},-1)}("::")};
|
|
85
|
-
Opal.modules["corelib/module"]=function(b){var n=b.truthy,x=b.coerce_to,D=b.const_set,q=b.Object,E=b.return_ivar,B=b.assign_ivar,A=b.ivar,z=b.deny_frozen_access,m=b.freeze,v=b.prop,G=b.jsid,I=b.klass,K=b.defs,M=b.send,t=b.def,J=b.eqeqeq,P=b.Module,R=b.Kernel,W=b.rb_lt,N=b.rb_gt,H=b.slice,L=b.to_a,U=b.hash2,a=b.Opal,k=b.return_val,d=b.eqeq,f=b.lambda,h=b.range,c=b.send2,p=b.find_super,T=b.alias,g=b.nil,l=b.$$$;b.add_stubs("module_eval,to_proc,===,raise,equal?,<,>,nil?,attr_reader,attr_writer,warn,attr_accessor,const_name?,class_variable_name!,pristine,const_name!,=~,new,inject,split,const_get,==,start_with?,!~,bind,call,class,frozen?,name,append_features,included,cover?,size,merge,compile,proc,any?,prepend_features,prepended,to_s,__id__,constants,include?,copy_class_variables,copy_constants,class_exec,module_exec,inspect");
|
|
86
|
-
(function(e,$super,S){e=I(e,$super,"Module");var y=[e].concat(S),O=b.$r(y);K(e,"$allocate",function(){var a=b.allocate_module(g,function(){});this!==b.Module&&Object.setPrototypeOf(a,this.$$prototype);return a});t(e,"$initialize",function Z(){var a=Z.$$p||g;Z.$$p=null;return a!==g?M(this,"module_eval",[],a.$to_proc()):g});t(e,"$===",function(a){return n(null==a)?!1:b.is_a(a,this)});t(e,"$<",function(a){J(P,a)||R.$raise(l("TypeError"),"compared with non class/module");var c;if(this===a)return!1;var e=
|
|
87
|
-
0;var f=b.ancestors(this);for(c=f.length;e<c;e++)if(f[e]===a)return!0;e=0;f=b.ancestors(a);for(c=f.length;e<c;e++)if(f[e]===this)return!1;return g});t(e,"$<=",function(a){var c;return n(c=this["$equal?"](a))?c:W(this,a)});t(e,"$>",function(a){J(P,a)||R.$raise(l("TypeError"),"compared with non class/module");return W(a,this)});t(e,"$>=",function(a){var c;return n(c=this["$equal?"](a))?c:N(this,a)});t(e,"$<=>",function(a){if(this===a)return 0;if(!J(P,a))return g;a=W(this,a);return n(a["$nil?"]())?g:
|
|
88
|
-
n(a)?-1:1});t(e,"$alias_method",function(a,c){z(this);a=x(a,l("String"),"to_str");c=x(c,l("String"),"to_str");b.alias(this,a,c);return this});t(e,"$alias_native",function(a,c){null==c&&(c=a);z(this);b.alias_native(this,a,c);return this},-2);t(e,"$ancestors",function(){return b.ancestors(this)});t(e,"$append_features",function(a){z(a);b.append_features(this,a);return this});t(e,"$attr_accessor",function(a){var c=H(arguments);M(this,"attr_reader",L(c));return M(this,"attr_writer",L(c))},-1);t(e,"$attr",
|
|
89
|
-
function(a){var c=H(arguments);return 2!=c.length||!0!==c[1]&&!1!==c[1]?M(this,"attr_reader",L(c)):(this.$warn("optional boolean argument is obsoleted",U(["uplevel"],{uplevel:1})),c[1]?this.$attr_accessor(c[0]):this.$attr_reader(c[0]),g)},-1);t(e,"$attr_reader",function(a){var c=H(arguments);z(this);for(var e=this.$$prototype,f=c.length-1;0<=f;f--){var l=c[f],d=G(l);l=A(l);var u=E(l);b.prop(e,l,g);u.$$parameters=[];u.$$arity=0;b.defn(this,d,u)}return g},-1);t(e,"$attr_writer",function(a){var c=H(arguments);
|
|
90
|
-
z(this);for(var e=this.$$prototype,f=c.length-1;0<=f;f--){var l=c[f],d=G(l+"=");l=A(l);var u=B(l);u.$$parameters=[["req"]];u.$$arity=1;b.prop(e,l,g);b.defn(this,d,u)}return g},-1);t(e,"$autoload",function(a,c){z(this);O("Opal")["$const_name?"](a)||R.$raise(l("NameError"),"autoload must be constant name: "+a);""==c&&R.$raise(l("ArgumentError"),"empty file name");this.$$const.hasOwnProperty(a)||(this.$$autoload||(this.$$autoload={}),b.const_cache_version++,this.$$autoload[a]={path:c,loaded:!1,required:!1,
|
|
91
|
-
success:!1,exception:!1},this.$const_added&&!this.$const_added.$$pristine&&this.$const_added(a));return g});t(e,"$autoload?",function(a){if(this.$$autoload&&this.$$autoload[a]&&!this.$$autoload[a].required&&!this.$$autoload[a].success)return this.$$autoload[a].path;for(var c=this.$ancestors(),e=0,f=c.length;e<f;e++)if(c[e].$$autoload&&c[e].$$autoload[a]&&!c[e].$$autoload[a].required&&!c[e].$$autoload[a].success)return c[e].$$autoload[a].path;return g});t(e,"$class_variables",function(){return Object.keys(b.class_variables(this))});
|
|
92
|
-
t(e,"$class_variable_get",function(c){c=a["$class_variable_name!"](c);return b.class_variable_get(this,c,!1)});t(e,"$class_variable_set",function(c,e){z(this);c=a["$class_variable_name!"](c);return b.class_variable_set(this,c,e)});t(e,"$class_variable_defined?",function(c){c=a["$class_variable_name!"](c);return b.class_variables(this).hasOwnProperty(c)});t(e,"$const_added",k(g));a.$pristine(e,"const_added");t(e,"$remove_class_variable",function(c){z(this);c=a["$class_variable_name!"](c);if(b.hasOwnProperty.call(this.$$cvars,
|
|
93
|
-
c)){var e=this.$$cvars[c];delete this.$$cvars[c];return e}R.$raise(l("NameError"),"cannot remove "+c+" for "+this)});t(e,"$constants",function(a){null==a&&(a=!0);return b.constants(this,a)},-1);K(e,"$constants",function(a){if(null==a){a=(this.$$nesting||[]).concat(q);var c,e={},f;var l=0;for(f=a.length;l<f;l++)for(c in a[l].$$const)e[c]=!0;return Object.keys(e)}return b.constants(this,a)},-1);K(e,"$nesting",function(){return this.$$nesting||[]});t(e,"$const_defined?",function(c,e){null==e&&(e=!0);
|
|
94
|
-
c=O("Opal")["$const_name!"](c);n(c["$=~"](l(a,"CONST_NAME_REGEXP")))||R.$raise(l("NameError").$new("wrong constant name "+c,c));var f=[this],d;e&&(f=f.concat(b.ancestors(this)),this.$$is_module&&(f=f.concat([q]).concat(b.ancestors(q))));var g=0;for(d=f.length;g<d;g++)if(e=f[g],null!=e.$$const[c]||e.$$autoload&&e.$$autoload[c]&&!e.$$autoload[c].required&&!e.$$autoload[c].success)return!0;return!1},-2);t(e,"$const_get",function(c,e){null==e&&(e=!0);c=O("Opal")["$const_name!"](c);0===c.indexOf("::")&&
|
|
95
|
-
"::"!==c&&(c=c.slice(2));if(n(-1!=c.indexOf("::")&&"::"!=c))return M(c.$split("::"),"inject",[this],function(a,c){null==a&&(a=g);null==c&&(c=g);return a.$const_get(c)});n(c["$=~"](l(a,"CONST_NAME_REGEXP")))||R.$raise(l("NameError").$new("wrong constant name "+c,c));return e?b.$$([this],c):b.const_get_local(this,c)},-2);t(e,"$const_missing",function(a){var c=d(this,q)?a:""+this+"::"+a;return R.$raise(l("NameError").$new("uninitialized constant "+c,a))});t(e,"$const_set",function(c,e){z(this);c=a["$const_name!"](c);
|
|
96
|
-
(n(c["$!~"](l(a,"CONST_NAME_REGEXP")))||n(c["$start_with?"]("::")))&&R.$raise(l("NameError").$new("wrong constant name "+c,c));D(this,c,e);return e});t(e,"$public_constant",k(g));t(e,"$define_method",function ra(a,c){var e=ra.$$p||g,d=g,u=g;ra.$$p=null;z(this);void 0===c&&e===g&&R.$raise(l("ArgumentError"),"tried to create a Proc object without a block");e=n(d=e)?d:J(l("Proc"),u=c)?c:J(l("Method"),u)?c.$to_proc().$$unbound:J(l("UnboundMethod"),u)?f(function pa(a){var e=null==pa.$$s?this:pa.$$s;var f=
|
|
97
|
-
H(arguments);e=c.$bind(e);return M(e,"call",L(f))},{$$arity:-1,$$s:this}):R.$raise(l("TypeError"),"wrong argument type "+e.$class()+" (expected Proc/Method)");"undefined"!==typeof Proxy&&(Object.create(null),e.$$proxy_target=e,e=new Proxy(e,{apply:function(c,e,f){var b=c.$$jsid;c.$$jsid=a;try{return c.apply(e,f)}catch(w){if(w===c.$$brk||w===c.$$ret)return w.$v;throw w;}finally{c.$$jsid=b}}}));e.$$jsid=a;e.$$s=null;e.$$def=e;e.$$define_meth=!0;return b.defn(this,G(a),e)},-2);t(e,"$freeze",function(){if(n(this["$frozen?"]()))return this;
|
|
98
|
-
this.hasOwnProperty("$$base_module")||v(this,"$$base_module",null);return m(this)});t(e,"$remove_method",function(a){var c=H(arguments);for(var e=0;e<c.length;e++){var f=c[e];"string"===typeof f||f.$$is_string||this.$raise(l("TypeError"),""+this.$name()+" is not a symbol nor a string");z(this);b.rdef(this,"$"+f)}return this},-1);t(e,"$singleton_class?",function(){return!!this.$$is_singleton});t(e,"$include",function(a){var c=H(arguments);for(var e=c.length-1;0<=e;e--){var f=c[e];f.$$is_module||R.$raise(l("TypeError"),
|
|
99
|
-
"wrong argument type "+f.$class()+" (expected Module)");f.$append_features(this);f.$included(this)}return this},-1);t(e,"$included_modules",function(){return b.included_modules(this)});t(e,"$include?",function(a){a.$$is_module||R.$raise(l("TypeError"),"wrong argument type "+a.$class()+" (expected Module)");var c,e=b.ancestors(this);var f=0;for(c=e.length;f<c;f++){var d=e[f];if(d===a&&d!==this)return!0}return!1});t(e,"$instance_method",function(a){var c=this.$$prototype[G(a)];c&&!c.$$stub||R.$raise(l("NameError").$new("undefined method `"+
|
|
100
|
-
a+"' for class `"+this.$name()+"'",a));return l("UnboundMethod").$new(this,c.$$owner||this,c,a)});t(e,"$instance_methods",function(a){null==a&&(a=!0);return n(a)?b.instance_methods(this):b.own_instance_methods(this)},-1);t(e,"$included",k(g));t(e,"$extended",k(g));t(e,"$extend_object",function(a){z(a);return g});t(e,"$method_added",function(a){H(arguments);return g},-1);t(e,"$method_removed",function(a){H(arguments);return g},-1);t(e,"$method_undefined",function(a){H(arguments);return g},-1);t(e,
|
|
101
|
-
"$module_eval",function ra(c){var e=ra.$$p||g,f,d=f=g,p=d=g,r=d=g;ra.$$p=null;f=H(arguments);n(e["$nil?"]())&&n(!!b.compile)?(n(h(1,3,!1)["$cover?"](f.$size()))||R.$raise(l("ArgumentError"),"wrong number of arguments (0 for 1..3)"),e=[].concat(L(f)),f=null==e[0]?g:e[0],d=null==e[1]?g:e[1],e,d=U(["file","eval"],{file:n(p=d)?p:"(eval)",eval:!0}),d=b.hash({arity_check:!1}).$merge(d),r=a.$compile(f,d),e=M(R,"proc",[],function Y(){var a=null==Y.$$s?this:Y.$$s;return(new Function("Opal,self","return "+
|
|
102
|
-
r))(b,a)},{$$s:this})):n(f["$any?"]())&&R.$raise(l("ArgumentError"),"wrong number of arguments ("+f.$size()+" for 0)\n\n NOTE:If you want to enable passing a String argument please add \"require 'opal-parser'\" to your script\n");p=e.$$s;e.$$s=null;f=e.apply(this,[this]);e.$$s=p;return f},-1);t(e,"$module_exec",function ja(a){var c=ja.$$p||g;ja.$$p=null;var e=H(arguments);c===g&&R.$raise(l("LocalJumpError"),"no block given");var f=c.$$s;c.$$s=null;e=c.apply(this,e);c.$$s=f;return e},-1);t(e,"$method_defined?",
|
|
103
|
-
function(a){a=this.$$prototype[G(a)];return!!a&&!a.$$stub});t(e,"$module_function",function(a){var c=H(arguments);z(this);if(0===c.length)return this.$$module_function=!0,g;for(var e=0,f=c.length;e<f;e++){var l=G(c[e]);b.defs(this,l,this.$$prototype[l])}return 1===c.length?c[0]:c},-1);t(e,"$name",function(){if(this.$$full_name)return this.$$full_name;for(var a=[],c=this;c;){if(c.$$name===g||null==c.$$name)return g;a.unshift(c.$$name);c=c.$$base_module;if(c===q)break}return 0===a.length?g:this.$$full_name=
|
|
104
|
-
a.join("::")});t(e,"$prepend",function(a){var c=H(arguments);0===c.length&&R.$raise(l("ArgumentError"),"wrong number of arguments (given 0, expected 1+)");for(var e=c.length-1;0<=e;e--){var f=c[e];f.$$is_module||R.$raise(l("TypeError"),"wrong argument type "+f.$class()+" (expected Module)");f.$prepend_features(this);f.$prepended(this)}return this},-1);t(e,"$prepend_features",function(a){z(a);this.$$is_module||R.$raise(l("TypeError"),"wrong argument type "+this.$class()+" (expected Module)");b.prepend_features(this,
|
|
105
|
-
a);return this});t(e,"$prepended",k(g));t(e,"$remove_const",function(a){z(this);return b.const_remove(this,a)});t(e,"$to_s",function(){var a;return n(a=b.Module.$name.call(this))?a:"#<"+(this.$$is_module?"Module":"Class")+":0x"+this.$__id__().$to_s(16)+">"});t(e,"$undef_method",function(a){var c=H(arguments);for(var e=0;e<c.length;e++){var f=c[e];"string"===typeof f||f.$$is_string||this.$raise(l("TypeError"),""+this.$name()+" is not a symbol nor a string");z(this);b.udef(this,"$"+c[e])}return this},
|
|
106
|
-
-1);t(e,"$instance_variables",function(){var a=(b.Module.$$nesting=y,this.$constants());var c=[],e;for(e in this)this.hasOwnProperty(e)&&"$"!==e.charAt(0)&&"constructor"!==e&&!a["$include?"](e)&&c.push("@"+e);return c});t(e,"$dup",function ja(){var a=ja.$$p||g;ja.$$p=null;a=c(this,p(this,"dup",ja,!1,!0),"dup",[],a);a.$copy_class_variables(this);a.$copy_constants(this);return a});t(e,"$copy_class_variables",function(a){for(var c in a.$$cvars)this.$$cvars[c]=a.$$cvars[c]});t(e,"$copy_constants",function(a){var c;
|
|
107
|
-
a=a.$$const;for(c in a)D(this,c,a[c])});t(e,"$refine",function u(a){var c=u.$$p||g;u.$$p=null;var e=[this,g,g];var f=e[0];e;e=b.id(a);"undefined"===typeof this.$$refine_modules&&(this.$$refine_modules=Object.create(null));e="undefined"===typeof this.$$refine_modules[e]?this.$$refine_modules[e]=l("Refinement").$new():this.$$refine_modules[e];e.refinement_module=f;e.refined_class=a;M(e,"class_exec",[],c.$to_proc());return e});t(e,"$refinements",function(){var a=this.$$refine_modules,c=U([],{});if("undefined"===
|
|
108
|
-
typeof a)return c;for(var e in a)c["$[]="](a[e].refined_class,a[e]);return c});t(e,"$using",function(a){return R.$raise("Module#using is not permitted in methods")});T(e,"class_eval","module_eval");T(e,"class_exec","module_exec");return T(e,"inspect","to_s")})("::",null,[]);return function(a,$super){a=I(a,$super,"Refinement");var e=a.$$prototype;e.refinement_module=e.refined_class=g;a.$attr_reader("refined_class");return t(a,"$inspect",function O(){var a=O.$$p||g;O.$$p=null;return n(this.refinement_module)?
|
|
109
|
-
"#<refinement:"+this.refined_class.$inspect()+"@"+this.refinement_module.$inspect()+">":c(this,p(this,"inspect",O,!1,!0),"inspect",[],a)})}("::",P)};
|
|
110
|
-
Opal.modules["corelib/class"]=function(b){var n=b.klass,x=b.send,D=b.defs,q=b.def,E=b.rb_plus,B=b.return_val,A=b.slice,z=b.send2,m=b.find_super,v=b.Kernel,G=b.alias,I=b.top,K=b.nil,M=b.$$$;b.add_stubs("require,class_eval,to_proc,+,subclasses,flatten,map,initialize_copy,allocate,name,to_s,raise");I.$require("corelib/module");return function(t,$super,P){t=n(t,$super,"Class");P=[t].concat(P);var I=b.$r(P);D(t,"$new",function H(m){var n=H.$$p||K;H.$$p=null;null==m&&(m=I("Object"));if(!m.$$is_class)throw b.TypeError.$new("superclass must be a Class");
|
|
111
|
-
var t=b.allocate_class(K,m);m.$inherited(t);n!==K?x(t,"class_eval",[],n.$to_proc()):K;return t},-1);q(t,"$allocate",function(){var m=new this.$$constructor;m.$$id=b.uid();return m});q(t,"$descendants",function(){return E(this.$subclasses(),x(this.$subclasses(),"map",[],"descendants".$to_proc()).$flatten())});q(t,"$inherited",B(K));q(t,"$initialize_dup",function(b){this.$initialize_copy(b);this.$$full_name=this.$$name=null});q(t,"$new",function L(m){var n=L.$$p||K;L.$$p=null;var a=A(arguments);var k=
|
|
112
|
-
this.$allocate();b.send(k,k.$initialize,a,n);return k},-1);q(t,"$subclasses",function(){if("undefined"!==typeof WeakRef){var b,m=[];for(b=0;b<this.$$subclasses.length;b++){var n=this.$$subclasses[b].deref();void 0!==n&&m.push(n)}return m}return this.$$subclasses});q(t,"$superclass",function(){return this.$$super||K});q(t,"$to_s",function L(){L.$$p=null;var n=this.$$singleton_of;return n&&n.$$is_a_module?"#<Class:"+n.$name()+">":n?"#<Class:#<"+n.$$class.$name()+":0x"+b.id(n).$to_s(16)+">>":z(this,
|
|
113
|
-
m(this,"to_s",L,!1,!0),"to_s",[],null)});q(t,"$attached_object",function(){if(null!=this.$$singleton_of)return this.$$singleton_of;v.$raise(M("TypeError"),"`"+this+"' is not a singleton class")});return G(t,"inspect","to_s")}("::",null,[])};
|
|
114
|
-
Opal.modules["corelib/basic_object"]=function(b){var n=b.klass,x=b.slice,D=b.def,q=b.alias,E=b.return_val,B=b.Opal,A=b.truthy,z=b.range,m=b.Kernel,v=b.to_a,G=b.hash2,I=b.send,K=b.eqeq,M=b.rb_ge,t=b.nil,J=b.$$$;b.add_stubs("==,raise,inspect,pristine,!,nil?,cover?,size,merge,compile,proc,[],first,>=,length,instance_variable_get,any?,new,caller");return function(P,$super){P=n(P,$super,"BasicObject");D(P,"$initialize",function(b){x(arguments);return t},-1);D(P,"$==",function(b){return this===b});D(P,
|
|
115
|
-
"$eql?",function(b){return this["$=="](b)});q(P,"equal?","==");D(P,"$__id__",function(){if(null!=this.$$id)return this.$$id;b.prop(this,"$$id",b.uid());return this.$$id});D(P,"$__send__",function L(m,n){var q=L.$$p||t;L.$$p=null;var a=x(arguments,1);m.$$is_string||this.$raise(J("TypeError"),""+this.$inspect()+" is not a symbol nor a string");var k=this[b.jsid(m)];if(k)return q!==t&&(k.$$p=q),k.apply(this,a);q!==t&&(this.$method_missing.$$p=q);return this.$method_missing.apply(this,[m].concat(a))},
|
|
116
|
-
-2);D(P,"$!",E(!1));B.$pristine("!");D(P,"$!=",function(b){return this["$=="](b)["$!"]()});D(P,"$instance_eval",function L(n){var q=L.$$p||t,a,k=a=t,d=k=t,f=k=t;L.$$p=null;a=x(arguments);if(A(q["$nil?"]())&&A(!!b.compile))A(z(1,3,!1)["$cover?"](a.$size()))||m.$raise(J("ArgumentError"),"wrong number of arguments (0 for 1..3)"),q=[].concat(v(a)),a=null==q[0]?t:q[0],k=null==q[1]?t:q[1],q,k=G(["file","eval"],{file:A(d=k)?d:"(eval)",eval:!0}),k=b.hash({arity_check:!1}).$merge(k),f=B.$compile(a,k),q=I(m,
|
|
117
|
-
"proc",[],function p(){var a=null==p.$$s?this:p.$$s;return(new Function("Opal,self","return "+f))(b,a)},{$$s:this});else{if(A(q["$nil?"]())&&A(M(a.$length(),1))&&K(a.$first()["$[]"](0),"@"))return this.$instance_variable_get(a.$first());A(a["$any?"]())&&m.$raise(J("ArgumentError"),"wrong number of arguments ("+a.$size()+" for 0)")}d=q.$$s;q.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var h=q.call(this,this)}finally{this.$$eval=!1}}else h=q.call(this,this);q.$$s=d;return h},-1);D(P,"$instance_exec",
|
|
118
|
-
function U(b){var a=U.$$p||t;U.$$p=null;var k=x(arguments);A(a)||m.$raise(J("ArgumentError"),"no block given");var d=a.$$s;a.$$s=null;if(this.$$is_a_module){this.$$eval=!0;try{var f=a.apply(this,k)}finally{this.$$eval=!1}}else f=a.apply(this,k);a.$$s=d;return f},-1);D(P,"$singleton_method_added",function(b){x(arguments);return t},-1);D(P,"$singleton_method_removed",function(b){x(arguments);return t},-1);D(P,"$singleton_method_undefined",function(b){x(arguments);return t},-1);D(P,"$method_missing",
|
|
119
|
-
function k(b,a){k.$$p=null;var d=x(arguments,1);var f=B.$inspect(this);return m.$raise(J("NoMethodError").$new("undefined method `"+b+"' for "+f,b,d),t,m.$caller(1))},-2);B.$pristine(P,"method_missing");return D(P,"$respond_to_missing?",function(b,a){return!1},-2)}("::",null)};
|
|
120
|
-
Opal.modules["corelib/kernel"]=function(b){var n=b.truthy,x=b.coerce_to,D=b.respond_to,q=b.Opal,E=b.deny_frozen_access,B=b.freeze,A=b.freeze_props,z=b.jsid,m=b.module,v=b.return_val,G=b.def,I=b.Kernel,K=b.gvars,M=b.slice,t=b.send,J=b.to_a,P=b.ensure_kwargs,R=b.eqeq,W=b.hash2,N=b.rb_plus,H=b.eqeqeq,L=b.return_self,U=b.rb_le,a=b.extract_kwargs,k=b.rb_lt,d=b.Object,f=b.alias,h=b.klass,c=b.nil,p=b.$$$;b.add_stubs("!,=~,==,object_id,raise,new,class,coerce_to?,<<,map,caller,nil?,allocate,copy_instance_variables,copy_singleton_methods,initialize_clone,frozen?,freeze,initialize_copy,define_method,singleton_class,to_proc,initialize_dup,for,empty?,pop,call,append_features,extend_object,extended,gets,__id__,include?,each,instance_variables,instance_variable_get,inspect,+,to_s,instance_variable_name!,respond_to?,to_int,coerce_to!,Integer,===,enum_for,result,any?,print,format,puts,<=,length,[],readline,<,first,split,to_str,exception,backtrace,rand,respond_to_missing?,pristine,try_convert!,expand_path,join,start_with?,new_seed,srand,tag,value,open,is_a?,__send__,yield_self,include");
|
|
121
|
-
(function(h,g){h=m(h,"Kernel");g=[h].concat(g);var l=b.$r(g);G(h,"$=~",v(!1));G(h,"$!~",function(a){return this["$=~"](a)["$!"]()});G(h,"$===",function(a){var c;return n(c=this.$object_id()["$=="](a.$object_id()))?c:this["$=="](a)});G(h,"$<=>",function(a){this.$$comparable=!0;return(a=this["$=="](a))&&a!==c?0:c});G(h,"$method",function(a){var c=this[z(a)];c&&!c.$$stub||I.$raise(p("NameError").$new("undefined method `"+a+"' for class `"+this.$class()+"'",a));return p("Method").$new(this,c.$$owner||
|
|
122
|
-
this.$class(),c,a)});G(h,"$methods",function(a){null==a&&(a=!0);return n(a)?b.methods(this):b.own_methods(this)},-1);G(h,"$public_methods",function(a){null==a&&(a=!0);return n(a)?b.methods(this):b.receiver_methods(this)},-1);G(h,"$Array",function(a){if(a===c)return[];if(a.$$is_array)return a;var e=q["$coerce_to?"](a,p("Array"),"to_ary");if(e!==c)return e;e=q["$coerce_to?"](a,p("Array"),"to_a");return e!==c?e:[a]});G(h,"$at_exit",function S(){var a=S.$$p||c,e=c;null==K.__at_exit__&&(K.__at_exit__=
|
|
123
|
-
c);S.$$p=null;K.__at_exit__=n(e=K.__at_exit__)?e:[];K.__at_exit__["$<<"](a);return a});G(h,"$caller",function(a,e){null==a&&(a=1);null==e&&(e=c);var f=Error().$backtrace();var b=[];a+=1;for(var l=f.length;a<l;a++)f[a].match(/runtime\.js/)||b.push(f[a]);e!=c&&(b=b.slice(0,e));return b},-1);G(h,"$caller_locations",function(a){var e=M(arguments);return t(t(this,"caller",J(e)),"map",[],function(a){null==a&&(a=c);return p(p(p("Thread"),"Backtrace"),"Location").$new(a)})},-1);G(h,"$class",function(){return this.$$class});
|
|
124
|
-
G(h,"$copy_instance_variables",function(a){var c=Object.keys(a),e;var f=0;for(e=c.length;f<e;f++){var b=c[f];"$"!==b.charAt(0)&&a.hasOwnProperty(b)&&(this[b]=a[b])}});G(h,"$copy_singleton_methods",function(a){var c;if(a.hasOwnProperty("$$meta")&&null!==a.$$meta){var e=b.get_singleton_class(a),f=b.get_singleton_class(this);var l=Object.getOwnPropertyNames(e.$$prototype);var d=0;for(c=l.length;d<c;d++){var g=l[d];b.is_method(g)&&(f.$$prototype[g]=e.$$prototype[g])}f.$$const=Object.assign({},e.$$const);
|
|
125
|
-
Object.setPrototypeOf(f.$$prototype,Object.getPrototypeOf(e.$$prototype))}d=0;l=Object.getOwnPropertyNames(a);for(c=l.length;d<c;d++)g=l[d],"$"===g.charAt(0)&&"$"!==g.charAt(1)&&a.hasOwnProperty(g)&&(this[g]=a[g])});G(h,"$clone",function(a){a=P(a);a=a.$$smap.freeze;null==a&&(a=c);n(a["$nil?"]())||R(a,!0)||R(a,!1)||this.$raise(l("ArgumentError"),"unexpected value for freeze: "+a.$class());var e=this.$class().$allocate();e.$copy_instance_variables(this);e.$copy_singleton_methods(this);e.$initialize_clone(this,
|
|
126
|
-
W(["freeze"],{freeze:a}));(R(a,!0)||n(a["$nil?"]())&&n(this["$frozen?"]()))&&e.$freeze();return e},-1);G(h,"$initialize_clone",function(a,c){P(c);this.$initialize_copy(a);return this},-2);G(h,"$define_singleton_method",function F(a,e){var f=F.$$p||c;F.$$p=null;return t(this.$singleton_class(),"define_method",[a,e],f.$to_proc())},-2);G(h,"$dup",function(){var a=this.$class().$allocate();a.$copy_instance_variables(this);a.$initialize_dup(this);return a});G(h,"$initialize_dup",function(a){return this.$initialize_copy(a)});
|
|
127
|
-
G(h,"$enum_for",function Z(a,e){var f=Z.$$p||c,b;Z.$$p=null;var l=M(arguments);0<l.length&&(b=l.shift());null==b&&(b="each");return t(p("Enumerator"),"for",[this,b].concat(J(l)),f.$to_proc())},-1);G(h,"$equal?",function(a){return this===a});G(h,"$exit",function(a){var e=c;null==K.__at_exit__&&(K.__at_exit__=c);null==a&&(a=!0);for(K.__at_exit__=n(e=K.__at_exit__)?e:[];!n(K.__at_exit__["$empty?"]());)e=K.__at_exit__.$pop(),e.$call();a=a.$$is_boolean?a?0:1:x(a,p("Integer"),"to_int");b.exit(a);return c},
|
|
128
|
-
-1);G(h,"$extend",function(a){var c=M(arguments);0==c.length&&this.$raise(p("ArgumentError"),"wrong number of arguments (given 0, expected 1+)");E(this);for(var e=this.$singleton_class(),f=c.length-1;0<=f;f--){var b=c[f];b.$$is_module||I.$raise(p("TypeError"),"wrong argument type "+b.$class()+" (expected Module)");b.$append_features(e);b.$extend_object(this);b.$extended(this)}return this},-1);G(h,"$freeze",function(){return n(this["$frozen?"]())?this:"object"===typeof this?(A(this),B(this)):this});
|
|
129
|
-
G(h,"$frozen?",function(){switch(typeof this){case "string":case "symbol":case "number":case "boolean":return!0;case "object":return this.$$frozen||!1;default:return!1}});G(h,"$gets",function(a){null==K.stdin&&(K.stdin=c);var e=M(arguments);return t(K.stdin,"gets",J(e))},-1);G(h,"$hash",function(){return this.$__id__()});G(h,"$initialize_copy",v(c));var e=[];G(h,"$inspect",function(){var a=this,f=c,d=c,g=c;return function(){try{try{return f="",d=a.$__id__(),n(e["$include?"](d))?f=" ...":(e["$<<"](d),
|
|
130
|
-
g=!0,t(a.$instance_variables(),"each",[],function ja(a){var e=null==ja.$$s?this:ja.$$s;null==a&&(a=c);e=e.$instance_variable_get(a);e=l("Opal").$inspect(e);return f=N(f," "+a+"="+e)},{$$s:a})),"#<"+a.$class()+":0x"+d.$to_s(16)+f+">"}catch(ea){if(b.rescue(ea,[l("StandardError")]))try{return"#<"+a.$class()+":0x"+d.$to_s(16)+">"}finally{b.pop_exception()}else throw ea;}}finally{n(g)?e.$pop():c}}()});G(h,"$instance_of?",function(a){a.$$is_class||a.$$is_module||I.$raise(p("TypeError"),"class or module required");
|
|
131
|
-
return this.$$class===a});G(h,"$instance_variable_defined?",function(a){a=q["$instance_variable_name!"](a);return b.hasOwnProperty.call(this,a.substr(1))});G(h,"$instance_variable_get",function(a){a=q["$instance_variable_name!"](a);a=this[b.ivar(a.substr(1))];return null==a?c:a});G(h,"$instance_variable_set",function(a,c){E(this);a=q["$instance_variable_name!"](a);return this[b.ivar(a.substr(1))]=c});G(h,"$remove_instance_variable",function(a){a=q["$instance_variable_name!"](a);var c=b.ivar(a.substr(1));
|
|
132
|
-
return this.hasOwnProperty(c)?(a=this[c],delete this[c],a):I.$raise(p("NameError"),"instance variable "+a+" not defined")});G(h,"$instance_variables",function(){var a=[],c;for(c in this)if(this.hasOwnProperty(c)&&"$"!==c.charAt(0)){var e="$"===c.substr(-1)?c.slice(0,c.length-1):c;a.push("@"+e)}return a});G(h,"$Integer",function(a,e){if(!a.$$is_string){void 0!==e&&I.$raise(p("ArgumentError"),"base specified for non string value");a===c&&I.$raise(p("TypeError"),"can't convert nil into Integer");if(a.$$is_number)return(Infinity===
|
|
133
|
-
a||-Infinity===a||isNaN(a))&&I.$raise(p("FloatDomainError"),a),Math.floor(a);if(a["$respond_to?"]("to_int")){var f=a.$to_int();if(f!==c)return f}return q["$coerce_to!"](a,p("Integer"),"to_i")}if("0"===a)return 0;void 0===e?e=0:(e=x(e,p("Integer"),"to_int"),(1===e||0>e||36<e)&&I.$raise(p("ArgumentError"),"invalid radix "+e));f=a.toLowerCase();f=f.replace(/(\d)_(?=\d)/g,"$1");f=f.replace(/^(\s*[+-]?)(0[bodx]?)/,function(c,f,b){switch(b){case "0b":if(0===e||2===e)return e=2,f;case "0":case "0o":if(0===
|
|
134
|
-
e||8===e)return e=8,f;case "0d":if(0===e||10===e)return e=10,f;case "0x":if(0===e||16===e)return e=16,f}I.$raise(p("ArgumentError"),'invalid value for Integer(): "'+a+'"')});e=0===e?10:e;var b="0-"+(10>=e?e-1:"9a-"+String.fromCharCode(97+(e-11)));(new RegExp("^\\s*[+-]?["+b+"]+\\s*$")).test(f)||I.$raise(p("ArgumentError"),'invalid value for Integer(): "'+a+'"');f=parseInt(f,e);isNaN(f)&&I.$raise(p("ArgumentError"),'invalid value for Integer(): "'+a+'"');return f},-2);G(h,"$Float",function(a){a===
|
|
135
|
-
c&&I.$raise(p("TypeError"),"can't convert nil into Float");if(a.$$is_string){var e=a.toString();e=e.replace(/(\d)_(?=\d)/g,"$1");if(/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(e))return I.$Integer(e);/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(e)||I.$raise(p("ArgumentError"),'invalid value for Float(): "'+a+'"');return parseFloat(e)}return q["$coerce_to!"](a,p("Float"),"to_f")});G(h,"$Hash",function(a){return n(a["$nil?"]())||R(a,[])?W([],{}):H(p("Hash"),a)?a:q["$coerce_to!"](a,p("Hash"),"to_hash")});
|
|
136
|
-
G(h,"$is_a?",function(a){a.$$is_class||a.$$is_module||I.$raise(p("TypeError"),"class or module required");return b.is_a(this,a)});G(h,"$itself",L);G(h,"$lambda",function F(){var a=F.$$p||c;F.$$p=null;return b.lambda(a)});G(h,"$load",function(a){a=q["$coerce_to!"](a,p("String"),"to_str");return b.load(a)});G(h,"$loop",function Z(){var a=Z.$$p||c,e=c;Z.$$p=null;if(a===c)return t(this,"enum_for",["loop"],function(){return p(p("Float"),"INFINITY")});for(;n(!0);)try{b.yieldX(a,[])}catch(ra){if(b.rescue(ra,
|
|
137
|
-
[p("StopIteration")])){e=ra;try{return e.$result()}finally{b.pop_exception()}}else throw ra;}return this});G(h,"$nil?",v(!1));G(h,"$printf",function(a){var e=M(arguments);n(e["$any?"]())&&this.$print(t(this,"format",J(e)));return c},-1);G(h,"$proc",function la(){var a=la.$$p||c;la.$$p=null;n(a)||I.$raise(p("ArgumentError"),"tried to create Proc object without a block");a.$$is_lambda=!1;return a});G(h,"$puts",function(a){null==K.stdout&&(K.stdout=c);var e=M(arguments);return t(K.stdout,"puts",J(e))},
|
|
138
|
-
-1);G(h,"$p",function(a){var e=M(arguments);t(e,"each",[],function(a){null==K.stdout&&(K.stdout=c);null==a&&(a=c);return K.stdout.$puts(a.$inspect())});return n(U(e.$length(),1))?e["$[]"](0):e},-1);G(h,"$print",function(a){null==K.stdout&&(K.stdout=c);var e=M(arguments);return t(K.stdout,"print",J(e))},-1);G(h,"$readline",function(a){null==K.stdin&&(K.stdin=c);var e=M(arguments);return t(K.stdin,"readline",J(e))},-1);G(h,"$warn",function(e,f){var b,l,d=c;null==K.VERBOSE&&(K.VERBOSE=c);null==K.stderr&&
|
|
139
|
-
(K.stderr=c);var g=M(arguments);var h=a(g);h=P(h);h=h.$$smap.uplevel;null==h&&(h=c);n(h)&&(h=q["$coerce_to!"](h,p("Integer"),"to_str"),n(k(h,0))&&I.$raise(p("ArgumentError"),"negative level ("+h+")"),d=(b=(l=this.$caller(N(h,1),1).$first(),l===c||null==l?c:l.$split(":in `")),b===c||null==b?c:b.$first()),n(d)&&(d=""+d+": "),g=t(g,"map",[],function(a){null==a&&(a=c);return""+d+"warning: "+a}));return n(K.VERBOSE["$nil?"]())||n(g["$empty?"]())?c:t(K.stderr,"puts",J(g))},-1);G(h,"$raise",function(a,e,
|
|
140
|
-
f){null==K["!"]&&(K["!"]=c);null==K["@"]&&(K["@"]=c);null==e&&(e=c);null==f&&(f=c);if(null==a&&K["!"]!==c)throw K["!"];null==a?a=p("RuntimeError").$new(""):D(a,"$to_str")?a=p("RuntimeError").$new(a.$to_str()):a.$$is_class&&D(a,"$exception")?a=a.$exception(e):a.$$is_exception||(a=p("TypeError").$new("exception class/object expected"));f!==c&&a.$set_backtrace(f);K["!"]!==c&&b.exceptions.push(K["!"]);K["!"]=a;K["@"]=a.$backtrace();throw a;},-1);G(h,"$rand",function(a){if(void 0===a)return p(p("Random"),
|
|
141
|
-
"DEFAULT").$rand();a.$$is_number&&(0>a&&(a=Math.abs(a)),0!==a%1&&(a=a.$to_i()),0===a&&(a=void 0));return p(p("Random"),"DEFAULT").$rand(a)},-1);G(h,"$respond_to?",function(a,c){null==c&&(c=!1);var e=this[z(a)];return"function"!==typeof e||e.$$stub?!0===this["$respond_to_missing?"].$$pristine?!1:this["$respond_to_missing?"](a,c):!0},-2);G(h,"$respond_to_missing?",function(a,c){return!1},-2);q.$pristine(h,"respond_to?","respond_to_missing?");G(h,"$require",function(a){"string"!==typeof a&&b.String&&
|
|
142
|
-
b.Array&&(a=q["$coerce_to!"](a,p("String"),"to_str"));return b.require(a)});G(h,"$require_relative",function(a){q["$try_convert!"](a,p("String"),"to_str");a=p("File").$expand_path(p("File").$join(b.current_file,"..",a));return b.require(a)});G(h,"$require_tree",function(a,c){c=P(c);c=c.$$smap.autoload;null==c&&(c=!1);var e=[];a=p("File").$expand_path(a);a=b.normalize(a);"."===a&&(a="");for(var f in b.modules)f["$start_with?"](a)&&(c?e.push([f,!0]):e.push([f,b.require(f)]));return e},-2);G(h,"$singleton_class",
|
|
143
|
-
function(){return b.get_singleton_class(this)});G(h,"$sleep",function(a){null==a&&(a=c);a===c&&I.$raise(p("TypeError"),"can't convert NilClass into time interval");a.$$is_number||I.$raise(p("TypeError"),"can't convert "+a.$class()+" into time interval");0>a&&I.$raise(p("ArgumentError"),"time interval must be positive");for(var e=b.global.performance?function(){return performance.now()}:function(){return new Date},f=e();e()-f<=1E3*a;);return Math.round(a)},-1);G(h,"$srand",function(a){null==a&&(a=
|
|
144
|
-
l("Random").$new_seed());return p("Random").$srand(a)},-1);G(h,"$String",function(a){var c;return n(c=q["$coerce_to?"](a,p("String"),"to_str"))?c:q["$coerce_to!"](a,p("String"),"to_s")});G(h,"$tap",function ea(){var a=ea.$$p||c;ea.$$p=null;b.yield1(a,this);return this});G(h,"$to_proc",L);G(h,"$to_s",function(){return"#<"+this.$class()+":0x"+this.$__id__().$to_s(16)+">"});G(h,"$catch",function ja(a){var e=ja.$$p||c,f=c;ja.$$p=null;null==a&&(a=c);try{return a=n(f=a)?f:d.$new(),b.yield1(e,a)}catch(wa){if(b.rescue(wa,
|
|
145
|
-
[p("UncaughtThrowError")])){e=wa;try{return R(e.$tag(),a)?e.$value():I.$raise()}finally{b.pop_exception()}}else throw wa;}},-1);G(h,"$throw",function(a,e){null==e&&(e=c);return I.$raise(p("UncaughtThrowError").$new(a,e))},-2);G(h,"$open",function ka(a){var e=ka.$$p||c;ka.$$p=null;var f=M(arguments);return t(p("File"),"open",J(f),e.$to_proc())},-1);G(h,"$yield_self",function ka(){var a=ka.$$p||c;ka.$$p=null;return a===c?t(this,"enum_for",["yield_self"],v(1)):b.yield1(a,this)});f(h,"fail","raise");
|
|
146
|
-
f(h,"kind_of?","is_a?");f(h,"object_id","__id__");f(h,"public_send","__send__");f(h,"send","__send__");f(h,"then","yield_self");return f(h,"to_enum","enum_for")})("::",[]);return function(a,$super){a=h(a,$super,"Object");delete d.$$prototype.$require;return a.$include(I)}("::",null)};
|
|
147
|
-
Opal.modules["corelib/main"]=function(b){var n=b.return_val,x=b.def,D=b.Object,q=b.slice,E=b.Kernel,B=b.top;b.add_stubs("include,raise");return function(B,z){x(B,"$to_s",n("main"));x(B,"$include",function(b){return D.$include(b)});x(B,"$autoload",function(m){var n=q(arguments);return b.Object.$autoload.apply(b.Object,n)},-1);return x(B,"$using",function(b){return E.$raise("main.using is permitted only at toplevel")})}(b.get_singleton_class(B),[])};
|
|
148
|
-
Opal.modules["corelib/error/errno"]=function(b){var n=b.module,x=b.truthy,D=b.rb_plus,q=b.send2,E=b.find_super,B=b.def,A=b.klass,z=[],m=b.nil,v=b.$$$;b.add_stubs("+,errno,class,attr_reader");(function(v,z){var G=n(v,"Errno"),M=[G].concat(z),t=m,A=m;t=[["EINVAL","Invalid argument",22],["EEXIST","File exists",17],["EISDIR","Is a directory",21],["EMFILE","Too many open files",24],["ESPIPE","Illegal seek",29],["EACCES","Permission denied",13],["EPERM","Operation not permitted",1],["ENOENT","No such file or directory",
|
|
149
|
-
2],["ENAMETOOLONG","File name too long",36]];A=m;var P;for(P=0;P<t.length;P++)(function(){var n=t[P][1],v=t[P][2];A=b.klass(G,b.SystemCallError,t[P][0]);A.errno=v;(function(b,t){return B(b,"$new",function a(b){a.$$p=null;null==b&&(b=m);var k=n;x(b)&&(k=D(k," - "+b));return q(this,E(this,"new",a,!1,!0),"new",[k],null)},-1)})(b.get_singleton_class(A),M)})()})("::",z);return function(m,$super,n){m=A(m,$super,"SystemCallError");n=[m].concat(n);B(m,"$errno",function(){return this.$class().$errno()});return function(b,
|
|
150
|
-
m){return b.$attr_reader("errno")}(b.get_singleton_class(m),n)}("::",v("StandardError"),z)};
|
|
151
|
-
Opal.modules["corelib/error"]=function(b){var n=b.klass,x=b.slice,D=b.gvars,q=b.defs,E=b.send,B=b.to_a,A=b.def,z=b.truthy,m=b.hash2,v=b.Kernel,G=b.not,I=b.rb_plus,K=b.eqeq,M=b.Object,t=b.ensure_kwargs,J=b.send2,P=b.find_super,R=b.module,W=[],N=b.nil,H=b.$$$;b.add_stubs("new,map,backtrace,clone,to_s,merge,tty?,[],include?,raise,dup,empty?,!,caller,shift,+,class,join,cause,full_message,==,reverse,split,autoload,attr_reader,inspect");(function(t,$super,a){function k(a){for(var c=[],f,b=0;b<a.length;b++){var d=
|
|
152
|
-
a[b];d&&d.$$is_string&&((f=d.match(/^ at (.*?) \((.*?)\)$/))?c.push(f[2]+":in `"+f[1]+"'"):(f=d.match(/^ at (.*?)$/))?c.push(f[1]+":in `undefined'"):(f=d.match(/^ from (.*?)$/))?c.push(f[1]):(f=d.match(/^(.*?)@(.*?)$/))&&c.push(f[2]+":in `"+f[1]+"'"))}return c}t=n(t,$super,"Exception");a=[t].concat(a);var d=b.$r(a);t.$$prototype.message=N;b.prop(t.$$prototype,"$$is_exception",!0);Error.stackTraceLimit=100;q(t,"$new",function(a){null==D["!"]&&(D["!"]=N);var c=x(arguments);var d=0<c.length?c[0]:
|
|
153
|
-
N,h=new this.$$constructor(d);h.name=this.$$name;h.message=d;h.cause=D["!"];b.send(h,h.$initialize,c);b.config.enable_stack_trace&&Error.captureStackTrace&&Error.captureStackTrace(h,f);return h},-1);var f=t.$new;q(t,"$exception",function(a){var c=x(arguments);return E(this,"new",B(c))},-1);A(t,"$initialize",function(a){var c=x(arguments);return this.message=0<c.length?c[0]:N},-1);A(t,"$backtrace",function(){if(this.backtrace)return this.backtrace;var a=this.stack;return"undefined"!==typeof a&&a.$$is_string?
|
|
154
|
-
this.backtrace=k(a.split("\n")):a?this.backtrace=k(a):[]});A(t,"$backtrace_locations",function(){var a;return this.backtrace_locations?this.backtrace_locations:this.backtrace_locations=(a=this.$backtrace(),a===N||null==a?N:E(a,"map",[],function(a){null==a&&(a=N);return H(H(H("Thread"),"Backtrace"),"Location").$new(a)}))});A(t,"$cause",function(){return this.cause||N});A(t,"$exception",function(a){null==a&&(a=N);if(a===N||this===a)return this;var c=this.$clone();c.message=a;this.backtrace&&(c.backtrace=
|
|
155
|
-
this.backtrace.$dup());c.stack=this.stack;c.cause=this.cause;return c},-1);A(t,"$message",function(){return this.$to_s()});A(t,"$full_message",function(a){var c=N,f=N,b=N,g=N,l=N,e=N,h=N,S=N;g=N;null==D.stderr&&(D.stderr=N);null==a&&(a=N);if(!z(d("Hash","skip_raise")?"constant":N))return""+this.message+"\n"+this.stack;a=m(["highlight","order"],{highlight:D.stderr["$tty?"](),order:"top"}).$merge(z(c=a)?c:m([],{}));a=[a["$[]"]("highlight"),a["$[]"]("order")];f=a[0];b=a[1];a;z([!0,!1]["$include?"](f))||
|
|
156
|
-
v.$raise(H("ArgumentError"),"expected true or false as highlight: "+f);z(["top","bottom"]["$include?"](b))||v.$raise(H("ArgumentError"),"expected :top or :bottom as order: "+b);z(f)?(g="\u001b[1;4m",l="\u001b[1m",e="\u001b[m"):g=l=e="";h=this.$backtrace().$dup();if(G(h)||z(h["$empty?"]()))h=this.$caller();S=h.$shift();g=I(""+S+": ",""+l+this.$to_s()+" ("+g+this.$class()+e+l+")"+e+"\n");g=I(g,E(h,"map",[],function(a){null==a&&(a=N);return"\tfrom "+a+"\n"}).$join());z(this.$cause())&&(g=I(g,this.$cause().$full_message(m(["highlight"],
|
|
157
|
-
{highlight:f}))));K(b,"bottom")&&(g=g.$split("\n").$reverse().$join("\n"),g=I(""+l+"Traceback"+e+" (most recent call last):\n",g));return g},-1);A(t,"$inspect",function(){var a=this.$to_s();return z(a["$empty?"]())?this.$class().$to_s():"#<"+this.$class().$to_s()+": "+this.$to_s()+">"});A(t,"$set_backtrace",function(a){var c=!0,f;if(a===N)this.backtrace=N,this.stack="";else if(a.$$is_string)this.backtrace=[a],this.stack=" from "+a;else{if(a.$$is_array){var b=0;for(f=a.length;b<f;b++)if(!a[b].$$is_string){c=
|
|
158
|
-
!1;break}}else c=!1;!1===c&&v.$raise(H("TypeError"),"backtrace must be Array of String");this.backtrace=a;this.stack=E(a,"map",[],function(a){null==a&&(a=N);return I(" from ",a)}).join("\n")}return a});return A(t,"$to_s",function(){var a,c=N;return z(a=z(c=this.message)?this.message.$to_s():c)?a:this.$class().$to_s()})})("::",Error,W);n("::",H("Exception"),"ScriptError");n("::",H("ScriptError"),"SyntaxError");n("::",H("ScriptError"),"LoadError");n("::",H("ScriptError"),"NotImplementedError");n("::",
|
|
159
|
-
H("Exception"),"SystemExit");n("::",H("Exception"),"NoMemoryError");n("::",H("Exception"),"SignalException");n("::",H("SignalException"),"Interrupt");n("::",H("Exception"),"SecurityError");n("::",H("Exception"),"SystemStackError");n("::",H("Exception"),"StandardError");n("::",H("StandardError"),"EncodingError");n("::",H("StandardError"),"ZeroDivisionError");n("::",H("StandardError"),"NameError");n("::",H("NameError"),"NoMethodError");n("::",H("StandardError"),"RuntimeError");n("::",H("RuntimeError"),
|
|
160
|
-
"FrozenError");n("::",H("StandardError"),"LocalJumpError");n("::",H("StandardError"),"TypeError");n("::",H("StandardError"),"ArgumentError");n("::",H("ArgumentError"),"UncaughtThrowError");n("::",H("StandardError"),"IndexError");n("::",H("IndexError"),"StopIteration");n("::",H("StopIteration"),"ClosedQueueError");n("::",H("IndexError"),"KeyError");n("::",H("StandardError"),"RangeError");n("::",H("RangeError"),"FloatDomainError");n("::",H("StandardError"),"IOError");n("::",H("IOError"),"EOFError");
|
|
161
|
-
n("::",H("StandardError"),"SystemCallError");n("::",H("StandardError"),"RegexpError");n("::",H("StandardError"),"ThreadError");n("::",H("StandardError"),"FiberError");M.$autoload("Errno","corelib/error/errno");(function(b,$super){b=n(b,$super,"FrozenError");b.$attr_reader("receiver");return A(b,"$initialize",function f(b,d){f.$$p=null;d=t(d);d=d.$$smap.receiver;null==d&&(d=N);J(this,P(this,"initialize",f,!1,!0),"initialize",[b],null);return this.receiver=d},-2)})("::",H("RuntimeError"));(function(b,
|
|
162
|
-
$super){b=n(b,$super,"UncaughtThrowError");b.$$prototype.tag=N;b.$attr_reader("tag","value");return A(b,"$initialize",function f(b,d){f.$$p=null;null==d&&(d=N);this.tag=b;this.value=d;return J(this,P(this,"initialize",f,!1,!0),"initialize",["uncaught throw "+this.tag.$inspect()],null)},-2)})("::",H("ArgumentError"));(function(b,$super){b=n(b,$super,"NameError");b.$attr_reader("name");return A(b,"$initialize",function f(b,d){f.$$p=null;null==d&&(d=N);J(this,P(this,"initialize",f,!1,!0),"initialize",
|
|
163
|
-
[b],null);return this.name=d},-2)})("::",null);(function(b,$super){b=n(b,$super,"NoMethodError");b.$attr_reader("args");return A(b,"$initialize",function h(b,d,f){h.$$p=null;null==d&&(d=N);null==f&&(f=[]);J(this,P(this,"initialize",h,!1,!0),"initialize",[b,d],null);return this.args=f},-2)})("::",null);n("::",null,"StopIteration").$attr_reader("result");(function(b,$super){b=n(b,$super,"KeyError");var a=b.$$prototype;a.receiver=a.key=N;A(b,"$initialize",function h(a,f){h.$$p=null;f=t(f);var c=f.$$smap.receiver;
|
|
164
|
-
null==c&&(c=N);f=f.$$smap.key;null==f&&(f=N);J(this,P(this,"initialize",h,!1,!0),"initialize",[a],null);this.receiver=c;return this.key=f},-2);A(b,"$receiver",function(){var a;return z(a=this.receiver)?a:v.$raise(H("ArgumentError"),"no receiver is available")});return A(b,"$key",function(){var a;return z(a=this.key)?a:v.$raise(H("ArgumentError"),"no key is available")})})("::",null);return function(b,m){b=[R(b,"JS")].concat(m);return n(b[0],null,"Error"),N}("::",W)};
|
|
165
|
-
Opal.modules["corelib/constants"]=function(b){var n=b.const_set;b=b.$$$;n("::","RUBY_PLATFORM","opal");n("::","RUBY_ENGINE","opal");n("::","RUBY_VERSION","3.2.0");n("::","RUBY_ENGINE_VERSION","1.7.3");n("::","RUBY_RELEASE_DATE","2023-03-23");n("::","RUBY_PATCHLEVEL",0);n("::","RUBY_REVISION","0");n("::","RUBY_COPYRIGHT","opal - Copyright (C) 2011-2023 Adam Beynon and the Opal contributors");return n("::","RUBY_DESCRIPTION","opal "+b("RUBY_ENGINE_VERSION")+" ("+b("RUBY_RELEASE_DATE")+" revision "+
|
|
166
|
-
b("RUBY_REVISION")+")")};Opal.modules["opal/base"]=function(b){var n=b.Object;b.add_stubs("require");n.$require("corelib/runtime");n.$require("corelib/helpers");n.$require("corelib/module");n.$require("corelib/class");n.$require("corelib/basic_object");n.$require("corelib/kernel");n.$require("corelib/main");n.$require("corelib/error");return n.$require("corelib/constants")};
|
|
167
|
-
Opal.modules["corelib/nil"]=function(b){var n=b.klass,x=b.Kernel,D=b.def,q=b.return_val,E=b.ensure_kwargs,B=b.NilClass,A=b.slice,z=b.truthy,m=b.rb_gt,v=b.alias,G=b.nil,I=b.$$$;b.add_stubs("raise,name,new,>,length,Rational,to_i");return function(K,$super,t){K=n(K,$super,"NilClass");t=[K].concat(t);K.$$prototype.$$meta=K;(function(m,n){D(m,"$allocate",function(){return x.$raise(I("TypeError"),"allocator undefined for "+this.$name())});b.udef(m,"$new");return G})(b.get_singleton_class(K),t);D(K,"$!",
|
|
168
|
-
q(!0));D(K,"$&",q(!1));D(K,"$|",function(b){return!1!==b&&b!==G});D(K,"$^",function(b){return!1!==b&&b!==G});D(K,"$==",function(b){return b===G});D(K,"$dup",q(G));D(K,"$clone",function(b){E(b);return G},-1);D(K,"$inspect",q("nil"));D(K,"$nil?",q(!0));D(K,"$singleton_class",function(){return B});D(K,"$to_a",function(){return[]});D(K,"$to_h",function(){return b.hash()});D(K,"$to_i",q(0));D(K,"$to_s",q(""));D(K,"$to_c",function(){return I("Complex").$new(0,0)});D(K,"$rationalize",function(b){var n=A(arguments);
|
|
169
|
-
z(m(n.$length(),1))&&x.$raise(I("ArgumentError"));return x.$Rational(0,1)},-1);D(K,"$to_r",function(){return x.$Rational(0,1)});D(K,"$instance_variables",function(){return[]});return v(K,"to_f","to_i")}("::",null,[])};
|
|
170
|
-
Opal.modules["corelib/boolean"]=function(b){var n=b.klass,x=b.Kernel,D=b.def,q=b.return_self,E=b.ensure_kwargs,B=b.slice,A=b.truthy,z=b.send2,m=b.find_super,v=b.to_a,G=b.alias,I=b.nil,K=b.$$$;b.add_stubs("raise,name,==,to_s,__id__");(function(M,$super,J){M=n(M,$super,"Boolean");J=[M].concat(J);b.prop(M.$$prototype,"$$is_boolean",!0);for(var P=["$$class","$$meta"],R=0;R<P.length;R++)Object.defineProperty(M.$$prototype,P[R],{configurable:!0,enumerable:!1,get:function(){return 1==this?b.TrueClass:0==
|
|
171
|
-
this?b.FalseClass:b.Boolean}});Object.defineProperty(M.$$prototype,"$$id",{configurable:!0,enumerable:!1,get:function(){return 1==this?2:0==this?0:I}});(function(m,n){D(m,"$allocate",function(){return x.$raise(K("TypeError"),"allocator undefined for "+this.$name())});b.udef(m,"$new");return I})(b.get_singleton_class(M),J);D(M,"$__id__",function(){return this.valueOf()?2:0});D(M,"$!",function(){return 1!=this});D(M,"$&",function(b){return 1==this?!1!==b&&b!==I:!1});D(M,"$|",function(b){return 1==this?
|
|
172
|
-
!0:!1!==b&&b!==I});D(M,"$^",function(b){return 1==this?!1===b||b===I:!1!==b&&b!==I});D(M,"$==",function(b){return 1==this===b.valueOf()});D(M,"$singleton_class",function(){return this.$$meta});D(M,"$to_s",function(){return 1==this?"true":"false"});D(M,"$dup",q);D(M,"$clone",function(b){E(b);return this},-1);D(M,"$method_missing",function L(n,q){var x=L.$$p||I;L.$$p=null;var a=B(arguments,1);var k=this.$$class.$$prototype[b.jsid(n)];A("undefined"!==typeof k&&!k.$$stub)||z(this,m(this,"method_missing",
|
|
173
|
-
L,!1,!0),"method_missing",[n].concat(v(a)),x);return b.send(this,k,a,x)},-2);D(M,"$respond_to_missing?",function(m,n){m=this.$$class.$$prototype[b.jsid(m)];return"undefined"!==typeof m&&!m.$$stub},-2);G(M,"eql?","==");G(M,"equal?","==");G(M,"inspect","to_s");return G(M,"object_id","__id__")})("::",Boolean,[]);n("::",K("Boolean"),"TrueClass");return n("::",K("Boolean"),"FalseClass"),I};
|
|
174
|
-
Opal.modules["corelib/comparable"]=function(b){var n=b.truthy,x=b.module,D=b.rb_gt,q=b.rb_lt,E=b.eqeqeq,B=b.Kernel,A=b.def,z=b.nil,m=b.$$$;b.add_stubs(">,<,===,raise,class,<=>,equal?");return function(v){function G(m){return b.is_a(m,b.Integer)?m:D(m,0)?1:q(m,0)?-1:0}function I(b,t){var q=b["$<=>"](t);if(!n(q)){var v;E(z,K=t)||E(!0,K)||E(!1,K)||E(m("Integer"),K)||E(m("Float"),K)?v=t.$inspect():v=t.$$class;B.$raise(m("ArgumentError"),"comparison of "+b.$class()+" with "+v+" failed")}return G(q)}v=
|
|
175
|
-
x(v,"Comparable");var K=z;A(v,"$==",function(m){var t;return n(this["$equal?"](m))?!0:this["$<=>"]==b.Kernel["$<=>"]?!1:this.$$comparable?this.$$comparable=!1:n(t=this["$<=>"](m))?0==G(t):!1});A(v,"$>",function(b){return 0<I(this,b)});A(v,"$>=",function(b){return 0<=I(this,b)});A(v,"$<",function(b){return 0>I(this,b)});A(v,"$<=",function(b){return 0>=I(this,b)});A(v,"$between?",function(b,m){return q(this,b)||D(this,m)?!1:!0});return A(v,"$clamp",function(n,t){null==t&&(t=z);if(t===z){b.is_a(n,b.Range)||
|
|
176
|
-
B.$raise(m("TypeError"),"wrong argument type "+n.$class()+" (expected Range)");var q=n.excl;t=n.end;n=n.begin;t!==z&&q&&B.$raise(m("ArgumentError"),"cannot clamp with an exclusive range")}n!==z&&t!==z&&0<I(n,t)&&B.$raise(m("ArgumentError"),"min argument must be smaller than max argument");if(n!==z){q=I(this,n);if(0==q)return this;if(0>q)return n}return t!==z&&(q=I(this,t),0<q)?t:this},-2)}("::")};
|
|
177
|
-
Opal.modules["corelib/regexp"]=function(b){var n=b.coerce_to,x=b.prop,D=b.freeze,q=b.klass,E=b.const_set,B=b.send2,A=b.find_super,z=b.def,m=b.truthy,v=b.gvars,G=b.slice,I=b.Kernel,K=b.Opal,M=b.alias,t=b.send,J=b.hash2,P=b.rb_plus,R=b.ensure_kwargs,W=b.rb_ge,N=b.to_a,H=b.eqeqeq,L=b.rb_minus,U=b.return_ivar,a=[],k=b.nil,d=b.$$$;b.add_stubs("nil?,[],raise,escape,options,to_str,new,join,coerce_to!,!,match,coerce_to?,begin,frozen?,uniq,map,scan,source,to_proc,transform_values,group_by,each_with_index,+,last,=~,==,attr_reader,>=,length,is_a?,include?,names,regexp,named_captures,===,captures,-,inspect,empty?,each,to_a");
|
|
178
|
-
q("::",d("StandardError"),"RegexpError");(function(a,$super,c){a=q(a,$super,"Regexp");c=[a].concat(c);var f=b.$r(c);E(a,"IGNORECASE",1);E(a,"EXTENDED",2);E(a,"MULTILINE",4);b.prop(a.$$prototype,"$$is_regexp",!0);(function(a,c){c=[a].concat(c);var f=b.$r(c);z(a,"$allocate",function ha(){var a=ha.$$p||k;ha.$$p=null;a=B(this,A(this,"allocate",ha,!1,!0),"allocate",[],a);a.uninitialized=!0;return a});z(a,"$escape",function(a){return b.escape_regexp(a)});z(a,"$last_match",function(a){null==v["~"]&&(v["~"]=
|
|
179
|
-
k);null==a&&(a=k);return m(a["$nil?"]())?v["~"]:m(v["~"])?v["~"]["$[]"](a):k},-1);z(a,"$union",function(a){var c=G(arguments);if(0==c.length)return/(?!)/;if(1==c.length&&c[0].$$is_regexp)return c[0];var b=c[0].$$is_array;1<c.length&&b&&I.$raise(d("TypeError"),"no implicit conversion of Array into String");b&&(c=c[0]);var f=void 0;b=[];for(var l=0;l<c.length;l++){var g=c[l];if(g.$$is_string)b.push(this.$escape(g));else if(g.$$is_regexp){var p=g.$options();void 0!=f&&f!=p&&I.$raise(d("TypeError"),"All expressions must use the same options");
|
|
180
|
-
f=p;b.push("("+g.source+")")}else b.push(this.$escape(g.$to_str()))}return this.$new(b.$join("|"),f)},-1);z(a,"$new",function(a,c){if(a.$$is_regexp)return new RegExp(a);a=K["$coerce_to!"](a,d("String"),"to_str");"\\"===a.charAt(a.length-1)&&"\\"!==a.charAt(a.length-2)&&I.$raise(d("RegexpError"),"too short escape sequence: /"+a+"/");a=a.replace("\\A","^").replace("\\z","$");if(void 0===c||c["$!"]())return new RegExp(a);if(c.$$is_number){var b="";f("IGNORECASE")&c&&(b+="i");f("MULTILINE")&c&&(b+="m");
|
|
181
|
-
c=b}else c="i";return new RegExp(a,c)},-2);M(a,"compile","new");return M(a,"quote","escape")})(b.get_singleton_class(a),c);z(a,"$==",function(a){return a instanceof RegExp&&this.toString()===a.toString()});z(a,"$===",function(a){return this.$match(K["$coerce_to?"](a,d("String"),"to_str"))!==k});z(a,"$=~",function(a){var c;null==v["~"]&&(v["~"]=k);return m(c=this.$match(a))?v["~"].$begin(0):c});z(a,"$freeze",function(){if(m(this["$frozen?"]()))return this;this.hasOwnProperty("$$g")||x(this,"$$g",null);
|
|
182
|
-
this.hasOwnProperty("$$gm")||x(this,"$$gm",null);return D(this)});z(a,"$inspect",function(){var a=this.toString(),c=/^\/(.*)\/([^\/]*)$/.exec(a);if(c){a=c[2];c=c[1].split("");for(var b=c.length,e=!1,f="",d=0;d<b;d++){var p=c[d];e||"/"!=p||(f=f.concat("\\"));f=f.concat(p);e="\\"==p?e?!1:!0:!1}return"/"+f+"/"+a}return a});z(a,"$match",function e(a,c){var f=e.$$p||k;null==v["~"]&&(v["~"]=k);e.$$p=null;this.uninitialized&&I.$raise(d("TypeError"),"uninitialized Regexp");if(void 0===c)return a===k?v["~"]=
|
|
183
|
-
k:(a=this.exec(n(a,d("String"),"to_str")))?(v["~"]=d("MatchData").$new(this,a),f===k?v["~"]:b.yield1(f,v["~"])):v["~"]=k;c=n(c,d("Integer"),"to_int");if(a===k)return v["~"]=k;a=n(a,d("String"),"to_str");if(0>c&&(c+=a.length,0>c))return v["~"]=k;for(var l,g=b.global_regexp(this);;){l=g.exec(a);if(null===l)return v["~"]=k;if(l.index>=c)return v["~"]=d("MatchData").$new(g,l),f===k?v["~"]:b.yield1(f,v["~"]);g.lastIndex=l.index+1}},-2);z(a,"$match?",function(a,c){this.uninitialized&&I.$raise(d("TypeError"),
|
|
184
|
-
"uninitialized Regexp");if(void 0===c)return a===k?!1:this.test(n(a,d("String"),"to_str"));c=n(c,d("Integer"),"to_int");if(a===k)return!1;a=n(a,d("String"),"to_str");if(0>c&&(c+=a.length,0>c))return!1;a=b.global_regexp(this).exec(a);return null===a||a.index<c?!1:!0},-2);z(a,"$names",function(){return t(this.$source().$scan(/\(?<(\w+)>/,J(["no_matchdata"],{no_matchdata:!0})),"map",[],"first".$to_proc()).$uniq()});z(a,"$named_captures",function(){return t(t(t(this.$source().$scan(/\(?<(\w+)>/,J(["no_matchdata"],
|
|
185
|
-
{no_matchdata:!0})),"map",[],"first".$to_proc()).$each_with_index(),"group_by",[],"first".$to_proc()),"transform_values",[],function(a){null==a&&(a=k);return t(a,"map",[],function(a){null==a&&(a=k);return P(a.$last(),1)})})});z(a,"$~",function(){null==v._&&(v._=k);return this["$=~"](v._)});z(a,"$source",function(){return this.source});z(a,"$options",function(){this.uninitialized&&I.$raise(d("TypeError"),"uninitialized Regexp");var a=0;this.multiline&&(a|=f("MULTILINE"));this.ignoreCase&&(a|=f("IGNORECASE"));
|
|
186
|
-
return a});z(a,"$casefold?",function(){return this.ignoreCase});M(a,"eql?","==");return M(a,"to_s","source")})("::",RegExp,a);return function(a,$super,c){a=q(a,$super,"MatchData");c=[a].concat(c);var f=b.$r(c);a.$$prototype.matches=k;a.$attr_reader("post_match","pre_match","regexp","string");z(a,"$initialize",function(a,c,b){b=R(b);b=b.$$smap.no_matchdata;null==b&&(b=!1);m(b)||(v["~"]=this);this.regexp=a;this.begin=c.index;this.string=c.input;this.pre_match=c.input.slice(0,c.index);this.post_match=
|
|
187
|
-
c.input.slice(c.index+c[0].length);this.matches=[];a=0;for(b=c.length;a<b;a++){var e=c[a];null==e?this.matches.push(k):this.matches.push(e)}},-3);z(a,"$match",function(a){var c;return m(c=this["$[]"](a))?c:m(a["$is_a?"](f("Integer")))&&m(W(a,this.$length()))?I.$raise(d("IndexError"),"index "+a+" out of matches"):k});z(a,"$match_length",function(a){var c;return c=this.$match(a),c===k||null==c?k:c.$length()});z(a,"$[]",function(a){var c=G(arguments);return c[0].$$is_string?(this.$regexp().$names()["$include?"](c["$[]"](0))["$!"]()&&
|
|
188
|
-
I.$raise(d("IndexError"),"undefined group name reference: "+c["$[]"](0)),this.$named_captures()["$[]"](c["$[]"](0))):t(this.matches,"[]",N(c))},-1);z(a,"$offset",function(a){0!==a&&I.$raise(d("ArgumentError"),"MatchData#offset only supports 0th element");return[this.begin,this.begin+this.matches[a].length]});z(a,"$==",function(a){var c,b=k,e=k,f=k;return H(d("MatchData"),a)?m(c=m(b=m(e=m(f=this.string==a.string)?this.regexp.toString()==a.regexp.toString():f)?this.pre_match==a.pre_match:e)?this.post_match==
|
|
189
|
-
a.post_match:b)?this.begin==a.begin:c:!1});z(a,"$begin",function(a){0!==a&&I.$raise(d("ArgumentError"),"MatchData#begin only supports 0th element");return this.begin});z(a,"$end",function(a){0!==a&&I.$raise(d("ArgumentError"),"MatchData#end only supports 0th element");return this.begin+this.matches[a].length});z(a,"$captures",function(){return this.matches.slice(1)});z(a,"$named_captures",function(){var a=k;a=this.$captures();return t(this.$regexp().$named_captures(),"transform_values",[],function(c){null==
|
|
190
|
-
c&&(c=k);return a["$[]"](L(c.$last(),1))})});z(a,"$names",function(){return this.$regexp().$names()});z(a,"$inspect",function(){var a="#<MatchData "+this.matches[0].$inspect();if(this.$regexp().$names()["$empty?"]())for(var c=1,b=this.matches.length;c<b;c++)a+=" "+c+":"+this.matches[c].$inspect();else t(this.$named_captures(),"each",[],function(c,b){null==c&&(c=k);null==b&&(b=k);return a+=" "+c+":"+b.$inspect()});return a+">"});z(a,"$length",function(){return this.matches.length});z(a,"$to_a",U("matches"));
|
|
191
|
-
z(a,"$to_s",function(){return this.matches[0]});z(a,"$values_at",function(a){var c=G(arguments);var b,e=[];for(b=0;b<c.length;b++){if(c[b].$$is_range){var f=c[b].$to_a();f.unshift(b,1);Array.prototype.splice.apply(c,f)}f=K["$coerce_to!"](c[b],d("Integer"),"to_int");if(0>f&&(f+=this.matches.length,0>f)){e.push(k);continue}e.push(this.matches[f])}return e},-1);M(a,"eql?","==");return M(a,"size","length")}(a[0],null,a)};
|
|
192
|
-
Opal.modules["corelib/string"]=function(b){var n=b.coerce_to,x=b.respond_to,D=b.global_multiline_regexp,q=b.prop,E=b.klass,B=b.def,A=b.Opal,z=b.defs,m=b.slice,v=b.send,G=b.to_a,I=b.extract_kwargs,K=b.ensure_kwargs,M=b.eqeqeq,t=b.Kernel,J=b.truthy,P=b.gvars,R=b.rb_divide,W=b.rb_plus,N=b.eqeq,H=b.hash2,L=b.alias,U=b.const_set,a=b.top,k=[],d=b.$r(k),f=b.nil,h=b.$$$;b.add_stubs("require,include,coerce_to?,initialize,===,format,raise,respond_to?,to_s,to_str,<=>,==,=~,new,force_encoding,casecmp,empty?,ljust,ceil,/,+,rjust,floor,coerce_to!,nil?,class,copy_singleton_methods,initialize_clone,initialize_dup,enum_for,chomp,[],to_i,length,each_line,to_proc,to_a,match,match?,captures,proc,succ,escape,include?,upcase,unicode_normalize,dup,__id__,next,intern,pristine");
|
|
193
|
-
a.$require("corelib/comparable");a.$require("corelib/regexp");(function(a,$super,d){function c(a){function c(a){var c="",e,b=a.length;for(e=0;e<b;e++){var f=a.charAt(e);if("-"===f&&0<e&&e<b-1&&!d){var d=a.charCodeAt(e-1);f=a.charCodeAt(e+1);d>f&&t.$raise(h("ArgumentError"),'invalid range "'+d+"-"+f+'" in string transliteration');for(d+=1;d<f+1;d++)c+=String.fromCharCode(d);d=!0;e++}else d="\\"===f,c+=f}return c}function e(a,c){if(0===a.length)return c;var e="",b,f=a.length;for(b=0;b<f;b++){var d=
|
|
194
|
-
a.charAt(b);-1!==c.indexOf(d)&&(e+=d)}return e}var b,f="",d="";var l=0;for(b=a.length;l<b;l++){var g=n(a[l],h("String"),"to_str");var k="^"===g.charAt(0)&&1<g.length;g=c(k?g.slice(1):g);k?d=e(d,g):f=e(f,g)}if(0<f.length&&0<d.length){g="";l=0;for(b=f.length;l<b;l++)a=f.charAt(l),-1===d.indexOf(a)&&(g+=a);f=g;d=""}return 0<f.length?"["+h("Regexp").$escape(f)+"]":0<d.length?"[^"+h("Regexp").$escape(d)+"]":null}a=E(a,$super,"String");d=[a].concat(d);var l=b.$r(d);a.$include(h("Comparable"));b.prop(a.$$prototype,
|
|
195
|
-
"$$is_string",!0);B(a,"$__id__",function(){return this.toString()});z(a,"$try_convert",function(a){return A["$coerce_to?"](a,h("String"),"to_str")});z(a,"$new",function(a){var c=m(arguments);var e=c[0]||"",b=c[c.length-1];e=n(e,h("String"),"to_str");b&&b.$$is_hash&&b.$$smap.encoding&&(e=e.$force_encoding(b.$$smap.encoding));e=new this.$$constructor(e);e.$initialize.$$pristine||v(e,"initialize",G(c));return e},-1);B(a,"$initialize",function(a,c){var e=m(arguments);var b=I(e);K(b);0<e.length&&e.shift();
|
|
196
|
-
return f},-1);B(a,"$%",function(a){return M(h("Array"),a)?v(this,"format",[this].concat(G(a))):this.$format(this,a)});B(a,"$*",function(a){a=n(a,h("Integer"),"to_int");0>a&&t.$raise(h("ArgumentError"),"negative argument");if(0===a)return"";var c="",e=this.toString();for(268435456<=e.length*a&&t.$raise(h("RangeError"),"multiply count must not overflow maximum string size");;){1===(a&1)&&(c+=e);a>>>=1;if(0===a)break;e+=e}return c});B(a,"$+",function(a){a=n(a,h("String"),"to_str");if(""==a&&this.$$class===
|
|
197
|
-
b.String)return this;if(""==this&&a.$$class===b.String)return a;var c=this+a;return this.encoding===c.encoding&&a.encoding===c.encoding||"UTF-8"===this.encoding.name||"UTF-8"===a.encoding.name?c:b.enc(c,this.encoding)});B(a,"$<=>",function(a){if(J(a["$respond_to?"]("to_str")))return a=a.$to_str().$to_s(),this>a?1:this<a?-1:0;a=a["$<=>"](this);return a===f?f:0<a?-1:0>a?1:0});B(a,"$==",function(a){return a.$$is_string?this.toString()===a.toString():x(a,"$to_str")?a["$=="](this):!1});B(a,"$=~",function(a){a.$$is_string&&
|
|
198
|
-
t.$raise(h("TypeError"),"type mismatch: String given");return a["$=~"](this)});B(a,"$[]",function(a,c){var e=this.length;if(a.$$is_range){var b=a.excl;var d=a;c=a.end===f?-1:n(a.end,h("Integer"),"to_int");a=a.begin===f?0:n(a.begin,h("Integer"),"to_int");if(Math.abs(a)>e)return f;0>a&&(a+=e);0>c&&(c+=e);b&&d.end!==f||(c+=1);c-=a;0>c&&(c=0);return this.substr(a,c)}if(a.$$is_string)return null!=c&&t.$raise(h("TypeError")),-1!==this.indexOf(a)?a:f;if(a.$$is_regexp){e=this.match(a);if(null===e)return P["~"]=
|
|
199
|
-
f;P["~"]=h("MatchData").$new(a,e);if(null==c)return e[0];c=n(c,h("Integer"),"to_int");return 0>c&&-c<e.length?e[c+e.length]:0<=c&&c<e.length?e[c]:f}a=n(a,h("Integer"),"to_int");0>a&&(a+=e);if(null==c)return a>=e||0>a?f:this.substr(a,1);c=n(c,h("Integer"),"to_int");return 0>c||a>e||0>a?f:this.substr(a,c)},-2);B(a,"$b",function(){return(new String(this)).$force_encoding("binary")});B(a,"$capitalize",function(){return this.charAt(0).toUpperCase()+this.substr(1).toLowerCase()});B(a,"$casecmp",function(a){var c=
|
|
200
|
-
this;if(!J(a["$respond_to?"]("to_str")))return f;a=n(a,h("String"),"to_str").$to_s();var e=/^[\x00-\x7F]*$/;e.test(c)&&e.test(a)&&(c=c.toLowerCase(),a=a.toLowerCase());return c["$<=>"](a)});B(a,"$casecmp?",function(a){a=this.$casecmp(a);return a===f?f:0===a});B(a,"$center",function(a,c){null==c&&(c=" ");a=n(a,h("Integer"),"to_int");c=n(c,h("String"),"to_str").$to_s();J(c["$empty?"]())&&t.$raise(h("ArgumentError"),"zero width padding");if(J(a<=this.length))return this;var e=this.$ljust(R(W(a,this.length),
|
|
201
|
-
2).$ceil(),c);return this.$rjust(R(W(a,this.length),2).$floor(),c)+e.slice(this.length)},-2);B(a,"$chomp",function(a){null==P["/"]&&(P["/"]=f);null==a&&(a=P["/"]);if(J(a===f||0===this.length))return this;a=A["$coerce_to!"](a,h("String"),"to_str").$to_s();var c;"\n"===a?c=this.replace(/\r?\n?$/,""):""===a?c=this.replace(/(\r?\n)+$/,""):this.length>=a.length&&this.substr(this.length-a.length,a.length)===a&&(c=this.substr(0,this.length-a.length));return null!=c?c:this},-1);B(a,"$chop",function(){var a=
|
|
202
|
-
this.length;return 1>=a?"":"\n"===this.charAt(a-1)&&"\r"===this.charAt(a-2)?this.substr(0,a-2):this.substr(0,a-1)});B(a,"$chr",function(){return this.charAt(0)});B(a,"$clone",function(a){a=K(a);a=a.$$smap.freeze;null==a&&(a=f);J(a["$nil?"]())||N(a,!0)||N(a,!1)||this.$raise(l("ArgumentError"),"unexpected value for freeze: "+a.$class());var c=new String(this);c.$copy_singleton_methods(this);c.$initialize_clone(this,H(["freeze"],{freeze:a}));N(a,!0)?c.$$frozen||(c.$$frozen=!0):J(a["$nil?"]())&&this.$$frozen&&
|
|
203
|
-
(c.$$frozen=!0);return c},-1);B(a,"$dup",function(){var a=new String(this);a.$initialize_dup(this);return a});B(a,"$count",function(a){var e=m(arguments);0===e.length&&t.$raise(h("ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");e=c(e);return null===e?0:this.length-this.replace(new RegExp(e,"g"),"").length},-1);B(a,"$delete",function(a){var e=m(arguments);0===e.length&&t.$raise(h("ArgumentError"),"ArgumentError: wrong number of arguments (0 for 1+)");e=c(e);return null===e?this:
|
|
204
|
-
this.replace(new RegExp(e,"g"),"")},-1);B(a,"$delete_prefix",function(a){a.$$is_string||(a=n(a,h("String"),"to_str"));return this.slice(0,a.length)===a?this.slice(a.length):this});B(a,"$delete_suffix",function(a){a.$$is_string||(a=n(a,h("String"),"to_str"));return this.slice(this.length-a.length)===a?this.slice(0,this.length-a.length):this});B(a,"$downcase",function(){return this.toLowerCase()});B(a,"$each_line",function y(a,c){var d=y.$$p||f,l;null==P["/"]&&(P["/"]=f);y.$$p=null;var g=m(arguments);
|
|
205
|
-
var S=I(g);S=K(S);0<g.length&&(l=g.shift());null==l&&(l=P["/"]);g=S.$$smap.chomp;null==g&&(g=!1);if(d===f)return this.$enum_for("each_line",l,H(["chomp"],{chomp:g}));if(l===f)return b.yield1(d,this),this;l=n(l,h("String"),"to_str");var ha,k;if(0===l.length){l=this.split(/((?:\r?\n){2})(?:(?:\r?\n)*)/);S=0;for(ha=l.length;S<ha;S+=2)if(l[S]||l[S+1]){var T=(l[S]||"")+(l[S+1]||"");g&&(T=T.$chomp("\n"));b.yield1(d,T)}return this}S=this.$chomp(l);ha=this.length!=S.length;var ka=S.split(l);S=0;for(k=ka.length;S<
|
|
206
|
-
k;S++){T=ka[S];if(S<k-1||ha)T+=l;g&&(T=T.$chomp(l));b.yield1(d,T)}return this},-1);B(a,"$empty?",function(){return 0===this.length});B(a,"$end_with?",function(a){var c=m(arguments);for(var b=0,f=c.length;b<f;b++){var d=n(c[b],h("String"),"to_str").$to_s();if(this.length>=d.length&&this.substr(this.length-d.length,d.length)==d)return!0}return!1},-1);B(a,"$gsub",function O(a,c){var b=O.$$p||f,d=this;O.$$p=null;if(void 0===c&&b===f)return d.$enum_for("gsub",a);var l="",g=f,y=0;a.$$is_regexp?a=D(a):(a=
|
|
207
|
-
n(a,h("String"),"to_str"),a=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(var S;;){var k=a.exec(d);if(null===k){P["~"]=f;l+=d.slice(y);break}g=h("MatchData").$new(a,k);if(void 0===c){S=a.lastIndex;var u=b(k[0]);a.lastIndex=S}else c.$$is_hash?u=c["$[]"](k[0]).$to_s():(c.$$is_string||(c=n(c,h("String"),"to_str")),u=c.replace(/([\\]+)([0-9+&`'])/g,function(a,c,b){if(0===c.length%2)return a;switch(b){case "+":for(a=k.length-1;0<a;a--)if(void 0!==k[a])return c.slice(1)+k[a];return"";case "&":return c.slice(1)+
|
|
208
|
-
k[0];case "`":return c.slice(1)+d.slice(0,k.index);case "'":return c.slice(1)+d.slice(k.index+k[0].length);default:return c.slice(1)+(k[b]||"")}}).replace(/\\\\/g,"\\"));a.lastIndex===k.index?(l+=d.slice(y,k.index)+u+(d[k.index]||""),a.lastIndex+=1):l+=d.slice(y,k.index)+u;y=a.lastIndex}P["~"]=g;return l},-2);B(a,"$hash",function(){return this.toString()});B(a,"$hex",function(){return this.$to_i(16)});B(a,"$include?",function(a){a.$$is_string||(a=n(a,h("String"),"to_str"));return-1!==this.indexOf(a)});
|
|
209
|
-
B(a,"$index",function(a,c){var b;if(void 0===c)c=0;else if(c=n(c,h("Integer"),"to_int"),0>c&&(c+=this.length,0>c))return f;if(a.$$is_regexp)for(b=D(a);;){a=b.exec(this);if(null===a){P["~"]=f;c=-1;break}if(a.index>=c){P["~"]=h("MatchData").$new(b,a);c=a.index;break}b.lastIndex=a.index+1}else a=n(a,h("String"),"to_str"),c=0===a.length&&c>this.length?-1:this.indexOf(a,c);return-1===c?f:c},-2);B(a,"$inspect",function(){var a=this,c={"\u0007":"\\a","\u001b":"\\e","\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f",
|
|
210
|
-
"\r":"\\r","\x0B":"\\v",'"':'\\"',"\\":"\\\\"};return'"'+a.replace(/[\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(b){if(c[b])return c[b];b=b.charCodeAt(0);return 255>=b&&(a.encoding["$binary?"]()||a.internal_encoding["$binary?"]())?"\\x"+("00"+b.toString(16).toUpperCase()).slice(-2):"\\u"+("0000"+b.toString(16).toUpperCase()).slice(-4)}).replace(/#[\$@\{]/g,"\\$&")+'"'});B(a,"$intern",function(){return this.toString()});
|
|
211
|
-
B(a,"$length",function(){return this.length});L(a,"size","length");B(a,"$lines",function F(a,c){var b=F.$$p||f,d;null==P["/"]&&(P["/"]=f);F.$$p=null;var l=m(arguments);var g=I(l);g=K(g);0<l.length&&(d=l.shift());null==d&&(d=P["/"]);l=g.$$smap.chomp;null==l&&(l=!1);d=v(this,"each_line",[d,H(["chomp"],{chomp:l})],b.$to_proc());return J(b)?this:d.$to_a()},-1);B(a,"$ljust",function(a,c){null==c&&(c=" ");a=n(a,h("Integer"),"to_int");c=n(c,h("String"),"to_str").$to_s();J(c["$empty?"]())&&t.$raise(h("ArgumentError"),
|
|
212
|
-
"zero width padding");if(J(a<=this.length))return this;var b=-1,f="";for(a-=this.length;++b<a;)f+=c;return this+f.slice(0,a)},-2);B(a,"$lstrip",function(){return this.replace(/^[\u0000\s]*/,"")});B(a,"$ascii_only?",function(){return this.encoding.ascii?/^[\x00-\x7F]*$/.test(this):!1});B(a,"$match",function Z(a,c){var b=Z.$$p||f;Z.$$p=null;if(M(l("String"),a)||J(a["$respond_to?"]("to_str")))a=h("Regexp").$new(a.$to_str());M(h("Regexp"),a)||t.$raise(h("TypeError"),"wrong argument type "+a.$class()+
|
|
213
|
-
" (expected Regexp)");return v(a,"match",[this,c],b.$to_proc())},-2);B(a,"$match?",function(a,c){if(M(l("String"),a)||J(a["$respond_to?"]("to_str")))a=h("Regexp").$new(a.$to_str());M(h("Regexp"),a)||t.$raise(h("TypeError"),"wrong argument type "+a.$class()+" (expected Regexp)");return a["$match?"](this,c)},-2);B(a,"$next",function(){var a=this.length;if(0===a)return"";for(var c=this,b=this.search(/[a-zA-Z0-9]/),f,d;a--;){d=this.charCodeAt(a);if(48<=d&&57>=d||65<=d&&90>=d||97<=d&&122>=d)switch(d){case 57:f=
|
|
214
|
-
!0;d=48;break;case 90:f=!0;d=65;break;case 122:f=!0;d=97;break;default:f=!1,d+=1}else-1===b?255===d?(f=!0,d=0):(f=!1,d+=1):f=!0;c=c.slice(0,a)+String.fromCharCode(d)+c.slice(a+1);if(f&&(0===a||a===b)){switch(d){case 65:break;case 97:break;default:d+=1}c=0===a?String.fromCharCode(d)+c:c.slice(0,a)+String.fromCharCode(d)+c.slice(a);f=!1}if(!f)break}return c});B(a,"$oct",function(){var a=this;var c=8;if(/^\s*_/.test(a))return 0;a=a.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i,function(a,b,f,d){switch(d.charAt(0)){case "+":case "-":return a;
|
|
215
|
-
case "0":if("x"===d.charAt(1)&&"0x"===f)return a}switch(f){case "0b":c=2;break;case "0":case "0o":c=8;break;case "0d":c=10;break;case "0x":c=16}return b+d});a=parseInt(a.replace(/_(?!_)/g,""),c);return isNaN(a)?0:a});B(a,"$ord",function(){return"function"===typeof this.codePointAt?this.codePointAt(0):this.charCodeAt(0)});B(a,"$partition",function(a){if(a.$$is_regexp){var c=a.exec(this);null===c?c=-1:(h("MatchData").$new(a,c),a=c[0],c=c.index)}else a=n(a,h("String"),"to_str"),c=this.indexOf(a);return-1===
|
|
216
|
-
c?[this,"",""]:[this.slice(0,c),this.slice(c,c+a.length),this.slice(c+a.length)]});B(a,"$reverse",function(){return this.split("").reverse().join("")});B(a,"$rindex",function(a,c){if(void 0===c)c=this.length;else if(c=n(c,h("Integer"),"to_int"),0>c&&(c+=this.length,0>c))return f;if(a.$$is_regexp){var b=null;for(a=D(a);;){var d=a.exec(this);if(null===d||d.index>c)break;b=d;a.lastIndex=b.index+1}null===b?(P["~"]=f,c=-1):(h("MatchData").$new(a,b),c=b.index)}else a=n(a,h("String"),"to_str"),c=this.lastIndexOf(a,
|
|
217
|
-
c);return-1===c?f:c},-2);B(a,"$rjust",function(a,c){null==c&&(c=" ");a=n(a,h("Integer"),"to_int");c=n(c,h("String"),"to_str").$to_s();J(c["$empty?"]())&&t.$raise(h("ArgumentError"),"zero width padding");if(J(a<=this.length))return this;a=Math.floor(a-this.length);var b=Array(Math.floor(a/c.length)+1).join(c);return b+c.slice(0,a-b.length)+this},-2);B(a,"$rpartition",function(a){var c;if(a.$$is_regexp){var b=null;for(c=D(a);;){var f=c.exec(this);if(null===f)break;b=f;c.lastIndex=b.index+1}null===b?
|
|
218
|
-
b=-1:(h("MatchData").$new(c,b),a=b[0],b=b.index)}else a=n(a,h("String"),"to_str"),b=this.lastIndexOf(a);return-1===b?["","",this]:[this.slice(0,b),this.slice(b,b+a.length),this.slice(b+a.length)]});B(a,"$rstrip",function(){return this.replace(/[\s\u0000]*$/,"")});B(a,"$scan",function la(a,c){var d=la.$$p||f;la.$$p=null;c=K(c);c=c.$$smap.no_matchdata;null==c&&(c=!1);var l=[],g=f,F;a.$$is_regexp?a=D(a):(a=n(a,h("String"),"to_str"),a=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));for(;null!=
|
|
219
|
-
(F=a.exec(this));)g=h("MatchData").$new(a,F,H(["no_matchdata"],{no_matchdata:c})),d===f?1==F.length?l.push(F[0]):l.push(g.$captures()):1==F.length?b.yield1(d,F[0]):b.yield1(d,g.$captures()),a.lastIndex===F.index&&(a.lastIndex+=1);c||(P["~"]=g);return d!==f?this:l},-2);B(a,"$singleton_class",function(){return b.get_singleton_class(this)});B(a,"$split",function(a,c){var b=f;null==P[";"]&&(P[";"]=f);if(0===this.length)return[];if(void 0===c)c=0;else if(c=A["$coerce_to!"](c,h("Integer"),"to_int"),1===
|
|
220
|
-
c)return[this];if(void 0===a||a===f)a=J(b=P[";"])?b:" ";var d=this.toString(),l=0,g;a.$$is_regexp?a=D(a):(a=n(a,h("String"),"to_str").$to_s()," "===a?(a=/\s+/gm,d=d.replace(/^\s+/,"")):a=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gm"));b=d.split(a);if(1===b.length&&b[0]===d)return[b[0]];for(;-1!==(g=b.indexOf(void 0));)b.splice(g,1);if(0===c){for(;""===b[b.length-1];)--b.length;return b}var F=a.exec(d);if(0>c){if(null!==F&&""===F[0]&&-1===a.source.indexOf("(?="))for(g=0,a=F.length;g<a;g++)b.push("");
|
|
221
|
-
return b}if(null!==F&&""===F[0])return b.splice(c-1,b.length-1,b.slice(c-1).join("")),b;if(c>=b.length)return b;for(g=0;null!==F;){g++;l=a.lastIndex;if(g+1===c)break;F=a.exec(d)}b.splice(c-1,b.length-1,d.slice(l));return b},-1);B(a,"$squeeze",function(a){var b=m(arguments);if(0===b.length)return this.replace(/(.)\1+/g,"$1");b=c(b);return null===b?this:this.replace(new RegExp("("+b+")\\1+","g"),"$1")},-1);B(a,"$start_with?",function(a){var c=m(arguments);for(var b=0,d=c.length;b<d;b++)if(c[b].$$is_regexp){var l=
|
|
222
|
-
c[b],g=l.exec(this);if(null!=g&&0===g.index)return P["~"]=h("MatchData").$new(l,g),!0;P["~"]=f}else if(l=n(c[b],h("String"),"to_str").$to_s(),0===this.indexOf(l))return!0;return!1},-1);B(a,"$strip",function(){return this.replace(/^[\s\u0000]*|[\s\u0000]*$/g,"")});B(a,"$sub",function ea(a,c){var b=ea.$$p||f,d=this;ea.$$p=null;a.$$is_regexp||(a=n(a,h("String"),"to_str"),a=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));var l=a.exec(d);null===l?(P["~"]=f,a=d.toString()):(h("MatchData").$new(a,l),
|
|
223
|
-
void 0===c?(b===f&&t.$raise(h("ArgumentError"),"wrong number of arguments (1 for 2)"),a=d.slice(0,l.index)+b(l[0])+d.slice(l.index+l[0].length)):c.$$is_hash?a=d.slice(0,l.index)+c["$[]"](l[0]).$to_s()+d.slice(l.index+l[0].length):(c=n(c,h("String"),"to_str"),c=c.replace(/([\\]+)([0-9+&`'])/g,function(a,c,b){if(0===c.length%2)return a;switch(b){case "+":for(a=l.length-1;0<a;a--)if(void 0!==l[a])return c.slice(1)+l[a];return"";case "&":return c.slice(1)+l[0];case "`":return c.slice(1)+d.slice(0,l.index);
|
|
224
|
-
case "'":return c.slice(1)+d.slice(l.index+l[0].length);default:return c.slice(1)+(l[b]||"")}}).replace(/\\\\/g,"\\"),a=d.slice(0,l.index)+c+d.slice(l.index+l[0].length)));return a},-2);B(a,"$sum",function(a){null==a&&(a=16);a=n(a,h("Integer"),"to_int");for(var c=0,b=this.length,f=0;f<b;f++)c+=this.charCodeAt(f);return 0>=a?c:c&Math.pow(2,a)-1},-1);B(a,"$swapcase",function(){return this.replace(/([a-z]+)|([A-Z]+)/g,function(a,c,b){return c?a.toUpperCase():a.toLowerCase()})});B(a,"$to_f",function(){if("_"===
|
|
225
|
-
this.charAt(0))return 0;var a=parseFloat(this.replace(/_/g,""));return isNaN(a)||Infinity==a||-Infinity==a?0:a});B(a,"$to_i",function(a){null==a&&(a=10);var c=this.toLowerCase(),b=n(a,h("Integer"),"to_int");(1===b||0>b||36<b)&&t.$raise(h("ArgumentError"),"invalid radix "+b);if(/^\s*_/.test(c))return 0;c=c.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/,function(a,c,f,d){switch(d.charAt(0)){case "+":case "-":return a;case "0":if("x"===d.charAt(1)&&"0x"===f&&(0===b||16===b))return a}switch(f){case "0b":if(0===
|
|
226
|
-
b||2===b)return b=2,c+d;break;case "0":case "0o":if(0===b||8===b)return b=8,c+d;break;case "0d":if(0===b||10===b)return b=10,c+d;break;case "0x":if(0===b||16===b)return b=16,c+d}return a});a=parseInt(c.replace(/_(?!_)/g,""),b);return isNaN(a)?0:a},-1);B(a,"$to_proc",function la(){var a=f,c=f,d=f;la.$$p=null;a=this.valueOf();c=b.jsid(a);d=v(t,"proc",[],function wa(b){var d=wa.$$p||f;wa.$$p=null;var l=m(arguments);0===l.length&&t.$raise(h("ArgumentError"),"no receiver given");var g=l[0];null==g&&(g=
|
|
227
|
-
f);var u=g[c];u?l=l.slice(1):(u=g.$method_missing,l[0]=a);"function"===typeof d&&(u.$$p=d);return 0===l.length?u.call(g):u.apply(g,l)},-1);d.$$source_location=f;return d});B(a,"$to_s",function(){return this.toString()});B(a,"$tr",function(a,c){a=n(a,h("String"),"to_str").$to_s();c=n(c,h("String"),"to_str").$to_s();if(0==a.length||a===c)return this;var b={};var f=a.split("");var d=f.length,l=c.split(""),g=l.length;a=!1;var r=null;"^"===f[0]&&1<f.length&&(a=!0,f.shift(),r=l[g-1],--d);var k=[];var T=
|
|
228
|
-
null;var C=!1;for(c=0;c<d;c++){var w=f[c];if(null==T)T=w,k.push(w);else if("-"===w)"-"===T?(k.push("-"),k.push("-")):c==d-1?k.push("-"):C=!0;else if(C){T=T.charCodeAt(0);C=w.charCodeAt(0);T>C&&t.$raise(h("ArgumentError"),'invalid range "'+String.fromCharCode(T)+"-"+String.fromCharCode(C)+'" in string transliteration');for(T+=1;T<C;T++)k.push(String.fromCharCode(T));k.push(w);T=C=null}else k.push(w)}f=k;d=f.length;if(a)for(c=0;c<d;c++)b[f[c]]=!0;else{if(0<g){k=[];T=null;C=!1;for(c=0;c<g;c++)if(w=l[c],
|
|
229
|
-
null==T)T=w,k.push(w);else if("-"===w)"-"===T?(k.push("-"),k.push("-")):c==g-1?k.push("-"):C=!0;else if(C){T=T.charCodeAt(0);C=w.charCodeAt(0);T>C&&t.$raise(h("ArgumentError"),'invalid range "'+String.fromCharCode(T)+"-"+String.fromCharCode(C)+'" in string transliteration');for(T+=1;T<C;T++)k.push(String.fromCharCode(T));k.push(w);T=C=null}else k.push(w);l=k;g=l.length}w=d-g;if(0<w)for(g=0<g?l[g-1]:"",c=0;c<w;c++)l.push(g);for(c=0;c<d;c++)b[f[c]]=l[c]}d="";c=0;for(f=this.length;c<f;c++)w=this.charAt(c),
|
|
230
|
-
l=b[w],d=a?d+(null==l?r:w):d+(null!=l?l:w);return d});B(a,"$tr_s",function(a,c){a=n(a,h("String"),"to_str").$to_s();c=n(c,h("String"),"to_str").$to_s();if(0==a.length)return this;var b={};var f=a.split("");var d=f.length,l=c.split(""),g=l.length;a=!1;var r=null;"^"===f[0]&&1<f.length&&(a=!0,f.shift(),r=l[g-1],--d);var k=[];var T=null;var C=!1;for(c=0;c<d;c++){var w=f[c];if(null==T)T=w,k.push(w);else if("-"===w)"-"===T?(k.push("-"),k.push("-")):c==d-1?k.push("-"):C=!0;else if(C){T=T.charCodeAt(0);
|
|
231
|
-
C=w.charCodeAt(0);T>C&&t.$raise(h("ArgumentError"),'invalid range "'+String.fromCharCode(T)+"-"+String.fromCharCode(C)+'" in string transliteration');for(T+=1;T<C;T++)k.push(String.fromCharCode(T));k.push(w);T=C=null}else k.push(w)}f=k;d=f.length;if(a)for(c=0;c<d;c++)b[f[c]]=!0;else{if(0<g){k=[];C=!1;for(c=0;c<g;c++)if(w=l[c],null==T)T=w,k.push(w);else if("-"===w)c==g-1?k.push("-"):C=!0;else if(C){T=T.charCodeAt(0);C=w.charCodeAt(0);T>C&&t.$raise(h("ArgumentError"),'invalid range "'+String.fromCharCode(T)+
|
|
232
|
-
"-"+String.fromCharCode(C)+'" in string transliteration');for(T+=1;T<C;T++)k.push(String.fromCharCode(T));k.push(w);T=C=null}else k.push(w);l=k;g=l.length}w=d-g;if(0<w)for(g=0<g?l[g-1]:"",c=0;c<w;c++)l.push(g);for(c=0;c<d;c++)b[f[c]]=l[c]}d="";l=null;c=0;for(f=this.length;c<f;c++)if(w=this.charAt(c),g=b[w],a)null==g?null==l&&(d+=r,l=!0):(d+=w,l=null);else if(null!=g){if(null==l||l!==g)d+=g,l=g}else d+=w,l=null;return d});B(a,"$upcase",function(){return this.toUpperCase()});B(a,"$upto",function ja(a,
|
|
233
|
-
c){var b=ja.$$p||f;ja.$$p=null;null==c&&(c=!1);if(b===f)return this.$enum_for("upto",a,c);var d=this.toString();a=n(a,h("String"),"to_str");if(1===d.length&&1===a.length)for(d=d.charCodeAt(0),a=a.charCodeAt(0);d<=a&&(!c||d!==a);)b(String.fromCharCode(d)),d+=1;else if(parseInt(d,10).toString()===d&&parseInt(a,10).toString()===a)for(d=parseInt(d,10),a=parseInt(a,10);d<=a&&(!c||d!==a);)b(d.toString()),d+=1;else for(;d.length<=a.length&&d<=a&&(!c||d!==a);)b(d),d=d.$succ();return this},-2);B(a,"$instance_variables",
|
|
234
|
-
function(){return[]});z(a,"$_load",function(a){var c=m(arguments);return v(this,"new",G(c))},-1);B(a,"$unicode_normalize",function(a){null==a&&(a="nfc");J(["nfc","nfd","nfkc","nfkd"]["$include?"](a))||t.$raise(h("ArgumentError"),"Invalid normalization form "+a);return this.normalize(a.$upcase())},-1);B(a,"$unicode_normalized?",function(a){null==a&&(a="nfc");return this.$unicode_normalize(a)["$=="](this)},-1);B(a,"$unpack",function(a){return t.$raise("To use String#unpack, you must first require 'corelib/string/unpack'.")});
|
|
235
|
-
B(a,"$unpack1",function(a){return t.$raise("To use String#unpack1, you must first require 'corelib/string/unpack'.")});B(a,"$freeze",function(){if("string"===typeof this)return this;q(this,"$$frozen",!0);return this});B(a,"$-@",function(){return"string"===typeof this||this.$$frozen?this:"UTF-8"==this.encoding.name&&"UTF-8"==this.internal_encoding.name?this.toString():this.$dup().$freeze()});B(a,"$frozen?",function(){return"string"===typeof this||!0===this.$$frozen});L(a,"+@","dup");L(a,"===","==");
|
|
236
|
-
L(a,"byteslice","[]");L(a,"eql?","==");L(a,"equal?","===");L(a,"object_id","__id__");L(a,"slice","[]");L(a,"succ","next");L(a,"to_str","to_s");L(a,"to_sym","intern");return A.$pristine(a,"initialize")})("::",String,k);return U(k[0],"Symbol",d("String"))};
|
|
237
|
-
Opal.modules["corelib/enumerable"]=function(b){var n=b.truthy,x=b.coerce_to,D=b.yield1,q=b.yieldX,E=b.deny_frozen_access,B=b.module,A=b.send,z=b.slice,m=b.to_a,v=b.Opal,G=b.thrower,I=b.def,K=b.Kernel,M=b.return_val,t=b.rb_gt,J=b.rb_times,P=b.rb_lt,R=b.eqeq,W=b.rb_plus,N=b.rb_minus,H=b.rb_divide,L=b.rb_le,U=b.hash2,a=b.lambda,k=b.not,d=b.alias,f=b.nil,h=b.$$$;b.add_stubs("each,public_send,destructure,to_enum,enumerator_size,new,yield,raise,slice_when,!,enum_for,flatten,map,to_proc,compact,to_a,warn,proc,==,nil?,respond_to?,coerce_to!,>,*,try_convert,<,+,-,ceil,/,size,select,__send__,length,<=,[],push,<<,[]=,===,inspect,<=>,first,reverse,sort,take,sort_by,compare,call,dup,sort!,map!,include?,-@,key?,values,transform_values,group_by,fetch,to_h,coerce_to?,class,zip,detect,find_all,collect_concat,collect,inject,entries");
|
|
238
|
-
return function(c,p){function T(a){0===a.length&&(a=[f]);1<a.length&&(a=[a]);return a}c=B(c,"Enumerable");p=[c].concat(p);var g=b.$r(p);I(c,"$all?",function ha(a){try{var c=G("return"),e=ha.$$p||f;ha.$$p=null;n(void 0!==a)?A(this,"each",[],function(e){var b=z(arguments);b=T(b);if(n(A(a,"public_send",["==="].concat(m(b)))))return f;c.$throw(!1)},{$$arity:-1,$$ret:c}):e!==f?A(this,"each",[],function(a){var d=z(arguments);if(n(b.yieldX(e,m(d))))return f;c.$throw(!1)},{$$arity:-1,$$ret:c}):A(this,"each",
|
|
239
|
-
[],function(a){var e=z(arguments);if(n(v.$destructure(e)))return f;c.$throw(!1)},{$$arity:-1,$$ret:c});return!0}catch(O){if(O===c)return O.$v;throw O;}},-1);I(c,"$any?",function S(a){try{var c=G("return"),d=S.$$p||f;S.$$p=null;n(void 0!==a)?A(this,"each",[],function(b){var d=z(arguments);d=T(d);if(n(A(a,"public_send",["==="].concat(m(d)))))c.$throw(!0);else return f},{$$arity:-1,$$ret:c}):d!==f?A(this,"each",[],function(a){var g=z(arguments);if(n(b.yieldX(d,m(g))))c.$throw(!0);else return f},{$$arity:-1,
|
|
240
|
-
$$ret:c}):A(this,"each",[],function(a){var b=z(arguments);if(n(v.$destructure(b)))c.$throw(!0);else return f},{$$arity:-1,$$ret:c});return!1}catch(F){if(F===c)return F.$v;throw F;}},-1);I(c,"$chunk",function S(){var a=S.$$p||f;S.$$p=null;return a===f?A(this,"to_enum",["chunk"],function F(){return(null==F.$$s?this:F.$$s).$enumerator_size()},{$$s:this}):A(h("Enumerator"),"new",[],function la(c){function b(){0<h.length&&c.$yield(g,h)}var d=null==la.$$s?this:la.$$s;null==c&&(c=f);var g=f,h=[];d.$each.$$p=
|
|
241
|
-
function(c){var d=D(a,c);d===f?(b(),h=[],g=f):(g===f||g===d?h.push(c):(b(),h=[c]),g=d)};d.$each();b()},{$$s:this})});I(c,"$chunk_while",function y(){var a=y.$$p||f;y.$$p=null;a===f&&K.$raise(h("ArgumentError"),"no block given");return A(this,"slice_when",[],function(c,d){null==c&&(c=f);null==d&&(d=f);return b.yieldX(a,[c,d])["$!"]()})});I(c,"$collect",function O(){var a=O.$$p||f;O.$$p=null;if(a===f)return A(this,"enum_for",["collect"],function ea(){return(null==ea.$$s?this:ea.$$s).$enumerator_size()},
|
|
242
|
-
{$$s:this});var c=[];this.$each.$$p=function(){var b=q(a,arguments);c.push(b)};this.$each();return c});I(c,"$collect_concat",function F(){var a=F.$$p||f;F.$$p=null;return a===f?A(this,"enum_for",["collect_concat"],function ea(){return(null==ea.$$s?this:ea.$$s).$enumerator_size()},{$$s:this}):A(this,"map",[],a.$to_proc()).$flatten(1)});I(c,"$compact",function(){return this.$to_a().$compact()});I(c,"$count",function la(a){var c=la.$$p||f,b=f;la.$$p=null;b=0;null!=a&&c!==f&&this.$warn("warning: given block not used");
|
|
243
|
-
n(null!=a)?c=A(K,"proc",[],function(c){var b=z(arguments);return v.$destructure(b)["$=="](a)},-1):n(c["$nil?"]())&&(c=A(K,"proc",[],M(!0)));A(this,"each",[],function(a){var d=z(arguments);return n(q(c,d))?b++:f},-1);return b},-1);I(c,"$cycle",function ea(a){var c=ea.$$p||f;ea.$$p=null;null==a&&(a=f);if(c===f)return A(this,"enum_for",["cycle",a],function r(){var c=null==r.$$s?this:r.$$s;if(n(a["$nil?"]()))return n(c["$respond_to?"]("size"))?h(h("Float"),"INFINITY"):f;a=v["$coerce_to!"](a,h("Integer"),
|
|
244
|
-
"to_int");return n(t(a,0))?J(c.$enumerator_size(),a):0},{$$s:this});if(!n(a["$nil?"]())&&(a=v["$coerce_to!"](a,h("Integer"),"to_int"),n(0>=a)))return f;var b=[],d;this.$each.$$p=function(){var a=v.$destructure(arguments);D(c,a);b.push(a)};this.$each();if(0===b.length)return f;if(a===f)for(;;){var g=0;for(d=b.length;g<d;g++)D(c,b[g])}else for(;1<a;){g=0;for(d=b.length;g<d;g++)D(c,b[g]);a--}},-1);I(c,"$detect",function ra(a){try{var c=G("return"),d=ra.$$p||f;ra.$$p=null;if(d===f)return this.$enum_for("detect",
|
|
245
|
-
a);A(this,"each",[],function(a){var g=z(arguments);g=v.$destructure(g);if(n(b.yield1(d,g)))c.$throw(g);else return f},{$$arity:-1,$$ret:c});return void 0!==a?"function"===typeof a?a():a:f}catch(u){if(u===c)return u.$v;throw u;}},-1);I(c,"$drop",function(a){a=x(a,h("Integer"),"to_int");n(0>a)&&K.$raise(h("ArgumentError"),"attempt to drop negative size");var c=[],b=0;this.$each.$$p=function(){a<=b&&c.push(v.$destructure(arguments));b++};this.$each();return c});I(c,"$drop_while",function ra(){var a=
|
|
246
|
-
ra.$$p||f;ra.$$p=null;if(a===f)return this.$enum_for("drop_while");var c=[],b=!0;this.$each.$$p=function(){var f=v.$destructure(arguments);if(b){var d=D(a,f);n(d)||(b=!1,c.push(f))}else c.push(f)};this.$each();return c});I(c,"$each_cons",function ka(a){var c=ka.$$p||f;ka.$$p=null;n(1!=arguments.length)&&K.$raise(h("ArgumentError"),"wrong number of arguments ("+arguments.length+" for 1)");a=v.$try_convert(a,h("Integer"),"to_int");n(0>=a)&&K.$raise(h("ArgumentError"),"invalid size");if(c===f)return A(this,
|
|
247
|
-
"enum_for",["each_cons",a],function pa(){var c=(null==pa.$$s?this:pa.$$s).$enumerator_size();return n(c["$nil?"]())?f:R(c,0)||n(P(c,a))?0:W(N(c,a),1)},{$$s:this});var b=[];this.$each.$$p=function(){var f=v.$destructure(arguments);b.push(f);b.length>a&&b.shift();b.length==a&&D(c,b.slice(0,a))};this.$each();return this});I(c,"$each_entry",function u(a){var c=u.$$p||f;u.$$p=null;var b=z(arguments);if(c===f)return A(this,"to_enum",["each_entry"].concat(m(b)),function Y(){return(null==Y.$$s?this:Y.$$s).$enumerator_size()},
|
|
248
|
-
{$$s:this});this.$each.$$p=function(){var a=v.$destructure(arguments);D(c,a)};this.$each.apply(this,b);return this},-1);I(c,"$each_slice",function wa(a){var c=wa.$$p||f;wa.$$p=null;a=x(a,h("Integer"),"to_int");n(0>=a)&&K.$raise(h("ArgumentError"),"invalid slice size");if(c===f)return A(this,"enum_for",["each_slice",a],function C(){var c=null==C.$$s?this:C.$$s;return n(c["$respond_to?"]("size"))?H(c.$size(),a).$ceil():f},{$$s:this});var b=[];this.$each.$$p=function(){var f=v.$destructure(arguments);
|
|
249
|
-
b.push(f);b.length===a&&(D(c,b),b=[])};this.$each();0<b.length&&D(c,b);return this});I(c,"$each_with_index",function r(a){var c=r.$$p||f;r.$$p=null;var b=z(arguments);if(c===f)return A(this,"enum_for",["each_with_index"].concat(m(b)),function na(){return(null==na.$$s?this:na.$$s).$enumerator_size()},{$$s:this});var d=0;this.$each.$$p=function(){var a=v.$destructure(arguments);c(a,d);d++};this.$each.apply(this,b);return this},-1);I(c,"$each_with_object",function pa(a){var c=pa.$$p||f;pa.$$p=null;if(c===
|
|
250
|
-
f)return A(this,"enum_for",["each_with_object",a],function w(){return(null==w.$$s?this:w.$$s).$enumerator_size()},{$$s:this});this.$each.$$p=function(){var b=v.$destructure(arguments);c(b,a)};this.$each();return a});I(c,"$entries",function(a){var c=z(arguments);var b=[];this.$each.$$p=function(){b.push(v.$destructure(arguments))};this.$each.apply(this,c);return b},-1);I(c,"$filter_map",function pa(){var a=pa.$$p||f;pa.$$p=null;return a===f?A(this,"enum_for",["filter_map"],function w(){return(null==
|
|
251
|
-
w.$$s?this:w.$$s).$enumerator_size()},{$$s:this}):A(A(this,"map",[],a.$to_proc()),"select",[],"itself".$to_proc())});I(c,"$find_all",function Y(){var a=Y.$$p||f;Y.$$p=null;if(a===f)return A(this,"enum_for",["find_all"],function ta(){return(null==ta.$$s?this:ta.$$s).$enumerator_size()},{$$s:this});var c=[];this.$each.$$p=function(){var b=v.$destructure(arguments),f=D(a,b);n(f)&&c.push(b)};this.$each();return c});I(c,"$find_index",function w(a){try{var c=G("return"),d=w.$$p||f,g=f;w.$$p=null;if(n(void 0===
|
|
252
|
-
a&&d===f))return this.$enum_for("find_index");null!=a&&d!==f&&this.$warn("warning: given block not used");g=0;n(null!=a)?A(this,"each",[],function(b){var f=z(arguments);R(v.$destructure(f),a)&&c.$throw(g);return g+=1},{$$arity:-1,$$ret:c}):A(this,"each",[],function(a){var f=z(arguments);n(b.yieldX(d,m(f)))&&c.$throw(g);return g+=1},{$$arity:-1,$$ret:c});return f}catch(aa){if(aa===c)return aa.$v;throw aa;}},-1);I(c,"$first",function(a){try{var c=G("return"),b=f,d=f;if(n(void 0===a))return A(this,"each",
|
|
253
|
-
[],function(a){null==a&&(a=f);c.$throw(a)},{$$ret:c});b=[];a=x(a,h("Integer"),"to_int");n(0>a)&&K.$raise(h("ArgumentError"),"attempt to take negative size");if(n(0==a))return[];d=0;A(this,"each",[],function(g){var h=z(arguments);b.push(v.$destructure(h));if(n(a<=++d))c.$throw(b);else return f},{$$arity:-1,$$ret:c});return b}catch(Ba){if(Ba===c)return Ba.$v;throw Ba;}},-1);I(c,"$grep",function na(a){var c=na.$$p||f,d=f;na.$$p=null;d=[];A(this,"each",[],function(g){var h=z(arguments);var p=T(h);if(!n(A(a,
|
|
254
|
-
"__send__",["==="].concat(m(p)))))return f;c!==f?(n(t(h.$length(),1))&&(h=[h]),h=b.yieldX(c,m(h))):n(L(h.$length(),1))&&(h=h["$[]"](0));return d.$push(h)},-1);return d});I(c,"$grep_v",function ta(a){var c=ta.$$p||f,d=f;ta.$$p=null;d=[];A(this,"each",[],function(g){var h=z(arguments);var p=T(h);if(n(A(a,"__send__",["==="].concat(m(p)))))return f;c!==f?(n(t(h.$length(),1))&&(h=[h]),h=b.yieldX(c,m(h))):n(L(h.$length(),1))&&(h=h["$[]"](0));return d.$push(h)},-1);return d});I(c,"$group_by",function ta(){var a=
|
|
255
|
-
ta.$$p||f,c,b=f,d=f;ta.$$p=null;if(a===f)return A(this,"enum_for",["group_by"],function xa(){return(null==xa.$$s?this:xa.$$s).$enumerator_size()},{$$s:this});b=U([],{});this.$each.$$p=function(){var f=v.$destructure(arguments),g=D(a,f);(n(d=b["$[]"](g))?d:(c=[g,[]],A(b,"[]=",c),c[c.length-1]))["$<<"](f)};this.$each();return b});I(c,"$include?",function(a){try{var c=G("return");A(this,"each",[],function(b){var d=z(arguments);if(R(v.$destructure(d),a))c.$throw(!0);else return f},{$$arity:-1,$$ret:c});
|
|
256
|
-
return!1}catch(aa){if(aa===c)return aa.$v;throw aa;}});I(c,"$inject",function qa(a,c){var b=qa.$$p||f;qa.$$p=null;var d=a;b!==f&&void 0===c?this.$each.$$p=function(){var a=v.$destructure(arguments);void 0!==d&&(a=q(b,[d,a]));d=a}:(void 0===c&&(h("Symbol")["$==="](a)||K.$raise(h("TypeError"),""+a.$inspect()+" is not a Symbol"),c=a,d=void 0),this.$each.$$p=function(){var a=v.$destructure(arguments);d=void 0===d?a:d.$__send__(c,a)});this.$each();return void 0==d?f:d},-1);I(c,"$lazy",function(){return A(h(h("Enumerator"),
|
|
257
|
-
"Lazy"),"new",[this,this.$enumerator_size()],function(a,c){null==a&&(a=f);var b=z(arguments,1);return A(a,"yield",m(b))},-2)});I(c,"$enumerator_size",function(){return n(this["$respond_to?"]("size"))?this.$size():f});I(c,"$max",function qa(a){var c=qa.$$p||f;qa.$$p=null;if(void 0===a||a===f){var b,d;this.$each.$$p=function(){var a=v.$destructure(arguments);void 0===b?b=a:(d=c!==f?q(c,[a,b]):a["$<=>"](b),d===f&&K.$raise(h("ArgumentError"),"comparison failed"),0<d&&(b=a))};this.$each();return void 0===
|
|
258
|
-
b?f:b}a=x(a,h("Integer"),"to_int");return A(this,"sort",[],c.$to_proc()).$reverse().$first(a)},-1);I(c,"$max_by",function ba(a){var c=ba.$$p||f;ba.$$p=null;null==a&&(a=f);if(!n(c))return A(this,"enum_for",["max_by",a],function X(){return(null==X.$$s?this:X.$$s).$enumerator_size()},{$$s:this});if(!n(a["$nil?"]()))return A(this,"sort_by",[],c.$to_proc()).$reverse().$take(a);var b,d;this.$each.$$p=function(){var a=v.$destructure(arguments),f=D(c,a);void 0===b?(b=a,d=f):0<f["$<=>"](d)&&(b=a,d=f)};this.$each();
|
|
259
|
-
return void 0===b?f:b},-1);I(c,"$min",function ca(a){var c=ca.$$p||f;ca.$$p=null;null==a&&(a=f);if(!n(a["$nil?"]()))return c!==f?A(this,"sort",[],function(a,d){null==a&&(a=f);null==d&&(d=f);return b.yieldX(c,[a,d])}).$take(a):this.$sort().$take(a);var d;this.$each.$$p=c!==f?function(){var a=v.$destructure(arguments);if(void 0===d)d=a;else{var b=c(a,d);b===f&&K.$raise(h("ArgumentError"),"comparison failed");0>b&&(d=a)}}:function(){var a=v.$destructure(arguments);void 0===d?d=a:0>v.$compare(a,d)&&(d=
|
|
260
|
-
a)};this.$each();return void 0===d?f:d},-1);I(c,"$min_by",function xa(a){var c=xa.$$p||f;xa.$$p=null;null==a&&(a=f);if(!n(c))return A(this,"enum_for",["min_by",a],function sa(){return(null==sa.$$s?this:sa.$$s).$enumerator_size()},{$$s:this});if(!n(a["$nil?"]()))return A(this,"sort_by",[],c.$to_proc()).$take(a);var b,d;this.$each.$$p=function(){var a=v.$destructure(arguments),f=D(c,a);void 0===b?(b=a,d=f):0>f["$<=>"](d)&&(b=a,d=f)};this.$each();return void 0===b?f:b},-1);I(c,"$minmax",function xa(){var a=
|
|
261
|
-
xa.$$p||f,c=f;xa.$$p=null;a=n(c=a)?c:A(K,"proc",[],function(a,c){null==a&&(a=f);null==c&&(c=f);return a["$<=>"](c)});var b=f,d=f,g=!0;this.$each.$$p=function(){var c=v.$destructure(arguments);if(g)b=d=c,g=!1;else{var Q=a.$call(b,c);Q===f?K.$raise(h("ArgumentError"),"comparison failed"):0<Q&&(b=c);Q=a.$call(d,c);Q===f?K.$raise(h("ArgumentError"),"comparison failed"):0>Q&&(d=c)}};this.$each();return[b,d]});I(c,"$minmax_by",function da(){var a=da.$$p||f;da.$$p=null;if(!n(a))return A(this,"enum_for",
|
|
262
|
-
["minmax_by"],function oa(){return(null==oa.$$s?this:oa.$$s).$enumerator_size()},{$$s:this});var c=f,b=f,d,g;this.$each.$$p=function(){var f=v.$destructure(arguments),Q=D(a,f);if(void 0===d||0>Q["$<=>"](d))c=f,d=Q;if(void 0===g||0<Q["$<=>"](g))b=f,g=Q};this.$each();return[c,b]});I(c,"$none?",function X(a){try{var c=G("return"),d=X.$$p||f;X.$$p=null;n(void 0!==a)?A(this,"each",[],function(b){var d=z(arguments);d=T(d);if(n(A(a,"public_send",["==="].concat(m(d)))))c.$throw(!1);else return f},{$$arity:-1,
|
|
263
|
-
$$ret:c}):d!==f?A(this,"each",[],function(a){var g=z(arguments);if(n(b.yieldX(d,m(g))))c.$throw(!1);else return f},{$$arity:-1,$$ret:c}):A(this,"each",[],function(a){var b=z(arguments);b=v.$destructure(b);if(n(b))c.$throw(!1);else return f},{$$arity:-1,$$ret:c});return!0}catch(fa){if(fa===c)return fa.$v;throw fa;}},-1);I(c,"$one?",function V(a){try{var c=G("return"),d=V.$$p||f,g=f;V.$$p=null;g=0;n(void 0!==a)?A(this,"each",[],function(b){var d=z(arguments);d=T(d);if(n(A(a,"public_send",["==="].concat(m(d)))))if(g=
|
|
264
|
-
W(g,1),n(t(g,1)))c.$throw(!1);else return f;else return f},{$$arity:-1,$$ret:c}):d!==f?A(this,"each",[],function(a){var h=z(arguments);if(!n(b.yieldX(d,m(h))))return f;g=W(g,1);if(n(t(g,1)))c.$throw(!1);else return f},{$$arity:-1,$$ret:c}):A(this,"each",[],function(a){var b=z(arguments);if(!n(v.$destructure(b)))return f;g=W(g,1);if(n(t(g,1)))c.$throw(!1);else return f},{$$arity:-1,$$ret:c});return g["$=="](1)}catch(oa){if(oa===c)return oa.$v;throw oa;}},-1);I(c,"$partition",function V(){var a=V.$$p||
|
|
265
|
-
f;V.$$p=null;if(a===f)return A(this,"enum_for",["partition"],function ia(){return(null==ia.$$s?this:ia.$$s).$enumerator_size()},{$$s:this});var c=[],b=[];this.$each.$$p=function(){var f=v.$destructure(arguments),d=D(a,f);n(d)?c.push(f):b.push(f)};this.$each();return[c,b]});I(c,"$reject",function sa(){var a=sa.$$p||f;sa.$$p=null;if(a===f)return A(this,"enum_for",["reject"],function ia(){return(null==ia.$$s?this:ia.$$s).$enumerator_size()},{$$s:this});var c=[];this.$each.$$p=function(){var b=v.$destructure(arguments),
|
|
266
|
-
f=D(a,b);n(f)||c.push(b)};this.$each();return c});I(c,"$reverse_each",function fa(){var a=fa.$$p||f;fa.$$p=null;if(a===f)return A(this,"enum_for",["reverse_each"],function za(){return(null==za.$$s?this:za.$$s).$enumerator_size()},{$$s:this});var c=[];this.$each.$$p=function(){c.push(arguments)};this.$each();for(var b=c.length-1;0<=b;b--)q(a,c[b]);return c});I(c,"$slice_before",function oa(a){var c=oa.$$p||f;oa.$$p=null;n(void 0===a&&c===f)&&K.$raise(h("ArgumentError"),"both pattern and block are given");
|
|
267
|
-
n(void 0!==a&&c!==f||1<arguments.length)&&K.$raise(h("ArgumentError"),"wrong number of arguments ("+arguments.length+" expected 1)");return A(h("Enumerator"),"new",[],function Ca(b){var d=null==Ca.$$s?this:Ca.$$s;null==b&&(b=f);var g=[];d.$each.$$p=c!==f?void 0===a?function(){var a=v.$destructure(arguments),f=D(c,a);n(f)&&0<g.length&&(b["$<<"](g),g=[]);g.push(a)}:function(){var f=v.$destructure(arguments),d=c(f,a.$dup());n(d)&&0<g.length&&(b["$<<"](g),g=[]);g.push(f)}:function(){var c=v.$destructure(arguments),
|
|
268
|
-
f=a["$==="](c);n(f)&&0<g.length&&(b["$<<"](g),g=[]);g.push(c)};d.$each();if(0<g.length)b["$<<"](g)},{$$s:this})},-1);I(c,"$slice_after",function ia(a){var c=ia.$$p||f;ia.$$p=null;n(void 0===a&&c===f)&&K.$raise(h("ArgumentError"),"both pattern and block are given");n(void 0!==a&&c!==f||1<arguments.length)&&K.$raise(h("ArgumentError"),"wrong number of arguments ("+arguments.length+" expected 1)");n(void 0!==a)&&(c=A(K,"proc",[],function(c){null==c&&(c=f);return a["$==="](c)}));return A(h("Enumerator"),
|
|
269
|
-
"new",[],function ua(a){var b=null==ua.$$s?this:ua.$$s;null==a&&(a=f);var d;b.$each.$$p=function(){var b=v.$destructure(arguments),f=D(c,b);null==d&&(d=[]);n(f)?(d.push(b),a.$yield(d),d=null):d.push(b)};b.$each();null!=d&&a.$yield(d)},{$$s:this})},-1);I(c,"$slice_when",function ia(){var a=ia.$$p||f;ia.$$p=null;a===f&&K.$raise(h("ArgumentError"),"wrong number of arguments (0 for 1)");return A(h("Enumerator"),"new",[],function ua(c){var b=null==ua.$$s?this:ua.$$s;null==c&&(c=f);var d=f,g=f;b.$each_cons.$$p=
|
|
270
|
-
function(){var b=v.$destructure(arguments),h=b[0];b=b[1];var p=q(a,[h,b]);g=b;d===f&&(d=[]);n(p)?(d.push(h),c.$yield(d),d=[]):d.push(h)};b.$each_cons(2);d!==f&&(d.push(g),c.$yield(d))},{$$s:this})});I(c,"$sort",function va(){var c=va.$$p||f,b=f;va.$$p=null;b=this.$to_a();c===f&&(c=a(function(a,c){null==a&&(a=f);null==c&&(c=f);return a["$<=>"](c)}));return A(b,"sort",[],c.$to_proc())});I(c,"$sort_by",function za(){var a=za.$$p||f,c=f;za.$$p=null;if(a===f)return A(this,"enum_for",["sort_by"],function Ea(){return(null==
|
|
271
|
-
Ea.$$s?this:Ea.$$s).$enumerator_size()},{$$s:this});c=A(this,"map",[],function(){var c=v.$destructure(arguments);return[b.yield1(a,c),c]});A(c,"sort!",[],function(a,c){null==a&&(a=f);null==c&&(c=f);return a[0]["$<=>"](c[0])});return A(c,"map!",[],function(a){null==a&&(a=f);return a[1]})});I(c,"$sum",function ua(a){var c=ua.$$p||f,d=f,g=f;ua.$$p=null;null==a&&(a=0);d=a;g=0;A(this,"each",[],function(a){var p=z(arguments);p=c!==f?b.yieldX(c,m(p)):v.$destructure(p);if(k([h(h("Float"),"INFINITY"),h(h("Float"),
|
|
272
|
-
"INFINITY")["$-@"]()]["$include?"](p))&&n(p["$respond_to?"]("-"))){p=N(p,g);var T=W(d,p);g=N(N(T,d),p);return d=T}return d=W(d,p)},-1);return d},-1);I(c,"$take",function(a){return this.$first(a)});I(c,"$take_while",function ua(){try{var a=G("return"),c=ua.$$p||f,d=f;ua.$$p=null;if(!n(c))return this.$enum_for("take_while");d=[];return A(this,"each",[],function(f){var g=z(arguments);g=v.$destructure(g);n(b.yield1(c,g))||a.$throw(d);return d.push(g)},{$$arity:-1,$$ret:a})}catch(ya){if(ya===a)return ya.$v;
|
|
273
|
-
throw ya;}});I(c,"$uniq",function Da(){var a=Da.$$p||f,c=f;Da.$$p=null;c=U([],{});A(this,"each",[],function(d){var g;var h=z(arguments);h=v.$destructure(h);var p=a!==f?b.yield1(a,h):h;return n(c["$key?"](p))?f:(g=[p,h],A(c,"[]=",g),g[g.length-1])},-1);return c.$values()});I(c,"$tally",function(a){var c=f;a&&a!==f&&E(a);c=A(A(this,"group_by",[],"itself".$to_proc()),"transform_values",[],"count".$to_proc());return n(a)?(A(c,"each",[],function(c,b){var d;null==c&&(c=f);null==b&&(b=f);return d=[c,W(a.$fetch(c,
|
|
274
|
-
0),b)],A(a,"[]=",d),d[d.length-1]}),a):c},-1);I(c,"$to_h",function Aa(a){var c=Aa.$$p||f;Aa.$$p=null;var d=z(arguments);if(c!==f)return A(A(this,"map",[],c.$to_proc()),"to_h",m(d));var g=U([],{});this.$each.$$p=function(){var a=v.$destructure(arguments);a=v["$coerce_to?"](a,h("Array"),"to_ary");a.$$is_array||K.$raise(h("TypeError"),"wrong element type "+a.$class()+" (expected array)");2!==a.length&&K.$raise(h("ArgumentError"),"wrong array length (expected 2, was "+a.$length()+")");b.hash_put(g,a[0],
|
|
275
|
-
a[1])};this.$each.apply(this,d);return g},-1);I(c,"$to_set",function Ha(a,c){var b=Ha.$$p||f,d;Ha.$$p=null;var h=z(arguments);0<h.length&&(d=h.shift());null==d&&(d=g("Set"));return A(d,"new",[this].concat(m(h)),b.$to_proc())},-1);I(c,"$zip",function Ha(a){Ha.$$p=null;var c=z(arguments);return A(this.$to_a(),"zip",m(c))},-1);d(c,"find","detect");d(c,"filter","find_all");d(c,"flat_map","collect_concat");d(c,"map","collect");d(c,"member?","include?");d(c,"reduce","inject");d(c,"select","find_all");return d(c,
|
|
276
|
-
"to_a","entries")}("::",[])};
|
|
277
|
-
Opal.modules["corelib/enumerator/arithmetic_sequence"]=function(b){var n=b.klass,x=b.truthy,D=b.to_a,q=b.eqeq,E=b.Kernel,B=b.def,A=b.rb_gt,z=b.rb_lt,m=b.rb_le,v=b.rb_ge,G=b.rb_plus,I=b.rb_minus,K=b.eqeqeq,M=b.not,t=b.rb_times,J=b.rb_divide,P=b.alias,R=b.nil,W=b.$$$;b.add_stubs("is_a?,==,raise,respond_to?,class,attr_reader,begin,end,exclude_end?,>,step,<,<=,>=,-@,_lesser_than_end?,<<,+,-,===,%,_greater_than_begin?,reverse,!,include?,*,to_i,abs,/,hash,inspect");return function(N,$super,L){N=n(N,$super,
|
|
278
|
-
"Enumerator");L=[N].concat(L);return function(N,$super,k){N=n(N,$super,"ArithmeticSequence");k=[N].concat(k);var d=b.$r(k);k=N.$$prototype;k.step_arg2=k.receiver_num=k.step_arg1=k.step=k.range=k.topfx=k.bypfx=k.creation_method=k.skipped_arg=R;b.prop(N.$$prototype,"$$is_arithmetic_seq",!0);B(N,"$initialize",function(f,h,c){var p=R;null==c&&(c="step");this.creation_method=c;x(f["$is_a?"](W("Array")))?(f=[].concat(D(f)),this.step_arg1=null==f[0]?R:f[0],this.step_arg2=null==f[1]?R:f[1],this.topfx=null==
|
|
279
|
-
f[2]?R:f[2],this.bypfx=null==f[3]?R:f[3],f,this.receiver_num=h,this.step=1,this.range=x(this.step_arg2)?(this.step=this.step_arg2,b.Range.$new(this.receiver_num,this.step_arg1,!1)):x(this.step_arg1)?b.Range.$new(this.receiver_num,this.step_arg1,!1):b.Range.$new(this.receiver_num,R,!1)):(x(h)||(this.skipped_arg=!0),f=[f,x(p=h)?p:1],this.range=f[0],this.step=f[1],f);this.object=this;q(this.step,0)&&E.$raise(d("ArgumentError"),"step can't be 0");return x(this.step["$respond_to?"]("to_int"))?R:E.$raise(d("ArgumentError"),
|
|
280
|
-
"no implicit conversion of "+this.step.$class()+" into Integer")},-2);N.$attr_reader("step");B(N,"$begin",function(){return this.range.$begin()});B(N,"$end",function(){return this.range.$end()});B(N,"$exclude_end?",function(){return this.range["$exclude_end?"]()});B(N,"$_lesser_than_end?",function(b){var f=R;var c=x(f=this.$end())?f:Infinity;return x(A(this.$step(),0))?x(this["$exclude_end?"]())?z(b,c):m(b,c):x(this["$exclude_end?"]())?A(b,c):v(b,c)});B(N,"$_greater_than_begin?",function(b){var f=
|
|
281
|
-
R;var c=x(f=this.$begin())?f:Infinity["$-@"]();return x(A(this.$step(),0))?A(b,c):z(b,c)});B(N,"$first",function(b){var f=R,c;var d=x(f=this.$begin())?f:Infinity["$-@"]();if(!x(b))return x(this["$_lesser_than_end?"](d))?d:R;for(c=[];x(x(f=this["$_lesser_than_end?"](d))?A(b,0):f);)c["$<<"](d),d=G(d,this.$step()),b=I(b,1);return c},-1);B(N,"$each",function h(){var c=h.$$p||R,p,k;h.$$p=null;if(c===R)return this;K(R,p=this.$begin())?E.$raise(d("TypeError"),"nil can't be coerced into Integer"):R;for(k=
|
|
282
|
-
x(p=this.$begin())?p:Infinity["$-@"]();x(this["$_lesser_than_end?"](k));)b.yield1(c,k),k=G(k,this.$step());return this});B(N,"$last",function(b){var c=R,d;K(Infinity,c=this.$end())||K(Infinity["$-@"](),c)?E.$raise(W("FloatDomainError"),this.$end()):K(R,c)?E.$raise(W("RangeError"),"cannot get the last element of endless arithmetic sequence"):R;var h=I(this.$end(),I(this.$end(),this.$begin())["$%"](this.$step()));x(this["$_lesser_than_end?"](h))||(h=I(h,this.$step()));if(!x(b))return x(this["$_greater_than_begin?"](h))?
|
|
283
|
-
h:R;for(d=[];x(x(c=this["$_greater_than_begin?"](h))?A(b,0):c);)d["$<<"](h),h=I(h,this.$step()),b=I(b,1);return d.$reverse()},-1);B(N,"$size",function(){var b=x(A(this.$step(),0))?1:-1;if(M(this["$_lesser_than_end?"](this.$begin())))return 0;if(x([Infinity["$-@"](),Infinity]["$include?"](this.$step())))return 1;if(x([t(Infinity["$-@"](),b),R]["$include?"](this.$begin()))||x([t(Infinity,b),R]["$include?"](this.$end())))return Infinity;b=I(this.$end(),I(this.$end(),this.$begin())["$%"](this.$step()));
|
|
284
|
-
x(this["$_lesser_than_end?"](b))||(b=I(b,this.$step()));return G(J(I(b,this.$begin()),this.$step()).$abs().$to_i(),1)});B(N,"$==",function(b){var c,d=R,h=R,g=R;return x(c=x(d=x(h=x(g=this.$class()["$=="](b.$class()))?this.$begin()["$=="](b.$begin()):g)?this.$end()["$=="](b.$end()):h)?this.$step()["$=="](b.$step()):d)?this["$exclude_end?"]()["$=="](b["$exclude_end?"]()):c});B(N,"$hash",function(){return[this.$begin(),this.$end(),this.$step(),this["$exclude_end?"]()].$hash()});B(N,"$inspect",function(){if(x(this.receiver_num)){var b=
|
|
285
|
-
x(this.step_arg2)?"("+this.topfx+this.step_arg1.$inspect()+", "+this.bypfx+this.step_arg2.$inspect()+")":x(this.step_arg1)?"("+this.topfx+this.step_arg1.$inspect()+")":R;return"("+this.receiver_num.$inspect()+"."+this.creation_method+b+")"}b=x(this.skipped_arg)?R:"("+this.step+")";return"(("+this.range.$inspect()+")."+this.creation_method+b+")"});P(N,"===","==");return P(N,"eql?","==")}(N,N,L)}("::",null,[])};
|
|
286
|
-
Opal.modules["corelib/enumerator/chain"]=function(b){var n=b.deny_frozen_access,x=b.klass,D=b.slice,q=b.def,E=b.send,B=b.to_a,A=b.truthy,z=b.rb_plus,m=b.thrower,v=b.nil,G=b.$$$;b.add_stubs("to_enum,size,each,<<,to_proc,include?,+,reverse_each,respond_to?,rewind,inspect");return function(b,$super){b=x(b,$super,"Enumerator");return function(b,$super){b=x(b,$super,"Chain");var M=b.$$prototype;M.enums=M.iterated=v;q(b,"$initialize",function(b){var m=D(arguments);n(this);this.enums=m;this.iterated=[];
|
|
287
|
-
return this.object=this},-1);q(b,"$each",function W(b){var m=W.$$p||v;W.$$p=null;var n=D(arguments);if(m===v)return E(this,"to_enum",["each"].concat(B(n)),function U(){return(null==U.$$s?this:U.$$s).$size()},{$$s:this});E(this.enums,"each",[],function a(b){var k=null==a.$$s?this:a.$$s;null==k.iterated&&(k.iterated=v);null==b&&(b=v);k.iterated["$<<"](b);return E(b,"each",B(n),m.$to_proc())},{$$s:this});return this},-1);q(b,"$size",function(b){try{var n=m("return"),q=v;var x=D(arguments);q=0;E(this.enums,
|
|
288
|
-
"each",[],function(b){null==b&&(b=v);b=E(b,"size",B(x));A([v,G(G("Float"),"INFINITY")]["$include?"](b))&&n.$throw(b);return q=z(q,b)},{$$ret:n});return q}catch(L){if(L===n)return L.$v;throw L;}},-1);q(b,"$rewind",function(){E(this.iterated,"reverse_each",[],function(b){null==b&&(b=v);return A(b["$respond_to?"]("rewind"))?b.$rewind():v});this.iterated=[];return this});return q(b,"$inspect",function(){return"#<Enumerator::Chain: "+this.enums.$inspect()+">"})}(b,b)}("::",null)};
|
|
289
|
-
Opal.modules["corelib/enumerator/generator"]=function(b){var n=b.deny_frozen_access,x=b.klass,D=b.truthy,q=b.Kernel,E=b.def,B=b.slice,A=b.send,z=[],m=b.nil,v=b.$$$;b.add_stubs("include,raise,new,to_proc");return function(z,$super,K){z=[x(z,$super,"Enumerator")].concat(K);return function(z,$super,G){z=x(z,$super,"Generator");G=[z].concat(G);var M=b.$r(G);z.$$prototype.block=m;z.$include(v("Enumerable"));E(z,"$initialize",function W(){var b=W.$$p||m;W.$$p=null;n(this);D(b)||q.$raise(v("LocalJumpError"),
|
|
290
|
-
"no block given");return this.block=b});return E(z,"$each",function H(n){var q=H.$$p||m;H.$$p=null;var v=B(arguments);q=A(M("Yielder"),"new",[],q.$to_proc());try{v.unshift(q),b.yieldX(this.block,v)}catch(a){if(a&&"breaker"==a.$thrower_type)return a.$v;throw a;}return this},-1)}(z[0],null,z)}(z[0],null,z)};
|
|
291
|
-
Opal.modules["corelib/enumerator/lazy"]=function(b){var n=b.truthy,x=b.coerce_to,D=b.yield1,q=b.yieldX,E=b.deny_frozen_access,B=b.klass,A=b.slice,z=b.send2,m=b.find_super,v=b.to_a,G=b.defs,I=b.Kernel,K=b.send,M=b.def,t=b.return_self,J=b.Opal,P=b.rb_lt,R=b.eqeqeq,W=b.rb_plus,N=b.alias,H=b.nil,L=b.$$$;b.add_stubs("raise,each,new,enumerator_size,yield,respond_to?,try_convert,<,===,+,for,class,to_proc,destructure,inspect,to_a,find_all,collect_concat,collect,enum_for");return function(U,$super,k){U=B(U,
|
|
292
|
-
$super,"Enumerator");k=[U].concat(k);return function(d,$super,h){d=B(d,$super,"Lazy");h=[d].concat(h);var c=b.$r(h);d.$$prototype.enumerator=H;B(d,L("Exception"),"StopLazyError");G(d,"$for",function l(c,b){var e=l.$$p||H;l.$$p=null;var d=A(arguments,1);d=z(this,m(this,"for",l,!1,!0),"for",[c].concat(v(d)),e);d.enumerator=c;return d},-2);M(d,"$initialize",function e(d,l){var g=e.$$p||H;e.$$p=null;null==l&&(l=H);E(this);g===H&&I.$raise(L("ArgumentError"),"tried to call lazy new without a block");this.enumerator=
|
|
293
|
-
d;return z(this,m(this,"initialize",e,!1,!0),"initialize",[l],function(e,l){null==e&&(e=H);var h=A(arguments,1);try{return K(d,"each",v(h),function(c){var b=A(arguments);b.unshift(e);q(g,b)},-1)}catch(F){if(b.rescue(F,[c("StopLazyError")]))try{return H}finally{b.pop_exception()}else throw F;}},-2)},-2);M(d,"$lazy",t);M(d,"$collect",function l(){var b=l.$$p||H;l.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy map without a block");return K(c("Lazy"),"new",[this,this.$enumerator_size()],
|
|
294
|
-
function(c,e){null==c&&(c=H);var d=A(arguments,1);d=q(b,d);c.$yield(d)},-2)});M(d,"$collect_concat",function e(){var b=e.$$p||H;e.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy map without a block");return K(c("Lazy"),"new",[this,H],function(c,e){null==c&&(c=H);var d=A(arguments,1);d=q(b,d);d["$respond_to?"]("force")&&d["$respond_to?"]("each")?K(d,"each",[],function(b){null==b&&(b=H);return c.$yield(b)}):J.$try_convert(d,L("Array"),"to_ary")===H?c.$yield(d):K(d,"each",[],function(b){null==
|
|
295
|
-
b&&(b=H);return c.$yield(b)})},-2)});M(d,"$drop",function(b){var e=H,d=e=H;b=x(b,L("Integer"),"to_int");n(P(b,0))&&I.$raise(L("ArgumentError"),"attempt to drop negative size");e=this.$enumerator_size();e=R(L("Integer"),e)?n(P(b,e))?b:e:e;d=0;return K(c("Lazy"),"new",[this,e],function(c,e){null==c&&(c=H);var h=A(arguments,1);return n(P(d,b))?d=W(d,1):K(c,"yield",v(h))},-2)});M(d,"$drop_while",function ha(){var b=ha.$$p||H,d=H;ha.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy drop_while without a block");
|
|
296
|
-
d=!0;return K(c("Lazy"),"new",[this,H],function(c,h){null==c&&(c=H);var y=A(arguments,1);if(n(d)){var F=q(b,y);n(F)||(d=!1,K(c,"yield",v(y)))}else return K(c,"yield",v(y))},-2)});M(d,"$enum_for",function O(c,b){var d=O.$$p||H,h;O.$$p=null;var y=A(arguments);0<y.length&&(h=y.shift());null==h&&(h="each");return K(this.$class(),"for",[this,h].concat(v(y)),d.$to_proc())},-1);M(d,"$find_all",function y(){var b=y.$$p||H;y.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy select without a block");
|
|
297
|
-
return K(c("Lazy"),"new",[this,H],function(c,d){null==c&&(c=H);var h=A(arguments,1);var y=q(b,h);n(y)&&K(c,"yield",v(h))},-2)});M(d,"$grep",function F(b){var d=F.$$p||H;F.$$p=null;return n(d)?K(c("Lazy"),"new",[this,H],function(c,h){null==c&&(c=H);var F=A(arguments,1);F=J.$destructure(F);var k=b["$==="](F);n(k)&&(D(d,F),c.$yield(D(d,F)))},-2):K(c("Lazy"),"new",[this,H],function(c,d){null==c&&(c=H);var h=A(arguments,1);h=J.$destructure(h);var F=b["$==="](h);n(F)&&c.$yield(h)},-2)});M(d,"$reject",function F(){var b=
|
|
298
|
-
F.$$p||H;F.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy reject without a block");return K(c("Lazy"),"new",[this,H],function(c,d){null==c&&(c=H);var h=A(arguments,1);var F=q(b,h);n(F)||K(c,"yield",v(h))},-2)});M(d,"$take",function(b){var d=H,h=d=H;b=x(b,L("Integer"),"to_int");n(P(b,0))&&I.$raise(L("ArgumentError"),"attempt to take negative size");d=this.$enumerator_size();d=R(L("Integer"),d)?n(P(b,d))?b:d:d;h=0;return K(c("Lazy"),"new",[this,d],function(d,F){null==d&&(d=H);var k=
|
|
299
|
-
A(arguments,1);return n(P(h,b))?(K(d,"yield",v(k)),h=W(h,1)):I.$raise(c("StopLazyError"))},-2)});M(d,"$take_while",function Z(){var b=Z.$$p||H;Z.$$p=null;n(b)||I.$raise(L("ArgumentError"),"tried to call lazy take_while without a block");return K(c("Lazy"),"new",[this,H],function(d,h){null==d&&(d=H);var k=A(arguments,1);var m=q(b,k);n(m)?K(d,"yield",v(k)):I.$raise(c("StopLazyError"))},-2)});M(d,"$inspect",function(){return"#<"+this.$class()+": "+this.enumerator.$inspect()+">"});N(d,"force","to_a");
|
|
300
|
-
N(d,"filter","find_all");N(d,"flat_map","collect_concat");N(d,"map","collect");N(d,"select","find_all");return N(d,"to_enum","enum_for")}(U,U,k)}("::",null,[])};
|
|
301
|
-
Opal.modules["corelib/enumerator/yielder"]=function(b){var n=b.klass,x=b.def,D=b.slice,q=b.send,E=b.to_a,B=[],A=b.nil;b.add_stubs("yield,proc");return function(z,$super,v){return function(v,$super){v=n(v,$super,"Yielder");v.$$prototype.block=A;x(v,"$initialize",function M(){var b=M.$$p||A;M.$$p=null;this.block=b;return this});x(v,"$yield",function(n){var t=D(arguments);if((t=b.yieldX(this.block,t))&&"break"==t.$thrower_type)throw t;return t},-1);x(v,"$<<",function(b){this.$yield(b);return this});
|
|
302
|
-
return x(v,"$to_proc",function(){return q(this,"proc",[],function J(b){var n=null==J.$$s?this:J.$$s;var t=D(arguments);return q(n,"yield",E(t))},{$$arity:-1,$$s:this})})}([n(z,$super,"Enumerator")].concat(v)[0],null)}(B[0],null,B)};
|
|
303
|
-
Opal.modules["corelib/enumerator"]=function(b){var n=b.slice,x=b.coerce_to,D=b.deny_frozen_access,q=b.klass,E=b.defs,B=b.truthy,A=b.send,z=b.not,m=b.def,v=b.rb_plus,G=b.to_a,I=b.Opal,K=b.send2,M=b.find_super,t=b.rb_ge,J=b.Kernel,P=b.rb_le,R=b.alias,W=b.top,N=b.nil,H=b.$$$;b.add_stubs("require,include,allocate,new,to_proc,!,respond_to?,empty?,nil?,+,class,__send__,call,enum_for,size,destructure,map,>=,length,raise,[],peek_values,<=,next_values,inspect,any?,each_with_object,autoload");W.$require("corelib/enumerable");
|
|
304
|
-
return function(L,$super,a){L=q(L,$super,"Enumerator");a=[L].concat(a);var k=b.$r(a);a=L.$$prototype;a.size=a.args=a.object=a.method=a.values=a.cursor=N;L.$include(H("Enumerable"));L.$$prototype.$$is_enumerator=!0;E(L,"$for",function p(a,b,c){var f=p.$$p||N,g;p.$$p=null;var l=n(arguments,1);0<l.length&&(g=l.shift());null==g&&(g="each");var e=this.$allocate();e.object=a;e.size=f;e.method=g;e.args=l;e.cursor=0;return e},-2);m(L,"$initialize",function c(a){var b=c.$$p||N;c.$$p=null;n(arguments);D(this);
|
|
305
|
-
this.cursor=0;if(B(b))return this.object=A(k("Generator"),"new",[],b.$to_proc()),this.method="each",this.args=[],this.size=arguments[0]||N,B(this.size)&&z(this.size["$respond_to?"]("call"))?this.size=x(this.size,H("Integer"),"to_int"):N;this.object=arguments[0];this.method=arguments[1]||"each";this.args=n(arguments,2);return this.size=N},-1);m(L,"$each",function p(a){var c=p.$$p||N;p.$$p=null;var b=n(arguments);if(B(c["$nil?"]())&&B(b["$empty?"]()))return this;b=v(this.args,b);return B(c["$nil?"]())?
|
|
306
|
-
A(this.$class(),"new",[this.object,this.method].concat(G(b))):A(this.object,"__send__",[this.method].concat(G(b)),c.$to_proc())},-1);m(L,"$size",function(){return B(this.size["$respond_to?"]("call"))?A(this.size,"call",G(this.args)):this.size});m(L,"$with_index",function T(a){var b=T.$$p||N;T.$$p=null;null==a&&(a=0);a=B(a)?x(a,H("Integer"),"to_int"):0;if(!B(b))return A(this,"enum_for",["with_index",a],function ha(){return(null==ha.$$s?this:ha.$$s).$size()},{$$s:this});var l=a;this.$each.$$p=function(){var a=
|
|
307
|
-
I.$destructure(arguments);a=b(a,l);l++;return a};return this.$each()},-1);m(L,"$each_with_index",function T(){var a=T.$$p||N;T.$$p=null;if(a===N)return A(this,"enum_for",["each_with_index"],function e(){return(null==e.$$s?this:e.$$s).$size()},{$$s:this});K(this,M(this,"each_with_index",T,!1,!0),"each_with_index",[],a);return this.object});m(L,"$rewind",function(){this.cursor=0;return this});m(L,"$peek_values",function(){var a=N;this.values=B(a=this.values)?a:A(this,"map",[],function(a){return n(arguments)},
|
|
308
|
-
-1);B(t(this.cursor,this.values.$length()))&&J.$raise(H("StopIteration"),"iteration reached an end");return this.values["$[]"](this.cursor)});m(L,"$peek",function(){var a=this.$peek_values();return B(P(a.$length(),1))?a["$[]"](0):a});m(L,"$next_values",function(){var a=this.$peek_values();this.cursor=v(this.cursor,1);return a});m(L,"$next",function(){var a=this.$next_values();return B(P(a.$length(),1))?a["$[]"](0):a});m(L,"$feed",function(a){return this.$raise(k("NotImplementedError"),"Opal doesn't support Enumerator#feed")});
|
|
309
|
-
m(L,"$+",function(a){return H(H("Enumerator"),"Chain").$new(this,a)});m(L,"$inspect",function(){var a="#<"+this.$class()+": "+this.object.$inspect()+":"+this.method;B(this.args["$any?"]())&&(a=v(a,"("+this.args.$inspect()["$[]"](H("Range").$new(1,-2))+")"));return v(a,">")});R(L,"with_object","each_with_object");L.$autoload("ArithmeticSequence","corelib/enumerator/arithmetic_sequence");L.$autoload("Chain","corelib/enumerator/chain");L.$autoload("Generator","corelib/enumerator/generator");L.$autoload("Lazy",
|
|
310
|
-
"corelib/enumerator/lazy");return L.$autoload("Yielder","corelib/enumerator/yielder")}("::",null,[])};
|
|
311
|
-
Opal.modules["corelib/numeric"]=function(b){var n=b.klass,x=b.truthy,D=b.Kernel,q=b.def,E=b.to_ary,B=b.return_self,A=b.rb_minus,z=b.rb_times,m=b.rb_lt,v=b.eqeq,G=b.rb_divide,I=b.return_val,K=b.Opal,M=b.slice,t=b.extract_kwargs,J=b.ensure_kwargs,P=b.not,R=b.send,W=b.rb_ge,N=b.rb_le,H=b.rb_plus,L=b.rb_gt,U=b.alias,a=b.top,k=b.nil,d=b.$$$;b.add_stubs("require,include,instance_of?,class,Float,respond_to?,coerce,__send__,raise,equal?,-,*,div,<,-@,ceil,to_f,denominator,to_r,==,floor,/,%,Complex,zero?,numerator,abs,arg,coerce_to!,round,<=>,compare,is_a?,!,new,enum_for,to_proc,negative?,>=,<=,+,to_i,truncate,>,angle,conj,imag,rect");a.$require("corelib/comparable");
|
|
312
|
-
return function(a,$super){a=n(a,$super,"Numeric");a.$include(d("Comparable"));q(a,"$coerce",function(a){return x(a["$instance_of?"](this.$class()))?[a,this]:[D.$Float(a),D.$Float(this)]});q(a,"$__coerced__",function(a,b){if(x(b["$respond_to?"]("coerce"))){b=b.$coerce(this);var c=E(b);var f=null==c[0]?k:c[0];c=null==c[1]?k:c[1];b;return f.$__send__(a,c)}switch(a){case "+":case "-":case "*":case "/":case "%":case "&":case "|":case "^":case "**":return D.$raise(d("TypeError"),""+b.$class()+" can't be coerced into Numeric");
|
|
313
|
-
case ">":case ">=":case "<":case "<=":case "<=>":return D.$raise(d("ArgumentError"),"comparison of "+this.$class()+" with "+b.$class()+" failed");default:return k}});q(a,"$<=>",function(a){return x(this["$equal?"](a))?0:k});q(a,"$+@",B);q(a,"$-@",function(){return A(0,this)});q(a,"$%",function(a){return A(this,z(a,this.$div(a)))});q(a,"$abs",function(){return m(this,0)?this["$-@"]():this});q(a,"$abs2",function(){return z(this,this)});q(a,"$angle",function(){return m(this,0)?d(d("Math"),"PI"):0});
|
|
314
|
-
q(a,"$ceil",function(a){null==a&&(a=0);return this.$to_f().$ceil(a)},-1);q(a,"$conj",B);q(a,"$denominator",function(){return this.$to_r().$denominator()});q(a,"$div",function(a){v(a,0)&&D.$raise(d("ZeroDivisionError"),"divided by o");return G(this,a).$floor()});q(a,"$divmod",function(a){return[this.$div(a),this["$%"](a)]});q(a,"$fdiv",function(a){return G(this.$to_f(),a)});q(a,"$floor",function(a){null==a&&(a=0);return this.$to_f().$floor(a)},-1);q(a,"$i",function(){return D.$Complex(0,this)});q(a,
|
|
315
|
-
"$imag",I(0));q(a,"$integer?",I(!1));q(a,"$nonzero?",function(){return x(this["$zero?"]())?k:this});q(a,"$numerator",function(){return this.$to_r().$numerator()});q(a,"$polar",function(){return[this.$abs(),this.$arg()]});q(a,"$quo",function(a){return G(K["$coerce_to!"](this,d("Rational"),"to_r"),a)});q(a,"$real",B);q(a,"$real?",I(!0));q(a,"$rect",function(){return[this,0]});q(a,"$round",function(a){return this.$to_f().$round(a)},-1);q(a,"$step",function l(a,f,g){function e(){F===k&&D.$raise(d("TypeError"),
|
|
316
|
-
"step must be numeric");null!=F&&F["$=="](0)&&D.$raise(d("ArgumentError"),"step can't be 0");if(F===k||null==F)F=1;var a=F["$<=>"](0);a===k&&D.$raise(d("ArgumentError"),"0 can't be coerced into "+F.$class());if(O===k||null==O)O=0<a?d(d("Float"),"INFINITY"):d(d("Float"),"INFINITY")["$-@"]();K.$compare(T,O)}function p(){if(0<F&&T>O||0>F&&T<O)return 0;if(Infinity===F||-Infinity===F)return 1;var a=Math.abs,b=Math.floor;a=(a(T)+a(O)+a(O-T))/a(F)*d(d("Float"),"EPSILON");if(Infinity===a||-Infinity===a)return 0;
|
|
317
|
-
.5<a&&(a=.5);return b((O-T)/F+a)+1}function S(){e();if(0===F)return Infinity;if(0!==F%1)return p();if(0<F&&T>O||0>F&&T<O)return 0;var a=Math.ceil,b=Math.abs,d=b(T-O)+1;b=b(F);return a(d/b)}var y=l.$$p||k,O,F,T=this;var m=k;l.$$p=null;m=M(arguments);var n=t(m);n=J(n);0<m.length&&(O=m.shift());0<m.length&&(F=m.shift());m=n.$$smap.to;n=n.$$smap.by;void 0!==O&&void 0!==m&&D.$raise(d("ArgumentError"),"to is given twice");void 0!==F&&void 0!==n&&D.$raise(d("ArgumentError"),"step is given twice");void 0!==
|
|
318
|
-
m&&(O=m);void 0!==n&&(F=n);void 0===O&&(O=k);if(y===k)return(P(O)||x(O["$is_a?"](d("Numeric"))))&&(P(F)||x(F["$is_a?"](d("Numeric"))))?d(d("Enumerator"),"ArithmeticSequence").$new([O,F,x(m)?"to: ":k,x(n)?"by: ":k],T):R(T,"enum_for",["step",O,F],S.$to_proc());e();n=F["$negative?"]();m=F["$=="](0)||Infinity===O&&!n||-Infinity===O&&n;if(T.$$is_number&&F.$$is_number&&O.$$is_number){if(0!==T%1||!m&&0!==O%1||0!==F%1)if(m=T.$to_f().valueOf(),F=F.$to_f().valueOf(),O=O.$to_f().valueOf(),n=p(),isFinite(F))if(0===
|
|
319
|
-
F)for(;;)y(m);else for(m=0;m<n;m++){var q=m*F+T;if(0<=F?O<q:O>q)q=O;y(q)}else 0!==n&&y(m);else if(q=T,m)for(;;q+=F)y(q);else if(n)for(;q>=O;q+=F)y(q);else for(;q<=O;q+=F)y(q);return T}for(m=T;x(n?W(m,O):N(m,O));)b.yield1(y,m),m=H(m,F)},-1);q(a,"$to_c",function(){return D.$Complex(this,0)});q(a,"$to_int",function(){return this.$to_i()});q(a,"$truncate",function(a){null==a&&(a=0);return this.$to_f().$truncate(a)},-1);q(a,"$zero?",function(){return this["$=="](0)});q(a,"$positive?",function(){return L(this,
|
|
320
|
-
0)});q(a,"$negative?",function(){return m(this,0)});q(a,"$dup",B);q(a,"$clone",function(a){J(a);return this},-1);q(a,"$finite?",I(!0));q(a,"$infinite?",I(k));U(a,"arg","angle");U(a,"conjugate","conj");U(a,"imaginary","imag");U(a,"magnitude","abs");U(a,"modulo","%");U(a,"phase","arg");return U(a,"rectangular","rect")}("::",null)};
|
|
321
|
-
Opal.modules["corelib/array"]=function(b){var n=b.truthy,x=b.falsy,D=b.hash_ids,q=b.yield1,E=b.hash_get,B=b.hash_put,A=b.hash_delete,z=b.coerce_to,m=b.respond_to,v=b.deny_frozen_access,G=b.freeze,I=b.klass,K=b.slice,M=b.defs,t=b.Kernel,J=b.def,P=b.Opal,R=b.eqeqeq,W=b.hash2,N=b.send2,H=b.find_super,L=b.send,U=b.rb_gt,a=b.rb_times,k=b.eqeq,d=b.rb_minus,f=b.to_a,h=b.to_ary,c=b.gvars,p=b.rb_ge,T=b.assign_ivar,g=b.rb_lt,l=b.return_self,e=b.neqeq,ha=b.alias,S=b.top,y=b.nil,O=b.$$$;b.add_stubs("require,include,to_a,warn,raise,replace,respond_to?,to_ary,coerce_to?,===,join,to_str,hash,<=>,==,object_id,inspect,enum_for,class,bsearch_index,to_proc,nil?,coerce_to!,>,*,enumerator_size,empty?,size,map,equal?,dup,each,reduce,-,[],dig,eql?,length,exclude_end?,flatten,frozen?,__id__,&,!,intersection,to_s,new,item,max,min,>=,**,delete_if,reverse,rotate,rand,at,keep_if,shuffle!,<,sort,sort_by,!=,times,[]=,<<,uniq,|,values,is_a?,end,begin,upto,reject,push,select,select!,collect,collect!,unshift,pristine,singleton_class");
|
|
322
|
-
S.$require("corelib/enumerable");S.$require("corelib/numeric");return function(F,$super,S){function ea(a,c,b){for(var e,d=null,f=Array(a.length),l=0,g=0,h=a.length;l<h;l++){if(!d)try{e=q(b,a[l])}catch(aa){d=aa}if(d||c(e))f[g]=a[l],g+=1}g!==l&&(a.splice.apply(a,[0,f.length].concat(f)),a.splice(g,f.length));if(d)throw d;}function la(a,c){var e=a.length;var d=c.excl;var f=c.begin===y?0:z(c.begin,b.Integer,"to_int");var l=c.end===y?-1:z(c.end,b.Integer,"to_int");if(0>f&&(f+=e,0>f))return y;c.excl_rev&&
|
|
323
|
-
c.begin!==y&&(f+=1);if(f>e)return y;if(0>l&&(l+=e,0>l))return[];d&&c.end!==y||(l+=1);return a.slice(f,l)}function ja(a,c){return a===c||0===c?1:0<c&&a>c?ja(a-1,c-1)+ja(a-1,c):0}F=I(F,$super,"Array");S=[F].concat(S);var ka=b.$r(S);F.$include(O("Enumerable"));b.prop(F.$$prototype,"$$is_array",!0);M(F,"$[]",function(a){var c=K(arguments);c=this.$$name===b.Array?c:this.$allocate().$replace(c.$to_a());return c},-1);J(F,"$initialize",function Y(a,c){var b=Y.$$p||y;Y.$$p=null;null==a&&(a=y);null==c&&(c=
|
|
324
|
-
y);v(this);c!==y&&b!==y&&t.$warn("warning: block supersedes default value argument");a>O(O("Integer"),"MAX")&&t.$raise(O("ArgumentError"),"array size too big");2<arguments.length&&t.$raise(O("ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..2)");if(0===arguments.length)return this.splice(0,this.length),this;if(1===arguments.length){if(a.$$is_array)return this.$replace(a.$to_a()),this;if(a["$respond_to?"]("to_ary"))return this.$replace(a.$to_ary()),this}a=z(a,O("Integer"),"to_int");
|
|
325
|
-
0>a&&t.$raise(O("ArgumentError"),"negative array size");this.splice(0,this.length);var e;if(b===y)for(e=0;e<a;e++)this.push(c);else for(e=0,d;e<a;e++){var d=b(e);this[e]=d}return this},-1);M(F,"$try_convert",function(a){return P["$coerce_to?"](a,O("Array"),"to_ary")});J(F,"$&",function(a){a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();var c=[],b=W([],{}),e;var d=0;for(e=a.length;d<e;d++)B(b,a[d],!0);d=0;for(e=this.length;d<e;d++)a=this[d],void 0!==A(b,a)&&c.push(a);return c});J(F,"$|",
|
|
326
|
-
function(a){a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();var c=W([],{}),b;var e=0;for(b=this.length;e<b;e++)B(c,this[e],!0);e=0;for(b=a.length;e<b;e++)B(c,a[e],!0);return c.$keys()});J(F,"$*",function(a){if(n(a["$respond_to?"]("to_str")))return this.$join(a.$to_str());a=z(a,O("Integer"),"to_int");n(0>a)&&t.$raise(O("ArgumentError"),"negative argument");for(var c=[],b=this.$to_a(),e=0;e<a;e++)c=c.concat(b);return c});J(F,"$+",function(a){a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();
|
|
327
|
-
return this.concat(a)});J(F,"$-",function(a){a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();if(n(0===this.length))return[];if(n(0===a.length))return this.slice();var c=[],b=W([],{}),e;var d=0;for(e=a.length;d<e;d++)B(b,a[d],!0);d=0;for(e=this.length;d<e;d++)a=this[d],void 0===E(b,a)&&c.push(a);return c});J(F,"$<<",function(a){v(this);this.push(a);return this});J(F,"$<=>",function(a){if(R(O("Array"),a))a=a.$to_a();else if(n(a["$respond_to?"]("to_ary")))a=a.$to_ary().$to_a();else return y;
|
|
328
|
-
if(this.$hash()===a.$hash())return 0;for(var c=Math.min(this.length,a.length),b=0;b<c;b++){var e=this[b]["$<=>"](a[b]);if(0!==e)return e}return this.length["$<=>"](a.length)});J(F,"$==",function(a){function c(a,e){var d;if(a===e)return!0;if(!e.$$is_array)return m(e,"$to_ary")?e["$=="](a):!1;a.$$constructor!==Array&&(a=a.$to_a());e.$$constructor!==Array&&(e=e.$to_a());if(a.length!==e.length)return!1;b[a.$object_id()]=!0;var f=0;for(d=a.length;f<d;f++){var l=a[f];var g=e[f];if(l.$$is_array){if(g.$$is_array&&
|
|
329
|
-
g.length!==l.length||!b.hasOwnProperty(l.$object_id())&&!c(l,g))return!1}else if(!l["$=="](g))return!1}return!0}var b={};return c(this,a)});J(F,"$[]",function(a,c){if(a.$$is_range)return la(this,a);if(a.$$is_arithmetic_seq){c=[];var e=0;if(0>a.step){var d={begin:a.range.end,end:a.range.begin,excl:!1,excl_rev:a.range.excl};d=la(this,d).$reverse()}else d=la(this,a.range);for(;e<d.length;)c.push(d[e]),e+=Math.abs(a.step);return c}a:{e=this.length;a=z(a,b.Integer,"to_int");if(0>a&&(a+=e,0>a)){a=y;break a}void 0===
|
|
330
|
-
c?a=a>=e||0>a?y:this[a]:(c=z(c,b.Integer,"to_int"),a=0>c||a>e||0>a?y:this.slice(a,a+c))}return a},-2);J(F,"$[]=",function(a,c,e){v(this);var d=y;var f=this.length;if(a.$$is_range){d=c.$$is_array?c.$to_a():c["$respond_to?"]("to_ary")?c.$to_ary().$to_a():[c];var l=a.excl;e=a.begin===y?0:z(a.begin,b.Integer,"to_int");var g=a.end===y?-1:z(a.end,b.Integer,"to_int");0>e&&(e+=f,0>e&&t.$raise(O("RangeError"),""+a.$inspect()+" out of range"));0>g&&(g+=f);l&&a.end!==y||(g+=1);if(e>f)for(;f<e;f++)this[f]=y;
|
|
331
|
-
0>g?this.splice.apply(this,[e,0].concat(d)):this.splice.apply(this,[e,g-e].concat(d))}else{void 0===e?g=1:(g=c,c=e,d=c.$$is_array?c.$to_a():c["$respond_to?"]("to_ary")?c.$to_ary().$to_a():[c]);a=z(a,O("Integer"),"to_int");g=z(g,O("Integer"),"to_int");0>a&&(l=a,a+=f,0>a&&t.$raise(O("IndexError"),"index "+l+" too small for array; minimum "+-this.length));0>g&&t.$raise(O("IndexError"),"negative length ("+g+")");if(a>f)for(;f<a;f++)this[f]=y;void 0===e?this[a]=c:this.splice.apply(this,[a,g].concat(d))}return c},
|
|
332
|
-
-3);J(F,"$any?",function Y(a){var c=Y.$$p||y;Y.$$p=null;return 0===this.length?!1:N(this,H(this,"any?",Y,!1,!0),"any?",[a],c)},-1);J(F,"$assoc",function(a){for(var c=0,b=this.length,e;c<b;c++)if(e=this[c],e.length&&e[0]["$=="](a))return e;return y});J(F,"$at",function(a){a=z(a,O("Integer"),"to_int");0>a&&(a+=this.length);return 0>a||a>=this.length?y:this[a]});J(F,"$bsearch_index",function Y(){var a=Y.$$p||y;Y.$$p=null;if(a===y)return this.$enum_for("bsearch_index");for(var c=0,b=this.length,e,d,f=
|
|
333
|
-
!1,l=y;c<b;){e=c+Math.floor((b-c)/2);d=this[e];d=q(a,d);if(!0===d)l=e,f=!0;else if(!1===d||d===y)f=!1;else if(d.$$is_number){if(0===d)return e;f=0>d}else t.$raise(O("TypeError"),"wrong argument type "+d.$class()+" (must be numeric, true, false or nil)");f?b=e:c=e+1}return l});J(F,"$bsearch",function C(){var a=C.$$p||y;C.$$p=null;if(a===y)return this.$enum_for("bsearch");a=L(this,"bsearch_index",[],a.$to_proc());return null!=a&&a.$$is_number?this[a]:a});J(F,"$cycle",function na(c){var b=na.$$p||y;
|
|
334
|
-
na.$$p=null;null==c&&(c=y);if(b===y)return L(this,"enum_for",["cycle",c],function ba(){var b=null==ba.$$s?this:ba.$$s;if(n(c["$nil?"]()))return O(O("Float"),"INFINITY");c=P["$coerce_to!"](c,O("Integer"),"to_int");return n(U(c,0))?a(b.$enumerator_size(),c):0},{$$s:this});if(n(this["$empty?"]())||k(c,0))return y;var e;if(c===y)for(;;){var d=0;for(e=this.length;d<e;d++)q(b,this[d])}else{c=P["$coerce_to!"](c,O("Integer"),"to_int");if(0>=c)return this;for(;0<c;){d=0;for(e=this.length;d<e;d++)q(b,this[d]);
|
|
335
|
-
c--}}return this},-1);J(F,"$clear",function(){v(this);this.splice(0,this.length);return this});J(F,"$count",function ta(a){var c=ta.$$p||y;ta.$$p=null;return n(void 0!==a)||n(c)?N(this,H(this,"count",ta,!1,!0),"count",[a],c):this.$size()},-1);J(F,"$initialize_copy",function(a){return this.$replace(a)});J(F,"$collect",function ta(){var a=ta.$$p||y;ta.$$p=null;if(a===y)return L(this,"enum_for",["collect"],function da(){return(null==da.$$s?this:da.$$s).$size()},{$$s:this});for(var c=[],b=0,e=this.length;b<
|
|
336
|
-
e;b++){var d=q(a,this[b]);c.push(d)}return c});J(F,"$collect!",function Ba(){var a=Ba.$$p||y;Ba.$$p=null;if(a===y)return L(this,"enum_for",["collect!"],function da(){return(null==da.$$s?this:da.$$s).$size()},{$$s:this});v(this);for(var c=0,b=this.length;c<b;c++){var e=q(a,this[c]);this[c]=e}return this});J(F,"$combination",function qa(a){var c=qa.$$p||y,e=y;qa.$$p=null;e=P["$coerce_to!"](a,O("Integer"),"to_int");if(c===y)return L(this,"enum_for",["combination",e],function V(){return ja((null==V.$$s?
|
|
337
|
-
this:V.$$s).length,e)},{$$s:this});if(0===e)b.yield1(c,[]);else if(1===e){var d=0;for(a=this.length;d<a;d++)b.yield1(c,[this[d]])}else if(e===this.length)b.yield1(c,this.slice());else if(0<=e&&e<this.length){a=[];for(d=0;d<=e+1;d++)a.push(0);d=[];var f=0;var l=!1;for(a[0]=-1;!l;){for(d[f]=this[a[f+1]];f<e-1;)f++,l=a[f+1]=a[f]+1,d[f]=this[l];b.yield1(c,d.slice());f++;do l=0===f,a[f]++,f--;while(a[f+1]+e===this.length+f+1)}}return this});J(F,"$repeated_combination",function ba(a){function c(a,d,f,l){if(f.length==
|
|
338
|
-
a)a=f.slice(),b.yield1(e,a);else for(;d<l.length;d++)f.push(l[d]),c(a,d,f,l),f.pop()}var e=ba.$$p||y,d=y;ba.$$p=null;d=P["$coerce_to!"](a,O("Integer"),"to_int");if(e===y)return L(this,"enum_for",["repeated_combination",d],function X(){return ja((null==X.$$s?this:X.$$s).length+d-1,d)},{$$s:this});0<=d&&c(d,0,[],this);return this});J(F,"$compact",function(){for(var a=[],c=0,b=this.length,e;c<b;c++)(e=this[c])!==y&&a.push(e);return a});J(F,"$compact!",function(){v(this);for(var a=this.length,c=0,b=this.length;c<
|
|
339
|
-
b;c++)this[c]===y&&(this.splice(c,1),b--,c--);return this.length===a?y:this});J(F,"$concat",function(a){var c=K(arguments);v(this);c=L(c,"map",[],function da(a){var c=null==da.$$s?this:da.$$s;null==a&&(a=y);a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();n(a["$equal?"](c))&&(a=a.$dup());return a},{$$s:this});L(c,"each",[],function Q(a){var c=null==Q.$$s?this:Q.$$s;null==a&&(a=y);for(var b=0,e=a.length;b<e;b++)c.push(a[b])},{$$s:this});return this},-1);J(F,"$delete",function ca(a){var c=
|
|
340
|
-
ca.$$p||y;ca.$$p=null;for(var e=this.length,d=0,f=e;d<f;d++)this[d]["$=="](a)&&(v(this),this.splice(d,1),f--,d--);return this.length===e?c!==y?b.yieldX(c,[]):y:a});J(F,"$delete_at",function(a){v(this);a=z(a,O("Integer"),"to_int");0>a&&(a+=this.length);if(0>a||a>=this.length)return y;var c=this[a];this.splice(a,1);return c});J(F,"$delete_if",function ca(){var a=ca.$$p||y;ca.$$p=null;if(a===y)return L(this,"enum_for",["delete_if"],function Q(){return(null==Q.$$s?this:Q.$$s).$size()},{$$s:this});v(this);
|
|
341
|
-
ea(this,x,a);return this});J(F,"$difference",function(a){var c=K(arguments);return L(c,"reduce",[this.$to_a().$dup()],function(a,c){null==a&&(a=y);null==c&&(c=y);return d(a,c)})},-1);J(F,"$dig",function(a,c){var b=K(arguments,1);var e=this["$[]"](a);if(e===y||0===b.length)return e;n(e["$respond_to?"]("dig"))||t.$raise(O("TypeError"),""+e.$class()+" does not have #dig method");return L(e,"dig",f(b))},-2);J(F,"$drop",function(a){a=z(a,O("Integer"),"to_int");0>a&&t.$raise(O("ArgumentError"));return this.slice(a)});
|
|
342
|
-
J(F,"$dup",function xa(){var a=xa.$$p||y;xa.$$p=null;return this.$$class===b.Array&&this.$$class.$allocate.$$pristine&&this.$copy_instance_variables.$$pristine&&this.$initialize_dup.$$pristine?this.slice(0):N(this,H(this,"dup",xa,!1,!0),"dup",[],a)});J(F,"$each",function da(){var a=da.$$p||y;da.$$p=null;if(a===y)return L(this,"enum_for",["each"],function fa(){return(null==fa.$$s?this:fa.$$s).$size()},{$$s:this});for(var c=0,b=this.length;c<b;c++)q(a,this[c]);return this});J(F,"$each_index",function Q(){var a=
|
|
343
|
-
Q.$$p||y;Q.$$p=null;if(a===y)return L(this,"enum_for",["each_index"],function ma(){return(null==ma.$$s?this:ma.$$s).$size()},{$$s:this});for(var c=0,b=this.length;c<b;c++)q(a,c);return this});J(F,"$empty?",function(){return 0===this.length});J(F,"$eql?",function(a){function c(a,e){var d;if(!e.$$is_array)return!1;e=e.$to_a();if(a.length!==e.length)return!1;b[a.$object_id()]=!0;var f=0;for(d=a.length;f<d;f++){var l=a[f];var g=e[f];if(l.$$is_array){if(g.$$is_array&&g.length!==l.length||!b.hasOwnProperty(l.$object_id())&&
|
|
344
|
-
!c(l,g))return!1}else if(!l["$eql?"](g))return!1}return!0}var b={};return c(this,a)});J(F,"$fetch",function sa(a,c){var b=sa.$$p||y;sa.$$p=null;var e=a;a=z(a,O("Integer"),"to_int");0>a&&(a+=this.length);if(0<=a&&a<this.length)return this[a];b!==y&&null!=c&&this.$warn("warning: block supersedes default value argument");if(b!==y)return b(e);if(null!=c)return c;0===this.length?t.$raise(O("IndexError"),"index "+e+" outside of array bounds: 0...0"):t.$raise(O("IndexError"),"index "+e+" outside of array bounds: -"+
|
|
345
|
-
this.length+"..."+this.length)},-2);J(F,"$fill",function sa(a){var c=sa.$$p||y,b=y;sa.$$p=null;var e=K(arguments);v(this);if(n(c)){n(2<e.length)&&t.$raise(O("ArgumentError"),"wrong number of arguments ("+e.$length()+" for 0..2)");var d=e;var f=h(d);e=null==f[0]?y:f[0];f=null==f[1]?y:f[1]}else n(0==e.length)?t.$raise(O("ArgumentError"),"wrong number of arguments (0 for 1..3)"):n(3<e.length)&&t.$raise(O("ArgumentError"),"wrong number of arguments ("+e.$length()+" for 1..3)"),d=e,f=h(d),b=null==f[0]?
|
|
346
|
-
y:f[0],e=null==f[1]?y:f[1],f=null==f[2]?y:f[2];d;if(R(O("Range"),e)){if(n(f)&&t.$raise(O("TypeError"),"length invalid with range"),d=e.begin===y?0:z(e.begin,O("Integer"),"to_int"),n(0>d)&&(d+=this.length),n(0>d)&&t.$raise(O("RangeError"),""+e.$inspect()+" out of range"),f=e.end===y?-1:z(e.end,O("Integer"),"to_int"),n(0>f)&&(f+=this.length),n(e["$exclude_end?"]())||(f+=1),n(f<=d))return this}else if(n(e))if(d=z(e,O("Integer"),"to_int"),n(0>d)&&(d+=this.length),n(0>d)&&(d=0),n(f)){f=z(f,O("Integer"),
|
|
347
|
-
"to_int");if(n(0==f))return this;f+=d}else f=this.length;else d=0,f=this.length;if(n(d>this.length))for(e=this.length;e<f;e++)this[e]=y;n(f>this.length)&&(this.length=f);if(n(c))for(;d<f;d++)b=c(d),this[d]=b;else for(;d<f;d++)this[d]=b;return this},-1);J(F,"$first",function(a){if(null==a)return 0===this.length?y:this[0];a=z(a,O("Integer"),"to_int");0>a&&t.$raise(O("ArgumentError"),"negative array size");return this.slice(0,a)},-1);J(F,"$flatten",function(a){function c(a,e){var d=[],f;a=a.$to_a();
|
|
348
|
-
var l=0;for(f=a.length;l<f;l++){var g=a[l];if(m(g,"$to_ary",!0)){var h=g.$to_ary();if(h===y)d.push(g);else switch(h.$$is_array||t.$raise(O("TypeError")),h===b&&t.$raise(O("ArgumentError")),e){case void 0:d=d.concat(c(h));break;case 0:d.push(h);break;default:d.push.apply(d,c(h,e-1))}}else d.push(g)}return d}var b=this;void 0!==a&&(a=z(a,O("Integer"),"to_int"));return c(b,a)},-1);J(F,"$flatten!",function(a){v(this);a=this.$flatten(a);if(this.length==a.length){for(var c=0,b=this.length;c<b&&this[c]===
|
|
349
|
-
a[c];c++);if(c==b)return y}this.$replace(a);return this},-1);J(F,"$freeze",function(){return n(this["$frozen?"]())?this:G(this)});J(F,"$hash",function(){var a=void 0===D,c=["A"],b=this.$object_id(),e,d;try{a&&(D=Object.create(null));if(D[b])return"self";for(d in D){var f=D[d];if(this["$eql?"](f))return"self"}D[b]=this;for(e=0;e<this.length;e++)f=this[e],c.push(f.$hash());return c.join(",")}finally{a&&(D=void 0)}});J(F,"$include?",function(a){for(var c=0,b=this.length;c<b;c++)if(this[c]["$=="](a))return!0;
|
|
350
|
-
return!1});J(F,"$index",function fa(a){var c=fa.$$p||y;fa.$$p=null;var b;null!=a&&c!==y&&this.$warn("warning: given block not used");if(null!=a){var e=0;for(b=this.length;e<b;e++)if(this[e]["$=="](a))return e}else if(c!==y)for(e=0,b=this.length;e<b;e++){if(a=c(this[e]),!1!==a&&a!==y)return e}else return this.$enum_for("index");return y},-1);J(F,"$insert",function(a,c){var b=K(arguments,1);v(this);a=z(a,O("Integer"),"to_int");if(0<b.length){0>a&&(a+=this.length+1,0>a&&t.$raise(O("IndexError"),""+a+
|
|
351
|
-
" is out of bounds"));if(a>this.length)for(var e=this.length;e<a;e++)this.push(y);this.splice.apply(this,[a,0].concat(b))}return this},-2);var u=[];J(F,"$inspect",function(){var a=[],c=this.$__id__(),b=!0;a:{try{if(-1!==u.indexOf(c)){b=!1;var e="[...]";break a}u.push(c);c=0;for(var d=this.length;c<d;c++){var f=this["$[]"](c);a.push(ka("Opal").$inspect(f))}e="["+a.join(", ")+"]";break a}finally{b&&u.pop()}e=void 0}return e});J(F,"$intersection",function(a){var c=K(arguments);return L(c,"reduce",[this.$to_a().$dup()],
|
|
352
|
-
function(a,c){null==a&&(a=y);null==c&&(c=y);return a["$&"](c)})},-1);J(F,"$intersect?",function(a){return this.$intersection(a)["$empty?"]()["$!"]()});J(F,"$join",function(a){null==c[","]&&(c[","]=y);null==a&&(a=y);if(n(0===this.length))return"";n(a===y)&&(a=c[","]);var b=[],e;var d=0;for(e=this.length;d<e;d++){var f=this[d];if(m(f,"$to_str")){var l=f.$to_str();if(l!==y){b.push(l.$to_s());continue}}if(m(f,"$to_ary")&&(l=f.$to_ary(),l===this&&t.$raise(O("ArgumentError")),l!==y)){b.push(l.$join(a));
|
|
353
|
-
continue}if(m(f,"$to_s")&&(l=f.$to_s(),l!==y)){b.push(l);continue}t.$raise(O("NoMethodError").$new(""+ka("Opal").$inspect(this.$item())+" doesn't respond to #to_str, #to_ary or #to_s","to_str"))}return a===y?b.join(""):b.join(P["$coerce_to!"](a,O("String"),"to_str").$to_s())},-1);J(F,"$keep_if",function fa(){var a=fa.$$p||y;fa.$$p=null;if(a===y)return L(this,"enum_for",["keep_if"],function ia(){return(null==ia.$$s?this:ia.$$s).$size()},{$$s:this});v(this);ea(this,n,a);return this});J(F,"$last",function(a){if(null==
|
|
354
|
-
a)return 0===this.length?y:this[this.length-1];a=z(a,O("Integer"),"to_int");0>a&&t.$raise(O("ArgumentError"),"negative array size");a>this.length&&(a=this.length);return this.slice(this.length-a,this.length)},-1);J(F,"$length",function(){return this.length});J(F,"$max",function oa(a){var c=oa.$$p||y;oa.$$p=null;return L(this.$each(),"max",[a],c.$to_proc())},-1);J(F,"$min",function oa(){var a=oa.$$p||y;oa.$$p=null;return L(this.$each(),"min",[],a.$to_proc())});J(F,"$permutation",function va(a){var c=
|
|
355
|
-
va.$$p||y,e=this,d=y,f=y;va.$$p=null;if(c===y)return L(e,"enum_for",["permutation",a],function Ia(){var c=null==Ia.$$s?this:Ia.$$s,b=c.length;c=void 0===a?c.length:a;for(var e=0<=c?1:0;c;)e*=b,b--,c--;return e},{$$s:e});var l;a=void 0===a?e.length:z(a,O("Integer"),"to_int");if(!(0>a||e.length<a))if(0===a)b.yield1(c,[]);else if(1===a)for(d=0;d<e.length;d++)b.yield1(c,[e[d]]);else{d=ka("Array").$new(a);f=ka("Array").$new(e.length,!1);var g=function(a,c,b,d,f){e=this;for(var h=0;h<e.length;h++)if(d["$[]"](h)["$!"]())if(c[b]=
|
|
356
|
-
h,b<a-1)d[h]=!0,g.call(e,a,c,b+1,d,f),d[h]=!1;else{l=[];for(var p=0;p<c.length;p++)l.push(e[c[p]]);q(f,l)}};if(c!==y){var h=e.slice();g.call(h,a,d,0,f,c)}else g.call(e,a,d,0,f,c)}return e},-1);J(F,"$repeated_permutation",function za(a){function c(a,d,f){if(d.length==a)a=d.slice(),b.yield1(e,a);else for(var l=0;l<f.length;l++)d.push(f[l]),c(a,d,f),d.pop()}var e=za.$$p||y,d=y;za.$$p=null;d=P["$coerce_to!"](a,O("Integer"),"to_int");if(e===y)return L(this,"enum_for",["repeated_permutation",d],function Aa(){var a=
|
|
357
|
-
null==Aa.$$s?this:Aa.$$s;return n(p(d,0))?a.$size()["$**"](d):0},{$$s:this});c(d,[],this.slice());return this});J(F,"$pop",function(a){v(this);if(n(void 0===a))return n(0===this.length)?y:this.pop();a=z(a,O("Integer"),"to_int");n(0>a)&&t.$raise(O("ArgumentError"),"negative array size");return n(0===this.length)?[]:n(1===a)?[this.pop()]:n(a>this.length)?this.splice(0,this.length):this.splice(this.length-a,this.length)},-1);J(F,"$product",function Ca(a){var c=Ca.$$p||y;Ca.$$p=null;var e=K(arguments);
|
|
358
|
-
var d=c!==y?null:[],f=e.length+1,l=Array(f),g=Array(f),h=Array(f),p;var u=1;h[0]=this;for(p=1;p<f;p++)h[p]=z(e[p-1],O("Array"),"to_ary");for(p=0;p<f;p++){e=h[p].length;if(0===e)return d||this;u*=e;2147483647<u&&t.$raise(O("RangeError"),"too big to product");g[p]=e;l[p]=0}a:for(;;){u=[];for(p=0;p<f;p++)u.push(h[p][l[p]]);d?d.push(u):b.yield1(c,u);p=f-1;for(l[p]++;l[p]===g[p];){l[p]=0;if(0>--p)break a;l[p]++}}return d||this},-1);J(F,"$push",function(a){var c=K(arguments);v(this);for(var b=0,e=c.length;b<
|
|
359
|
-
e;b++)this.push(c[b]);return this},-1);J(F,"$rassoc",function(a){for(var c=0,b=this.length,e;c<b;c++)if(e=this[c],e.length&&void 0!==e[1]&&e[1]["$=="](a))return e;return y});J(F,"$reject",function Ca(){var a=Ca.$$p||y;Ca.$$p=null;if(a===y)return L(this,"enum_for",["reject"],function Ia(){return(null==Ia.$$s?this:Ia.$$s).$size()},{$$s:this});for(var c=[],b=0,e=this.length,d;b<e;b++)d=a(this[b]),!1!==d&&d!==y||c.push(this[b]);return c});J(F,"$reject!",function ua(){var a=ua.$$p||y,c=y;ua.$$p=null;if(a===
|
|
360
|
-
y)return L(this,"enum_for",["reject!"],function ya(){return(null==ya.$$s?this:ya.$$s).$size()},{$$s:this});v(this);c=this.$length();L(this,"delete_if",[],a.$to_proc());return k(this.$length(),c)?y:this});J(F,"$replace",function(a){v(this);a=R(O("Array"),a)?a.$to_a():z(a,O("Array"),"to_ary").$to_a();this.splice(0,this.length);this.push.apply(this,a);return this});J(F,"$reverse",function(){return this.slice(0).reverse()});J(F,"$reverse!",function(){v(this);return this.reverse()});J(F,"$reverse_each",
|
|
361
|
-
function Da(){var a=Da.$$p||y;Da.$$p=null;if(a===y)return L(this,"enum_for",["reverse_each"],function ya(){return(null==ya.$$s?this:ya.$$s).$size()},{$$s:this});L(this.$reverse(),"each",[],a.$to_proc());return this});J(F,"$rindex",function Aa(a){var c=Aa.$$p||y;Aa.$$p=null;var b;null!=a&&c!==y&&this.$warn("warning: given block not used");if(null!=a)for(b=this.length-1;0<=b&&!(b>=this.length);b--){if(this[b]["$=="](a))return b}else if(c!==y)for(b=this.length-1;0<=b&&!(b>=this.length);b--){if(a=c(this[b]),
|
|
362
|
-
!1!==a&&a!==y)return b}else if(null==a)return this.$enum_for("rindex");return y},-1);J(F,"$rotate",function(a){null==a&&(a=1);a=z(a,O("Integer"),"to_int");if(1===this.length)return this.slice();if(0===this.length)return[];var c=this.slice();var b=a%c.length;a=c.slice(b);c=c.slice(0,b);return a.concat(c)},-1);J(F,"$rotate!",function(a){null==a&&(a=1);v(this);if(0===this.length||1===this.length)return this;a=z(a,O("Integer"),"to_int");a=this.$rotate(a);return this.$replace(a)},-1);(function(a,$super){a=
|
|
363
|
-
I(a,$super,"SampleRandom");a.$$prototype.rng=y;J(a,"$initialize",T("rng"));return J(a,"$rand",function(a){var c=z(this.rng.$rand(a),O("Integer"),"to_int");n(0>c)&&t.$raise(O("RangeError"),"random value must be >= 0");n(c<a)||t.$raise(O("RangeError"),"random value must be less than Array size");return c})})(F,null);J(F,"$sample",function(a,c){var b=y;if(n(void 0===a))return this.$at(t.$rand(this.length));n(void 0===c)?n(c=P["$coerce_to?"](a,O("Hash"),"to_hash"))?a=y:(c=y,a=z(a,O("Integer"),"to_int")):
|
|
364
|
-
(a=z(a,O("Integer"),"to_int"),c=z(c,O("Hash"),"to_hash"));n(a)&&n(0>a)&&t.$raise(O("ArgumentError"),"count must be greater than 0");n(c)&&(b=c["$[]"]("random"));b=n(b)&&n(b["$respond_to?"]("rand"))?ka("SampleRandom").$new(b):t;if(!n(a))return this[b.$rand(this.length)];a>this.length&&(a=this.length);switch(a){case 0:return[];case 1:return[this[b.$rand(this.length)]];case 2:var e=b.$rand(this.length);var d=b.$rand(this.length-1);e<=d&&d++;return[this[e],this[d]];default:if(3<this.length/a){var f=!1;
|
|
365
|
-
var l=0;c=ka("Array").$new(a);e=1;for(c[0]=b.$rand(this.length);e<a;){var g=b.$rand(this.length);for(d=0;d<e;){for(;g===c[d];){l++;if(100<l){f=!0;break}g=b.$rand(this.length)}if(f)break;d++}if(f)break;c[e]=g;e++}if(!f){for(e=0;e<a;)c[e]=this[c[e]],e++;return c}}c=this.slice();for(e=0;e<a;e++)f=b.$rand(this.length-e)+e,l=c[e],c[e]=c[f],c[f]=l;return a===this.length?c:c["$[]"](0,a)}},-1);J(F,"$select",function Aa(){var a=Aa.$$p||y;Aa.$$p=null;if(a===y)return L(this,"enum_for",["select"],function Fa(){return(null==
|
|
366
|
-
Fa.$$s?this:Fa.$$s).$size()},{$$s:this});for(var c=[],b=0,e=this.length,d,f;b<e;b++)d=this[b],f=q(a,d),n(f)&&c.push(d);return c});J(F,"$select!",function ya(){var a=ya.$$p||y;ya.$$p=null;if(a===y)return L(this,"enum_for",["select!"],function La(){return(null==La.$$s?this:La.$$s).$size()},{$$s:this});v(this);var c=this.length;L(this,"keep_if",[],a.$to_proc());return this.length===c?y:this});J(F,"$shift",function(a){v(this);if(n(void 0===a)){if(n(0===this.length))return y;a=this[0];for(var c=1,b=this.length;c<
|
|
367
|
-
b;c++)this[c-1]=this[c];this.pop();return a}a=z(a,O("Integer"),"to_int");n(0>a)&&t.$raise(O("ArgumentError"),"negative array size");return n(0===this.length)?[]:this.splice(0,a)},-1);J(F,"$shuffle",function(a){return this.$dup().$to_a()["$shuffle!"](a)},-1);J(F,"$shuffle!",function(a){v(this);var c,b=this.length;void 0!==a&&(a=P["$coerce_to?"](a,O("Hash"),"to_hash"),a!==y&&(a=a["$[]"]("random"),a!==y&&a["$respond_to?"]("rand")&&(c=a)));for(;b;){c?(a=c.$rand(b).$to_int(),0>a&&t.$raise(O("RangeError"),
|
|
368
|
-
"random number too small "+a),a>=b&&t.$raise(O("RangeError"),"random number too big "+a)):a=this.$rand(b);var e=this[--b];this[b]=this[a];this[a]=e}return this},-1);J(F,"$slice!",function(a,c){v(this);if(n(void 0===c))if(R(O("Range"),a)){var b=this["$[]"](a);c=a.begin===y?0:z(a.begin,O("Integer"),"to_int");var e=a.end===y?-1:z(a.end,O("Integer"),"to_int");0>c&&(c+=this.length);0>e?e+=this.length:e>=this.length&&(e=this.length-1,a.excl&&(e+=1));var d=e-c;a.excl&&a.end!==y?--e:d+=1;c<this.length&&0<=
|
|
369
|
-
c&&e<this.length&&0<=e&&0<d&&this.splice(c,d)}else{a=z(a,O("Integer"),"to_int");0>a&&(a+=this.length);if(0>a||a>=this.length)return y;b=this[a];0===a?this.shift():this.splice(a,1)}else{a=z(a,O("Integer"),"to_int");c=z(c,O("Integer"),"to_int");if(0>c)return y;b=this["$[]"](a,c);0>a&&(a+=this.length);a+c>this.length&&(c=this.length-a);a<this.length&&0<=a&&this.splice(a,c)}return b},-2);J(F,"$sort",function Ha(){var a=Ha.$$p||y;Ha.$$p=null;if(!n(1<this.length))return this;a===y&&(a=function(a,c){return a["$<=>"](c)});
|
|
370
|
-
return this.slice().sort(function(c,b){var e=a(c,b);e===y&&t.$raise(O("ArgumentError"),"comparison of "+c.$inspect()+" with "+b.$inspect()+" failed");return U(e,0)?1:g(e,0)?-1:0})});J(F,"$sort!",function Ia(){var a=Ia.$$p||y;Ia.$$p=null;v(this);a=a!==y?L(this.slice(),"sort",[],a.$to_proc()):this.slice().$sort();for(var c=this.length=0,b=a.length;c<b;c++)this.push(a[c]);return this});J(F,"$sort_by!",function Ka(){var a=Ka.$$p||y;Ka.$$p=null;if(a===y)return L(this,"enum_for",["sort_by!"],function Ma(){return(null==
|
|
371
|
-
Ma.$$s?this:Ma.$$s).$size()},{$$s:this});v(this);return this.$replace(L(this,"sort_by",[],a.$to_proc()))});J(F,"$take",function(a){0>a&&t.$raise(O("ArgumentError"));return this.slice(0,a)});J(F,"$take_while",function La(){var a=La.$$p||y;La.$$p=null;for(var c=[],b=0,e=this.length,d,f;b<e;b++){d=this[b];f=a(d);if(!1===f||f===y)break;c.push(d)}return c});J(F,"$to_a",function(){return this.$$class===b.Array?this:b.Array.$new(this)});J(F,"$to_ary",l);J(F,"$to_h",function Qa(){var a=Qa.$$p||y;Qa.$$p=null;
|
|
372
|
-
var c=this;a!==y&&(c=L(c,"map",[],a.$to_proc()));var b=c.length,e=W([],{});for(a=0;a<b;a++){var d=P["$coerce_to?"](c[a],O("Array"),"to_ary");d.$$is_array||t.$raise(O("TypeError"),"wrong element type "+d.$class()+" at "+a+" (expected array)");2!==d.length&&t.$raise(O("ArgumentError"),"wrong array length at "+a+" (expected 2, was "+d.$length()+")");var f=d[0];d=d[1];B(e,f,d)}return e});J(F,"$transpose",function(){var a=y,c=y;if(n(this["$empty?"]()))return[];a=[];c=y;L(this,"each",[],function(b){var d=
|
|
373
|
-
y;null==b&&(b=y);b=R(O("Array"),b)?b.$to_a():z(b,O("Array"),"to_ary").$to_a();c=n(d=c)?d:b.length;e(b.length,c)&&t.$raise(O("IndexError"),"element size differs ("+b.length+" should be "+c+")");return L(b.length,"times",[],function(c){var e;null==c&&(c=y);return(n(d=a["$[]"](c))?d:(e=[c,[]],L(a,"[]=",e),e[e.length-1]))["$<<"](b.$at(c))})});return a});J(F,"$union",function(a){var c=K(arguments);return L(c,"reduce",[this.$uniq()],function(a,c){null==a&&(a=y);null==c&&(c=y);return a["$|"](c)})},-1);J(F,
|
|
374
|
-
"$uniq",function Ma(){var a=Ma.$$p||y;Ma.$$p=null;var c=W([],{}),b;if(a===y){var e=0;for(b=this.length;e<b;e++){var d=this[e];void 0===E(c,d)&&B(c,d,d)}}else for(e=0,b=this.length;e<b;e++){d=this[e];var f=q(a,d);void 0===E(c,f)&&B(c,f,d)}return c.$values()});J(F,"$uniq!",function Fa(){var a=Fa.$$p||y;Fa.$$p=null;v(this);var c=this.length,b=W([],{}),e;var d=0;for(e=c;d<e;d++){var f=this[d];var l=a===y?f:q(a,f);void 0===E(b,l)?B(b,l,f):(this.splice(d,1),e--,d--)}return this.length===c?y:this});J(F,
|
|
375
|
-
"$unshift",function(a){var c=K(arguments);v(this);var b=this.length,e=c.length;if(0==e)return this;for(var d=b-e,f=0;f<e;f++)this.push(this[d+f]);for(--b;0<=b-e;)this[b]=this[b-e],b--;for(b=0;b<e;b++)this[b]=c[b];return this},-1);J(F,"$values_at",function(a){var c=y;var b=K(arguments);c=[];L(b,"each",[],function Ra(a){var b=null==Ra.$$s?this:Ra.$$s,e=y,d=y;e=y;null==a&&(a=y);if(n(a["$is_a?"](O("Range")))){e=a.$end()===y?-1:z(a.$end(),O("Integer"),"to_int");d=a.$begin()===y?0:z(a.$begin(),O("Integer"),
|
|
376
|
-
"to_int");if(0>d)return d+=b.length,y;0>e&&(e+=b.length);a["$exclude_end?"]()&&a.$end()!==y&&e--;return e<d?y:L(d,"upto",[e],function Oa(a){var b=null==Oa.$$s?this:Oa.$$s;null==a&&(a=y);return c["$<<"](b.$at(a))},{$$s:b})}e=z(a,O("Integer"),"to_int");return c["$<<"](b.$at(e))},{$$s:this});return c},-1);J(F,"$zip",function Ja(a){var c=Ja.$$p||y,e=y;Ja.$$p=null;var d=K(arguments);var f=[],l=this.length,g,h;var p=0;for(h=d.length;p<h;p++){var u=d[p];u.$$is_array||(d[p]=u.$$is_range||u.$$is_enumerator?
|
|
377
|
-
u.$take(l):(n(e=P["$coerce_to?"](u,O("Array"),"to_ary"))?e:P["$coerce_to!"](u,O("Enumerator"),"to_enum","each")).$to_a())}for(g=0;g<l;g++){e=[this[g]];p=0;for(h=d.length;p<h;p++)u=d[p][g],null==u&&(u=y),e[p+1]=u;f[g]=e}if(c!==y){for(g=0;g<l;g++)b.yield1(c,f[g]);return y}return f},-1);M(F,"$inherited",function(a){a.$$prototype.$to_a=function(){return this.slice(0,this.length)}});J(F,"$instance_variables",function Ja(){var a=Ja.$$p||y;Ja.$$p=null;return L(N(this,H(this,"instance_variables",Ja,!1,!0),
|
|
378
|
-
"instance_variables",[],a),"reject",[],function(a){var c;null==a&&(a=y);return n(c=/^@\d+$/.test(a))?c:a["$=="]("@length")})});J(F,"$pack",function(a){K(arguments);return t.$raise("To use Array#pack, you must first require 'corelib/array/pack'.")},-1);ha(F,"append","push");ha(F,"filter","select");ha(F,"filter!","select!");ha(F,"map","collect");ha(F,"map!","collect!");ha(F,"prepend","unshift");ha(F,"size","length");ha(F,"slice","[]");ha(F,"to_s","inspect");P.$pristine(F.$singleton_class(),"allocate");
|
|
379
|
-
return P.$pristine(F,"copy_instance_variables","initialize_dup")}("::",Array,[])};
|
|
380
|
-
Opal.modules["corelib/hash"]=function(b){var n=b.yield1,x=b.hash,D=b.hash_init,q=b.hash_get,E=b.hash_put,B=b.hash_delete,A=b.deny_frozen_access,z=b.freeze,m=b.klass,v=b.slice,G=b.Opal,I=b.Kernel,K=b.defs,M=b.def,t=b.send,J=b.rb_ge,P=b.rb_gt,R=b.hash2,W=b.truthy,N=b.to_a,H=b.return_self,L=b.alias,U=b.top,a=b.nil,k=b.$$$;b.add_stubs("require,include,coerce_to?,[],merge!,allocate,raise,coerce_to!,each,fetch,>=,>,==,compare_by_identity,lambda?,abs,arity,enum_for,size,respond_to?,class,dig,except!,dup,delete,new,inspect,map,to_proc,flatten,frozen?,eql?,default,default_proc,default_proc=,default=,to_h,proc,clone,select,select!,has_key?,indexes,index,length,[]=,has_value?");U.$require("corelib/enumerable");
|
|
381
|
-
return function(d,$super,h){d=m(d,$super,"Hash");h=[d].concat(h);var c=b.$r(h);d.$include(k("Enumerable"));d.$$prototype.$$is_hash=!0;K(d,"$[]",function(c){var b=v(arguments);var d=b.length,e;if(1===d){var h=G["$coerce_to?"](b["$[]"](0),k("Hash"),"to_hash");if(h!==a)return this.$allocate()["$merge!"](h);b=G["$coerce_to?"](b["$[]"](0),k("Array"),"to_ary");b===a&&I.$raise(k("ArgumentError"),"odd number of arguments for Hash");d=b.length;h=this.$allocate();for(e=0;e<d;e++)if(b[e].$$is_array)switch(b[e].length){case 1:h.$store(b[e][0],
|
|
382
|
-
a);break;case 2:h.$store(b[e][0],b[e][1]);break;default:I.$raise(k("ArgumentError"),"invalid number of elements ("+b[e].length+" for 1..2)")}return h}0!==d%2&&I.$raise(k("ArgumentError"),"odd number of arguments for Hash");h=this.$allocate();for(e=0;e<d;e+=2)h.$store(b[e],b[e+1]);return h},-1);K(d,"$allocate",function(){var c=new this.$$constructor;D(c);c.$$none=a;c.$$proc=a;return c});K(d,"$try_convert",function(a){return G["$coerce_to?"](a,k("Hash"),"to_hash")});M(d,"$initialize",function l(c){var b=
|
|
383
|
-
l.$$p||a;l.$$p=null;A(this);void 0!==c&&b!==a&&I.$raise(k("ArgumentError"),"wrong number of arguments (1 for 0)");this.$$none=void 0===c?a:c;this.$$proc=b;return this},-1);M(d,"$==",function(a){if(this===a)return!0;if(!a.$$is_hash||this.$$keys.length!==a.$$keys.length)return!1;for(var c=0,b=this.$$keys,d=b.length,g,h;c<d;c++)if(g=b[c],g.$$is_string?(h=this.$$smap[g],g=a.$$smap[g]):(h=g.value,g=q(a,g.key)),void 0===g||!h["$eql?"](g))return!1;return!0});M(d,"$>=",function(c){var b=a;c=G["$coerce_to!"](c,
|
|
384
|
-
k("Hash"),"to_hash");if(this.$$keys.length<c.$$keys.length)return!1;b=!0;t(c,"each",[],function y(c,d){var l=null==y.$$s?this:y.$$s;null==c&&(c=a);null==d&&(d=a);c=l.$fetch(c,null);if(null==c||c!==d)b=!1},{$$s:this});return b});M(d,"$>",function(a){a=G["$coerce_to!"](a,k("Hash"),"to_hash");return this.$$keys.length<=a.$$keys.length?!1:J(this,a)});M(d,"$<",function(a){a=G["$coerce_to!"](a,k("Hash"),"to_hash");return P(a,this)});M(d,"$<=",function(a){a=G["$coerce_to!"](a,k("Hash"),"to_hash");return J(a,
|
|
385
|
-
this)});M(d,"$[]",function(a){var c=q(this,a);return void 0!==c?c:this.$default(a)});M(d,"$[]=",function(a,c){A(this);E(this,a,c);return c});M(d,"$assoc",function(c){for(var b=0,e=this.$$keys,d=e.length,g;b<d;b++)if(g=e[b],g.$$is_string){if(g["$=="](c))return[g,this.$$smap[g]]}else if(g.key["$=="](c))return[g.key,g.value];return a});M(d,"$clear",function(){A(this);D(this);return this});M(d,"$clone",function(){var a=new this.$$class;D(a);b.hash_clone(this,a);return a});M(d,"$compact",function(){for(var c=
|
|
386
|
-
x(),b=0,e=this.$$keys,d=e.length,h,p;b<d;b++)h=e[b],h.$$is_string?p=this.$$smap[h]:(p=h.value,h=h.key),p!==a&&E(c,h,p);return c});M(d,"$compact!",function(){A(this);for(var c=!1,b=0,e=this.$$keys,d=e.length,h,p;b<d;b++)h=e[b],h.$$is_string?p=this.$$smap[h]:(p=h.value,h=h.key),p===a&&void 0!==B(this,h)&&(c=!0,d--,b--);return c?this:a});M(d,"$compare_by_identity",function(){A(this);var a,c=this.$$keys;if(this.$$by_identity)return this;if(0===this.$$keys.length)return this.$$by_identity=!0,this;var b=
|
|
387
|
-
R([],{}).$compare_by_identity();var d=0;for(a=c.length;d<a;d++){var h=c[d];h.$$is_string||(h=h.key);E(b,h,q(this,h))}this.$$by_identity=!0;this.$$map=b.$$map;this.$$smap=b.$$smap;return this});M(d,"$compare_by_identity?",function(){return!0===this.$$by_identity});M(d,"$default",function(c){return void 0!==c&&this.$$proc!==a&&void 0!==this.$$proc?this.$$proc.$call(this,c):void 0===this.$$none?a:this.$$none},-1);M(d,"$default=",function(c){A(this);this.$$proc=a;return this.$$none=c});M(d,"$default_proc",
|
|
388
|
-
function(){return void 0!==this.$$proc?this.$$proc:a});M(d,"$default_proc=",function(c){A(this);var b=c;b!==a&&(b=G["$coerce_to!"](b,k("Proc"),"to_proc"),b["$lambda?"]()&&2!==b.$arity().$abs()&&I.$raise(k("TypeError"),"default_proc takes two arguments"));this.$$none=a;this.$$proc=b;return c});M(d,"$delete",function e(c){var d=e.$$p||a;e.$$p=null;A(this);var l=B(this,c);return void 0!==l?l:d!==a?b.yield1(d,c):a});M(d,"$delete_if",function e(){var c=e.$$p||a;e.$$p=null;if(!W(c))return t(this,"enum_for",
|
|
389
|
-
["delete_if"],function ea(){return(null==ea.$$s?this:ea.$$s).$size()},{$$s:this});A(this);for(var b=0,d=this.$$keys,h=d.length,p,k;b<h;b++)p=d[b],p.$$is_string?k=this.$$smap[p]:(k=p.value,p=p.key),k=c(p,k),!1!==k&&k!==a&&void 0!==B(this,p)&&(h--,b--);return this});M(d,"$dig",function(c,b){var e=v(arguments,1);var d=this["$[]"](c);if(d===a||0===e.length)return d;W(d["$respond_to?"]("dig"))||I.$raise(k("TypeError"),""+d.$class()+" does not have #dig method");return t(d,"dig",N(e))},-2);M(d,"$each",
|
|
390
|
-
function ha(){var c=ha.$$p||a;ha.$$p=null;if(!W(c))return t(this,"enum_for",["each"],function ra(){return(null==ra.$$s?this:ra.$$s).$size()},{$$s:this});for(var b=0,d=this.$$keys.slice(),h=d.length,p,k;b<h;b++)p=d[b],p.$$is_string?k=this.$$smap[p]:(k=p.value,p=p.key),n(c,[p,k]);return this});M(d,"$each_key",function S(){var c=S.$$p||a;S.$$p=null;if(!W(c))return t(this,"enum_for",["each_key"],function ra(){return(null==ra.$$s?this:ra.$$s).$size()},{$$s:this});for(var b=0,d=this.$$keys.slice(),h=d.length,
|
|
391
|
-
p;b<h;b++)p=d[b],c(p.$$is_string?p:p.key);return this});M(d,"$each_value",function y(){var c=y.$$p||a;y.$$p=null;if(!W(c))return t(this,"enum_for",["each_value"],function ja(){return(null==ja.$$s?this:ja.$$s).$size()},{$$s:this});for(var b=0,d=this.$$keys.slice(),h=d.length,p;b<h;b++)p=d[b],c(p.$$is_string?this.$$smap[p]:p.value);return this});M(d,"$empty?",function(){return 0===this.$$keys.length});M(d,"$except",function(a){var c=v(arguments);return t(this.$dup(),"except!",N(c))},-1);M(d,"$except!",
|
|
392
|
-
function(c){var b=v(arguments);t(b,"each",[],function la(c){var b=null==la.$$s?this:la.$$s;null==c&&(c=a);return b.$delete(c)},{$$s:this});return this},-1);M(d,"$fetch",function Z(c,b){var d=Z.$$p||a;Z.$$p=null;var h=q(this,c);return void 0!==h?h:d!==a?d(c):void 0!==b?b:I.$raise(k("KeyError").$new("key not found: "+c.$inspect(),R(["key","receiver"],{key:c,receiver:this})))},-2);M(d,"$fetch_values",function Z(c){var b=Z.$$p||a;Z.$$p=null;var d=v(arguments);return t(d,"map",[],function ka(c){var d=
|
|
393
|
-
null==ka.$$s?this:ka.$$s;null==c&&(c=a);return t(d,"fetch",[c],b.$to_proc())},{$$s:this})},-1);M(d,"$flatten",function(a){null==a&&(a=1);a=G["$coerce_to!"](a,k("Integer"),"to_int");for(var c=[],b=0,d=this.$$keys,h=d.length,p,F;b<h;b++)p=d[b],p.$$is_string?F=this.$$smap[p]:(F=p.value,p=p.key),c.push(p),F.$$is_array?1===a?c.push(F):c=c.concat(F.$flatten(a-2)):c.push(F);return c},-1);M(d,"$freeze",function(){return W(this["$frozen?"]())?this:z(this)});M(d,"$has_key?",function(a){return void 0!==q(this,
|
|
394
|
-
a)});M(d,"$has_value?",function(a){for(var c=0,b=this.$$keys,d=b.length,h;c<d;c++)if(h=b[c],(h.$$is_string?this.$$smap[h]:h.value)["$=="](a))return!0;return!1});M(d,"$hash",function(){var a=void 0===b.hash_ids,c=this.$object_id(),d=["Hash"];try{a&&(b.hash_ids=Object.create(null));if(b[c])return"self";for(m in b.hash_ids){var h=b.hash_ids[m];if(this["$eql?"](h))return"self"}b.hash_ids[c]=this;c=0;for(var p=this.$$keys,k=p.length;c<k;c++){var m=p[c];m.$$is_string?d.push([m,this.$$smap[m].$hash()]):
|
|
395
|
-
d.push([m.key_hash,m.value.$hash()])}return d.sort().join()}finally{a&&(b.hash_ids=void 0)}});M(d,"$index",function(c){for(var b=0,d=this.$$keys,h=d.length,p,k;b<h;b++)if(p=d[b],p.$$is_string?k=this.$$smap[p]:(k=p.value,p=p.key),k["$=="](c))return p;return a});M(d,"$indexes",function(a){var c=v(arguments);for(var b=[],d=0,h=c.length,p;d<h;d++)p=c[d],p=q(this,p),void 0===p?b.push(this.$default()):b.push(p);return b},-1);var p;M(d,"$inspect",function(){var a=void 0===p,b=this.$object_id(),d=[];a:{try{a&&
|
|
396
|
-
(p={});if(p.hasOwnProperty(b)){var h="{...}";break a}p[b]=!0;b=0;for(var k=this.$$keys,m=k.length,n,u;b<m;b++)n=k[b],n.$$is_string?u=this.$$smap[n]:(u=n.value,n=n.key),n=c("Opal").$inspect(n),u=c("Opal").$inspect(u),d.push(n+"=>"+u);h="{"+d.join(", ")+"}";break a}finally{a&&(p=void 0)}h=void 0}return h});M(d,"$invert",function(){for(var a=x(),c=0,b=this.$$keys,d=b.length,h,p;c<d;c++)h=b[c],h.$$is_string?p=this.$$smap[h]:(p=h.value,h=h.key),E(a,p,h);return a});M(d,"$keep_if",function Z(){var c=Z.$$p||
|
|
397
|
-
a;Z.$$p=null;if(!W(c))return t(this,"enum_for",["keep_if"],function r(){return(null==r.$$s?this:r.$$s).$size()},{$$s:this});A(this);for(var b=0,d=this.$$keys,h=d.length,p,u;b<h;b++)p=d[b],p.$$is_string?u=this.$$smap[p]:(u=p.value,p=p.key),u=c(p,u),!1!==u&&u!==a||void 0===B(this,p)||(h--,b--);return this});M(d,"$keys",function(){for(var a=[],c=0,b=this.$$keys,d=b.length,h;c<d;c++)h=b[c],h.$$is_string?a.push(h):a.push(h.key);return a});M(d,"$length",function(){return this.$$keys.length});M(d,"$merge",
|
|
398
|
-
function ea(c){var b=ea.$$p||a;ea.$$p=null;var d=v(arguments);return t(this.$dup(),"merge!",N(d),b.$to_proc())},-1);M(d,"$merge!",function ra(c){var b=ra.$$p||a;ra.$$p=null;var d=v(arguments);A(this);var h,p;for(h=0;h<d.length;++h){var r=G["$coerce_to!"](d[h],k("Hash"),"to_hash");var m=r.$$keys;var n=m.length;if(b===a)for(p=0;p<n;p++){var C=m[p];if(C.$$is_string)var w=r.$$smap[C];else w=C.value,C=C.key;E(this,C,w)}else for(p=0;p<n;p++){C=m[p];C.$$is_string?w=r.$$smap[C]:(w=C.value,C=C.key);var na=
|
|
399
|
-
q(this,C);void 0===na?E(this,C,w):E(this,C,b(C,na,w))}}return this},-1);M(d,"$rassoc",function(c){for(var b=0,d=this.$$keys,h=d.length,p,k;b<h;b++)if(p=d[b],p.$$is_string?k=this.$$smap[p]:(k=p.value,p=p.key),k["$=="](c))return[p,k];return a});M(d,"$rehash",function(){A(this);b.hash_rehash(this);return this});M(d,"$reject",function ra(){var c=ra.$$p||a;ra.$$p=null;if(!W(c))return t(this,"enum_for",["reject"],function na(){return(null==na.$$s?this:na.$$s).$size()},{$$s:this});for(var b=x(),d=0,h=this.$$keys,
|
|
400
|
-
p=h.length,k,m,C;d<p;d++)k=h[d],k.$$is_string?m=this.$$smap[k]:(m=k.value,k=k.key),C=c(k,m),!1!==C&&C!==a||E(b,k,m);return b});M(d,"$reject!",function ja(){var c=ja.$$p||a;ja.$$p=null;if(!W(c))return t(this,"enum_for",["reject!"],function na(){return(null==na.$$s?this:na.$$s).$size()},{$$s:this});A(this);for(var b=!1,d=0,h=this.$$keys,p=h.length,k,C;d<p;d++)k=h[d],k.$$is_string?C=this.$$smap[k]:(C=k.value,k=k.key),C=c(k,C),!1!==C&&C!==a&&void 0!==B(this,k)&&(b=!0,p--,d--);return b?this:a});M(d,"$replace",
|
|
401
|
-
function(a){A(this);a=G["$coerce_to!"](a,k("Hash"),"to_hash");D(this);for(var c=0,b=a.$$keys,d=b.length,h,p;c<d;c++)h=b[c],h.$$is_string?p=a.$$smap[h]:(p=h.value,h=h.key),E(this,h,p);if(W(a.$default_proc()))this["$default_proc="](a.$default_proc());else this["$default="](a.$default());return this});M(d,"$select",function ka(){var c=ka.$$p||a;ka.$$p=null;if(!W(c))return t(this,"enum_for",["select"],function Ba(){return(null==Ba.$$s?this:Ba.$$s).$size()},{$$s:this});for(var b=x(),d=0,h=this.$$keys,
|
|
402
|
-
p=h.length,k,w,m;d<p;d++)k=h[d],k.$$is_string?w=this.$$smap[k]:(w=k.value,k=k.key),m=c(k,w),!1!==m&&m!==a&&E(b,k,w);return b});M(d,"$select!",function u(){var c=u.$$p||a;u.$$p=null;if(!W(c))return t(this,"enum_for",["select!"],function Ba(){return(null==Ba.$$s?this:Ba.$$s).$size()},{$$s:this});A(this);for(var b=a,d=0,h=this.$$keys,p=h.length,k,m;d<p;d++)if(k=h[d],k.$$is_string?m=this.$$smap[k]:(m=k.value,k=k.key),m=c(k,m),!1===m||m===a)void 0!==B(this,k)&&(p--,d--),b=this;return b});M(d,"$shift",
|
|
403
|
-
function(){A(this);var c=this.$$keys;return 0<c.length?(c=c[0],c=c.$$is_string?c:c.key,[c,B(this,c)]):a});M(d,"$slice",function(a){var c=v(arguments);for(var b=x(),d=0,h=c.length;d<h;d++){var p=c[d],u=q(this,p);void 0!==u&&E(b,p,u)}return b},-1);M(d,"$to_a",function(){for(var a=[],c=0,b=this.$$keys,d=b.length,h,p;c<d;c++)h=b[c],h.$$is_string?p=this.$$smap[h]:(p=h.value,h=h.key),a.push([h,p]);return a});M(d,"$to_h",function wa(){var c=wa.$$p||a;wa.$$p=null;if(c!==a)return t(this,"map",[],c.$to_proc()).$to_h();
|
|
404
|
-
if(this.$$class===b.Hash)return this;c=new b.Hash;D(c);b.hash_clone(this,c);return c});M(d,"$to_hash",H);M(d,"$to_proc",function(){return t(this,"proc",[],function pa(a){var c=null==pa.$$s?this:pa.$$s;null==a&&I.$raise(k("ArgumentError"),"no key given");return c["$[]"](a)},{$$arity:-1,$$s:this})});M(d,"$transform_keys",function r(){var c=r.$$p||a;r.$$p=null;if(!W(c))return t(this,"enum_for",["transform_keys"],function qa(){return(null==qa.$$s?this:qa.$$s).$size()},{$$s:this});for(var b=x(),d=0,h=
|
|
405
|
-
this.$$keys,p=h.length,k,m;d<p;d++)k=h[d],k.$$is_string?m=this.$$smap[k]:(m=k.value,k=k.key),k=n(c,k),E(b,k,m);return b});M(d,"$transform_keys!",function pa(){var c=pa.$$p||a;pa.$$p=null;if(!W(c))return t(this,"enum_for",["transform_keys!"],function ba(){return(null==ba.$$s?this:ba.$$s).$size()},{$$s:this});A(this);var d=b.slice(this.$$keys),h,p=d.length;for(h=0;h<p;h++){var k=d[h];if(k.$$is_string)var m=this.$$smap[k];else m=k.value,k=k.key;var aa=n(c,k);B(this,k);E(this,aa,m)}return this});M(d,
|
|
406
|
-
"$transform_values",function Y(){var c=Y.$$p||a;Y.$$p=null;if(!W(c))return t(this,"enum_for",["transform_values"],function ca(){return(null==ca.$$s?this:ca.$$s).$size()},{$$s:this});for(var b=x(),d=0,h=this.$$keys,p=h.length,k,m;d<p;d++)k=h[d],k.$$is_string?m=this.$$smap[k]:(m=k.value,k=k.key),m=n(c,m),E(b,k,m);return b});M(d,"$transform_values!",function C(){var c=C.$$p||a;C.$$p=null;if(!W(c))return t(this,"enum_for",["transform_values!"],function ca(){return(null==ca.$$s?this:ca.$$s).$size()},{$$s:this});
|
|
407
|
-
A(this);for(var b=0,d=this.$$keys,h=d.length,p,k;b<h;b++)p=d[b],p.$$is_string?k=this.$$smap[p]:(k=p.value,p=p.key),k=n(c,k),E(this,p,k);return this});M(d,"$values",function(){for(var a=[],c=0,b=this.$$keys,d=b.length,h;c<d;c++)h=b[c],h.$$is_string?a.push(this.$$smap[h]):a.push(h.value);return a});L(d,"dup","clone");L(d,"each_pair","each");L(d,"eql?","==");L(d,"filter","select");L(d,"filter!","select!");L(d,"include?","has_key?");L(d,"indices","indexes");L(d,"key","index");L(d,"key?","has_key?");L(d,
|
|
408
|
-
"member?","has_key?");L(d,"size","length");L(d,"store","[]=");L(d,"to_s","inspect");L(d,"update","merge!");L(d,"value?","has_value?");return L(d,"values_at","indexes")}("::",null,[])};
|
|
409
|
-
Opal.modules["corelib/number"]=function(b){var n=b.klass,x=b.Opal,D=b.Kernel,q=b.def,E=b.eqeqeq,B=b.truthy,A=b.rb_gt,z=b.not,m=b.rb_lt,v=b.alias,G=b.send2,I=b.find_super,K=b.send,M=b.rb_plus,t=b.rb_minus,J=b.eqeq,P=b.return_self,R=b.rb_divide,W=b.to_ary,N=b.rb_times,H=b.rb_le,L=b.rb_ge,U=b.return_val,a=b.const_set,k=b.top,d=[],f=b.nil,h=b.$$$;b.add_stubs("require,bridge,raise,name,class,Float,respond_to?,coerce_to!,__coerced__,===,>,!,**,new,<,to_f,==,nan?,infinite?,enum_for,+,-,gcd,lcm,%,/,frexp,to_i,ldexp,rationalize,*,<<,to_r,truncate,-@,size,<=,>=,inspect,angle,to_s,is_a?,abs,__id__,next,coerce_to?");
|
|
410
|
-
k.$require("corelib/numeric");(function(a,$super,d){function c(a){var c=new Uint8Array(8);(new DataView(c.buffer)).setFloat64(0,a,!0);return c}function l(a){a=c(a);for(var b=0;b<a.length;b++)if(255===a[b])a[b]=0;else{a[b]++;break}return(new DataView(a.buffer)).getFloat64(0,!0)}function e(a){a=c(a);for(var b=0;b<a.length;b++)if(0===a[b])a[b]=255;else{a[b]--;break}return(new DataView(a.buffer)).getFloat64(0,!0)}a=n(a,$super,"Number");d=[a].concat(d);x.$bridge(Number,a);b.prop(a.$$prototype,"$$is_number",
|
|
411
|
-
!0);a.$$is_number_class=!0;(function(a,c){q(a,"$allocate",function(){return D.$raise(h("TypeError"),"allocator undefined for "+this.$name())});b.udef(a,"$new");return f})(b.get_singleton_class(a),d);q(a,"$coerce",function(a){if(a!==f){if(a.$$is_string)return[D.$Float(a),this];if(a["$respond_to?"]("to_f"))return[x["$coerce_to!"](a,h("Float"),"to_f"),this];if(a.$$is_number)return[a,this]}D.$raise(h("TypeError"),"can't convert "+a.$class()+" into Float")});q(a,"$__id__",function(){return 2*this+1});
|
|
412
|
-
q(a,"$+",function(a){return a.$$is_number?this+a:this.$__coerced__("+",a)});q(a,"$-",function(a){return a.$$is_number?this-a:this.$__coerced__("-",a)});q(a,"$*",function(a){return a.$$is_number?this*a:this.$__coerced__("*",a)});q(a,"$/",function(a){return a.$$is_number?this/a:this.$__coerced__("/",a)});q(a,"$%",function(a){if(a.$$is_number){if(-Infinity==a)return a;if(0==a)D.$raise(h("ZeroDivisionError"),"divided by 0");else return 0>a||0>this?(this%a+a)%a:this%a}else return this.$__coerced__("%",
|
|
413
|
-
a)});q(a,"$&",function(a){return a.$$is_number?this&a:this.$__coerced__("&",a)});q(a,"$|",function(a){return a.$$is_number?this|a:this.$__coerced__("|",a)});q(a,"$^",function(a){return a.$$is_number?this^a:this.$__coerced__("^",a)});q(a,"$<",function(a){return a.$$is_number?this<a:this.$__coerced__("<",a)});q(a,"$<=",function(a){return a.$$is_number?this<=a:this.$__coerced__("<=",a)});q(a,"$>",function(a){return a.$$is_number?this>a:this.$__coerced__(">",a)});q(a,"$>=",function(a){return a.$$is_number?
|
|
414
|
-
this>=a:this.$__coerced__(">=",a)});q(a,"$<=>",function(a){try{return a.$$is_number?isNaN(this)||isNaN(a)?f:this>a?1:this<a?-1:0:this.$__coerced__("<=>",a)}catch(S){if(b.rescue(S,[h("ArgumentError")]))try{return f}finally{b.pop_exception()}else throw S;}});q(a,"$<<",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");return 0<a?this<<a:this>>-a});q(a,"$>>",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");return 0<a?this>>a:this<<-a});q(a,"$[]",function(a){a=x["$coerce_to!"](a,h("Integer"),
|
|
415
|
-
"to_int");return 0>a?0:32<=a?0>this?1:0:this>>a&1});q(a,"$+@",function(){return+this});q(a,"$-@",function(){return-this});q(a,"$~",function(){return~this});q(a,"$**",function(a){return E(h("Integer"),a)?z(h("Integer")["$==="](this))||B(A(a,0))?Math.pow(this,a):h("Rational").$new(this,1)["$**"](a):m(this,0)&&(E(h("Float"),a)||E(h("Rational"),a))?h("Complex").$new(this,0)["$**"](a.$to_f()):B(null!=a.$$is_number)?Math.pow(this,a):this.$__coerced__("**",a)});q(a,"$==",function(a){return a.$$is_number?
|
|
416
|
-
this.valueOf()===a.valueOf():a["$respond_to?"]("==")?a["$=="](this):!1});v(a,"===","==");q(a,"$abs",function(){return Math.abs(this)});q(a,"$abs2",function(){return Math.abs(this*this)});q(a,"$allbits?",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");return(this&a)==a});q(a,"$anybits?",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");return 0!==(this&a)});q(a,"$angle",function(){return B(this["$nan?"]())?this:0==this?0<1/this?0:Math.PI:0>this?Math.PI:0});q(a,"$bit_length",function(){E(h("Integer"),
|
|
417
|
-
this)||D.$raise(h("NoMethodError").$new("undefined method `bit_length` for "+this+":Float","bit_length"));if(0===this||-1===this)return 0;for(var a=0,c=0>this?~this:this;0!=c;)a+=1,c>>>=1;return a});q(a,"$ceil",function(a){null==a&&(a=0);var c=this.$to_f();if(0===c%1&&0<=a)return c;a=Math.pow(10,a);a=Math.ceil(c*a)/a;0===c%1&&(a=Math.round(a));return a},-1);q(a,"$chr",function(a){return b.enc(String.fromCharCode(this),a||"BINARY")},-1);q(a,"$denominator",function S(){var a=S.$$p||f;S.$$p=null;return B(this["$nan?"]())||
|
|
418
|
-
B(this["$infinite?"]())?1:G(this,I(this,"denominator",S,!1,!0),"denominator",[],a)});q(a,"$downto",function O(a){var c=O.$$p||f;O.$$p=null;if(c===f)return K(this,"enum_for",["downto",a],function ea(){var c=null==ea.$$s?this:ea.$$s;E(h("Numeric"),a)||D.$raise(h("ArgumentError"),"comparison of "+c.$class()+" with "+a.$class()+" failed");return B(A(a,c))?0:M(t(c,a),1)},{$$s:this});a.$$is_number||D.$raise(h("ArgumentError"),"comparison of "+this.$class()+" with "+a.$class()+" failed");for(var b=this;b>=
|
|
419
|
-
a;b--)c(b);return this});q(a,"$equal?",function(a){var c;return B(c=this["$=="](a))?c:isNaN(this)&&isNaN(a)});q(a,"$even?",function(){return 0===this%2});q(a,"$floor",function(a){null==a&&(a=0);var c=this.$to_f();if(0===c%1&&0<=a)return c;a=Math.pow(10,a);a=Math.floor(c*a)/a;0===c%1&&(a=Math.round(a));return a},-1);q(a,"$gcd",function(a){E(h("Integer"),a)||D.$raise(h("TypeError"),"not an integer");var c=Math.abs(this);for(a=Math.abs(a);0<c;){var b=c;c=a%c;a=b}return a});q(a,"$gcdlcm",function(a){return[this.$gcd(a),
|
|
420
|
-
this.$lcm(a)]});q(a,"$integer?",function(){return 0===this%1});q(a,"$is_a?",function F(a){var c=F.$$p||f;F.$$p=null;return J(a,h("Integer"))&&E(h("Integer"),this)||J(a,h("Integer"))&&E(h("Integer"),this)||J(a,h("Float"))&&E(h("Float"),this)?!0:G(this,I(this,"is_a?",F,!1,!0),"is_a?",[a],c)});q(a,"$instance_of?",function Z(a){var c=Z.$$p||f;Z.$$p=null;return J(a,h("Integer"))&&E(h("Integer"),this)||J(a,h("Integer"))&&E(h("Integer"),this)||J(a,h("Float"))&&E(h("Float"),this)?!0:G(this,I(this,"instance_of?",
|
|
421
|
-
Z,!1,!0),"instance_of?",[a],c)});q(a,"$lcm",function(a){E(h("Integer"),a)||D.$raise(h("TypeError"),"not an integer");return 0==this||0==a?0:Math.abs(this*a/this.$gcd(a))});q(a,"$next",function(){return this+1});q(a,"$nobits?",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");return 0==(this&a)});q(a,"$nonzero?",function(){return 0==this?f:this});q(a,"$numerator",function Z(){var a=Z.$$p||f;Z.$$p=null;return B(this["$nan?"]())||B(this["$infinite?"]())?this:G(this,I(this,"numerator",Z,!1,!0),
|
|
422
|
-
"numerator",[],a)});q(a,"$odd?",function(){return 0!==this%2});q(a,"$ord",P);q(a,"$pow",function(a,c){0==this&&D.$raise(h("ZeroDivisionError"),"divided by 0");if(void 0===c)return this["$**"](a);h("Integer")["$==="](a)||D.$raise(h("TypeError"),"Integer#pow() 2nd argument not allowed unless a 1st argument is integer");0>a&&D.$raise(h("TypeError"),"Integer#pow() 1st argument cannot be negative when 2nd argument specified");h("Integer")["$==="](c)||D.$raise(h("TypeError"),"Integer#pow() 2nd argument not allowed unless all arguments are integers");
|
|
423
|
-
0===c&&D.$raise(h("ZeroDivisionError"),"divided by 0");return this["$**"](a)["$%"](c)},-2);q(a,"$pred",function(){return this-1});q(a,"$quo",function ea(a){var c=ea.$$p||f;ea.$$p=null;return E(h("Integer"),this)?G(this,I(this,"quo",ea,!1,!0),"quo",[a],c):R(this,a)});q(a,"$rationalize",function(a){1<arguments.length&&D.$raise(h("ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");if(E(h("Integer"),this))return h("Rational").$new(this,1);if(B(this["$infinite?"]()))return D.$raise(h("FloatDomainError"),
|
|
424
|
-
"Infinity");if(B(this["$nan?"]()))return D.$raise(h("FloatDomainError"),"NaN");if(B(null==a)){var c=h("Math").$frexp(this);var b=W(c);var e=null==b[0]?f:b[0];b=null==b[1]?f:b[1];c;e=h("Math").$ldexp(e,h(h("Float"),"MANT_DIG")).$to_i();b=t(b,h(h("Float"),"MANT_DIG"));return h("Rational").$new(N(2,e),1["$<<"](t(1,b))).$rationalize(h("Rational").$new(1,1["$<<"](t(1,b))))}return this.$to_r().$rationalize(a)},-1);q(a,"$remainder",function(a){return t(this,N(a,R(this,a).$truncate()))});q(a,"$round",function(a){if(E(h("Integer"),
|
|
425
|
-
this)){if(B(null==a))return this;E(h("Float"),a)&&B(a["$infinite?"]())&&D.$raise(h("RangeError"),"Infinity");a=x["$coerce_to!"](a,h("Integer"),"to_int");B(m(a,h(h("Integer"),"MIN")))&&D.$raise(h("RangeError"),"out of bounds");if(B(0<=a))return this;a=a["$-@"]();if(.415241*a-.125>this.$size())return 0;a=Math.pow(10,a);a*=Math.floor((Math.abs(this)+a/2)/a);return 0>this?-a:a}B(this["$nan?"]())&&B(null==a)&&D.$raise(h("FloatDomainError"),"NaN");a=x["$coerce_to!"](a||0,h("Integer"),"to_int");if(B(H(a,
|
|
426
|
-
0)))B(this["$nan?"]())?D.$raise(h("RangeError"),"NaN"):B(this["$infinite?"]())&&D.$raise(h("FloatDomainError"),"Infinity");else{if(J(a,0))return Math.round(this);if(B(this["$nan?"]())||B(this["$infinite?"]()))return this}var c=h("Math").$frexp(this);var b=W(c);b=null==b[1]?f:b[1];c;return B(L(a,t(M(h(h("Float"),"DIG"),2),B(A(b,0))?R(b,4):t(R(b,3),1))))?this:B(m(a,(B(A(b,0))?M(R(b,3),1):R(b,4))["$-@"]()))?0:Math.round(this*Math.pow(10,a))/Math.pow(10,a)},-1);q(a,"$times",function ea(){var a=ea.$$p||
|
|
427
|
-
f;ea.$$p=null;if(!B(a))return K(this,"enum_for",["times"],function u(){return null==u.$$s?this:u.$$s},{$$s:this});for(var c=0;c<this;c++)a(c);return this});q(a,"$to_f",P);q(a,"$to_i",function(){return 0>this?Math.ceil(this):Math.floor(this)});q(a,"$to_r",function(){if(E(h("Integer"),this))return h("Rational").$new(this,1);var a=h("Math").$frexp(this);var c=W(a);var b=null==c[0]?f:c[0];c=null==c[1]?f:c[1];a;b=h("Math").$ldexp(b,h(h("Float"),"MANT_DIG")).$to_i();c=t(c,h(h("Float"),"MANT_DIG"));return N(b,
|
|
428
|
-
h(h("Float"),"RADIX")["$**"](c)).$to_r()});q(a,"$to_s",function(a){null==a&&(a=10);a=x["$coerce_to!"](a,h("Integer"),"to_int");(B(m(a,2))||B(A(a,36)))&&D.$raise(h("ArgumentError"),"invalid radix "+a);return J(this,0)&&B(-Infinity===1/this)?"-0.0":this.toString(a)},-1);q(a,"$truncate",function(a){null==a&&(a=0);var c=this.$to_f();if(0===c%1&&0<=a)return c;a=Math.pow(10,a);a=parseInt(c*a,10)/a;0===c%1&&(a=Math.round(a));return a},-1);q(a,"$digits",function(a){null==a&&(a=10);m(this,0)&&D.$raise(h(h("Math"),
|
|
429
|
-
"DomainError"),"out of domain");a=x["$coerce_to!"](a,h("Integer"),"to_int");B(m(a,2))&&D.$raise(h("ArgumentError"),"invalid radix "+a);this!=parseInt(this)&&D.$raise(h("NoMethodError"),"undefined method `digits' for "+this.$inspect());var c=this,b=[];if(0==this)return[0];for(;0!=c;)b.push(c%a),c=parseInt(c/a,10);return b},-1);q(a,"$divmod",function ja(a){var c=ja.$$p||f;ja.$$p=null;return B(this["$nan?"]())||B(a["$nan?"]())?D.$raise(h("FloatDomainError"),"NaN"):B(this["$infinite?"]())?D.$raise(h("FloatDomainError"),
|
|
430
|
-
"Infinity"):G(this,I(this,"divmod",ja,!1,!0),"divmod",[a],c)});q(a,"$upto",function ka(a){var c=ka.$$p||f;ka.$$p=null;if(c===f)return K(this,"enum_for",["upto",a],function pa(){var c=null==pa.$$s?this:pa.$$s;E(h("Numeric"),a)||D.$raise(h("ArgumentError"),"comparison of "+c.$class()+" with "+a.$class()+" failed");return B(m(a,c))?0:M(t(a,c),1)},{$$s:this});a.$$is_number||D.$raise(h("ArgumentError"),"comparison of "+this.$class()+" with "+a.$class()+" failed");for(var b=this;b<=a;b++)c(b);return this});
|
|
431
|
-
q(a,"$zero?",function(){return 0==this});q(a,"$size",U(4));q(a,"$nan?",function(){return isNaN(this)});q(a,"$finite?",function(){return Infinity!=this&&-Infinity!=this&&!isNaN(this)});q(a,"$infinite?",function(){return Infinity==this?1:-Infinity==this?-1:f});q(a,"$positive?",function(){return 0!=this&&(Infinity==this||0<1/this)});q(a,"$negative?",function(){return-Infinity==this||0>1/this});q(a,"$next_float",function(){return J(this,h(h("Float"),"INFINITY"))?h(h("Float"),"INFINITY"):B(this["$nan?"]())?
|
|
432
|
-
h(h("Float"),"NAN"):L(this,0)?l(Math.abs(this)):e(this)});q(a,"$prev_float",function(){return J(this,h(h("Float"),"INFINITY")["$-@"]())?h(h("Float"),"INFINITY")["$-@"]():B(this["$nan?"]())?h(h("Float"),"NAN"):A(this,0)?e(this):-l(Math.abs(this))});v(a,"arg","angle");v(a,"eql?","==");v(a,"fdiv","/");v(a,"inspect","to_s");v(a,"kind_of?","is_a?");v(a,"magnitude","abs");v(a,"modulo","%");v(a,"object_id","__id__");v(a,"phase","angle");v(a,"succ","next");return v(a,"to_int","to_i")})("::",h("Numeric"),
|
|
433
|
-
d);a("::","Fixnum",h("Number"));(function(c,$super,d){c=n(c,$super,"Integer");d=[c].concat(d);c.$$is_number_class=!0;c.$$is_integer_class=!0;(function(a,c){c=[a].concat(c);var e=b.$r(c);q(a,"$allocate",function(){return D.$raise(h("TypeError"),"allocator undefined for "+this.$name())});b.udef(a,"$new");q(a,"$sqrt",function(a){a=x["$coerce_to!"](a,h("Integer"),"to_int");0>a&&D.$raise(h(h("Math"),"DomainError"),'Numerical argument is out of domain - "isqrt"');return parseInt(Math.sqrt(a),10)});return q(a,
|
|
434
|
-
"$try_convert",function(a){return e("Opal")["$coerce_to?"](a,this,"to_int")})})(b.get_singleton_class(c),d);a(c,"MAX",Math.pow(2,30)-1);return a(c,"MIN",-Math.pow(2,30))})("::",h("Numeric"),d);return function(c,$super,d){c=n(c,$super,"Float");d=[c].concat(d);c.$$is_number_class=!0;(function(a,c){q(a,"$allocate",function(){return D.$raise(h("TypeError"),"allocator undefined for "+this.$name())});b.udef(a,"$new");return q(a,"$===",function(a){return!!a.$$is_number})})(b.get_singleton_class(c),d);a(c,
|
|
435
|
-
"INFINITY",Infinity);a(c,"MAX",Number.MAX_VALUE);a(c,"MIN",Number.MIN_VALUE);a(c,"NAN",NaN);a(c,"DIG",15);a(c,"MANT_DIG",53);a(c,"RADIX",2);return a(c,"EPSILON",Number.EPSILON||2.220446049250313E-16)}("::",h("Numeric"),d)};
|
|
436
|
-
Opal.modules["corelib/range"]=function(b){var n=b.klass,x=b.truthy,D=b.Kernel,q=b.def,E=b.not,B=b.send2,A=b.find_super,z=b.rb_lt,m=b.rb_le,v=b.send,G=b.eqeq,I=b.eqeqeq,K=b.return_ivar,M=b.rb_gt,t=b.rb_minus,J=b.Opal,P=b.rb_divide,R=b.rb_plus,W=b.rb_times,N=b.rb_ge,H=b.thrower,L=b.alias,U=b.top,a=b.nil,k=b.$$$;b.add_stubs("require,include,attr_reader,raise,nil?,<=>,include?,!,<,<=,enum_for,size,upto,to_proc,respond_to?,class,succ,==,===,exclude_end?,eql?,begin,end,last,to_a,>,-@,-,to_i,coerce_to!,ceil,/,is_a?,new,loop,+,*,>=,each_with_index,%,step,bsearch,inspect,[],hash,cover?");
|
|
437
|
-
U.$require("corelib/enumerable");return function(d,$super,h){function c(c){return c.begin===a||c.end===a||-Infinity===c.begin||Infinity===c.end||Infinity===c.begin||-Infinity===c.end?!0:!1}d=n(d,$super,"Range");h=[d].concat(h);var p=b.$r(h);h=d.$$prototype;h.begin=h.end=h.excl=a;d.$include(k("Enumerable"));d.$$prototype.$$is_range=!0;d.$attr_reader("begin","end");q(d,"$initialize",function(a,c,b){null==b&&(b=!1);x(this.begin)&&D.$raise(k("NameError"),"'initialize' called twice");x(a["$<=>"](c))||
|
|
438
|
-
x(a["$nil?"]())||x(c["$nil?"]())||D.$raise(k("ArgumentError"),"bad value for range");this.begin=a;this.end=c;return this.excl=b},-3);q(d,"$===",function(a){return this["$include?"](a)});q(d,"$count",function g(){var b=g.$$p||a;g.$$p=null;return E(b!==a)&&x(c(this))?k(k("Float"),"INFINITY"):B(this,A(this,"count",g,!1,!0),"count",[],b)});q(d,"$to_a",function l(){var b=l.$$p||a;l.$$p=null;x(c(this))&&D.$raise(k("TypeError"),"cannot convert endless range to an array");return B(this,A(this,"to_a",l,!1,
|
|
439
|
-
!0),"to_a",[],b)});q(d,"$cover?",function(c){var b=a,d=a,l=a;var h=x(b=x(d=x(l=this.begin["$nil?"]())?-1:l)?d:this.begin["$<=>"](c))&&b;c=x(b=x(d=x(l=this.end["$nil?"]())?-1:l)?d:c["$<=>"](this.end))&&b;return x(b=x(d=x(this.excl)?x(l=c)?z(c,0):l:x(l=c)?m(c,0):l)?h:d)?m(h,0):b});q(d,"$each",function e(){var c=e.$$p||a,d=a,h=a,p=a;e.$$p=null;if(c===a)return v(this,"enum_for",["each"],function Z(){return(null==Z.$$s?this:Z.$$s).$size()},{$$s:this});if(this.begin.$$is_number&&this.end.$$is_number){0===
|
|
440
|
-
this.begin%1&&0===this.end%1||D.$raise(k("TypeError"),"can't iterate from Float");d=this.begin;for(h=this.end+(x(this.excl)?0:1);d<h;d++)c(d);return this}if(this.begin.$$is_string&&this.end.$$is_string)return v(this.begin,"upto",[this.end,this.excl],c.$to_proc()),this;d=this.begin;h=this.end;for(x(d["$respond_to?"]("succ"))||D.$raise(k("TypeError"),"can't iterate from "+d.$class());x(x(p=this.end["$nil?"]())?p:z(d["$<=>"](h),0));)b.yield1(c,d),d=d.$succ();E(this.excl)&&G(d,h)&&b.yield1(c,d);return this});
|
|
441
|
-
q(d,"$eql?",function(c){var b,e=a;return I(k("Range"),c)?x(b=x(e=this.excl["$==="](c["$exclude_end?"]()))?this.begin["$eql?"](c.$begin()):e)?this.end["$eql?"](c.$end()):b:!1});q(d,"$exclude_end?",K("excl"));q(d,"$first",function S(c){var b=S.$$p||a;S.$$p=null;x(this.begin["$nil?"]())&&D.$raise(k("RangeError"),"cannot get the minimum of beginless range");return x(null==c)?this.begin:B(this,A(this,"first",S,!1,!0),"first",[c],b)},-1);q(d,"$last",function(a){x(this.end["$nil?"]())&&D.$raise(k("RangeError"),
|
|
442
|
-
"cannot get the maximum of endless range");return x(null==a)?this.end:this.$to_a().$last(a)},-1);q(d,"$max",function S(){var c=S.$$p||a;S.$$p=null;return x(this.end["$nil?"]())?D.$raise(k("RangeError"),"cannot get the maximum of endless range"):c!==a?B(this,A(this,"max",S,!1,!0),"max",[],c):E(this.begin["$nil?"]())&&(x(M(this.begin,this.end))||x(this.excl)&&G(this.begin,this.end))?a:this.excl?this.end-1:this.end});q(d,"$min",function y(){var c=y.$$p||a;y.$$p=null;return x(this.begin["$nil?"]())?D.$raise(k("RangeError"),
|
|
443
|
-
"cannot get the minimum of beginless range"):c!==a?B(this,A(this,"min",y,!1,!0),"min",[],c):E(this.end["$nil?"]())&&(x(M(this.begin,this.end))||x(this.excl)&&G(this.begin,this.end))?a:this.begin});q(d,"$size",function(){var b=k(k("Float"),"INFINITY");if(G(this.begin,b)&&E(this.end["$nil?"]())||G(this.end,b["$-@"]())&&E(this.begin["$nil?"]()))return 0;if(x(c(this)))return b;if(!I(k("Numeric"),this.begin)||!I(k("Numeric"),this.end))return a;b=this.begin;var d=this.end;x(this.excl)&&(d=t(d,1));return x(z(d,
|
|
444
|
-
b))?0:(Math.abs(d-b)+1).$to_i()});q(d,"$step",function F(c){function d(){null==c?c=1:c.$$is_number||(c=J["$coerce_to!"](c,k("Integer"),"to_int"));0>c?D.$raise(k("ArgumentError"),"step can't be negative"):0===c&&D.$raise(k("ArgumentError"),"step can't be 0")}function h(){if(!n.begin["$respond_to?"]("succ")||n.begin.$$is_string&&n.end.$$is_string)return a;if(0===c%1)return P(n.$size(),c).$ceil();var b=n.begin,d=n.end,h=Math.abs,p=Math.floor;h=(h(b)+h(d)+h(d-b))/h(c)*k(k("Float"),"EPSILON");.5<h&&(h=
|
|
445
|
-
.5);n.excl?(p=p((d-b)/c-h),p*c+b<d&&p++):p=p((d-b)/c+h)+1;return p}var m=F.$$p||a,n=this,O=a,t=a;F.$$p=null;if(m===a)return(x(n.begin["$is_a?"](p("Numeric")))||x(n.begin["$nil?"]()))&&(x(n.end["$is_a?"](p("Numeric")))||x(n.end["$nil?"]()))&&E(x(O=n.begin["$nil?"]())?n.end["$nil?"]():O)?k(k("Enumerator"),"ArithmeticSequence").$new(n,c,"step"):v(n,"enum_for",["step",c],function(){d();return h()});d();x(n.begin.$$is_number&&n.end.$$is_number)?(t=0,function(){try{var d=H("break");return v(n,"loop",[],
|
|
446
|
-
function r(){var h=null==r.$$s?this:r.$$s;null==h.begin&&(h.begin=a);null==h.excl&&(h.excl=a);null==h.end&&(h.end=a);var p=R(h.begin,W(t,c));x(h.excl)?x(N(p,h.end))&&d.$throw():x(M(p,h.end))&&d.$throw();b.yield1(m,p);return t=R(t,1)},{$$s:n})}catch(wa){if(wa===d)return wa.$v;throw wa;}}()):(n.begin.$$is_string&&n.end.$$is_string&&0!==c%1&&D.$raise(k("TypeError"),"no implicit conversion to float from string"),v(n,"each_with_index",[],function(d,h){null==d&&(d=a);null==h&&(h=a);return G(h["$%"](c),
|
|
447
|
-
0)?b.yield1(m,d):a}));return n},-1);q(d,"$%",function(a){return x(this.begin["$is_a?"](p("Numeric")))&&x(this.end["$is_a?"](p("Numeric")))?k(k("Enumerator"),"ArithmeticSequence").$new(this,a,"%"):this.$step(a)});q(d,"$bsearch",function F(){var b=F.$$p||a;F.$$p=null;if(b===a)return this.$enum_for("bsearch");x(c(this)&&(this.begin.$$is_number||this.end.$$is_number))&&D.$raise(k("NotImplementedError"),"Can't #bsearch an infinite range");x(this.begin.$$is_number&&this.end.$$is_number)||D.$raise(k("TypeError"),
|
|
448
|
-
"can't do binary search for "+this.begin.$class());return v(this.$to_a(),"bsearch",[],b.$to_proc())});q(d,"$to_s",function(){var c=a;return""+(x(c=this.begin)?c:"")+(x(this.excl)?"...":"..")+(x(c=this.end)?c:"")});q(d,"$inspect",function(){var c=a;return""+(x(c=this.begin)?this.begin.$inspect():c)+(x(this.excl)?"...":"..")+(x(c=this.end)?this.end.$inspect():c)});q(d,"$marshal_load",function(a){this.begin=a["$[]"]("begin");this.end=a["$[]"]("end");return this.excl=a["$[]"]("excl")});q(d,"$hash",function(){return[this.begin,
|
|
449
|
-
this.end,this.excl].$hash()});L(d,"==","eql?");L(d,"include?","cover?");return L(d,"member?","cover?")}("::",null,[])};
|
|
450
|
-
Opal.modules["corelib/proc"]=function(b){var n=b.slice,x=b.klass,D=b.truthy,q=b.Kernel,E=b.defs,B=b.def,A=b.send,z=b.to_a,m=b.return_self,v=b.ensure_kwargs,G=b.Opal,I=b.alias,K=b.nil,M=b.$$$;b.add_stubs("raise,proc,call,to_proc,new,source_location,coerce_to!,dup");return function(t,$super){t=x(t,$super,"Proc");b.prop(t.$$prototype,"$$is_proc",!0);b.prop(t.$$prototype,"$$is_lambda",!1);E(t,"$new",function R(){var b=R.$$p||K;R.$$p=null;D(b)||q.$raise(M("ArgumentError"),"tried to create a Proc object without a block");
|
|
451
|
-
return b});B(t,"$call",function N(m){var t=N.$$p||K;N.$$p=null;var q=n(arguments);t!==K&&(this.$$p=t);t=this.$$brk;var v=this.$$ret;if(t||v&&this.$$is_lambda)try{var a=this.$$is_lambda?this.apply(null,q):b.yieldX(this,q)}catch(k){if(k===t||this.$$is_lambda&&k===v)return k.$v;throw k;}else a=this.$$is_lambda?this.apply(null,q):b.yieldX(this,q);return a},-1);B(t,"$>>",function H(b){H.$$p=null;return A(q,"proc",[],function a(m){var k=a.$$p||K,d=null==a.$$s?this:a.$$s;a.$$p=null;var f=n(arguments);k=
|
|
452
|
-
A(d,"call",z(f),k.$to_proc());return b.$call(k)},{$$arity:-1,$$s:this})});B(t,"$<<",function L(b){L.$$p=null;return A(q,"proc",[],function k(a){var d=k.$$p||K,f=null==k.$$s?this:k.$$s;k.$$p=null;var h=n(arguments);d=A(b,"call",z(h),d.$to_proc());return f.$call(d)},{$$arity:-1,$$s:this})});B(t,"$to_proc",m);B(t,"$lambda?",function(){return!!this.$$is_lambda});B(t,"$arity",function(){return this.$$is_curried?-1:null!=this.$$arity?this.$$arity:this.length});B(t,"$source_location",function(){var b;return this.$$is_curried?
|
|
453
|
-
K:D(b=this.$$source_location)?b:K});B(t,"$binding",function(){this.$$is_curried&&q.$raise(M("ArgumentError"),"Can't create Binding");return D(M("::","Binding","skip_raise")?"constant":K)?M("Binding").$new(K,[],this.$$s,this.$source_location()):K});B(t,"$parameters",function(b){b=v(b);b=b.$$smap.lambda;if(this.$$is_curried)return[["rest"]];if(this.$$parameters){if(null==b?this.$$is_lambda:b)return this.$$parameters;b=[];var m;var n=0;for(m=this.$$parameters.length;n<m;n++){var a=this.$$parameters[n];
|
|
454
|
-
"req"===a[0]&&(a=["opt",a[1]]);b.push(a)}return b}return[]},-1);B(t,"$curry",function(b){function m(){var a=n(arguments),k=a.length;k>b&&t.$$is_lambda&&!t.$$is_curried&&q.$raise(M("ArgumentError"),"wrong number of arguments ("+k+" for "+b+")");if(k>=b)return t.$call.apply(t,a);k=function(){return m.apply(null,a.concat(n(arguments)))};k.$$is_lambda=t.$$is_lambda;k.$$is_curried=!0;return k}var t=this;void 0===b?b=t.length:(b=G["$coerce_to!"](b,M("Integer"),"to_int"),t.$$is_lambda&&b!==t.length&&q.$raise(M("ArgumentError"),
|
|
455
|
-
"wrong number of arguments ("+b+" for "+t.length+")"));m.$$is_lambda=t.$$is_lambda;m.$$is_curried=!0;return m},-1);B(t,"$dup",function(){var b=this.$$original_proc||this,m=function(){return b.apply(this,arguments)},n;for(n in this)this.hasOwnProperty(n)&&(m[n]=this[n]);return m});I(t,"===","call");I(t,"clone","dup");I(t,"yield","call");return I(t,"[]","call")}("::",Function)};
|
|
456
|
-
Opal.modules["corelib/method"]=function(b){var n=b.klass,x=b.def,D=b.truthy,q=b.slice,E=b.alias,B=b.Kernel,A=b.send,z=b.to_a,m=b.nil,v=b.$$$;b.add_stubs("attr_reader,arity,curry,>>,<<,new,class,join,source_location,call,raise,bind,to_proc");(function(b,$super){b=n(b,$super,"Method");var z=b.$$prototype;z.method=z.receiver=z.owner=z.name=m;b.$attr_reader("owner","receiver","name");x(b,"$initialize",function(b,m,n,q){this.receiver=b;this.owner=m;this.name=q;return this.method=n});x(b,"$arity",function(){return this.method.$arity()});
|
|
457
|
-
x(b,"$parameters",function(){return this.method.$$parameters});x(b,"$source_location",function(){var b;return D(b=this.method.$$source_location)?b:["(eval)",0]});x(b,"$comments",function(){var b;return D(b=this.method.$$comments)?b:[]});x(b,"$call",function J(b){var n=J.$$p||m;J.$$p=null;var t=q(arguments);this.method.$$p=n;return this.method.apply(this.receiver,t)},-1);x(b,"$curry",function(b){return this.method.$curry(b)},-1);x(b,"$>>",function(b){return this.method["$>>"](b)});x(b,"$<<",function(b){return this.method["$<<"](b)});
|
|
458
|
-
x(b,"$unbind",function(){return v("UnboundMethod").$new(this.receiver.$class(),this.owner,this.method,this.name)});x(b,"$to_proc",function(){var b=this.$call.bind(this);b.$$unbound=this.method;b.$$is_lambda=!0;b.$$arity=null==this.method.$$arity?this.method.length:this.method.$$arity;b.$$parameters=this.method.$$parameters;return b});x(b,"$inspect",function(){return"#<"+this.$class()+": "+this.receiver.$class()+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"});
|
|
459
|
-
E(b,"[]","call");return E(b,"===","call")})("::",null);return function(G,$super){G=n(G,$super,"UnboundMethod");var E=G.$$prototype;E.method=E.owner=E.name=E.source=m;G.$attr_reader("source","owner","name");x(G,"$initialize",function(b,m,n,q){this.source=b;this.owner=m;this.method=n;return this.name=q});x(G,"$arity",function(){return this.method.$arity()});x(G,"$parameters",function(){return this.method.$$parameters});x(G,"$source_location",function(){var b;return D(b=this.method.$$source_location)?
|
|
460
|
-
b:["(eval)",0]});x(G,"$comments",function(){var b;return D(b=this.method.$$comments)?b:[]});x(G,"$bind",function(m){if(this.owner.$$is_module||b.is_a(m,this.owner))return v("Method").$new(m,this.owner,this.method,this.name);B.$raise(v("TypeError"),"can't bind singleton method to a different class (expected "+m+".kind_of?("+this.owner+" to be true)")});x(G,"$bind_call",function P(b,n){var t=P.$$p||m;P.$$p=null;var v=q(arguments,1);return A(this.$bind(b),"call",z(v),t.$to_proc())},-2);return x(G,"$inspect",
|
|
461
|
-
function(){return"#<"+this.$class()+": "+this.source+"#"+this.name+" (defined in "+this.owner+" in "+this.$source_location().$join(":")+")>"})}("::",null)};Opal.modules["corelib/variables"]=function(b){var n=b.gvars,x=b.const_set,D=b.Object,q=b.hash2,E=b.nil;b.add_stubs("new");n["&"]=n["~"]=n["`"]=n["'"]=E;n.LOADED_FEATURES=n['"']=b.loaded_features;n.LOAD_PATH=n[":"]=[];n["/"]="\n";n[","]=E;x("::","ARGV",[]);x("::","ARGF",D.$new());x("::","ENV",q([],{}));n.VERBOSE=!1;n.DEBUG=!1;return n.SAFE=0};
|
|
462
|
-
Opal.modules["corelib/io"]=function(b){var n=b.klass,x=b.const_set,D=b.not,q=b.truthy,E=b.def,B=b.return_ivar,A=b.return_val,z=b.slice,m=b.Kernel,v=b.gvars,G=b.send,I=b.to_a,K=b.rb_plus,M=b.neqeq,t=b.range,J=b.hash2,P=b.eqeq,R=b.to_ary,W=b.rb_gt,N=b.assign_ivar_val,H=b.alias,L,U=b.nil,a=b.$$$;b.add_stubs("attr_reader,attr_accessor,!,match?,include?,size,write,String,flatten,puts,sysread_noraise,+,!=,[],ord,getc,readchar,raise,gets,==,to_str,length,split,sub,sysread,>,to_a,each_line,enum_for,getbyte,closed_write?,closed_read?,each,eof,new,write_proc=,read_proc=");
|
|
463
|
-
(function(d,$super){d=n(d,$super,"IO");var h=d.$$prototype;h.read_buffer=h.closed=U;x(d,"SEEK_SET",0);x(d,"SEEK_CUR",1);x(d,"SEEK_END",2);x(d,"SEEK_DATA",3);x(d,"SEEK_HOLE",4);x(d,"READABLE",1);x(d,"WRITABLE",4);d.$attr_reader("eof");d.$attr_accessor("read_proc","sync","tty","write_proc");E(d,"$initialize",function(a,b){null==b&&(b="r");this.fd=a;this.flags=b;this.eof=!1;return q(b["$include?"]("r"))&&D(b["$match?"](/[wa+]/))?this.closed="write":q(b["$match?"](/[wa]/))&&D(b["$match?"](/[r+]/))?this.closed=
|
|
464
|
-
"read":U},-2);E(d,"$fileno",B("fd"));E(d,"$tty?",function(){return 1==this.tty});E(d,"$write",function(a){this.write_proc(a);return a.$size()});E(d,"$flush",A(U));E(d,"$<<",function(a){this.$write(a);return this});E(d,"$print",function(a){null==v[","]&&(v[","]=U);var c=z(arguments);for(var b=0,d=c.length;b<d;b++)c[b]=m.$String(c[b]);this.$write(c.join(v[","]));return U},-1);E(d,"$puts",function(a){var c=z(arguments);if(0===c.length)return this.$write("\n"),U;for(var b=0,d=c.length;b<d;b++)if(c[b].$$is_array){var l=
|
|
465
|
-
c[b].$flatten();0<l.length&&G(this,"puts",I(l))}else l=c[b].$$is_string?c[b].valueOf():m.$String(c[b]),l.endsWith("\n")||(l+="\n"),this.$write(l);return U},-1);E(d,"$getc",function(){var a=U;this.read_buffer=q(a=this.read_buffer)?a:"";a="";do if(this.read_buffer=K(this.read_buffer,a),M(this.read_buffer,""))return a=this.read_buffer["$[]"](0),this.read_buffer=this.read_buffer["$[]"](t(1,-1,!1)),a;while(q(a=this.$sysread_noraise(1)));return U});E(d,"$getbyte",function(){var a;return a=this.$getc(),
|
|
466
|
-
a===U||null==a?U:a.$ord()});E(d,"$readbyte",function(){return this.$readchar().$ord()});E(d,"$readchar",function(){var c;return q(c=this.$getc())?c:m.$raise(a("EOFError"),"end of file reached")});E(d,"$readline",function(c){var b;var d=z(arguments);return q(b=G(this,"gets",I(d)))?b:m.$raise(a("EOFError"),"end of file reached")},-1);E(d,"$gets",function(a,d,h){var c=U;null==v["/"]&&(v["/"]=U);null==a&&(a=!1);null==d&&(d=U);null==h&&(h=J([],{}));if(q(a.$$is_number)&&D(d)){var l=[!1,a,d];a=l[0];d=l[1];
|
|
467
|
-
h=l[2];l}q(a.$$is_hash)&&D(d)&&P(h,J([],{}))?(l=[!1,U,a],a=l[0],d=l[1],h=l[2],l):q(d.$$is_hash)&&P(h,J([],{}))&&(l=[a,U,d],a=l[0],d=l[1],h=l[2],l);var e=a;P(a,!1)&&(a=v["/"]);P(a,"")&&(a=/\r?\n\r?\n/);a=q(c=a)?c:"";P(e,"")||(a=a.$to_str());var p=P(e,"")?2:a.$length();P(a," ")&&(a=/ /);this.read_buffer=q(c=this.read_buffer)?c:"";l="";var k=U;do if(this.read_buffer=K(this.read_buffer,l),M(a,"")&&q(q(a.$$is_regexp)?this.read_buffer["$match?"](a):this.read_buffer["$include?"](a))){var y=this.read_buffer;
|
|
468
|
-
a=this.read_buffer.$split(a,2);l=R(a);k=null==l[0]?U:l[0];this.read_buffer=null==l[1]?U:l[1];a;M(k,y)&&(k=K(k,y["$[]"](k.$length(),p)));break}while(q(l=this.$sysread_noraise(P(a,"")?65536:1)));q(k)||(l=[q(c=this.read_buffer)?c:"",""],k=l[0],this.read_buffer=l[1],l,P(k,"")&&(k=U));q(k)&&(q(d)&&(k=k["$[]"](b.Range.$new(0,d,!0)),this.read_buffer=K(k["$[]"](b.Range.$new(d,-1,!1)),this.read_buffer)),q(h["$[]"]("chomp"))&&(k=k.$sub(/\r?\n$/,"")),P(e,"")&&(k=k.$sub(/^[\r\n]+/,"")));P(e,!1)&&(v._=k);return k},
|
|
469
|
-
-1);E(d,"$sysread",function(c){if(q(c=this.read_proc(c)))return c;this.eof=!0;return m.$raise(a("EOFError"),"end of file reached")});E(d,"$sysread_noraise",function(c){try{return this.$sysread(c)}catch(p){if(b.rescue(p,[a("EOFError")]))try{return U}finally{b.pop_exception()}else throw p;}});E(d,"$readpartial",function(a){var c=U;this.read_buffer=q(c=this.read_buffer)?c:"";a=this.$sysread(a);a=[K(this.read_buffer,q(c=a)?c:""),""];c=a[0];this.read_buffer=a[1];a;P(c,"")&&(c=U);return c});E(d,"$read",
|
|
470
|
-
function(a){var c=U;null==a&&(a=U);this.read_buffer=q(c=this.read_buffer)?c:"";var d="";do if(this.read_buffer=K(this.read_buffer,d),q(a)&&q(W(this.read_buffer.$length(),a)))return a=[this.read_buffer["$[]"](b.Range.$new(0,a,!0)),this.read_buffer["$[]"](b.Range.$new(a,-1,!1))],c=a[0],this.read_buffer=a[1],a,c;while(q(d=this.$sysread_noraise(q(c=a)?c:65536)));a=[this.read_buffer,""];c=a[0];this.read_buffer=a[1];a;return c},-1);E(d,"$readlines",function(a){null==v["/"]&&(v["/"]=U);null==a&&(a=v["/"]);
|
|
471
|
-
return this.$each_line(a).$to_a()},-1);E(d,"$each",function g(a,d){var l=g.$$p||U,e,h;null==v["/"]&&(v["/"]=U);g.$$p=null;var p=z(arguments);0<p.length&&(e=p.shift());null==e&&(e=v["/"]);if(l===U)return G(this,"enum_for",["each",e].concat(I(p)));for(;q(h=G(this,"gets",[e].concat(I(p))));)b.yield1(l,h);return this},-1);E(d,"$each_byte",function T(){var a=T.$$p||U,d;T.$$p=null;if(a===U)return this.$enum_for("each_byte");for(;q(d=this.$getbyte());)b.yield1(a,d);return this});E(d,"$each_char",function g(){var a=
|
|
472
|
-
g.$$p||U,d;g.$$p=null;if(a===U)return this.$enum_for("each_char");for(;q(d=this.$getc());)b.yield1(a,d);return this});E(d,"$close",N("closed","both"));E(d,"$close_read",function(){return P(this.closed,"write")?this.closed="both":this.closed="read"});E(d,"$close_write",function(){return P(this.closed,"read")?this.closed="both":this.closed="write"});E(d,"$closed?",function(){return this.closed["$=="]("both")});E(d,"$closed_read?",function(){var a;return q(a=this.closed["$=="]("read"))?a:this.closed["$=="]("both")});
|
|
473
|
-
E(d,"$closed_write?",function(){var a;return q(a=this.closed["$=="]("write"))?a:this.closed["$=="]("both")});E(d,"$check_writable",function(){return q(this["$closed_write?"]())?m.$raise(a("IOError"),"not opened for writing"):U});E(d,"$check_readable",function(){return q(this["$closed_read?"]())?m.$raise(a("IOError"),"not opened for reading"):U});H(d,"each_line","each");return H(d,"eof?","eof")})("::",null);x("::","STDIN",v.stdin=a("IO").$new(0,"r"));x("::","STDOUT",v.stdout=a("IO").$new(1,"w"));x("::",
|
|
474
|
-
"STDERR",v.stderr=a("IO").$new(2,"w"));var k=b.global.console;a("STDOUT")["$write_proc="]("object"===typeof process&&"object"===typeof process.stdout?function(a){process.stdout.write(a)}:function(a){k.log(a)});a("STDERR")["$write_proc="]("object"===typeof process&&"object"===typeof process.stderr?function(a){process.stderr.write(a)}:function(a){k.warn(a)});return L=[function(a){a=prompt();return null!==a?a+"\n":U}],G(a("STDIN"),"read_proc=",L),L[L.length-1]};
|
|
475
|
-
Opal.modules["opal/regexp_anchors"]=function(b){var n=b.module,x=b.const_set,D=[],q=b.$$$;b.add_stubs("new");n=n(D[0],"Opal");D=[n].concat(D);b=b.$r(D);x(n,"REGEXP_START","^");x(n,"REGEXP_END","$");x(n,"FORBIDDEN_STARTING_IDENTIFIER_CHARS","\\u0001-\\u002F\\u003A-\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");x(n,"FORBIDDEN_ENDING_IDENTIFIER_CHARS","\\u0001-\\u0020\\u0022-\\u002F\\u003A-\\u003E\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");x(n,"INLINE_IDENTIFIER_REGEXP",b("Regexp").$new("[^"+q(n,
|
|
476
|
-
"FORBIDDEN_STARTING_IDENTIFIER_CHARS")+"]*[^"+q(n,"FORBIDDEN_ENDING_IDENTIFIER_CHARS")+"]"));x(n,"FORBIDDEN_CONST_NAME_CHARS","\\u0001-\\u0020\\u0021-\\u002F\\u003B-\\u003F\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F");return x(n,"CONST_NAME_REGEXP",b("Regexp").$new(""+q(n,"REGEXP_START")+"(::)?[A-Z][^"+q(n,"FORBIDDEN_CONST_NAME_CHARS")+"]*"+q(n,"REGEXP_END")))};
|
|
477
|
-
Opal.modules["opal/mini"]=function(b){var n=b.Object;b.add_stubs("require");n.$require("opal/base");n.$require("corelib/nil");n.$require("corelib/boolean");n.$require("corelib/string");n.$require("corelib/comparable");n.$require("corelib/enumerable");n.$require("corelib/enumerator");n.$require("corelib/array");n.$require("corelib/hash");n.$require("corelib/number");n.$require("corelib/range");n.$require("corelib/proc");n.$require("corelib/method");n.$require("corelib/regexp");n.$require("corelib/variables");
|
|
478
|
-
n.$require("corelib/io");return n.$require("opal/regexp_anchors")};
|
|
479
|
-
Opal.modules["corelib/kernel/format"]=function(b){var n=b.coerce_to,x=b.module,D=b.slice,q=b.truthy,E=b.eqeq,B=b.Opal,A=b.Kernel,z=b.gvars,m=b.def,v=b.alias,G=b.nil,I=b.$$$;b.add_stubs("respond_to?,[],==,length,coerce_to?,nil?,to_a,raise,to_int,fetch,Integer,Float,to_ary,to_str,inspect,to_s,format");return function(b){b=x(b,"Kernel");m(b,"$format",function(b,m){function t(){l&32&&A.$raise(I("ArgumentError"),"flag after width");l&128&&A.$raise(I("ArgumentError"),"flag after precision")}function v(){l&
|
|
480
|
-
32&&A.$raise(I("ArgumentError"),"width given twice");l&128&&A.$raise(I("ArgumentError"),"width after precision")}function x(a){a>=k.length&&A.$raise(I("ArgumentError"),"too few arguments");return k[a]}function K(){switch(T){case -1:A.$raise(I("ArgumentError"),"unnumbered("+p+") mixed with numbered");case -2:A.$raise(I("ArgumentError"),"unnumbered("+p+") mixed with named")}T=p++;return x(T-1)}function N(a){0<T&&A.$raise(I("ArgumentError"),"numbered("+a+") after unnumbered("+T+")");-2===T&&A.$raise(I("ArgumentError"),
|
|
481
|
-
"numbered("+a+") after named");1>a&&A.$raise(I("ArgumentError"),"invalid index - "+a+"$");T=-1;return x(a-1)}function H(){return void 0===ha?K():ha}function L(a){var c;for(c="";;f++){f===h&&A.$raise(I("ArgumentError"),"malformed format string - %*[0-9]");if(48>b.charCodeAt(f)||57<b.charCodeAt(f))return f--,c=parseInt(c,10)||0,2147483647<c&&A.$raise(I("ArgumentError"),""+a+" too big"),c;c+=b.charAt(f)}}function M(a){a=L(a);"$"===b.charAt(f+1)?(f++,a=N(a)):a=K();return a.$to_int()}var a=G;null==z.DEBUG&&
|
|
482
|
-
(z.DEBUG=G);var k=D(arguments,1);E(k.$length(),1)&&q(k["$[]"](0)["$respond_to?"]("to_ary"))&&(a=B["$coerce_to?"](k["$[]"](0),I("Array"),"to_ary"),q(a["$nil?"]())||(k=a.$to_a()));a="";var d=0,f,h=b.length,c,p=1,T=0;for(f=b.indexOf("%");-1!==f;f=b.indexOf("%",f)){var g=void 0;var l=0;var e=c=-1;var ha=void 0;var S=f;f++;switch(b.charAt(f)){case "%":d=f;case "":case "\n":case "\x00":f++;continue}a:for(;f<h;f++)switch(b.charAt(f)){case " ":t();l|=16;continue a;case "#":t();l|=1;continue a;case "+":t();
|
|
483
|
-
l|=4;continue a;case "-":t();l|=2;continue a;case "0":t();l|=8;continue a;case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":var y=L("width");if("$"===b.charAt(f+1)){if(f+2===h){g="%";f++;break a}void 0!==ha&&A.$raise(I("ArgumentError"),"value given twice - %"+y+"$");ha=N(y);f++}else v(),l|=32,c=y;continue a;case "<":case "{":var O="<"===b.charAt(f)?">":"}";y="";for(f++;;f++){f===h&&A.$raise(I("ArgumentError"),"malformed name - unmatched parenthesis");if(b.charAt(f)===
|
|
484
|
-
O)if(0<T&&A.$raise(I("ArgumentError"),"named "+y+" after unnumbered("+T+")"),-1===T&&A.$raise(I("ArgumentError"),"named "+y+" after numbered"),T=-2,void 0!==k[0]&&k[0].$$is_hash||A.$raise(I("ArgumentError"),"one hash required"),ha=k[0].$fetch(y),">"===O)continue a;else{g=ha.toString();-1!==e&&(g=g.slice(0,e));if(l&2)for(;g.length<c;)g+=" ";else for(;g.length<c;)g=" "+g;break a}y+=b.charAt(f)}case "*":f++;v();l|=32;c=M("width");0>c&&(l|=2,c=-c);continue a;case ".":l&128&&A.$raise(I("ArgumentError"),
|
|
485
|
-
"precision given twice");l|=192;e=0;f++;if("*"===b.charAt(f)){f++;e=M("precision");0>e&&(l&=-65);continue a}e=L("precision");continue a;case "d":case "i":case "u":y=A.$Integer(H());if(0<=y){for(g=y.toString();g.length<e;)g="0"+g;if(l&2){if(l&4||l&16)g=(l&4?"+":" ")+g;for(;g.length<c;)g+=" "}else if(l&8&&-1===e){for(;g.length<c-(l&4||l&16?1:0);)g="0"+g;if(l&4||l&16)g=(l&4?"+":" ")+g}else{if(l&4||l&16)g=(l&4?"+":" ")+g;for(;g.length<c;)g=" "+g}}else{for(g=(-y).toString();g.length<e;)g="0"+g;if(l&2)for(g=
|
|
486
|
-
"-"+g;g.length<c;)g+=" ";else if(l&8&&-1===e){for(;g.length<c-1;)g="0"+g;g="-"+g}else for(g="-"+g;g.length<c;)g=" "+g}break a;case "b":case "B":case "o":case "x":case "X":switch(b.charAt(f)){case "b":case "B":var F=2;var Z="0b";var la=/^1+/;var ea="1";break;case "o":F=8;Z="0";la=/^3?7+/;ea="7";break;case "x":case "X":F=16,Z="0x",la=/^f+/,ea="f"}y=A.$Integer(H());if(0<=y){for(g=y.toString(F);g.length<e;)g="0"+g;if(l&2){if(l&4||l&16)g=(l&4?"+":" ")+g;for(l&1&&0!==y&&(g=Z+g);g.length<c;)g+=" "}else if(l&
|
|
487
|
-
8&&-1===e){for(;g.length<c-(l&4||l&16?1:0)-(l&1&&0!==y?Z.length:0);)g="0"+g;l&1&&0!==y&&(g=Z+g);if(l&4||l&16)g=(l&4?"+":" ")+g}else{l&1&&0!==y&&(g=Z+g);if(l&4||l&16)g=(l&4?"+":" ")+g;for(;g.length<c;)g=" "+g}}else if(l&4||l&16){for(g=(-y).toString(F);g.length<e;)g="0"+g;if(l&2)for(l&1&&(g=Z+g),g="-"+g;g.length<c;)g+=" ";else if(l&8&&-1===e){for(;g.length<c-1-(l&1?2:0);)g="0"+g;l&1&&(g=Z+g);g="-"+g}else for(l&1&&(g=Z+g),g="-"+g;g.length<c;)g=" "+g}else{for(g=(y>>>0).toString(F).replace(la,ea);g.length<
|
|
488
|
-
e-2;)g=ea+g;if(l&2)for(g=".."+g,l&1&&(g=Z+g);g.length<c;)g+=" ";else if(l&8&&-1===e){for(;g.length<c-2-(l&1?Z.length:0);)g=ea+g;g=".."+g;l&1&&(g=Z+g)}else for(g=".."+g,l&1&&(g=Z+g);g.length<c;)g=" "+g}b.charAt(f)===b.charAt(f).toUpperCase()&&(g=g.toUpperCase());break a;case "f":case "e":case "E":case "g":case "G":y=A.$Float(H());if(0<=y||isNaN(y)){if(Infinity===y)g="Inf";else switch(b.charAt(f)){case "f":g=y.toFixed(-1===e?6:e);break;case "e":case "E":g=y.toExponential(-1===e?6:e);break;case "g":case "G":g=
|
|
489
|
-
y.toExponential(),O=parseInt(g.split("e")[1],10),-4>O||O>=(-1===e?6:e)||(g=y.toPrecision(-1===e?l&1?6:void 0:e))}if(l&2){if(l&4||l&16)g=(l&4?"+":" ")+g;for(;g.length<c;)g+=" "}else if(l&8&&Infinity!==y&&!isNaN(y)){for(;g.length<c-(l&4||l&16?1:0);)g="0"+g;if(l&4||l&16)g=(l&4?"+":" ")+g}else{if(l&4||l&16)g=(l&4?"+":" ")+g;for(;g.length<c;)g=" "+g}}else{if(-Infinity===y)g="Inf";else switch(b.charAt(f)){case "f":g=(-y).toFixed(-1===e?6:e);break;case "e":case "E":g=(-y).toExponential(-1===e?6:e);break;
|
|
490
|
-
case "g":case "G":g=(-y).toExponential(),O=parseInt(g.split("e")[1],10),-4>O||O>=(-1===e?6:e)||(g=(-y).toPrecision(-1===e?l&1?6:void 0:e))}if(l&2)for(g="-"+g;g.length<c;)g+=" ";else if(l&8&&-Infinity!==y){for(;g.length<c-1;)g="0"+g;g="-"+g}else for(g="-"+g;g.length<c;)g=" "+g}b.charAt(f)!==b.charAt(f).toUpperCase()||Infinity===y||-Infinity===y||isNaN(y)||(g=g.toUpperCase());g=g.replace(/([eE][-+]?)([0-9])$/,"$10$2");break a;case "a":case "A":A.$raise(I("NotImplementedError"),"`A` and `a` format field types are not implemented in Opal yet");
|
|
491
|
-
case "c":y=H();y["$respond_to?"]("to_ary")&&(y=y.$to_ary()[0]);g=y["$respond_to?"]("to_str")?y.$to_str():String.fromCharCode(n(y,I("Integer"),"to_int"));1!==g.length&&A.$raise(I("ArgumentError"),"%c requires a character");if(l&2)for(;g.length<c;)g+=" ";else for(;g.length<c;)g=" "+g;break a;case "p":g=H().$inspect();-1!==e&&(g=g.slice(0,e));if(l&2)for(;g.length<c;)g+=" ";else for(;g.length<c;)g=" "+g;break a;case "s":g=H().$to_s();-1!==e&&(g=g.slice(0,e));if(l&2)for(;g.length<c;)g+=" ";else for(;g.length<
|
|
492
|
-
c;)g=" "+g;break a;default:A.$raise(I("ArgumentError"),"malformed format string - %"+b.charAt(f))}void 0===g&&A.$raise(I("ArgumentError"),"malformed format string - %");a+=b.slice(d,S)+g;d=f+1}z.DEBUG&&0<=T&&p<k.length&&A.$raise(I("ArgumentError"),"too many arguments for format string");return a+b.slice(d)},-2);return v(b,"sprintf","format")}("::")};
|
|
493
|
-
Opal.modules["corelib/string/encoding"]=function(b){var n=b.klass,x=b.hash2,D=b.rb_plus,q=b.truthy,E=b.send,B=b.defs,A=b.eqeq,z=b.def,m=b.return_ivar,v=b.return_val,G=b.slice,I=b.Kernel,K=b.Opal,M=b.rb_lt,t,J=b.top,P=b.$r([]),R=b.nil,W=b.$$$;b.add_stubs("require,+,[],clone,initialize,new,instance_eval,to_proc,each,const_set,tr,==,default_external,attr_accessor,singleton_class,attr_reader,raise,register,length,bytes,force_encoding,dup,bytesize,enum_for,each_byte,to_a,each_char,each_codepoint,coerce_to!,find,<,default_external=");
|
|
494
|
-
J.$require("corelib/string");(function(t,$super){t=n(t,$super,"Encoding");var N=t.$$prototype;N.name=N.dummy=R;B(t,"$register",function d(a,k){var f=d.$$p||R,h=R,c=R,p=R,m=R,g=R,l=R;d.$$p=null;null==k&&(k=x([],{}));h=D([a],q(c=k["$[]"]("aliases"))?c:[]);p=q(c=k["$[]"]("ascii"))&&c;m=q(c=k["$[]"]("dummy"))&&c;q(k["$[]"]("inherits"))?(g=k["$[]"]("inherits").$clone(),g.$initialize(a,h,p,m)):g=this.$new(a,h,p,m);f!==R&&E(g,"instance_eval",[],f.$to_proc());l=b.encodings;return E(h,"each",[],function S(a){var c=
|
|
495
|
-
null==S.$$s?this:S.$$s;null==a&&(a=R);c.$const_set(a.$tr("-","_"),g);return l[a]=g},{$$s:this})},-2);B(t,"$find",function(a){return A(a,"default_external")?this.$default_external():b.find_encoding(a)});t.$singleton_class().$attr_accessor("default_external");t.$attr_reader("name","names");z(t,"$initialize",function(a,b,d,f){this.name=a;this.names=b;this.ascii=d;return this.dummy=f});z(t,"$ascii_compatible?",m("ascii"));z(t,"$dummy?",m("dummy"));z(t,"$binary?",v(!1));z(t,"$to_s",m("name"));z(t,"$inspect",
|
|
496
|
-
function(){return"#<Encoding:"+this.name+(q(this.dummy)?" (dummy)":R)+">"});z(t,"$charsize",function(a){for(var b=0,d=0,f=a.length;d<f;d++){var h=a.charCodeAt(d);55296<=h&&56319>=h||b++}return b});z(t,"$each_char",function d(k){var f=d.$$p||R;d.$$p=null;for(var h="",c=0,p=k.length;c<p;c++){var m=k.charCodeAt(c),g=k.charAt(c);56320<=m&&57343>=m?h=g:(55296<=m&&56319>=m&&(g=h+g),"UTF-8"!=k.encoding.name&&(g=new String(g),g.encoding=k.encoding),b.yield1(f,g))}});z(t,"$each_byte",function(b){G(arguments);
|
|
497
|
-
return I.$raise(W("NotImplementedError"))},-1);z(t,"$bytesize",function(b){G(arguments);return I.$raise(W("NotImplementedError"))},-1);n("::",W("StandardError"),"EncodingError");return n("::",W("EncodingError"),"CompatibilityError"),R})("::",null);E(W("Encoding"),"register",["UTF-8",x(["aliases","ascii"],{aliases:["CP65001"],ascii:!0})],function H(){var m=null==H.$$s?this:H.$$s;z(m,"$each_byte",function k(a){var d=k.$$p||R;k.$$p=null;for(var f=Infinity,h,c=a.length,p=null,m=0;m<c;++m){h=a.charCodeAt(m);
|
|
498
|
-
if(55295<h&&57344>h){if(!p){if(56319<h){-1<(f-=3)&&(b.yield1(d,239),b.yield1(d,191),b.yield1(d,189));continue}else if(m+1===c){-1<(f-=3)&&(b.yield1(d,239),b.yield1(d,191),b.yield1(d,189));continue}p=h;continue}if(56320>h){-1<(f-=3)&&(b.yield1(d,239),b.yield1(d,191),b.yield1(d,189));p=h;continue}h=(p-55296<<10|h-56320)+65536}else p&&-1<(f-=3)&&(b.yield1(d,239),b.yield1(d,191),b.yield1(d,189));p=null;if(128>h){if(0>--f)break;b.yield1(d,h)}else if(2048>h){if(0>(f-=2))break;b.yield1(d,h>>6|192);b.yield1(d,
|
|
499
|
-
h&63|128)}else if(65536>h){if(0>(f-=3))break;b.yield1(d,h>>12|224);b.yield1(d,h>>6&63|128);b.yield1(d,h&63|128)}else if(1114112>h){if(0>(f-=4))break;b.yield1(d,h>>18|240);b.yield1(d,h>>12&63|128);b.yield1(d,h>>6&63|128);b.yield1(d,h&63|128)}}});return z(m,"$bytesize",function(a){return a.$bytes().$length()})},{$$s:J});E(W("Encoding"),"register",["UTF-16LE"],function L(){var m=null==L.$$s?this:L.$$s;z(m,"$each_byte",function d(k){var f=d.$$p||R;d.$$p=null;for(var h=0,c=k.length;h<c;h++){var p=k.charCodeAt(h);
|
|
500
|
-
b.yield1(f,p&255);b.yield1(f,p>>8)}});return z(m,"$bytesize",function(b){return 2*b.length})},{$$s:J});E(W("Encoding"),"register",["UTF-16BE",x(["inherits"],{inherits:W(W("Encoding"),"UTF_16LE")})],function U(){return z(null==U.$$s?this:U.$$s,"$each_byte",function d(k){var f=d.$$p||R;d.$$p=null;for(var h=0,c=k.length;h<c;h++){var p=k.charCodeAt(h);b.yield1(f,p>>8);b.yield1(f,p&255)}})},{$$s:J});E(W("Encoding"),"register",["UTF-32LE"],function a(){var k=null==a.$$s?this:a.$$s;z(k,"$each_byte",function h(a){var c=
|
|
501
|
-
h.$$p||R;h.$$p=null;for(var f=0,k=a.length;f<k;f++){var g=a.charCodeAt(f);b.yield1(c,g&255);b.yield1(c,g>>8);b.yield1(c,0);b.yield1(c,0)}});return z(k,"$bytesize",function(a){return 4*a.length})},{$$s:J});E(W("Encoding"),"register",["UTF-32BE",x(["inherits"],{inherits:W(W("Encoding"),"UTF_32LE")})],function k(){return z(null==k.$$s?this:k.$$s,"$each_byte",function h(f){var c=h.$$p||R;h.$$p=null;for(var p=0,k=f.length;p<k;p++){var g=f.charCodeAt(p);b.yield1(c,0);b.yield1(c,0);b.yield1(c,g>>8);b.yield1(c,
|
|
502
|
-
g&255)}})},{$$s:J});E(W("Encoding"),"register",["ASCII-8BIT",x(["aliases","ascii"],{aliases:["BINARY"],ascii:!0})],function d(){var f=null==d.$$s?this:d.$$s;z(f,"$each_char",function p(c){var d=p.$$p||R;p.$$p=null;for(var f=0,l=c.length;f<l;f++){var e=new String(c.charAt(f));e.encoding=c.encoding;b.yield1(d,e)}});z(f,"$charsize",function(c){return c.length});z(f,"$each_byte",function T(d){var f=T.$$p||R;T.$$p=null;for(var l=0,e=d.length;l<e;l++){var p=d.charCodeAt(l);b.yield1(f,p&255)}});z(f,"$bytesize",
|
|
503
|
-
function(b){return b.length});return z(f,"$binary?",v(!0))},{$$s:J});W("Encoding").$register("ISO-8859-1",x(["aliases","ascii","inherits"],{aliases:["ISO8859-1"],ascii:!0,inherits:W(W("Encoding"),"ASCII_8BIT")}));W("Encoding").$register("US-ASCII",x(["aliases","ascii","inherits"],{aliases:["ASCII"],ascii:!0,inherits:W(W("Encoding"),"ASCII_8BIT")}));(function(d,$super){d=n(d,$super,"String");var h=d.$$prototype;h.internal_encoding=h.bytes=h.encoding=R;d.$attr_reader("encoding");d.$attr_reader("internal_encoding");
|
|
504
|
-
b.prop(String.prototype,"bytes",R);b.prop(String.prototype,"encoding",W(W("Encoding"),"UTF_8"));b.prop(String.prototype,"internal_encoding",W(W("Encoding"),"UTF_8"));z(d,"$b",function(){return this.$dup().$force_encoding("binary")});z(d,"$bytesize",function(){return this.internal_encoding.$bytesize(this)});z(d,"$each_byte",function p(){var b=p.$$p||R;p.$$p=null;if(b===R)return E(this,"enum_for",["each_byte"],function l(){return(null==l.$$s?this:l.$$s).$bytesize()},{$$s:this});E(this.internal_encoding,
|
|
505
|
-
"each_byte",[this],b.$to_proc());return this});z(d,"$bytes",function(){var b=R;if("string"===typeof this)return(new String(this)).$each_byte().$to_a();this.bytes=q(b=this.bytes)?b:this.$each_byte().$to_a();return this.bytes.$dup()});z(d,"$each_char",function T(){var b=T.$$p||R;T.$$p=null;if(b===R)return E(this,"enum_for",["each_char"],function e(){return(null==e.$$s?this:e.$$s).$length()},{$$s:this});E(this.encoding,"each_char",[this],b.$to_proc());return this});z(d,"$chars",function g(){var b=g.$$p||
|
|
506
|
-
R;g.$$p=null;return q(b)?E(this,"each_char",[],b.$to_proc()):this.$each_char().$to_a()});z(d,"$each_codepoint",function l(){var d=l.$$p||R;l.$$p=null;if(d===R)return this.$enum_for("each_codepoint");for(var h=0,m=this.length;h<m;h++)b.yield1(d,this.codePointAt(h));return this});z(d,"$codepoints",function e(){var b=e.$$p||R;e.$$p=null;return b!==R?E(this,"each_codepoint",[],b.$to_proc()):this.$each_codepoint().$to_a()});z(d,"$encode",function(d){return b.enc(this,d)});z(d,"$force_encoding",function(d){var e=
|
|
507
|
-
this;if(d===e.encoding)return e;d=K["$coerce_to!"](d,W("String"),"to_s");d=W("Encoding").$find(d);return d===e.encoding?e:e=b.set_encoding(e,d)});z(d,"$getbyte",function(b){var d=this.$bytes();b=K["$coerce_to!"](b,W("Integer"),"to_int");return q(M(d.$length(),b))?R:d["$[]"](b)});z(d,"$initialize_copy",function(b){return"\n self.encoding = other.encoding;\n self.internal_encoding = other.internal_encoding;\n "});return z(d,"$valid_encoding?",v(!0))})("::",null);return t=[W(P("Encoding"),
|
|
508
|
-
"UTF_8")],E(W("Encoding"),"default_external=",t),t[t.length-1]};
|
|
509
|
-
Opal.modules["corelib/math"]=function(b){var n=b.type_error,x=b.module,D=b.const_set,q=b.Class,E=b.slice,B=b.Kernel,A=b.defs,z=b.truthy,m=b.send,v=b.def,G=b.rb_minus,I=b.eqeqeq,K=b.rb_divide,M=b.nil,t=b.$$$;b.add_stubs("new,raise,Float,Integer,module_function,each,define_method,checked,float!,===,gamma,-,integer!,/,infinite?");return function(J,P){J=x(J,"Math");P=[J].concat(P);var R=b.$r(P);D(J,"E",Math.E);D(J,"PI",Math.PI);D(J,"DomainError",q.$new(t("StandardError")));A(J,"$checked",function(b,m){var n=
|
|
510
|
-
E(arguments,1);if(isNaN(n[0])||2==n.length&&isNaN(n[1]))return NaN;n=Math[b].apply(null,n);isNaN(n)&&B.$raise(R("DomainError"),'Numerical argument is out of domain - "'+b+'"');return n},-2);A(J,"$float!",function(m){try{return B.$Float(m)}catch(N){if(b.rescue(N,[t("ArgumentError")]))try{return B.$raise(n(m,t("Float")))}finally{b.pop_exception()}else throw N;}});A(J,"$integer!",function(m){try{return B.$Integer(m)}catch(N){if(b.rescue(N,[t("ArgumentError")]))try{return B.$raise(n(m,t("Integer")))}finally{b.pop_exception()}else throw N;
|
|
511
|
-
}});J.$module_function();z("undefined"!==typeof Math.erf)||b.prop(Math,"erf",function(b){var m=1;0>b&&(m=-1);b=Math.abs(b);var n=1/(1+.3275911*b);return m*(1-((((1.061405429*n+-1.453152027)*n+1.421413741)*n+-.284496736)*n+.254829592)*n*Math.exp(-b*b))});z("undefined"!==typeof Math.erfc)||b.prop(Math,"erfc",function(b){var m=Math.abs(b),n=1/(.5*m+1);m=n*Math.exp(-m*m-1.26551223+n*(n*(n*(n*(n*(n*(n*(n*(.17087277*n+-.82215223)+1.48851587)+-1.13520398)+.27886807)+-.18628806)+.09678418)+.37409196)+1.00002368));
|
|
512
|
-
return 0>b?2-m:m});m("acos acosh asin asinh atan atanh cbrt cos cosh erf erfc exp sin sinh sqrt tanh".split(" "),"each",[],function H(b){var n=null==H.$$s?this:H.$$s;null==b&&(b=M);return m(n,"define_method",[b],function(m){null==m&&(m=M);return t("Math").$checked(b,t("Math")["$float!"](m))})},{$$s:J});v(J,"$atan2",function(b,m){return t("Math").$checked("atan2",t("Math")["$float!"](b),t("Math")["$float!"](m))});v(J,"$hypot",function(b,m){return t("Math").$checked("hypot",t("Math")["$float!"](b),
|
|
513
|
-
t("Math")["$float!"](m))});v(J,"$frexp",function(b){b=R("Math")["$float!"](b);if(isNaN(b))return[NaN,0];var m=Math.floor(Math.log(Math.abs(b))/Math.log(2))+1;return[b/Math.pow(2,m),m]});v(J,"$gamma",function(b){b=R("Math")["$float!"](b);var m=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3.399464998481189E-5,4.652362892704858E-5,-9.837447530487956E-5,1.580887032249125E-4,-2.1026444172410488E-4,2.1743961811521265E-4,-1.643181065367639E-4,8.441822398385275E-5,
|
|
514
|
-
-2.6190838401581408E-5,3.6899182659531625E-6];if(isNaN(b))return NaN;if(0===b&&0>1/b)return-Infinity;-1!==b&&-Infinity!==b||B.$raise(R("DomainError"),'Numerical argument is out of domain - "gamma"');if(R("Integer")["$==="](b)){if(0>=b)return isFinite(b)?Infinity:NaN;if(171<b)return Infinity;var n=b-2;for(--b;1<n;)b*=n,n--;0==b&&(b=1);return b}if(.5>b)return Math.PI/(Math.sin(Math.PI*b)*t("Math").$gamma(G(1,b)));if(171.35<=b)return Infinity;if(85<b){n=b*b;var q=n*b;m=q*b;var a=m*b;return Math.sqrt(2*
|
|
515
|
-
Math.PI/b)*Math.pow(b/Math.E,b)*(1+1/(12*b)+1/(288*n)-139/(51840*q)-571/(2488320*m)+163879/(209018880*a)+5246819/(75246796800*a*b))}--b;n=m[0];for(q=1;q<m.length;++q)n+=m[q]/(b+q);q=b+4.7421875+.5;return Math.sqrt(2*Math.PI)*Math.pow(q,b+.5)*Math.exp(-q)*n});v(J,"$ldexp",function(b,m){b=R("Math")["$float!"](b);m=R("Math")["$integer!"](m);isNaN(m)&&B.$raise(t("RangeError"),"float NaN out of range of integer");return b*Math.pow(2,m)});v(J,"$lgamma",function(b){return-1==b?[Infinity,1]:[Math.log(Math.abs(t("Math").$gamma(b))),
|
|
516
|
-
0>t("Math").$gamma(b)?-1:1]});v(J,"$log",function(b,m){I(t("String"),b)&&B.$raise(n(b,t("Float")));if(z(null==m))return t("Math").$checked("log",t("Math")["$float!"](b));I(t("String"),m)&&B.$raise(n(m,t("Float")));return K(t("Math").$checked("log",t("Math")["$float!"](b)),t("Math").$checked("log",t("Math")["$float!"](m)))},-2);v(J,"$log10",function(b){I(t("String"),b)&&B.$raise(n(b,t("Float")));return t("Math").$checked("log10",t("Math")["$float!"](b))});v(J,"$log2",function(b){I(t("String"),b)&&
|
|
517
|
-
B.$raise(n(b,t("Float")));return t("Math").$checked("log2",t("Math")["$float!"](b))});return v(J,"$tan",function(b){b=t("Math")["$float!"](b);return z(b["$infinite?"]())?t(t("Float"),"NAN"):t("Math").$checked("tan",t("Math")["$float!"](b))})}("::",[])};
|
|
518
|
-
Opal.modules["corelib/complex/base"]=function(b){var n=b.module,x=b.truthy,D=b.def,q=b.klass,E=[],B=b.nil;b.add_stubs("new,from_string");(function(q,z){q=n(q,"Kernel");z=[q].concat(z);var m=b.$r(z);return D(q,"$Complex",function(b,n){null==n&&(n=B);return x(n)?m("Complex").$new(b,n):m("Complex").$new(b,0)},-2)})("::",E);return function(n,$super,m){n=q(n,$super,"String");m=[n].concat(m);var v=b.$r(m);return D(n,"$to_c",function(){return v("Complex").$from_string(this)})}("::",null,E)};
|
|
519
|
-
Opal.modules["corelib/complex"]=function(b){var n=b.klass,x=b.truthy,D=b.eqeqeq,q=b.Kernel,E=b.defs,B=b.rb_times,A=b.def,z=b.rb_plus,m=b.rb_minus,v=b.rb_divide,G=b.eqeq,I=b.to_ary,K=b.rb_gt,M=b.neqeq,t=b.return_val,J=b.const_set,P=b.alias,R=b.top,W=b.nil,N=b.$$$;b.add_stubs("require,real?,===,raise,new,*,cos,sin,attr_reader,freeze,class,==,real,imag,Complex,-@,+,__coerced__,-,nan?,/,conj,abs2,quo,polar,exp,log,>,!=,divmod,**,hypot,atan2,lcm,denominator,finite?,infinite?,numerator,abs,arg,rationalize,to_f,to_i,to_r,inspect,zero?,positive?,Rational,rect,angle");
|
|
520
|
-
R.$require("corelib/numeric");R.$require("corelib/complex/base");return function(H,$super,R){H=n(H,$super,"Complex");R=[H].concat(R);var a=b.$r(R),k=H.$$prototype;k.real=k.imag=W;E(H,"$rect",function(a,b){null==b&&(b=0);D(N("Numeric"),a)&&x(a["$real?"]())&&D(N("Numeric"),b)&&x(b["$real?"]())||q.$raise(N("TypeError"),"not a real");return this.$new(a,b)},-2);E(H,"$polar",function(a,b){null==b&&(b=0);D(N("Numeric"),a)&&x(a["$real?"]())&&D(N("Numeric"),b)&&x(b["$real?"]())||q.$raise(N("TypeError"),"not a real");
|
|
521
|
-
return this.$new(B(a,N("Math").$cos(b)),B(a,N("Math").$sin(b)))},-2);H.$attr_reader("real","imag");A(H,"$initialize",function(a,b){null==b&&(b=0);this.real=a;this.imag=b;return this.$freeze()},-2);A(H,"$coerce",function(a){return D(N("Complex"),a)?[a,this]:D(N("Numeric"),a)&&x(a["$real?"]())?[N("Complex").$new(a,0),this]:q.$raise(N("TypeError"),""+a.$class()+" can't be coerced into Complex")});A(H,"$==",function(a){var b;return D(N("Complex"),a)?x(b=this.real["$=="](a.$real()))?this.imag["$=="](a.$imag()):
|
|
522
|
-
b:D(N("Numeric"),a)&&x(a["$real?"]())?x(b=this.real["$=="](a))?this.imag["$=="](0):b:a["$=="](this)});A(H,"$-@",function(){return q.$Complex(this.real["$-@"](),this.imag["$-@"]())});A(H,"$+",function(a){return D(N("Complex"),a)?q.$Complex(z(this.real,a.$real()),z(this.imag,a.$imag())):D(N("Numeric"),a)&&x(a["$real?"]())?q.$Complex(z(this.real,a),this.imag):this.$__coerced__("+",a)});A(H,"$-",function(a){return D(N("Complex"),a)?q.$Complex(m(this.real,a.$real()),m(this.imag,a.$imag())):D(N("Numeric"),
|
|
523
|
-
a)&&x(a["$real?"]())?q.$Complex(m(this.real,a),this.imag):this.$__coerced__("-",a)});A(H,"$*",function(a){return D(N("Complex"),a)?q.$Complex(m(B(this.real,a.$real()),B(this.imag,a.$imag())),z(B(this.real,a.$imag()),B(this.imag,a.$real()))):D(N("Numeric"),a)&&x(a["$real?"]())?q.$Complex(B(this.real,a),B(this.imag,a)):this.$__coerced__("*",a)});A(H,"$/",function(a){return D(N("Complex"),a)?D(N("Number"),this.real)&&x(this.real["$nan?"]())||D(N("Number"),this.imag)&&x(this.imag["$nan?"]())||D(N("Number"),
|
|
524
|
-
a.$real())&&x(a.$real()["$nan?"]())||D(N("Number"),a.$imag())&&x(a.$imag()["$nan?"]())?N("Complex").$new(N(N("Float"),"NAN"),N(N("Float"),"NAN")):v(B(this,a.$conj()),a.$abs2()):D(N("Numeric"),a)&&x(a["$real?"]())?q.$Complex(this.real.$quo(a),this.imag.$quo(a)):this.$__coerced__("/",a)});A(H,"$**",function(a){if(G(a,0))return N("Complex").$new(1,0);if(D(N("Complex"),a)){var b=this.$polar();var d=I(b);var c=null==d[0]?W:d[0];d=null==d[1]?W:d[1];b;b=a.$real();var p=a.$imag();a=N("Math").$exp(m(B(b,N("Math").$log(c)),
|
|
525
|
-
B(p,d)));b=z(B(d,b),B(p,N("Math").$log(c)));return N("Complex").$polar(a,b)}if(D(N("Integer"),a)){if(x(K(a,0))){p=c=this;for(a=m(a,1);M(a,0);){b=a.$divmod(2);d=I(b);var k=null==d[0]?W:d[0];d=null==d[1]?W:d[1];for(b;G(d,0);)c=q.$Complex(m(B(c.$real(),c.$real()),B(c.$imag(),c.$imag())),B(B(2,c.$real()),c.$imag())),a=k,b=a.$divmod(2),d=I(b),k=null==d[0]?W:d[0],d=null==d[1]?W:d[1],b;p=B(p,c);a=m(a,1)}return p}return v(N("Rational").$new(1,1),this)["$**"](a["$-@"]())}return D(N("Float"),a)||D(N("Rational"),
|
|
526
|
-
a)?(b=this.$polar(),d=I(b),c=null==d[0]?W:d[0],d=null==d[1]?W:d[1],b,N("Complex").$polar(c["$**"](a),B(d,a))):this.$__coerced__("**",a)});A(H,"$abs",function(){return N("Math").$hypot(this.real,this.imag)});A(H,"$abs2",function(){return z(B(this.real,this.real),B(this.imag,this.imag))});A(H,"$angle",function(){return N("Math").$atan2(this.imag,this.real)});A(H,"$conj",function(){return q.$Complex(this.real,this.imag["$-@"]())});A(H,"$denominator",function(){return this.real.$denominator().$lcm(this.imag.$denominator())});
|
|
527
|
-
A(H,"$eql?",function(b){var d,h=W;return x(d=x(h=a("Complex")["$==="](b))?this.real.$class()["$=="](this.imag.$class()):h)?this["$=="](b):d});A(H,"$fdiv",function(a){D(N("Numeric"),a)||q.$raise(N("TypeError"),""+a.$class()+" can't be coerced into Complex");return v(this,a)});A(H,"$finite?",function(){var a;return x(a=this.real["$finite?"]())?this.imag["$finite?"]():a});A(H,"$hash",function(){return"Complex:"+this.real+":"+this.imag});A(H,"$infinite?",function(){var a;return x(a=this.real["$infinite?"]())?
|
|
528
|
-
a:this.imag["$infinite?"]()});A(H,"$inspect",function(){return"("+this+")"});A(H,"$numerator",function(){var a=this.$denominator();return q.$Complex(B(this.real.$numerator(),v(a,this.real.$denominator())),B(this.imag.$numerator(),v(a,this.imag.$denominator())))});A(H,"$polar",function(){return[this.$abs(),this.$arg()]});A(H,"$rationalize",function(a){1<arguments.length&&q.$raise(N("ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");M(this.imag,0)&&q.$raise(N("RangeError"),
|
|
529
|
-
"can't convert "+this+" into Rational");return this.$real().$rationalize(a)},-1);A(H,"$real?",t(!1));A(H,"$rect",function(){return[this.real,this.imag]});A(H,"$to_f",function(){G(this.imag,0)||q.$raise(N("RangeError"),"can't convert "+this+" into Float");return this.real.$to_f()});A(H,"$to_i",function(){G(this.imag,0)||q.$raise(N("RangeError"),"can't convert "+this+" into Integer");return this.real.$to_i()});A(H,"$to_r",function(){G(this.imag,0)||q.$raise(N("RangeError"),"can't convert "+this+" into Rational");
|
|
530
|
-
return this.real.$to_r()});A(H,"$to_s",function(){var a=this.real.$inspect();a=z(a,D(N("Number"),this.imag)&&x(this.imag["$nan?"]())||x(this.imag["$positive?"]())||x(this.imag["$zero?"]())?"+":"-");a=z(a,this.imag.$abs().$inspect());D(N("Number"),this.imag)&&(x(this.imag["$nan?"]())||x(this.imag["$infinite?"]()))&&(a=z(a,"*"));return z(a,"i")});J(R[0],"I",H.$new(0,1));E(H,"$from_string",function(a){function b(){var b=a.match(c)[0];a=a.slice(b.length);return b.replace(/_/g,"")}function d(){if(c.test(a)){var d=
|
|
531
|
-
parseFloat(b());if("/"===a[0]){a=a.slice(1);if(c.test(a)){var f=parseFloat(b());return q.$Rational(d,f)}a="/"+a}return d}return null}var c=/[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/;a.match(c);var p;var k=d();return k?(p=d())?q.$Complex(k,p):"i"===a[0]?q.$Complex(0,k):q.$Complex(k,0):"i"===a[0]?q.$Complex(0,1):"-"===a[0]&&"i"===a[1]?q.$Complex(0,-1):"+"===a[0]&&"i"===a[1]?q.$Complex(0,1):q.$Complex(0,0)});(function(a,b){return P(a,"rectangular","rect")})(b.get_singleton_class(H),R);P(H,"arg","angle");P(H,"conjugate",
|
|
532
|
-
"conj");P(H,"divide","/");P(H,"imaginary","imag");P(H,"magnitude","abs");P(H,"phase","arg");P(H,"quo","/");P(H,"rectangular","rect");b.udef(H,"$negative?");b.udef(H,"$positive?");b.udef(H,"$step");return W}("::",N("Numeric"),[])};
|
|
533
|
-
Opal.modules["corelib/rational/base"]=function(b){var n=b.module,x=b.def,D=b.klass,q=b.$$$;b.add_stubs("convert,from_string");(function(b){b=n(b,"Kernel");return x(b,"$Rational",function(b,n){null==n&&(n=1);return q("Rational").$convert(b,n)},-2)})("::");return function(b,$super){b=D(b,$super,"String");return x(b,"$to_r",function(){return q("Rational").$from_string(this)})}("::",null)};
|
|
534
|
-
Opal.modules["corelib/rational"]=function(b){var n=b.klass,x=b.eqeq,D=b.Kernel,q=b.truthy,E=b.rb_lt,B=b.rb_divide,A=b.defs,z=b.eqeqeq,m=b.not,v=b.Opal,G=b.def,I=b.return_ivar,K=b.rb_minus,M=b.rb_times,t=b.rb_plus,J=b.rb_gt,P=b.rb_le,R=b.return_self,W=b.alias,N=b.top,H=b.nil,L=b.$$$;b.add_stubs("require,to_i,==,raise,<,-@,new,gcd,/,nil?,===,reduce,to_r,!,equal?,coerce_to!,freeze,to_f,numerator,denominator,<=>,-,*,__coerced__,+,Rational,>,**,abs,ceil,with_precision,floor,<=,truncate,send");N.$require("corelib/numeric");
|
|
535
|
-
N.$require("corelib/rational/base");return function(b,$super){b=n(b,$super,"Rational");var k=b.$$prototype;k.num=k.den=H;A(b,"$reduce",function(b,f){b=b.$to_i();f=f.$to_i();if(x(f,0))D.$raise(L("ZeroDivisionError"),"divided by 0");else if(q(E(f,0)))b=b["$-@"](),f=f["$-@"]();else if(x(f,1))return this.$new(b,f);var d=b.$gcd(f);return this.$new(B(b,d),B(f,d))});A(b,"$convert",function(b,f){(q(b["$nil?"]())||q(f["$nil?"]()))&&D.$raise(L("TypeError"),"cannot convert nil into Rational");if(z(L("Integer"),
|
|
536
|
-
b)&&z(L("Integer"),f))return this.$reduce(b,f);if(z(L("Float"),b)||z(L("String"),b)||z(L("Complex"),b))b=b.$to_r();if(z(L("Float"),f)||z(L("String"),f)||z(L("Complex"),f))f=f.$to_r();return q(f["$equal?"](1))&&m(L("Integer")["$==="](b))?v["$coerce_to!"](b,L("Rational"),"to_r"):z(L("Numeric"),b)&&z(L("Numeric"),f)?B(b,f):this.$reduce(b,f)});G(b,"$initialize",function(b,f){this.num=b;this.den=f;return this.$freeze()});G(b,"$numerator",I("num"));G(b,"$denominator",I("den"));G(b,"$coerce",function(b){return z(L("Rational"),
|
|
537
|
-
b)?[b,this]:z(L("Integer"),b)?[b.$to_r(),this]:z(L("Float"),b)?[b,this.$to_f()]:H});G(b,"$==",function(b){var d;return z(L("Rational"),b)?q(d=this.num["$=="](b.$numerator()))?this.den["$=="](b.$denominator()):d:z(L("Integer"),b)?q(d=this.num["$=="](b))?this.den["$=="](1):d:z(L("Float"),b)?this.$to_f()["$=="](b):b["$=="](this)});G(b,"$<=>",function(b){return z(L("Rational"),b)?K(M(this.num,b.$denominator()),M(this.den,b.$numerator()))["$<=>"](0):z(L("Integer"),b)?K(this.num,M(this.den,b))["$<=>"](0):
|
|
538
|
-
z(L("Float"),b)?this.$to_f()["$<=>"](b):this.$__coerced__("<=>",b)});G(b,"$+",function(b){if(z(L("Rational"),b)){var d=t(M(this.num,b.$denominator()),M(this.den,b.$numerator()));b=M(this.den,b.$denominator());return D.$Rational(d,b)}return z(L("Integer"),b)?D.$Rational(t(this.num,M(b,this.den)),this.den):z(L("Float"),b)?t(this.$to_f(),b):this.$__coerced__("+",b)});G(b,"$-",function(b){if(z(L("Rational"),b)){var d=K(M(this.num,b.$denominator()),M(this.den,b.$numerator()));b=M(this.den,b.$denominator());
|
|
539
|
-
return D.$Rational(d,b)}return z(L("Integer"),b)?D.$Rational(K(this.num,M(b,this.den)),this.den):z(L("Float"),b)?K(this.$to_f(),b):this.$__coerced__("-",b)});G(b,"$*",function(b){if(z(L("Rational"),b)){var d=M(this.num,b.$numerator());b=M(this.den,b.$denominator());return D.$Rational(d,b)}return z(L("Integer"),b)?D.$Rational(M(this.num,b),this.den):z(L("Float"),b)?M(this.$to_f(),b):this.$__coerced__("*",b)});G(b,"$/",function(b){if(z(L("Rational"),b)){var d=M(this.num,b.$denominator());b=M(this.den,
|
|
540
|
-
b.$numerator());return D.$Rational(d,b)}return z(L("Integer"),b)?x(b,0)?B(this.$to_f(),0):D.$Rational(this.num,M(this.den,b)):z(L("Float"),b)?B(this.$to_f(),b):this.$__coerced__("/",b)});G(b,"$**",function(b){return z(L("Integer"),b)?x(this,0)&&q(E(b,0))?L(L("Float"),"INFINITY"):q(J(b,0))?D.$Rational(this.num["$**"](b),this.den["$**"](b)):q(E(b,0))?D.$Rational(this.den["$**"](b["$-@"]()),this.num["$**"](b["$-@"]())):D.$Rational(1,1):z(L("Float"),b)?this.$to_f()["$**"](b):z(L("Rational"),b)?x(b,0)?
|
|
541
|
-
D.$Rational(1,1):x(b.$denominator(),1)?q(E(b,0))?D.$Rational(this.den["$**"](b.$numerator().$abs()),this.num["$**"](b.$numerator().$abs())):D.$Rational(this.num["$**"](b.$numerator()),this.den["$**"](b.$numerator())):x(this,0)&&q(E(b,0))?D.$raise(L("ZeroDivisionError"),"divided by 0"):this.$to_f()["$**"](b):this.$__coerced__("**",b)});G(b,"$abs",function(){return D.$Rational(this.num.$abs(),this.den.$abs())});G(b,"$ceil",function(b){null==b&&(b=0);return x(b,0)?B(this.num["$-@"](),this.den)["$-@"]().$ceil():
|
|
542
|
-
this.$with_precision("ceil",b)},-1);G(b,"$floor",function(b){null==b&&(b=0);return x(b,0)?B(this.num["$-@"](),this.den)["$-@"]().$floor():this.$with_precision("floor",b)},-1);G(b,"$hash",function(){return"Rational:"+this.num+":"+this.den});G(b,"$inspect",function(){return"("+this+")"});G(b,"$rationalize",function(b){1<arguments.length&&D.$raise(L("ArgumentError"),"wrong number of arguments ("+arguments.length+" for 0..1)");if(null==b)return this;var d=b.$abs(),h=K(this,d);d=t(this,d);for(var c=0,
|
|
543
|
-
p=1,k=1,g=0,l,e,m;;){l=h.$ceil();if(P(l,d))break;m=l-1;l=m*p+c;e=m*g+k;c=B(1,K(d,m));d=B(1,K(h,m));h=c;c=p;k=g;p=l;g=e}return D.$Rational(l*p+c,l*g+k)},-1);G(b,"$round",function(b){null==b&&(b=0);if(!x(b,0))return this.$with_precision("round",b);if(x(this.num,0))return 0;if(x(this.den,1))return this.num;b=t(M(this.num.$abs(),2),this.den);var d=M(this.den,2);b=B(b,d).$truncate();return q(E(this.num,0))?b["$-@"]():b},-1);G(b,"$to_f",function(){return B(this.num,this.den)});G(b,"$to_i",function(){return this.$truncate()});
|
|
544
|
-
G(b,"$to_r",R);G(b,"$to_s",function(){return""+this.num+"/"+this.den});G(b,"$truncate",function(b){null==b&&(b=0);return x(b,0)?q(E(this.num,0))?this.$ceil():this.$floor():this.$with_precision("truncate",b)},-1);G(b,"$with_precision",function(b,f){z(L("Integer"),f)||D.$raise(L("TypeError"),"not an Integer");var d=10["$**"](f);var c=M(this,d);return q(E(f,1))?B(c.$send(b),d).$to_i():D.$Rational(c.$send(b),d)});A(b,"$from_string",function(b){function d(){var b=h.match(c)[0];h=h.slice(b.length);return b.replace(/_/g,
|
|
545
|
-
"")}var h=b.trimLeft(),c=/^[+-]?[\d_]+(\.[\d_]+)?/;h.match(c);if(c.test(h)){b=parseFloat(d());if("/"===h[0]&&(h=h.slice(1),c.test(h))){var p=parseFloat(d());return D.$Rational(b,p)}return D.$Rational(b,1)}return D.$Rational(0,1)});W(b,"divide","/");return W(b,"quo","/")}("::",L("Numeric"))};
|
|
546
|
-
Opal.modules["corelib/time"]=function(b){var n=b.slice,x=b.deny_frozen_access,D=b.klass,q=b.Kernel,E=b.Opal,B=b.defs,A=b.eqeqeq,z=b.def,m=b.truthy,v=b.rb_gt,G=b.rb_lt,I=b.send,K=b.rb_plus,M=b.rb_divide,t=b.rb_minus,J=b.range,P=b.neqeq,R=b.rb_le,W=b.eqeq,N=b.alias,H=b.top,L=b.nil,U=b.$$$;b.add_stubs("require,include,===,raise,coerce_to!,respond_to?,to_str,to_i,_parse_offset,new,<=>,to_f,nil?,>,<,strftime,each,define_method,year,month,day,+,round,/,-,copy_instance_variables,initialize_dup,is_a?,zero?,wday,utc?,mon,yday,hour,min,sec,rjust,ljust,zone,to_s,[],cweek_cyear,jd,to_date,format,isdst,!=,<=,==,ceil,local,gm,asctime,getgm,gmt_offset,inspect,usec,gmtime,gmt?");
|
|
547
|
-
H.$require("corelib/comparable");return function(a,$super,d){function f(a,c,b,d,f,g){a=a.$$is_string?parseInt(a,10):E["$coerce_to!"](a,U("Integer"),"to_int");if(c===L)c=1;else if(!c.$$is_number)if(c["$respond_to?"]("to_str"))switch(c=c.$to_str(),c.toLowerCase()){case "jan":c=1;break;case "feb":c=2;break;case "mar":c=3;break;case "apr":c=4;break;case "may":c=5;break;case "jun":c=6;break;case "jul":c=7;break;case "aug":c=8;break;case "sep":c=9;break;case "oct":c=10;break;case "nov":c=11;break;case "dec":c=
|
|
548
|
-
12;break;default:c=c.$to_i()}else c=E["$coerce_to!"](c,U("Integer"),"to_int");(1>c||12<c)&&q.$raise(U("ArgumentError"),"month out of range: "+c);--c;b=b===L?1:b.$$is_string?parseInt(b,10):E["$coerce_to!"](b,U("Integer"),"to_int");(1>b||31<b)&&q.$raise(U("ArgumentError"),"day out of range: "+b);d=d===L?0:d.$$is_string?parseInt(d,10):E["$coerce_to!"](d,U("Integer"),"to_int");(0>d||24<d)&&q.$raise(U("ArgumentError"),"hour out of range: "+d);f=f===L?0:f.$$is_string?parseInt(f,10):E["$coerce_to!"](f,U("Integer"),
|
|
549
|
-
"to_int");(0>f||59<f)&&q.$raise(U("ArgumentError"),"min out of range: "+f);g===L?g=0:g.$$is_number||(g=g.$$is_string?parseInt(g,10):E["$coerce_to!"](g,U("Integer"),"to_int"));(0>g||60<g)&&q.$raise(U("ArgumentError"),"sec out of range: "+g);return[a,c,b,d,f,g]}a=D(a,$super,"Time");d=[a].concat(d);var h=b.$r(d);a.$include(U("Comparable"));var c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),p="Sun Mon Tue Wed Thu Fri Sat".split(" "),T="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
|
|
550
|
-
g="January February March April May June July August September October November December".split(" ");B(a,"$at",function(a,c){if(U("Time")["$==="](a))return void 0!==c&&q.$raise(U("TypeError"),"can't convert Time into an exact number"),c=new Date(a.getTime()),c.timezone=a.timezone,c;a.$$is_number||(a=E["$coerce_to!"](a,U("Integer"),"to_int"));if(void 0===c)return new Date(1E3*a);c.$$is_number||(c=E["$coerce_to!"](c,U("Integer"),"to_int"));return new Date(1E3*a+c/1E3)},-2);B(a,"$new",function(a,c,b,
|
|
551
|
-
d,g,h,p){null==c&&(c=L);null==b&&(b=L);null==d&&(d=L);null==g&&(g=L);null==h&&(h=L);null==p&&(p=L);if(void 0===a)return new Date;h=f(a,c,b,d,g,h);a=h[0];c=h[1];b=h[2];d=h[3];g=h[4];h=h[5];if(p===L)return c=new Date(a,c,b,d,g,0,1E3*h),100>a&&c.setFullYear(a),c;p=this.$_parse_offset(p);c=new Date(Date.UTC(a,c,b,d,g,0,1E3*h));100>a&&c.setUTCFullYear(a);c=new Date(c.getTime()-36E5*p);c.timezone=p;return c},-1);B(a,"$_parse_offset",function(a){var c;a.$$is_string?"UTC"==a?c=0:/^[+-]\d\d:[0-5]\d$/.test(a)?
|
|
552
|
-
c=("-"==a[0]?-1:1)*(+(a[1]+a[2])+ +(a[4]+a[5])/60):q.$raise(U("ArgumentError"),'"+HH:MM", "-HH:MM", "UTC" expected for utc_offset: '+a):a.$$is_number?c=a/3600:q.$raise(U("ArgumentError"),"Opal doesn't support other types for a timezone argument than Integer and String");return c});B(a,"$local",function(a,c,b,d,g,h,p,m,T,t){null==c&&(c=L);null==b&&(b=L);null==d&&(d=L);null==g&&(g=L);null==h&&(h=L);null==p&&(p=L);null==m&&(m=L);null==T&&(T=L);null==t&&(t=L);if(10===arguments.length){var e=n(arguments);
|
|
553
|
-
a=e[5];c=e[4];b=e[3];d=e[2];g=e[1];h=e[0]}e=f(a,c,b,d,g,h);a=e[0];c=e[1];b=e[2];d=e[3];g=e[4];h=e[5];e=new Date(a,c,b,d,g,0,1E3*h);100>a&&e.setFullYear(a);return e},-2);B(a,"$gm",function(a,c,b,d,g,h,p,m,T,t){null==c&&(c=L);null==b&&(b=L);null==d&&(d=L);null==g&&(g=L);null==h&&(h=L);null==p&&(p=L);null==m&&(m=L);null==T&&(T=L);null==t&&(t=L);if(10===arguments.length){var e=n(arguments);a=e[5];c=e[4];b=e[3];d=e[2];g=e[1];h=e[0]}e=f(a,c,b,d,g,h);a=e[0];c=e[1];b=e[2];d=e[3];g=e[4];h=e[5];e=new Date(Date.UTC(a,
|
|
554
|
-
c,b,d,g,0,1E3*h));100>a&&e.setUTCFullYear(a);e.timezone=0;return e},-2);B(a,"$now",function(){return this.$new()});z(a,"$+",function(a){A(U("Time"),a)&&q.$raise(U("TypeError"),"time + time?");a.$$is_number||(a=E["$coerce_to!"](a,U("Integer"),"to_int"));a=new Date(this.getTime()+1E3*a);a.timezone=this.timezone;return a});z(a,"$-",function(a){if(A(U("Time"),a))return(this.getTime()-a.getTime())/1E3;a.$$is_number||(a=E["$coerce_to!"](a,U("Integer"),"to_int"));a=new Date(this.getTime()-1E3*a);a.timezone=
|
|
555
|
-
this.timezone;return a});z(a,"$<=>",function(a){if(A(U("Time"),a))return this.$to_f()["$<=>"](a.$to_f());a=a["$<=>"](this);return m(a["$nil?"]())?L:m(v(a,0))?-1:m(G(a,0))?1:0});z(a,"$==",function(a){var c;return m(c=U("Time")["$==="](a))?this.$to_f()===a.$to_f():c});z(a,"$asctime",function(){return this.$strftime("%a %b %e %H:%M:%S %Y")});I([["year","getFullYear","getUTCFullYear"],["mon","getMonth","getUTCMonth",1],["wday","getDay","getUTCDay"],["day","getDate","getUTCDate"],["hour","getHours","getUTCHours"],
|
|
556
|
-
["min","getMinutes","getUTCMinutes"],["sec","getSeconds","getUTCSeconds"]],"each",[],function O(a,c,b,d){var e=null==O.$$s?this:O.$$s;null==a&&(a=L);null==c&&(c=L);null==b&&(b=L);null==d&&(d=0);return I(e,"define_method",[a],function la(){var a=null==la.$$s?this:la.$$s;return d+(null!=a.timezone?(new Date(a.getTime()+36E5*a.timezone))[b]():a[c]())},{$$s:e})},{$$arity:-4,$$s:a});z(a,"$yday",function(){var a=h("Time").$new(this.$year()).$to_i();var c=h("Time").$new(this.$year(),this.$month(),this.$day()).$to_i();
|
|
557
|
-
return K(M(t(c,a),86400).$round(),1)});z(a,"$isdst",function(){var a=new Date(this.getFullYear(),0,1),c=new Date(this.getFullYear(),6,1);return this.getTimezoneOffset()<Math.max(a.getTimezoneOffset(),c.getTimezoneOffset())});z(a,"$dup",function(){var a=new Date(this.getTime());a.$copy_instance_variables(this);a.$initialize_dup(this);return a});z(a,"$eql?",function(a){var c;return m(c=a["$is_a?"](U("Time")))?this["$<=>"](a)["$zero?"]():c});I([["sunday?",0],["monday?",1],["tuesday?",2],["wednesday?",
|
|
558
|
-
3],["thursday?",4],["friday?",5],["saturday?",6]],"each",[],function y(a,c){var b=null==y.$$s?this:y.$$s;null==a&&(a=L);null==c&&(c=L);return I(b,"define_method",[a],function Z(){return(null==Z.$$s?this:Z.$$s).$wday()===c},{$$s:b})},{$$s:a});z(a,"$hash",function(){return"Time:"+this.getTime()});z(a,"$inspect",function(){return m(this["$utc?"]())?this.$strftime("%Y-%m-%d %H:%M:%S UTC"):this.$strftime("%Y-%m-%d %H:%M:%S %z")});z(a,"$succ",function(){var a=new Date(this.getTime()+1E3);a.timezone=this.timezone;
|
|
559
|
-
return a});z(a,"$usec",function(){return 1E3*this.getMilliseconds()});z(a,"$zone",function(){if(0===this.timezone)return"UTC";if(null!=this.timezone)return L;var a=this.toString();var c=-1==a.indexOf("(")?a.match(/[A-Z]{3,4}/)[0]:a.match(/\((.+)\)(?:\s|$)/)[1];return"GMT"==c&&/(GMT\W*\d{4})/.test(a)?RegExp.$1:c});z(a,"$getgm",function(){var a=new Date(this.getTime());a.timezone=0;return a});z(a,"$gmtime",function(){0!==this.timezone&&(x(this),this.timezone=0);return this});z(a,"$gmt?",function(){return 0===
|
|
560
|
-
this.timezone});z(a,"$gmt_offset",function(){return null!=this.timezone?60*this.timezone:60*-this.getTimezoneOffset()});z(a,"$strftime",function(a){var b=this;return a.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g,function(a,d,f,h,m){h="";var y=-1!==d.indexOf("0"),n=-1===d.indexOf("-"),F=-1!==d.indexOf("_"),S=-1!==d.indexOf("^"),u=-1!==d.indexOf("#");var O=(d.match(":")||[]).length;f=parseInt(f,10);y&&F&&(d.indexOf("0")<d.indexOf("_")?y=!1:F=!1);switch(m){case "Y":h+=b.$year();break;case "C":y=!F;
|
|
561
|
-
h+=Math.round(b.$year()/100);break;case "y":y=!F;h+=b.$year()%100;break;case "m":y=!F;h+=b.$mon();break;case "B":h+=g[b.$mon()-1];break;case "b":case "h":F=!y;h+=T[b.$mon()-1];break;case "d":y=!F;h+=b.$day();break;case "e":F=!y;h+=b.$day();break;case "j":y=!F;f=isNaN(f)?3:f;h+=b.$yday();break;case "H":y=!F;h+=b.$hour();break;case "k":F=!y;h+=b.$hour();break;case "I":y=!F;h+=b.$hour()%12||12;break;case "l":F=!y;h+=b.$hour()%12||12;break;case "P":h+=12<=b.$hour()?"pm":"am";break;case "p":h+=12<=b.$hour()?
|
|
562
|
-
"PM":"AM";break;case "M":y=!F;h+=b.$min();break;case "S":y=!F;h+=b.$sec();break;case "L":y=!F;f=isNaN(f)?3:f;h+=b.getMilliseconds();break;case "N":f=isNaN(f)?9:f;h+=b.getMilliseconds().toString().$rjust(3,"0");h=h.$ljust(f,"0");break;case "z":a=null==b.timezone?b.getTimezoneOffset():60*-b.timezone;d=Math.floor(Math.abs(a)/60);m=Math.abs(a)%60;h=h+(0>a?"+":"-")+(10>d?"0":"")+d;0<O&&(h+=":");h+=10>m?"0":"";h+=m;1<O&&(h+=":00");break;case "Z":h+=b.$zone();break;case "A":h+=c[b.$wday()];break;case "a":h+=
|
|
563
|
-
p[b.$wday()];break;case "u":h+=b.$wday()+1;break;case "w":h+=b.$wday();break;case "V":h+=b.$cweek_cyear()["$[]"](0).$to_s().$rjust(2,"0");break;case "G":h+=b.$cweek_cyear()["$[]"](1);break;case "g":h+=b.$cweek_cyear()["$[]"](1)["$[]"](J(-2,-1,!1));break;case "s":h+=b.$to_i();break;case "n":h+="\n";break;case "t":h+="\t";break;case "%":h+="%";break;case "c":h+=b.$strftime("%a %b %e %T %Y");break;case "D":case "x":h+=b.$strftime("%m/%d/%y");break;case "F":h+=b.$strftime("%Y-%m-%d");break;case "v":h+=
|
|
564
|
-
b.$strftime("%e-%^b-%4Y");break;case "r":h+=b.$strftime("%I:%M:%S %p");break;case "R":h+=b.$strftime("%H:%M");break;case "T":case "X":h+=b.$strftime("%H:%M:%S");break;case "J":O=b.$to_date().$jd();if(2405160>O){h+=b.$strftime("%Y-%m-%d");break}else 2419614>O?(O="M",a=1867):2424875>O?(O="T",a=1911):2447535>O?(O="S",a=1925):2458605>O?(O="H",a=1988):(O="R",a=2018);h+=b.$format("%c%02d",O,t(b.$year(),a));h+=b.$strftime("-%m-%d");break;default:return a}S&&(h=h.toUpperCase());u&&(h=h.replace(/[A-Z]/,function(a){a.toLowerCase()}).replace(/[a-z]/,
|
|
565
|
-
function(a){a.toUpperCase()}));n&&(y||F)&&(h=h.$rjust(isNaN(f)?2:f,F?" ":"0"));return h})});z(a,"$to_a",function(){return[this.$sec(),this.$min(),this.$hour(),this.$day(),this.$month(),this.$year(),this.$wday(),this.$yday(),this.$isdst(),this.$zone()]});z(a,"$to_f",function(){return this.getTime()/1E3});z(a,"$to_i",function(){return parseInt(this.getTime()/1E3,10)});z(a,"$cweek_cyear",function(){var a=U("Time").$new(this.$year(),1,1).$wday();var c=this.$year();m(R(a,4))&&P(a,0)?a=t(a,1):(a=t(t(a,
|
|
566
|
-
7),1),W(a,-8)&&(a=-1));a=M(K(this.$yday(),a),7).$ceil();if(m(R(a,0)))return U("Time").$new(t(this.$year(),1),12,31).$cweek_cyear();if(W(a,53)){var b=U("Time").$new(this.$year(),12,31);b=b.$wday();m(R(b,3))&&P(b,0)&&(a=1,c=K(c,1))}return[a,c]});(function(a,c){N(a,"mktime","local");return N(a,"utc","gm")})(b.get_singleton_class(a),d);N(a,"ctime","asctime");N(a,"dst?","isdst");N(a,"getutc","getgm");N(a,"gmtoff","gmt_offset");N(a,"mday","day");N(a,"month","mon");N(a,"to_s","inspect");N(a,"tv_sec","to_i");
|
|
567
|
-
N(a,"tv_usec","usec");N(a,"utc","gmtime");N(a,"utc?","gmt?");return N(a,"utc_offset","gmt_offset")}("::",Date,[])};
|
|
568
|
-
Opal.modules["corelib/struct"]=function(b){var n=b.klass,x=b.slice,D=b.extract_kwargs,q=b.ensure_kwargs,E=b.truthy,B=b.neqeq,A=b.eqeq,z=b.Opal,m=b.send,v=b.Class,G=b.to_a,I=b.def,K=b.defs,M=b.Kernel,t=b.hash2,J=b.rb_gt,P=b.rb_minus,R=b.eqeqeq,W=b.rb_lt,N=b.rb_ge,H=b.rb_plus,L=b.alias,U=b.top,a=b.nil,k=b.$$$;b.add_stubs("require,include,!=,upcase,[],==,class,unshift,const_name!,map,coerce_to!,new,each,define_struct_attribute,allocate,initialize,alias_method,module_eval,to_proc,const_set,raise,<<,members,define_method,instance_eval,last,>,length,-,keys,any?,join,[]=,each_with_index,hash,===,<,-@,size,>=,include?,to_sym,instance_of?,__id__,eql?,enum_for,+,name,each_pair,inspect,to_h,args,each_with_object,flatten,to_a,respond_to?,dig");U.$require("corelib/enumerable");
|
|
569
|
-
return function(d,$super,h){d=n(d,$super,"Struct");var c=[d].concat(h),p=b.$r(c);d.$include(k("Enumerable"));K(d,"$new",function S(d,e,h){var l=S.$$p||a,p=a;S.$$p=null;var F=x(arguments,1);var n=D(F);n=q(n);n=n.$$smap.keyword_init;null==n&&(n=!1);if(E(d))if(A(d.$class(),k("String"))&&B(d["$[]"](0).$upcase(),d["$[]"](0)))F.$unshift(d),d=a;else try{d=z["$const_name!"](d)}catch(la){if(b.rescue(la,[k("TypeError"),k("NameError")]))try{F.$unshift(d),d=a}finally{b.pop_exception()}else throw la;}m(F,"map",
|
|
570
|
-
[],function(c){null==c&&(c=a);return z["$coerce_to!"](c,k("String"),"to_str")});p=m(v,"new",[this],function ea(){var e=null==ea.$$s?this:ea.$$s;m(F,"each",[],function u(c){var b=null==u.$$s?this:u.$$s;null==c&&(c=a);return b.$define_struct_attribute(c)},{$$s:e});return function(a,c){I(a,"$new",function(a){var c=x(arguments);var b=this.$allocate();b.$$data={};m(b,"initialize",G(c));return b},-1);return a.$alias_method("[]","new")}(b.get_singleton_class(e),c)},{$$s:this});E(l)&&m(p,"module_eval",[],
|
|
571
|
-
l.$to_proc());p.$$keyword_init=n;E(d)&&k("Struct").$const_set(d,p);return p},-2);K(d,"$define_struct_attribute",function(c){A(this,k("Struct"))&&M.$raise(k("ArgumentError"),"you cannot define attributes to the Struct class");this.$members()["$<<"](c);m(this,"define_method",[c],function ha(){return(null==ha.$$s?this:ha.$$s).$$data[c]},{$$s:this});return m(this,"define_method",[""+c+"="],function y(b){var d=null==y.$$s?this:y.$$s;null==b&&(b=a);return d.$$data[c]=b},{$$s:this})});K(d,"$members",function(){var c=
|
|
572
|
-
a;null==this.members&&(this.members=a);A(this,k("Struct"))&&M.$raise(k("ArgumentError"),"the Struct class has no members");return this.members=E(c=this.members)?c:[]});K(d,"$inherited",function(c){var b=a;null==this.members&&(this.members=a);b=this.members;return m(c,"instance_eval",[],function S(){return(null==S.$$s?this:S.$$s).members=b},{$$s:this})});I(d,"$initialize",function(c){var b=a,d=a,h=a;var l=x(arguments);if(E(this.$class().$$keyword_init))return b=E(d=l.$last())?d:t([],{}),(E(J(l.$length(),
|
|
573
|
-
1))||E(1===l.length&&!b.$$is_hash))&&M.$raise(k("ArgumentError"),"wrong number of arguments (given "+l.$length()+", expected 0)"),h=P(b.$keys(),this.$class().$members()),E(h["$any?"]())&&M.$raise(k("ArgumentError"),"unknown keywords: "+h.$join(", ")),m(this.$class().$members(),"each",[],function Z(c){var e,d=null==Z.$$s?this:Z.$$s;null==c&&(c=a);return e=[c,b["$[]"](c)],m(d,"[]=",e),e[e.length-1]},{$$s:this});E(J(l.$length(),this.$class().$members().$length()))&&M.$raise(k("ArgumentError"),"struct size differs");
|
|
574
|
-
return m(this.$class().$members(),"each_with_index",[],function la(c,b){var e,d=null==la.$$s?this:la.$$s;null==c&&(c=a);null==b&&(b=a);return e=[c,l["$[]"](b)],m(d,"[]=",e),e[e.length-1]},{$$s:this})},-1);I(d,"$initialize_copy",function(a){this.$$data={};var c=Object.keys(a.$$data),b;var d=0;for(b=c.length;d<b;d++){var h=c[d];this.$$data[h]=a.$$data[h]}});K(d,"$keyword_init?",function(){return this.$$keyword_init});I(d,"$members",function(){return this.$class().$members()});I(d,"$hash",function(){return p("Hash").$new(this.$$data).$hash()});
|
|
575
|
-
I(d,"$[]",function(a){R(k("Integer"),a)?(E(W(a,this.$class().$members().$size()["$-@"]()))&&M.$raise(k("IndexError"),"offset "+a+" too small for struct(size:"+this.$class().$members().$size()+")"),E(N(a,this.$class().$members().$size()))&&M.$raise(k("IndexError"),"offset "+a+" too large for struct(size:"+this.$class().$members().$size()+")"),a=this.$class().$members()["$[]"](a)):R(k("String"),a)?this.$$data.hasOwnProperty(a)||M.$raise(k("NameError").$new("no member '"+a+"' in struct",a)):M.$raise(k("TypeError"),
|
|
576
|
-
"no implicit conversion of "+a.$class()+" into Integer");a=z["$coerce_to!"](a,k("String"),"to_str");return this.$$data[a]});I(d,"$[]=",function(a,c){R(k("Integer"),a)?(E(W(a,this.$class().$members().$size()["$-@"]()))&&M.$raise(k("IndexError"),"offset "+a+" too small for struct(size:"+this.$class().$members().$size()+")"),E(N(a,this.$class().$members().$size()))&&M.$raise(k("IndexError"),"offset "+a+" too large for struct(size:"+this.$class().$members().$size()+")"),a=this.$class().$members()["$[]"](a)):
|
|
577
|
-
R(k("String"),a)?E(this.$class().$members()["$include?"](a.$to_sym()))||M.$raise(k("NameError").$new("no member '"+a+"' in struct",a)):M.$raise(k("TypeError"),"no implicit conversion of "+a.$class()+" into Integer");a=z["$coerce_to!"](a,k("String"),"to_str");return this.$$data[a]=c});I(d,"$==",function(a){function c(a,e){var h;b[a.$__id__()]=!0;d[e.$__id__()]=!0;for(h in a.$$data){var l=a.$$data[h];var p=e.$$data[h];if(k("Struct")["$==="](l)){if(!(b.hasOwnProperty(l.$__id__())&&d.hasOwnProperty(p.$__id__())||
|
|
578
|
-
c(l,p)))return!1}else if(!l["$=="](p))return!1}return!0}if(!E(a["$instance_of?"](this.$class())))return!1;var b={},d={};return c(this,a)});I(d,"$eql?",function(a){function c(a,e){var h;b[a.$__id__()]=!0;d[e.$__id__()]=!0;for(h in a.$$data){var l=a.$$data[h];var p=e.$$data[h];if(k("Struct")["$==="](l)){if(!(b.hasOwnProperty(l.$__id__())&&d.hasOwnProperty(p.$__id__())||c(l,p)))return!1}else if(!l["$eql?"](p))return!1}return!0}if(!E(a["$instance_of?"](this.$class())))return!1;var b={},d={};return c(this,
|
|
579
|
-
a)});I(d,"$each",function e(){var c=e.$$p||a;e.$$p=null;if(c===a)return m(this,"enum_for",["each"],function y(){return(null==y.$$s?this:y.$$s).$size()},{$$s:this});m(this.$class().$members(),"each",[],function O(e){var d=null==O.$$s?this:O.$$s;null==e&&(e=a);return b.yield1(c,d["$[]"](e))},{$$s:this});return this});I(d,"$each_pair",function ha(){var c=ha.$$p||a;ha.$$p=null;if(c===a)return m(this,"enum_for",["each_pair"],function O(){return(null==O.$$s?this:O.$$s).$size()},{$$s:this});m(this.$class().$members(),
|
|
580
|
-
"each",[],function F(d){var h=null==F.$$s?this:F.$$s;null==d&&(d=a);return b.yield1(c,[d,h["$[]"](d)])},{$$s:this});return this});I(d,"$length",function(){return this.$class().$members().$length()});I(d,"$to_a",function(){return m(this.$class().$members(),"map",[],function y(c){var b=null==y.$$s?this:y.$$s;null==c&&(c=a);return b["$[]"](c)},{$$s:this})});var T=[];I(d,"$inspect",function(){var c=this,b=a,d=a;return function(){try{b="#<struct ";if(E(T["$include?"](c.$__id__())))return H(b,":...>");
|
|
581
|
-
T["$<<"](c.$__id__());d=!0;R(k("Struct"),c)&&E(c.$class().$name())&&(b=H(b,""+c.$class()+" "));b=H(b,m(c.$each_pair(),"map",[],function(c,b){null==c&&(c=a);null==b&&(b=a);return""+c+"="+p("Opal").$inspect(b)}).$join(", "));return b=H(b,">")}finally{E(d)?T.pop():a}}()});I(d,"$to_h",function S(){var c=S.$$p||a;S.$$p=null;return c!==a?m(m(this,"map",[],c.$to_proc()),"to_h",G(this.$args())):m(this.$class().$members(),"each_with_object",[t([],{})],function la(c,b){var d,h=null==la.$$s?this:la.$$s;null==
|
|
582
|
-
c&&(c=a);null==b&&(b=a);return d=[c,h["$[]"](c)],m(b,"[]=",d),d[d.length-1]},{$$s:this})});I(d,"$values_at",function(c){var b=x(arguments);b=m(b,"map",[],function(c){null==c&&(c=a);return c.$$is_range?c.$to_a():c}).$flatten();for(var d=[],h=0,p=b.length;h<p;h++)b[h].$$is_number||M.$raise(k("TypeError"),"no implicit conversion of "+b[h].$class()+" into Integer"),d.push(this["$[]"](b[h]));return d},-1);I(d,"$dig",function(c,b){var d=x(arguments,1);var h=E(c.$$is_string&&this.$$data.hasOwnProperty(c))?
|
|
583
|
-
this.$$data[c]||a:a;if(h===a||0===d.length)return h;E(h["$respond_to?"]("dig"))||M.$raise(k("TypeError"),""+h.$class()+" does not have #dig method");return m(h,"dig",G(d))},-2);L(d,"size","length");L(d,"to_s","inspect");return L(d,"values","to_a")}("::",null,[])};
|
|
584
|
-
Opal.modules["corelib/set"]=function(b){var n=b.freeze,x=b.klass,D=b.slice,q=b.defs,E=b.hash2,B=b.truthy,A=b.eqeqeq,z=b.Kernel,m=b.send,v=b.def,G=b.eqeq,I=b.rb_lt,K=b.rb_le,M=b.alias,t=b.nil,J=b.$$$;b.add_stubs("include,new,nil?,===,raise,each,add,merge,class,respond_to?,subtract,dup,join,to_a,equal?,instance_of?,==,instance_variable_get,size,is_a?,all?,include?,[]=,enum_for,[],<<,replace,compare_by_identity,name,compare_by_identity?,delete,select,frozen?,freeze,reject,delete_if,to_proc,keep_if,each_key,empty?,eql?,instance_eval,clear,<,<=,any?,!,intersect?,keys,|,proper_subset?,subset?,proper_superset?,superset?,-,select!,collect!");return function(P,
|
|
585
|
-
$super,W){function N(b){B(L=b["$is_a?"](J("Set")))?L:z.$raise(J("ArgumentError"),"value must be a set")}P=x(P,$super,"Set");W=[P].concat(W);var H=b.$r(W),L=t;P.$$prototype.hash=t;P.$include(J("Enumerable"));q(P,"$[]",function(b){var a=D(arguments);return this.$new(a)},-1);v(P,"$initialize",function k(a){var d=k.$$p||t;k.$$p=null;null==a&&(a=t);this.hash=E([],{});if(B(a["$nil?"]()))return t;A(J("Enumerable"),a)||z.$raise(J("ArgumentError"),"value must be enumerable");return B(d)?m(a,"each",[],function c(a){var h=
|
|
586
|
-
null==c.$$s?this:c.$$s;null==a&&(a=t);return h.$add(b.yield1(d,a))},{$$s:this}):this.$merge(a)},-1);v(P,"$dup",function(){return this.$class().$new().$merge(this)});v(P,"$-",function(a){B(a["$respond_to?"]("each"))||z.$raise(J("ArgumentError"),"value must be enumerable");return this.$dup().$subtract(a)});v(P,"$inspect",function(){return"#<Set: {"+this.$to_a().$join(",")+"}>"});v(P,"$==",function(a){return B(this["$equal?"](a))?!0:B(a["$instance_of?"](this.$class()))?this.hash["$=="](a.$instance_variable_get("@hash")):
|
|
587
|
-
B(a["$is_a?"](J("Set")))&&G(this.$size(),a.$size())?m(a,"all?",[],function f(a){var b=null==f.$$s?this:f.$$s;null==b.hash&&(b.hash=t);null==a&&(a=t);return b.hash["$include?"](a)},{$$s:this}):!1});v(P,"$add",function(a){this.hash["$[]="](a,!0);return this});v(P,"$classify",function k(){var d=k.$$p||t,f=t;k.$$p=null;if(d===t)return this.$enum_for("classify");f=m(J("Hash"),"new",[],function T(c,b){var d,f=null==T.$$s?this:T.$$s;null==c&&(c=t);null==b&&(b=t);return d=[b,f.$class().$new()],m(c,"[]=",
|
|
588
|
-
d),d[d.length-1]},{$$s:this});m(this,"each",[],function(c){null==c&&(c=t);return f["$[]"](b.yield1(d,c)).$add(c)});return f});v(P,"$collect!",function d(){var f=d.$$p||t,h=t;d.$$p=null;if(f===t)return this.$enum_for("collect!");h=this.$class().$new();m(this,"each",[],function(c){null==c&&(c=t);return h["$<<"](b.yield1(f,c))});return this.$replace(h)});v(P,"$compare_by_identity",function(){return B(this.hash["$respond_to?"]("compare_by_identity"))?(this.hash.$compare_by_identity(),this):this.$raise(H("NotImplementedError"),
|
|
589
|
-
""+this.$class().$name()+"#compare_by_identity is not implemented")});v(P,"$compare_by_identity?",function(){var b;return B(b=this.hash["$respond_to?"]("compare_by_identity?"))?this.hash["$compare_by_identity?"]():b});v(P,"$delete",function(b){this.hash.$delete(b);return this});v(P,"$delete?",function(b){return B(this["$include?"](b))?(this.$delete(b),this):t});v(P,"$delete_if",function f(){var h=f.$$p||t;f.$$p=null;if(h===t)return this.$enum_for("delete_if");m(m(this,"select",[],function(c){null==
|
|
590
|
-
c&&(c=t);return b.yield1(h,c)}),"each",[],function T(b){var f=null==T.$$s?this:T.$$s;null==f.hash&&(f.hash=t);null==b&&(b=t);return f.hash.$delete(b)},{$$s:this});return this});v(P,"$freeze",function(){if(B(this["$frozen?"]()))return this;this.hash.$freeze();return n(this)});v(P,"$keep_if",function h(){var c=h.$$p||t;h.$$p=null;if(c===t)return this.$enum_for("keep_if");m(m(this,"reject",[],function(h){null==h&&(h=t);return b.yield1(c,h)}),"each",[],function g(c){var b=null==g.$$s?this:g.$$s;null==
|
|
591
|
-
b.hash&&(b.hash=t);null==c&&(c=t);return b.hash.$delete(c)},{$$s:this});return this});v(P,"$reject!",function c(){var b=c.$$p||t;c.$$p=null;if(b===t)return this.$enum_for("reject!");var n=this.$size();m(this,"delete_if",[],b.$to_proc());return G(this.$size(),n)?t:this});v(P,"$select!",function p(){var b=p.$$p||t;p.$$p=null;if(b===t)return this.$enum_for("select!");var g=this.$size();m(this,"keep_if",[],b.$to_proc());return G(this.$size(),g)?t:this});v(P,"$add?",function(b){return B(this["$include?"](b))?
|
|
592
|
-
t:this.$add(b)});v(P,"$each",function T(){var b=T.$$p||t;T.$$p=null;if(b===t)return this.$enum_for("each");m(this.hash,"each_key",[],b.$to_proc());return this});v(P,"$empty?",function(){return this.hash["$empty?"]()});v(P,"$eql?",function(b){return this.hash["$eql?"](m(b,"instance_eval",[],function l(){var b=null==l.$$s?this:l.$$s;null==b.hash&&(b.hash=t);return b.hash},{$$s:this}))});v(P,"$clear",function(){this.hash.$clear();return this});v(P,"$include?",function(b){return this.hash["$include?"](b)});
|
|
593
|
-
v(P,"$merge",function(b){m(b,"each",[],function e(b){var l=null==e.$$s?this:e.$$s;null==b&&(b=t);return l.$add(b)},{$$s:this});return this});v(P,"$replace",function(b){this.$clear();this.$merge(b);return this});v(P,"$size",function(){return this.hash.$size()});v(P,"$subtract",function(b){m(b,"each",[],function e(b){var l=null==e.$$s?this:e.$$s;null==b&&(b=t);return l.$delete(b)},{$$s:this});return this});v(P,"$|",function(b){B(b["$respond_to?"]("each"))||z.$raise(J("ArgumentError"),"value must be enumerable");
|
|
594
|
-
return this.$dup().$merge(b)});v(P,"$superset?",function(b){N(b);return B(I(this.$size(),b.$size()))?!1:m(b,"all?",[],function e(b){var l=null==e.$$s?this:e.$$s;null==b&&(b=t);return l["$include?"](b)},{$$s:this})});v(P,"$proper_superset?",function(b){N(b);return B(K(this.$size(),b.$size()))?!1:m(b,"all?",[],function e(b){var l=null==e.$$s?this:e.$$s;null==b&&(b=t);return l["$include?"](b)},{$$s:this})});v(P,"$subset?",function(b){N(b);return B(I(b.$size(),this.$size()))?!1:m(this,"all?",[],function(g){null==
|
|
595
|
-
g&&(g=t);return b["$include?"](g)})});v(P,"$proper_subset?",function(b){N(b);return B(K(b.$size(),this.$size()))?!1:m(this,"all?",[],function(g){null==g&&(g=t);return b["$include?"](g)})});v(P,"$intersect?",function(b){N(b);return B(I(this.$size(),b.$size()))?m(this,"any?",[],function(g){null==g&&(g=t);return b["$include?"](g)}):m(b,"any?",[],function e(b){var l=null==e.$$s?this:e.$$s;null==b&&(b=t);return l["$include?"](b)},{$$s:this})});v(P,"$disjoint?",function(b){return this["$intersect?"](b)["$!"]()});
|
|
596
|
-
v(P,"$to_a",function(){return this.hash.$keys()});M(P,"+","|");M(P,"<","proper_subset?");M(P,"<<","add");M(P,"<=","subset?");M(P,">","proper_superset?");M(P,">=","superset?");M(P,"difference","-");M(P,"filter!","select!");M(P,"length","size");M(P,"map!","collect!");M(P,"member?","include?");return M(P,"union","|")}("::",null,[])};
|
|
597
|
-
Opal.modules["corelib/dir"]=function(b){var n=b.klass,x=b.def,D=b.truthy,q=b.alias,E=b.nil,B=b.$$$;b.add_stubs("[],pwd");return function(A,$super,m){A=n(A,$super,"Dir");m=[A].concat(m);return function(m,n){x(m,"$chdir",function M(m){var n=M.$$p||E,q=E;M.$$p=null;a:{try{q=b.current_dir;b.current_dir=m;var v=b.yieldX(n,[]);break a}finally{b.current_dir=q}v=void 0}return v});x(m,"$pwd",function(){return b.current_dir||"."});x(m,"$home",function(){var b;return D(b=B("ENV")["$[]"]("HOME"))?b:"."});return q(m,
|
|
598
|
-
"getwd","pwd")}(b.get_singleton_class(A),m)}("::",null,[])};
|
|
599
|
-
Opal.modules["corelib/file"]=function(b){var n=b.truthy,x=b.klass,D=b.const_set,q=b.Opal,E=b.regexp,B=b.rb_plus,A=b.def,z=b.Kernel,m=b.eqeq,v=b.rb_lt,G=b.rb_minus,I=b.range,K=b.send,M=b.slice,t=b.alias,J=b.nil,P=b.$$$;b.add_stubs("respond_to?,to_path,coerce_to!,pwd,split,sub,+,unshift,join,home,raise,start_with?,absolute_path,==,<,dirname,-,basename,empty?,rindex,[],length,nil?,gsub,find,=~,map,each_with_index,flatten,reject,to_proc,end_with?,expand_path,exist?");return function(R,$super,N){R=x(R,
|
|
600
|
-
$super,"File");N=[R].concat(N);var H=J;D(N[0],"Separator",D(N[0],"SEPARATOR","/"));D(N[0],"ALT_SEPARATOR",J);D(N[0],"PATH_SEPARATOR",":");D(N[0],"FNM_SYSCASE",0);H=/^[a-zA-Z]:(?:\\|\/)/;return function(x,D){function a(a){n(a["$respond_to?"]("to_path"))&&(a=a.$to_path());return a=q["$coerce_to!"](a,P("String"),"to_str")}function k(){return d("ALT_SEPARATOR")===J?b.escape_regexp(d("SEPARATOR")):b.escape_regexp(B(d("SEPARATOR"),d("ALT_SEPARATOR")))}D=[x].concat(D);var d=b.$r(D);A(x,"$absolute_path",
|
|
601
|
-
function(a,b){var c=J;null==b&&(b=J);var f=d("SEPARATOR");var h=k();var g=[];a=n(a["$respond_to?"]("to_path"))?a.$to_path():a;a=q["$coerce_to!"](a,P("String"),"to_str");b=n(c=b)?c:P("Dir").$pwd();c=a.substr(0,f.length)===f||H.test(a);var l=b.substr(0,f.length)===f||H.test(b);n(c)?(c=a.$split(E(["[",h,"]"])),a=H.test(a)?"":a.$sub(E(["^([",h,"]+).*$"]),"\\1"),b=!0):(c=B(b.$split(E(["[",h,"]"])),a.$split(E(["[",h,"]"]))),a=H.test(b)?"":b.$sub(E(["^([",h,"]+).*$"]),"\\1"),b=l);l=0;for(var e=c.length;l<
|
|
602
|
-
e;l++)h=c[l],h===J||""===h&&(0===g.length||b)||"."===h&&(0===g.length||b)||(".."===h?g.pop():g.push(h));b||"."===c[0]||g.$unshift(".");f=g.$join(f);n(b)&&(f=B(a,f));return f},-2);A(x,"$expand_path",function(a,b){null==b&&(b=J);var c=d("SEPARATOR");var f=k();if(n("~"===a[0]||b&&"~"===b[0])){var h=d("Dir").$home();n(h)||z.$raise(P("ArgumentError"),"couldn't find HOME environment -- expanding `~'");f=H.test(h)?"":h.$sub(E(["^([",f,"]+).*$"]),"\\1");n(h["$start_with?"](f))||z.$raise(P("ArgumentError"),
|
|
603
|
-
"non-absolute home");h=B(h,c);c=E(["^\\~(?:",c,"|$)"]);a=a.$sub(c,h);n(b)&&(b=b.$sub(c,h))}return this.$absolute_path(a,b)},-2);A(x,"$dirname",function(b,d){null==d&&(d=1);if(m(d,0))return b;n(v(d,0))&&z.$raise(P("ArgumentError"),"level can't be negative");var c=k();b=a(b);var f=b.match(new RegExp("^["+c+"]"));b=b.replace(new RegExp("["+c+"]+$"),"");b=b.replace(new RegExp("[^"+c+"]+$"),"");b=b.replace(new RegExp("["+c+"]+$"),"");b=""===b?f?"/":".":b;return 1==d?b:this.$dirname(b,G(d,1))},-2);A(x,
|
|
604
|
-
"$basename",function(d,h){null==h&&(h=J);var c=k();d=a(d);if(0==d.length)return d;h=h!==J?q["$coerce_to!"](h,P("String"),"to_str"):null;d=d.replace(new RegExp("(.)["+c+"]*$"),"$1");d=d.replace(new RegExp("^(?:.*["+c+"])?([^"+c+"]+)$"),"$1");".*"===h?d=d.replace(/\.[^\.]+$/,""):null!==h&&(h=b.escape_regexp(h),d=d.replace(new RegExp(""+h+"$"),""));return d},-2);A(x,"$extname",function(d){d=a(d);d=this.$basename(d);if(n(d["$empty?"]()))return"";var f=d["$[]"](I(1,-1,!1)).$rindex(".");return n(f["$nil?"]())||
|
|
605
|
-
m(B(f,1),G(d.$length(),1))?"":d["$[]"](b.Range.$new(B(f,1),-1,!1))});A(x,"$exist?",function(a){return null!=b.modules[a]});A(x,"$directory?",function(a){var f=J;f=[];for(var c in b.modules)f.push(c);a=a.$gsub(E(["(^.",d("SEPARATOR"),"+|",d("SEPARATOR"),"+$)"]));return K(f,"find",[],function(c){null==c&&(c=J);return c["$=~"](E(["^",a]))})});A(x,"$join",function(a){var b=J;var c=M(arguments);if(n(c["$empty?"]()))return"";b="";c=K(c.$flatten().$each_with_index(),"map",[],function(a,b){null==a&&(a=J);
|
|
606
|
-
null==b&&(b=J);return m(b,0)&&n(a["$empty?"]())?d("SEPARATOR"):m(c.$length(),B(b,1))&&n(a["$empty?"]())?d("SEPARATOR"):a});c=K(c,"reject",[],"empty?".$to_proc());K(c,"each_with_index",[],function(a,f){null==a&&(a=J);null==f&&(f=J);f=c["$[]"](B(f,1));if(n(f["$nil?"]()))return b=""+b+a;n(a["$end_with?"](d("SEPARATOR")))&&n(f["$start_with?"](d("SEPARATOR")))&&(a=a.$sub(E([d("SEPARATOR"),"+$"]),""));return b=n(a["$end_with?"](d("SEPARATOR")))||n(f["$start_with?"](d("SEPARATOR")))?""+b+a:""+b+a+d("SEPARATOR")});
|
|
607
|
-
return b},-1);A(x,"$split",function(a){return a.$split(d("SEPARATOR"))});t(x,"realpath","expand_path");return t(x,"exists?","exist?")}(b.get_singleton_class(R),N)}("::",P("IO"),[])};Opal.modules["corelib/process/base"]=function(b){var n=b.klass,x=b.slice,D=b.defs,q=b.return_val,E=b.nil;(function(b,$super){b=n(b,$super,"Signal");return D(b,"$trap",function(b){x(arguments);return E},-1)})("::",null);return function(b,$super){b=n(b,$super,"GC");return D(b,"$start",q(E))}("::",null)};
|
|
608
|
-
Opal.modules["corelib/process"]=function(b){var n=b.module,x=b.defs,D=b.truthy,q=b.return_val,E=b.Kernel,B=b.nil,A=b.$$$;b.add_stubs("const_set,size,<<,__register_clock__,to_f,now,new,[],raise");return function(z){z=n(z,"Process");var m=B;z.__clocks__=[];x(z,"$__register_clock__",function(b,m){null==this.__clocks__&&(this.__clocks__=B);this.$const_set(b,this.__clocks__.$size());return this.__clocks__["$<<"](m)});z.$__register_clock__("CLOCK_REALTIME",function(){return Date.now()});m=!1;if(b.global.performance)m=
|
|
609
|
-
function(){return performance.now()};else if(b.global.process&&process.hrtime){var v=process.hrtime();m=function(){var b=process.hrtime(v);return 1E3*b[0]+(b[1]/1E3|0)/1E3}}D(m)&&z.$__register_clock__("CLOCK_MONOTONIC",m);x(z,"$pid",q(0));x(z,"$times",function(){var b=A("Time").$now().$to_f();return A(A("Benchmark"),"Tms").$new(b,b,b,b,b)});return x(z,"$clock_gettime",function(b,m){var n,q;null==this.__clocks__&&(this.__clocks__=B);null==m&&(m="float_second");D(n=q=this.__clocks__["$[]"](b))?n:E.$raise(A(A("Errno"),
|
|
610
|
-
"EINVAL"),"clock_gettime("+b+") "+this.__clocks__["$[]"](b));b=q();switch(m){case "float_second":return b/1E3;case "float_millisecond":return b/1;case "float_microsecond":return 1E3*b;case "second":return b/1E3|0;case "millisecond":return b/1|0;case "microsecond":return 1E3*b|0;case "nanosecond":return 1E6*b|0;default:E.$raise(A("ArgumentError"),"unexpected unit: "+m)}},-2)}("::")};
|
|
611
|
-
Opal.modules["corelib/random/formatter"]=function(b){var n=b.klass,x=b.module,D=b.def,q=b.range,E=b.send,B=b.rb_divide,A=b.Kernel,z=b.Opal,m=b.nil,v=b.$$$;b.add_stubs("_verify_count,bytes,encode,strict_encode64,random_bytes,urlsafe_encode64,split,hex,[]=,[],map,to_proc,join,times,<<,|,ord,/,abs,random_float,raise,coerce_to!,flatten,new,random_number,length,include,extend");return function(G,$super,K){G=n(G,$super,"Random");K=[G].concat(K);(function(n,t){n=x(n,"Formatter");t=[n].concat(t);var G=b.$r(t);
|
|
612
|
-
D(n,"$hex",function(b){null==b&&(b=m);b=v("Random").$_verify_count(b);for(var n=this.$bytes(b),t="",q=0;q<b;q++)t+=n.charCodeAt(q).toString(16).padStart(2,"0");return t.$encode("US-ASCII")},-1);D(n,"$random_bytes",function(b){null==b&&(b=m);return this.$bytes(b)},-1);D(n,"$base64",function(b){null==b&&(b=m);return v("Base64").$strict_encode64(this.$random_bytes(b)).$encode("US-ASCII")},-1);D(n,"$urlsafe_base64",function(b,n){null==b&&(b=m);null==n&&(n=!1);return v("Base64").$urlsafe_encode64(this.$random_bytes(b),
|
|
613
|
-
n).$encode("US-ASCII")},-1);D(n,"$uuid",function(){var b=this.$hex(16).$split("");b["$[]="](12,"4");b["$[]="](16,(parseInt(b["$[]"](16),16)&3|8).toString(16));b=[b["$[]"](q(0,8,!0)),b["$[]"](q(8,12,!0)),b["$[]"](q(12,16,!0)),b["$[]"](q(16,20,!0)),b["$[]"](q(20,32,!0))];b=E(b,"map",[],"join".$to_proc());return b.$join("-")});D(n,"$random_float",function(){var b=m,n=m;b=this.$bytes(4);n=0;E(4,"times",[],function(t){null==t&&(t=m);n=n["$<<"](8);return n=n["$|"](b["$[]"](t).$ord())});return B(n.$abs(),
|
|
614
|
-
2147483647)});D(n,"$random_number",function(b){function n(b){return Math.floor(q.$random_float()*b)}function t(){var t=b.begin,q=b.end;if(t===m||q===m)return m;var v=q-t;if(0>v)return m;if(0===v)return t;0!==q%1||0!==t%1||b.excl||v++;return n(v)+t}var q=this;if(null==b)return q.$random_float();if(b.$$is_range)return t();if(b.$$is_number)return 0>=b&&A.$raise(v("ArgumentError"),"invalid argument - "+b),0===b%1?n(b):q.$random_float()*b;b=z["$coerce_to!"](b,v("Integer"),"to_int");0>=b&&A.$raise(v("ArgumentError"),
|
|
615
|
-
"invalid argument - "+b);return n(b)},-1);return D(n,"$alphanumeric",function(b){var n=m;null==b&&(b=m);b=G("Random").$_verify_count(b);n=E([q("0","9",!1),q("a","z",!1),q("A","Z",!1)],"map",[],"to_a".$to_proc()).$flatten();return E(v("Array"),"new",[b],function H(b){return n["$[]"]((null==H.$$s?this:H.$$s).$random_number(n.$length()))},{$$s:this}).$join()},-1)})(G,K);G.$include(v(v("Random"),"Formatter"));return G.$extend(v(v("Random"),"Formatter"))}("::",null,[])};
|
|
616
|
-
Opal.modules["corelib/random/mersenne_twister"]=function(b){var n=b.klass,x=b.const_set,D=b.send,q=b.$$$,E=b.nil;b.add_stubs("generator=");E=function(){function b(b){if(0>=--b.left){var m=0,q=b.state,x;b.left=624;b.next=0;for(x=228;--x;m++)q[m]=q[m+397]^n(q[m+0],q[m+1]);for(x=397;--x;m++)q[m]=q[m+-227]^n(q[m+0],q[m+1]);q[m]=q[m+-227]^n(q[m+0],q[0])}b=b.state[b.next++];b^=b>>>11;b^=b<<7&2636928640;b^=b<<15&4022730752;return(b^b>>>18)>>>0}var n=function(b,m){return(b&2147483648|m&2147483647)>>>1^(m&
|
|
617
|
-
1?2567483615:0)};return{genrand_real:function(n){var m=b(n);n=b(n);return 1.1102230246251565E-16*(67108864*(m>>>5)+(n>>>6))},init:function(b){var m={left:0,next:624,state:Array(624)};m.state[0]=b>>>0;for(b=1;624>b;b++)m.state[b]=1812433253*(m.state[b-1]^m.state[b-1]>>30>>>0)+b,m.state[b]&=4294967295;m.left=1;m.next=624;return m}}}();return function(b,$super){b=n(b,$super,"Random");var z,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1;x(b,"MERSENNE_TWISTER_GENERATOR",{new_seed:function(){return Math.round(Math.random()*
|
|
618
|
-
m)},reseed:function(b){return E.init(b)},rand:function(b){return E.genrand_real(b)}});return z=[q(b,"MERSENNE_TWISTER_GENERATOR")],D(b,"generator=",z),z[z.length-1]}("::",null)};
|
|
619
|
-
Opal.modules["corelib/random"]=function(b){var n=b.truthy,x=b.klass,D=b.Kernel,q=b.defs,E=b.Opal,B=b.def,A=b.eqeqeq,z=b.send,m=b.top,v=b.$$$;b.add_stubs("require,attr_reader,to_int,raise,new_seed,coerce_to!,reseed,rand,seed,bytes,===,==,state,_verify_count,encode,join,new,chr,random_number,random_float,const_defined?,const_set");m.$require("corelib/random/formatter");(function(m,$super){m=x(m,$super,"Random");m.$attr_reader("seed","state");q(m,"$_verify_count",function(b){n(b)||(b=16);"number"!==
|
|
620
|
-
typeof b&&(b=b.$to_int());0>b&&D.$raise(v("ArgumentError"),"negative string size (or size too big)");return b=Math.floor(b)});B(m,"$initialize",function(b){null==b&&(b=v("Random").$new_seed());this.state=b=E["$coerce_to!"](b,v("Integer"),"to_int");return this.$reseed(b)},-1);B(m,"$reseed",function(m){this.seed=m;return this.$rng=b.$$rand.reseed(m)});q(m,"$new_seed",function(){return b.$$rand.new_seed()});q(m,"$rand",function(b){return v(this,"DEFAULT").$rand(b)},-1);q(m,"$srand",function(b){null==
|
|
621
|
-
b&&(b=v("Random").$new_seed());b=E["$coerce_to!"](b,v("Integer"),"to_int");var m=v(this,"DEFAULT").$seed();v(this,"DEFAULT").$reseed(b);return m},-1);q(m,"$urandom",function(b){return v("SecureRandom").$bytes(b)});B(m,"$==",function(b){var m;return A(v("Random"),b)?n(m=this.$seed()["$=="](b.$seed()))?this.$state()["$=="](b.$state()):m:!1});B(m,"$bytes",function(b){b=v("Random").$_verify_count(b);return z(v("Array"),"new",[b],function t(){return(null==t.$$s?this:t.$$s).$rand(255).$chr()},{$$s:this}).$join().$encode("ASCII-8BIT")});
|
|
622
|
-
q(m,"$bytes",function(b){return v(this,"DEFAULT").$bytes(b)});B(m,"$rand",function(b){return this.$random_number(b)},-1);B(m,"$random_float",function(){this.state++;return b.$$rand.rand(this.$rng)});q(m,"$random_float",function(){return v(this,"DEFAULT").$random_float()});return q(m,"$generator=",function(m){b.$$rand=m;return n(this["$const_defined?"]("DEFAULT"))?v(this,"DEFAULT").$reseed():this.$const_set("DEFAULT",this.$new(this.$new_seed()))})})("::",null);return m.$require("corelib/random/mersenne_twister")};
|
|
623
|
-
Opal.modules["corelib/unsupported"]=function(b){function n(m){switch(b.config.unsupported_features_severity){case "error":x.$raise(K("NotImplementedError"),m);break;case "warning":M[m]||(M[m]=!0,G.$warn(m))}}var x=b.Kernel,D=b.klass,q=b.send,E=b.slice,B=b.module,A=b.def,z=b.return_val,m=b.alias,v=b.defs,G=b.top,I=b.nil,K=b.$$$;b.add_stubs("raise,warn,each,define_method,%,public,private_method_defined?,private_class_method,instance_method,instance_methods,method_defined?,private_methods");var M={};
|
|
624
|
-
(function(b,$super){b=D(b,$super,"String");return q("<< capitalize! chomp! chop! downcase! gsub! lstrip! next! reverse! slice! squeeze! strip! sub! succ! swapcase! tr! tr_s! upcase! prepend []= clear encode! unicode_normalize!".split(" "),"each",[],function W(b){var m=null==W.$$s?this:W.$$s;null==b&&(b=I);return q(m,"define_method",[b],function(m){E(arguments);return x.$raise(K("NotImplementedError"),"String#%s not supported. Mutable String methods are not supported in Opal."["$%"](b))},-1)},{$$s:b})})("::",
|
|
625
|
-
null);(function(b){b=B(b,"Kernel");A(b,"$taint",function(){n("Object tainting is not supported by Opal");return this});A(b,"$untaint",function(){n("Object tainting is not supported by Opal");return this});return A(b,"$tainted?",function(){n("Object tainting is not supported by Opal");return!1})})("::");(function(b,$super){b=D(b,$super,"Module");A(b,"$public",function(b){var m=E(arguments);return 0===m.length?(this.$$module_function=!1,I):1===m.length?m[0]:m},-1);A(b,"$private_class_method",function(b){var m=
|
|
626
|
-
E(arguments);return 1===m.length?m[0]:m},-1);A(b,"$private_method_defined?",z(!1));A(b,"$private_constant",function(b){E(arguments);return I},-1);m(b,"nesting","public");m(b,"private","public");m(b,"protected","public");m(b,"protected_method_defined?","private_method_defined?");m(b,"public_class_method","private_class_method");m(b,"public_instance_method","instance_method");m(b,"public_instance_methods","instance_methods");return m(b,"public_method_defined?","method_defined?")})("::",null);(function(b){b=
|
|
627
|
-
B(b,"Kernel");A(b,"$private_methods",function(b){E(arguments);return[]},-1);m(b,"protected_methods","private_methods");m(b,"private_instance_methods","private_methods");return m(b,"protected_instance_methods","private_methods")})("::");(function(m,n){m=B(m,"Kernel");n=[m].concat(n);var q=b.$r(n);return A(m,"$eval",function(b){E(arguments);return x.$raise(K("NotImplementedError"),"To use Kernel#eval, you must first require 'opal-parser'. "+("See https://github.com/opal/opal/blob/"+q("RUBY_ENGINE_VERSION")+
|
|
628
|
-
"/docs/opal_parser.md for details."))},-1)})("::",[]);v(G,"$public",function(b){var m=E(arguments);return 1===m.length?m[0]:m},-1);return v(G,"$private",function(b){var m=E(arguments);return 1===m.length?m[0]:m},-1)};
|
|
629
|
-
Opal.queue(function(b){var n=b.Object;b.add_stubs("require,autoload");n.$require("opal/base");n.$require("opal/mini");n.$require("corelib/kernel/format");n.$require("corelib/string/encoding");n.$autoload("Math","corelib/math");n.$require("corelib/complex/base");n.$autoload("Complex","corelib/complex");n.$require("corelib/rational/base");n.$autoload("Rational","corelib/rational");n.$require("corelib/time");n.$autoload("Struct","corelib/struct");n.$autoload("Set","corelib/set");n.$autoload("Dir","corelib/dir");
|
|
630
|
-
n.$autoload("File","corelib/file");n.$require("corelib/process/base");n.$autoload("Process","corelib/process");n.$autoload("Random","corelib/random");return n.$require("corelib/unsupported")});
|
|
631
|
-
function Asciidoctor$$module$build$asciidoctor_browser(b){function n(a,b,d,f,h){var c=Opal.klass(Opal.Object,a,b,function(){}),p,k,g,l={},e;for(e in d)Object.prototype.hasOwnProperty.call(d,e)&&function(a){var b=d[a];if("postConstruct"===a)p=b;else if("initialize"===a)k=b;else if("constructor"===a)g=b;else{f&&Object.prototype.hasOwnProperty.call(f,a)&&(l[a]=!0);var e;Opal.def(c,"$"+a,e=function(){var c=h&&Object.prototype.hasOwnProperty.call(h,a)?h[a](arguments):arguments;var d=e.$$p;d&&(c[c.length]=
|
|
632
|
-
function(){return Opal.yield1(d)},c.length+=1,e.$$p=null);return b.apply(this,c)})}}(e);var m="function"===typeof g?function(){for(var a=Array.from(arguments),c=0;c<a.length;c++)"object"===typeof a[c]&&"$$smap"in a[c]&&(a[c]=B(a[c]));a.unshift(null);a=new (Function.prototype.bind.apply(g,a));Object.assign(this,a);"function"===typeof p&&p.bind(this)()}:"function"===typeof k?function(){for(var a=Array.from(arguments),c=0;c<a.length;c++)"object"===typeof a[c]&&"$$smap"in a[c]&&(a[c]=B(a[c]));k.apply(this,
|
|
633
|
-
a);"function"===typeof p&&p.bind(this)()}:function(){Opal.send(this,Opal.find_super_dispatcher(this,"initialize",m));"function"===typeof p&&p.bind(this)()};Opal.def(c,"$initialize",m);var $superFunction;Opal.def(c,"super",$superFunction=function(a){if("function"===typeof a)Opal.send(this,Opal.find_super_dispatcher(this,a.name,a));else{for(var c=Array.from(arguments),b=0;b<c.length;b++)"object"===typeof c[b]&&(c[b]=E(c[b]));Opal.send(this,Opal.find_super_dispatcher(this,"initialize",m),c)}});a={};
|
|
634
|
-
for(var n in d)a.$jscomp$loop$prop$functionName$7$9=n,$superFunction[a.$jscomp$loop$prop$functionName$7$9]=function(a){return function(){for(var b=Array.from(arguments),d=0;d<b.length;d++)"object"===typeof b[d]&&"function"===typeof b[d].constructor&&"Object"===b[d].constructor.name&&(b[d]=E(b[d]));d=c.$$prototype;return Opal.send(d,Opal.find_super_dispatcher(d,a.$jscomp$loop$prop$functionName$7$9,d["$"+a.$jscomp$loop$prop$functionName$7$9]),b)}}(a),a={$jscomp$loop$prop$functionName$7$9:a.$jscomp$loop$prop$functionName$7$9};
|
|
635
|
-
if(f)for(var q in f)Object.prototype.hasOwnProperty.call(f,q)&&!Object.prototype.hasOwnProperty.call(l,q)&&function(a){var b=f[a];Opal.def(c,"$"+a,function(){return b.apply(this,arguments)})}(q);return c}function x(a,b){var d=Opal.const_get_qualified(Opal.Logger,"Formatter");return n(d,a,b,{},{call:function(a){for(var b=0;b<a.length;b++)"object"===typeof a[b]&&"$$smap"in a[b]&&(a[b]=B(a[b]));return a}})}function D(a,b){var d=Opal.const_get_qualified(Opal.Asciidoctor,"Logger");return n(d,a,b,{},{add:function(a){if(2<=
|
|
636
|
-
a.length&&"object"===typeof a[2]&&"$$smap"in a[2]){var b=B(a[2]);b.getText=function(){return this.text};b.getSourceLocation=function(){return this.source_location};b.$inspect=function(){var a=this.getSourceLocation();return a?a.getPath()+": line "+a.getLineNumber()+": "+this.getText():this.getText()};a[2]=b}1<=a.length&&(a[1]=a[1]===Opal.nil?void 0:a[1]);return a}})}function q(a,b,d){a=Opal.const_get_qualified(U,a);return n(a,b,d,{"handles?":function(){return!0}})}Opal.modules["asciidoctor/js/opal_ext/browser/file"]=
|
|
637
|
-
function(a){var b=a.klass,d=a.defs,f=[];a.add_stubs("new");return function(f,$super,p){f=b(f,$super,"File");p=[f].concat(p);var h=a.$r(p);return d(f,"$read",function(a){var b="",d=-1;try{var f=new XMLHttpRequest;f.open("GET",a,!1);f.addEventListener("load",function(){d=this.status;if(0===d||200===d)b=this.responseText});f.overrideMimeType("text/plain");f.send()}catch(S){throw h("IOError").$new("Error reading file or directory: "+a+"; reason: "+S.message);}if(404===d||0===d&&!b)throw h("IOError").$new("No such file or directory: "+
|
|
638
|
-
a);return b})}(f[0],null,f)};Opal.modules["asciidoctor/js/opal_ext/browser"]=function(a){var k=a.const_set,d=a.top,f=[];a.add_stubs("require");if("object"===typeof b&&"object"===typeof b.runtime){a=b.runtime;var h=a.platform;var c=a.engine;var p=a.framework;var m=a.ioModule}h=h||"browser";c=c||"";p=p||"";k(f[0],"JAVASCRIPT_IO_MODULE",m||"xmlhttprequest");k(f[0],"JAVASCRIPT_PLATFORM",h);k(f[0],"JAVASCRIPT_ENGINE",c);k(f[0],"JAVASCRIPT_FRAMEWORK",p);return d.$require("asciidoctor/js/opal_ext/browser/file")};
|
|
639
|
-
Opal.modules["asciidoctor/js/asciidoctor_ext/browser/abstract_node"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.truthy,c=a.def,p=[],m=a.nil,g=a.$$$;a.add_stubs("web_path,path_resolver,uriish?,[],attr?,start_with?,descends_from?,base_dir,join,prepare_source_string,read,fetch,warn,logger,normalize_system_path,read_asset");return function(l,e){l=[b(l,"Asciidoctor")].concat(e);return function(b,$super,e){b=d(b,$super,"AbstractNode");e=[b].concat(e);var l=a.$r(e);b.$$prototype.document=m;c(b,"$read_contents",
|
|
640
|
-
function(c,b){var d=m,e=m;null==b&&(b=f([],{}));var p=this.document;if(h(l("Helpers")["$uriish?"](c))||h(d=b["$[]"]("start"))&&h(l("Helpers")["$uriish?"](d))&&h(c=p.$path_resolver().$web_path(c,d)))if(h(p.$path_resolver()["$descends_from?"](c,p.$base_dir()))||h(c["$start_with?"]("chrome://"))||h(p["$attr?"]("allow-uri-read")))try{return h(b["$[]"]("normalize"))?l("Helpers").$prepare_source_string(g("File").$read(c)).$join(l("LF")):g("File").$read(c)}catch(ja){if(a.rescue(ja,[l("StandardError")]))try{return h(b.$fetch("warn_on_failure",
|
|
641
|
-
!0))&&this.$logger().$warn("could not retrieve contents of "+(h(e=b["$[]"]("label"))?e:"asset")+" at URI: "+c),m}finally{a.pop_exception()}else throw ja;}else return h(b.$fetch("warn_on_failure",!0))&&this.$logger().$warn("cannot retrieve contents of "+(h(e=b["$[]"]("label"))?e:"asset")+" at URI: "+c+" (allow-uri-read attribute not enabled)"),m;else return c=this.$normalize_system_path(c,b["$[]"]("start"),m,f(["target_name"],{target_name:h(e=b["$[]"]("label"))?e:"asset"})),this.$read_asset(c,f(["normalize",
|
|
642
|
-
"warn_on_failure","label"],{normalize:b["$[]"]("normalize"),warn_on_failure:b.$fetch("warn_on_failure",!0),label:b["$[]"]("label")}))},-2);return c(b,"$generate_data_uri_from_uri",function(a,c){null==c&&(c=!1);var b="",d="",e=-1;try{var f=new XMLHttpRequest;f.open("GET",a,!1);f.overrideMimeType("text/plain; charset=x-user-defined");f.addEventListener("load",function(){e=this.status;if(0===e||200===e){for(var a="",c=this.responseText,f=0,h=c.length;f<h;++f){var l=c.charCodeAt(f)&255;a+=String.fromCharCode(l)}d=
|
|
643
|
-
btoa(a);b=this.getResponseHeader("content-type")}});f.send(null);if(!b)if(a.endsWith(".jpeg")||a.endsWith(".jpg")||a.endsWith(".jpe"))b="image/jpg";else if(a.endsWith(".png"))b="image/png";else if(a.endsWith(".svg"))b="image/svg+xml";else if(a.endsWith(".bmp"))b="image/bmp";else if(a.endsWith(".tif")||a.endsWith(".tiff"))b="image/tiff"}catch(ka){e=0}return 404!==e&&(0!==e||d&&b)?"data:"+b+";base64,"+d:(this.$logger().$warn("could not retrieve image data from URI: "+a),a)},-2)}(l[0],null,l)}(p[0],
|
|
644
|
-
p)};Opal.modules["asciidoctor/js/asciidoctor_ext/browser/open_uri"]=function(a){var b=a.module,d=a.slice,f=a.send,h=a.to_a,c=a.defs,p=[],m=a.nil;a.add_stubs("new,path");return function(g,l){g=[b(g,"OpenURI")].concat(l);var e=a.$r(g);return c(e("OpenURI"),"$open_uri",function O(c,b){var l=O.$$p||m;O.$$p=null;var g=d(arguments,1);g=f(e("File"),"new",[this.$path()].concat(h(g)));return l!==m?a.yield1(l,g):g},-2)}(p[0],p)};Opal.modules["asciidoctor/js/asciidoctor_ext/browser/path_resolver"]=function(a){var b=
|
|
645
|
-
a.module,d=a.klass,f=a.truthy,h=a.def,c=[];a.add_stubs("absolute_path?,start_with?");return function(a,c){return function(a,$super){a=d(a,$super,"PathResolver");return h(a,"$root?",function(a){var c;return f(c=this["$absolute_path?"](a))?c:a["$start_with?"]("file://","http://","https://","chrome://")})}([b(a,"Asciidoctor")].concat(c)[0],null)}(c[0],c)};Opal.modules["asciidoctor/js/asciidoctor_ext/browser/reader"]=function(a){var b=a.module,d=a.klass,f=a.truthy,h=a.eqeq,c=a.not,p=a.def,m=[],g=a.nil;
|
|
646
|
-
a.add_stubs("posixify,new,base_dir,start_with?,uriish?,key?,attributes,descends_from?,replace_next_line,absolute_path?,==,empty?,!,slice,length");return function(l,e){l=[b(l,"Asciidoctor")].concat(e);e=a.$r(l);return function(b,$super,e){b=d(b,$super,"PreprocessorReader");e=[b].concat(e);var l=a.$r(e);e=b.$$prototype;e.path_resolver=e.document=e.include_stack=e.dir=g;return p(b,"$resolve_include_path",function(a,b,d){var e=g,p;d=g;var k=(this.path_resolver=f(e=this.path_resolver)?e:l("PathResolver").$new("\\")).$posixify(a);
|
|
647
|
-
var m=["file",this.document.$base_dir()];e=m[1];m;if(f(k["$start_with?"]("file://")))a=b=k;else if(f(l("Helpers")["$uriish?"](k))){if(!f(this.path_resolver["$descends_from?"](k,e))&&!f(this.document.$attributes()["$key?"]("allow-uri-read")))return this.$replace_next_line("link:"+a+"["+b+"]");a=b=k}else if(f(this.path_resolver["$absolute_path?"](k)))a=b="file://"+(f(k["$start_with?"]("/"))?"":"/")+k;else if(h(p=f(m=this.include_stack["$empty?"]())?e:this.dir,"."))a=b=k;else if(f(p["$start_with?"]("file://"))||
|
|
648
|
-
c(l("Helpers")["$uriish?"](p)))a=""+p+"/"+k,b=f(m)?k:h(e,".")||c(d=this.path_resolver["$descends_from?"](a,e))?a:a.$slice(d,a.$length());else if(f(m))a=""+p+"/"+(b=k);else if(f(d=this.path_resolver["$descends_from?"](p,e))||f(this.document.$attributes()["$key?"]("allow-uri-read")))a=""+p+"/"+k,b=f(d)?a.$slice(d,a.$length()):k;else return this.$replace_next_line("link:"+a+"["+b+"]");return[a,"file",b]})}(l[0],e("Reader"),l)}(m[0],m)};Opal.modules["asciidoctor/js/asciidoctor_ext/browser"]=function(a){var b=
|
|
649
|
-
a.eqeq,d=a.top,f=a.$r([]),h=a.nil;a.add_stubs("==,require");return b(f("JAVASCRIPT_IO_MODULE"),"xmlhttprequest")?(d.$require("asciidoctor/js/asciidoctor_ext/browser/abstract_node"),d.$require("asciidoctor/js/asciidoctor_ext/browser/open_uri"),d.$require("asciidoctor/js/asciidoctor_ext/browser/path_resolver"),d.$require("asciidoctor/js/asciidoctor_ext/browser/reader")):h};Opal.modules.set=Opal.return_val(Opal.nil);Opal.modules["asciidoctor/js/opal_ext/kernel"]=function(a){var b=a.module,d=a.slice,
|
|
650
|
-
f=a.send,h=a.to_a,c=a.def,p=a.return_val,m=[],g=a.nil;a.add_stubs("new");return function(l,e){l=b(l,"Kernel");e=[l].concat(e);var k=a.$r(e);c(l,"$open",function F(c,b){var e=F.$$p||g;F.$$p=null;var l=d(arguments,1);l=f(k("File"),"new",[c].concat(h(l)));return e!==g?a.yield1(e,l):l},-2);return c(l,"$__dir__",p(""))}(m[0],m)};Opal.modules["asciidoctor/js/opal_ext/file"]=function(a){var b=a.klass,d=a.def,f=a.truthy,h=a.gvars,c=a.return_val,p=a.defs,m=[],g=a.nil;a.add_stubs("attr_reader,delete,gsub,read,size,to_enum,chomp,each_line,readlines,split");
|
|
651
|
-
(function(l,$super,p){l=b(l,$super,"File");p=[l].concat(p);var k=a.$r(p),m=l.$$prototype;m.eof=m.path=g;l.$attr_reader("eof");l.$attr_reader("lineno");l.$attr_reader("path");d(l,"$initialize",function(a,c){null==c&&(c="r");this.path=a;this.contents=g;this.eof=!1;this.lineno=0;c=c.$delete("b");return this.flags=c=c.$gsub(/:(.*)/,"")},-2);d(l,"$read",function(){if(f(this.eof))return"";var a=k("File").$read(this.path);this.eof=!0;this.lineno=a.$size();return a});d(l,"$each_line",function Z(c){var b=
|
|
652
|
-
Z.$$p||g;null==h["/"]&&(h["/"]=g);Z.$$p=null;null==c&&(c=h["/"]);if(f(this.eof))return b!==g?this:[].$to_enum();if(b!==g){var d=k("File").$read(this.path);this.eof=!1;this.lineno=0;var l=d.$chomp();d=d.length!=l.length;l=l.split(c);for(var p=0,m=l.length;p<m;p++)this.lineno+=1,p<m-1||d?a.yield1(b,l[p]+c):a.yield1(b,l[p]);this.eof=!0;return this}return this.$read().$each_line()},-1);d(l,"$readlines",function(){return k("File").$readlines(this.path)});return function(b,f){f=[b].concat(f);var l=a.$r(f);
|
|
653
|
-
d(b,"$readlines",function(a,c){null==h["/"]&&(h["/"]=g);null==c&&(c=h["/"]);return l("File").$read(a).$split(c)},-2);d(b,"$file?",c(!0));d(b,"$readable?",c(!0));return d(b,"$read",c(""))}(a.get_singleton_class(l),p)})(m[0],null,m);return function(c,$super,d){c=b(c,$super,"IO");d=[c].concat(d);var f=a.$r(d);return p(c,"$read",function(a){return f("File").$read(a)})}(m[0],null,m)};Opal.modules["asciidoctor/js/opal_ext/match_data"]=function(a){var b=a.klass,d=a.send,f=a.def,h=a.nil;a.add_stubs("[]=");
|
|
654
|
-
return function(a,$super){a=b(a,$super,"MatchData");a.$$prototype.matches=h;return f(a,"$[]=",function(a,c){var b;return b=[a,c],d(this.matches,"[]=",b),b[b.length-1]})}([][0],null)};Opal.modules["asciidoctor/js/opal_ext/string"]=function(a){var b=a.klass,d=a.truthy,f=a.rb_lt,h=a.def,c=a.alias,p=a.rb_ge,m=a.eqeq,g=a.rb_minus,l=a.nil;a.add_stubs("method_defined?,<,length,bytes,to_s,byteslice,limit_bytesize,>=,==,-,_original_byteslice,unpack,_original_unpack");return function(a,$super){a=b(a,$super,
|
|
655
|
-
"String");d(a["$method_defined?"]("limit_bytesize"))||h(a,"$limit_bytesize",function(a){return d(f(a,this.$bytes().$length()))?this.$byteslice(0,a).$to_s():this.$to_s()});d(a["$method_defined?"]("limit"))||c(a,"limit","limit_bytesize");c(a,"_original_byteslice","byteslice");h(a,"$byteslice",function(a,c){null==c&&(c=1);return m(a,3)&&d(p(c,a))&&d(65279===this.charCodeAt())?this.substr(1).$byteslice(0,g(c,3)):this.$_original_byteslice(a,c)},-2);c(a,"_original_unpack","unpack");return h(a,"$unpack",
|
|
656
|
-
function(a){if(m(a,"C3")){if(d(65279===this.charCodeAt()))return[239,187,191];a=[];for(var c=0;3>c;c++)c<this.length?a.push(this.charCodeAt(c)):a.push(l);return a}return this.$_original_unpack(a)})}([][0],null)};Opal.modules["asciidoctor/js/opal_ext/uri"]=function(a){var b=a.module,d=a.defs,f=a.return_self,h=a.def,c=[];a.add_stubs("extend");return function(c,k){c=b(c,"URI");k=[c].concat(k);var g=a.$r(k);d(c,"$parse",function(a){return a.$extend(g("URI"))});return h(c,"$path",f)}(c[0],c)};Opal.modules["asciidoctor/js/opal_ext/base64"]=
|
|
657
|
-
function(a){var b=a.module,d=a.defs,f=a.ensure_kwargs,h=a.truthy;a.add_stubs("delete");return function(c){c=b(c,"Base64");var p=a.global.btoa||function(a){return(a instanceof Buffer?a:Buffer.from(a.toString(),"binary")).toString("base64")};var k=a.global.atob||function(a){return Buffer.from(a,"base64").toString("binary")};d(c,"$decode64",function(a){return k(a.replace(/\r?\n/g,""))});d(c,"$encode64",function(a){return p(a).replace(/(.{60})/g,"$1\n").replace(/([^\n])$/g,"$1\n")});d(c,"$strict_decode64",
|
|
658
|
-
function(a){return k(a)});d(c,"$strict_encode64",function(a){return p(a)});d(c,"$urlsafe_decode64",function(a){return k(a.replace(/\-/g,"+").replace(/_/g,"/"))});return d(c,"$urlsafe_encode64",function(a,c){c=f(c);c=c.$$smap.padding;null==c&&(c=!0);a=p(a).replace(/\+/g,"-").replace(/\//g,"_");h(c)||(a=a.$delete("="));return a},-2)}([][0])};Opal.modules["asciidoctor/js/opal_ext/number"]=function(a){var b=a.klass,d=a.truthy,f=a.rb_gt,h=a.def,c=[],p=a.$r(c);a.add_stubs("coerce_to!,>");return function(c,
|
|
659
|
-
$super,l){c=b(c,$super,"Number");l=[c].concat(l);var e=a.$r(l);return h(c,"$round",function(a){a=e("Opal")["$coerce_to!"](a,e("Integer"),"to_int");return d(f(a,0))?Number(this.toFixed(a)):Math.round(this)},-1)}(c[0],p("Numeric"),c)};Opal.modules["asciidoctor/js/opal_ext"]=function(a){var b=a.top;a.add_stubs("require");b.$require("asciidoctor/js/opal_ext/kernel");b.$require("asciidoctor/js/opal_ext/file");b.$require("asciidoctor/js/opal_ext/match_data");b.$require("asciidoctor/js/opal_ext/string");
|
|
660
|
-
b.$require("asciidoctor/js/opal_ext/uri");b.$require("asciidoctor/js/opal_ext/base64");b.$require("asciidoctor/js/opal_ext/number");a.config.unsupported_features_severity="ignore";b.$require("asciidoctor/js/opal_ext/browser")};Opal.modules["asciidoctor/js/rx"]=function(a){var b=a.module,d=a.const_set,f=a.send,h=a.gvars,c=a.truthy,p=a.defs,m=a.rb_plus,g=[],l=a.nil;a.add_stubs("gsub,+,unpack_hex_range");return function(e,g){e=b(e,"Asciidoctor");g=[e].concat(g);var k=a.$r(g);d(g[0],"HEX_RANGE_RX",/([A-F0-9]{4})(?:-([A-F0-9]{4}))?/);
|
|
661
|
-
p(e,"$unpack_hex_range",function(a){return f(a,"gsub",[k("HEX_RANGE_RX")],function(){var a,b=l;return"\\u"+((a=h["~"])===l?l:a["$[]"](1))+(c(b=(a=h["~"])===l?l:a["$[]"](2))?"-\\u"+((a=h["~"])===l?l:a["$[]"](2)):b)})});d(g[0],"P_L",m("A-Za-z",e.$unpack_hex_range("00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D037F03860388-038A038C038E-03A103A3-03F503F7-0481048A-052F0531-055605590561-058705D0-05EA05F0-05F20620-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280840-085808A0-08B20904-0939093D09500958-09610971-09800985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10CF10CF20D05-0D0C0D0E-0D100D12-0D3A0D3D0D4E0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC-0EDF0F000F40-0F470F49-0F6C0F88-0F8C1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510C710CD10D0-10FA10FC-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA16F1-16F81700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191E1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1BBA-1BE51C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11CF51CF61D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209C21022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2CF22CF32D00-2D252D272D2D2D30-2D672D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A66EA67F-A69DA6A0-A6E5A717-A71FA722-A788A78B-A78EA790-A7ADA7B0A7B1A7F7-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFA9E0-A9E4A9E6-A9EFA9FA-A9FEAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA7E-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDAAE0-AAEAAAF2-AAF4AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EAB30-AB5AAB5C-AB5FAB64AB65ABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC")));
|
|
662
|
-
d(g[0],"P_Nl",e.$unpack_hex_range("16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF"));d(g[0],"P_Nd",m("0-9",e.$unpack_hex_range("0660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0DE6-0DEF0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19D91A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9A9F0-A9F9AA50-AA59ABF0-ABF9FF10-FF19")));d(g[0],"P_Pc",e.$unpack_hex_range("005F203F20402054FE33FE34FE4D-FE4FFF3F"));
|
|
663
|
-
d(g[0],"CC_ALPHA",""+k("P_L")+k("P_Nl"));d(g[0],"CG_ALPHA","["+k("CC_ALPHA")+"]");d(g[0],"CC_ALNUM",""+k("CC_ALPHA")+k("P_Nd"));d(g[0],"CG_ALNUM","["+k("CC_ALNUM")+"]");d(g[0],"CC_WORD",""+k("CC_ALNUM")+k("P_Pc"));d(g[0],"CG_WORD","["+k("CC_WORD")+"]");d(g[0],"CG_BLANK","[ \\t]");d(g[0],"CC_EOL","(?=\\n|$)");d(g[0],"CG_GRAPH","[^\\s\\x00-\\x1F\\x7F]");d(g[0],"CC_ALL","[\\s\\S]");return d(g[0],"CC_ANY","[^\\n]")}(g[0],g)};Opal.modules.strscan=function(a){var b=a.klass,d=a.def,f=a.truthy,h=a.eqeqeq,
|
|
664
|
-
c=a.Opal,p=a.return_ivar,m=a.send,g=a.alias,l=[],e=a.nil;a.add_stubs("attr_reader,anchor,empty?,===,to_s,coerce_to!,scan_until,length,size,rest,pos=,beginning_of_line?,get_byte,private");return function(l,$super,k){l=b(l,$super,"StringScanner");k=[l].concat(k);var n=a.$r(k);k=l.$$prototype;k.pos=k.string=k.working=k.matched=k.prev_pos=k.match=e;l.$attr_reader("pos","matched");d(l,"$initialize",function(a){this.string=a;this.pos=0;this.matched=e;this.working=a;return this.match=[]});l.$attr_reader("string");
|
|
665
|
-
d(l,"$beginning_of_line?",function(){return 0===this.pos||"\n"===this.string.charAt(this.pos-1)});d(l,"$scan",function(a){a=this.$anchor(a);a=a.exec(this.working);if(null==a)return this.matched=e;this.prev_pos=this.pos;this.pos+=a[0].length;this.working=this.working.substring(a[0].length);this.matched=a[0];this.match=a;return a[0]});d(l,"$scan_until",function(a){a=this.$anchor(a);for(var c=this.working,b=0;c.length!=b;++b){var d=a.exec(c.substr(b));if(null!==d){a=b+d[0].length;var f=c.substr(0,a);
|
|
666
|
-
this.matched=d[0];this.match=d;this.prev_pos=this.pos+b;this.pos+=a;this.working=c.substr(a);return f}}return this.matched=e});d(l,"$[]",function(a){var b;if(f(this.match["$empty?"]()))return e;h(n("Symbol"),b=a)?a=a.$to_s():h(n("String"),b)||(a=c["$coerce_to!"](a,n("Integer"),"to_int"));b=this.match;0>a&&(a+=b.length);return 0>a||a>=b.length||null==b[a]?e:b[a]});d(l,"$check",function(a){a=this.$anchor(a);a=a.exec(this.working);return null==a?this.matched=e:this.matched=a[0]});d(l,"$check_until",
|
|
667
|
-
function(a){var c=this.prev_pos,b=this.pos,d=this.working;a=this.$scan_until(a);this.prev_pos=c;this.pos=b;this.working=d;return a});d(l,"$peek",function(a){return this.working.substring(0,a)});d(l,"$eos?",function(){return 0===this.working.length});d(l,"$exist?",function(a){a=a.exec(this.working);return null==a?e:0==a.index?0:a.index+1});d(l,"$skip",function(a){a=this.$anchor(a);a=a.exec(this.working);if(null==a)return this.match=[],this.matched=e;var c=a[0],b=c.length;this.matched=c;this.match=
|
|
668
|
-
a;this.prev_pos=this.pos;this.pos+=b;this.working=this.working.substring(b);return b});d(l,"$skip_until",function(a){a=this.$scan_until(a);if(a===e)return e;this.matched=a.substr(-1);return a.length});d(l,"$get_byte",function(){var a=e;this.pos<this.string.length?(this.prev_pos=this.pos,this.pos+=1,a=this.matched=this.working.substring(0,1),this.working=this.working.substring(1)):this.matched=e;return a});d(l,"$match?",function(a){a=this.$anchor(a);a=a.exec(this.working);if(null==a)return e;this.prev_pos=
|
|
669
|
-
this.pos;return a[0].length});d(l,"$pos=",function(a){0>a&&(a+=this.string.$length());this.pos=a;return this.working=this.string.slice(a)});d(l,"$matched_size",function(){return this.matched===e?e:this.matched.length});d(l,"$post_match",function(){return this.matched===e?e:this.string.substr(this.pos)});d(l,"$pre_match",function(){return this.matched===e?e:this.string.substr(0,this.prev_pos)});d(l,"$reset",function(){this.working=this.string;this.matched=e;return this.pos=0});d(l,"$rest",p("working"));
|
|
670
|
-
d(l,"$rest?",function(){return 0!==this.working.length});d(l,"$rest_size",function(){return this.$rest().$size()});d(l,"$terminate",function(){var a;this.match=e;return a=[this.string.$length()],m(this,"pos=",a),a[a.length-1]});d(l,"$unscan",function(){this.pos=this.prev_pos;this.match=this.prev_pos=e;return this});g(l,"bol?","beginning_of_line?");g(l,"getch","get_byte");l.$private();return d(l,"$anchor",function(a){var c=a.toString().match(/\/([^\/]+)$/);c=c?c[1]:void 0;return new RegExp("^(?:"+
|
|
671
|
-
a.source+")",c)})}(l[0],null,l)};Opal.modules["asciidoctor/js"]=function(a){var b=a.top;a.add_stubs("require");b.$require("asciidoctor/js/opal_ext");b.$require("asciidoctor/js/rx");return b.$require("strscan")};Opal.modules["asciidoctor/core_ext/nil_or_empty"]=function(a){var b=a.klass,d=a.truthy,f=a.alias,h=[],c=a.nil;a.add_stubs("method_defined?,nil?,empty?");(function(a,$super){a=b(a,$super,"NilClass");return d(a["$method_defined?"]("nil_or_empty?"))?c:f(a,"nil_or_empty?","nil?")})(h[0],null);
|
|
672
|
-
(function(a,$super){a=b(a,$super,"String");return d(a["$method_defined?"]("nil_or_empty?"))?c:f(a,"nil_or_empty?","empty?")})(h[0],null);(function(a,$super){a=b(a,$super,"Array");return d(a["$method_defined?"]("nil_or_empty?"))?c:f(a,"nil_or_empty?","empty?")})(h[0],null);(function(a,$super){a=b(a,$super,"Hash");return d(a["$method_defined?"]("nil_or_empty?"))?c:f(a,"nil_or_empty?","empty?")})(h[0],null);return function(a,$super){a=b(a,$super,"Numeric");return d(a["$method_defined?"]("nil_or_empty?"))?
|
|
673
|
-
c:f(a,"nil_or_empty?","nil?")}(h[0],null)};Opal.modules["asciidoctor/core_ext/hash/merge"]=function(a){var b=a.eqeq,d=a.send,f=a.slice,h=a.truthy,c=a.rb_lt,p=a.rb_gt,m=a.send2,g=a.find_super,l=a.def,e=a.top,n=a.$r([]),q=a.nil;a.add_stubs("==,arity,instance_method,send,new,<,length,dup,>,inject,merge,[]");return b(n("Hash").$instance_method("merge").$arity(),1)?n("Hash").$send("prepend",d(n("Module"),"new",[],function O(){return l(null==O.$$s?this:O.$$s,"$merge",function la(a){var b=q;la.$$p=null;
|
|
674
|
-
var e=f(arguments);return h(c(b=e.$length(),1))?this.$dup():h(p(b,1))?d(e,"inject",[this],function(a,c){null==a&&(a=q);null==c&&(c=q);return a.$merge(c)}):m(this,g(this,"merge",la,!1,!0),"merge",[e["$[]"](0)],null)},-1)},{$$s:e})):q};Opal.modules["asciidoctor/core_ext/match_data/names"]=function(a){var b=a.truthy,d=a.klass,f=a.def,h=[],c=a.$r(h),p=a.nil;a.add_stubs("method_defined?");return b(c("MatchData")["$method_defined?"]("names"))?p:function(a,$super){a=d(a,$super,"MatchData");return f(a,"$names",
|
|
675
|
-
function(){return[]})}(h[0],null)};Opal.modules["asciidoctor/core_ext"]=function(a){a=a.top;a.$require("asciidoctor/core_ext.rb/../core_ext/nil_or_empty");a.$require("asciidoctor/core_ext.rb/../core_ext/hash/merge");return a.$require("asciidoctor/core_ext.rb/../core_ext/match_data/names")};Opal.modules["asciidoctor/helpers"]=function(a){var b=a.module,d=a.truthy,f=a.eqeq,h=a.gvars,c=a.def,p=a.send,m=a.neqeq,g=a.const_set,l=a.hash2,e=a.to_ary,n=a.rb_times,q=a.eqeqeq,y=a.rb_plus,O=a.Class,F=a.Object,
|
|
676
|
-
t=[],x=a.nil,v=a.$$$;a.add_stubs("module_function,require,include?,include,==,path,message,raise,warn,logger,chomp,empty?,slice,unpack,[],[]=,byteslice,bytesize,map,rstrip,encode,encoding,nil_or_empty?,!=,tap,each_line,<<,!,start_with?,match?,gsub,rindex,index,basename,extname,length,directory?,dirname,mkdir_p,mkdir,private_constant,join,divmod,*,===,+,to_s,to_i,succ,class_for_name,const_get");return function(k,S){k=[b(k,"Asciidoctor")].concat(S);return function(k,u){k=b(k,"Helpers");u=[k].concat(u);
|
|
677
|
-
var S=a.$r(u);k.$module_function();c(k,"$require_library",function(c,b,e){var l=x;null==h["!"]&&(h["!"]=x);null==b&&(b=!0);null==e&&(e="abort");try{return this.$require(c)}catch(w){if(a.rescue(w,[v("LoadError")]))try{d(this["$include?"](S("Logging")))||this.$include(S("Logging"));if(d(b))switch(f(b,!0)&&(b=c),e){case "abort":l=f(h["!"].$path(),b)?"":" (reason: "+(d(h["!"].$path())?"cannot load '"+h["!"].$path()+"'":h["!"].$message())+")";this.$raise(v("LoadError"),"asciidoctor: FAILED: required gem '"+
|
|
678
|
-
b+"' is not available"+l+". Processing aborted.");break;case "warn":l=f(h["!"].$path(),b)?"":" (reason: "+(d(h["!"].$path())?"cannot load '"+h["!"].$path()+"'":h["!"].$message())+")";this.$logger().$warn("optional gem '"+b+"' is not available"+l+". Functionality disabled.");break;default:x}else switch(e){case "abort":this.$raise(v("LoadError"),"asciidoctor: FAILED: "+h["!"].$message().$chomp(".")+". Processing aborted.");break;case "warn":this.$logger().$warn(""+h["!"].$message().$chomp(".")+". Functionality disabled.");
|
|
679
|
-
break;default:x}return x}finally{a.pop_exception()}else throw w;}},-2);c(k,"$prepare_source_array",function(a,c){var b=x,e=x,l=x;null==c&&(c=!0);if(d(a["$empty?"]()))return[];if(f(b=(e=(l=a["$[]"](0)).$unpack("C3")).$slice(0,2),S("BOM_BYTES_UTF_16LE")))return a["$[]="](0,l.$byteslice(2,l.$bytesize())),d(c)?p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8"),v(v("Encoding"),"UTF_16LE")).$rstrip()}):p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8"),v(v("Encoding"),
|
|
680
|
-
"UTF_16LE")).$chomp()});if(f(b,S("BOM_BYTES_UTF_16BE")))return a["$[]="](0,l.$byteslice(2,l.$bytesize())),d(c)?p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8"),v(v("Encoding"),"UTF_16BE")).$rstrip()}):p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8"),v(v("Encoding"),"UTF_16BE")).$chomp()});if(f(e,S("BOM_BYTES_UTF_8")))a["$[]="](0,l.$byteslice(3,l.$bytesize()));return f(l.$encoding(),S("UTF_8"))?d(c)?p(a,"map",[],function(a){null==a&&(a=x);return a.$rstrip()}):
|
|
681
|
-
p(a,"map",[],function(a){null==a&&(a=x);return a.$chomp()}):d(c)?p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8")).$rstrip()}):p(a,"map",[],function(a){null==a&&(a=x);return a.$encode(S("UTF_8")).$chomp()})},-2);c(k,"$prepare_source_string",function(a,c){var b=x,e=x;null==c&&(c=!0);if(d(a["$nil_or_empty?"]()))return[];f(b=(e=a.$unpack("C3")).$slice(0,2),S("BOM_BYTES_UTF_16LE"))?a=a.$byteslice(2,a.$bytesize()).$encode(S("UTF_8"),v(v("Encoding"),"UTF_16LE")):f(b,S("BOM_BYTES_UTF_16BE"))?
|
|
682
|
-
a=a.$byteslice(2,a.$bytesize()).$encode(S("UTF_8"),v(v("Encoding"),"UTF_16BE")):f(e,S("BOM_BYTES_UTF_8"))?(a=a.$byteslice(3,a.$bytesize()),f(a.$encoding(),S("UTF_8"))||(a=a.$encode(S("UTF_8")))):m(a.$encoding(),S("UTF_8"))&&(a=a.$encode(S("UTF_8")));return d(c)?p([],"tap",[],function(c){null==c&&(c=x);return p(a,"each_line",[],function(a){null==a&&(a=x);return c["$<<"](a.$rstrip())})}):p([],"tap",[],function(c){null==c&&(c=x);return p(a,"each_line",[],function(a){null==a&&(a=x);return c["$<<"](a.$chomp())})})},
|
|
683
|
-
-2);f(v("RUBY_ENGINE"),"jruby")?c(k,"$uriish?",function(a){var c,b=x;return d(c=d(b=a["$include?"](":"))?a["$start_with?"]("uri:classloader:")["$!"]():b)?S("UriSniffRx")["$match?"](a):c}):c(k,"$uriish?",function(a){var c;return d(c=a["$include?"](":"))?S("UriSniffRx")["$match?"](a):c});c(k,"$encode_uri_component",function(a){return encodeURIComponent(a).replace(/%20|[!'()*]/g,function(a){return"%20"===a?"+":"%"+a.charCodeAt(0).toString(16)})});c(k,"$encode_spaces_in_uri",function(a){return d(a["$include?"](" "))?
|
|
684
|
-
a.$gsub(" ","%20"):a});c(k,"$rootname",function(a){var c;return d(c=a.$rindex("."))?d(a.$index("/",c))?a:a.$slice(0,c):a});c(k,"$basename",function(a,c){null==c&&(c=x);return d(c)?v("File").$basename(a,f(c,!0)?this.$extname(a):c):v("File").$basename(a)},-2);c(k,"$extname?",function(a){var c,b;return d(c=b=a.$rindex("."))?a.$index("/",b)["$!"]():c});d(v(v("File"),"ALT_SEPARATOR"))?c(k,"$extname",function(a,c){var b;null==c&&(c="");return d(b=a.$rindex("."))?d(a.$index("/",b))||d(a.$index(v(v("File"),
|
|
685
|
-
"ALT_SEPARATOR"),b))?c:a.$slice(b,a.$length()):c},-2):c(k,"$extname",function(a,c){var b;null==c&&(c="");return d(b=a.$rindex("."))?d(a.$index("/",b))?c:a.$slice(b,a.$length()):c},-2);c(k,"$mkdir_p",function(c){var b;if(d(v("File")["$directory?"](c)))return x;f(b=v("File").$dirname(c),".")||this.$mkdir_p(b);try{return v("Dir").$mkdir(c)}catch(Y){if(a.rescue(Y,[v("SystemCallError")]))try{return d(v("File")["$directory?"](c))?x:this.$raise()}finally{a.pop_exception()}else throw Y;}});g(u[0],"ROMAN_NUMERALS",
|
|
686
|
-
l("M CM D CD C XC L XL X IX V IV I".split(" "),{M:1E3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}));k.$private_constant("ROMAN_NUMERALS");c(k,"$int_to_roman",function(a){return p(S("ROMAN_NUMERALS"),"map",[],function(c,b){null==c&&(c=x);null==b&&(b=x);var d=a.$divmod(b);b=e(d);var f=null==b[0]?x:b[0];a=null==b[1]?x:b[1];d;return n(c,f)}).$join()});c(k,"$nextval",function(a){var c;return q(v("Integer"),a)?y(a,1):f((c=a.$to_i()).$to_s(),a.$to_s())?y(c,1):a.$succ()});c(k,"$resolve_class",
|
|
687
|
-
function(a){return q(O,a)?a:q(v("String"),a)?this.$class_for_name(a):x});return c(k,"$class_for_name",function(c){var b=x;try{return q(O,b=F.$const_get(c,!1))||this.$raise(),b}catch(Y){if(a.rescue(Y,[S("StandardError")]))try{return this.$raise(v("NameError"),"Could not resolve class for name: "+c)}finally{a.pop_exception()}else throw Y;}})}(k[0],k)}(t[0],t)};Opal.modules.logger=function(a){var b=a.klass,d=a.module,f=a.const_set,h=a.send,c=a.def,p=a.eqeqeq,m=a.rb_plus,g=a.truthy,l=a.rb_le,e=a.rb_lt,
|
|
688
|
-
n=[],q=a.nil,y=a.$$$;a.add_stubs("include,to_h,map,constants,const_get,to_s,format,chr,strftime,message_as_string,===,+,message,class,join,backtrace,inspect,attr_reader,attr_accessor,new,key,upcase,raise,add,to_proc,<=,<,write,call,[],now");return function(k,$super,n){k=b(k,$super,"Logger");n=[k].concat(n);var S=a.$r(n),t=k.$$prototype;t.level=t.progname=t.pipe=t.formatter=q;(function(a,c){a=[d(a,"Severity")].concat(c);f(a[0],"DEBUG",0);f(a[0],"INFO",1);f(a[0],"WARN",2);f(a[0],"ERROR",3);f(a[0],"FATAL",
|
|
689
|
-
4);return f(a[0],"UNKNOWN",5)})(n[0],n);k.$include(S("Severity"));f(n[0],"SEVERITY_LABELS",h(S("Severity").$constants(),"map",[],function(a){null==a&&(a=q);return[S("Severity").$const_get(a),a.$to_s()]}).$to_h());(function(d,$super,e){d=b(d,$super,"Formatter");e=[d].concat(e);var l=a.$r(e);f(e[0],"MESSAGE_FORMAT","%s, [%s] %5s -- %s: %s\n");f(e[0],"DATE_TIME_FORMAT","%Y-%m-%dT%H:%M:%S.%6N");c(d,"$call",function(a,c,b,d){return this.$format(l("MESSAGE_FORMAT"),a.$chr(),c.$strftime(l("DATE_TIME_FORMAT")),
|
|
690
|
-
a,b,this.$message_as_string(d))});return c(d,"$message_as_string",function(a){var c=q;return p(y("String"),a)?a:p(y("Exception"),a)?m(""+a.$message()+" ("+a.$class()+")\n",(g(c=a.$backtrace())?c:[]).$join("\n")):a.$inspect()})})(n[0],null,n);k.$attr_reader("level");k.$attr_accessor("progname");k.$attr_accessor("formatter");c(k,"$initialize",function(a){this.pipe=a;this.level=S("DEBUG");return this.formatter=S("Formatter").$new()});c(k,"$level=",function(a){var c;return p(y("Integer"),a)?this.level=
|
|
691
|
-
a:g(c=S("SEVERITY_LABELS").$key(a.$to_s().$upcase()))?this.level=c:this.$raise(S("ArgumentError"),"invalid log level: "+a)});c(k,"$info",function ka(a){var c=ka.$$p||q;ka.$$p=null;null==a&&(a=q);return h(this,"add",[S("INFO"),q,a],c.$to_proc())},-1);c(k,"$debug",function u(a){var c=u.$$p||q;u.$$p=null;null==a&&(a=q);return h(this,"add",[S("DEBUG"),q,a],c.$to_proc())},-1);c(k,"$warn",function wa(a){var c=wa.$$p||q;wa.$$p=null;null==a&&(a=q);return h(this,"add",[S("WARN"),q,a],c.$to_proc())},-1);c(k,
|
|
692
|
-
"$error",function r(a){var c=r.$$p||q;r.$$p=null;null==a&&(a=q);return h(this,"add",[S("ERROR"),q,a],c.$to_proc())},-1);c(k,"$fatal",function pa(a){var c=pa.$$p||q;pa.$$p=null;null==a&&(a=q);return h(this,"add",[S("FATAL"),q,a],c.$to_proc())},-1);c(k,"$unknown",function Y(a){var c=Y.$$p||q;Y.$$p=null;null==a&&(a=q);return h(this,"add",[S("UNKNOWN"),q,a],c.$to_proc())},-1);c(k,"$info?",function(){return l(this.level,S("INFO"))});c(k,"$debug?",function(){return l(this.level,S("DEBUG"))});c(k,"$warn?",
|
|
693
|
-
function(){return l(this.level,S("WARN"))});c(k,"$error?",function(){return l(this.level,S("ERROR"))});c(k,"$fatal?",function(){return l(this.level,S("FATAL"))});return c(k,"$add",function na(c,b,d){var f=na.$$p||q,l=q;na.$$p=null;null==b&&(b=q);null==d&&(d=q);if(g(e(c=g(l=c)?l:S("UNKNOWN"),this.level)))return!0;d=g(l=d)?l:this.progname;g(b)||(f!==q?b=a.yieldX(f,[]):(b=d,d=this.progname));this.pipe.$write(this.formatter.$call(g(l=S("SEVERITY_LABELS")["$[]"](c))?l:"ANY",y("Time").$now(),d,b));return!0},
|
|
694
|
-
-2)}(n[0],null,n)};Opal.modules["asciidoctor/logging"]=function(a){var b=a.module,d=a.klass,f=a.slice,h=a.send2,c=a.find_super,p=a.to_a,m=a.send,g=a.def,l=a.truthy,e=a.rb_gt,n=a.const_set,q=a.hash2,y=a.eqeqeq,t=a.gvars,F=a.alias,x=a.defs,v=a.top,D=[],z=a.nil,B=a.$$$;a.add_stubs("require,attr_reader,progname=,formatter=,new,level=,>,[],===,inspect,to_h,map,constants,const_get,<<,clear,empty?,max,attr_accessor,memoize_logger,private,logger,extend,private_class_method,merge");v.$require("logger");return function(k,
|
|
695
|
-
u){k=[b(k,"Asciidoctor")].concat(u);(function(k,$super,u){k=d(k,$super,"Logger");u=[k].concat(u);var S=a.$r(u);k.$$prototype.max_severity=z;k.$attr_reader("max_severity");g(k,"$initialize",function na(a){var b,d=na.$$p||z;na.$$p=null;var e=f(arguments);h(this,c(this,"initialize",na,!1,!0),"initialize",p(e),d);this["$progname="]("asciidoctor");this["$formatter="](S("BasicFormatter").$new());return b=[S("WARN")],m(this,"level=",b),b[b.length-1]},-1);g(k,"$add",function aa(a,b,d){var f=aa.$$p||z,g=z;
|
|
696
|
-
aa.$$p=null;null==b&&(b=z);null==d&&(d=z);l(e(a=l(g=a)?g:S("UNKNOWN"),this.max_severity=l(g=this.max_severity)?g:a))&&(this.max_severity=a);return h(this,c(this,"add",aa,!1,!0),"add",[a,b,d],f)},-2);(function(c,$super,b){c=d(c,$super,"BasicFormatter");b=[c].concat(b);var e=a.$r(b);n(b[0],"SEVERITY_LABEL_SUBSTITUTES",q(["WARN","FATAL"],{WARN:"WARNING",FATAL:"FAILED"}));return g(c,"$call",function(a,c,b,d){c=z;return""+b+": "+(l(c=e("SEVERITY_LABEL_SUBSTITUTES")["$[]"](a))?c:a)+": "+(y(B("String"),
|
|
697
|
-
d)?d:d.$inspect())+e("LF")})})(u[0],S("Formatter"),u);return function(a){a=b(a,"AutoFormattingMessage");return g(a,"$inspect",function(){var a;return l(a=this["$[]"]("source_location"))?""+a+": "+this["$[]"]("text"):this["$[]"]("text")})}(u[0])})(k[0],B("Logger"),k);(function(c,$super,b){c=d(c,$super,"MemoryLogger");b=[c].concat(b);var e=a.$r(b);c.$$prototype.messages=z;n(b[0],"SEVERITY_SYMBOL_BY_VALUE",m(e("Severity").$constants(!1),"map",[],function(a){null==a&&(a=z);return[e("Severity").$const_get(a),
|
|
698
|
-
a]}).$to_h());c.$attr_reader("messages");g(c,"$initialize",function(){this["$level="](e("WARN"));return this.messages=[]});g(c,"$add",function Ba(c,b,d){var f=Ba.$$p||z,h=z;Ba.$$p=null;null==b&&(b=z);null==d&&(d=z);b=l(h=b)?h:f!==z?a.yieldX(f,[]):d;this.messages["$<<"](q(["severity","message"],{severity:e("SEVERITY_SYMBOL_BY_VALUE")["$[]"](l(h=c)?h:e("UNKNOWN")),message:b}));return!0},-2);g(c,"$clear",function(){return this.messages.$clear()});g(c,"$empty?",function(){return this.messages["$empty?"]()});
|
|
699
|
-
return g(c,"$max_severity",function(){return l(this["$empty?"]())?z:m(this.messages,"map",[],function(a){null==a&&(a=z);return e("Severity").$const_get(a["$[]"]("severity"))}).$max()})})(k[0],B("Logger"),k);(function(c,$super,b){c=d(c,$super,"NullLogger");b=[c].concat(b);var f=a.$r(b);c.$$prototype.max_severity=z;c.$attr_reader("max_severity");g(c,"$initialize",function(){var a;return a=[f("WARN")],m(this,"level=",a),a[a.length-1]});return g(c,"$add",function(a,c,b){c=z;l(e(a=l(c=a)?c:f("UNKNOWN"),
|
|
700
|
-
this.max_severity=l(c=this.max_severity)?c:a))&&(this.max_severity=a);return!0},-2)})(k[0],B("Logger"),k);(function(c,d){c=b(c,"LoggerManager");d=[c].concat(d);var e=a.$r(d);c.logger_class=e("Logger");return function(c,b){[c].concat(b);c.$attr_accessor("logger_class");g(c,"$logger",function(a){var c=z;null==this.logger&&(this.logger=z);null==this.logger_class&&(this.logger_class=z);null==t.stderr&&(t.stderr=z);null==a&&(a=t.stderr);this.$memoize_logger();return this.logger=l(c=this.logger)?c:this.logger_class.$new(a)},
|
|
701
|
-
-1);g(c,"$logger=",function(a){var c=z;null==this.logger_class&&(this.logger_class=z);null==t.stderr&&(t.stderr=z);return this.logger=l(c=a)?c:this.logger_class.$new(t.stderr)});c.$private();return g(c,"$memoize_logger",function(){var c=a.get_singleton_class(this);F(c,"logger","logger");return c.$attr_reader("logger")})}(a.get_singleton_class(c),d)})(k[0],k);return function(c,d){c=b(c,"Logging");d=[c].concat(d);var e=a.$r(d);x(c,"$included",function(a){return a.$extend(e("Logging"))});c.$private_class_method("included");
|
|
702
|
-
g(c,"$logger",function(){return e("LoggerManager").$logger()});return g(c,"$message_with_context",function(a,c){null==c&&(c=q([],{}));return q(["text"],{text:a}).$merge(c).$extend(B(e("Logger"),"AutoFormattingMessage"))},-2)}(k[0],k)}(D[0],D)};Opal.modules["asciidoctor/rx"]=function(a){var b=a.module,d=a.const_set,f=a.regexp,h=a.hash2,c=a.send,p=a.truthy,m=a.hash,g=[],l=a.nil,e=a.$$$;a.add_stubs("join,to_a,new,[]=,empty?,escape");return function(g,k){g=[b(g,"Asciidoctor")].concat(k);var n=a.$r(g);
|
|
703
|
-
b(g[0],"Rx");d(g[0],"AuthorInfoLineRx",f(["^(",n("CG_WORD"),"[",n("CC_WORD"),"\\-'.]*)(?: +(",n("CG_WORD"),"[",n("CC_WORD"),"\\-'.]*))?(?: +(",n("CG_WORD"),"[",n("CC_WORD"),"\\-'.]*))?(?: +<([^>]+)>)?$"]));d(g[0],"AuthorDelimiterRx",/;(?: |$)/);d(g[0],"RevisionInfoLineRx",f(["^(?:[^\\d{]*(",n("CC_ANY"),"*?),)? *(?!:)(",n("CC_ANY"),"*?)(?: *(?!^),?: *(",n("CC_ANY"),"*))?$"]));d(g[0],"ManpageTitleVolnumRx",f(["^(",n("CC_ANY"),"+?) *\\( *(",n("CC_ANY"),"+?) *\\)$"]));d(g[0],"ManpageNamePurposeRx",f(["^(",
|
|
704
|
-
n("CC_ANY"),"+?) +- +(",n("CC_ANY"),"+)$"]));d(g[0],"ConditionalDirectiveRx",f(["^(\\\\)?(ifdef|ifndef|ifeval|endif)::(\\S*?(?:([,+])\\S*?)?)\\[(",n("CC_ANY"),"+)?\\]$"]));d(g[0],"EvalExpressionRx",f(["^(",n("CC_ANY"),"+?) *([=!><]=|[><]) *(",n("CC_ANY"),"+)$"]));d(g[0],"IncludeDirectiveRx",f(["^(\\\\)?include::([^\\s\\[](?:[^\\[]*[^\\s\\[])?)\\[(",n("CC_ANY"),"+)?\\]$"]));d(g[0],"TagDirectiveRx",/\b(?:tag|(e)nd)::(\S+?)\[\](?=$|[ \r])/m);d(g[0],"AttributeEntryRx",f(["^:(!?",n("CG_WORD"),"[^:]*):(?:[ \\t]+(",
|
|
705
|
-
n("CC_ANY"),"*))?$"]));d(g[0],"InvalidAttributeNameCharsRx",f(["[^",n("CC_WORD"),"-]"]));d(g[0],"AttributeEntryPassMacroRx",f(["^pass:([a-z]+(?:,[a-z-]+)*)?\\[(",n("CC_ALL"),"*)\\]$"]));d(g[0],"AttributeReferenceRx",f(["(\\\\)?\\{(",n("CG_WORD"),"[",n("CC_WORD"),"-]*|(set|counter2?):",n("CC_ANY"),"+?)(\\\\)?\\}"]));d(g[0],"BlockAnchorRx",f(["^\\[\\[(?:|([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+))?)\\]\\]$"]));d(g[0],"BlockAttributeListRx",f(["^\\[(|[",n("CC_WORD"),".#%{,\"']",
|
|
706
|
-
n("CC_ANY"),"*)\\]$"]));d(g[0],"BlockAttributeLineRx",f(["^\\[(?:|[",n("CC_WORD"),".#%{,\"']",n("CC_ANY"),"*|\\[(?:|[",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*(?:, *",n("CC_ANY"),"+)?)\\])\\]$"]));d(g[0],"BlockTitleRx",f(["^\\.(\\.?[^ \\t.]",n("CC_ANY"),"*)$"]));d(g[0],"AdmonitionParagraphRx",f(["^(",n("ADMONITION_STYLES").$to_a().$join("|"),"):[ \\t]+"]));d(g[0],"LiteralParagraphRx",f(["^([ \\t]+",n("CC_ANY"),"*)$"]));d(g[0],"AtxSectionTitleRx",f(["^(=={0,5})[ \\t]+(",n("CC_ANY"),"+?)(?:[ \\t]+\\1)?$"]));
|
|
707
|
-
d(g[0],"ExtAtxSectionTitleRx",f(["^(=={0,5}|#\\#{0,5})[ \\t]+(",n("CC_ANY"),"+?)(?:[ \\t]+\\1)?$"]));d(g[0],"SetextSectionTitleRx",f(["^((?!\\.)",n("CC_ANY"),"*?",n("CG_ALNUM"),n("CC_ANY"),"*)$"]));d(g[0],"InlineSectionAnchorRx",f([" (\\\\)?\\[\\[([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+))?\\]\\]$"]));d(g[0],"InvalidSectionIdCharsRx",f(["<[^>]+>|&(?:[a-z][a-z]+\\d{0,2}|#\\d\\d\\d{0,4}|#x[\\da-f][\\da-f][\\da-f]{0,3});|[^ ",n("CC_WORD"),"\\-.]+?"]));d(g[0],"SectionLevelStyleRx",
|
|
708
|
-
/^sect\d$/);d(g[0],"AnyListRx",f(["^(?:[ \\t]*(?:-|\\*\\**|\\.\\.*|\\u2022|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))[ \\t]|(?!//[^/])[ \\t]*[^ \\t]",n("CC_ANY"),"*?(?::::{0,2}|;;)(?:$|[ \\t])|<(?:\\d+|\\.)>[ \\t])"]));d(g[0],"UnorderedListRx",f(["^[ \\t]*(-|\\*\\**|\\u2022)[ \\t]+(",n("CC_ANY"),"*)$"]));d(g[0],"OrderedListRx",f(["^[ \\t]*(\\.\\.*|\\d+\\.|[a-zA-Z]\\.|[IVXivx]+\\))[ \\t]+(",n("CC_ANY"),"*)$"]));d(g[0],"OrderedListMarkerRxMap",h(["arabic","loweralpha","lowerroman","upperalpha","upperroman"],
|
|
709
|
-
{arabic:/\d+\./,loweralpha:/[a-z]\./,lowerroman:/[ivx]+\)/,upperalpha:/[A-Z]\./,upperroman:/[IVX]+\)/}));d(g[0],"DescriptionListRx",f(["^(?!//[^/])[ \\t]*([^ \\t]",n("CC_ANY"),"*?)(:::{0,2}|;;)(?:$|[ \\t]+(",n("CC_ANY"),"*)$)"]));d(g[0],"DescriptionListSiblingRx",h(["::",":::","::::",";;"],{"::":f(["^(?!//[^/])[ \\t]*([^ \\t]",n("CC_ANY"),"*?[^:]|[^ \\t:])(::)(?:$|[ \\t]+(",n("CC_ANY"),"*)$)"]),":::":f(["^(?!//[^/])[ \\t]*([^ \\t]",n("CC_ANY"),"*?[^:]|[^ \\t:])(:::)(?:$|[ \\t]+(",n("CC_ANY"),"*)$)"]),
|
|
710
|
-
"::::":f(["^(?!//[^/])[ \\t]*([^ \\t]",n("CC_ANY"),"*?[^:]|[^ \\t:])(::::)(?:$|[ \\t]+(",n("CC_ANY"),"*)$)"]),";;":f(["^(?!//[^/])[ \\t]*([^ \\t]",n("CC_ANY"),"*?)(;;)(?:$|[ \\t]+(",n("CC_ANY"),"*)$)"])}));d(g[0],"CalloutListRx",f(["^<(\\d+|\\.)>[ \\t]+(",n("CC_ANY"),"*)$"]));d(g[0],"CalloutExtractRx",/((?:\/\/|#|--|;;) ?)?(\\)?<!?(|--)(\d+|\.)\3>(?=(?: ?\\?<!?\3(?:\d+|\.)\3>)*$)/);d(g[0],"CalloutExtractRxt","(\\\\)?<()(\\d+|\\.)>(?=(?: ?\\\\?<(?:\\d+|\\.)>)*$)");d(g[0],"CalloutExtractRxMap",c(e("Hash"),
|
|
711
|
-
"new",[],function(a,b){var d;null==a&&(a=l);null==b&&(b=l);return d=[b,f(["(",p(b["$empty?"]())?"":""+e("Regexp").$escape(b)+" ?",")?",n("CalloutExtractRxt")])],c(a,"[]=",d),d[d.length-1]}));d(g[0],"CalloutScanRx",f(["\\\\?<!?(|--)(\\d+|\\.)\\1>(?=(?: ?\\\\?<!?\\1(?:\\d+|\\.)\\1>)*",n("CC_EOL"),")"]));d(g[0],"CalloutSourceRx",f(["((?://|#|--|;;) ?)?(\\\\)?<!?(|--)(\\d+|\\.)\\3>(?=(?: ?\\\\?<!?\\3(?:\\d+|\\.)\\3>)*",n("CC_EOL"),")"]));d(g[0],"CalloutSourceRxt","(\\\\)?<()(\\d+|\\.)>(?=(?: ?\\\\?<(?:\\d+|\\.)>)*"+
|
|
712
|
-
n("CC_EOL")+")");d(g[0],"CalloutSourceRxMap",c(e("Hash"),"new",[],function(a,b){var d;null==a&&(a=l);null==b&&(b=l);return d=[b,f(["(",p(b["$empty?"]())?"":""+e("Regexp").$escape(b)+" ?",")?",n("CalloutSourceRxt")])],c(a,"[]=",d),d[d.length-1]}));d(g[0],"ListRxMap",h(["ulist","olist","dlist","colist"],{ulist:n("UnorderedListRx"),olist:n("OrderedListRx"),dlist:n("DescriptionListRx"),colist:n("CalloutListRx")}));d(g[0],"ColumnSpecRx",/^(?:(\d+)\*)?([<^>](?:\.[<^>]?)?|(?:[<^>]?\.)?[<^>])?(\d+%?|~)?([a-z])?$/);
|
|
713
|
-
d(g[0],"CellSpecStartRx",/^[ \t]*(?:(\d+(?:\.\d*)?|(?:\d*\.)?\d+)([*+]))?([<^>](?:\.[<^>]?)?|(?:[<^>]?\.)?[<^>])?([a-z])?$/);d(g[0],"CellSpecEndRx",/[ \t]+(?:(\d+(?:\.\d*)?|(?:\d*\.)?\d+)([*+]))?([<^>](?:\.[<^>]?)?|(?:[<^>]?\.)?[<^>])?([a-z])?$/);d(g[0],"CustomBlockMacroRx",f(["^(",n("CG_WORD"),"[",n("CC_WORD"),"-]*)::(|\\S|\\S",n("CC_ANY"),"*?\\S)\\[(",n("CC_ANY"),"+)?\\]$"]));d(g[0],"BlockMediaMacroRx",f(["^(image|video|audio)::(\\S|\\S",n("CC_ANY"),"*?\\S)\\[(",n("CC_ANY"),"+)?\\]$"]));d(g[0],
|
|
714
|
-
"BlockTocMacroRx",f(["^toc::\\[(",n("CC_ANY"),"+)?\\]$"]));d(g[0],"InlineAnchorRx",f(["(\\\\)?(?:\\[\\[([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+?))?\\]\\]|anchor:([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)\\[(?:\\]|(",n("CC_ANY"),"*?[^\\\\])\\]))"]));d(g[0],"InlineAnchorScanRx",f(["(?:^|[^\\\\\\[])\\[\\[([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+?))?\\]\\]|(?:^|[^\\\\])anchor:([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)\\[(?:\\]|(",n("CC_ANY"),
|
|
715
|
-
"*?[^\\\\])\\])"]));d(g[0],"LeadingInlineAnchorRx",f(["^\\[\\[([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+?))?\\]\\]"]));d(g[0],"InlineBiblioAnchorRx",f(["^\\[\\[\\[([",n("CC_ALPHA"),"_:][",n("CC_WORD"),"\\-:.]*)(?:, *(",n("CC_ANY"),"+?))?\\]\\]\\]"]));d(g[0],"InlineEmailRx",f(["([\\\\>:/])?",n("CG_WORD"),"(?:&|[",n("CC_WORD"),"\\-.%+])*@",n("CG_ALNUM"),"[",n("CC_ALNUM"),"_\\-.]*\\.[a-zA-Z]{2,5}\\b"]));d(g[0],"InlineFootnoteMacroRx",f(["\\\\?footnote(?:(ref):|:([",n("CC_WORD"),
|
|
716
|
-
"-]+)?)\\[(?:|(",n("CC_ALL"),"*?[^\\\\]))\\](?!</a>)"],"m"));d(g[0],"InlineImageMacroRx",f(["\\\\?i(?:mage|con):([^:\\s\\[](?:[^\\n\\[]*[^\\s\\[])?)\\[(|",n("CC_ALL"),"*?[^\\\\])\\]"],"m"));d(g[0],"InlineIndextermMacroRx",f(["\\\\?(?:(indexterm2?):\\[(",n("CC_ALL"),"*?[^\\\\])\\]|\\(\\((",n("CC_ALL"),"+?)\\)\\)(?!\\)))"],"m"));d(g[0],"InlineKbdBtnMacroRx",f(["(\\\\)?(kbd|btn):\\[(",n("CC_ALL"),"*?[^\\\\])\\]"],"m"));d(g[0],"InlineLinkRx",f(["(^|link:|",n("CG_BLANK"),"|<|[>\\(\\)\\[\\];\"'])(\\\\?(?:https?|file|ftp|irc)://)(?:([^\\s\\[\\]]+)\\[(|",
|
|
717
|
-
n("CC_ALL"),"*?[^\\\\])\\]|([^\\s\\[\\]<]*([^\\s,.?!\\[\\]<\\)])))"],"m"));d(g[0],"InlineLinkMacroRx",f(["\\\\?(?:link|(mailto)):(|[^:\\s\\[][^\\s\\[]*)\\[(|",n("CC_ALL"),"*?[^\\\\])\\]"],"m"));d(g[0],"MacroNameRx",f(["^",n("CG_WORD"),"[",n("CC_WORD"),"-]*$"]));d(g[0],"InlineStemMacroRx",f(["\\\\?(stem|(?:latex|ascii)math):([a-z]+(?:,[a-z-]+)*)?\\[(",n("CC_ALL"),"*?[^\\\\])\\]"],"m"));d(g[0],"InlineMenuMacroRx",f(["\\\\?menu:(",n("CG_WORD"),"|[",n("CC_WORD"),"&][^\\n\\[]*[^\\s\\[])\\[ *(?:|(",n("CC_ALL"),
|
|
718
|
-
"*?[^\\\\]))\\]"],"m"));d(g[0],"InlineMenuRx",f(['\\\\?"([',n("CC_WORD"),'&][^"]*?[ \\n]+>[ \\n]+[^"]*)"']));d(g[0],"InlinePassRx",m(!1,["+","-]",f(["((?:^|[^",n("CC_WORD"),";:\\\\])(?=(\\[)|\\+)|\\\\(?=\\[)|(?=\\\\\\+))(?:\\2(x-|[^\\]]+ x-)\\]|(?:\\[([^\\]]+)\\])?(?=(\\\\)?\\+))(\\5?(\\+|`)(\\S|\\S",n("CC_ALL"),"*?\\S)\\7)(?!",n("CG_WORD"),")"],"m")],!0,["`",l,f(["(^|[^`",n("CC_WORD"),"])(?:(\\Z)()|\\[([^\\]]+)\\](?=(\\\\))?)?(\\5?(`)([^`\\s]|[^`\\s]",n("CC_ALL"),"*?\\S)\\7)(?![`",n("CC_WORD"),
|
|
719
|
-
"])"],"m")]));d(g[0],"InlinePassMacroRx",f(["(?:(?:(\\\\?)\\[([^\\]]+)\\])?(\\\\{0,2})(\\+\\+\\+?|\\$\\$)(",n("CC_ALL"),"*?)\\4|(\\\\?)pass:([a-z]+(?:,[a-z-]+)*)?\\[(|",n("CC_ALL"),"*?[^\\\\])\\])"],"m"));d(g[0],"InlineXrefMacroRx",f(["\\\\?(?:<<([",n("CC_WORD"),"#/.:{]",n("CC_ALL"),"*?)>>|xref:([",n("CC_WORD"),"#/.:{]",n("CC_ALL"),"*?)\\[(?:\\]|(",n("CC_ALL"),"*?[^\\\\])\\]))"],"m"));d(g[0],"HardLineBreakRx",f(["^(",n("CC_ANY"),"*) \\+$"],"m"));d(g[0],"MarkdownThematicBreakRx",/^ {0,3}([-*_])( *)\1\2\1$/);
|
|
720
|
-
d(g[0],"ExtLayoutBreakRx",/^(?:'{3,}|<{3,}|([-*_])( *)\1\2\1)$/);d(g[0],"BlankLineRx",/\n{2,}/);d(g[0],"EscapedSpaceRx",/\\([ \t\n])/);d(g[0],"ReplaceableTextRx",/[&']|--|\.\.\.|\([CRT]M?\)/);d(g[0],"SpaceDelimiterRx",/([^\\])[ \t\n]+/);d(g[0],"SubModifierSniffRx",/[+-]/);d(g[0],"TrailingDigitsRx",/\d+$/);d(g[0],"UriSniffRx",f(["^",n("CG_ALPHA"),"[",n("CC_ALNUM"),".+-]+:/{0,2}"]));return d(g[0],"XmlSanitizeRx",/<[^>]+>/)}(g[0],g)};Opal.modules["asciidoctor/substitutors"]=function(a){var b=a.module,
|
|
721
|
-
d=a.const_set,f=a.hash2,h=a.hash,c=a.rb_plus,p=a.regexp,n=a.not,g=a.truthy,l=a.send,e=a.def,m=a.alias,q=a.gvars,y=a.eqeq,t=a.to_ary,F=a.neqeq,x=a.to_a,v=a.eqeqeq,z=a.rb_gt,D=a.slice,B=a.rb_minus,A=a.rb_lt,u=a.rb_times,E=[],r=a.nil,G=a.$$$;a.add_stubs("freeze,+,keys,!,empty?,===,[],join,include?,extract_passthroughs,each,sub_specialchars,sub_quotes,sub_attributes,sub_replacements,sub_macros,highlight_source,sub_callouts,sub_post_replacements,warn,logger,restore_passthroughs,clear,split,apply_subs,gsub,match?,compat_mode,convert_quoted_text,attributes,==,shift,store_attribute,!=,attribute_undefined,counter,key?,downcase,attribute_missing,info,squeeze,delete,reject,start_with?,do_replacement,inline_macros?,extensions,inline_macros,regexp,instance,slice,length,names,config,merge,[]=,normalize_text,parse_attributes,process_method,expand_subs,text=,text,convert,class,strip,index,min,compact,>,end_with?,map,chop,new,pop,rstrip,register,tr,basename,parse,lstrip,split_simple_csv,-,partition,extract_attributes_from_text,sub,encode_uri_component,style,extname?,rindex,catalog,info?,fetch,outfilesuffix,natural_xrefs,resolve_id,find,footnotes,id,<,size,<<,attr?,attr,to_s,read_next_id,callouts,highlight?,syntax_highlighter,sub_source,extract_callouts,name,to_i,to_sym,resolve_lines_to_highlight,highlight,nil_or_empty?,restore_callouts,count,to_a,|,sort,*,parse_quoted_text_attributes,resolve_pass_subs,basebackend?,error,chr,drop,&,resolve_subs,resolve_block_subs,parse_into,private,shorthand_property_syntax,each_char");
|
|
722
|
-
return function(k,C){k=[b(k,"Asciidoctor")].concat(C);return function(k,C){k=b(k,"Substitutors");C=[k].concat(C);var w=a.$r(C);d(C[0],"SpecialCharsRx",/[<&>]/);d(C[0],"SpecialCharsTr",f([">","<","&"],{">":">","<":"<","&":"&"}));d(C[0],"QuotedTextSniffRx",h(!1,/[*_`#^~]/,!0,/[*'_+#^~]/));d(C[0],"BASIC_SUBS",["specialcharacters"]).$freeze();d(C[0],"HEADER_SUBS",["specialcharacters","attributes"]).$freeze();d(C[0],"NO_SUBS",[]).$freeze();d(C[0],"NORMAL_SUBS","specialcharacters quotes attributes replacements macros post_replacements".split(" ")).$freeze();
|
|
723
|
-
d(C[0],"REFTEXT_SUBS",["specialcharacters","quotes","replacements"]).$freeze();d(C[0],"VERBATIM_SUBS",["specialcharacters","callouts"]).$freeze();d(C[0],"SUB_GROUPS",f(["none","normal","verbatim","specialchars"],{none:w("NO_SUBS"),normal:w("NORMAL_SUBS"),verbatim:w("VERBATIM_SUBS"),specialchars:w("BASIC_SUBS")}));d(C[0],"SUB_HINTS",f("amnpqrcv".split(""),{a:"attributes",m:"macros",n:"normal",p:"post_replacements",q:"quotes",r:"replacements",c:"specialcharacters",v:"verbatim"}));d(C[0],"SUB_OPTIONS",
|
|
724
|
-
f(["block","inline"],{block:c(c(w("SUB_GROUPS").$keys(),w("NORMAL_SUBS")),["callouts"]),inline:c(w("SUB_GROUPS").$keys(),w("NORMAL_SUBS"))}));d(C[0],"CAN","\u0018");d(C[0],"DEL","\u007f");d(C[0],"PASS_START","\u0096");d(C[0],"PASS_END","\u0097");d(C[0],"PassSlotRx",p([w("PASS_START"),"(\\d+)",w("PASS_END")]));d(C[0],"HighlightedPassSlotRx",p(["<span\\b[^>]*>",w("PASS_START"),"</span>[^\\d]*(\\d+)[^\\d]*<span\\b[^>]*>",w("PASS_END"),"</span>"]));d(C[0],"RS","\\");d(C[0],"R_SB","]");d(C[0],"ESC_R_SB",
|
|
725
|
-
"\\]");d(C[0],"PLUS","+");e(k,"$apply_subs",function(a,c){var b=r,d=r,e=r,f=r;null==this.passthroughs&&(this.passthroughs=r);null==this.passthroughs_locked&&(this.passthroughs_locked=r);null==c&&(c=w("NORMAL_SUBS"));if(g(a["$empty?"]())||n(c))return a;g(b=G("Array")["$==="](a))&&(a=g(a["$[]"](1))?a.$join(w("LF")):a["$[]"](0));g(c["$include?"]("macros"))&&(a=this.$extract_passthroughs(a),g(this.passthroughs["$empty?"]())||(d=this.passthroughs,this.passthroughs_locked=g(e=this.passthroughs_locked)?
|
|
726
|
-
e:f=!0));l(c,"each",[],function X(b){var d=null==X.$$s?this:X.$$s;null==b&&(b=r);switch(b){case "specialcharacters":return a=d.$sub_specialchars(a);case "quotes":return a=d.$sub_quotes(a);case "attributes":return g(a["$include?"](w("ATTR_REF_HEAD")))?a=d.$sub_attributes(a):r;case "replacements":return a=d.$sub_replacements(a);case "macros":return a=d.$sub_macros(a);case "highlight":return a=d.$highlight_source(a,c["$include?"]("callouts"));case "callouts":return g(c["$include?"]("highlight"))?r:a=
|
|
727
|
-
d.$sub_callouts(a);case "post_replacements":return a=d.$sub_post_replacements(a);default:return d.$logger().$warn("unknown substitution type "+b)}},{$$s:this});g(d)&&(a=this.$restore_passthroughs(a),g(f)&&(d.$clear(),this.passthroughs_locked=r));return g(b)?a.$split(w("LF"),-1):a},-2);e(k,"$apply_normal_subs",function(a){return this.$apply_subs(a,w("NORMAL_SUBS"))});e(k,"$apply_header_subs",function(a){return this.$apply_subs(a,w("HEADER_SUBS"))});m(k,"apply_title_subs","apply_subs");e(k,"$apply_reftext_subs",
|
|
728
|
-
function(a){return this.$apply_subs(a,w("REFTEXT_SUBS"))});e(k,"$sub_specialchars",function(a){return g(a["$include?"](">"))||g(a["$include?"]("&"))||g(a["$include?"]("<"))?a.$gsub(w("SpecialCharsRx"),w("SpecialCharsTr")):a});m(k,"sub_specialcharacters","sub_specialchars");e(k,"$sub_quotes",function(a){var c=r;null==this.document&&(this.document=r);g(w("QuotedTextSniffRx")["$[]"](c=this.document.$compat_mode())["$match?"](a))&&l(w("QUOTE_SUBS")["$[]"](c),"each",[],function da(c,b,d){var e=null==da.$$s?
|
|
729
|
-
this:da.$$s;null==c&&(c=r);null==b&&(b=r);null==d&&(d=r);return a=l(a,"gsub",[d],function V(){var a=null==V.$$s?this:V.$$s;null==q["~"]&&(q["~"]=r);return a.$convert_quoted_text(q["~"],c,b)},{$$s:e})},{$$s:this});return a});e(k,"$sub_attributes",function(a,c){var b=r,d=r,e=r,h=r,p=r,Q=r,k=r,n=r;null==this.document&&(this.document=r);null==c&&(c=f([],{}));b=this.document.$attributes();d=e=h=p=Q=k=r;a=l(a,"gsub",[w("AttributeReferenceRx")],function fa(){var a;var f=null==fa.$$s?this:fa.$$s;var X=r,
|
|
730
|
-
n=r,V=X=r,m=r,u=r;null==f.document&&(f.document=r);if(y((a=q["~"])===r?r:a["$[]"](1),w("RS"))||y((a=q["~"])===r?r:a["$[]"](4),w("RS")))return"{"+((a=q["~"])===r?r:a["$[]"](2))+"}";if(g((a=q["~"])===r?r:a["$[]"](3)))switch((X=((a=q["~"])===r?r:a["$[]"](2)).$split(":",3)).$shift()){case "set":return f=w("Parser").$store_attribute(X["$[]"](0),g(n=X["$[]"](1))?n:"",f.document),a=t(f),X=null==a[1]?r:a[1],f,g(X)||F(Q=g(n=Q)?n:g(V=b["$[]"]("attribute-undefined"))?V:w("Compliance").$attribute_undefined(),
|
|
731
|
-
"drop-line")?d=p=w("DEL"):d=e=w("CAN");case "counter2":return l(f.document,"counter",x(X)),d=p=w("DEL");default:return l(f.document,"counter",x(X))}else{if(g(b["$key?"](m=((a=q["~"])===r?r:a["$[]"](2)).$downcase())))return b["$[]"](m);if(g(X=w("INTRINSIC_ATTRIBUTES")["$[]"](m)))return X;switch(k=g(n=k)?n:g(V=g(u=c["$[]"]("attribute_missing"))?u:b["$[]"]("attribute-missing"))?V:w("Compliance").$attribute_missing()){case "drop":return d=p=w("DEL");case "drop-line":return y(h=g(n=h)?n:g(V=c["$[]"]("drop_line_severity"))?
|
|
732
|
-
V:"info","info")&&l(f.$logger(),"info",[],function(){return"dropping line containing reference to missing attribute: "+m}),d=e=w("CAN");case "warn":return f.$logger().$warn("skipping reference to missing attribute: "+m),(a=q["~"])===r?r:a["$[]"](0);default:return(a=q["~"])===r?r:a["$[]"](0)}}},{$$s:this});return g(d)?g(p)?(n=a.$squeeze(w("DEL")).$split(w("LF"),-1),g(e)?l(n,"reject",[],function(a){var c,b=r,d=r;null==a&&(a=r);return g(c=g(b=g(d=a["$=="](w("DEL")))?d:a["$=="](w("CAN")))?b:a["$start_with?"](w("CAN")))?
|
|
733
|
-
c:a["$include?"](w("CAN"))}).$join(w("LF")).$delete(w("DEL")):l(n,"reject",[],function(a){null==a&&(a=r);return a["$=="](w("DEL"))}).$join(w("LF")).$delete(w("DEL"))):g(a["$include?"](w("LF")))?l(a.$split(w("LF"),-1),"reject",[],function(a){var c,b=r;null==a&&(a=r);return g(c=g(b=a["$=="](w("CAN")))?b:a["$start_with?"](w("CAN")))?c:a["$include?"](w("CAN"))}).$join(w("LF")):"":a},-2);e(k,"$sub_replacements",function(a){g(w("ReplaceableTextRx")["$match?"](a))&&l(w("REPLACEMENTS"),"each",[],function xa(c,
|
|
734
|
-
b,d){var e=null==xa.$$s?this:xa.$$s;null==c&&(c=r);null==b&&(b=r);null==d&&(d=r);return a=l(a,"gsub",[c],function X(){var a=null==X.$$s?this:X.$$s;null==q["~"]&&(q["~"]=r);return a.$do_replacement(q["~"],b,d)},{$$s:e})},{$$s:this});return a});e(k,"$sub_macros",function(b){var d=r,e=r,h=r,p=r,k=r,m=r,Q=r,X=r;null==this.document&&(this.document=r);null==this.parent&&(this.parent=r);null==this.context&&(this.context=r);d=b["$include?"]("[");e=b["$include?"](":");h=g(p=d)?e:p;k=g(p=h)?b["$include?"](":["):
|
|
735
|
-
p;m=(Q=this.document).$attributes();g(X=Q.$extensions())&&g(X["$inline_macros?"]())&&l(X.$inline_macros(),"each",[],function fa(c){var d=null==fa.$$s?this:fa.$$s;null==c&&(c=r);return b=l(b,"gsub",[c.$instance().$regexp()],function ia(){var b,d,e=null==ia.$$s?this:ia.$$s,h=r,Q=r,k=r,X=r,n=r,m=r,u=r,da=r,C=r;null==q["~"]&&(q["~"]=r);if(g((h=(b=q["~"])===r?r:b["$[]"](0))["$start_with?"](w("RS"))))return((b=q["~"])===r?r:b["$[]"](0)).$slice(1,((b=q["~"])===r?r:b["$[]"](0)).$length());if(g(q["~"].$names()["$empty?"]()))b=
|
|
736
|
-
[(d=q["~"])===r?r:d["$[]"](1),(d=q["~"])===r?r:d["$[]"](2)];else{a:{try{var aa=q["~"]["$[]"]("target");break a}catch(Fa){if(a.rescue(Fa,[w("StandardError")]))try{aa=r;break a}finally{a.pop_exception()}else throw Fa;}aa=void 0}b=aa;a:{try{var fa=q["~"]["$[]"]("content");break a}catch(Fa){if(a.rescue(Fa,[w("StandardError")]))try{fa=r;break a}finally{a.pop_exception()}else throw Fa;}fa=void 0}b=[b,fa]}Q=b[0];k=b[1];b;X=g(n=(m=c.$config())["$[]"]("default_attrs"))?n.$merge():f([],{});if(g(k)){if(g(k["$empty?"]())){if(!y(m["$[]"]("content_model"),
|
|
737
|
-
"attributes"))X["$[]="]("text",k)}else if(k=e.$normalize_text(k,!0,!0),y(m["$[]"]("content_model"),"attributes"))e.$parse_attributes(k,g(p=g(u=m["$[]"]("positional_attrs"))?u:m["$[]"]("pos_attrs"))?p:[],f(["into"],{into:X}));else X["$[]="]("text",k);Q=g(p=Q)?p:y(m["$[]"]("format"),"short")?k:Q}if(v(w("Inline"),da=c.$process_method()["$[]"](e,Q,X))){if(g(C=da.$attributes().$delete("subs"))&&g(C=e.$expand_subs(C,"custom inline macro")))da["$text="](e.$apply_subs(da.$text(),C));return da.$convert()}return g(da)?
|
|
738
|
-
(l(e.$logger(),"info",[],function(){return"expected substitution value for custom inline macro to be of type Inline; got "+da.$class()+": "+h}),da):""},{$$s:d})},{$$s:this});g(m["$key?"]("experimental"))&&(g(k)&&(g(b["$include?"]("kbd:"))||g(b["$include?"]("btn:")))&&(b=l(b,"gsub",[w("InlineKbdBtnMacroRx")],function fa(){var a,b=null==fa.$$s?this:fa.$$s,d=r,e=r,h=r;return g((a=q["~"])===r?r:a["$[]"](1))?((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length()):y((a=q["~"])===
|
|
739
|
-
r?r:a["$[]"](2),"kbd")?(g((d=((a=q["~"])===r?r:a["$[]"](3)).$strip())["$include?"](w("R_SB")))&&(d=d.$gsub(w("ESC_R_SB"),w("R_SB"))),g(z(d.$length(),1))&&g(e=g(e=d.$index(",",1))?[e,d.$index("+",1)].$compact().$min():d.$index("+",1))?(h=d.$slice(e,1),g(d["$end_with?"](h))?(d=l(d.$chop().$split(h,-1),"map",[],function(a){null==a&&(a=r);return a.$strip()}),d["$[]="](-1,c(d["$[]"](-1),h))):d=l(d.$split(h),"map",[],function(a){null==a&&(a=r);return a.$strip()})):d=[d],w("Inline").$new(b,"kbd",r,f(["attributes"],
|
|
740
|
-
{attributes:f(["keys"],{keys:d})})).$convert()):w("Inline").$new(b,"button",b.$normalize_text((a=q["~"])===r?r:a["$[]"](3),!0,!0)).$convert()},{$$s:this})),g(h)&&g(b["$include?"]("menu:"))&&(b=l(b,"gsub",[w("InlineMenuMacroRx")],function ma(){var a,c=null==ma.$$s?this:ma.$$s,b=r,d=r,e=r;e=d=r;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());b=(a=q["~"])===r?r:a["$[]"](1);g(d=(a=q["~"])===r?r:a["$[]"](2))?
|
|
741
|
-
(g(d["$include?"](w("R_SB")))&&(d=d.$gsub(w("ESC_R_SB"),w("R_SB"))),g(e=g(d["$include?"](">"))?">":g(d["$include?"](","))?",":r)?(d=l(d.$split(e),"map",[],function(a){null==a&&(a=r);return a.$strip()}),e=d.$pop()):(a=[[],d.$rstrip()],d=a[0],e=a[1],a)):(a=[[],r],d=a[0],e=a[1],a);return w("Inline").$new(c,"menu",r,f(["attributes"],{attributes:f(["menu","submenus","menuitem"],{menu:b,submenus:d,menuitem:e})})).$convert()},{$$s:this})),g(b["$include?"]('"'))&&g(b["$include?"](">"))&&(b=l(b,"gsub",
|
|
742
|
-
[w("InlineMenuRx")],function oa(){var a,c,b=null==oa.$$s?this:oa.$$s,d=r,e=r;var h=r;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());h=l(((c=q["~"])===r?r:c["$[]"](1)).$split(">"),"map",[],function(a){null==a&&(a=r);return a.$strip()});a=t(h);d=null==a[0]?r:a[0];e=D(a,1);h;h=e.$pop();return w("Inline").$new(b,"menu",r,f(["attributes"],{attributes:f(["menu","submenus","menuitem"],{menu:d,submenus:e,
|
|
743
|
-
menuitem:h})})).$convert()},{$$s:this})));g(h)&&(g(b["$include?"]("image:"))||g(b["$include?"]("icon:")))&&(b=l(b,"gsub",[w("InlineImageMacroRx")],function fa(){var a,c=null==fa.$$s?this:fa.$$s,b,d;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"]("icon:"))?(a=["icon",["size"]],b=a[0],d=a[1]):(a=["image",["alt","width","height"]],b=a[0],d=a[1]);a;var e=
|
|
744
|
-
(a=q["~"])===r?r:a["$[]"](1);d=c.$parse_attributes((a=q["~"])===r?r:a["$[]"](2),d,f(["unescape_input"],{unescape_input:!0}));y(b,"icon")||(Q.$register("images",e),d["$[]="]("imagesdir",m["$[]"]("imagesdir")));if(g(p=d["$[]"]("alt")))p;else d["$[]="]("alt",(a=["default-alt",w("Helpers").$basename(e,!0).$tr("_-"," ")],l(d,"[]=",a),a[a.length-1]));return w("Inline").$new(c,"image",r,f(["type","target","attributes"],{type:b,target:e,attributes:d})).$convert()},{$$s:this}));if(g(b["$include?"]("(("))&&
|
|
745
|
-
g(b["$include?"]("))"))||g(k)&&g(b["$include?"]("dexterm")))b=l(b,"gsub",[w("InlineIndextermMacroRx")],function ma(){var a,c,b=null==ma.$$s?this:ma.$$s,d=r,e=r,h=r,Q=d=r,p=c=r,k=r,X=e=Q=r;Q=k=k=r;switch((a=q["~"])===r?r:a["$[]"](1)){case "indexterm":if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());if(g((d=b.$normalize_text((a=q["~"])===r?r:a["$[]"](2),!0,!0))["$include?"]("=")))if(g(e=(h=w("AttributeList").$new(d,
|
|
746
|
-
b).$parse())["$[]"](1))){if(h["$[]="]("terms",[e]),g(d=h["$[]"]("see-also")))h["$[]="]("see-also",g(d["$include?"](","))?l(d.$split(","),"map",[],function(a){null==a&&(a=r);return a.$lstrip()}):[d])}else h=f(["terms"],{terms:d});else h=f(["terms"],{terms:b.$split_simple_csv(d)});return w("Inline").$new(b,"indexterm",r,f(["attributes"],{attributes:h})).$convert();case "indexterm2":if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===
|
|
747
|
-
r?r:a["$[]"](0)).$length());if(g((Q=b.$normalize_text((a=q["~"])===r?r:a["$[]"](2),!0,!0))["$include?"]("="))&&(Q=g(c=g(p=(h=w("AttributeList").$new(Q,b).$parse())["$[]"](1))?p:h=r)?c:Q,g(h)&&g(d=h["$[]"]("see-also"))))h["$[]="]("see-also",g(d["$include?"](","))?l(d.$split(","),"map",[],function(a){null==a&&(a=r);return a.$lstrip()}):[d]);return w("Inline").$new(b,"indexterm",Q,f(["attributes","type"],{attributes:h,type:"visible"})).$convert();default:k=(a=q["~"])===r?r:a["$[]"](3);if(g(((a=q["~"])===
|
|
748
|
-
r?r:a["$[]"](0))["$start_with?"](w("RS"))))if(g(k["$start_with?"]("("))&&g(k["$end_with?"](")")))k=k.$slice(1,B(k.$length(),2)),a=[!0,"(",")"],Q=a[0],e=a[1],X=a[2],a;else return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());else Q=!0,g(k["$start_with?"]("("))?(g(k["$end_with?"](")"))?(a=[k.$slice(1,B(k.$length(),2)),!1],k=a[0],Q=a[1]):(a=[k.$slice(1,k.$length()),"(",""],k=a[0],e=a[1],X=a[2]),a):g(k["$end_with?"](")"))&&(a=[k.$chop(),"",")"],k=a[0],e=a[1],X=a[2],
|
|
749
|
-
a);g(Q)?(g((Q=b.$normalize_text(k,!0))["$include?"](";&"))&&(g(Q["$include?"](" >> "))?(c=Q.$partition(" >> "),a=t(c),Q=null==a[0]?r:a[0],k=null==a[2]?r:a[2],c,h=f(["see"],{see:k})):g(Q["$include?"](" &> "))&&(c=Q.$split(" &> "),a=t(c),Q=null==a[0]?r:a[0],d=D(a,1),c,h=f(["see-also"],{"see-also":d}))),k=w("Inline").$new(b,"indexterm",Q,f(["attributes","type"],{attributes:h,type:"visible"})).$convert()):(h=f([],{}),g((Q=b.$normalize_text(k,!0))["$include?"](";&"))&&(g(Q["$include?"](" >> "))?
|
|
750
|
-
(c=Q.$partition(" >> "),a=t(c),Q=null==a[0]?r:a[0],k=null==a[2]?r:a[2],c,h["$[]="]("see",k)):g(Q["$include?"](" &> "))&&(c=Q.$split(" &> "),a=t(c),Q=null==a[0]?r:a[0],d=D(a,1),c,h["$[]="]("see-also",d))),h["$[]="]("terms",b.$split_simple_csv(Q)),k=w("Inline").$new(b,"indexterm",r,f(["attributes"],{attributes:h})).$convert());return g(e)?""+e+k+X:k}},{$$s:this});g(e)&&g(b["$include?"]("://"))&&(b=l(b,"gsub",[w("InlineLinkRx")],function ma(){var a,b,d=null==ma.$$s?this:ma.$$s,e,
|
|
751
|
-
h=r,k=r,X=r,u=r;if(g((e=c((a=q["~"])===r?r:a["$[]"](2),g(p=(a=q["~"])===r?r:a["$[]"](3))?p:(a=q["~"])===r?r:a["$[]"](5)))["$start_with?"](w("RS"))))return c(((a=q["~"])===r?r:a["$[]"](0)).$slice(0,h=((a=q["~"])===r?r:a["$[]"](1)).$length()),((a=q["~"])===r?r:a["$[]"](0)).$slice(c(h,1),((a=q["~"])===r?r:a["$[]"](0)).$length()));a=[(b=q["~"])===r?r:b["$[]"](1),""];h=a[0];var da=a[1];a;if(g((a=q["~"])===r?r:a["$[]"](4)))y(h,"link:")&&(h=""),g((k=(a=q["~"])===r?r:a["$[]"](4))["$empty?"]())&&(k=r);else{switch(h){case "link:":case '"':case "'":return(a=
|
|
752
|
-
q["~"])===r?r:a["$[]"](0);default:r}switch((a=q["~"])===r?r:a["$[]"](6)){case ";":g(h["$start_with?"]("<"))&&g(e["$end_with?"](">"))?(h=h.$slice(4,h.$length()),e=e.$slice(0,B(e.$length(),4))):g((e=e.$chop())["$end_with?"](")"))?(e=e.$chop(),da=");"):da=";";if(g(e["$end_with?"]("://")))return(a=q["~"])===r?r:a["$[]"](0);break;case ":":g((e=e.$chop())["$end_with?"](")"))?(e=e.$chop(),da="):"):da=":";if(g(e["$end_with?"]("://")))return(a=q["~"])===r?r:a["$[]"](0);break;default:r}}a=[r,f(["type"],
|
|
753
|
-
{type:"link"})];var C=a[0];var aa=a[1];a;if(g(k)){g(k["$include?"](w("R_SB")))&&(X=k=k.$gsub(w("ESC_R_SB"),w("R_SB")));n(Q.$compat_mode())&&g(k["$include?"]("="))&&(b=d.$extract_attributes_from_text(k,""),a=t(b),k=null==a[0]?r:a[0],C=null==a[1]?r:a[1],b,X=k,aa["$[]="]("id",C["$[]"]("id")));if(g(k["$end_with?"]("^")))if(X=k=k.$chop(),g(C))if(g(p=C["$[]"]("window")))p;else C["$[]="]("window","_blank");else C=f(["window"],{window:"_blank"});g(X)&&g(X["$empty?"]())&&(k=g(m["$key?"]("hide-uri-scheme"))?
|
|
754
|
-
e.$sub(w("UriSniffRx"),""):e,u=!0)}else k=g(m["$key?"]("hide-uri-scheme"))?e.$sub(w("UriSniffRx"),""):e,u=!0;if(g(u))if(g(C))C["$[]="]("role",g(C["$key?"]("role"))?"bare "+C["$[]"]("role"):"bare");else C=f(["role"],{role:"bare"});Q.$register("links",(a=["target",e],l(aa,"[]=",a),a[a.length-1]));if(g(C))aa["$[]="]("attributes",C);return""+h+w("Inline").$new(d,"anchor",k,aa).$convert()+da},{$$s:this}));g(h)&&(g(b["$include?"]("link:"))||g(b["$include?"]("ilto:")))&&(b=l(b,"gsub",[w("InlineLinkMacroRx")],
|
|
755
|
-
function oa(){var a,b=null==oa.$$s?this:oa.$$s,d,e=r,h;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());var k=g(d=(a=q["~"])===r?r:a["$[]"](1))?c("mailto:",e=(a=q["~"])===r?r:a["$[]"](2)):(a=q["~"])===r?r:a["$[]"](2);a=[r,f(["type"],{type:"link"})];var X=a[0];var u=a[1];a;if(!g((h=(a=q["~"])===r?r:a["$[]"](3))["$empty?"]())){g(h["$include?"](w("R_SB")))&&(h=h.$gsub(w("ESC_R_SB"),w("R_SB")));if(g(d)){if(n(Q.$compat_mode())&&
|
|
756
|
-
g(h["$include?"](","))){var da=b.$extract_attributes_from_text(h,"");a=t(da);h=null==a[0]?r:a[0];X=null==a[1]?r:a[1];da;u["$[]="]("id",X["$[]"]("id"));g(X["$key?"](2))&&(k=g(X["$key?"](3))?""+k+"?subject="+w("Helpers").$encode_uri_component(X["$[]"](2))+"&body="+w("Helpers").$encode_uri_component(X["$[]"](3)):""+k+"?subject="+w("Helpers").$encode_uri_component(X["$[]"](2)))}}else n(Q.$compat_mode())&&g(h["$include?"]("="))&&(da=b.$extract_attributes_from_text(h,""),a=t(da),h=null==a[0]?r:a[0],
|
|
757
|
-
X=null==a[1]?r:a[1],da,u["$[]="]("id",X["$[]"]("id")));if(g(h["$end_with?"]("^")))if(h=h.$chop(),g(X))if(g(p=X["$[]"]("window")))p;else X["$[]="]("window","_blank");else X=f(["window"],{window:"_blank"})}if(g(h["$empty?"]()))if(g(d))h=e;else if(g(m["$key?"]("hide-uri-scheme"))?g((h=k.$sub(w("UriSniffRx"),""))["$empty?"]())&&(h=k):h=k,g(X))X["$[]="]("role",g(X["$key?"]("role"))?"bare "+X["$[]"]("role"):"bare");else X=f(["role"],{role:"bare"});Q.$register("links",(a=["target",k],l(u,"[]=",a),a[a.length-
|
|
758
|
-
1]));if(g(X))u["$[]="]("attributes",X);return w("Inline").$new(b,"anchor",h,u).$convert()},{$$s:this}));g(b["$include?"]("@"))&&(b=l(b,"gsub",[w("InlineEmailRx")],function ia(){var a,b=null==ia.$$s?this:ia.$$s,d;if(g((a=q["~"])===r?r:a["$[]"](1)))return y((a=q["~"])===r?r:a["$[]"](1),w("RS"))?((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length()):(a=q["~"])===r?r:a["$[]"](0);var e=c("mailto:",d=(a=q["~"])===r?r:a["$[]"](0));Q.$register("links",e);return w("Inline").$new(b,
|
|
759
|
-
"anchor",d,f(["type","target"],{type:"link",target:e})).$convert()},{$$s:this}));g(d)&&y(this.context,"list_item")&&y(this.parent.$style(),"bibliography")&&(b=l(b,"sub",[w("InlineBiblioAnchorRx")],function va(){var a,c=null==va.$$s?this:va.$$s;return w("Inline").$new(c,"anchor",(a=q["~"])===r?r:a["$[]"](2),f(["type","id"],{type:"bibref",id:(a=q["~"])===r?r:a["$[]"](1)})).$convert()},{$$s:this}));if(g(d)&&g(b["$include?"]("[["))||g(h)&&g(b["$include?"]("or:")))b=l(b,"gsub",[w("InlineAnchorRx")],function za(){var a,
|
|
760
|
-
c=null==za.$$s?this:za.$$s,b,d=r;if(g((a=q["~"])===r?r:a["$[]"](1)))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());g(b=(a=q["~"])===r?r:a["$[]"](2))?d=(a=q["~"])===r?r:a["$[]"](3):(b=(a=q["~"])===r?r:a["$[]"](4),g(d=(a=q["~"])===r?r:a["$[]"](5))&&g(d["$include?"](w("R_SB")))&&(d=d.$gsub(w("ESC_R_SB"),w("R_SB"))));return w("Inline").$new(c,"anchor",d,f(["type","id"],{type:"ref",id:b})).$convert()},{$$s:this});if(g(b["$include?"]("&"))&&g(b["$include?"](";&l"))||
|
|
761
|
-
g(h)&&g(b["$include?"]("xref:")))b=l(b,"gsub",[w("InlineXrefMacroRx")],function za(){var a,b=null==za.$$s?this:za.$$s,d,e=r,h=r,k=r,X=r,m=r,u=r,da=r;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());var C=f([],{});if(g(d=(a=q["~"])===r?r:a["$[]"](1))){if(g(d["$include?"](","))){var aa=d.$partition(",");a=t(aa);d=null==a[0]?r:a[0];e=null==a[2]?r:a[2];aa;g((e=e.$lstrip())["$empty?"]())&&(e=r)}}else h=
|
|
762
|
-
!0,d=(a=q["~"])===r?r:a["$[]"](2),g(e=(a=q["~"])===r?r:a["$[]"](3))&&(g(e["$include?"](w("R_SB")))&&(e=e.$gsub(w("ESC_R_SB"),w("R_SB"))),n(Q.$compat_mode())&&g(e["$include?"]("="))&&(aa=b.$extract_attributes_from_text(e),a=t(aa),e=null==a[0]?r:a[0],C=null==a[1]?r:a[1],aa));g(Q.$compat_mode())?k=d:g(X=d.$index("#"))&&F(d["$[]"](B(X,1)),"&")?g(z(X,0))?(g(z(a=B(B(d.$length(),1),X),0))?(a=[d.$slice(0,X),d.$slice(c(X,1),a)],m=a[0],k=a[1],a):m=d.$chop(),g(h)?g(m["$end_with?"](".adoc"))?u=m=m.$slice(0,B(m.$length(),
|
|
763
|
-
5)):n(w("Helpers")["$extname?"](m))&&(u=m):u=g(l(m,"end_with?",x(w("ASCIIDOC_EXTENSIONS").$keys())))?m=m.$slice(0,m.$rindex(".")):m):(a=[d,d.$slice(1,d.$length())],da=a[0],k=a[1],a):g(h)?g(d["$end_with?"](".adoc"))?u=m=d.$slice(0,B(d.$length(),5)):g(w("Helpers")["$extname?"](d))?m=d:k=d:k=d;g(da)?(d=k,g(b.$logger()["$info?"]())&&n(Q.$catalog()["$[]"]("refs")["$[]"](d))&&b.$logger().$info("possible invalid reference: "+d)):g(m)?g(u)&&(y(Q.$attributes()["$[]"]("docname"),m)||g(Q.$catalog()["$[]"]("includes")["$[]"](m)))?
|
|
764
|
-
g(k)?(a=[k,r,"#"+k],d=a[0],m=a[1],da=a[2],a,g(b.$logger()["$info?"]())&&n(Q.$catalog()["$[]"]("refs")["$[]"](d))&&b.$logger().$info("possible invalid reference: "+d)):(a=[r,r,"#"],d=a[0],m=a[1],da=a[2],a):(a=[m,""+(g(p=Q.$attributes()["$[]"]("relfileprefix"))?p:"")+m+(g(u)?Q.$attributes().$fetch("relfilesuffix",Q.$outfilesuffix()):"")],d=a[0],m=a[1],a,g(k)?(a=[""+d+"#"+k,""+m+"#"+k],d=a[0],da=a[1],a):da=m):g(Q.$compat_mode())||n(w("Compliance").$natural_xrefs())?(a=[k,"#"+k],d=a[0],da=a[1],a,g(b.$logger()["$info?"]())&&
|
|
765
|
-
n(Q.$catalog()["$[]"]("refs")["$[]"](d))&&b.$logger().$info("possible invalid reference: "+d)):g(Q.$catalog()["$[]"]("refs")["$[]"](k))?(a=[k,"#"+k],d=a[0],da=a[1],a):(g(k["$include?"](" "))||F(k.$downcase(),k))&&g(d=Q.$resolve_id(k))?(a=[d,"#"+d],k=a[0],da=a[1],a):(a=[k,"#"+k],d=a[0],da=a[1],a,g(b.$logger()["$info?"]())&&b.$logger().$info("possible invalid reference: "+d));C["$[]="]("path",m);C["$[]="]("fragment",k);C["$[]="]("refid",d);return w("Inline").$new(b,"anchor",e,f(["type","target","attributes"],
|
|
766
|
-
{type:"xref",target:da,attributes:C})).$convert()},{$$s:this});g(h)&&g(b["$include?"]("tnote"))&&(b=l(b,"gsub",[w("InlineFootnoteMacroRx")],function za(){var a,c,b,d=null==za.$$s?this:za.$$s,e=r,h=r,p=c=r,k=c=r;if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());if(g((a=q["~"])===r?r:a["$[]"](1)))if(g((a=q["~"])===r?r:a["$[]"](3)))c=((b=q["~"])===r?r:b["$[]"](3)).$split(",",2),a=t(c),e=null==a[0]?r:a[0],
|
|
767
|
-
h=null==a[1]?r:a[1],c,g(Q.$compat_mode())||d.$logger().$warn("found deprecated footnoteref macro: "+((a=q["~"])===r?r:a["$[]"](0))+"; use footnote macro with target instead");else return(a=q["~"])===r?r:a["$[]"](0);else e=(a=q["~"])===r?r:a["$[]"](2),h=(a=q["~"])===r?r:a["$[]"](3);if(g(e))g(c=l(Q.$footnotes(),"find",[],function(a){null==a&&(a=r);return a.$id()["$=="](e)}))?(a=[c.$index(),c.$text()],p=a[0],h=a[1],a,a=["xref",e,r],c=a[0],k=a[1],e=a[2]):g(h)?(h=d.$restore_passthroughs(d.$normalize_text(h,
|
|
768
|
-
!0,!0)),p=Q.$counter("footnote-number"),Q.$register("footnotes",G(w("Document"),"Footnote").$new(p,e,h)),a=["ref",r],c=a[0],k=a[1]):(d.$logger().$warn("invalid footnote reference: "+e),a=["xref",e,e,r],c=a[0],k=a[1],h=a[2],e=a[3]),a;else if(g(h))h=d.$restore_passthroughs(d.$normalize_text(h,!0,!0)),p=Q.$counter("footnote-number"),Q.$register("footnotes",G(w("Document"),"Footnote").$new(p,e,h)),c=k=r;else return(a=q["~"])===r?r:a["$[]"](0);return w("Inline").$new(d,"footnote",h,f(["attributes","id",
|
|
769
|
-
"target","type"],{attributes:f(["index"],{index:p}),id:e,target:k,type:c})).$convert()},{$$s:this}));return b});e(k,"$sub_post_replacements",function(a){var c=r,b=r;null==this.document&&(this.document=r);null==this.attributes&&(this.attributes=r);if(g(this.attributes["$[]"]("hardbreaks-option"))||g(this.document.$attributes()["$[]"]("hardbreaks-option"))){c=a.$split(w("LF"),-1);if(g(A(c.$size(),2)))return a;b=c.$pop();return l(c,"map",[],function xa(a){var c=null==xa.$$s?this:xa.$$s;null==a&&(a=r);
|
|
770
|
-
return w("Inline").$new(c,"break",g(a["$end_with?"](w("HARD_LINE_BREAK")))?a.$slice(0,B(a.$length(),2)):a,f(["type"],{type:"line"})).$convert()},{$$s:this})["$<<"](b).$join(w("LF"))}return g(a["$include?"](w("PLUS")))&&g(a["$include?"](w("HARD_LINE_BREAK")))?l(a,"gsub",[w("HardLineBreakRx")],function ca(){var a,c=null==ca.$$s?this:ca.$$s;return w("Inline").$new(c,"break",(a=q["~"])===r?r:a["$[]"](1),f(["type"],{type:"line"})).$convert()},{$$s:this}):a});e(k,"$sub_source",function(a,c){return g(c)?
|
|
771
|
-
this.$sub_callouts(this.$sub_specialchars(a)):this.$sub_specialchars(a)});e(k,"$sub_callouts",function(a){var b=r,d=r;b=g(this["$attr?"]("line-comment"))?w("CalloutSourceRxMap")["$[]"](this.$attr("line-comment")):w("CalloutSourceRx");d=0;return l(a,"gsub",[b],function ca(){var a,b=null==ca.$$s?this:ca.$$s,e=r;null==b.document&&(b.document=r);return g((a=q["~"])===r?r:a["$[]"](2))?((a=q["~"])===r?r:a["$[]"](0)).$sub(w("RS"),""):w("Inline").$new(b,"callout",y((a=q["~"])===r?r:a["$[]"](4),".")?(d=c(d,
|
|
772
|
-
1)).$to_s():(a=q["~"])===r?r:a["$[]"](4),f(["id","attributes"],{id:b.document.$callouts().$read_next_id(),attributes:f(["guard"],{guard:g(e=(a=q["~"])===r?r:a["$[]"](1))?e:y((a=q["~"])===r?r:a["$[]"](3),"--")?["\x3c!--","--\x3e"]:r})})).$convert()},{$$s:this})});e(k,"$highlight_source",function(a,c){var b=r,d=r,e=r,h,l=r,Q=r;null==this.document&&(this.document=r);null==this.passthroughs&&(this.passthroughs=r);if(!g(b=this.document.$syntax_highlighter())||!g(b["$highlight?"]()))return this.$sub_source(a,
|
|
773
|
-
c);if(g(c)){c=this.$extract_callouts(a);var p=t(c);a=null==p[0]?r:p[0];d=null==p[1]?r:p[1];c}c=this.document.$attributes();p=b.$name();g(h=g(this["$attr?"]("linenums"))?(g(l=c["$[]"](""+p+"-linenums-mode"))?l:"table").$to_sym():r)&&g(A(e=this.$attr("start",1).$to_i(),1))&&(e=1);g(this["$attr?"]("highlight"))&&(Q=this.$resolve_lines_to_highlight(a,this.$attr("highlight"),e));c=b.$highlight(this,a,this.$attr("language"),f("callouts css_mode highlight_lines number_lines start_line_number style".split(" "),
|
|
774
|
-
{callouts:d,css_mode:(g(l=c["$[]"](""+p+"-css"))?l:"class").$to_sym(),highlight_lines:Q,number_lines:h,start_line_number:e,style:c["$[]"](""+p+"-style")}));p=t(c);a=null==p[0]?r:p[0];b=null==p[1]?r:p[1];c;g(this.passthroughs["$empty?"]())||(a=a.$gsub(w("HighlightedPassSlotRx"),""+w("PASS_START")+"\\1"+w("PASS_END")));return g(d["$nil_or_empty?"]())?a:this.$restore_callouts(a,d,b)});e(k,"$resolve_lines_to_highlight",function(b,d,e){var f=r,h=r;null==e&&(e=r);f=[];g(d["$include?"](" "))&&(d=d.$delete(" "));
|
|
775
|
-
l(g(d["$include?"](","))?d.$split(","):d.$split(";"),"map",[],function(d){var e=r,h;null==d&&(d=r);g(d["$start_with?"]("!"))&&(d=d.$slice(1,d.$length()),e=!0);if(g(h=g(d["$include?"](".."))?"..":g(d["$include?"]("-"))?"-":r)){d=d.$partition(h);var l=t(d);h=null==l[0]?r:l[0];l=null==l[2]?r:l[2];d;if(g(l["$empty?"]())||g(A(l=l.$to_i(),0)))l=c(b.$count(w("LF")),1);return g(e)?f=B(f,a.Range.$new(h.$to_i(),l,!1).$to_a()):f=f["$|"](a.Range.$new(h.$to_i(),l,!1).$to_a())}return g(e)?f.$delete(d.$to_i()):
|
|
776
|
-
n(f["$include?"](l=d.$to_i()))?f["$<<"](l):r});y(h=g(e)?B(e,1):0,0)||(f=l(f,"map",[],function(a){null==a&&(a=r);return B(a,h)}));return f.$sort()},-3);e(k,"$extract_passthroughs",function(a){var c=r,b=r,d=r,e=r;var h=r;null==this.document&&(this.document=r);null==this.passthroughs&&(this.passthroughs=r);c=this.document.$compat_mode();b=this.passthroughs;if(g(a["$include?"]("++"))||g(a["$include?"]("$$"))||g(a["$include?"]("ss:")))a=l(a,"gsub",[w("InlinePassMacroRx")],function X(){var a,d=null==X.$$s?
|
|
777
|
-
this:X.$$s,e,h,l,p=r,k=r,m=r,n=r;if(g(e=(a=q["~"])===r?r:a["$[]"](4))){if(g(c)&&y(e,"++"))return(g((a=q["~"])===r?r:a["$[]"](2))?""+((a=q["~"])===r?r:a["$[]"](1))+"["+((a=q["~"])===r?r:a["$[]"](2))+"]"+((a=q["~"])===r?r:a["$[]"](3)):""+((a=q["~"])===r?r:a["$[]"](1))+((a=q["~"])===r?r:a["$[]"](3)))+"++"+d.$extract_passthroughs((a=q["~"])===r?r:a["$[]"](5))+"++";if(g(h=(a=q["~"])===r?r:a["$[]"](2))){if(g(z(l=((a=q["~"])===r?r:a["$[]"](3)).$length(),0)))return""+((a=q["~"])===r?r:a["$[]"](1))+"["+h+
|
|
778
|
-
"]"+u(w("RS"),B(l,1))+e+((a=q["~"])===r?r:a["$[]"](5))+e;y((a=q["~"])===r?r:a["$[]"](1),w("RS"))?p="["+h+"]":y(e,"++")?y(h,"x-")?(k=!0,m=f([],{})):g(h["$end_with?"](" x-"))?(k=!0,m=d.$parse_quoted_text_attributes(h.$slice(0,B(h.$length(),3)))):m=d.$parse_quoted_text_attributes(h):m=d.$parse_quoted_text_attributes(h)}else if(g(z(l=((a=q["~"])===r?r:a["$[]"](3)).$length(),0)))return""+u(w("RS"),B(l,1))+e+((a=q["~"])===r?r:a["$[]"](5))+e;e=y(e,"+++")?[]:w("BASIC_SUBS");if(g(m))if(g(k))b["$[]="](k=b.$size(),
|
|
779
|
-
f(["text","subs","type","attributes"],{text:(a=q["~"])===r?r:a["$[]"](5),subs:w("NORMAL_SUBS"),type:"monospaced",attributes:m}));else b["$[]="](k=b.$size(),f(["text","subs","type","attributes"],{text:(a=q["~"])===r?r:a["$[]"](5),subs:e,type:"unquoted",attributes:m}));else b["$[]="](k=b.$size(),f(["text","subs"],{text:(a=q["~"])===r?r:a["$[]"](5),subs:e}))}else{if(y((a=q["~"])===r?r:a["$[]"](6),w("RS")))return((a=q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());if(g(e=
|
|
780
|
-
(a=q["~"])===r?r:a["$[]"](7)))b["$[]="](k=b.$size(),f(["text","subs"],{text:d.$normalize_text((a=q["~"])===r?r:a["$[]"](8),r,!0),subs:d.$resolve_pass_subs(e)}));else b["$[]="](k=b.$size(),f(["text"],{text:d.$normalize_text((a=q["~"])===r?r:a["$[]"](8),r,!0)}))}return""+(g(n=p)?n:"")+w("PASS_START")+k+w("PASS_END")},{$$s:this});var p=w("InlinePassRx")["$[]"](c);h=t(p);d=null==h[0]?r:h[0];e=null==h[1]?r:h[1];h=null==h[2]?r:h[2];p;if(g(a["$include?"](d))||g(e)&&g(a["$include?"](e)))a=l(a,"gsub",[h],
|
|
781
|
-
function X(){var a,d=null==X.$$s?this:X.$$s,e=r,h=r,l=r,p=r,k=r;var m=(a=q["~"])===r?r:a["$[]"](1);var n=g(e=(a=q["~"])===r?r:a["$[]"](4))?e:(a=q["~"])===r?r:a["$[]"](3);g((a=q["~"])===r?r:a["$[]"](5))&&(h=!0);var u=(a=q["~"])===r?r:a["$[]"](6);var da=(a=q["~"])===r?r:a["$[]"](7);e=(a=q["~"])===r?r:a["$[]"](8);g(c)?l=!0:g(n)&&(y(n,"x-")||g(n["$end_with?"](" x-")))&&(l=p=!0);if(g(n)){if(g(h))return""+m+"["+n+"]"+u.$slice(1,u.$length());if(y(m,w("RS"))){if(g(p)&&y(da,"`"))return""+m+"["+n+"]"+u;m="["+
|
|
782
|
-
n+"]"}else k=g(p)?y(n,"x-")?f([],{}):d.$parse_quoted_text_attributes(n.$slice(0,B(n.$length(),3))):d.$parse_quoted_text_attributes(n)}else{if(g(h))return""+m+u.$slice(1,u.$length());if(g(c)&&y(m,w("RS")))return u}if(g(c))b["$[]="](a=b.$size(),f(["text","subs","attributes","type"],{text:e,subs:w("BASIC_SUBS"),attributes:k,type:"monospaced"}));else if(g(k))if(g(l))d=y(da,"`")?w("BASIC_SUBS"):w("NORMAL_SUBS"),b["$[]="](a=b.$size(),f(["text","subs","attributes","type"],{text:e,subs:d,attributes:k,type:"monospaced"}));
|
|
783
|
-
else b["$[]="](a=b.$size(),f(["text","subs","attributes","type"],{text:e,subs:w("BASIC_SUBS"),attributes:k,type:"unquoted"}));else b["$[]="](a=b.$size(),f(["text","subs"],{text:e,subs:w("BASIC_SUBS")}));return""+m+w("PASS_START")+a+w("PASS_END")},{$$s:this});g(a["$include?"](":"))&&(g(a["$include?"]("stem:"))||g(a["$include?"]("math:")))&&(a=l(a,"gsub",[w("InlineStemMacroRx")],function X(){var a,c=null==X.$$s?this:X.$$s,d;null==c.document&&(c.document=r);if(g(((a=q["~"])===r?r:a["$[]"](0))["$start_with?"](w("RS"))))return((a=
|
|
784
|
-
q["~"])===r?r:a["$[]"](0)).$slice(1,((a=q["~"])===r?r:a["$[]"](0)).$length());y(d=((a=q["~"])===r?r:a["$[]"](1)).$to_sym(),"stem")&&(d=w("STEM_TYPE_ALIASES")["$[]"](c.document.$attributes()["$[]"]("stem")).$to_sym());var e=(a=q["~"])===r?r:a["$[]"](2);var h=c.$normalize_text((a=q["~"])===r?r:a["$[]"](3),r,!0);y(d,"latexmath")&&g(h["$start_with?"]("$"))&&g(h["$end_with?"]("$"))&&(h=h.$slice(1,B(h.$length(),2)));e=g(e)?c.$resolve_pass_subs(e):g(c.document["$basebackend?"]("html"))?w("BASIC_SUBS"):r;
|
|
785
|
-
b["$[]="](a=b.$size(),f(["text","subs","type"],{text:h,subs:e,type:d}));return""+w("PASS_START")+a+w("PASS_END")},{$$s:this}));return a});e(k,"$restore_passthroughs",function(a){var c=r;null==this.passthroughs&&(this.passthroughs=r);c=this.passthroughs;return l(a,"gsub",[w("PassSlotRx")],function ba(){var b,d=null==ba.$$s?this:ba.$$s,e,h,l,p=r;if(g(e=c["$[]"](((b=q["~"])===r?r:b["$[]"](1)).$to_i())))return b=d.$apply_subs(e["$[]"]("text"),e["$[]"]("subs")),g(h=e["$[]"]("type"))&&(g(l=e["$[]"]("attributes"))&&
|
|
786
|
-
(p=l["$[]"]("id")),b=w("Inline").$new(d,"quoted",b,f(["type","id","attributes"],{type:h,id:p,attributes:l})).$convert()),g(b["$include?"](w("PASS_START")))?d.$restore_passthroughs(b):b;d.$logger().$error("unresolved passthrough detected: "+a);return"??pass??"},{$$s:this})});e(k,"$resolve_subs",function(a,b,d,e){var f=r,h=r,p=r,Q=r;null==b&&(b="block");null==d&&(d=r);null==e&&(e=r);if(g(a["$nil_or_empty?"]()))return r;f=r;g(a["$include?"](" "))&&(a=a.$delete(" "));h=w("SubModifierSniffRx")["$match?"](a);
|
|
787
|
-
l(a.$split(","),"each",[],function(a){var e,l,Q=r;null==a&&(a=r);var p=r;g(h)&&(y(e=a.$chr(),"+")?(p="append",a=a.$slice(1,a.$length())):y(e,"-")?(p="remove",a=a.$slice(1,a.$length())):g(a["$end_with?"]("+"))&&(p="prepend",a=a.$chop()));a=a.$to_sym();y(b,"inline")&&(y(a,"verbatim")||y(a,"v"))?a=w("BASIC_SUBS"):g(w("SUB_GROUPS")["$key?"](a))?a=w("SUB_GROUPS")["$[]"](a):y(b,"inline")&&y(a.$length(),1)&&g(w("SUB_HINTS")["$key?"](a))?(a=w("SUB_HINTS")["$[]"](a),a=g(l=w("SUB_GROUPS")["$[]"](a))?l:[a]):
|
|
788
|
-
a=[a];if(g(p))switch(f=g(Q=f)?Q:g(d)?d.$drop(0):[],p){case "append":return f=c(f,a);case "prepend":return f=c(a,f);case "remove":return f=B(f,a);default:return r}else return f=g(Q=f)?Q:[],f=c(f,a)});if(!g(f))return r;p=f["$&"](w("SUB_OPTIONS")["$[]"](b));g(B(f,p)["$empty?"]())||(Q=B(f,p),this.$logger().$warn("invalid substitution type"+(g(z(Q.$size(),1))?"s":"")+(g(e)?" for ":"")+e+": "+Q.$join(", ")));return p},-2);e(k,"$resolve_block_subs",function(a,c,b){return this.$resolve_subs(a,"block",c,b)});
|
|
789
|
-
e(k,"$resolve_pass_subs",function(a){return this.$resolve_subs(a,"inline",r,"passthrough macro")});e(k,"$expand_subs",function(a,b){var d=r,e=r,f=r;null==b&&(b=r);return v(G("Symbol"),d=a)?y(a,"none")?r:g(e=w("SUB_GROUPS")["$[]"](a))?e:[a]:v(G("Array"),d)?(f=[],l(a,"each",[],function(a){var b;null==a&&(a=r);return y(a,"none")?r:g(b=w("SUB_GROUPS")["$[]"](a))?f=c(f,b):f["$<<"](a)}),g(f["$empty?"]())?r:f):this.$resolve_subs(a,"inline",r,b)},-2);e(k,"$commit_subs",function(){var a,c,b=r,d=r,e=r;null==
|
|
790
|
-
this.default_subs&&(this.default_subs=r);null==this.content_model&&(this.content_model=r);null==this.context&&(this.context=r);null==this.subs&&(this.subs=r);null==this.attributes&&(this.attributes=r);null==this.document&&(this.document=r);null==this.style&&(this.style=r);if(!g(a=this.default_subs))switch(this.content_model){case "simple":a=w("NORMAL_SUBS");break;case "verbatim":a=y(this.context,"verse")?w("NORMAL_SUBS"):w("VERBATIM_SUBS");break;case "raw":a=y(this.context,"stem")?w("BASIC_SUBS"):
|
|
791
|
-
w("NO_SUBS");break;default:return this.subs}g(c=this.attributes["$[]"]("subs"))?this.subs=g(b=this.$resolve_block_subs(c,a,this.context))?b:[]:this.subs=a.$drop(0);if(y(this.context,"listing")&&y(this.style,"source")&&g(e=this.document.$syntax_highlighter())&&g(e["$highlight?"]())&&g(d=this.subs.$index("specialcharacters")))this.subs["$[]="](d,"highlight");return r});e(k,"$parse_attributes",function(a,c,b){var d=r,e;null==this.document&&(this.document=r);null==c&&(c=[]);null==b&&(b=f([],{}));if(g(g(a)?
|
|
792
|
-
a["$empty?"]():!0))return f([],{});g(b["$[]"]("unescape_input"))&&(a=this.$normalize_text(a,!0,!0));g(b["$[]"]("sub_input"))&&g(a["$include?"](w("ATTR_REF_HEAD")))&&(a=this.document.$sub_attributes(a));g(b["$[]"]("sub_result"))&&(d=this);return g(e=b["$[]"]("into"))?w("AttributeList").$new(a,d).$parse_into(e,c):w("AttributeList").$new(a,d).$parse(c)},-2);k.$private();e(k,"$extract_attributes_from_text",function(a,c){var b,d;null==c&&(c=r);var e=g(a["$include?"](w("LF")))?a.$tr(w("LF")," "):a;return g(b=
|
|
793
|
-
(d=w("AttributeList").$new(e,this).$parse())["$[]"](1))?y(b,e)?[a,d.$clear()]:[b,d]:[c,d]},-2);e(k,"$extract_callouts",function(a){var b=r,d=r,e=r,h=r,p=r;b=f([],{});d=e=0;h=r;p=g(this["$attr?"]("line-comment"))?w("CalloutExtractRxMap")["$[]"](this.$attr("line-comment")):w("CalloutExtractRx");a=l(a.$split(w("LF"),-1),"map",[],function(a){null==a&&(a=r);e=c(e,1);return l(a,"gsub",[p],function(){var a,f=r;if(g((a=q["~"])===r?r:a["$[]"](2)))return((a=q["~"])===r?r:a["$[]"](0)).$sub(w("RS"),"");(g(f=
|
|
794
|
-
b["$[]"](e))?f:(a=[e,[]],l(b,"[]=",a),a[a.length-1]))["$<<"]([g(f=(a=q["~"])===r?r:a["$[]"](1))?f:y((a=q["~"])===r?r:a["$[]"](3),"--")?["\x3c!--","--\x3e"]:r,y((a=q["~"])===r?r:a["$[]"](4),".")?(d=c(d,1)).$to_s():(a=q["~"])===r?r:a["$[]"](4)]);h=e;return""})}).$join(w("LF"));g(h)?y(h,e)&&(a=""+a+w("LF")):b=r;return[a,b]});e(k,"$restore_callouts",function(a,b,d){var e=r,h=r;null==d&&(d=r);g(d)?(e=a.$slice(0,d),a=a.$slice(d,a.$length())):e="";h=0;return c(e,l(a.$split(w("LF"),-1),"map",[],function Q(a){var d,
|
|
795
|
-
e=null==Q.$$s?this:Q.$$s,p=d=r;var k=r;null==e.document&&(e.document=r);null==a&&(a=r);return g(d=b.$delete(h=c(h,1)))?y(d.$size(),1)?(d=d["$[]"](0),k=t(d),p=null==k[0]?r:k[0],k=null==k[1]?r:k[1],d,""+a+w("Inline").$new(e,"callout",k,f(["id","attributes"],{id:e.document.$callouts().$read_next_id(),attributes:f(["guard"],{guard:p})})).$convert()):""+a+l(d,"map",[],function va(a,c){var b=null==va.$$s?this:va.$$s;null==b.document&&(b.document=r);null==a&&(a=r);null==c&&(c=r);return w("Inline").$new(b,
|
|
796
|
-
"callout",c,f(["id","attributes"],{id:b.document.$callouts().$read_next_id(),attributes:f(["guard"],{guard:a})})).$convert()},{$$s:e}).$join(" "):a},{$$s:this}).$join(w("LF")))},-3);e(k,"$convert_quoted_text",function(a,c,b){var d=r,e=r,h=r,l=r;if(g(a["$[]"](0)["$start_with?"](w("RS"))))if(y(b,"constrained")&&g(d=a["$[]"](2)))e="["+d+"]";else return a["$[]"](0).$slice(1,a["$[]"](0).$length());if(y(b,"constrained")){if(g(e))return""+e+w("Inline").$new(this,"quoted",a["$[]"](3),f(["type"],{type:c})).$convert();
|
|
797
|
-
g(b=a["$[]"](2))&&(h=(l=this.$parse_quoted_text_attributes(b))["$[]"]("id"),y(c,"mark")&&(c="unquoted"));return""+a["$[]"](1)+w("Inline").$new(this,"quoted",a["$[]"](3),f(["type","id","attributes"],{type:c,id:h,attributes:l})).$convert()}g(b=a["$[]"](1))&&(h=(l=this.$parse_quoted_text_attributes(b))["$[]"]("id"),y(c,"mark")&&(c="unquoted"));return w("Inline").$new(this,"quoted",a["$[]"](2),f(["type","id","attributes"],{type:c,id:h,attributes:l})).$convert()});e(k,"$do_replacement",function(a,b,d){var e;
|
|
798
|
-
if(g((e=a["$[]"](0))["$include?"](w("RS"))))return e.$sub(w("RS"),"");switch(d){case "none":return b;case "bounding":return c(c(a["$[]"](1),b),a["$[]"](2));default:return c(a["$[]"](1),b)}});r;e(k,"$parse_quoted_text_attributes",function(a){g(a["$include?"](w("ATTR_REF_HEAD")))&&(a=this.$sub_attributes(a));g(a["$include?"](","))&&(a=a.$slice(0,a.$index(",")));if(g((a=a.$strip())["$empty?"]()))return f([],{});if(g(a["$start_with?"](".","#"))&&g(w("Compliance").$shorthand_property_syntax())){a=a.$partition("#");
|
|
799
|
-
var b=t(a);var d=null==b[0]?r:b[0];var e=null==b[2]?r:b[2];a;var h=f([],{});if(g(e["$empty?"]())){if(g(z(d.$length(),1)))h["$[]="]("role",d.$tr("."," ").$lstrip())}else{a=e.$partition(".");b=t(a);e=null==b[0]?r:b[0];b=null==b[2]?r:b[2];a;if(!g(e["$empty?"]()))h["$[]="]("id",e);if(g(b["$empty?"]())){if(g(z(d.$length(),1)))h["$[]="]("role",d.$tr("."," ").$lstrip())}else if(g(z(d.$length(),1)))h["$[]="]("role",c(c(d,"."),b).$tr("."," ").$lstrip());else h["$[]="]("role",b.$tr("."," "))}return h}return f(["role"],
|
|
800
|
-
{role:a})});e(k,"$normalize_text",function(a,c,b){null==c&&(c=r);null==b&&(b=r);g(a["$empty?"]())||(g(c)&&(a=a.$strip().$tr(w("LF")," ")),g(b)&&g(a["$include?"](w("R_SB")))&&(a=a.$gsub(w("ESC_R_SB"),w("R_SB"))));return a},-2);return e(k,"$split_simple_csv",function(a){var b=r,d=r,e=r;return g(a["$empty?"]())?[]:g(a["$include?"]('"'))?(b=[],d="",e=r,l(a,"each_char",[],function(a){null==a&&(a=r);switch(a){case ",":if(g(e))return d=c(d,a);b["$<<"](d.$strip());return d="";case '"':return e=e["$!"]();
|
|
801
|
-
default:return d=c(d,a)}}),b["$<<"](d.$strip())):l(a.$split(","),"map",[],function(a){null==a&&(a=r);return a.$strip()})})}(k[0],k)}(E[0],E)};Opal.modules["asciidoctor/version"]=function(a){var b=a.module;a=a.const_set;var d=[];b=[b(d[0],"Asciidoctor")].concat(d);return a(b[0],"VERSION","2.0.20")};Opal.modules["asciidoctor/abstract_node"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.eqeq,c=a.truthy,p=a.def,m=a.send,g=a.rb_minus,l=a.eqeqeq,e=a.rb_lt,n=a.not,q=a.to_ary,y=[],t=a.nil,F=a.$$$;a.add_stubs("include,attr_reader,attr_accessor,==,document,to_s,[],merge,raise,converter,attributes,key?,[]=,delete,tap,new,each_key,end_with?,<<,slice,-,length,update,split,include?,===,join,empty?,apply_reftext_subs,attr?,attr,extname?,image_uri,<,safe,normalize_web_path,uriish?,encode_spaces_in_uri,generate_data_uri_from_uri,generate_data_uri,extname,normalize_system_path,readable?,strict_encode64,binread,warn,logger,require_library,!,open_uri,content_type,read,base_dir,root?,path_resolver,system_path,web_path,!=,prepare_source_string,fetch,read_asset");
|
|
802
|
-
return function(k,y){k=[b(k,"Asciidoctor")].concat(y);return function(b,$super,k){b=d(b,$super,"AbstractNode");k=[b].concat(k);var y=a.$r(k);k=b.$$prototype;k.document=k.attributes=k.parent=t;b.$include(y("Logging"));b.$include(y("Substitutors"));b.$attr_reader("attributes");b.$attr_reader("context");b.$attr_reader("document");b.$attr_accessor("id");b.$attr_reader("node_name");b.$attr_reader("parent");p(b,"$initialize",function(a,b,d){var e=t;null==d&&(d=f([],{}));h(b,"document")?this.document=this:
|
|
803
|
-
c(a)&&(this.document=(this.parent=a).$document());this.node_name=(this.context=b).$to_s();this.attributes=c(e=d["$[]"]("attributes"))?e.$merge():f([],{});return this.passthroughs=[]},-3);p(b,"$block?",function(){return this.$raise(F("NotImplementedError"))});p(b,"$inline?",function(){return this.$raise(F("NotImplementedError"))});p(b,"$converter",function(){return this.document.$converter()});p(b,"$parent=",function(a){var b;return b=[a,a.$document()],this.parent=b[0],this.document=b[1],b});p(b,"$attr",
|
|
804
|
-
function(a,b,d){var e,f,l=t,g=t;null==b&&(b=t);null==d&&(d=t);return c(e=this.attributes["$[]"](a.$to_s()))?e:c(f=c(l=c(g=d)?this.parent:g)?this.document.$attributes()["$[]"]((h(d,!0)?a:d).$to_s()):l)?f:b},-2);p(b,"$attr?",function(a,b,d){var e=t;null==b&&(b=t);null==d&&(d=t);return c(b)?b["$=="](c(e=this.attributes["$[]"](a.$to_s()))?e:c(d)&&c(this.parent)?this.document.$attributes()["$[]"]((h(d,!0)?a:d).$to_s()):t):c(e=this.attributes["$key?"](a.$to_s()))?e:c(d)&&c(this.parent)?this.document.$attributes()["$key?"]((h(d,
|
|
805
|
-
!0)?a:d).$to_s()):!1},-2);p(b,"$set_attr",function(a,b,d){null==b&&(b="");null==d&&(d=!0);if(h(d,!1)&&c(this.attributes["$key?"](a)))return!1;this.attributes["$[]="](a,b);return!0},-2);p(b,"$remove_attr",function(a){return this.attributes.$delete(a)});p(b,"$option?",function(a){return c(this.attributes["$[]"](""+a+"-option"))?!0:!1});p(b,"$set_option",function(a){this.attributes["$[]="](""+a+"-option","");return t});p(b,"$enabled_options",function(){return m(F("Set").$new(),"tap",[],function r(a){var b=
|
|
806
|
-
null==r.$$s?this:r.$$s;null==b.attributes&&(b.attributes=t);null==a&&(a=t);return m(b.attributes,"each_key",[],function(b){null==b&&(b=t);return c(b.$to_s()["$end_with?"]("-option"))?a["$<<"](b.$slice(0,g(b.$length(),7))):t})},{$$s:this})});p(b,"$update_attributes",function(a){return this.attributes.$update(a)});p(b,"$role",function(){return this.attributes["$[]"]("role")});p(b,"$roles",function(){var a;return c(a=this.attributes["$[]"]("role"))?a.$split():[]});p(b,"$role?",function(a){null==a&&(a=
|
|
807
|
-
t);return c(a)?a["$=="](this.attributes["$[]"]("role")):this.attributes["$key?"]("role")},-1);p(b,"$has_role?",function(a){var b;return c(b=this.attributes["$[]"]("role"))?(" "+b+" ")["$include?"](" "+a+" "):!1});p(b,"$role=",function(a){var b;return b=["role",l(F("Array"),a)?a.$join(" "):a],m(this.attributes,"[]=",b),b[b.length-1]});p(b,"$add_role",function(a){var b;if(c(b=this.attributes["$[]"]("role"))){if(c((" "+b+" ")["$include?"](" "+a+" ")))return!1;this.attributes["$[]="]("role",""+b+" "+
|
|
808
|
-
a);return!0}this.attributes["$[]="]("role",a);return!0});p(b,"$remove_role",function(a){var b=t;if(c(b=this.attributes["$[]"]("role"))&&c((b=b.$split()).$delete(a))){if(c(b["$empty?"]()))this.attributes.$delete("role");else this.attributes["$[]="]("role",b.$join(" "));return!0}return!1});p(b,"$reftext",function(){var a;return c(a=this.attributes["$[]"]("reftext"))?this.$apply_reftext_subs(a):t});p(b,"$reftext?",function(){return this.attributes["$key?"]("reftext")});p(b,"$icon_uri",function(a){c(this["$attr?"]("icon"))?
|
|
809
|
-
(a=this.$attr("icon"),c(y("Helpers")["$extname?"](a))||(a=""+a+"."+this.document.$attr("icontype","png"))):a=""+a+"."+this.document.$attr("icontype","png");return this.$image_uri(a,"iconsdir")});p(b,"$image_uri",function(a,b){var d=t,f=t;null==b&&(b="imagesdir");return c(e((d=this.document).$safe(),F(y("SafeMode"),"SECURE")))&&c(d["$attr?"]("data-uri"))?c(y("Helpers")["$uriish?"](a))&&c(a=y("Helpers").$encode_spaces_in_uri(a))||c(b)&&c(f=d.$attr(b))&&c(y("Helpers")["$uriish?"](f))&&c(a=this.$normalize_web_path(a,
|
|
810
|
-
f,!1))?c(d["$attr?"]("allow-uri-read"))?this.$generate_data_uri_from_uri(a,d["$attr?"]("cache-uri")):a:this.$generate_data_uri(a,b):this.$normalize_web_path(a,c(b)?d.$attr(b):t)},-2);p(b,"$media_uri",function(a,b){null==b&&(b="imagesdir");return this.$normalize_web_path(a,c(b)?this.document.$attr(b):t)},-2);p(b,"$generate_data_uri",function(a,b){var d;null==b&&(b=t);var e=c(d=y("Helpers").$extname(a,t))?h(d,".svg")?"image/svg+xml":"image/"+d.$slice(1,d.$length()):"application/octet-stream";a=c(b)?
|
|
811
|
-
this.$normalize_system_path(a,this.document.$attr(b),t,f(["target_name"],{target_name:"image"})):this.$normalize_system_path(a);if(c(F("File")["$readable?"](a)))return"data:"+e+";base64,"+F("Base64").$strict_encode64(F("File").$binread(a));this.$logger().$warn("image to embed not found or not readable: "+a);return"data:"+e+";base64,"},-2);p(b,"$generate_data_uri_from_uri",function(b,d){var e=t,f=t;null==d&&(d=!1);c(d)?y("Helpers").$require_library("open-uri/cached","open-uri-cached"):n(y("RUBY_ENGINE_OPAL"))&&
|
|
812
|
-
F("OpenURI");try{var h=m(F("OpenURI"),"open_uri",[b,y("URI_READ_MODE")],function(a){null==a&&(a=t);return[a.$content_type(),a.$read()]});var l=q(h);e=null==l[0]?t:l[0];f=null==l[1]?t:l[1];h;return"data:"+e+";base64,"+F("Base64").$strict_encode64(f)}catch(w){if(a.rescue(w,[y("StandardError")]))try{return this.$logger().$warn("could not retrieve image data from URI: "+b),b}finally{a.pop_exception()}else throw w;}},-2);p(b,"$normalize_asset_path",function(a,b,c){null==b&&(b="path");null==c&&(c=!0);return this.$normalize_system_path(a,
|
|
813
|
-
this.document.$base_dir(),t,f(["target_name","recover"],{target_name:b,recover:c}))},-2);p(b,"$normalize_system_path",function(a,b,d,h){var l,g=t;null==b&&(b=t);null==d&&(d=t);null==h&&(h=f([],{}));c(e((l=this.document).$safe(),F(y("SafeMode"),"SAFE")))?c(b)?c(l.$path_resolver()["$root?"](b))||(b=F("File").$join(l.$base_dir(),b)):b=l.$base_dir():(b=c(g=b)?g:l.$base_dir(),d=c(g=d)?g:l.$base_dir());return l.$path_resolver().$system_path(a,b,d,h)},-2);p(b,"$normalize_web_path",function(a,b,d){null==
|
|
814
|
-
b&&(b=t);null==d&&(d=!0);return c(d)&&c(y("Helpers")["$uriish?"](a))?y("Helpers").$encode_spaces_in_uri(a):this.document.$path_resolver().$web_path(a,b)},-2);p(b,"$read_asset",function(a,b){var d=t;null==b&&(b=f([],{}));l(F("Hash"),b)||(b=f(["warn_on_failure"],{warn_on_failure:b["$!="](!1)}));if(c(F("File")["$readable?"](a)))return c(b["$[]"]("normalize"))?y("Helpers").$prepare_source_string(F("File").$read(a,f(["mode"],{mode:y("FILE_READ_MODE")}))).$join(y("LF")):F("File").$read(a,f(["mode"],{mode:y("FILE_READ_MODE")}));
|
|
815
|
-
c(b["$[]"]("warn_on_failure"))&&this.$logger().$warn(""+(c(d=this.$attr("docfile"))?d:"<stdin>")+": "+(c(d=b["$[]"]("label"))?d:"file")+" does not exist or cannot be read: "+a);return t},-2);p(b,"$read_contents",function(b,d){var e=t,h=t,l=t,g=t;null==d&&(d=f([],{}));e=this.document;if(c(y("Helpers")["$uriish?"](b))||c(h=d["$[]"]("start"))&&c(y("Helpers")["$uriish?"](h))&&c(b=e.$path_resolver().$web_path(b,h)))if(c(e["$attr?"]("allow-uri-read"))){c(e["$attr?"]("cache-uri"))&&y("Helpers").$require_library("open-uri/cached",
|
|
816
|
-
"open-uri-cached");try{l=c(d["$[]"]("normalize"))?y("Helpers").$prepare_source_string(m(F("OpenURI"),"open_uri",[b,y("URI_READ_MODE")],function(a){null==a&&(a=t);return a.$read()})).$join(y("LF")):m(F("OpenURI"),"open_uri",[b,y("URI_READ_MODE")],function(a){null==a&&(a=t);return a.$read()})}catch(w){if(a.rescue(w,[y("StandardError")]))try{c(d.$fetch("warn_on_failure",!0))&&this.$logger().$warn("could not retrieve contents of "+(c(g=d["$[]"]("label"))?g:"asset")+" at URI: "+b)}finally{a.pop_exception()}else throw w;
|
|
817
|
-
}}else c(d.$fetch("warn_on_failure",!0))&&this.$logger().$warn("cannot retrieve contents of "+(c(g=d["$[]"]("label"))?g:"asset")+" at URI: "+b+" (allow-uri-read attribute not enabled)");else b=this.$normalize_system_path(b,d["$[]"]("start"),t,f(["target_name"],{target_name:c(g=d["$[]"]("label"))?g:"asset"})),l=this.$read_asset(b,f(["normalize","warn_on_failure","label"],{normalize:d["$[]"]("normalize"),warn_on_failure:d.$fetch("warn_on_failure",!0),label:d["$[]"]("label")}));c(l)&&c(d["$[]"]("warn_if_empty"))&&
|
|
818
|
-
c(l["$empty?"]())&&this.$logger().$warn("contents of "+(c(g=d["$[]"]("label"))?g:"asset")+" is empty: "+b);return l},-2);return p(b,"$is_uri?",function(a){return y("Helpers")["$uriish?"](a)})}(k[0],null,k)}(y[0],y)};Opal.modules["asciidoctor/abstract_block"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.send2,c=a.find_super,p=a.eqeq,m=a.eqeqeq,g=a.def,l=a.return_val,e=a.truthy,n=a.alias,q=a.send,y=a.rb_plus,t=a.not,F=a.neqeq,x=[],v=a.nil,z=a.$$$;a.add_stubs("attr_reader,attr_writer,attr_accessor,==,===,level,file,lineno,playback_attributes,convert,converter,join,map,to_s,parent,parent=,<<,empty?,Integer,find_by_internal,to_proc,find_by,context,[],items,+,find_index,include?,next_adjacent_block,blocks,select,sub_specialchars,match?,sub_replacements,title,apply_title_subs,delete,!,reftext,nil_or_empty?,sub_placeholder,sub_quotes,compat_mode,attributes,chomp,increment_and_store_counter,index=,numbered,sectname,numeral=,counter,caption=,numeral,int_to_roman,each,assign_numeral,reindex_sections,protected,has_role?,raise,header?,!=,flatten,head,rows,merge,body,foot,style,inner_document");
|
|
819
|
-
return function(k,x){k=[b(k,"Asciidoctor")].concat(x);x=a.$r(k);return function(b,$super,k){b=d(b,$super,"AbstractBlock");k=[b].concat(k);var r=a.$r(k);k=b.$$prototype;k.source_location=k.document=k.attributes=k.blocks=k.numeral=k.context=k.parent=k.caption=k.style=k.converted_title=k.title=k.subs=k.next_section_index=k.next_section_ordinal=k.id=k.header=v;b.$attr_reader("blocks");b.$attr_writer("caption");b.$attr_accessor("content_model");b.$attr_accessor("level");b.$attr_accessor("numeral");b.$attr_accessor("source_location");
|
|
820
|
-
b.$attr_accessor("style");b.$attr_reader("subs");g(b,"$initialize",function na(a,b,d){var e=na.$$p||v;na.$$p=null;null==d&&(d=f([],{}));h(this,c(this,"initialize",na,!1,!0),"initialize",[a,b,d],e);this.content_model="compound";this.blocks=[];this.subs=[];this.id=this.title=this.caption=this.numeral=this.style=this.default_subs=this.source_location=v;return p(b,"document")||p(b,"section")?(this.level=this.next_section_index=0,this.next_section_ordinal=1):m(r("AbstractBlock"),a)?this.level=a.$level():
|
|
821
|
-
this.level=v},-3);g(b,"$block?",l(!0));g(b,"$inline?",l(!1));g(b,"$file",function(){var a;return e(a=this.source_location)?this.source_location.$file():a});g(b,"$lineno",function(){var a;return e(a=this.source_location)?this.source_location.$lineno():a});g(b,"$convert",function(){this.document.$playback_attributes(this.attributes);return this.$converter().$convert(this)});n(b,"render","convert");g(b,"$content",function(){return q(this.blocks,"map",[],function(a){null==a&&(a=v);return a.$convert()}).$join(r("LF"))});
|
|
822
|
-
g(b,"$context=",function(a){return this.node_name=(this.context=a).$to_s()});g(b,"$<<",function(a){if(!p(a.$parent(),this))a["$parent="](this);this.blocks["$<<"](a);return this});n(b,"append","<<");g(b,"$blocks?",function(){return e(this.blocks["$empty?"]())?!1:!0});g(b,"$sections?",l(!1));g(b,"$number",function(){try{return this.$Integer(this.numeral)}catch(Y){if(a.rescue(Y,[r("StandardError")]))try{return this.numeral}finally{a.pop_exception()}else throw Y;}});g(b,"$number=",function(a){return this.numeral=
|
|
823
|
-
a.$to_s()});g(b,"$find_by",function w(b){var c=w.$$p||v,d=v;w.$$p=null;null==b&&(b=f([],{}));try{return q(this,"find_by_internal",[b,d=[]],c.$to_proc())}catch(Ba){if(a.rescue(Ba,[z("StopIteration")]))try{return d}finally{a.pop_exception()}else throw Ba;}},-1);n(b,"query","find_by");g(b,"$next_adjacent_block",function(){var a=v,b=v;return p(this.context,"document")?v:p((a=this.parent).$context(),"dlist")&&p(this.context,"list_item")?e(b=a.$items()["$[]"](y(q(a.$items(),"find_index",[],function aa(a,
|
|
824
|
-
b){var c=null==aa.$$s?this:aa.$$s,d;null==a&&(a=v);null==b&&(b=v);return e(d=a["$include?"](c))?d:b["$=="](c)},{$$s:this}),1)))?b:a.$next_adjacent_block():e(b=a.$blocks()["$[]"](y(a.$blocks().$find_index(this),1)))?b:a.$next_adjacent_block()});g(b,"$sections",function(){return q(this.blocks,"select",[],function(a){null==a&&(a=v);return a.$context()["$=="]("section")})});g(b,"$alt",function(){var a;if(e(a=this.attributes["$[]"]("alt"))){if(p(a,this.attributes["$[]"]("default-alt")))return this.$sub_specialchars(a);
|
|
825
|
-
a=this.$sub_specialchars(a);return e(r("ReplaceableTextRx")["$match?"](a))?this.$sub_replacements(a):a}return""});g(b,"$caption",function(){return p(this.context,"admonition")?this.attributes["$[]"]("textlabel"):this.caption});g(b,"$captioned_title",function(){return""+this.caption+this.$title()});g(b,"$list_marker_keyword",function(a){var b=v;null==a&&(a=v);return r("ORDERED_LIST_KEYWORDS")["$[]"](e(b=a)?b:this.style)},-1);g(b,"$title",function(){var a=v,b=v;return this.converted_title=e(a=this.converted_title)?
|
|
826
|
-
a:e(b=this.title)?this.$apply_title_subs(this.title):b});g(b,"$title?",function(){return e(this.title)?!0:!1});g(b,"$title=",function(a){this.converted_title=v;return this.title=a});g(b,"$sub?",function(a){return this.subs["$include?"](a)});g(b,"$remove_sub",function(a){this.subs.$delete(a);return v});g(b,"$xreftext",function(a){var b=v,c=v,d=v;null==a&&(a=v);if(e(b=this.$reftext())&&t(b["$empty?"]()))return b;if(e(a)&&e(this.title)&&t(this.caption["$nil_or_empty?"]()))switch(a){case "full":return a=
|
|
827
|
-
this.$sub_placeholder(this.$sub_quotes(e(this.document.$compat_mode())?"``%s''":'"`%s`"'),this.$title()),e(this.numeral)&&e(d=r("CAPTION_ATTRIBUTE_NAMES")["$[]"](this.context))&&e(c=this.document.$attributes()["$[]"](d))?""+c+" "+this.numeral+", "+a:""+this.caption.$chomp(". ")+", "+a;case "short":return e(this.numeral)&&e(d=r("CAPTION_ATTRIBUTE_NAMES")["$[]"](this.context))&&e(c=this.document.$attributes()["$[]"](d))?""+c+" "+this.numeral:this.caption.$chomp(". ");default:return this.$title()}else return this.$title()},
|
|
828
|
-
-1);g(b,"$assign_caption",function(a,b){var c=v,d=v,f=v;null==b&&(b=this.context);e(this.caption)||t(this.title)||e(this.caption=e(c=a)?c:this.document.$attributes()["$[]"]("caption"))||!e(f=r("CAPTION_ATTRIBUTE_NAMES")["$[]"](b))||!e(d=this.document.$attributes()["$[]"](f))||(this.caption=""+d+" "+(this.numeral=this.document.$increment_and_store_counter(""+b+"-number",this))+". ");return v},-2);g(b,"$assign_numeral",function(a){var b,c,d=v;this.next_section_index=y((b=[this.next_section_index],q(a,
|
|
829
|
-
"index=",b),b[b.length-1]),1);if(e(b=a.$numbered()))if(p(c=a.$sectname(),"appendix"))a["$numeral="](this.document.$counter("appendix-number","A")),a["$caption="](e(d=this.document.$attributes()["$[]"]("appendix-caption"))?""+d+" "+a.$numeral()+": ":""+a.$numeral()+". ");else if(p(c,"chapter")||p(b,"chapter"))a["$numeral="](this.document.$counter("chapter-number",1).$to_s());else a["$numeral="](p(c,"part")?r("Helpers").$int_to_roman(this.next_section_ordinal):this.next_section_ordinal.$to_s()),this.next_section_ordinal=
|
|
830
|
-
y(this.next_section_ordinal,1);return v});g(b,"$reindex_sections",function(){this.next_section_index=0;this.next_section_ordinal=1;return q(this.blocks,"each",[],function na(a){var b=null==na.$$s?this:na.$$s;null==a&&(a=v);return p(a.$context(),"section")?(b.$assign_numeral(a),a.$reindex_sections()):v},{$$s:this})});b.$protected();return g(b,"$find_by_internal",function ta(b,c){var d=ta.$$p||v,h=v,l=v,g=v,k=v,m=v,n=v;ta.$$p=null;null==b&&(b=f([],{}));null==c&&(c=[]);if((e(k=e(m=b["$[]"]("context"))?
|
|
831
|
-
v:!0)||p(m,this.context))&&(t(g=b["$[]"]("style"))||p(g,this.style))&&(t(l=b["$[]"]("role"))||e(this["$has_role?"](l)))&&(t(h=b["$[]"]("id"))||p(h,this.id)))if(d!==v)if(e(n=a.yield1(d,this)))switch(n){case "prune":return c["$<<"](this),e(h)&&this.$raise(z("StopIteration")),c;case "reject":return e(h)&&this.$raise(z("StopIteration")),c;case "stop":this.$raise(z("StopIteration"));break;default:c["$<<"](this),e(h)&&this.$raise(z("StopIteration"))}else e(h)&&this.$raise(z("StopIteration"));else c["$<<"](this),
|
|
832
|
-
e(h)&&this.$raise(z("StopIteration"));switch(this.context){case "document":p(m,"document")||(e(this["$header?"]())&&(e(k)||p(m,"section"))&&q(this.header,"find_by_internal",[b,c],d.$to_proc()),q(this.blocks,"each",[],function(a){null==a&&(a=v);return p(m,"section")&&F(a.$context(),"section")?v:q(a,"find_by_internal",[b,c],d.$to_proc())}));break;case "dlist":(e(k)||F(m,"section"))&&q(this.blocks.$flatten(),"each",[],function(a){null==a&&(a=v);return e(a)?q(a,"find_by_internal",[b,c],d.$to_proc()):
|
|
833
|
-
v});break;case "table":e(b["$[]"]("traverse_documents"))?(q(this.$rows().$head(),"each",[],function(a){null==a&&(a=v);return q(a,"each",[],function(a){null==a&&(a=v);return q(a,"find_by_internal",[b,c],d.$to_proc())})}),p(m,"inner_document")&&(b=b.$merge(f(["context"],{context:"document"}))),q(y(this.$rows().$body(),this.$rows().$foot()),"each",[],function(a){null==a&&(a=v);return q(a,"each",[],function(a){null==a&&(a=v);q(a,"find_by_internal",[b,c],d.$to_proc());return p(a.$style(),"asciidoc")?q(a.$inner_document(),
|
|
834
|
-
"find_by_internal",[b,c],d.$to_proc()):v})})):q(y(y(this.$rows().$head(),this.$rows().$body()),this.$rows().$foot()),"each",[],function(a){null==a&&(a=v);return q(a,"each",[],function(a){null==a&&(a=v);return q(a,"find_by_internal",[b,c],d.$to_proc())})});break;default:q(this.blocks,"each",[],function(a){null==a&&(a=v);return p(m,"section")&&F(a.$context(),"section")?v:q(a,"find_by_internal",[b,c],d.$to_proc())})}return c},-1)}(k[0],x("AbstractNode"),k)}(x[0],x)};Opal.modules["asciidoctor/attribute_list"]=
|
|
835
|
-
function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.hash,c=a.regexp,p=a.hash2,m=a.def,g=a.truthy,l=a.rb_plus,e=a.send,n=a.defs,q=a.eqeqeq,y=a.eqeq,t=a.rb_times,F=[],v=a.nil,x=a.$$$;a.add_stubs("new,[],update,parse,parse_attribute,eos?,skip_delimiter,+,rekey,each_with_index,[]=,private,skip_blank,===,peek,parse_attribute_value,get_byte,start_with?,scan_name,end_with?,rstrip,string,==,unscan,scan_to_delimiter,*,include?,delete,each,split,empty?,apply_subs,scan_to_quote,gsub,skip,scan");return function(k,
|
|
836
|
-
F){k=[b(k,"Asciidoctor")].concat(F);return function(b,$super,k){b=d(b,$super,"AttributeList");k=[b].concat(k);var u=a.$r(k),r=b.$$prototype;r.attributes=r.scanner=r.delimiter=r.block=r.delimiter_skip_pattern=r.delimiter_boundary_pattern=v;f(k[0],"APOS","'");f(k[0],"BACKSLASH","\\");f(k[0],"QUOT",'"');f(k[0],"BoundaryRx",h(u("QUOT"),/.*?[^\\](?=")/,u("APOS"),/.*?[^\\](?=')/,",",/.*?(?=[ \t]*(,|$))/));f(k[0],"EscapedQuotes",h(u("QUOT"),'\\"',u("APOS"),"\\'"));f(k[0],"NameRx",c([u("CG_WORD"),"[",u("CC_WORD"),
|
|
837
|
-
"\\-.]*"]));f(k[0],"BlankRx",/[ \t]+/);f(k[0],"SkipRx",p([","],{",":/[ \t]*(,|$)/}));m(b,"$initialize",function(a,b,c){null==b&&(b=v);null==c&&(c=",");this.scanner=x("StringScanner").$new(a);this.block=b;this.delimiter=c;this.delimiter_skip_pattern=u("SkipRx")["$[]"](c);this.delimiter_boundary_pattern=u("BoundaryRx")["$[]"](c);return this.attributes=v},-2);m(b,"$parse_into",function(a,b){null==b&&(b=[]);return a.$update(this.$parse(b))},-2);m(b,"$parse",function(a){var b;null==a&&(a=[]);if(g(this.attributes))return this.attributes;
|
|
838
|
-
this.attributes=p([],{});for(b=0;g(this.$parse_attribute(b,a))&&!g(this.scanner["$eos?"]());)this.$skip_delimiter(),b=l(b,1);return this.attributes},-1);m(b,"$rekey",function(a){return u("AttributeList").$rekey(this.attributes,a)});n(b,"$rekey",function(a,b){e(b,"each_with_index",[],function(b,c){var d,f=v;null==b&&(b=v);null==c&&(c=v);return g(b)&&g(f=a["$[]"](l(c,1)))?(d=[b,f],e(a,"[]=",d),d[d.length-1]):v});return a});b.$private();m(b,"$parse_attribute",function(a,b){var c=v,d=v,f=d=v,h=v,k=v,
|
|
839
|
-
p=v,m=v,n=v;h=v;c=!0;this.$skip_blank();if(q(u("QUOT"),d=this.scanner.$peek(1)))d=this.$parse_attribute_value(this.scanner.$get_byte());else if(q(u("APOS"),d))d=this.$parse_attribute_value(this.scanner.$get_byte()),g(d["$start_with?"](u("APOS")))||(f=!0);else if(h=g(k=g(p=d=this.$scan_name())?this.$skip_blank():p)?k:0,g(this.scanner["$eos?"]())){if(!g(d)&&!g(this.scanner.$string().$rstrip()["$end_with?"](this.delimiter)))return v;c=v}else if(y(m=this.scanner.$get_byte(),this.delimiter))this.scanner.$unscan();
|
|
840
|
-
else if(g(d))if(y(m,"="))if(this.$skip_blank(),q(u("QUOT"),k=m=this.scanner.$get_byte()))n=this.$parse_attribute_value(m);else if(q(u("APOS"),k))n=this.$parse_attribute_value(m),g(n["$start_with?"](u("APOS")))||(f=!0);else if(q(this.delimiter,k))n="",this.scanner.$unscan();else if(q(v,k))n="";else{if(n=""+m+this.$scan_to_delimiter(),y(n,"None"))return!0}else d=""+d+t(" ",h)+m+this.$scan_to_delimiter();else d=""+m+this.$scan_to_delimiter();if(g(n))switch(d){case "options":case "opts":if(g(n["$include?"](",")))g(n["$include?"](" "))&&
|
|
841
|
-
(n=n.$delete(" ")),e(n.$split(","),"each",[],function da(a){var b,c=null==da.$$s?this:da.$$s;null==c.attributes&&(c.attributes=v);null==a&&(a=v);return g(a["$empty?"]())?v:(b=[""+a+"-option",""],e(c.attributes,"[]=",b),b[b.length-1])},{$$s:this});else if(!g(n["$empty?"]()))this.attributes["$[]="](""+n+"-option","");break;default:if(g(f)&&g(this.block))switch(d){case "title":case "reftext":this.attributes["$[]="](d,n);break;default:this.attributes["$[]="](d,this.block.$apply_subs(n))}else this.attributes["$[]="](d,
|
|
842
|
-
n)}else{g(f)&&g(this.block)&&(d=this.block.$apply_subs(d));if(g(h=b["$[]"](a))&&g(d))this.attributes["$[]="](h,d);this.attributes["$[]="](l(a,1),d)}return c});m(b,"$parse_attribute_value",function(a){var b;return y(this.scanner.$peek(1),a)?(this.scanner.$get_byte(),""):g(b=this.$scan_to_quote(a))?(this.scanner.$get_byte(),g(b["$include?"](u("BACKSLASH")))?b.$gsub(u("EscapedQuotes")["$[]"](a),a):b):""+a+this.$scan_to_delimiter()});m(b,"$skip_blank",function(){return this.scanner.$skip(u("BlankRx"))});
|
|
843
|
-
m(b,"$skip_delimiter",function(){return this.scanner.$skip(this.delimiter_skip_pattern)});m(b,"$scan_name",function(){return this.scanner.$scan(u("NameRx"))});m(b,"$scan_to_delimiter",function(){return this.scanner.$scan(this.delimiter_boundary_pattern)});return m(b,"$scan_to_quote",function(a){return this.scanner.$scan(u("BoundaryRx")["$[]"](a))})}(k[0],null,k)}(F[0],F)};Opal.modules["asciidoctor/block"]=function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.hash2,c=a.alias,p=a.send2,m=a.find_super,
|
|
844
|
-
g=a.truthy,l=a.eqeqeq,e=a.def,n=a.rb_lt,q=a.eqeq,y=[],t=a.nil,v=a.$$$;a.add_stubs("default=,context,attr_accessor,[],key?,===,drop,delete,[]=,to_s,commit_subs,nil_or_empty?,prepare_source_string,apply_subs,join,<,size,empty?,rstrip,shift,pop,==,warn,logger,class,object_id,inspect");return function(k,y){k=[b(k,"Asciidoctor")].concat(y);y=a.$r(k);return function(b,$super,k){b=d(b,$super,"Block");k=[b].concat(k);var y=a.$r(k),u=b.$$prototype;u.attributes=u.content_model=u.lines=u.subs=u.blocks=u.context=
|
|
845
|
-
u.style=t;f(k[0],"DEFAULT_CONTENT_MODEL",h("audio image listing literal stem open page_break pass thematic_break video".split(" "),{audio:"empty",image:"empty",listing:"verbatim",literal:"verbatim",stem:"raw",open:"compound",page_break:"empty",pass:"raw",thematic_break:"empty",video:"empty"}))["$default="]("simple");c(b,"blockname","context");b.$attr_accessor("lines");e(b,"$initialize",function C(a,b,c){var d=C.$$p||t,e=t,f;C.$$p=null;null==c&&(c=h([],{}));p(this,m(this,"initialize",C,!1,!0),"initialize",
|
|
846
|
-
[a,b,c],d);this.content_model=g(e=c["$[]"]("content_model"))?e:y("DEFAULT_CONTENT_MODEL")["$[]"](b);g(c["$key?"]("subs"))?g(a=c["$[]"]("subs"))?(l("default",e=a)?this.default_subs=c["$[]"]("default_subs"):l(v("Array"),e)?(this.default_subs=a.$drop(0),this.attributes.$delete("subs")):(this.default_subs=t,this.attributes["$[]="]("subs",a.$to_s())),this.$commit_subs()):(this.default_subs=[],this.attributes.$delete("subs")):this.default_subs=t;return g((f=c["$[]"]("source"))["$nil_or_empty?"]())?this.lines=
|
|
847
|
-
[]:l(v("String"),f)?this.lines=y("Helpers").$prepare_source_string(f):this.lines=f.$drop(0)},-3);e(b,"$content",function pa(){var a=pa.$$p||t,b=t,c=t,d=t;pa.$$p=null;switch(this.content_model){case "compound":return p(this,m(this,"content",pa,!1,!0),"content",[],a);case "simple":return this.$apply_subs(this.lines.$join(y("LF")),this.subs);case "verbatim":case "raw":a=this.$apply_subs(this.lines,this.subs);if(g(n(a.$size(),2)))return g(b=a["$[]"](0))?b:"";for(;g(g(b=c=a["$[]"](0))?c.$rstrip()["$empty?"]():
|
|
848
|
-
b);)a.$shift();for(;g(g(b=d=a["$[]"](-1))?d.$rstrip()["$empty?"]():b);)a.$pop();return a.$join(y("LF"));default:return q(this.content_model,"empty")||this.$logger().$warn("unknown content model '"+this.content_model+"' for block: "+this),t}});e(b,"$source",function(){return this.lines.$join(y("LF"))});return e(b,"$to_s",function(){var a=q(this.content_model,"compound")?"blocks: "+this.blocks.$size():"lines: "+this.lines.$size();return"#<"+this.$class()+"@"+this.$object_id()+" {context: "+this.context.$inspect()+
|
|
849
|
-
", content_model: "+this.content_model.$inspect()+", style: "+this.style.$inspect()+", "+a+"}>"})}(k[0],y("AbstractBlock"),k)}(y[0],y)};Opal.modules["asciidoctor/callouts"]=function(a){var b=a.module,d=a.klass,f=a.def,h=a.hash2,c=a.rb_plus,p=a.truthy,m=a.rb_le,g=a.rb_minus,l=a.send,e=a.eqeq,n=a.rb_lt,q=[],y=a.nil;a.add_stubs("next_list,<<,current_list,to_i,generate_next_callout_id,+,<=,size,[],-,chop,join,map,==,<,private,generate_callout_id");return function(a,k){return function(a,$super){a=d(a,
|
|
850
|
-
$super,"Callouts");var b=a.$$prototype;b.co_index=b.lists=b.list_index=y;f(a,"$initialize",function(){this.lists=[];this.list_index=0;return this.$next_list()});f(a,"$register",function(a){this.$current_list()["$<<"](h(["ordinal","id"],{ordinal:a.$to_i(),id:a=this.$generate_next_callout_id()}));this.co_index=c(this.co_index,1);return a});f(a,"$read_next_id",function(){var a=y;var b=this.$current_list();p(m(this.co_index,b.$size()))&&(a=b["$[]"](g(this.co_index,1))["$[]"]("id"));this.co_index=c(this.co_index,
|
|
851
|
-
1);return a});f(a,"$callout_ids",function(a){return l(this.$current_list(),"map",[],function(b){null==b&&(b=y);return e(b["$[]"]("ordinal"),a)?""+b["$[]"]("id")+" ":""}).$join().$chop()});f(a,"$current_list",function(){return this.lists["$[]"](g(this.list_index,1))});f(a,"$next_list",function(){this.list_index=c(this.list_index,1);if(p(n(this.lists.$size(),this.list_index)))this.lists["$<<"]([]);this.co_index=1;return y});f(a,"$rewind",function(){this.co_index=this.list_index=1;return y});a.$private();
|
|
852
|
-
f(a,"$generate_next_callout_id",function(){return this.$generate_callout_id(this.list_index,this.co_index)});return f(a,"$generate_callout_id",function(a,b){return"CO"+a+"-"+b})}([b(a,"Asciidoctor")].concat(k)[0],null)}(q[0],q)};Opal.modules["asciidoctor/converter/composite"]=function(a){var b=a.module,d=a.klass,f=a.slice,h=a.extract_kwargs,c=a.ensure_kwargs,p=a.send,m=a.truthy,g=a.def,l=a.thrower,e=[],n=a.nil,q=a.$$$;a.add_stubs("attr_reader,each,respond_to?,composed,init_backend_traits,backend_traits,new,[]=,find_converter,convert,converter_for,node_name,[],handles?,raise");
|
|
853
|
-
return function(e,k){e=[b(e,"Asciidoctor")].concat(k);e=a.$r(e);return function(a,$super){a=d(a,$super,"CompositeConverter");var b=a.$$prototype;b.converter_cache=b.converters=n;a.$attr_reader("converters");g(a,"$initialize",function(a,b,d){var e=f(arguments,1);var l=h(e);l=c(l);l=l.$$smap.backend_traits_source;null==l&&(l=n);this.backend=a;p(this.converters=e,"each",[],function pa(a){var b=null==pa.$$s?this:pa.$$s;null==a&&(a=n);return m(a["$respond_to?"]("composed"))?a.$composed(b):n},{$$s:this});
|
|
854
|
-
m(l)&&this.$init_backend_traits(l.$backend_traits());return this.converter_cache=p(q("Hash"),"new",[],function C(a,b){var c,d=null==C.$$s?this:C.$$s;null==a&&(a=n);null==b&&(b=n);return c=[b,d.$find_converter(b)],p(a,"[]=",c),c[c.length-1]},{$$s:this})},-2);g(a,"$convert",function(a,b,c){var d=n;null==b&&(b=n);null==c&&(c=n);return this.$converter_for(b=m(d=b)?d:a.$node_name()).$convert(a,b,c)},-2);g(a,"$converter_for",function(a){return this.converter_cache["$[]"](a)});return g(a,"$find_converter",
|
|
855
|
-
function(a){try{var b=l("return");p(this.converters,"each",[],function(c){null==c&&(c=n);if(m(c["$handles?"](a)))b.$throw(c);else return n},{$$ret:b});return this.$raise("Could not find a converter to handle transform: "+a)}catch(ja){if(ja===b)return ja.$v;throw ja;}})}(e("Converter"),q(e("Converter"),"Base"))}(e[0],e)};Opal.modules["asciidoctor/converter"]=function(a){var b=a.module,d=a.hash2,f=a.def,h=a.return_val,c=a.truthy,p=a.eqeq,m=a.defs,g=a.send,l=a.alias,e=a.slice,n=a.to_a,q=a.extract_kwargs,
|
|
856
|
-
t=a.ensure_kwargs,v=a.eqeqeq,F=a.Class,x=a.klass,z=a.class_variable_set,D=a.class_variable_get,B=a.rb_plus,A=a.gvars,E=[],u=a.nil,G=a.$$$;a.add_stubs("autoload,attr_reader,raise,class,[],sub,slice,length,==,[]=,backend_traits,derive_backend_traits,register,map,to_s,new,create,default,each,default=,registry,for,===,supports_templates?,merge,private,include,delete,clear,send,extend,private_class_method,node_name,+,name,receiver,warn,logger,respond_to?,content");return function(k,y){k=[b(k,"Asciidoctor")].concat(y);
|
|
857
|
-
return function(k,r){k=b(k,"Converter");r=[k].concat(r);var w=a.$r(r);k.$autoload("CompositeConverter","asciidoctor/converter/composite");u;k.$attr_reader("backend");f(k,"$initialize",function(a,b){null==b&&d([],{});return this.backend=a},-2);f(k,"$convert",function(a,b,c){null==this.backend&&(this.backend=u);return this.$raise(G("NotImplementedError"),""+this.$class()+" (backend: "+this.backend+") must implement the #convert method")},-2);f(k,"$handles?",h(!0));m(k,"$derive_backend_traits",function(a,
|
|
858
|
-
b){var e,f=u,h;null==b&&(b=u);if(!c(a))return d([],{});c(e=w("DEFAULT_EXTENSIONS")["$[]"](b=c(f=b)?f:a.$sub(w("TrailingDigitsRx"),"")))?h=e.$slice(1,e.$length()):e="."+(h=b);return p(h,"html")?d(["basebackend","filetype","htmlsyntax","outfilesuffix"],{basebackend:b,filetype:h,htmlsyntax:"html",outfilesuffix:e}):d(["basebackend","filetype","outfilesuffix"],{basebackend:b,filetype:h,outfilesuffix:e})},-2);(function(e,h){e=b(e,"BackendTraits");h=[e].concat(h);var k=a.$r(h);f(e,"$basebackend",function(a){var b;
|
|
859
|
-
null==a&&(a=u);return c(a)?(b=["basebackend",a],g(this.$backend_traits(a),"[]=",b),b[b.length-1]):this.$backend_traits()["$[]"]("basebackend")},-1);f(e,"$filetype",function(a){var b;null==a&&(a=u);return c(a)?(b=["filetype",a],g(this.$backend_traits(),"[]=",b),b[b.length-1]):this.$backend_traits()["$[]"]("filetype")},-1);f(e,"$htmlsyntax",function(a){var b;null==a&&(a=u);return c(a)?(b=["htmlsyntax",a],g(this.$backend_traits(),"[]=",b),b[b.length-1]):this.$backend_traits()["$[]"]("htmlsyntax")},-1);
|
|
860
|
-
f(e,"$outfilesuffix",function(a){var b;null==a&&(a=u);return c(a)?(b=["outfilesuffix",a],g(this.$backend_traits(),"[]=",b),b[b.length-1]):this.$backend_traits()["$[]"]("outfilesuffix")},-1);f(e,"$supports_templates",function(a){var b;null==a&&(a=!0);return b=["supports_templates",a],g(this.$backend_traits(),"[]=",b),b[b.length-1]},-1);f(e,"$supports_templates?",function(){return this.$backend_traits()["$[]"]("supports_templates")});f(e,"$init_backend_traits",function(a){var b=u;null==a&&(a=u);return this.backend_traits=
|
|
861
|
-
c(b=a)?b:d([],{})},-1);f(e,"$backend_traits",function(a){var b=u;null==this.backend_traits&&(this.backend_traits=u);null==this.backend&&(this.backend=u);null==a&&(a=u);return this.backend_traits=c(b=this.backend_traits)?b:k("Converter").$derive_backend_traits(this.backend,a)},-1);l(e,"backend_info","backend_traits");return m(e,"$derive_backend_traits",function(a,b){null==b&&(b=u);return k("Converter").$derive_backend_traits(a,b)},-2)})(r[0],r);(function(c,d){c=b(c,"Config");d=[c].concat(d);var h=
|
|
862
|
-
a.$r(d);return f(c,"$register_for",function(a){var b=e(arguments);return g(h("Converter"),"register",[this].concat(n(g(b,"map",[],function(a){null==a&&(a=u);return a.$to_s()}))))},-1)})(r[0],r);(function(h,l){h=b(h,"Factory");l=[h].concat(l);var k=a.$r(l);m(h,"$new",function(a,b){var d;var f=e(arguments);var h=q(f);h=t(h);0<f.length&&(d=f.shift());null==d&&(d=u);f=h.$$smap.proxy_default;null==f&&(f=!0);return c(f)?k("DefaultFactoryProxy").$new(d):k("CustomFactory").$new(d)},-1);m(h,"$default",function(a){e(arguments);
|
|
863
|
-
return k("Converter")},-1);m(h,"$create",function(a,b){null==b&&(b=d([],{}));return this.$default().$create(a,b)},-2);f(h,"$register",function(a,b){var c=e(arguments,1);return g(c,"each",[],function da(b){var c,d=null==da.$$s?this:da.$$s;null==b&&(b=u);return p(b,"*")?(c=[a],g(d.$registry(),"default=",c),c[c.length-1]):(c=[b,a],g(d.$registry(),"[]=",c),c[c.length-1])},{$$s:this})},-2);f(h,"$for",function(a){return this.$registry()["$[]"](a)});f(h,"$create",function(a,b){var e,f,h=u;null==b&&(b=d([],
|
|
864
|
-
{}));return c(e=this.$for(a))?(v(F,e)&&(e=e.$new(a,b)),c(f=b["$[]"]("template_dirs"))&&v(k("BackendTraits"),e)&&c(e["$supports_templates?"]())?k("CompositeConverter").$new(a,k("TemplateConverter").$new(a,f,b),e,d(["backend_traits_source"],{backend_traits_source:e})):e):c(f=b["$[]"]("template_dirs"))?c(h=b["$[]"]("delegate_backend"))&&c(e=this.$for(h))?(v(F,e)&&(e=e.$new(h,b)),k("CompositeConverter").$new(a,k("TemplateConverter").$new(a,f,b),e,d(["backend_traits_source"],{backend_traits_source:e}))):
|
|
865
|
-
k("TemplateConverter").$new(a,f,b):u},-2);f(h,"$converters",function(){return this.$registry().$merge()});h.$private();return f(h,"$registry",function(){return this.$raise(G("NotImplementedError"),""+k("Factory")+" subclass "+this.$class()+" must implement the #registry method")})})(r[0],r);(function(b,$super,e){b=x(b,$super,"CustomFactory");e=[b].concat(e);e=a.$r(e);b.$include(e("Factory"));f(b,"$initialize",function(a){null==a&&(a=u);return c(a)?(a["$default="](a.$delete("*")),this.registry=a):
|
|
866
|
-
this.registry=d([],{})},-1);f(b,"$unregister_all",function(){var a;return a=[u],g(this.$registry().$clear(),"default=",a),a[a.length-1]});b.$private();return b.$attr_reader("registry")})(r[0],null,r);(function(c,e){c=b(c,"DefaultFactory");var h=[c].concat(e);e=a.$r(h);c.$include(e("Factory"));c.$private();z(h[0],"@@registry",d([],{}));f(c,"$registry",function(){return D(h[0],"@@registry",!1)});return u})(r[0],r);(function(b,$super,c){b=x(b,$super,"DefaultFactoryProxy");c=[b].concat(c);c=a.$r(c);b.$include(c("DefaultFactory"));
|
|
867
|
-
return u})(r[0],w("CustomFactory"),r);m(k,"$included",function(a){a.$send("include",w("BackendTraits"));return a.$extend(w("Config"))});k.$private_class_method("included");(function(b,$super,d){b=x(b,$super,"Base");d=[b].concat(d);var e=a.$r(d);b.$$prototype.backend=u;b.$include(e("Logging"));b.$include(e("Converter"));f(b,"$convert",function(b,d,f){var h=u;null==A["!"]&&(A["!"]=u);null==d&&(d=b.$node_name());null==f&&(f=u);try{return c(f)?this.$send(B("convert_",d),b,f):this.$send(B("convert_",d),
|
|
868
|
-
b)}catch(da){if(a.rescue(da,[e("StandardError")]))try{return v(G("NoMethodError"),h=A["!"])&&p(h.$receiver(),this)&&p(h.$name().$to_s(),d)||this.$raise(),this.$logger().$warn("missing convert handler for "+h.$name()+" node in "+this.backend+" backend ("+this.$class()+")"),u}finally{a.pop_exception()}else throw da;}},-2);f(b,"$handles?",function(a){return this["$respond_to?"]("convert_"+a)});f(b,"$content_only",function(a){return a.$content()});return f(b,"$skip",h(u))})(r[0],null,r);return k.$extend(w("DefaultFactory"))}(k[0],
|
|
869
|
-
k)}(E[0],E)};Opal.modules["asciidoctor/document"]=function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.send,c=a.alias,p=a.truthy,m=a.def,g=a.hash2,l=a.not,e=a.to_ary,n=a.return_ivar,q=a.send2,t=a.find_super,v=a.rb_minus,F=a.eqeq,x=a.eqeqeq,z=a.hash,D=a.rb_ge,B=a.rb_plus,A=a.neqeq,E=a.thrower,u=a.rb_gt,G=a.rb_lt,r=a.gvars,I=a.to_a,L=[],C=a.nil,w=a.$$$;a.add_stubs("new,target,attr_reader,nil?,<<,[],[]=,main,include?,strip,squeeze,gsub,!,empty?,rpartition,attr_accessor,catalog,delete,base_dir,options,merge,instance_variable_get,attributes,safe,compat_mode,outfilesuffix,sourcemap,path_resolver,converter,extensions,syntax_highlighter,each,end_with?,start_with?,slice,-,length,chop,==,downcase,===,extname,value_for_name,key?,freeze,attribute_undefined,attribute_missing,update,&,keys,name_for_value,expand_path,pwd,to_s,>=,+,abs,to_i,delete_if,update_doctype_attributes,cursor,parse,restore_attributes,update_backend_attributes,fetch,fill_datetime_attributes,activate,groups,create,to_proc,preprocessors?,preprocessors,process_method,tree_processors?,tree_processors,!=,counter,nil_or_empty?,attribute_locked?,nextval,value,save_to,increment_and_store_counter,register,tap,xreftext,>,source,source_lines,doctitle,sectname=,title=,first_section,title,reftext,<,find,context,header?,assign_numeral,clear_playback_attributes,save_attributes,name,negate,rewind,replace,apply_attribute_value_subs,delete?,start,doctype,content_model,warn,logger,content,convert,postprocessors?,postprocessors,record,write,respond_to?,chomp,class,write_alternate_pages,map,split,resolve_docinfo_subs,normalize_system_path,read_asset,apply_subs,docinfo_processors?,join,concat,compact,docinfo_processors,object_id,inspect,size,private,=~,resolve_pass_subs,apply_header_subs,limit_bytesize,bytesize,valid_encoding?,byteslice,resolve_subs,utc,at,Integer,now,index,strftime,year,utc_offset,partition,create_converter,basebackend,filetype,htmlsyntax,derive_backend_traits,raise");
|
|
870
|
-
return function(k,y){k=[b(k,"Asciidoctor")].concat(y);y=a.$r(k);return function(b,$super,k){b=d(b,$super,"Document");k=[b].concat(k);var y=a.$r(k),ca=b.$$prototype;ca.attributes=ca.safe=ca.sourcemap=ca.reader=ca.base_dir=ca.parsed=ca.parent_document=ca.extensions=ca.options=ca.counters=ca.catalog=ca.reftexts=ca.next_section_index=ca.header=ca.blocks=ca.header_attributes=ca.attributes_modified=ca.backend=ca.attribute_overrides=ca.timings=ca.converter=ca.outfilesuffix=ca.docinfo_processor_extensions=
|
|
871
|
-
ca.document=ca.max_attribute_value_size=ca.id=ca.doctype=C;f(k[0],"ImageReference",h(w("Struct"),"new",["target","imagesdir"],function da(){return c(null==da.$$s?this:da.$$s,"to_s","target")},{$$s:b}));f(k[0],"Footnote",w("Struct").$new("index","id","text"));(function(a,$super){a=d(a,$super,"AttributeEntry");a.$attr_reader("name","value","negate");m(a,"$initialize",function(a,b,c){null==c&&(c=C);this.name=a;this.value=b;return this.negate=p(c["$nil?"]())?b["$nil?"]():c},-3);return m(a,"$save_to",
|
|
872
|
-
function(a){var b,c=C;(p(c=a["$[]"]("attribute_entries"))?c:(b=["attribute_entries",[]],h(a,"[]=",b),b[b.length-1]))["$<<"](this);return this})})(k[0],null);(function(b,$super,f){b=d(b,$super,"Title");f=[b].concat(f);var h=a.$r(f);b.$$prototype.subtitle=C;b.$attr_reader("main");c(b,"title","main");b.$attr_reader("subtitle");b.$attr_reader("combined");m(b,"$initialize",function(a,b){var c,d=c=C;null==b&&(b=g([],{}));p(this.sanitized=b["$[]"]("sanitize"))&&p(a["$include?"]("<"))&&(a=a.$gsub(h("XmlSanitizeRx"),
|
|
873
|
-
"").$squeeze(" ").$strip());p((c=p(d=b["$[]"]("separator"))?d:":")["$empty?"]())||l(a["$include?"](c=""+c+" "))?(this.main=a,this.subtitle=C):(c=a.$rpartition(c),b=e(c),this.main=null==b[0]?C:b[0],this.subtitle=null==b[2]?C:b[2],c);return this.combined=a},-2);m(b,"$sanitized?",n("sanitized"));m(b,"$subtitle?",function(){return p(this.subtitle)?!0:!1});return m(b,"$to_s",n("combined"))})(k[0],null,k);f(k[0],"Author",w("Struct").$new("name","firstname","middlename","lastname","initials","email"));b.$attr_reader("safe");
|
|
874
|
-
b.$attr_reader("compat_mode");b.$attr_reader("backend");b.$attr_reader("doctype");b.$attr_accessor("sourcemap");b.$attr_reader("catalog");c(b,"references","catalog");b.$attr_reader("counters");b.$attr_reader("header");b.$attr_reader("base_dir");b.$attr_reader("options");b.$attr_reader("outfilesuffix");b.$attr_reader("parent_document");b.$attr_reader("reader");b.$attr_reader("path_resolver");b.$attr_reader("converter");b.$attr_reader("syntax_highlighter");b.$attr_reader("extensions");m(b,"$initialize",
|
|
875
|
-
function V(b,c){var d,e,f,Q,k=C,m=C,n=C,X=C,u=C,r=C,ca=r=r=C,ba=C,O=ca=C,qa=ca=ca=C;k=k=k=C;V.$$p=null;null==b&&(b=C);null==c&&(c=g([],{}));q(this,t(this,"initialize",V,!1,!0),"initialize",[this,"document"],null);if(p(k=c.$delete("parent"))){this.parent_document=k;if(p(m=c["$[]"]("base_dir")))m;else c["$[]="]("base_dir",k.$base_dir());if(p(k.$options()["$[]"]("catalog_assets")))c["$[]="]("catalog_assets",!0);if(p(k.$options()["$[]"]("to_dir")))c["$[]="]("to_dir",k.$options()["$[]"]("to_dir"));this.catalog=
|
|
876
|
-
k.$catalog().$merge(g(["footnotes"],{footnotes:[]}));this.attribute_overrides=n=k.$instance_variable_get("@attribute_overrides").$merge(k.$attributes());n.$delete("compat-mode");X=n.$delete("doctype");n.$delete("notitle");n.$delete("showtitle");n.$delete("toc");this.attributes["$[]="]("toc-placement",p(m=n.$delete("toc-placement"))?m:"auto");n.$delete("toc-position");this.safe=k.$safe();if(p(this.compat_mode=k.$compat_mode()))this.attributes["$[]="]("compat-mode","");this.outfilesuffix=k.$outfilesuffix();
|
|
877
|
-
this.sourcemap=k.$sourcemap();this.timings=C;this.path_resolver=k.$path_resolver();this.converter=k.$converter();u=C;this.extensions=k.$extensions();this.syntax_highlighter=k.$syntax_highlighter()}else{this.parent_document=C;this.catalog=g("ids refs footnotes links images callouts includes".split(" "),{ids:g([],{}),refs:g([],{}),footnotes:[],links:[],images:[],callouts:y("Callouts").$new(),includes:g([],{})});this.attribute_overrides=n=g([],{});h(p(m=c["$[]"]("attributes"))?m:g([],{}),"each",[],function(a,
|
|
878
|
-
b){var c;null==a&&(a=C);null==b&&(b=C);p(a["$end_with?"]("@"))?(p(a["$start_with?"]("!"))?(c=[a.$slice(1,v(a.$length(),2)),!1],a=c[0],b=c[1]):p(a["$end_with?"]("!@"))?(c=[a.$slice(0,v(a.$length(),2)),!1],a=c[0],b=c[1]):(c=[a.$chop(),""+b+"@"],a=c[0],b=c[1]),c):p(a["$start_with?"]("!"))?(c=[a.$slice(1,a.$length()),F(b,"@")?!1:C],a=c[0],b=c[1],c):p(a["$end_with?"]("!"))&&(c=[a.$chop(),F(b,"@")?!1:C],a=c[0],b=c[1],c);return c=[a.$downcase(),b],h(n,"[]=",c),c[c.length-1]});if(x(w("String"),r=c["$[]"]("to_file")))n["$[]="]("outfilesuffix",
|
|
879
|
-
y("Helpers").$extname(r));if(l(r=c["$[]"]("safe")))this.safe=w(y("SafeMode"),"SECURE");else if(x(w("Integer"),r))this.safe=r;else{a:{try{var na=y("SafeMode").$value_for_name(r);break a}catch(Ka){if(a.rescue(Ka,[y("StandardError")]))try{na=w(y("SafeMode"),"SECURE");break a}finally{a.pop_exception()}else throw Ka;}na=void 0}this.safe=na}r=c.$delete("input_mtime");this.compat_mode=n["$key?"]("compat-mode");this.sourcemap=c["$[]"]("sourcemap");this.timings=c.$delete("timings");this.path_resolver=y("PathResolver").$new();
|
|
880
|
-
u=p((d=w("::","Asciidoctor","skip_raise"))&&w(d,"Extensions","skip_raise")?"constant":C)||p(c["$key?"]("extensions"))?w(w("Asciidoctor"),"Extensions"):C;this.extensions=C;if(p(c["$key?"]("header_footer"))&&l(c["$key?"]("standalone")))c["$[]="]("standalone",c["$[]"]("header_footer"))}this.parsed=this.reftexts=this.header=this.header_attributes=C;this.counters=g([],{});this.attributes_modified=w("Set").$new();this.docinfo_processor_extensions=g([],{});ca=c["$[]"]("standalone");(this.options=c).$freeze();
|
|
881
|
-
ba=this.attributes;p(k)||(ba["$[]="]("attribute-undefined",y("Compliance").$attribute_undefined()),ba["$[]="]("attribute-missing",y("Compliance").$attribute_missing()),ba.$update(y("DEFAULT_ATTRIBUTES")));if(p(ca))n["$[]="]("embedded",C),ba["$[]="]("copycss",""),ba["$[]="]("iconfont-remote",""),ba["$[]="]("stylesheet",""),ba["$[]="]("webfonts","");else if(n["$[]="]("embedded",""),p(n["$key?"]("showtitle"))&&F(n.$keys()["$&"](["notitle","showtitle"])["$[]"](-1),"showtitle"))n["$[]="]("notitle",z(C,
|
|
882
|
-
"",!1,"@","@",!1)["$[]"](n["$[]"]("showtitle")));else if(p(n["$key?"]("notitle")))n["$[]="]("showtitle",z(C,"",!1,"@","@",!1)["$[]"](n["$[]"]("notitle")));else ba["$[]="]("notitle","");n["$[]="]("asciidoctor","");n["$[]="]("asciidoctor-version",w(w("Asciidoctor"),"VERSION"));n["$[]="]("safe-mode-name",ca=y("SafeMode").$name_for_value(this.safe));n["$[]="]("safe-mode-"+ca,"");n["$[]="]("safe-mode-level",this.safe);if(p(m=n["$[]"]("max-include-depth")))m;else n["$[]="]("max-include-depth",64);if(p(m=
|
|
883
|
-
n["$[]"]("allow-uri-read")))m;else n["$[]="]("allow-uri-read",C);if(p(n["$key?"]("numbered")))n["$[]="]("sectnums",n.$delete("numbered"));if(p(n["$key?"]("hardbreaks")))n["$[]="]("hardbreaks-option",n.$delete("hardbreaks"));p(O=c["$[]"]("base_dir"))?this.base_dir=(e=["docdir",w("File").$expand_path(O)],h(n,"[]=",e),e[e.length-1]):p(n["$[]"]("docdir"))?this.base_dir=n["$[]"]("docdir"):this.base_dir=(e=["docdir",w("Dir").$pwd()],h(n,"[]=",e),e[e.length-1]);if(p(ca=c["$[]"]("backend")))n["$[]="]("backend",
|
|
884
|
-
ca.$to_s());if(p(ca=c["$[]"]("doctype")))n["$[]="]("doctype",ca.$to_s());if(p(D(this.safe,w(y("SafeMode"),"SERVER")))){if(p(m=n["$[]"]("copycss")))m;else n["$[]="]("copycss",C);if(p(m=n["$[]"]("source-highlighter")))m;else n["$[]="]("source-highlighter",C);if(p(m=n["$[]"]("backend")))m;else n["$[]="]("backend",y("DEFAULT_BACKEND"));if(l(k)&&p(n["$key?"]("docfile")))n["$[]="]("docfile",n["$[]"]("docfile")["$[]"](a.Range.$new(B(n["$[]"]("docdir").$length(),1),-1,!1)));n["$[]="]("docdir","");if(p(m=
|
|
885
|
-
n["$[]"]("user-home")))m;else n["$[]="]("user-home",".");if(p(D(this.safe,w(y("SafeMode"),"SECURE")))){if(!p(n["$key?"]("max-attribute-value-size")))n["$[]="]("max-attribute-value-size",4096);if(!p(n["$key?"]("linkcss")))n["$[]="]("linkcss","");if(p(m=n["$[]"]("icons")))m;else n["$[]="]("icons",C)}}else if(p(m=n["$[]"]("user-home")))m;else n["$[]="]("user-home",y("USER_HOME"));this.max_attribute_value_size=p(qa=p(m=n["$[]"]("max-attribute-value-size"))?m:(e=["max-attribute-value-size",C],h(n,"[]=",
|
|
886
|
-
e),e[e.length-1]))?qa.$to_i().$abs():C;h(n,"delete_if",[],function(a,b){var c=C;null==a&&(a=C);null==b&&(b=C);if(p(b)){if(x(w("String"),b)&&p(b["$end_with?"]("@"))){var d=[b.$chop(),!0];b=d[0];c=d[1];d}ba["$[]="](a,b)}else ba.$delete(a),c=b["$=="](!1);return c});if(p(k))return this.backend=ba["$[]"]("backend"),F(this.doctype=(e=["doctype",X],h(ba,"[]=",e),e[e.length-1]),y("DEFAULT_DOCTYPE"))||this.$update_doctype_attributes(y("DEFAULT_DOCTYPE")),this.reader=y("Reader").$new(b,c["$[]"]("cursor")),
|
|
887
|
-
p(this.sourcemap)&&(this.source_location=this.reader.$cursor()),y("Parser").$parse(this.reader,this),this.$restore_attributes(),this.parsed=!0;this.backend=C;F(k=p(m=ba["$[]"]("backend"))?m:y("DEFAULT_BACKEND"),"manpage")?this.doctype=(e=["doctype",(f=["doctype","manpage"],h(n,"[]=",f),f[f.length-1])],h(ba,"[]=",e),e[e.length-1]):this.doctype=p(m=ba["$[]"]("doctype"))?m:(e=["doctype",y("DEFAULT_DOCTYPE")],h(ba,"[]=",e),e[e.length-1]);this.$update_backend_attributes(k,!0);if(p(m=ba["$[]"]("stylesdir")))m;
|
|
888
|
-
else ba["$[]="]("stylesdir",".");if(p(m=ba["$[]"]("iconsdir")))m;else ba["$[]="]("iconsdir",""+ba.$fetch("imagesdir","./images")+"/icons");this.$fill_datetime_attributes(ba,r);if(p(u))if(p(k=c["$[]"]("extension_registry"))){if(x(w(y("Extensions"),"Registry"),k)||p((Q=w("::","AsciidoctorJ","skip_raise"))&&(f=w(Q,"Extensions","skip_raise"))&&(e=w(f,"ExtensionRegistry","skip_raise"))?"constant":C)&&x(w(w(w("AsciidoctorJ"),"Extensions"),"ExtensionRegistry"),k))this.extensions=k.$activate(this)}else p((k=
|
|
889
|
-
c["$[]"]("extensions"))["$nil?"]())?p(y("Extensions").$groups()["$empty?"]())||(this.extensions=w(y("Extensions"),"Registry").$new().$activate(this)):x(w("Proc"),k)&&(this.extensions=h(y("Extensions"),"create",[],k.$to_proc()).$activate(this));this.reader=y("PreprocessorReader").$new(this,b,w(y("Reader"),"Cursor").$new(ba["$[]"]("docfile"),this.base_dir),g(["normalize"],{normalize:!0}));return p(this.sourcemap)?this.source_location=this.reader.$cursor():C},-1);m(b,"$parse",function(a){var b=C,c=C;
|
|
890
|
-
null==a&&(a=C);if(p(this.parsed))return this;b=this;p(a)&&(this.reader=y("PreprocessorReader").$new(b,a,w(y("Reader"),"Cursor").$new(this.attributes["$[]"]("docfile"),this.base_dir),g(["normalize"],{normalize:!0})),p(this.sourcemap)&&(this.source_location=this.reader.$cursor()));p(c=p(this.parent_document)?C:this.extensions)&&p(c["$preprocessors?"]())&&h(c.$preprocessors(),"each",[],function ma(a){var c=null==ma.$$s?this:ma.$$s,d=C;null==c.reader&&(c.reader=C);null==a&&(a=C);return c.reader=p(d=a.$process_method()["$[]"](b,
|
|
891
|
-
c.reader))?d:c.reader},{$$s:this});y("Parser").$parse(this.reader,b,g(["header_only"],{header_only:this.options["$[]"]("parse_header_only")}));this.$restore_attributes();p(c)&&p(c["$tree_processors?"]())&&h(c.$tree_processors(),"each",[],function(a){var c=C;null==a&&(a=C);return p(c=a.$process_method()["$[]"](b))&&x(y("Document"),c)&&A(c,b)?b=c:C});this.parsed=!0;return b},-1);m(b,"$parsed?",n("parsed"));m(b,"$counter",function(a,b){var c,d=C,e;null==b&&(b=C);if(p(this.parent_document))return this.parent_document.$counter(a,
|
|
892
|
-
b);b=p(e=this["$attribute_locked?"](a))&&p(d=this.counters["$[]"](a))||l((d=this.attributes["$[]"](a))["$nil_or_empty?"]())?(c=[a,y("Helpers").$nextval(d)],h(this.counters,"[]=",c),c[c.length-1]):p(b)?(c=[a,F(b,b.$to_i().$to_s())?b.$to_i():b],h(this.counters,"[]=",c),c[c.length-1]):(c=[a,1],h(this.counters,"[]=",c),c[c.length-1]);if(!p(e))this.attributes["$[]="](a,b);return b},-2);m(b,"$increment_and_store_counter",function(a,b){return y("AttributeEntry").$new(a,this.$counter(a)).$save_to(b.$attributes()).$value()});
|
|
893
|
-
c(b,"counter_increment","increment_and_store_counter");m(b,"$register",function(a,b){var c=C,d=C;switch(a){case "ids":return this.$register("refs",[c=b["$[]"](0),y("Inline").$new(this,"anchor",b["$[]"](1),g(["type","id"],{type:"ref",id:c}))]);case "refs":a=this.catalog["$[]"]("refs");if(p(c=a["$[]"](b["$[]"](0))))c;else a["$[]="](b["$[]"](0),d=b["$[]"](1));return d;case "footnotes":return this.catalog["$[]"](a)["$<<"](b);default:return p(this.options["$[]"]("catalog_assets"))?this.catalog["$[]"](a)["$<<"](F(a,
|
|
894
|
-
"images")?y("ImageReference").$new(b,this.attributes["$[]"]("imagesdir")):b):C}});m(b,"$resolve_id",function(a){var b=this,c=C,d=C;if(p(b.reftexts))return b.reftexts["$[]"](a);if(p(b.parsed))return h(b.reftexts=g([],{}),"tap",[],function oa(a){var b=null==oa.$$s?this:oa.$$s;null==b.catalog&&(b.catalog=C);null==a&&(a=C);return h(b.catalog["$[]"]("refs"),"each",[],function(b,c){var d,e;null==b&&(b=C);null==c&&(c=C);return p(e=a["$[]"](c.$xreftext()))?e:(d=[c.$xreftext(),b],h(a,"[]=",d),d[d.length-1])})},
|
|
895
|
-
{$$s:b})["$[]"](a);c=C;b.reftexts=d=g([],{});(function(){try{var e=E("break");return h(b.catalog["$[]"]("refs"),"each",[],function(b,f){var l,g;null==b&&(b=C);null==f&&(f=C);F(f=f.$xreftext(),a)&&(c=b,e.$throw());return p(g=d["$[]"](f))?g:(l=[f,b],h(d,"[]=",l),l[l.length-1])})}catch(ma){if(ma===e)return ma.$v;throw ma;}})();b.reftexts=C;return c});m(b,"$sections?",function(){return u(this.next_section_index,0)});m(b,"$footnotes?",function(){return p(this.catalog["$[]"]("footnotes")["$empty?"]())?
|
|
896
|
-
!1:!0});m(b,"$footnotes",function(){return this.catalog["$[]"]("footnotes")});m(b,"$callouts",function(){return this.catalog["$[]"]("callouts")});m(b,"$nested?",function(){return p(this.parent_document)?!0:!1});m(b,"$embedded?",function(){return this.attributes["$key?"]("embedded")});m(b,"$extensions?",function(){return p(this.extensions)?!0:!1});m(b,"$source",function(){return p(this.reader)?this.reader.$source():C});m(b,"$source_lines",function(){return p(this.reader)?this.reader.$source_lines():
|
|
897
|
-
C});m(b,"$basebackend?",function(a){return this.attributes["$[]"]("basebackend")["$=="](a)});m(b,"$title",function(){return this.$doctitle()});m(b,"$title=",function(a){var b,c;if(!p(c=this.header))(c=this.header=y("Section").$new(this,0))["$sectname="]("header");return b=[a],h(c,"title=",b),b[b.length-1]});m(b,"$doctitle",function(a){var b,c,d=C,e;null==a&&(a=g([],{}));if(!p(b=this.attributes["$[]"]("title")))if(p(c=this.$first_section()))b=c.$title();else if(l(p(d=a["$[]"]("use_fallback"))?b=this.attributes["$[]"]("untitled-label"):
|
|
898
|
-
d))return C;return p(e=a["$[]"]("partition"))?y("Title").$new(b,a.$merge(g(["separator"],{separator:F(e,!0)?this.attributes["$[]"]("title-separator"):e}))):p(a["$[]"]("sanitize"))&&p(b["$include?"]("<"))?b.$gsub(y("XmlSanitizeRx"),"").$squeeze(" ").$strip():b},-1);c(b,"name","doctitle");m(b,"$xreftext",function(a){a=C;return p(a=this.$reftext())&&l(a["$empty?"]())?a:this.$title()},-1);m(b,"$author",function(){return this.attributes["$[]"]("author")});m(b,"$authors",function(){var a,b,c=C;if(p((a=
|
|
899
|
-
this.attributes)["$key?"]("author"))){var d=[y("Author").$new(a["$[]"]("author"),a["$[]"]("firstname"),a["$[]"]("middlename"),a["$[]"]("lastname"),a["$[]"]("authorinitials"),a["$[]"]("email"))];if(p(u(b=p(c=a["$[]"]("authorcount"))?c:0,1)))for(c=1;p(G(c,b));)c=B(c,1),d["$<<"](y("Author").$new(a["$[]"]("author_"+c),a["$[]"]("firstname_"+c),a["$[]"]("middlename_"+c),a["$[]"]("lastname_"+c),a["$[]"]("authorinitials_"+c),a["$[]"]("email_"+c)));return d}return[]});m(b,"$revdate",function(){return this.attributes["$[]"]("revdate")});
|
|
900
|
-
m(b,"$notitle",function(){return this.attributes["$key?"]("notitle")});m(b,"$noheader",function(){return this.attributes["$key?"]("noheader")});m(b,"$nofooter",function(){return this.attributes["$key?"]("nofooter")});m(b,"$first_section",function(){var a=C;return p(a=this.header)?a:h(this.blocks,"find",[],function(a){null==a&&(a=C);return a.$context()["$=="]("section")})});m(b,"$header?",function(){return p(this.header)?!0:!1});c(b,"has_header?","header?");m(b,"$<<",function V(a){var b=V.$$p||C;V.$$p=
|
|
901
|
-
null;F(a.$context(),"section")&&this.$assign_numeral(a);return q(this,t(this,"<<",V,!1,!0),"<<",[a],b)});m(b,"$finalize_header",function(a,b){null==b&&(b=!0);this.$clear_playback_attributes(a);this.$save_attributes();if(!p(b))a["$[]="]("invalid-header",!0);return a},-2);m(b,"$playback_attributes",function(a){return p(a["$key?"]("attribute_entries"))?h(a["$[]"]("attribute_entries"),"each",[],function fa(a){var b=null==fa.$$s?this:fa.$$s;null==b.attributes&&(b.attributes=C);null==a&&(a=C);var c=a.$name();
|
|
902
|
-
if(p(a.$negate()))return b.attributes.$delete(c),F(c,"compat-mode")?b.compat_mode=!1:C;b.attributes["$[]="](c,a.$value());return F(c,"compat-mode")?b.compat_mode=!0:C},{$$s:this}):C});m(b,"$restore_attributes",function(){p(this.parent_document)||this.catalog["$[]"]("callouts").$rewind();return this.attributes.$replace(this.header_attributes)});m(b,"$set_attribute",function(a,b){var c=C;null==b&&(b="");if(p(this["$attribute_locked?"](a)))return C;p(b["$empty?"]())||(b=this.$apply_attribute_value_subs(b));
|
|
903
|
-
if(p(this.header_attributes))this.attributes["$[]="](a,b);else{switch(a){case "backend":this.$update_backend_attributes(b,p(c=this.attributes_modified["$delete?"]("htmlsyntax"))?b["$=="](this.backend):c);break;case "doctype":this.$update_doctype_attributes(b);break;default:this.attributes["$[]="](a,b)}this.attributes_modified["$<<"](a)}return b},-2);m(b,"$delete_attribute",function(a){if(p(this["$attribute_locked?"](a)))return!1;this.attributes.$delete(a);this.attributes_modified["$<<"](a);return!0});
|
|
904
|
-
m(b,"$attribute_locked?",function(a){return this.attribute_overrides["$key?"](a)});m(b,"$set_header_attribute",function(a,b,c){var d=C;null==b&&(b="");null==c&&(c=!0);var e=p(d=this.header_attributes)?d:this.attributes;if(F(c,!1)&&p(e["$key?"](a)))return!1;e["$[]="](a,b);return!0},-2);m(b,"$convert",function(a){var b,c=C,d=C,e=C,f=C,l=C;null==a&&(a=g([],{}));p(this.timings)&&this.timings.$start("convert");p(this.parsed)||this.$parse();p(D(this.safe,w(y("SafeMode"),"SERVER")))||p(a["$empty?"]())||
|
|
905
|
-
(p((b=["outfile",a["$[]"]("outfile")],h(this.attributes,"[]=",b),b[b.length-1]))||this.attributes.$delete("outfile"),p((b=["outdir",a["$[]"]("outdir")],h(this.attributes,"[]=",b),b[b.length-1]))||this.attributes.$delete("outdir"));F(this.$doctype(),"inline")?p(c=p(d=this.blocks["$[]"](0))?d:this.header)&&(F(c.$content_model(),"compound")||F(c.$content_model(),"empty")?this.$logger().$warn("no inline candidate; use the inline doctype to convert a single paragragh, verbatim, or raw block"):e=c.$content()):
|
|
906
|
-
(f=p(a["$key?"]("standalone"))?p(a["$[]"]("standalone"))?"document":"embedded":p(a["$key?"]("header_footer"))?p(a["$[]"]("header_footer"))?"document":"embedded":p(this.options["$[]"]("standalone"))?"document":"embedded",e=this.converter.$convert(this,f));p(this.parent_document)||p(l=this.extensions)&&p(l["$postprocessors?"]())&&h(l.$postprocessors(),"each",[],function Ca(a){var b=null==Ca.$$s?this:Ca.$$s;null==a&&(a=C);return e=a.$process_method()["$[]"](b,e)},{$$s:this});p(this.timings)&&this.timings.$record("convert");
|
|
907
|
-
return e},-1);c(b,"render","convert");m(b,"$write",function(a,b){p(this.timings)&&this.timings.$start("write");x(y("Writer"),this.converter)?this.converter.$write(a,b):(p(b["$respond_to?"]("write"))?p(a["$nil_or_empty?"]())||(b.$write(a.$chomp()),b.$write(y("LF"))):w("File").$write(b,a,g(["mode"],{mode:y("FILE_WRITE_MODE")})),F(this.backend,"manpage")&&x(w("String"),b)&&p(this.converter.$class()["$respond_to?"]("write_alternate_pages"))&&this.converter.$class().$write_alternate_pages(this.attributes["$[]"]("mannames"),
|
|
908
|
-
this.attributes["$[]"]("manvolnum"),b));p(this.timings)&&this.timings.$record("write");return C});m(b,"$content",function V(){var a=V.$$p||C;V.$$p=null;this.attributes.$delete("title");return q(this,t(this,"content",V,!1,!0),"content",[],a)});m(b,"$docinfo",function(a,b){var c=C,d=C,e=C,f=C,l=C,k=C,m=C,n=C;l=n=C;null==a&&(a="head");null==b&&(b=C);if(p(G(this.$safe(),w(y("SafeMode"),"SECURE")))&&(F(a,"head")||(c="-"+a),b=p(d=b)?d:this.outfilesuffix,e=p((e=this.attributes["$[]"]("docinfo"))["$nil_or_empty?"]())?
|
|
909
|
-
p(this.attributes["$key?"]("docinfo2"))?["private","shared"]:p(this.attributes["$key?"]("docinfo1"))?["shared"]:p(e)?["private"]:C:h(e.$split(","),"map",[],function(a){null==a&&(a=C);return a.$strip()}),p(e))){f=[];b=["docinfo"+c+b,this.attributes["$[]"]("docinfodir"),this.$resolve_docinfo_subs()];l=b[0];k=b[1];m=b[2];b;if(!p(e["$&"](["shared","shared-"+a])["$empty?"]())&&(n=this.$normalize_system_path(l,k),p(n=this.$read_asset(n,g(["normalize"],{normalize:!0})))))f["$<<"](this.$apply_subs(n,m));
|
|
910
|
-
if(!p(this.attributes["$[]"]("docname")["$nil_or_empty?"]())&&!p(e["$&"](["private","private-"+a])["$empty?"]())&&(n=this.$normalize_system_path(""+this.attributes["$[]"]("docname")+"-"+l,k),p(l=this.$read_asset(n,g(["normalize"],{normalize:!0})))))f["$<<"](this.$apply_subs(l,m))}return p(this.extensions)&&p(this["$docinfo_processors?"](a))?(p(d=f)?d:[]).$concat(h(this.docinfo_processor_extensions["$[]"](a),"map",[],function Aa(a){var b=null==Aa.$$s?this:Aa.$$s;null==a&&(a=C);return a.$process_method()["$[]"](b)},
|
|
911
|
-
{$$s:this}).$compact()).$join(y("LF")):p(f)?f.$join(y("LF")):""},-1);m(b,"$docinfo_processors?",function(a){var b;null==a&&(a="head");return p(this.docinfo_processor_extensions["$key?"](a))?this.docinfo_processor_extensions["$[]"](a)["$!="](!1):p(this.extensions)&&p(this.document.$extensions()["$docinfo_processors?"](a))?(b=[a,this.document.$extensions().$docinfo_processors(a)],h(this.docinfo_processor_extensions,"[]=",b),b[b.length-1])["$!"]()["$!"]():(b=[a,!1],h(this.docinfo_processor_extensions,
|
|
912
|
-
"[]=",b),b[b.length-1])},-1);m(b,"$to_s",function(){var a=C;return"#<"+this.$class()+"@"+this.$object_id()+" {doctype: "+this.$doctype().$inspect()+", doctitle: "+(p(a=this.header)?this.header.$title():a).$inspect()+", blocks: "+this.blocks.$size()+"}>"});b.$private();m(b,"$apply_attribute_value_subs",function(a){var b;p(y("AttributeEntryPassMacroRx")["$=~"](a))?(a=(b=r["~"])===C?C:b["$[]"](2),p((b=r["~"])===C?C:b["$[]"](1))&&(a=this.$apply_subs(a,this.$resolve_pass_subs((b=r["~"])===C?C:b["$[]"](1))))):
|
|
913
|
-
a=this.$apply_header_subs(a);return p(this.max_attribute_value_size)?this.$limit_bytesize(a,this.max_attribute_value_size):a});m(b,"$limit_bytesize",function(a,b){if(p(u(a.$bytesize(),b)))for(;!p((a=a.$byteslice(0,b))["$valid_encoding?"]());)b=v(b,1);return a});m(b,"$resolve_docinfo_subs",function(){return p(this.attributes["$key?"]("docinfosubs"))?this.$resolve_subs(this.attributes["$[]"]("docinfosubs"),"block",C,"docinfo"):["attributes"]});m(b,"$create_converter",function(a,b){var c,d=C,e=C,f;var h=
|
|
914
|
-
g(["document","htmlsyntax"],{document:this,htmlsyntax:this.attributes["$[]"]("htmlsyntax")});if(p(c=p(d=(e=this.options)["$[]"]("template_dirs"))?d:e["$[]"]("template_dir"))&&(h["$[]="]("template_dirs",[].concat(I(c))),h["$[]="]("template_cache",e.$fetch("template_cache",!0)),h["$[]="]("template_engine",e["$[]"]("template_engine")),h["$[]="]("template_engine_options",e["$[]"]("template_engine_options")),h["$[]="]("eruby",e["$[]"]("eruby")),h["$[]="]("safe",this.safe),p(b)))h["$[]="]("delegate_backend",
|
|
915
|
-
b);return p(f=e["$[]"]("converter"))?w(y("Converter"),"CustomFactory").$new(z(a,f)).$create(a,h):e.$fetch("converter_factory",y("Converter")).$create(a,h)});m(b,"$clear_playback_attributes",function(a){return a.$delete("attribute_entries")});m(b,"$save_attributes",function(){var a=C,b=C,c=C,d=C,e=C,f=C,k=C,m=C,n=m=m=d=C,u=C,r=C;if(!p((b=this.attributes)["$key?"]("doctitle"))&&!l(a=this.$doctitle()))b["$[]="]("doctitle",a);this.id=p(c=this.id)?c:b["$[]"]("css-signature");if(p(d=p(b.$delete("toc2"))?
|
|
916
|
-
"left":b["$[]"]("toc"))&&(e=p(f=b.$fetch("toc-placement","macro"))&&A(f,"auto")?f:b["$[]"]("toc-position"),!p(d["$empty?"]())||!p(e["$nil_or_empty?"]()))){k="left";m="toc2";d=p(e["$nil_or_empty?"]())?p(d["$empty?"]())?k:d:e;b["$[]="]("toc","");b["$[]="]("toc-placement","auto");switch(d){case "left":case "<":case "<":b["$[]="]("toc-position","left");break;case "right":case ">":case ">":b["$[]="]("toc-position","right");break;case "top":case "^":b["$[]="]("toc-position","top");break;case "bottom":case "v":b["$[]="]("toc-position",
|
|
917
|
-
"bottom");break;case "preamble":case "macro":b["$[]="]("toc-position","content");b["$[]="]("toc-placement",d);m=C;break;default:b.$delete("toc-position"),m=C}if(p(m))if(p(c=b["$[]"]("toc-class")))c;else b["$[]="]("toc-class",m)}if(p(m=b["$[]"]("icons"))&&l(b["$key?"]("icontype")))switch(m){case "":case "font":break;default:if(b["$[]="]("icons",""),!F(m,"image"))b["$[]="]("icontype",m)}if(p(this.compat_mode=b["$key?"]("compat-mode"))&&p(b["$key?"]("language")))b["$[]="]("source-language",b["$[]"]("language"));
|
|
918
|
-
if(!p(this.parent_document)){if(F(m=b["$[]"]("basebackend"),"html"))p(n=b["$[]"]("source-highlighter"))&&l(b["$[]"](""+n+"-unavailable"))&&(p(u=this.options["$[]"]("syntax_highlighter_factory"))?this.syntax_highlighter=u.$create(n,this.backend,g(["document"],{document:this})):p(r=this.options["$[]"]("syntax_highlighters"))?this.syntax_highlighter=w(y("SyntaxHighlighter"),"DefaultFactoryProxy").$new(r).$create(n,this.backend,g(["document"],{document:this})):this.syntax_highlighter=y("SyntaxHighlighter").$create(n,
|
|
919
|
-
this.backend,g(["document"],{document:this})));else if(F(m,"docbook")){if(!p(this["$attribute_locked?"]("toc"))&&!p(this.attributes_modified["$include?"]("toc")))b["$[]="]("toc","");if(!p(this["$attribute_locked?"]("sectnums"))&&!p(this.attributes_modified["$include?"]("sectnums")))b["$[]="]("sectnums","")}this.outfilesuffix=b["$[]"]("outfilesuffix");h(y("FLEXIBLE_ATTRIBUTES"),"each",[],function ya(a){var b=null==ya.$$s?this:ya.$$s;null==b.attribute_overrides&&(b.attribute_overrides=C);null==a&&(a=
|
|
920
|
-
C);return p(b.attribute_overrides["$key?"](a))&&p(b.attribute_overrides["$[]"](a))?b.attribute_overrides.$delete(a):C},{$$s:this})}return this.header_attributes=b.$merge()});m(b,"$fill_datetime_attributes",function(a,b){var c,d=C,e,f,l=C;var g=p(w("ENV")["$key?"]("SOURCE_DATE_EPOCH"))?d=w("Time").$at(this.$Integer(w("ENV")["$[]"]("SOURCE_DATE_EPOCH"))).$utc():w("Time").$now();if(p(e=a["$[]"]("localdate")))if(p(f=a["$[]"]("localyear")))f;else a["$[]="]("localyear",F(e.$index("-"),4)?e.$slice(0,4):
|
|
921
|
-
C);else if(e=(c=["localdate",g.$strftime("%F")],h(a,"[]=",c),c[c.length-1]),p(f=a["$[]"]("localyear")))f;else a["$[]="]("localyear",g.$year().$to_s());var k=p(f=a["$[]"]("localtime"))?f:(c=["localtime",g.$strftime("%T "+(F(g.$utc_offset(),0)?"UTC":"%z"))],h(a,"[]=",c),c[c.length-1]);if(p(f=a["$[]"]("localdatetime")))f;else a["$[]="]("localdatetime",""+e+" "+k);b=p(f=p(l=d)?l:b)?f:g;if(p(g=a["$[]"]("docdate")))if(p(f=a["$[]"]("docyear")))f;else a["$[]="]("docyear",F(g.$index("-"),4)?g.$slice(0,4):
|
|
922
|
-
C);else if(g=(c=["docdate",b.$strftime("%F")],h(a,"[]=",c),c[c.length-1]),p(f=a["$[]"]("docyear")))f;else a["$[]="]("docyear",b.$year().$to_s());b=p(f=a["$[]"]("doctime"))?f:(c=["doctime",b.$strftime("%T "+(F(b.$utc_offset(),0)?"UTC":"%z"))],h(a,"[]=",c),c[c.length-1]);if(p(f=a["$[]"]("docdatetime")))f;else a["$[]="]("docdatetime",""+g+" "+b);return C});m(b,"$update_backend_attributes",function(a,b){var c,d=C,f=C,l=C,g=C,k=C,m;null==b&&(b=C);if(p(b)||A(a,this.backend)){var n=this.backend;var u=(c=
|
|
923
|
-
this.attributes)["$[]"]("basebackend");var r=this.doctype;if(p(a["$include?"](":"))){var q=a.$partition(":");var V=e(q);d=null==V[0]?C:V[0];a=null==V[2]?C:V[2];q}if(p(a["$start_with?"]("xhtml")))c["$[]="]("htmlsyntax","xml"),a=a.$slice(1,a.$length());else if(p(a["$start_with?"]("html")))if(p(f=c["$[]"]("htmlsyntax")))f;else c["$[]="]("htmlsyntax","html");a=p(f=y("BACKEND_ALIASES")["$[]"](a))?f:a;p(d)&&(V=[d,a],a=V[0],l=V[1],V);p(r)?(p(n)&&(c.$delete("backend-"+n),c.$delete("backend-"+n+"-doctype-"+
|
|
924
|
-
r)),c["$[]="]("backend-"+a+"-doctype-"+r,""),c["$[]="]("doctype-"+r,"")):p(n)&&c.$delete("backend-"+n);c["$[]="]("backend-"+a,"");this.backend=(V=["backend",a],h(c,"[]=",V),V[V.length-1]);if(x(w(y("Converter"),"BackendTraits"),V=this.$create_converter(a,l))){g=V.$basebackend();k=V.$filetype();if(p(f=V.$htmlsyntax()))c["$[]="]("htmlsyntax",f);if(p(b))if(p(f=c["$[]"]("outfilesuffix")))f;else c["$[]="]("outfilesuffix",V.$outfilesuffix());else if(!p(this["$attribute_locked?"]("outfilesuffix")))c["$[]="]("outfilesuffix",
|
|
925
|
-
V.$outfilesuffix())}else if(p(V))if(q=y("Converter").$derive_backend_traits(a),g=q["$[]"]("basebackend"),k=q["$[]"]("filetype"),p(b))if(p(f=c["$[]"]("outfilesuffix")))f;else c["$[]="]("outfilesuffix",q["$[]"]("outfilesuffix"));else{if(!p(this["$attribute_locked?"]("outfilesuffix")))c["$[]="]("outfilesuffix",q["$[]"]("outfilesuffix"))}else this.$raise(w("NotImplementedError"),"asciidoctor: FAILED: missing converter for backend '"+a+"'. Processing aborted.");this.converter=V;p(m=c["$[]"]("filetype"))&&
|
|
926
|
-
c.$delete("filetype-"+m);c["$[]="]("filetype",k);c["$[]="]("filetype-"+k,"");if(p(b=y("DEFAULT_PAGE_WIDTHS")["$[]"](g)))c["$[]="]("pagewidth",b);else c.$delete("pagewidth");A(g,u)&&(p(r)?(p(u)&&(c.$delete("basebackend-"+u),c.$delete("basebackend-"+u+"-doctype-"+r)),c["$[]="]("basebackend-"+g+"-doctype-"+r,"")):p(u)&&c.$delete("basebackend-"+u),c["$[]="]("basebackend-"+g,""),c["$[]="]("basebackend",g));return a}return C},-2);return m(b,"$update_doctype_attributes",function(a){var b;if(p(a)&&A(a,this.doctype)){var c=
|
|
927
|
-
[this.backend,(b=this.attributes)["$[]"]("basebackend"),this.doctype];var d=c[0];var e=c[1];var f=c[2];c;if(p(f))b.$delete("doctype-"+f),p(d)&&(b.$delete("backend-"+d+"-doctype-"+f),b["$[]="]("backend-"+d+"-doctype-"+a,"")),p(e)&&(b.$delete("basebackend-"+e+"-doctype-"+f),b["$[]="]("basebackend-"+e+"-doctype-"+a,""));else{if(p(d))b["$[]="]("backend-"+d+"-doctype-"+a,"");if(p(e))b["$[]="]("basebackend-"+e+"-doctype-"+a,"")}b["$[]="]("doctype-"+a,"");return this.doctype=(c=["doctype",a],h(b,"[]=",c),
|
|
928
|
-
c[c.length-1])}return C})}(k[0],y("AbstractBlock"),k)}(L[0],L)};Opal.modules["asciidoctor/inline"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.send2,c=a.find_super,p=a.def,m=a.return_val,g=a.alias,l=a.truthy,e=[],n=a.nil;a.add_stubs("attr_accessor,attr_reader,[],convert,converter,attr,==,apply_reftext_subs,reftext");return function(e,k){e=[b(e,"Asciidoctor")].concat(k);k=a.$r(e);return function(a,$super){a=d(a,$super,"Inline");var b=a.$$prototype;b.text=b.type=n;a.$attr_accessor("text");a.$attr_reader("type");
|
|
929
|
-
a.$attr_accessor("target");p(a,"$initialize",function u(a,b,d,e){u.$$p=null;null==d&&(d=n);null==e&&(e=f([],{}));h(this,c(this,"initialize",u,!1,!0),"initialize",[a,b,e],null);this.node_name="inline_"+b;this.text=d;this.id=e["$[]"]("id");this.type=e["$[]"]("type");return this.target=e["$[]"]("target")},-3);p(a,"$block?",m(!1));p(a,"$inline?",m(!0));p(a,"$convert",function(){return this.$converter().$convert(this)});g(a,"render","convert");p(a,"$alt",function(){var a;return l(a=this.$attr("alt"))?
|
|
930
|
-
a:""});p(a,"$reftext?",function(){var a,b;return l(a=this.text)?l(b=this.type["$=="]("ref"))?b:this.type["$=="]("bibref"):a});p(a,"$reftext",function(){var a;return l(a=this.text)?this.$apply_reftext_subs(a):n});return p(a,"$xreftext",function(a){return this.$reftext()},-1)}(e[0],k("AbstractNode"))}(e[0],e)};Opal.modules["asciidoctor/list"]=function(a){var b=a.module,d=a.klass,f=a.alias,h=a.hash2,c=a.send2,m=a.find_super,n=a.def,g=a.truthy,l=a.eqeq,e=[],q=a.nil;a.add_stubs("blocks,blocks?,==,next_list,callouts,convert,class,object_id,inspect,size,items,parent,attr_accessor,level,drop,nil_or_empty?,apply_subs,attr_writer,empty?,===,[],outline?,!,simple?,source,shift,context");
|
|
931
|
-
return function(e,k){e=[b(e,"Asciidoctor")].concat(k);k=a.$r(e);(function(a,$super){a=d(a,$super,"List");var b=a.$$prototype;b.context=b.document=b.style=q;f(a,"items","blocks");f(a,"content","blocks");f(a,"items?","blocks?");n(a,"$initialize",function ka(a,b,d){var e=ka.$$p||q;ka.$$p=null;null==d&&(d=h([],{}));return c(this,m(this,"initialize",ka,!1,!0),"initialize",[a,b,d],e)},-3);n(a,"$outline?",function(){var a;return g(a=this.context["$=="]("ulist"))?a:this.context["$=="]("olist")});n(a,"$convert",
|
|
932
|
-
function ra(){var a=ra.$$p||q;ra.$$p=null;return l(this.context,"colist")?(a=c(this,m(this,"convert",ra,!1,!0),"convert",[],a),this.document.$callouts().$next_list(),a):c(this,m(this,"convert",ra,!1,!0),"convert",[],a)});f(a,"render","convert");return n(a,"$to_s",function(){return"#<"+this.$class()+"@"+this.$object_id()+" {context: "+this.context.$inspect()+", style: "+this.style.$inspect()+", items: "+this.$items().$size()+"}>"})})(e[0],k("AbstractBlock"));return function(b,$super,e){b=d(b,$super,
|
|
933
|
-
"ListItem");e=[b].concat(e);var h=a.$r(e);e=b.$$prototype;e.text=e.subs=e.blocks=q;f(b,"list","parent");b.$attr_accessor("marker");n(b,"$initialize",function ka(a,b){ka.$$p=null;null==b&&(b=q);c(this,m(this,"initialize",ka,!1,!0),"initialize",[a,"list_item"],null);this.text=b;this.level=a.$level();return this.subs=h("NORMAL_SUBS").$drop(0)},-2);n(b,"$text?",function(){return g(this.text["$nil_or_empty?"]())?!1:!0});n(b,"$text",function(){var a;return g(a=this.text)?this.$apply_subs(this.text,this.subs):
|
|
934
|
-
a});b.$attr_writer("text");n(b,"$simple?",function(){var a,b,c=q,d=q;return g(a=this.blocks["$empty?"]())?a:g(b=g(c=this.blocks.$size()["$=="](1))?h("List")["$==="](d=this.blocks["$[]"](0)):c)?d["$outline?"]():b});n(b,"$compound?",function(){return this["$simple?"]()["$!"]()});n(b,"$fold_first",function(){this.text=g(this.text["$nil_or_empty?"]())?this.blocks.$shift().$source():""+this.text+h("LF")+this.blocks.$shift().$source();return q});return n(b,"$to_s",function(){var a=q;return"#<"+this.$class()+
|
|
935
|
-
"@"+this.$object_id()+" {list_context: "+this.$parent().$context().$inspect()+", text: "+this.text.$inspect()+", blocks: "+(g(a=this.blocks)?a:[]).$size()+"}>"})}(e[0],k("AbstractBlock"),e)}(e[0],e)};Opal.modules["asciidoctor/parser"]=function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.send,c=a.truthy,m=a.hash2,n=a.to_ary,g=a.defs,l=a.eqeq,e=a.not,q=a.gvars,t=a.neqeq,y=a.rb_plus,v=a.rb_lt,F=a.rb_gt,x=a.to_a,z=a.eqeqeq,D=a.rb_minus,B=a.rb_times,A=a.thrower,E=[],u=a.nil,G=a.$$$;a.add_stubs("include,new,proc,start_with?,match?,is_delimited_block?,private_class_method,parse_document_header,[],has_more_lines?,next_section,assign_numeral,<<,blocks,skip_blank_lines,parse_block_metadata_lines,attributes,is_next_line_doctitle?,[]=,finalize_header,nil_or_empty?,title=,sourcemap,cursor,parse_section_title,id=,include?,sub_specialchars,sub_attributes,source_location=,header,attribute_locked?,id,clear,delete,instance_variable_get,parse_header_metadata,==,!,register,process_authors,update,doctype,parse_manpage_header,=~,downcase,error,logger,message_with_context,cursor_at_line,backend,save,is_next_line_section?,initialize_section,join,map,read_lines_until,lstrip,split,title,restore_save,discard_save,header?,empty?,context,!=,attr?,attr,key?,document,+,level,special,sectname,to_i,<,>,warn,next_block,blocks?,style,style=,parent=,content_model,content_model=,lines,subs,size,context=,shift,unwrap_standalone_preamble,source_location,merge,fetch,parse_block_metadata_line,extensions,block_macros?,mark,read_line,terminator,to_s,masq,to_sym,registered_for_block?,debug?,debug,cursor_at_mark,strict_verbatim_paragraphs,unshift_line,markdown_syntax,keys,chr,uniform?,length,end_with?,parse_attributes,attribute_missing,tr,basename,assign_caption,registered_for_block_macro?,config,process_method,replace,parse_callout_list,callouts,===,parse_list,parse_description_list,underline_style_section_titles,is_section_title?,peek_line,atx_section_title?,generate_id,level=,read_paragraph_lines,adjust_indentation!,map!,slice,pop,build_block,apply_subs,chop,catalog_inline_anchors,rekey,index,strip,-,parse_table,each,raise,title?,update_attributes,commit_subs,sub?,catalog_callouts,source,remove_sub,block_terminates_paragraph,to_proc,nil?,parse_blocks,parse_list_item,items,scan,gsub,count,advance,dup,match,callout_ids,next_list,catalog_inline_anchor,marker=,catalog_inline_biblio_anchor,set_option,text=,resolve_ordered_list_marker,read_lines_for_list_item,skip_line_comments,unshift_lines,fold_first,text?,is_sibling_list_item?,concat,find,casecmp,sectname=,special=,numbered=,numbered,lineno,peek_lines,setext_section_title?,abs,cursor_at_prev_line,process_attribute_entries,next_line_empty?,apply_header_subs,rstrip,each_with_index,compact,to_h,squeeze,to_a,parse_style_attribute,process_attribute_entry,skip_comment_lines,store_attribute,sanitize_attribute_name,set_attribute,save_to,delete_attribute,ord,int_to_roman,resolve_list_marker,parse_colspecs,create_columns,has_header_option=,format,starts_with_delimiter?,close_open_cell,parse_cellspec,delimiter,match_delimiter,pre_match,post_match,buffer_has_unclosed_quotes?,skip_past_delimiter,buffer=,buffer,skip_past_escaped_delimiter,keep_cell_open,push_cellspec,close_cell,cell_open?,columns,assign_column_widths,partition_header_footer,upto,partition,shorthand_property_syntax,each_char,yield_buffered_attribute,any?,*,each_byte,%");
|
|
936
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);return function(b,$super,k){b=d(b,$super,"Parser");k=[b].concat(k);var p=a.$r(k);b.$include(p("Logging"));f(k[0],"BlockMatchData",p("Struct").$new("context","masq","tip","terminator"));f(k[0],"TAB","\t");f(k[0],"TabIndentRx",/^\t+/);f(k[0],"StartOfBlockProc",h(b,"proc",[],function aa(a){var b=null==aa.$$s?this:aa.$$s,d,e=u;null==a&&(a=u);return c(d=c(e=a["$start_with?"]("["))?p("BlockAttributeLineRx")["$match?"](a):e)?d:b["$is_delimited_block?"](a)},
|
|
937
|
-
{$$s:b}));f(k[0],"StartOfListProc",h(b,"proc",[],function(a){null==a&&(a=u);return p("AnyListRx")["$match?"](a)}));f(k[0],"StartOfBlockOrListProc",h(b,"proc",[],function qa(a){var b=null==qa.$$s?this:qa.$$s,d,e=u,f=u;null==a&&(a=u);return c(d=c(e=b["$is_delimited_block?"](a))?e:c(f=a["$start_with?"]("["))?p("BlockAttributeLineRx")["$match?"](a):f)?d:p("AnyListRx")["$match?"](a)},{$$s:b}));f(k[0],"NoOp",u);f(k[0],"AuthorKeys","author authorinitials firstname middlename lastname email".split(" "));
|
|
938
|
-
f(k[0],"TableCellHorzAlignments",m(["<",">","^"],{"<":"left",">":"right","^":"center"}));f(k[0],"TableCellVertAlignments",m(["<",">","^"],{"<":"top",">":"bottom","^":"middle"}));f(k[0],"TableCellStyles",m("dsemhla".split(""),{d:"none",s:"strong",e:"emphasis",m:"monospaced",h:"header",l:"literal",a:"asciidoc"}));b.$private_class_method("new");g(b,"$parse",function(a,b,d){null==d&&(d=m([],{}));var e=this.$parse_document_header(a,b,d=d["$[]"]("header_only"));if(!c(d))for(;c(a["$has_more_lines?"]());){d=
|
|
939
|
-
this.$next_section(a,b,e);e=n(d);var f=null==e[0]?u:e[0];e=null==e[1]?u:e[1];d;c(f)&&(b.$assign_numeral(f),b.$blocks()["$<<"](f))}return b},-3);g(b,"$parse_document_header",function(a,b,d){var f,g,k=u,Q=u;null==d&&(d=!1);var q=c(a.$skip_blank_lines())?this.$parse_block_metadata_lines(a,b):m([],{});var r=b.$attributes();if(c(f=this["$is_next_line_doctitle?"](a,q,r["$[]"]("leveloffset")))&&c(q["$[]"]("title")))return r["$[]="]("authorcount",0),b.$finalize_header(q,!1);if(!c((g=r["$[]"]("doctitle"))["$nil_or_empty?"]()))b["$title="](k=
|
|
940
|
-
g);if(c(f)){c(b.$sourcemap())&&(Q=a.$cursor());var w=this.$parse_section_title(a,b);var y=n(w);f=[null==y[0]?u:y[0]];h(b,"id=",f);f[f.length-1];f=null==y[2]?u:y[2];var t=null==y[4]?u:y[4];w;if(c(k))f=u;else if(b["$title="](f),c((y=["doctitle",k=b.$sub_specialchars(f)],h(r,"[]=",y),y[y.length-1])["$include?"](p("ATTR_REF_HEAD"))))r["$[]="]("doctitle",k=b.$sub_attributes(k,m(["attribute_missing"],{attribute_missing:"skip"})));if(c(Q))b.$header()["$source_location="](Q);if(!c(t)&&!c(b["$attribute_locked?"]("compat-mode")))r["$[]="]("compat-mode",
|
|
941
|
-
"");if(c(Q=q["$[]"]("separator"))&&!c(b["$attribute_locked?"]("title-separator")))r["$[]="]("title-separator",Q);if(c(Q=q["$[]"]("id")))b["$id="](Q);else Q=b.$id();if(c(y=q["$[]"]("role")))r["$[]="]("role",y);if(c(y=q["$[]"]("reftext")))r["$[]="]("reftext",y);q.$clear();(y=b.$instance_variable_get("@attributes_modified")).$delete("doctitle");this.$parse_header_metadata(a,b,u);if(c(y["$include?"]("doctitle")))if(c((g=r["$[]"]("doctitle"))["$nil_or_empty?"]())||l(g,k))r["$[]="]("doctitle",k);else b["$title="](g);
|
|
942
|
-
else if(e(f))y["$<<"]("doctitle");c(Q)&&b.$register("refs",[Q,b])}else if(c(g=r["$[]"]("author")))g=this.$process_authors(g,!0,!1),c(r["$[]"]("authorinitials"))&&g.$delete("authorinitials"),r.$update(g);else if(c(g=r["$[]"]("authors")))g=this.$process_authors(g,!0),r.$update(g);else r["$[]="]("authorcount",0);l(b.$doctype(),"manpage")&&this.$parse_manpage_header(a,b,q,d);return b.$finalize_header(q)},-3);g(b,"$parse_manpage_header",function(a,b,d,e){var f,g=u,k=u,n=u,r=u,w=k=u,y=u,t=y=u,v=u,aa=u,
|
|
943
|
-
F=u;null==e&&(e=!1);c(p("ManpageTitleVolnumRx")["$=~"]((g=b.$attributes())["$[]"]("doctitle")))?(g["$[]="]("manvolnum",k=(f=q["~"])===u?u:f["$[]"](2)),g["$[]="]("mantitle",(c((n=(f=q["~"])===u?u:f["$[]"](1))["$include?"](p("ATTR_REF_HEAD")))?b.$sub_attributes(n):n).$downcase())):(this.$logger().$error(this.$message_with_context("non-conforming manpage title",m(["source_location"],{source_location:a.$cursor_at_line(1)}))),g["$[]="]("mantitle",c(r=c(k=g["$[]"]("doctitle"))?k:g["$[]"]("docname"))?r:
|
|
944
|
-
"command"),g["$[]="]("manvolnum",k="1"));if(c(w=g["$[]"]("manname"))&&c(g["$[]"]("manpurpose"))){if(c(r=g["$[]"]("manname-title")))r;else g["$[]="]("manname-title","Name");g["$[]="]("mannames",[w]);l(b.$backend(),"manpage")&&(g["$[]="]("docname",w),g["$[]="]("outfilesuffix","."+k))}else if(!c(e)){a.$skip_blank_lines();a.$save();d.$update(this.$parse_block_metadata_lines(a,b));if(c(y=this["$is_next_line_section?"](a,m([],{}))))if(l(y,1))if(y=this.$initialize_section(a,b,m([],{})),t=h(a.$read_lines_until(m(["break_on_blank_lines",
|
|
945
|
-
"skip_line_comments"],{break_on_blank_lines:!0,skip_line_comments:!0})),"map",[],function(a){null==a&&(a=u);return a.$lstrip()}).$join(" "),c(p("ManpageNamePurposeRx")["$=~"](t))){c((w=(f=q["~"])===u?u:f["$[]"](1))["$include?"](p("ATTR_REF_HEAD")))&&(w=b.$sub_attributes(w));c(w["$include?"](","))?w=(v=h(w.$split(","),"map",[],function(a){null==a&&(a=u);return a.$lstrip()}))["$[]"](0):v=[w];c((aa=(f=q["~"])===u?u:f["$[]"](2))["$include?"](p("ATTR_REF_HEAD")))&&(aa=b.$sub_attributes(aa));if(c(r=g["$[]"]("manname-title")))r;
|
|
946
|
-
else g["$[]="]("manname-title",y.$title());if(c(y.$id()))g["$[]="]("manname-id",y.$id());g["$[]="]("manname",w);g["$[]="]("mannames",v);g["$[]="]("manpurpose",aa);l(b.$backend(),"manpage")&&(g["$[]="]("docname",w),g["$[]="]("outfilesuffix","."+k))}else F="non-conforming name section body";else F="name section must be at level 1";else F="name section expected";c(F)?(a.$restore_save(),this.$logger().$error(this.$message_with_context(F,m(["source_location"],{source_location:a.$cursor()}))),g["$[]="]("manname",
|
|
947
|
-
w=c(r=g["$[]"]("docname"))?r:"command"),g["$[]="]("mannames",[w]),l(b.$backend(),"manpage")&&(g["$[]="]("docname",w),g["$[]="]("outfilesuffix","."+k))):a.$discard_save()}return u},-4);g(b,"$next_section",function(a,b,d){var f,g,k=u,Q,q,r=u,w=q=u,fa,aa;var x=u;null==d&&(d=m([],{}));var ba=f=g=!1;if(l(b.$context(),"document")&&c(b.$blocks()["$empty?"]())&&(c(k=b["$header?"]())||c(d.$delete("invalid-header"))||e(this["$is_next_line_section?"](a,d)))){var z=(Q=b).$doctype()["$=="]("book");if(c(k)||c(z)&&
|
|
948
|
-
t(d["$[]"](1),"abstract")){ba=f=p("Block").$new(b,"preamble",m(["content_model"],{content_model:"compound"}));if(c(z)&&c(b["$attr?"]("preface-title")))ba["$title="](b.$attr("preface-title"));b.$blocks()["$<<"](ba)}k=b;q=0;if(c(b.$attributes()["$key?"]("fragment")))var D=-1;else if(c(z)){var B=[1,0];D=B[0];r=B[1];B}else D=1}else z=(Q=b.$document()).$doctype()["$=="]("book"),k=this.$initialize_section(a,b,d),d=c(q=d["$[]"]("title"))?m(["title"],{title:q}):m([],{}),D=y(q=k.$level(),1),l(q,0)?g=z:l(q,
|
|
949
|
-
1)&&c(k.$special())&&(l(w=k.$sectname(),"appendix")||l(w,"preface")||l(w,"abstract")||(D=u));for(a.$skip_blank_lines();c(a["$has_more_lines?"]());){this.$parse_block_metadata_lines(a,Q,d);if(c(fa=this["$is_next_line_section?"](a,d)))if(c(Q["$attr?"]("leveloffset"))&&(fa=y(fa,Q.$attr("leveloffset").$to_i()),c(v(fa,0))&&(fa=0)),c(F(fa,q)))c(D)?l(fa,D)||c(r)&&l(fa,r)||c(v(D,0))||(B=c(r)?"expected levels "+r+" or "+D:"expected level "+D,this.$logger().$warn(this.$message_with_context("section title out of sequence: "+
|
|
950
|
-
B+", got level "+fa,m(["source_location"],{source_location:a.$cursor()})))):this.$logger().$error(this.$message_with_context(""+w+" sections do not support nested sections",m(["source_location"],{source_location:a.$cursor()}))),x=this.$next_section(a,k,d),B=n(x),fa=null==B[0]?u:B[0],d=null==B[1]?u:B[1],x,k.$assign_numeral(fa),k.$blocks()["$<<"](fa);else if(l(fa,0)&&l(k,Q))c(z)||this.$logger().$error(this.$message_with_context("level 0 sections can only be used when doctype is book",m(["source_location"],
|
|
951
|
-
{source_location:a.$cursor()}))),x=this.$next_section(a,k,d),B=n(x),fa=null==B[0]?u:B[0],d=null==B[1]?u:B[1],x,k.$assign_numeral(fa),k.$blocks()["$<<"](fa);else break;else if(fa=a.$cursor(),c(aa=this.$next_block(a,c(x=f)?x:k,d,m(["parse_metadata"],{parse_metadata:!1})))){if(c(g))if(e(k["$blocks?"]()))if(t(aa.$style(),"partintro"))if(l(aa.$style(),"open")&&l(aa.$context(),"open"))aa["$style="]("partintro");else aa["$parent="](f=p("Block").$new(k,"open",m(["content_model"],{content_model:"compound"}))),
|
|
952
|
-
f["$style="]("partintro"),k.$blocks()["$<<"](f);else l(aa.$content_model(),"simple")&&(aa["$content_model="]("compound"),aa["$<<"](p("Block").$new(aa,"paragraph",m(["source","subs"],{source:aa.$lines(),subs:aa.$subs()}))),aa.$lines().$clear(),aa.$subs().$clear());else if(l(k.$blocks().$size(),1)){var A=k.$blocks()["$[]"](0);e(f)&&l(A.$content_model(),"compound")?this.$logger().$error(this.$message_with_context("illegal block content outside of partintro block",m(["source_location"],{source_location:fa}))):
|
|
953
|
-
t(A.$content_model(),"compound")&&(aa["$parent="](f=p("Block").$new(k,"open",m(["content_model"],{content_model:"compound"}))),l(A.$style(),(B=["partintro"],h(f,"style=",B),B[B.length-1]))&&(A["$context="]("paragraph"),A["$style="](u)),k.$blocks().$shift(),f["$<<"](A),k.$blocks()["$<<"](f))}(c(x=f)?x:k).$blocks()["$<<"](aa);d.$clear()}if(c(x=a.$skip_blank_lines()))x;else break}if(c(g))c(k["$blocks?"]())&&l(k.$blocks()["$[]"](-1).$context(),"section")||this.$logger().$error(this.$message_with_context("invalid part, must have at least one section (e.g., chapter, appendix, etc.)",
|
|
954
|
-
m(["source_location"],{source_location:a.$cursor()})));else if(c(ba))if(c(ba["$blocks?"]()))if(c(z)||c(Q.$blocks()["$[]"](1))||e(p("Compliance").$unwrap_standalone_preamble())){if(c(Q.$sourcemap()))ba["$source_location="](ba.$blocks()["$[]"](0).$source_location())}else for(Q.$blocks().$shift();c(a=ba.$blocks().$shift());)Q["$<<"](a);else Q.$blocks().$shift();return[l(k,b)?u:k,d.$merge()]},-3);g(b,"$next_block",function(a,b,d,f){var g,k=u,Q=u,r=u,w=u,aa=u,fa=u,ca=u,B=u,ia=u,ba=u,A=u,O=u,G=u,E=u,S=
|
|
955
|
-
u,T=S=u,qa=u,I=u,L=u,J=u,M=u,K=Q=k=Q=u,H=J=u,N=u,P=Q=J=M=u,ea=S=Q=J=A=A=k=Q=A=J=u,Z=u;E=Z=ia=Z=Z=u;null==q["~"]&&(q["~"]=u);null==d&&(d=m([],{}));null==f&&(f=m([],{}));if(!c(k=a.$skip_blank_lines()))return u;c(Q=f["$[]"]("text_only"))&&c(F(k,0))&&(f.$delete("text_only"),Q=u);r=b.$document();if(c(f.$fetch("parse_metadata",!0)))for(;c(this.$parse_block_metadata_line(a,r,d,f));)if(a.$shift(),c(w=a.$skip_blank_lines()))w;else return u;if(c(aa=r.$extensions())){var Y=[aa["$blocks?"](),aa["$block_macros?"]()];
|
|
956
|
-
fa=Y[0];ca=Y[1];Y}a.$mark();Y=[a.$read_line(),r.$attributes(),d["$[]"](1)];B=Y[0];ia=Y[1];ba=Y[2];Y;A=O=G=E=u;c(S=this["$is_delimited_block?"](B,!0))&&(O=G=S.$context(),E=S.$terminator(),c(ba)?l(ba,O.$to_s())||(c(S.$masq()["$include?"](ba))?O=ba.$to_sym():c(S.$masq()["$include?"]("admonition"))&&c(p("ADMONITION_STYLES")["$include?"](ba))?O="admonition":c(fa)&&c(aa["$registered_for_block?"](ba,O))?O=ba.$to_sym():(c(this.$logger()["$debug?"]())&&this.$logger().$debug(this.$message_with_context("unknown style for "+
|
|
957
|
-
O+" block: "+ba,m(["source_location"],{source_location:a.$cursor_at_mark()}))),ba=O.$to_s())):ba=(Y=["style",O.$to_s()],h(d,"[]=",Y),Y[Y.length-1]));if(!c(S))for(;c(!0);){if(c(ba)&&c(p("Compliance").$strict_verbatim_paragraphs())&&c(p("VERBATIM_STYLES")["$include?"](ba))){O=ba.$to_sym();a.$unshift_line(B);break}if(c(Q))S=B["$start_with?"](" ",p("TAB"));else if(T=p("Compliance").$markdown_syntax(),c(B["$start_with?"](" "))){if(Y=[!0," "],S=Y[0],qa=Y[1],Y,c(T)&&c(h(B.$lstrip(),"start_with?",x(p("MARKDOWN_THEMATIC_BREAK_CHARS").$keys())))&&
|
|
958
|
-
c(p("MarkdownThematicBreakRx")["$match?"](B))){A=p("Block").$new(b,"thematic_break",m(["content_model"],{content_model:"empty"}));break}}else if(c(B["$start_with?"](p("TAB"))))Y=[!0,p("TAB")],S=Y[0],qa=Y[1],Y;else if(Y=[!1,B.$chr()],S=Y[0],qa=Y[1],Y,I=c(T)?p("HYBRID_LAYOUT_BREAK_CHARS"):p("LAYOUT_BREAK_CHARS"),c(I["$key?"](qa))&&c(c(T)?p("ExtLayoutBreakRx")["$match?"](B):c(w=this["$uniform?"](B,qa,L=B.$length()))?F(L,2):w)){A=p("Block").$new(b,I["$[]"](qa),m(["content_model"],{content_model:"empty"}));
|
|
959
|
-
break}else if(c(B["$end_with?"]("]"))&&c(B["$include?"]("::")))if((l(qa,"i")||c(B["$start_with?"]("video:","audio:")))&&c(p("BlockMediaMacroRx")["$=~"](B))){Y=[((g=q["~"])===u?u:g["$[]"](1)).$to_sym(),(g=q["~"])===u?u:g["$[]"](2),(g=q["~"])===u?u:g["$[]"](3)];J=Y[0];M=Y[1];Q=Y[2];Y;A=p("Block").$new(b,J,m(["content_model"],{content_model:"empty"}));if(c(Q)){switch(J){case "video":k=["poster","width","height"];break;case "audio":k=[];break;default:k=["alt","width","height"]}A.$parse_attributes(Q,k,
|
|
960
|
-
m(["sub_input","into"],{sub_input:!0,into:d}))}c(d["$key?"]("style"))&&d.$delete("style");if(c(M["$include?"](p("ATTR_REF_HEAD")))){if(c((Q=A.$sub_attributes(M))["$empty?"]())&&l(c(w=ia["$[]"]("attribute-missing"))?w:p("Compliance").$attribute_missing(),"drop-line")&&c(A.$sub_attributes(y(M," "),m(["attribute_missing","drop_line_severity"],{attribute_missing:"drop-line",drop_line_severity:"ignore"}))["$empty?"]()))return d.$clear(),u;M=Q}if(l(J,"image")){r.$register("images",M);d["$[]="]("imagesdir",
|
|
961
|
-
ia["$[]"]("imagesdir"));if(c(w=d["$[]"]("alt")))w;else d["$[]="]("alt",c(K=ba)?K:(Y=["default-alt",p("Helpers").$basename(M,!0).$tr("_-"," ")],h(d,"[]=",Y),Y[Y.length-1]));if(!c((J=d.$delete("scaledwidth"))["$nil_or_empty?"]()))d["$[]="]("scaledwidth",c(p("TrailingDigitsRx")["$match?"](J))?""+J+"%":J);c(d["$[]"]("title"))&&(A["$title="](H=d.$delete("title")),A.$assign_caption(d.$delete("caption"),"figure"))}d["$[]="]("target",M);break}else if(l(qa,"t")&&c(B["$start_with?"]("toc:"))&&c(p("BlockTocMacroRx")["$=~"](B))){A=
|
|
962
|
-
p("Block").$new(b,"toc",m(["content_model"],{content_model:"empty"}));c((Y=q["~"])===u?u:Y["$[]"](1))&&A.$parse_attributes((Y=q["~"])===u?u:Y["$[]"](1),[],m(["into"],{into:d}));break}else if(c(c(ca)?c(w=c(K=p("CustomBlockMacroRx")["$=~"](B))?N=aa["$registered_for_block_macro?"]((Y=q["~"])===u?u:Y["$[]"](1)):K)?w:M=this.$logger()["$debug?"]():c(w=this.$logger()["$debug?"]())?M=p("CustomBlockMacroRx")["$=~"](B):w))if(c(M))this.$logger().$debug(this.$message_with_context("unknown name for block macro: "+
|
|
963
|
-
((Y=q["~"])===u?u:Y["$[]"](1)),m(["source_location"],{source_location:a.$cursor_at_mark()})));else{J=(Y=q["~"])===u?u:Y["$[]"](3);if(c((M=(Y=q["~"])===u?u:Y["$[]"](2))["$include?"](p("ATTR_REF_HEAD")))){if(c((Q=b.$sub_attributes(M))["$empty?"]())&&l(c(w=ia["$[]"]("attribute-missing"))?w:p("Compliance").$attribute_missing(),"drop-line")&&c(b.$sub_attributes(y(M," "),m(["attribute_missing","drop_line_severity"],{attribute_missing:"drop-line",drop_line_severity:"ignore"}))["$empty?"]()))return d.$clear(),
|
|
964
|
-
u;M=Q}if(l((Q=N.$config())["$[]"]("content_model"),"attributes"))c(J)&&r.$parse_attributes(J,c(w=c(K=Q["$[]"]("positional_attrs"))?K:Q["$[]"]("pos_attrs"))?w:[],m(["sub_input","into"],{sub_input:!0,into:d}));else d["$[]="]("text",c(w=J)?w:"");c(P=Q["$[]"]("default_attrs"))&&h(d,"update",[P],function(a,b){null==b&&(b=u);return b});if(c(A=N.$process_method()["$[]"](b,M,d))&&t(A,b)){d.$replace(A.$attributes());break}else return d.$clear(),u}if(e(S)&&l(qa=c(w=qa)?w:B.$chr(),"<")&&c(p("CalloutListRx")["$=~"](B))){a.$unshift_line(B);
|
|
965
|
-
A=this.$parse_callout_list(a,q["~"],b,r.$callouts());d["$[]="]("style","arabic");break}else if(c(p("UnorderedListRx")["$match?"](B))){a.$unshift_line(B);if(e(ba)&&z(p("Section"),b)&&l(b.$sectname(),"bibliography"))d["$[]="]("style",ba="bibliography");A=this.$parse_list(a,"ulist",b,ba);break}else if(c(p("OrderedListRx")["$match?"](B))){a.$unshift_line(B);A=this.$parse_list(a,"olist",b,ba);if(c(A.$style()))d["$[]="]("style",A.$style());break}else if((c(B["$include?"]("::"))||c(B["$include?"](";;")))&&
|
|
966
|
-
c(p("DescriptionListRx")["$=~"](B))){a.$unshift_line(B);A=this.$parse_description_list(a,q["~"],b);break}else if((l(ba,"float")||l(ba,"discrete"))&&c(c(p("Compliance").$underline_style_section_titles())?this["$is_section_title?"](B,a.$peek_line()):c(w=S["$!"]())?this["$atx_section_title?"](B):w)){a.$unshift_line(B);g=this.$parse_section_title(a,r,d["$[]"]("id"));Y=n(g);J=null==Y[0]?u:Y[0];A=null==Y[1]?u:Y[1];H=null==Y[2]?u:Y[2];Q=null==Y[3]?u:Y[3];g;if(c(A))d["$[]="]("reftext",A);A=p("Block").$new(b,
|
|
967
|
-
"floating_title",m(["content_model"],{content_model:"empty"}));A["$title="](H);d.$delete("title");A["$id="](c(w=J)?w:c(ia["$key?"]("sectids"))?p("Section").$generate_id(A.$title(),r):u);A["$level="](Q);break}else if(c(ba)&&t(ba,"normal"))if(c(p("PARAGRAPH_STYLES")["$include?"](ba))){O=ba.$to_sym();G="paragraph";a.$unshift_line(B);break}else if(c(p("ADMONITION_STYLES")["$include?"](ba))){O="admonition";G="paragraph";a.$unshift_line(B);break}else if(c(fa)&&c(aa["$registered_for_block?"](ba,"paragraph"))){O=
|
|
968
|
-
ba.$to_sym();G="paragraph";a.$unshift_line(B);break}else c(this.$logger()["$debug?"]())&&this.$logger().$debug(this.$message_with_context("unknown style for paragraph: "+ba,m(["source_location"],{source_location:a.$cursor_at_mark()}))),ba=u;a.$unshift_line(B);if(c(S)&&e(ba))k=this.$read_paragraph_lines(a,A=l(k,0)?f["$[]"]("list_type"):u,m(["skip_line_comments"],{skip_line_comments:Q})),this["$adjust_indentation!"](k),A=c(Q)||l(A,"dlist")?p("Block").$new(b,"paragraph",m(["content_model","source","attributes"],
|
|
969
|
-
{content_model:"simple",source:k,attributes:d})):p("Block").$new(b,"literal",m(["content_model","source","attributes"],{content_model:"verbatim",source:k,attributes:d}));else{k=this.$read_paragraph_lines(a,c(w=k["$=="](0))?f["$[]"]("list_type"):w,m(["skip_line_comments"],{skip_line_comments:!0}));if(c(Q)){if(c(S)&&l(ba,"normal"))this["$adjust_indentation!"](k);A=p("Block").$new(b,"paragraph",m(["content_model","source","attributes"],{content_model:"simple",source:k,attributes:d}))}else if(c(p("ADMONITION_STYLE_HEADS")["$include?"](qa))&&
|
|
970
|
-
c(B["$include?"](":"))&&c(p("AdmonitionParagraphRx")["$=~"](B)))k["$[]="](0,(Y=q["~"])===u?u:Y.$post_match()),d["$[]="]("name",A=(Y=["style",(g=q["~"])===u?u:g["$[]"](1)],h(d,"[]=",Y),Y[Y.length-1]).$downcase()),d["$[]="]("textlabel",c(w=d.$delete("caption"))?w:ia["$[]"](""+A+"-caption")),A=p("Block").$new(b,"admonition",m(["content_model","source","attributes"],{content_model:"simple",source:k,attributes:d}));else if(c(T)&&l(qa,">")&&c(B["$start_with?"]("> "))){h(k,"map!",[],function(a){null==a&&
|
|
971
|
-
(a=u);return l(a,">")?a.$slice(1,a.$length()):c(a["$start_with?"]("> "))?a.$slice(2,a.$length()):a});if(c(k["$[]"](-1)["$start_with?"]("-- "))&&(J=(J=k.$pop()).$slice(3,J.$length()),!c(k["$empty?"]())))for(;c(k["$[]"](-1)["$empty?"]());)k.$pop();d["$[]="]("style","quote");A=this.$build_block("quote","compound",!1,b,p("Reader").$new(k),d);if(c(J)){g=A.$apply_subs(J).$split(", ",2);Y=n(g);Q=null==Y[0]?u:Y[0];S=null==Y[1]?u:Y[1];g;if(c(Q))d["$[]="]("attribution",Q);if(c(S))d["$[]="]("citetitle",S)}}else if(l(qa,
|
|
972
|
-
'"')&&c(F(k.$size(),1))&&c(k["$[]"](-1)["$start_with?"]("-- "))&&c(k["$[]"](-2)["$end_with?"]('"'))){k["$[]="](0,B.$slice(1,B.$length()));for(J=(J=k.$pop()).$slice(3,J.$length());c(k["$[]"](-1)["$empty?"]());)k.$pop();k["$<<"](k.$pop().$chop());d["$[]="]("style","quote");A=p("Block").$new(b,"quote",m(["content_model","source","attributes"],{content_model:"simple",source:k,attributes:d}));g=A.$apply_subs(J).$split(", ",2);Y=n(g);Q=null==Y[0]?u:Y[0];S=null==Y[1]?u:Y[1];g;if(c(Q))d["$[]="]("attribution",
|
|
973
|
-
Q);if(c(S))d["$[]="]("citetitle",S)}else{if(c(S)&&l(ba,"normal"))this["$adjust_indentation!"](k);A=p("Block").$new(b,"paragraph",m(["content_model","source","attributes"],{content_model:"simple",source:k,attributes:d}))}this.$catalog_inline_anchors(k.$join(p("LF")),A,r,a)}break}if(!c(A))switch(O){case "listing":case "source":if(l(O,"source")||e(d["$[]"](1))&&c(ea=c(K=d["$[]"](2))?K:ia["$[]"]("source-language"))){if(c(ea))d["$[]="]("style","source"),d["$[]="]("language",ea),p("AttributeList").$rekey(d,
|
|
974
|
-
[u,u,"linenums"]);else if(p("AttributeList").$rekey(d,[u,"language","linenums"]),!c(d["$key?"]("language"))&&c(ia["$key?"]("source-language")))d["$[]="]("language",ia["$[]"]("source-language"));if(!c(d["$key?"]("linenums"))&&(c(d["$[]"]("linenums-option"))||c(ia["$[]"]("source-linenums-option"))))d["$[]="]("linenums","");if(!c(d["$key?"]("indent"))&&c(ia["$key?"]("source-indent")))d["$[]="]("indent",ia["$[]"]("source-indent"))}A=this.$build_block("listing","verbatim",E,b,a,d);break;case "fenced_code":d["$[]="]("style",
|
|
975
|
-
"source");if(c(F(L=B.$length(),3)))if(c(Z=(ea=B.$slice(3,L)).$index(",")))if(c(F(Z,0))){if(ea=ea.$slice(0,Z).$strip(),c(v(Z,D(L,4))))d["$[]="]("linenums","")}else{if(c(F(L,4)))d["$[]="]("linenums","")}else ea=ea.$lstrip();if(c(ea["$nil_or_empty?"]())){if(c(ia["$key?"]("source-language")))d["$[]="]("language",ia["$[]"]("source-language"))}else d["$[]="]("language",ea);if(!c(d["$key?"]("linenums"))&&(c(d["$[]"]("linenums-option"))||c(ia["$[]"]("source-linenums-option"))))d["$[]="]("linenums","");if(!c(d["$key?"]("indent"))&&
|
|
976
|
-
c(ia["$key?"]("source-indent")))d["$[]="]("indent",ia["$[]"]("source-indent"));E=E.$slice(0,3);A=this.$build_block("listing","verbatim",E,b,a,d);break;case "table":Z=a.$cursor();Z=p("Reader").$new(a.$read_lines_until(m(["terminator","skip_line_comments","context","cursor"],{terminator:E,skip_line_comments:!0,context:"table",cursor:"at_mark"})),Z);if(!c(E["$start_with?"]("|","!")))if(c(K=d["$[]"]("format")))K;else d["$[]="]("format",c(E["$start_with?"](","))?"csv":"dsv");A=this.$parse_table(Z,b,d);
|
|
977
|
-
break;case "sidebar":A=this.$build_block(O,"compound",E,b,a,d);break;case "admonition":d["$[]="]("name",A=ba.$downcase());d["$[]="]("textlabel",c(K=d.$delete("caption"))?K:ia["$[]"](""+A+"-caption"));A=this.$build_block(O,"compound",E,b,a,d);break;case "open":case "abstract":case "partintro":A=this.$build_block("open","compound",E,b,a,d);break;case "literal":A=this.$build_block(O,"verbatim",E,b,a,d);break;case "example":if(c(d["$[]"]("collapsible-option")))d["$[]="]("caption","");A=this.$build_block(O,
|
|
978
|
-
"compound",E,b,a,d);break;case "quote":case "verse":p("AttributeList").$rekey(d,[u,"attribution","citetitle"]);A=this.$build_block(O,l(O,"verse")?"verbatim":"compound",E,b,a,d);break;case "stem":case "latexmath":case "asciimath":if(l(O,"stem"))d["$[]="]("style",p("STEM_TYPE_ALIASES")["$[]"](c(K=d["$[]"](2))?K:ia["$[]"]("stem")));A=this.$build_block("stem","raw",E,b,a,d);break;case "pass":A=this.$build_block(O,"raw",E,b,a,d);break;case "comment":return this.$build_block(O,"skip",E,b,a,d),d.$clear(),
|
|
979
|
-
u;default:if(c(fa)&&c(N=aa["$registered_for_block?"](O,G))){if(l(ia=(Q=N.$config())["$[]"]("content_model"),"skip")||(c((Z=c(K=Q["$[]"]("positional_attrs"))?K:Q["$[]"]("pos_attrs"))["$nil_or_empty?"]())||p("AttributeList").$rekey(d,y([u],Z)),c(P=Q["$[]"]("default_attrs"))&&h(P,"each",[],function(a,b){var e;null==a&&(a=u);null==b&&(b=u);return c(K=d["$[]"](a))?K:(e=[a,b],h(d,"[]=",e),e[e.length-1])}),d["$[]="]("cloaked-context",G)),!c(A=this.$build_block(O,ia,E,b,a,d,m(["extension"],{extension:N}))))return d.$clear(),
|
|
980
|
-
u}else this.$raise("Unsupported block type "+O+" at "+a.$cursor())}if(c(r.$sourcemap()))A["$source_location="](a.$cursor_at_mark());c(d["$[]"]("title"))&&(A["$title="](H=d.$delete("title")),c(p("CAPTION_ATTRIBUTE_NAMES")["$[]"](A.$context()))&&A.$assign_caption(d.$delete("caption")));A["$style="](d["$[]"]("style"));c(E=c(w=A.$id())?w:(Y=[d["$[]"]("id")],h(A,"id=",Y),Y[Y.length-1]))&&(c(c(H)?H["$include?"](p("ATTR_REF_HEAD")):A["$title?"]())&&A.$title(),c(r.$register("refs",[E,A]))||this.$logger().$warn(this.$message_with_context("id assigned to block already in use: "+
|
|
981
|
-
E,m(["source_location"],{source_location:a.$cursor_at_mark()}))));c(d["$empty?"]())||A.$update_attributes(d);A.$commit_subs();c(A["$sub?"]("callouts"))&&(c(this.$catalog_callouts(A.$source(),r))||A.$remove_sub("callouts"));return A},-3);g(b,"$read_paragraph_lines",function(a,b,d){null==d&&(d=m([],{}));d["$[]="]("break_on_blank_lines",!0);d["$[]="]("break_on_list_continuation",!0);d["$[]="]("preserve_last_line",!0);b=c(b)?c(p("Compliance").$block_terminates_paragraph())?p("StartOfBlockOrListProc"):
|
|
982
|
-
p("StartOfListProc"):c(p("Compliance").$block_terminates_paragraph())?p("StartOfBlockProc"):p("NoOp");return h(a,"read_lines_until",[d],b.$to_proc())},-3);g(b,"$is_delimited_block?",function(a,b){var d;null==b&&(b=u);if(!c(F(d=a.$length(),1))||!c(p("DELIMITED_BLOCK_HEADS")["$[]"](a.$slice(0,2))))return u;if(l(d,2)){var e=a;var f=2}else if(c(v(d,5))?(e=a,f=d):e=a.$slice(0,f=4),c(p("Compliance").$markdown_syntax())&&c(e["$start_with?"]("`")))if(l(f,4)){if(l(e,"````")||t(e=e.$chop(),"```"))return u;
|
|
983
|
-
a=e;d=f=3}else{if(t(e,"```"))return u}else if(l(f,3))return u;var h=p("DELIMITED_BLOCKS")["$[]"](e);var g=n(h);var k=null==g[0]?u:g[0];g=null==g[1]?u:g[1];h;return c(k)&&(l(d,f)||c(this["$uniform?"](a.$slice(1,d),p("DELIMITED_BLOCK_TAILS")["$[]"](e),D(d,1))))?c(b)?p("BlockMatchData").$new(k,g,e,a):!0:u},-2);g(b,"$build_block",function(a,b,d,f,h,g,k){var Q=u,n=u,q=u;null==k&&(k=m([],{}));switch(b){case "skip":var r=[!0,"simple"];var w=r[0];var y=r[1];r;break;case "raw":r=[!1,"simple"];w=r[0];y=r[1];
|
|
984
|
-
r;break;default:r=[!1,b],w=r[0],y=r[1],r}c(d["$nil?"]())?(l(y,"verbatim")?r=h.$read_lines_until(m(["break_on_blank_lines","break_on_list_continuation"],{break_on_blank_lines:!0,break_on_list_continuation:!0})):(l(b,"compound")&&(b="simple"),r=this.$read_paragraph_lines(h,!1,m(["skip_line_comments","skip_processing"],{skip_line_comments:!0,skip_processing:w}))),d=u):t(y,"compound")?(r=h.$read_lines_until(m(["terminator","skip_processing","context","cursor"],{terminator:d,skip_processing:w,context:a,
|
|
985
|
-
cursor:"at_mark"})),d=u):l(d,!1)?(r=u,d=h):(r=u,y=h.$cursor(),d=p("Reader").$new(h.$read_lines_until(m(["terminator","skip_processing","context","cursor"],{terminator:d,skip_processing:w,context:a,cursor:"at_mark"})),y));switch(b){case "verbatim":h=(c(Q=g["$[]"]("tabsize"))?Q:f.$document().$attributes()["$[]"]("tabsize")).$to_i();if(c(Q=g["$[]"]("indent")))this["$adjust_indentation!"](r,Q.$to_i(),h);else if(c(F(h,0)))this["$adjust_indentation!"](r,-1,h);break;case "skip":return u;default:u}if(c(k=
|
|
986
|
-
k["$[]"]("extension")))if(g.$delete("style"),c(n=k.$process_method()["$[]"](f,c(q=d)?q:p("Reader").$new(r),g.$merge()))&&t(n,f))g.$replace(n.$attributes()),l(n.$content_model(),"compound")&&z(p("Block"),n)&&e((r=n.$lines())["$empty?"]())&&(b="compound",d=p("Reader").$new(r));else return u;else n=p("Block").$new(f,a,m(["content_model","source","attributes"],{content_model:b,source:r,attributes:g}));l(b,"compound")&&this.$parse_blocks(d,n);return n},-7);g(b,"$parse_blocks",function(a,b,d){var e=u,f=
|
|
987
|
-
u,h=u;null==d&&(d=u);if(c(d))for(;c(c(e=c(f=h=this.$next_block(a,b,d.$merge()))?b.$blocks()["$<<"](h):f)?e:a["$has_more_lines?"]()););else for(;c(c(e=c(f=h=this.$next_block(a,b))?b.$blocks()["$<<"](h):f)?e:a["$has_more_lines?"]()););return u},-3);g(b,"$parse_list",function(a,b,d,e){var f,h=u;null==q["~"]&&(q["~"]=u);d=p("List").$new(d,b);for(b=p("ListRxMap")["$[]"](b);c(c(h=a["$has_more_lines?"]())?b["$=~"](a.$peek_line()):h);){if(c(h=this.$parse_list_item(a,d,q["~"],(f=q["~"])===u?u:f["$[]"](1),
|
|
988
|
-
e)))d.$items()["$<<"](h);if(c(h=a.$skip_blank_lines()))h;else break}return d});g(b,"$catalog_callouts",function(a,b){var d=u,e=u;d=!1;e=0;c(a["$include?"]("<"))&&h(a,"scan",[p("CalloutScanRx")],function(){var a;c(((a=q["~"])===u?u:a["$[]"](0))["$start_with?"]("\\"))||b.$callouts().$register(l((a=q["~"])===u?u:a["$[]"](2),".")?(e=y(e,1)).$to_s():(a=q["~"])===u?u:a["$[]"](2));return d=!0});return d});g(b,"$catalog_inline_anchor",function(a,b,d,e,f){null==f&&(f=d.$document());c(b)&&c(b["$include?"](p("ATTR_REF_HEAD")))&&
|
|
989
|
-
(b=f.$sub_attributes(b));c(f.$register("refs",[a,p("Inline").$new(d,"anchor",b,m(["type","id"],{type:"ref",id:a}))]))||(z(p("Reader"),e)&&(e=e.$cursor()),this.$logger().$warn(this.$message_with_context("id assigned to anchor already in use: "+a,m(["source_location"],{source_location:e}))));return u},-5);g(b,"$catalog_inline_anchors",function(a,b,d,e){(c(a["$include?"]("[["))||c(a["$include?"]("or:")))&&h(a,"scan",[p("InlineAnchorScanRx")],function da(){var a,f=null==da.$$s?this:da.$$s,h,g=u,l;if(c(h=
|
|
990
|
-
(a=q["~"])===u?u:a["$[]"](1))){if(c(g=(a=q["~"])===u?u:a["$[]"](2))&&c(g["$include?"](p("ATTR_REF_HEAD")))&&c((g=d.$sub_attributes(g))["$empty?"]()))return u}else h=(a=q["~"])===u?u:a["$[]"](3),c(g=(a=q["~"])===u?u:a["$[]"](4))&&(c(g["$include?"]("]"))?(g=g.$gsub("\\]","]"),c(g["$include?"](p("ATTR_REF_HEAD")))&&(g=d.$sub_attributes(g))):c(g["$include?"](p("ATTR_REF_HEAD")))&&c((g=d.$sub_attributes(g))["$empty?"]())&&(g=u));if(c(d.$register("refs",[h,p("Inline").$new(b,"anchor",g,m(["type","id"],
|
|
991
|
-
{type:"ref",id:h}))])))return u;g=e.$cursor_at_mark();c(F(l=y(((a=q["~"])===u?u:a.$pre_match()).$count(p("LF")),c(((a=q["~"])===u?u:a["$[]"](0))["$start_with?"](p("LF")))?1:0),0))&&(g=g.$dup()).$advance(l);return f.$logger().$warn(f.$message_with_context("id assigned to anchor already in use: "+h,m(["source_location"],{source_location:g})))},{$$s:this});return u});g(b,"$catalog_inline_biblio_anchor",function(a,b,d,e){var f=u;c(d.$document().$register("refs",[a,p("Inline").$new(d,"anchor",c(f=b)?"["+
|
|
992
|
-
b+"]":f,m(["type","id"],{type:"bibref",id:a}))]))||this.$logger().$warn(this.$message_with_context("id assigned to bibliography anchor already in use: "+a,m(["source_location"],{source_location:e.$cursor()})));return u});g(b,"$parse_description_list",function(a,b,d){var e=u;null==q["~"]&&(q["~"]=u);d=p("List").$new(d,"dlist");var f=p("DescriptionListSiblingRx")["$[]"](b["$[]"](2));for(d.$items()["$<<"](b=this.$parse_list_item(a,d,b,f));c(c(e=a["$has_more_lines?"]())?f["$=~"](a.$peek_line()):e);){var h=
|
|
993
|
-
this.$parse_list_item(a,d,q["~"],f);if(c(b["$[]"](1)))d.$items()["$<<"](b=h);else b["$[]"](0)["$<<"](h["$[]"](0)["$[]"](0)),b["$[]="](1,h["$[]"](1))}return d});g(b,"$parse_callout_list",function(a,b,d,e){var f,h=u,g=u,k;d=p("List").$new(d,"colist");var n=1;for(f=0;c(c(h=b)?h:c(g=b=p("CalloutListRx").$match(a.$peek_line()))?a.$mark():g);){l(k=b["$[]"](1),".")&&(k=(f=y(f,1)).$to_s());l(k,n.$to_s())||this.$logger().$warn(this.$message_with_context("callout list item index: expected "+n+", got "+k,m(["source_location"],
|
|
994
|
-
{source_location:a.$cursor_at_mark()})));if(c(b=this.$parse_list_item(a,d,b,"<1>")))if(d.$items()["$<<"](b),c((k=e.$callout_ids(d.$items().$size()))["$empty?"]()))this.$logger().$warn(this.$message_with_context("no callout found for <"+d.$items().$size()+">",m(["source_location"],{source_location:a.$cursor_at_mark()})));else b.$attributes()["$[]="]("coids",k);n=y(n,1);b=u}e.$next_list();return d});g(b,"$parse_list_item",function(a,b,d,f,h){var g,k,r=u,w=u;var y=u;var t,v=u,F=u,x,B=u,z=u,A=u,ca=u;
|
|
995
|
-
null==h&&(h=u);if(l(k=b.$context(),"dlist")){if(r=!0,w=p("ListItem").$new(b,h=d["$[]"](1)),c(h["$start_with?"]("[["))&&c(p("LeadingInlineAnchorRx")["$=~"](h))&&this.$catalog_inline_anchor((g=q["~"])===u?u:g["$[]"](1),c(y=(g=q["~"])===u?u:g["$[]"](2))?y:((g=q["~"])===u?u:g.$post_match()).$lstrip(),w,a),c(t=d["$[]"](3))&&(v=!0),d=p("ListItem").$new(b,t),c(b.$document().$sourcemap()))if(w["$source_location="](a.$cursor()),c(v))d["$source_location="](w.$source_location());else F=!0}else{v=!0;d=p("ListItem").$new(b,
|
|
996
|
-
t=d["$[]"](2));if(c(b.$document().$sourcemap()))d["$source_location="](a.$cursor());switch(k){case "ulist":d["$marker="](f);if(c(t["$start_with?"]("[")))if(c(h)&&l(h,"bibliography"))c(p("InlineBiblioAnchorRx")["$=~"](t))&&this.$catalog_inline_biblio_anchor((g=q["~"])===u?u:g["$[]"](1),(g=q["~"])===u?u:g["$[]"](2),d,a);else if(c(t["$start_with?"]("[[")))c(p("LeadingInlineAnchorRx")["$=~"](t))&&this.$catalog_inline_anchor((g=q["~"])===u?u:g["$[]"](1),(g=q["~"])===u?u:g["$[]"](2),d,a);else if(c(t["$start_with?"]("[ ] ",
|
|
997
|
-
"[x] ","[*] "))){b.$set_option("checklist");d.$attributes()["$[]="]("checkbox","");if(!c(t["$start_with?"]("[ ")))d.$attributes()["$[]="]("checked","");d["$text="](t.$slice(4,t.$length()))}break;case "olist":y=this.$resolve_ordered_list_marker(f,x=b.$items().$size(),!0,a);g=n(y);f=null==g[0]?u:g[0];var aa=null==g[1]?u:g[1];y;d["$marker="](f);if(l(x,0)&&e(h))b["$style="](c(B=aa)?B:(c(z=p("ORDERED_LIST_STYLES")["$[]"](D(f.$length(),1)))?z:"arabic").$to_s());c(t["$start_with?"]("[["))&&c(p("LeadingInlineAnchorRx")["$=~"](t))&&
|
|
998
|
-
this.$catalog_inline_anchor((g=q["~"])===u?u:g["$[]"](1),(g=q["~"])===u?u:g["$[]"](2),d,a);break;default:d["$marker="](f),c(t["$start_with?"]("[["))&&c(p("LeadingInlineAnchorRx")["$=~"](t))&&this.$catalog_inline_anchor((g=q["~"])===u?u:g["$[]"](1),(g=q["~"])===u?u:g["$[]"](2),d,a)}}a.$shift();b=a.$cursor();a=p("Reader").$new(this.$read_lines_for_list_item(a,k,f,v),b);if(c(a["$has_more_lines?"]())){if(c(F))d["$source_location="](b);F=a.$skip_line_comments();c(f=a.$peek_line())&&(c(F["$empty?"]())||
|
|
999
|
-
a.$unshift_lines(F),c(f["$empty?"]())||(A=!0,c(r)||(v=u)));if(c(v=this.$next_block(a,d,m([],{}),m(["text_only","list_type"],{text_only:c(v)?u:!0,list_type:k}))))d.$blocks()["$<<"](v);for(;c(a["$has_more_lines?"]());)if(c(v=this.$next_block(a,d,m([],{}),m(["list_type"],{list_type:k}))))d.$blocks()["$<<"](v);c(A)&&c(ca=d.$blocks()["$[]"](0))&&l(ca.$context(),"paragraph")&&d.$fold_first()}return c(r)?[[w],c(d["$text?"]())||c(d["$blocks?"]())?d:u]:d},-5);g(b,"$read_lines_for_list_item",function(a,b,d,
|
|
1000
|
-
f){var g,k=u,Q=u,n=u,r=u,w=u,y=u,v=u,F=u,x=F=v=u,B=u,z=v=u;Q=u;null==d&&(d=u);null==f&&(f=!0);k=[];Q="inactive";n=!1;r=u;for(w=b["$=="]("dlist");c(a["$has_more_lines?"]());){y=a.$read_line();if(c(this["$is_sibling_list_item?"](y,b,d)))break;v=c(k["$empty?"]())?u:k["$[]"](-1);if(l(v,p("LIST_CONTINUATION"))){if(l(Q,"inactive")&&(Q="active",f=!0,!c(n)))k["$[]="](-1,"");if(l(y,p("LIST_CONTINUATION"))){t(Q,"frozen")&&(Q="frozen",k["$<<"](y));y=u;continue}}if(c(F=this["$is_delimited_block?"](y,!0))){if(!l(Q,
|
|
1001
|
-
"active"))break;k["$<<"](y);k.$concat(a.$read_lines_until(m(["terminator","read_last_line","context"],{terminator:F.$terminator(),read_last_line:!0,context:u})));Q="inactive"}else if(c(w)&&t(Q,"active")&&c(y["$start_with?"]("["))&&c(p("BlockAttributeLineRx")["$match?"](y))){for(v=[y];c(F=a.$peek_line());){if(c(this["$is_delimited_block?"](F)))x=!0;else if(c(F["$empty?"]())||c(F["$start_with?"]("["))&&c(p("BlockAttributeLineRx")["$match?"](F))){v["$<<"](a.$read_line());continue}else c(p("AnyListRx")["$match?"](F))&&
|
|
1002
|
-
e(this["$is_sibling_list_item?"](F,b,d))?k.$concat(v):x=!0;break}if(c(x)){a.$unshift_lines(v);break}}else if(l(Q,"active")&&e(y["$empty?"]()))if(c(p("LiteralParagraphRx")["$match?"](y)))a.$unshift_line(y),c(w)?k.$concat(h(a,"read_lines_until",[m(["preserve_last_line","break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0})],function Da(a){var c=null==Da.$$s?this:Da.$$s;null==a&&(a=u);return c["$is_sibling_list_item?"](a,b,
|
|
1003
|
-
d)},{$$s:this})):k.$concat(a.$read_lines_until(m(["preserve_last_line","break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0}))),Q="inactive";else if(l(B=y.$chr(),".")&&c(p("BlockTitleRx")["$match?"](y))||l(B,"[")&&c(p("BlockAttributeLineRx")["$match?"](y))||l(B,":")&&c(p("AttributeEntryRx")["$match?"](y)))k["$<<"](y);else c(v=h(c(n)?["dlist"]:p("NESTABLE_LIST_CONTEXTS"),"find",[],function(a){null==a&&(a=u);return p("ListRxMap")["$[]"](a)["$match?"](y)}))&&
|
|
1004
|
-
(n=!0,l(v,"dlist")&&c(((g=q["~"])===u?u:g["$[]"](3))["$nil_or_empty?"]())&&(f=!1)),k["$<<"](y),Q="inactive";else if(c(v)&&c(v["$empty?"]())){if(c(y["$empty?"]())){if(!c(y=c(z=a.$skip_blank_lines())?a.$read_line():z))break;if(c(this["$is_sibling_list_item?"](y,b,d)))break}if(l(y,p("LIST_CONTINUATION")))r=k.$size(),k["$<<"](y);else if(c(f))if(c(this["$is_sibling_list_item?"](y,b,d)))break;else if(c(v=h(p("NESTABLE_LIST_CONTEXTS"),"find",[],function(a){null==a&&(a=u);return p("ListRxMap")["$[]"](a)["$=~"](y)})))k["$<<"](y),
|
|
1005
|
-
n=!0,l(v,"dlist")&&c(((g=q["~"])===u?u:g["$[]"](3))["$nil_or_empty?"]())&&(f=!1);else if(c(p("LiteralParagraphRx")["$match?"](y)))a.$unshift_line(y),c(w)?k.$concat(h(a,"read_lines_until",[m(["preserve_last_line","break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0})],function Da(a){var c=null==Da.$$s?this:Da.$$s;null==a&&(a=u);return c["$is_sibling_list_item?"](a,b,d)},{$$s:this})):k.$concat(a.$read_lines_until(m(["preserve_last_line",
|
|
1006
|
-
"break_on_blank_lines","break_on_list_continuation"],{preserve_last_line:!0,break_on_blank_lines:!0,break_on_list_continuation:!0})));else break;else c(n)||k.$pop(),k["$<<"](y),f=!0}else c(y["$empty?"]())||(f=!0),c(v=h(c(n)?["dlist"]:p("NESTABLE_LIST_CONTEXTS"),"find",[],function(a){null==a&&(a=u);return p("ListRxMap")["$[]"](a)["$=~"](y)}))&&(n=!0,l(v,"dlist")&&c(((g=q["~"])===u?u:g["$[]"](3))["$nil_or_empty?"]())&&(f=!1)),k["$<<"](y);y=u}c(y)&&a.$unshift_line(y);if(c(r))k["$[]="](r,"");for(;!c(k["$empty?"]());)if(c((Q=
|
|
1007
|
-
k["$[]"](-1))["$empty?"]()))k.$pop();else{l(Q,p("LIST_CONTINUATION"))&&k.$pop();break}return k},-3);g(b,"$initialize_section",function(a,b,d){var f,g=u,k=u,Q=u,r=u,q=u;null==d&&(d=m([],{}));var w=b.$document();var y=(f=w.$doctype())["$=="]("book");c(w.$sourcemap())&&(g=a.$cursor());var t=d["$[]"](1);var v=this.$parse_section_title(a,w,d["$[]"]("id"));var x=n(v);var B=null==x[0]?u:x[0];var z=null==x[1]?u:x[1];var A=null==x[2]?u:x[2];var aa=null==x[3]?u:x[3];var O=null==x[4]?u:x[4];v;c(t)?c(y)&&l(t,
|
|
1008
|
-
"abstract")?(x=["chapter",1],v=x[0],aa=x[1],x):c(t["$start_with?"]("sect"))&&c(p("SectionLevelStyleRx")["$match?"](t))?v="section":(x=[t,!0],v=x[0],k=x[1],x,l(aa,0)&&(aa=1),Q=v["$=="]("appendix")):c(y)?v=l(aa,0)?"part":c(F(aa,1))?"section":"chapter":l(f,"manpage")&&l(A.$casecmp("synopsis"),0)?(x=["synopsis",!0],v=x[0],k=x[1],x):v="section";if(c(z))d["$[]="]("reftext",z);z=p("Section").$new(b,aa);x=[B,A,v,g];v=[x[0]];h(z,"id=",v);v[v.length-1];v=[x[1]];h(z,"title=",v);v[v.length-1];v=[x[2]];h(z,"sectname=",
|
|
1009
|
-
v);v[v.length-1];v=[x[3]];h(z,"source_location=",v);v[v.length-1];x;if(c(k))if(z["$special="](!0),c(Q))z["$numbered="](!0);else{if(l(w.$attributes()["$[]"]("sectnums"),"all"))z["$numbered="](c(y)&&l(aa,1)?"chapter":!0)}else if(c(w.$attributes()["$[]"]("sectnums"))&&c(F(aa,0)))z["$numbered="](c(z.$special())?c(r=b.$numbered())||r:!0);else if(c(y)&&l(aa,0)&&c(w.$attributes()["$[]"]("partnums")))z["$numbered="](!0);c(b=c(r=z.$id())?r:(x=[c(w.$attributes()["$key?"]("sectids"))?q=p("Section").$generate_id(z.$title(),
|
|
1010
|
-
w):u],h(z,"id=",x),x[x.length-1]))&&(c(q)||e(A["$include?"](p("ATTR_REF_HEAD")))||z.$title(),c(w.$register("refs",[b,z]))||this.$logger().$warn(this.$message_with_context("id assigned to section already in use: "+b,m(["source_location"],{source_location:a.$cursor_at_line(D(a.$lineno(),c(O)?1:2))}))));z.$update_attributes(d);a.$skip_blank_lines();return z},-3);g(b,"$is_next_line_section?",function(a,b){var d=u,e=u;return c(d=b["$[]"](1))&&(l(d,"discrete")||l(d,"float"))?u:c(p("Compliance").$underline_style_section_titles())?
|
|
1011
|
-
(a=a.$peek_lines(2,c(e=d)?d["$=="]("comment"):e),this["$is_section_title?"](c(e=a["$[]"](0))?e:"",a["$[]"](1))):this["$atx_section_title?"](c(e=a.$peek_line())?e:"")});g(b,"$is_next_line_doctitle?",function(a,b,d){var e,f;return c(d)?c(e=f=this["$is_next_line_section?"](a,b))?y(f,d.$to_i())["$=="](0):e:this["$is_next_line_section?"](a,b)["$=="](0)});g(b,"$is_section_title?",function(a,b){var d;null==b&&(b=u);return c(d=this["$atx_section_title?"](a))?d:c(b["$nil_or_empty?"]())?u:this["$setext_section_title?"](a,
|
|
1012
|
-
b)},-2);g(b,"$atx_section_title?",function(a){var b,d=u;return c(c(p("Compliance").$markdown_syntax())?c(d=a["$start_with?"]("=","#"))?p("ExtAtxSectionTitleRx")["$=~"](a):d:c(d=a["$start_with?"]("="))?p("AtxSectionTitleRx")["$=~"](a):d)?D(((b=q["~"])===u?u:b["$[]"](1)).$length(),1):u});g(b,"$setext_section_title?",function(a,b){var d=u,e,f=u;return c(e=p("SETEXT_SECTION_LEVELS")["$[]"](f=b.$chr()))&&c(this["$uniform?"](b,f,d=b.$length()))&&c(p("SetextSectionTitleRx")["$match?"](a))&&c(v(D(a.$length(),
|
|
1013
|
-
d).$abs(),2))?e:u});g(b,"$parse_section_title",function(a,b,d){var f,h=u,g=u,l=u,k=u,m=u,n=u,r=u;null==d&&(d=u);var w=u;var t=a.$read_line();if(c(c(p("Compliance").$markdown_syntax())?c(h=t["$start_with?"]("=","#"))?p("ExtAtxSectionTitleRx")["$=~"](t):h:c(h=t["$start_with?"]("="))?p("AtxSectionTitleRx")["$=~"](t):h)){var x=[D(((f=q["~"])===u?u:f["$[]"](1)).$length(),1),(f=q["~"])===u?u:f["$[]"](2),!0];g=x[0];l=x[1];k=x[2];x;!c(d)&&c(l["$end_with?"]("]]"))&&c(p("InlineSectionAnchorRx")["$=~"](l))&&
|
|
1014
|
-
e((x=q["~"])===u?u:x["$[]"](1))&&(x=[l.$slice(0,D(l.$length(),((f=q["~"])===u?u:f["$[]"](0)).$length())),(f=q["~"])===u?u:f["$[]"](2),(f=q["~"])===u?u:f["$[]"](3)],l=x[0],d=x[1],w=x[2],x)}else c(p("Compliance").$underline_style_section_titles())&&c(r=a.$peek_line(!0))&&c(g=p("SETEXT_SECTION_LEVELS")["$[]"](n=r.$chr()))&&c(this["$uniform?"](r,n,m=r.$length()))&&c(l=c(h=p("SetextSectionTitleRx")["$=~"](t))?(x=q["~"])===u?u:x["$[]"](1):h)&&c(v(D(t.$length(),m).$abs(),2))?(k=!1,!c(d)&&c(l["$end_with?"]("]]"))&&
|
|
1015
|
-
c(p("InlineSectionAnchorRx")["$=~"](l))&&e((x=q["~"])===u?u:x["$[]"](1))&&(x=[l.$slice(0,D(l.$length(),((f=q["~"])===u?u:f["$[]"](0)).$length())),(f=q["~"])===u?u:f["$[]"](2),(f=q["~"])===u?u:f["$[]"](3)],l=x[0],d=x[1],w=x[2],x),a.$shift()):this.$raise("Unrecognized section at "+a.$cursor_at_prev_line());c(b["$attr?"]("leveloffset"))&&(g=y(g,b.$attr("leveloffset").$to_i()),c(v(g,0))&&(g=0));return[d,w,l,g,k]},-3);g(b,"$parse_header_metadata",function(a,b,d){var f,g=u,k=u,Q=u,n=u,r=u,q=u,w=u,v=u,x=
|
|
1016
|
-
u,B=u,z=v=u,A=u,D=u,O=v=x=u,aa=u,E=u;null==b&&(b=u);null==d&&(d=!0);g=c(k=b)?b.$attributes():k;this.$process_attribute_entries(a,b);if(c(a["$has_more_lines?"]())&&e(a["$next_line_empty?"]())){Q=(n=this.$process_authors(a.$read_line())).$delete("authorcount");c(b)&&c(F((f=["authorcount",Q],h(g,"[]=",f),f[f.length-1]),0))&&(h(n,"each",[],function(a,d){var e;null==a&&(a=u);null==d&&(d=u);return c(g["$key?"](a))?u:(e=[a,b.$apply_header_subs(d)],h(g,"[]=",e),e[e.length-1])}),r=g["$[]"]("author"),q=g["$[]"]("authorinitials"),
|
|
1017
|
-
w=g["$[]"]("authors"));n["$[]="]("authorcount",Q);this.$process_attribute_entries(a,b);if(c(a["$has_more_lines?"]())&&e(a["$next_line_empty?"]()))if(v=a.$read_line(),c(x=p("RevisionInfoLineRx").$match(v))){B=m([],{});if(c(x["$[]"](1)))B["$[]="]("revnumber",x["$[]"](1).$rstrip());if(!c((v=x["$[]"](2).$strip())["$empty?"]()))if(e(x["$[]"](1))&&c(v["$start_with?"]("v")))B["$[]="]("revnumber",v.$slice(1,v.$length()));else B["$[]="]("revdate",v);if(c(x["$[]"](3)))B["$[]="]("revremark",x["$[]"](3).$rstrip());
|
|
1018
|
-
c(b)&&e(B["$empty?"]())&&h(B,"each",[],function(a,d){var e;null==a&&(a=u);null==d&&(d=u);return c(g["$key?"](a))?u:(e=[a,b.$apply_header_subs(d)],h(g,"[]=",e),e[e.length-1])})}else a.$unshift_line(v);this.$process_attribute_entries(a,b);a.$skip_blank_lines()}else n=m([],{});if(c(b)){if(c(g["$key?"]("author"))&&t(z=g["$[]"]("author"),r))A=this.$process_authors(z,!0,!1),t(g["$[]"]("authorinitials"),q)&&A.$delete("authorinitials");else if(c(g["$key?"]("authors"))&&t(z=g["$[]"]("authors"),w))A=this.$process_authors(z,
|
|
1019
|
-
!0);else{f=[[],1,"author_1",!1,!1];D=f[0];x=f[1];v=f[2];O=f[3];aa=f[4];for(f;c(g["$key?"](v));)l(E=g["$[]"](v),n["$[]"](v))?(D["$<<"](u),aa=!0):(D["$<<"](E),O=!0),v="author_"+(x=y(x,1));c(O)?(c(aa)&&h(D,"each_with_index",[],function(a,b){var d,e=u;null==a&&(a=u);null==b&&(b=u);return c(a)?u:(d=[b,h([n["$[]"]("firstname_"+(e=y(b,1))),n["$[]"]("middlename_"+e),n["$[]"]("lastname_"+e)].$compact(),"map",[],function(a){null==a&&(a=u);return a.$tr(" ","_")}).$join(" ")],h(D,"[]=",d),d[d.length-1])}),A=
|
|
1020
|
-
this.$process_authors(D,!0,!1)):A=m(["authorcount"],{authorcount:0})}if(l(A["$[]"]("authorcount"),0))if(c(Q))A=u;else g["$[]="]("authorcount",0);else if(g.$update(A),e(g["$key?"]("email"))&&c(g["$key?"]("email_1")))g["$[]="]("email",g["$[]"]("email_1"))}return c(d)?n.$merge(B.$to_h(),A.$to_h()):u},-2);g(b,"$process_authors",function(a,b,d){var f=u,g=u;null==b&&(b=!1);null==d&&(d=!0);f=m([],{});g=0;h(c(d)&&c(a["$include?"](";"))?a.$split(p("AuthorDelimiterRx")):[].concat(x(a)),"each",[],function(a){var d,
|
|
1021
|
-
k=u,n=u,r=u,q=u,w=u,t=u,v=u;w=u;null==a&&(a=u);if(c(a["$empty?"]()))return u;k=m([],{});l(g=y(g,1),1)?h(p("AuthorKeys"),"each",[],function(a){var b;null==a&&(a=u);return b=[a.$to_sym(),a],h(k,"[]=",b),b[b.length-1]}):h(p("AuthorKeys"),"each",[],function(a){var b;null==a&&(a=u);return b=[a.$to_sym(),""+a+"_"+g],h(k,"[]=",b),b[b.length-1]});if(c(b)){if(c(a["$include?"]("<"))&&(f["$[]="](k["$[]"]("author"),a.$tr("_"," ")),a=a.$gsub(p("XmlSanitizeRx"),"")),l((n=a.$split(u,3)).$size(),3))n["$<<"](n.$pop().$squeeze(" "))}else c(r=
|
|
1022
|
-
p("AuthorInfoLineRx").$match(a))&&(n=r.$to_a()).$shift();if(c(n)){q=(d=[k["$[]"]("firstname"),w=n["$[]"](0).$tr("_"," ")],h(f,"[]=",d),d[d.length-1]);f["$[]="](k["$[]"]("authorinitials"),w.$chr());c(n["$[]"](1))&&(c(n["$[]"](2))?(f["$[]="](k["$[]"]("middlename"),t=n["$[]"](1).$tr("_"," ")),f["$[]="](k["$[]"]("lastname"),v=n["$[]"](2).$tr("_"," ")),q=y(y(y(y(w," "),t)," "),v),f["$[]="](k["$[]"]("authorinitials"),""+w.$chr()+t.$chr()+v.$chr())):(f["$[]="](k["$[]"]("lastname"),v=n["$[]"](1).$tr("_",
|
|
1023
|
-
" ")),q=y(y(w," "),v),f["$[]="](k["$[]"]("authorinitials"),""+w.$chr()+v.$chr())));if(c(w=f["$[]"](k["$[]"]("author"))))w;else f["$[]="](k["$[]"]("author"),q);if(!c(b)&&!e(n["$[]"](3)))f["$[]="](k["$[]"]("email"),n["$[]"](3))}else f["$[]="](k["$[]"]("author"),(d=[k["$[]"]("firstname"),w=a.$squeeze(" ").$strip()],h(f,"[]=",d),d[d.length-1])),f["$[]="](k["$[]"]("authorinitials"),w.$chr());if(l(g,1))return d=["authors",f["$[]"](k["$[]"]("author"))],h(f,"[]=",d),d[d.length-1];l(g,2)&&h(p("AuthorKeys"),
|
|
1024
|
-
"each",[],function(a){var b;null==a&&(a=u);return c(f["$key?"](a))?(b=[""+a+"_1",f["$[]"](a)],h(f,"[]=",b),b[b.length-1]):u});return d=["authors",""+f["$[]"]("authors")+", "+f["$[]"](k["$[]"]("author"))],h(f,"[]=",d),d[d.length-1]});f["$[]="]("authorcount",g);return f},-2);g(b,"$parse_block_metadata_lines",function(a,b,d,e){var f;null==d&&(d=m([],{}));for(null==e&&(e=m([],{}));c(this.$parse_block_metadata_line(a,b,d,e));)if(a.$shift(),c(f=a.$skip_blank_lines()))f;else break;return d},-3);g(b,"$parse_block_metadata_line",
|
|
1025
|
-
function(a,b,d,f){var h,g=u,k=u,n=u,r=u;null==q["~"]&&(q["~"]=u);null==f&&(f=m([],{}));if(c(k=a.$peek_line())&&c(c(f["$[]"]("text_only"))?k["$start_with?"]("[","/"):g=k["$start_with?"]("[",".","/",":")))if(c(k["$start_with?"]("[")))if(c(k["$start_with?"]("[["))){if(c(k["$end_with?"]("]]"))&&c(p("BlockAnchorRx")["$=~"](k))){d["$[]="]("id",(h=q["~"])===u?u:h["$[]"](1));if(c(a=(h=q["~"])===u?u:h["$[]"](2)))d["$[]="]("reftext",c(a["$include?"](p("ATTR_REF_HEAD")))?b.$sub_attributes(a):a);return!0}}else{if(c(k["$end_with?"]("]"))&&
|
|
1026
|
-
c(p("BlockAttributeListRx")["$=~"](k))){f=d["$[]"](1);if(c(b.$parse_attributes((h=q["~"])===u?u:h["$[]"](1),[],m(["sub_input","sub_result","into"],{sub_input:!0,sub_result:!0,into:d}))["$[]"](1)))d["$[]="](1,c(n=this.$parse_style_attribute(d,a))?n:f);return!0}}else if(c(g)&&c(k["$start_with?"]("."))){if(c(p("BlockTitleRx")["$=~"](k)))return d["$[]="]("title",(h=q["~"])===u?u:h["$[]"](1)),!0}else if(e(g)||c(k["$start_with?"]("/"))){if(c(k["$start_with?"]("//"))){if(l(k,"//"))return!0;if(c(g)&&c(this["$uniform?"](k,
|
|
1027
|
-
"/",r=k.$length()))){if(!l(r,3))return a.$read_lines_until(m(["terminator","skip_first_line","preserve_last_line","skip_processing","context"],{terminator:k,skip_first_line:!0,preserve_last_line:!0,skip_processing:!0,context:"comment"})),!0}else if(!c(k["$start_with?"]("///")))return!0}}else if(c(g)&&c(k["$start_with?"](":"))&&c(p("AttributeEntryRx")["$=~"](k)))return this.$process_attribute_entry(a,b,d,q["~"]),!0;return u},-4);g(b,"$process_attribute_entries",function(a,b,d){null==d&&(d=u);for(a.$skip_comment_lines();c(this.$process_attribute_entry(a,
|
|
1028
|
-
b,d));)a.$shift(),a.$skip_comment_lines()},-3);g(b,"$process_attribute_entry",function(a,b,d,e){var f,h=u,g=u,l=u;null==d&&(d=u);null==e&&(e=u);if(c(e)||c(e=c(a["$has_more_lines?"]())?p("AttributeEntryRx").$match(a.$peek_line()):u)){if(c((f=e["$[]"](2))["$nil_or_empty?"]()))f="";else if(c(f["$end_with?"](p("LINE_CONTINUATION"),p("LINE_CONTINUATION_LEGACY")))){var k=[f.$slice(D(f.$length(),2),2),f.$slice(0,D(f.$length(),2)).$rstrip()];var m=k[0];f=k[1];for(k;c(c(h=a.$advance())?(g=c(l=a.$peek_line())?
|
|
1029
|
-
l:"")["$empty?"]()["$!"]():h)&&(g=g.$lstrip(),c(k=g["$end_with?"](m))&&(g=g.$slice(0,D(g.$length(),2)).$rstrip()),f=""+f+(c(f["$end_with?"](p("HARD_LINE_BREAK")))?p("LF"):" ")+g,c(k)););}this.$store_attribute(e["$[]"](1),f,b,d);return!0}return u},-3);g(b,"$store_attribute",function(a,b,d,e){null==d&&(d=u);null==e&&(e=u);c(a["$end_with?"]("!"))?(a=a.$chop(),b=u):c(a["$start_with?"]("!"))&&(a=a.$slice(1,a.$length()),b=u);l(a=this.$sanitize_attribute_name(a),"numbered")?a="sectnums":l(a,"hardbreaks")?
|
|
1030
|
-
a="hardbreaks-option":l(a,"showtitle")&&this.$store_attribute("notitle",c(b)?u:"",d,e);c(d)?c(b)?(l(a,"leveloffset")&&(c(b["$start_with?"]("+"))?b=y(d.$attr("leveloffset",0).$to_i(),b.$slice(1,b.$length()).$to_i()).$to_s():c(b["$start_with?"]("-"))&&(b=D(d.$attr("leveloffset",0).$to_i(),b.$slice(1,b.$length()).$to_i()).$to_s())),c(d=d.$set_attribute(a,b))&&(b=d,c(e)&&G(p("Document"),"AttributeEntry").$new(a,b).$save_to(e))):c(d.$delete_attribute(a))&&c(e)&&G(p("Document"),"AttributeEntry").$new(a,
|
|
1031
|
-
b).$save_to(e):c(e)&&G(p("Document"),"AttributeEntry").$new(a,b).$save_to(e);return[a,b]},-3);g(b,"$resolve_list_marker",function(a,b,c,d,e){null==c&&(c=0);null==d&&(d=!1);null==e&&(e=u);switch(a){case "ulist":return b;case "olist":return this.$resolve_ordered_list_marker(b,c,d,e)["$[]"](0);default:return"<1>"}},-3);g(b,"$resolve_ordered_list_marker",function(a,b,d,e){var f=u,g=u,l=u;null==b&&(b=0);null==d&&(d=!1);null==e&&(e=u);if(c(a["$start_with?"](".")))return[a];switch(f=h(p("ORDERED_LIST_STYLES"),
|
|
1032
|
-
"find",[],function(b){null==b&&(b=u);return p("OrderedListMarkerRxMap")["$[]"](b)["$match?"](a)})){case "arabic":c(d)&&(g=y(b,1),l=a.$to_i());a="1.";break;case "loweralpha":c(d)&&(g=y("a"["$[]"](0).$ord(),b).$chr(),l=a.$chop());a="a.";break;case "upperalpha":c(d)&&(g=y("A"["$[]"](0).$ord(),b).$chr(),l=a.$chop());a="A.";break;case "lowerroman":c(d)&&(g=p("Helpers").$int_to_roman(y(b,1)).$downcase(),l=a.$chop());a="i)";break;case "upperroman":c(d)&&(g=p("Helpers").$int_to_roman(y(b,1)),l=a.$chop());
|
|
1033
|
-
a="I)";break;default:u}c(d)&&t(g,l)&&this.$logger().$warn(this.$message_with_context("list item index: expected "+g+", got "+l,m(["source_location"],{source_location:e.$cursor()})));return[a,f]},-2);g(b,"$is_sibling_list_item?",function(a,b,d){var e,f;return z(G("Regexp"),d)?d["$match?"](a):c(f=p("ListRxMap")["$[]"](b)["$=~"](a))?d["$=="](this.$resolve_list_marker(b,(e=q["~"])===u?u:e["$[]"](1))):f});g(b,"$parse_table",function(a,b,d){var f,g,k=f=u,m=u,r=u,q,w=u,t=u;b=p("Table").$new(b,d);c(d["$key?"]("cols"))&&
|
|
1034
|
-
e((f=this.$parse_colspecs(d["$[]"]("cols")))["$empty?"]())&&(b.$create_columns(f),k=!0);f=c(m=a.$skip_blank_lines())?m:0;if(c(d["$[]"]("header-option")))b["$has_header_option="](!0);else l(f,0)&&e(d["$[]"]("noheader-option"))&&(b["$has_header_option="]("implicit"),r=!0);var v=G(p("Table"),"ParserContext").$new(a,b,d);f=[v.$format(),-1,u];var x=f[0];var B=f[1];var A=f[2];for(f;c(q=a.$read_line());){if(c(g=F(B=y(B,1),0))&&c(q["$empty?"]()))q=u,c(A)&&(A=y(A,1));else if(l(x,"psv"))if(c(v["$starts_with_delimiter?"](q)))q=
|
|
1035
|
-
q.$slice(1,q.$length()),v.$close_open_cell(),c(A)&&(A=u);else{var D=this.$parse_cellspec(q,"start",v.$delimiter());f=n(D);var O=null==f[0]?u:f[0];q=null==f[1]?u:f[1];D;if(c(O))v.$close_open_cell(O),c(A)&&(A=u);else if(c(A)&&l(A,B))b["$has_header_option="](r=A=u)}if(!c(g)&&(a.$mark(),c(r)))if(c(a["$has_more_lines?"]())&&c(a.$peek_line()["$empty?"]()))A=1;else b["$has_header_option="](r=u);for(f=!1;f||c(!0);)if(f=!1,c(q)&&c(w=v.$match_delimiter(q))){D=[w.$pre_match(),w.$post_match()];O=D[0];q=D[1];
|
|
1036
|
-
D;if(z("csv",m=x)){if(c(v["$buffer_has_unclosed_quotes?"](O))){v.$skip_past_delimiter(O);if(c(q["$empty?"]()))break;f=!0;continue}v["$buffer="](""+v.$buffer()+O)}else if(z("dsv",m)){if(c(O["$end_with?"]("\\"))){v.$skip_past_escaped_delimiter(O);if(c(q["$empty?"]())){v["$buffer="](""+v.$buffer()+p("LF"));v.$keep_cell_open();break}f=!0;continue}v["$buffer="](""+v.$buffer()+O)}else{if(c(O["$end_with?"]("\\"))){v.$skip_past_escaped_delimiter(O);if(c(q["$empty?"]())){v["$buffer="](""+v.$buffer()+p("LF"));
|
|
1037
|
-
v.$keep_cell_open();break}f=!0;continue}g=this.$parse_cellspec(O);D=n(g);O=null==D[0]?u:D[0];D=null==D[1]?u:D[1];g;v.$push_cellspec(O);v["$buffer="](""+v.$buffer()+D)}c(q["$empty?"]())&&(q=u);v.$close_cell()}else{v["$buffer="](""+v.$buffer()+q+p("LF"));switch(x){case "csv":if(c(v["$buffer_has_unclosed_quotes?"]())){if(c(A)&&l(B,0))b["$has_header_option="](r=A=u);v.$keep_cell_open()}else v.$close_cell(!0);break;case "dsv":v.$close_cell(!0);break;default:v.$keep_cell_open()}break}if(c(v["$cell_open?"]()))c(a["$has_more_lines?"]())||
|
|
1038
|
-
v.$close_cell(!0);else if(c(m=a.$skip_blank_lines()))m;else break}l((t=b.$attributes(),c(m=t["$[]"]("colcount"))?m:(f=["colcount",b.$columns().$size()],h(t,"[]=",f),f[f.length-1])),0)||c(k)||b.$assign_column_widths();if(c(r))b["$has_header_option="](!0);b.$partition_header_footer(d);return b});g(b,"$parse_colspecs",function(a){var b=u;c(a["$include?"](" "))&&(a=a.$delete(" "));if(l(a,a.$to_i().$to_s()))return h(G("Array"),"new",[a.$to_i()],function(){return m(["width"],{width:1})});b=[];h(c(a["$include?"](","))?
|
|
1039
|
-
a.$split(",",-1):a.$split(";",-1),"each",[],function(a){var d,f=u,g=u,k=u;k=d=u;null==a&&(a=u);if(c(a["$empty?"]()))return b["$<<"](m(["width"],{width:1}));if(c(f=p("ColumnSpecRx").$match(a))){g=m([],{});if(c(f["$[]"](2))){a=f["$[]"](2).$split(".");d=n(a);k=null==d[0]?u:d[0];d=null==d[1]?u:d[1];a;if(e(k["$nil_or_empty?"]())&&c(p("TableCellHorzAlignments")["$key?"](k)))g["$[]="]("halign",p("TableCellHorzAlignments")["$[]"](k));if(e(d["$nil_or_empty?"]())&&c(p("TableCellVertAlignments")["$key?"](d)))g["$[]="]("valign",
|
|
1040
|
-
p("TableCellVertAlignments")["$[]"](d))}if(c(k=f["$[]"](3)))g["$[]="]("width",l(k,"~")?-1:k.$to_i());else g["$[]="]("width",1);if(c(f["$[]"](4))&&c(p("TableCellStyles")["$key?"](f["$[]"](4))))g["$[]="]("style",p("TableCellStyles")["$[]"](f["$[]"](4)));return c(f["$[]"](1))?h(1,"upto",[f["$[]"](1).$to_i()],function(){return b["$<<"](g.$merge())}):b["$<<"](g)}return u});return b});g(b,"$parse_cellspec",function(a,b,d){null==b&&(b="end");null==d&&(d=u);var f=[u,""];f;if(l(b,"start"))if(c(a["$include?"](d))){b=
|
|
1041
|
-
a.$partition(d);f=n(b);var h=null==f[0]?u:f[0];d=null==f[2]?u:f[2];b;if(c(h=p("CellSpecStartRx").$match(h))){if(c(h["$[]"](0)["$empty?"]()))return[m([],{}),d]}else return[u,a]}else return[u,a];else if(c(h=p("CellSpecEndRx").$match(a))){if(c(h["$[]"](0).$lstrip()["$empty?"]()))return[m([],{}),a.$rstrip()];d=h.$pre_match()}else return[m([],{}),a];a=m([],{});if(c(h["$[]"](1))){b=h["$[]"](1).$split(".");f=n(b);var g=null==f[0]?u:f[0];f=null==f[1]?u:f[1];b;g=c(g["$nil_or_empty?"]())?1:g.$to_i();f=c(f["$nil_or_empty?"]())?
|
|
1042
|
-
1:f.$to_i();switch(h["$[]"](2)){case "+":if(!l(g,1))a["$[]="]("colspan",g);if(!l(f,1))a["$[]="]("rowspan",f);break;case "*":if(!l(g,1))a["$[]="]("repeatcol",g);break;default:u}}if(c(h["$[]"](3))){b=h["$[]"](3).$split(".");f=n(b);g=null==f[0]?u:f[0];f=null==f[1]?u:f[1];b;if(e(g["$nil_or_empty?"]())&&c(p("TableCellHorzAlignments")["$key?"](g)))a["$[]="]("halign",p("TableCellHorzAlignments")["$[]"](g));if(e(f["$nil_or_empty?"]())&&c(p("TableCellVertAlignments")["$key?"](f)))a["$[]="]("valign",p("TableCellVertAlignments")["$[]"](f))}if(c(h["$[]"](4))&&
|
|
1043
|
-
c(p("TableCellStyles")["$key?"](h["$[]"](4))))a["$[]="]("style",p("TableCellStyles")["$[]"](h["$[]"](4)));return[a,d]},-2);g(b,"$parse_style_attribute",function(a,b){var d,f=u,g=u,l=u,k=u,n=u,r=u;null==b&&(b=u);if(c(f=a["$[]"](1))&&e(f["$include?"](" "))&&c(p("Compliance").$shorthand_property_syntax())&&(g=u,l="",k=m([],{}),h(f,"each_char",[],function ma(a){var c=null==ma.$$s?this:ma.$$s;null==a&&(a=u);switch(a){case ".":return c.$yield_buffered_attribute(k,g,l,b),l="",g="role";case "#":return c.$yield_buffered_attribute(k,
|
|
1044
|
-
g,l,b),l="",g="id";case "%":return c.$yield_buffered_attribute(k,g,l,b),l="",g="option";default:return l=y(l,a)}},{$$s:this}),c(g))){this.$yield_buffered_attribute(k,g,l,b);if(c(n=k["$[]"]("style")))a["$[]="]("style",n);if(c(k["$key?"]("id")))a["$[]="]("id",k["$[]"]("id"));if(c(k["$key?"]("role")))a["$[]="]("role",c((r=a["$[]"]("role"))["$nil_or_empty?"]())?k["$[]"]("role").$join(" "):""+r+" "+k["$[]"]("role").$join(" "));c(k["$key?"]("option"))&&h(k["$[]"]("option"),"each",[],function(b){var c;null==
|
|
1045
|
-
b&&(b=u);return c=[""+b+"-option",""],h(a,"[]=",c),c[c.length-1]});return n}return d=["style",f],h(a,"[]=",d),d[d.length-1]},-2);g(b,"$yield_buffered_attribute",function(a,b,d,e){var f,g=u;if(c(b))if(c(d["$empty?"]()))c(e)?this.$logger().$warn(this.$message_with_context("invalid empty "+b+" detected in style attribute",m(["source_location"],{source_location:e.$cursor_at_prev_line()}))):this.$logger().$warn("invalid empty "+b+" detected in style attribute");else if(l(b,"id"))c(a["$key?"]("id"))&&(c(e)?
|
|
1046
|
-
this.$logger().$warn(this.$message_with_context("multiple ids detected in style attribute",m(["source_location"],{source_location:e.$cursor_at_prev_line()}))):this.$logger().$warn("multiple ids detected in style attribute")),a["$[]="](b,d);else(c(g=a["$[]"](b))?g:(f=[b,[]],h(a,"[]=",f),f[f.length-1]))["$<<"](d);else if(!c(d["$empty?"]()))a["$[]="]("style",d);return u});g(b,"$adjust_indentation!",function(a,b,d){var e=u,f=u,g=u;null==b&&(b=0);null==d&&(d=0);if(c(a["$empty?"]()))return u;c(F(d,0))&&
|
|
1047
|
-
c(h(a,"any?",[],function(a){null==a&&(a=u);return a["$include?"](p("TAB"))}))&&(e=B(" ",d),h(a,"map!",[],function(a){var b=u,f=u,g=u,k=u,m=u;null==a&&(a=u);if(c(a["$empty?"]())||c((b=a.$index(p("TAB")))["$nil?"]())||l(b,0)&&(f=0,function(){try{var b=A("break");return h(a,"each_byte",[],function(a){null==a&&(a=u);l(a,9)||b.$throw();return f=y(f,1)})}catch(ia){if(ia===b)return ia.$v;throw ia;}}(),a=""+B(e,f)+a.$slice(f,a.$length()),!c(a["$include?"](p("TAB")))))return a;k=g=0;m="";h(a,"each_char",[],
|
|
1048
|
-
function(a){var b;null==a&&(a=u);l(a,p("TAB"))?l((a=y(k,g))["$%"](d),0)?(g=y(g,D(d,1)),m=y(m,e)):(l(b=D(d,a["$%"](d)),1)||(g=y(g,D(b,1))),m=y(m,B(" ",b))):m=y(m,a);return k=y(k,1)});return m}));if(c(v(b,0)))return u;f=u;(function(){try{var b=A("break");return h(a,"each",[],function(a){null==a&&(a=u);if(c(a["$empty?"]()))return u;l(a=D(a.$length(),a.$lstrip().$length()),0)&&(f=u,b.$throw());return c(f)&&c(v(f,a))?u:f=a})}catch(X){if(X===b)return X.$v;throw X;}})();l(b,0)?c(f)&&h(a,"map!",[],function(a){null==
|
|
1049
|
-
a&&(a=u);return c(a["$empty?"]())?a:a.$slice(f,a.$length())}):(g=B(" ",b),c(f)?h(a,"map!",[],function(a){null==a&&(a=u);return c(a["$empty?"]())?a:y(g,a.$slice(f,a.$length()))}):h(a,"map!",[],function(a){null==a&&(a=u);return c(a["$empty?"]())?a:y(g,a)}));return u},-2);g(b,"$uniform?",function(a,b,c){return a.$count(b)["$=="](c)});return g(b,"$sanitize_attribute_name",function(a){return a.$gsub(p("InvalidAttributeNameCharsRx"),"").$downcase()})}(k[0],null,k)}(E[0],E)};Opal.modules["asciidoctor/path_resolver"]=
|
|
1050
|
-
function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.truthy,c=a.hash2,m=a.def,n=a.eqeq,g=a.alias,l=a.rb_plus,e=a.to_ary,q=a.send,t=a.not,y=a.neqeq,v=a.rb_gt,x=a.gvars,B=[],z=a.nil,A=a.$$$;a.add_stubs("include,attr_accessor,root?,posixify,expand_path,pwd,start_with?,==,match?,absolute_path?,+,length,descends_from?,slice,to_s,relative_path_from,new,include?,tr,partition_path,each,pop,<<,join_path,[],web_root?,unc?,index,split,delete,[]=,join,raise,!,fetch,warn,logger,empty?,nil_or_empty?,chomp,!=,>,size,extract_uri_prefix,end_with?,gsub,private,=~");
|
|
1051
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);return function(b,$super,k){b=d(b,$super,"PathResolver");k=[b].concat(k);var p=a.$r(k),F=b.$$prototype;F.file_separator=F._partition_path_web=F._partition_path_sys=F.working_dir=z;b.$include(p("Logging"));f(k[0],"DOT",".");f(k[0],"DOT_DOT","..");f(k[0],"DOT_SLASH","./");f(k[0],"SLASH","/");f(k[0],"BACKSLASH","\\");f(k[0],"DOUBLE_SLASH","//");f(k[0],"URI_CLASSLOADER","uri:classloader:");f(k[0],"WindowsRootRx",/^(?:[a-zA-Z]:)?[\\\/]/);b.$attr_accessor("file_separator");
|
|
1052
|
-
b.$attr_accessor("working_dir");m(b,"$initialize",function(a,b){var d=z,e=z;null==a&&(a=z);null==b&&(b=z);this.file_separator=h(d=h(e=a)?e:A(A("File"),"ALT_SEPARATOR"))?d:A(A("File"),"SEPARATOR");this.working_dir=h(b)?h(this["$root?"](b))?this.$posixify(b):A("File").$expand_path(b):A("Dir").$pwd();this._partition_path_sys=c([],{});return this._partition_path_web=c([],{})},-1);m(b,"$absolute_path?",function(a){var b,c;return h(b=a["$start_with?"](p("SLASH")))?b:h(c=this.file_separator["$=="](p("BACKSLASH")))?
|
|
1053
|
-
p("WindowsRootRx")["$match?"](a):c});n(p("RUBY_ENGINE"),"opal")&&n(A("JAVASCRIPT_IO_MODULE"),"xmlhttprequest")?m(b,"$root?",function(a){var b;return h(b=this["$absolute_path?"](a))?b:a["$start_with?"]("file://","http://","https://")}):n(A("RUBY_ENGINE"),"jruby")?m(b,"$root?",function(a){var b;return h(b=this["$absolute_path?"](a))?b:a["$start_with?"](p("URI_CLASSLOADER"))}):g(b,"root?","absolute_path?");m(b,"$unc?",function(a){return a["$start_with?"](p("DOUBLE_SLASH"))});m(b,"$web_root?",function(a){return a["$start_with?"](p("SLASH"))});
|
|
1054
|
-
m(b,"$descends_from?",function(a,b){var c;return n(b,a)?0:n(b,p("SLASH"))?h(c=a["$start_with?"](p("SLASH")))?1:c:h(c=a["$start_with?"](l(b,p("SLASH"))))?l(b.$length(),1):c});m(b,"$relative_path",function(b,c){var d;if(h(this["$root?"](b))){if(h(d=this["$descends_from?"](b,c)))return b.$slice(d,b.$length());try{return p("Pathname").$new(b).$relative_path_from(p("Pathname").$new(c)).$to_s()}catch(na){if(a.rescue(na,[p("StandardError")]))try{return b}finally{a.pop_exception()}else throw na;}}else return b});
|
|
1055
|
-
m(b,"$posixify",function(a){return h(a)?n(this.file_separator,p("BACKSLASH"))&&h(a["$include?"](p("BACKSLASH")))?a.$tr(p("BACKSLASH"),p("SLASH")):a:""});g(b,"posixfy","posixify");m(b,"$expand_path",function(a){var b,c=z,d=b=z;var f=this.$partition_path(a);b=e(f);c=null==b[0]?z:b[0];b=null==b[1]?z:b[1];f;return h(a["$include?"](p("DOT_DOT")))?(d=[],q(c,"each",[],function(a){null==a&&(a=z);return n(a,p("DOT_DOT"))?d.$pop():d["$<<"](a)}),this.$join_path(d,b)):this.$join_path(c,b)});m(b,"$partition_path",
|
|
1056
|
-
function(a,b){var c,d,e,f=z;null==b&&(b=z);if(h(d=(e=h(b)?this._partition_path_web:this._partition_path_sys)["$[]"](a)))return d;d=this.$posixify(a);h(b)?h(this["$web_root?"](d))?f=p("SLASH"):h(d["$start_with?"](p("DOT_SLASH")))&&(f=p("DOT_SLASH")):h(this["$root?"](d))?f=h(this["$unc?"](d))?p("DOUBLE_SLASH"):h(d["$start_with?"](p("SLASH")))?p("SLASH"):h(d["$start_with?"](p("URI_CLASSLOADER")))?d.$slice(0,p("URI_CLASSLOADER").$length()):d.$slice(0,l(d.$index(p("SLASH")),1)):h(d["$start_with?"](p("DOT_SLASH")))&&
|
|
1057
|
-
(f=p("DOT_SLASH"));b=(h(f)?d.$slice(f.$length(),d.$length()):d).$split(p("SLASH"));b.$delete(p("DOT"));return c=[a,[b,f]],q(e,"[]=",c),c[c.length-1]},-2);m(b,"$join_path",function(a,b){null==b&&(b=z);return h(b)?""+b+a.$join(p("SLASH")):a.$join(p("SLASH"))},-2);m(b,"$system_path",function(a,b,d,f){var g,k=g=z,m=z,r=z,w=z,x=z,C=z,F=z,Q=z,X=C=z;null==b&&(b=z);null==d&&(d=z);null==f&&(f=c([],{}));h(d)&&(h(this["$root?"](d))||this.$raise(A("SecurityError"),"Jail is not an absolute path: "+d),d=this.$posixify(d));
|
|
1058
|
-
if(h(a)){if(h(this["$root?"](a))){g=this.$expand_path(a);if(h(d)&&t(this["$descends_from?"](g,d))){if(h(f.$fetch("recover",!0))){this.$logger().$warn(""+(h(k=f["$[]"]("target_name"))?k:"path")+" is outside of jail; recovering automatically");var V=this.$partition_path(g);g=e(V);m=null==g[0]?z:g[0];V;V=this.$partition_path(d);g=e(V);r=null==g[0]?z:g[0];w=null==g[1]?z:g[1];V;return this.$join_path(l(r,m),w)}this.$raise(A("SecurityError"),""+(h(k=f["$[]"]("target_name"))?k:"path")+" "+a+" is outside of jail: "+
|
|
1059
|
-
d+" (disallowed in safe mode)")}return g}V=this.$partition_path(a);g=e(V);m=null==g[0]?z:g[0];V}else m=[];if(h(m["$empty?"]())){if(h(b["$nil_or_empty?"]()))return h(k=d)?k:this.working_dir;if(h(this["$root?"](b)))if(h(d))b=this.$posixify(b);else return this.$expand_path(b);else V=this.$partition_path(b),g=e(V),m=null==g[0]?z:g[0],V,b=h(k=d)?k:this.working_dir}else h(b["$nil_or_empty?"]())?b=h(k=d)?k:this.working_dir:h(this["$root?"](b))?h(d)&&(b=this.$posixify(b)):b=""+(h(k=d)?k:this.working_dir).$chomp("/")+
|
|
1060
|
-
"/"+b;h(d)&&h(x=this["$descends_from?"](b,d)["$!"]())&&n(this.file_separator,p("BACKSLASH"))?(V=this.$partition_path(b),g=e(V),C=null==g[0]?z:g[0],F=null==g[1]?z:g[1],V,V=this.$partition_path(d),g=e(V),r=null==g[0]?z:g[0],w=null==g[1]?z:g[1],V,y(F,w)&&(h(f.$fetch("recover",!0))?(this.$logger().$warn("start path for "+(h(k=f["$[]"]("target_name"))?k:"path")+" is outside of jail root; recovering automatically"),C=r,x=!1):this.$raise(A("SecurityError"),"start path for "+(h(k=f["$[]"]("target_name"))?
|
|
1061
|
-
k:"path")+" "+b+" refers to location outside jail root: "+d+" (disallowed in safe mode)"))):(V=this.$partition_path(b),g=e(V),C=null==g[0]?z:g[0],w=null==g[1]?z:g[1],V);h((Q=l(C,m))["$include?"](p("DOT_DOT")))&&(g=[Q,[]],C=g[0],Q=g[1],g,h(d)?(h(r)||(V=this.$partition_path(d),g=e(V),r=null==g[0]?z:g[0],V),X=!1,q(C,"each",[],function ma(b){var c=null==ma.$$s?this:ma.$$s;null==b&&(b=z);if(n(b,p("DOT_DOT"))){if(h(v(Q.$size(),r.$size())))return Q.$pop();if(h(f.$fetch("recover",!0))){if(h(X))return z;c.$logger().$warn(""+
|
|
1062
|
-
(h(k=f["$[]"]("target_name"))?k:"path")+" has illegal reference to ancestor of jail; recovering automatically");return X=!0}return c.$raise(A("SecurityError"),""+(h(k=f["$[]"]("target_name"))?k:"path")+" "+a+" refers to location outside jail: "+d+" (disallowed in safe mode)")}return Q["$<<"](b)},{$$s:this})):q(C,"each",[],function(a){null==a&&(a=z);return n(a,p("DOT_DOT"))?Q.$pop():Q["$<<"](a)}));return h(x)?(g=this.$join_path(Q,w),h(this["$descends_from?"](g,d))?g:h(f.$fetch("recover",!0))?(this.$logger().$warn(""+
|
|
1063
|
-
(h(k=f["$[]"]("target_name"))?k:"path")+" is outside of jail; recovering automatically"),h(r)||(V=this.$partition_path(d),g=e(V),r=null==g[0]?z:g[0],V),this.$join_path(l(r,m),w)):this.$raise(A("SecurityError"),""+(h(k=f["$[]"]("target_name"))?k:"path")+" "+a+" is outside of jail: "+d+" (disallowed in safe mode)")):this.$join_path(Q,w)},-2);m(b,"$web_path",function(a,b){var c=z,d=z,f=z,g=z,l=z;null==b&&(b=z);a=this.$posixify(a);b=this.$posixify(b);if(!h(b["$nil_or_empty?"]())&&!h(this["$web_root?"](a))){var k=
|
|
1064
|
-
this.$extract_uri_prefix(""+b+(h(b["$end_with?"](p("SLASH")))?"":p("SLASH"))+a);b=e(k);a=null==b[0]?z:b[0];c=null==b[1]?z:b[1];k}k=this.$partition_path(a,!0);b=e(k);d=null==b[0]?z:b[0];f=null==b[1]?z:b[1];k;g=[];q(d,"each",[],function(a){null==a&&(a=z);return n(a,p("DOT_DOT"))?h(g["$empty?"]())?h(f)&&y(f,p("DOT_SLASH"))?z:g["$<<"](a):n(g["$[]"](-1),p("DOT_DOT"))?g["$<<"](a):g.$pop():g["$<<"](a)});h((l=this.$join_path(g,f))["$include?"](" "))&&(l=l.$gsub(" ","%20"));return h(c)?""+c+l:l},-2);b.$private();
|
|
1065
|
-
return m(b,"$extract_uri_prefix",function(a){var b;return h(a["$include?"](":"))&&h(p("UriSniffRx")["$=~"](a))?[a.$slice(((b=x["~"])===z?z:b["$[]"](0)).$length(),a.$length()),(b=x["~"])===z?z:b["$[]"](0)]:a})}(k[0],null,k)}(B[0],B)};Opal.modules["asciidoctor/reader"]=function(a){var b=a.module,d=a.klass,f=a.def,h=a.rb_plus,c=a.alias,m=a.hash2,n=a.not,g=a.eqeqeq,l=a.to_ary,e=a.truthy,q=a.rb_gt,t=a.send,y=a.rb_minus,v=a.thrower,x=a.eqeq,z=a.rb_times,B=a.neqeq,A=a.to_a,D=a.assign_ivar_val,E=a.send2,
|
|
1066
|
-
G=a.find_super,u=a.rb_ge,I=a.gvars,r=a.rb_lt,J=a.hash,L=[],C=a.nil,w=a.$$$;a.add_stubs("include,attr_reader,+,line_info,attr_accessor,!,===,split,file,dir,dirname,path,basename,lineno,reverse,prepare_lines,empty?,nil_or_empty?,peek_line,[],>,slice,length,process_line,times,shift,read_line,<<,-,unshift_all,has_more_lines?,read_lines,join,unshift,unshift_line,unshift_lines,replace_next_line,start_with?,==,*,read_lines_until,size,clear,cursor,[]=,fetch,!=,cursor_at_mark,warn,logger,message_with_context,pop,push,respond_to?,reverse_each,new,tap,each,instance_variables,instance_variable_get,drop,instance_variable_set,class,object_id,inspect,private,prepare_source_array,prepare_source_string,chomp,valid_encoding?,to_s,raise,to_i,attributes,catalog,pop_include,parse,path=,dup,end_with?,keys,rindex,rootname,key?,attr,reverse!,>=,exceeds_max_depth?,nil?,include_processors?,extensions,extensions?,include_processors,map,skip_front_matter!,adjust_indentation!,include?,=~,preprocess_conditional_directive,preprocess_include_directive,downcase,error,none?,any?,all?,strip,send,resolve_expr_val,rstrip,sub_attributes,attribute_missing,info,parse_attributes,find,handles?,instance,process_method,safe,resolve_include_path,method,split_delimited_value,partition,<,to_a,uniq,sort,call,each_line,infinite?,push_include,delete,first,values,value?,create_include_cursor,delete_at,keep_if,read,uriish?,attr?,require_library,normalize_system_path,file?,relative_path,path_resolver,base_dir,to_f");
|
|
1067
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);p=a.$r(k);(function(b,$super,k){b=d(b,$super,"Reader");k=[b].concat(k);var p=a.$r(k),r=b.$$prototype;r.file=r.lines=r.look_ahead=r.unescape_next_line=r.lineno=r.process_lines=r.dir=r.path=r.mark=r.source_lines=r.saved=C;b.$include(p("Logging"));(function(a,$super){a=d(a,$super,"Cursor");var b=a.$$prototype;b.lineno=b.path=C;a.$attr_reader("file","dir","path","lineno");f(a,"$initialize",function(a,b,c,d){var e;null==b&&(b=C);null==c&&(c=C);null==
|
|
1068
|
-
d&&(d=1);return e=[a,b,c,d],this.file=e[0],this.dir=e[1],this.path=e[2],this.lineno=e[3],e},-2);f(a,"$advance",function(a){return this.lineno=h(this.lineno,a)});f(a,"$line_info",function(){return""+this.path+": line "+this.lineno});return c(a,"to_s","line_info")})(k[0],null);b.$attr_reader("file");b.$attr_reader("dir");b.$attr_reader("path");b.$attr_reader("lineno");b.$attr_reader("source_lines");b.$attr_accessor("process_lines");b.$attr_accessor("unterminated");f(b,"$initialize",function(a,b,c){var d=
|
|
1069
|
-
C;null==a&&(a=C);null==b&&(b=C);null==c&&(c=m([],{}));n(b)?(this.file=C,this.dir=".",this.path="<stdin>",this.lineno=1):g(w("String"),b)?(this.file=b,d=w("File").$split(this.file),b=l(d),this.dir=null==b[0]?C:b[0],this.path=null==b[1]?C:b[1],d,this.lineno=1):(e(this.file=b.$file())?(this.dir=e(d=b.$dir())?d:w("File").$dirname(this.file),this.path=e(d=b.$path())?d:w("File").$basename(this.file)):(this.dir=e(d=b.$dir())?d:".",this.path=e(d=b.$path())?d:"<stdin>"),this.lineno=e(d=b.$lineno())?d:1);this.lines=
|
|
1070
|
-
(this.source_lines=this.$prepare_lines(a,c)).$reverse();this.mark=C;this.look_ahead=0;this.process_lines=!0;this.unescape_next_line=!1;return this.saved=this.unterminated=C},-1);f(b,"$has_more_lines?",function(){return e(this.lines["$empty?"]())?(this.look_ahead=0,!1):!0});f(b,"$empty?",function(){return e(this.lines["$empty?"]())?(this.look_ahead=0,!0):!1});c(b,"eof?","empty?");f(b,"$next_line_empty?",function(){return this.$peek_line()["$nil_or_empty?"]()});f(b,"$peek_line",function(a){for(null==
|
|
1071
|
-
a&&(a=!1);e(!0);){var b=this.lines["$[]"](-1);if(e(a)||e(q(this.look_ahead,0)))return e(this.unescape_next_line)?b.$slice(1,b.$length()):b;if(e(b)){if(e(b=this.$process_line(b)))return b}else return this.look_ahead=0,C}},-1);f(b,"$peek_lines",function(a,b){var c=this,d=C,f=C,g=C;null==a&&(a=C);null==b&&(b=!1);d=c.look_ahead;f=[];(function(){try{var d=v("break");return t(e(g=a)?g:p("MAX_INT"),"times",[],function oa(){var a=null==oa.$$s?this:oa.$$s,c;null==a.lineno&&(a.lineno=C);if(e(c=e(b)?a.$shift():
|
|
1072
|
-
a.$read_line()))return f["$<<"](c);e(b)&&(a.lineno=y(a.lineno,1));d.$throw()},{$$s:c})}catch(ma){if(ma===d)return ma.$v;throw ma;}})();e(f["$empty?"]())||(c.$unshift_all(f),e(b)&&(c.look_ahead=d));return f},-1);f(b,"$read_line",function(){return e(q(this.look_ahead,0))||e(this["$has_more_lines?"]())?this.$shift():C});f(b,"$read_lines",function(){var a;for(a=[];e(this["$has_more_lines?"]());)a["$<<"](this.$shift());return a});c(b,"readlines","read_lines");f(b,"$read",function(){return this.$read_lines().$join(p("LF"))});
|
|
1073
|
-
f(b,"$advance",function(){return e(this.$shift())?!0:!1});f(b,"$unshift_line",function(a){this.$unshift(a);return C});c(b,"restore_line","unshift_line");f(b,"$unshift_lines",function(a){return this.$unshift_all(a)});c(b,"restore_lines","unshift_lines");f(b,"$replace_next_line",function(a){this.$shift();this.$unshift(a);return!0});c(b,"replace_line","replace_next_line");f(b,"$skip_blank_lines",function(){var a,b;if(e(this["$empty?"]()))return C;for(a=0;e(b=this.$peek_line());)if(e(b["$empty?"]()))this.$shift(),
|
|
1074
|
-
a=h(a,1);else return a});f(b,"$skip_comment_lines",function(){var a=C,b=C,c=C;if(e(this["$empty?"]()))return C;for(;e(e(a=b=this.$peek_line())?b["$empty?"]()["$!"]():a);)if(e(b["$start_with?"]("//")))if(e(b["$start_with?"]("///")))if(e(q(c=b.$length(),3))&&x(b,z("/",c)))this.$read_lines_until(m(["terminator","skip_first_line","read_last_line","skip_processing","context"],{terminator:b,skip_first_line:!0,read_last_line:!0,skip_processing:!0,context:"comment"}));else break;else this.$shift();else break;
|
|
1075
|
-
return C});f(b,"$skip_line_comments",function(){var a,b=C,c=C;if(e(this["$empty?"]()))return[];for(a=[];e(e(b=c=this.$peek_line())?c["$empty?"]()["$!"]():b);)if(e(c["$start_with?"]("//")))a["$<<"](this.$shift());else break;return a});f(b,"$terminate",function(){this.lineno=h(this.lineno,this.lines.$size());this.lines.$clear();this.look_ahead=0;return C});f(b,"$read_lines_until",function Q(b){var c,d=Q.$$p||C,f=C,g,h=C,k=C,l,q,r,u=C,w=C,v=C,z=C,F=C;Q.$$p=null;null==b&&(b=m([],{}));var A=[];e(this.process_lines)&&
|
|
1076
|
-
e(b["$[]"]("skip_processing"))&&(this.process_lines=!1,f=!0);if(e(g=b["$[]"]("terminator"))){h=e(k=b["$[]"]("cursor"))?k:this.$cursor();var D=l=!1}else l=b["$[]"]("break_on_blank_lines"),D=b["$[]"]("break_on_list_continuation");var da=b["$[]"]("skip_line_comments");var O=q=C;for(e(b["$[]"]("skip_first_line"))&&this.$shift();e(r=this.$read_line());){if(e(e(g)?r["$=="](g):e(k=e(u=e(w=l)?r["$empty?"]():w)?u:e(w=e(v=e(z=D)?O:z)?r["$=="](p("LIST_CONTINUATION")):v)?(c=["preserve_last_line",!0],t(b,"[]=",
|
|
1077
|
-
c),c[c.length-1]):w)?k:e(u=d!==C)?a.yield1(d,r):u)){if(e(b["$[]"]("read_last_line")))A["$<<"](r);e(b["$[]"]("preserve_last_line"))&&(this.$unshift(r),q=!0);break}e(da)&&e(r["$start_with?"]("//"))&&n(r["$start_with?"]("///"))||(A["$<<"](r),O=!0)}e(f)&&(this.process_lines=!0,e(q)&&n(g)&&(this.look_ahead=y(this.look_ahead,1)));e(g)&&B(g,r)&&e(F=b.$fetch("context",g))&&(x(h,"at_mark")&&(h=this.$cursor_at_mark()),this.$logger().$warn(this.$message_with_context("unterminated "+F+" block",m(["source_location"],
|
|
1078
|
-
{source_location:h}))),this.unterminated=!0);return A},-1);f(b,"$shift",function(){this.lineno=h(this.lineno,1);x(this.look_ahead,0)||(this.look_ahead=y(this.look_ahead,1));return this.lines.$pop()});f(b,"$unshift",function(a){this.lineno=y(this.lineno,1);this.look_ahead=h(this.look_ahead,1);this.lines.$push(a);return C});x(w("RUBY_ENGINE"),"jruby")?f(b,"$unshift_all",function(a){this.lineno=y(this.lineno,a.$size());this.look_ahead=h(this.look_ahead,a.$size());e(a["$respond_to?"]("reverse"))?t(this.lines,
|
|
1079
|
-
"push",A(a.$reverse())):t(a,"reverse_each",[],function V(a){var b=null==V.$$s?this:V.$$s;null==b.lines&&(b.lines=C);null==a&&(a=C);return b.lines.$push(a)},{$$s:this});return C}):f(b,"$unshift_all",function(a){this.lineno=y(this.lineno,a.$size());this.look_ahead=h(this.look_ahead,a.$size());t(this.lines,"push",A(a.$reverse()));return C});f(b,"$cursor",function(){return p("Cursor").$new(this.file,this.dir,this.path,this.lineno)});f(b,"$cursor_at_line",function(a){return p("Cursor").$new(this.file,
|
|
1080
|
-
this.dir,this.path,a)});f(b,"$cursor_at_mark",function(){return e(this.mark)?t(p("Cursor"),"new",A(this.mark)):this.$cursor()});f(b,"$cursor_before_mark",function(){if(e(this.mark)){var a=this.mark;var b=l(a);var c=null==b[0]?C:b[0];var d=null==b[1]?C:b[1];var f=null==b[2]?C:b[2];b=null==b[3]?C:b[3];a;return p("Cursor").$new(c,d,f,y(b,1))}return p("Cursor").$new(this.file,this.dir,this.path,y(this.lineno,1))});f(b,"$cursor_at_prev_line",function(){return p("Cursor").$new(this.file,this.dir,this.path,
|
|
1081
|
-
y(this.lineno,1))});f(b,"$mark",function(){return this.mark=[this.file,this.dir,this.path,this.lineno]});f(b,"$line_info",function(){return""+this.path+": line "+this.lineno});f(b,"$lines",function(){return this.lines.$reverse()});f(b,"$string",function(){return this.lines.$reverse().$join(p("LF"))});f(b,"$source",function(){return this.source_lines.$join(p("LF"))});f(b,"$save",function(){this.saved=t(m([],{}),"tap",[],function X(a){var b=null==X.$$s?this:X.$$s;null==a&&(a=C);return t(b.$instance_variables(),
|
|
1082
|
-
"each",[],function ma(b){var c,d=null==ma.$$s?this:ma.$$s,e=C;null==b&&(b=C);return x(b,"@saved")||x(b,"@source_lines")?C:(c=[b,g(w("Array"),e=d.$instance_variable_get(b))?e.$drop(0):e],t(a,"[]=",c),c[c.length-1])},{$$s:b})},{$$s:this});return C});f(b,"$restore_save",function(){return e(this.saved)?(t(this.saved,"each",[],function V(a,b){var c=null==V.$$s?this:V.$$s;null==a&&(a=C);null==b&&(b=C);return c.$instance_variable_set(a,b)},{$$s:this}),this.saved=C):C});f(b,"$discard_save",D("saved",C));
|
|
1083
|
-
f(b,"$to_s",function(){return"#<"+this.$class()+"@"+this.$object_id()+" {path: "+this.path.$inspect()+", line: "+this.lineno+"}>"});b.$private();f(b,"$prepare_lines",function(b,c){var d=C;null==c&&(c=m([],{}));try{return e(d=c["$[]"]("normalize"))?g(w("Array"),b)?p("Helpers").$prepare_source_array(b,d["$!="]("chomp")):p("Helpers").$prepare_source_string(b,d["$!="]("chomp")):g(w("Array"),b)?b.$drop(0):e(b)?b.$chomp().$split(p("LF"),-1):[]}catch(V){if(a.rescue(V,[p("StandardError")]))try{return e((g(w("Array"),
|
|
1084
|
-
b)?b.$join():b.$to_s())["$valid_encoding?"]())?this.$raise():this.$raise(w("ArgumentError"),"source is either binary or contains invalid Unicode data")}finally{a.pop_exception()}else throw V;}},-2);return f(b,"$process_line",function(a){e(this.process_lines)&&(this.look_ahead=h(this.look_ahead,1));return a})})(k[0],null,k);return function(b,$super,k){b=d(b,$super,"PreprocessorReader");k=[b].concat(k);var p=a.$r(k);k=b.$$prototype;k.include_stack=k.lines=k.file=k.dir=k.path=k.lineno=k.maxdepth=k.process_lines=
|
|
1085
|
-
k.includes=k.document=k.unescape_next_line=k.include_processor_extensions=k.look_ahead=k.skipping=k.conditional_stack=C;b.$attr_reader("include_stack");f(b,"$initialize",function V(a,b,c,d){var f,g=C;V.$$p=null;null==b&&(b=C);null==c&&(c=C);null==d&&(d=m([],{}));this.document=a;E(this,G(this,"initialize",V,!1,!0),"initialize",[b,c,d],null);e(q(f=(e(g=a.$attributes()["$[]"]("max-include-depth"))?g:64).$to_i(),0))?this.maxdepth=m(["abs","curr","rel"],{abs:f,curr:f,rel:f}):this.maxdepth=C;this.include_stack=
|
|
1086
|
-
[];this.includes=a.$catalog()["$[]"]("includes");this.skipping=!1;this.conditional_stack=[];return this.include_processor_extensions=C},-2);f(b,"$has_more_lines?",function(){return e(this.$peek_line())?!0:!1});f(b,"$empty?",function(){return e(this.$peek_line())?!1:!0});c(b,"eof?","empty?");f(b,"$peek_line",function Q(a){var b=Q.$$p||C;Q.$$p=null;null==a&&(a=!1);if(e(b=E(this,G(this,"peek_line",Q,!1,!0),"peek_line",[a],b)))return b;if(e(this.include_stack["$empty?"]()))return C;this.$pop_include();
|
|
1087
|
-
return this.$peek_line(a)},-1);f(b,"$push_include",function(a,b,c,d,f){var k=C,l=C,n,Q=C;null==b&&(b=C);null==c&&(c=C);null==d&&(d=1);null==f&&(f=m([],{}));this.include_stack["$<<"]([this.lines,this.file,this.dir,this.path,this.lineno,this.maxdepth,this.process_lines]);if(e(this.file=b)){if(g(w("String"),b)?this.dir=w("File").$dirname(b):e(p("RUBY_ENGINE_OPAL"))?this.dir=w("URI").$parse(w("File").$dirname(b=b.$to_s())):((this.dir=b.$dup())["$path="](x(k=w("File").$dirname(b.$path()),"/")?"":k),b=
|
|
1088
|
-
b.$to_s()),this.path=c=e(l=c)?l:w("File").$basename(b),e(this.process_lines=t(b,"end_with?",A(p("ASCIIDOC_EXTENSIONS").$keys()))))if(e(l=this.includes["$[]"](c.$slice(0,c.$rindex(".")))))l;else this.includes["$[]="](c.$slice(0,c.$rindex(".")),e(f["$[]"]("partial-option"))?C:!0)}else if(this.dir=".",this.process_lines=!0,e(this.path=c))if(e(l=this.includes["$[]"](p("Helpers").$rootname(c))))l;else this.includes["$[]="](p("Helpers").$rootname(c),e(f["$[]"]("partial-option"))?C:!0);else this.path="<stdin>";
|
|
1089
|
-
this.lineno=d;e(this.maxdepth)&&e(f["$key?"]("depth"))&&(e(q(b=f["$[]"]("depth").$to_i(),0))?(e(q(c=h(this.include_stack.$size(),b),n=this.maxdepth["$[]"]("abs")))&&(c=b=n),this.maxdepth=m(["abs","curr","rel"],{abs:n,curr:c,rel:b})):this.maxdepth=m(["abs","curr","rel"],{abs:this.maxdepth["$[]"]("abs"),curr:this.include_stack.$size(),rel:0}));if(e((this.lines=this.$prepare_lines(a,m(["normalize","condense","indent"],{normalize:e(l=this.process_lines)?l:"chomp",condense:!1,indent:f["$[]"]("indent")})))["$empty?"]()))this.$pop_include();
|
|
1090
|
-
else{if(e(f["$key?"]("leveloffset")))this.lines=h(h([e(Q=this.document.$attr("leveloffset"))?":leveloffset: "+Q:":leveloffset!:",""],this.lines.$reverse()),["",":leveloffset: "+f["$[]"]("leveloffset")]),this.lineno=y(this.lineno,2);else this.lines["$reverse!"]();this.look_ahead=0}return this},-2);f(b,"$include_depth",function(){return this.include_stack.$size()});f(b,"$exceeds_max_depth?",function(){var a,b=C;return e(a=e(b=this.maxdepth)?u(this.include_stack.$size(),this.maxdepth["$[]"]("curr")):
|
|
1091
|
-
b)?this.maxdepth["$[]"]("rel"):a});c(b,"exceeded_max_depth?","exceeds_max_depth?");f(b,"$shift",function Q(){var a=Q.$$p||C,b=C;Q.$$p=null;return e(this.unescape_next_line)?(this.unescape_next_line=!1,(b=E(this,G(this,"shift",Q,!1,!0),"shift",[],a)).$slice(1,b.$length())):E(this,G(this,"shift",Q,!1,!0),"shift",[],a)});f(b,"$include_processors?",function(){return e(this.include_processor_extensions["$nil?"]())?e(this.document["$extensions?"]())&&e(this.document.$extensions()["$include_processors?"]())?
|
|
1092
|
-
(this.include_processor_extensions=this.document.$extensions().$include_processors())["$!"]()["$!"]():this.include_processor_extensions=!1:this.include_processor_extensions["$!="](!1)});f(b,"$create_include_cursor",function(a,b,c){var d=C;g(w("String"),a)?d=w("File").$dirname(a):e(p("RUBY_ENGINE_OPAL"))?d=w("File").$dirname(a=a.$to_s()):(d=x(d=w("File").$dirname(a.$path()),"")?"/":d,a=a.$to_s());return p("Cursor").$new(a,d,b,c)});f(b,"$to_s",function(){return"#<"+this.$class()+"@"+this.$object_id()+
|
|
1093
|
-
" {path: "+this.path.$inspect()+", line: "+this.lineno+", include depth: "+this.include_stack.$size()+", include stack: ["+t(this.include_stack,"map",[],function(a){null==a&&(a=C);return a.$to_s()}).$join(", ")+"]}>"});b.$private();f(b,"$prepare_lines",function sa(a,b){var c=sa.$$p||C,d=C,f=C,g=C;sa.$$p=null;null==b&&(b=m([],{}));a=E(this,G(this,"prepare_lines",sa,!1,!0),"prepare_lines",[a,b],c);if(e(this.document)&&e(this.document.$attributes()["$[]"]("skip-front-matter"))&&e(d=this["$skip_front_matter!"](a)))this.document.$attributes()["$[]="]("front-matter",
|
|
1094
|
-
d.$join(p("LF")));if(e(b.$fetch("condense",!0)))for(;e(e(f=g=a["$[]"](-1))?g["$empty?"]():f);)a.$pop();if(e(b["$[]"]("indent")))p("Parser")["$adjust_indentation!"](a,b["$[]"]("indent").$to_i(),this.document.$attr("tabsize").$to_i());return a},-2);f(b,"$process_line",function(a){var b;if(!e(this.process_lines))return a;if(e(a["$empty?"]()))return this.look_ahead=h(this.look_ahead,1),a;if(e(a["$end_with?"]("]"))&&n(a["$start_with?"]("["))&&e(a["$include?"]("::"))){if(e(a["$include?"]("if"))&&e(p("ConditionalDirectiveRx")["$=~"](a))){if(x((b=
|
|
1095
|
-
I["~"])===C?C:b["$[]"](1),"\\"))return this.unescape_next_line=!0,this.look_ahead=h(this.look_ahead,1),a.$slice(1,a.$length());if(e(this.$preprocess_conditional_directive((b=I["~"])===C?C:b["$[]"](2),(b=I["~"])===C?C:b["$[]"](3),(b=I["~"])===C?C:b["$[]"](4),(b=I["~"])===C?C:b["$[]"](5))))return this.$shift(),C;this.look_ahead=h(this.look_ahead,1);return a}if(e(this.skipping))return this.$shift(),C;if(e(a["$start_with?"]("inc","\\inc"))&&e(p("IncludeDirectiveRx")["$=~"](a))){if(x((b=I["~"])===C?C:
|
|
1096
|
-
b["$[]"](1),"\\"))return this.unescape_next_line=!0,this.look_ahead=h(this.look_ahead,1),a.$slice(1,a.$length());if(e(this.$preprocess_include_directive((b=I["~"])===C?C:b["$[]"](2),(b=I["~"])===C?C:b["$[]"](3))))return C;this.look_ahead=h(this.look_ahead,1);return a}this.look_ahead=h(this.look_ahead,1);return a}if(e(this.skipping))return this.$shift(),C;this.look_ahead=h(this.look_ahead,1);return a});f(b,"$preprocess_conditional_directive",function(b,c,d,f){var g,h=C,k=C,l=C,q=h=C,r=C;e(h=c["$empty?"]())||
|
|
1097
|
-
(c=c.$downcase());if(x(b,"endif"))return e(f)?this.$logger().$error(this.$message_with_context("malformed preprocessor directive - text not permitted: endif::"+c+"["+f+"]",m(["source_location"],{source_location:this.$cursor()}))):e(this.conditional_stack["$empty?"]())?this.$logger().$error(this.$message_with_context("unmatched preprocessor directive: endif::"+c+"[]",m(["source_location"],{source_location:this.$cursor()}))):e(h)||x(c,(k=this.conditional_stack["$[]"](-1))["$[]"]("target"))?(this.conditional_stack.$pop(),
|
|
1098
|
-
this.skipping=e(this.conditional_stack["$empty?"]())?!1:this.conditional_stack["$[]"](-1)["$[]"]("skipping")):this.$logger().$error(this.$message_with_context("mismatched preprocessor directive: endif::"+c+"[], expected endif::"+k["$[]"]("target")+"[]",m(["source_location"],{source_location:this.$cursor()}))),!0;if(e(this.skipping))l=!1;else switch(b){case "ifdef":if(e(h))return this.$logger().$error(this.$message_with_context("malformed preprocessor directive - missing target: ifdef::["+f+"]",m(["source_location"],
|
|
1099
|
-
{source_location:this.$cursor()}))),!0;switch(d){case ",":l=t(c.$split(",",-1),"none?",[],function Ea(a){var b=null==Ea.$$s?this:Ea.$$s;null==b.document&&(b.document=C);null==a&&(a=C);return b.document.$attributes()["$key?"](a)},{$$s:this});break;case "+":l=t(c.$split("+",-1),"any?",[],function Aa(a){var b=null==Aa.$$s?this:Aa.$$s;null==b.document&&(b.document=C);null==a&&(a=C);return b.document.$attributes()["$key?"](a)["$!"]()},{$$s:this});break;default:l=this.document.$attributes()["$key?"](c)["$!"]()}break;
|
|
1100
|
-
case "ifndef":if(e(h))return this.$logger().$error(this.$message_with_context("malformed preprocessor directive - missing target: ifndef::["+f+"]",m(["source_location"],{source_location:this.$cursor()}))),!0;switch(d){case ",":l=t(c.$split(",",-1),"any?",[],function Ea(a){var b=null==Ea.$$s?this:Ea.$$s;null==b.document&&(b.document=C);null==a&&(a=C);return b.document.$attributes()["$key?"](a)},{$$s:this});break;case "+":l=t(c.$split("+",-1),"all?",[],function Aa(a){var b=null==Aa.$$s?this:Aa.$$s;
|
|
1101
|
-
null==b.document&&(b.document=C);null==a&&(a=C);return b.document.$attributes()["$key?"](a)},{$$s:this});break;default:l=this.document.$attributes()["$key?"](c)}break;case "ifeval":if(e(h))if(e(f)&&e(p("EvalExpressionRx")["$=~"](f.$strip()))){h=(g=I["~"])===C?C:g["$[]"](1);q=(g=I["~"])===C?C:g["$[]"](2);r=(g=I["~"])===C?C:g["$[]"](3);a:{try{l=e(this.$resolve_expr_val(h).$send(q,this.$resolve_expr_val(r)))?!1:!0;break a}catch(ua){if(a.rescue(ua,[p("StandardError")]))try{l=!0;break a}finally{a.pop_exception()}else throw ua;
|
|
1102
|
-
}l=void 0}}else return this.$logger().$error(this.$message_with_context("malformed preprocessor directive - "+(e(f)?"invalid expression":"missing expression")+": ifeval::["+f+"]",m(["source_location"],{source_location:this.$cursor()}))),!0;else return this.$logger().$error(this.$message_with_context("malformed preprocessor directive - target not permitted: ifeval::"+c+"["+f+"]",m(["source_location"],{source_location:this.$cursor()}))),!0;break;default:C}x(b,"ifeval")||n(f)?(e(l)&&(this.skipping=!0),
|
|
1103
|
-
this.conditional_stack["$<<"](m(["target","skip","skipping"],{target:c,skip:l,skipping:this.skipping}))):e(this.skipping)||e(l)||(this.$replace_next_line(f.$rstrip()),this.$unshift(""),e(f["$start_with?"]("include::"))&&(this.look_ahead=y(this.look_ahead,1)));return!0});f(b,"$preprocess_include_directive",function(b,c){var d,f,k=C,X=C,z=C,F=C,V=d=C,A=C,D=C,O=C,E=f=C,G=C,S=E=C,T=C,L=C,M=C,K=C,H=C,N=C,P=C,Z=C,ta=C,Y=C,ea=C,ha=C;G=C;k=this.document;if(e((X=b)["$include?"](p("ATTR_REF_HEAD")))&&e((X=
|
|
1104
|
-
k.$sub_attributes(b,m(["attribute_missing"],{attribute_missing:x(z=e(F=k.$attributes()["$[]"]("attribute-missing"))?F:p("Compliance").$attribute_missing(),"warn")?"drop-line":z})))["$empty?"]())){if(x(z,"drop-line")&&e(k.$sub_attributes(h(b," "),m(["attribute_missing","drop_line_severity"],{attribute_missing:"drop-line",drop_line_severity:"ignore"}))["$empty?"]()))return t(this.$logger(),"info",[],function Na(){var a=null==Na.$$s?this:Na.$$s;return a.$message_with_context("include dropped due to missing attribute: include::"+
|
|
1105
|
-
b+"["+c+"]",m(["source_location"],{source_location:a.$cursor()}))},{$$s:this}),this.$shift(),!0;if(e(k.$parse_attributes(c,[],m(["sub_input"],{sub_input:!0}))["$[]"]("optional-option")))return t(this.$logger(),"info",[],function Na(){var a=null==Na.$$s?this:Na.$$s;return a.$message_with_context("optional include dropped "+(x(z,"warn")&&e(k.$sub_attributes(h(b," "),m(["attribute_missing","drop_line_severity"],{attribute_missing:"drop-line",drop_line_severity:"ignore"}))["$empty?"]())?"due to missing attribute":
|
|
1106
|
-
"because resolved target is blank")+": include::"+b+"["+c+"]",m(["source_location"],{source_location:a.$cursor()}))},{$$s:this}),this.$shift(),!0;this.$logger().$warn(this.$message_with_context("include dropped "+(x(z,"warn")&&e(k.$sub_attributes(h(b," "),m(["attribute_missing","drop_line_severity"],{attribute_missing:"drop-line",drop_line_severity:"ignore"}))["$empty?"]())?"due to missing attribute":"because resolved target is blank")+": include::"+b+"["+c+"]",m(["source_location"],{source_location:this.$cursor()})));
|
|
1107
|
-
return this.$replace_next_line("Unresolved directive in "+this.path+" - include::"+b+"["+c+"]")}if(e(this["$include_processors?"]())&&e(d=t(this.include_processor_extensions,"find",[],function(a){null==a&&(a=C);return a.$instance()["$handles?"](X)})))return this.$shift(),d.$process_method()["$[]"](k,this,X,k.$parse_attributes(c,[],m(["sub_input"],{sub_input:!0}))),!0;if(e(u(k.$safe(),w(p("SafeMode"),"SECURE"))))return this.$replace_next_line("link:"+X+"[role=include]");if(e(this.maxdepth)){if(e(u(this.include_stack.$size(),
|
|
1108
|
-
this.maxdepth["$[]"]("curr"))))return this.$logger().$error(this.$message_with_context("maximum include depth of "+this.maxdepth["$[]"]("rel")+" exceeded",m(["source_location"],{source_location:this.$cursor()}))),C;V=k.$parse_attributes(c,[],m(["sub_input"],{sub_input:!0}));f=this.$resolve_include_path(X,c,V);d=l(f);A=null==d[0]?C:d[0];D=null==d[1]?C:d[1];O=null==d[2]?C:d[2];f;switch(D){case "file":f=w("File").$method("open");E=p("FILE_READ_MODE");break;case "uri":f=w("OpenURI").$method("open_uri");
|
|
1109
|
-
E=p("URI_READ_MODE");break;default:return A}if(!e(p("RUBY_ENGINE_OPAL"))){if(d=e(G=V["$[]"]("encoding"))){a:{try{var R=w("Encoding").$find(G);break a}catch(Ga){if(a.rescue(Ga,[p("StandardError")]))try{R=C;break a}finally{a.pop_exception()}else throw Ga;}R=void 0}d=e(R)}d&&((E=E.$split(":"))["$[]="](1,G),E=E.$join(":"))}S=T=C;e(c)&&(e(V["$key?"]("lines"))?(S=[],t(this.$split_delimited_value(V["$[]"]("lines")),"each",[],function(b){null==b&&(b=C);if(e(b["$include?"](".."))){b=b.$partition("..");var c=
|
|
1110
|
-
l(b);var d=null==c[0]?C:c[0];c=null==c[2]?C:c[2];b;return S=h(S,e(c["$empty?"]())||e(r(c=c.$to_i(),0))?[d.$to_i(),w(w("Float"),"INFINITY")]:a.Range.$new(d.$to_i(),c,!1).$to_a())}return S["$<<"](b.$to_i())}),S=e(S["$empty?"]())?C:S.$sort().$uniq()):e(V["$key?"]("tag"))?e((L=V["$[]"]("tag"))["$empty?"]())||x(L,"!")||(T=e(L["$start_with?"]("!"))?J(L.$slice(1,L.$length()),!1):J(L,!0)):e(V["$key?"]("tags"))&&(T=m([],{}),t(this.$split_delimited_value(V["$[]"]("tags")),"each",[],function(a){var b;null==
|
|
1111
|
-
a&&(a=C);return e(a["$empty?"]())||x(a,"!")?C:e(a["$start_with?"]("!"))?(b=[a.$slice(1,a.$length()),!1],t(T,"[]=",b),b[b.length-1]):(b=[a,!0],t(T,"[]=",b),b[b.length-1])}),e(T["$empty?"]())&&(T=C)));if(e(S)){d=[[],C,0];M=d[0];K=d[1];H=d[2];d;try{t(f,"call",[A,E],function(a){var b=C;null==a&&(a=C);b=C;return function(){try{var c=v("break");return t(a,"each_line",[],function(a){var d=C;null==a&&(a=C);H=h(H,1);if(e(b)||g(w("Float"),d=S["$[]"](0))&&e(b=d["$infinite?"]()))return K=e(F=K)?F:H,M["$<<"](a);
|
|
1112
|
-
x(d,H)&&(K=e(F=K)?F:H,M["$<<"](a),S.$shift());if(e(S["$empty?"]()))c.$throw();else return C})}catch(Pa){if(Pa===c)return Pa.$v;throw Pa;}}()})}catch(Ga){if(a.rescue(Ga,[p("StandardError")]))try{return this.$logger().$error(this.$message_with_context("include "+D+" not readable: "+A,m(["source_location"],{source_location:this.$cursor()}))),this.$replace_next_line("Unresolved directive in "+this.path+" - include::"+X+"["+c+"]")}finally{a.pop_exception()}else throw Ga;}this.$shift();e(K)&&(V["$[]="]("partial-option",
|
|
1113
|
-
""),this.$push_include(M,A,O,K,V))}else if(e(T)){d=[[],C,0,[],w("Set").$new(),C];M=d[0];K=d[1];H=d[2];N=d[3];P=d[4];Z=d[5];d;e(T["$key?"]("**"))?(ta=Y=T.$delete("**"),e(T["$key?"]("*"))?ea=T.$delete("*"):n(ta)&&x(T.$values().$first(),!1)&&(ea=!0)):e(T["$key?"]("*"))?x(T.$keys().$first(),"*")?ta=Y=(ea=T.$delete("*"))["$!"]():(ta=Y=!1,ea=T.$delete("*")):ta=Y=T["$value?"](!0)["$!"]();try{t(f,"call",[A,E],function Sa(a){var b=null==Sa.$$s?this:Sa.$$s,c=C,d=C;null==a&&(a=C);var f=["::","[]"];c=f[0];d=
|
|
1114
|
-
f[1];f;return t(a,"each_line",[],function Ta(a){var b,f,g=null==Ta.$$s?this:Ta.$$s,k=C,q=C,r=C;null==a&&(a=C);H=h(H,1);if(e(a["$include?"](c))&&e(a["$include?"](d))&&e(p("TagDirectiveRx")["$=~"](a))){k=(b=I["~"])===C?C:b["$[]"](2);if(e((b=I["~"])===C?C:b["$[]"](1)))return x(k,Z)?(N.$pop(),f=e(N["$empty?"]())?[C,Y]:N["$[]"](-1),b=l(f),Z=null==b[0]?C:b[0],ta=null==b[1]?C:b[1],f):e(T["$key?"](k))?(q=g.$create_include_cursor(A,X,H),e(r=t(N,"rindex",[],function(a){null==a&&(a=C);return a["$=="](k)},{$$has_trailing_comma_in_args:!0}))?
|
|
1115
|
-
(x(r,0)?N.$shift():N.$delete_at(r),g.$logger().$warn(g.$message_with_context("mismatched end tag (expected '"+Z+"' but found '"+k+"') at line "+H+" of include "+D+": "+A,m(["source_location","include_location"],{source_location:g.$cursor(),include_location:q})))):g.$logger().$warn(g.$message_with_context("unexpected end tag '"+k+"' at line "+H+" of include "+D+": "+A,m(["source_location","include_location"],{source_location:g.$cursor(),include_location:q})))):C;if(e(T["$key?"](k))){if(e(ta=T["$[]"](k)))P["$<<"](k);
|
|
1116
|
-
return N["$<<"]([Z=k,ta,H])}return n(ea["$nil?"]())?(ta=e(Z)&&n(ta)?!1:ea,N["$<<"]([Z=k,ta,H])):C}return e(ta)?(K=e(F=K)?F:H,M["$<<"](a)):C},{$$s:b})},{$$s:this})}catch(Ga){if(a.rescue(Ga,[p("StandardError")]))try{return this.$logger().$error(this.$message_with_context("include "+D+" not readable: "+A,m(["source_location"],{source_location:this.$cursor()}))),this.$replace_next_line("Unresolved directive in "+this.path+" - include::"+X+"["+c+"]")}finally{a.pop_exception()}else throw Ga;}e(N["$empty?"]())||
|
|
1117
|
-
t(N,"each",[],function Oa(a,b,c){b=null==Oa.$$s?this:Oa.$$s;null==a&&(a=C);null==c&&(c=C);return b.$logger().$warn(b.$message_with_context("detected unclosed tag '"+a+"' starting at line "+c+" of include "+D+": "+A,m(["source_location","include_location"],{source_location:b.$cursor(),include_location:b.$create_include_cursor(A,X,c)})))},{$$s:this});e((ha=y(t(T,"keep_if",[],function(a,b){null==b&&(b=C);return b}).$keys(),P.$to_a()))["$empty?"]())||this.$logger().$warn(this.$message_with_context("tag"+
|
|
1118
|
-
(e(q(ha.$size(),1))?"s":"")+" '"+ha.$join(", ")+"' not found in include "+D+": "+A,m(["source_location"],{source_location:this.$cursor()})));this.$shift();if(e(K)){if(!(e(Y)&&B(ea,!1)&&e(T["$empty?"]())))V["$[]="]("partial-option","");this.$push_include(M,A,O,K,V)}}else{G=C;try{G=t(f,"call",[A,E],function(a){null==a&&(a=C);return a.$read()}),this.$shift()}catch(Ga){if(a.rescue(Ga,[p("StandardError")]))try{return this.$logger().$error(this.$message_with_context("include "+D+" not readable: "+A,m(["source_location"],
|
|
1119
|
-
{source_location:this.$cursor()}))),this.$replace_next_line("Unresolved directive in "+this.path+" - include::"+X+"["+c+"]")}finally{a.pop_exception()}else throw Ga;}this.$push_include(G,A,O,1,V)}return!0}return C});f(b,"$resolve_include_path",function(a,b,c){var d,f=C,h=C;f=C;f=this.document;if(e(p("Helpers")["$uriish?"](a))||e(g(w("String"),this.dir)?C:a=""+this.dir+"/"+a)){if(!e(f["$attr?"]("allow-uri-read")))return this.$replace_next_line("link:"+a+"[role=include]");e(f["$attr?"]("cache-uri"))?
|
|
1120
|
-
e((d=w("::","OpenURI","skip_raise"))&&w(d,"Cache","skip_raise")?"constant":C)||p("Helpers").$require_library("open-uri/cached","open-uri-cached"):n(p("RUBY_ENGINE_OPAL"))&&w("OpenURI");return[w("URI").$parse(a),"uri",a]}h=f.$normalize_system_path(a,this.dir,C,m(["target_name"],{target_name:"include file"}));if(!e(w("File")["$file?"](h))){if(e(c["$[]"]("optional-option")))return t(this.$logger(),"info",[],function va(){var a=null==va.$$s?this:va.$$s;return a.$message_with_context("optional include dropped because include file not found: "+
|
|
1121
|
-
h,m(["source_location"],{source_location:a.$cursor()}))},{$$s:this}),this.$shift(),!0;this.$logger().$error(this.$message_with_context("include file not found: "+h,m(["source_location"],{source_location:this.$cursor()})));return this.$replace_next_line("Unresolved directive in "+this.path+" - include::"+a+"["+b+"]")}f=f.$path_resolver().$relative_path(h,f.$base_dir());return[h,"file",f]});f(b,"$pop_include",function(){if(!e(this.include_stack["$empty?"]())){var a=this.include_stack.$pop();var b=l(a);
|
|
1122
|
-
this.lines=null==b[0]?C:b[0];this.file=null==b[1]?C:b[1];this.dir=null==b[2]?C:b[2];this.path=null==b[3]?C:b[3];this.lineno=null==b[4]?C:b[4];this.maxdepth=null==b[5]?C:b[5];this.process_lines=null==b[6]?C:b[6];a;this.look_ahead=0}return C});f(b,"$split_delimited_value",function(a){return e(a["$include?"](","))?a.$split(","):a.$split(";")});f(b,"$skip_front_matter!",function(a,b){var c,d=C,f;null==b&&(b=!0);if(!x(c=a["$[]"](0),"---"))return C;var g=a.$drop(0);a.$shift();var k=[];e(b)&&(this.lineno=
|
|
1123
|
-
h(this.lineno,1));for(;!e(e(d=f=a["$empty?"]())?d:a["$[]"](0)["$=="](c));)k["$<<"](a.$shift()),e(b)&&(this.lineno=h(this.lineno,1));if(e(f))return t(a,"unshift",A(g)),e(b)&&(this.lineno=y(this.lineno,g.$size())),C;a.$shift();e(b)&&(this.lineno=h(this.lineno,1));return k},-2);return f(b,"$resolve_expr_val",function(a){if(e(a["$start_with?"]('"'))&&e(a["$end_with?"]('"'))||e(a["$start_with?"]("'"))&&e(a["$end_with?"]("'"))){var b=!0;a=a.$slice(1,y(a.$length(),1))}else b=!1;e(a["$include?"](p("ATTR_REF_HEAD")))&&
|
|
1124
|
-
(a=this.document.$sub_attributes(a,m(["attribute_missing"],{attribute_missing:"drop"})));return e(b)?a:e(a["$empty?"]())?C:x(a,"true")?!0:x(a,"false")?!1:e(a.$rstrip()["$empty?"]())?" ":e(a["$include?"]("."))?a.$to_f():a.$to_i()})}(k[0],p("Reader"),k)}(L[0],L)};Opal.modules["asciidoctor/section"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.send2,c=a.find_super,m=a.eqeqeq,n=a.truthy,g=a.rb_plus,l=a.def,e=a.alias,q=a.rb_gt,t=a.eqeq,y=a.not,v=a.send,x=a.defs,z=[],A=a.nil;a.add_stubs("attr_accessor,attr_reader,===,+,level,special,title,generate_id,>,==,sectnum,!,empty?,reftext,sub_placeholder,sub_quotes,compat_mode,[],attributes,context,assign_numeral,class,object_id,inspect,size,[]=,chr,length,gsub,downcase,delete,tr_s,end_with?,chop,start_with?,slice,key?,catalog,unique_id_start_index");
|
|
1125
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);p=a.$r(k);return function(b,$super,k){b=d(b,$super,"Section");k=[b].concat(k);var p=a.$r(k);k=b.$$prototype;k.document=k.next_section_index=k.parent=k.level=k.numeral=k.numbered=k.sectname=k.title=k.blocks=A;b.$attr_accessor("index");b.$attr_accessor("sectname");b.$attr_accessor("special");b.$attr_accessor("numbered");b.$attr_reader("caption");l(b,"$initialize",function na(a,b,d,e){var k,l=A;na.$$p=null;null==a&&(a=A);null==b&&(b=A);null==d&&(d=
|
|
1126
|
-
!1);null==e&&(e=f([],{}));h(this,c(this,"initialize",na,!1,!0),"initialize",[a,"section",e],null);m(p("Section"),a)?(k=[n(l=b)?l:g(a.$level(),1),a.$special()],this.level=k[0],this.special=k[1]):(k=[n(l=b)?l:1,!1],this.level=k[0],this.special=k[1]);k;this.numbered=d;return this.index=0},-1);e(b,"name","title");l(b,"$generate_id",function(){return p("Section").$generate_id(this.$title(),this.document)});l(b,"$sections?",function(){return q(this.next_section_index,0)});l(b,"$sectnum",function(a,b){var c=
|
|
1127
|
-
A;null==a&&(a=".");null==b&&(b=A);b=n(c=b)?c:t(b,!1)?"":a;return n(q(this.level,1))&&m(p("Section"),this.parent)?""+this.parent.$sectnum(a,a)+this.numeral+b:""+this.numeral+b},-1);l(b,"$xreftext",function(a){var b=A,c=A,d;null==a&&(a=A);if(n(b=this.$reftext())&&y(b["$empty?"]()))return b;if(n(a))if(n(this.numbered))switch(a){case "full":return a=t(c=this.sectname,"chapter")||t(c,"appendix")?this.$sub_placeholder(this.$sub_quotes("_%s_"),this.$title()):this.$sub_placeholder(this.$sub_quotes(n(this.document.$compat_mode())?
|
|
1128
|
-
"``%s''":'"`%s`"'),this.$title()),n(d=this.document.$attributes()["$[]"](""+c+"-refsig"))?""+d+" "+this.$sectnum(".",",")+" "+a:""+this.$sectnum(".",",")+" "+a;case "short":return n(d=this.document.$attributes()["$[]"](""+this.sectname+"-refsig"))?""+d+" "+this.$sectnum(".",""):this.$sectnum(".","");default:return t(c=this.sectname,"chapter")||t(c,"appendix")?this.$sub_placeholder(this.$sub_quotes("_%s_"),this.$title()):this.$title()}else return t(c=this.sectname,"chapter")||t(c,"appendix")?this.$sub_placeholder(this.$sub_quotes("_%s_"),
|
|
1129
|
-
this.$title()):this.$title();else return this.$title()},-1);l(b,"$<<",function C(a){var b=C.$$p||A;C.$$p=null;t(a.$context(),"section")&&this.$assign_numeral(a);return h(this,c(this,"<<",C,!1,!0),"<<",[a],b)});l(b,"$to_s",function C(){var a=C.$$p||A;C.$$p=null;return n(this.title)?(a=n(this.numbered)?""+this.$sectnum()+" "+this.title:this.title,"#<"+this.$class()+"@"+this.$object_id()+" {level: "+this.level+", title: "+a.$inspect()+", blocks: "+this.blocks.$size()+"}>"):h(this,c(this,"to_s",C,!1,
|
|
1130
|
-
!0),"to_s",[],a)});return x(b,"$generate_id",function(a,b){var c,d=A,e=A,f=A;var h=b.$attributes();var k=n(d=h["$[]"]("idprefix"))?d:"_";if(n(d=h["$[]"]("idseparator"))){if(t(d.$length(),1)||y(e=d["$empty?"]())&&n(d=(c=["idseparator",d.$chr()],v(h,"[]=",c),c[c.length-1])))f=t(d,"-")||t(d,".")?" .-":" "+d+".-"}else c=["_"," _.-"],d=c[0],f=c[1],c;a=""+k+a.$downcase().$gsub(p("InvalidSectionIdCharsRx"),"");n(e)?a=a.$delete(" "):(a=a.$tr_s(f,d),n(a["$end_with?"](d))&&(a=a.$chop()),n(k["$empty?"]())&&
|
|
1131
|
-
n(a["$start_with?"](d))&&(a=a.$slice(1,a.$length())));if(n(b.$catalog()["$[]"]("refs")["$key?"](a))){b=b.$catalog()["$[]"]("refs");for(k=p("Compliance").$unique_id_start_index();n(b["$[]"](e=""+a+d+k));)k=g(k,1);return e}return a})}(k[0],p("AbstractBlock"),k)}(z[0],z)};Opal.modules["asciidoctor/stylesheets"]=function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.return_ivar,c=a.defs,m=a.def,n=a.truthy,g=a.hash2,l=[],e=a.nil,q=a.$$$;a.add_stubs("join,new,rstrip,read,primary_stylesheet_data,write,primary_stylesheet_name,stylesheet_basename,for,read_stylesheet,coderay_stylesheet_data,coderay_stylesheet_name,pygments_stylesheet_data,pygments_stylesheet_name");
|
|
1132
|
-
return function(k,l){k=[b(k,"Asciidoctor")].concat(l);return function(b,$super,k){b=d(b,$super,"Stylesheets");k=[b].concat(k);var l=a.$r(k);b.$$prototype.primary_stylesheet_data=e;f(k[0],"DEFAULT_STYLESHEET_NAME","asciidoctor.css");f(k[0],"STYLESHEETS_DIR",q("File").$join(l("DATA_DIR"),"stylesheets"));b.__instance__=b.$new();c(b,"$instance",h("__instance__"));m(b,"$primary_stylesheet_name",function(){return l("DEFAULT_STYLESHEET_NAME")});m(b,"$primary_stylesheet_data",function(){var a=e;return this.primary_stylesheet_data=
|
|
1133
|
-
n(a=this.primary_stylesheet_data)?a:q("File").$read(q("File").$join(l("STYLESHEETS_DIR"),"asciidoctor-default.css"),g(["mode"],{mode:l("FILE_READ_MODE")})).$rstrip()});m(b,"$embed_primary_stylesheet",function(){return"<style>\n"+this.$primary_stylesheet_data()+"\n</style>"});m(b,"$write_primary_stylesheet",function(a){null==a&&(a=".");return q("File").$write(q("File").$join(a,this.$primary_stylesheet_name()),this.$primary_stylesheet_data(),g(["mode"],{mode:l("FILE_WRITE_MODE")}))},-1);m(b,"$coderay_stylesheet_name",
|
|
1134
|
-
function(){return l("SyntaxHighlighter").$for("coderay").$stylesheet_basename()});m(b,"$coderay_stylesheet_data",function(){return l("SyntaxHighlighter").$for("coderay").$read_stylesheet()});m(b,"$embed_coderay_stylesheet",function(){return"<style>\n"+this.$coderay_stylesheet_data()+"\n</style>"});m(b,"$write_coderay_stylesheet",function(a){null==a&&(a=".");return q("File").$write(q("File").$join(a,this.$coderay_stylesheet_name()),this.$coderay_stylesheet_data(),g(["mode"],{mode:l("FILE_WRITE_MODE")}))},
|
|
1135
|
-
-1);m(b,"$pygments_stylesheet_name",function(a){null==a&&(a=e);return l("SyntaxHighlighter").$for("pygments").$stylesheet_basename(a)},-1);m(b,"$pygments_stylesheet_data",function(a){null==a&&(a=e);return l("SyntaxHighlighter").$for("pygments").$read_stylesheet(a)},-1);m(b,"$embed_pygments_stylesheet",function(a){null==a&&(a=e);return"<style>\n"+this.$pygments_stylesheet_data(a)+"\n</style>"},-1);return m(b,"$write_pygments_stylesheet",function(a,b){null==a&&(a=".");null==b&&(b=e);return q("File").$write(q("File").$join(a,
|
|
1136
|
-
this.$pygments_stylesheet_name(b)),this.$pygments_stylesheet_data(b),g(["mode"],{mode:l("FILE_WRITE_MODE")}))},-1)}(k[0],null,k)}(l[0],l)};Opal.modules["asciidoctor/table"]=function(a){var b=a.module,d=a.klass,f=a.const_set,h=a.def,c=a.alias,m=a.hash2,n=a.send2,g=a.find_super,l=a.truthy,e=a.rb_lt,q=a.rb_gt,t=a.eqeq,y=a.rb_times,v=a.rb_divide,x=a.send,z=a.rb_plus,A=a.rb_minus,B=a.return_val,D=a.to_a,E=a.gvars,G=a.neqeq,u=a.return_ivar,I=a.to_ary,r=a.regexp,J=a.not,L=a.thrower,C=[],w=a.nil,K=a.$$$;
|
|
1137
|
-
a.add_stubs("attr_accessor,send,attr_reader,new,[],<,>,to_i,==,[]=,attributes,truncate,*,/,to_f,empty?,body,each,<<,size,+,assign_column_widths,warn,logger,-,update_attributes,assign_width,round,head=,map,shift,reinitialize,nil?,unshift,foot=,pop,parent,sourcemap,dup,header_row?,table,style,merge,delete,start_with?,rstrip,slice,length,advance,lstrip,strip,split,include?,readlines,catalog_inline_anchor,=~,apply_subs,attr_writer,convert,text,!=,file,lineno,include,to_set,mark,key?,nested?,document,error,message_with_context,cursor_at_prev_line,nil_or_empty?,escape,columns,match,chop,end_with?,gsub,!,push_cellspec,cell_open?,close_cell,take_cellspec,squeeze,upto,times,cursor_before_mark,rowspan,activate_rowspan,colspan,end_of_row?,close_row,private,rows,effective_column_visits");
|
|
1138
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);p=a.$r(k);(function(b,$super,k){b=d(b,$super,"Table");k=[b].concat(k);var p=a.$r(k),r=b.$$prototype;r.attributes=r.document=r.rows=r.has_header_option=r.columns=w;f(k[0],"DEFAULT_PRECISION",4);(function(a,$super){a=d(a,$super,"Rows");var b=a.$$prototype;b.head=b.body=b.foot=w;a.$attr_accessor("head","foot","body");h(a,"$initialize",function(a,b,c){null==a&&(a=[]);null==b&&(b=[]);null==c&&(c=[]);this.head=a;this.foot=b;return this.body=c},-1);c(a,
|
|
1139
|
-
"[]","send");h(a,"$by_section",function(){return[["head",this.head],["body",this.body],["foot",this.foot]]});return h(a,"$to_h",function(){return m(["head","body","foot"],{head:this.head,body:this.body,foot:this.foot})})})(k[0],null);b.$attr_accessor("columns");b.$attr_accessor("rows");b.$attr_accessor("has_header_option");b.$attr_reader("caption");h(b,"$initialize",function V(a,b){var c,d=w,f=w;V.$$p=null;n(this,g(this,"initialize",V,!1,!0),"initialize",[a,"table"],null);this.rows=p("Rows").$new();
|
|
1140
|
-
this.columns=[];this.has_header_option=!1;if(l(a=b["$[]"]("width"))){if(l(q(d=a.$to_i(),100))||l(e(d,1)))t(d,0)&&(t(a,"0")||t(a,"0%"))||(d=100)}else d=100;this.attributes["$[]="]("tablepcwidth",d);if(l(this.document.$attributes()["$[]"]("pagewidth")))this.attributes["$[]="]("tableabswidth",t(f=y(v(d,100),this.document.$attributes()["$[]"]("pagewidth").$to_f()).$truncate(p("DEFAULT_PRECISION")),f.$to_i())?f.$to_i():f);return l(b["$[]"]("rotate-option"))?(c=["orientation","landscape"],x(this.attributes,
|
|
1141
|
-
"[]=",c),c[c.length-1]):w});h(b,"$header_row?",function(){var a;return l(a=this.has_header_option)&&l(this.rows.$body()["$empty?"]())?a:w});h(b,"$create_columns",function(a){var b=w,c=w,d=w,f=w;b=[];c=w;d=0;x(a,"each",[],function ia(a){var f=null==ia.$$s?this:ia.$$s,g=w;null==a&&(a=w);var h=a["$[]"]("width");b["$<<"](p("Column").$new(f,b.$size(),a));return l(e(h,0))?(c=l(g=c)?g:[])["$<<"](b["$[]"](-1)):d=z(d,h)},{$$s:this});l(q(f=(this.columns=b).$size(),0))&&(this.attributes["$[]="]("colcount",f),
|
|
1142
|
-
l(q(d,0))||l(c)||(d=w),this.$assign_column_widths(d,c));return w});h(b,"$assign_column_widths",function(a,b){var c=w,d=w,e=w,f=w,g=w;null==a&&(a=w);null==b&&(b=w);c=p("DEFAULT_PRECISION");d=e=0;l(a)?(l(b)&&(l(q(a,100))?(f=0,this.$logger().$warn("total column width must not exceed 100% when using autowidth columns; got "+a+"%")):(f=v(A(100,a),b.$size()).$truncate(c),t(f.$to_i(),f)&&(f=f.$to_i()),a=100),g=m(["width","autowidth-option"],{width:f,"autowidth-option":""}),x(b,"each",[],function(a){null==
|
|
1143
|
-
a&&(a=w);return a.$update_attributes(g)})),x(this.columns,"each",[],function(b){null==b&&(b=w);return d=z(d,e=b.$assign_width(w,a,c))})):(e=v(100,this.columns.$size()).$truncate(c),t(e.$to_i(),e)&&(e=e.$to_i()),x(this.columns,"each",[],function(a){null==a&&(a=w);return d=z(d,a.$assign_width(e,w,c))}));t(d,100)||this.columns["$[]"](-1).$assign_width(z(A(100,d),e).$round(c),w,c);return w},-1);return h(b,"$partition_header_footer",function(a){var b,c=w,d=w;c=(b=["rowcount",(d=this.rows.$body()).$size()],
|
|
1144
|
-
x(this.attributes,"[]=",b),b[b.length-1]);l(q(c,0))&&(l(this.has_header_option)?(this.rows["$head="]([x(d.$shift(),"map",[],function(a){null==a&&(a=w);return a.$reinitialize(!0)})]),c=A(c,1)):l(this.has_header_option["$nil?"]())&&(this.has_header_option=!1,d.$unshift(x(d.$shift(),"map",[],function(a){null==a&&(a=w);return a.$reinitialize(!1)}))));if(l(q(c,0))&&l(a["$[]"]("footer-option")))this.rows["$foot="]([d.$pop()]);return w})})(k[0],p("AbstractBlock"),k);(function(a,$super){a=d(a,$super,"Column");
|
|
1145
|
-
a.$$prototype.attributes=w;a.$attr_accessor("style");h(a,"$initialize",function Q(a,b,c){Q.$$p=null;null==c&&(c=m([],{}));n(this,g(this,"initialize",Q,!1,!0),"initialize",[a,"table_column"],null);this.style=c["$[]"]("style");c["$[]="]("colnumber",z(b,1));if(l(a=c["$[]"]("width")))a;else c["$[]="]("width",1);if(l(a=c["$[]"]("halign")))a;else c["$[]="]("halign","left");if(l(a=c["$[]"]("valign")))a;else c["$[]="]("valign","top");return this.$update_attributes(c)},-3);c(a,"table","parent");h(a,"$assign_width",
|
|
1146
|
-
function(a,b,c){var d,e=w;l(b)&&(a=v(y(this.attributes["$[]"]("width").$to_f(),100),b).$truncate(c),t(a.$to_i(),a)&&(a=a.$to_i()));if(l(this.$parent().$attributes()["$[]"]("tableabswidth")))this.attributes["$[]="]("colabswidth",t(e=y(v(a,100),this.$parent().$attributes()["$[]"]("tableabswidth")).$truncate(c),e.$to_i())?e.$to_i():e);return d=["colpcwidth",a],x(this.attributes,"[]=",d),d[d.length-1]});h(a,"$block?",B(!1));return h(a,"$inline?",B(!1))})(p("Table"),p("AbstractNode"));(function(b,$super,
|
|
1147
|
-
k){b=d(b,$super,"Cell");k=[b].concat(k);var p=a.$r(k),q=b.$$prototype;q.document=q.reinitialize_args=q.attributes=q.cursor=q.text=q.subs=q.style=q.inner_document=q.source_location=q.colspan=q.rowspan=w;f(k[0],"DOUBLE_LF",y(p("LF"),2));b.$attr_accessor("colspan");b.$attr_accessor("rowspan");c(b,"column","parent");b.$attr_reader("inner_document");h(b,"$initialize",function fa(a,b,c,d){var f=w,h=w,k=w,q=w,Q=w,r=w,u=w,y=w,v;fa.$$p=null;null==c&&(c=m([],{}));null==d&&(d=m([],{}));n(this,g(this,"initialize",
|
|
1148
|
-
fa,!1,!0),"initialize",[a,"table_cell"],null);this.cursor=this.reinitialize_args=w;l(this.document.$sourcemap())&&(this.source_location=d["$[]"]("cursor").$dup());if(l(a)){if(l(f=a.$table()["$header_row?"]())){if(t(f,"implicit")&&l(h=l(k=a.$style())?k:l(q=c)?c["$[]"]("style"):q)){if(t(h,"asciidoc")||t(h,"literal"))this.reinitialize_args=[a,b,l(k=c)?c.$merge():k,d];h=w}}else h=a.$style();this.$update_attributes(a.$attributes())}if(l(c))switch(l(c["$empty?"]())?this.colspan=this.rowspan=w:(a=[c.$delete("colspan"),
|
|
1149
|
-
c.$delete("rowspan")],this.colspan=a[0],this.rowspan=a[1],a,l(f)||(h=l(k=c["$[]"]("style"))?k:h),this.$update_attributes(c)),h){case "asciidoc":Q=!0;r=d["$[]"]("cursor");if(l((b=b.$rstrip())["$start_with?"](p("LF")))){for(c=1;l((b=b.$slice(1,b.$length()))["$start_with?"](p("LF")));)c=z(c,1);r.$advance(c)}else b=b.$lstrip();break;case "literal":u=!0;for(b=b.$rstrip();l(b["$start_with?"](p("LF")));)b=b.$slice(1,b.$length());break;default:y=!0,b=l(b)?b.$strip():""}else this.colspan=this.rowspan=w,t(h,
|
|
1150
|
-
"asciidoc")&&(Q=!0,r=d["$[]"]("cursor"));if(l(Q)){d=this.document.$attributes().$delete("doctitle");f=b.$split(p("LF"),-1);!l(f["$empty?"]())&&l((v=f["$[]"](0))["$include?"]("::"))&&(Q=p("PreprocessorReader").$new(this.document,[v]).$readlines(),t(v,Q["$[]"](0))&&l(e(Q.$size(),2))||(f.$shift(),l(Q["$empty?"]())||x(f,"unshift",D(Q))));this.inner_document=p("Document").$new(f,m(["standalone","parent","cursor"],{standalone:!1,parent:this.document,cursor:r}));if(!l(d["$nil?"]()))this.document.$attributes()["$[]="]("doctitle",
|
|
1151
|
-
d);this.subs=w}else l(u)?(this.content_model="verbatim",this.subs=p("BASIC_SUBS")):(l(y)&&(l(f)?this.cursor=d["$[]"]("cursor"):this.$catalog_inline_anchor(b,d["$[]"]("cursor"))),this.content_model="simple",this.subs=p("NORMAL_SUBS"));this.text=b;return this.style=h},-3);h(b,"$reinitialize",function(a){if(l(a))this.reinitialize_args=w;else{if(l(this.reinitialize_args))return x(K(p("Table"),"Cell"),"new",D(this.reinitialize_args));this.style=this.attributes["$[]"]("style")}l(this.cursor)&&this.$catalog_inline_anchor();
|
|
1152
|
-
return this});h(b,"$catalog_inline_anchor",function(a,b){null==a&&(a=this.text);null==b&&(b=w);if(!l(b)){var c=[this.cursor,w];b=c[0];this.cursor=c[1];c}return l(a["$start_with?"]("[["))&&l(p("LeadingInlineAnchorRx")["$=~"](a))?p("Parser").$catalog_inline_anchor((c=E["~"])===w?w:c["$[]"](1),(c=E["~"])===w?w:c["$[]"](2),this,b,this.document):w},-1);h(b,"$text",function(){return this.$apply_subs(this.text,this.subs)});b.$attr_writer("text");h(b,"$content",function(){var a=w,b=w;return t(a=this.style,
|
|
1153
|
-
"asciidoc")?this.inner_document.$convert():l(this.text["$include?"](p("DOUBLE_LF")))?x(this.$text().$split(p("BlankLineRx")),"map",[],function fa(b){var c=null==fa.$$s?this:fa.$$s;null==b&&(b=w);return l(a)&&G(a,"header")?p("Inline").$new(c.$parent(),"quoted",b,m(["type"],{type:a})).$convert():b},{$$s:this}):l((b=this.$text())["$empty?"]())?[]:l(a)&&G(a,"header")?[p("Inline").$new(this.$parent(),"quoted",b,m(["type"],{type:a})).$convert()]:[b]});h(b,"$lines",function(){return this.text.$split(p("LF"))});
|
|
1154
|
-
h(b,"$source",u("text"));h(b,"$file",function(){var a;return l(a=this.source_location)?this.source_location.$file():a});h(b,"$lineno",function(){var a;return l(a=this.source_location)?this.source_location.$lineno():a});return h(b,"$to_s",function X(){var a=X.$$p||w,b=w;X.$$p=null;return""+n(this,g(this,"to_s",X,!1,!0),"to_s",[],a)+" - [text: "+this.text+", colspan: "+(l(b=this.colspan)?b:1)+", rowspan: "+(l(b=this.rowspan)?b:1)+", attributes: "+this.attributes+"]"})})(p("Table"),p("AbstractBlock"),
|
|
1155
|
-
k);return function(b,$super,c){b=d(b,$super,"ParserContext");c=[b].concat(c);var e=a.$r(c),g=b.$$prototype;g.delimiter=g.delimiter_rx=g.buffer=g.cellspecs=g.cell_open=g.format=g.start_cursor_data=g.reader=g.table=g.current_row=g.colcount=g.column_visits=g.active_rowspans=g.linenum=w;b.$include(e("Logging"));f(c[0],"FORMATS",["psv","csv","dsv","tsv"].$to_set());f(c[0],"DELIMITERS",m(["psv","csv","dsv","tsv","!sv"],{psv:["|",/\|/],csv:[",",/,/],dsv:[":",/:/],tsv:["\t",/\t/],"!sv":["!",/!/]}));b.$attr_accessor("table");
|
|
1156
|
-
b.$attr_accessor("format");b.$attr_reader("colcount");b.$attr_accessor("buffer");b.$attr_reader("delimiter");b.$attr_reader("delimiter_re");h(b,"$initialize",function(a,b,c){var d;null==c&&(c=m([],{}));this.start_cursor_data=(this.reader=a).$mark();this.table=b;l(c["$key?"]("format"))?l(e("FORMATS")["$include?"](d=c["$[]"]("format")))?t(d,"tsv")?this.format="csv":t(this.format=d,"psv")&&l(b.$document()["$nested?"]())&&(d="!sv"):(this.$logger().$error(this.$message_with_context("illegal table format: "+
|
|
1157
|
-
d,m(["source_location"],{source_location:a.$cursor_at_prev_line()}))),a=["psv",l(b.$document()["$nested?"]())?"!sv":"psv"],this.format=a[0],d=a[1],a):(a=["psv",l(b.$document()["$nested?"]())?"!sv":"psv"],this.format=a[0],d=a[1],a);l(c["$key?"]("separator"))?l((c=c["$[]"]("separator"))["$nil_or_empty?"]())?(d=e("DELIMITERS")["$[]"](d),a=I(d),this.delimiter=null==a[0]?w:a[0],this.delimiter_rx=null==a[1]?w:a[1],d):t(c,"\\t")?(d=e("DELIMITERS")["$[]"]("tsv"),a=I(d),this.delimiter=null==a[0]?w:a[0],this.delimiter_rx=
|
|
1158
|
-
null==a[1]?w:a[1],d):(a=[c,r([K("Regexp").$escape(c)])],this.delimiter=a[0],this.delimiter_rx=a[1],a):(d=e("DELIMITERS")["$[]"](d),a=I(d),this.delimiter=null==a[0]?w:a[0],this.delimiter_rx=null==a[1]?w:a[1],d);this.colcount=l(b.$columns()["$empty?"]())?-1:b.$columns().$size();this.buffer="";this.cellspecs=[];this.cell_open=!1;this.active_rowspans=[0];this.column_visits=0;this.current_row=[];return this.linenum=-1},-3);h(b,"$starts_with_delimiter?",function(a){return a["$start_with?"](this.delimiter)});
|
|
1159
|
-
h(b,"$match_delimiter",function(a){return this.delimiter_rx.$match(a)});h(b,"$skip_past_delimiter",function(a){this.buffer=""+this.buffer+a+this.delimiter;return w});h(b,"$skip_past_escaped_delimiter",function(a){this.buffer=""+this.buffer+a.$chop()+this.delimiter;return w});h(b,"$buffer_has_unclosed_quotes?",function(a,b){var c,d;null==a&&(a=w);null==b&&(b='"');if(t(a=l(a)?z(this.buffer,a).$strip():this.buffer.$strip(),b))return!0;if(l(a["$start_with?"](b))){var e=z(b,b);return l(c=a["$end_with?"](b))&&
|
|
1160
|
-
l(a["$end_with?"](e))||l(a["$start_with?"](e))?l(d=(a=a.$gsub(e,""))["$start_with?"](b))?a["$end_with?"](b)["$!"]():d:c["$!"]()}return!1},-1);h(b,"$take_cellspec",function(){return this.cellspecs.$shift()});h(b,"$push_cellspec",function(a){var b=w;null==a&&(a=m([],{}));this.cellspecs["$<<"](l(b=a)?b:m([],{}));return w},-1);h(b,"$keep_cell_open",function(){this.cell_open=!0;return w});h(b,"$mark_cell_closed",function(){this.cell_open=!1;return w});h(b,"$cell_open?",u("cell_open"));h(b,"$cell_closed?",
|
|
1161
|
-
function(){return this.cell_open["$!"]()});h(b,"$close_open_cell",function(a){null==a&&(a=m([],{}));this.$push_cellspec(a);l(this["$cell_open?"]())&&this.$close_cell(!0);this.$advance();return w},-1);h(b,"$close_cell",function(a){try{var b=L("return"),c=w,d=w,f=w,g=w,h=w;null==a&&(a=!1);t(this.format,"psv")?(c=this.buffer,this.buffer="",l(d=this.$take_cellspec())?f=l(g=d.$delete("repeatcol"))?g:1:(this.$logger().$error(this.$message_with_context("table missing leading separator; recovering automatically",
|
|
1162
|
-
m(["source_location"],{source_location:x(K(e("Reader"),"Cursor"),"new",D(this.start_cursor_data))}))),d=m([],{}),f=1)):(c=this.buffer.$strip(),this.buffer="",d=w,f=1,t(this.format,"csv")&&J(c["$empty?"]())&&l(c["$include?"](h='"'))&&(l(c["$start_with?"](h))&&l(c["$end_with?"](h))?l(c=c.$slice(1,A(c.$length(),2)))?c=c.$strip().$squeeze(h):(this.$logger().$error(this.$message_with_context("unclosed quote in CSV data; setting cell to empty",m(["source_location"],{source_location:this.reader.$cursor_at_prev_line()}))),
|
|
1163
|
-
c=""):c=c.$squeeze(h)));x(1,"upto",[f],function va(h){var k=null==va.$$s?this:va.$$s,p=w,n=w,r=w;p=w;null==k.colcount&&(k.colcount=w);null==k.table&&(k.table=w);null==k.current_row&&(k.current_row=w);null==k.reader&&(k.reader=w);null==k.column_visits&&(k.column_visits=w);null==k.linenum&&(k.linenum=w);null==h&&(h=w);t(k.colcount,-1)?(k.table.$columns()["$<<"](p=K(e("Table"),"Column").$new(k.table,A(z(k.table.$columns().$size(),h),1))),l(d)&&l(d["$key?"]("colspan"))&&l(q(n=A(d["$[]"]("colspan").$to_i(),
|
|
1164
|
-
1),0))&&(r=k.table.$columns().$size(),x(n,"times",[],function ya(a){var b=null==ya.$$s?this:ya.$$s;null==b.table&&(b.table=w);null==a&&(a=w);return b.table.$columns()["$<<"](K(e("Table"),"Column").$new(b.table,z(r,a)))},{$$s:k}))):l(p=k.table.$columns()["$[]"](k.current_row.$size()))||(k.$logger().$error(k.$message_with_context("dropping cell because it exceeds specified number of columns",m(["source_location"],{source_location:k.reader.$cursor_before_mark()}))),b.$throw());p=K(e("Table"),"Cell").$new(p,
|
|
1165
|
-
c,d,m(["cursor"],{cursor:k.reader.$cursor_before_mark()}));k.reader.$mark();J(p.$rowspan())||t(p.$rowspan(),1)||k.$activate_rowspan(p.$rowspan(),l(g=p.$colspan())?g:1);k.column_visits=z(k.column_visits,l(g=p.$colspan())?g:1);k.current_row["$<<"](p);return l(k["$end_of_row?"]())&&(G(k.colcount,-1)||l(q(k.linenum,0))||l(a)&&t(h,f))?k.$close_row():w},{$$s:this,$$ret:b});this.cell_open=!1;return w}catch(oa){if(oa===b)return oa.$v;throw oa;}},-1);b.$private();h(b,"$close_row",function(){var a;this.table.$rows().$body()["$<<"](this.current_row);
|
|
1166
|
-
t(this.colcount,-1)&&(this.colcount=this.column_visits);this.column_visits=0;this.current_row=[];this.active_rowspans.$shift();if(l(a=this.active_rowspans["$[]"](0)))a;else this.active_rowspans["$[]="](0,0);return w});h(b,"$activate_rowspan",function(a,b){x(1,"upto",[A(a,1)],function sa(a){var c,d=null==sa.$$s?this:sa.$$s,e=w;null==d.active_rowspans&&(d.active_rowspans=w);null==a&&(a=w);return c=[a,z(l(e=d.active_rowspans["$[]"](a))?e:0,b)],x(d.active_rowspans,"[]=",c),c[c.length-1]},{$$s:this});
|
|
1167
|
-
return w});h(b,"$end_of_row?",function(){var a;return l(a=this.colcount["$=="](-1))?a:this.$effective_column_visits()["$=="](this.colcount)});h(b,"$effective_column_visits",function(){return z(this.column_visits,this.active_rowspans["$[]"](0))});return h(b,"$advance",function(){return this.linenum=z(this.linenum,1)})}(p("Table"),null,k)}(C[0],C)};Opal.modules["asciidoctor/writer"]=function(a){var b=a.module,d=a.truthy,f=a.rb_plus,h=a.hash2,c=a.def,m=a.return_val,n=[],g=a.nil,l=a.$$$;a.add_stubs("respond_to?,write,+,chomp,include");
|
|
1168
|
-
return function(e,k){e=[b(e,"Asciidoctor")].concat(k);(function(e,k){e=b(e,"Writer");k=[e].concat(k);var m=a.$r(k);return c(e,"$write",function(a,b){d(b["$respond_to?"]("write"))?b.$write(f(a.$chomp(),m("LF"))):l("File").$write(b,a,h(["mode"],{mode:m("FILE_WRITE_MODE")}));return g})})(e[0],e);return function(d,e){d=b(d,"VoidWriter");e=[d].concat(e);e=a.$r(e);d.$include(e("Writer"));return c(d,"$write",m(g))}(e[0],e)}(n[0],n)};Opal.modules["asciidoctor/load"]=function(a){var b=a.module,d=a.hash2,f=
|
|
1169
|
-
a.truthy,h=a.neqeq,c=a.not,m=a.eqeqeq,n=a.send,g=a.to_ary,l=a.rb_plus,e=a.eqeq,q=a.def,t=[],y=a.nil,v=a.$$$;a.add_stubs("merge,[],start,!=,logger,key?,logger=,new,!,===,dup,tap,each,partition,[]=,split,gsub,+,respond_to?,keys,raise,join,ancestors,class,==,at,to_i,mtime,absolute_path,path,dirname,basename,extname,read,rewind,drop,record,parse,exception,message,set_backtrace,backtrace,stack_trace=,stack_trace,open,load");return function(k,p){k=b(k,"Asciidoctor");p=[k].concat(p);return function(b,k){k=
|
|
1170
|
-
[b].concat(k);var p=a.$r(k);q(b,"$load",function(b,k){var q,t,r,x=y,z=y,C=y,w=y,A=y,B=y,F=y,D=y,E=y,G=y;null==k&&(k=d([],{}));try{k=k.$merge();f(x=k["$[]"]("timings"))&&x.$start("read");if(f(k["$key?"]("logger"))&&h(z=k["$[]"]("logger"),p("LoggerManager").$logger()))p("LoggerManager")["$logger="](f(C=z)?C:p("NullLogger").$new());c(w=k["$[]"]("attributes"))?w=d([],{}):m(v("Hash"),w)?w=w.$merge():f((t=v("::","Java","skip_raise"))&&(q=v(t,"JavaUtil","skip_raise"))&&v(q,"Map","skip_raise")?"constant":
|
|
1171
|
-
y)&&m(v(v(v("Java"),"JavaUtil"),"Map"),w)?w=w.$dup():m(v("Array"),w)?w=n(d([],{}),"tap",[],function(a){null==a&&(a=y);return n(w,"each",[],function(b){null==b&&(b=y);var c=b.$partition("=");b=g(c);var d=null==b[0]?y:b[0];var e=null==b[2]?y:b[2];c;return b=[d,e],n(a,"[]=",b),b[b.length-1]})}):m(v("String"),w)?w=n(d([],{}),"tap",[],function(a){null==a&&(a=y);return n(w.$gsub(p("SpaceDelimiterRx"),l("\\1",p("NULL"))).$gsub(p("EscapedSpaceRx"),"\\1").$split(p("NULL")),"each",[],function(b){null==b&&(b=
|
|
1172
|
-
y);var c=b.$partition("=");b=g(c);var d=null==b[0]?y:b[0];var e=null==b[2]?y:b[2];c;return b=[d,e],n(a,"[]=",b),b[b.length-1]})}):f(w["$respond_to?"]("keys"))&&f(w["$respond_to?"]("[]"))?w=n(d([],{}),"tap",[],function(a){null==a&&(a=y);return n(w.$keys(),"each",[],function(b){var c;null==b&&(b=y);return c=[b,w["$[]"](b)],n(a,"[]=",c),c[c.length-1]})}):this.$raise(v("ArgumentError"),"illegal type for attributes option: "+w.$class().$ancestors().$join(" < "));if(m(v("File"),b))k["$[]="]("input_mtime",
|
|
1173
|
-
e(p("RUBY_ENGINE"),"jruby")?v("Time").$at(b.$mtime().$to_i()):b.$mtime()),w["$[]="]("docfile",A=v("File").$absolute_path(b.$path())),w["$[]="]("docdir",v("File").$dirname(A)),w["$[]="]("docname",p("Helpers").$basename(A,(r=["docfilesuffix",p("Helpers").$extname(A)],n(w,"[]=",r),r[r.length-1]))),B=b.$read();else if(f(b["$respond_to?"]("read"))){try{b.$rewind()}catch(ca){if(a.rescue(ca,[p("StandardError")]))try{y}finally{a.pop_exception()}else throw ca;}B=b.$read()}else m(v("String"),b)?B=b:m(v("Array"),
|
|
1174
|
-
b)?B=b.$drop(0):f(b)&&this.$raise(v("ArgumentError"),"unsupported input type: "+b.$class());f(x)&&(x.$record("read"),x.$start("parse"));k["$[]="]("attributes",w);F=e(k["$[]"]("parse"),!1)?p("Document").$new(B,k):p("Document").$new(B,k).$parse();f(x)&&x.$record("parse");return F}catch(ca){if(a.rescue(ca,[p("StandardError")])){D=ca;try{try{E="asciidoctor: FAILED: "+(f(C=w["$[]"]("docfile"))?C:"<stdin>")+": Failed to load AsciiDoc document",f(D["$respond_to?"]("exception"))?(G=D.$exception(""+E+" - "+
|
|
1175
|
-
D.$message()),G.$set_backtrace(D.$backtrace())):(G=D.$class().$new(E,D),G["$stack_trace="](D.$stack_trace()))}catch(xa){if(a.rescue(xa,[p("StandardError")]))try{G=D}finally{a.pop_exception()}else throw xa;}return this.$raise(G)}finally{a.pop_exception()}}else throw ca;}},-2);return q(b,"$load_file",function(a,b){null==b&&(b=d([],{}));return n(v("File"),"open",[a,p("FILE_READ_MODE")],function r(a){var c=null==r.$$s?this:r.$$s;null==a&&(a=y);return c.$load(a,b)},{$$s:this})},-2)}(a.get_singleton_class(k),
|
|
1176
|
-
p)}(t[0],t)};Opal.modules["asciidoctor/convert"]=function(a){var b=a.module,d=a.hash2,f=a.eqeqeq,h=a.truthy,c=a.eqeq,m=a.rb_ge,n=a.not,g=a.rb_lt,l=a.neqeq,e=a.def,q=a.send,t=a.alias,y=[],v=a.nil,x=a.$$$;a.add_stubs("delete,merge,===,absolute_path,path,load,respond_to?,[]=,key?,fetch,[],dirname,expand_path,join,attributes,outfilesuffix,==,raise,pwd,>=,safe,normalize_system_path,mkdir_p,directory?,!,convert,write,attr,uriish?,basebackend?,attr?,<,include?,syntax_highlighter,write_stylesheet?,write_primary_stylesheet,instance,to_s,read_asset,file?,!=,write_stylesheet,open,convert_file");
|
|
1177
|
-
return function(k,p){k=b(k,"Asciidoctor");p=[k].concat(p);return function(b,k){k=[b].concat(k);var p=a.$r(k);e(b,"$convert",function(a,b){var e=v,k,q=v,u=v,t=v,w=v,y=v,z=v,A,B=v,D=v,F=v,E=v,G=v,O=v;null==b&&(b=d([],{}));(b=b.$merge()).$delete("parse");var Q=b.$delete("to_dir");var X=b.$delete("mkdirs");if(f(!0,e=k=b.$delete("to_file"))||f(v,e))h(q=Q)||f(x("File"),a)&&(u=x("File").$absolute_path(a.$path())),k=v;else if(f(!1,e))k=v;else{if(f("/dev/null",e))return this.$load(a,b);if(!h(t=k["$respond_to?"]("write")))b["$[]="]("to_file",
|
|
1178
|
-
q=k)}if(!h(b["$key?"]("standalone")))if(h(u)||h(q))b["$[]="]("standalone",b.$fetch("header_footer",!0));else if(h(b["$key?"]("header_footer")))b["$[]="]("standalone",b["$[]"]("header_footer"));if(h(u))b["$[]="]("to_dir",w=x("File").$dirname(u));else if(h(q))if(h(Q))if(h(k))b["$[]="]("to_dir",x("File").$dirname(x("File").$expand_path(k,Q)));else b["$[]="]("to_dir",x("File").$expand_path(Q));else if(h(k))b["$[]="]("to_dir",x("File").$dirname(x("File").$expand_path(k)));var V=this.$load(a,b);h(u)?(y=
|
|
1179
|
-
x("File").$join(w,""+V.$attributes()["$[]"]("docname")+V.$outfilesuffix()),c(y,u)&&this.$raise(x("IOError"),"input file and output file cannot be the same: "+y)):h(q)?(b=h(b["$key?"]("base_dir"))?x("File").$expand_path(b["$[]"]("base_dir")):x("Dir").$pwd(),q=h(m(V.$safe(),x(p("SafeMode"),"SAFE")))?b:v,h(Q)?(w=V.$normalize_system_path(Q,b,q,d(["target_name","recover"],{target_name:"to_dir",recover:!1})),h(k)?(y=V.$normalize_system_path(k,w,v,d(["target_name","recover"],{target_name:"to_dir",recover:!1})),
|
|
1180
|
-
w=x("File").$dirname(y)):y=x("File").$join(w,""+V.$attributes()["$[]"]("docname")+V.$outfilesuffix())):h(k)&&(y=V.$normalize_system_path(k,b,q,d(["target_name","recover"],{target_name:"to_dir",recover:!1})),w=x("File").$dirname(y)),f(x("File"),a)&&c(y,x("File").$absolute_path(a.$path()))&&this.$raise(x("IOError"),"input file and output file cannot be the same: "+y),h(X)?p("Helpers").$mkdir_p(w):h(x("File")["$directory?"](w))||this.$raise(x("IOError"),"target directory does not exist: "+Q+" (hint: set :mkdirs option)")):
|
|
1181
|
-
(y=k,w=v);a=h(y)&&n(t)?V.$convert(d(["outfile","outdir"],{outfile:y,outdir:w})):V.$convert();return h(y)?(V.$write(a,y),n(t)&&h(g(V.$safe(),x(p("SafeMode"),"SECURE")))&&h(V["$attr?"]("linkcss"))&&h(V["$attr?"]("copycss"))&&h(V["$basebackend?"]("html"))&&n(h(e=z=V.$attr("stylesdir"))?p("Helpers")["$uriish?"](z):e)&&(h(A=V.$attr("stylesheet"))&&(h(p("DEFAULT_STYLESHEET_KEYS")["$include?"](A))?B=!0:n(p("Helpers")["$uriish?"](A))&&(D=!0)),t=h(e=F=V.$syntax_highlighter())?F["$write_stylesheet?"](V):e,
|
|
1182
|
-
h(B)||h(D)||h(t))&&(e=V.$normalize_system_path(z,w,h(m(V.$safe(),x(p("SafeMode"),"SAFE")))?w:v),h(X)?p("Helpers").$mkdir_p(e):h(x("File")["$directory?"](e))||this.$raise(x("IOError"),"target stylesheet directory does not exist: "+e+" (hint: set :mkdirs option)"),h(B)?p("Stylesheets").$instance().$write_primary_stylesheet(e):h(D)&&(E=c(E=V.$attr("copycss"),"")||c(E,!0)?V.$normalize_system_path(A):V.$normalize_system_path(E.$to_s()),w=V.$normalize_system_path(A,e,h(m(V.$safe(),x(p("SafeMode"),"SAFE")))?
|
|
1183
|
-
w:v),l(E,w)&&h(G=V.$read_asset(E,d(["warn_on_failure","label"],{warn_on_failure:x("File")["$file?"](w)["$!"](),label:"stylesheet"})))&&(l(O=x("File").$dirname(w),e)&&n(x("File")["$directory?"](O))&&(h(X)?p("Helpers").$mkdir_p(O):this.$raise(x("IOError"),"target stylesheet directory does not exist: "+O+" (hint: set :mkdirs option)")),x("File").$write(w,G,d(["mode"],{mode:p("FILE_WRITE_MODE")})))),h(t)&&F.$write_stylesheet(V,e)),V):a},-2);e(b,"$convert_file",function(a,b){null==b&&(b=d([],{}));return q(x("File"),
|
|
1184
|
-
"open",[a,p("FILE_READ_MODE")],function pa(a){var c=null==pa.$$s?this:pa.$$s;null==a&&(a=v);return c.$convert(a,b)},{$$s:this})},-2);t(b,"render","convert");return t(b,"render_file","convert_file")}(a.get_singleton_class(k),p)}(y[0],y)};Opal.modules["asciidoctor/syntax_highlighter/highlightjs"]=function(a){var b=a.module,d=a.klass,f=a.slice,h=a.send2,c=a.find_super,m=a.to_a,n=a.def,g=a.hash2,l=a.send,e=a.truthy,q=a.return_val,t=a.eqeq,y=[],v=a.nil,x=a.$$$;a.add_stubs("register_for,merge,proc,[]=,attr,[],==,attr?,join,map,split,lstrip");
|
|
1185
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);p=a.$r(k);return function(b,$super,k){b=d(b,$super,"HighlightJsAdapter");k=[b].concat(k);var p=a.$r(k);b.$register_for("highlightjs","highlight.js");n(b,"$initialize",function r(a){var b=r.$$p||v;r.$$p=null;var d=f(arguments);h(this,c(this,"initialize",r,!1,!0),"initialize",m(d),b);return this.name=this.pre_class="highlightjs"},-1);n(b,"$format",function C(a,b,d){C.$$p=null;return h(this,c(this,"format",C,!1,!0),"format",[a,b,d.$merge(g(["transform"],
|
|
1186
|
-
{transform:l(this,"proc",[],function(a,c){var d;a=v;null==c&&(c=v);return d=["class","language-"+(e(a=b)?a:"none")+" hljs"],l(c,"[]=",d),d[d.length-1]})}))],null)});n(b,"$docinfo?",q(!0));return n(b,"$docinfo",function(a,b,c){var d=v;d=b.$attr("highlightjsdir",""+c["$[]"]("cdn_base_url")+"/highlight.js/"+p("HIGHLIGHT_JS_VERSION"));return t(a,"head")?'<link rel="stylesheet" href="'+d+"/styles/"+b.$attr("highlightjs-theme","github")+'.min.css"'+c["$[]"]("self_closing_tag_slash")+">":'<script src="'+
|
|
1187
|
-
d+'/highlight.min.js">\x3c/script>\n'+(e(b["$attr?"]("highlightjs-languages"))?l(b.$attr("highlightjs-languages").$split(","),"map",[],function(a){null==a&&(a=v);return'<script src="'+d+"/languages/"+a.$lstrip()+'.min.js">\x3c/script>\n'}).$join():"")+"<script>\nif (!hljs.initHighlighting.called) {\n hljs.initHighlighting.called = true\n ;[].slice.call(document.querySelectorAll('pre.highlight > code[data-lang]')).forEach(function (el) { hljs.highlightBlock(el) })\n}\n\x3c/script>"})}(p("SyntaxHighlighter"),
|
|
1188
|
-
x(p("SyntaxHighlighter"),"Base"),k)}(y[0],y)};Opal.modules["asciidoctor/syntax_highlighter"]=function(a){var b=a.module,d=a.hash2,f=a.def,h=a.return_val,c=a.defs,m=a.slice,n=a.send,g=a.to_a,l=a.truthy,e=a.eqeqeq,q=a.Class,t=a.klass,y=a.class_variable_set,v=a.class_variable_get,x=a.top,z=[],A=a.nil,B=a.$$$;a.add_stubs("attr_reader,raise,class,extend,private_class_method,register,map,to_s,each,[]=,registry,[],for,===,new,name,private,include,delete,join,content");(function(k,p){k=[b(k,"Asciidoctor")].concat(p);
|
|
1189
|
-
return function(k,p){k=b(k,"SyntaxHighlighter");p=[k].concat(p);var u=a.$r(p);k.$attr_reader("name");f(k,"$initialize",function(a,b,c){null==c&&d([],{});return this.name=this.pre_class=a},-2);f(k,"$docinfo?",h(A));f(k,"$docinfo",function(a,b,c){return this.$raise(B("NotImplementedError"),""+u("SyntaxHighlighter")+" subclass "+this.$class()+" must implement the #docinfo method since #docinfo? returns true")});f(k,"$highlight?",h(A));f(k,"$highlight",function(a,b,c,d){return this.$raise(B("NotImplementedError"),
|
|
1190
|
-
""+u("SyntaxHighlighter")+" subclass "+this.$class()+" must implement the #highlight method since #highlight? returns true")});f(k,"$format",function(a,b,c){return this.$raise(B("NotImplementedError"),""+u("SyntaxHighlighter")+" subclass "+this.$class()+" must implement the #format method")});f(k,"$write_stylesheet?",h(A));f(k,"$write_stylesheet",function(a,b){return this.$raise(B("NotImplementedError"),""+u("SyntaxHighlighter")+" subclass "+this.$class()+" must implement the #write_stylesheet method since #write_stylesheet? returns true")});
|
|
1191
|
-
c(k,"$included",function(a){return a.$extend(u("Config"))});k.$private_class_method("included");(function(c,d){c=b(c,"Config");d=[c].concat(d);var e=a.$r(d);return f(c,"$register_for",function(a){var b=m(arguments);return n(e("SyntaxHighlighter"),"register",[this].concat(g(n(b,"map",[],function(a){null==a&&(a=A);return a.$to_s()}))))},-1)})(p[0],p);(function(c,g){c=b(c,"Factory");g=[c].concat(g);var k=a.$r(g);f(c,"$register",function(a,b){var c=m(arguments,1);return n(c,"each",[],function aa(b){var c,
|
|
1192
|
-
d=null==aa.$$s?this:aa.$$s;null==b&&(b=A);return c=[b,a],n(d.$registry(),"[]=",c),c[c.length-1]},{$$s:this})},-2);f(c,"$for",function(a){return this.$registry()["$[]"](a)});f(c,"$create",function(a,b,c){var f;null==b&&(b="html5");null==c&&(c=d([],{}));return l(f=this.$for(a))?(e(q,f)&&(f=f.$new(a,b,c)),l(f.$name())||this.$raise(B("NameError"),""+f.$class()+" must specify a value for `name'"),f):A},-2);c.$private();return f(c,"$registry",function(){return this.$raise(B("NotImplementedError"),""+k("Factory")+
|
|
1193
|
-
" subclass "+this.$class()+" must implement the #registry method")})})(p[0],p);(function(b,$super,c){b=t(b,$super,"CustomFactory");c=[b].concat(c);c=a.$r(c);b.$include(c("Factory"));f(b,"$initialize",function(a){var b=A;null==a&&(a=A);return this.registry=l(b=a)?b:d([],{})},-1);b.$private();return b.$attr_reader("registry")})(p[0],null,p);(function(c,e){c=b(c,"DefaultFactory");var g=[c].concat(e);e=a.$r(g);c.$include(e("Factory"));y(g[0],"@@registry",d([],{}));c.$private();f(c,"$registry",function(){return v(g[0],
|
|
1194
|
-
"@@registry",!1)});return A})(p[0],p);(function(b,$super,c){b=t(b,$super,"DefaultFactoryProxy");c=[b].concat(c);c=a.$r(c);b.$include(c("DefaultFactory"));return A})(p[0],u("CustomFactory"),p);(function(b,$super,c){b=t(b,$super,"Base");c=[b].concat(c);c=a.$r(c);b.$$prototype.pre_class=A;b.$include(c("SyntaxHighlighter"));return f(b,"$format",function(a,b,c){var e=A,f=A;f=e=A;e=l(c["$[]"]("nowrap"))?""+this.pre_class+" highlight nowrap":""+this.pre_class+" highlight";if(l(f=c["$[]"]("transform"))){f["$[]"](e=
|
|
1195
|
-
d(["class"],{"class":e}),f=l(b)?d(["data-lang"],{"data-lang":b}):d([],{}));if(l(b=f.$delete("data-lang")))f["$[]="]("data-lang",b);return"<pre"+n(e,"map",[],function(a,b){null==a&&(a=A);null==b&&(b=A);return" "+a+'="'+b+'"'}).$join()+"><code"+n(f,"map",[],function(a,b){null==a&&(a=A);null==b&&(b=A);return" "+a+'="'+b+'"'}).$join()+">"+a.$content()+"</code></pre>"}return'<pre class="'+e+'"><code'+(l(b)?' data-lang="'+b+'"':"")+">"+a.$content()+"</code></pre>"})})(p[0],null,p);return k.$extend(u("DefaultFactory"))}(k[0],
|
|
1196
|
-
k)})(z[0],z);x.$require("asciidoctor/syntax_highlighter.rb/../syntax_highlighter/highlightjs");return A};Opal.modules["asciidoctor/timings"]=function(a){var b=a.module,d=a.klass,f=a.hash2,h=a.def,c=a.send,m=a.rb_minus,n=a.slice,g=a.rb_plus,l=a.truthy,e=a.rb_gt,q=a.gvars,t=a.eqeq,y=a.const_set,v=[],x=a.nil,z=a.$$$;a.add_stubs("[]=,now,-,delete,reduce,+,[],>,time,puts,sprintf,to_f,read_parse,convert,read_parse_convert,private,==,const_defined?,clock_gettime");return function(k,p){k=[b(k,"Asciidoctor")].concat(p);
|
|
1197
|
-
return function(b,$super,k){b=d(b,$super,"Timings");var p,v,r,A;k=[b].concat(k);var B=a.$r(k),C=b.$$prototype;C.timers=C.log=x;h(b,"$initialize",function(){this.log=f([],{});return this.timers=f([],{})});h(b,"$start",function(a){var b;return b=[a,this.$now()],c(this.timers,"[]=",b),b[b.length-1]});h(b,"$record",function(a){var b;return b=[a,m(this.$now(),this.timers.$delete(a))],c(this.log,"[]=",b),b[b.length-1]});h(b,"$time",function(a){var b=x;b=n(arguments);b=c(b,"reduce",[0],function qa(a,b){var c=
|
|
1198
|
-
null==qa.$$s?this:qa.$$s,d=x;null==c.log&&(c.log=x);null==a&&(a=x);null==b&&(b=x);return g(a,l(d=c.log["$[]"](b))?d:0)},{$$s:this});return l(e(b,0))?b:x},-1);h(b,"$read",function(){return this.$time("read")});h(b,"$parse",function(){return this.$time("parse")});h(b,"$read_parse",function(){return this.$time("read","parse")});h(b,"$convert",function(){return this.$time("convert")});h(b,"$read_parse_convert",function(){return this.$time("read","parse","convert")});h(b,"$write",function(){return this.$time("write")});
|
|
1199
|
-
h(b,"$total",function(){return this.$time("read","parse","convert","write")});h(b,"$print_report",function(a,b){null==q.stdout&&(q.stdout=x);null==a&&(a=q.stdout);null==b&&(b=x);l(b)&&a.$puts("Input file: "+b);a.$puts(" Time to read and parse source: "+this.$sprintf("%05.5f",this.$read_parse().$to_f()));a.$puts(" Time to convert document: "+this.$sprintf("%05.5f",this.$convert().$to_f()));return a.$puts(" Total time (read, parse and convert): "+this.$sprintf("%05.5f",this.$read_parse_convert().$to_f()))},
|
|
1200
|
-
-1);b.$private();return l(z("Process")["$const_defined?"]("CLOCK_MONOTONIC",!1))&&t((p=z("::","Process","skip_raise"))&&(v=p,v)&&(r=v)&&((A=r.$clock_gettime)&&!A.$$stub||r["$respond_to_missing?"]("clock_gettime"))?"method":x,"method")?(y(k[0],"CLOCK_ID",z(z("Process"),"CLOCK_MONOTONIC")),h(b,"$now",function(){return z("Process").$clock_gettime(B("CLOCK_ID"))})):h(b,"$now",function(){return z("Time").$now()})}(k[0],null,k)}(v[0],v)};Opal.modules["asciidoctor/converter/html5"]=function(a){var b=a.module,
|
|
1201
|
-
d=a.klass,f=a.const_set,h=a.hash2,c=a.regexp,m=a.eqeq,n=a.def,g=a.send2,l=a.find_super,e=a.truthy,q=a.send,t=a.rb_gt,v=a.rb_plus,x=a.not,z=a.neqeq,A=a.rb_le,B=a.rb_lt,D=a.to_ary,E=a.rb_times,G=a.rb_minus,I=a.gvars,u=a.return_val,J=a.alias,r=a.eqeqeq,K=a.slice,L=a.to_a,C=[],w=a.nil,M=a.$$$;a.add_stubs("register_for,default=,==,[],init_backend_traits,node_name,convert_inline_quoted,convert_paragraph,convert_inline_anchor,convert_section,convert_listing,convert_literal,convert_ulist,convert_olist,convert_dlist,convert_admonition,convert_colist,convert_embedded,convert_example,convert_floating_title,convert_image,convert_inline_break,convert_inline_button,convert_inline_callout,convert_inline_footnote,convert_inline_image,convert_inline_indexterm,convert_inline_kbd,convert_inline_menu,convert_open,convert_page_break,convert_preamble,convert_quote,convert_sidebar,convert_stem,convert_table,convert_thematic_break,convert_verse,convert_video,convert_document,convert_toc,convert_pass,convert_audio,empty?,attr,attr?,<<,include?,sub_replacements,gsub,extname,slice,length,doctitle,normalize_web_path,primary_stylesheet_data,instance,read_contents,syntax_highlighter,size,docinfo,id,sections?,doctype,role?,role,join,noheader,convert,converter,generate_manname_section,header?,notitle,title,header,each,authors,>,name,email,sub_macros,+,downcase,concat,content,!,footnotes?,footnotes,index,text,nofooter,docinfo?,[]=,delete_at,inspect,!=,to_i,attributes,document,sections,level,caption,captioned_title,<=,numbered,<,sectname,sectnum,convert_outline,title?,icon_uri,compact,media_uri,option?,append_boolean_attribute,style,items,blocks?,text?,chomp,safe,read_svg_contents,alt,image_uri,encode_attribute_value,append_link_constraint_attrs,highlight?,to_sym,format,*,-,count,end_with?,start_with?,list_marker_keyword,parent,warn,logger,context,error,content_only,new,columns,to_h,rows,colspan,rowspan,unshift,shift,split,pop,nil_or_empty?,type,===,catalog,get_root_document,xreftext,target,reftext,chop,sub,match,private,upcase,nested?,parent_document,handles?,to_s,send");
|
|
1202
|
-
return function(k,p){k=[b(k,"Asciidoctor")].concat(p);p=a.$r(k);return function(b,$super,k){b=d(b,$super,"Html5Converter");k=[b].concat(k);var p=a.$r(k),y=b.$$prototype;y.void_element_slash=y.xml_mode=y.refs=y.resolving_xref=w;b.$register_for("html5");f(k[0],"QUOTE_TAGS",h("monospaced emphasis strong double single mark superscript subscript asciimath latexmath".split(" "),{monospaced:["<code>","</code>",!0],emphasis:["<em>","</em>",!0],strong:["<strong>","</strong>",!0],"double":["“","”"],
|
|
1203
|
-
single:["‘","’"],mark:["<mark>","</mark>",!0],superscript:["<sup>","</sup>",!0],subscript:["<sub>","</sub>",!0],asciimath:["\\$","\\$"],latexmath:["\\(","\\)"]}))["$default="](["",""]);f(k[0],"DropAnchorRx",/<(?:a\b[^>]*|\/a)>/);f(k[0],"StemBreakRx",/ *\\\n(?:\\?\n)*|\n\n+/);f(k[0],"SvgPreambleRx",c(["^",p("CC_ALL"),"*?(?=<svg[\\s>])"]));f(k[0],"SvgStartTagRx",/^<svg(?:\s[^>]*)?>/);f(k[0],"DimensionAttributeRx",c(["\\s(?:width|height|style)=([\"'])",p("CC_ANY"),"*?\\1"]));n(b,"$initialize",
|
|
1204
|
-
function(a,b){null==b&&(b=h([],{}));this.backend=a;m(b["$[]"]("htmlsyntax"),"xml")?(a="xml",this.xml_mode=!0,this.void_element_slash="/"):(a="html",this.xml_mode=w,this.void_element_slash="");return this.$init_backend_traits(h(["basebackend","filetype","htmlsyntax","outfilesuffix","supports_templates"],{basebackend:"html",filetype:"html",htmlsyntax:a,outfilesuffix:".html",supports_templates:!0}))},-2);n(b,"$convert",function sa(a,b,c){var d=sa.$$p||w;sa.$$p=null;null==b&&(b=a.$node_name());null==
|
|
1205
|
-
c&&(c=w);switch(b){case "inline_quoted":return this.$convert_inline_quoted(a);case "paragraph":return this.$convert_paragraph(a);case "inline_anchor":return this.$convert_inline_anchor(a);case "section":return this.$convert_section(a);case "listing":return this.$convert_listing(a);case "literal":return this.$convert_literal(a);case "ulist":return this.$convert_ulist(a);case "olist":return this.$convert_olist(a);case "dlist":return this.$convert_dlist(a);case "admonition":return this.$convert_admonition(a);
|
|
1206
|
-
case "colist":return this.$convert_colist(a);case "embedded":return this.$convert_embedded(a);case "example":return this.$convert_example(a);case "floating_title":return this.$convert_floating_title(a);case "image":return this.$convert_image(a);case "inline_break":return this.$convert_inline_break(a);case "inline_button":return this.$convert_inline_button(a);case "inline_callout":return this.$convert_inline_callout(a);case "inline_footnote":return this.$convert_inline_footnote(a);case "inline_image":return this.$convert_inline_image(a);
|
|
1207
|
-
case "inline_indexterm":return this.$convert_inline_indexterm(a);case "inline_kbd":return this.$convert_inline_kbd(a);case "inline_menu":return this.$convert_inline_menu(a);case "open":return this.$convert_open(a);case "page_break":return this.$convert_page_break(a);case "preamble":return this.$convert_preamble(a);case "quote":return this.$convert_quote(a);case "sidebar":return this.$convert_sidebar(a);case "stem":return this.$convert_stem(a);case "table":return this.$convert_table(a);case "thematic_break":return this.$convert_thematic_break(a);
|
|
1208
|
-
case "verse":return this.$convert_verse(a);case "video":return this.$convert_video(a);case "document":return this.$convert_document(a);case "toc":return this.$convert_toc(a);case "pass":return this.$convert_pass(a);case "audio":return this.$convert_audio(a);default:return g(this,l(this,"convert",sa,!1,!0),"convert",[a,b,c],d)}},-2);n(b,"$convert_document",function(a){var b=w,c=w,d=w,f=w,g=w,k=w,l=w,n=w,r=w,u=n=w,Q=w,y=n=n=n=w,z=w,A=u=z=w,B=w,C=w,D=w;c=c=w;b="<br"+(c=this.void_element_slash)+">";e((d=
|
|
1209
|
-
a.$attr("asset-uri-scheme","https"))["$empty?"]())||(d=""+d+":");f=""+d+"//cdnjs.cloudflare.com/ajax/libs";g=a["$attr?"]("linkcss");k=e(a["$attr?"]("max-width"))?' style="max-width: '+a.$attr("max-width")+';"':"";l=["<!DOCTYPE html>"];n=e(a["$attr?"]("nolang"))?"":' lang="'+a.$attr("lang","en")+'"';l["$<<"]("<html"+(e(this.xml_mode)?' xmlns="http://www.w3.org/1999/xhtml"':"")+n+">");l["$<<"]('<head>\n<meta charset="'+a.$attr("encoding","UTF-8")+'"'+c+'>\n<meta http-equiv="X-UA-Compatible" content="IE=edge"'+
|
|
1210
|
-
c+'>\n<meta name="viewport" content="width=device-width, initial-scale=1.0"'+c+'>\n<meta name="generator" content="Asciidoctor '+a.$attr("asciidoctor-version")+'"'+c+">");if(e(a["$attr?"]("app-name")))l["$<<"]('<meta name="application-name" content="'+a.$attr("app-name")+'"'+c+">");if(e(a["$attr?"]("description")))l["$<<"]('<meta name="description" content="'+a.$attr("description")+'"'+c+">");if(e(a["$attr?"]("keywords")))l["$<<"]('<meta name="keywords" content="'+a.$attr("keywords")+'"'+c+">");if(e(a["$attr?"]("authors")))l["$<<"]('<meta name="author" content="'+
|
|
1211
|
-
(e((r=a.$sub_replacements(a.$attr("authors")))["$include?"]("<"))?r.$gsub(p("XmlSanitizeRx"),""):r)+'"'+c+">");if(e(a["$attr?"]("copyright")))l["$<<"]('<meta name="copyright" content="'+a.$attr("copyright")+'"'+c+">");e(a["$attr?"]("favicon"))&&(e((n=a.$attr("favicon"))["$empty?"]())?(n="favicon.ico",u="image/x-icon"):u=e(Q=p("Helpers").$extname(n,w))?m(Q,".ico")?"image/x-icon":"image/"+Q.$slice(1,Q.$length()):"image/x-icon",l["$<<"]('<link rel="icon" type="'+u+'" href="'+n+'"'+c+">"));l["$<<"]("<title>"+
|
|
1212
|
-
a.$doctitle(h(["sanitize","use_fallback"],{sanitize:!0,use_fallback:!0}))+"</title>");if(e(p("DEFAULT_STYLESHEET_KEYS")["$include?"](a.$attr("stylesheet")))){if(e(n=a.$attr("webfonts")))l["$<<"]('<link rel="stylesheet" href="'+d+"//fonts.googleapis.com/css?family="+(e(n["$empty?"]())?"Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700":n)+'"'+c+">");if(e(g))l["$<<"]('<link rel="stylesheet" href="'+a.$normalize_web_path(p("DEFAULT_STYLESHEET_NAME"),
|
|
1213
|
-
a.$attr("stylesdir",""),!1)+'"'+c+">");else l["$<<"]("<style>\n"+p("Stylesheets").$instance().$primary_stylesheet_data()+"\n</style>")}else if(e(a["$attr?"]("stylesheet")))if(e(g))l["$<<"]('<link rel="stylesheet" href="'+a.$normalize_web_path(a.$attr("stylesheet"),a.$attr("stylesdir",""))+'"'+c+">");else l["$<<"]("<style>\n"+a.$read_contents(a.$attr("stylesheet"),h(["start","warn_on_failure","label"],{start:a.$attr("stylesdir"),warn_on_failure:!0,label:"stylesheet"}))+"\n</style>");if(e(a["$attr?"]("icons",
|
|
1214
|
-
"font")))if(e(a["$attr?"]("iconfont-remote")))l["$<<"]('<link rel="stylesheet" href="'+a.$attr("iconfont-cdn",""+f+"/font-awesome/"+p("FONT_AWESOME_VERSION")+"/css/font-awesome.min.css")+'"'+c+">");else n=""+a.$attr("iconfont-name","font-awesome")+".css",l["$<<"]('<link rel="stylesheet" href="'+a.$normalize_web_path(n,a.$attr("stylesdir",""),!1)+'"'+c+">");if(e(n=a.$syntax_highlighter()))l["$<<"](y=l.$size());if(!e((z=a.$docinfo())["$empty?"]()))l["$<<"](z);l["$<<"]("</head>");z=e(a.$id())?' id="'+
|
|
1215
|
-
a.$id()+'"':"";A=e(u=a["$sections?"]())&&e(a["$attr?"]("toc-class"))&&e(a["$attr?"]("toc"))&&e(a["$attr?"]("toc-placement","auto"))?[a.$doctype(),a.$attr("toc-class"),"toc-"+a.$attr("toc-position","header")]:[a.$doctype()];if(e(a["$role?"]()))A["$<<"](a.$role());l["$<<"]("<body"+z+' class="'+A.$join(" ")+'">');if(!e((z=a.$docinfo("header"))["$empty?"]()))l["$<<"](z);if(!e(a.$noheader())){l["$<<"]('<div id="header"'+k+">");if(m(a.$doctype(),"manpage")){l["$<<"]("<h1>"+a.$doctitle()+" Manual Page</h1>");
|
|
1216
|
-
if(e(u)&&e(a["$attr?"]("toc"))&&e(a["$attr?"]("toc-placement","auto")))l["$<<"]('<div id="toc" class="'+a.$attr("toc-class","toc")+'">\n<div id="toctitle">'+a.$attr("toc-title")+"</div>\n"+a.$converter().$convert(a,"outline")+"\n</div>");if(e(a["$attr?"]("manpurpose")))l["$<<"](this.$generate_manname_section(a))}else{if(e(a["$header?"]())){if(!e(a.$notitle()))l["$<<"]("<h1>"+a.$header().$title()+"</h1>");B=[];C=1;q(a.$authors(),"each",[],function(c){null==c&&(c=w);B["$<<"]('<span id="author'+(e(t(C,
|
|
1217
|
-
1))?C:"")+'" class="author">'+a.$sub_replacements(c.$name())+"</span>"+b);if(e(c.$email()))B["$<<"]('<span id="email'+(e(t(C,1))?C:"")+'" class="email">'+a.$sub_macros(c.$email())+"</span>"+b);return C=v(C,1)});if(e(a["$attr?"]("revnumber")))B["$<<"]('<span id="revnumber">'+(e(D=a.$attr("version-label"))?D:"").$downcase()+" "+a.$attr("revnumber")+(e(a["$attr?"]("revdate"))?",":"")+"</span>");if(e(a["$attr?"]("revdate")))B["$<<"]('<span id="revdate">'+a.$attr("revdate")+"</span>");if(e(a["$attr?"]("revremark")))B["$<<"](""+
|
|
1218
|
-
b+'<span id="revremark">'+a.$attr("revremark")+"</span>");e(B["$empty?"]())||(l["$<<"]('<div class="details">'),l.$concat(B),l["$<<"]("</div>"))}if(e(u)&&e(a["$attr?"]("toc"))&&e(a["$attr?"]("toc-placement","auto")))l["$<<"]('<div id="toc" class="'+a.$attr("toc-class","toc")+'">\n<div id="toctitle">'+a.$attr("toc-title")+"</div>\n"+a.$converter().$convert(a,"outline")+"\n</div>")}l["$<<"]("</div>")}l["$<<"]('<div id="content"'+k+">\n"+a.$content()+"\n</div>");e(a["$footnotes?"]())&&x(a["$attr?"]("nofootnotes"))&&
|
|
1219
|
-
(l["$<<"]('<div id="footnotes"'+k+">\n<hr"+c+">"),q(a.$footnotes(),"each",[],function(a){null==a&&(a=w);return l["$<<"]('<div class="footnote" id="_footnotedef_'+a.$index()+'">\n<a href="#_footnoteref_'+a.$index()+'">'+a.$index()+"</a>. "+a.$text()+"\n</div>")}),l["$<<"]("</div>"));if(!e(a.$nofooter())){l["$<<"]('<div id="footer"'+k+">");l["$<<"]('<div id="footer-text">');if(e(a["$attr?"]("revnumber")))l["$<<"](""+a.$attr("version-label")+" "+a.$attr("revnumber")+b);if(e(a["$attr?"]("last-update-label"))&&
|
|
1220
|
-
x(a["$attr?"]("reproducible")))l["$<<"](""+a.$attr("last-update-label")+" "+a.$attr("docdatetime"));l["$<<"]("</div>");l["$<<"]("</div>")}if(e(n)){if(e(n["$docinfo?"]("head")))l["$[]="](y,n.$docinfo("head",a,h(["cdn_base_url","linkcss","self_closing_tag_slash"],{cdn_base_url:f,linkcss:g,self_closing_tag_slash:c})));else l.$delete_at(y);if(e(n["$docinfo?"]("footer")))l["$<<"](n.$docinfo("footer",a,h(["cdn_base_url","linkcss","self_closing_tag_slash"],{cdn_base_url:f,linkcss:g,self_closing_tag_slash:c})))}e(a["$attr?"]("stem"))&&
|
|
1221
|
-
(c=a.$attr("eqnums","none"),e(c["$empty?"]())&&(c="AMS"),c=' equationNumbers: { autoNumber: "'+c+'" } ',l["$<<"]('<script type="text/x-mathjax-config">\nMathJax.Hub.Config({\n messageStyle: "none",\n tex2jax: {\n inlineMath: ['+p("INLINE_MATH_DELIMITERS")["$[]"]("latexmath").$inspect()+"],\n displayMath: ["+p("BLOCK_MATH_DELIMITERS")["$[]"]("latexmath").$inspect()+'],\n ignoreClass: "nostem|nolatexmath"\n },\n asciimath2jax: {\n delimiters: ['+p("BLOCK_MATH_DELIMITERS")["$[]"]("asciimath").$inspect()+
|
|
1222
|
-
'],\n ignoreClass: "nostem|noasciimath"\n },\n TeX: {'+c+'}\n})\nMathJax.Hub.Register.StartupHook("AsciiMath Jax Ready", function () {\n MathJax.InputJax.AsciiMath.postfilterHooks.Add(function (data, node) {\n if ((node = data.script.parentNode) && (node = node.parentNode) && node.classList.contains("stemblock")) {\n data.math.root.display = "block"\n }\n return data\n })\n})\n\x3c/script>\n<script src="'+f+"/mathjax/"+p("MATHJAX_VERSION")+'/MathJax.js?config=TeX-MML-AM_HTMLorMML">\x3c/script>'));
|
|
1223
|
-
if(!e((z=a.$docinfo("footer"))["$empty?"]()))l["$<<"](z);l["$<<"]("</body>");l["$<<"]("</html>");return l.$join(p("LF"))});n(b,"$convert_embedded",function(a){var b=w,c=w,d=w;b=[];if(m(a.$doctype(),"manpage")){if(e(a.$notitle())||(c=e(a.$id())?' id="'+a.$id()+'"':"",b["$<<"]("<h1"+c+">"+a.$doctitle()+" Manual Page</h1>")),e(a["$attr?"]("manpurpose")))b["$<<"](this.$generate_manname_section(a))}else e(a["$header?"]())&&x(a.$notitle())&&(c=e(a.$id())?' id="'+a.$id()+'"':"",b["$<<"]("<h1"+c+">"+a.$header().$title()+
|
|
1224
|
-
"</h1>"));if(e(a["$sections?"]())&&e(a["$attr?"]("toc"))&&z(d=a.$attr("toc-placement"),"macro")&&z(d,"preamble"))b["$<<"]('<div id="toc" class="toc">\n<div id="toctitle">'+a.$attr("toc-title")+"</div>\n"+a.$converter().$convert(a,"outline")+"\n</div>");b["$<<"](a.$content());e(a["$footnotes?"]())&&x(a["$attr?"]("nofootnotes"))&&(b["$<<"]('<div id="footnotes">\n<hr'+this.void_element_slash+">"),q(a.$footnotes(),"each",[],function(a){null==a&&(a=w);return b["$<<"]('<div class="footnote" id="_footnotedef_'+
|
|
1225
|
-
a.$index()+'">\n<a href="#_footnoteref_'+a.$index()+'">'+a.$index()+"</a>. "+a.$text()+"\n</div>")}),b["$<<"]("</div>"));return b.$join(p("LF"))});n(b,"$convert_outline",function(a,b){var c=w,d=w,f=w,g=w,k=w,l=w;null==b&&(b=h([],{}));if(!e(a["$sections?"]()))return w;c=e(d=b["$[]"]("sectnumlevels"))?d:(e(f=a.$document().$attributes()["$[]"]("sectnumlevels"))?f:3).$to_i();g=e(d=b["$[]"]("toclevels"))?d:(e(f=a.$document().$attributes()["$[]"]("toclevels"))?f:2).$to_i();k=a.$sections();l=['<ul class="sectlevel'+
|
|
1226
|
-
k["$[]"](0).$level()+'">'];q(k,"each",[],function Ca(b){var d=null==Ca.$$s?this:Ca.$$s,f=w,k=w;null==b&&(b=w);var n=b.$level();if(e(b.$caption()))var q=b.$captioned_title();else if(e(b.$numbered())&&e(A(n,c)))if(e(B(n,2))&&m(a.$document().$doctype(),"book"))switch(b.$sectname()){case "chapter":q=(e(f=a.$document().$attributes()["$[]"]("chapter-signifier"))?""+f+" ":"")+b.$sectnum()+" "+b.$title();break;case "part":q=(e(f=a.$document().$attributes()["$[]"]("part-signifier"))?""+f+" ":"")+b.$sectnum(w,
|
|
1227
|
-
":")+" "+b.$title();break;default:q=""+b.$sectnum()+" "+b.$title()}else q=""+b.$sectnum()+" "+b.$title();else q=b.$title();e(q["$include?"]("<a"))&&(q=q.$gsub(p("DropAnchorRx"),""));return e(B(n,g))&&e(k=d.$convert_outline(b,h(["toclevels","sectnumlevels"],{toclevels:g,sectnumlevels:c})))?(l["$<<"]('<li><a href="#'+b.$id()+'">'+q+"</a>"),l["$<<"](k),l["$<<"]("</li>")):l["$<<"]('<li><a href="#'+b.$id()+'">'+q+"</a></li>")},{$$s:this});l["$<<"]("</ul>");return l.$join(p("LF"))},-2);n(b,"$convert_section",
|
|
1228
|
-
function(a){var b,c=b=w,d,f=w;var g=a.$document().$attributes();var k=a.$level();if(e(a.$caption()))b=a.$captioned_title();else if(e(a.$numbered())&&e(A(k,(e(b=g["$[]"]("sectnumlevels"))?b:3).$to_i())))if(e(B(k,2))&&m(a.$document().$doctype(),"book"))switch(a.$sectname()){case "chapter":b=(e(c=g["$[]"]("chapter-signifier"))?""+c+" ":"")+a.$sectnum()+" "+a.$title();break;case "part":b=(e(c=g["$[]"]("part-signifier"))?""+c+" ":"")+a.$sectnum(w,":")+" "+a.$title();break;default:b=""+a.$sectnum()+" "+
|
|
1229
|
-
a.$title()}else b=""+a.$sectnum()+" "+a.$title();else b=a.$title();e(a.$id())?(c=' id="'+(d=a.$id())+'"',e(g["$[]"]("sectlinks"))&&(b='<a class="link" href="#'+d+'">'+b+"</a>"),e(g["$[]"]("sectanchors"))&&(b=m(g["$[]"]("sectanchors"),"after")?""+b+'<a class="anchor" href="#'+d+'"></a>':'<a class="anchor" href="#'+d+'"></a>'+b)):c="";return m(k,0)?"<h1"+c+' class="sect0'+(e(f=a.$role())?" "+f:"")+'">'+b+"</h1>\n"+a.$content():'<div class="sect'+k+(e(f=a.$role())?" "+f:"")+'">\n<h'+v(k,1)+c+">"+b+"</h"+
|
|
1230
|
-
v(k,1)+">\n"+(m(k,1)?'<div class="sectionbody">\n'+a.$content()+"\n</div>":a.$content())+"\n</div>"});n(b,"$convert_admonition",function(a){var b=w;var c=e(a.$id())?' id="'+a.$id()+'"':"";var d=a.$attr("name");var f=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";var g=e(a.$document()["$attr?"]("icons"))?e(a.$document()["$attr?"]("icons","font"))&&x(a["$attr?"]("icon"))?'<i class="fa icon-'+d+'" title="'+a.$attr("textlabel")+'"></i>':'<img src="'+a.$icon_uri(d)+'" alt="'+a.$attr("textlabel")+
|
|
1231
|
-
'"'+this.void_element_slash+">":'<div class="title">'+a.$attr("textlabel")+"</div>";return"<div"+c+' class="admonitionblock '+d+(e(b=a.$role())?" "+b:"")+'">\n<table>\n<tr>\n<td class="icon">\n'+g+'\n</td>\n<td class="content">\n'+f+a.$content()+"\n</td>\n</tr>\n</table>\n</div>"});n(b,"$convert_audio",function(a){var b=w;var c=this.xml_mode;var d=e(a.$id())?' id="'+a.$id()+'"':"";var f=' class="'+["audioblock",a.$role()].$compact().$join(" ")+'"';var g=e(a["$title?"]())?'<div class="title">'+a.$title()+
|
|
1232
|
-
"</div>\n":"";var k=a.$attr("start");var h=a.$attr("end");k=e(k)||e(h)?"#t="+(e(b=k)?b:"")+(e(h)?","+h:""):"";return"<div"+d+f+">\n"+g+'<div class="content">\n<audio src="'+a.$media_uri(a.$attr("target"))+k+'"'+(e(a["$option?"]("autoplay"))?this.$append_boolean_attribute("autoplay",c):"")+(e(a["$option?"]("nocontrols"))?"":this.$append_boolean_attribute("controls",c))+(e(a["$option?"]("loop"))?this.$append_boolean_attribute("loop",c):"")+">\nYour browser does not support the audio tag.\n</audio>\n</div>\n</div>"});
|
|
1233
|
-
n(b,"$convert_colist",function(a){var b,c=w,d=b=w,f=d=w,g=w;c=[];b=e(a.$id())?' id="'+a.$id()+'"':"";d=["colist",a.$style(),a.$role()].$compact();d=' class="'+d.$join(" ")+'"';c["$<<"]("<div"+b+d+">");if(e(a["$title?"]()))c["$<<"]('<div class="title">'+a.$title()+"</div>");e(a.$document()["$attr?"]("icons"))?(c["$<<"]("<table>"),b=[a.$document()["$attr?"]("icons","font"),0],f=b[0],g=b[1],b,q(a.$items(),"each",[],function va(b){var d=null==va.$$s?this:va.$$s;null==d.void_element_slash&&(d.void_element_slash=
|
|
1234
|
-
w);null==b&&(b=w);g=v(g,1);d=e(f)?'<i class="conum" data-value="'+g+'"></i><b>'+g+"</b>":'<img src="'+a.$icon_uri("callouts/"+g)+'" alt="'+g+'"'+d.void_element_slash+">";return c["$<<"]("<tr>\n<td>"+d+"</td>\n<td>"+b.$text()+(e(b["$blocks?"]())?v(p("LF"),b.$content()):"")+"</td>\n</tr>")},{$$s:this}),c["$<<"]("</table>")):(c["$<<"]("<ol>"),q(a.$items(),"each",[],function(a){null==a&&(a=w);return c["$<<"]("<li>\n<p>"+a.$text()+"</p>"+(e(a["$blocks?"]())?v(p("LF"),a.$content()):"")+"\n</li>")}),c["$<<"]("</ol>"));
|
|
1235
|
-
c["$<<"]("</div>");return c.$join(p("LF"))});n(b,"$convert_dlist",function(a){var b=w,c=w,d=w,f=d=w,g=c=w;b=[];c=e(a.$id())?' id="'+a.$id()+'"':"";switch(a.$style()){case "qanda":d=["qlist","qanda",a.$role()];break;case "horizontal":d=["hdlist",a.$role()];break;default:d=["dlist",a.$style(),a.$role()]}d=' class="'+d.$compact().$join(" ")+'"';b["$<<"]("<div"+c+d+">");if(e(a["$title?"]()))b["$<<"]('<div class="title">'+a.$title()+"</div>");switch(a.$style()){case "qanda":b["$<<"]("<ol>");q(a.$items(),
|
|
1236
|
-
"each",[],function(a,c){null==a&&(a=w);null==c&&(c=w);b["$<<"]("<li>");q(a,"each",[],function(a){null==a&&(a=w);return b["$<<"]("<p><em>"+a.$text()+"</em></p>")});if(e(c)){if(e(c["$text?"]()))b["$<<"]("<p>"+c.$text()+"</p>");if(e(c["$blocks?"]()))b["$<<"](c.$content())}return b["$<<"]("</li>")});b["$<<"]("</ol>");break;case "horizontal":f=this.void_element_slash;b["$<<"]("<table>");if(e(a["$attr?"]("labelwidth"))||e(a["$attr?"]("itemwidth")))b["$<<"]("<colgroup>"),c=e(a["$attr?"]("labelwidth"))?' style="width: '+
|
|
1237
|
-
a.$attr("labelwidth").$chomp("%")+'%;"':"",b["$<<"]("<col"+c+f+">"),c=e(a["$attr?"]("itemwidth"))?' style="width: '+a.$attr("itemwidth").$chomp("%")+'%;"':"",b["$<<"]("<col"+c+f+">"),b["$<<"]("</colgroup>");q(a.$items(),"each",[],function(c,d){var g=w;null==c&&(c=w);null==d&&(d=w);b["$<<"]("<tr>");b["$<<"]('<td class="hdlist1'+(e(a["$option?"]("strong"))?" strong":"")+'">');g=!0;q(c,"each",[],function(a){null==a&&(a=w);if(!e(g))b["$<<"]("<br"+f+">");b["$<<"](a.$text());return g=w});b["$<<"]("</td>");
|
|
1238
|
-
b["$<<"]('<td class="hdlist2">');if(e(d)){if(e(d["$text?"]()))b["$<<"]("<p>"+d.$text()+"</p>");if(e(d["$blocks?"]()))b["$<<"](d.$content())}b["$<<"]("</td>");return b["$<<"]("</tr>")});b["$<<"]("</table>");break;default:b["$<<"]("<dl>"),g=e(a.$style())?"":' class="hdlist1"',q(a.$items(),"each",[],function(a,c){null==a&&(a=w);null==c&&(c=w);q(a,"each",[],function(a){null==a&&(a=w);return b["$<<"]("<dt"+g+">"+a.$text()+"</dt>")});if(!e(c))return w;b["$<<"]("<dd>");if(e(c["$text?"]()))b["$<<"]("<p>"+
|
|
1239
|
-
c.$text()+"</p>");if(e(c["$blocks?"]()))b["$<<"](c.$content());return b["$<<"]("</dd>")}),b["$<<"]("</dl>")}b["$<<"]("</div>");return b.$join(p("LF"))});n(b,"$convert_example",function(a){var b=w;var c=e(a.$id())?' id="'+a.$id()+'"':"";if(e(a["$option?"]("collapsible"))){var d=e(a.$role())?' class="'+a.$role()+'"':"";b=e(a["$title?"]())?'<summary class="title">'+a.$title()+"</summary>":'<summary class="title">Details</summary>';return"<details"+c+d+(e(a["$option?"]("open"))?" open":"")+">\n"+b+'\n<div class="content">\n'+
|
|
1240
|
-
a.$content()+"\n</div>\n</details>"}d=e(a["$title?"]())?'<div class="title">'+a.$captioned_title()+"</div>\n":"";return"<div"+c+' class="exampleblock'+(e(b=a.$role())?" "+b:"")+'">\n'+d+'<div class="content">\n'+a.$content()+"\n</div>\n</div>"});n(b,"$convert_floating_title",function(a){var b="h"+v(a.$level(),1);var c=e(a.$id())?' id="'+a.$id()+'"':"";var d=[a.$style(),a.$role()].$compact();return"<"+b+c+' class="'+d.$join(" ")+'">'+a.$title()+"</"+b+">"});n(b,"$convert_image",function(a){var b=w;
|
|
1241
|
-
var c=a.$attr("target");var d=e(a["$attr?"]("width"))?' width="'+a.$attr("width")+'"':"";var f=e(a["$attr?"]("height"))?' height="'+a.$attr("height")+'"':"";(e(a["$attr?"]("format","svg"))||e(c["$include?"](".svg")))&&e(B(a.$document().$safe(),M(p("SafeMode"),"SECURE")))?e(a["$option?"]("inline"))?c=e(b=this.$read_svg_contents(a,c))?b:'<span class="alt">'+a.$alt()+"</span>":e(a["$option?"]("interactive"))?(b=e(a["$attr?"]("fallback"))?'<img src="'+a.$image_uri(a.$attr("fallback"))+'" alt="'+this.$encode_attribute_value(a.$alt())+
|
|
1242
|
-
'"'+d+f+this.void_element_slash+">":'<span class="alt">'+a.$alt()+"</span>",c='<object type="image/svg+xml" data="'+a.$image_uri(c)+'"'+d+f+">"+b+"</object>"):c='<img src="'+a.$image_uri(c)+'" alt="'+this.$encode_attribute_value(a.$alt())+'"'+d+f+this.void_element_slash+">":c='<img src="'+a.$image_uri(c)+'" alt="'+this.$encode_attribute_value(a.$alt())+'"'+d+f+this.void_element_slash+">";e(a["$attr?"]("link"))&&(c='<a class="image" href="'+a.$attr("link")+'"'+this.$append_link_constraint_attrs(a).$join()+
|
|
1243
|
-
">"+c+"</a>");d=e(a.$id())?' id="'+a.$id()+'"':"";f=["imageblock"];if(e(a["$attr?"]("float")))f["$<<"](a.$attr("float"));if(e(a["$attr?"]("align")))f["$<<"]("text-"+a.$attr("align"));if(e(a.$role()))f["$<<"](a.$role());f=' class="'+f.$join(" ")+'"';a=e(a["$title?"]())?'\n<div class="title">'+a.$captioned_title()+"</div>":"";return"<div"+d+f+'>\n<div class="content">\n'+c+"\n</div>"+a+"\n</div>"});n(b,"$convert_listing",function(a){var b=w,c=w,d=w,f=w,g=w,k=w,l=w,p=w;var n=e(b=a["$option?"]("nowrap"))?
|
|
1244
|
-
b:a.$document()["$attr?"]("prewrap")["$!"]();m(a.$style(),"source")?(c=a.$attr("language"),e(d=a.$document().$syntax_highlighter())?(f=e(d["$highlight?"]())?h(["css_mode","style"],{css_mode:(e(b=(g=a.$document().$attributes())["$[]"](""+d.$name()+"-css"))?b:"class").$to_sym(),style:g["$[]"](""+d.$name()+"-style")}):h([],{}),f["$[]="]("nowrap",n)):(k='<pre class="highlight'+(e(n)?" nowrap":"")+'"><code'+(e(c)?' class="language-'+c+'" data-lang="'+c+'"':"")+">",l="</code></pre>")):(k="<pre"+(e(n)?' class="nowrap"':
|
|
1245
|
-
"")+">",l="</pre>");n=e(a.$id())?' id="'+a.$id()+'"':"";b=e(a["$title?"]())?'<div class="title">'+a.$captioned_title()+"</div>\n":"";return"<div"+n+' class="listingblock'+(e(p=a.$role())?" "+p:"")+'">\n'+b+'<div class="content">\n'+(e(d)?d.$format(a,c,f):v(v(k,a.$content()),l))+"\n</div>\n</div>"});n(b,"$convert_literal",function(a){var b=w,c=w;var d=e(a.$id())?' id="'+a.$id()+'"':"";var f=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";var g=e(b=a.$document()["$attr?"]("prewrap")["$!"]())?
|
|
1246
|
-
b:a["$option?"]("nowrap");return"<div"+d+' class="literalblock'+(e(c=a.$role())?" "+c:"")+'">\n'+f+'<div class="content">\n<pre'+(e(g)?' class="nowrap"':"")+">"+a.$content()+"</pre>\n</div>\n</div>"});n(b,"$convert_stem",function(a){var b,c=w,d=w,f=w,g=w,k=w,h=b=w,l=w;c=e(a.$id())?' id="'+a.$id()+'"':"";d=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";var n=p("BLOCK_MATH_DELIMITERS")["$[]"](f=a.$style().$to_sym());b=D(n);g=null==b[0]?w:b[0];k=null==b[1]?w:b[1];n;e(b=a.$content())?
|
|
1247
|
-
(m(f,"asciimath")&&e(b["$include?"](p("LF")))&&(h=""+p("LF")+"<br"+this.void_element_slash+">",b=q(b,"gsub",[p("StemBreakRx")],function(){var a;return""+k+E(h,G(((a=I["~"])===w?w:a["$[]"](0)).$count(p("LF")),1))+p("LF")+g})),e(b["$start_with?"](g))&&e(b["$end_with?"](k))||(b=""+g+b+k)):b="";return"<div"+c+' class="stemblock'+(e(l=a.$role())?" "+l:"")+'">\n'+d+'<div class="content">\n'+b+"\n</div>\n</div>"});n(b,"$convert_olist",function(a){var b=w,c=w,d=w,f=c=d=w,g=d=w;b=[];c=e(a.$id())?' id="'+a.$id()+
|
|
1248
|
-
'"':"";d=["olist",a.$style(),a.$role()].$compact();d=' class="'+d.$join(" ")+'"';b["$<<"]("<div"+c+d+">");if(e(a["$title?"]()))b["$<<"]('<div class="title">'+a.$title()+"</div>");c=e(f=a.$list_marker_keyword())?' type="'+f+'"':"";d=e(a["$attr?"]("start"))?' start="'+a.$attr("start")+'"':"";g=e(a["$option?"]("reversed"))?this.$append_boolean_attribute("reversed",this.xml_mode):"";b["$<<"]('<ol class="'+a.$style()+'"'+c+d+g+">");q(a.$items(),"each",[],function(a){null==a&&(a=w);if(e(a.$id()))b["$<<"]('<li id="'+
|
|
1249
|
-
a.$id()+'"'+(e(a.$role())?' class="'+a.$role()+'"':"")+">");else if(e(a.$role()))b["$<<"]('<li class="'+a.$role()+'">');else b["$<<"]("<li>");b["$<<"]("<p>"+a.$text()+"</p>");if(e(a["$blocks?"]()))b["$<<"](a.$content());return b["$<<"]("</li>")});b["$<<"]("</ol>");b["$<<"]("</div>");return b.$join(p("LF"))});n(b,"$convert_open",function(a){var b,c=w;if(m(b=a.$style(),"abstract")){if(m(a.$parent(),a.$document())&&m(a.$document().$doctype(),"book"))return this.$logger().$warn("abstract block cannot be used in a document without a title when doctype is book. Excluding block content."),
|
|
1250
|
-
"";var d=e(a.$id())?' id="'+a.$id()+'"':"";var f=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";return"<div"+d+' class="quoteblock abstract'+(e(c=a.$role())?" "+c:"")+'">\n'+f+"<blockquote>\n"+a.$content()+"\n</blockquote>\n</div>"}if(m(b,"partintro")&&(e(t(a.$level(),0))||z(a.$parent().$context(),"section")||z(a.$document().$doctype(),"book")))return this.$logger().$error("partintro block can only be used when doctype is book and must be a child of a book part. Excluding block content."),
|
|
1251
|
-
"";d=e(a.$id())?' id="'+a.$id()+'"':"";f=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";return"<div"+d+' class="openblock'+(e(b)&&z(b,"open")?" "+b:"")+(e(c=a.$role())?" "+c:"")+'">\n'+f+'<div class="content">\n'+a.$content()+"\n</div>\n</div>"});n(b,"$convert_page_break",u('<div style="page-break-after: always;"></div>'));n(b,"$convert_paragraph",function(a){var b=e(a.$role())?(e(a.$id())?' id="'+a.$id()+'"':"")+' class="paragraph '+a.$role()+'"':e(a.$id())?' id="'+a.$id()+'" class="paragraph"':
|
|
1252
|
-
' class="paragraph"';return e(a["$title?"]())?"<div"+b+'>\n<div class="title">'+a.$title()+"</div>\n<p>"+a.$content()+"</p>\n</div>":"<div"+b+">\n<p>"+a.$content()+"</p>\n</div>"});J(b,"convert_pass","content_only");n(b,"$convert_preamble",function(a){var b=w;var c=e((b=a.$document())["$attr?"]("toc-placement","preamble"))&&e(b["$sections?"]())&&e(b["$attr?"]("toc"))?'\n<div id="toc" class="'+b.$attr("toc-class","toc")+'">\n<div id="toctitle">'+b.$attr("toc-title")+"</div>\n"+b.$converter().$convert(b,
|
|
1253
|
-
"outline")+"\n</div>":"";return'<div id="preamble">\n<div class="sectionbody">\n'+a.$content()+"\n</div>"+c+"\n</div>"});n(b,"$convert_quote",function(a){var b=e(a.$id())?' id="'+a.$id()+'"':"";var c=' class="'+["quoteblock",a.$role()].$compact().$join(" ")+'"';var d=e(a["$title?"]())?'\n<div class="title">'+a.$title()+"</div>":"";var f=e(a["$attr?"]("attribution"))?a.$attr("attribution"):w;var g=e(a["$attr?"]("citetitle"))?a.$attr("citetitle"):w;if(e(f)||e(g)){var k=e(g)?"<cite>"+g+"</cite>":"";
|
|
1254
|
-
f=e(f)?"— "+f+(e(g)?"<br"+this.void_element_slash+">\n":""):"";k='\n<div class="attribution">\n'+f+k+"\n</div>"}else k="";return"<div"+b+c+">"+d+"\n<blockquote>\n"+a.$content()+"\n</blockquote>"+k+"\n</div>"});n(b,"$convert_thematic_break",function(a){return"<hr"+this.void_element_slash+">"});n(b,"$convert_sidebar",function(a){var b=w;var c=e(a.$id())?' id="'+a.$id()+'"':"";var d=e(a["$title?"]())?'<div class="title">'+a.$title()+"</div>\n":"";return"<div"+c+' class="sidebarblock'+(e(b=a.$role())?
|
|
1255
|
-
" "+b:"")+'">\n<div class="content">\n'+d+a.$content()+"\n</div>\n</div>"});n(b,"$convert_table",function(a){var b=w,c=w,d=w,f=d=w,g=f=w,k=w,h=d=k=w;b=[];c=e(a.$id())?' id="'+a.$id()+'"':"";m(d=a.$attr("frame","all","table-frame"),"topbot")&&(d="ends");d=["tableblock","frame-"+d,"grid-"+a.$attr("grid","all","table-grid")];if(e(f=a.$attr("stripes",w,"table-stripes")))d["$<<"]("stripes-"+f);f="";if(e(g=a["$option?"]("autowidth"))&&x(a["$attr?"]("width")))d["$<<"]("fit-content");else if(m(k=a.$attr("tablepcwidth"),
|
|
1256
|
-
100))d["$<<"]("stretch");else f=' style="width: '+k+'%;"';if(e(a["$attr?"]("float")))d["$<<"](a.$attr("float"));if(e(k=a.$role()))d["$<<"](k);d=' class="'+d.$join(" ")+'"';b["$<<"]("<table"+c+d+f+">");if(e(a["$title?"]()))b["$<<"]('<caption class="title">'+a.$captioned_title()+"</caption>");e(t(a.$attr("rowcount"),0))&&(h=this.void_element_slash,b["$<<"]("<colgroup>"),e(g)?b=v(b,p("Array").$new(a.$columns().$size(),"<col"+h+">")):q(a.$columns(),"each",[],function(a){null==a&&(a=w);return b["$<<"](e(a["$option?"]("autowidth"))?
|
|
1257
|
-
"<col"+h+">":'<col style="width: '+a.$attr("colpcwidth")+'%;"'+h+">")}),b["$<<"]("</colgroup>"),q(a.$rows().$to_h(),"each",[],function(c,d){null==c&&(c=w);null==d&&(d=w);if(e(d["$empty?"]()))return w;b["$<<"]("<t"+c+">");q(d,"each",[],function(d){null==d&&(d=w);b["$<<"]("<tr>");q(d,"each",[],function(d){var f=w;null==d&&(d=w);if(m(c,"head"))f=d.$text();else switch(d.$style()){case "asciidoc":f='<div class="content">'+d.$content()+"</div>";break;case "literal":f='<div class="literal"><pre>'+d.$text()+
|
|
1258
|
-
"</pre></div>";break;default:f=e((f=d.$content())["$empty?"]())?"":'<p class="tableblock">'+f.$join('</p>\n<p class="tableblock">')+"</p>"}var g=m(c,"head")||m(d.$style(),"header")?"th":"td";var k=' class="tableblock halign-'+d.$attr("halign")+" valign-"+d.$attr("valign")+'"';var h=e(d.$colspan())?' colspan="'+d.$colspan()+'"':"";d=e(d.$rowspan())?' rowspan="'+d.$rowspan()+'"':"";var l=e(a.$document()["$attr?"]("cellbgcolor"))?' style="background-color: '+a.$document().$attr("cellbgcolor")+';"':"";
|
|
1259
|
-
return b["$<<"]("<"+g+k+h+d+l+">"+f+"</"+g+">")});return b["$<<"]("</tr>")});return b["$<<"]("</t"+c+">")}));b["$<<"]("</table>");return b.$join(p("LF"))});n(b,"$convert_toc",function(a){var b=w;if(!(e((b=a.$document())["$attr?"]("toc-placement","macro"))&&e(b["$sections?"]())&&e(b["$attr?"]("toc"))))return"\x3c!-- toc disabled --\x3e";if(e(a.$id())){var c=' id="'+a.$id()+'"';var d=' id="'+a.$id()+'title"'}else c=' id="toc"',d=' id="toctitle"';var f=e(a["$title?"]())?a.$title():b.$attr("toc-title");
|
|
1260
|
-
var g=e(a["$attr?"]("levels"))?a.$attr("levels").$to_i():w;a=e(a["$role?"]())?a.$role():b.$attr("toc-class","toc");return"<div"+c+' class="'+a+'">\n<div'+d+' class="title">'+f+"</div>\n"+b.$converter().$convert(b,"outline",h(["toclevels"],{toclevels:g}))+"\n</div>"});n(b,"$convert_ulist",function(a){var b=w,c=w,d=w,f=w,g=w,k=w,h=w;b=[];c=e(a.$id())?' id="'+a.$id()+'"':"";d=["ulist",a.$style(),a.$role()].$compact();f=g="";e(k=a["$option?"]("checklist"))?(d.$unshift(d.$shift(),"checklist"),h=' class="checklist"',
|
|
1261
|
-
e(a["$option?"]("interactive"))?e(this.xml_mode)?(f='<input type="checkbox" data-item-complete="1" checked="checked"/> ',g='<input type="checkbox" data-item-complete="0"/> '):(f='<input type="checkbox" data-item-complete="1" checked> ',g='<input type="checkbox" data-item-complete="0"> '):e(a.$document()["$attr?"]("icons","font"))?(f='<i class="fa fa-check-square-o"></i> ',g='<i class="fa fa-square-o"></i> '):(f="✓ ",g="❏ ")):h=e(a.$style())?' class="'+a.$style()+'"':"";b["$<<"]("<div"+
|
|
1262
|
-
c+' class="'+d.$join(" ")+'">');if(e(a["$title?"]()))b["$<<"]('<div class="title">'+a.$title()+"</div>");b["$<<"]("<ul"+h+">");q(a.$items(),"each",[],function(a){null==a&&(a=w);if(e(a.$id()))b["$<<"]('<li id="'+a.$id()+'"'+(e(a.$role())?' class="'+a.$role()+'"':"")+">");else if(e(a.$role()))b["$<<"]('<li class="'+a.$role()+'">');else b["$<<"]("<li>");if(e(k)&&e(a["$attr?"]("checkbox")))b["$<<"]("<p>"+(e(a["$attr?"]("checked"))?f:g)+a.$text()+"</p>");else b["$<<"]("<p>"+a.$text()+"</p>");if(e(a["$blocks?"]()))b["$<<"](a.$content());
|
|
1263
|
-
return b["$<<"]("</li>")});b["$<<"]("</ul>");b["$<<"]("</div>");return b.$join(p("LF"))});n(b,"$convert_verse",function(a){var b=e(a.$id())?' id="'+a.$id()+'"':"";var c=' class="'+["verseblock",a.$role()].$compact().$join(" ")+'"';var d=e(a["$title?"]())?'\n<div class="title">'+a.$title()+"</div>":"";var f=e(a["$attr?"]("attribution"))?a.$attr("attribution"):w;var g=e(a["$attr?"]("citetitle"))?a.$attr("citetitle"):w;if(e(f)||e(g)){var k=e(g)?"<cite>"+g+"</cite>":"";f=e(f)?"— "+f+(e(g)?"<br"+
|
|
1264
|
-
this.void_element_slash+">\n":""):"";k='\n<div class="attribution">\n'+f+k+"\n</div>"}else k="";return"<div"+b+c+">"+d+'\n<pre class="content">'+a.$content()+"</pre>"+k+"\n</div>"});n(b,"$convert_video",function(a){var b,c=w,d;var f=w;var g=this.xml_mode;var k=e(a.$id())?' id="'+a.$id()+'"':"";var h=["videoblock"];if(e(a["$attr?"]("float")))h["$<<"](a.$attr("float"));if(e(a["$attr?"]("align")))h["$<<"]("text-"+a.$attr("align"));if(e(a.$role()))h["$<<"](a.$role());h=' class="'+h.$join(" ")+'"';var l=
|
|
1265
|
-
e(a["$title?"]())?'\n<div class="title">'+a.$title()+"</div>":"";var m=e(a["$attr?"]("width"))?' width="'+a.$attr("width")+'"':"";var p=e(a["$attr?"]("height"))?' height="'+a.$attr("height")+'"':"";switch(a.$attr("poster")){case "vimeo":e((b=a.$document().$attr("asset-uri-scheme","https"))["$empty?"]())||(b=""+b+":");var n=e(a["$attr?"]("start"))?"#at="+a.$attr("start"):"";var q=["?"];var r=a.$attr("target").$split("/",2);var u=D(r);var t=null==u[0]?w:u[0];f=null==u[1]?w:u[1];r;r=e(f=e(c=f)?c:a.$attr("hash"))?
|
|
1266
|
-
""+(e(c=q.$pop())?c:"&")+"h="+f:"";f=e(a["$option?"]("autoplay"))?""+(e(c=q.$pop())?c:"&")+"autoplay=1":"";var v=e(a["$option?"]("loop"))?""+(e(c=q.$pop())?c:"&")+"loop=1":"";q=e(a["$option?"]("muted"))?""+(e(c=q.$pop())?c:"&")+"muted=1":"";return"<div"+k+h+">"+l+'\n<div class="content">\n<iframe'+m+p+' src="'+b+"//player.vimeo.com/video/"+t+r+f+v+q+n+'" frameborder="0"'+(e(a["$option?"]("nofullscreen"))?"":this.$append_boolean_attribute("allowfullscreen",g))+"></iframe>\n</div>\n</div>";
|
|
1267
|
-
case "youtube":e((b=a.$document().$attr("asset-uri-scheme","https"))["$empty?"]())||(b=""+b+":");n=e(a["$option?"]("related"))?1:0;q=e(a["$attr?"]("start"))?"&start="+a.$attr("start"):"";var y=e(a["$attr?"]("end"))?"&end="+a.$attr("end"):"";f=e(a["$option?"]("autoplay"))?"&autoplay=1":"";v=e(d=a["$option?"]("loop"))?"&loop=1":"";var x=e(a["$option?"]("muted"))?"&mute=1":"";var z=e(a["$option?"]("nocontrols"))?"&controls=0":"";if(e(a["$option?"]("nofullscreen"))){var A="&fs=0";
|
|
1268
|
-
g=""}else A="",g=this.$append_boolean_attribute("allowfullscreen",g);var B=e(a["$option?"]("modest"))?"&modestbranding=1":"";var C=e(a["$attr?"]("theme"))?"&theme="+a.$attr("theme"):"";var F=e(a["$attr?"]("lang"))?"&hl="+a.$attr("lang"):"";r=a.$attr("target").$split("/",2);u=D(r);t=null==u[0]?w:u[0];u=null==u[1]?w:u[1];r;e(u=e(c=u)?c:a.$attr("list"))?a="&list="+u:(r=t.$split(",",2),u=D(r),t=null==u[0]?w:u[0],u=null==u[1]?w:u[1],r,a=e(u=e(c=u)?c:a.$attr("playlist"))?"&playlist="+
|
|
1269
|
-
t+","+u:e(d)?"&playlist="+t:"");return"<div"+k+h+">"+l+'\n<div class="content">\n<iframe'+m+p+' src="'+b+"//www.youtube.com/embed/"+t+"?rel="+n+q+y+f+v+x+z+a+A+B+C+F+'" frameborder="0"'+g+"></iframe>\n</div>\n</div>";default:return b=e((f=a.$attr("poster"))["$nil_or_empty?"]())?"":' poster="'+a.$media_uri(f)+'"',t=e((f=a.$attr("preload"))["$nil_or_empty?"]())?"":' preload="'+f+'"',f=a.$attr("start"),v=a.$attr("end"),f=e(f)||e(v)?"#t="+(e(c=f)?c:"")+(e(v)?","+v:""):"","<div"+k+h+">"+l+'\n<div class="content">\n<video src="'+
|
|
1270
|
-
a.$media_uri(a.$attr("target"))+f+'"'+m+p+b+(e(a["$option?"]("autoplay"))?this.$append_boolean_attribute("autoplay",g):"")+(e(a["$option?"]("muted"))?this.$append_boolean_attribute("muted",g):"")+(e(a["$option?"]("nocontrols"))?"":this.$append_boolean_attribute("controls",g))+(e(a["$option?"]("loop"))?this.$append_boolean_attribute("loop",g):"")+t+">\nYour browser does not support the video tag.\n</video>\n</div>\n</div>"}});n(b,"$convert_inline_anchor",function(a){var b,c=w,d,f=w,g=w,k=w,h=w;switch(a.$type()){case "xref":if(e(b=
|
|
1271
|
-
a.$attributes()["$[]"]("path"))){var l=this.$append_link_constraint_attrs(a,e(a.$role())?[' class="'+a.$role()+'"']:[]).$join();b=e(c=a.$text())?c:b}else l=e(a.$role())?' class="'+a.$role()+'"':"",e(b=a.$text())||(r(p("AbstractNode"),d=e(c=(this.refs=e(f=this.refs)?f:a.$document().$catalog()["$[]"]("refs"))["$[]"](g=a.$attributes()["$[]"]("refid")))?c:e(g["$nil_or_empty?"]())?k=this.$get_root_document(a):w)?e(this.resolving_xref=e(c=this.resolving_xref)?c:h=!0)&&e(h)?(e(b=d.$xreftext(a.$attr("xrefstyle",
|
|
1272
|
-
w,!0)))?e(b["$include?"]("<a"))&&(b=b.$gsub(p("DropAnchorRx"),"")):b=e(k)?"[^top]":"["+g+"]",this.resolving_xref=w):b=e(k)?"[^top]":"["+g+"]":b="["+g+"]");return'<a href="'+a.$target()+'"'+l+">"+b+"</a>";case "ref":return'<a id="'+a.$id()+'"></a>';case "link":l=e(a.$id())?[' id="'+a.$id()+'"']:[];if(e(a.$role()))l["$<<"](' class="'+a.$role()+'"');if(e(a["$attr?"]("title")))l["$<<"](' title="'+a.$attr("title")+'"');return'<a href="'+a.$target()+'"'+this.$append_link_constraint_attrs(a,l).$join()+">"+
|
|
1273
|
-
a.$text()+"</a>";case "bibref":return'<a id="'+a.$id()+'"></a>['+(e(c=a.$reftext())?c:a.$id())+"]";default:return this.$logger().$warn("unknown anchor type: "+a.$type().$inspect()),w}});n(b,"$convert_inline_break",function(a){return""+a.$text()+"<br"+this.void_element_slash+">"});n(b,"$convert_inline_button",function(a){return'<b class="button">'+a.$text()+"</b>"});n(b,"$convert_inline_callout",function(a){if(e(a.$document()["$attr?"]("icons","font")))return'<i class="conum" data-value="'+a.$text()+
|
|
1274
|
-
'"></i><b>('+a.$text()+")</b>";if(e(a.$document()["$attr?"]("icons"))){var b=a.$icon_uri("callouts/"+a.$text());return'<img src="'+b+'" alt="'+a.$text()+'"'+this.void_element_slash+">"}return r(M("Array"),b=a.$attributes()["$[]"]("guard"))?'<!--<b class="conum">('+a.$text()+")</b>-->":""+b+'<b class="conum">('+a.$text()+")</b>"});n(b,"$convert_inline_footnote",function(a){var b;if(e(b=a.$attr("index"))){if(m(a.$type(),"xref"))return'<sup class="footnoteref">[<a class="footnote" href="#_footnotedef_'+
|
|
1275
|
-
b+'" title="View footnote.">'+b+"</a>]</sup>";a=e(a.$id())?' id="_footnote_'+a.$id()+'"':"";return'<sup class="footnote"'+a+'>[<a id="_footnoteref_'+b+'" class="footnote" href="#_footnotedef_'+b+'" title="View footnote.">'+b+"</a>]</sup>"}return m(a.$type(),"xref")?'<sup class="footnoteref red" title="Unresolved footnote reference.">['+a.$text()+"]</sup>":w});n(b,"$convert_inline_image",function(a){var b,c=w,d,f;var g=a.$target();m(b=e(c=a.$type())?c:"image","icon")?m(d=a.$document().$attr("icons"),
|
|
1276
|
-
"font")?(g="fa fa-"+g,e(a["$attr?"]("size"))&&(g=""+g+" fa-"+a.$attr("size")),e(a["$attr?"]("flip"))?g=""+g+" fa-flip-"+a.$attr("flip"):e(a["$attr?"]("rotate"))&&(g=""+g+" fa-rotate-"+a.$attr("rotate")),d=e(a["$attr?"]("title"))?' title="'+a.$attr("title")+'"':"",g='<i class="'+g+'"'+d+"></i>"):e(d)?(d=e(a["$attr?"]("width"))?' width="'+a.$attr("width")+'"':"",e(a["$attr?"]("height"))&&(d=""+d+' height="'+a.$attr("height")+'"'),e(a["$attr?"]("title"))&&(d=""+d+' title="'+a.$attr("title")+'"'),g='<img src="'+
|
|
1277
|
-
a.$icon_uri(g)+'" alt="'+this.$encode_attribute_value(a.$alt())+'"'+d+this.void_element_slash+">"):g="["+a.$alt()+"]":(d=e(a["$attr?"]("width"))?' width="'+a.$attr("width")+'"':"",e(a["$attr?"]("height"))&&(d=""+d+' height="'+a.$attr("height")+'"'),e(a["$attr?"]("title"))&&(d=""+d+' title="'+a.$attr("title")+'"'),(e(a["$attr?"]("format","svg"))||e(g["$include?"](".svg")))&&e(B(a.$document().$safe(),M(p("SafeMode"),"SECURE")))?e(a["$option?"]("inline"))?g=e(c=this.$read_svg_contents(a,g))?c:'<span class="alt">'+
|
|
1278
|
-
a.$alt()+"</span>":e(a["$option?"]("interactive"))?(c=e(a["$attr?"]("fallback"))?'<img src="'+a.$image_uri(a.$attr("fallback"))+'" alt="'+this.$encode_attribute_value(a.$alt())+'"'+d+this.void_element_slash+">":'<span class="alt">'+a.$alt()+"</span>",g='<object type="image/svg+xml" data="'+a.$image_uri(g)+'"'+d+">"+c+"</object>"):g='<img src="'+a.$image_uri(g)+'" alt="'+this.$encode_attribute_value(a.$alt())+'"'+d+this.void_element_slash+">":g='<img src="'+a.$image_uri(g)+'" alt="'+this.$encode_attribute_value(a.$alt())+
|
|
1279
|
-
'"'+d+this.void_element_slash+">");e(a["$attr?"]("link"))&&(g='<a class="image" href="'+a.$attr("link")+'"'+this.$append_link_constraint_attrs(a).$join()+">"+g+"</a>");e(f=a.$role())?b=e(a["$attr?"]("float"))?""+b+" "+a.$attr("float")+" "+f:""+b+" "+f:e(a["$attr?"]("float"))&&(b=""+b+" "+a.$attr("float"));return'<span class="'+b+'">'+g+"</span>"});n(b,"$convert_inline_indexterm",function(a){return m(a.$type(),"visible")?a.$text():""});n(b,"$convert_inline_kbd",function(a){var b;return m((b=a.$attr("keys")).$size(),
|
|
1280
|
-
1)?"<kbd>"+b["$[]"](0)+"</kbd>":'<span class="keyseq"><kbd>'+b.$join("</kbd>+<kbd>")+"</kbd></span>"});n(b,"$convert_inline_menu",function(a){var b,c;var d=e(a.$document()["$attr?"]("icons","font"))?' <i class="fa fa-angle-right caret"></i> ':' <b class="caret">›</b> ';var f="</b>"+d+'<b class="submenu">';var g=a.$attr("menu");return e((b=a.$attr("submenus"))["$empty?"]())?e(c=a.$attr("menuitem"))?'<span class="menuseq"><b class="menu">'+g+"</b>"+d+'<b class="menuitem">'+c+"</b></span>":
|
|
1281
|
-
'<b class="menuref">'+g+"</b>":'<span class="menuseq"><b class="menu">'+g+"</b>"+d+'<b class="submenu">'+b.$join(f)+"</b>"+d+'<b class="menuitem">'+a.$attr("menuitem")+"</b></span>"});n(b,"$convert_inline_quoted",function(a){var b=p("QUOTE_TAGS")["$[]"](a.$type());var c=D(b);var d=null==c[0]?w:c[0];var f=null==c[1]?w:c[1];c=null==c[2]?w:c[2];b;return e(a.$id())?(b=e(a.$role())?' class="'+a.$role()+'"':"",e(c)?""+d.$chop()+' id="'+a.$id()+'"'+b+">"+a.$text()+f:'<span id="'+a.$id()+'"'+b+">"+d+a.$text()+
|
|
1282
|
-
f+"</span>"):e(a.$role())?e(c)?""+d.$chop()+' class="'+a.$role()+'">'+a.$text()+f:'<span class="'+a.$role()+'">'+d+a.$text()+f+"</span>":""+d+a.$text()+f});n(b,"$read_svg_contents",function(b,c){var d=w,f=w,g=w,k=w;if(e(d=b.$read_contents(c,h(["start","normalize","label","warn_if_empty"],{start:b.$document().$attr("imagesdir"),normalize:!0,label:"SVG",warn_if_empty:!0})))){if(e(d["$empty?"]()))return w;e(d["$start_with?"]("<svg"))||(d=d.$sub(p("SvgPreambleRx"),""));f=g=k=w;q(["width","height"],"each",
|
|
1283
|
-
[],function(a){var c=w,h=w;null==a&&(a=w);if(!e(b["$attr?"](a)))return w;if(!e(g)){if(m(k=e(c=k)?c:e(h=d.$match(p("SvgStartTagRx")))?h:"no_match","no_match"))return w;g=(f=k["$[]"](0)).$gsub(p("DimensionAttributeRx"),"")}return g=""+g.$chop()+" "+a+'="'+b.$attr(a)+'">'});e(g)&&(d=""+g+d["$[]"](a.Range.$new(f.$length(),-1,!1)))}return d});b.$private();n(b,"$append_boolean_attribute",function(a,b){return e(b)?" "+a+'="'+a+'"':" "+a});n(b,"$append_link_constraint_attrs",function(a,b){var c=w,d;null==
|
|
1284
|
-
b&&(b=[]);e(a["$option?"]("nofollow"))&&(c="nofollow");if(e(d=a.$attributes()["$[]"]("window"))){if(b["$<<"](' target="'+d+'"'),m(d,"_blank")||e(a["$option?"]("noopener")))b["$<<"](e(c)?' rel="'+c+' noopener"':' rel="noopener"')}else if(e(c))b["$<<"](' rel="'+c+'"');return b},-2);n(b,"$encode_attribute_value",function(a){return e(a["$include?"]('"'))?a.$gsub('"',"""):a});n(b,"$generate_manname_section",function(a){var b=w,c=w,d=w;var f=a.$attr("manname-title","Name");e(c=a.$sections()["$[]"](0))&&
|
|
1285
|
-
m(b=c.$title(),b.$upcase())&&(f=f.$upcase());return"<h2"+(e(d=a.$attr("manname-id"))?' id="'+d+'"':"")+">"+f+'</h2>\n<div class="sectionbody">\n<p>'+a.$attr("mannames").$join(", ")+" - "+a.$attr("manpurpose")+"</p>\n</div>"});n(b,"$get_root_document",function(a){for(;e((a=a.$document())["$nested?"]());)a=a.$parent_document();return a});n(b,"$method_missing",function sa(a,b){var c=sa.$$p||w,d=w;sa.$$p=null;var f=K(arguments,1);return x((d=a.$to_s())["$start_with?"]("convert_"))&&e(this["$handles?"](d))?
|
|
1286
|
-
q(this,"send",["convert_"+d].concat(L(f))):g(this,l(this,"method_missing",sa,!1,!0),"method_missing",[a].concat(L(f)),c)},-2);return n(b,"$respond_to_missing?",function(a,b){var c,d;K(arguments,1);return e(c=(d=a.$to_s())["$start_with?"]("convert_")["$!"]())?this["$handles?"](d):c},-2)}(p("Converter"),M(p("Converter"),"Base"),k)}(C[0],C)};Opal.modules["asciidoctor/extensions"]=function(a){var b=a.module,d=a.klass,f=a.truthy,h=a.hash2,c=a.def,m=a.send,n=a.alias,g=a.slice,l=a.rb_plus,e=a.eqeq,q=a.rb_gt,
|
|
1287
|
-
t=a.not,v=a.eqeqeq,x=a.to_a,z=a.to_ary,A=a.const_set,B=a.return_val,D=a.send2,E=a.find_super,G=a.NilClass,I=a.class_variable_set,u=a.class_variable_get,J=a.regexp,r=a.Class,K=a.return_ivar,L=a.rb_lt,C=a.rb_minus,w=a.hash,M=[],H=a.nil,N=a.$$$;a.add_stubs("[]=,config,const_defined?,singleton_class?,include,const_get,extend,enable_dsl,attr_reader,merge,class,update,raise,document,==,doctype,[],+,level,delete,>,casecmp,new,title=,sectname=,special=,fetch,numbered=,attr?,!,key?,special,numbered,id=,generate_id,title,update_attributes,tr,basename,create_block,assign_caption,===,parse_blocks,empty?,include?,sub_attributes,parse,each,define_method,unshift,shift,send,size,receiver,binding,define_singleton_method,instance_exec,to_proc,call,option,content_model,flatten,positional_attributes,default_attributes,respond_to?,to_s,partition,to_i,<<,compact,inspect,resolve_attributes,attr_accessor,to_set,contexts,match?,resolve_regexp,format,method,register,reset,values,groups,arity,activate,add_document_processor,tree_processor,tree_processors?,tree_processors,any?,select,add_syntax_processor,to_sym,instance_variable_get,kind,private,join,map,split,capitalize,instance_variable_set,resolve_args,singleton_class,process_block_given?,source_location,freeze,resolve_class,<,update_config,as_symbol,name,name=,pop,-,-@,next_auto_id,generate_name,each_with_object");
|
|
1288
|
-
H;return function(k,p){k=[b(k,"Asciidoctor")].concat(p);return function(k,p){k=b(k,"Extensions");p=[k].concat(p);var y=a.$r(p);(function(b,$super,k){b=d(b,$super,"Processor");k=[b].concat(k);var p=a.$r(k);b.$$prototype.config=H;(function(a,b){c(a,"$config",function(){var a=H;null==this.config&&(this.config=H);return this.config=f(a=this.config)?a:h([],{})});c(a,"$option",function(a,b){var c;return c=[a,b],m(this.$config(),"[]=",c),c[c.length-1]});c(a,"$enable_dsl",function(){return f(this["$const_defined?"]("DSL"))?
|
|
1289
|
-
f(this["$singleton_class?"]())?this.$include(this.$const_get("DSL")):this.$extend(this.$const_get("DSL")):H});return n(a,"use_dsl","enable_dsl")})(a.get_singleton_class(b),k);b.$attr_reader("config");c(b,"$initialize",function(a){null==a&&(a=h([],{}));return this.config=this.$class().$config().$merge(a)},-1);c(b,"$update_config",function(a){return this.config.$update(a)});c(b,"$process",function(a){g(arguments);return this.$raise(N("NotImplementedError"),""+p("Processor")+" subclass "+this.$class()+
|
|
1290
|
-
" must implement the #process method")},-1);c(b,"$create_section",function(a,b,c,d){var g,k=H,n,r=H;null==d&&(d=h([],{}));var u=a.$document();var w=(g=u.$doctype())["$=="]("book");var v=f(k=d["$[]"]("level"))?k:l(a.$level(),1);if(f(n=c.$delete("style")))if(f(w)&&e(n,"abstract")){g=["chapter",1];var y=g[0];v=g[1];g}else g=[n,!0],y=g[0],r=g[1],g,e(v,0)&&(v=1);else f(w)?y=e(v,0)?"part":f(q(v,1))?"section":"chapter":e(g,"manpage")&&e(b.$casecmp("synopsis"),0)?(g=["synopsis",!0],y=g[0],r=g[1],g):y="section";
|
|
1291
|
-
var x=p("Section").$new(a,v);g=[b,y];b=[g[0]];m(x,"title=",b);b[b.length-1];b=[g[1]];m(x,"sectname=",b);b[b.length-1];g;if(f(r))if(x["$special="](!0),f(d.$fetch("numbered",n["$=="]("appendix"))))x["$numbered="](!0);else{if(t(d["$key?"]("numbered"))&&f(u["$attr?"]("sectnums","all")))x["$numbered="](f(w)&&e(v,1)?"chapter":!0)}else if(f(q(v,0))){if(f(d.$fetch("numbered",u["$attr?"]("sectnums"))))x["$numbered="](f(x.$special())?f(k=a.$numbered())||k:!0)}else if(f(d.$fetch("numbered",f(k=w)?u["$attr?"]("partnums"):
|
|
1292
|
-
k)))x["$numbered="](!0);if(e(a=c["$[]"]("id"),!1))c.$delete("id");else x["$id="]((g=["id",f(k=a)?k:f(u["$attr?"]("sectids"))?p("Section").$generate_id(x.$title(),u):H],m(c,"[]=",g),g[g.length-1]));x.$update_attributes(c);return x},-4);c(b,"$create_block",function(a,b,c,d,e){null==e&&(e=h([],{}));return p("Block").$new(a,b,h(["source","attributes"],{source:c,attributes:d}).$merge(e))},-5);c(b,"$create_list",function(a,b,c){null==c&&(c=H);a=p("List").$new(a,b);f(c)&&a.$update_attributes(c);return a},
|
|
1293
|
-
-3);c(b,"$create_list_item",function(a,b){null==b&&(b=H);return p("ListItem").$new(a,b)},-2);c(b,"$create_image_block",function(a,b,c){var d,e,g;null==c&&(c=h([],{}));f(e=b["$[]"]("target"))||this.$raise(N("ArgumentError"),"Unable to create an image block, target attribute is required");if(f(g=b["$[]"]("alt")))g;else b["$[]="]("alt",(d=["default-alt",p("Helpers").$basename(e,!0).$tr("_-"," ")],m(b,"[]=",d),d[d.length-1]));d=f(b["$key?"]("title"))?b.$delete("title"):H;a=this.$create_block(a,"image",
|
|
1294
|
-
H,b,c);f(d)&&(a["$title="](d),a.$assign_caption(b.$delete("caption"),"figure"));return a},-3);c(b,"$create_inline",function(a,b,c,d){null==d&&(d=h([],{}));return p("Inline").$new(a,b,c,e(b,"quoted")?h(["type"],{type:"unquoted"}).$merge(d):d)},-4);c(b,"$parse_content",function(a,b,c){null==c&&(c=H);b=v(p("Reader"),b)?b:p("Reader").$new(b);p("Parser").$parse_blocks(b,a,c);return a},-3);c(b,"$parse_attributes",function(a,b,c){var d=H;null==c&&(c=h([],{}));if(f(f(b)?b["$empty?"]():!0))return h([],{});
|
|
1295
|
-
f(c["$[]"]("sub_attributes"))&&f(b["$include?"](p("ATTR_REF_HEAD")))&&(b=a.$sub_attributes(b));return p("AttributeList").$new(b).$parse(f(d=c["$[]"]("positional_attributes"))?d:[])},-3);return m([["create_paragraph","create_block","paragraph"],["create_open_block","create_block","open"],["create_example_block","create_block","example"],["create_pass_block","create_block","pass"],["create_listing_block","create_block","listing"],["create_literal_block","create_block","literal"],["create_anchor","create_inline",
|
|
1296
|
-
"anchor"],["create_inline_pass","create_inline","quoted"]],"each",[],function ia(a,b,c){var d=null==ia.$$s?this:ia.$$s;null==a&&(a=H);null==b&&(b=H);null==c&&(c=H);return m(d,"define_method",[a],function ua(a){var d=null==ua.$$s?this:ua.$$s;var e=g(arguments);e.$unshift(e.$shift(),c);return m(d,"send",[b].concat(x(e)))},{$$arity:-1,$$s:d})},{$$s:b})})(p[0],null,p);(function(a){a=b(a,"ProcessorDsl");c(a,"$option",function(a,b){var c;return c=[a,b],m(this.$config(),"[]=",c),c[c.length-1]});c(a,"$process",
|
|
1297
|
-
function V(a){var b=V.$$p||H,c,d=H;null==this.process_block&&(this.process_block=H);V.$$p=null;var k=g(arguments);return b!==H?(f(k["$empty?"]())||this.$raise(N("ArgumentError"),"wrong number of arguments (given "+k.$size()+", expected 0)"),f(b.$binding())&&e(this,b.$binding().$receiver())||(d=this,m(b,"define_singleton_method",["call"],function(a){var c=g(arguments);return m(d,"instance_exec",x(c),b.$to_proc())},-1)),this.process_block=b):f((c=this.process_block,null!=c&&c!==H)?"instance-variable":
|
|
1298
|
-
H)?m(this.process_block,"call",x(k)):this.$raise(N("NotImplementedError"),""+this.$class()+" #process method called before being registered")},-1);return c(a,"$process_block_given?",function(){var a;return(a=this.process_block,null!=a&&a!==H)?"instance-variable":H})})(p[0]);(function(d,e){d=b(d,"DocumentProcessorDsl");e=[d].concat(e);e=a.$r(e);d.$include(e("ProcessorDsl"));return c(d,"$prefer",function(){return this.$option("position",">>")})})(p[0],p);(function(d,k){d=b(d,"SyntaxProcessorDsl");k=
|
|
1299
|
-
[d].concat(k);var l=a.$r(k);d.$include(l("ProcessorDsl"));c(d,"$named",function(a){return v(l("Processor"),this)?this.name=a:this.$option("name",a)});c(d,"$content_model",function(a){return this.$option("content_model",a)});n(d,"parse_content_as","content_model");c(d,"$positional_attributes",function(a){var b=g(arguments);return this.$option("positional_attrs",b.$flatten())},-1);n(d,"name_positional_attributes","positional_attributes");n(d,"positional_attrs","positional_attributes");c(d,"$default_attributes",
|
|
1300
|
-
function(a){return this.$option("default_attrs",a)});n(d,"default_attrs","default_attributes");c(d,"$resolve_attributes",function(a){var b,c=b=H,d=H;var k=g(arguments);f(q(k.$size(),1))||f((k=k.$fetch(0,!0))["$respond_to?"]("to_sym"))&&(k=[k]);return v(!0,b=k)?(this.$option("positional_attrs",[]),this.$option("default_attrs",h([],{}))):v(N("Array"),b)?(b=[[],h([],{})],c=b[0],d=b[1],b,m(k,"each",[],function(a){null==a&&(a=H);if(f((a=a.$to_s())["$include?"]("="))){var b=a.$partition("=");a=z(b);var g=
|
|
1301
|
-
null==a[0]?H:a[0];var k=null==a[2]?H:a[2];b;if(f(g["$include?"](":"))){b=g.$partition(":");a=z(b);var h=null==a[0]?H:a[0];g=null==a[2]?H:a[2];b;h=e(h,"@")?c.$size():h.$to_i();c["$[]="](h,g)}return a=[g,k],m(d,"[]=",a),a[a.length-1]}return f(a["$include?"](":"))?(b=a.$partition(":"),a=z(b),h=null==a[0]?H:a[0],g=null==a[2]?H:a[2],b,h=e(h,"@")?c.$size():h.$to_i(),a=[h,g],m(c,"[]=",a),a[a.length-1]):c["$<<"](a)}),this.$option("positional_attrs",c.$compact()),this.$option("default_attrs",d)):v(N("Hash"),
|
|
1302
|
-
b)?(b=[[],h([],{})],c=b[0],d=b[1],b,m(k,"each",[],function(a,b){var g;null==a&&(a=H);null==b&&(b=H);if(f((g=a.$to_s())["$include?"](":"))){a=g.$partition(":");var k=z(a);var h=null==k[0]?H:k[0];g=null==k[2]?H:k[2];a;h=e(h,"@")?c.$size():h.$to_i();c["$[]="](h,g)}return f(b)?(k=[g,b],m(d,"[]=",k),k[k.length-1]):H}),this.$option("positional_attrs",c.$compact()),this.$option("default_attrs",d)):this.$raise(N("ArgumentError"),"unsupported attributes specification for macro: "+k.$inspect())},-1);return n(d,
|
|
1303
|
-
"resolves_attributes","resolve_attributes")})(p[0],p);(function(b,$super,e){b=d(b,$super,"Preprocessor");e=[b].concat(e);var f=a.$r(e);return c(b,"$process",function(a,b){return this.$raise(N("NotImplementedError"),""+f("Preprocessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);A(y("Preprocessor"),"DSL",y("DocumentProcessorDsl"));(function(b,$super,e){b=d(b,$super,"TreeProcessor");e=[b].concat(e);var f=a.$r(e);return c(b,"$process",function(a){return this.$raise(N("NotImplementedError"),
|
|
1304
|
-
""+f("TreeProcessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);A(y("TreeProcessor"),"DSL",y("DocumentProcessorDsl"));A(p[0],"Treeprocessor",y("TreeProcessor"));(function(b,$super,e){b=d(b,$super,"Postprocessor");e=[b].concat(e);var f=a.$r(e);return c(b,"$process",function(a,b){return this.$raise(N("NotImplementedError"),""+f("Postprocessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);A(y("Postprocessor"),
|
|
1305
|
-
"DSL",y("DocumentProcessorDsl"));(function(b,$super,e){b=d(b,$super,"IncludeProcessor");e=[b].concat(e);var f=a.$r(e);c(b,"$process",function(a,b,c,d){return this.$raise(N("NotImplementedError"),""+f("IncludeProcessor")+" subclass "+this.$class()+" must implement the #process method")});return c(b,"$handles?",B(!0))})(p[0],y("Processor"),p);(function(d,e){d=b(d,"IncludeProcessorDsl");e=[d].concat(e);e=a.$r(e);d.$include(e("DocumentProcessorDsl"));return c(d,"$handles?",function sa(a){var b=sa.$$p||
|
|
1306
|
-
H,c;null==this.handles_block&&(this.handles_block=H);sa.$$p=null;var d=g(arguments);return b!==H?(f(d["$empty?"]())||this.$raise(N("ArgumentError"),"wrong number of arguments (given "+d.$size()+", expected 0)"),this.handles_block=b):f((c=this.handles_block,null!=c&&c!==H)?"instance-variable":H)?this.handles_block.$call(d["$[]"](0)):!0},-1)})(p[0],p);A(y("IncludeProcessor"),"DSL",y("IncludeProcessorDsl"));(function(b,$super,e){b=d(b,$super,"DocinfoProcessor");e=[b].concat(e);var g=a.$r(e);b.$$prototype.config=
|
|
1307
|
-
H;c(b,"$initialize",function ma(a){var b,c;ma.$$p=null;null==a&&(a=h([],{}));D(this,E(this,"initialize",ma,!1,!0),"initialize",[a],null);return f(c=this.config["$[]"]("location"))?c:(b=["location","head"],m(this.config,"[]=",b),b[b.length-1])},-1);return c(b,"$process",function(a){return this.$raise(N("NotImplementedError"),""+g("DocinfoProcessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);(function(d,e){d=b(d,"DocinfoProcessorDsl");e=[d].concat(e);
|
|
1308
|
-
e=a.$r(e);d.$include(e("DocumentProcessorDsl"));return c(d,"$at_location",function(a){return this.$option("location",a)})})(p[0],p);A(y("DocinfoProcessor"),"DSL",y("DocinfoProcessorDsl"));(function(b,$super,e){b=d(b,$super,"BlockProcessor");e=[b].concat(e);var g=a.$r(e);b.$$prototype.config=H;b.$attr_accessor("name");c(b,"$initialize",function oa(a,b){var c,d=H;oa.$$p=null;null==a&&(a=H);null==b&&(b=h([],{}));D(this,E(this,"initialize",oa,!1,!0),"initialize",[b],null);this.name=f(d=a)?d:this.config["$[]"]("name");
|
|
1309
|
-
if(v(G,d=this.config["$[]"]("contexts")))if(f(a=this.config["$[]"]("contexts")))a;else this.config["$[]="]("contexts",["open","paragraph"].$to_set());else if(v(N("Symbol"),d))this.config["$[]="]("contexts",[this.config["$[]"]("contexts")].$to_set());else this.config["$[]="]("contexts",this.config["$[]"]("contexts").$to_set());return f(d=this.config["$[]"]("content_model"))?d:(c=["content_model","compound"],m(this.config,"[]=",c),c[c.length-1])},-1);return c(b,"$process",function(a,b,c){return this.$raise(N("NotImplementedError"),
|
|
1310
|
-
""+g("BlockProcessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);(function(d,e){d=b(d,"BlockProcessorDsl");e=[d].concat(e);e=a.$r(e);d.$include(e("SyntaxProcessorDsl"));c(d,"$contexts",function(a){var b=g(arguments);return this.$option("contexts",b.$flatten().$to_set())},-1);n(d,"on_contexts","contexts");n(d,"on_context","contexts");return n(d,"bind_to","contexts")})(p[0],p);A(y("BlockProcessor"),"DSL",y("BlockProcessorDsl"));(function(b,$super,e){b=
|
|
1311
|
-
d(b,$super,"MacroProcessor");e=[b].concat(e);var g=a.$r(e);b.$$prototype.config=H;b.$attr_accessor("name");c(b,"$initialize",function oa(a,b){var c,d=H;oa.$$p=null;null==a&&(a=H);null==b&&(b=h([],{}));D(this,E(this,"initialize",oa,!1,!0),"initialize",[b],null);this.name=f(d=a)?d:this.config["$[]"]("name");return f(d=this.config["$[]"]("content_model"))?d:(c=["content_model","attributes"],m(this.config,"[]=",c),c[c.length-1])},-1);return c(b,"$process",function(a,b,c){return this.$raise(N("NotImplementedError"),
|
|
1312
|
-
""+g("MacroProcessor")+" subclass "+this.$class()+" must implement the #process method")})})(p[0],y("Processor"),p);(function(d,f){d=b(d,"MacroProcessorDsl");f=[d].concat(f);f=a.$r(f);d.$include(f("SyntaxProcessorDsl"));c(d,"$resolve_attributes",function sa(a){var b=sa.$$p||H;sa.$$p=null;var c=g(arguments);if(e(c.$size(),1)&&t(c["$[]"](0)))return this.$option("content_model","text");D(this,E(this,"resolve_attributes",sa,!1,!0),"resolve_attributes",x(c),b);return this.$option("content_model","attributes")},
|
|
1313
|
-
-1);return n(d,"resolves_attributes","resolve_attributes")})(p[0],p);(function(b,$super,e){b=d(b,$super,"BlockMacroProcessor");e=[b].concat(e);var g=a.$r(e);b.$$prototype.name=H;return c(b,"$name",function(){f(g("MacroNameRx")["$match?"](this.name.$to_s()))||this.$raise(N("ArgumentError"),"invalid name for block macro: "+this.name);return this.name})})(p[0],y("MacroProcessor"),p);A(y("BlockMacroProcessor"),"DSL",y("MacroProcessorDsl"));(function(b,$super,g){b=d(b,$super,"InlineMacroProcessor");var k=
|
|
1314
|
-
[b].concat(g),l=a.$r(k);g=b.$$prototype;g.config=g.name=H;I(k[0],"@@rx_cache",h([],{}));c(b,"$regexp",function(){var a,b;return f(b=this.config["$[]"]("regexp"))?b:(a=["regexp",this.$resolve_regexp(this.name.$to_s(),this.config["$[]"]("format"))],m(this.config,"[]=",a),a[a.length-1])});return c(b,"$resolve_regexp",function(a,b){var c,d;f(l("MacroNameRx")["$match?"](a))||this.$raise(N("ArgumentError"),"invalid name for inline macro: "+a);return f(d=u(k[0],"@@rx_cache",!1)["$[]"]([a,b]))?d:(c=[[a,b],
|
|
1315
|
-
J(["\\\\?",a,":",e(b,"short")?"(){0}":"(\\S+?)","\\[(|",l("CC_ANY"),"*?[^\\\\])\\]"])],m(u(k[0],"@@rx_cache",!1),"[]=",c),c[c.length-1])})})(p[0],y("MacroProcessor"),p);(function(d,e){d=b(d,"InlineMacroProcessorDsl");e=[d].concat(e);e=a.$r(e);d.$include(e("MacroProcessorDsl"));c(d,"$format",function(a){return this.$option("format",a)});n(d,"match_format","format");n(d,"using_format","format");return c(d,"$match",function(a){return this.$option("regexp",a)})})(p[0],p);A(y("InlineMacroProcessor"),"DSL",
|
|
1316
|
-
y("InlineMacroProcessorDsl"));(function(a,$super){a=d(a,$super,"Extension");a.$attr_reader("kind");a.$attr_reader("config");a.$attr_reader("instance");return c(a,"$initialize",function(a,b,c){this.kind=a;this.instance=b;return this.config=c})})(p[0],null);(function(a,$super){a=d(a,$super,"ProcessorExtension");a.$attr_reader("process_method");return c(a,"$initialize",function ma(a,b,c){var d=H;ma.$$p=null;null==c&&(c=H);D(this,E(this,"initialize",ma,!1,!0),"initialize",[a,b,b.$config()],null);return this.process_method=
|
|
1317
|
-
f(d=c)?d:b.$method("process")},-3)})(p[0],y("Extension"));(function(b,$super,e){b=d(b,$super,"Group");e=[b].concat(e);(function(b,d){d=[b].concat(d);var e=a.$r(d);return c(b,"$register",function(a){null==a&&(a=H);return e("Extensions").$register(a,this)},-1)})(a.get_singleton_class(b),e);return c(b,"$activate",function(a){return this.$raise(N("NotImplementedError"))})})(p[0],null,p);(function(b,$super,k){b=d(b,$super,"Registry");k=[b].concat(k);var p=a.$r(k);k=b.$$prototype;k.document=k.groups=k.preprocessor_extensions=
|
|
1318
|
-
k.tree_processor_extensions=k.postprocessor_extensions=k.include_processor_extensions=k.docinfo_processor_extensions=k.block_extensions=k.block_macro_extensions=k.inline_macro_extensions=H;b.$attr_reader("document");b.$attr_reader("groups");c(b,"$initialize",function(a){null==a&&(a=h([],{}));this.groups=a;this.$reset();return this.document=this.preprocessor_extensions=this.tree_processor_extensions=this.postprocessor_extensions=this.include_processor_extensions=this.docinfo_processor_extensions=this.block_extensions=
|
|
1319
|
-
this.block_macro_extensions=this.inline_macro_extensions=H},-1);c(b,"$activate",function(a){var b=H;f(this.document)&&this.$reset();this.document=a;f((b=l(p("Extensions").$groups().$values(),this.groups.$values()))["$empty?"]())||m(b,"each",[],function ia(a){var b=null==ia.$$s?this:ia.$$s,c;null==a&&(a=H);if(v(N("Proc"),c=a))switch(a.$arity()){case 0:case -1:return m(b,"instance_exec",[],a.$to_proc());case 1:return a.$call(b);default:return H}else return v(r,c)?a.$new().$activate(b):a.$activate(b)},
|
|
1320
|
-
{$$s:this});return this});c(b,"$preprocessor",function ma(a){var b=ma.$$p||H;ma.$$p=null;var c=g(arguments);return m(this,"add_document_processor",["preprocessor",c],b.$to_proc())},-1);c(b,"$preprocessors?",function(){return this.preprocessor_extensions["$!"]()["$!"]()});c(b,"$preprocessors",K("preprocessor_extensions"));c(b,"$tree_processor",function oa(a){var b=oa.$$p||H;oa.$$p=null;var c=g(arguments);return m(this,"add_document_processor",["tree_processor",c],b.$to_proc())},-1);c(b,"$tree_processors?",
|
|
1321
|
-
function(){return this.tree_processor_extensions["$!"]()["$!"]()});c(b,"$tree_processors",K("tree_processor_extensions"));n(b,"treeprocessor","tree_processor");n(b,"treeprocessors?","tree_processors?");n(b,"treeprocessors","tree_processors");c(b,"$postprocessor",function ia(a){var b=ia.$$p||H;ia.$$p=null;var c=g(arguments);return m(this,"add_document_processor",["postprocessor",c],b.$to_proc())},-1);c(b,"$postprocessors?",function(){return this.postprocessor_extensions["$!"]()["$!"]()});c(b,"$postprocessors",
|
|
1322
|
-
K("postprocessor_extensions"));c(b,"$include_processor",function va(a){var b=va.$$p||H;va.$$p=null;var c=g(arguments);return m(this,"add_document_processor",["include_processor",c],b.$to_proc())},-1);c(b,"$include_processors?",function(){return this.include_processor_extensions["$!"]()["$!"]()});c(b,"$include_processors",K("include_processor_extensions"));c(b,"$docinfo_processor",function za(a){var b=za.$$p||H;za.$$p=null;var c=g(arguments);return m(this,"add_document_processor",["docinfo_processor",
|
|
1323
|
-
c],b.$to_proc())},-1);c(b,"$docinfo_processors?",function(a){null==a&&(a=H);return f(this.docinfo_processor_extensions)?f(a)?m(this.docinfo_processor_extensions,"any?",[],function(b){null==b&&(b=H);return b.$config()["$[]"]("location")["$=="](a)}):!0:!1},-1);c(b,"$docinfo_processors",function(a){null==a&&(a=H);return f(this.docinfo_processor_extensions)?f(a)?m(this.docinfo_processor_extensions,"select",[],function(b){null==b&&(b=H);return b.$config()["$[]"]("location")["$=="](a)}):this.docinfo_processor_extensions:
|
|
1324
|
-
H},-1);c(b,"$block",function Ca(a){var b=Ca.$$p||H;Ca.$$p=null;var c=g(arguments);return m(this,"add_syntax_processor",["block",c],b.$to_proc())},-1);c(b,"$blocks?",function(){return this.block_extensions["$!"]()["$!"]()});c(b,"$registered_for_block?",function(a,b){var c;return f(c=this.block_extensions["$[]"](a.$to_sym()))?f(c.$config()["$[]"]("contexts")["$include?"](b))?c:!1:!1});c(b,"$find_block_extension",function(a){return this.block_extensions["$[]"](a.$to_sym())});c(b,"$block_macro",function ua(a){var b=
|
|
1325
|
-
ua.$$p||H;ua.$$p=null;var c=g(arguments);return m(this,"add_syntax_processor",["block_macro",c],b.$to_proc())},-1);c(b,"$block_macros?",function(){return this.block_macro_extensions["$!"]()["$!"]()});c(b,"$registered_for_block_macro?",function(a){var b;return f(b=this.block_macro_extensions["$[]"](a.$to_sym()))?b:!1});c(b,"$find_block_macro_extension",function(a){return this.block_macro_extensions["$[]"](a.$to_sym())});c(b,"$inline_macro",function Da(a){var b=Da.$$p||H;Da.$$p=null;var c=g(arguments);
|
|
1326
|
-
return m(this,"add_syntax_processor",["inline_macro",c],b.$to_proc())},-1);c(b,"$inline_macros?",function(){return this.inline_macro_extensions["$!"]()["$!"]()});c(b,"$registered_for_inline_macro?",function(a){var b;return f(b=this.inline_macro_extensions["$[]"](a.$to_sym()))?b:!1});c(b,"$find_inline_macro_extension",function(a){return this.inline_macro_extensions["$[]"](a.$to_sym())});c(b,"$inline_macros",function(){return this.inline_macro_extensions.$values()});c(b,"$prefer",function Ea(a){var b=
|
|
1327
|
-
Ea.$$p||H,c=H;Ea.$$p=null;var d=g(arguments);b=v(p("ProcessorExtension"),c=d.$shift())?c:m(this,"send",[c].concat(x(d)),b.$to_proc());c=this.$instance_variable_get(("@"+b.$kind()+"_extensions").$to_sym());c.$unshift(c.$delete(b));return b},-1);b.$private();c(b,"$add_document_processor",function ya(b,c){var d=ya.$$p||H,g,k=H,h=H,l=H,n=H,q=g=h=H,r=H,u=H,w=H;k=H;ya.$$p=null;k=b.$to_s().$tr("_"," ");h=m(k.$split(),"map",[],function(a){null==a&&(a=H);return a.$capitalize()}).$join().$to_sym();l=p("Extensions").$const_get(h,
|
|
1328
|
-
!1);n=f(N("::","AsciidoctorJ","skip_raise")?"constant":H)?N(N("AsciidoctorJ"),"Extensions").$const_get(h,!1):H;h=f(g=this.$instance_variable_get(("@"+b+"_extensions").$to_sym()))?g:this.$instance_variable_set(("@"+b+"_extensions").$to_sym(),[]);d!==H?(q=this.$resolve_args(c,1),(r=l.$new(q)).$singleton_class().$enable_dsl(),e(d.$arity(),0)?m(r,"instance_exec",[],d.$to_proc()):a.yield1(d,r),f(r["$process_block_given?"]())||this.$raise(N("NoMethodError"),"No block specified to process "+k+" extension at "+
|
|
1329
|
-
d.$source_location().$join(":")),r.$freeze(),u=p("ProcessorExtension").$new(b,r)):(d=this.$resolve_args(c,2),g=z(d),r=null==g[0]?H:g[0],q=null==g[1]?H:g[1],d,f(w=p("Helpers").$resolve_class(r))?(f(L(w,l))||f(n)&&f(L(w,n))||this.$raise(N("ArgumentError"),"Invalid type for "+k+" extension: "+r),k=w.$new(q),k.$freeze(),u=p("ProcessorExtension").$new(b,k)):v(l,r)||f(n)&&v(n,r)?(r.$update_config(q),r.$freeze(),u=p("ProcessorExtension").$new(b,r)):this.$raise(N("ArgumentError"),"Invalid arguments specified for registering "+
|
|
1330
|
-
k+" extension: "+c));if(e(u.$config()["$[]"]("position"),">>"))h.$unshift(u);else h["$<<"](u);return u});c(b,"$add_syntax_processor",function Ha(b,c){var d=Ha.$$p||H,g,k,l=H,n=H,q=H,r=H,u=g=n=H,w=H,t=H;q=k=H;Ha.$$p=null;l=b.$to_s().$tr("_"," ");n=m(l.$split(),"map",[],function(a){null==a&&(a=H);return a.$capitalize()})["$<<"]("Processor").$join().$to_sym();q=p("Extensions").$const_get(n,!1);r=f(N("::","AsciidoctorJ","skip_raise")?"constant":H)?N(N("AsciidoctorJ"),"Extensions").$const_get(n,!1):H;
|
|
1331
|
-
n=f(g=this.$instance_variable_get(("@"+b+"_extensions").$to_sym()))?g:this.$instance_variable_set(("@"+b+"_extensions").$to_sym(),h([],{}));if(d!==H)return k=this.$resolve_args(c,2),g=z(k),u=null==g[0]?H:g[0],w=null==g[1]?H:g[1],k,(t=q.$new(this.$as_symbol(u),w)).$singleton_class().$enable_dsl(),e(d.$arity(),0)?m(t,"instance_exec",[],d.$to_proc()):a.yield1(d,t),f(u=this.$as_symbol(t.$name()))||this.$raise(N("ArgumentError"),"No name specified for "+l+" extension at "+d.$source_location().$join(":")),
|
|
1332
|
-
f(t["$process_block_given?"]())||this.$raise(N("NoMethodError"),"No block specified to process "+l+" extension at "+d.$source_location().$join(":")),t.$freeze(),g=[u,p("ProcessorExtension").$new(b,t)],m(n,"[]=",g),g[g.length-1];k=this.$resolve_args(c,3);g=z(k);t=null==g[0]?H:g[0];u=null==g[1]?H:g[1];w=null==g[2]?H:g[2];k;return f(k=p("Helpers").$resolve_class(t))?(f(L(k,q))||f(r)&&f(L(k,r))||this.$raise(N("ArgumentError"),"Class specified for "+l+" extension does not inherit from "+q+": "+t),q=k.$new(this.$as_symbol(u),
|
|
1333
|
-
w),f(u=this.$as_symbol(q.$name()))||this.$raise(N("ArgumentError"),"No name specified for "+l+" extension: "+t),q.$freeze(),g=[u,p("ProcessorExtension").$new(b,q)],m(n,"[]=",g),g[g.length-1]):v(q,t)||f(r)&&v(r,t)?(t.$update_config(w),f(u=f(u)?(g=[this.$as_symbol(u)],m(t,"name=",g),g[g.length-1]):this.$as_symbol(t.$name()))||this.$raise(N("ArgumentError"),"No name specified for "+l+" extension: "+t),t.$freeze(),g=[u,p("ProcessorExtension").$new(b,t)],m(n,"[]=",g),g[g.length-1]):this.$raise(N("ArgumentError"),
|
|
1334
|
-
"Invalid arguments specified for registering "+l+" extension: "+c)});c(b,"$reset",function(){return this.document=this.preprocessor_extensions=this.tree_processor_extensions=this.postprocessor_extensions=this.include_processor_extensions=this.docinfo_processor_extensions=this.block_extensions=this.block_macro_extensions=this.inline_macro_extensions=H});c(b,"$resolve_args",function(a,b){var c;var d=v(N("Hash"),a["$[]"](-1))?a.$pop():h([],{});if(e(b,1))return d;f(q(c=C(C(b,1),a.$size()),0))?a=l(a,N("Array").$new(c)):
|
|
1335
|
-
f(L(c,0))&&a.$pop(c["$-@"]());a["$<<"](d);return a});return c(b,"$as_symbol",function(a){return f(a)?a.$to_sym():H})})(p[0],null,p);return function(b,d){d=[b].concat(d);var e=a.$r(d);c(b,"$generate_name",function(){return"extgrp"+this.$next_auto_id()});c(b,"$next_auto_id",function(){var a=H;null==this.auto_id&&(this.auto_id=H);this.auto_id=f(a=this.auto_id)?a:-1;return this.auto_id=l(this.auto_id,1)});c(b,"$groups",function(){var a=H;null==this.groups&&(this.groups=H);return this.groups=f(a=this.groups)?
|
|
1336
|
-
a:h([],{})});c(b,"$create",function fa(a){var b=fa.$$p||H,c=H;fa.$$p=null;null==a&&(a=H);return b!==H?e("Registry").$new(w(f(c=a)?c:this.$generate_name(),b)):e("Registry").$new()},-1);c(b,"$register",function ma(a){var b=ma.$$p||H,c,d=H,k,h=H;ma.$$p=null;var l=g(arguments);var n=l.$size();b!==H?d=b:f(k=l.$pop())?d=f(h=e("Helpers").$resolve_class(k))?h:k:this.$raise(N("ArgumentError"),"Extension group to register not specified");b=f(h=l.$pop())?h:this.$generate_name();f(l["$empty?"]())||this.$raise(N("ArgumentError"),
|
|
1337
|
-
"Wrong number of arguments ("+n+" for 1..2)");return c=[b.$to_sym(),d],m(this.$groups(),"[]=",c),c[c.length-1]},-1);c(b,"$unregister_all",function(){this.groups=h([],{});return H});return c(b,"$unregister",function(a){var b=g(arguments);m(b,"each_with_object",[this.$groups()],function(a,b){null==a&&(a=H);null==b&&(b=H);return b.$delete(a.$to_sym())});return H},-1)}(a.get_singleton_class(k),p)}(k[0],k)}(M[0],M)};Opal.modules["asciidoctor/js/asciidoctor_ext/stylesheet"]=function(a){var b=a.module,d=
|
|
1338
|
-
a.klass,f=a.truthy,h=a.def,c=[],m=a.nil,n=a.$$$;a.add_stubs("rstrip,read,join");return function(a,c){return function(a,$super){a=d(a,$super,"Stylesheets");a.$$prototype.primary_stylesheet_data=m;return h(a,"$primary_stylesheet_data",function(){var a=m;return this.primary_stylesheet_data=f(a=this.primary_stylesheet_data)?a:n("IO").$read(n("File").$join("css","asciidoctor.css")).$rstrip()})}([b(a,"Asciidoctor")].concat(c)[0],null)}(c[0],c)};Opal.modules["asciidoctor/js/asciidoctor_ext/document"]=function(a){var b=
|
|
1339
|
-
a.module,d=a.klass,f=a.def,h=[];return function(c,k){c=[b(c,"Asciidoctor")].concat(k);k=a.$r(c);return function(b,$super){b=d(b,$super,"Document");return f(b,"$fill_datetime_attributes",function(b,c){var d=a.truthy,e=a.falsy,f=a.nil,k,h,l=function(a,b){return 0===b?a.getUTCFullYear():a.getFullYear()},m=function(a,b){return 0===b?a.getUTCMonth():a.getMonth()};var n=function(a,b){return 0===b?a.getUTCDate():a.getDate()};var p=function(a,b){return 0===b?a.getUTCHours():a.getHours()},q=new Date;if(a.const_get_qualified("::",
|
|
1340
|
-
"ENV")["$key?"]("SOURCE_DATE_EPOCH")){q.setTime(1E3*parseInt(a.const_get_qualified("::","ENV")["$[]"]("SOURCE_DATE_EPOCH")));var t=q;var u=0}else u=-q.getTimezoneOffset()/60;if(d(k=b["$[]"]("localdate")))e(h=b["$[]"]("localyear"))&&(h=4===k.indexOf("-")?k.substring(0,4):f,b["$[]="]("localyear",h));else{var v=l(q,u).toString();k=("0"+(m(q,u)+1)).slice(-2);h=("0"+n(q,u)).slice(-2);k=v+"-"+k+"-"+h;b["$[]="]("localdate",k);h=v;b["$[]="]("localyear",v)}if(e(v=b["$[]"]("localtime"))){h=("0"+p(q,u)).slice(-2);
|
|
1341
|
-
var r=("0"+q.getMinutes()).slice(-2),x=("0"+q.getSeconds()).slice(-2);v=0===u?"UTC":0<u?("+0"+100*u).slice(-5):("-0"+100*-u).slice(-5);v=h+":"+r+":"+x+" "+v;b["$[]="]("localtime",v)}if(e(b["$[]"]("localdatetime")))b["$[]="]("localdatetime",k+" "+v);d(t)?c=t:d(c)?u=-c.getTimezoneOffset()/60:c=q;if(d(d=b["$[]"]("docdate")))b["$[]="]("docyear",4===d.indexOf("-")?d.substring(0,4):f);else if(l=l(c,u).toString(),m=("0"+(m(c,u)+1)).slice(-2),n=("0"+n(c,u)).slice(-2),d=l+"-"+m+"-"+n,b["$[]="]("docdate",d),
|
|
1342
|
-
e(b["$[]"]("docyear")))b["$[]="]("docyear",l);e(n=b["$[]"]("doctime"))&&(p=("0"+p(c,u)).slice(-2),n=("0"+c.getMinutes()).slice(-2),c=("0"+c.getSeconds()).slice(-2),v=0===u?"UTC":0<u?("+0"+100*u).slice(-5):("-0"+100*-u).slice(-5),n=p+":"+n+":"+c+" "+v,b["$[]="]("doctime",n));if(e(b["$[]"]("docdatetime")))b["$[]="]("docdatetime",d+" "+n);return f})}(c[0],k("AbstractBlock"))}(h[0],h)};Opal.modules["asciidoctor/js/asciidoctor_ext/substitutors"]=function(a){var b=a.module,d=a.def;a=[];return function(a,
|
|
1343
|
-
k){return function(a){a=b(a,"Substitutors");return d(a,"$sub_placeholder",function(a,b){return a.replace("%s",b)})}([b(a,"Asciidoctor")].concat(k)[0])}(a[0],a)};Opal.modules["asciidoctor/js/asciidoctor_ext/parser"]=function(a){var b=a.module,d=a.klass,f=a.truthy,h=a.defs;a=[];return function(a,k){return function(a,$super){a=d(a,$super,"Parser");return f(String.prototype.repeat)?h(a,"$uniform?",function(a,b,c){return b.repeat(c)===a}):h(a,"$uniform?",function(a,b,c){return Array.apply(null,{length:c}).map(function(){return b}).join("")===
|
|
1344
|
-
a})}([b(a,"Asciidoctor")].concat(k)[0],null)}(a[0],a)};Opal.modules["asciidoctor/js/asciidoctor_ext/syntax_highlighter"]=function(a){var b=a.module,d=a.truthy,f=a.def,h=[],c=a.nil;a.add_stubs("key?,registry,[],include?,include,empty?,debug,logger,join,keys");return function(k,h){k=[b(k,"Asciidoctor")].concat(h);return function(g,k){g=[b(g,"SyntaxHighlighter")].concat(k);return function(e,g){e=b(e,"Factory");g=[e].concat(g);var k=a.$r(g);return f(e,"$for",function(a){if(d(this.$registry()["$key?"](a)))return this.$registry()["$[]"](a);
|
|
1345
|
-
d(this["$include?"](k("Logging")))||this.$include(k("Logging"));d(this.$registry()["$empty?"]())?this.$logger().$debug("no syntax highlighter available, functionality disabled."):this.$logger().$debug("syntax highlighter named '"+a+"' is not available, must be one of: '"+this.$registry().$keys().$join("', '")+"'.");return c})}(g[0],g)}(k[0],k)}(h[0],h)};Opal.modules["asciidoctor/js/asciidoctor_ext"]=function(a){var b=a.top;a.add_stubs("require");b.$require("asciidoctor/js/asciidoctor_ext/stylesheet");
|
|
1346
|
-
b.$require("asciidoctor/js/asciidoctor_ext/document");b.$require("asciidoctor/js/asciidoctor_ext/substitutors");b.$require("asciidoctor/js/asciidoctor_ext/parser");b.$require("asciidoctor/js/asciidoctor_ext/syntax_highlighter");b.$require("asciidoctor/js/asciidoctor_ext/browser")};Opal.modules["asciidoctor/js/opal_ext/logger"]=function(a){var b=a.klass,d=a.def,f=a.truthy,h=a.rb_lt,c=[],m=a.nil;a.add_stubs("chr,rjust,message_as_string,<,write,call,[]");return function(c,$super,k){c=b(c,$super,"Logger");
|
|
1347
|
-
k=[c].concat(k);var e=a.$r(k),l=c.$$prototype;l.level=l.progname=l.pipe=l.formatter=m;(function(a,$super){a=b(a,$super,"Formatter");return d(a,"$call",function(a,b,c,d){b=b.getFullYear()+"-"+("0"+(b.getMonth()+1)).slice(-2)+"-"+("0"+b.getDate()).slice(-2)+"T"+("0"+b.getHours()).slice(-2)+":"+("0"+b.getMinutes()).slice(-2)+":"+("0"+b.getSeconds()).slice(-2)+"."+("00"+1E3*(new Date).getMilliseconds()).slice(-6);return""+a.$chr()+", ["+b+"] "+a.$rjust(5)+" -- "+c+": "+this.$message_as_string(d)})})(k[0],
|
|
1348
|
-
null);return d(c,"$add",function Z(b,c,d){var k=Z.$$p||m,l=m;Z.$$p=null;null==c&&(c=m);null==d&&(d=m);if(f(h(b=f(l=b)?l:e("UNKNOWN"),this.level)))return!0;d=f(l=d)?l:this.progname;f(c)||(k!==m?c=a.yieldX(k,[]):(c=d,d=this.progname));this.pipe.$write(this.formatter.$call(f(l=e("SEVERITY_LABELS")["$[]"](b))?l:"ANY",new Date,d,c));return!0},-2)}(c[0],null,c)};Opal.modules["asciidoctor/js/postscript"]=function(a){var b=a.top;a.add_stubs("require");b.$require("asciidoctor/converter/composite");b.$require("asciidoctor/converter/html5");
|
|
1349
|
-
b.$require("asciidoctor/extensions");b.$require("asciidoctor/js/asciidoctor_ext");return b.$require("asciidoctor/js/opal_ext/logger")};Opal.queue(function(a){var b=a.module,d=a.const_set,f=a.send,h=a.to_ary,c=a.defs,m=a.def,n=a.truthy,g=a.hash2,l=a.eqeq,e=a.rb_minus,q=a.regexp,t=a.top,v=[],x=a.nil,z=a.$$$;a.add_stubs("require,==,to_h,sort,map,constants,const_get,downcase,to_s,<=>,upcase,[],values,new,attr_reader,instance_variable_set,send,singleton_class,<<,define,dirname,absolute_path,join,home,pwd,to_set,tap,each,chr,each_key,[]=,slice,length,-,merge,default=,drop,insert");
|
|
1350
|
-
t.$require("set");t.$require("asciidoctor/js");(function(k,p){k=[b(k,"Asciidoctor")].concat(p);var t=a.$r(k);p=x;d(k[0],"RUBY_ENGINE_OPAL",d(k[0],"RUBY_ENGINE",z("RUBY_ENGINE"))["$=="]("opal"));(function(a,e){a=b(a,"SafeMode");e=[a].concat(e);d(e[0],"UNSAFE",0);d(e[0],"SAFE",1);d(e[0],"SERVER",10);d(e[0],"SECURE",20);a.names_by_value=f(f(a.$constants(!1),"map",[],function pa(a){var b=null==pa.$$s?this:pa.$$s;null==a&&(a=x);return[b.$const_get(a),a.$to_s().$downcase()]},{$$s:a}),"sort",[],function(a,
|
|
1351
|
-
b){null==a&&(a=x);null==b&&(b=x);var c=h(a);var d=null==c[0]?x:c[0];a;a=b;c=h(a);b=null==c[0]?x:c[0];a;return d["$<=>"](b)},{$$has_top_level_mlhs_arg:!0}).$to_h();c(a,"$value_for_name",function(a){return this.$const_get(a.$upcase(),!1)});c(a,"$name_for_value",function(a){null==this.names_by_value&&(this.names_by_value=x);return this.names_by_value["$[]"](a)});return c(a,"$names",function(){null==this.names_by_value&&(this.names_by_value=x);return this.names_by_value.$values()})})(k[0],k);(function(c,
|
|
1352
|
-
d){c=b(c,"Compliance");d=[c].concat(d);c.keys=z("Set").$new();(function(a,b){a.$attr_reader("keys");return m(a,"$define",function(a,b){null==this.keys&&(this.keys=x);this.$instance_variable_set("@"+a,b);this.$singleton_class().$send("attr_accessor",a);this.keys["$<<"](a);return x})})(a.get_singleton_class(c),d);c.$define("block_terminates_paragraph",!0);c.$define("strict_verbatim_paragraphs",!0);c.$define("underline_style_section_titles",!0);c.$define("unwrap_standalone_preamble",!0);c.$define("attribute_missing",
|
|
1353
|
-
"skip");c.$define("attribute_undefined","drop-line");c.$define("shorthand_property_syntax",!0);c.$define("natural_xrefs",!0);c.$define("unique_id_start_index",2);return c.$define("markdown_syntax",!0)})(k[0],k);n(t("ROOT_DIR","skip_raise")?"constant":x)||d(k[0],"ROOT_DIR",z("File").$dirname(z("File").$absolute_path(".")));d(k[0],"LIB_DIR",z("File").$join(t("ROOT_DIR"),"lib"));d(k[0],"DATA_DIR",z("File").$join(t("ROOT_DIR"),"data"));var v=k[0];a:{try{var y=z("Dir").$home();break a}catch(ka){if(a.rescue(ka,
|
|
1354
|
-
[t("StandardError")]))try{y=n(p=z("ENV")["$[]"]("HOME"))?p:z("Dir").$pwd();break a}finally{a.pop_exception()}else throw ka;}y=void 0}d(v,"USER_HOME",y);d(k[0],"LF","\n");d(k[0],"NULL","\x00");d(k[0],"TAB","\t");d(k[0],"MAX_INT",9007199254740991);d(k[0],"UTF_8",z(z("Encoding"),"UTF_8"));d(k[0],"BOM_BYTES_UTF_8",[239,187,191]);d(k[0],"BOM_BYTES_UTF_16LE",[255,254]);d(k[0],"BOM_BYTES_UTF_16BE",[254,255]);d(k[0],"FILE_READ_MODE",n(t("RUBY_ENGINE_OPAL"))?"r":"rb:utf-8:utf-8");d(k[0],"URI_READ_MODE",t("FILE_READ_MODE"));
|
|
1355
|
-
d(k[0],"FILE_WRITE_MODE",n(t("RUBY_ENGINE_OPAL"))?"w":"w:utf-8");d(k[0],"DEFAULT_DOCTYPE","article");d(k[0],"DEFAULT_BACKEND","html5");d(k[0],"DEFAULT_STYLESHEET_KEYS",["","DEFAULT"].$to_set());d(k[0],"DEFAULT_STYLESHEET_NAME","asciidoctor.css");d(k[0],"BACKEND_ALIASES",g(["html","docbook"],{html:"html5",docbook:"docbook5"}));d(k[0],"DEFAULT_PAGE_WIDTHS",g(["docbook"],{docbook:425}));d(k[0],"DEFAULT_EXTENSIONS",g("html docbook pdf epub manpage asciidoc".split(" "),{html:".html",docbook:".xml",pdf:".pdf",
|
|
1356
|
-
epub:".epub",manpage:".man",asciidoc:".adoc"}));d(k[0],"ASCIIDOC_EXTENSIONS",g([".adoc",".asciidoc",".asc",".ad",".txt"],{".adoc":!0,".asciidoc":!0,".asc":!0,".ad":!0,".txt":!0}));d(k[0],"SETEXT_SECTION_LEVELS",g(["=","-","~","^","+"],{"=":0,"-":1,"~":2,"^":3,"+":4}));d(k[0],"ADMONITION_STYLES",["NOTE","TIP","IMPORTANT","WARNING","CAUTION"].$to_set());d(k[0],"ADMONITION_STYLE_HEADS",f(z("Set").$new(),"tap",[],function(a){null==a&&(a=x);return f(t("ADMONITION_STYLES"),"each",[],function(b){null==b&&
|
|
1357
|
-
(b=x);return a["$<<"](b.$chr())})}));d(k[0],"PARAGRAPH_STYLES","comment example literal listing normal open pass quote sidebar source verse abstract partintro".split(" ").$to_set());d(k[0],"VERBATIM_STYLES",["literal","listing","source","verse"].$to_set());d(k[0],"DELIMITED_BLOCKS",g("-- ---- .... ==== **** ____ ++++ |=== ,=== :=== !=== //// ```".split(" "),{"--":["open","comment example literal listing pass quote sidebar source verse admonition abstract partintro".split(" ").$to_set()],"----":["listing",
|
|
1358
|
-
["literal","source"].$to_set()],"....":["literal",["listing","source"].$to_set()],"====":["example",["admonition"].$to_set()],"****":["sidebar",z("Set").$new()],____:["quote",["verse"].$to_set()],"++++":["pass",["stem","latexmath","asciimath"].$to_set()],"|===":["table",z("Set").$new()],",===":["table",z("Set").$new()],":===":["table",z("Set").$new()],"!===":["table",z("Set").$new()],"////":["comment",z("Set").$new()],"```":["fenced_code",z("Set").$new()]}));d(k[0],"DELIMITED_BLOCK_HEADS",f(g([],
|
|
1359
|
-
{}),"tap",[],function(a){null==a&&(a=x);return f(t("DELIMITED_BLOCKS"),"each_key",[],function(b){var c;null==b&&(b=x);return c=[b.$slice(0,2),!0],f(a,"[]=",c),c[c.length-1]})}));d(k[0],"DELIMITED_BLOCK_TAILS",f(g([],{}),"tap",[],function(a){null==a&&(a=x);return f(t("DELIMITED_BLOCKS"),"each_key",[],function(b){var c;null==b&&(b=x);return l(b.$length(),4)?(c=[b,b["$[]"](e(b.$length(),1))],f(a,"[]=",c),c[c.length-1]):x})}));d(k[0],"CAPTION_ATTRIBUTE_NAMES",g(["example","figure","listing","table"],
|
|
1360
|
-
{example:"example-caption",figure:"figure-caption",listing:"listing-caption",table:"table-caption"}));d(k[0],"LAYOUT_BREAK_CHARS",g(["'","<"],{"'":"thematic_break","<":"page_break"}));d(k[0],"MARKDOWN_THEMATIC_BREAK_CHARS",g(["-","*","_"],{"-":"thematic_break","*":"thematic_break",_:"thematic_break"}));d(k[0],"HYBRID_LAYOUT_BREAK_CHARS",t("LAYOUT_BREAK_CHARS").$merge(t("MARKDOWN_THEMATIC_BREAK_CHARS")));d(k[0],"NESTABLE_LIST_CONTEXTS",["ulist","olist","dlist"]);d(k[0],"ORDERED_LIST_STYLES",["arabic",
|
|
1361
|
-
"loweralpha","lowerroman","upperalpha","upperroman"]);d(k[0],"ORDERED_LIST_KEYWORDS",g(["loweralpha","lowerroman","upperalpha","upperroman"],{loweralpha:"a",lowerroman:"i",upperalpha:"A",upperroman:"I"}));d(k[0],"ATTR_REF_HEAD","{");d(k[0],"LIST_CONTINUATION","+");d(k[0],"HARD_LINE_BREAK"," +");d(k[0],"LINE_CONTINUATION"," \\");d(k[0],"LINE_CONTINUATION_LEGACY"," +");d(k[0],"BLOCK_MATH_DELIMITERS",g(["asciimath","latexmath"],{asciimath:["\\$","\\$"],latexmath:["\\[","\\]"]}));d(k[0],"INLINE_MATH_DELIMITERS",
|
|
1362
|
-
g(["asciimath","latexmath"],{asciimath:["\\$","\\$"],latexmath:["\\(","\\)"]}));d(k[0],"STEM_TYPE_ALIASES",g(["latexmath","latex","tex"],{latexmath:"latexmath",latex:"latexmath",tex:"latexmath"}))["$default="]("asciimath");d(k[0],"FONT_AWESOME_VERSION","4.7.0");d(k[0],"HIGHLIGHT_JS_VERSION","9.18.3");d(k[0],"MATHJAX_VERSION","2.7.9");d(k[0],"DEFAULT_ATTRIBUTES",g("appendix-caption appendix-refsig caution-caption chapter-refsig example-caption figure-caption important-caption last-update-label note-caption part-refsig prewrap sectids section-refsig table-caption tip-caption toc-placement toc-title untitled-label version-label warning-caption".split(" "),
|
|
1363
|
-
{"appendix-caption":"Appendix","appendix-refsig":"Appendix","caution-caption":"Caution","chapter-refsig":"Chapter","example-caption":"Example","figure-caption":"Figure","important-caption":"Important","last-update-label":"Last updated","note-caption":"Note","part-refsig":"Part",prewrap:"",sectids:"","section-refsig":"Section","table-caption":"Table","tip-caption":"Tip","toc-placement":"auto","toc-title":"Table of Contents","untitled-label":"Untitled","version-label":"Version","warning-caption":"Warning"}));
|
|
1364
|
-
d(k[0],"FLEXIBLE_ATTRIBUTES",["sectnums"]);d(k[0],"INTRINSIC_ATTRIBUTES",g("startsb endsb vbar caret asterisk tilde plus backslash backtick blank empty sp two-colons two-semicolons nbsp deg zwsp quot apos lsquo rsquo ldquo rdquo wj brvbar pp cpp amp lt gt".split(" "),{startsb:"[",endsb:"]",vbar:"|",caret:"^",asterisk:"*",tilde:"~",plus:"+",backslash:"\\",backtick:"`",blank:"",empty:"",sp:" ","two-colons":"::","two-semicolons":";;",nbsp:" ",deg:"°",zwsp:"​",quot:""",apos:"'",
|
|
1365
|
-
lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",wj:"⁠",brvbar:"¦",pp:"++",cpp:"C++",amp:"&",lt:"<",gt:">"}));x;d(k[0],"QUOTE_SUBS",f(g([],{}),"tap",[],function(a){var b;null==a&&(a=x);a["$[]="](!1,b=[["strong","unconstrained",q(["\\\\?(?:\\[([^\\]]+)\\])?\\*\\*(",t("CC_ALL"),"+?)\\*\\*"],"m")],["strong","constrained",q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?\\*(\\S|\\S",t("CC_ALL"),"*?\\S)\\*(?!",t("CG_WORD"),")"],"m")],["double","constrained",q(["(^|[^",
|
|
1366
|
-
t("CC_WORD"),';:}])(?:\\[([^\\]]+)\\])?"`(\\S|\\S',t("CC_ALL"),'*?\\S)`"(?!',t("CG_WORD"),")"],"m")],["single","constrained",q(["(^|[^",t("CC_WORD"),";:`}])(?:\\[([^\\]]+)\\])?'`(\\S|\\S",t("CC_ALL"),"*?\\S)`'(?!",t("CG_WORD"),")"],"m")],["monospaced","unconstrained",q(["\\\\?(?:\\[([^\\]]+)\\])?``(",t("CC_ALL"),"+?)``"],"m")],["monospaced","constrained",q(["(^|[^",t("CC_WORD"),";:\"'`}])(?:\\[([^\\]]+)\\])?`(\\S|\\S",t("CC_ALL"),"*?\\S)`(?![",t("CC_WORD"),"\"'`])"],"m")],["emphasis","unconstrained",
|
|
1367
|
-
q(["\\\\?(?:\\[([^\\]]+)\\])?__(",t("CC_ALL"),"+?)__"],"m")],["emphasis","constrained",q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?_(\\S|\\S",t("CC_ALL"),"*?\\S)_(?!",t("CG_WORD"),")"],"m")],["mark","unconstrained",q(["\\\\?(?:\\[([^\\]]+)\\])?##(",t("CC_ALL"),"+?)##"],"m")],["mark","constrained",q(["(^|[^",t("CC_WORD"),"&;:}])(?:\\[([^\\]]+)\\])?#(\\S|\\S",t("CC_ALL"),"*?\\S)#(?!",t("CG_WORD"),")"],"m")],["superscript","unconstrained",/\\?(?:\[([^\]]+)\])?\^(\S+?)\^/],["subscript","unconstrained",
|
|
1368
|
-
/\\?(?:\[([^\]]+)\])?~(\S+?)~/]]);a["$[]="](!0,a=b.$drop(0));a["$[]="](2,["double","constrained",q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?``(\\S|\\S",t("CC_ALL"),"*?\\S)''(?!",t("CG_WORD"),")"],"m")]);a["$[]="](3,["single","constrained",q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?`(\\S|\\S",t("CC_ALL"),"*?\\S)'(?!",t("CG_WORD"),")"],"m")]);a["$[]="](4,["monospaced","unconstrained",q(["\\\\?(?:\\[([^\\]]+)\\])?\\+\\+(",t("CC_ALL"),"+?)\\+\\+"],"m")]);a["$[]="](5,["monospaced","constrained",
|
|
1369
|
-
q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?\\+(\\S|\\S",t("CC_ALL"),"*?\\S)\\+(?!",t("CG_WORD"),")"],"m")]);return a.$insert(3,["emphasis","constrained",q(["(^|[^",t("CC_WORD"),";:}])(?:\\[([^\\]]+)\\])?'(\\S|\\S",t("CC_ALL"),"*?\\S)'(?!",t("CG_WORD"),")"],"m")])}));d(k[0],"REPLACEMENTS",[[/\\?\(C\)/,"©","none"],[/\\?\(R\)/,"®","none"],[/\\?\(TM\)/,"™","none"],[/(?: |\n|^|\\)--(?: |\n|$)/," — ","none"],[q(["(",t("CG_WORD"),")\\\\?--(?=",t("CG_WORD"),")"]),
|
|
1370
|
-
"—​","leading"],[/\\?\.\.\./,"…​","none"],[/\\?`'/,"’","none"],[q(["(",t("CG_ALNUM"),")\\\\?'(?=",t("CG_ALPHA"),")"]),"’","leading"],[/\\?->/,"→","none"],[/\\?=>/,"⇒","none"],[/\\?<-/,"←","none"],[/\\?<=/,"⇐","none"],[/\\?(&)amp;((?:[a-zA-Z][a-zA-Z]+\d{0,2}|#\d\d\d{0,4}|#x[\da-fA-F][\da-fA-F][\da-fA-F]{0,3});)/,"","bounding"]]);x;return x})(v[0],v);t.$require("asciidoctor.rb/../asciidoctor/core_ext");t.$require("asciidoctor.rb/../asciidoctor/helpers");
|
|
1371
|
-
t.$require("asciidoctor.rb/../asciidoctor/logging");t.$require("asciidoctor.rb/../asciidoctor/rx");t.$require("asciidoctor.rb/../asciidoctor/substitutors");t.$require("asciidoctor.rb/../asciidoctor/version");t.$require("asciidoctor.rb/../asciidoctor/abstract_node");t.$require("asciidoctor.rb/../asciidoctor/abstract_block");t.$require("asciidoctor.rb/../asciidoctor/attribute_list");t.$require("asciidoctor.rb/../asciidoctor/block");t.$require("asciidoctor.rb/../asciidoctor/callouts");t.$require("asciidoctor.rb/../asciidoctor/converter");
|
|
1372
|
-
t.$require("asciidoctor.rb/../asciidoctor/document");t.$require("asciidoctor.rb/../asciidoctor/inline");t.$require("asciidoctor.rb/../asciidoctor/list");t.$require("asciidoctor.rb/../asciidoctor/parser");t.$require("asciidoctor.rb/../asciidoctor/path_resolver");t.$require("asciidoctor.rb/../asciidoctor/reader");t.$require("asciidoctor.rb/../asciidoctor/section");t.$require("asciidoctor.rb/../asciidoctor/stylesheets");t.$require("asciidoctor.rb/../asciidoctor/table");t.$require("asciidoctor.rb/../asciidoctor/writer");
|
|
1373
|
-
t.$require("asciidoctor.rb/../asciidoctor/load");t.$require("asciidoctor.rb/../asciidoctor/convert");t.$require("asciidoctor.rb/../asciidoctor/syntax_highlighter");t.$require("asciidoctor.rb/../asciidoctor/timings");return t.$require("asciidoctor/js/postscript")});var E=function(a){return a&&!a.$$is_hash?Opal.hash2(Object.keys(a),a):a},B=function(a){var b={};if(a){var d=a.$$smap;for(c in d){var f=d[c];b[c]=f===Opal.nil?void 0:f}if(a=a.$$map){d=[];for(var h in a){var c=a[h];f=c.value;d[c.key-1]=f===
|
|
1374
|
-
Opal.nil?void 0:f}0<d.length&&(b.$positional=d)}}return b},A=function(a){if(a=E(a)){var b=a["$[]"]("converter");if(b&&b!==Opal.nil)a["$[]="]("converter",z(b));(b=a["$[]"]("attributes"))&&"object"===typeof b&&"Object"===b.constructor.name&&(a=a.$dup(),a["$[]="]("attributes",E(b)))}return a},z=function(a){var b=function(a,b){if(a.backend_traits)b.backend_traits=E(a.backend_traits);else if(a.backendTraits)b.backend_traits=E(a.backendTraits);else if(a.basebackend||a.outfilesuffix||a.filetype||a.htmlsyntax||
|
|
1375
|
-
a.supports_templates)b.backend_traits=E(Object.assign({},a.basebackend?{basebackend:a.basebackend}:{},a.outfilesuffix?{outfilesuffix:a.outfilesuffix}:{},a.filetype?{filetype:a.filetype}:{},a.htmlsyntax?{htmlsyntax:a.htmlsyntax}:{},a.supports_templates?{supports_templates:a.supports_templates}:{}))},d=function(a,b){c(a,b,"$handles?","handles",function(){return!0})},f=function(a,b){c(a,b,"$==","==",function(a){return b===a})},h=function(a,b){c(a,b,"$send","send",function(a){var c=$jscomp.makeIterator(Array.from(arguments));
|
|
1376
|
-
c.next();c=$jscomp.arrayFromIterator(c);var d=b["$"+a];if(d)return d.apply(b,c);throw Error("undefined method `"+a+"` for `"+b.toString()+"`");})},c=function(a,b,c,d,f){"undefined"===typeof a[c]&&("function"===typeof a[d]?b[c]=a[d]:f&&(b[c]=f))},m=function(a){"function"!==typeof a["$respond_to?"]&&(a["$respond_to?"]=function(a){return"function"===typeof this[a]})};if("function"===typeof a)return f=n(W,a.constructor.name,{initialize:function(f,e){var g=new a(f,e);Object.assign(this,g);b(g,this);for(var k=
|
|
1377
|
-
Object.getOwnPropertyNames(a.prototype),h=0;h<k.length;h++){var l=k[h];"constructor"!==l&&(this[l]=g[l])}"undefined"===typeof g.$convert&&"function"===typeof g.convert&&(this.$convert=g.convert);d(g,this);c(g,this,"$composed","composed");m(this);this.super(f,e)}}),f.$extend(N),f;if("object"===typeof a){"undefined"===typeof a.$convert&&"function"===typeof a.convert&&(a.$convert=a.convert);b(a,a);if(a.backend_traits){for(var q=$jscomp.makeIterator("basebackend filetype htmlsyntax outfilesuffix supports_templates supports_templates? init_backend_traits backend_traits".split(" ")),
|
|
1378
|
-
g=q.next();!g.done;g=q.next())g=g.value,a["$"+g]=N.prototype["$"+g];a.$$meta=N}d(a,a);c(a,a,"$composed","composed");f(a,a);h(a,a);m(a)}return a},m=Opal.Asciidoctor.$$class;m.prototype.getCoreVersion=function(){return this.$$const.VERSION};m.prototype.getRuntime=function(){return{ioModule:Opal.const_get_qualified("::","JAVASCRIPT_IO_MODULE"),platform:Opal.const_get_qualified("::","JAVASCRIPT_PLATFORM"),engine:Opal.const_get_qualified("::","JAVASCRIPT_ENGINE"),framework:Opal.const_get_qualified("::",
|
|
1379
|
-
"JAVASCRIPT_FRAMEWORK")}};m.prototype.convert=function(a,b){"object"===typeof a&&"Buffer"===a.constructor.name&&(a=a.toString("utf8"));var d=b&&b.to_file;"object"===typeof d&&"Writable"===d.constructor.name&&"function"===typeof d.write&&(d["$respond_to?"]=function(a){return"write"===a},d.$object_id=function(){return""},d.$write=function(a){this.write(a)});b=A(b);a=this.$convert(a,b);"object"===typeof d&&"Writable"===d.constructor.name&&"function"===typeof d.end&&d.end();return a===Opal.nil?"":a};
|
|
1380
|
-
m.prototype.convertFile=function(a,b){return this.$convert_file(a,A(b))};m.prototype.load=function(a,b){"object"===typeof a&&"Buffer"===a.constructor.name&&(a=a.toString("utf8"));return this.$load(a,A(b))};m.prototype.loadFile=function(a,b){return this.$load_file(a,A(b))};m=Opal.Asciidoctor.AbstractBlock;m.prototype.getContentModel=function(){var a=this.content_model;return a===Opal.nil?void 0:a};m.prototype.setContentModel=function(a){this.content_model=a};m.prototype.append=function(a){this.$append(a);
|
|
1381
|
-
return this};m.prototype.getTitle=function(){var a=this.$title();return a===Opal.nil?void 0:a};m.prototype.setTitle=function(a){a="undefined"===typeof a?Opal.nil:a;return this["$title="](a)};m.prototype.assignCaption=function(a,b){a="undefined"===typeof a?Opal.nil:a;this.$assign_caption(a,"undefined"===typeof b?null:b)};m.prototype.getCaptionedTitle=function(){return this.$captioned_title()};m.prototype.getStyle=function(){var a=this.style;return a===Opal.nil?void 0:a};m.prototype.setStyle=function(a){this.style=
|
|
1382
|
-
a};m.prototype.getSourceLocation=function(){var a=this.source_location;if(a!==Opal.nil)return a.getFile=function(){var a=this.file;return a===Opal.nil?void 0:a},a.getDirectory=function(){var a=this.dir;return a===Opal.nil?void 0:a},a.getPath=function(){var a=this.path;return a===Opal.nil?void 0:a},a.getLineNumber=function(){var a=this.lineno;return a===Opal.nil?void 0:a},a};m.prototype.getCaption=function(){var a=this.$caption();return a===Opal.nil?void 0:a};m.prototype.setCaption=function(a){this.caption=
|
|
1383
|
-
"undefined"===typeof a?Opal.nil:a};m.prototype.getLevel=function(){var a=this.level;return a===Opal.nil?void 0:a};m.prototype.getSubstitutions=function(){return this.subs};m.prototype.hasSubstitution=function(a){return this["$sub?"](a)};m.prototype.removeSubstitution=function(a){this.$remove_sub(a)};m.prototype.hasBlocks=function(){return 0<this.blocks.length};m.prototype.getBlocks=function(){return this.blocks};m.prototype.getContent=function(){var a=this.$content();return a===Opal.nil?void 0:a};
|
|
1384
|
-
m.prototype.convert=function(){return this.$convert()};m.prototype.findBy=function(a,b){return"undefined"===typeof b&&"function"===typeof a?Opal.send(this,"find_by",null,a):"function"===typeof b?Opal.send(this,"find_by",[E(a)],b):this.$find_by(E(a))};m.prototype.getLineNumber=function(){var a=this.$lineno();return a===Opal.nil?void 0:a};m.prototype.hasSections=function(){return this.next_section_index!==Opal.nil&&0<this.next_section_index};m.prototype.getSections=function(){return this.$sections()};
|
|
1385
|
-
m.prototype.getNumeral=function(){var a=this.$numeral();return a===Opal.nil?void 0:a};m.prototype.setNumeral=function(a){this["$numeral="](a)};m.prototype.hasTitle=function(){return this["$title?"]()};m.prototype.getAlt=function(){return this.$alt()};m=Opal.Asciidoctor.Section;m.create=function(a,b,d,f){f&&f.attributes&&(f.attributes=E(f.attributes));return this.$new(a,b,d,E(f))};m.prototype.setLevel=function(a){this.level=a};m.prototype.getIndex=function(){return this.index};m.prototype.setIndex=
|
|
1386
|
-
function(a){this.index=a};m.prototype.getSectionName=function(){var a=this.sectname;return a===Opal.nil?void 0:a};m.prototype.setSectionName=function(a){this.sectname=a};m.prototype.getSectionNumeral=function(){return this.$sectnum()};m.prototype.getSectionNumber=m.prototype.getSectionNumeral;m.prototype.isSpecial=function(){return this.special};m.prototype.setSpecial=function(a){this.special=a};m.prototype.isNumbered=function(){return this.numbered};m.prototype.getCaption=function(){var a=this.caption;
|
|
1387
|
-
return a===Opal.nil?void 0:a};m.prototype.getName=function(){return this.getTitle()};m=Opal.Asciidoctor.Block;m.create=function(a,b,d){d&&d.attributes&&(d.attributes=E(d.attributes));return this.$new(a,b,E(d))};m.prototype.getSource=function(){return this.$source()};m.prototype.getSourceLines=function(){return this.lines};m=Opal.Asciidoctor.AbstractNode;m.prototype.applySubstitutions=function(a,b){return this.$apply_subs(a,b)};m.prototype.resolveSubstitutions=function(a,b,d,f){"undefined"===typeof b&&
|
|
1388
|
-
(b="block");"undefined"===typeof d&&(d=Opal.nil);"undefined"===typeof f&&(f=Opal.nil);a=this.$resolve_subs(a,b,d,f);return a===Opal.nil?void 0:a};m.prototype.resolveBlockSubstitutions=function(a,b,d){return this.resolveSubstitutions(a,"block",b,d)};m.prototype.resolvePassSubstitutions=function(a){return this.resolveSubstitutions(a,"inline",void 0,"passthrough macro")};m.prototype.getNodeName=function(){return this.node_name};m.prototype.getAttributes=function(){return B(this.attributes)};m.prototype.getAttribute=
|
|
1389
|
-
function(a,b,d){a=this.$attr(a,b,d);return a===Opal.nil?void 0:a};m.prototype.hasAttribute=function(a){return a in this.attributes.$$smap};m.prototype.isAttribute=function(a,b,d){return this["$attr?"](a,b,d)};m.prototype.setAttribute=function(a,b,d){"undefined"===typeof d&&(d=!0);return this.$set_attr(a,b,d)};m.prototype.removeAttribute=function(a){a=this.$remove_attr(a);return a===Opal.nil?void 0:a};m.prototype.getDocument=function(){return this.document};m.prototype.getParent=function(){var a=this.parent;
|
|
1390
|
-
return a===Opal.nil?void 0:a};m.prototype.isInline=function(){return this["$inline?"]()};m.prototype.isBlock=function(){return this["$block?"]()};m.prototype.isRole=function(a){return this["$role?"](a)};m.prototype.getRole=function(){var a=this.$role();return a===Opal.nil?void 0:a};m.prototype.setRole=function(a){return Array.isArray(a)||"string"===typeof a&&1===arguments.length?this["$role="](a):this["$role="](Array.from(arguments))};m.prototype.hasRole=function(a){return this["$has_role?"](a)};
|
|
1391
|
-
m.prototype.getRoles=function(){return this.$roles()};m.prototype.addRole=function(a){return this.$add_role(a)};m.prototype.removeRole=function(a){return this.$remove_role(a)};m.prototype.isReftext=function(){return this["$reftext?"]()};m.prototype.getReftext=function(){var a=this.$reftext();return a===Opal.nil?void 0:a};m.prototype.getContext=function(){var a=this.context;return"string"===typeof a?a:a.toString()};m.prototype.getId=function(){var a=this.id;return a===Opal.nil?void 0:a};m.prototype.setId=
|
|
1392
|
-
function(a){this.id=a};m.prototype.isOption=function(a){return this["$option?"](a)};m.prototype.setOption=function(a){return this.$set_option(a)};m.prototype.getIconUri=function(a){return this.$icon_uri(a)};m.prototype.getMediaUri=function(a,b){return this.$media_uri(a,b)};m.prototype.getImageUri=function(a,b){return this.$image_uri(a,b)};m.prototype.getConverter=function(){return this.$converter()};m.prototype.readContents=function(a,b){return this.$read_contents(a,E(b))};m.prototype.readAsset=function(a,
|
|
1393
|
-
b){a=this.$read_asset(a,E(b));return a===Opal.nil?void 0:a};m.prototype.normalizeWebPath=function(a,b,d){return this.$normalize_web_path(a,b,d)};m.prototype.normalizeSystemPath=function(a,b,d,f){return this.$normalize_system_path(a,b,d,E(f))};m.prototype.normalizeAssetPath=function(a,b,d){return this.$normalize_asset_path(a,b,d)};var v=Opal.Asciidoctor.Document;v.prototype.append=function(a){this["$<<"](a);return this};v.prototype.getSyntaxHighlighter=function(){var a=this.syntax_highlighter,b=a.__proto__;
|
|
1394
|
-
b&&("function"===typeof b["$highlight?"]&&(b.handlesHighlighting=function(){var a=b["$highlight?"]();return a===Opal.nil?!1:a}),"function"===typeof b["$docinfo?"]&&(b.hasDocinfo=b["$docinfo?"]),"function"===typeof b.$format&&(b.format=function(a,b,k){return this.$format(a,b,E(k))}),"function"===typeof b.$docinfo&&(b.docinfo=function(a,b,k){return this.$docinfo(a,b,E(k))}));return a};v.prototype.getRefs=function(){return B(this.catalog.$$smap.refs)};v.prototype.getImages=function(){return this.catalog.$$smap.images};
|
|
1395
|
-
v.prototype.getLinks=function(){return this.catalog.$$smap.links};v.prototype.hasFootnotes=function(){return this["$footnotes?"]()};v.prototype.getFootnotes=function(){return this.$footnotes()};v.prototype.getHeader=function(){return this.header};v.prototype.setAttribute=function(a,b){return this.$set_attribute(a,b)};v.prototype.removeAttribute=function(a){this.attributes.$delete(a);this.attribute_overrides.$delete(a)};v.prototype.convert=function(a){a=this.$convert(E(a));return a===Opal.nil?"":a};
|
|
1396
|
-
v.prototype.write=function(a,b){return this.$write(a,b)};v.prototype.getAuthor=function(){return this.$author()};v.prototype.getSource=function(){return this.$source()};v.prototype.getSourceLines=function(){return this.$source_lines()};v.prototype.isNested=function(){return this["$nested?"]()};v.prototype.isEmbedded=function(){return this["$embedded?"]()};v.prototype.hasExtensions=function(){return this["$extensions?"]()};v.prototype.getDoctype=function(){return this.doctype};v.prototype.getBackend=
|
|
1397
|
-
function(){return this.backend};v.prototype.isBasebackend=function(a){return this["$basebackend?"](a)};v.prototype.getTitle=function(){var a=this.$title();return a===Opal.nil?void 0:a};v.prototype.setTitle=function(a){return this["$title="](a)};v.prototype.getDocumentTitle=function(a){a=this.$doctitle(E(a));return a===Opal.nil?void 0:a};v.prototype.getDoctitle=v.prototype.getDocumentTitle;v.prototype.getCatalog=function(){return B(this.catalog)};v.prototype.getReferences=v.prototype.getCatalog;v.prototype.getRevisionDate=
|
|
1398
|
-
function(){return this.getAttribute("revdate")};v.prototype.getRevdate=function(){return this.getRevisionDate()};v.prototype.getRevisionNumber=function(){return this.getAttribute("revnumber")};v.prototype.getRevisionRemark=function(){return this.getAttribute("revremark")};v.prototype.setHeaderAttribute=function(a,b,d){"undefined"===typeof d&&(d=!0);"undefined"===typeof b&&(b="");return this.$set_header_attribute(a,b,d)};v.prototype.getAuthors=function(){return this.$authors()};var G=v.Footnote;G.prototype.getIndex=
|
|
1399
|
-
function(){var a=this.$$data.index;return a===Opal.nil?void 0:a};G.prototype.getId=function(){var a=this.$$data.id;return a===Opal.nil?void 0:a};G.prototype.getText=function(){var a=this.$$data.text;return a===Opal.nil?void 0:a};G=v.ImageReference;G.prototype.getTarget=function(){return this.$$data.target};G.prototype.getImagesDirectory=function(){var a=this.$$data.imagesdir;return a===Opal.nil?void 0:a};G=v.Author;G.prototype.getName=function(){var a=this.$$data.name;return a===Opal.nil?void 0:a};
|
|
1400
|
-
G.prototype.getFirstName=function(){var a=this.$$data.firstname;return a===Opal.nil?void 0:a};G.prototype.getMiddleName=function(){var a=this.$$data.middlename;return a===Opal.nil?void 0:a};G.prototype.getLastName=function(){var a=this.$$data.lastname;return a===Opal.nil?void 0:a};G.prototype.getInitials=function(){var a=this.$$data.initials;return a===Opal.nil?void 0:a};G.prototype.getEmail=function(){var a=this.$$data.email;return a===Opal.nil?void 0:a};v.RevisionInfo=function(a,b,d){this.date=
|
|
1401
|
-
a;this.number=b;this.remark=d};G=v.RevisionInfo;G.prototype.getDate=function(){return this.date};G.prototype.getNumber=function(){return this.number};G.prototype.getRemark=function(){return this.remark};G.prototype.isEmpty=function(){return void 0===this.date&&void 0===this.number&&void 0===this.remark};G=Opal.Asciidoctor.SafeMode;G.getValueForName=function(a){return this.$value_for_name(a)};G.getNameForValue=function(a){a=this.$name_for_value(a);return a===Opal.nil?void 0:a};G.getNames=function(){return this.$names()};
|
|
1402
|
-
G=Opal.Asciidoctor.Callouts;G.create=function(){return this.$new()};G.prototype.register=function(a){return this.$register(a)};G.prototype.readNextId=function(){return this.$read_next_id()};G.prototype.getCalloutIds=function(a){return this.$callout_ids(a)};G.prototype.getLists=function(){var a=this.lists;if(a&&0<a.length)for(var b=0;b<a.length;b++){var d=a[b];if(d&&0<d.length)for(var f=0;f<d.length;f++)"object"===typeof d[f]&&"$$smap"in d[f]&&(d[f]=B(d[f]))}return a};G.prototype.getListIndex=function(){return this.list_index};
|
|
1403
|
-
G.prototype.getCurrentList=function(){var a=this.$current_list();if(a&&0<a.length)for(var b=0;b<a.length;b++)"object"===typeof a[b]&&"$$smap"in a[b]&&(a[b]=B(a[b]));return a};G.prototype.nextList=function(){return this.$nextList()};G.prototype.rewind=function(){return this.$rewind()};v.prototype.getRevisionInfo=function(){return new v.RevisionInfo(this.getRevisionDate(),this.getRevisionNumber(),this.getRevisionRemark())};v.prototype.hasRevisionInfo=function(){return!this.getRevisionInfo().isEmpty()};
|
|
1404
|
-
v.prototype.getNotitle=function(){return this.$notitle()};v.prototype.getNoheader=function(){return this.$noheader()};v.prototype.getNofooter=function(){return this.$nofooter()};v.prototype.hasHeader=function(){return this["$header?"]()};v.prototype.playbackAttributes=function(a){if(a=E(a)){var b=a["$[]"]("attribute_entries");if(b&&Array.isArray(b)){for(var d=[],f=0;f<b.length;f++){var h=b[f];h&&"object"===typeof h&&"Object"===h.constructor.name&&(h.$name=function(){return this.name},h.$value=function(){return this.value},
|
|
1405
|
-
h.$negate=function(){return this.negate});d.push(h)}a["$[]="]("attribute_entries",d)}}this.$playback_attributes(a)};v.prototype.deleteAttribute=function(a){return this.$delete_attribute(a)};v.prototype.isAttributeLocked=function(a){return this["$attribute_locked?"](a)};v.prototype.restoreAttributes=function(){return this.$restore_attributes()};v.prototype.parse=function(a){return this.$parse(a)};v.prototype.getDocinfo=function(a,b){return this.$docinfo(a,b)};v.prototype.hasDocinfoProcessors=function(a){return this["$docinfo_processors?"](a)};
|
|
1406
|
-
v.prototype.incrementAndStoreCounter=function(a,b){return this.$increment_and_store_counter(a,b)};v.prototype.counterIncrement=v.prototype.incrementAndStoreCounter;v.prototype.counter=function(a,b){return this.$counter(a,b)};v.prototype.getSafe=function(){return this.safe};v.prototype.getCompatMode=function(){return this.compat_mode};v.prototype.getSourcemap=function(){var a=this.sourcemap;return a===Opal.nil?!1:a};v.prototype.setSourcemap=function(a){this.sourcemap=a};v.prototype.getCounters=function(){return B(this.counters)};
|
|
1407
|
-
v.prototype.getCallouts=function(){return this.$callouts()};v.prototype.getBaseDir=function(){return this.base_dir};v.prototype.getOptions=function(){return B(this.options)};v.prototype.getOutfilesuffix=function(){return this.outfilesuffix};v.prototype.getParentDocument=function(){var a=this.parent_document;return a===Opal.nil?void 0:a};v.prototype.getReader=function(){return this.reader};v.prototype.getConverter=function(){return this.converter};v.prototype.getExtensions=function(){var a=this.extensions;
|
|
1408
|
-
return a===Opal.nil?void 0:a};G=v.Title;G.prototype.getMain=function(){return this.main};G.prototype.getCombined=function(){return this.combined};G.prototype.getSubtitle=function(){var a=this.subtitle;return a===Opal.nil?void 0:a};G.prototype.isSanitized=function(){var a=this["$sanitized?"]();return a===Opal.nil?!1:a};G.prototype.hasSubtitle=function(){return this["$subtitle?"]()};G=Opal.Asciidoctor.Inline;G.create=function(a,b,d,f){return this.$new(a,b,d,A(f))};G.prototype.convert=function(){return this.$convert()};
|
|
1409
|
-
G.prototype.getText=function(){var a=this.$text();return a===Opal.nil?void 0:a};G.prototype.getType=function(){return this.$type()};G.prototype.getTarget=function(){var a=this.$target();return a===Opal.nil?void 0:a};G.prototype.getAlt=function(){return this.$alt()};G=Opal.Asciidoctor.List;G.prototype.hasItems=function(){return this["$items?"]()};G.prototype.getItems=function(){return this.blocks};G=Opal.Asciidoctor.ListItem;G.prototype.getText=function(){return this.$text()};G.prototype.setText=function(a){return this["$text="](a)};
|
|
1410
|
-
G.prototype.hasText=function(){return this["$text?"]()};G.prototype.getMarker=function(){return this.marker};G.prototype.setMarker=function(a){this.marker=a};G.prototype.getList=function(){return this.$list()};G.prototype.getParent=G.prototype.getList;G=Opal.Asciidoctor.Reader;G.prototype.pushInclude=function(a,b,d,f,h){return this.$push_include(a,b,d,f,E(h))};G.prototype.getCursor=function(){return this.$cursor()};G.prototype.getLines=function(){return this.$lines()};G.prototype.getString=function(){return this.$string()};
|
|
1411
|
-
G.prototype.hasMoreLines=function(){return this["$has_more_lines?"]()};G.prototype.isEmpty=function(){return this["$empty?"]()};G.prototype.peekLine=function(a){a=this.$peek_line(a||!1);return a===Opal.nil?void 0:a};G.prototype.readLine=function(){var a=this.$read_line();return a===Opal.nil?void 0:a};G.prototype.readLines=function(){return this.$read_lines()};G.prototype.read=function(){return this.$read()};G.prototype.advance=function(){return this.$advance()};var I=Opal.Asciidoctor.Reader.Cursor;
|
|
1412
|
-
I.prototype.getFile=function(){var a=this.file;return a===Opal.nil?void 0:a};I.prototype.getDirectory=function(){var a=this.dir;return a===Opal.nil?void 0:a};I.prototype.getPath=function(){var a=this.path;return a===Opal.nil?void 0:a};I.prototype.getLineNumber=function(){return this.lineno};var K=Opal.const_get_qualified(Opal.Asciidoctor,"LoggerManager",!0);Opal.Asciidoctor.LoggerManager=K;K.getLogger=function(){return this.$logger()};K.setLogger=function(a){this["$logger="](a)};K.newLogger=function(a,
|
|
1413
|
-
b){return D(a,b).$new()};K.newFormatter=function(a,b){return x(a,b).$new()};var M=Opal.const_get_qualified(Opal.Logger,"Severity",!0);Opal.Asciidoctor.LoggerSeverity=M;M.get=function(a){return M.$constants()[a]};I=Opal.const_get_qualified(Opal.Logger,"Formatter",!0);Opal.Asciidoctor.LoggerFormatter=I;I.prototype.call=function(a,b,d,f){return this.$call(M.get(a),b,d,f)};I=Opal.const_get_qualified(Opal.Asciidoctor,"MemoryLogger",!0);Opal.Asciidoctor.MemoryLogger=I;I.create=function(){return this.$new()};
|
|
1414
|
-
I.prototype.getMessages=function(){for(var a=this.messages,b=[],d=0;d<a.length;d++){var f=B(a[d]);"string"===typeof f.message?f.getText=function(){return this.message}:(f.message=B(f.message),f.getText=function(){return this.message.text});f.getSeverity=function(){return this.severity.toString()};f.getSourceLocation=function(){return this.message.source_location};b.push(f)}return b};var t=Opal.const_get_qualified(Opal.Asciidoctor,"Logging",!0);Opal.Asciidoctor.Logging=t;t.getLogger=function(){return K.$logger()};
|
|
1415
|
-
t.createLogMessage=function(a,b){return t.prototype.$message_with_context(a,E(b))};G.prototype.getLogger=t.getLogger;G.prototype.createLogMessage=t.createLogMessage;m.prototype.getLogger=t.getLogger;m.prototype.createLogMessage=t.createLogMessage;m=Opal.const_get_qualified(Opal.Asciidoctor,"Logger",!0);Opal.Asciidoctor.Logger=m;m.prototype.getMaxSeverity=function(){var a=this.max_severity;return a===Opal.nil?void 0:a};m.prototype.getFormatter=function(){return this.formatter};m.prototype.setFormatter=
|
|
1416
|
-
function(a){this.formatter=a};m.prototype.getLevel=function(){return this.level};m.prototype.setLevel=function(a){this.level=a};m.prototype.getProgramName=function(){return this.progname};m.prototype.setProgramName=function(a){this.progname=a};m=Opal.const_get_qualified("::","Logger");m.prototype.add=function(a,b,d){a="string"===typeof a?M[a.toUpperCase()]:a;this.$add(a,b,d)};m.prototype.log=m.prototype.add;m.prototype.debug=function(a){this.$debug(a)};m.prototype.info=function(a){this.$info(a)};
|
|
1417
|
-
m.prototype.warn=function(a){this.$warn(a)};m.prototype.error=function(a){this.$error(a)};m.prototype.fatal=function(a){this.$fatal(a)};m.prototype.isDebugEnabled=function(){return this["$debug?"]()};m.prototype.isInfoEnabled=function(){return this["$info?"]()};m.prototype.isWarnEnabled=function(){return this["$warn?"]()};m.prototype.isErrorEnabled=function(){return this["$error?"]()};m.prototype.isFatalEnabled=function(){return this["$fatal?"]()};m=Opal.const_get_qualified(Opal.Asciidoctor,"NullLogger",
|
|
1418
|
-
!0);Opal.Asciidoctor.NullLogger=m;m.create=function(){return this.$new()};m.prototype.getMaxSeverity=function(){return this.max_severity};Opal.Asciidoctor.StopIteration=Opal.StopIteration;m=Opal.const_get_qualified(Opal.Asciidoctor,"Timings",!0);Opal.Asciidoctor.Timings=m;m.create=function(){return this.$new()};m.prototype.printReport=function(a,b){if(a)if("function"===typeof a.$add)var d=function(b){a.$add(1,b)};else if("function"===typeof a.log)d=a.log;else if("function"===typeof a.write)d=function(b){a.write(b,
|
|
1419
|
-
"utf-8")};else throw Error("The output should be a Stream (with a write function), an object with a log function or a Ruby Logger (with a add function)");else d=function(a){Opal.gvars.stdout.$write(a)};b&&d("Input file: "+b);d(" Time to read and parse source: "+this.$read_parse().toFixed(2));d(" Time to convert document: "+this.$convert().toFixed(2));d(" Total time (read, parse and convert): "+this.$read_parse_convert().toFixed(2))};var J=Opal.const_get_qualified(Opal.Asciidoctor,"SyntaxHighlighter",
|
|
1420
|
-
!0);Opal.Asciidoctor.SyntaxHighlighter=J;J.register=function(a,b){var d="string"===typeof a?a:a[0];if("function"===typeof b){var f=b.prototype,k=Object.getOwnPropertyNames(f);b={};for(var c in k){var m=k[c];b[m]=f[m]}}var q=n(P,d,b,{},{format:function(a){2<=a.length&&"object"===typeof a[2]&&"$$smap"in a[2]&&(a[2]=B(a[2]));1<=a.length&&(a[1]=a[1]===Opal.nil?void 0:a[1]);return a},highlight:function(a){if(3<=a.length&&"object"===typeof a[3]&&"$$smap"in a[3]){var b=a[3];b=B(b);for(var c in b){var d=
|
|
1421
|
-
b[c];if("callouts"===c){var f=void 0,g={};if(d)for(f in d=d.$$keys,d){var k=d[f].value;g[f.toString()]=k===Opal.nil?void 0:k}f=g;for(var h in f)for(g=f[h],d=0;d<g.length;d++){k=g[d];for(var l=0;l<k.length;l++)k[l]=k[l]===Opal.nil?void 0:k[l]}b[c]=f}else b[c]=d===Opal.nil?void 0:d}a[3]=b}2<=a.length&&(a[2]=a[2]===Opal.nil?void 0:a[2]);return a}}),g;for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&function(a){var c=b[a];"handlesHighlighting"===a?Opal.def(q,"$highlight?",function(){return c.call()}):
|
|
1422
|
-
"hasDocinfo"===a&&Opal.def(q,"$docinfo?",function(a){return c.apply(this,[a])})}(g);Opal.def(q,"$name",function(){return d});J.$register(q,a);return q};J.get=function(a){a=J.$for(a);return a===Opal.nil?void 0:a};J.for=J.get;var P=Opal.const_get_qualified(J,"Base",!0);Opal.Asciidoctor.SyntaxHighlighterBase=P;P.prototype.registerFor=function(a){J.$register(this,a)};m=Opal.Asciidoctor.Table;m.create=function(a,b){return this.$new(a,E(b))};m.prototype.getCaption=function(){return this.caption};m.prototype.getRows=
|
|
1423
|
-
function(){return this.rows};m.prototype.getColumns=function(){return this.columns};m.prototype.getHeadRows=function(){return this.rows.head};m.prototype.hasHeadRows=function(){return this.rows!==Opal.nil&&0<this.rows.head.length};m.prototype.getBodyRows=function(){return this.rows.body};m.prototype.hasBodyRows=function(){return this.rows!==Opal.nil&&0<this.rows.body.length};m.prototype.getFootRows=function(){return this.rows.foot};m.prototype.hasFootRows=function(){return this.rows!==Opal.nil&&0<
|
|
1424
|
-
this.rows.foot.length};m.prototype.hasHeaderOption=function(){return this.has_header_option};m.prototype.hasFooterOption=function(){return this.isOption("footer")};m.prototype.hasAutowidthOption=function(){return this.isOption("autowidth")};m.prototype.getRowCount=function(){return this.getAttribute("rowcount")};m.prototype.setRowCount=function(a){this.setAttribute("rowcount",a)};m.prototype.getColumnCount=function(){return this.getAttribute("colcount")};m.prototype.setColumnCount=function(a){this.setAttribute("colcount",
|
|
1425
|
-
a)};m=Opal.Asciidoctor.Table.Rows;m.create=function(a,b,d){return this.$new(a,b,d)};m.prototype.getHead=function(){return this.head};m.prototype.getFoot=function(){return this.foot};m.prototype.getBody=function(){return this.body};m.prototype.bySection=function(){return[["head",this.head],["body",this.body],["foot",this.foot]]};m=Opal.Asciidoctor.Table.Column;m.create=function(a,b,d){return this.$new(a,b,E(d))};m.prototype.getColumnNumber=function(){return this.getAttribute("colnumber")};m.prototype.getWidth=
|
|
1426
|
-
function(){return this.getAttribute("width")};m.prototype.getHorizontalAlign=function(){return this.getAttribute("halign")};m.prototype.getVerticalAlign=function(){return this.getAttribute("valign")};m.prototype.getStyle=function(){var a=this.style;return a===Opal.nil?void 0:a};m=Opal.Asciidoctor.Table.Cell;m.create=function(a,b,d,f){return this.$new(a,b,E(d),E(f))};m.prototype.getColumnSpan=function(){var a=this.colspan;return a===Opal.nil?void 0:a};m.prototype.setColumnSpan=function(a){return this["$colspan="](a)};
|
|
1427
|
-
m.prototype.getRowSpan=function(){var a=this.rowspan;return a===Opal.nil?void 0:a};m.prototype.setRowSpan=function(a){return this["$rowspan="](a)};m.prototype.getContent=function(){return this.$content()};m.prototype.getText=function(){return this.$text()};m.prototype.getSource=function(){return this.$source()};m.prototype.getLines=function(){return this.$lines()};m.prototype.getLineNumber=function(){var a=this.$lineno();return a===Opal.nil?void 0:a};m.prototype.getFile=function(){var a=this.$file();
|
|
1428
|
-
return a===Opal.nil?void 0:a};m.prototype.getStyle=function(){var a=this.$style();return a===Opal.nil?void 0:a};m.prototype.getColumn=function(){var a=this.$column();return a===Opal.nil?void 0:a};m.prototype.getWidth=function(){return this.getAttribute("width")};m.prototype.getColumnPercentageWidth=function(){return this.getAttribute("colpcwidth")};m.prototype.getInnerDocument=function(){var a=this.inner_document;return a===Opal.nil?void 0:a};if(m=Opal.Asciidoctor.Converter.TemplateConverter)Opal.Asciidoctor.TemplateConverter=
|
|
1429
|
-
m,m.create=function(a,b,d){d&&d.template_cache&&(d.template_cache=E(d.template_cache));this.$new(a,b,E(d))},m.getCache=function(){var a=B(this.caches);if(a){if(a.scans){a.scans=B(a.scans);for(var b in a.scans)a.scans[b]=B(a.scans[b])}a.templates&&(a.templates=B(a.templates))}return a},m.clearCache=function(){this.$clear_caches()},m.prototype.convert=function(a,b,d){return this.$convert(a,b,E(d))},m.prototype.handles=function(a){return this["$handles?"](a)},m.prototype.getContentOnly=function(a){return this.$content_only(a)},
|
|
1430
|
-
m.prototype.skip=function(a){this.$skip(a)},m.prototype.getTemplates=function(){return B(this.$templates())},m.prototype.register=function(a,b){return this.$register(a,b)},m={registry:{}},Opal.Asciidoctor.TemplateEngine=m,m.register=function(a,b){if("string"===typeof a)this.registry[a]=b;else for(var d=0;d<a.length;d++)this.registry[a[d]]=b};if(m=Opal.Asciidoctor.Converter.CompositeConverter)Opal.Asciidoctor.CompositeConverter=m,m.prototype.convert=function(a,b,d){return this.$convert(a,b,E(d))},
|
|
1431
|
-
m.prototype.getContentOnly=function(a){return this.$content_only(a)},m.prototype.skip=function(a){this.$skip(a)},m.prototype.getConverters=function(){return this.converters},m.prototype.getConverter=function(a){a=this.$converter_for(a);return a===Opal.nil?void 0:a},m.prototype.findConverter=function(a){return this.$find_converter(a)};var R=Opal.const_get_qualified(Opal.Asciidoctor,"Converter");Opal.Asciidoctor.Converter=R;R.prototype.convert=function(a,b,d){return this.$convert(a,b,E(d))};R.create=
|
|
1432
|
-
function(a,b){return this.$create(a,E(b))};m=Opal.Asciidoctor.Converter.Factory;var W=Opal.Asciidoctor.Converter.Base;Opal.Asciidoctor.ConverterFactory=m;var N=Opal.Asciidoctor.Converter.BackendTraits;Opal.Asciidoctor.ConverterBackendTraits=N;m.register=function(a,b){a=[z(a)].concat(b);return R.$register.apply(R,a)};m.getDefault=function(a){return this.$default(a)};m.prototype.create=function(a,b){return this.$create(a,E(b))};m.getRegistry=function(){return B(R.$registry())};m.for=function(a){a=R.$for(a);
|
|
1433
|
-
return a===Opal.nil?void 0:a};m.unregisterAll=function(){R.DefaultFactory.$$cvars["@@registry"]=E({html5:R.DefaultFactory.$$cvars["@@registry"]["$[]"]("html5")})};m=Opal.Asciidoctor.Converter.Html5Converter;Opal.Asciidoctor.Html5Converter=m;m.create=function(){return this.$new()};m.prototype.convert=function(a,b,d){return this.$convert(a,b,d)};var H=function(a){a.$$arity=a.length;return a},L=function(a,b,d,f){return"object"===typeof d||d.$$is_class?a["$"+b](d,f):Opal.send(a,b,f&&[f],H(d))},U=Opal.const_get_qualified(Opal.Asciidoctor,
|
|
1434
|
-
"Extensions");Opal.Asciidoctor.Extensions=U;U.create=function(a,b){return"function"===typeof a&&"undefined"===typeof b?Opal.send(this,"create",null,H(a)):"function"===typeof b?Opal.send(this,"create",[a],H(b)):this.$create()};U.register=function(a,b){return"function"===typeof a&&"undefined"===typeof b?Opal.send(this,"register",null,H(a)):Opal.send(this,"register",[a],H(b))};U.getGroups=function(){return B(this.$groups())};U.unregisterAll=function(){this.$unregister_all()};U.unregister=function(){for(var a=
|
|
1435
|
-
Array.prototype.concat.apply([],arguments),b=this.$groups(),d={},f=0,h=b.$$keys;f<h.length;f++){var c=h[f];d[c.toString()]=c}for(f=0;f<a.length;f++)h=a[f],h in d&&Opal.hash_delete(b,d[h])};m=U.Registry;m.prototype.getGroups=U.getGroups;m.prototype.unregisterAll=function(){this.groups=Opal.hash()};m.prototype.unregister=U.unregister;m.prototype.prefer=function(a,b){1===arguments.length&&(b=a,a=null);return"object"===typeof b||b.$$is_class?this.$prefer(a,b):Opal.send(this,"prefer",a&&[a],H(b))};m.prototype.block=
|
|
1436
|
-
function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"block",b,a)};m.prototype.inlineMacro=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"inline_macro",b,a)};m.prototype.includeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"include_processor",b,a)};m.prototype.blockMacro=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"block_macro",b,a)};m.prototype.treeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"tree_processor",
|
|
1437
|
-
b,a)};m.prototype.postprocessor=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"postprocessor",b,a)};m.prototype.preprocessor=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"preprocessor",b,a)};m.prototype.docinfoProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return L(this,"docinfo_processor",b,a)};m.prototype.hasPreprocessors=function(){return this["$preprocessors?"]()};m.prototype.hasTreeProcessors=function(){return this["$tree_processors?"]()};m.prototype.hasIncludeProcessors=
|
|
1438
|
-
function(){return this["$include_processors?"]()};m.prototype.hasPostprocessors=function(){return this["$postprocessors?"]()};m.prototype.hasDocinfoProcessors=function(a){return this["$docinfo_processors?"](a)};m.prototype.hasBlocks=function(){return this["$blocks?"]()};m.prototype.hasBlockMacros=function(){return this["$block_macros?"]()};m.prototype.hasInlineMacros=function(){return this["$inline_macros?"]()};m.prototype.getPreprocessors=function(){return this.$preprocessors()};m.prototype.getTreeProcessors=
|
|
1439
|
-
function(){return this.$tree_processors()};m.prototype.getIncludeProcessors=function(){return this.$include_processors()};m.prototype.getPostprocessors=function(){return this.$postprocessors()};m.prototype.getDocinfoProcessors=function(a){return this.$docinfo_processors(a)};m.prototype.getBlocks=function(){return this.block_extensions.$values()};m.prototype.getBlockMacros=function(){return this.block_macro_extensions.$values()};m.prototype.getInlineMacros=function(){return this.$inline_macros()};
|
|
1440
|
-
m.prototype.getInlineMacroFor=function(a){a=this["$registered_for_inline_macro?"](a);return!1===a?void 0:a};m.prototype.getBlockFor=function(a,b){if("undefined"===typeof b)return a=this.$find_block_extension(a),a===Opal.nil?void 0:a;a=this["$registered_for_block?"](a,b);return!1===a?void 0:a};m.prototype.getBlockMacroFor=function(a){a=this["$registered_for_block_macro?"](a);return!1===a?void 0:a};m=U.Processor;m.prototype.prepend=function(){this.$option("position",">>")};m.prototype.process=function(a){a=
|
|
1441
|
-
new Proxy(a,{apply:function(a,b,f){for(var d=0;d<f.length;d++)"object"===typeof f[d]&&"$$smap"in f[d]&&(f[d]=B(f[d]));return a.apply(b,f)}});return Opal.send(this,"process",null,H(a))};m.prototype.named=function(a){return this.$named(a)};m.prototype.createBlock=function(a,b,d,f,h){return this.$create_block(a,b,d,E(f),E(h))};m.prototype.createList=function(a,b,d){return this.$create_list(a,b,E(d))};m.prototype.createListItem=function(a,b){return this.$create_list_item(a,b)};m.prototype.createImageBlock=
|
|
1442
|
-
function(a,b,d){return this.$create_image_block(a,E(b),E(d))};m.prototype.createParagraph=function(a,b,d,f){return this.$create_paragraph(a,b,E(d),E(f))};m.prototype.createOpenBlock=function(a,b,d,f){return this.$create_open_block(a,b,E(d),E(f))};m.prototype.createExampleBlock=function(a,b,d,f){return this.$create_example_block(a,b,E(d),E(f))};m.prototype.createPassBlock=function(a,b,d,f){return this.$create_pass_block(a,b,E(d),E(f))};m.prototype.createListingBlock=function(a,b,d,f){return this.$create_listing_block(a,
|
|
1443
|
-
b,E(d),E(f))};m.prototype.createLiteralBlock=function(a,b,d,f){return this.$create_literal_block(a,b,E(d),E(f))};m.prototype.createAnchor=function(a,b,d){d&&d.attributes&&(d.attributes=E(d.attributes));return this.$create_anchor(a,b,E(d))};m.prototype.createInlinePass=function(a,b,d){d&&d.attributes&&(d.attributes=E(d.attributes));return this.$create_inline_pass(a,b,E(d))};m.prototype.createInline=function(a,b,d,f){f&&f.attributes&&(f.attributes=E(f.attributes));return this.$create_inline(a,b,d,E(f))};
|
|
1444
|
-
m.prototype.parseContent=function(a,b,d){return this.$parse_content(a,b,E(d))};m.prototype.parseAttributes=function(a,b,d){d&&d.attributes&&(d.attributes=E(d.attributes));return B(this.$parse_attributes(a,b,E(d)))};m.prototype.positionalAttributes=function(a){return this.$positional_attrs(a)};m.prototype.resolveAttributes=function(a){return"object"!==typeof a||Array.isArray(a)?1<arguments.length?this.$resolves_attributes(Array.prototype.slice.call(arguments)):"undefined"===typeof a?this.$resolves_attributes(Opal.nil):
|
|
1445
|
-
this.$resolves_attributes(a):this.$resolves_attributes(E(a))};m.prototype.resolvesAttributes=m.prototype.resolveAttributes;m.prototype.getConfig=function(){return B(this.config)};m.prototype.option=function(a,b){this.$option(a,b)};m=U.BlockProcessor;m.prototype.defaultAttributes=function(a){this.$default_attributes(E(a))};m.prototype.onContext=function(a){return this.$on_context(a)};m.prototype.onContexts=function(a){return this.$on_contexts(Array.prototype.slice.call(arguments))};m.prototype.getName=
|
|
1446
|
-
function(){var a=this.name;return a===Opal.nil?void 0:a};m.prototype.parseContentAs=function(a){this.$parse_content_as(a)};m=U.BlockMacroProcessor;m.prototype.defaultAttributes=function(a){this.$default_attributes(E(a))};m.prototype.getName=function(){var a=this.name;return a===Opal.nil?void 0:a};m.prototype.parseContentAs=function(a){this.$parse_content_as(a)};m=U.InlineMacroProcessor;m.prototype.defaultAttributes=function(a){this.$default_attributes(E(a))};m.prototype.getName=function(){var a=this.name;
|
|
1447
|
-
return a===Opal.nil?void 0:a};m.prototype.parseContentAs=function(a){this.$parse_content_as(a)};m.prototype.matchFormat=function(a){this.$match_format(a)};m.prototype.match=function(a){this.$match(a)};m=U.IncludeProcessor;m.prototype.handles=function(a){return Opal.send(this,"handles?",null,H(a))};m.prototype.prefer=function(){this.$prefer()};U.TreeProcessor.prototype.prefer=function(){this.$prefer()};U.Postprocessor.prototype.prefer=function(){this.$prefer()};U.Preprocessor.prototype.prefer=function(){this.$prefer()};
|
|
1448
|
-
m=U.DocinfoProcessor;m.prototype.prefer=function(){this.$prefer()};m.prototype.atLocation=function(a){this.$at_location(a)};U.createPostprocessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("Postprocessor",a,b)};U.newPostprocessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createPostprocessor(a,b).$new()};U.createPreprocessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("Preprocessor",a,b)};U.newPreprocessor=function(a,b){1===arguments.length&&(b=a,a=null);
|
|
1449
|
-
return this.createPreprocessor(a,b).$new()};U.createTreeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("TreeProcessor",a,b)};U.newTreeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createTreeProcessor(a,b).$new()};U.createIncludeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("IncludeProcessor",a,b)};U.newIncludeProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createIncludeProcessor(a,b).$new()};U.createDocinfoProcessor=
|
|
1450
|
-
function(a,b){1===arguments.length&&(b=a,a=null);return q("DocinfoProcessor",a,b)};U.newDocinfoProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createDocinfoProcessor(a,b).$new()};U.createBlockProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("BlockProcessor",a,b)};U.newBlockProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createBlockProcessor(a,b).$new()};U.createInlineMacroProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("InlineMacroProcessor",
|
|
1451
|
-
a,b)};U.newInlineMacroProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createInlineMacroProcessor(a,b).$new()};U.createBlockMacroProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return q("BlockMacroProcessor",a,b)};U.newBlockMacroProcessor=function(a,b){1===arguments.length&&(b=a,a=null);return this.createBlockMacroProcessor(a,b).$new()};Opal.Asciidoctor.prototype.getVersion=function(){return"3.0.4"};return Opal.Asciidoctor}var module$build$asciidoctor_browser={};
|
|
1452
|
-
module$build$asciidoctor_browser.default=Asciidoctor$$module$build$asciidoctor_browser;
|