@sassoftware/restaflib 4.2.8 → 4.2.12
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/dist/restaflib.js +97 -420
- package/dist/restaflib.min.js +4 -4
- package/lib/restaflib.js +143 -418
- package/package.json +6 -3
package/dist/restaflib.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("restaflib",[],e):"object"==typeof exports?exports.restaflib=e():t.restaflib=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=15)}([function(t,e,n){var r=n(16)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e){function n(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,s,"next",t)}function s(t){n(a,o,i,u,s,"throw",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(1),o=n.n(r),i=n(0),a=n.n(i),u=n(6);function s(){return(s=o()(a.a.mark((function t(e,n,r,o){var i,s,c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=Object(u.a)(null!==o?o:{},"_args_"),s=(s=i+" "+r).replace(/\r?\n|\r/g,""),c={action:"sccasl.runcasl",data:{code:s}},f=d.length,l=new Array(f>4?f-4:0),p=4;p<f;p++)l[p-4]=d[p];return t.next=7,e.runAction.apply(e,[n,c].concat(l));case 7:return h=t.sent,t.abrupt("return",h);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,n,r){return s.apply(this,arguments)}},function(t,e,n){"use strict";var r=n(13),o=n.n(r);var i=function(){return"\n results = casFetchData(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.filter); \n send_response({casResults = results}); \n \n function casFetchData(caslib, name, from, count, format, _args_.filter) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ; \n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, -1);\n /*\n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do;\n pagePrev = max(to + ,rowCount);\n end; \n */\n \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, table=table}, prev={from=pagePrev, count=count, format=format, table=table}};\n\n /*return ({pagination = {table = {caslib=caslib, name=name}, prev=pagePrev, next=pageNext, count=count}, rc=0 , data = {schema=columns, rows=rows } } ); */\n\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};var a=function(){return"\n \n /*------------------------------------------------*/\n /*Does the tables exist and if not try to load it */\n /*\n Typical usage:\n rc = checkAndLoadTable(caslib, name);\n if ( rc ne true) then do;\n ...handle errors...\n end; \n else do;\n ...your stuff...\n end;\n rc = true - the data is ready for use\n rc = false - the table could not be found\n rc = -1 - the caslib does not exist\n */\n /*------------------------------------------------*/\n\n function checkAndLoadTable(caslib, name); \n\n /* verify caslib is there */\n table.queryCaslib status=status result=result/\n caslib = caslib;\n do k,v over result; /* to handle casuser[user] */ \n rc = v;\n end;\n if ( rc eq false ) then \n return -1;\n /* \n * Check to see if table is already loaded \n */ \n action table.tableExists r=result/ \n caslib = caslib \n name = name; \n /* \n * if not loaded then try to load it \n */ \n rc = true;\n if (result.exists eq 0) then do; \n path = lookupPath(caslib, name);\n if (path eq '*') then do;\n rc = false;\n end;\n else do;\n\t action table.loadTable status=status/ \n\t caslib = caslib \n\t source = path \n\t casout={caslib= caslib name=name}; \n\t if (status.statusCode ne 0 ) then rc = false;\n end; \n end; \n return rc; \n end; \n\n/*\n * return path to table\n */\n\nfunction lookupPath(caslib, name ) ; \n table.fileInfo r = result/ \n caslib=caslib; \n\n names = result.fileInfo[,4]; \n nameu = upcase(name)||'.SASHDAT'; \n cpath = '*'; \n count = 0; \n\n do n over names; \n\t if (upcase(n) eq nameu) then do; \n\t count = count + 1; \n\t if ( cpath eq '*') then do; \n\t cpath = n; \n\t end; \n\t end; \n end; \n \n if (count GT 1 ) then do; \n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\n print 'Path: ' cpath ' will be used****'; \n end; \n r = cpath; \n return r; \nend; \n\n /*-----------------------------------------*/ \n /* isModel: is it model table */ \n /*-----------------------------------------*/ \n \n function isModel(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n validTable = false; \n mtype = 'bad'; \n do c over result.columninfo; \n cu = upCase(c.Column); \n if ( cu eq 'DATASTEPSRC') then do; \n mtype = 'ds'; \n end; \n else if ( cu eq '_STATE_' ) then do; \n mtype = 'astore'; \n end; \n else if (cu eq 'MODELMETADATA') then do; \n mtype = 'ds2'; \n end; \n end; \n print 'Specified model type: ' || mtype; \n return mtype; \n end; \n \n /*-----------------------------------------*/ \n /* Returns contents of the specified table */ \n /*-----------------------------------------*/ \n \n function contents(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \n i = 1; \n columns = {}; \n do c over result.columninfo; \n columns[i] = c; \n i = i + 1; \n end; \n return {describe = columns, table = {}}; \n end; \n \n /*------------------------------------------*/ \n /* Returns unique values */ \n /*-----------------------------------------*/ \n \n function selectionLists(idvars,caslib, name); \n \n s = checkAndLoadTable(caslib, name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n \n do k over idvars; \n r = _getValues(k, caslib, name); \n results[k] = r; \n end; \n \n return results; \n end; \n \n function _getValues(id, caslib, name) ; \n \n action table.dropTable/ \n caslib='casuser' name='dtemp1' quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \n \n action simple.groupby result=r status=rc/ \n aggregator = 'N' \n inputs = {id} \n table = {caslib=caslib name=name} \n casout = {caslib='casuser' name='dtemp1'} \n ; \n action table.fetch result=r/ \n table={caslib='casuser' name='dtemp1'} \n sortby={{name=id, order='ascending'}}; \n result = r.Fetch[,2]; \n return result; \n end; \n \n /*------------------------------------------*/ \n /* get a record */ \n /*------------------------------------------*/ \n \n function _fetchData(filter, table); \n s = checkAndLoadTable(table.caslib, table.name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \n return results; \n end; \n wherex = dictTowhere(filter); \n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \n \n destroyTable('casuser', 'input'); \n \n action datastep.runCode r=result status=rc/ \n single='yes' \n code = 'data casuser.input; set ' || wherex||'run;'; \n */ \n \n action table.fetch r = result / \n table={caslib=table.caslib name=table.name where=wherex}; \n \n rows = resultsToDict(result.Fetch); \n return {scenario = rows, table = result.Fetch}; \n \n end; \n\n function destroyTable(caslib,name); \n action table.dropTable/ \n caslib=caslib name=name quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib=caslib source= name||'.sashdat' quiet=TRUE; \n \n return true; \n end; \n \n \n function dictToWhere(filter); \n where =''; \n andbit=' '; \n do k,v over filter; \n if (isString(v) ) then do; \n where = where || andbit || k || ' eq ' || '\"'||v||'\"'; \n end; \n else do; \n where = where || andbit || k || ' eq ' || v ; \n end; \n andbit =' and '; \n end; \n return where; \n end; \n \n function resultsToDict(r); \n casResults = {}; \n i = 1; \n do row over r; \n casResults[i] = row; \n i = i + 1; \n end; \n return casResults; \n end; \n \n function argsToTable(_arg_, caslib, name ); \n action table.droptable/ \n caslib=caslib name=name quiet=TRUE; \n i = 1; \n do key,obj over _arg_; \n columns[i] = key; \n row[i] = obj; \n if ( isString(obj) ) then \n type[i] = 'varchar'; \n else if ( isInteger(obj) ) then \n type[i] = 'int'; \n else type[i] = 'double'; \n i = i + 1; \n end; \n \n data1 = newTable('data1', columns, type, row ); \n \n saveresult data1 casout=name caslib=caslib replace; \n end; \n\n "};var u=function(){return"\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.where); \n send_response({casResults = results}); \n \n function casFetchRows(caslib, name, from, count, format, where) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n /* wherex = dictTowhere(where); */\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ;\n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, 1);\n \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, where=where table=table}, prev={from=pagePrev, count=count, format=format, where=where, table=table}};\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};e.a={commonCasl:a,casFetchData:i,casFetchRows:u,scoreCasl:o.a}},function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(1),o=n.n(r),i=n(0),a=n.n(i),u=n(2),s=n(3);function c(){return(c=o()(a.a.mark((function t(e,n,r,o,i){var c,f,l,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c=r,!0===i&&(c=r+" "+s.a.commonCasl()),f=d.length,l=new Array(f>5?f-5:0),p=5;p<f;p++)l[p-5]=d[p];return t.next=5,u.a.apply(void 0,[e,n,c,o].concat(l));case 5:return h=t.sent,t.abrupt("return",h.items().toJS());case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,n,r,o){return c.apply(this,arguments)}},function(t,e,n){"use strict";var r=n(4),o=n.n(r);function i(t){var e="{ ",n=" ";for(var r in t){if(!0===Array.isArray(t[r])){var u=a(t[r]);e=e+n+"".concat(r,"=")+u}else{var s=o()(t[r]);if("object"===s){var c=i(t[r]);e=e+n+"".concat(r,"=")+c}else e=e+n+"".concat(r,"=")+("string"===s?' "'.concat(t[r],'" '):"".concat(t[r]," "))}n=","}return e+="} "}function a(t){for(var e="{",n=" ",r=t.length,u=0;u<r;u++)if(!0===Array.isArray(t[u])){var s=a(t[u]);e=e+n+"".concat(u,"=")+s}else{var c=o()(t[u]);if("object"===c)e=e+n+i(t[u]);else e=e+n+("string"===c?' "'.concat(t[u],'" '):"".concat(t[u]," "));n=","}return e+="}"}e.a=function(t,e){var n;return n=null===t?"{}":!0===Array.isArray(t)?a(t):i(t),"".concat(e," = ").concat(n,";")}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return h}));var r=n(1),o=n.n(r),i=n(0),a=n.n(i);function u(){return(u=o()(a.a.mark((function t(e,n,r,o){var i,u,s,c,f;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=o.output,u=i.caslib,null!=(s=i.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return s=s.toLowerCase(s),c="\n action table.droptable /\n caslib= '".concat(u,"' name= '").concat(s,"' quiet=true;\n\n action table.deleteSource/\n caslib= '").concat(u,"' source= '").concat(s,".sashdat' quiet=true; \n "),f={action:"sccasl.runcasl",data:{code:c}},t.next=8,e.runAction(n,f);case 8:return f={action:"astore.upload",data:{rstore:{name:"".concat(s),caslib:"".concat(u),replace:!0},store:r}},t.next=11,e.runAction(n,f);case 11:return t.sent,t.abrupt("return","Upload of ".concat(o.source," to ").concat(u,".").concat(s," completed"));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var s=function(t,e,n,r){return u.apply(this,arguments)},c=n(5);function f(){return(f=o()(a.a.mark((function t(e,n,r,o,i){var u,s,f,l,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.output,s=u.caslib,null!=(f=u.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return l={casout:{caslib:s,name:f},importOptions:{fileType:o.fileType}},"sas"!==o.fileExt&&"ds2"!==o.fileExt||(l.importOptions.delimiter="\\"),p={headers:{"JSON-Parameters":l,"Content-Type":"binary/octet-stream"},data:r,action:"table.upload"},t.next=8,e.runAction(n,p);case 8:if(!0!==i){t.next=13;break}return h="\n\t\t\taction table.save r = result / \n\t\t\ttable = {caslib='".concat(s,"' name='").concat(f,"'} replace=true\n\t\t\tcaslib='").concat(s,"' name='").concat(f,"';\n\n\t\t\tsend_response(result);\n\t\t\t"),t.next=12,Object(c.a)(e,n,h,null);case 12:t.sent;case 13:return t.abrupt("return","Upload of ".concat(o.source," to ").concat((o.output,s),".").concat(o.output.name," completed"));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var l=function(t,e,n,r,o){return f.apply(this,arguments)};function p(){return(p=o()(a.a.mark((function t(e,n,r,o){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={action:"table.save",data:{name:"".concat(o),caslib:"".concat(r),replace:!0,table:{name:"".concat(o),caslib:"".concat(r)}}},t.next=3,e.runAction(n,i);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var h=function(t,e,n,r){return p.apply(this,arguments)}},function(t,e,n){"use strict";var r=n(12),o=n(31),i=/[^\w\s\n\r\v\t\.,]/i;e.version=n(32).version;var a=function(t,e){return void 0!==t||e.renderUndefined},u=function(t,e,n){return"boolean"==typeof t||"number"==typeof t||"function"==typeof t||null==t||t instanceof Date||("string"==typeof t&&-1===t.indexOf("\n")||!(!n.inlineArrays||e||!Array.isArray(t)||!u(t[0],!0,n)))},s=function(t,e){if(e.noColor)return t;if("string"==typeof t)return e.stringColor?r[e.stringColor](t):t;var n=t+"";return!0===t?r.green(n):!1===t?r.red(n):null==t?r.grey(n):"number"==typeof t?t>=0?r[e.positiveNumberColor](n):r[e.negativeNumberColor](n):"function"==typeof t?"function() {}":Array.isArray(t)?t.join(", "):n},c=function(t,e){return null===t.multilineStringColor||t.noColor?e:r[t.multilineStringColor](e)},f=function(t,e,n){var r=t.split("\n");return(r=r.map((function(t){return o.indent(e)+c(n,t)}))).join("\n")},l=function(t,e,n){if("string"==typeof t&&t.match(i)&&e.escape&&(t=JSON.stringify(t)),!a(t,e))return[];if(u(t,!1,e))return[o.indent(n)+s(t,e)];if("string"==typeof t)return[o.indent(n)+c(e,'"""'),f(t,n+e.defaultIndentation,e),o.indent(n)+c(e,'"""')];if(Array.isArray(t)){if(0===t.length)return[o.indent(n)+e.emptyArrayMsg];var p=[];return t.forEach((function(t){if(a(t,e)){var i="- ";e.noColor||(i=r[e.dashColor](i)),i=o.indent(n)+i,u(t,!1,e)?(i+=l(t,e,0)[0],p.push(i)):(p.push(i),p.push.apply(p,l(t,e,n+e.defaultIndentation)))}})),p}if(t instanceof Error)return l({message:t.message,stack:t.stack.split("\n")},e,n);var h,d=e.noAlign?0:o.getMaxIndexLength(t),y=[];return Object.getOwnPropertyNames(t).forEach((function(i){if(a(t[i],e))if(h=i+": ",e.noColor||(h=r[e.keysColor](h)),h=o.indent(n)+h,u(t[i],!1,e)){var s=e.noAlign?0:d-i.length;h+=l(t[i],e,s)[0],y.push(h)}else y.push(h),y.push.apply(y,l(t[i],e,n+e.defaultIndentation))})),y};e.render=function(t,e,n){return n=n||0,(e=e||{}).emptyArrayMsg=e.emptyArrayMsg||"(empty array)",e.keysColor=e.keysColor||"green",e.dashColor=e.dashColor||"green",e.numberColor=e.numberColor||"blue",e.positiveNumberColor=e.positiveNumberColor||e.numberColor,e.negativeNumberColor=e.negativeNumberColor||e.numberColor,e.defaultIndentation=e.defaultIndentation||2,e.noColor=!!e.noColor,e.noAlign=!!e.noAlign,e.escape=!!e.escape,e.renderUndefined=!!e.renderUndefined,e.stringColor=e.stringColor||null,e.multilineStringColor=e.multilineStringColor||null,l(t,e,n).join("\n")},e.renderString=function(t,n,o){var i,a,u="";if("string"!=typeof t||""===t)return"";"{"!==t[0]&&"["!==t[0]&&(a=-1===t.indexOf("{")?t.indexOf("["):-1===t.indexOf("[")||t.indexOf("{")<t.indexOf("[")?t.indexOf("{"):t.indexOf("["),u+=t.substr(0,a)+"\n",t=t.substr(a));try{i=JSON.parse(t)}catch(t){return r.red("Error:")+" Not valid JSON!"}return u+=e.render(i,n,o)}},function(t,e,n){var r=n(33),o=n(34),i=n(35),a=n(37);t.exports=function(t,e){return r(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var t=u(p);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.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];c.push(new d(t,e)),1!==c.length||f||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){var r=n(17);t.exports=r},function(t,e){t.exports=function(){return"\n result = runMain(_args_); \n send_response(result); \n /* print result; */\n \n \n function runMain(_args_) ; \n r = {Error= 'No path'}; \n if ( _args_.path eq '/selectors') then do; \n r = selectionLists(_args_.selectors, _args_.table.caslib, _args_.table.name); \n end; \n else if ( _args_.path eq '/contents') then do; \n r = contents(_args_.table.caslib, _args_.table.name); \n end; \n else if (_args_.path eq '/describe') then do; \n r = describeModel(_args_); \n end; \n else if (_args_.path eq '/scenario' ) then do;\n r = fetchData(_args_.filter, _args_.table);\n end;\n else if (_args_.path eq '/score') then do; \n if( exists(_args_, 'modelName') eq false ) then\n modelname = '';\n else modelName =_args_.modelName;\n r = runScoreCode(_args_.model, _args_.scenario, modelName); \n end; \n else do; \n r = {icasResults={Errors = 'Invalid action option specified' || _args_.path}, statusCode=404}; \n end; \n print r;\n if ( r.statusCode ne 0) then do;\n print r.icasResults;\n exit({severity=2,reason=6, status=r.iCasResults.Errors,statusCode=r.statusCode});\n end;\n result = {casResults = r.icasResults}; \n print '***************************************************************'; \n print result; \n print '***************************************************************'; \n return result; \n end; \n \n /*-----------------------------------------*/ \n /* describeModel */ \n /*-----------------------------------------*/ \n \n function describeModel(_args_) ; \n s = checkAndLoadTable(_args_.model.caslib, _args_.model.name); \n if ( s ne true) then do; \n results = {Errors= 'Unable to access ' ||_args_.model.caslib||'.'||_args_.model.name}; \n return {icasResults=results, statusCode=404}; \n end; \n \n mtype = isModel(_args_.model.caslib, _args_.model.name); \n if ( mtype EQ 'astore' ) then do; \n r = astoreDescribe(_args_.model); \n end; \n else if (mtype EQ 'ds' or mtype EQ 'ds2') then do;\n s = checkAndLoadTable(_args_.table.caslib, _args_.table.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||_args_.table.caslib||'.'||_args_.table.name}; \n return {icasResults=results, statusCode=404}; \n end; \n r = contents( _args_.table.caslib, _args_.table.name); \n end; \n return {icasResults= r, statusCode=0} ;\n end; \n \n /*------------------------------------------*/ \n /* astoreDescribe */ \n /*------------------------------------------*/ \n \n function astoreDescribe(model); \n action astore.describe r=result/ \n rstore = { caslib= model.caslib name = model.name }; \n rows = resultsToDict(result.InputVariables); \n return {describe = rows, table = result.InputVariables}; \n end; \n \n /*------------------------------------------*/ \n /* score */ \n /*------------------------------------------*/ \n function runScoreCode( model, scenario, modelName); \n print model; \n s = checkAndLoadTable(model.caslib, model.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||model.caslib||'.'||model.name}; \n return {icasResults=results, statusCode=404}; \n end;\n \n mtype = isModel(model.caslib, model.name); \n \n if ( mtype eq 'bad' ) then do; \n results = {Error= model.caslib||'.'||model.name || ' is not recognized as a valid supported model. Please check your values'};\n return {icasResults=results, statusCode=400};\n end; \n destroyTable('casuser', 'input'); \n argsToTable(scenario, 'casuser', 'input'); \n \n destroyTable('casuser', 'output'); \n \n if (mtype eq 'astore') then do; \n print 'Scoring with astore'; \n action astore.score r = result/ \n rstore = {caslib=model.caslib name=model.name} \n out = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds') then do; \n print 'scoring with datastep code'; \n action datastep.runcodetable r = result/ \n single='YES' \n codeTable= {caslib=model.caslib name=model.name} \n casout = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds2' ) then do; \n print 'Scoring with d2'; \n if ( missing(modelName) eq true) then do;\n results = {Error= 'modelName is missing. Please check your values'};\n return {icasResults=results, statusCode=400};\n end;\n\n action ds2.runModel r = result/ \n modelTable = {caslib=model.caslib, name=model.name} \n modelName = modelName \n table = {caslib= 'casuser', name='input'} \n casOut = {caslib= 'casuser' name='output'}; \n end; \n \n \n action table.fetch r = result / \n table={caslib='casuser' name='output'}; \n \n rows = resultsToDict(result.Fetch); \n \n return {icasResults= rows, statusCode=0} ;\n end; \n \n \n "}},function(t,e,n){"use strict";(function(t){var r=n(10),o=n.n(r),i=n(8);e.a=function(e,n){var r,a=null,u=i.c,s=function(t){return t},c=e.split(".").pop().toLowerCase();switch(c){case"sas7bdat":r="basesas";break;case"sashdat":r="hdat";break;case"csv":r=c,a="UTF8";break;case"xslx":case"xsl":r=c;break;case"astore":case"sasast":r=c,u=i.b,s=function(e){return new t.from(e).toString("base64")};break;case"ds2":case"sas":r="csv",a="UTF8",u=i.c,s=function(t,e){var n=t.replace(/[^\x00-\x7F]/g,"").replace(/\r?\n/g,""),r=e.fileExt;return"modelName\\"+("sas"===r?"dataStepSrc":"ds2"===r?"ds2Src":"casl"===r?"caslSrc":"dataStepsrc")+"\n"+e.output.name+"\\ "+n+"\n"};break;default:throw"Currently file type of ".concat(c," is not supported")}var f=n.split("."),l=o()(f,2);return{source:e,output:{caslib:l[0],name:l[1].toLowerCase()},fileType:r,fileExt:c,fileOptions:a,transform:s,contentType:"binary/octet-stream",handler:u}}}).call(this,n(39).Buffer)},function(t,e,n){t.exports=n(44)},function(t,e,n){var r=n(4).default;function o(){"use strict";
|
|
2
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),a=new k(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return j()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=p(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h={};function d(){}function y(){}function v(){}var _={};f(_,u,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(A([])));b&&b!==n&&i.call(b,u)&&(_=b);var g=v.prototype=d.prototype=Object.create(_);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var n;this._invoke=function(o,a){function u(){return new e((function(n,u){!function n(o,a,u,s){var c=p(t[o],t,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,s)}),(function(t){n("throw",t,u,s)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,s)}))}s(c.arg)}(o,a,n,u)}))}return n=n?n.then(u,u):u()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:j}}function j(){return{value:void 0,done:!0}}return y.prototype=v,f(g,"constructor",v),f(v,"constructor",y),y.displayName=f(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,f(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},w(x.prototype),f(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new x(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(g),f(g,c,"Generator"),f(g,u,(function(){return this})),f(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r={};t.exports=r,r.themes={};var o=n(18),i=r.styles=n(21),a=Object.defineProperties,u=new RegExp(/[\r\n]+/g);r.supportsColor=n(22).supportsColor,void 0===r.enabled&&(r.enabled=!1!==r.supportsColor()),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};r.stylize=function(t,e){if(!r.enabled)return t+"";var n=i[e];return!n&&e in r?r[e](t):n.open+t+n.close};var s=/[|\\{}()[\]^$+*?.]/g;function c(t){var e=function t(){return h.apply(t,arguments)};return e._styles=t,e.__proto__=p,e}var f,l=(f={},i.grey=i.gray,Object.keys(i).forEach((function(t){i[t].closeRe=new RegExp(function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(s,"\\$&")}(i[t].close),"g"),f[t]={get:function(){return c(this._styles.concat(t))}}})),f),p=a((function(){}),l);function h(){var t=Array.prototype.slice.call(arguments),e=t.map((function(t){return null!=t&&t.constructor===String?t:o.inspect(t)})).join(" ");if(!r.enabled||!e)return e;for(var n=-1!=e.indexOf("\n"),a=this._styles,s=a.length;s--;){var c=i[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,n&&(e=e.replace(u,(function(t){return c.close+t+c.open})))}return e}r.setTheme=function(t){if("string"!=typeof t)for(var e in t)!function(e){r[e]=function(n){if("object"==typeof t[e]){var o=n;for(var i in t[e])o=r[t[e][i]](o);return o}return r[t[e]](n)}}(e);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var d=function(t,e){var n=e.split("");return(n=n.map(t)).join("")};for(var y in r.trap=n(25),r.zalgo=n(26),r.maps={},r.maps.america=n(27)(r),r.maps.zebra=n(28)(r),r.maps.rainbow=n(29)(r),r.maps.random=n(30)(r),r.maps)!function(t){r[t]=function(e){return d(r.maps[t],e)}}(y);a(r,function(){var t={};return Object.keys(l).forEach((function(e){t[e]={get:function(){return c([e])}}})),t}())},function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},o=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(u(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n<i;s=r[++n])y(s)||!g(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(n,r){if(void 0!==t&&!0===t.noDeprecation)return n;if(void 0===t)return function(){return e.deprecate(n,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(r);t.traceDeprecation?console.trace(r):console.error(r),o=!0}return n.apply(this,arguments)}};var i,a={};function u(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&e._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),f(r,t,r.depth)}function s(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function f(t,n,r){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return _(o)||(o=f(t,o,r)),o}var i=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(v(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(y(e))return t.stylize("null","null")}(t,n);if(i)return i;var a=Object.keys(n),u=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(n);if(0===a.length){if(S(n)){var s=n.name?": "+n.name:"";return t.stylize("[Function"+s+"]","special")}if(b(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return t.stylize(Date.prototype.toString.call(n),"date");if(x(n))return l(n)}var c,g="",E=!1,O=["{","}"];(h(n)&&(E=!0,O=["[","]"]),S(n))&&(g=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(g=" "+RegExp.prototype.toString.call(n)),w(n)&&(g=" "+Date.prototype.toUTCString.call(n)),x(n)&&(g=" "+l(n)),0!==a.length||E&&0!=n.length?r<0?b(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=E?function(t,e,n,r,o){for(var i=[],a=0,u=e.length;a<u;++a)j(e,String(a))?i.push(p(t,e,n,r,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(t,e,n,r,o,!0))})),i}(t,n,r,u,a):a.map((function(e){return p(t,n,r,u,e,E)})),t.seen.pop(),function(t,e,n){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(c,g,O)):O[0]+g+O[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,o,i){var a,u,s;if((s=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?u=s.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):s.set&&(u=t.stylize("[Setter]","special")),j(r,o)||(a="["+o+"]"),u||(t.seen.indexOf(s.value)<0?(u=y(n)?f(t,s.value,null):f(t,s.value,n-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+u.split("\n").map((function(t){return" "+t})).join("\n")):u=t.stylize("[Circular]","special")),m(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return"number"==typeof t}function _(t){return"string"==typeof t}function m(t){return void 0===t}function b(t){return g(t)&&"[object RegExp]"===E(t)}function g(t){return"object"==typeof t&&null!==t}function w(t){return g(t)&&"[object Date]"===E(t)}function x(t){return g(t)&&("[object Error]"===E(t)||t instanceof Error)}function S(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(m(i)&&(i=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(i)){var r=t.pid;a[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else a[n]=function(){};return a[n]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=d,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=b,e.isObject=g,e.isDate=w,e.isError=x,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(19);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",A(),e.format.apply(e,arguments))},e.inherits=n(20),e._extend=function(t,e){if(!e||!g(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,r){t?n(t):e(r)}));try{t.apply(this,o)}catch(t){n(t)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),I&&Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=I,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,n).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(R,e,a)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,r(e)),n}}).call(this,n(11))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){var n={};t.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach((function(t){var e=r[t],o=n[t]=[];o.open="["+e[0]+"m",o.close="["+e[1]+"m"}))},function(t,e,n){"use strict";(function(e){var r=n(23),o=n(24),i=e.env,a=void 0;function u(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(!1===a)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(t&&!t.isTTY&&!0!==a)return 0;var n=a?1:0;if("win32"===e.platform){var u=r.release().split(".");return Number(e.versions.node.split(".")[0])>=8&&Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(t){return t in i}))||"codeship"===i.CI_NAME?1:n;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in i){var s=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,n)}(t))}o("no-color")||o("no-colors")||o("color=false")?a=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(a=!0),"FORCE_COLOR"in i&&(a=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),t.exports={supportsColor:u,stdout:u(e.stdout),stderr:u(e.stderr)}}).call(this,n(11))},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},function(t,e,n){"use strict";(function(e){t.exports=function(t,n){var r=(n=n||e.argv).indexOf("--"),o=/^-{1,2}/.test(t)?"":"--",i=n.indexOf(o+t);return-1!==i&&(-1===r||i<r)}}).call(this,n(11))},function(t,e){t.exports=function(t,e){var n="";t=(t=t||"Run the trap, drop the bass").split("");var r={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach((function(t){t=t.toLowerCase();var e=r[t]||[" "],o=Math.floor(Math.random()*e.length);n+=void 0!==r[t]?r[t][o]:t})),n}},function(t,e){t.exports=function(t,e){t=t||" he is here ";var n={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},r=[].concat(n.up,n.down,n.mid);function o(t){return Math.floor(Math.random()*t)}function i(t){var e=!1;return r.filter((function(n){e=n===t})),e}return function(t,e){var r,a,u="";for(a in(e=e||{}).up=void 0===e.up||e.up,e.mid=void 0===e.mid||e.mid,e.down=void 0===e.down||e.down,e.size=void 0!==e.size?e.size:"maxi",t=t.split(""))if(!i(a)){switch(u+=t[a],r={up:0,down:0,mid:0},e.size){case"mini":r.up=o(8),r.mid=o(2),r.down=o(8);break;case"maxi":r.up=o(16)+3,r.mid=o(4)+1,r.down=o(64)+3;break;default:r.up=o(8)+1,r.mid=o(6)/2,r.down=o(8)+1}var s=["up","mid","down"];for(var c in s)for(var f=s[c],l=0;l<=r[f];l++)e[f]&&(u+=n[f][o(n[f].length)])}return u}(t,e)}},function(t,e){t.exports=function(t){return function(e,n,r){if(" "===e)return e;switch(n%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}},function(t,e){t.exports=function(t){return function(e,n,r){return n%2==0?e:t.inverse(e)}}},function(t,e){t.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(n,r,o){return" "===n?n:t[e[r++%e.length]](n)}}},function(t,e){t.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(n,r,o){return" "===n?n:t[e[Math.round(Math.random()*(e.length-2))]](n)}}},function(t,e,n){"use strict";e.indent=function(t){return new Array(t+1).join(" ")},e.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach((function(n){void 0!==t[n]&&(e=Math.max(e,n.length))})),e}},function(t){t.exports=JSON.parse('{"author":"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)","name":"prettyjson","description":"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output","version":"1.2.5","homepage":"http://rafeca.com/prettyjson","keywords":["json","cli","formatting","colors"],"repository":{"type":"git","url":"https://github.com/rafeca/prettyjson.git"},"bugs":{"url":"https://github.com/rafeca/prettyjson/issues"},"main":"./lib/prettyjson","files":["bin/prettyjson","lib/*.js"],"license":"MIT","scripts":{"test":"npm run jshint && mocha --reporter spec","testwin":"node ./node_modules/mocha/bin/mocha --reporter spec","jshint":"jshint lib/*.js test/*.js","coverage":"istanbul cover _mocha --report lcovonly -- -R spec","coveralls":"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty=\'* %s\' --first-parent"},"bin":{"prettyjson":"./bin/prettyjson"},"dependencies":{"colors":"1.4.0","minimist":"^1.2.0"},"devDependencies":{"coveralls":"^2.11.15","istanbul":"^0.4.5","jshint":"^2.9.4","mocha":"^3.1.2","mocha-lcov-reporter":"^1.2.0","should":"^11.1.1"}}')},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(36);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){},function(t,e,n){"use strict";
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("restaflib",[],e):"object"==typeof exports?exports.restaflib=e():t.restaflib=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){var r=n(13)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e){function n(t,e,n,r,a,o,s){try{var i=t[o](s),u=i.value}catch(t){return void n(t)}i.done?e(u):Promise.resolve(u).then(r,a)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(a,o){var s=t.apply(e,r);function i(t){n(s,a,o,i,u,"next",t)}function u(t){n(s,a,o,i,u,"throw",t)}i(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(1),a=n.n(r),o=n(0),s=n.n(o),i=n(5);function u(){return(u=a()(s.a.mark((function t(e,n,r,a){var o,u,c,l,f,p,h,d=arguments;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=Object(i.a)(null!==a?a:{},"_args_"),u=(u=o+" "+r).replace(/\r?\n|\r/g,""),c={action:"sccasl.runcasl",data:{code:u}},l=d.length,f=new Array(l>4?l-4:0),p=4;p<l;p++)f[p-4]=d[p];return t.next=7,e.runAction.apply(e,[n,c].concat(f));case 7:return h=t.sent,t.abrupt("return",h);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,n,r){return u.apply(this,arguments)}},function(t,e,n){"use strict";var r=n(10),a=n.n(r);var o=function(){return"\n results = casFetchData(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.filter); \n send_response({casResults = results}); \n \n function casFetchData(caslib, name, from, count, format, _args_.filter) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ; \n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, -1);\n /*\n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do;\n pagePrev = max(to + ,rowCount);\n end; \n */\n \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, table=table}, prev={from=pagePrev, count=count, format=format, table=table}};\n\n /*return ({pagination = {table = {caslib=caslib, name=name}, prev=pagePrev, next=pageNext, count=count}, rc=0 , data = {schema=columns, rows=rows } } ); */\n\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};var s=function(){return"\n \n /*------------------------------------------------*/\n /*Does the tables exist and if not try to load it */\n /*\n Typical usage:\n rc = checkAndLoadTable(caslib, name);\n if ( rc ne true) then do;\n ...handle errors...\n end; \n else do;\n ...your stuff...\n end;\n rc = true - the data is ready for use\n rc = false - the table could not be found\n rc = -1 - the caslib does not exist\n */\n /*------------------------------------------------*/\n\n function checkAndLoadTable(caslib, name); \n\n /* verify caslib is there */\n table.queryCaslib status=status result=result/\n caslib = caslib;\n do k,v over result; /* to handle casuser[user] */ \n rc = v;\n end;\n if ( rc eq false ) then \n return -1;\n /* \n * Check to see if table is already loaded \n */ \n action table.tableExists r=result/ \n caslib = caslib \n name = name; \n /* \n * if not loaded then try to load it \n */ \n rc = true;\n if (result.exists eq 0) then do; \n path = lookupPath(caslib, name);\n if (path eq '*') then do;\n rc = false;\n end;\n else do;\n\t action table.loadTable status=status/ \n\t caslib = caslib \n\t source = path \n\t casout={caslib= caslib name=name}; \n\t if (status.statusCode ne 0 ) then rc = false;\n end; \n end; \n return rc; \n end; \n\n/*\n * return path to table\n */\n\nfunction lookupPath(caslib, name ) ; \n table.fileInfo r = result/ \n caslib=caslib; \n\n names = result.fileInfo[,4]; \n nameu = upcase(name)||'.SASHDAT'; \n cpath = '*'; \n count = 0; \n\n do n over names; \n\t if (upcase(n) eq nameu) then do; \n\t count = count + 1; \n\t if ( cpath eq '*') then do; \n\t cpath = n; \n\t end; \n\t end; \n end; \n \n if (count GT 1 ) then do; \n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\n print 'Path: ' cpath ' will be used****'; \n end; \n r = cpath; \n return r; \nend; \n\n /*-----------------------------------------*/ \n /* isModel: is it model table */ \n /*-----------------------------------------*/ \n \n function isModel(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n validTable = false; \n mtype = 'bad'; \n do c over result.columninfo; \n cu = upCase(c.Column); \n if ( cu eq 'DATASTEPSRC') then do; \n mtype = 'ds'; \n end; \n else if ( cu eq '_STATE_' ) then do; \n mtype = 'astore'; \n end; \n else if (cu eq 'MODELMETADATA') then do; \n mtype = 'ds2'; \n end; \n end; \n print 'Specified model type: ' || mtype; \n return mtype; \n end; \n \n /*-----------------------------------------*/ \n /* Returns contents of the specified table */ \n /*-----------------------------------------*/ \n \n function contents(caslib, name) ; \n table.columnInfo r = result / \n table = {caslib=caslib , name=name}; \n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \n i = 1; \n columns = {}; \n do c over result.columninfo; \n columns[i] = c; \n i = i + 1; \n end; \n return {describe = columns, table = {}}; \n end; \n \n /*------------------------------------------*/ \n /* Returns unique values */ \n /*-----------------------------------------*/ \n \n function selectionLists(idvars,caslib, name); \n \n s = checkAndLoadTable(caslib, name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n \n do k over idvars; \n r = _getValues(k, caslib, name); \n results[k] = r; \n end; \n \n return results; \n end; \n \n function _getValues(id, caslib, name) ; \n \n action table.dropTable/ \n caslib='casuser' name='dtemp1' quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \n \n action simple.groupby result=r status=rc/ \n aggregator = 'N' \n inputs = {id} \n table = {caslib=caslib name=name} \n casout = {caslib='casuser' name='dtemp1'} \n ; \n action table.fetch result=r/ \n table={caslib='casuser' name='dtemp1'} \n sortby={{name=id, order='ascending'}}; \n result = r.Fetch[,2]; \n return result; \n end; \n \n /*------------------------------------------*/ \n /* get a record */ \n /*------------------------------------------*/ \n \n function _fetchData(filter, table); \n s = checkAndLoadTable(table.caslib, table.name); \n if ( s ne 0 ) then do; \n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \n return results; \n end; \n wherex = dictTowhere(filter); \n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \n \n destroyTable('casuser', 'input'); \n \n action datastep.runCode r=result status=rc/ \n single='yes' \n code = 'data casuser.input; set ' || wherex||'run;'; \n */ \n \n action table.fetch r = result / \n table={caslib=table.caslib name=table.name where=wherex}; \n \n rows = resultsToDict(result.Fetch); \n return {scenario = rows, table = result.Fetch}; \n \n end; \n\n function destroyTable(caslib,name); \n action table.dropTable/ \n caslib=caslib name=name quiet=TRUE; \n \n action table.deleteSource status=src / \n caslib=caslib source= name||'.sashdat' quiet=TRUE; \n \n return true; \n end; \n \n \n function dictToWhere(filter); \n where =''; \n andbit=' '; \n do k,v over filter; \n if (isString(v) ) then do; \n where = where || andbit || k || ' eq ' || '\"'||v||'\"'; \n end; \n else do; \n where = where || andbit || k || ' eq ' || v ; \n end; \n andbit =' and '; \n end; \n return where; \n end; \n \n function resultsToDict(r); \n casResults = {}; \n i = 1; \n do row over r; \n casResults[i] = row; \n i = i + 1; \n end; \n return casResults; \n end; \n \n function argsToTable(_arg_, caslib, name ); \n action table.droptable/ \n caslib=caslib name=name quiet=TRUE; \n i = 1; \n do key,obj over _arg_; \n columns[i] = key; \n row[i] = obj; \n if ( isString(obj) ) then \n type[i] = 'varchar'; \n else if ( isInteger(obj) ) then \n type[i] = 'int'; \n else type[i] = 'double'; \n i = i + 1; \n end; \n \n data1 = newTable('data1', columns, type, row ); \n \n saveresult data1 casout=name caslib=caslib replace; \n end; \n\n "};var i=function(){return"\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.where); \n send_response({casResults = results}); \n \n function casFetchRows(caslib, name, from, count, format, where) ; \n \n rc = checkAndLoadTable(caslib, name);\n \n if (rc ne true) then do;\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \n return results; \n end; \n\n /*\n * get all table to get rowCount\n */\n\n action table.tableinfo r= result/ \n caslib = caslib \n name = name; \n \n rowCount = result.TableInfo[1, 'rows']; \n to = min(from + count -1, rowCount); \n \n /*\n * get column information\n */\n\n action table.columninfo r=infoResult /\n table = {caslib=caslib name=name};\n\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\n i = 2;\n do c over inforesult.columninfo;\n columns[i] = c;\n i = i + 1;\n end;\n \n /*\n * Fetch the current set of rows\n */\n /* wherex = dictTowhere(where); */\n action table.fetch r = result / \n table = {caslib=caslib, name=name} \n from= from to=to format=format \n ;\n\n /* \n * create payload to return\n */\n\n i = 1;\n rows ={};\n do row over result.fetch;\n rr = {};\n j = 1;\n do key,v over row;\n rr[j] = override(columns[j].Type, v);\n j = j + 1;\n end;\n rows[i] = rr;\n i = i + 1;\n end;\n\n pagePrev = max(from - count, 1);\n \n if ( to eq rowCount ) then do; \n pageNext = -1; \n end; \n else do ; \n pageNext = min(to + 1, rowCount); \n end; \n table = {caslib=caslib, name=name};\n pagination = {next= {from=pageNext, count=count, format=format, where=where table=table}, prev={from=pagePrev, count=count, format=format, where=where, table=table}};\n return( \n {pagination = pagination, data = {schema=columns, rows=rows }}\n );\n end; \n \n \n /*\n * For non-primary column types set new content\n */\n\n function override(type, iv);\n if (type EQ 'varbinary') then v = '...varbinary';\n else if (type EQ 'blob') then v = '...blob';\n else if (type EQ 'table') then v = '...table';\n else if (type EQ 'dictionary') then v = '...dictionary';\n else if (type EQ 'list') then v = '...list';\n else if (type EQ 'isArray') then v = '...array';\n else v = iv;\n return v;\n end;\n\n \n "};e.a={commonCasl:s,casFetchData:o,casFetchRows:i,scoreCasl:a.a}},function(t,e,n){"use strict";var r=n(1),a=n.n(r),o=n(0),s=n.n(o),i=n(2),u=n(3);function c(){return(c=a()(s.a.mark((function t(e,n,r,a,o){var c,l,f,p,h,d=arguments;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c=r,!0===o&&(c=r+" "+u.a.commonCasl()),l=d.length,f=new Array(l>5?l-5:0),p=5;p<l;p++)f[p-5]=d[p];return t.next=5,i.a.apply(void 0,[e,n,c,a].concat(f));case 5:return h=t.sent,t.abrupt("return",h.items().toJS());case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.a=function(t,e,n,r,a){return c.apply(this,arguments)}},function(t,e,n){"use strict";var r=n(8),a=n.n(r);function o(t){var e="{ ",n=" ";for(var r in t){if(!0===Array.isArray(t[r])){var i=s(t[r]);e=e+n+"".concat(r,"=")+i}else{var u=a()(t[r]);if("object"===u){var c=o(t[r]);e=e+n+"".concat(r,"=")+c}else e=e+n+"".concat(r,"=")+("string"===u?' "'.concat(t[r],'" '):"".concat(t[r]," "))}n=","}return e+="} "}function s(t){for(var e="{",n=" ",r=t.length,i=0;i<r;i++)if(!0===Array.isArray(t[i])){var u=s(t[i]);e=e+n+"".concat(i,"=")+u}else{var c=a()(t[i]);if("object"===c)e=e+n+o(t[i]);else e=e+n+("string"===c?' "'.concat(t[i],'" '):"".concat(t[i]," "));n=","}return e+="}"}e.a=function(t,e){var n;return n=null===t?"{}":!0===Array.isArray(t)?s(t):o(t),"".concat(e," = ").concat(n,";")}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return f})),n.d(e,"a",(function(){return h}));var r=n(1),a=n.n(r),o=n(0),s=n.n(o);function i(){return(i=a()(s.a.mark((function t(e,n,r,a){var o,i,u,c,l;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=a.output,i=o.caslib,null!=(u=o.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return u=u.toLowerCase(u),c="\n action table.droptable /\n caslib= '".concat(i,"' name= '").concat(u,"' quiet=true;\n\n action table.deleteSource/\n caslib= '").concat(i,"' source= '").concat(u,".sashdat' quiet=true; \n "),l={action:"sccasl.runcasl",data:{code:c}},t.next=8,e.runAction(n,l);case 8:return l={action:"astore.upload",data:{rstore:{name:"".concat(u),caslib:"".concat(i),replace:!0},store:r}},t.next=11,e.runAction(n,l);case 11:return t.sent,t.abrupt("return","Upload of ".concat(a.source," to ").concat(i,".").concat(u," completed"));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var u=function(t,e,n,r){return i.apply(this,arguments)},c=n(4);function l(){return(l=a()(s.a.mark((function t(e,n,r,a,o){var i,u,l,f,p,h;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=a.output,u=i.caslib,null!=(l=i.name)){t.next=3;break}throw"Please specify table as caslib.name";case 3:return f={casout:{caslib:u,name:l},importOptions:{fileType:a.fileType}},"sas"!==a.fileExt&&"ds2"!==a.fileExt||(f.importOptions.delimiter="\\"),p={headers:{"JSON-Parameters":f,"Content-Type":"binary/octet-stream"},data:r,action:"table.upload"},t.next=8,e.runAction(n,p);case 8:if(!0!==o){t.next=13;break}return h="\n\t\t\taction table.save r = result / \n\t\t\ttable = {caslib='".concat(u,"' name='").concat(l,"'} replace=true\n\t\t\tcaslib='").concat(u,"' name='").concat(l,"';\n\n\t\t\tsend_response(result);\n\t\t\t"),t.next=12,Object(c.a)(e,n,h,null);case 12:t.sent;case 13:return t.abrupt("return","Upload of ".concat(a.source," to ").concat((a.output,u),".").concat(a.output.name," completed"));case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var f=function(t,e,n,r,a){return l.apply(this,arguments)};function p(){return(p=a()(s.a.mark((function t(e,n,r,a){var o;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={action:"table.save",data:{name:"".concat(a),caslib:"".concat(r),replace:!0,table:{name:"".concat(a),caslib:"".concat(r)}}},t.next=3,e.runAction(n,o);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var h=function(t,e,n,r){return p.apply(this,arguments)}},function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(14),a=n(15),o=n(16),s=n(18);t.exports=function(t,e){return r(t)||a(t,e)||o(t,e)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){return"\n result = runMain(_args_); \n send_response(result); \n /* print result; */\n \n \n function runMain(_args_) ; \n r = {Error= 'No path'}; \n if ( _args_.path eq '/selectors') then do; \n r = selectionLists(_args_.selectors, _args_.table.caslib, _args_.table.name); \n end; \n else if ( _args_.path eq '/contents') then do; \n r = contents(_args_.table.caslib, _args_.table.name); \n end; \n else if (_args_.path eq '/describe') then do; \n r = describeModel(_args_); \n end; \n else if (_args_.path eq '/scenario' ) then do;\n r = fetchData(_args_.filter, _args_.table);\n end;\n else if (_args_.path eq '/score') then do; \n if( exists(_args_, 'modelName') eq false ) then\n modelname = '';\n else modelName =_args_.modelName;\n r = runScoreCode(_args_.model, _args_.scenario, modelName); \n end; \n else do; \n r = {icasResults={Errors = 'Invalid action option specified' || _args_.path}, statusCode=404}; \n end; \n print r;\n if ( r.statusCode ne 0) then do;\n print r.icasResults;\n exit({severity=2,reason=6, status=r.iCasResults.Errors,statusCode=r.statusCode});\n end;\n result = {casResults = r.icasResults}; \n print '***************************************************************'; \n print result; \n print '***************************************************************'; \n return result; \n end; \n \n /*-----------------------------------------*/ \n /* describeModel */ \n /*-----------------------------------------*/ \n \n function describeModel(_args_) ; \n s = checkAndLoadTable(_args_.model.caslib, _args_.model.name); \n if ( s ne true) then do; \n results = {Errors= 'Unable to access ' ||_args_.model.caslib||'.'||_args_.model.name}; \n return {icasResults=results, statusCode=404}; \n end; \n \n mtype = isModel(_args_.model.caslib, _args_.model.name); \n if ( mtype EQ 'astore' ) then do; \n r = astoreDescribe(_args_.model); \n end; \n else if (mtype EQ 'ds' or mtype EQ 'ds2') then do;\n s = checkAndLoadTable(_args_.table.caslib, _args_.table.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||_args_.table.caslib||'.'||_args_.table.name}; \n return {icasResults=results, statusCode=404}; \n end; \n r = contents( _args_.table.caslib, _args_.table.name); \n end; \n return {icasResults= r, statusCode=0} ;\n end; \n \n /*------------------------------------------*/ \n /* astoreDescribe */ \n /*------------------------------------------*/ \n \n function astoreDescribe(model); \n action astore.describe r=result/ \n rstore = { caslib= model.caslib name = model.name }; \n rows = resultsToDict(result.InputVariables); \n return {describe = rows, table = result.InputVariables}; \n end; \n \n /*------------------------------------------*/ \n /* score */ \n /*------------------------------------------*/ \n function runScoreCode( model, scenario, modelName); \n print model; \n s = checkAndLoadTable(model.caslib, model.name); \n if ( s ne true ) then do; \n results = {Errors= 'Unable to access ' ||model.caslib||'.'||model.name}; \n return {icasResults=results, statusCode=404}; \n end;\n \n mtype = isModel(model.caslib, model.name); \n \n if ( mtype eq 'bad' ) then do; \n results = {Error= model.caslib||'.'||model.name || ' is not recognized as a valid supported model. Please check your values'};\n return {icasResults=results, statusCode=400};\n end; \n destroyTable('casuser', 'input'); \n argsToTable(scenario, 'casuser', 'input'); \n \n destroyTable('casuser', 'output'); \n \n if (mtype eq 'astore') then do; \n print 'Scoring with astore'; \n action astore.score r = result/ \n rstore = {caslib=model.caslib name=model.name} \n out = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds') then do; \n print 'scoring with datastep code'; \n action datastep.runcodetable r = result/ \n single='YES' \n codeTable= {caslib=model.caslib name=model.name} \n casout = {caslib='casuser' name='output'} \n table = {caslib='casuser' name='input'}; \n end; \n else if (mtype eq 'ds2' ) then do; \n print 'Scoring with d2'; \n if ( missing(modelName) eq true) then do;\n results = {Error= 'modelName is missing. Please check your values'};\n return {icasResults=results, statusCode=400};\n end;\n\n action ds2.runModel r = result/ \n modelTable = {caslib=model.caslib, name=model.name} \n modelName = modelName \n table = {caslib= 'casuser', name='input'} \n casOut = {caslib= 'casuser' name='output'}; \n end; \n \n \n action table.fetch r = result / \n table={caslib='casuser' name='output'}; \n \n rows = resultsToDict(result.Fetch); \n \n return {icasResults= rows, statusCode=0} ;\n end; \n \n \n "}},function(t,e,n){"use strict";(function(t){var r=n(9),a=n.n(r),o=n(7);e.a=function(e,n){var r,s=null,i=o.c,u=function(t){return t},c=e.split(".").pop().toLowerCase();switch(c){case"sas7bdat":r="basesas";break;case"sashdat":r="hdat";break;case"csv":r=c,s="UTF8";break;case"xslx":case"xsl":r=c;break;case"astore":case"sasast":r=c,i=o.b,u=function(e){return new t.from(e).toString("base64")};break;case"ds2":case"sas":r="csv",s="UTF8",i=o.c,u=function(t,e){var n=t.replace(/[^\x00-\x7F]/g,"").replace(/\r?\n/g,""),r=e.fileExt;return"modelName\\"+("sas"===r?"dataStepSrc":"ds2"===r?"ds2Src":"casl"===r?"caslSrc":"dataStepsrc")+"\n"+e.output.name+"\\ "+n+"\n"};break;default:throw"Currently file type of ".concat(c," is not supported")}var l=n.split("."),f=a()(l,2);return{source:e,output:{caslib:f[0],name:f[1].toLowerCase()},fileType:r,fileExt:c,fileOptions:s,transform:u,contentType:"binary/octet-stream",handler:i}}}).call(this,n(20).Buffer)},function(t,e,n){t.exports=n(25)},function(t,e,n){var r=n(8).default;function a(){"use strict";
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=a=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},i=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var a=e&&e.prototype instanceof d?e:d,o=Object.create(a.prototype),s=new R(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return C()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=E(s,n);if(i){if(i===h)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h={};function d(){}function b(){}function m(){}var y={};l(y,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(A([])));v&&v!==n&&o.call(v,i)&&(y=v);var w=m.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){var n;this._invoke=function(a,s){function i(){return new e((function(n,i){!function n(a,s,i,u){var c=p(t[a],t,s);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(c.arg)}(a,s,n,i)}))}return n=n?n.then(i,i):i()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return b.prototype=m,l(w,"constructor",m),l(m,"constructor",b),b.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,u,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var s=new _(f(t,n,r,a),o);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(w),l(w,c,"Generator"),l(w,i,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(i&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,a,o=[],s=!0,i=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);s=!0);}catch(t){i=!0,a=t}finally{try{s||null==n.return||n.return()}finally{if(i)throw a}}return o}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(17);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){},function(t,e,n){"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
6
6
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/var r=n(40),o=n(41),i=n(42);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),o=(t=u(t,r)).write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(s.isBuffer(e)){var n=0|h(e.length);return 0===(t=u(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=u(t,e<0?0:0|h(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|h(e.length);t=u(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return N(t).length;default:if(r)return B(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return j(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function _(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,o);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,r,o){var i,a=1,u=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var f=-1;for(i=n;i<u;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*a}else-1!==f&&(i-=i-f),f=-1}else for(n+s>u&&(n=u-s),i=n;i>=0;i--){for(var l=!0,p=0;p<s;p++)if(c(t,i+p)!==c(e,p)){l=!1;break}if(l)return i}return-1}function b(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[n+a]=u}return a}function g(t,e,n,r){return F(B(e,t.length-n),t,n,r)}function w(t,e,n,r){return F(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return w(t,e,n,r)}function S(t,e,n,r){return F(N(e),t,n,r)}function E(t,e,n,r){return F(function(t,e){for(var n,r,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function O(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,a,u,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(s=(15&c)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),o+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==Object({}).TYPED_ARRAY_SUPPORT?Object({}).TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return c(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?u(t,e):void 0!==n?"string"==typeof r?u(t,e).fill(n,r):u(t,e).fill(n):u(t,e)}(null,t,e,n)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=s.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?k(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,n,r,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),u=Math.min(i,a),c=this.slice(r,o),f=t.slice(e,n),l=0;l<u;++l)if(c[l]!==f[l]){i=c[l],a=f[l];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return _(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return _(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return g(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return S(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function j(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=U(t[i]);return o}function R(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,n,r,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function z(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function D(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,i){return i||D(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function P(t,e,n,r,i){return i||D(t,0,n,8),o.write(t,e,n,r,52,8),n+8}s.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=s.prototype;else{var o=e-t;n=new s(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},s.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},s.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},s.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||T(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},s.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||T(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<n&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return P(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return P(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},s.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var a=s.isBuffer(t)?t:B(new s(t,r).toString()),u=a.length;for(i=0;i<n-e;++i)this[i+e]=a[i%u]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function N(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],u=r[1],s=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,u)),f=0,l=u>0?a-4:a;for(n=0;n<l;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=255&e;2===u&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,s[f++]=255&e);1===u&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,s[f++]=e>>8&255,s[f++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,u=n-o;a<u;a+=16383)i.push(f(t,a,a+16383>u?u:a+16383));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)r[u]=a[u],o[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,n){for(var o,i,a=[],u=e;u<n;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
8
|
+
*/var r=n(21),a=n(22),o=n(23);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),a=(t=i(t,r)).write(e,n);a!==r&&(t=t.slice(0,a));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|h(e.length);return 0===(t=i(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?i(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=i(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|h(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function b(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,a){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,a);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,a){var o,s=1,i=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,i/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(a){var l=-1;for(o=n;o<i;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>i&&(n=i-u),o=n;o>=0;o--){for(var f=!0,p=0;p<u;p++)if(c(t,o+p)!==c(e,p)){f=!1;break}if(f)return o}return-1}function v(t,e,n,r){n=Number(n)||0;var a=t.length-n;r?(r=Number(r))>a&&(r=a):r=a;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var i=parseInt(e.substr(2*s,2),16);if(isNaN(i))return s;t[n+s]=i}return s}function w(t,e,n,r){return Y(F(e,t.length-n),t,n,r)}function x(t,e,n,r){return Y(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function _(t,e,n,r){return x(t,e,n,r)}function E(t,e,n,r){return Y(q(e),t,n,r)}function k(t,e,n,r){return Y(function(t,e){for(var n,r,a,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,a=n%256,o.push(a),o.push(r);return o}(e,t.length-n),t,n,r)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function R(t,e,n){n=Math.min(t.length,n);for(var r=[],a=e;a<n;){var o,s,i,u,c=t[a],l=null,f=c>239?4:c>223?3:c>191?2:1;if(a+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[a+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[a+1],s=t[a+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[a+1],s=t[a+2],i=t[a+3],128==(192&o)&&128==(192&s)&&128==(192&i)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&i)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==Object({}).TYPED_ARRAY_SUPPORT?Object({}).TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,a=0,o=Math.min(n,r);a<o;++a)if(t[a]!==e[a]){n=t[a],r=e[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,a),a+=s.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?R(this,0,t):b.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,a){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||n>t.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=n)return 0;if(r>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),i=Math.min(o,s),c=this.slice(r,a),l=t.slice(e,n),f=0;f<i;++f)if(c[f]!==l[f]){o=c[f],s=l[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(127&t[a]);return r}function C(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(t[a]);return r}function T(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",o=e;o<n;++o)a+=N(t[o]);return a}function O(t,e,n){for(var r=t.slice(e,n),a="",o=0;o<r.length;o+=2)a+=String.fromCharCode(r[o]+256*r[o+1]);return a}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,a,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function L(t,e,n,r){e<0&&(e=65535+e+1);for(var a=0,o=Math.min(t.length-n,2);a<o;++a)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function U(t,e,n,r){e<0&&(e=4294967295+e+1);for(var a=0,o=Math.min(t.length-n,4);a<o;++a)t[n+a]=e>>>8*(r?a:3-a)&255}function D(t,e,n,r,a,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(t,e,n,r,o){return o||D(t,0,n,4),a.write(t,e,n,r,23,4),n+4}function M(t,e,n,r,o){return o||D(t,0,n,8),a.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var a=e-t;n=new u(a,void 0);for(var o=0;o<a;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],a=1,o=0;++o<e&&(a*=256);)r+=this[t+o]*a;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],a=1;e>0&&(a*=256);)r+=this[t+--e]*a;return r},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],a=1,o=0;++o<e&&(a*=256);)r+=this[t+o]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,a=1,o=this[t+--r];r>0&&(a*=256);)o+=this[t+--r]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),a.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),a.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),a.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),a.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||j(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,o=0;for(this[e]=255&t;++o<n&&(a*=256);)this[e+o]=t/a&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||j(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);j(this,t,e,n,a-1,-a)}var o=0,s=1,i=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===i&&0!==this[e+o-1]&&(i=1),this[e+o]=(t/s>>0)-i&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);j(this,t,e,n,a-1,-a)}var o=n-1,s=1,i=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===i&&0!==this[e+o+1]&&(i=1),this[e+o]=(t/s>>0)-i&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return I(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return I(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return M(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return M(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var a,o=r-n;if(this===t&&n<e&&e<r)for(a=o-1;a>=0;--a)t[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=u.isBuffer(t)?t:F(new u(t,r).toString()),i=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%i]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,a=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&o.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=t.length);++a)e[a+n]=t[a];return a}},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),s=r[0],i=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,i)),l=0,f=i>0?s-4:s;for(n=0;n<f;n+=4)e=a[t.charCodeAt(n)]<<18|a[t.charCodeAt(n+1)]<<12|a[t.charCodeAt(n+2)]<<6|a[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===i&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===i&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,a=n%3,o=[],s=0,i=n-a;s<i;s+=16383)o.push(l(t,s,s+16383>i?i:s+16383));1===a?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===a&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],a=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,u=s.length;i<u;++i)r[i]=s[i],a[s.charCodeAt(i)]=i;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var a,o,s=[],i=e;i<n;i+=3)a=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),s.push(r[(o=a)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(t,e){
|
|
9
9
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
10
|
-
e.read=function(t,e,n,r,o){var i,a,u=8*o-r-1,s=(1<<u)-1,c=s>>1,f=-7,l=n?o-1:0,p=n?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=u;f>0;i=256*i+t[e+l],l+=p,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,u,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+l>=1?p/s:p*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(e*s-1)*Math.pow(2,o),a+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[n+h]=255&u,h+=d,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*y}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,n){"use strict";n.r(e),n.d(e,"caslRun",(function(){return r.a})),n.d(e,"caslRunBase",(function(){return o.a})),n.d(e,"casSetup",(function(){return w})),n.d(e,"casActionRun",(function(){return S})),n.d(e,"casTableToJson",(function(){return R})),n.d(e,"casFetchData",(function(){return O})),n.d(e,"casFetchRows",(function(){return $o})),n.d(e,"casUpdateData",(function(){return I})),n.d(e,"computeRun",(function(){return L})),n.d(e,"computeSetup",(function(){return q})),n.d(e,"computeSummary",(function(){return T})),n.d(e,"computeFetchData",(function(){return F})),n.d(e,"computeFileContent",(function(){return J})),n.d(e,"findReport",(function(){return G})),n.d(e,"getReportImage",(function(){return V})),n.d(e,"getReportUri",(function(){return Q})),n.d(e,"getSasTableRows",(function(){return X})),n.d(e,"jesSetup",(function(){return tt})),n.d(e,"jesRun",(function(){return st})),n.d(e,"jesSummary",(function(){return nt})),n.d(e,"jsonToDict",(function(){return ct.a})),n.d(e,"computeResults",(function(){return B})),n.d(e,"print",(function(){return Uo})),n.d(e,"caslScore",(function(){return y})),n.d(e,"caslDescribe",(function(){return b})),n.d(e,"masSetup",(function(){return yt})),n.d(e,"masAddModel",(function(){return lt})),n.d(e,"masDescribe",(function(){return vt})),n.d(e,"masRun",(function(){return mt})),n.d(e,"masScore",(function(){return gt})),n.d(e,"casUpload",(function(){return Go})),n.d(e,"uploadData",(function(){return Ho})),n.d(e,"lib",(function(){return Xo}));var r=n(5),o=n(2),i=n(7),a=n.n(i),u=n(1),s=n.n(u),c=n(0),f=n.n(c),l=n(3);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(){return(d=s()(f.a.mark((function t(e,n,r){var i,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.a.commonCasl()+" "+l.a.scoreCasl(),a=h({path:"/score"},r),t.next=4,Object(o.a)(e,n,i,a);case 4:return u=t.sent,s=u.items("results","casResults").toJS()[0],t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var y=function(t,e,n){return d.apply(this,arguments)};function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(){return(m=s()(f.a.mark((function t(e,n,r){var i,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.a.commonCasl()+" "+l.a.scoreCasl(),a=_({path:"/describe"},r),t.next=4,Object(o.a)(e,n,i,a);case 4:return u=t.sent,s=u.items("results").toJS(),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var b=function(t,e,n){return m.apply(this,arguments)};function g(){return(g=s()(f.a.mark((function t(e,n){var r,o,i,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("casManagement");case 5:return r=t.sent,o=r.casManagement,t.next=9,e.apiCall(o.links("servers"));case 9:if(0!==(i=t.sent).itemsList().size){t.next=12;break}throw{Error:"No cas servers were found"};case 12:return a=i.itemsList(0),t.next=15,e.apiCall(i.itemsCmd(a,"createSession"));case 15:return u=t.sent,t.abrupt("return",{servers:i,session:u});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var w=function(t,e){return g.apply(this,arguments)};function x(){return(x=s()(f.a.mark((function t(e){var n,r,o,i,a=arguments;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=a.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=a[o];return t.next=3,e.runAction.apply(e,r);case 3:return i=t.sent,t.abrupt("return",i.items().toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var S=function(t){return x.apply(this,arguments)};function E(){return(E=s()(f.a.mark((function t(e,n,r){var i,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.a.commonCasl()+" "+l.a.casFetchData(),t.next=3,Object(o.a)(e,n,i,r);case 3:return a=t.sent,t.abrupt("return",a.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var O=function(t,e,n){return E.apply(this,arguments)};function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function j(){return(j=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s,c,l,p,h,d,y,v,_,m,b;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c in o=r.data,i=r.where,a=r.table,u="",s=" ",i)l=i[c],p="string"==typeof l?"'".concat(l.toString(),"'"):l,u=u+s+c+"= ".concat(p," "),s=" AND ";for(d in h=[],o)y=o[d],v=void 0,v=null==y?".":"string"==typeof y?JSON.stringify(y):y.toString(),h.push({var:d,value:v});return _=A(A({},a),{},{where:"".concat(u)}),m={action:"table.update",data:{table:_,set:h}},t.next=12,e.runAction(n,m);case 12:return b=t.sent,t.abrupt("return",b);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var I=function(t,e,n){return j.apply(this,arguments)};var R=function(t,e){var n=t.items("tables",e),r=n.get("rows"),o=[];n.get("schema").map((function(t){o.push(t.get("name"))}));var i=[];return r.map((function(t){var e={};t.map((function(t,n){e[o[n]]=t})),i.push(e)})),i};function C(){return(C=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o={session:n,log:null,listing:null,ods:null,job:r,tables:{},files:{}}).log=r.links("log"),o.listing=r.links("listing"),null===(i=r.links("results"))){t.next=10;break}return t.next=7,e.apiCall(i);case 7:if(a=t.sent,(u=a.itemsList().size)>0)for(s=0;s<u;s++)c=a.itemsList(s),"ods"===(l=a.items(c,"data","type").toLowerCase())?o.ods=a.itemsCmd(c,"self"):"table"===l?(p={self:a.itemsCmd(c,"self"),current:null},o.tables[c]=p):"file"===l?(h={self:c,current:null,data:null},o.files[c]=h):(d={self:c,current:null,data:null},o[l]=d);case 10:return t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=function(t,e,n){return C.apply(this,arguments)};function z(){return(z=s()(f.a.mark((function t(e,n,r,o,i){var a,u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="wait",u=null!=i?i:5,"wait"!==o&&null!==o&&(a=Math.max(Math.floor(o/u),1)),s={data:{code:r}},t.next=6,e.apiCall(n.links("execute"),s);case 6:return c=t.sent,t.next=9,e.jobState(c,null,a,u);case 9:if("running"!==(l=t.sent).data){t.next=14;break}throw"ERROR: Job did not complete in allotted time";case 14:return t.next=16,T(e,n,l.job);case 16:return(p=t.sent).SASJobStatus=l.data,t.abrupt("return",p);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var M=function(t,e,n,r,o){return z.apply(this,arguments)};function D(){return(D=s()(f.a.mark((function t(e,n,r,o,i,a){var u,s,c,l,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=[],null!=o)for(s in o)c="%let ".concat(s," = ").concat(o[s],";"),u.push(c);return l=r.split(/\r?\n/),u=u.concat(l),t.next=6,M(e,n,u,i,a);case 6:return p=t.sent,t.abrupt("return",p);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=function(t,e,n,r,o,i){return D.apply(this,arguments)};function P(){return(P=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=4;break}return t.next=3,e.logon(r);case 3:t.sent;case 4:return t.next=6,e.addServices("compute");case 6:return o=t.sent,i=o.compute,t.next=10,e.apiCall(i.links("contexts"));case 10:if(a=t.sent,null==n&&(n="Job Execution compute"),n=n.toLowerCase(),-1!==(u=a.itemsList().findIndex((function(t){return t.toLowerCase().indexOf(n)>=0})))){t.next=17;break}throw{Error:"Compute Context not found: "+n};case 17:return s=a.itemsCmd(a.itemsList(u),"createSession"),t.next=20,e.apiCall(s);case 20:return c=t.sent,t.abrupt("return",c);case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var q=function(t,e,n){return P.apply(this,arguments)};function U(){return(U=s()(f.a.mark((function t(e,n,r){var o,i,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("log"!==r&&"listing"!==r){t.next=20;break}if(o=[],null===n[r]){t.next=16;break}return t.next=5,e.apiCall(n[r]);case 5:i=t.sent,o=o.concat(i.items().toJS());case 7:if(null===(a=i.scrollCmds("next"))){t.next=14;break}return t.next=10,e.apiCall(a);case 10:i=t.sent,o=o.concat(i.items().toJS()),t.next=7;break;case 14:t.next=17;break;case 16:o[0]="Note: No ".concat(r);case 17:return t.abrupt("return",o);case 20:if("ods"!==r){t.next=31;break}if(null===n.ods){t.next=28;break}return t.next=24,e.apiCall(n.ods);case 24:return u=t.sent,t.abrupt("return",u.items());case 28:return t.abrupt("return","<h2> No ODS output </h2>");case 29:t.next=40;break;case 31:if("tables"!==r){t.next=35;break}return t.abrupt("return",Object.keys(n.tables));case 35:if("files"!==r){t.next=39;break}return t.abrupt("return",Object.keys(n.files));case 39:throw"Error: Invalid type ".concat(r);case 40:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B=function(t,e,n){return U.apply(this,arguments)};function N(){return(N=s()(f.a.mark((function t(e,n,r,o,i){var a,u,s,c,l,p,h,d,y,v;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=null,s=null!=i?{qs:i}:null,!0!==n.tables.hasOwnProperty(r)){t.next=29;break}if(null!==(u=n.tables[r]).current&&null!=o){t.next=17;break}return t.next=8,e.apiCall(u.self);case 8:return c=t.sent,t.next=11,e.apiCall(c.links("rowSet"),s);case 11:l=t.sent,u.current=l,p=l.items().toJS(),a={columns:p.columns,rows:p.rows,scrollOptions:l.scrollCmds().keySeq().toJS()},t.next=29;break;case 17:if(h=u.current,d=o,"next"===o&&null===h.scrollCmds("next")&&(d=null!==h.links("last")?"last":null),"prev"===o&&null===h.scrollCmds("prev")&&(d=null!==h.links("first")?"first":null),null===d||null===h.scrollCmds(d)){t.next=29;break}return t.next=25,e.apiCall(h.scrollCmds(d),s);case 25:y=t.sent,u.current=y,v=y.items().toJS(),a={columns:v.columns,rows:v.rows,scrollOptions:y.scrollCmds().keySeq().toJS()};case 29:return t.abrupt("return",a);case 30:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var F=function(t,e,n,r,o){return N.apply(this,arguments)};function Y(){return(Y=s()(f.a.mark((function t(e,n,r,o){var i,a,u,s,c,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(i=n.files[r])){t.next=3;break}throw"Invalid fileref ".concat(r);case 3:if(null!==i.current){t.next=12;break}return a={qs:{filter:"eq(name,'".concat(r,"')")}},t.next=7,e.apiCall(n.session.links("files"),a);case 7:return u=t.sent,t.next=10,e.apiCall(u.itemsCmd(r,"self"));case 10:u=t.sent,i.current=u;case 12:if(!0!==o){t.next=17;break}return s="".concat(n.session.host).concat(i.current.links("content","link","uri")),t.abrupt("return",s);case 17:if(null!==i.data){t.next=26;break}return t.next=20,e.apiCall(i.current.links("content"));case 20:return c=t.sent,l=c.items(),i.data=l,t.abrupt("return",l);case 26:return t.abrupt("return",i.data);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var J=function(t,e,n,r){return Y.apply(this,arguments)};function K(){return(K=s()(f.a.mark((function t(e,n){var r,o,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getService("reports"),o=null,null!==n&&(o={qs:{filter:"eq(name,'".concat(n,"')")}}),t.next=5,e.apiCall(r.links("reports"),o);case 5:return i=t.sent,t.abrupt("return",0===i.itemsList().size?null:i);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var G=function(t,e){return K.apply(this,arguments)};function W(){return(W=s()(f.a.mark((function t(e,n){var r,o,i,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.rafObject("reportImages"),t.next=3,G(e,n);case 3:if(null!==(o=t.sent)){t.next=6;break}return t.abrupt("return","".concat(n," was not found"));case 6:return i=o.itemsCmd(o.itemsList(0),"self","link","uri"),a={data:{reportUri:i,sectionIndex:0,layoutType:"entireSection",size:"400x400"}},t.next=11,e.apiCall(r.links("createJob"),a);case 11:return u=t.sent,t.next=14,e.jobState(u,{qs:{wait:1.5}},10,2);case 14:if("completed"===(s=t.sent).data){t.next=17;break}return t.abrupt("return","Job failed ".concat(s.data));case 17:return t.next=19,e.apiCall(s.job.itemsCmd(s.job.itemsList(0),"image"));case 19:return c=t.sent,t.abrupt("return",c.items());case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var V=function(t,e){return W.apply(this,arguments)};function H(){return(H=s()(f.a.mark((function t(e,n){var r,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,G(e,n);case 2:if(null!==(r=t.sent)){t.next=6;break}throw null==n?"No reports were found":"".concat(n," was not found");case 6:return o=[],r.items().map((function(t,e){var n={name:e,uri:r.itemsCmd(e,"self","link","uri")};o.push(n)})),t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Q=function(t,e){return H.apply(this,arguments)};function $(){return($=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s,c,l,p,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.tables[r],t.next=3,e.apiCall(o);case 3:return i=t.sent,t.next=6,e.apiCall(i.links("rowSet"));case 6:for(a=t.sent,u=a.items("columns"),s=a.items("rows"),c=[],l=s.size,p=function(t){var e=s.get(t),n={};u.map((function(t,r){var o=t.toLowerCase();n[o]=e.get(r)})),c.push(n)},h=0;h<l;h++)p(h);return t.abrupt("return",c);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var X=function(t,e,n){return $.apply(this,arguments)};function Z(){return(Z=s()(f.a.mark((function t(e,n){var r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("jobExecution","compute","jobDefinitions");case 5:return r=t.sent,t.abrupt("return",r.jobExecution);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tt=function(t,e){return Z.apply(this,arguments)};function et(){return(et=s()(f.a.mark((function t(e,n){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var nt=function(t,e){return et.apply(this,arguments)};function rt(){return(rt=s()(f.a.mark((function t(e,n,r){var o,i,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apiCall(n.links("create"),r);case 2:return o=t.sent,t.next=5,e.jobState(o,null,5,2);case 5:if("running"!==(i=t.sent).data){t.next=10;break}throw"ERROR: Job did not complete in allotted time";case 10:if("failed"!==i.data){t.next=14;break}throw JSON.stringify(i);case 14:return t.next=16,nt(e,i.job);case 16:return a=t.sent,t.abrupt("return",a);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ot=function(t,e,n){return rt.apply(this,arguments)};function it(){return(it=s()(f.a.mark((function t(e,n,r,o,i){var a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a={},u={},null===o){t.next=6;break}return t.next=5,at(e,o);case 5:a.jobDefinitionUri=t.sent;case 6:return-0!=r&&(u.code=r),u.type="Compute",a.arguments=i,a.jobDefinition=u,s={data:a},t.next=13,ot(e,n,s);case 13:return c=t.sent,t.abrupt("return",c);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function at(t,e){return ut.apply(this,arguments)}function ut(){return(ut=s()(f.a.mark((function t(e,n){var r,o,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.getService("jobDefinitions"),r=null,o={qs:{filter:"eq(name,'".concat(n,"')")}},t.next=5,ot(e,o);case 5:if(0!==(i=t.sent).itemsList().size){t.next=10;break}throw"Error: ".concat(n," not found in the system");case 10:r=i.itemsCmd(n,"self","link","uri");case 11:return t.abrupt("return",r);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var st=function(t,e,n,r,o){return it.apply(this,arguments)},ct=n(6);function ft(){return(ft=s()(f.a.mark((function t(e,n,r){var o,i,a,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.service,i=0;case 2:if(!(i<r.length)){t.next=12;break}if(a=r[i],null!=n.steps[a]){t.next=9;break}return t.next=7,ht(e,o,a);case 7:u=t.sent,n.steps[a]=u;case 9:i++,t.next=2;break;case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var lt=function(t,e,n){return ft.apply(this,arguments)};function pt(){return(pt=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={qs:{filter:"eq(name,'".concat(r.trim(),"')")}},t.next=3,e.apiCall(n.links("modules"),o);case 3:if(0!==(i=t.sent).itemsList().size){t.next=6;break}return t.abrupt("return",null);case 6:return a=i.itemsCmd(r,"steps"),t.next=9,e.apiCall(a);case 9:return u=t.sent,s={name:r,stepsRafLink:u,stepIds:i.items(r,"data","stepIds").toJS(),microanalyticScore:n},t.abrupt("return",s);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ht=function(t,e,n){return pt.apply(this,arguments)};function dt(){return(dt=s()(f.a.mark((function t(e,n,r){var o,i,a,u,s,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("microanalyticScore");case 5:o=t.sent,i=o.microanalyticScore,a={service:i,steps:{}},u=0;case 9:if(!(u<n.length)){t.next=18;break}return s=n[u],t.next=13,ht(e,i,s);case 13:c=t.sent,a.steps[s]=c;case 15:u++,t.next=9;break;case 18:return t.abrupt("return",a);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var yt=function(t,e,n){return dt.apply(this,arguments)};var vt=function(t,e,n){var r=t.steps[e];if(null===r)return[];var o=null;if(null==n){var i=r.stepIds.findIndex((function(t){return"execute"===t||"score"===t}));if(-1===i)return[];o=r.stepIds[i]}else{if(-1===r.stepIds.findIndex((function(t){return t===n})))return[];o=n}var a=r.stepsRafLink.items(o,"data","inputs");return null===a?[]:a.toJS()};function _t(){return(_t=s()(f.a.mark((function t(e,n,r,o,i,a){var u,s,c,l,p,h,d,y,v,_,m,b,g;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=n.steps[r],s=!1,c=[],!1===Array.isArray(o))for(l in o)p={name:l,value:o[l]},c.push(p);else s=!0;if(h={data:{inputs:!0===s?o:c}},d=null,null!=i){t.next=15;break}if(-1!==(y=u.stepIds.findIndex((function(t){return"execute"===t||"score"===t})))){t.next=12;break}return t.abrupt("return",[]);case 12:d=u.stepIds[y];case 13:t.next=21;break;case 15:if(-1!==u.stepIds.findIndex((function(t){return t===i}))){t.next=20;break}return t.abrupt("return",[]);case 20:d=i;case 21:if(null!==(v=u.stepsRafLink.itemsCmd(d,a))){t.next=25;break}return _=[{name:"Error",type:"string",value:"name: ".concat(r," step: ").concat(i," operation: ").concat(a," is an invalid combination")}],t.abrupt("return",_);case 25:return t.next=27,e.apiCall(v,h);case 27:return m=t.sent,b=m.items("outputs").toJS(),!0===s?g=b:(g={},b.map((function(t){g[t.name]=t.value}))),t.abrupt("return",g);case 31:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var mt=function(t,e,n,r,o,i){return _t.apply(this,arguments)};function bt(){return(bt=s()(f.a.mark((function t(e,n,r){var o,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt(e,[n]);case 2:return o=t.sent,t.next=5,mt(e,o,n,r,"score","execute");case 5:return i=t.sent,t.abrupt("return",i);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gt=function(t,e,n){return bt.apply(this,arguments)},wt=n(4),xt=n.n(wt),St={};function Et(t){t&&(t.value=!0)}function Ot(){}function kt(t){return void 0===t.size&&(t.size=t.__iterate(jt)),t.size}function At(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?kt(t)+e:e}function jt(){return!0}function It(t,e,n){return(0===t&&!zt(t)||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function Rt(t,e){return Tt(t,e,0)}function Ct(t,e){return Tt(t,e,e)}function Tt(t,e,n){return void 0===t?n:zt(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function zt(t){return t<0||0===t&&1/t==-1/0}function Mt(t){return Boolean(t&&t["@@__IMMUTABLE_ITERABLE__@@"])}function Dt(t){return Boolean(t&&t["@@__IMMUTABLE_KEYED__@@"])}function Lt(t){return Boolean(t&&t["@@__IMMUTABLE_INDEXED__@@"])}function Pt(t){return Dt(t)||Lt(t)}var qt=function(t){return Mt(t)?t:oe(t)},Ut=function(t){function e(t){return Dt(t)?t:ie(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(qt),Bt=function(t){function e(t){return Lt(t)?t:ae(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(qt),Nt=function(t){function e(t){return Mt(t)&&!Pt(t)?t:ue(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(qt);qt.Keyed=Ut,qt.Indexed=Bt,qt.Set=Nt;function Ft(t){return Boolean(t&&t["@@__IMMUTABLE_SEQ__@@"])}function Yt(t){return Boolean(t&&t["@@__IMMUTABLE_RECORD__@@"])}function Jt(t){return Mt(t)||Yt(t)}var Kt="@@__IMMUTABLE_ORDERED__@@";function Gt(t){return Boolean(t&&t[Kt])}var Wt="function"==typeof Symbol&&Symbol.iterator,Vt=Wt||"@@iterator",Ht=function(t){this.next=t};function Qt(t,e,n,r){var o=0===t?e:1===t?n:[e,n];return r?r.value=o:r={value:o,done:!1},r}function $t(){return{value:void 0,done:!0}}function Xt(t){return!!Array.isArray(t)||!!ee(t)}function Zt(t){return t&&"function"==typeof t.next}function te(t){var e=ee(t);return e&&e.call(t)}function ee(t){var e=t&&(Wt&&t[Wt]||t["@@iterator"]);if("function"==typeof e)return e}Ht.prototype.toString=function(){return"[Iterator]"},Ht.KEYS=0,Ht.VALUES=1,Ht.ENTRIES=2,Ht.prototype.inspect=Ht.prototype.toSource=function(){return this.toString()},Ht.prototype[Vt]=function(){return this};var ne=Object.prototype.hasOwnProperty;function re(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var oe=function(t){function e(t){return null==t?pe():Jt(t)?t.toSeq():function(t){var e=ye(t);if(e)return(r=ee(n=t))&&r===n.entries?e.fromEntrySeq():function(t){var e=ee(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var n,r;if("object"==typeof t)return new ce(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var n=this._cache;if(n){for(var r=n.length,o=0;o!==r;){var i=n[e?r-++o:o++];if(!1===t(i[1],i[0],this))break}return o}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var n=this._cache;if(n){var r=n.length,o=0;return new Ht((function(){if(o===r)return{value:void 0,done:!0};var i=n[e?r-++o:o++];return Qt(t,i[0],i[1])}))}return this.__iteratorUncached(t,e)},e}(qt),ie=function(t){function e(t){return null==t?pe().toKeyedSeq():Mt(t)?Dt(t)?t.toSeq():t.fromEntrySeq():Yt(t)?t.toSeq():he(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(oe),ae=function(t){function e(t){return null==t?pe():Mt(t)?Dt(t)?t.entrySeq():t.toIndexedSeq():Yt(t)?t.toSeq().entrySeq():de(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(oe),ue=function(t){function e(t){return(Mt(t)&&!Pt(t)?t:ae(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(oe);oe.isSeq=Ft,oe.Keyed=ie,oe.Set=ue,oe.Indexed=ae,oe.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var se=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[At(this,t)]:e},e.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length,o=0;o!==r;){var i=e?r-++o:o++;if(!1===t(n[i],i,this))break}return o},e.prototype.__iterator=function(t,e){var n=this._array,r=n.length,o=0;return new Ht((function(){if(o===r)return{value:void 0,done:!0};var i=e?r-++o:o++;return Qt(t,i,n[i])}))},e}(ae),ce=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return ne.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,o=r.length,i=0;i!==o;){var a=r[e?o-++i:i++];if(!1===t(n[a],a,this))break}return i},e.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,o=r.length,i=0;return new Ht((function(){if(i===o)return{value:void 0,done:!0};var a=r[e?o-++i:i++];return Qt(t,a,n[a])}))},e}(ie);ce.prototype[Kt]=!0;var fe,le=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=te(this._collection),r=0;if(Zt(n))for(var o;!(o=n.next()).done&&!1!==t(o.value,r++,this););return r},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=te(this._collection);if(!Zt(n))return new Ht($t);var r=0;return new Ht((function(){var e=n.next();return e.done?e:Qt(t,r++,e.value)}))},e}(ae);function pe(){return fe||(fe=new se([]))}function he(t){var e=ye(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new ce(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function de(t){var e=ye(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ye(t){return re(t)?new se(t):Xt(t)?new le(t):void 0}function ve(t){return Boolean(t&&t["@@__IMMUTABLE_MAP__@@"])}function _e(t){return ve(t)&&Gt(t)}function me(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function be(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(me(t)&&me(e)&&t.equals(e))}var ge="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var n=65535&(t|=0),r=65535&(e|=0);return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0};function we(t){return t>>>1&1073741824|3221225471&t}var xe=Object.prototype.valueOf;function Se(t){if(null==t)return Ee(t);if("function"==typeof t.hashCode)return we(t.hashCode(t));var e,n=(e=t).valueOf!==xe&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==n)return Ee(n);switch(typeof n){case"boolean":return n?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return we(e)}(n);case"string":return n.length>Me?function(t){var e=Pe[t];void 0===e&&(e=Oe(t),Le===De&&(Le=0,Pe={}),Le++,Pe[t]=e);return e}(n):Oe(n);case"object":case"function":return function(t){var e;if(Re&&void 0!==(e=Ie.get(t)))return e;if(void 0!==(e=t[ze]))return e;if(!Ae){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[ze]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=je(),Re)Ie.set(t,e);else{if(void 0!==ke&&!1===ke(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Ae)Object.defineProperty(t,ze,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[ze]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[ze]=e}}return e}(n);case"symbol":return function(t){var e=Ce[t];if(void 0!==e)return e;return e=je(),Ce[t]=e,e}(n);default:if("function"==typeof n.toString)return Oe(n.toString());throw new Error("Value type "+typeof n+" cannot be hashed.")}}function Ee(t){return null===t?1108378658:1108378659}function Oe(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return we(e)}var ke=Object.isExtensible,Ae=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function je(){var t=++Te;return 1073741824&Te&&(Te=0),t}var Ie,Re="function"==typeof WeakMap;Re&&(Ie=new WeakMap);var Ce=Object.create(null),Te=0,ze="__immutablehash__";"function"==typeof Symbol&&(ze=Symbol(ze));var Me=16,De=255,Le=0,Pe={},qe=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Je(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var n=this,r=Ye(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},e.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate((function(e,r){return t(e,r,n)}),e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(ie);qe.prototype[Kt]=!0;var Ue=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var n=this,r=0;return e&&kt(this),this._iter.__iterate((function(o){return t(o,e?n.size-++r:r++,n)}),e)},e.prototype.__iterator=function(t,e){var n=this,r=this._iter.__iterator(1,e),o=0;return e&&kt(this),new Ht((function(){var i=r.next();return i.done?i:Qt(t,e?n.size-++o:o++,i.value,i)}))},e}(ae),Be=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate((function(e){return t(e,e,n)}),e)},e.prototype.__iterator=function(t,e){var n=this._iter.__iterator(1,e);return new Ht((function(){var e=n.next();return e.done?e:Qt(t,e.value,e.value,e)}))},e}(ue),Ne=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate((function(e){if(e){en(e);var r=Mt(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}}),e)},e.prototype.__iterator=function(t,e){var n=this._iter.__iterator(1,e);return new Ht((function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){en(r);var o=Mt(r);return Qt(t,o?r.get(0):r[0],o?r.get(1):r[1],e)}}}))},e}(ie);function Fe(t){var e=rn(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=on,e.__iterateUncached=function(e,n){var r=this;return t.__iterate((function(t,n){return!1!==e(n,t,r)}),n)},e.__iteratorUncached=function(e,n){if(2===e){var r=t.__iterator(e,n);return new Ht((function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(1===e?0:1,n)},e}function Ye(t,e,n){var r=rn(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,o){var i=t.get(r,St);return i===St?o:e.call(n,i,r,t)},r.__iterateUncached=function(r,o){var i=this;return t.__iterate((function(t,o,a){return!1!==r(e.call(n,t,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=t.__iterator(2,o);return new Ht((function(){var o=i.next();if(o.done)return o;var a=o.value,u=a[0];return Qt(r,u,e.call(n,a[1],u,t),o)}))},r}function Je(t,e){var n=this,r=rn(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=Fe(t);return e.reverse=function(){return t.flip()},e}),r.get=function(n,r){return t.get(e?n:-1-n,r)},r.has=function(n){return t.has(e?n:-1-n)},r.includes=function(e){return t.includes(e)},r.cacheResult=on,r.__iterate=function(n,r){var o=this,i=0;return r&&kt(t),t.__iterate((function(t,a){return n(t,e?a:r?o.size-++i:i++,o)}),!r)},r.__iterator=function(r,o){var i=0;o&&kt(t);var a=t.__iterator(2,!o);return new Ht((function(){var t=a.next();if(t.done)return t;var u=t.value;return Qt(r,e?u[0]:o?n.size-++i:i++,u[1],t)}))},r}function Ke(t,e,n,r){var o=rn(t);return r&&(o.has=function(r){var o=t.get(r,St);return o!==St&&!!e.call(n,o,r,t)},o.get=function(r,o){var i=t.get(r,St);return i!==St&&e.call(n,i,r,t)?i:o}),o.__iterateUncached=function(o,i){var a=this,u=0;return t.__iterate((function(t,i,s){if(e.call(n,t,i,s))return u++,o(t,r?i:u-1,a)}),i),u},o.__iteratorUncached=function(o,i){var a=t.__iterator(2,i),u=0;return new Ht((function(){for(;;){var i=a.next();if(i.done)return i;var s=i.value,c=s[0],f=s[1];if(e.call(n,f,c,t))return Qt(o,r?c:u++,f,i)}}))},o}function Ge(t,e,n,r){var o=t.size;if(It(e,n,o))return t;var i=Rt(e,o),a=Ct(n,o);if(i!=i||a!=a)return Ge(t.toSeq().cacheResult(),e,n,r);var u,s=a-i;s==s&&(u=s<0?0:s);var c=rn(t);return c.size=0===u?u:t.size&&u||void 0,!r&&Ft(t)&&u>=0&&(c.get=function(e,n){return(e=At(this,e))>=0&&e<u?t.get(e+i,n):n}),c.__iterateUncached=function(e,n){var o=this;if(0===u)return 0;if(n)return this.cacheResult().__iterate(e,n);var a=0,s=!0,c=0;return t.__iterate((function(t,n){if(!s||!(s=a++<i))return c++,!1!==e(t,r?n:c-1,o)&&c!==u})),c},c.__iteratorUncached=function(e,n){if(0!==u&&n)return this.cacheResult().__iterator(e,n);if(0===u)return new Ht($t);var o=t.__iterator(e,n),a=0,s=0;return new Ht((function(){for(;a++<i;)o.next();if(++s>u)return{value:void 0,done:!0};var t=o.next();return r||1===e||t.done?t:Qt(e,s-1,0===e?void 0:t.value[1],t)}))},c}function We(t,e,n,r){var o=rn(t);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,s=0;return t.__iterate((function(t,i,c){if(!u||!(u=e.call(n,t,i,c)))return s++,o(t,r?i:s-1,a)})),s},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var u=t.__iterator(2,i),s=!0,c=0;return new Ht((function(){var t,i,f;do{if((t=u.next()).done)return r||1===o?t:Qt(o,c++,0===o?void 0:t.value[1],t);var l=t.value;i=l[0],f=l[1],s&&(s=e.call(n,f,i,a))}while(s);return 2===o?t:Qt(o,i,f,t)}))},o}function Ve(t,e){var n=Dt(t),r=[t].concat(e).map((function(t){return Mt(t)?n&&(t=Ut(t)):t=n?he(t):de(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===r.length)return t;if(1===r.length){var o=r[0];if(o===t||n&&Dt(o)||Lt(t)&&Lt(o))return o}var i=new se(r);return n?i=i.toKeyedSeq():Lt(t)||(i=i.toSetSeq()),(i=i.flatten(!0)).size=r.reduce((function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}}),0),i}function He(t,e,n){var r=rn(t);return r.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var a=0,u=!1;return function t(s,c){s.__iterate((function(i,s){return(!e||c<e)&&Mt(i)?t(i,c+1):(a++,!1===o(i,n?s:a-1,r)&&(u=!0)),!u}),i)}(t,0),a},r.__iteratorUncached=function(r,o){if(o)return this.cacheResult().__iterator(r,o);var i=t.__iterator(r,o),a=[],u=0;return new Ht((function(){for(;i;){var t=i.next();if(!1===t.done){var s=t.value;if(2===r&&(s=s[1]),e&&!(a.length<e)||!Mt(s))return n?t:Qt(r,u++,s,t);a.push(i),i=s.__iterator(r,o)}else i=a.pop()}return{value:void 0,done:!0}}))},r}function Qe(t,e,n){e||(e=an);var r=Dt(t),o=0,i=t.toSeq().map((function(e,r){return[r,e,o++,n?n(e,r,t):e]})).valueSeq().toArray();return i.sort((function(t,n){return e(t[3],n[3])||t[2]-n[2]})).forEach(r?function(t,e){i[e].length=2}:function(t,e){i[e]=t[1]}),r?ie(i):Lt(t)?ae(i):ue(i)}function $e(t,e,n){if(e||(e=an),n){var r=t.toSeq().map((function(e,r){return[e,n(e,r,t)]})).reduce((function(t,n){return Xe(e,t[1],n[1])?n:t}));return r&&r[0]}return t.reduce((function(t,n){return Xe(e,t,n)?n:t}))}function Xe(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(null==n||n!=n)||r>0}function Ze(t,e,n,r){var o=rn(t),i=new se(n).map((function(t){return t.size}));return o.size=r?i.max():i.min(),o.__iterate=function(t,e){for(var n,r=this.__iterator(1,e),o=0;!(n=r.next()).done&&!1!==t(n.value,o++,this););return o},o.__iteratorUncached=function(t,o){var i=n.map((function(t){return t=qt(t),te(o?t.reverse():t)})),a=0,u=!1;return new Ht((function(){var n;return u||(n=i.map((function(t){return t.next()})),u=r?n.every((function(t){return t.done})):n.some((function(t){return t.done}))),u?{value:void 0,done:!0}:Qt(t,a++,e.apply(null,n.map((function(t){return t.value}))))}))},o}function tn(t,e){return t===e?t:Ft(t)?e:t.constructor(e)}function en(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function nn(t){return Dt(t)?Ut:Lt(t)?Bt:Nt}function rn(t){return Object.create((Dt(t)?ie:Lt(t)?ae:ue).prototype)}function on(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):oe.prototype.cacheResult.call(this)}function an(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t<e?-1:0}function un(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),o=0;o<n;o++)r[o]=t[o+e];return r}function sn(t,e){if(!t)throw new Error(e)}function cn(t){sn(t!==1/0,"Cannot perform this action with an infinite size.")}function fn(t){if(re(t)&&"string"!=typeof t)return t;if(Gt(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}Ue.prototype.cacheResult=qe.prototype.cacheResult=Be.prototype.cacheResult=Ne.prototype.cacheResult=on;var ln=Object.prototype.toString;function pn(t){if(!t||"object"!=typeof t||"[object Object]"!==ln.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e,r=Object.getPrototypeOf(e);null!==r;)n=r,r=Object.getPrototypeOf(n);return n===e}function hn(t){return"object"==typeof t&&(Jt(t)||Array.isArray(t)||pn(t))}function dn(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function yn(t,e){return Jt(t)?t.has(e):hn(t)&&ne.call(t,e)}function vn(t,e,n){return Jt(t)?t.get(e,n):yn(t,e)?"function"==typeof t.get?t.get(e):t[e]:n}function _n(t){if(Array.isArray(t))return un(t);var e={};for(var n in t)ne.call(t,n)&&(e[n]=t[n]);return e}function mn(t,e){if(!hn(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Jt(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!ne.call(t,e))return t;var n=_n(t);return Array.isArray(n)?n.splice(e,1):delete n[e],n}function bn(t,e,n){if(!hn(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(Jt(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,n)}if(ne.call(t,e)&&n===t[e])return t;var r=_n(t);return r[e]=n,r}function gn(t,e,n,r){r||(r=n,n=void 0);var o=function t(e,n,r,o,i,a){var u=n===St;if(o===r.length){var s=u?i:n,c=a(s);return c===s?n:c}if(!u&&!hn(n))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,o).map(dn)+"]: "+n);var f=r[o],l=u?St:vn(n,f,St),p=t(l===St?e:Jt(l),l,r,o+1,i,a);return p===l?n:p===St?mn(n,f):bn(u?e?Zn():{}:n,f,p)}(Jt(t),t,fn(e),0,n,r);return o===St?n:o}function wn(t,e,n){return gn(t,e,St,(function(){return n}))}function xn(t,e){return wn(this,t,e)}function Sn(t,e){return gn(t,e,(function(){return St}))}function En(t){return Sn(this,t)}function On(t,e,n,r){return gn(t,[e],n,r)}function kn(t,e,n){return 1===arguments.length?t(this):On(this,t,e,n)}function An(t,e,n){return gn(this,t,e,n)}function jn(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Rn(this,t)}function In(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Rn(this,e,t)}function Rn(t,e,n){for(var r=[],o=0;o<e.length;o++){var i=Ut(e[o]);0!==i.size&&r.push(i)}return 0===r.length?t:0!==t.toSeq().size||t.__ownerID||1!==r.length?t.withMutations((function(t){for(var e=n?function(e,r){On(t,r,St,(function(t){return t===St?e:n(t,e,r)}))}:function(e,n){t.set(n,e)},o=0;o<r.length;o++)r[o].forEach(e)})):t.constructor(r[0])}function Cn(t,e,n){return Tn(t,e,function(t){return function e(n,r,o){return hn(n)&&hn(r)&&(i=r,a=oe(n),u=oe(i),Lt(a)===Lt(u)&&Dt(a)===Dt(u))?Tn(n,[r],e):t?t(n,r,o):r;var i,a,u}}(n))}function Tn(t,e,n){if(!hn(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(Jt(t))return"function"==typeof n&&t.mergeWith?t.mergeWith.apply(t,[n].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var r=Array.isArray(t),o=t,i=r?Bt:Ut,a=r?function(e){o===t&&(o=_n(o)),o.push(e)}:function(e,r){var i=ne.call(o,r),a=i&&n?n(o[r],e,r):e;i&&a===o[r]||(o===t&&(o=_n(o)),o[r]=a)},u=0;u<e.length;u++)i(e[u]).forEach(a);return o}function zn(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Cn(this,t)}function Mn(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return Cn(this,e,t)}function Dn(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return gn(this,t,Zn(),(function(t){return Tn(t,e)}))}function Ln(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return gn(this,t,Zn(),(function(t){return Cn(t,e)}))}function Pn(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function qn(){return this.__ownerID?this:this.__ensureOwner(new Ot)}function Un(){return this.__ensureOwner()}function Bn(){return this.__altered}var Nn=function(t){function e(e){return null==e?Zn():ve(e)&&!Gt(e)?e:Zn().withMutations((function(n){var r=t(e);cn(r.size),r.forEach((function(t,e){return n.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Zn().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return tr(this,t,e)},e.prototype.remove=function(t){return tr(this,t,St)},e.prototype.deleteAll=function(t){var e=qt(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Zn()},e.prototype.sort=function(t){return Er(Qe(this,t))},e.prototype.sortBy=function(t,e){return Er(Qe(this,e,t))},e.prototype.map=function(t,e){var n=this;return this.withMutations((function(r){r.forEach((function(o,i){r.set(i,t.call(e,o,i,n))}))}))},e.prototype.__iterator=function(t,e){return new Hn(this,t,e)},e.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate((function(e){return r++,t(e[1],e[0],n)}),e),r},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Xn(this.size,this._root,t,this.__hash):0===this.size?Zn():(this.__ownerID=t,this.__altered=!1,this)},e}(Ut);Nn.isMap=ve;var Fn=Nn.prototype;Fn["@@__IMMUTABLE_MAP__@@"]=!0,Fn.delete=Fn.remove,Fn.removeAll=Fn.deleteAll,Fn.setIn=xn,Fn.removeIn=Fn.deleteIn=En,Fn.update=kn,Fn.updateIn=An,Fn.merge=Fn.concat=jn,Fn.mergeWith=In,Fn.mergeDeep=zn,Fn.mergeDeepWith=Mn,Fn.mergeIn=Dn,Fn.mergeDeepIn=Ln,Fn.withMutations=Pn,Fn.wasAltered=Bn,Fn.asImmutable=Un,Fn["@@transducer/init"]=Fn.asMutable=qn,Fn["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Fn["@@transducer/result"]=function(t){return t.asImmutable()};var Yn=function(t,e){this.ownerID=t,this.entries=e};Yn.prototype.get=function(t,e,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(be(n,o[i][0]))return o[i][1];return r},Yn.prototype.update=function(t,e,n,r,o,i,a){for(var u=o===St,s=this.entries,c=0,f=s.length;c<f&&!be(r,s[c][0]);c++);var l=c<f;if(l?s[c][1]===o:u)return this;if(Et(a),(u||!l)&&Et(i),!u||1!==s.length){if(!l&&!u&&s.length>=ar)return function(t,e,n,r){t||(t=new Ot);for(var o=new Wn(t,Se(n),[n,r]),i=0;i<e.length;i++){var a=e[i];o=o.update(t,0,void 0,a[0],a[1])}return o}(t,s,r,o);var p=t&&t===this.ownerID,h=p?s:un(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Yn(t,h)}};var Jn=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n};Jn.prototype.get=function(t,e,n,r){void 0===e&&(e=Se(n));var o=1<<(31&(0===t?e:e>>>t)),i=this.bitmap;return 0==(i&o)?r:this.nodes[or(i&o-1)].get(t+5,e,n,r)},Jn.prototype.update=function(t,e,n,r,o,i,a){void 0===n&&(n=Se(r));var u=31&(0===e?n:n>>>e),s=1<<u,c=this.bitmap,f=0!=(c&s);if(!f&&o===St)return this;var l=or(c&s-1),p=this.nodes,h=f?p[l]:void 0,d=er(h,t,e+5,n,r,o,i,a);if(d===h)return this;if(!f&&d&&p.length>=ur)return function(t,e,n,r,o){for(var i=0,a=new Array(32),u=0;0!==n;u++,n>>>=1)a[u]=1&n?e[i++]:void 0;return a[r]=o,new Kn(t,i+1,a)}(t,p,c,u,d);if(f&&!d&&2===p.length&&nr(p[1^l]))return p[1^l];if(f&&d&&1===p.length&&nr(d))return d;var y=t&&t===this.ownerID,v=f?d?c:c^s:c|s,_=f?d?ir(p,l,d,y):function(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var o=new Array(r),i=0,a=0;a<r;a++)a===e&&(i=1),o[a]=t[a+i];return o}(p,l,y):function(t,e,n,r){var o=t.length+1;if(r&&e+1===o)return t[e]=n,t;for(var i=new Array(o),a=0,u=0;u<o;u++)u===e?(i[u]=n,a=-1):i[u]=t[u+a];return i}(p,l,d,y);return y?(this.bitmap=v,this.nodes=_,this):new Jn(t,v,_)};var Kn=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n};Kn.prototype.get=function(t,e,n,r){void 0===e&&(e=Se(n));var o=31&(0===t?e:e>>>t),i=this.nodes[o];return i?i.get(t+5,e,n,r):r},Kn.prototype.update=function(t,e,n,r,o,i,a){void 0===n&&(n=Se(r));var u=31&(0===e?n:n>>>e),s=o===St,c=this.nodes,f=c[u];if(s&&!f)return this;var l=er(f,t,e+5,n,r,o,i,a);if(l===f)return this;var p=this.count;if(f){if(!l&&--p<sr)return function(t,e,n,r){for(var o=0,i=0,a=new Array(n),u=0,s=1,c=e.length;u<c;u++,s<<=1){var f=e[u];void 0!==f&&u!==r&&(o|=s,a[i++]=f)}return new Jn(t,o,a)}(t,c,p,u)}else p++;var h=t&&t===this.ownerID,d=ir(c,u,l,h);return h?(this.count=p,this.nodes=d,this):new Kn(t,p,d)};var Gn=function(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n};Gn.prototype.get=function(t,e,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(be(n,o[i][0]))return o[i][1];return r},Gn.prototype.update=function(t,e,n,r,o,i,a){void 0===n&&(n=Se(r));var u=o===St;if(n!==this.keyHash)return u?this:(Et(a),Et(i),rr(this,t,e,n,[r,o]));for(var s=this.entries,c=0,f=s.length;c<f&&!be(r,s[c][0]);c++);var l=c<f;if(l?s[c][1]===o:u)return this;if(Et(a),(u||!l)&&Et(i),u&&2===f)return new Wn(t,this.keyHash,s[1^c]);var p=t&&t===this.ownerID,h=p?s:un(s);return l?u?c===f-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Gn(t,this.keyHash,h)};var Wn=function(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n};Wn.prototype.get=function(t,e,n,r){return be(n,this.entry[0])?this.entry[1]:r},Wn.prototype.update=function(t,e,n,r,o,i,a){var u=o===St,s=be(r,this.entry[0]);return(s?o===this.entry[1]:u)?this:(Et(a),u?void Et(i):s?t&&t===this.ownerID?(this.entry[1]=o,this):new Wn(t,this.keyHash,[r,o]):(Et(i),rr(this,t,e,Se(r),[r,o])))},Yn.prototype.iterate=Gn.prototype.iterate=function(t,e){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===t(n[e?o-r:r]))return!1},Jn.prototype.iterate=Kn.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[e?o-r:r];if(i&&!1===i.iterate(t,e))return!1}},Wn.prototype.iterate=function(t,e){return t(this.entry)};var Vn,Hn=function(t){function e(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&$n(t._root)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n=e.node,r=e.index++,o=void 0;if(n.entry){if(0===r)return Qn(t,n.entry)}else if(n.entries){if(r<=(o=n.entries.length-1))return Qn(t,n.entries[this._reverse?o-r:r])}else if(r<=(o=n.nodes.length-1)){var i=n.nodes[this._reverse?o-r:r];if(i){if(i.entry)return Qn(t,i.entry);e=this._stack=$n(i,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(Ht);function Qn(t,e){return Qt(t,e[0],e[1])}function $n(t,e){return{node:t,index:0,__prev:e}}function Xn(t,e,n,r){var o=Object.create(Fn);return o.size=t,o._root=e,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Zn(){return Vn||(Vn=Xn(0))}function tr(t,e,n){var r,o;if(t._root){var i={value:!1},a={value:!1};if(r=er(t._root,t.__ownerID,0,void 0,e,n,i,a),!a.value)return t;o=t.size+(i.value?n===St?-1:1:0)}else{if(n===St)return t;o=1,r=new Yn(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=o,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Xn(o,r):Zn()}function er(t,e,n,r,o,i,a,u){return t?t.update(e,n,r,o,i,a,u):i===St?t:(Et(u),Et(a),new Wn(e,r,[o,i]))}function nr(t){return t.constructor===Wn||t.constructor===Gn}function rr(t,e,n,r,o){if(t.keyHash===r)return new Gn(e,r,[t.entry,o]);var i,a=31&(0===n?t.keyHash:t.keyHash>>>n),u=31&(0===n?r:r>>>n),s=a===u?[rr(t,e,n+5,r,o)]:(i=new Wn(e,r,o),a<u?[t,i]:[i,t]);return new Jn(e,1<<a|1<<u,s)}function or(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function ir(t,e,n,r){var o=r?t:un(t);return o[e]=n,o}var ar=8,ur=16,sr=8;function cr(t){return Boolean(t&&t["@@__IMMUTABLE_LIST__@@"])}var fr=function(t){function e(e){var n=_r();if(null==e)return n;if(cr(e))return e;var r=t(e),o=r.size;return 0===o?n:(cn(o),o>0&&o<32?vr(0,o,5,null,new pr(r.toArray())):n.withMutations((function(t){t.setSize(o),r.forEach((function(e,n){return t.set(n,e)}))})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,e){if((t=At(this,t))>=0&&t<this.size){var n=gr(this,t+=this._origin);return n&&n.array[31&t]}return e},e.prototype.set=function(t,e){return function(t,e,n){if((e=At(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?wr(t,e).set(0,n):wr(t,0,e+1).set(e,n)}));e+=t._origin;var r=t._tail,o=t._root,i={value:!1};e>=xr(t._capacity)?r=mr(r,t.__ownerID,0,e,n,i):o=mr(o,t.__ownerID,t._level,e,n,i);if(!i.value)return t;if(t.__ownerID)return t._root=o,t._tail=r,t.__hash=void 0,t.__altered=!0,t;return vr(t._origin,t._capacity,t._level,o,r)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):_r()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(n){wr(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])}))},e.prototype.pop=function(){return wr(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){wr(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])}))},e.prototype.shift=function(){return wr(this,1)},e.prototype.concat=function(){for(var e=arguments,n=[],r=0;r<arguments.length;r++){var o=e[r],i=t("string"!=typeof o&&Xt(o)?o:[o]);0!==i.size&&n.push(i)}return 0===n.length?this:0!==this.size||this.__ownerID||1!==n.length?this.withMutations((function(t){n.forEach((function(e){return e.forEach((function(e){return t.push(e)}))}))})):this.constructor(n[0])},e.prototype.setSize=function(t){return wr(this,0,t)},e.prototype.map=function(t,e){var n=this;return this.withMutations((function(r){for(var o=0;o<n.size;o++)r.set(o,t.call(e,r.get(o),o,n))}))},e.prototype.slice=function(t,e){var n=this.size;return It(t,e,n)?this:wr(this,Rt(t,n),Ct(e,n))},e.prototype.__iterator=function(t,e){var n=e?this.size:0,r=yr(this,e);return new Ht((function(){var o=r();return o===dr?{value:void 0,done:!0}:Qt(t,e?--n:n++,o)}))},e.prototype.__iterate=function(t,e){for(var n,r=e?this.size:0,o=yr(this,e);(n=o())!==dr&&!1!==t(n,e?--r:r++,this););return r},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?vr(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?_r():(this.__ownerID=t,this.__altered=!1,this)},e}(Bt);fr.isList=cr;var lr=fr.prototype;lr["@@__IMMUTABLE_LIST__@@"]=!0,lr.delete=lr.remove,lr.merge=lr.concat,lr.setIn=xn,lr.deleteIn=lr.removeIn=En,lr.update=kn,lr.updateIn=An,lr.mergeIn=Dn,lr.mergeDeepIn=Ln,lr.withMutations=Pn,lr.wasAltered=Bn,lr.asImmutable=Un,lr["@@transducer/init"]=lr.asMutable=qn,lr["@@transducer/step"]=function(t,e){return t.push(e)},lr["@@transducer/result"]=function(t){return t.asImmutable()};var pr=function(t,e){this.array=t,this.ownerID=e};pr.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&31;if(r>=this.array.length)return new pr([],t);var o,i=0===r;if(e>0){var a=this.array[r];if((o=a&&a.removeBefore(t,e-5,n))===a&&i)return this}if(i&&!o)return this;var u=br(this,t);if(!i)for(var s=0;s<r;s++)u.array[s]=void 0;return o&&(u.array[r]=o),u},pr.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r,o=n-1>>>e&31;if(o>=this.array.length)return this;if(e>0){var i=this.array[o];if((r=i&&i.removeAfter(t,e-5,n))===i&&o===this.array.length-1)return this}var a=br(this,t);return a.array.splice(o+1),r&&(a.array[o]=r),a};var hr,dr={};function yr(t,e){var n=t._origin,r=t._capacity,o=xr(r),i=t._tail;return a(t._root,t._level,0);function a(t,u,s){return 0===u?function(t,a){var u=a===o?i&&i.array:t&&t.array,s=a>n?0:n-a,c=r-a;c>32&&(c=32);return function(){if(s===c)return dr;var t=e?--c:s++;return u&&u[t]}}(t,s):function(t,o,i){var u,s=t&&t.array,c=i>n?0:n-i>>o,f=1+(r-i>>o);f>32&&(f=32);return function(){for(;;){if(u){var t=u();if(t!==dr)return t;u=null}if(c===f)return dr;var n=e?--f:c++;u=a(s&&s[n],o-5,i+(n<<o))}}}(t,u,s)}}function vr(t,e,n,r,o,i,a){var u=Object.create(lr);return u.size=e-t,u._origin=t,u._capacity=e,u._level=n,u._root=r,u._tail=o,u.__ownerID=i,u.__hash=a,u.__altered=!1,u}function _r(){return hr||(hr=vr(0,0,5))}function mr(t,e,n,r,o,i){var a,u=r>>>n&31,s=t&&u<t.array.length;if(!s&&void 0===o)return t;if(n>0){var c=t&&t.array[u],f=mr(c,e,n-5,r,o,i);return f===c?t:((a=br(t,e)).array[u]=f,a)}return s&&t.array[u]===o?t:(i&&Et(i),a=br(t,e),void 0===o&&u===a.array.length-1?a.array.pop():a.array[u]=o,a)}function br(t,e){return e&&t&&e===t.ownerID?t:new pr(t?t.array.slice():[],e)}function gr(t,e){if(e>=xr(t._capacity))return t._tail;if(e<1<<t._level+5){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&31],r-=5;return n}}function wr(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new Ot,o=t._origin,i=t._capacity,a=o+e,u=void 0===n?i:n<0?i+n:o+n;if(a===o&&u===i)return t;if(a>=u)return t.clear();for(var s=t._level,c=t._root,f=0;a+f<0;)c=new pr(c&&c.array.length?[void 0,c]:[],r),f+=1<<(s+=5);f&&(a+=f,o+=f,u+=f,i+=f);for(var l=xr(i),p=xr(u);p>=1<<s+5;)c=new pr(c&&c.array.length?[c]:[],r),s+=5;var h=t._tail,d=p<l?gr(t,u-1):p>l?new pr([],r):h;if(h&&p>l&&a<i&&h.array.length){for(var y=c=br(c,r),v=s;v>5;v-=5){var _=l>>>v&31;y=y.array[_]=br(y.array[_],r)}y.array[l>>>5&31]=h}if(u<i&&(d=d&&d.removeAfter(r,0,u)),a>=p)a-=p,u-=p,s=5,c=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p<l){for(f=0;c;){var m=a>>>s&31;if(m!==p>>>s&31)break;m&&(f+=(1<<s)*m),s-=5,c=c.array[m]}c&&a>o&&(c=c.removeBefore(r,s,a-f)),c&&p<l&&(c=c.removeAfter(r,s,p-f)),f&&(a-=f,u-=f)}return t.__ownerID?(t.size=u-a,t._origin=a,t._capacity=u,t._level=s,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):vr(a,u,s,c,d)}function xr(t){return t<32?0:t-1>>>5<<5}var Sr,Er=function(t){function e(t){return null==t?kr():_e(t)?t:kr().withMutations((function(e){var n=Ut(t);cn(n.size),n.forEach((function(t,n){return e.set(n,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):kr()},e.prototype.set=function(t,e){return Ar(this,t,e)},e.prototype.remove=function(t){return Ar(this,t,St)},e.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],n)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Or(e,n,t,this.__hash):0===this.size?kr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=n,this)},e}(Nn);function Or(t,e,n,r){var o=Object.create(Er.prototype);return o.size=t?t.size:0,o._map=t,o._list=e,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function kr(){return Sr||(Sr=Or(Zn(),_r()))}function Ar(t,e,n){var r,o,i=t._map,a=t._list,u=i.get(e),s=void 0!==u;if(n===St){if(!s)return t;a.size>=32&&a.size>=2*i.size?(r=(o=a.filter((function(t,e){return void 0!==t&&u!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(r.__ownerID=o.__ownerID=t.__ownerID)):(r=i.remove(e),o=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(n===a.get(u)[1])return t;r=i,o=a.set(u,[e,n])}else r=i.set(e,a.size),o=a.set(a.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=o,t.__hash=void 0,t.__altered=!0,t):Or(r,o)}Er.isOrderedMap=_e,Er.prototype[Kt]=!0,Er.prototype.delete=Er.prototype.remove;function jr(t){return Boolean(t&&t["@@__IMMUTABLE_STACK__@@"])}var Ir=function(t){function e(t){return null==t?zr():jr(t)?t:zr().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var n=this._head;for(t=At(this,t);n&&t--;)n=n.next;return n?n.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:t[r],next:n};return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Tr(e,n)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&jr(e))return e;cn(e.size);var n=this.size,r=this._head;return e.__iterate((function(t){n++,r={value:t,next:r}}),!0),this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):Tr(n,r)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):zr()},e.prototype.slice=function(e,n){if(It(e,n,this.size))return this;var r=Rt(e,this.size);if(Ct(n,this.size)!==this.size)return t.prototype.slice.call(this,e,n);for(var o=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):Tr(o,i)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Tr(this.size,this._head,t,this.__hash):0===this.size?zr():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var n=this;if(e)return new se(this.toArray()).__iterate((function(e,r){return t(e,r,n)}),e);for(var r=0,o=this._head;o&&!1!==t(o.value,r++,this);)o=o.next;return r},e.prototype.__iterator=function(t,e){if(e)return new se(this.toArray()).__iterator(t,e);var n=0,r=this._head;return new Ht((function(){if(r){var e=r.value;return r=r.next,Qt(t,n++,e)}return{value:void 0,done:!0}}))},e}(Bt);Ir.isStack=jr;var Rr,Cr=Ir.prototype;function Tr(t,e,n,r){var o=Object.create(Cr);return o.size=t,o._head=e,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function zr(){return Rr||(Rr=Tr(0))}Cr["@@__IMMUTABLE_STACK__@@"]=!0,Cr.shift=Cr.pop,Cr.unshift=Cr.push,Cr.unshiftAll=Cr.pushAll,Cr.withMutations=Pn,Cr.wasAltered=Bn,Cr.asImmutable=Un,Cr["@@transducer/init"]=Cr.asMutable=qn,Cr["@@transducer/step"]=function(t,e){return t.unshift(e)},Cr["@@transducer/result"]=function(t){return t.asImmutable()};function Mr(t){return Boolean(t&&t["@@__IMMUTABLE_SET__@@"])}function Dr(t){return Mr(t)&&Gt(t)}function Lr(t,e){if(t===e)return!0;if(!Mt(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||Dt(t)!==Dt(e)||Lt(t)!==Lt(e)||Gt(t)!==Gt(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!Pt(t);if(Gt(t)){var r=t.entries();return e.every((function(t,e){var o=r.next().value;return o&&be(o[1],t)&&(n||be(o[0],e))}))&&r.next().done}var o=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{o=!0;var i=t;t=e,e=i}var a=!0,u=e.__iterate((function(e,r){if(n?!t.has(e):o?!be(e,t.get(r,St)):!be(t.get(r,St),e))return a=!1,!1}));return a&&t.size===u}function Pr(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function qr(t){if(!t||"object"!=typeof t)return t;if(!Mt(t)){if(!hn(t))return t;t=oe(t)}if(Dt(t)){var e={};return t.__iterate((function(t,n){e[n]=qr(t)})),e}var n=[];return t.__iterate((function(t){n.push(qr(t))})),n}var Ur=function(t){function e(e){return null==e?Jr():Mr(e)&&!Gt(e)?e:Jr().withMutations((function(n){var r=t(e);cn(r.size),r.forEach((function(t){return n.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Ut(t).keySeq())},e.intersect=function(t){return(t=qt(t).toArray()).length?Nr.intersect.apply(e(t.pop()),t):Jr()},e.union=function(t){return(t=qt(t).toArray()).length?Nr.union.apply(e(t.pop()),t):Jr()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Fr(this,this._map.set(t,t))},e.prototype.remove=function(t){return Fr(this,this._map.remove(t))},e.prototype.clear=function(){return Fr(this,this._map.clear())},e.prototype.map=function(t,e){var n=this,r=!1,o=Fr(this,this._map.mapEntries((function(o){var i=o[1],a=t.call(e,i,i,n);return a!==i&&(r=!0),[a,a]}),e));return r?o:this},e.prototype.union=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(n){for(var r=0;r<e.length;r++)t(e[r]).forEach((function(t){return n.add(t)}))})):this.constructor(e[0])},e.prototype.intersect=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var r=[];return this.forEach((function(t){e.every((function(e){return e.includes(t)}))||r.push(t)})),this.withMutations((function(t){r.forEach((function(e){t.remove(e)}))}))},e.prototype.subtract=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var r=[];return this.forEach((function(t){e.some((function(e){return e.includes(t)}))&&r.push(t)})),this.withMutations((function(t){r.forEach((function(e){t.remove(e)}))}))},e.prototype.sort=function(t){return co(Qe(this,t))},e.prototype.sortBy=function(t,e){return co(Qe(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate((function(e){return t(e,e,n)}),e)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(Nt);Ur.isSet=Mr;var Br,Nr=Ur.prototype;function Fr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Yr(t,e){var n=Object.create(Nr);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Jr(){return Br||(Br=Yr(Zn()))}Nr["@@__IMMUTABLE_SET__@@"]=!0,Nr.delete=Nr.remove,Nr.merge=Nr.concat=Nr.union,Nr.withMutations=Pn,Nr.asImmutable=Un,Nr["@@transducer/init"]=Nr.asMutable=qn,Nr["@@transducer/step"]=function(t,e){return t.add(e)},Nr["@@transducer/result"]=function(t){return t.asImmutable()},Nr.__empty=Jr,Nr.__make=Yr;var Kr,Gr=function(t){function e(t,n,r){if(!(this instanceof e))return new e(t,n,r);if(sn(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===n&&(n=1/0),r=void 0===r?1:Math.abs(r),n<t&&(r=-r),this._start=t,this._end=n,this._step=r,this.size=Math.max(0,Math.ceil((n-t)/r-1)+1),0===this.size){if(Kr)return Kr;Kr=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},e.prototype.get=function(t,e){return this.has(t)?this._start+At(this,t)*this._step:e},e.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},e.prototype.slice=function(t,n){return It(t,n,this.size)?this:(t=Rt(t,this.size),(n=Ct(n,this.size))<=t?new e(0,0):new e(this.get(t,this._end),this.get(n,this._end),this._step))},e.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,e){for(var n=this.size,r=this._step,o=e?this._start+(n-1)*r:this._start,i=0;i!==n&&!1!==t(o,e?n-++i:i++,this);)o+=e?-r:r;return i},e.prototype.__iterator=function(t,e){var n=this.size,r=this._step,o=e?this._start+(n-1)*r:this._start,i=0;return new Ht((function(){if(i===n)return{value:void 0,done:!0};var a=o;return o+=e?-r:r,Qt(t,e?n-++i:i++,a)}))},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:Lr(this,t)},e}(ae);function Wr(t,e,n){for(var r=fn(e),o=0;o!==r.length;)if((t=vn(t,r[o++],St))===St)return n;return t}function Vr(t,e){return Wr(this,t,e)}function Hr(t,e){return Wr(t,e,St)!==St}function Qr(){cn(this.size);var t={};return this.__iterate((function(e,n){t[n]=e})),t}qt.isIterable=Mt,qt.isKeyed=Dt,qt.isIndexed=Lt,qt.isAssociative=Pt,qt.isOrdered=Gt,qt.Iterator=Ht,Pr(qt,{toArray:function(){cn(this.size);var t=new Array(this.size||0),e=Dt(this),n=0;return this.__iterate((function(r,o){t[n++]=e?[o,r]:r})),t},toIndexedSeq:function(){return new Ue(this)},toJS:function(){return qr(this)},toKeyedSeq:function(){return new qe(this,!0)},toMap:function(){return Nn(this.toKeyedSeq())},toObject:Qr,toOrderedMap:function(){return Er(this.toKeyedSeq())},toOrderedSet:function(){return co(Dt(this)?this.valueSeq():this)},toSet:function(){return Ur(Dt(this)?this.valueSeq():this)},toSetSeq:function(){return new Be(this)},toSeq:function(){return Lt(this)?this.toIndexedSeq():Dt(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ir(Dt(this)?this.valueSeq():this)},toList:function(){return fr(Dt(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return tn(this,Ve(this,t))},includes:function(t){return this.some((function(e){return be(e,t)}))},entries:function(){return this.__iterator(2)},every:function(t,e){cn(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!t.call(e,r,o,i))return n=!1,!1})),n},filter:function(t,e){return tn(this,Ke(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return cn(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){cn(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate((function(r){n?n=!1:e+=t,e+=null!=r?r.toString():""})),e},keys:function(){return this.__iterator(0)},map:function(t,e){return tn(this,Ye(this,t,e))},reduce:function(t,e,n){return eo(this,t,e,n,arguments.length<2,!1)},reduceRight:function(t,e,n){return eo(this,t,e,n,arguments.length<2,!0)},reverse:function(){return tn(this,Je(this,!0))},slice:function(t,e){return tn(this,Ge(this,t,e,!0))},some:function(t,e){return!this.every(oo(t),e)},sort:function(t){return tn(this,Qe(this,t))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return kt(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,n){var r=Nn().asMutable();return t.__iterate((function(o,i){r.update(e.call(n,o,i,t),0,(function(t){return t+1}))})),r.asImmutable()}(this,t,e)},equals:function(t){return Lr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new se(t._cache);var e=t.toSeq().map(ro).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(oo(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate((function(n,o,i){if(t.call(e,n,o,i))return r=[o,n],!1})),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(jt,null,t)},flatMap:function(t,e){return tn(this,function(t,e,n){var r=nn(t);return t.toSeq().map((function(o,i){return r(e.call(n,o,i,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return tn(this,He(this,t,!0))},fromEntrySeq:function(){return new Ne(this)},get:function(t,e){return this.find((function(e,n){return be(n,t)}),void 0,e)},getIn:Vr,groupBy:function(t,e){return function(t,e,n){var r=Dt(t),o=(Gt(t)?Er():Nn()).asMutable();t.__iterate((function(i,a){o.update(e.call(n,i,a,t),(function(t){return(t=t||[]).push(r?[a,i]:i),t}))}));var i=nn(t);return o.map((function(e){return tn(t,i(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,St)!==St},hasIn:function(t){return Hr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:qt(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:qt(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return be(e,t)}))},keySeq:function(){return this.toSeq().map(no).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return $e(this,t)},maxBy:function(t,e){return $e(this,e,t)},min:function(t){return $e(this,t?io(t):uo)},minBy:function(t,e){return $e(this,e?io(e):uo,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return tn(this,We(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(oo(t),e)},sortBy:function(t,e){return tn(this,Qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return tn(this,function(t,e,n){var r=rn(t);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return t.__iterate((function(t,o,u){return e.call(n,t,o,u)&&++a&&r(t,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=t.__iterator(2,o),u=!0;return new Ht((function(){if(!u)return{value:void 0,done:!0};var t=a.next();if(t.done)return t;var o=t.value,s=o[0],c=o[1];return e.call(n,c,s,i)?2===r?t:Qt(r,s,c,t):(u=!1,{value:void 0,done:!0})}))},r}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(oo(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=Gt(t),n=Dt(t),r=e?1:0;return function(t,e){return e=ge(e,3432918353),e=ge(e<<15|e>>>-15,461845907),e=ge(e<<13|e>>>-13,5),e=ge((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=we((e=ge(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+so(Se(t),Se(e))|0}:function(t,e){r=r+so(Se(t),Se(e))|0}:e?function(t){r=31*r+Se(t)|0}:function(t){r=r+Se(t)|0}),r)}(this))}});var $r=qt.prototype;$r["@@__IMMUTABLE_ITERABLE__@@"]=!0,$r[Vt]=$r.values,$r.toJSON=$r.toArray,$r.__toStringMapper=dn,$r.inspect=$r.toSource=function(){return this.toString()},$r.chain=$r.flatMap,$r.contains=$r.includes,Pr(Ut,{flip:function(){return tn(this,Fe(this))},mapEntries:function(t,e){var n=this,r=0;return tn(this,this.toSeq().map((function(o,i){return t.call(e,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(t,e){var n=this;return tn(this,this.toSeq().flip().map((function(r,o){return t.call(e,r,o,n)})).flip())}});var Xr=Ut.prototype;Xr["@@__IMMUTABLE_KEYED__@@"]=!0,Xr[Vt]=$r.entries,Xr.toJSON=Qr,Xr.__toStringMapper=function(t,e){return dn(e)+": "+dn(t)},Pr(Bt,{toKeyedSeq:function(){return new qe(this,!1)},filter:function(t,e){return tn(this,Ke(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return tn(this,Je(this,!1))},slice:function(t,e){return tn(this,Ge(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(e||0,0),0===n||2===n&&!e)return this;t=Rt(t,t<0?this.count():this.size);var r=this.slice(0,t);return tn(this,1===n?r:r.concat(un(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return tn(this,He(this,t,!1))},get:function(t,e){return(t=At(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,n){return n===t}),void 0,e)},has:function(t){return(t=At(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return tn(this,function(t,e){var n=rn(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return t.__iterate((function(t){return(!i||!1!==n(e,i++,o))&&!1!==n(t,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=t.__iterator(1,r),a=0;return new Ht((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?Qt(n,a++,e):Qt(n,a++,o.value,o)}))},n}(this,t))},interleave:function(){var t=[this].concat(un(arguments)),e=Ze(this.toSeq(),ae.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),tn(this,n)},keySeq:function(){return Gr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return tn(this,We(this,t,e,!1))},zip:function(){var t=[this].concat(un(arguments));return tn(this,Ze(this,ao,t))},zipAll:function(){var t=[this].concat(un(arguments));return tn(this,Ze(this,ao,t,!0))},zipWith:function(t){var e=un(arguments);return e[0]=this,tn(this,Ze(this,t,e))}});var Zr=Bt.prototype;Zr["@@__IMMUTABLE_INDEXED__@@"]=!0,Zr[Kt]=!0,Pr(Nt,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var to=Nt.prototype;function eo(t,e,n,r,o,i){return cn(t.size),t.__iterate((function(t,i,a){o?(o=!1,n=t):n=e.call(r,n,t,i,a)}),i),n}function no(t,e){return e}function ro(t,e){return[e,t]}function oo(t){return function(){return!t.apply(this,arguments)}}function io(t){return function(){return-t.apply(this,arguments)}}function ao(){return un(arguments)}function uo(t,e){return t<e?1:t>e?-1:0}function so(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}to.has=$r.includes,to.contains=to.includes,to.keys=to.values,Pr(ie,Xr),Pr(ae,Zr),Pr(ue,to);var co=function(t){function e(t){return null==t?ho():Dr(t)?t:ho().withMutations((function(e){var n=Nt(t);cn(n.size),n.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Ut(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ur);co.isOrderedSet=Dr;var fo,lo=co.prototype;function po(t,e){var n=Object.create(lo);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function ho(){return fo||(fo=po(kr()))}lo[Kt]=!0,lo.zip=Zr.zip,lo.zipWith=Zr.zipWith,lo.zipAll=Zr.zipAll,lo.__empty=ho,lo.__make=po;var yo=function(t,e){var n;!function(t){if(Yt(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Jt(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var r=function(i){var a=this;if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var u=Object.keys(t),s=o._indices={};o._name=e,o._keys=u,o._defaultValues=t;for(var c=0;c<u.length;c++){var f=u[c];s[f]=c,o[f]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+bo(this)+' with property "'+f+'" since that property name is part of the Record API.'):wo(o,f)}}return this.__ownerID=void 0,this._values=fr().withMutations((function(t){t.setSize(a._keys.length),Ut(i).forEach((function(e,n){t.set(a._indices[n],e===a._defaultValues[n]?void 0:e)}))})),this},o=r.prototype=Object.create(_o);return o.constructor=r,e&&(r.displayName=e),r};yo.prototype.toString=function(){for(var t,e=bo(this)+" { ",n=this._keys,r=0,o=n.length;r!==o;r++)e+=(r?", ":"")+(t=n[r])+": "+dn(this.get(t));return e+" }"},yo.prototype.equals=function(t){return this===t||Yt(t)&&go(this).equals(go(t))},yo.prototype.hashCode=function(){return go(this).hashCode()},yo.prototype.has=function(t){return this._indices.hasOwnProperty(t)},yo.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._indices[t],r=this._values.get(n);return void 0===r?this._defaultValues[t]:r},yo.prototype.set=function(t,e){if(this.has(t)){var n=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(n!==this._values&&!this.__ownerID)return mo(this,n)}return this},yo.prototype.remove=function(t){return this.set(t)},yo.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:mo(this,t)},yo.prototype.wasAltered=function(){return this._values.wasAltered()},yo.prototype.toSeq=function(){return go(this)},yo.prototype.toJS=function(){return qr(this)},yo.prototype.entries=function(){return this.__iterator(2)},yo.prototype.__iterator=function(t,e){return go(this).__iterator(t,e)},yo.prototype.__iterate=function(t,e){return go(this).__iterate(t,e)},yo.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?mo(this,e,t):(this.__ownerID=t,this._values=e,this)},yo.isRecord=Yt,yo.getDescriptiveName=bo;var vo,_o=yo.prototype;function mo(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._values=e,r.__ownerID=n,r}function bo(t){return t.constructor.displayName||t.constructor.name||"Record"}function go(t){return he(t._keys.map((function(e){return[e,t.get(e)]})))}function wo(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){sn(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}function xo(t,e){return Lt(e)?e.toList():Dt(e)?e.toMap():e.toSet()}_o["@@__IMMUTABLE_RECORD__@@"]=!0,_o.delete=_o.remove,_o.deleteIn=_o.removeIn=En,_o.getIn=Vr,_o.hasIn=$r.hasIn,_o.merge=jn,_o.mergeWith=In,_o.mergeIn=Dn,_o.mergeDeep=zn,_o.mergeDeepWith=Mn,_o.mergeDeepIn=Ln,_o.setIn=xn,_o.update=kn,_o.updateIn=An,_o.withMutations=Pn,_o.asMutable=qn,_o.asImmutable=Un,_o[Vt]=_o.entries,_o.toJSON=_o.toObject=$r.toObject,_o.inspect=_o.toSource=function(){return this.toString()};var So={version:"4.1.0",Collection:qt,Iterable:qt,Seq:oe,Map:Nn,OrderedMap:Er,List:fr,Stack:Ir,Set:Ur,OrderedSet:co,Record:yo,Range:Gr,Repeat:function(t){function e(t,n){if(!(this instanceof e))return new e(t,n);if(this._value=t,this.size=void 0===n?1/0:Math.max(0,n),0===this.size){if(vo)return vo;vo=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(t,e){return this.has(t)?this._value:e},e.prototype.includes=function(t){return be(this._value,t)},e.prototype.slice=function(t,n){var r=this.size;return It(t,n,r)?this:new e(this._value,Ct(n,r)-Rt(t,r))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return be(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return be(this._value,t)?this.size:-1},e.prototype.__iterate=function(t,e){for(var n=this.size,r=0;r!==n&&!1!==t(this._value,e?n-++r:r++,this););return r},e.prototype.__iterator=function(t,e){var n=this,r=this.size,o=0;return new Ht((function(){return o===r?{value:void 0,done:!0}:Qt(t,e?r-++o:o++,n._value)}))},e.prototype.equals=function(t){return t instanceof e?be(this._value,t._value):Lr(t)},e}(ae),is:be,fromJS:function(t,e){return function t(e,n,r,o,i,a){if("string"!=typeof r&&!Jt(r)&&(re(r)||Xt(r)||pn(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&""!==o&&i.push(o);var u=n.call(a,o,oe(r).map((function(o,a){return t(e,n,o,a,i,r)})),i&&i.slice());return e.pop(),i&&i.pop(),u}return r}([],e||xo,t,"",e&&e.length>2?[]:void 0,{"":t})},hash:Se,isImmutable:Jt,isCollection:Mt,isKeyed:Dt,isIndexed:Lt,isAssociative:Pt,isOrdered:Gt,isValueObject:me,isPlainObject:pn,isSeq:Ft,isList:cr,isMap:ve,isOrderedMap:_e,isStack:jr,isSet:Mr,isOrderedSet:Dr,isRecord:Yt,get:vn,getIn:Wr,has:yn,hasIn:Hr,merge:function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return Tn(t,e)},mergeDeep:function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return Cn(t,e)},mergeWith:function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Tn(e,n,t)},mergeDeepWith:function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Cn(e,n,t)},remove:mn,removeIn:Sn,set:bn,setIn:wn,update:On,updateIn:gn},Eo={keysColor:"red",dashColor:"bold",stringColor:"red"},Oo={keysColor:"cyan",dashColor:"bold",stringColor:"bold"},ko={keysColor:"magenta",dashColor:"black",stringColor:"bold"};var Ao=function(t,e){var n=t.items("tablesByName",e);if(null!==n){var r=n.get("rows"),o=[];n.get("schema").map((function(t){o.push(t.get("name"))})),Uo.object(o,"Columns"),Uo.titleLine("Data Rows");var i=r.map((function(t,e){var n={};return t.map((function(t,e){n[o[e]]=t})),n}));Uo.object(i,"Data for ".concat(e))}},jo=n(12),Io=n.n(jo);function Ro(){return(Ro=s()(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.map((function(t){var e=t.line.replace(/(\r\n|\n|\r)/gm,"");0===e.length&&console.log(" "),"title"===t.type?console.log(Io.a.bold(e)):console.log(e)})),t.abrupt("return");case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Co=function(t){return Ro.apply(this,arguments)},To=n(9),zo=n.n(To);function Mo(t){console.log(" ","\n======================================="),console.log(zo.a.render({title:t},ko)),console.log(" ","=======================================\n")}function Do(t,e){Mo("".concat(e," size: ").concat(t.itemsList().size)),t.itemsList().size>0?qo(t.itemsList().toJS()):qo({info:"List is empty"})}function Lo(t,e){Mo("".concat(e," size: ").concat(t.links().size)),t.links().forEach((function(t,e){qo({rel:e})}))}function Po(t,e){Mo("".concat(e," size: ").concat(Do.size)),qo(t.items().toJS())}function qo(t,e){!function(t,e){e&&Mo(e);console.log(zo.a.render(t,Oo))}(So.Iterable.isIterable(t)?t.toJS():"object"===xt()(t)||Array.isArray(t)?t:{value:t},e)}var Uo={result:function(t,e){t.itemsList().size>0&&Do(t,"".concat(e,": ItemList")),t.links().size>0&&Lo(t,"".concat(e,": links")),null!==t.items()&&Po(t,"".concat(e,": items"))},itemsList:Do,links:Lo,items:Po,itemsCmd:function(t,e,n){Mo("".concat(n," size: ").concat(t.itemsCmd(e).size)),t.itemsCmd(e).forEach((function(t,e){qo({rel:e})}))},object:qo,errMsg:function(t){var e="object"===xt()(t)?t:{Error:t};console.log(zo.a.render(e,Eo))},msg:function(t,e){e&&Mo(e),console.log(zo.a.render(t,Oo))},titleLine:Mo,casTable:Ao,logListLines:Co},Bo=n(10),No=n.n(Bo),Fo=n(14),Yo=n(8),Jo=n(38).promises;function Ko(){return(Ko=s()(f.a.mark((function t(e,n,r,o,i,a){var u,s,c,l,p,h,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=Object(Fo.a)(r,o),null==a){t.next=5;break}t.t0=a,t.next=8;break;case 5:return t.next=7,Jo.readFile(r,u.fileOptions);case 7:t.t0=t.sent;case 8:return s=t.t0,null!==u.transform&&(s=u.transform(s,u)),t.next=12,u.handler(e,n,s,u,i);case 12:if(c=t.sent,!0!==i){t.next=18;break}return l=o.split("."),p=No()(l,2),h=p[0],d=p[1],t.next=17,Object(Yo.a)(e,n,h,d);case 17:c=c+"\n"+" ".concat(o," was saved");case 18:return t.abrupt("return",c);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Go=function(t,e,n,r,o,i){return Ko.apply(this,arguments)},Wo=n(43);function Vo(){return(Vo=s()(f.a.mark((function t(e,n,r,o,i,a){var u,s,c,l,p,h,d,y,v,_,m,b,g,w,x;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.addServices("casManagement");case 2:return u=t.sent,s=u.casManagement,t.next=6,i.apiCall(s.links("servers"));case 6:if(0!==(c=t.sent).itemsList().size){t.next=9;break}throw{Error:"No cas servers were found"};case 9:return l=c.itemsList(0),p={qs:{filter:"eq(name,".concat(e,")")}},t.next=13,i.apiCall(c.itemsCmd(l,"caslibs"),p);case 13:return h=t.sent,t.next=16,i.apiCall(h.itemsCmd(e,"tables"));case 16:return d=t.sent,y={qs:{filter:"eq(name, ".concat(n.trim().toUpperCase(),")")}},t.next=20,i.apiCall(h.itemsCmd(e,"tables"),y);case 20:if(1!==(v=t.sent).itemsList().size){t.next=25;break}return _=v.itemsList(0),m=v.items(_,"data","tableReference","tableUri"),t.abrupt("return",m);case 25:return(b=new Wo).append("tableName",n),b.append("format",o),b.append("scope",null==a?"global":a),b.append("containsHeaderRow",!0),b.append("file",r),g={data:b,headers:{"content-type":'multipart/form-data; boundary="----------12345678901234567"'}},t.next=34,i.apiCall(d.links("upload"),g);case 34:return w=t.sent,x=w.items("tableReference","tableUri"),t.abrupt("return",x);case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ho=function(t,e,n,r,o,i){return Vo.apply(this,arguments)};function Qo(){return(Qo=s()(f.a.mark((function t(e,n,r){var i,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.a.commonCasl()+" "+l.a.casFetchRows(),t.next=3,Object(o.a)(e,n,i,r);case 3:return a=t.sent,t.abrupt("return",a.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var $o=function(t,e,n){return Qo.apply(this,arguments)};var Xo=function(){return{caslRun:r.a,caslRunBase:o.a,casSetup:w,casActionRun:S,casFetchData:O,casUpdateData:I,computeRun:L,computeSetup:q,computeSummary:T,computeFetchData:F,computeFileContent:J,computeResults:B,findReport:G,getReportImage:V,getReportUri:Q,getSASTableRows:X,jesSetup:tt,jesRun:st,jesSummary:nt,jsonToDict:ct.a,casTableToJson:R,caslScore:y,caslDescribe:b,masSetup:yt,masAddModel:lt,masDescribe:vt,masRun:mt,casUpload:Go,uploadData:Ho}}()}])}));
|
|
10
|
+
e.read=function(t,e,n,r,a){var o,s,i=8*a-r-1,u=(1<<i)-1,c=u>>1,l=-7,f=n?a-1:0,p=n?-1:1,h=t[e+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=i;l>0;o=256*o+t[e+f],f+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,a,o){var s,i,u,c=8*o-a-1,l=(1<<c)-1,f=l>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(i=0,s=l):s+f>=1?(i=(e*u-1)*Math.pow(2,a),s+=f):(i=e*Math.pow(2,f-1)*Math.pow(2,a),s=0));a>=8;t[n+h]=255&i,h+=d,i/=256,a-=8);for(s=s<<a|i,c+=a;c>0;t[n+h]=255&s,h+=d,s/=256,c-=8);t[n+h-d]|=128*b}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,n){"use strict";n.r(e),n.d(e,"caslRun",(function(){return r.a})),n.d(e,"caslRunBase",(function(){return a.a})),n.d(e,"casSetup",(function(){return x})),n.d(e,"casActionRun",(function(){return E})),n.d(e,"casTableToJson",(function(){return O})),n.d(e,"casFetchData",(function(){return S})),n.d(e,"casFetchRows",(function(){return jt})),n.d(e,"casUpdateData",(function(){return T})),n.d(e,"computeRun",(function(){return I})),n.d(e,"computeSetup",(function(){return B})),n.d(e,"computeSummary",(function(){return j})),n.d(e,"computeFetchData",(function(){return Y})),n.d(e,"computeFileContent",(function(){return z})),n.d(e,"findReport",(function(){return G})),n.d(e,"getReportImage",(function(){return H})),n.d(e,"getReportUri",(function(){return X})),n.d(e,"getSasTableRows",(function(){return $})),n.d(e,"jesSetup",(function(){return tt})),n.d(e,"jesRun",(function(){return ut})),n.d(e,"jesSummary",(function(){return nt})),n.d(e,"jsonToDict",(function(){return ct.a})),n.d(e,"computeResults",(function(){return F})),n.d(e,"caslScore",(function(){return b})),n.d(e,"caslDescribe",(function(){return v})),n.d(e,"masSetup",(function(){return bt})),n.d(e,"masAddModel",(function(){return ft})),n.d(e,"masDescribe",(function(){return mt})),n.d(e,"masRun",(function(){return gt})),n.d(e,"masScore",(function(){return wt})),n.d(e,"casUpload",(function(){return At})),n.d(e,"uploadData",(function(){return Ot})),n.d(e,"lib",(function(){return Lt}));var r=n(4),a=n(2),o=n(6),s=n.n(o),i=n(1),u=n.n(i),c=n(0),l=n.n(c),f=n(3);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(){return(d=u()(l.a.mark((function t(e,n,r){var o,s,i,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.a.commonCasl()+" "+f.a.scoreCasl(),s=h({path:"/score"},r),t.next=4,Object(a.a)(e,n,o,s);case 4:return i=t.sent,u=i.items("results","casResults").toJS()[0],t.abrupt("return",u);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var b=function(t,e,n){return d.apply(this,arguments)};function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function g(){return(g=u()(l.a.mark((function t(e,n,r){var o,s,i,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.a.commonCasl()+" "+f.a.scoreCasl(),s=y({path:"/describe"},r),t.next=4,Object(a.a)(e,n,o,s);case 4:return i=t.sent,u=i.items("results").toJS(),t.abrupt("return",u);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var v=function(t,e,n){return g.apply(this,arguments)};function w(){return(w=u()(l.a.mark((function t(e,n){var r,a,o,s,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("casManagement");case 5:return r=t.sent,a=r.casManagement,t.next=9,e.apiCall(a.links("servers"));case 9:if(0!==(o=t.sent).itemsList().size){t.next=12;break}throw{Error:"No cas servers were found"};case 12:return s=o.itemsList(0),t.next=15,e.apiCall(o.itemsCmd(s,"createSession"));case 15:return i=t.sent,t.abrupt("return",{servers:o,session:i});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var x=function(t,e){return w.apply(this,arguments)};function _(){return(_=u()(l.a.mark((function t(e){var n,r,a,o,s=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=s.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=s[a];return t.next=3,e.runAction.apply(e,r);case 3:return o=t.sent,t.abrupt("return",o.items().toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var E=function(t){return _.apply(this,arguments)};function k(){return(k=u()(l.a.mark((function t(e,n,r){var o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.a.commonCasl()+" "+f.a.casFetchData(),t.next=3,Object(a.a)(e,n,o,r);case 3:return s=t.sent,t.abrupt("return",s.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var S=function(t,e,n){return k.apply(this,arguments)};function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(){return(C=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u,c,f,p,h,d,b,m,y,g,v;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c in a=r.data,o=r.where,s=r.table,i="",u=" ",o)f=o[c],p="string"==typeof f?"'".concat(f.toString(),"'"):f,i=i+u+c+"= ".concat(p," "),u=" AND ";for(d in h=[],a)b=a[d],m=void 0,m=null==b?".":"string"==typeof b?JSON.stringify(b):b.toString(),h.push({var:d,value:m});return y=A(A({},s),{},{where:"".concat(i)}),g={action:"table.update",data:{table:y,set:h}},t.next=11,e.runAction(n,g);case 11:return v=t.sent,t.abrupt("return",v);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=function(t,e,n){return C.apply(this,arguments)};var O=function(t,e){var n=t.items("tables",e),r=n.get("rows"),a=[];n.get("schema").map((function(t){a.push(t.get("name"))}));var o=[];return r.map((function(t){var e={};t.map((function(t,n){e[a[n]]=t})),o.push(e)})),o};function P(){return(P=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u,c,f,p,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((a={session:n,log:null,listing:null,ods:null,job:r,tables:{},files:{}}).log=r.links("log"),a.listing=r.links("listing"),null===(o=r.links("results"))){t.next=10;break}return t.next=7,e.apiCall(o);case 7:if(s=t.sent,(i=s.itemsList().size)>0)for(u=0;u<i;u++)c=s.itemsList(u),"ods"===(f=s.items(c,"data","type").toLowerCase())?a.ods=s.itemsCmd(c,"self"):"table"===f?(p={self:s.itemsCmd(c,"self"),current:null},a.tables[c]=p):"file"===f?(h={self:c,current:null,data:null},a.files[c]=h):(d={self:c,current:null,data:null},a[f]=d);case 10:return t.abrupt("return",a);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var j=function(t,e,n){return P.apply(this,arguments)};function L(){return(L=u()(l.a.mark((function t(e,n,r,a,o){var s,i,u,c,f,p;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s="wait",i=null!=o?o:5,"wait"!==a&&null!==a&&(s=Math.max(Math.floor(a/i),1)),u={data:{code:r}},t.next=6,e.apiCall(n.links("execute"),u);case 6:return c=t.sent,t.next=9,e.jobState(c,null,s,i);case 9:if("running"!==(f=t.sent).data){t.next=14;break}throw"ERROR: Job did not complete in allotted time";case 14:return t.next=16,j(e,n,f.job);case 16:return(p=t.sent).SASJobStatus=f.data,t.abrupt("return",p);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var U=function(t,e,n,r,a){return L.apply(this,arguments)};function D(){return(D=u()(l.a.mark((function t(e,n,r,a,o,s){var i,u,c,f,p;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=[],null!=a)for(u in a)c="%let ".concat(u," = ").concat(a[u],";"),i.push(c);return f=r.split(/\r?\n/),i=i.concat(f),t.next=6,U(e,n,i,o,s);case 6:return p=t.sent,t.abrupt("return",p);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var I=function(t,e,n,r,a,o){return D.apply(this,arguments)};function M(){return(M=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u,c;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=4;break}return t.next=3,e.logon(r);case 3:t.sent;case 4:return t.next=6,e.addServices("compute");case 6:return a=t.sent,o=a.compute,t.next=10,e.apiCall(o.links("contexts"));case 10:if(s=t.sent,null==n&&(n="Job Execution"),n=n.toLowerCase(),-1!==(i=s.itemsList().findIndex((function(t){return t.toLowerCase().indexOf(n)>=0})))){t.next=17;break}throw{Error:"Compute Context not found: "+n};case 17:return u=s.itemsCmd(s.itemsList(i),"createSession"),t.next=20,e.apiCall(u);case 20:return c=t.sent,t.abrupt("return",c);case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B=function(t,e,n){return M.apply(this,arguments)};function N(){return(N=u()(l.a.mark((function t(e,n,r){var a,o,s,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("log"!==r&&"listing"!==r){t.next=20;break}if(a=[],null===n[r]){t.next=16;break}return t.next=5,e.apiCall(n[r]);case 5:o=t.sent,a=a.concat(o.items().toJS());case 7:if(null===(s=o.scrollCmds("next"))){t.next=14;break}return t.next=10,e.apiCall(s);case 10:o=t.sent,a=a.concat(o.items().toJS()),t.next=7;break;case 14:t.next=17;break;case 16:a[0]="Note: No ".concat(r);case 17:return t.abrupt("return",a);case 20:if("ods"!==r){t.next=31;break}if(null===n.ods){t.next=28;break}return t.next=24,e.apiCall(n.ods);case 24:return i=t.sent,t.abrupt("return",i.items());case 28:return t.abrupt("return","<h2> No ODS output </h2>");case 29:t.next=40;break;case 31:if("tables"!==r){t.next=35;break}return t.abrupt("return",Object.keys(n.tables));case 35:if("files"!==r){t.next=39;break}return t.abrupt("return",Object.keys(n.files));case 39:throw"Error: Invalid type ".concat(r);case 40:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var F=function(t,e,n){return N.apply(this,arguments)};function q(){return(q=u()(l.a.mark((function t(e,n,r,a,o){var s,i,u,c,f,p,h,d,b,m;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=null,u=null!=o?{qs:o}:null,!0!==n.tables.hasOwnProperty(r)){t.next=27;break}if(null!==(i=n.tables[r]).current&&null!=a){t.next=16;break}return t.next=7,e.apiCall(i.self);case 7:return c=t.sent,t.next=10,e.apiCall(c.links("rowSet"),u);case 10:f=t.sent,i.current=f,p=f.items().toJS(),s={columns:p.columns,rows:p.rows,scrollOptions:f.scrollCmds().keySeq().toJS()},t.next=27;break;case 16:if(h=i.current,d=a,"next"===a&&null===h.scrollCmds("next")&&(d=null!==h.links("last")?"last":null),"prev"===a&&null===h.scrollCmds("prev")&&(d=null!==h.links("first")?"first":null),null===d||null===h.scrollCmds(d)){t.next=27;break}return t.next=23,e.apiCall(h.scrollCmds(d),u);case 23:b=t.sent,i.current=b,m=b.items().toJS(),s={columns:m.columns,rows:m.rows,scrollOptions:b.scrollCmds().keySeq().toJS()};case 27:return t.abrupt("return",s);case 28:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Y=function(t,e,n,r,a){return q.apply(this,arguments)};function J(){return(J=u()(l.a.mark((function t(e,n,r,a){var o,s,i,u,c,f;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(o=n.files[r])){t.next=3;break}throw"Invalid fileref ".concat(r);case 3:if(null!==o.current){t.next=12;break}return s={qs:{filter:"eq(name,'".concat(r,"')")}},t.next=7,e.apiCall(n.session.links("files"),s);case 7:return i=t.sent,t.next=10,e.apiCall(i.itemsCmd(r,"self"));case 10:i=t.sent,o.current=i;case 12:if(!0!==a){t.next=17;break}return u="".concat(n.session.host).concat(o.current.links("content","link","uri")),t.abrupt("return",u);case 17:if(null!==o.data){t.next=26;break}return t.next=20,e.apiCall(o.current.links("content"));case 20:return c=t.sent,f=c.items(),o.data=f,t.abrupt("return",f);case 26:return t.abrupt("return",o.data);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var z=function(t,e,n,r){return J.apply(this,arguments)};function Q(){return(Q=u()(l.a.mark((function t(e,n){var r,a,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getService("reports"),a=null,null!==n&&(a={qs:{filter:"eq(name,'".concat(n,"')")}}),t.next=5,e.apiCall(r.links("reports"),a);case 5:return o=t.sent,t.abrupt("return",0===o.itemsList().size?null:o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var G=function(t,e){return Q.apply(this,arguments)};function V(){return(V=u()(l.a.mark((function t(e,n){var r,a,o,s,i,u,c;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.rafObject("reportImages"),t.next=3,G(e,n);case 3:if(null!==(a=t.sent)){t.next=6;break}return t.abrupt("return","".concat(n," was not found"));case 6:return o=a.itemsCmd(a.itemsList(0),"self","link","uri"),s={data:{reportUri:o,sectionIndex:0,layoutType:"entireSection",size:"400x400"}},t.next=11,e.apiCall(r.links("createJob"),s);case 11:return i=t.sent,t.next=14,e.jobState(i,{qs:{wait:1.5}},10,2);case 14:if("completed"===(u=t.sent).data){t.next=17;break}return t.abrupt("return","Job failed ".concat(u.data));case 17:return t.next=19,e.apiCall(u.job.itemsCmd(u.job.itemsList(0),"image"));case 19:return c=t.sent,t.abrupt("return",c.items());case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var H=function(t,e){return V.apply(this,arguments)};function W(){return(W=u()(l.a.mark((function t(e,n){var r,a;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,G(e,n);case 2:if(null!==(r=t.sent)){t.next=6;break}throw null==n?"No reports were found":"".concat(n," was not found");case 6:return a=[],r.items().map((function(t,e){var n={name:e,uri:r.itemsCmd(e,"self","link","uri")};a.push(n)})),t.abrupt("return",a);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var X=function(t,e){return W.apply(this,arguments)};function Z(){return(Z=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u,c,f,p,h;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n.tables[r],t.next=3,e.apiCall(a);case 3:return o=t.sent,t.next=6,e.apiCall(o.links("rowSet"));case 6:for(s=t.sent,i=s.items("columns"),u=s.items("rows"),c=[],f=u.size,p=function(t){var e=u.get(t),n={};i.map((function(t,r){var a=t.toLowerCase();n[a]=e.get(r)})),c.push(n)},h=0;h<f;h++)p(h);return t.abrupt("return",c);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var $=function(t,e,n){return Z.apply(this,arguments)};function K(){return(K=u()(l.a.mark((function t(e,n){var r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==n){t.next=3;break}return t.next=3,e.logon(n);case 3:return t.next=5,e.addServices("jobExecution","compute","jobDefinitions");case 5:return r=t.sent,t.abrupt("return",r.jobExecution);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var tt=function(t,e){return K.apply(this,arguments)};function et(){return(et=u()(l.a.mark((function t(e,n){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var nt=function(t,e){return et.apply(this,arguments)};function rt(){return(rt=u()(l.a.mark((function t(e,n,r){var a,o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apiCall(n.links("create"),r);case 2:return a=t.sent,t.next=5,e.jobState(a,null,5,2);case 5:if("running"!==(o=t.sent).data){t.next=10;break}throw"ERROR: Job did not complete in allotted time";case 10:if("failed"!==o.data){t.next=14;break}throw JSON.stringify(o);case 14:return t.next=16,nt(e,o.job);case 16:return s=t.sent,t.abrupt("return",s);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var at=function(t,e,n){return rt.apply(this,arguments)};function ot(){return(ot=u()(l.a.mark((function t(e,n,r,a,o){var s,i,u,c;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={},i={},null===a){t.next=6;break}return t.next=5,st(e,a);case 5:s.jobDefinitionUri=t.sent;case 6:return-0!=r&&(i.code=r),i.type="Compute",s.arguments=o,s.jobDefinition=i,u={data:s},t.next=13,at(e,n,u);case 13:return c=t.sent,t.abrupt("return",c);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function st(t,e){return it.apply(this,arguments)}function it(){return(it=u()(l.a.mark((function t(e,n){var r,a,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.getService("jobDefinitions"),r=null,a={qs:{filter:"eq(name,'".concat(n,"')")}},t.next=5,at(e,a);case 5:if(0!==(o=t.sent).itemsList().size){t.next=10;break}throw"Error: ".concat(n," not found in the system");case 10:r=o.itemsCmd(n,"self","link","uri");case 11:return t.abrupt("return",r);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ut=function(t,e,n,r,a){return ot.apply(this,arguments)},ct=n(5);function lt(){return(lt=u()(l.a.mark((function t(e,n,r){var a,o,s,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.service,o=0;case 2:if(!(o<r.length)){t.next=12;break}if(s=r[o],null!=n.steps[s]){t.next=9;break}return t.next=7,ht(e,a,s);case 7:i=t.sent,n.steps[s]=i;case 9:o++,t.next=2;break;case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ft=function(t,e,n){return lt.apply(this,arguments)};function pt(){return(pt=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={qs:{filter:"eq(name,'".concat(r.trim(),"')")}},t.next=3,e.apiCall(n.links("modules"),a);case 3:if(0!==(o=t.sent).itemsList().size){t.next=6;break}return t.abrupt("return",null);case 6:return s=o.itemsCmd(r,"steps"),t.next=9,e.apiCall(s);case 9:return i=t.sent,u={name:r,stepsRafLink:i,stepIds:o.items(r,"data","stepIds").toJS(),microanalyticScore:n},t.abrupt("return",u);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ht=function(t,e,n){return pt.apply(this,arguments)};function dt(){return(dt=u()(l.a.mark((function t(e,n,r){var a,o,s,i,u,c;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==r){t.next=3;break}return t.next=3,e.logon(r);case 3:return t.next=5,e.addServices("microanalyticScore");case 5:a=t.sent,o=a.microanalyticScore,s={service:o,steps:{}},i=0;case 9:if(!(i<n.length)){t.next=18;break}return u=n[i],t.next=13,ht(e,o,u);case 13:c=t.sent,s.steps[u]=c;case 15:i++,t.next=9;break;case 18:return t.abrupt("return",s);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var bt=function(t,e,n){return dt.apply(this,arguments)};var mt=function(t,e,n){var r=t.steps[e];if(null===r)return[];var a=null;if(null==n){var o=r.stepIds.findIndex((function(t){return"execute"===t||"score"===t}));if(-1===o)return[];a=r.stepIds[o]}else{if(-1===r.stepIds.findIndex((function(t){return t===n})))return[];a=n}var s=r.stepsRafLink.items(a,"data","inputs");return null===s?[]:s.toJS()};function yt(){return(yt=u()(l.a.mark((function t(e,n,r,a,o,s){var i,u,c,f,p,h,d,b,m,y,g,v,w;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.steps[r],u=!1,c=[],!1===Array.isArray(a))for(f in a)p={name:f,value:a[f]},c.push(p);else u=!0;if(h={data:{inputs:!0===u?a:c}},d=null,null!=o){t.next=15;break}if(-1!==(b=i.stepIds.findIndex((function(t){return"execute"===t||"score"===t})))){t.next=12;break}return t.abrupt("return",[]);case 12:d=i.stepIds[b];case 13:t.next=21;break;case 15:if(-1!==i.stepIds.findIndex((function(t){return t===o}))){t.next=20;break}return t.abrupt("return",[]);case 20:d=o;case 21:if(null!==(m=i.stepsRafLink.itemsCmd(d,s))){t.next=25;break}return y=[{name:"Error",type:"string",value:"name: ".concat(r," step: ").concat(o," operation: ").concat(s," is an invalid combination")}],t.abrupt("return",y);case 25:return t.next=27,e.apiCall(m,h);case 27:return g=t.sent,v=g.items("outputs").toJS(),!0===u?w=v:(w={},v.map((function(t){w[t.name]=t.value}))),t.abrupt("return",w);case 31:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gt=function(t,e,n,r,a,o){return yt.apply(this,arguments)};function vt(){return(vt=u()(l.a.mark((function t(e,n,r){var a,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,bt(e,[n]);case 2:return a=t.sent,t.next=5,gt(e,a,n,r,"score","execute");case 5:return o=t.sent,t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var wt=function(t,e,n){return vt.apply(this,arguments)},xt=n(9),_t=n.n(xt),Et=n(11),kt=n(7),St=n(19).promises;function Rt(){return(Rt=u()(l.a.mark((function t(e,n,r,a,o,s){var i,u,c,f,p,h,d;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Object(Et.a)(r,a),null==s){t.next=5;break}t.t0=s,t.next=8;break;case 5:return t.next=7,St.readFile(r,i.fileOptions);case 7:t.t0=t.sent;case 8:return u=t.t0,null!==i.transform&&(u=i.transform(u,i)),t.next=12,i.handler(e,n,u,i,o);case 12:if(c=t.sent,!0!==o){t.next=18;break}return f=a.split("."),p=_t()(f,2),h=p[0],d=p[1],t.next=17,Object(kt.a)(e,n,h,d);case 17:c=c+"\n"+" ".concat(a," was saved");case 18:return t.abrupt("return",c);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var At=function(t,e,n,r,a,o){return Rt.apply(this,arguments)},Ct=n(24);function Tt(){return(Tt=u()(l.a.mark((function t(e,n,r,a,o,s){var i,u,c,f,p,h,d,b,m,y,g,v,w,x,_;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.addServices("casManagement");case 2:return i=t.sent,u=i.casManagement,t.next=6,o.apiCall(u.links("servers"));case 6:if(0!==(c=t.sent).itemsList().size){t.next=9;break}throw{Error:"No cas servers were found"};case 9:return f=c.itemsList(0),p={qs:{filter:"eq(name,".concat(e,")")}},t.next=13,o.apiCall(c.itemsCmd(f,"caslibs"),p);case 13:return h=t.sent,t.next=16,o.apiCall(h.itemsCmd(e,"tables"));case 16:return d=t.sent,b={qs:{filter:"eq(name, ".concat(n.trim().toUpperCase(),")")}},t.next=20,o.apiCall(h.itemsCmd(e,"tables"),b);case 20:if(1!==(m=t.sent).itemsList().size){t.next=25;break}return y=m.itemsList(0),g=m.items(y,"data","tableReference","tableUri"),t.abrupt("return",g);case 25:return(v=new Ct).append("tableName",n),v.append("format",a),v.append("scope",null==s?"global":s),v.append("containsHeaderRow",!0),v.append("file",r),w={data:v,headers:{"content-type":'multipart/form-data; boundary="----------12345678901234567"'}},t.next=34,o.apiCall(d.links("upload"),w);case 34:return x=t.sent,_=x.items("tableReference","tableUri"),t.abrupt("return",_);case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ot=function(t,e,n,r,a,o){return Tt.apply(this,arguments)};function Pt(){return(Pt=u()(l.a.mark((function t(e,n,r){var o,s;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=f.a.commonCasl()+" "+f.a.casFetchRows(),t.next=3,Object(a.a)(e,n,o,r);case 3:return s=t.sent,t.abrupt("return",s.items("results","casResults").toJS());case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var jt=function(t,e,n){return Pt.apply(this,arguments)};var Lt=function(){return{caslRun:r.a,caslRunBase:a.a,casSetup:x,casActionRun:E,casFetchData:S,casUpdateData:T,computeRun:I,computeSetup:B,computeSummary:j,computeFetchData:Y,computeFileContent:z,computeResults:F,findReport:G,getReportImage:H,getReportUri:X,getSASTableRows:$,jesSetup:tt,jesRun:ut,jesSummary:nt,jsonToDict:ct.a,casTableToJson:O,caslScore:b,caslDescribe:v,masSetup:bt,masAddModel:ft,masDescribe:mt,masRun:gt,casUpload:At,uploadData:Ot}}()}])}));
|