Comparing version 0.1.0-beta-14 to 0.1.0-beta-15
@@ -580,2 +580,57 @@ 'use strict'; | ||
var math = function (fromArray, mathType, propName) { | ||
if (mathType === void 0) { mathType = 'max'; } | ||
if (propName === void 0) { propName = ''; } | ||
var resNum = 0; | ||
if (propName !== '') { | ||
resNum = Math[mathType].apply(Math, fromArray.map(function (it) { return it[propName]; }).filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
else { | ||
resNum = Math[mathType].apply(Math, fromArray.filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
return resNum; | ||
}; | ||
var move = function (fromArray, currentIndex, propName, moveType) { | ||
if (currentIndex === void 0) { currentIndex = 0; } | ||
if (propName === void 0) { propName = ''; } | ||
if (moveType === void 0) { moveType = 'up'; } | ||
var resArr = Array.from(fromArray); | ||
if (resArr.length >= 1 && propName !== '') { | ||
var startIndex = 0; | ||
var endIndex = Number(resArr.length) - 1; | ||
if (moveType === 'down') { | ||
var nextIndex_1 = Number(currentIndex) >= Number(endIndex) ? 0 : (Number(currentIndex) + 1); | ||
var currentItem_1 = resArr[String(currentIndex)]; | ||
var nextItem_1 = resArr[String(nextIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = nextItem_1; | ||
} | ||
if (Number(nextIndex_1) === Number(index)) { | ||
item = currentItem_1; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
else { | ||
var prevIndex_1 = Number(currentIndex) <= Number(startIndex) ? Number(endIndex) : (Number(currentIndex) - 1); | ||
var currentItem_2 = resArr[String(currentIndex)]; | ||
var prevItem_1 = resArr[String(prevIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = prevItem_1; | ||
} | ||
if (Number(prevIndex_1) === Number(index)) { | ||
item = currentItem_2; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
} | ||
return resArr; | ||
}; | ||
var array = /*#__PURE__*/Object.freeze({ | ||
@@ -603,3 +658,5 @@ __proto__: null, | ||
shuffle: shuffle, | ||
column: column | ||
column: column, | ||
math: math, | ||
move: move | ||
}); | ||
@@ -606,0 +663,0 @@ |
@@ -576,2 +576,57 @@ var uniq = function (fromArray, byProp) { | ||
var math = function (fromArray, mathType, propName) { | ||
if (mathType === void 0) { mathType = 'max'; } | ||
if (propName === void 0) { propName = ''; } | ||
var resNum = 0; | ||
if (propName !== '') { | ||
resNum = Math[mathType].apply(Math, fromArray.map(function (it) { return it[propName]; }).filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
else { | ||
resNum = Math[mathType].apply(Math, fromArray.filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
return resNum; | ||
}; | ||
var move = function (fromArray, currentIndex, propName, moveType) { | ||
if (currentIndex === void 0) { currentIndex = 0; } | ||
if (propName === void 0) { propName = ''; } | ||
if (moveType === void 0) { moveType = 'up'; } | ||
var resArr = Array.from(fromArray); | ||
if (resArr.length >= 1 && propName !== '') { | ||
var startIndex = 0; | ||
var endIndex = Number(resArr.length) - 1; | ||
if (moveType === 'down') { | ||
var nextIndex_1 = Number(currentIndex) >= Number(endIndex) ? 0 : (Number(currentIndex) + 1); | ||
var currentItem_1 = resArr[String(currentIndex)]; | ||
var nextItem_1 = resArr[String(nextIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = nextItem_1; | ||
} | ||
if (Number(nextIndex_1) === Number(index)) { | ||
item = currentItem_1; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
else { | ||
var prevIndex_1 = Number(currentIndex) <= Number(startIndex) ? Number(endIndex) : (Number(currentIndex) - 1); | ||
var currentItem_2 = resArr[String(currentIndex)]; | ||
var prevItem_1 = resArr[String(prevIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = prevItem_1; | ||
} | ||
if (Number(prevIndex_1) === Number(index)) { | ||
item = currentItem_2; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
} | ||
return resArr; | ||
}; | ||
var array = /*#__PURE__*/Object.freeze({ | ||
@@ -599,3 +654,5 @@ __proto__: null, | ||
shuffle: shuffle, | ||
column: column | ||
column: column, | ||
math: math, | ||
move: move | ||
}); | ||
@@ -602,0 +659,0 @@ |
@@ -1,1 +0,1 @@ | ||
var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,a=0,u=e;a<u.length;a++){var i=u[a];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var l=Number(r);o.has(i[l])||(t.push(i),o.add(i[l]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t};function t(e,r,t,n){return new(t||(t=Promise))((function(o,a){function u(e){try{l(n.next(e))}catch(e){a(e)}}function i(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(u,i)}l((n=n.apply(e,r||[])).next())}))}function n(e,r){var t,n,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(u=0)),u;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(e,u)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function o(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var a=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,a=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=u(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},u=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(a(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return a(e)}))},u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var a=e;a[n.parent]=r[n.prop],"object"==typeof a[n.children]&&Array.isArray(a[n.children])&&(o(a[n.children],e),delete a[n.children]),t.push(a)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},i=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var u=a[o];u in n&&delete n[u]}return n},l=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,u=Object.keys(e);a<u.length;a++){var i=u[a];o.has(String(e[i]))||(n[i]=e[i])}return n},c=i,f=l,m=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return n<o?a=-1:n>o&&(a=1),a}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return o<n?a=-1:o>n&&(a=1),a}}})),n},s=m,v=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:a,nestedAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(a(t,r))]}}))}))},flatten:u,flattenAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var a=[],u=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));a=r(o(o([],a,!0),n,!0))},i=0,l=t.flat();i<l.length;i++){u(l[i])}return a},searchBy:function(e,t,n){for(var a=[],u=function(t){var u=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var a=o[r];if(a in e){if(!1===isNaN(e[a])&&Number(e[a])===Number(t))return!0;if("string"==typeof e[a]&&-1!==String(e[a]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));a=r(o(o([],a,!0),u,!0))},i=0,l=t;i<l.length;i++){u(l[i])}return a},filter:function(e,r){for(var t=Array.from(e),n=l(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},a=0,u=Object.keys(n);a<u.length;a++){o(u[a])}return t},sortBy:m,sort:s,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return n.slice(o-1,a<=n.length?a:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageStart:function(e,r){return void 0===e&&(e=1),void 0===r&&(r=10),(Number(e)-1)*Number(r)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:a<=n.length?a:n.length,end:a<=n.length?a:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),a=Number(r)<1?1:Number(r),u=o+Number(t),i=a-Number(t);if(0===Number(t))for(var l=1;l<=Number(e);l++)n.push(String(l));else{if(a>1)for(l=i;l<a;l++)n.push(String(l));for(l=o;l<=u;l++)n.push(String(l))}var c=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return u<Number(e)&&0!==Number(t)&&c.push("..."),i>1&&0!==Number(t)&&c.unshift("..."),c},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},a=0,u=n;a<u.length;a++){o(u[a])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var a=function(o){var a=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))},u=0,i=o;u<i.length;u++){a(i[u])}return t},shuffle:function(e){for(var r,t=e,n=e.length,o=0;n>=1;)o=Math.floor(Math.random()*n),n--,r=[t[o],t[n]],t[n]=r[0],t[o]=r[1];return t},column:function(e,r){void 0===r&&(r=2);for(var t=[],n=Math.ceil(Number(Array.from(e).length)/Number(r)),o=0;o<Number(r);o++){var a=Number(o)*Number(n),u=(Number(o)+1)*Number(n),i=Array.from(e).slice(a,u);t.push(i)}return t}}),d=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},b=function(e,r,t,n){void 0===r&&(r=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date(e||null),a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())," ").concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds()));return""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate())," ").concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),"date"===r?(a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate()))),""!==t&&(a=o.toLocaleDateString(t,n))):"time"===r?(a="".concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),""!==t&&(a=o.toLocaleTimeString(t,n))):""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o)),a},h=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},N=function(){return Number((new Date).getFullYear())},g=function(){return Number((new Date).getMonth())},p=function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},y=function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},w=function(e){return void 0===e&&(e=N()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},D=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},M=function(e){void 0===e&&(e=new Date);for(var r=[],t=new Date(e||null),n=Number(t.getDay());n>=0;n--)r.push(b(new Date(t.getFullYear(),t.getMonth(),Number(t.getDate())-Number(n)),"date"));for(var o=Number(t.getDay())-1;o<5;o++)r.push(b(new Date(t.getFullYear(),t.getMonth(),Number(t.getDate())+Number(o)),"date"));return r},S=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return b(n,e,r,t)},format:b,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)<h(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)>h(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=h(e,n),a=h(r,n),u=h(t,n),i=!1;return o>=a&&o<=u&&(i=!0),i},daysInMonth:p,daysOfPrevMonth:y,daysOfNextMonth:function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());var t=Number(new Date(e,Number(r)-1,p(e,r)).getDay()),n=6-Number(t),o=Number(p(e,r))+Number(y(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:w,daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=h(e,t),o=h(r,t),a=Number(o)-Number(n);return Math.floor(a/864e5)},monthsInBetween:D,yearsInBetween:function(e,r){return Math.floor(D(e,r)/12)},doubleFormat:d,day:function(e,r,t){void 0===e&&(e=new Date),void 0===r&&(r="en-US"),void 0===t&&(t="long");var n=new Date(e);return new Intl.DateTimeFormat(r,{weekday:t}).format(n)},days:function(e,r,t){void 0===e&&(e=new Date),void 0===r&&(r="en-US"),void 0===t&&(t="long");for(var n=[],o=0,a=M(e);o<a.length;o++){var u=a[o],i={},l=new Date(u||null);i.value=u,i.text=new Intl.DateTimeFormat(r,{weekday:t}).format(l),n.push(i)}return n},week:function(e){void 0===e&&(e=new Date);var r=new Date(e||null);r.setTime(r.getTime()+864e5);var t=new Date(r.getFullYear(),0,1),n=Math.floor((Number(r.valueOf())-Number(t.valueOf()))/864e5),o=0;return 0!==Number(t.getDay())&&(o=1),Number(Math.ceil(n/7))-Number(o)},weeks:function(){var e=Number(w((new Date).getFullYear())),r=new Date((new Date).getFullYear(),0,1),t=0;return 0!==Number(r.getDay())&&(t=1),Number(Math.ceil(e/7))-Number(t)},weekDates:M,month:function(e,r,t,n){void 0===e&&(e=N()),void 0===r&&(r=g()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var a={},u=new Date(n,o);a.value=d(Number(o)+1),a.text=new Intl.DateTimeFormat(e,{month:r}).format(u),t.push(a)}return t},years:function(e,r,t){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5),void 0===t&&(t=!1);for(var n=[],o=Number(e)-(Number(r)+1),a=Number(e)+Number(r),u=o;u<=a;u++)if(t){var i={value:u,text:u};u===o?i.text="Prev":u===a&&(i.text="Next"),n.push(i)}else n.push(u);return n},add:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()+(r||1)),b(a,t,n,o)},sub:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()-(r||1)),b(a,t,n,o)}}),A=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",a=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var u=String(Number(e));u=u.includes(".")?(u=Number(u).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";a=(a=a.split(i)[0].trim())+i+u}return a},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),a=Math.floor(Math.random()*Number(o));return a<=n&&(a=Number(n)+Number(a)),a},isBetween:function(e,r,t){var n=Number(e),o=Number(r),a=Number(t),u=!1;return n>=o&&n<=a&&(u=!0),u}}),C=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[0].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},T=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[1].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},F=C,O=T,j=Object.freeze({__proto__:null,remove:i,removeBy:l,removeByKey:c,removeByVal:f,filter:C,filterBy:T,filterByKey:F,filterByVal:O,count:function(e){return Number(Object.entries(e).length)}}),_=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},U=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},I=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},L=Object.freeze({__proto__:null,urlEncode:_,urlDecode:U,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(_(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(U(t,r))]}}))}))},urlData:function(e,r){return"data:".concat(r,";base64,").concat(e)},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(JSON.parse((new Date).toJSON().replace(/-|T|Z|:|\./g,"")));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(52*Math.random())),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:I,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),x=function(e,r,t){var n;void 0===r&&(r=":"),void 0===t&&(t=3);var o=null===(n=null==e?void 0:e.split(r))||void 0===n?void 0:n.slice(0,t);if(o.length<t)for(var a=0;a<Number(t)-Number(o.length);a++)o.push("0");return o.join(r)},B=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var a=new Date,u=new Date(e);"utc"!==r&&(u=new Date(new Date(e).toJSON()));var i=Math.round((u.valueOf()-a.valueOf())/1e3),l=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(l="".concat(Math.abs(Math.round(i)),"s"));var c=i/31536e3;if(Math.abs(c)>1){var f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"y"))}else if(c=i/2592e3,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"mo"))}else if(c=i/86400,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"d"))}else if(c=i/3600,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"h"))}else if(c=i/60,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"m"))}return l},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))},reading:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=250),void 0===t&&(t="minute");var n=e.split(" ").length,o=Number(n)/Number(r);return"second"===t?o=60*Number(o):"millisecond"===t&&(o=6e4*Number(o)),Math.ceil(o)},now:function(e,r){void 0===e&&(e=":"),void 0===r&&(r=3);var t=(new Date).toTimeString().split(" ")[0];return t=x(t,e,r)},format:x,double:function(e,r,t){void 0===r&&(r=":"),void 0===t&&(t="double");var n=e.split(r);return"double"===t?n=n.map((function(e){return e.length<=1&&(e="0"+e),e})):"normal"===t&&(n=n.map((function(e,r){return e.length<=1&&r>=1&&(e="0"+e),e}))),n.join(r)},toDecimal:function(e,r,t,n){void 0===r&&(r=2),void 0===t&&(t=":"),void 0===n&&(n=".");var o=100/60,a=e.trim().split(t),u=0;if(a.length>=2&&(u=Number(a[1])*Number(o),a.length>=3)){var i=String(a[2]).split(n),l=Number(i[0])*Number(o)/100,c=0;i.length>=2&&(c=Number(i[1])/1e3),u=Number(u)+(Number(l)+Number(c))}return(Number(a[0])+Number(u)/100).toFixed(r)},fromDecimal:function(e,r,t){void 0===r&&(r=":"),void 0===t&&(t=2);var n=String(e).split("."),o="00";return n.length>=2&&(o=(o=(60*Number("0."+n[1])).toFixed(2)).replace(".",":")),x(n[0]+r+o,r,t)}});return e.array=v,e.date=S,e.number=A,e.object=j,e.string=L,e.time=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,u=0,a=e;u<a.length;u++){var i=a[u];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var l=Number(r);o.has(i[l])||(t.push(i),o.add(i[l]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t};function t(e,r,t,n){return new(t||(t=Promise))((function(o,u){function a(e){try{l(n.next(e))}catch(e){u(e)}}function i(e){try{l(n.throw(e))}catch(e){u(e)}}function l(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,i)}l((n=n.apply(e,r||[])).next())}))}function n(e,r){var t,n,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;u&&(u=0,i[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function o(e,r,t){if(t||2===arguments.length)for(var n,o=0,u=r.length;o<u;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,u=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=a(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},a=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(u(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return u(e)}))},a=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var u=e;u[n.parent]=r[n.prop],"object"==typeof u[n.children]&&Array.isArray(u[n.children])&&(o(u[n.children],e),delete u[n.children]),t.push(u)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},i=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,u=r;o<u.length;o++){var a=u[o];a in n&&delete n[a]}return n},l=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),u=0,a=Object.keys(e);u<a.length;u++){var i=a[u];o.has(String(e[i]))||(n[i]=e[i])}return n},c=i,f=l,m=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),u=0;return n<o?u=-1:n>o&&(u=1),u}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),u=0;return o<n?u=-1:o>n&&(u=1),u}}})),n},s=m,v=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:u,nestedAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},flatten:a,flattenAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(a(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var u=[],a=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));u=r(o(o([],u,!0),n,!0))},i=0,l=t.flat();i<l.length;i++){a(l[i])}return u},searchBy:function(e,t,n){for(var u=[],a=function(t){var a=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var u=o[r];if(u in e){if(!1===isNaN(e[u])&&Number(e[u])===Number(t))return!0;if("string"==typeof e[u]&&-1!==String(e[u]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));u=r(o(o([],u,!0),a,!0))},i=0,l=t;i<l.length;i++){a(l[i])}return u},filter:function(e,r){for(var t=Array.from(e),n=l(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},u=0,a=Object.keys(n);u<a.length;u++){o(a[u])}return t},sortBy:m,sort:s,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),u=Number(t)*Number(r);return n.slice(o-1,u<=n.length?u:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageStart:function(e,r){return void 0===e&&(e=1),void 0===r&&(r=10),(Number(e)-1)*Number(r)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),u=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:u<=n.length?u:n.length,end:u<=n.length?u:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),u=Number(r)<1?1:Number(r),a=o+Number(t),i=u-Number(t);if(0===Number(t))for(var l=1;l<=Number(e);l++)n.push(String(l));else{if(u>1)for(l=i;l<u;l++)n.push(String(l));for(l=o;l<=a;l++)n.push(String(l))}var c=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return a<Number(e)&&0!==Number(t)&&c.push("..."),i>1&&0!==Number(t)&&c.unshift("..."),c},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},u=0,a=n;u<a.length;u++){o(a[u])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var u=function(o){var u=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(u.length)||(n.add(u.length),t[u.length]=[]),u.forEach((function(e){t[u.length].push(e)}))},a=0,i=o;a<i.length;a++){u(i[a])}return t},shuffle:function(e){for(var r,t=e,n=e.length,o=0;n>=1;)o=Math.floor(Math.random()*n),n--,r=[t[o],t[n]],t[n]=r[0],t[o]=r[1];return t},column:function(e,r){void 0===r&&(r=2);for(var t=[],n=Math.ceil(Number(Array.from(e).length)/Number(r)),o=0;o<Number(r);o++){var u=Number(o)*Number(n),a=(Number(o)+1)*Number(n),i=Array.from(e).slice(u,a);t.push(i)}return t},math:function(e,r,t){void 0===r&&(r="max"),void 0===t&&(t="");return""!==t?Math[r].apply(Math,e.map((function(e){return e[t]})).filter((function(e){return!1===isNaN(e)}))):Math[r].apply(Math,e.filter((function(e){return!1===isNaN(e)})))},move:function(e,r,t,n){void 0===r&&(r=0),void 0===t&&(t=""),void 0===n&&(n="up");var o=Array.from(e);if(o.length>=1&&""!==t){var u=Number(o.length)-1;if("down"===n){var a=Number(r)>=Number(u)?0:Number(r)+1,i=o[String(r)],l=o[String(a)];o=o.map((function(e,n){return Number(r)===Number(n)&&(e=l),Number(a)===Number(n)&&(e=i),e[t]=Number(n)+1,e}))}else{var c=Number(r)<=Number(0)?Number(u):Number(r)-1,f=o[String(r)],m=o[String(c)];o=o.map((function(e,n){return Number(r)===Number(n)&&(e=m),Number(c)===Number(n)&&(e=f),e[t]=Number(n)+1,e}))}}return o}}),d=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},b=function(e,r,t,n){void 0===r&&(r=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date(e||null),u="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())," ").concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds()));return""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(u="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate())," ").concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),"date"===r?(u="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(u="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate()))),""!==t&&(u=o.toLocaleDateString(t,n))):"time"===r?(u="".concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(u="".concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),""!==t&&(u=o.toLocaleTimeString(t,n))):""!==t&&(u=new Intl.DateTimeFormat(t,n).format(o)),u},h=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},N=function(){return Number((new Date).getFullYear())},g=function(){return Number((new Date).getMonth())},p=function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},y=function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},w=function(e){return void 0===e&&(e=N()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},D=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},M=function(e){void 0===e&&(e=new Date);for(var r=[],t=new Date(e||null),n=Number(t.getDay());n>=0;n--)r.push(b(new Date(t.getFullYear(),t.getMonth(),Number(t.getDate())-Number(n)),"date"));for(var o=Number(t.getDay())-1;o<5;o++)r.push(b(new Date(t.getFullYear(),t.getMonth(),Number(t.getDate())+Number(o)),"date"));return r},S=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return b(n,e,r,t)},format:b,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)<h(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)>h(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=h(e,n),u=h(r,n),a=h(t,n),i=!1;return o>=u&&o<=a&&(i=!0),i},daysInMonth:p,daysOfPrevMonth:y,daysOfNextMonth:function(e,r){void 0===e&&(e=N()),void 0===r&&(r=g());var t=Number(new Date(e,Number(r)-1,p(e,r)).getDay()),n=6-Number(t),o=Number(p(e,r))+Number(y(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:w,daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=h(e,t),o=h(r,t),u=Number(o)-Number(n);return Math.floor(u/864e5)},monthsInBetween:D,yearsInBetween:function(e,r){return Math.floor(D(e,r)/12)},doubleFormat:d,day:function(e,r,t){void 0===e&&(e=new Date),void 0===r&&(r="en-US"),void 0===t&&(t="long");var n=new Date(e);return new Intl.DateTimeFormat(r,{weekday:t}).format(n)},days:function(e,r,t){void 0===e&&(e=new Date),void 0===r&&(r="en-US"),void 0===t&&(t="long");for(var n=[],o=0,u=M(e);o<u.length;o++){var a=u[o],i={},l=new Date(a||null);i.value=a,i.text=new Intl.DateTimeFormat(r,{weekday:t}).format(l),n.push(i)}return n},week:function(e){void 0===e&&(e=new Date);var r=new Date(e||null);r.setTime(r.getTime()+864e5);var t=new Date(r.getFullYear(),0,1),n=Math.floor((Number(r.valueOf())-Number(t.valueOf()))/864e5),o=0;return 0!==Number(t.getDay())&&(o=1),Number(Math.ceil(n/7))-Number(o)},weeks:function(){var e=Number(w((new Date).getFullYear())),r=new Date((new Date).getFullYear(),0,1),t=0;return 0!==Number(r.getDay())&&(t=1),Number(Math.ceil(e/7))-Number(t)},weekDates:M,month:function(e,r,t,n){void 0===e&&(e=N()),void 0===r&&(r=g()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var u={},a=new Date(n,o);u.value=d(Number(o)+1),u.text=new Intl.DateTimeFormat(e,{month:r}).format(a),t.push(u)}return t},years:function(e,r,t){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5),void 0===t&&(t=!1);for(var n=[],o=Number(e)-(Number(r)+1),u=Number(e)+Number(r),a=o;a<=u;a++)if(t){var i={value:a,text:a};a===o?i.text="Prev":a===u&&(i.text="Next"),n.push(i)}else n.push(a);return n},add:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var u=new Date(e||null);return u.setDate(u.getDate()+(r||1)),b(u,t,n,o)},sub:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var u=new Date(e||null);return u.setDate(u.getDate()-(r||1)),b(u,t,n,o)}}),A=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",u=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var a=String(Number(e));a=a.includes(".")?(a=Number(a).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";u=(u=u.split(i)[0].trim())+i+a}return u},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),u=Math.floor(Math.random()*Number(o));return u<=n&&(u=Number(n)+Number(u)),u},isBetween:function(e,r,t){var n=Number(e),o=Number(r),u=Number(t),a=!1;return n>=o&&n<=u&&(a=!0),a}}),C=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[0].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},T=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[1].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},F=C,O=T,j=Object.freeze({__proto__:null,remove:i,removeBy:l,removeByKey:c,removeByVal:f,filter:C,filterBy:T,filterByKey:F,filterByVal:O,count:function(e){return Number(Object.entries(e).length)}}),_=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},U=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},I=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},x=Object.freeze({__proto__:null,urlEncode:_,urlDecode:U,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(_(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(U(t,r))]}}))}))},urlData:function(e,r){return"data:".concat(r,";base64,").concat(e)},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(JSON.parse((new Date).toJSON().replace(/-|T|Z|:|\./g,"")));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(52*Math.random())),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:I,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=I(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),L=function(e,r,t){var n;void 0===r&&(r=":"),void 0===t&&(t=3);var o=null===(n=null==e?void 0:e.split(r))||void 0===n?void 0:n.slice(0,t);if(o.length<t)for(var u=0;u<Number(t)-Number(o.length);u++)o.push("0");return o.join(r)},B=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var u=new Date,a=new Date(e);"utc"!==r&&(a=new Date(new Date(e).toJSON()));var i=Math.round((a.valueOf()-u.valueOf())/1e3),l=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(l="".concat(Math.abs(Math.round(i)),"s"));var c=i/31536e3;if(Math.abs(c)>1){var f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"y"))}else if(c=i/2592e3,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"mo"))}else if(c=i/86400,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"d"))}else if(c=i/3600,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"h"))}else if(c=i/60,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"m"))}return l},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))},reading:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=250),void 0===t&&(t="minute");var n=e.split(" ").length,o=Number(n)/Number(r);return"second"===t?o=60*Number(o):"millisecond"===t&&(o=6e4*Number(o)),Math.ceil(o)},now:function(e,r){void 0===e&&(e=":"),void 0===r&&(r=3);var t=(new Date).toTimeString().split(" ")[0];return t=L(t,e,r)},format:L,double:function(e,r,t){void 0===r&&(r=":"),void 0===t&&(t="double");var n=e.split(r);return"double"===t?n=n.map((function(e){return e.length<=1&&(e="0"+e),e})):"normal"===t&&(n=n.map((function(e,r){return e.length<=1&&r>=1&&(e="0"+e),e}))),n.join(r)},toDecimal:function(e,r,t,n){void 0===r&&(r=2),void 0===t&&(t=":"),void 0===n&&(n=".");var o=100/60,u=e.trim().split(t),a=0;if(u.length>=2&&(a=Number(u[1])*Number(o),u.length>=3)){var i=String(u[2]).split(n),l=Number(i[0])*Number(o)/100,c=0;i.length>=2&&(c=Number(i[1])/1e3),a=Number(a)+(Number(l)+Number(c))}return(Number(u[0])+Number(a)/100).toFixed(r)},fromDecimal:function(e,r,t){void 0===r&&(r=":"),void 0===t&&(t=2);var n=String(e).split("."),o="00";return n.length>=2&&(o=(o=(60*Number("0."+n[1])).toFixed(2)).replace(".",":")),L(n[0]+r+o,r,t)}});return e.array=v,e.date=S,e.number=A,e.object=j,e.string=x,e.time=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
@@ -564,2 +564,57 @@ 'use strict'; | ||
var math = function (fromArray, mathType, propName) { | ||
if (mathType === void 0) { mathType = 'max'; } | ||
if (propName === void 0) { propName = ''; } | ||
var resNum = 0; | ||
if (propName !== '') { | ||
resNum = Math[mathType].apply(Math, fromArray.map(function (it) { return it[propName]; }).filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
else { | ||
resNum = Math[mathType].apply(Math, fromArray.filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
return resNum; | ||
}; | ||
var move = function (fromArray, currentIndex, propName, moveType) { | ||
if (currentIndex === void 0) { currentIndex = 0; } | ||
if (propName === void 0) { propName = ''; } | ||
if (moveType === void 0) { moveType = 'up'; } | ||
var resArr = Array.from(fromArray); | ||
if (resArr.length >= 1 && propName !== '') { | ||
var startIndex = 0; | ||
var endIndex = Number(resArr.length) - 1; | ||
if (moveType === 'down') { | ||
var nextIndex_1 = Number(currentIndex) >= Number(endIndex) ? 0 : (Number(currentIndex) + 1); | ||
var currentItem_1 = resArr[String(currentIndex)]; | ||
var nextItem_1 = resArr[String(nextIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = nextItem_1; | ||
} | ||
if (Number(nextIndex_1) === Number(index)) { | ||
item = currentItem_1; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
else { | ||
var prevIndex_1 = Number(currentIndex) <= Number(startIndex) ? Number(endIndex) : (Number(currentIndex) - 1); | ||
var currentItem_2 = resArr[String(currentIndex)]; | ||
var prevItem_1 = resArr[String(prevIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = prevItem_1; | ||
} | ||
if (Number(prevIndex_1) === Number(index)) { | ||
item = currentItem_2; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
} | ||
return resArr; | ||
}; | ||
exports.column = column; | ||
@@ -571,2 +626,4 @@ exports.duplication = duplication; | ||
exports.flattenAsync = flattenAsync; | ||
exports.math = math; | ||
exports.move = move; | ||
exports.nested = nested; | ||
@@ -573,0 +630,0 @@ exports.nestedAsync = nestedAsync; |
@@ -560,2 +560,57 @@ var uniq = function (fromArray, byProp) { | ||
export { column, duplication, duplicationGroup, filter, flatten, flattenAsync, nested, nestedAsync, order, pageInfo, pageStart, pages, paginate, pagination, search, searchBy, shuffle, sort, sortBy, take, uniq }; | ||
var math = function (fromArray, mathType, propName) { | ||
if (mathType === void 0) { mathType = 'max'; } | ||
if (propName === void 0) { propName = ''; } | ||
var resNum = 0; | ||
if (propName !== '') { | ||
resNum = Math[mathType].apply(Math, fromArray.map(function (it) { return it[propName]; }).filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
else { | ||
resNum = Math[mathType].apply(Math, fromArray.filter(function (i) { return isNaN(i) === false; })); | ||
} | ||
return resNum; | ||
}; | ||
var move = function (fromArray, currentIndex, propName, moveType) { | ||
if (currentIndex === void 0) { currentIndex = 0; } | ||
if (propName === void 0) { propName = ''; } | ||
if (moveType === void 0) { moveType = 'up'; } | ||
var resArr = Array.from(fromArray); | ||
if (resArr.length >= 1 && propName !== '') { | ||
var startIndex = 0; | ||
var endIndex = Number(resArr.length) - 1; | ||
if (moveType === 'down') { | ||
var nextIndex_1 = Number(currentIndex) >= Number(endIndex) ? 0 : (Number(currentIndex) + 1); | ||
var currentItem_1 = resArr[String(currentIndex)]; | ||
var nextItem_1 = resArr[String(nextIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = nextItem_1; | ||
} | ||
if (Number(nextIndex_1) === Number(index)) { | ||
item = currentItem_1; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
else { | ||
var prevIndex_1 = Number(currentIndex) <= Number(startIndex) ? Number(endIndex) : (Number(currentIndex) - 1); | ||
var currentItem_2 = resArr[String(currentIndex)]; | ||
var prevItem_1 = resArr[String(prevIndex_1)]; | ||
resArr = resArr.map(function (item, index) { | ||
if (Number(currentIndex) === Number(index)) { | ||
item = prevItem_1; | ||
} | ||
if (Number(prevIndex_1) === Number(index)) { | ||
item = currentItem_2; | ||
} | ||
item[propName] = Number(index) + 1; | ||
return item; | ||
}); | ||
} | ||
} | ||
return resArr; | ||
}; | ||
export { column, duplication, duplicationGroup, filter, flatten, flattenAsync, math, move, nested, nestedAsync, order, pageInfo, pageStart, pages, paginate, pagination, search, searchBy, shuffle, sort, sortBy, take, uniq }; |
@@ -1,1 +0,1 @@ | ||
var array=function(r){"use strict";var e=function(r,e){void 0===e&&(e="");for(var n=[],t=Number(e),o=new Set,i=0,u=r;i<u.length;i++){var a=u[i];if("object"==typeof a&&null!==a&&"string"==typeof e&&""!==e&&!1===Array.isArray(a))o.has(a[e])||(n.push(a),o.add(a[e]));else if(Array.isArray(a)&&!1===isNaN(t)&&Number(a.length)>Number(e)){var f=Number(e);o.has(a[f])||(n.push(a),o.add(a[f]))}else o.has(JSON.stringify(a))||(n.push(a),o.add(JSON.stringify(a)))}return n};function n(r,e,n,t){return new(n||(n=Promise))((function(o,i){function u(r){try{f(t.next(r))}catch(r){i(r)}}function a(r){try{f(t.throw(r))}catch(r){i(r)}}function f(r){var e;r.done?o(r.value):(e=r.value,e instanceof n?e:new n((function(r){r(e)}))).then(u,a)}f((t=t.apply(r,e||[])).next())}))}function t(r,e){var n,t,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(f){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,t=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=e.call(r,u)}catch(r){a=[6,r],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,f])}}}function o(r,e,n){if(n||2===arguments.length)for(var t,o=0,i=e.length;o<i;o++)!t&&o in e||(t||(t=Array.prototype.slice.call(e,0,o)),t[o]=e[o]);return r.concat(t||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var i=function(r,e){void 0===e&&(e={prop:"id",parent:"parent",children:"children"});var n,t=Array.from(r),o=e,i=function(r){var e=r;return void 0!==r[o.children]&&null!==r[o.children]||(e[o.children]=u(r[o.prop]),e[o.children].length<=0&&delete e[o.children]),delete e[o.parent],e},u=function(r){var e=[];return a(r).length>=1&&a(r).forEach((function(r){e.push(i(r))})),e},a=function(r){return t.filter((function(e){return e[o.parent]===r}))};return(n=t).filter((function(r){return"object"==typeof r&&null!==r&&!n.map((function(r){return String(r[o.prop]).trim()})).includes(String(r[o.parent]).trim())})).map((function(r){return i(r)}))},u=function(r,e){void 0===e&&(e={prop:"id",parent:"parent",children:"children"});var n=[],t=e,o=function(r,e){r.length>=1&&Array.from(r).forEach((function(r){if("object"==typeof r&&null!==r){var i=r;i[t.parent]=e[t.prop],"object"==typeof i[t.children]&&Array.isArray(i[t.children])&&(o(i[t.children],r),delete i[t.children]),n.push(i)}}))};return Array.from(r).forEach((function(r){if("object"==typeof r&&null!==r){var e=r;e[t.parent]="0","object"==typeof e[t.children]&&Array.isArray(e[t.children])&&(o(e[t.children],r),delete e[t.children]),n.push(e)}})),n},a=function(r,e,n){void 0===n&&(n="asc");var t=Array.from(r);return"asc"===n?t.sort((function(r,n){if(e in r&&e in n){if(!1===isNaN(r[e])&&!1===isNaN(n[e]))return Number(r[e])-Number(n[e]);if("string"==typeof r[e]&&"string"==typeof n[e]){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),i=0;return t<o?i=-1:t>o&&(i=1),i}}})):"desc"===n&&t.sort((function(r,n){if(e in r&&e in n){if(!1===isNaN(r[e])&&!1===isNaN(n[e]))return Number(n[e])-Number(r[e]);if("string"==typeof r[e]&&"string"==typeof n[e]){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),i=0;return o<t?i=-1:o>t&&(i=1),i}}})),t},f=a;return r.column=function(r,e){void 0===e&&(e=2);for(var n=[],t=Math.ceil(Number(Array.from(r).length)/Number(e)),o=0;o<Number(e);o++){var i=Number(o)*Number(t),u=(Number(o)+1)*Number(t),a=Array.from(r).slice(i,u);n.push(a)}return n},r.duplication=function(r,e){void 0===e&&(e="");var n=[],t=Array.from(new Set(r));""!==e&&(t=Array.from(new Set(r.map((function(r){return r[e]})))));for(var o=function(t){var o=Array.from(r).filter((function(r){return""!==e?r[e]===t:r===t}));Number(o.length)>=2&&o.forEach((function(r){n.push(r)}))},i=0,u=t;i<u.length;i++){o(u[i])}return n},r.duplicationGroup=function(r,e){void 0===e&&(e="");var n={},t=new Set,o=Array.from(new Set(r));""!==e&&(o=Array.from(new Set(r.map((function(r){return r[e]})))));for(var i=function(o){var i=Array.from(r).filter((function(r){return""!==e?r[e]===o:r===o}));t.has(i.length)||(t.add(i.length),n[i.length]=[]),i.forEach((function(r){n[i.length].push(r)}))},u=0,a=o;u<a.length;u++){i(a[u])}return n},r.filter=function(r,e){for(var n=Array.from(r),t=function(r){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var t={},o=new Set(e.map((function(r){return String(r)}))),i=0,u=Object.keys(r);i<u.length;i++){var a=u[i];o.has(String(r[a]))||(t[a]=r[a])}return t}(e,"",0),o=function(r){var e=n.filter((function(e){if(r in e){if(!1===isNaN(e[r])&&Number(e[r])===Number(t[r]))return!0;if("string"==typeof e[r]&&String(e[r]).toLowerCase().includes(String(t[r]).toLowerCase()))return!0}return!1}));n=e},i=0,u=Object.keys(t);i<u.length;i++){o(u[i])}return n},r.flatten=u,r.flattenAsync=function(r,e){return void 0===e&&(e={}),n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Promise.resolve(r)];case 1:return n=t.sent(),[2,Promise.resolve(u(n,e))]}}))}))},r.nested=i,r.nestedAsync=function(r,e){return void 0===e&&(e={}),n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Promise.resolve(r)];case 1:return n=t.sent(),[2,Promise.resolve(i(n,e))]}}))}))},r.order=function(r,e){return void 0===e&&(e="order"),Array.from(r).map((function(r,n){return"object"==typeof r&&null!==r&&(r[e]=Number(n)+1),r}))},r.pageInfo=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=10);var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),i=Number(n)*Number(e);return{from:t.length>=1?o:0,start:t.length>=1?o:0,to:i<=t.length?i:t.length,end:i<=t.length?i:t.length,of:t.length,length:t.length}},r.pageStart=function(r,e){return void 0===r&&(r=1),void 0===e&&(e=10),(Number(r)-1)*Number(e)},r.pages=function(r,e){void 0===e&&(e=10);var n=Array.isArray(r)?r.length:r,t=Number(n)/Number(e);return Math.ceil(t)},r.paginate=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=10);var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),i=Number(n)*Number(e);return t.slice(o-1,i<=t.length?i:t.length)},r.pagination=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var t=[],o=Number(r)<Number(e)?Number(r):Number(e),i=Number(e)<1?1:Number(e),u=o+Number(n),a=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(r);f++)t.push(String(f));else{if(i>1)for(f=a;f<i;f++)t.push(String(f));for(f=o;f<=u;f++)t.push(String(f))}var c=t.filter((function(r){return Number(r)>0})).filter((function(e){return Number(e)<=Number(r)}));return u<Number(r)&&0!==Number(n)&&c.push("..."),a>1&&0!==Number(n)&&c.unshift("..."),c},r.search=function(r){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var i=[],u=function(n){var t=Array.from(r).filter((function(r){if(!1===isNaN(r)&&Number(r)===Number(n))return!0;if("string"==typeof r&&String(r).toLowerCase().includes(String(n).toLowerCase()))return!0;if("object"==typeof r&&null!==r)for(var e=0,t=Object.keys(r);e<t.length;e++){var o=t[e];if(!1===isNaN(r[o])&&Number(r[o])===Number(n))return!0;if("string"==typeof r[o]&&String(r[o]).toLowerCase().includes(String(n).toLowerCase()))return!0}return!1}));i=e(o(o([],i,!0),t,!0))},a=0,f=n.flat();a<f.length;a++){u(f[a])}return i},r.searchBy=function(r,n,t){for(var i=[],u=function(n){var u=Array.from(r).filter((function(r){for(var e=0,o=Array.from(t);e<o.length;e++){var i=o[e];if(i in r){if(!1===isNaN(r[i])&&Number(r[i])===Number(n))return!0;if("string"==typeof r[i]&&-1!==String(r[i]).toLowerCase().indexOf(String(n).toLowerCase()))return!0}}return!1}));i=e(o(o([],i,!0),u,!0))},a=0,f=n;a<f.length;a++){u(f[a])}return i},r.shuffle=function(r){for(var e,n=r,t=r.length,o=0;t>=1;)o=Math.floor(Math.random()*t),t--,e=[n[o],n[t]],n[t]=e[0],n[o]=e[1];return n},r.sort=f,r.sortBy=a,r.take=function(r,e,n){void 0===n&&(n="");var t=[],o=Number(e);return Array.isArray(r)&&r.length>=1&&("object"==typeof r[0]&&null!==r[0]&&"string"==typeof e&&Object.keys(r[0]).includes(e)?(t=r.map((function(r){return r[e]})),"uniq"===n&&(t=Array.from(new Set(t)))):Array.isArray(r[0])&&!1===isNaN(o)?(t=r.map((function(r){return r[o]})),"uniq"===n&&(t=Array.from(new Set(t)))):"function"==typeof e&&(t=r.filter((function(r){return e(r)})),""!==n&&(t=t.map((function(r){return r[n]}))))),t},r.uniq=e,Object.defineProperty(r,"__esModule",{value:!0}),r}({}); | ||
var array=function(r){"use strict";var e=function(r,e){void 0===e&&(e="");for(var n=[],t=Number(e),u=new Set,i=0,o=r;i<o.length;i++){var a=o[i];if("object"==typeof a&&null!==a&&"string"==typeof e&&""!==e&&!1===Array.isArray(a))u.has(a[e])||(n.push(a),u.add(a[e]));else if(Array.isArray(a)&&!1===isNaN(t)&&Number(a.length)>Number(e)){var f=Number(e);u.has(a[f])||(n.push(a),u.add(a[f]))}else u.has(JSON.stringify(a))||(n.push(a),u.add(JSON.stringify(a)))}return n};function n(r,e,n,t){return new(n||(n=Promise))((function(u,i){function o(r){try{f(t.next(r))}catch(r){i(r)}}function a(r){try{f(t.throw(r))}catch(r){i(r)}}function f(r){var e;r.done?u(r.value):(e=r.value,e instanceof n?e:new n((function(r){r(e)}))).then(o,a)}f((t=t.apply(r,e||[])).next())}))}function t(r,e){var n,t,u,i,o={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(f){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(n=1,t&&(u=2&a[0]?t.return:a[0]?t.throw||((u=t.return)&&u.call(t),0):t.next)&&!(u=u.call(t,a[1])).done)return u;switch(t=0,u&&(a=[2&a[0],u.value]),a[0]){case 0:case 1:u=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,t=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(u=o.trys,(u=u.length>0&&u[u.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!u||a[1]>u[0]&&a[1]<u[3])){o.label=a[1];break}if(6===a[0]&&o.label<u[1]){o.label=u[1],u=a;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(a);break}u[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(r,o)}catch(r){a=[6,r],t=0}finally{n=u=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,f])}}}function u(r,e,n){if(n||2===arguments.length)for(var t,u=0,i=e.length;u<i;u++)!t&&u in e||(t||(t=Array.prototype.slice.call(e,0,u)),t[u]=e[u]);return r.concat(t||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var i=function(r,e){void 0===e&&(e={prop:"id",parent:"parent",children:"children"});var n,t=Array.from(r),u=e,i=function(r){var e=r;return void 0!==r[u.children]&&null!==r[u.children]||(e[u.children]=o(r[u.prop]),e[u.children].length<=0&&delete e[u.children]),delete e[u.parent],e},o=function(r){var e=[];return a(r).length>=1&&a(r).forEach((function(r){e.push(i(r))})),e},a=function(r){return t.filter((function(e){return e[u.parent]===r}))};return(n=t).filter((function(r){return"object"==typeof r&&null!==r&&!n.map((function(r){return String(r[u.prop]).trim()})).includes(String(r[u.parent]).trim())})).map((function(r){return i(r)}))},o=function(r,e){void 0===e&&(e={prop:"id",parent:"parent",children:"children"});var n=[],t=e,u=function(r,e){r.length>=1&&Array.from(r).forEach((function(r){if("object"==typeof r&&null!==r){var i=r;i[t.parent]=e[t.prop],"object"==typeof i[t.children]&&Array.isArray(i[t.children])&&(u(i[t.children],r),delete i[t.children]),n.push(i)}}))};return Array.from(r).forEach((function(r){if("object"==typeof r&&null!==r){var e=r;e[t.parent]="0","object"==typeof e[t.children]&&Array.isArray(e[t.children])&&(u(e[t.children],r),delete e[t.children]),n.push(e)}})),n},a=function(r,e,n){void 0===n&&(n="asc");var t=Array.from(r);return"asc"===n?t.sort((function(r,n){if(e in r&&e in n){if(!1===isNaN(r[e])&&!1===isNaN(n[e]))return Number(r[e])-Number(n[e]);if("string"==typeof r[e]&&"string"==typeof n[e]){var t=r[e].toLowerCase(),u=n[e].toLowerCase(),i=0;return t<u?i=-1:t>u&&(i=1),i}}})):"desc"===n&&t.sort((function(r,n){if(e in r&&e in n){if(!1===isNaN(r[e])&&!1===isNaN(n[e]))return Number(n[e])-Number(r[e]);if("string"==typeof r[e]&&"string"==typeof n[e]){var t=r[e].toLowerCase(),u=n[e].toLowerCase(),i=0;return u<t?i=-1:u>t&&(i=1),i}}})),t},f=a;return r.column=function(r,e){void 0===e&&(e=2);for(var n=[],t=Math.ceil(Number(Array.from(r).length)/Number(e)),u=0;u<Number(e);u++){var i=Number(u)*Number(t),o=(Number(u)+1)*Number(t),a=Array.from(r).slice(i,o);n.push(a)}return n},r.duplication=function(r,e){void 0===e&&(e="");var n=[],t=Array.from(new Set(r));""!==e&&(t=Array.from(new Set(r.map((function(r){return r[e]})))));for(var u=function(t){var u=Array.from(r).filter((function(r){return""!==e?r[e]===t:r===t}));Number(u.length)>=2&&u.forEach((function(r){n.push(r)}))},i=0,o=t;i<o.length;i++){u(o[i])}return n},r.duplicationGroup=function(r,e){void 0===e&&(e="");var n={},t=new Set,u=Array.from(new Set(r));""!==e&&(u=Array.from(new Set(r.map((function(r){return r[e]})))));for(var i=function(u){var i=Array.from(r).filter((function(r){return""!==e?r[e]===u:r===u}));t.has(i.length)||(t.add(i.length),n[i.length]=[]),i.forEach((function(r){n[i.length].push(r)}))},o=0,a=u;o<a.length;o++){i(a[o])}return n},r.filter=function(r,e){for(var n=Array.from(r),t=function(r){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var t={},u=new Set(e.map((function(r){return String(r)}))),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];u.has(String(r[a]))||(t[a]=r[a])}return t}(e,"",0),u=function(r){var e=n.filter((function(e){if(r in e){if(!1===isNaN(e[r])&&Number(e[r])===Number(t[r]))return!0;if("string"==typeof e[r]&&String(e[r]).toLowerCase().includes(String(t[r]).toLowerCase()))return!0}return!1}));n=e},i=0,o=Object.keys(t);i<o.length;i++){u(o[i])}return n},r.flatten=o,r.flattenAsync=function(r,e){return void 0===e&&(e={}),n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Promise.resolve(r)];case 1:return n=t.sent(),[2,Promise.resolve(o(n,e))]}}))}))},r.math=function(r,e,n){void 0===e&&(e="max"),void 0===n&&(n="");return""!==n?Math[e].apply(Math,r.map((function(r){return r[n]})).filter((function(r){return!1===isNaN(r)}))):Math[e].apply(Math,r.filter((function(r){return!1===isNaN(r)})))},r.move=function(r,e,n,t){void 0===e&&(e=0),void 0===n&&(n=""),void 0===t&&(t="up");var u=Array.from(r);if(u.length>=1&&""!==n){var i=Number(u.length)-1;if("down"===t){var o=Number(e)>=Number(i)?0:Number(e)+1,a=u[String(e)],f=u[String(o)];u=u.map((function(r,t){return Number(e)===Number(t)&&(r=f),Number(o)===Number(t)&&(r=a),r[n]=Number(t)+1,r}))}else{var c=Number(e)<=Number(0)?Number(i):Number(e)-1,l=u[String(e)],s=u[String(c)];u=u.map((function(r,t){return Number(e)===Number(t)&&(r=s),Number(c)===Number(t)&&(r=l),r[n]=Number(t)+1,r}))}}return u},r.nested=i,r.nestedAsync=function(r,e){return void 0===e&&(e={}),n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,Promise.resolve(r)];case 1:return n=t.sent(),[2,Promise.resolve(i(n,e))]}}))}))},r.order=function(r,e){return void 0===e&&(e="order"),Array.from(r).map((function(r,n){return"object"==typeof r&&null!==r&&(r[e]=Number(n)+1),r}))},r.pageInfo=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=10);var t=Array.from(r),u=Number(n)*Number(e)-(Number(n)-1),i=Number(n)*Number(e);return{from:t.length>=1?u:0,start:t.length>=1?u:0,to:i<=t.length?i:t.length,end:i<=t.length?i:t.length,of:t.length,length:t.length}},r.pageStart=function(r,e){return void 0===r&&(r=1),void 0===e&&(e=10),(Number(r)-1)*Number(e)},r.pages=function(r,e){void 0===e&&(e=10);var n=Array.isArray(r)?r.length:r,t=Number(n)/Number(e);return Math.ceil(t)},r.paginate=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=10);var t=Array.from(r),u=Number(n)*Number(e)-(Number(n)-1),i=Number(n)*Number(e);return t.slice(u-1,i<=t.length?i:t.length)},r.pagination=function(r,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var t=[],u=Number(r)<Number(e)?Number(r):Number(e),i=Number(e)<1?1:Number(e),o=u+Number(n),a=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(r);f++)t.push(String(f));else{if(i>1)for(f=a;f<i;f++)t.push(String(f));for(f=u;f<=o;f++)t.push(String(f))}var c=t.filter((function(r){return Number(r)>0})).filter((function(e){return Number(e)<=Number(r)}));return o<Number(r)&&0!==Number(n)&&c.push("..."),a>1&&0!==Number(n)&&c.unshift("..."),c},r.search=function(r){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var i=[],o=function(n){var t=Array.from(r).filter((function(r){if(!1===isNaN(r)&&Number(r)===Number(n))return!0;if("string"==typeof r&&String(r).toLowerCase().includes(String(n).toLowerCase()))return!0;if("object"==typeof r&&null!==r)for(var e=0,t=Object.keys(r);e<t.length;e++){var u=t[e];if(!1===isNaN(r[u])&&Number(r[u])===Number(n))return!0;if("string"==typeof r[u]&&String(r[u]).toLowerCase().includes(String(n).toLowerCase()))return!0}return!1}));i=e(u(u([],i,!0),t,!0))},a=0,f=n.flat();a<f.length;a++){o(f[a])}return i},r.searchBy=function(r,n,t){for(var i=[],o=function(n){var o=Array.from(r).filter((function(r){for(var e=0,u=Array.from(t);e<u.length;e++){var i=u[e];if(i in r){if(!1===isNaN(r[i])&&Number(r[i])===Number(n))return!0;if("string"==typeof r[i]&&-1!==String(r[i]).toLowerCase().indexOf(String(n).toLowerCase()))return!0}}return!1}));i=e(u(u([],i,!0),o,!0))},a=0,f=n;a<f.length;a++){o(f[a])}return i},r.shuffle=function(r){for(var e,n=r,t=r.length,u=0;t>=1;)u=Math.floor(Math.random()*t),t--,e=[n[u],n[t]],n[t]=e[0],n[u]=e[1];return n},r.sort=f,r.sortBy=a,r.take=function(r,e,n){void 0===n&&(n="");var t=[],u=Number(e);return Array.isArray(r)&&r.length>=1&&("object"==typeof r[0]&&null!==r[0]&&"string"==typeof e&&Object.keys(r[0]).includes(e)?(t=r.map((function(r){return r[e]})),"uniq"===n&&(t=Array.from(new Set(t)))):Array.isArray(r[0])&&!1===isNaN(u)?(t=r.map((function(r){return r[u]})),"uniq"===n&&(t=Array.from(new Set(t)))):"function"==typeof e&&(t=r.filter((function(r){return e(r)})),""!==n&&(t=t.map((function(r){return r[n]}))))),t},r.uniq=e,Object.defineProperty(r,"__esModule",{value:!0}),r}({}); |
{ | ||
"name": "alga-js", | ||
"version": "0.1.0-beta-14", | ||
"version": "0.1.0-beta-15", | ||
"description": "Alga.js is a JavaScript helper to help build UI components by using any of modern web frameworks or libraries", | ||
@@ -5,0 +5,0 @@ "module": "./lib/alga.es.js", |
@@ -12,1 +12,3 @@ export * from './uniqArray.js' | ||
export * from './columnArray.js' | ||
export * from './mathArray.js' | ||
export * from './moveArray.js' |
@@ -12,1 +12,3 @@ export * from './uniqArray.js'; | ||
export * from './columnArray.js'; | ||
export * from './mathArray.js'; | ||
export * from './moveArray.js'; |
349730
133
7235