Skip to content

Instantly share code, notes, and snippets.

@michaelhenry
Last active May 9, 2018 02:56
Show Gist options
  • Save michaelhenry/268f7ad14161b10211821466caa0d6c1 to your computer and use it in GitHub Desktop.
Save michaelhenry/268f7ad14161b10211821466caa0d6c1 to your computer and use it in GitHub Desktop.
parcelRequire=function(e,r,n){var t="function"==typeof parcelRequire&&parcelRequire,i="function"==typeof require&&require;function u(n,o){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!o&&f)return f(n,!0);if(t)return t(n,!0);if(i&&"string"==typeof n)return i(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}a.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,a,l,l.exports)}return r[n].exports;function a(e){return u(a.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=t;for(var o=0;o<n.length;o++)u(n[o]);return u}({13:[function(require,module,exports) {
"use strict";var e=["Out_of_memory",0],r=["Sys_error",-1],o=["Failure",-2],t=["Invalid_argument",-3],_=["End_of_file",-4],s=["Division_by_zero",-5],a=["Not_found",-6],i=["Match_failure",-7],u=["Stack_overflow",-8],f=["Sys_blocked_io",-9],l=["Assert_failure",-10],d=["Undefined_recursive_module",-11];e.tag=248,r.tag=248,o.tag=248,t.tag=248,_.tag=248,s.tag=248,a.tag=248,i.tag=248,u.tag=248,f.tag=248,l.tag=248,d.tag=248,exports.out_of_memory=e,exports.sys_error=r,exports.failure=o,exports.invalid_argument=t,exports.end_of_file=_,exports.division_by_zero=s,exports.not_found=a,exports.match_failure=i,exports.stack_overflow=u,exports.sys_blocked_io=f,exports.assert_failure=l,exports.undefined_recursive_module=d;
},{}],7:[function(require,module,exports) {
"use strict";var r=require("./caml_builtin_exceptions.js");function n(r,n,t){for(var a=new Array(t),e=0,o=n;e<t;)a[e]=r[o],e=e+1|0,o=o+1|0;return a}function t(r,n){for(;;){var t=n,a=r;if(!t)return a;n=t[1],r=t[0].length+a|0}}function a(r,n,t){for(;;){var a=t,e=n;if(!a)return 0;for(var o=a[0],u=o.length,i=e,c=0;c<u;)r[i]=o[c],i=i+1|0,c=c+1|0;t=a[1],n=i}}function e(r){var n=t(0,r),e=new Array(n);return a(e,0,r),e}function o(n,t,a){if(t<0||t>=n.length)throw[r.invalid_argument,"index out of bounds"];return n[t]=a,0}function u(n,t){if(t<0||t>=n.length)throw[r.invalid_argument,"index out of bounds"];return n[t]}function i(r,n){for(var t=new Array(r),a=0,e=r-1|0;a<=e;++a)t[a]=n;return t}function c(r){for(var n=new Array(r),t=0,a=r-1|0;t<=a;++t)n[t]=0;return n}function f(r,n,t,a,e){if(a<=n){for(var o=0,u=e-1|0;o<=u;++o)t[o+a|0]=r[o+n|0];return 0}for(var i=e-1|0;i>=0;--i)t[i+a|0]=r[i+n|0];return 0}function _(r){return r.slice(0)}exports.caml_array_dup=_,exports.caml_array_sub=n,exports.caml_array_concat=e,exports.caml_make_vect=i,exports.caml_make_float_vect=c,exports.caml_array_blit=f,exports.caml_array_get=u,exports.caml_array_set=o;
},{"./caml_builtin_exceptions.js":13}],5:[function(require,module,exports) {
"use strict";var r=require("./caml_array.js");function n(e,t){for(;;){var u=t,c=e,s=c.length,a=0===s?1:s,o=a-u.length|0;if(0===o)return c.apply(null,u);if(!(o<0))return function(r,e){return function(t){return n(r,e.concat([t]))}}(c,u);t=r.caml_array_sub(u,a,0|-o),e=c.apply(null,r.caml_array_sub(u,0,a))}}function e(r,e,t){if(t>7||t<0)return n(r,[e]);switch(t){case 0:case 1:return r(e);case 2:return function(n){return r(e,n)};case 3:return function(n,t){return r(e,n,t)};case 4:return function(n,t,u){return r(e,n,t,u)};case 5:return function(n,t,u,c){return r(e,n,t,u,c)};case 6:return function(n,t,u,c,s){return r(e,n,t,u,c,s)};case 7:return function(n,t,u,c,s,a){return r(e,n,t,u,c,s,a)}}}function t(r,n){var t=r.length;return 1===t?r(n):e(r,n,t)}function u(r){return 1===r.length?r:function(n){return t(r,n)}}function c(r,e,t,u){if(u>7||u<0)return n(r,[e,t]);switch(u){case 0:case 1:return n(r(e),[t]);case 2:return r(e,t);case 3:return function(n){return r(e,t,n)};case 4:return function(n,u){return r(e,t,n,u)};case 5:return function(n,u,c){return r(e,t,n,u,c)};case 6:return function(n,u,c,s){return r(e,t,n,u,c,s)};case 7:return function(n,u,c,s,a){return r(e,t,n,u,c,s,a)}}}function s(r,n,e){var t=r.length;return 2===t?r(n,e):c(r,n,e,t)}function a(r){return 2===r.length?r:function(n,e){return s(r,n,e)}}function o(r,e,t,u,c){var s=0;if(c>7||c<0)return n(r,[e,t,u]);switch(c){case 0:case 1:s=1;break;case 2:return n(r(e,t),[u]);case 3:return r(e,t,u);case 4:return function(n){return r(e,t,u,n)};case 5:return function(n,c){return r(e,t,u,n,c)};case 6:return function(n,c,s){return r(e,t,u,n,c,s)};case 7:return function(n,c,s,a){return r(e,t,u,n,c,s,a)}}return 1===s?n(r(e),[t,u]):void 0}function i(r,n,e,t){var u=r.length;return 3===u?r(n,e,t):o(r,n,e,t,u)}function f(r){return 3===r.length?r:function(n,e,t){return i(r,n,e,t)}}function _(r,e,t,u,c,s){var a=0;if(s>7||s<0)return n(r,[e,t,u,c]);switch(s){case 0:case 1:a=1;break;case 2:return n(r(e,t),[u,c]);case 3:return n(r(e,t,u),[c]);case 4:return r(e,t,u,c);case 5:return function(n){return r(e,t,u,c,n)};case 6:return function(n,s){return r(e,t,u,c,n,s)};case 7:return function(n,s,a){return r(e,t,u,c,n,s,a)}}return 1===a?n(r(e),[t,u,c]):void 0}function p(r,n,e,t,u){var c=r.length;return 4===c?r(n,e,t,u):_(r,n,e,t,u,c)}function l(r){return 4===r.length?r:function(n,e,t,u){return p(r,n,e,t,u)}}function h(r,e,t,u,c,s,a){var o=0;if(a>7||a<0)return n(r,[e,t,u,c,s]);switch(a){case 0:case 1:o=1;break;case 2:return n(r(e,t),[u,c,s]);case 3:return n(r(e,t,u),[c,s]);case 4:return n(r(e,t,u,c),[s]);case 5:return r(e,t,u,c,s);case 6:return function(n){return r(e,t,u,c,s,n)};case 7:return function(n,a){return r(e,t,u,c,s,n,a)}}return 1===o?n(r(e),[t,u,c,s]):void 0}function x(r,n,e,t,u,c){var s=r.length;return 5===s?r(n,e,t,u,c):h(r,n,e,t,u,c,s)}function v(r){return 5===r.length?r:function(n,e,t,u,c){return x(r,n,e,t,u,c)}}function g(r,e,t,u,c,s,a,o){var i=0;if(o>7||o<0)return n(r,[e,t,u,c,s,a]);switch(o){case 0:case 1:i=1;break;case 2:return n(r(e,t),[u,c,s,a]);case 3:return n(r(e,t,u),[c,s,a]);case 4:return n(r(e,t,u,c),[s,a]);case 5:return n(r(e,t,u,c,s),[a]);case 6:return r(e,t,u,c,s,a);case 7:return function(n){return r(e,t,u,c,s,a,n)}}return 1===i?n(r(e),[t,u,c,s,a]):void 0}function y(r,n,e,t,u,c,s){var a=r.length;return 6===a?r(n,e,t,u,c,s):g(r,n,e,t,u,c,s,a)}function b(r){return 6===r.length?r:function(n,e,t,u,c,s){return y(r,n,e,t,u,c,s)}}function w(r,e,t,u,c,s,a,o,i){var f=0;if(i>7||i<0)return n(r,[e,t,u,c,s,a,o]);switch(i){case 0:case 1:f=1;break;case 2:return n(r(e,t),[u,c,s,a,o]);case 3:return n(r(e,t,u),[c,s,a,o]);case 4:return n(r(e,t,u,c),[s,a,o]);case 5:return n(r(e,t,u,c,s),[a,o]);case 6:return n(r(e,t,u,c,s,a),[o]);case 7:return r(e,t,u,c,s,a,o)}return 1===f?n(r(e),[t,u,c,s,a,o]):void 0}function d(r,n,e,t,u,c,s,a){var o=r.length;return 7===o?r(n,e,t,u,c,s,a):w(r,n,e,t,u,c,s,a,o)}function k(r){return 7===r.length?r:function(n,e,t,u,c,s,a){return d(r,n,e,t,u,c,s,a)}}function m(r,e,t,u,c,s,a,o,i,f){var _=0;if(f>7||f<0)return n(r,[e,t,u,c,s,a,o,i]);switch(f){case 0:case 1:_=1;break;case 2:return n(r(e,t),[u,c,s,a,o,i]);case 3:return n(r(e,t,u),[c,s,a,o,i]);case 4:return n(r(e,t,u,c),[s,a,o,i]);case 5:return n(r(e,t,u,c,s),[a,o,i]);case 6:return n(r(e,t,u,c,s,a),[o,i]);case 7:return n(r(e,t,u,c,s,a,o),[i])}return 1===_?n(r(e),[t,u,c,s,a,o,i]):void 0}function j(r,n,e,t,u,c,s,a,o){var i=r.length;return 8===i?r(n,e,t,u,c,s,a,o):m(r,n,e,t,u,c,s,a,o,i)}function q(r){return 8===r.length?r:function(n,e,t,u,c,s,a,o){return j(r,n,e,t,u,c,s,a,o)}}exports.app=n,exports.curry_1=e,exports._1=t,exports.__1=u,exports.curry_2=c,exports._2=s,exports.__2=a,exports.curry_3=o,exports._3=i,exports.__3=f,exports.curry_4=_,exports._4=p,exports.__4=l,exports.curry_5=h,exports._5=x,exports.__5=v,exports.curry_6=g,exports._6=y,exports.__6=b,exports.curry_7=w,exports._7=d,exports.__7=k,exports.curry_8=m,exports._8=j,exports.__8=q;
},{"./caml_array.js":7}],23:[function(require,module,exports) {
"use strict";function t(t,r){return r.tag=t,r}exports.__=t;
},{}],17:[function(require,module,exports) {
"use strict";function t(t,n){return t<n?-1:t===n?0:1}function n(t,n){return t?n?0:1:n?-1:0}function r(t,n){return t===n?0:t<n?-1:t>n||t==t?1:n==n?-1:0}function o(t,n){return t===n?0:t<n?-1:1}function e(t,n){return t?n:t}function c(t,n){return t<n?t:n}function i(t,n){return t<n?t:n}function a(t,n){return t<n?t:n}function m(t,n){return t<n?t:n}function _(t,n){return t<n?t:n}function u(t,n){return t||n}function l(t,n){return t>n?t:n}function p(t,n){return t>n?t:n}function x(t,n){return t>n?t:n}function s(t,n){return t>n?t:n}function f(t,n){return t>n?t:n}var v=t,b=t;exports.caml_int_compare=t,exports.caml_bool_compare=n,exports.caml_float_compare=r,exports.caml_nativeint_compare=v,exports.caml_string_compare=o,exports.caml_int32_compare=b,exports.caml_bool_min=e,exports.caml_int_min=c,exports.caml_float_min=i,exports.caml_string_min=a,exports.caml_nativeint_min=m,exports.caml_int32_min=_,exports.caml_bool_max=u,exports.caml_int_max=l,exports.caml_float_max=p,exports.caml_string_max=x,exports.caml_nativeint_max=s,exports.caml_int32_max=f;
},{}],20:[function(require,module,exports) {
"use strict";var r=require("./block.js"),n=require("./caml_primitive.js"),t=require("./caml_builtin_exceptions.js");function e(r,n){var t=new Array(n);return t.tag=r,t}function a(r){for(var n=0|r.length,t=new Array(n),e=0,a=n-1|0;e<=a;++e)t[e]=r[e];return t.tag=0|r.tag,t}function u(r,n){var e=0|r.length;if(n<=0||n>e)throw[t.invalid_argument,"Obj.truncate"];if(e!==n){for(var a=n,u=e-1|0;a<=u;++a)r[a]=0;return r.length=n,0}return 0}function i(n){return r.__(250,[n])}function o(r,n){for(var t=0,e=(0|n.length)-1|0;t<=e;++t)r[t]=n[t];var a=0|n.tag;return 0!==a?(r.tag=a,0):0}var f=function(r,n){for(var t in r)n(t)};function l(r,e){for(;;){var a=e,u=r;if(u===a)return 0;var i=typeof u,o=typeof a;if("string"===i)return n.caml_string_compare(u,a);var c="number"===o;if("number"===i)return c?n.caml_int_compare(u,a):-1;if(c)return 1;if("boolean"===i||"undefined"===i||null===u){return u===a?0:u<a?-1:1}if("function"===i||"function"===o)throw[t.invalid_argument,"compare: functional value"];var v=0|u.tag,m=0|a.tag;if(250!==v)if(250!==m){if(248===v)return n.caml_int_compare(u[1],a[1]);if(251===v)throw[t.invalid_argument,"equal: abstract value"];if(v!==m)return v<m?-1:1;var s=0|u.length,_=0|a.length;if(s===_){if(!Array.isArray(u)){var p=u,g=a,x=[0],d=[0],h=function(r,n){var t=r[2],e=r[1];if(!e.hasOwnProperty(n)||l(r[0][n],e[n])>0){var a=t[0];return a?n<a[0]?(t[0]=[n],0):0:(t[0]=[n],0)}return 0},b=function(r){return function(n){return h(r,n)}}([p,g,d]),y=function(r){return function(n){return h(r,n)}}([g,p,x]);f(p,b),f(g,y);var q=x[0],w=d[0];return q?w?n.caml_string_compare(q[0],w[0]):-1:w?1:0}for(var j=u,A=a,O=0,k=s;;){var P=O;if(P===k)return 0;var z=l(j[P],A[P]);if(0!==z)return z;O=P+1|0}}else if(s<_)for(var B=u,C=a,D=0,E=s;;){var F=D;if(F===E)return-1;var G=l(B[F],C[F]);if(0!==G)return G;D=F+1|0}else for(var H=u,I=a,J=0,K=_;;){var L=J;if(L===K)return 1;var M=l(H[L],I[L]);if(0!==M)return M;J=L+1|0}}else e=a[0];else r=u[0]}}function c(r,n){for(;;){var e=n,a=r;if(a===e)return!0;var u=typeof a;if("string"===u||"number"===u||"boolean"===u||"undefined"===u||null===a)return!1;var i=typeof e;if("function"===u||"function"===i)throw[t.invalid_argument,"equal: functional value"];if("number"===i||"undefined"===i||null===e)return!1;var o=0|a.tag,l=0|e.tag;if(250!==o)if(250!==l){if(248===o)return a[1]===e[1];if(251===o)throw[t.invalid_argument,"equal: abstract value"];if(o!==l)return!1;var v=0|a.length;if(v!==(0|e.length))return!1;if(!Array.isArray(a)){var m=a,s=e,_=[!0],p=function(r,n){return function(t){return r.hasOwnProperty(t)?0:(n[0]=!1,0)}}(s,_),g=function(r,n,t){return function(e){return r.hasOwnProperty(e)&&c(n[e],r[e])?0:(t[0]=!1,0)}}(m,s,_);return f(m,p),_[0]&&f(s,g),_[0]}for(var x=a,d=e,h=0,b=v;;){var y=h;if(y===b)return!0;if(!c(x[y],d[y]))return!1;h=y+1|0}}else n=e[0];else r=a[0]}}function v(r,n){return null!==n?c(r,n):r===n}function m(r,n){return void 0!==n?c(r,n):r===n}function s(r,n){return null==n?r===n:c(r,n)}function _(r,n){return!c(r,n)}function p(r,n){return l(r,n)>=0}function g(r,n){return l(r,n)>0}function x(r,n){return l(r,n)<=0}function d(r,n){return l(r,n)<0}function h(r,n){return l(r,n)<=0?r:n}function b(r,n){return l(r,n)>=0?r:n}exports.caml_obj_block=e,exports.caml_obj_dup=a,exports.caml_obj_truncate=u,exports.caml_lazy_make_forward=i,exports.caml_update_dummy=o,exports.caml_compare=l,exports.caml_equal=c,exports.caml_equal_null=v,exports.caml_equal_undefined=m,exports.caml_equal_nullable=s,exports.caml_notequal=_,exports.caml_greaterequal=p,exports.caml_greaterthan=g,exports.caml_lessthan=d,exports.caml_lessequal=x,exports.caml_min=h,exports.caml_max=b;
},{"./block.js":23,"./caml_primitive.js":17,"./caml_builtin_exceptions.js":13}],29:[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],24:[function(require,module,exports) {
var process = require("process");
var t=require("process"),r=require("./curry.js"),e=require("./caml_builtin_exceptions.js");function o(t,r){return t+r}var n=["",function(r,e){var o=e.length-1|0;return void 0!==t&&t.stdout&&t.stdout.write?t.stdout.write(e):"\n"===e[o]?(console.log(e.slice(0,o)),0):(console.log(e),0)}],i=["",function(t,r){var e=r.length-1|0;return"\n"===r[e]?(console.log(r.slice(0,e)),0):(console.log(r),0)}];function l(){throw[e.failure,"caml_ml_open_descriptor_in not implemented"]}function u(){throw[e.failure,"caml_ml_open_descriptor_out not implemented"]}function c(t){return""!==t[0]?(r._2(t[1],t,t[0]),t[0]="",0):0}var s=function(r){return void 0!==t&&t.stdout&&(t.stdout.write(r),!0)};function _(r,e,o,i){var l=0===o&&i===e.length?e:e.slice(o,i);if(void 0!==t&&t.stdout&&t.stdout.write&&r===n)return t.stdout.write(l);var u=l.lastIndexOf("\n");return u<0?(r[0]=r[0]+l,0):(r[0]=r[0]+l.slice(0,u+1|0),c(r),r[0]=r[0]+l.slice(u+1|0),0)}function m(t,r){return _(t,String.fromCharCode(r),0,1)}function p(t,r,o,n){throw[e.failure,"caml_ml_input ic not implemented"]}function a(){throw[e.failure,"caml_ml_input_char not implemnted"]}function d(){return[n,[i,0]]}var f=void 0;exports.$caret=o,exports.stdin=f,exports.stdout=n,exports.stderr=i,exports.caml_ml_open_descriptor_in=l,exports.caml_ml_open_descriptor_out=u,exports.caml_ml_flush=c,exports.node_std_output=s,exports.caml_ml_output=_,exports.caml_ml_output_char=m,exports.caml_ml_input=p,exports.caml_ml_input_char=a,exports.caml_ml_out_channels_list=d;
},{"./curry.js":5,"./caml_builtin_exceptions.js":13,"process":29}],25:[function(require,module,exports) {
var process = require("process");
var o=require("process"),r=require("./caml_builtin_exceptions.js");function t(t){var e=void 0===o?void 0:o;if(void 0!==e){var i=e.env[t];if(void 0!==i)return i;throw r.not_found}throw r.not_found}function e(){var r=void 0===o?void 0:o;return void 0!==r?r.uptime():-1}function i(){return[(4294967295^(0|Date.now()))*Math.random()|0]}function s(){return 127}function n(){var r=void 0===o?void 0:o;return void 0!==r?r.cwd():"/"}function _(){var r=void 0===o?void 0:o;return void 0!==r?null==r.argv?["",[""]]:[r.argv[0],r.argv]:["",[""]]}function a(r){var t=void 0===o?void 0:o;return void 0!==t?t.exit(r):0}function v(){throw[r.failure,"caml_sys_is_directory not implemented"]}function c(){throw[r.failure,"caml_sys_file_exists not implemented"]}exports.caml_sys_getenv=t,exports.caml_sys_time=e,exports.caml_sys_random_seed=i,exports.caml_sys_system_command=s,exports.caml_sys_getcwd=n,exports.caml_sys_get_argv=_,exports.caml_sys_exit=a,exports.caml_sys_is_directory=v,exports.caml_sys_file_exists=c;
},{"./caml_builtin_exceptions.js":13,"process":29}],15:[function(require,module,exports) {
"use strict";var t=require("./caml_builtin_exceptions.js");function r(r,i){if(0===i)throw t.division_by_zero;return r/i|0}function i(r,i){if(0===i)throw t.division_by_zero;return r%i}function n(t){return(255&t)<<8|(65280&t)>>>8}function e(t){return(255&t)<<24|(65280&t)<<8|(16711680&t)>>>8|(4278190080&t)>>>24}var o=Math.imul||function(t,r){return((t>>16)*(r|=0)<<16)+(65535&t)*r|0},s=e;exports.div=r,exports.mod_=i,exports.caml_bswap16=n,exports.caml_int32_bswap=e,exports.caml_nativeint_bswap=s,exports.imul=o;
},{"./caml_builtin_exceptions.js":13}],31:[function(require,module,exports) {
"use strict";var r=String.prototype.repeat&&function(r,t){return t.repeat(r)}||function(r,t){if(0==t.length||0==r)return"";if(t.length*r>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var e="";1==(1&r)&&(e+=t),0!=(r>>>=1);)t+=t;return e};exports.repeat=r;
},{}],30:[function(require,module,exports) {
"use strict";var r=require("./caml_int32.js"),t=require("./caml_utils.js"),n=require("./caml_primitive.js"),e=require("./caml_builtin_exceptions.js"),o=[-2147483648,0],u=[2147483647,1],i=[0,1],f=[0,0],a=[-1,4294967295];function s(r){return 0!=(2147483648&r)}function c(r,t){var n=t[1],e=r[1],o=e+n&4294967295,u=s(e)&&(s(n)||!s(o))||s(n)&&!s(o)?1:0;return[r[0]+t[0]+u&4294967295,o>>>0]}function p(r){return[-1^r[0],(-1^r[1])>>>0]}function x(r,t){return r[0]===t[0]&&r[1]===t[1]}function l(r,t){return null!==t&&x(r,t)}function _(r,t){return void 0!==t&&x(r,t)}function v(r,t){return null!=t&&x(r,t)}function d(r){return x(r,o)?o:c(p(r),i)}function m(r,t){return c(r,d(t))}function h(r,t){if(0===t)return r;var n=r[1];return t>=32?[n<<(t-32|0),0]:[n>>>(32-t|0)|r[0]<<t,n<<t>>>0]}function w(r,t){if(0===t)return r;var n=r[0],e=t-32|0;return 0===e?[0,n>>>0]:e>0?[0,n>>>e>>>0]:[n>>>t,(n<<(0|-e)|r[1]>>>t)>>>0]}function A(r,t){if(0===t)return r;var n=r[0];return t<32?[n>>t,(n<<(32-t|0)|r[1]>>>t)>>>0]:[n>=0?0:-1,n>>(t-32|0)>>>0]}function b(r){return 0===r[0]&&0===r[1]}function q(r,t){for(;;){var n,e=t,u=r,i=0,a=u[0],s=0,c=0;if(0===a&&0===u[1])return f;if(4===4){if(0===e[0]&&0===e[1])return f;c=3}if(3===c&&(-2147483648!==a||0!==u[1]?s=2:(n=e[1],i=1)),2===s){var p=e[0],x=u[1],l=0;if(-2147483648!==p||0!==e[1]?l=3:(n=x,i=1),3===l){var _=e[1];if(a<0){if(p<0){t=d(e),r=d(u);continue}return d(q(d(u),e))}if(p<0)return d(q(u,d(e)));var v=65535&a,m=x>>>16,h=65535&x,w=65535&p,A=_>>>16,b=65535&_,g=0,C=0,M=0,y=h*b;return g=(C=(C=(M=(y>>>16)+m*b)>>>16)+((M=(65535&M)+h*A)>>>16)+v*b)>>>16,g+=(C=(65535&C)+m*A)>>>16,g+=(C=(65535&C)+h*w)>>>16,[(C&=65535)|(g=g+((a>>>16)*b+v*A+m*w+h*(p>>>16))&65535)<<16,(65535&y|(65535&M)<<16)>>>0]}}if(1===i)return 0==(1&n)?f:o}}function g(t){return[r.caml_int32_bswap(t[1]),r.caml_int32_bswap(t[0])>>>0]}function C(r,t){return[r[0]^t[0],(r[1]^t[1])>>>0]}function M(r,t){return[r[0]|t[0],(r[1]|t[1])>>>0]}function y(r,t){return[r[0]&t[0],(r[1]&t[1])>>>0]}function j(r,t){var n=t[0],e=r[0];return e>n||!(e<n)&&r[1]>=t[1]}function z(r,t){return!x(r,t)}function F(r,t){return!j(r,t)}function N(r,t){return r[0]>t[0]||!(r[0]<t[0])&&r[1]>t[1]}function I(r,t){return!N(r,t)}function L(r,t){return j(r,t)?t:r}function S(r,t){return N(r,t)?r:t}function k(r){return 4294967296*r[0]+r[1]}var B=Math.pow(2,32),D=Math.pow(2,63),E=-Math.pow(2,63);function G(r){return isNaN(r)||!isFinite(r)?f:r<=E?o:r+1>=D?u:r<0?d(G(-r)):[r/B|0,(r%B|0)>>>0]}function H(r,t){for(;;){var u=t,s=r,p=s[0],l=0;if(0===u[0]&&0===u[1])throw e.division_by_zero;if(2===2)if(-2147483648!==p){if(0===p&&0===s[1])return f;l=1}else if(0!==s[1])l=1;else{if(x(u,i)||x(u,a))return s;if(x(u,o))return i;var _=u[0],v=h(H(A(s,1),u),1);if(0===v[0]&&0===v[1])return _<0?i:d(i);if(3===3)return c(v,H(c(s,d(q(u,v))),u))}if(1===l){var m=u[0];if(-2147483648===m&&0===u[1])return f;if(2===2){if(p<0){if(m<0){t=d(u),r=d(s);continue}return d(H(d(s),u))}if(m<0)return d(H(s,d(u)));for(var w=f,g=s;j(g,u);){for(var C=n.caml_float_max(1,Math.floor(k(g)/k(u))),M=Math.ceil(Math.log(C)/Math.LN2),y=M<=48?1:Math.pow(2,M-48),z=G(C),F=q(z,u);F[0]<0||N(F,g);)F=q(z=G(C-=y),u);b(z)&&(z=i),w=c(w,z),g=c(g,d(F))}return w}}}}function J(r,t){return c(r,d(q(H(r,t),t)))}function K(r,t){var n=H(r,t);return[n,c(r,d(q(n,t)))]}function O(r,t){var e=n.caml_nativeint_compare(r[0],t[0]);return 0===e?n.caml_nativeint_compare(r[1],t[1]):e}function P(r){return[r<0?-1:0,r>>>0]}function Q(r){return 0|r[1]}function R(r){var n=function(r){return(r>>>0).toString(16)},e=r[0],o=r[1];if(0===e&&0===o)return"0";if(1===1){if(0!==o){if(0!==e){var u=n(r[1]),i=8-u.length|0;return i<=0?n(r[0])+u:n(r[0])+(t.repeat(i,"0")+u)}return n(r[1])}return n(r[0])+"00000000"}}function T(r){return[2147483647&r[0],r[1]]}function U(r){var t=new Int32Array([r[1],r[0]]);return new Float64Array(t.buffer)[0]}function V(r){var t=new Float64Array([r]),n=new Int32Array(t.buffer);return[n[1],n[0]>>>0]}function W(r,t){return[r.charCodeAt(t+4|0)<<32|r.charCodeAt(t+5|0)<<40|r.charCodeAt(t+6|0)<<48|r.charCodeAt(t+7|0)<<56,(r.charCodeAt(t)|r.charCodeAt(t+1|0)<<8|r.charCodeAt(t+2|0)<<16|r.charCodeAt(t+3|0)<<24)>>>0]}exports.min_int=o,exports.max_int=u,exports.one=i,exports.zero=f,exports.not=p,exports.of_int32=P,exports.to_int32=Q,exports.add=c,exports.neg=d,exports.sub=m,exports.lsl_=h,exports.lsr_=w,exports.asr_=A,exports.is_zero=b,exports.mul=q,exports.xor=C,exports.or_=M,exports.and_=y,exports.swap=g,exports.ge=j,exports.eq=x,exports.neq=z,exports.lt=F,exports.gt=N,exports.le=I,exports.equal_null=l,exports.equal_undefined=_,exports.equal_nullable=v,exports.min=L,exports.max=S,exports.to_float=k,exports.of_float=G,exports.div=H,exports.mod_=J,exports.div_mod=K,exports.compare=O,exports.to_hex=R,exports.discard_sign=T,exports.float_of_bits=U,exports.bits_of_float=V,exports.get64=W;
},{"./caml_int32.js":15,"./caml_utils.js":31,"./caml_primitive.js":17,"./caml_builtin_exceptions.js":13}],26:[function(require,module,exports) {
"use strict";var e=require("./curry.js"),r=require("./caml_int32.js"),a=require("./caml_int64.js"),t=require("./caml_utils.js"),i=require("./caml_builtin_exceptions.js");function n(e){throw[i.failure,e]}function c(e){return e>=65?e>=97?e>=123?-1:e-87|0:e>=91?-1:e-55|0:e>57||e<48?-1:e-48|0}function o(e){switch(e){case 0:return 8;case 1:return 16;case 2:return 10;case 3:return 2}}function s(e){var r=1,a=2,t=0;"-"===e[t]&&(r=-1,t=t+1|0);var i=e.charCodeAt(t),n=e.charCodeAt(t+1|0);return 48===i&&(n>=89?98!==n?111!==n?120===n&&(a=1,t=t+2|0):(a=0,t=t+2|0):(a=3,t=t+2|0):66!==n?79!==n?n>=88&&(a=1,t=t+2|0):(a=0,t=t+2|0):(a=3,t=t+2|0)),[t,r,a]}function f(e){var r=s(e),a=r[0],t=o(r[2]),n=e.length,f=c(a<n?e.charCodeAt(a):0);if(f<0||f>=t)throw[i.failure,"int_of_string"];var u=r[1]*function(r,a){for(;;){var o=a,s=r;if(o===n)return s;var f=e.charCodeAt(o);if(95!==f){var u=c(f);if(u<0||u>=t)throw[i.failure,"int_of_string"];var l=t*s+u;if(l>4294967295)throw[i.failure,"int_of_string"];a=o+1|0,r=l}else a=o+1|0}}(f,a+1|0),l=0|u;if(10===t&&u!==l)throw[i.failure,"int_of_string"];return l}function u(e){var r,t=s(e),n=t[2],f=t[0],u=a.of_int32(o(n)),l=a.of_int32(t[1]);switch(n){case 0:r=[536870911,4294967295];break;case 1:r=[268435455,4294967295];break;case 2:r=[429496729,2576980377];break;case 3:r=[2147483647,4294967295]}var d=e.length,_=f<d?e.charCodeAt(f):0,v=a.of_int32(c(_));if(a.lt(v,[0,0])||a.ge(v,u))throw[i.failure,"int64_of_string"];var h=a.mul(l,function(t,n){for(;;){var o=n,s=t;if(o===d)return s;var f=e.charCodeAt(o);if(95!==f){var l=a.of_int32(c(f));if(a.lt(l,[0,0])||a.ge(l,u)||a.gt(s,r))throw[i.failure,"int64_of_string"];n=o+1|0,t=a.add(a.mul(u,s),l)}else n=o+1|0}}(v,f+1|0)),g=a.or_(h,[0,0]);if(a.eq(u,[0,10])&&a.neq(h,g))throw[i.failure,"int64_of_string"];return g}function l(e){switch(e){case 0:return 8;case 1:return 16;case 2:return 10}}function d(e){return e>=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function _(e){var a=e.length;if(a>31)throw[i.invalid_argument,"format_int: format too long"];for(var t=["+","-"," ",!1,2,!1,0,!1,1,-1,"f"],n=0;;){var c=n;if(c>=a)return t;var o=e.charCodeAt(c),s=0;if(o>=69)if(o>=88)if(o>=121)s=1;else switch(o-88|0){case 0:t[4]=1,t[7]=!0,n=c+1|0;continue;case 13:case 14:case 15:s=5;break;case 12:case 17:s=4;break;case 23:t[4]=0,n=c+1|0;continue;case 29:t[4]=2,n=c+1|0;continue;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 16:case 18:case 19:case 20:case 21:case 22:case 24:case 25:case 26:case 27:case 28:case 30:case 31:s=1;break;case 32:t[4]=1,n=c+1|0;continue}else{if(!(o>=72)){t[5]=!0,t[7]=!0,t[10]=String.fromCharCode(d(o)),n=c+1|0;continue}s=1}else{var f=o-32|0;if(f>25||f<0)s=1;else switch(f){case 3:t[3]=!0,n=c+1|0;continue;case 0:case 11:s=2;break;case 13:t[0]="-",n=c+1|0;continue;case 14:t[9]=0;for(var u=c+1|0;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(u)();)t[9]=(r.imul(t[9],10)+e.charCodeAt(u)|0)-48|0,u=u+1|0;n=u;continue;case 1:case 2:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 12:case 15:s=1;break;case 16:t[2]="0",n=c+1|0;continue;case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:s=3}}switch(s){case 1:n=c+1|0;continue;case 2:t[1]=String.fromCharCode(o),n=c+1|0;continue;case 3:t[6]=0;for(var l=c;function(r){return function(){var a=e.charCodeAt(r)-48|0;return a>=0&&a<=9}}(l)();)t[6]=(r.imul(t[6],10)+e.charCodeAt(l)|0)-48|0,l=l+1|0;n=l;continue;case 4:t[5]=!0,t[4]=2,n=c+1|0;continue;case 5:t[5]=!0,t[10]=String.fromCharCode(o),n=c+1|0;continue}}}function v(e,r){var a=e[0],t=e[1],i=e[2],n=e[3],c=e[4],o=e[5],s=e[6],f=e[7],u=e[8],l=r.length;o&&(u<0||"-"!==t)&&(l=l+1|0),n&&(0===c?l=l+1|0:1===c&&(l=l+2|0));var d="";if("+"===a&&" "===i)for(var _=l,v=s-1|0;_<=v;++_)d+=i;if(o&&(u<0?d+="-":"-"!==t&&(d+=t)),n&&0===c&&(d+="0"),n&&1===c&&(d+="0x"),"+"===a&&"0"===i)for(var h=l,g=s-1|0;h<=g;++h)d+=i;if(d=f?d+r.toUpperCase():d+r,"-"===a)for(var m=l,C=s-1|0;m<=C;++m)d+=" ";return d}function h(e,r){if("%d"===e)return String(r);var a=_(e),i=r,n=(i<0?a[5]?(a[8]=-1,-i):i>>>0:i).toString(l(a[4]));if(a[9]>=0){a[2]=" ";var c=a[9]-n.length|0;c>0&&(n=t.repeat(c,"0")+n)}return v(a,n)}function g(e,r){var i=_(e),n=i[5]&&a.lt(r,[0,0])?(i[8]=-1,a.neg(r)):r,c="";switch(i[4]){case 0:var o=[0,8],s="01234567";if(a.lt(n,[0,0])){var f=a.discard_sign(n),u=a.div_mod(f,o),l=a.add([268435456,0],u[0]),d=u[1];for(c=String.fromCharCode(s.charCodeAt(0|d[1]))+c;a.neq(l,[0,0]);){var h=a.div_mod(l,o);l=h[0],d=h[1],c=String.fromCharCode(s.charCodeAt(0|d[1]))+c}}else{var g=a.div_mod(n,o),m=g[0],C=g[1];for(c=String.fromCharCode(s.charCodeAt(0|C[1]))+c;a.neq(m,[0,0]);){var x=a.div_mod(m,o);m=x[0],C=x[1],c=String.fromCharCode(s.charCodeAt(0|C[1]))+c}}break;case 1:c=a.to_hex(n)+c;break;case 2:var p=[0,10];if(a.lt(n,[0,0])){var A=a.discard_sign(n),w=a.div_mod(A,p),b=a.div_mod(a.add([0,8],w[1]),p),S=a.add(a.add([214748364,3435973836],w[0]),b[0]),k=b[1];for(c=String.fromCharCode("0123456789".charCodeAt(0|k[1]))+c;a.neq(S,[0,0]);){var q=a.div_mod(S,p);S=q[0],k=q[1],c=String.fromCharCode("0123456789".charCodeAt(0|k[1]))+c}}else{var j=a.div_mod(n,p),F=j[0],y=j[1];for(c=String.fromCharCode("0123456789".charCodeAt(0|y[1]))+c;a.neq(F,[0,0]);){var N=a.div_mod(F,p);F=N[0],y=N[1],c=String.fromCharCode("0123456789".charCodeAt(0|y[1]))+c}}}if(i[9]>=0){i[2]=" ";var O=i[9]-c.length|0;O>0&&(c=t.repeat(O,"0")+c)}return v(i,c)}function m(e,r){var a=_(e),t=a[9]<0?6:a[9],i=r<0?(a[8]=-1,-r):r,n="";if(isNaN(i))n="nan",a[2]=" ";else if(isFinite(i)){switch(a[10]){case"e":var c=(n=i.toExponential(t)).length;"e"===n[c-3|0]&&(n=n.slice(0,c-1|0)+"0"+n.slice(c-1|0));break;case"f":n=i.toFixed(t);break;case"g":var o=0!==t?t:1,s=(n=i.toExponential(o-1|0)).indexOf("e"),f=0|Number(n.slice(s+1|0));if(f<-4||i>=1e21||i.toFixed().length>o){for(var u=s-1|0;"0"===n[u];)u=u-1|0;"."===n[u]&&(u=u-1|0);var l=(n=n.slice(0,u+1|0)+n.slice(s)).length;"e"===n[l-3|0]&&(n=n.slice(0,l-1|0)+"0"+n.slice(l-1|0))}else{var d=o;if(f<0)d=d-(f+1|0)|0,n=i.toFixed(d);else for(;(n=i.toFixed(d)).length>(o+1|0);)d=d-1|0;if(0!==d){for(var h=n.length-1|0;"0"===n[h];)h=h-1|0;"."===n[h]&&(h=h-1|0),n=n.slice(0,h+1|0)}}}}else n="inf",a[2]=" ";return v(a,n)}var C=function(e,r){var a=+e;if(e.length>0&&a==a)return a;if(a=+(e=e.replace(/_/g,"")),e.length>0&&a==a||/^[+-]?nan$/i.test(e))return a;if(/^ *0x[0-9a-f_]+p[+-]?[0-9_]+/i.test(e)){var t=e.indexOf("p");t=-1==t?e.indexOf("P"):t;var i=+e.substring(t+1);return(a=+e.substring(0,t))*Math.pow(2,i)}return/^\+?inf(inity)?$/i.test(e)?1/0:/^-inf(inity)?$/i.test(e)?-1/0:void r("float_of_string")};function x(r){return e._2(C,r,n)}var p=h,A=h,w=f,b=f;exports.caml_format_float=m,exports.caml_format_int=h,exports.caml_nativeint_format=p,exports.caml_int32_format=A,exports.caml_float_of_string=x,exports.caml_int64_format=g,exports.caml_int_of_string=f,exports.caml_int32_of_string=w,exports.caml_int64_of_string=u,exports.caml_nativeint_of_string=b;
},{"./curry.js":5,"./caml_int32.js":15,"./caml_int64.js":30,"./caml_utils.js":31,"./caml_builtin_exceptions.js":13}],16:[function(require,module,exports) {
"use strict";var r=require("./caml_builtin_exceptions.js");function t(r){return String.fromCharCode(r)}function n(t,n){if(n>=t.length||n<0)throw[r.invalid_argument,"index out of bounds"];return t.charCodeAt(n)}function e(t){if(t<0)throw[r.invalid_argument,"String.create"];for(var n=new Array(t),e=0,o=t-1|0;e<=o;++e)n[e]=0;return n}function o(r,t,n,e){if(n>0){for(var o=t,a=(n+t|0)-1|0;o<=a;++o)r[o]=e;return 0}return 0}function a(r,t,n,e,o){if(o>0){var a=r.length-t|0;if(o<=a){for(var i=0,f=o-1|0;i<=f;++i)n[e+i|0]=r.charCodeAt(t+i|0);return 0}for(var u=0,c=a-1|0;u<=c;++u)n[e+u|0]=r.charCodeAt(t+u|0);for(var l=a,s=o-1|0;l<=s;++l)n[e+l|0]=0;return 0}return 0}function i(r,t,n,e,o){if(o>0){if(r===n){var a=r,i=t,f=e,u=o;if(i<f){for(var c=(a.length-f|0)-1|0,l=u-1|0,s=c>l?l:c;s>=0;--s)a[f+s|0]=a[i+s|0];return 0}if(i>f){for(var g=(a.length-i|0)-1|0,_=u-1|0,h=g>_?_:g,v=0;v<=h;++v)a[f+v|0]=a[i+v|0];return 0}return 0}var d=r.length-t|0;if(o<=d){for(var p=0,C=o-1|0;p<=C;++p)n[e+p|0]=r[t+p|0];return 0}for(var m=0,x=d-1|0;m<=x;++m)n[e+m|0]=r[t+m|0];for(var A=d,y=o-1|0;A<=y;++A)n[e+A|0]=0;return 0}return 0}function f(r){for(var t=r.length,n=new Array(t),e=0,o=t-1|0;e<=o;++e)n[e]=r.charCodeAt(e);return n}function u(r){var t=r,n=r.length,e="",o=n;if(n<=4096&&n===t.length)return String.fromCharCode.apply(null,t);for(var a=0;o>0;){var f=o<1024?o:1024,u=new Array(f);i(t,a,u,0,f),e+=String.fromCharCode.apply(null,u),o=o-f|0,a=a+f|0}return e}function c(r){for(var t=r.length,n=new Array(t),e=0,o=t-1|0;e<=o;++e)n[e]=r[e];return u(n)}function l(r){return r>31&&r<127}function s(r,t){return r.charCodeAt(t)+(r.charCodeAt(t+1|0)<<8)|0}function g(r,t){return((r.charCodeAt(t)+(r.charCodeAt(t+1|0)<<8)|0)+(r.charCodeAt(t+2|0)<<16)|0)+(r.charCodeAt(t+3|0)<<24)|0}function _(t,n){if(n<0||n>=t.length)throw[r.invalid_argument,"index out of bounds"];return t.charCodeAt(n)}exports.bytes_of_string=f,exports.bytes_to_string=u,exports.caml_is_printable=l,exports.caml_string_of_char_array=c,exports.caml_string_get=n,exports.caml_create_string=e,exports.caml_fill_string=o,exports.caml_blit_string=a,exports.caml_blit_bytes=i,exports.caml_string_get16=s,exports.caml_string_get32=g,exports.string_of_char=t,exports.get=_;
},{"./caml_builtin_exceptions.js":13}],19:[function(require,module,exports) {
"use strict";var t=[0];function r(r){return r[1]=t[0],t[0]+=1,r}function e(){return t[0]+=1,t[0]}function n(t){var r=[t,e(0)];return r.tag=248,r}function i(t){if(void 0===t)return!1;if(248===t.tag)return!0;var r=t[0];return void 0!==r&&248===r.tag}exports.caml_set_oo_id=r,exports.get_id=e,exports.create=n,exports.isCamlExceptionOrOpenVariant=i;
},{}],27:[function(require,module,exports) {
"use strict";function e(e){throw new Error(e+" not implemented by BuckleScript yet\n")}exports.not_implemented=e;
},{}],28:[function(require,module,exports) {
"use strict";var r=require("./block.js");function e(_){if("number"==typeof _)return 0;switch(0|_.tag){case 0:return r.__(0,[e(_[0])]);case 1:return r.__(1,[e(_[0])]);case 2:return r.__(2,[e(_[0])]);case 3:return r.__(3,[e(_[0])]);case 4:return r.__(4,[e(_[0])]);case 5:return r.__(5,[e(_[0])]);case 6:return r.__(6,[e(_[0])]);case 7:return r.__(7,[e(_[0])]);case 8:return r.__(8,[_[0],e(_[1])]);case 9:var t=_[0];return r.__(9,[t,t,e(_[2])]);case 10:return r.__(10,[e(_[0])]);case 11:return r.__(11,[e(_[0])]);case 12:return r.__(12,[e(_[0])]);case 13:return r.__(13,[e(_[0])]);case 14:return r.__(14,[e(_[0])])}}function _(e,t){if("number"==typeof e)return t;switch(0|e.tag){case 0:return r.__(0,[_(e[0],t)]);case 1:return r.__(1,[_(e[0],t)]);case 2:return r.__(2,[_(e[0],t)]);case 3:return r.__(3,[_(e[0],t)]);case 4:return r.__(4,[_(e[0],t)]);case 5:return r.__(5,[_(e[0],t)]);case 6:return r.__(6,[_(e[0],t)]);case 7:return r.__(7,[_(e[0],t)]);case 8:return r.__(8,[e[0],_(e[1],t)]);case 9:return r.__(9,[e[0],e[1],_(e[2],t)]);case 10:return r.__(10,[_(e[0],t)]);case 11:return r.__(11,[_(e[0],t)]);case 12:return r.__(12,[_(e[0],t)]);case 13:return r.__(13,[_(e[0],t)]);case 14:return r.__(14,[_(e[0],t)])}}function t(e,_){if("number"==typeof e)return _;switch(0|e.tag){case 0:return r.__(0,[t(e[0],_)]);case 1:return r.__(1,[t(e[0],_)]);case 2:return r.__(2,[e[0],t(e[1],_)]);case 3:return r.__(3,[e[0],t(e[1],_)]);case 4:return r.__(4,[e[0],e[1],e[2],t(e[3],_)]);case 5:return r.__(5,[e[0],e[1],e[2],t(e[3],_)]);case 6:return r.__(6,[e[0],e[1],e[2],t(e[3],_)]);case 7:return r.__(7,[e[0],e[1],e[2],t(e[3],_)]);case 8:return r.__(8,[e[0],e[1],e[2],t(e[3],_)]);case 9:return r.__(9,[t(e[0],_)]);case 10:return r.__(10,[t(e[0],_)]);case 11:return r.__(11,[e[0],t(e[1],_)]);case 12:return r.__(12,[e[0],t(e[1],_)]);case 13:return r.__(13,[e[0],e[1],t(e[2],_)]);case 14:return r.__(14,[e[0],e[1],t(e[2],_)]);case 15:return r.__(15,[t(e[0],_)]);case 16:return r.__(16,[t(e[0],_)]);case 17:return r.__(17,[e[0],t(e[1],_)]);case 18:return r.__(18,[e[0],t(e[1],_)]);case 19:return r.__(19,[t(e[0],_)]);case 20:return r.__(20,[e[0],e[1],t(e[2],_)]);case 21:return r.__(21,[e[0],t(e[1],_)]);case 22:return r.__(22,[t(e[0],_)]);case 23:return r.__(23,[e[0],t(e[1],_)]);case 24:return r.__(24,[e[0],e[1],t(e[2],_)])}}exports.concat_fmtty=_,exports.erase_rel=e,exports.concat_fmt=t;
},{"./block.js":23}],21:[function(require,module,exports) {
"use strict";var t=require("./curry.js"),n=require("./caml_io.js"),e=require("./caml_sys.js"),r=require("./caml_format.js"),_=require("./caml_string.js"),o=require("./caml_exceptions.js"),u=require("./caml_missing_polyfill.js"),i=require("./caml_builtin_exceptions.js"),l=require("./camlinternalFormatBasics.js");function c(t){throw[i.failure,t]}function a(t){throw[i.invalid_argument,t]}var m=o.create("Pervasives.Exit");function s(t){return t>=0?t:0|-t}function p(t){return-1^t}var f=-2147483648;function x(t){if(t<0||t>255)throw[i.invalid_argument,"char_of_int"];return t}function h(t){return t?"true":"false"}function d(t){switch(t){case"false":return!1;case"true":return!0;default:throw[i.invalid_argument,"bool_of_string"]}}function g(t){for(var n=t.length,e=0;;){var r=e;if(r>=n)return t+".";var o=_.get(t,r);if(o>=48){if(o>=58)return t;e=r+1|0}else{if(45!==o)return t;e=r+1|0}}}function v(t){return g(r.caml_format_float("%.12g",t))}function y(t,n){return t?[t[0],y(t[1],n)]:n}var b=n.stdin,w=n.stdout,j=n.stderr;function q(t,e,r){return n.caml_ml_open_descriptor_out(u.not_implemented("caml_sys_open"))}function k(t){return q([1,[3,[4,[7,0]]]],438,t)}function z(t){return q([1,[3,[4,[6,0]]]],438,t)}function $(){for(var t=n.caml_ml_out_channels_list(0);;){var e=t;if(!e)return 0;try{n.caml_ml_flush(e[0])}catch(t){}t=e[1]}}function E(t,e){return n.caml_ml_output(t,e,0,e.length)}function F(t,e){return n.caml_ml_output(t,e,0,e.length)}function S(t,e,r,_){if(r<0||_<0||r>(e.length-_|0))throw[i.invalid_argument,"output"];return n.caml_ml_output(t,e,r,_)}function B(t,e,r,_){if(r<0||_<0||r>(e.length-_|0))throw[i.invalid_argument,"output_substring"];return n.caml_ml_output(t,e,r,_)}function L(t,n){return u.not_implemented("caml_output_value")}function P(t){return n.caml_ml_flush(t),u.not_implemented("caml_ml_close_channel")}function A(t){try{n.caml_ml_flush(t)}catch(t){}try{return u.not_implemented("caml_ml_close_channel")}catch(t){return 0}}function C(t,e,r){return n.caml_ml_open_descriptor_in(u.not_implemented("caml_sys_open"))}function D(t){return C([0,[7,0]],0,t)}function G(t){return C([0,[6,0]],0,t)}function H(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw[i.invalid_argument,"input"];return u.not_implemented("caml_ml_input")}function I(t,n,e,r){for(;;){var _=r,o=e;if(_<=0)return 0;var l=u.not_implemented("caml_ml_input");if(0===l)throw i.end_of_file;r=_-l|0,e=o+l|0}}function J(t,n,e,r){if(e<0||r<0||e>(n.length-r|0))throw[i.invalid_argument,"really_input"];return I(t,n,e,r)}function K(t,n){var e=_.caml_create_string(n);return J(t,e,0,n),_.bytes_to_string(e)}function M(t){var e=function(t,n,e){for(;;){var r=e,o=n;if(!r)return t;var u=r[0],i=u.length;_.caml_blit_bytes(u,0,t,o-i|0,i),e=r[1],n=o-i|0}};return _.bytes_to_string(function(r,o){for(;;){var l=o,c=r,a=u.not_implemented("caml_ml_input_scan_line");if(0===a){if(c)return e(_.caml_create_string(l),l,c);throw i.end_of_file}if(a>0){var m=_.caml_create_string(a-1|0);if(u.not_implemented("caml_ml_input"),n.caml_ml_input_char(t),c){var s=(l+a|0)-1|0;return e(_.caml_create_string(s),s,[m,c])}return m}var p=_.caml_create_string(0|-a);u.not_implemented("caml_ml_input"),o=l-a|0,r=[p,c]}}(0,0))}function N(){try{return u.not_implemented("caml_ml_close_channel")}catch(t){return 0}}function O(t){return n.caml_ml_output_char(w,t)}function Q(t){return F(w,t)}function R(t){return E(w,t)}function T(t){return F(w,String(t))}function U(t){return F(w,g(r.caml_format_float("%.12g",t)))}function V(){return n.caml_ml_output_char(w,10),n.caml_ml_flush(w)}function W(t){return n.caml_ml_output_char(j,t)}function X(t){return F(j,t)}function Y(t){return E(j,t)}function Z(t){return F(j,String(t))}function tt(t){return F(j,g(r.caml_format_float("%.12g",t)))}function nt(){return n.caml_ml_output_char(j,10),n.caml_ml_flush(j)}function et(){return n.caml_ml_flush(w),M(b)}function rt(){return r.caml_int_of_string((n.caml_ml_flush(w),M(b)))}function _t(){return r.caml_float_of_string((n.caml_ml_flush(w),M(b)))}function ot(t){return t[1]}function ut(t,n){return[l.concat_fmt(t[0],n[0]),t[1]+"%,"+n[1]]}var it=[$];function lt(n){var e=it[0];return it[0]=function(){return t._1(n,0),t._1(e,0)},0}function ct(){return t._1(it[0],0)}function at(t){return ct(0),e.caml_sys_exit(t)}var mt=2147483647,st=2.220446049250313e-16,pt=n.caml_ml_flush,ft=n.caml_ml_output_char,xt=n.caml_ml_output_char;function ht(t,n){return u.not_implemented("caml_ml_output_int")}function dt(t,n){return u.not_implemented("caml_ml_seek_out")}function gt(){return u.not_implemented("caml_ml_pos_out")}function vt(){return u.not_implemented("caml_ml_channel_size")}function yt(t,n){return u.not_implemented("caml_ml_set_binary_mode")}var bt=n.caml_ml_input_char,wt=n.caml_ml_input_char;function jt(){return u.not_implemented("caml_ml_input_int")}function qt(){return u.not_implemented("caml_input_value")}function kt(t,n){return u.not_implemented("caml_ml_seek_in")}function zt(){return u.not_implemented("caml_ml_pos_in")}function $t(){return u.not_implemented("caml_ml_channel_size")}function Et(){return u.not_implemented("caml_ml_close_channel")}function Ft(t,n){return u.not_implemented("caml_ml_set_binary_mode")}function St(t,n){return u.not_implemented("caml_ml_seek_out_64")}function Bt(){return u.not_implemented("caml_ml_pos_out_64")}function Lt(){return u.not_implemented("caml_ml_channel_size_64")}function Pt(t,n){return u.not_implemented("caml_ml_seek_in_64")}function At(){return u.not_implemented("caml_ml_pos_in_64")}function Ct(){return u.not_implemented("caml_ml_channel_size_64")}var Dt=[St,Bt,Lt,Pt,At,Ct];exports.invalid_arg=a,exports.failwith=c,exports.Exit=m,exports.abs=s,exports.max_int=mt,exports.min_int=f,exports.lnot=p,exports.epsilon_float=st,exports.char_of_int=x,exports.string_of_bool=h,exports.bool_of_string=d,exports.string_of_float=v,exports.$at=y,exports.stdin=b,exports.stdout=w,exports.stderr=j,exports.print_char=O,exports.print_string=Q,exports.print_bytes=R,exports.print_int=T,exports.print_float=U,exports.print_newline=V,exports.prerr_char=W,exports.prerr_string=X,exports.prerr_bytes=Y,exports.prerr_int=Z,exports.prerr_float=tt,exports.prerr_newline=nt,exports.read_line=et,exports.read_int=rt,exports.read_float=_t,exports.open_out=k,exports.open_out_bin=z,exports.open_out_gen=q,exports.flush=pt,exports.flush_all=$,exports.output_char=ft,exports.output_string=F,exports.output_bytes=E,exports.output=S,exports.output_substring=B,exports.output_byte=xt,exports.output_binary_int=ht,exports.output_value=L,exports.seek_out=dt,exports.pos_out=gt,exports.out_channel_length=vt,exports.close_out=P,exports.close_out_noerr=A,exports.set_binary_mode_out=yt,exports.open_in=D,exports.open_in_bin=G,exports.open_in_gen=C,exports.input_char=bt,exports.input_line=M,exports.input=H,exports.really_input=J,exports.really_input_string=K,exports.input_byte=wt,exports.input_binary_int=jt,exports.input_value=qt,exports.seek_in=kt,exports.pos_in=zt,exports.in_channel_length=$t,exports.close_in=Et,exports.close_in_noerr=N,exports.set_binary_mode_in=Ft,exports.LargeFile=Dt,exports.string_of_format=ot,exports.$caret$caret=ut,exports.exit=at,exports.at_exit=lt,exports.valid_float_lexem=g,exports.unsafe_really_input=I,exports.do_at_exit=ct;
},{"./curry.js":5,"./caml_io.js":24,"./caml_sys.js":25,"./caml_format.js":26,"./caml_string.js":16,"./caml_exceptions.js":19,"./caml_missing_polyfill.js":27,"./caml_builtin_exceptions.js":13,"./camlinternalFormatBasics.js":28}],9:[function(require,module,exports) {
"use strict";var r=require("./curry.js"),t=require("./caml_obj.js"),i=require("./pervasives.js"),n=require("./caml_builtin_exceptions.js");function e(r){for(var t=0,i=r;;){var n=i,e=t;if(!n)return e;i=n[1],t=e+1|0}}function f(r){if(r)return r[0];throw[n.failure,"hd"]}function o(r){if(r)return r[1];throw[n.failure,"tl"]}function u(r,t){if(t<0)throw[n.invalid_argument,"List.nth"];for(var i=r,e=t;;){var f=e,o=i;if(!o)throw[n.failure,"nth"];if(0===f)return o[0];e=f-1|0,i=o[1]}}function a(r,t){for(;;){var i=t,n=r;if(!n)return i;t=[n[0],i],r=n[1]}}function v(r){return a(r,0)}function s(r){return r?i.$at(r[0],s(r[1])):0}function _(t,i){return i?[r._1(t,i[0]),_(t,i[1])]:0}function c(t,i,n){return n?[r._2(i,t,n[0]),c(t+1|0,i,n[1])]:0}function l(r,t){return c(0,r,t)}function p(t,i){for(var n=0,e=i;;){var f=e,o=n;if(!f)return o;e=f[1],n=[r._1(t,f[0]),o]}}function x(t,i){for(;;){var n=i;if(!n)return 0;r._1(t,n[0]),i=n[1]}}function m(t,i){for(var n=0,e=t,f=i;;){var o=f,u=n;if(!o)return 0;r._2(e,u,o[0]),f=o[1],n=u+1|0}}function d(t,i,n){for(;;){var e=n,f=i;if(!e)return f;n=e[1],i=r._2(t,f,e[0])}}function h(t,i,n){return i?r._2(t,i[0],h(t,i[1],n)):n}function w(t,i,e){if(i){if(e)return[r._2(t,i[0],e[0]),w(t,i[1],e[1])];throw[n.invalid_argument,"List.map2"]}if(e)throw[n.invalid_argument,"List.map2"];return 0}function g(t,i,e){for(var f=0,o=i,u=e;;){var a=u,v=o,s=f;if(v){if(a){u=a[1],o=v[1],f=[r._2(t,v[0],a[0]),s];continue}throw[n.invalid_argument,"List.rev_map2"]}if(a)throw[n.invalid_argument,"List.rev_map2"];return s}}function L(t,i,e){for(;;){var f=e,o=i;if(o){if(f){r._2(t,o[0],f[0]),e=f[1],i=o[1];continue}throw[n.invalid_argument,"List.iter2"]}if(f)throw[n.invalid_argument,"List.iter2"];return 0}}function q(t,i,e,f){for(;;){var o=f,u=e,a=i;if(u){if(o){f=o[1],e=u[1],i=r._3(t,a,u[0],o[0]);continue}throw[n.invalid_argument,"List.fold_left2"]}if(o)throw[n.invalid_argument,"List.fold_left2"];return a}}function b(t,i,e,f){if(i){if(e)return r._3(t,i[0],e[0],b(t,i[1],e[1],f));throw[n.invalid_argument,"List.fold_right2"]}if(e)throw[n.invalid_argument,"List.fold_right2"];return f}function j(t,i){for(;;){var n=i;if(n){if(r._1(t,n[0])){i=n[1];continue}return!1}return!0}}function $(t,i){for(;;){var n=i;if(!n)return!1;if(r._1(t,n[0]))return!0;i=n[1]}}function y(t,i,e){for(;;){var f=e,o=i;if(o){if(f){if(r._2(t,o[0],f[0])){e=f[1],i=o[1];continue}return!1}throw[n.invalid_argument,"List.for_all2"]}if(f)throw[n.invalid_argument,"List.for_all2"];return!0}}function k(t,i,e){for(;;){var f=e,o=i;if(o){if(f){if(r._2(t,o[0],f[0]))return!0;e=f[1],i=o[1];continue}throw[n.invalid_argument,"List.exists2"]}if(f)throw[n.invalid_argument,"List.exists2"];return!1}}function z(r,i){for(;;){var n=i;if(!n)return!1;if(t.caml_equal(n[0],r))return!0;i=n[1]}}function A(r,t){for(;;){var i=t;if(!i)return!1;if(i[0]===r)return!0;t=i[1]}}function B(r,i){for(;;){var e=i;if(!e)throw n.not_found;var f=e[0];if(t.caml_equal(f[0],r))return f[1];i=e[1]}}function C(r,t){for(;;){var i=t;if(!i)throw n.not_found;var e=i[0];if(e[0]===r)return e[1];t=i[1]}}function D(r,i){for(;;){var n=i;if(!n)return!1;if(t.caml_equal(n[0][0],r))return!0;i=n[1]}}function E(r,t){for(;;){var i=t;if(!i)return!1;if(i[0][0]===r)return!0;t=i[1]}}function F(r,i){if(i){var n=i[1],e=i[0];return t.caml_equal(e[0],r)?n:[e,F(r,n)]}return 0}function G(r,t){if(t){var i=t[1],n=t[0];return n[0]===r?i:[n,G(r,i)]}return 0}function H(t,i){for(;;){var e=i;if(!e)throw n.not_found;var f=e[0];if(r._1(t,f))return f;i=e[1]}}function I(t){return function(i){for(var n=0,e=i;;){var f=e,o=n;if(!f)return a(o,0);var u=f[1],v=f[0];r._1(t,v)?(e=u,n=[v,o]):e=u}}}function J(t,i){for(var n=0,e=0,f=i;;){var o=f,u=e,v=n;if(!o)return[a(v,0),a(u,0)];var s=o[1],_=o[0];r._1(t,_)?(f=s,n=[_,v]):(f=s,e=[_,u])}}function K(r){if(r){var t=r[0],i=K(r[1]);return[[t[0],i[0]],[t[1],i[1]]]}return[0,0]}function M(r,t){if(r){if(t)return[[r[0],t[0]],M(r[1],t[1])];throw[n.invalid_argument,"List.combine"]}if(t)throw[n.invalid_argument,"List.combine"];return 0}function N(t,i,n){if(i){if(n){var e=n[0],f=i[0];return r._2(t,f,e)<=0?[f,N(t,i[1],n)]:[e,N(t,i,n[1])]}return i}return n}function O(r,t){for(;;){var i=t,e=r;if(0===e)return i;if(!i)throw[n.assert_failure,["list.ml",223,11]];t=i[1],r=e-1|0}}function P(t,i){var n=function(i,n){var e=0;if(2!==i)if(3===i&&n){var o=n[1];if(o){var u=o[1];if(u){var v=u[0],s=o[0],_=n[0];return r._2(t,_,s)<=0?r._2(t,s,v)<=0?[_,[s,[v,0]]]:r._2(t,_,v)<=0?[_,[v,[s,0]]]:[v,[_,[s,0]]]:r._2(t,_,v)<=0?[s,[_,[v,0]]]:r._2(t,s,v)<=0?[s,[v,[_,0]]]:[v,[s,[_,0]]]}e=1}else e=1}else e=1;else if(n){var c=n[1];if(c){var l=c[0],p=n[0];return r._2(t,p,l)<=0?[p,[l,0]]:[l,[p,0]]}e=1}else e=1;if(1===e)for(var x=i>>1,m=i-x|0,d=O(x,n),h=f(x,n),w=f(m,d),g=0;;){var L=g,q=w,b=h;if(b){if(q){var j=q[0],$=b[0];if(r._2(t,$,j)>0){g=[$,L],h=b[1];continue}g=[j,L],w=q[1];continue}return a(b,L)}return a(q,L)}},f=function(i,e){var f=0;if(2!==i)if(3===i&&e){var o=e[1];if(o){var u=o[1];if(u){var v=u[0],s=o[0],_=e[0];return r._2(t,_,s)>0?r._2(t,s,v)>0?[_,[s,[v,0]]]:r._2(t,_,v)>0?[_,[v,[s,0]]]:[v,[_,[s,0]]]:r._2(t,_,v)>0?[s,[_,[v,0]]]:r._2(t,s,v)>0?[s,[v,[_,0]]]:[v,[s,[_,0]]]}f=1}else f=1}else f=1;else if(e){var c=e[1];if(c){var l=c[0],p=e[0];return r._2(t,p,l)>0?[p,[l,0]]:[l,[p,0]]}f=1}else f=1;if(1===f)for(var x=i>>1,m=i-x|0,d=O(x,e),h=n(x,e),w=n(m,d),g=0;;){var L=g,q=w,b=h;if(b){if(q){var j=q[0],$=b[0];if(r._2(t,$,j)<=0){g=[$,L],h=b[1];continue}g=[j,L],w=q[1];continue}return a(b,L)}return a(q,L)}},o=e(i);return o<2?i:n(o,i)}function Q(t,i){var n=function(i,n){var e=0;if(2!==i)if(3===i&&n){var o=n[1];if(o){var u=o[1];if(u){var v=u[0],s=o[0],_=n[0],c=r._2(t,_,s);if(0===c){var l=r._2(t,s,v);return 0===l?[s,0]:l<0?[s,[v,0]]:[v,[s,0]]}if(c<0){var p=r._2(t,s,v);if(0===p)return[_,[s,0]];if(p<0)return[_,[s,[v,0]]];var x=r._2(t,_,v);return 0===x?[_,[s,0]]:x<0?[_,[v,[s,0]]]:[v,[_,[s,0]]]}var m=r._2(t,_,v);if(0===m)return[s,[_,0]];if(m<0)return[s,[_,[v,0]]];var d=r._2(t,s,v);return 0===d?[s,[_,0]]:d<0?[s,[v,[_,0]]]:[v,[s,[_,0]]]}e=1}else e=1}else e=1;else if(n){var h=n[1];if(h){var w=h[0],g=n[0],L=r._2(t,g,w);return 0===L?[g,0]:L<0?[g,[w,0]]:[w,[g,0]]}e=1}else e=1;if(1===e)for(var q=i>>1,b=i-q|0,j=O(q,n),$=f(q,n),y=f(b,j),k=0;;){var z=k,A=y,B=$;if(B){if(A){var C=A[1],D=A[0],E=B[1],F=B[0],G=r._2(t,F,D);if(0===G){k=[F,z],y=C,$=E;continue}if(G>0){k=[F,z],$=E;continue}k=[D,z],y=C;continue}return a(B,z)}return a(A,z)}},f=function(i,e){var f=0;if(2!==i)if(3===i&&e){var o=e[1];if(o){var u=o[1];if(u){var v=u[0],s=o[0],_=e[0],c=r._2(t,_,s);if(0===c){var l=r._2(t,s,v);return 0===l?[s,0]:l>0?[s,[v,0]]:[v,[s,0]]}if(c>0){var p=r._2(t,s,v);if(0===p)return[_,[s,0]];if(p>0)return[_,[s,[v,0]]];var x=r._2(t,_,v);return 0===x?[_,[s,0]]:x>0?[_,[v,[s,0]]]:[v,[_,[s,0]]]}var m=r._2(t,_,v);if(0===m)return[s,[_,0]];if(m>0)return[s,[_,[v,0]]];var d=r._2(t,s,v);return 0===d?[s,[_,0]]:d>0?[s,[v,[_,0]]]:[v,[s,[_,0]]]}f=1}else f=1}else f=1;else if(e){var h=e[1];if(h){var w=h[0],g=e[0],L=r._2(t,g,w);return 0===L?[g,0]:L>0?[g,[w,0]]:[w,[g,0]]}f=1}else f=1;if(1===f)for(var q=i>>1,b=i-q|0,j=O(q,e),$=n(q,e),y=n(b,j),k=0;;){var z=k,A=y,B=$;if(B){if(A){var C=A[1],D=A[0],E=B[1],F=B[0],G=r._2(t,F,D);if(0===G){k=[F,z],y=C,$=E;continue}if(G<0){k=[F,z],$=E;continue}k=[D,z],y=C;continue}return a(B,z)}return a(A,z)}},o=e(i);return o<2?i:n(o,i)}var R=i.$at,S=s,T=I,U=P,V=P;exports.length=e,exports.hd=f,exports.tl=o,exports.nth=u,exports.rev=v,exports.append=R,exports.rev_append=a,exports.concat=S,exports.flatten=s,exports.iter=x,exports.iteri=m,exports.map=_,exports.mapi=l,exports.rev_map=p,exports.fold_left=d,exports.fold_right=h,exports.iter2=L,exports.map2=w,exports.rev_map2=g,exports.fold_left2=q,exports.fold_right2=b,exports.for_all=j,exports.exists=$,exports.for_all2=y,exports.exists2=k,exports.mem=z,exports.memq=A,exports.find=H,exports.filter=T,exports.find_all=I,exports.partition=J,exports.assoc=B,exports.assq=C,exports.mem_assoc=D,exports.mem_assq=E,exports.remove_assoc=F,exports.remove_assq=G,exports.split=K,exports.combine=M,exports.sort=U,exports.stable_sort=P,exports.fast_sort=V,exports.sort_uniq=Q,exports.merge=N;
},{"./curry.js":5,"./caml_obj.js":20,"./pervasives.js":21,"./caml_builtin_exceptions.js":13}],18:[function(require,module,exports) {
"use strict";var r=require("./caml_exceptions.js"),e=r.create("Js_exn.Error");function o(o){return r.isCamlExceptionOrOpenVariant(o)?o:[e,o]}function n(r){throw new Error(r)}function t(r){throw new EvalError(r)}function i(r){throw new RangeError(r)}function s(r){throw new ReferenceError(r)}function a(r){throw new SyntaxError(r)}function E(r){throw new TypeError(r)}function c(r){throw new URIError(r)}exports.$$Error=e,exports.internalToOCamlException=o,exports.raiseError=n,exports.raiseEvalError=t,exports.raiseRangeError=i,exports.raiseReferenceError=s,exports.raiseSyntaxError=a,exports.raiseTypeError=E,exports.raiseUriError=c;
},{"./caml_exceptions.js":19}],10:[function(require,module,exports) {
"use strict";var r=require("./curry.js"),a=require("./js_exn.js"),t=require("./caml_array.js"),e=require("./caml_exceptions.js"),_=require("./caml_builtin_exceptions.js");function n(a,e){if(0===a)return[];if(a<0)throw[_.invalid_argument,"Array.init"];for(var n=t.caml_make_vect(a,r._1(e,0)),c=1,i=a-1|0;c<=i;++c)n[c]=r._1(e,c);return n}function c(r,a,e){for(var _=t.caml_make_vect(r,[]),n=0,c=r-1|0;n<=c;++n)_[n]=t.caml_make_vect(a,e);return _}function i(r){var a=r.length;return 0===a?[]:t.caml_array_sub(r,0,a)}function o(r,a){var e=r.length;return 0===e?i(a):0===a.length?t.caml_array_sub(r,0,e):r.concat(a)}function l(r,a,e){if(e<0||a>(r.length-e|0))throw[_.invalid_argument,"Array.sub"];return t.caml_array_sub(r,a,e)}function u(r,a,t,e){if(a<0||t<0||a>(r.length-t|0))throw[_.invalid_argument,"Array.fill"];for(var n=a,c=(a+t|0)-1|0;n<=c;++n)r[n]=e;return 0}function f(r,a,e,n,c){if(c<0||a<0||a>(r.length-c|0)||n<0||n>(e.length-c|0))throw[_.invalid_argument,"Array.blit"];return t.caml_array_blit(r,a,e,n,c)}function m(a,t){for(var e=0,_=t.length-1|0;e<=_;++e)r._1(a,t[e]);return 0}function s(a,e){var _=e.length;if(0===_)return[];for(var n=t.caml_make_vect(_,r._1(a,e[0])),c=1,i=_-1|0;c<=i;++c)n[c]=r._1(a,e[c]);return n}function y(a,t){for(var e=0,_=t.length-1|0;e<=_;++e)r._2(a,e,t[e]);return 0}function v(a,e){var _=e.length;if(0===_)return[];for(var n=t.caml_make_vect(_,r._2(a,0,e[0])),c=1,i=_-1|0;c<=i;++c)n[c]=r._2(a,c,e[c]);return n}function g(r){for(var a=r.length-1|0,t=0;;){var e=t,_=a;if(_<0)return e;t=[r[_],e],a=_-1|0}}function p(r,a){for(;;){var t=a,e=r;if(!t)return e;a=t[1],r=e+1|0}}function h(r){if(!r)return[];for(var a=t.caml_make_vect(p(0,r),r[0]),e=1,_=r[1];;){var n=_,c=e;if(!n)return a;a[c]=n[0],_=n[1],e=c+1|0}}function x(a,t,e){for(var _=t,n=0,c=e.length-1|0;n<=c;++n)_=r._2(a,_,e[n]);return _}function b(a,t,e){for(var _=e,n=t.length-1|0;n>=0;--n)_=r._2(a,t[n],_);return _}var k=e.create("Array.Bottom");function w(e,n){for(var c=function(a,_){var c=1+((_+_|0)+_|0)|0,i=c;if((c+2|0)<a)return r._2(e,t.caml_array_get(n,c),t.caml_array_get(n,c+1|0))<0&&(i=c+1|0),r._2(e,t.caml_array_get(n,i),t.caml_array_get(n,c+2|0))<0&&(i=c+2|0),i;if((c+1|0)<a&&r._2(e,t.caml_array_get(n,c),t.caml_array_get(n,c+1|0))<0)return c+1|0;if(c<a)return c;throw[k,_]},i=function(_,i,o){try{for(var l=_,u=i,f=o;;){var m=u,s=c(l,m);if(!(r._2(e,t.caml_array_get(n,s),f)>0))return t.caml_array_set(n,m,f);t.caml_array_set(n,m,t.caml_array_get(n,s)),u=s}}catch(r){var y=a.internalToOCamlException(r);if(y[0]===k)return t.caml_array_set(n,y[1],o);throw y}},o=function(r,e){try{for(var _=r,i=e;;){var o=i,l=c(_,o);t.caml_array_set(n,o,t.caml_array_get(n,l)),i=l}}catch(r){var u=a.internalToOCamlException(r);if(u[0]===k)return u[1];throw u}},l=function(a,c){for(;;){var i=a,o=(i-1|0)/3|0;if(i===o)throw[_.assert_failure,["array.ml",173,4]];if(r._2(e,t.caml_array_get(n,o),c)<0){if(t.caml_array_set(n,i,t.caml_array_get(n,o)),o>0){a=o;continue}return t.caml_array_set(n,0,c)}return t.caml_array_set(n,i,c)}},u=n.length,f=((u+1|0)/3|0)-1|0;f>=0;--f)i(u,f,t.caml_array_get(n,f));for(var m=u-1|0;m>=2;--m){var s=t.caml_array_get(n,m);t.caml_array_set(n,m,t.caml_array_get(n,0)),l(o(m,0),s)}if(u>1){var y=t.caml_array_get(n,1);return t.caml_array_set(n,1,t.caml_array_get(n,0)),t.caml_array_set(n,0,y)}return 0}function d(a,e){var _=function(_,n,c,i,o,l,u){for(var m=_+n|0,s=i+o|0,y=_,v=t.caml_array_get(e,_),g=i,p=t.caml_array_get(c,i),h=u;;){var x=h,b=p,k=g,w=v,d=y;if(r._2(a,w,b)<=0){t.caml_array_set(l,x,w);var j=d+1|0;if(j<m){h=x+1|0,v=t.caml_array_get(e,j),y=j;continue}return f(c,k,l,x+1|0,s-k|0)}t.caml_array_set(l,x,b);var q=k+1|0;if(!(q<s))return f(e,d,l,x+1|0,m-d|0);h=x+1|0,p=t.caml_array_get(c,q),g=q}},n=function(_,n,c,i){for(var o=0,l=i-1|0;o<=l;++o){for(var u=t.caml_array_get(e,_+o|0),f=(c+o|0)-1|0;f>=c&&r._2(a,t.caml_array_get(n,f),u)>0;)t.caml_array_set(n,f+1|0,t.caml_array_get(n,f)),f=f-1|0;t.caml_array_set(n,f+1|0,u)}return 0},c=function(r,a,t,i){if(i<=5)return n(r,a,t,i);var o=i/2|0,l=i-o|0;return c(r+o|0,a,t+o|0,l),c(r,e,r+l|0,o),_(r+l|0,o,a,t+o|0,l,a,t)},i=e.length;if(i<=5)return n(0,e,0,i);var o=i/2|0,l=i-o|0,u=t.caml_make_vect(l,t.caml_array_get(e,0));return c(o,u,0,l),c(0,e,l,o),_(l,o,u,0,l,e,0)}var j=c,q=t.caml_array_concat,A=d;exports.init=n,exports.make_matrix=c,exports.create_matrix=j,exports.append=o,exports.concat=q,exports.sub=l,exports.copy=i,exports.fill=u,exports.blit=f,exports.to_list=g,exports.of_list=h,exports.iter=m,exports.map=s,exports.iteri=y,exports.mapi=v,exports.fold_left=x,exports.fold_right=b,exports.sort=w,exports.stable_sort=d,exports.fast_sort=A;
},{"./curry.js":5,"./js_exn.js":18,"./caml_array.js":7,"./caml_exceptions.js":19,"./caml_builtin_exceptions.js":13}],22:[function(require,module,exports) {
"use strict";var e=require("./caml_string.js"),r=require("./caml_builtin_exceptions.js");function t(e){if(e<0||e>255)throw[r.invalid_argument,"Char.chr"];return e}function s(r){var t=0;if(r>=40){if(92===r)return"\\\\";t=r>=127?1:2}else if(r>=32){if(r>=39)return"\\'";t=2}else if(r>=14)t=1;else switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:t=1;break;case 13:return"\\r"}switch(t){case 1:var s=e.caml_create_string(4);return s[0]=92,s[1]=48+(r/100|0)|0,s[2]=48+(r/10|0)%10|0,s[3]=48+r%10|0,e.bytes_to_string(s);case 2:var c=e.caml_create_string(1);return c[0]=r,e.bytes_to_string(c)}}function c(e){return e>=65&&e<=90||e>=192&&e<=214||e>=216&&e<=222?e+32|0:e}function a(e){return e>=97&&e<=122||e>=224&&e<=246||e>=248&&e<=254?e-32|0:e}function n(e,r){return e-r|0}exports.chr=t,exports.escaped=s,exports.lowercase=c,exports.uppercase=a,exports.compare=n;
},{"./caml_string.js":16,"./caml_builtin_exceptions.js":13}],14:[function(require,module,exports) {
"use strict";var t=require("./char.js"),r=require("./list.js"),e=require("./curry.js"),n=require("./caml_obj.js"),i=require("./caml_int32.js"),a=require("./caml_string.js"),o=require("./caml_primitive.js"),s=require("./caml_builtin_exceptions.js");function c(t,r){var e=a.caml_create_string(t);return a.caml_fill_string(e,0,t,r),e}function u(t,r){for(var n=a.caml_create_string(t),i=0,o=t-1|0;i<=o;++i)n[i]=e._1(r,i);return n}var l=[];function _(t){var r=t.length,e=a.caml_create_string(r);return a.caml_blit_bytes(t,0,e,0,r),e}function f(t){return a.bytes_to_string(_(t))}function g(t){return _(a.bytes_of_string(t))}function m(t,r,e){if(r<0||e<0||r>(t.length-e|0))throw[s.invalid_argument,"String.sub / Bytes.sub"];var n=a.caml_create_string(e);return a.caml_blit_bytes(t,r,n,0,e),n}function h(t,r,e){return a.bytes_to_string(m(t,r,e))}function p(t,r,e){var n=(t.length+r|0)+e|0,i=a.caml_create_string(n),s=r<0?[0|-r,0]:[0,r],c=s[1],u=s[0],l=o.caml_int_min(t.length-u|0,n-c|0);return l>0&&a.caml_blit_bytes(t,u,i,c,l),i}function x(t,r,e,n){if(r<0||e<0||r>(t.length-e|0))throw[s.invalid_argument,"String.fill / Bytes.fill"];return a.caml_fill_string(t,r,e,n)}function v(t,r,e,n,i){if(i<0||r<0||r>(t.length-i|0)||n<0||n>(e.length-i|0))throw[s.invalid_argument,"Bytes.blit"];return a.caml_blit_bytes(t,r,e,n,i)}function b(t,r,e,n,i){if(i<0||r<0||r>(t.length-i|0)||n<0||n>(e.length-i|0))throw[s.invalid_argument,"String.blit / Bytes.blit_string"];return a.caml_blit_string(t,r,e,n,i)}function y(t,r){for(var n=0,i=r.length-1|0;n<=i;++n)e._1(t,r[n]);return 0}function d(t,r){for(var n=0,i=r.length-1|0;n<=i;++n)e._2(t,n,r[n]);return 0}function w(t,e){if(e){var n=e[0],o=[0],s=[0];r.iter(function(t){return o[0]=o[0]+1|0,s[0]=s[0]+t.length|0,0},e);var c=a.caml_create_string(s[0]+i.imul(t.length,o[0]-1|0)|0);a.caml_blit_bytes(n,0,c,0,n.length);var u=[n.length];return r.iter(function(r){return a.caml_blit_bytes(t,0,c,u[0],t.length),u[0]=u[0]+t.length|0,a.caml_blit_bytes(r,0,c,u[0],r.length),u[0]=u[0]+r.length|0,0},e[1]),c}return l}function j(t,r){var e=t.length,n=r.length,i=a.caml_create_string(e+n|0);return a.caml_blit_bytes(t,0,i,0,e),a.caml_blit_bytes(r,0,i,e,n),i}function q(t){var r=t-9|0;return r>4||r<0?23===r:2!==r}function B(t){for(var r=t.length,e=0;e<r&&q(t[e]);)e=e+1|0;for(var n=r-1|0;n>=e&&q(t[n]);)n=n-1|0;return n>=e?m(t,e,1+(n-e|0)|0):l}function S(t){for(var r=0,e=0,n=t.length-1|0;e<=n;++e){var i,o=t[e];if(o>=32){var s=o-34|0;i=s>58||s<0?s>=93?4:1:s>57||s<1?2:1}else i=o>=11?13!==o?4:2:o>=8?2:4;r=r+i|0}if(r===t.length)return _(t);var c=a.caml_create_string(r);r=0;for(var u=0,l=t.length-1|0;u<=l;++u){var f=t[u],g=0;if(f>=35)92!==f?f>=127?g=1:c[r]=f:g=2;else if(f>=32)f>=34?g=2:c[r]=f;else if(f>=14)g=1;else switch(f){case 8:c[r]=92,c[r=r+1|0]=98;break;case 9:c[r]=92,c[r=r+1|0]=116;break;case 10:c[r]=92,c[r=r+1|0]=110;break;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 11:case 12:g=1;break;case 13:c[r]=92,c[r=r+1|0]=114}switch(g){case 1:c[r]=92,c[r=r+1|0]=48+(f/100|0)|0,c[r=r+1|0]=48+(f/10|0)%10|0,c[r=r+1|0]=48+f%10|0;break;case 2:c[r]=92,c[r=r+1|0]=f}r=r+1|0}return c}function k(t,r){var n=r.length;if(0===n)return r;for(var i=a.caml_create_string(n),o=0,s=n-1|0;o<=s;++o)i[o]=e._1(t,r[o]);return i}function z(t,r){var n=r.length;if(0===n)return r;for(var i=a.caml_create_string(n),o=0,s=n-1|0;o<=s;++o)i[o]=e._2(t,o,r[o]);return i}function A(r){return k(t.uppercase,r)}function C(r){return k(t.lowercase,r)}function D(t,r){if(0===r.length)return r;var n=_(r);return n[0]=e._1(t,r[0]),n}function E(r){return D(t.uppercase,r)}function F(r){return D(t.lowercase,r)}function G(t,r,e,n){for(;;){var i=e;if(i>=r)throw s.not_found;if(t[i]===n)return i;e=i+1|0}}function H(t,r){return G(t,t.length,0,r)}function I(t,r,e){var n=t.length;if(r<0||r>n)throw[s.invalid_argument,"String.index_from / Bytes.index_from"];return G(t,n,r,e)}function J(t,r,e){for(;;){var n=r;if(n<0)throw s.not_found;if(t[n]===e)return n;r=n-1|0}}function K(t,r){return J(t,t.length-1|0,r)}function L(t,r,e){if(r<-1||r>=t.length)throw[s.invalid_argument,"String.rindex_from / Bytes.rindex_from"];return J(t,r,e)}function M(t,r,e){var n=t.length;if(r<0||r>n)throw[s.invalid_argument,"String.contains_from / Bytes.contains_from"];try{return G(t,n,r,e),!0}catch(t){if(t===s.not_found)return!1;throw t}}function N(t,r){return M(t,0,r)}function O(t,r,e){if(r<0||r>=t.length)throw[s.invalid_argument,"String.rcontains_from / Bytes.rcontains_from"];try{return J(t,r,e),!0}catch(t){if(t===s.not_found)return!1;throw t}}var P=n.caml_compare,Q=a.bytes_to_string,R=a.bytes_of_string;exports.make=c,exports.init=u,exports.empty=l,exports.copy=_,exports.of_string=g,exports.to_string=f,exports.sub=m,exports.sub_string=h,exports.extend=p,exports.fill=x,exports.blit=v,exports.blit_string=b,exports.concat=w,exports.cat=j,exports.iter=y,exports.iteri=d,exports.map=k,exports.mapi=z,exports.trim=B,exports.escaped=S,exports.index=H,exports.rindex=K,exports.index_from=I,exports.rindex_from=L,exports.contains=N,exports.contains_from=M,exports.rcontains_from=O,exports.uppercase=A,exports.lowercase=C,exports.capitalize=E,exports.uncapitalize=F,exports.compare=P,exports.unsafe_to_string=Q,exports.unsafe_of_string=R;
},{"./char.js":22,"./list.js":9,"./curry.js":5,"./caml_obj.js":20,"./caml_int32.js":15,"./caml_string.js":16,"./caml_primitive.js":17,"./caml_builtin_exceptions.js":13}],11:[function(require,module,exports) {
"use strict";var t=require("./list.js"),r=require("./bytes.js"),n=require("./caml_int32.js"),e=require("./caml_string.js"),i=require("./caml_primitive.js");function s(t,n){return e.bytes_to_string(r.make(t,n))}function o(t,n){return e.bytes_to_string(r.init(t,n))}function _(t){return e.bytes_to_string(r.copy(e.bytes_of_string(t)))}function u(t,n,i){return e.bytes_to_string(r.sub(e.bytes_of_string(t),n,i))}function f(r,i){if(i){var s=i[0],o=[0],_=[0];t.iter(function(t){return o[0]=o[0]+1|0,_[0]=_[0]+t.length|0,0},i);var u=e.caml_create_string(_[0]+n.imul(r.length,o[0]-1|0)|0);e.caml_blit_string(s,0,u,0,s.length);var f=[s.length];return t.iter(function(t){return e.caml_blit_string(r,0,u,f[0],r.length),f[0]=f[0]+r.length|0,e.caml_blit_string(t,0,u,f[0],t.length),f[0]=f[0]+t.length|0,0},i[1]),e.bytes_to_string(u)}return""}function c(t,n){return r.iter(t,e.bytes_of_string(n))}function a(t,n){return r.iteri(t,e.bytes_of_string(n))}function g(t,n){return e.bytes_to_string(r.map(t,e.bytes_of_string(n)))}function p(t,n){return e.bytes_to_string(r.mapi(t,e.bytes_of_string(n)))}function b(t){var r=t-9|0;return r>4||r<0?23===r:2!==r}function l(t){return""===t||!b(t.charCodeAt(0))&&!b(t.charCodeAt(t.length-1|0))?t:e.bytes_to_string(r.trim(e.bytes_of_string(t)))}function y(t){return function(r){for(;;){var n=r;if(n>=t.length)return!1;var e=t.charCodeAt(n);if(!(e>=32))return!0;var i=e-34|0;if(i>58||i<0){if(i>=93)return!0;r=n+1|0}else{if(i>57||i<1)return!0;r=n+1|0}}}(0)?e.bytes_to_string(r.escaped(e.bytes_of_string(t))):t}function x(t,n){return r.index(e.bytes_of_string(t),n)}function m(t,n){return r.rindex(e.bytes_of_string(t),n)}function d(t,n,i){return r.index_from(e.bytes_of_string(t),n,i)}function h(t,n,i){return r.rindex_from(e.bytes_of_string(t),n,i)}function v(t,n){return r.contains(e.bytes_of_string(t),n)}function j(t,n,i){return r.contains_from(e.bytes_of_string(t),n,i)}function q(t,n,i){return r.rcontains_from(e.bytes_of_string(t),n,i)}function z(t){return e.bytes_to_string(r.uppercase(e.bytes_of_string(t)))}function A(t){return e.bytes_to_string(r.lowercase(e.bytes_of_string(t)))}function C(t){return e.bytes_to_string(r.capitalize(e.bytes_of_string(t)))}function k(t){return e.bytes_to_string(r.uncapitalize(e.bytes_of_string(t)))}var w=i.caml_string_compare,B=r.fill,D=r.blit_string;exports.make=s,exports.init=o,exports.copy=_,exports.sub=u,exports.fill=B,exports.blit=D,exports.concat=f,exports.iter=c,exports.iteri=a,exports.map=g,exports.mapi=p,exports.trim=l,exports.escaped=y,exports.index=x,exports.rindex=m,exports.index_from=d,exports.rindex_from=h,exports.contains=v,exports.contains_from=j,exports.rcontains_from=q,exports.uppercase=z,exports.lowercase=A,exports.capitalize=C,exports.uncapitalize=k,exports.compare=w;
},{"./list.js":9,"./bytes.js":14,"./caml_int32.js":15,"./caml_string.js":16,"./caml_primitive.js":17}],12:[function(require,module,exports) {
"use strict";var r=function(r,e){return delete r[e],0};function e(r){for(var e=Object.keys(r),t=e.length,n=new Array(t),o=0,a=t-1|0;o<=a;++o){var f=e[o];n[o]=[f,r[f]]}return n}function t(r){for(var e=Object.keys(r),t=e.length,n=new Array(t),o=0,a=t-1|0;o<=a;++o)n[o]=r[e[o]];return n}function n(r){for(var e={},t=r;;){var n=t;if(!n)return e;var o=n[0];e[o[0]]=o[1],t=n[1]}}function o(r){for(var e={},t=0,n=r.length-1|0;t<=n;++t){var o=r[t];e[o[0]]=o[1]}return e}function a(r,e){for(var t={},n=Object.keys(e),o=0,a=n.length-1|0;o<=a;++o){var f=n[o];t[f]=r(e[f])}return t}exports.unsafeDeleteKey=r,exports.entries=e,exports.values=t,exports.fromList=n,exports.fromArray=o,exports.map=a;
},{}],6:[function(require,module,exports) {
"use strict";var r=require("bs-platform/lib/js/list.js"),t=require("bs-platform/lib/js/array.js"),e=require("bs-platform/lib/js/curry.js"),s=require("bs-platform/lib/js/string.js"),o=require("bs-platform/lib/js/js_dict.js");function u(r){return r}function n(r){return s.make(1,r)}function i(r){return r.toJSON()}function p(r,t){return t?e._1(r,t[0]):null}function l(r,t,s){return s?e._1(t,s[0]):r}var a=o.fromList,f=t.map;function c(e,s){return t.of_list(r.map(e,s))}function _(r,t,s){return[e._1(r,s[0]),e._1(t,s[1])]}function b(r,t,s,o){return[e._1(r,o[0]),e._1(t,o[1]),e._1(s,o[2])]}function x(r,t,s,o,u){return[e._1(r,u[0]),e._1(t,u[1]),e._1(s,u[2]),e._1(o,u[3])]}var j=_,m=f;exports.bool=u,exports.$$char=n,exports.date=i,exports.nullable=p,exports.withDefault=l,exports.pair=_,exports.tuple2=j,exports.tuple3=b,exports.tuple4=x,exports.object_=a,exports.array=f,exports.arrayOf=m,exports.list=c;
},{"bs-platform/lib/js/list.js":9,"bs-platform/lib/js/array.js":10,"bs-platform/lib/js/curry.js":5,"bs-platform/lib/js/string.js":11,"bs-platform/lib/js/js_dict.js":12}],3:[function(require,module,exports) {
"use strict";var n=require("bs-platform/lib/js/curry.js"),r=require("bs-platform/lib/js/caml_array.js"),t=require("@glennsl/bs-json/src/Json_encode.bs.js");function e(n){return n?"input":"radio"}function o(n){return t.object_([["id",n[0]],[["name",n[1]],[["slug",n[2]],[["short_name",n[3]],[["info",n[4]],[["type",n[5]?"input":"radio"],0]]]]]])}var s=[e,o];function i(n){return r.caml_make_vect(3,n)}function u(){var r=new Function("return function(x) { return x * Math.random(); }"),t=n._1(r,0);return n._1(t,3.5)}function a(){return hostFunction(o([1,"Question 1","question_1","Q.1","Ask this Q first",0])),0}exports.Encode=s,exports.bridgeFn=i,exports.testEval=u,exports.invokeHostFn=a;
},{"bs-platform/lib/js/curry.js":5,"bs-platform/lib/js/caml_array.js":7,"@glennsl/bs-json/src/Json_encode.bs.js":6}],1:[function(require,module,exports) {
"use strict";var e=require("./Demo.bs"),t=Function("return this")();t.invokeBridgeFn=e.bridgeFn,t.invokeHostFn=e.invokeHostFn,t.testEval=e.testEval;
},{"./Demo.bs":3}]},{},[1])
//# sourceMappingURL=/index.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment