Greasy Fork

Greasy Fork is available in English.

rx-util

rxliuli 在浏览器上使用的 js 工具集

当前为 2019-05-18 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/382120/699345/rx-util.js

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).rx={})}(this,function(t){"use strict";function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"unknown",n=document.createElement("a");n.download=e,n.style.display="none",n.href=URL.createObjectURL(t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var s=e(function(t){var e=function(i){var c,t=Object.prototype,f=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof g?e:g,f=Object.create(o.prototype),l=new R(r||[]);return f._invoke=(i=t,a=n,u=l,c=h,function(t,e){if(c===p)throw new Error("Generator is already running");if(c===y){if("throw"===t)throw e;return j()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=E(n,u);if(r){if(r===d)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===h)throw c=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=p;var o=s(i,a,u);if("normal"===o.type){if(c=u.done?y:v,o.arg===d)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=y,u.method="throw",u.arg=o.arg)}}),f}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=a;var h="suspendedStart",v="suspendedYield",p="executing",y="completed",d={};function g(){}function u(){}function l(){}var m={};m[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(A([])));b&&b!==t&&f.call(b,o)&&(m=b);var x=l.prototype=g.prototype=Object.create(m);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(c){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){var i=s(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&f.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):Promise.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function E(t,e){var n=t.iterator[e.method];if(n===c){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=c,E(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;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=c),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(f.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=c,t.done=!0,t};return r.next=r}}return{next:j}}function j(){return{value:c,done:!0}}return u.prototype=x.constructor=l,l.constructor=u,l[r]=u.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(x),t},i.awrap=function(t){return{__await:t}},k(S.prototype),S.prototype[n]=function(){return this},i.AsyncIterator=S,i.async=function(t,e,n,r){var o=new S(a(t,e,n,r));return i.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},k(x),x[r]="Generator",x[o]=function(){return this},x.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=A,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),u=f.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&f.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 i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},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),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(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=c),d}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function c(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var h=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){c(r,e,n,o,i,"next",t)}function i(t){c(r,e,n,o,i,"throw",t)}o(void 0)})}};function n(){return(n=h(s.mark(function t(e){var n,r=arguments;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=1<r.length&&void 0!==r[1]?r[1]:"unknown.txt",i(new Blob([e],{type:"text/plain"}),n);case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function r(){return(r=h(s.mark(function t(e){var n,r,o=arguments;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=1<o.length&&void 0!==o[1]?o[1]:e.substr(e.lastIndexOf("/")),t.prev=1,t.next=4,fetch(e);case 4:return r=t.sent,t.next=7,r.blob();case 7:i(t.sent,n),t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(1),t.abrupt("return",console.log("下载出错了 ",t.t0));case 14:case"end":return t.stop()}},t,null,[[1,11]])}))).apply(this,arguments)}var o=function(t){if(Array.isArray(t))return t};var a=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var u=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var l=function(t,e){return o(t)||a(t,e)||u()};function f(){return(f=h(s.mark(function t(e,n){var r,o,i,a=arguments;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=2<a.length&&void 0!==a[2]?a[2]:{},t.next=3,fetch(e,r);case 3:return o=t.sent,t.next=6,o.blob();case 6:i=t.sent,n.src=window.URL.createObjectURL(i);case 8:case"end":return t.stop()}},t)}))).apply(this,arguments)}var m=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},v=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=e.href,r=void 0===n?"":n,o=e.website,i=void 0===o?"":o,a=e.protocol,u=void 0===a?"":a,c=e.domain,f=void 0===c?"":c,l=e.accessPath,s=void 0===l?"":l,h=e.params,v=void 0===h?{}:h,p=e.url,y=void 0===p?"":p,d=e.port,g=void 0===d?0:d;m(this,t),this.href=r,this.website=i,this.protocol=u,this.domain=f,this.accessPath=s,this.params=v,this.url=y,this.port=g},p={http:80,https:443,ssh:22,ftp:21};function y(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.type,o=void 0===e?y.DataURL:e,n=t.encoding,i=void 0===n?"UTF-8":n;return new Promise(function(e,n){r||n(new Error("file not exists"));var t=new FileReader;t.onload=function(t){e(t.target.result)},t.onerror=function(t){n(t)},t[o](r,i)})}function d(t,e){var n={"y+":t.getFullYear(),"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};for(var r in n)if(new RegExp("("+r+")").test(e))if("y+"===r)e=e.replace(RegExp.$1,(""+n[r]).substr(4-RegExp.$1.length));else if("S+"===r){var o=RegExp.$1.length;o=1===o?3:o,e=e.replace(RegExp.$1,("00"+n[r]).substr((""+n[r]).length-1,o))}else e=e.replace(RegExp.$1,1===RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length));return e}y.DataURL="readAsDataURL",y.Text="readAsText",y.BinaryString="readAsBinaryString",y.ArrayBuffer="readAsArrayBuffer";var g="yyyy-MM-ddThh:mm:ss.SSS",w=function(t,e){return encodeURIComponent(t)+"="+encodeURIComponent(e)};function b(n){return new Promise(function(t){if("number"==typeof n)setTimeout(t,n);else if("function"==typeof n)var e=setInterval(function(){n()&&(clearInterval(e),t())},100);else t()})}function x(t,e){return Promise.race([t,b(e)])}var k=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var S=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var E=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var O=function(t){return k(t)||S(t)||E()};function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var R=function(t,e,n){return e&&P(t.prototype,e),n&&P(t,n),t},A=function(){function i(t){var e=t.timeout,n=void 0===e?1e4:e,r=t.limit,o=void 0===r?10:r;m(this,i),this.timeout=n,this.limit=o,this.execCount=0,this.waitArr=[]}return R(i,[{key:"fetch",value:function(n){function t(t,e){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(){var n=h(s.mark(function t(e,n){var r,o=this,i=arguments;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(){var t=h(s.mark(function t(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o.execCount++,e=o.waitArr.shift(),t.prev=2,t.next=5,x(fetch.apply(void 0,O(e)),o.timeout);case 5:return t.abrupt("return",t.sent);case 6:return t.prev=6,o.execCount--,t.finish(6);case 9:case"end":return t.stop()}},t,null,[[2,,6,9]])}));return function(){return t.apply(this,arguments)}}(),this.waitArr.push(i),t.next=4,b(function(){return o.execCount<o.limit});case 4:return t.abrupt("return",r());case 5:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}())}]),i}();function j(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}function L(){return(L=h(s.mark(function t(e,n){var r,o;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=[],o=0;case 2:if(o<e.length)return t.t0=r.push,t.t1=r,t.t2=O,t.next=8,n(e[o]);t.next=14;break;case 8:t.t3=t.sent,t.t4=(0,t.t2)(t.t3),t.t0.apply.call(t.t0,t.t1,t.t4);case 11:o++,t.next=2;break;case 14:return t.abrupt("return",r);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function T(t,i){return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.concat(i.apply(void 0,[e].concat(r)))},[])}function M(t,a){var u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t,e){return t.push(e),t},c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(){return[]};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=a.apply(void 0,[e].concat(r));return t.has(i)||t.set(i,c()),t.set(i,u.apply(void 0,[t.get(i),e].concat(r))),t},new Map)}function D(t,e){for(var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,r=[],o=t;o<e;o+=n)r.push(o);return r}function I(t){return t}function F(t,i){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return t};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.set(i.apply(void 0,[e].concat(r)),a.apply(void 0,[e].concat(r)))},new Map)}function C(t,e){return e<=0?"":t+C(t,e-1)}var _,N=function t(e,n,r,o){m(this,t),this.name=e,this.format=n,this.value=r,this.index=o},U={year:"y{4}|y{2}",month:"M{1,2}",day:"d{1,2}",hour:"h{1,2}",minute:"m{1,2}",second:"s{1,2}",millieSecond:"S{1,3}"};function B(o,t){var e={year:(new Date).getFullYear().toString(),month:"01",day:"01",hour:"00",minute:"00",second:"00",millieSecond:"000"},i=[];for(var n in U){var r=new RegExp(U[n]);if(r.test(t)){var a=r.exec(t)[0],u=C("`",a.length),c=t.indexOf(a);t=t.replace(a,u),i.push(new N(n,C("\\d",a.length),null,c))}else i.push(new N(n,null,e[n],-1))}if(t=t.replace(new RegExp("`","g"),"\\d"),!new RegExp("^".concat(t,"$")).test(o))return null;i.filter(function(t){return t.format}).sort(function(t,e){return t.index-e.index}).map(function(t){var e=new RegExp(t.format).exec(o);return null!==e&&0<e.length&&(o=o.replace(e[0],""),t.value=e[0]),t}).forEach(function(t,e){var n=t.format,r=new RegExp(n).exec(o);null!==r&&0<r.length&&(o=o.replace(r[0],""),i[e].value=r[0])});var f=F(i,function(t){return t.name},function(t){return t.value});2===f.get("year").length&&f.set("year",e.year.substr(0,2).concat(f.get("year")));var l="".concat(f.get("year"),"-").concat(f.get("month"),"-").concat(f.get("day"),"T").concat(f.get("hour"),":").concat(f.get("minute"),":").concat(f.get("second"),".").concat(f.get("millieSecond"));return new Date(l)}function z(t){return t.selectionStart}function $(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:e;t.focus(),t.setSelectionRange(e,n)}function Y(t){return null==t}function G(t){return Y(t)||"string"!=typeof t?t:t.toLowerCase()}function J(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;try{for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(void 0,r)}catch(t){return e}}document.addEventListener("focus",function(t){_=t.target},!0),document.addEventListener("blur",function(){_=null},!0);var Z=e(function(n){function r(t,e){return n.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.exports=r}),q=e(function(r){function o(t,e,n){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?r.exports=o=function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Z(o,n.prototype),o}:r.exports=o=Reflect.construct,o.apply(null,arguments)}r.exports=o}),K=function(){function t(){m(this,t)}return R(t,null,[{key:"getFactory",value:function(){var i=new Map;return new(function(){function t(){m(this,t)}return R(t,[{key:"register",value:function(t,e){return i.set(t,e),e}},{key:"getInstance",value:function(t){var e=i.get(t);if(!e)return null;for(var n=arguments.length,r=new Array(1<n?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return q(e,r)}},{key:Symbol.iterator,value:function(){var t=i.entries();return{next:function(){return t.next()}}}}]),t}())}}]),t}();function W(t){var e=performance.now(),n=t();return n instanceof Promise?n.then(function(){return performance.now()-e}):performance.now()-e}var H=/^(-?\d+)(.\d+)?$/,V=/^-?\d+$/,Q=/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/,X=/^((25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(25[0-5]|2[0-4]\d|1?\d?\d)$/,tt=/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/,et=/^(((13[0-9]{1})|15[0-9]{1}|18[0-9]{1}|)+\d{8})$/,nt=/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/,rt=/^\d{6}$/,ot=new(function(){function t(){m(this,t)}return R(t,[{key:"isEmpty",value:function(t){return Y(t)||""===t}},{key:"isBlank",value:function(t){return ot.isEmpty(t)||""===t.trim()}},{key:"isFloat",value:function(t){return H.test(t)}},{key:"isInteger",value:function(t){return V.test(t)}},{key:"isEmail",value:function(t){return Q.test(t)}},{key:"isIpv4",value:function(t){return X.test(t)}},{key:"isTelephone",value:function(t){return tt.test(t)}},{key:"isMoblie",value:function(t){return et.test(t)}},{key:"isDomain",value:function(t){return nt.test(t)}},{key:"isPostcode",value:function(t){return rt.test(t)}}]),t}());function it(t){return Y(t)||"string"!=typeof t?t:t.toUpperCase()}function at(t){return t&&0!==t.trim().length?t:null}function ut(t){return Y(t)?[]:Reflect.ownKeys(t)}function ct(n){for(var t=arguments.length,e=new Array(1<t?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];var o=new Set(e);return ut(n).reduce(function(t,e){return o.has(e)||(t[e]=n[e]),t},{})}var ft=new(function(){function t(){m(this,t)}return R(t,[{key:"dayStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T00:00:00.000"))}},{key:"dayEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T23:59:59.999"))}},{key:"yearStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-01-01T00:00:00.000"))}},{key:"yearEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-12-31T23:59:59.999"))}}]),t}());function lt(t,e,n){return e<=t&&t<n}var st=new(function(){function t(){m(this,t)}return R(t,[{key:"dayStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T00:00:00.000"))}},{key:"dayEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T23:59:59.999"))}},{key:"yearStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-01-01T00:00:00.000"))}},{key:"yearEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-12-31T23:59:59.999"))}}]),t}()),ht=function(){function e(t){m(this,e),this.date=t}return R(e,[{key:"year",value:function(){return this.date.getFullYear()}},{key:"month",value:function(){return this.date.getMonth()}},{key:"monthOfYear",value:function(){return this.date.getMonth()+1}},{key:"dayOfYear",value:function(){return Math.ceil((this.date.getTime()-st.yearStart(this.date).getTime())/864e5)}},{key:"dayOfMonth",value:function(){return this.date.getDate()}},{key:"dayOfWeek",value:function(){return this.date.getDay()}},{key:"weekOfYear",value:function(){return Math.ceil(this.dayOfYear()/7)}},{key:"weekOfMonth",value:function(){return Math.ceil(this.dayOfMonth()/7)}},{key:"quarter",value:function(){var t=this.month();return lt(t,0,3)?1:lt(t,3,6)?2:lt(t,6,9)?3:4}},{key:"hour",value:function(){return this.date.getHours()}},{key:"minute",value:function(){return this.date.getMinutes()}},{key:"second",value:function(){return this.date.getSeconds()}},{key:"milliSecond",value:function(){return this.date.getMilliseconds()}}]),e}();var vt=function(){function n(t,e){m(this,n),this.start=t,this.end=e}return R(n,[{key:"milliSecond",value:function(){return this.end.getTime()-this.start.getTime()}},{key:"second",value:function(){return Math.floor(this.milliSecond()/1e3)}},{key:"minute",value:function(){return Math.floor(this.second()/60)}},{key:"hour",value:function(){return Math.floor(this.minute()/60)}},{key:"day",value:function(){return Math.floor(this.hour()/24)}},{key:"month",value:function(){var t=this.year(),e=this.end.getMonth()-this.start.getMonth();return 12*t+e}},{key:"year",value:function(){return this.end.getFullYear()-this.start.getFullYear()}}]),n}();function pt(t){var o,i=!0;return new Proxy(t,{apply:function(t,e,n){if(!1===i)return o;i=!1;var r=Reflect.apply(t,e,n);return r instanceof Promise?r.then(function(t){return o=t}):o=r}})}function yt(t){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return JSON.stringify(e)},u=new Map;return new Proxy(t,{apply:function(t,e,n){var r=a.apply(void 0,O(n)),o=u.get(r);if(void 0!==o)return o;var i=Reflect.apply(t,e,n);return i instanceof Promise?i.then(function(t){return u.set(r,t),t}):(u.set(r,i),i)}})}var dt=function t(e,n,r){m(this,t),this.left=e,this.right=n,this.common=r};var gt=s.mark(mt);function mt(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:return t.next=3,e;case 3:e++,t.next=1;break;case 6:case"end":return t.stop()}},gt)}var wt=pt(mt);var bt=e(function(e){function n(t){return(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)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r});var xt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var kt=function(t,e){return!e||"object"!==bt(e)&&"function"!=typeof e?xt(t):e},St=e(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n});var Et=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Z(t,e)},Ot=function(){function t(){m(this,t)}return R(t,[{key:"from",value:function(t){throw new Error("子类必须重写 from 函数")}},{key:"to",value:function(t){throw new Error("子类必须重写 to 函数")}}]),t}(),Pt=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,Ot),R(e,[{key:"from",value:function(t){for(var e=[],n=t.length,r=0,o=0;o<n;o++){var i=t.charAt(o);"A"<=i&&i<="Z"&&(0!==o&&e.push(t.substring(r,o)),r=o)}return r!==t.length&&e.push(t.substring(r,t.length)),e}}]),e}(),Rt=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,Pt),R(e,[{key:"to",value:function(t){return t.reduce(function(t,e,n){var r=G(e);return t+((0===n?G:it)(r.substring(0,1))+r.substring(1))},"")}}]),e}(),At=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,Pt),R(e,[{key:"to",value:function(t){return t.reduce(function(t,e){var n=G(e);return t+(it(n.substring(0,1))+n.substring(1))},"")}}]),e}(),jt=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,Ot),R(e,[{key:"from",value:function(t){return t.split("_")}}]),e}(),Lt=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,jt),R(e,[{key:"to",value:function(t){return t.map(G).join("_")}}]),e}(),Tt=function(t){function e(){return m(this,e),kt(this,St(e).apply(this,arguments))}return Et(e,jt),R(e,[{key:"to",value:function(t){return t.map(it).join("_")}}]),e}(),Mt={Camel:Symbol(1),Pascal:Symbol(2),Snake:Symbol(3),ScreamingSnake:Symbol(4)},Dt=function(){function t(){m(this,t)}return R(t,null,[{key:"getInstance",value:function(t){switch(t){case Mt.Camel:return new Rt;case Mt.Pascal:return new At;case Mt.Snake:return new Lt;case Mt.ScreamingSnake:return new Tt;default:throw new Error("No corresponding converter found")}}}]),t}(),It=function(){function n(t,e){m(this,n),this.fromConverter=Dt.getInstance(t),this.toConverter=Dt.getInstance(e)}return R(n,[{key:"convert",value:function(t){return ot.isEmpty(t)?t:this.toConverter.to(this.fromConverter.from(t))}}]),n}(),Ft=yt(function(t,e){return new It(t,e)},function(t,e){return t.toString()+e.toString()}),Ct=function(){function r(){m(this,r)}return R(r,null,[{key:"getConverter",value:function(t,e){return Ft(t,e)}},{key:"convert",value:function(t,e,n){return r.getConverter(t,e).convert(n)}}]),r}();function _t(u){for(var t=arguments.length,c=new Array(1<t?t-1:0),e=1;e<t;e++)c[e-1]=arguments[e];var n=c.filter(function(t){return t!==_t._});if(n.length>=u.length)return u.apply(void 0,O(n));function r(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=new Set,o=0,i=c.map(function(t){return t!==_t._||void 0===e[o]||e[o]===_t._?t:(r.add(o),e[o++])}),a=e.filter(function(t,e){return!r.has(e)});return _t.apply(void 0,[u].concat(O(i),O(a)))}return r.toString=function(){return"name: ".concat(u.name,", args: [").concat(c.map(function(t){return t.toString()}).join(", "),"]")},r._curry=!0,r}_t._=Symbol("_");var Nt=function(){function e(t){m(this,e),this.fmt=t}return R(e,[{key:"format",value:function(t){return Y(t)?"":d(t,this.fmt)}},{key:"parse",value:function(t){return ot.isEmpty(t)?null:B(t,this.fmt)}},{key:"strFormat",value:function(t,e){return ot.isEmpty(t)?"":d(e?B(t,e):new Date(t),this.fmt)}}]),e}();Nt.dateFormatter=new Nt("yyyy-MM-dd"),Nt.timeFormatter=new Nt("hh:mm:ss"),Nt.dateTimeFormatter=new Nt("yyyy-MM-dd hh:mm:ss");var Ut=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Bt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){Ut(e,t,n[t])})}return e},zt=Symbol("TimoutInfinite").toString(),$t=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=e.timeout,r=e.timeStart,o=e.serialize,i=e.deserialize;m(this,t),this.timeout=n,this.timeStart=r,this.serialize=o,this.deserialize=i};function Yt(e){return ut(e).map(function(t){return[t,e[t]]})}function Gt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return T(e,function(t){return Y(t)?[]:Yt(t)}).reduce(function(t,e){var n=l(e,2),r=n[0],o=n[1];return Y(o)||(t[r]=o),t},{})}var Jt=function(){function e(t){m(this,e),this.cacheOption=Gt(new $t({timeout:zt,serialize:JSON.stringify,deserialize:JSON.parse}),t)}return R(e,[{key:"add",value:function(t,e,n){}},{key:"del",value:function(t){}},{key:"set",value:function(t,e,n){}},{key:"get",value:function(t,e){}},{key:"touch",value:function(t,e){}}]),e}(),Zt=function t(e){var n=e.key,r=e.val,o=e.cacheOption;m(this,t),this.key=n,this.val=r,this.cacheOption=o},qt=function(t){function n(t){var e;return m(this,n),(e=kt(this,St(n).call(this,t))).localStorage=window.localStorage,e.clearExpired(),e}var e;return Et(n,Jt),R(n,[{key:"clearExpired",value:(e=h(s.mark(function t(){var n,e,r,o,i,a,u,c,f,l;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=this.localStorage,e=n.length,r=[],o=0;case 4:if(o<e)return t.next=7,b(0);t.next=17;break;case 7:if(i=n.key(o),a=n.getItem(i),null===(u=J(JSON.parse,null,a)))return t.abrupt("continue",14);t.next=12;break;case 12:c=u.cacheOption,f=c.timeStart,(l=c.timeout)!==zt&&Date.now()-f>l&&r.push(i);case 14:o++,t.next=4;break;case 17:return t.next=19,r.forEach(function(){var e=h(s.mark(function t(e){return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.removeItem(e));case 1:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}());case 19:case"end":return t.stop()}},t,this)})),function(){return e.apply(this,arguments)})},{key:"add",value:function(t,e,n){null===this.get(t,n)&&this.set(t,e,n)}},{key:"del",value:function(t){this.localStorage.removeItem(t)}},{key:"set",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new $t,r=Gt(this.cacheOption,n);this.localStorage.setItem(t,JSON.stringify(new Zt({key:t,val:r.serialize(e),cacheOption:Bt({},r,{timeStart:r.timeStart||Date.now()})})))}},{key:"get",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new $t,n=this.localStorage.getItem(e),r=J(JSON.parse,null,n);if(null===r)return null;var o=Gt(this.cacheOption,r.cacheOption,t),i=o.timeStart,a=o.timeout,u=o.deserialize;if(a!==zt&&Date.now()-i>a)return this.del(e),null;try{return u(r.val)}catch(t){return this.del(e),null}}},{key:"touch",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new $t,n=this.localStorage.getItem(e),r=J(JSON.parse,null,n);if(null===r)return null;var o=Gt(this.cacheOption,r.cacheOption,t),i=o.timeStart,a=o.timeout,u=o.deserialize;if(a!==zt&&Date.now()-i>a)return this.del(e),null;try{var c=u(r.val);return this.set(e,c,Gt(o,{timeStart:Date.now()})),c}catch(t){return this.del(e),null}}}]),n}(),Kt=new qt,Wt=new(function(){function t(){m(this,t)}return R(t,[{key:"onceOfSameParam",value:function(u){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.identity,n=void 0===e?u.toString():e,r=t.timeout,c=void 0===r?zt:r,f=function(t){return"onceOfSameParam-".concat(n,"-").concat(JSON.stringify(t))},o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=f(e),o=new $t({timeout:c}),i=Kt.get(r);if(null!==i)return i;var a=u.call.apply(u,[this].concat(e));return a instanceof Promise?a.then(function(t){return Kt.set(r,t,o),t}):(Kt.set(r,a,o),a)};return o.origin=u,o.clear=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=f(e);Kt.del(r)},o}}]),t}());function Ht(){}var Vt={cyclingDebugger:function(){setInterval(function(){},100)},checkDebug:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(){return window.location.reload()};setInterval(function(){var t=W(function(){for(var t=0;t<1e3;t++)console.log(t),console.clear()});500<t&&(console.log(t),e())},1e3)},disableConsoleOutput:function(){window.console&&Object.keys(console).forEach(function(t){return console[t]=Ht})}};var Qt=new(function(){function t(){m(this,t)}return R(t,[{key:"isEmpty",value:function(t){return Y(t)||!(t instanceof Array)||0===t.length}}]),t}()),Xt=function(){function r(){m(this,r)}return R(r,[{key:"join",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(r._join)}}],[{key:"_join",value:function(t,e){return t.endsWith(r.Separator)?(t+e).replace(r.Separator+r.Separator,r.Separator):e.startsWith(r.Separator)?t+e:t+r.Separator+e}}]),r}();Xt.Separator="/";var te=new Xt,ee=new(function(){function n(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).enable,e=void 0===t||t;m(this,n),this.enable=e}return R(n,[{key:"log",value:function(t){}},{key:"enable",set:function(e){var n=this;this._enable=e,Object.keys(console).forEach(function(t){return n[t]=e?console[t]:Ht})}}]),n}());function ne(n){return ut(n).reduce(function(t,e){return t.set(e,n[e])},new Map)}function re(r){return r instanceof Map||(r=ne(r)),function(t){return new Proxy(t,{get:function(t,e){return r.has(e)?Reflect.get(t,r.get(e)):Reflect.get(t,e)},set:function(t,e,n){return r.has(e)?Reflect.set(t,r.get(e),n):Reflect.set(t,e,n),!0}})}}var oe=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o};var ie=function(t,e){if(null==t)return{};var n,r,o=oe(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o};function ae(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.before,f=void 0===n?I:n,r=e.after,l=void 0===r?I:r,o=e.paramFn,s=void 0===o?function(t){return[]}:o;return function t(e){for(var n=arguments.length,r=new Array(1<n?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=f.apply(void 0,[e].concat(r)),a=i.child;if(Qt.isEmpty(a))return i;for(var u=a.length,c=0;c<u;c++)a[c]=t.apply(void 0,[a[c]].concat(O(s.apply(void 0,[i].concat(r)))));return l.apply(void 0,[i].concat(r))}(t)}var ue=function(){function t(){m(this,t)}return R(t,null,[{key:"bridge",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=void 0===e?"id":e,r=t.parentId,o=void 0===r?"parentId":r,i=t.child,a=void 0===i?"child":i,u=t.path,c=void 0===u?"path":u,f=ie(t,["id","parentId","child","path"]);this.id=n,this.parentId=o,this.child=a,this.path=c,Object.assign(this,f)}}]),t}(),ce=new(function(){function t(){m(this,t)}return R(t,[{key:"bridge",value:function(t){return re(Object.assign(new ue,t))}},{key:"bridgeTree",value:function(t,e){return ae(t,{before:this.bridge(e)})}},{key:"bridgeList",value:function(t,e){return t.map(this.bridge(e))}}]),t}());function fe(e,n){var r=n instanceof Function?/^(?:constructor|prototype|arguments|caller|name|bind|call|apply|toString|length)$/:/^(?:toString|length)$/;return Reflect.ownKeys(n).forEach(function(t){"string"==typeof t&&r.test(t)||Reflect.set(e,t,Reflect.get(n,t))}),e}var le=function(){return!1},se=function(){function i(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.limit,n=void 0===e?1:e,r=t.timeout,o=void 0===r?le:r;m(this,i),this.limit=n,this.timeout=o}var t;return R(i,[{key:"isLocked",value:function(){return this.limit<=0}},{key:"lock",value:(t=h(s.mark(function t(){var e,n=this,r=arguments;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=0<r.length&&void 0!==r[0]?r[0]:this.timeout,this.isLocked())return t.next=4,Promise.race([b(function(){var t=!n.isLocked();return t&&n.limit--,t}),b(e)]);t.next=6;break;case 4:t.next=7;break;case 6:this.limit--;case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})},{key:"unlock",value:function(){this.limit++}}]),i}();t.DateFormatter=Nt,t.FetchLimiting=A,t.LocalStorageCache=qt,t.Locker=se,t.NodeBridge=ue,t.StateMachine=K,t.StringStyleUtil=Ct,t.aggregation=function(t){var r=Array.from(t),n=function t(){for(var o=this,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];m(this,t),r.forEach(function(t){var e=l(t,2),n=e[0],r=e[1];fe(o,q(n,O((void 0===r?I:r)(i))))})};return r.forEach(function(t){var e=l(t,1)[0];fe(n.prototype,e.prototype),fe(n,e)}),n},t.antiDebug=Vt,t.appends=function(t,e){for(var n in e)t.append(n,e[n]);return t},t.arrayDiffBy=function(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:I,i=new Set(t.map(o)),a=new Set(e.map(o)),n=t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!a.has(o.apply(void 0,[t].concat(n)))}),r=e.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!i.has(o.apply(void 0,[t].concat(n)))}),u=new Set(n.map(o)),c=t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!u.has(o.apply(void 0,[t].concat(n)))});return new dt(n,r,c)},t.arrayToMap=F,t.arrayValidator=Qt,t.asIterator=j,t.assign=Gt,t.asyncFlatMap=function(t,e){return L.apply(this,arguments)},t.asyncLimiting=function(t){var r,e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).limit,i=void 0===e?1:e,a=0,u=[],c=!1;return new Proxy(t,{apply:(r=h(s.mark(function t(n,r,e){var o;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=function(){var t=h(s.mark(function t(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c||(a++,c=!1),e=u.shift(),t.prev=2,t.next=5,Reflect.apply(n,r,e);case 5:return t.abrupt("return",t.sent);case 6:return t.prev=6,a--,t.finish(6);case 9:case"end":return t.stop()}},t,null,[[2,,6,9]])}));return function(){return t.apply(this,arguments)}}(),u.push(e),t.next=4,b(function(){var t=a<i;return t&&(c=!0,a++),t});case 4:return t.abrupt("return",o());case 5:case"end":return t.stop()}},t)})),function(t,e,n){return r.apply(this,arguments)})})},t.autoIncrement=function(){return wt().next().value},t.blankToNull=at,t.blankToNullField=function(n){var r={};return ut(n).forEach(function(t){var e=n[t];r[t]="string"==typeof e?at(e):e}),r},t.bridge=re,t.cacheUtil=Wt,t.compare=function t(e,n){if("number"==typeof e&&"number"==typeof n){if(isNaN(e)&&isNaN(n))return!0;if(Math.abs(e-n)<Number.EPSILON)return!0}if(e===n)return!0;if("function"==typeof e&&"function"==typeof n)return(e instanceof RegExp&&n instanceof RegExp||e instanceof String||n instanceof String||e instanceof Number||n instanceof Number)&&e.toString()===n.toString();if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(!(e instanceof Object&&n instanceof Object))return!1;if(e.prototype!==n.prototype)return!1;if(e.constructor!==n.constructor)return!1;var r=!0,o=!1,i=void 0;try{for(var a,u=Reflect.ownKeys(n)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value;if(!Reflect.has(e,c))return!1}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}var f=!0,l=!1,s=void 0;try{for(var h,v=Reflect.ownKeys(e)[Symbol.iterator]();!(f=(h=v.next()).done);f=!0){var p=h.value;if(!Reflect.has(n,p))return!1;if(bt(n[p])!==bt(e[p]))return!1;if(!t(e[p],n[p]))return!1}}catch(t){l=!0,s=t}finally{try{f||null==v.return||v.return()}finally{if(l)throw s}}return!0},t.compose=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduceRight(function(t,e){return function o(i,a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=_t.apply(void 0,[i].concat(e));return r instanceof Function&&!0===r._curry?o(r,a):_t(a,r)}}(e,t)})},t.copyText=function(t){var e=document.createElement("input");document.body.appendChild(e),e.setAttribute("value",t),e.select();var n=document.execCommand("copy");return document.body.removeChild(e),n},t.createElByString=function(t){var e=document.createElement("div");return e.innerHTML=t,e.querySelector("*")},t.curry=_t,t.dateBetween=function(t,e){return new vt(t,e)},t.dateConstants=ft,t.dateEnhance=function(t){return new ht(t)},t.dateFormat=d,t.dateParse=B,t.debounce=function(o,t){var i,a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return new Proxy(t,{apply:function(e,n,r){return new Promise(function(t){i&&clearTimeout(i),i=setTimeout(function(){return t(a=Reflect.apply(e,n,r))},o),setTimeout(function(){return t(a)},o)})}})},t.deepFreeze=function e(t){return Y(t)?null:(t instanceof Array?t.forEach(function(t){"object"===bt(t)&&e(t)}):t instanceof Object&&(n=t,ut(n).map(function(t){return n[t]})).forEach(function(t){"object"===bt(t)&&e(t)}),Object.freeze(t));var n},t.deepProxy=function(t){var r={get:function(t,e){Reflect.set(t,e,Reflect.has(t,e)?Reflect.get(t,e):{});var n=Reflect.get(t,e);return"object"===bt(n)?new Proxy(n,r):n}};return new Proxy(t,r)},t.deletes=function(e,t){return t.forEach(function(t){return e.delete(t)}),e},t.deny=function(t){return new Proxy(t,{apply:function(t,e,n){var r=Reflect.apply(t,this,n);return r instanceof Promise?r.then(function(t){return!t}):!r}})},t.download=i,t.downloadString=function(t){return n.apply(this,arguments)},t.downloadUrl=function(t){return r.apply(this,arguments)},t.emptyAllField=function(t){return ut(t).reduce(function(t,e){return t[e]=null,t},{})},t.emptyFunc=Ht,t.excludeFields=ct,t.excludeFieldsDeep=function n(r){for(var t=arguments.length,o=new Array(1<t?t-1:0),e=1;e<t;e++)o[e-1]=arguments[e];var i=r instanceof Array?r:ct.apply(void 0,[r].concat(o));return ut(r).forEach(function(t){var e=i[t];e instanceof Object&&(r[t]=n.apply(void 0,[e].concat(o)))}),i},t.fetchTimeout=x,t.fill=C,t.filterItems=function(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:I,i=new Set(e.map(o));return t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!i.has(o.apply(void 0,[t].concat(n)))})},t.flatMap=T,t.floatEquals=function(t,e){return Math.abs(t-e)<Number.EPSILON},t.formDataToArray=function(t){return j(t.entries())},t.format=function(t,n){return n?Object.keys(n).reduce(function(t,e){return t.replace(new RegExp("{".concat(e,"}"),"g"),n[e])},t):t},t.getCookies=function(){return document.cookie.split(";").map(function(t){return t.split("=")}).map(function(t){return[t[0].trim(),t[1].trim()]}).reduce(function(t,e){var n=l(e,2),r=n[0],o=n[1];return t.set(r,o)},new Map)},t.getCusorPostion=z,t.getObjectEntries=Yt,t.getObjectKeys=ut,t.getYearWeek=function(t){var e=t.getTime()-new Date(t.getFullYear(),0,1).getTime();return Math.floor(e/864e5/7)},t.groupBy=M,t.insertText=function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:z(t),r=t.value;t.value=r.substr(0,n)+e+r.substr(n),$(t,n+e.length)},t.isBlank=function(t){return ot.isBlank(t)},t.isEditable=function(t){return t&&(t.isContentEditable||["input","date","datetime","select","textarea"].includes(G(t.tagName)))},t.isEmpty=function(t){return ot.isEmpty(t)},t.isFloat=function(t){return ot.isFloat(t)},t.isNullOrUndefined=Y,t.isNumber=function(t){return ot.isInteger(t)},t.isRange=lt,t.lastFocus=function(){return _},t.listToTree=function(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.isRoot,o=void 0===e?function(t){return!t.parentId}:e,n=t.bridge,i=void 0===n?I:n,a=r.reduce(function(t,e){var n=i(e);return r.forEach(function(t){var e=i(t);n.parentId===e.id&&(e.child=e.child||[]).push(n)}),o(n)&&t.push(n),t},[]),u=a.length;return 0===u?{}:1===u?a[0]:a},t.loadResource=function(t,e){return f.apply(this,arguments)},t.loadScript=function(r){return new Promise(function(t,e){var n=document.createElement("script");n.src=r,n.addEventListener("load",t),n.addEventListener("error",e),document.body.appendChild(n)})},t.logger=ee,t.mapToObject=function(t){var e={},n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=l(i.value,2),c=u[0],f=u[1];e[c]=f}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return e},t.nodeBridgeUtil=ce,t.objToFormData=function(t){var e=new FormData;if(t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e.append(n,r)}return e},t.objectToMap=ne,t.once=pt,t.onceOfSameParam=yt,t.parseUrl=function(t){if(!t)throw new Error("url 不能为空");var e=new RegExp("^((\\w+)://([\\w\\.]*)(:(\\d+))?)(.*)").exec(t),n=new v({url:t,website:e[1],protocol:e[2],domain:e[3],port:e[5],href:e[6]}),r=t.substr(n.website.length),o=r.indexOf("?");return-1===o?n.accessPath=r:(n.accessPath=r.substr(0,o),n.accessPath.endsWith("/")&&(n.accessPath=n.accessPath.substring(0,n.accessPath.length-1)),n.port=n.port||p[n.protocol]||"",n.params=r.substr(o+1).split("&").map(function(t){return t.split("=")}).filter(function(t){return""!==t[0]}).reduce(function(t,e){var n=decodeURIComponent(e[0]),r=decodeURIComponent(1===e.length?"":e[1]),o=t[n];return void 0!==o?(Array.isArray(o)||(t[n]=[o]),t[n].push(r)):t[n]=r,t},{})),n},t.pathUtil=te,t.randomInt=function(){var t,e;if(0===arguments.length)throw new Error("非法参数,必须指定最大值");return 1===arguments.length?(t=0,e=arguments.length<=0?void 0:arguments[0]):1<arguments.length&&(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1]),t+Math.floor(Math.random()*(e-t))},t.range=D,t.readLocal=y,t.removeEl=function(t){return t.parentElement.removeChild(t)},t.removeText=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t.selectionStart,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:t.selectionEnd,r=z(t),o=t.value;t.value=o.substr(0,e)+o.substr(n,o.length),$(t,r)},t.returnItself=I,t.returnReasonableItself=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.length;if(0!==r)return 1===r?e[0]:e},t.safeExec=J,t.setCusorPostion=$,t.sets=function(t,e){for(var n in e)t.set(n,e[n]);return t},t.singleModel=function(t){var r;return new Proxy(t,{construct:function(t,e,n){return void 0===r&&(r=Reflect.construct(t,e,n)),r}})},t.sleep=function(t){for(var e=performance.now();performance.now()-e<=t;);},t.sortBy=function t(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:I;if(e.length<=1)return e;var n=Math.floor(e.length/2),r=e.slice(),i=r.splice(n,1)[0],a=o(i,n,e),u=M(r,function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o.apply(void 0,[t].concat(n))<a});return[].concat(O(t(u.get(!0)||[],o)),[i],O(t(u.get(!1)||[],o)))},t.spliceParams=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!(t instanceof Object))throw new Error("The parameter type must be Object: ".concat(t));return Array.from(Object.entries(t)).reduce(function(t,e){var n=l(e,2),r=n[0],o=n[1];return null==o?t:(o instanceof Date?t+=w(r,d(o,g)):o instanceof Array?t+=o.map(function(t){return w(r,t instanceof Date?d(t,g):t)}).join("&"):t+=w(r,o),t+"&")},"")},t.strToArrayBuffer=function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},t.strToDate=function(t,e){return B(t,e)},t.stringStyleType=Mt,t.stringValidator=ot,t.throttle=function(i,t){var a,u=0;return new Proxy(t,{apply:function(n,r,o){return new Promise(function(t){var e=Date.now();if(i<e-u)return a=Reflect.apply(n,r,o),u=e,void t(a);t(a)})}})},t.timing=W,t.toLowerCase=G,t.toObject=function(t,a){var u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return t};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=a.apply(void 0,[e].concat(r));return Reflect.has(t,i)||(t[i]=u.apply(void 0,[e].concat(r))),t},{})},t.toString=function(t){return Y(t)?"":t instanceof Date?t.toISOString():t.toString()},t.toUpperCase=it,t.treeMapping=ae,t.treeToList=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.calcPath,r=void 0!==n&&n,o=e.bridge,i=void 0===o?I:o,a=[];return ae(t,{before:function(t,e){var n=i(t);return r&&(n.path=(e?e+",":"")+n.id),a.push(n),n},paramFn:function(t){return r?[t.path]:[]}}),a},t.trySometime=function(t){var r,u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return!0};return new Proxy(t,{apply:(r=h(s.mark(function t(e,n,r){var o,i,a;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(i<u)return t.prev=2,t.next=5,Reflect.apply(e,n,r);t.next=17;break;case 5:if(a=t.sent,!0===c(a))return t.abrupt("return",a);t.next=8;break;case 8:throw a;case 11:t.prev=11,t.t0=t.catch(2),o=t.t0;case 14:i++,t.next=1;break;case 17:throw o;case 18:case"end":return t.stop()}},t,null,[[2,11]])})),function(t,e,n){return r.apply(this,arguments)})})},t.trySometimeParallel=function(t){var r,u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return!0};return new Proxy(t,{apply:(r=h(s.mark(function t(o,i,a){return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var n=h(s.mark(function t(n,e){var r;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all(D(0,u).map(h(s.mark(function t(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Reflect.apply(o,i,a);case 3:throw e=t.sent,!0===c(e)&&n(e),e;case 8:t.prev=8,t.t0=t.catch(0),r=t.t0;case 11:case"end":return t.stop()}},t,null,[[0,8]])}))));case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.log(t.t0);case 8:e(r);case 9:case"end":return t.stop()}},t,null,[[0,5]])}));return function(t,e){return n.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t)})),function(t,e,n){return r.apply(this,arguments)})})},t.uniqueBy=function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:I,a=new Set;return t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=i.apply(void 0,[t].concat(n));return!a.has(o)&&(a.add(o),!0)})},t.wait=b,t.waitResource=function(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.interval,o=void 0===e?100:e,n=t.max,i=void 0===n?10:n,a=0;return new Promise(function(t,e){var n=setInterval(function(){r()&&(clearInterval(n),t()),i<=++a&&(clearInterval(n),e(new Error("等待超时")))},o)})},t.watch=function(e,n){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:100,r=J(e),o=setInterval(function(){var t=J(e);r!==t&&(n(t,r),r=t)},t);return function(){return clearInterval(o)}},t.watchEventListener=function(){var o=document.addEventListener,i=EventTarget.prototype.addEventListener,a=document.removeEventListener,u=EventTarget.prototype.removeEventListener,c=[],f=function t(e,n,r,o){m(this,t),this.el=e,this.type=n,this.listener=r,this.useCapture=o};function t(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=this===document?o:i;c.push(new f(this,t,e,n)),r.apply(this,arguments)}function e(t){var n=arguments,r=this,o=r===document?a:u,e=c.map(function(t,e){return t.el===r||t.type===n[0]?e:-1}).filter(function(t){return-1!==t});e.forEach(function(t){var e=c[t];o.apply(e.el,[e.type,e.listener,e.useCapture])}),e.sort(function(t,e){return e-t}).forEach(function(t){return c.splice(t,1)})}document.addEventListener=EventTarget.prototype.addEventListener=t,document.removeEventListenerByType=EventTarget.prototype.removeEventListenerByType=e},t.watchObject=function(t,o){var i={get:function(e,n,r){try{return new Proxy(e[n],i)}catch(t){return Reflect.get(e,n,r)}},set:function(t,e,n,r){return o(t,e,n),Reflect.set(t,e,n,r)}};return new Proxy(t,i)},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=rx-util.min.js.map