@minsize/utils 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +7 -4
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ declare const createLinksFromText: <T extends string, R extends unknown>(text: s
|
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Сравнивает два объекта на глубокое равенство, включая массивы (с учетом порядка).
|
|
81
|
+
* Не сравнивает ссылки
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* const obj1 = { a: 1, b: { c: 2 } };
|
|
@@ -175,6 +176,8 @@ declare const elasticClamp: (value: number, min: number, max: number, options?:
|
|
|
175
176
|
|
|
176
177
|
declare function updateCurrent<CURRENT extends unknown, NEXT extends unknown>(current: CURRENT, next: NEXT): CURRENT;
|
|
177
178
|
|
|
179
|
+
declare function getChangedData<VALUE extends unknown>(prev: VALUE, next: VALUE): VALUE | undefined;
|
|
180
|
+
|
|
178
181
|
/**
|
|
179
182
|
*
|
|
180
183
|
* @example
|
|
@@ -314,13 +317,13 @@ declare class DebouncedFunction<T extends any[]> {
|
|
|
314
317
|
}
|
|
315
318
|
|
|
316
319
|
declare class DataKeeper<VALUE extends unknown> {
|
|
317
|
-
private getter;
|
|
318
320
|
initValue: VALUE;
|
|
319
321
|
currentValue: VALUE;
|
|
320
|
-
constructor(
|
|
322
|
+
constructor(value: VALUE);
|
|
321
323
|
setter(updater: (value: VALUE) => VALUE): void;
|
|
322
|
-
reset(): void;
|
|
324
|
+
reset(value: VALUE): void;
|
|
323
325
|
isModified(): boolean;
|
|
326
|
+
get updateValues(): VALUE | undefined;
|
|
324
327
|
}
|
|
325
328
|
|
|
326
|
-
export { DataKeeper, DebouncedFunction, EventEmitter, HEXtoRGB, HSVtoRGB, RGBtoHEX, RGBtoHSV, alignTo, chunks, clamp, distributor as comparison, copyText, createLinksFromText, decWord, elasticClamp, formatNumber, generateUniqueKey, groupBy, isType, memoize, omit, orderBy, parseQueryString, parseVersionString, pick, random, randomByWeight, retry, shuffle, sleep, textParserUrl, timeAgo, toShort, unique, unlink, updateCurrent };
|
|
329
|
+
export { DataKeeper, DebouncedFunction, EventEmitter, HEXtoRGB, HSVtoRGB, RGBtoHEX, RGBtoHSV, alignTo, chunks, clamp, distributor as comparison, copyText, createLinksFromText, decWord, elasticClamp, formatNumber, generateUniqueKey, getChangedData, groupBy, isType, memoize, omit, orderBy, parseQueryString, parseVersionString, pick, random, randomByWeight, retry, shuffle, sleep, textParserUrl, timeAgo, toShort, unique, unlink, updateCurrent };
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=(e,t)=>t[e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2];function t(e,t,r){if(!r){const e=new Date;r=e.getDate()*e.getFullYear()*(e.getHours()??1)*e.getMilliseconds()}const n=function(e){const t=2**32;let r=e;return function(){var e;return r=(1664525*r+1013904223)%t,e=r,e^=e>>>21,r=(e^=e<<35)^e>>>4,(r>>>0)/t}}(r);return function(e,t,r){if(t>r)throw new Error("Минимальная граница не может быть больше максимальной.");return Math.floor(e()*(r-t+1))+t}(n,e,t)}function r(e,t){var r=Object.prototype.toString.call(e).replace("[object ","").replace("]","").toLowerCase();try{e instanceof Buffer?r="buffer":"number"===r&&isNaN(e)&&(r="nan")}catch{}return void 0!==t?r===t:r}const n=(e,t)=>{switch(r(e)){case"array":if(!function(e,t,r){if(!s(e,t,"array",r))return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++)if(!n(e[o],t[o]))return!1;return!0}(e,t,{skipCheckPrev:!0}))return!1;break;case"object":if(!function(e,t,r){if(!s(e,t,"object",r))return!1;const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(var c of o){if(!t.hasOwnProperty(c))return!1;if(!n(e[c],t[c]))return!1}return!0}(e,t,{skipCheckPrev:!0}))return!1;break;case"function":if(!function(e,t,r){return!!s(e,t,"function",r)&&e===t}(e,t,{skipCheckPrev:!0}))return!1;break;case"date":if(!function(e,t,r){return!!s(e,t,"date",r)&&e.getTime()===t.getTime()}(e,t,{skipCheckPrev:!0}))return!1;break;case"map":if(!function(e,t,r){if(!s(e,t,"map",r))return!1;if(e.size!==t.size)return!1;for(const[r,s]of e)if(!n(s,t.get(r)))return!1;return!0}(e,t,{skipCheckPrev:!0}))return!1;break;case"set":if(!function(e,t,r){if(!s(e,t,"set",r))return!1;if(e.size!==t.size)return!1;const o=Array.from(e.keys()),i=Array.from(t.keys());for(var c=0;c<o.length;c++)if(!n(o[c],i[c]))return!1;return!0}(e,t,{skipCheckPrev:!0}))return!1;break;default:if(e!==t)return!1}return!0};function s(e,t,n,s){return!(!s?.skipCheckPrev&&!r(e,n)||!r(t,n))}const o=e=>{switch(r(e)){case"array":return i(e);case"object":return c(e);case"number":return Number(String(e));case"string":return String(e);case"bigint":return BigInt(String(e));case"map":return new Map(e);case"set":return new Set(e);default:return e}},i=e=>{const t=[];for(const r of e)t.push(o(r));return t},c=e=>{const t={};for(const r in e)t[r]=o(e[r]);return t},a=new RegExp(/(?:https?:\/\/)?(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),u=new RegExp(/(?:https?:\/\/)(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),l=e=>e;function f(e){return Array.from(new Set(e))}function h(e,t){switch(r(e)){case"object":return function(e,t){const r={},n=Object.keys(e),s=Object.keys(t),o=f([...n,...s]);for(const n of o)r[n]=h(e[n],t[n]);return r}(e,t);case"array":return function(e,t){const r=[];for(var n=0;n<e.length;n++)r.push(h(e?.[n],t?.[n]));for(n=e.length;n<t.length;n++)r.push(h(e?.[n],t?.[n]));return r}(e,t);default:return e??t}}function p(e,t){return t.split(".").reduce(((e,t)=>e?e[t]:void 0),e)}const g=e=>{const t=e.toString(16);return 1==t.length?"0"+t:t};var m=Object.defineProperty,b=(e,t,r)=>(((e,t,r)=>{t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);var d=Object.defineProperty,y=(e,t,r)=>(((e,t,r)=>{t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);var k=Object.defineProperty,x=(e,t,r)=>(((e,t,r)=>{t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);exports.DataKeeper=class{constructor(e){x(this,"getter"),x(this,"initValue"),x(this,"currentValue");const t=e();this.getter=e,this.initValue=o(t),this.currentValue=t}setter(e){this.currentValue=e(this.currentValue)}reset(){const e=this.getter();this.initValue=o(e),this.currentValue=e}isModified(){return!n(this.initValue,this.currentValue)}},exports.DebouncedFunction=class{constructor(e,t){y(this,"cb"),y(this,"o"),y(this,"tId",null),y(this,"s"),this.cb=e,this.o=t,this.s=[]}execute(...e){if(this.cancel(),"[object Function]"===Object.prototype.toString.call(e[0]))this.s=e[0](...this.s);else for(let t=0;t<this.cb.length;t++)this.s[t]=e[t];this.tId=setTimeout(this.executeImmediately.bind(this),this.o.delay)}executeImmediately(){this.cancel(),this.cb(...this.s),this.s=[]}cancel(){this.tId&&(clearTimeout(this.tId),this.tId=null)}},exports.EventEmitter=class{constructor(){b(this,"e",{})}on(e,t){return this.e[e]||(this.e[e]=[]),this.e[e].push(t),()=>this.off(e,t)}off(e,t){if(!this.e[e])return;const r=this.e[e].findIndex((e=>e===t));-1!==r&&(this.e[e].splice(r,1),0===this.e[e].length&&delete this.e[e])}emit(e,...t){if(!this.e[e])return;const r=this.e[e].slice();for(const n of r)try{n(...t)}catch(t){console.error(`Ошибка в обработчике события ${e}:`,t)}}once(e,t){const r=(...n)=>{this.off(e,r),t(...n)};return this.on(e,r)}clear(e){e?delete this.e[e]:this.e={}}},exports.HEXtoRGB=e=>{if(3===(e=e.replace("#","")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)return[0,0,0];const t=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),n=parseInt(e.substring(4,6),16);return isNaN(t)||isNaN(r)||isNaN(n)||t<0||t>255||r<0||r>255||n<0||n>255?[0,0,0]:[t,r,n]},exports.HSVtoRGB=(e,t,r)=>{var n,s,o,i,c,a,u,l;switch(a=r*(1-t),u=r*(1-(c=6*e-(i=Math.floor(6*e)))*t),l=r*(1-(1-c)*t),i%6){case 0:n=r,s=l,o=a;break;case 1:n=u,s=r,o=a;break;case 2:n=a,s=r,o=l;break;case 3:n=a,s=u,o=r;break;case 4:n=l,s=a,o=r;break;case 5:n=r,s=a,o=u}return[Math.round(255*n),Math.round(255*s),Math.round(255*o)]},exports.RGBtoHEX=(e,t,r)=>"#"+g(e)+g(t)+g(r),exports.RGBtoHSV=(e,t,r)=>{var n=Math.max(e,t,r),s=Math.min(e,t,r),o=n-s,i=0,c=0===n?0:o/n,a=n/255;switch(n){case s:i=0;break;case e:i=t-r+o*(t<r?6:0),i/=6*o;break;case t:i=r-e+2*o,i/=6*o;break;case r:i=e-t+4*o,i/=6*o}return[i,c,a]},exports.alignTo=function(e,t){return e<=0?t:e+(t-e%t)%t},exports.chunks=(e,t)=>{const r=[];for(let n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r},exports.clamp=(e,t,r)=>e>t?e<r?e:r:t,exports.comparison=n,exports.copyText=e=>{if(e){try{navigator.clipboard?.writeText(e)}catch{}try{var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch{}}},exports.createLinksFromText=(e,t)=>{const r=[],n=/{{([^}]+):([^}]+)}}/g;let s,o=0;for(;null!==(s=n.exec(e));)r.push(e.substring(o,s.index)),o=s.index+s[0].length,r.push({key:s[1],text:s[2]});return r.push(e.substring(o)),r.map((e=>"string"==typeof e?e:t(e.key,e.text)))},exports.decWord=e,exports.elasticClamp=(e,t,r,n={})=>{const{threshold:s=50,resistance:o=.2}=n;if(e<t){const r=t-e;return t-s*(1-Math.exp(-r*o/s))}if(e>r){const t=e-r;return r+s*(1-Math.exp(-t*o/s))}return e},exports.formatNumber=e=>(e||0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,"."),exports.generateUniqueKey=e=>{const t=e=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||null===e)return JSON.stringify(e);if(Array.isArray(e))return"["+e.map(t).join(",")+"]";if("object"==typeof e){const r=Object.keys(e).sort();let n="{";for(let s=0;s<r.length;s++){const o=r[s];n+=JSON.stringify(o)+":"+t(e[o]),s<r.length-1&&(n+=",")}return n+="}",n}return String(e)},r=e=>{let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t};try{const n=t(e);return r(n).toString(16)}catch(t){return console.warn(`Object could not be fully stringified. Using a simple string conversion. Error: ${t}`),r(String(e)).toString(16)}},exports.groupBy=function(e,t){return e.reduce(((e,r)=>{const n=t(r);return e[n]||(e[n]=[]),e[n].push(r),e}),{})},exports.isType=r,exports.memoize=function(e){const t=new Map;return function(...r){const n=JSON.stringify(r);if(t.has(n))return t.get(n);const s=e(...r);return t.set(n,s),s}},exports.omit=function(e,t){return Object.keys(e).reduce(((r,n)=>(t.includes(n)||(r[n]=e[n]),r)),{})},exports.orderBy=function(e,t){const r=Object.keys(t);return e.slice().sort(((e,n)=>{for(const s of r){const r="desc"===t[s]?-1:1,o=p(e,s),i=p(n,s);if(o<i)return-r;if(o>i)return r}return 0}))},exports.parseQueryString=function(e){const t={},r=(e.startsWith("?")?e.slice(1):e).split("&");for(const e of r){const[r,n]=e.split("=");if(r){const e=decodeURIComponent(r),s=n?decodeURIComponent(n):"";t[e]=s}}return t},exports.parseVersionString=function(e){const t=e.match(/^(\d+|\*)\.(\d+|\*)\.(\d+|\*)(?:-([a-zA-Z0-9-.]+))?$/);if(!t)throw new Error("Invalid version string");const[,r,n,s,o]=t,i=e=>"*"===e?"*":parseInt(e,10);return{major:i(r),minor:i(n),patch:i(s),prerelease:o||null}},exports.pick=function(e,t){return Object.keys(e).reduce(((r,n)=>(t.includes(n)&&(r[n]=e[n]),r)),{})},exports.random=t,exports.randomByWeight=function(e,r){let n=0;for(const t in e)n+=e[t];const s=t(0,n,r);let o=0;for(const t in e)if(o+=e[t],s<o)return t;const i=Object.keys(e);return i[t(0,i.length-1,r)]},exports.retry=function(e,t,r){return new Promise(((n,s)=>{const o=t=>{e().then(n).catch((e=>{0===t?s(e):(console.log(`Retrying... attempts left: ${t}`),setTimeout((()=>o(t-1)),r))}))};o(t)}))},exports.shuffle=(e,r)=>{for(let n=e.length-1;n>0;n--){const s=t(0,n,r);[e[n],e[s]]=[e[s],e[n]]}return e},exports.sleep=async e=>await new Promise((t=>setTimeout(t,e))),exports.textParserUrl=(e,t)=>{const r=t?.onToken??l,n=t?.requireProtocol??!1,s=t?.regex??n?u:a,o=[];let i=e+" ",c=s.exec(i);for(;c;){const e=c[0].trim(),t=c.index;t>0&&(o.push(r({type:"raw",value:i.substring(0,t)})),i=i.substring(t)),o.push(r({type:"url",value:e})),i=i.substring(e.length),c=s.exec(i)}return i.length>0&&o.push(r({type:"raw",value:i})),o},exports.timeAgo=t=>{if(!t)return"только что";const r=new Date(t),n=Math.floor((Date.now()-r.getTime())/1e3),s=()=>new Intl.DateTimeFormat("RU-ru",{day:"numeric",month:"short"}).format(r).replace(".",""),o=()=>r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),i=(t,r,n)=>Array.isArray(t)?`${n} ${e(n,t)} ${r}`:`${t} ${r}`;switch(!0){case n<0:return"скоро";case n<60:return i(["секунду","секунды","секунд"],"назад",n);case n<3600:return i(["минуту","минуты","минут"],"назад",Math.floor(n/60));case n<7200:return i("час","назад",Math.floor(n/3600));case n<10800:return i("два часа","назад",Math.floor(n/3600));case n<14400:return i("три часа","назад",Math.floor(n/3600));case n<86400:return i(`сегодня в ${o()}`,"",Math.floor(n/3600));case n<172800:return i(`вчера в ${o()}`,"",Math.floor(n/86400));case n<259200:return i("два дня","назад",Math.floor(n/86400));case n<345600:return i("три дня","назад",Math.floor(n/86400));case n<31536e3:return i(`${s()} в ${o()}`,"",Math.floor(n/86400));case n>=31536e3:return i(`${s()} ${r.getFullYear()} г.`,"",Math.floor(n/31536e3))}return"только что"},exports.toShort=(e,t,r=1)=>{const n=t||["","k","M","G","T","P"],s=e<0,o=Math.abs(e),i=Math.log10(o)/3|0,c=o/10**(3*i);return parseFloat(`${s?"-":""}${c%1?(Math.floor(10*c)/10).toFixed(r):c}`)+n[i]},exports.unique=f,exports.unlink=o,exports.updateCurrent=h;
|
|
1
|
+
"use strict";const t=(t,e)=>e[t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2];function e(t,e,r){if(!r){const t=new Date;r=t.getDate()*t.getFullYear()*(t.getHours()??1)*t.getMilliseconds()}const n=function(t){const e=2**32;let r=t;return function(){var t;return r=(1664525*r+1013904223)%e,t=r,t^=t>>>21,r=(t^=t<<35)^t>>>4,(r>>>0)/e}}(r);return function(t,e,r){if(e>r)throw new Error("Минимальная граница не может быть больше максимальной.");return Math.floor(t()*(r-e+1))+e}(n,t,e)}function r(t,e){var r=Object.prototype.toString.call(t).replace("[object ","").replace("]","").toLowerCase();try{t instanceof Buffer?r="buffer":"number"===r&&isNaN(t)&&(r="nan")}catch{}return void 0!==e?r===e:r}const n=(t,e)=>{switch(r(t)){case"array":if(!function(t,e,r){if(!s(t,e,"array",r))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!n(t[o],e[o]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"object":if(!function(t,e,r){if(!s(t,e,"object",r))return!1;const o=Object.keys(t),i=Object.keys(e);if(o.length!==i.length)return!1;for(var c of o){if(!e.hasOwnProperty(c))return!1;if(!n(t[c],e[c]))return!1}return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"function":if(!function(t,e,r){return!!s(t,e,"function",r)&&t===e}(t,e,{skipCheckPrev:!0}))return!1;break;case"date":if(!function(t,e,r){return!!s(t,e,"date",r)&&t.getTime()===e.getTime()}(t,e,{skipCheckPrev:!0}))return!1;break;case"map":if(!function(t,e,r){if(!s(t,e,"map",r))return!1;if(t.size!==e.size)return!1;for(const[r,s]of t)if(!n(s,e.get(r)))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"set":if(!function(t,e,r){if(!s(t,e,"set",r))return!1;if(t.size!==e.size)return!1;const o=Array.from(t.keys()),i=Array.from(e.keys());for(var c=0;c<o.length;c++)if(!n(o[c],i[c]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;default:if(t!==e)return!1}return!0};function s(t,e,n,s){return!(!s?.skipCheckPrev&&!r(t,n)||!r(e,n))}const o=t=>{switch(r(t)){case"array":return i(t);case"object":return c(t);case"number":return Number(String(t));case"string":return String(t);case"bigint":return BigInt(String(t));case"map":return new Map(t);case"set":return new Set(t);default:return t}},i=t=>{const e=[];for(const r of t)e.push(o(r));return e},c=t=>{const e={};for(const r in t)e[r]=o(t[r]);return e},a=new RegExp(/(?:https?:\/\/)?(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),u=new RegExp(/(?:https?:\/\/)(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),l=t=>t;function f(t){return Array.from(new Set(t))}function h(t,e){switch(r(t)){case"object":return function(t,e){const r={},n=Object.keys(t),s=Object.keys(e),o=f([...n,...s]);for(const n of o)r[n]=h(t[n],e[n]);return r}(t,e);case"array":return function(t,e){const r=[];for(var n=0;n<t.length;n++)r.push(h(t?.[n],e?.[n]));for(n=t.length;n<e.length;n++)r.push(h(t?.[n],e?.[n]));return r}(t,e);default:return t??e}}function p(t,e){switch(r(t)){case"object":return function(t,e){const r={};var n=!1;for(const s in e)if(t.hasOwnProperty(s)){const o=p(t?.[s],e?.[s]);void 0!==o&&(r[s]=o,n=!0)}else r[s]=e[s],n=!0;for(const s in t)s in e||(r[s]=void 0,n=!0);return n?r:void 0}(t,e);case"array":return function(t,e){const r=[];for(var n=!1,s=0;s<t.length;s++){const o=p(t?.[s],e?.[s]);void 0===o&&void 0!==e?.[s]||(r[s]=o,n=!0)}for(s=0;s<e.length;s++){const o=p(t?.[s],e?.[s]);void 0!==o&&(r[s]=o,n=!0)}return n?r:void 0}(t,e);default:if(t!==e)return e}}function g(t,e){return e.split(".").reduce(((t,e)=>t?t[e]:void 0),t)}const m=t=>{const e=t.toString(16);return 1==e.length?"0"+e:e};var b=Object.defineProperty,d=(t,e,r)=>(((t,e,r)=>{e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);var y=Object.defineProperty,k=(t,e,r)=>(((t,e,r)=>{e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);var x=Object.defineProperty,v=(t,e,r)=>(((t,e,r)=>{e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);exports.DataKeeper=class{constructor(t){v(this,"initValue"),v(this,"currentValue"),this.initValue=o(t),this.currentValue=t}setter(t){this.currentValue=t(this.currentValue)}reset(t){this.initValue=o(t),this.currentValue=t}isModified(){return!n(this.initValue,this.currentValue)}get updateValues(){return p(this.initValue,this.currentValue)}},exports.DebouncedFunction=class{constructor(t,e){k(this,"cb"),k(this,"o"),k(this,"tId",null),k(this,"s"),this.cb=t,this.o=e,this.s=[]}execute(...t){if(this.cancel(),"[object Function]"===Object.prototype.toString.call(t[0]))this.s=t[0](...this.s);else for(let e=0;e<this.cb.length;e++)this.s[e]=t[e];this.tId=setTimeout(this.executeImmediately.bind(this),this.o.delay)}executeImmediately(){this.cancel(),this.cb(...this.s),this.s=[]}cancel(){this.tId&&(clearTimeout(this.tId),this.tId=null)}},exports.EventEmitter=class{constructor(){d(this,"e",{})}on(t,e){return this.e[t]||(this.e[t]=[]),this.e[t].push(e),()=>this.off(t,e)}off(t,e){if(!this.e[t])return;const r=this.e[t].findIndex((t=>t===e));-1!==r&&(this.e[t].splice(r,1),0===this.e[t].length&&delete this.e[t])}emit(t,...e){if(!this.e[t])return;const r=this.e[t].slice();for(const n of r)try{n(...e)}catch(e){console.error(`Ошибка в обработчике события ${t}:`,e)}}once(t,e){const r=(...n)=>{this.off(t,r),e(...n)};return this.on(t,r)}clear(t){t?delete this.e[t]:this.e={}}},exports.HEXtoRGB=t=>{if(3===(t=t.replace("#","")).length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)return[0,0,0];const e=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16);return isNaN(e)||isNaN(r)||isNaN(n)||e<0||e>255||r<0||r>255||n<0||n>255?[0,0,0]:[e,r,n]},exports.HSVtoRGB=(t,e,r)=>{var n,s,o,i,c,a,u,l;switch(a=r*(1-e),u=r*(1-(c=6*t-(i=Math.floor(6*t)))*e),l=r*(1-(1-c)*e),i%6){case 0:n=r,s=l,o=a;break;case 1:n=u,s=r,o=a;break;case 2:n=a,s=r,o=l;break;case 3:n=a,s=u,o=r;break;case 4:n=l,s=a,o=r;break;case 5:n=r,s=a,o=u}return[Math.round(255*n),Math.round(255*s),Math.round(255*o)]},exports.RGBtoHEX=(t,e,r)=>"#"+m(t)+m(e)+m(r),exports.RGBtoHSV=(t,e,r)=>{var n=Math.max(t,e,r),s=Math.min(t,e,r),o=n-s,i=0,c=0===n?0:o/n,a=n/255;switch(n){case s:i=0;break;case t:i=e-r+o*(e<r?6:0),i/=6*o;break;case e:i=r-t+2*o,i/=6*o;break;case r:i=t-e+4*o,i/=6*o}return[i,c,a]},exports.alignTo=function(t,e){return t<=0?e:t+(e-t%e)%e},exports.chunks=(t,e)=>{const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r},exports.clamp=(t,e,r)=>t>e?t<r?t:r:e,exports.comparison=n,exports.copyText=t=>{if(t){try{navigator.clipboard?.writeText(t)}catch{}try{var e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}catch{}}},exports.createLinksFromText=(t,e)=>{const r=[],n=/{{([^}]+):([^}]+)}}/g;let s,o=0;for(;null!==(s=n.exec(t));)r.push(t.substring(o,s.index)),o=s.index+s[0].length,r.push({key:s[1],text:s[2]});return r.push(t.substring(o)),r.map((t=>"string"==typeof t?t:e(t.key,t.text)))},exports.decWord=t,exports.elasticClamp=(t,e,r,n={})=>{const{threshold:s=50,resistance:o=.2}=n;if(t<e){const r=e-t;return e-s*(1-Math.exp(-r*o/s))}if(t>r){const e=t-r;return r+s*(1-Math.exp(-e*o/s))}return t},exports.formatNumber=t=>(t||0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,"."),exports.generateUniqueKey=t=>{const e=t=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||null===t)return JSON.stringify(t);if(Array.isArray(t))return"["+t.map(e).join(",")+"]";if("object"==typeof t){const r=Object.keys(t).sort();let n="{";for(let s=0;s<r.length;s++){const o=r[s];n+=JSON.stringify(o)+":"+e(t[o]),s<r.length-1&&(n+=",")}return n+="}",n}return String(t)},r=t=>{let e=0;if(0===t.length)return e;for(let r=0;r<t.length;r++){e=(e<<5)-e+t.charCodeAt(r),e|=0}return e};try{const n=e(t);return r(n).toString(16)}catch(e){return console.warn(`Object could not be fully stringified. Using a simple string conversion. Error: ${e}`),r(String(t)).toString(16)}},exports.getChangedData=p,exports.groupBy=function(t,e){return t.reduce(((t,r)=>{const n=e(r);return t[n]||(t[n]=[]),t[n].push(r),t}),{})},exports.isType=r,exports.memoize=function(t){const e=new Map;return function(...r){const n=JSON.stringify(r);if(e.has(n))return e.get(n);const s=t(...r);return e.set(n,s),s}},exports.omit=function(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)||(r[n]=t[n]),r)),{})},exports.orderBy=function(t,e){const r=Object.keys(e);return t.slice().sort(((t,n)=>{for(const s of r){const r="desc"===e[s]?-1:1,o=g(t,s),i=g(n,s);if(o<i)return-r;if(o>i)return r}return 0}))},exports.parseQueryString=function(t){const e={},r=(t.startsWith("?")?t.slice(1):t).split("&");for(const t of r){const[r,n]=t.split("=");if(r){const t=decodeURIComponent(r),s=n?decodeURIComponent(n):"";e[t]=s}}return e},exports.parseVersionString=function(t){const e=t.match(/^(\d+|\*)\.(\d+|\*)\.(\d+|\*)(?:-([a-zA-Z0-9-.]+))?$/);if(!e)throw new Error("Invalid version string");const[,r,n,s,o]=e,i=t=>"*"===t?"*":parseInt(t,10);return{major:i(r),minor:i(n),patch:i(s),prerelease:o||null}},exports.pick=function(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)&&(r[n]=t[n]),r)),{})},exports.random=e,exports.randomByWeight=function(t,r){let n=0;for(const e in t)n+=t[e];const s=e(0,n,r);let o=0;for(const e in t)if(o+=t[e],s<o)return e;const i=Object.keys(t);return i[e(0,i.length-1,r)]},exports.retry=function(t,e,r){return new Promise(((n,s)=>{const o=e=>{t().then(n).catch((t=>{0===e?s(t):(console.log(`Retrying... attempts left: ${e}`),setTimeout((()=>o(e-1)),r))}))};o(e)}))},exports.shuffle=(t,r)=>{for(let n=t.length-1;n>0;n--){const s=e(0,n,r);[t[n],t[s]]=[t[s],t[n]]}return t},exports.sleep=async t=>await new Promise((e=>setTimeout(e,t))),exports.textParserUrl=(t,e)=>{const r=e?.onToken??l,n=e?.requireProtocol??!1,s=e?.regex??n?u:a,o=[];let i=t+" ",c=s.exec(i);for(;c;){const t=c[0].trim(),e=c.index;e>0&&(o.push(r({type:"raw",value:i.substring(0,e)})),i=i.substring(e)),o.push(r({type:"url",value:t})),i=i.substring(t.length),c=s.exec(i)}return i.length>0&&o.push(r({type:"raw",value:i})),o},exports.timeAgo=e=>{if(!e)return"только что";const r=new Date(e),n=Math.floor((Date.now()-r.getTime())/1e3),s=()=>new Intl.DateTimeFormat("RU-ru",{day:"numeric",month:"short"}).format(r).replace(".",""),o=()=>r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),i=(e,r,n)=>Array.isArray(e)?`${n} ${t(n,e)} ${r}`:`${e} ${r}`;switch(!0){case n<0:return"скоро";case n<60:return i(["секунду","секунды","секунд"],"назад",n);case n<3600:return i(["минуту","минуты","минут"],"назад",Math.floor(n/60));case n<7200:return i("час","назад",Math.floor(n/3600));case n<10800:return i("два часа","назад",Math.floor(n/3600));case n<14400:return i("три часа","назад",Math.floor(n/3600));case n<86400:return i(`сегодня в ${o()}`,"",Math.floor(n/3600));case n<172800:return i(`вчера в ${o()}`,"",Math.floor(n/86400));case n<259200:return i("два дня","назад",Math.floor(n/86400));case n<345600:return i("три дня","назад",Math.floor(n/86400));case n<31536e3:return i(`${s()} в ${o()}`,"",Math.floor(n/86400));case n>=31536e3:return i(`${s()} ${r.getFullYear()} г.`,"",Math.floor(n/31536e3))}return"только что"},exports.toShort=(t,e,r=1)=>{const n=e||["","k","M","G","T","P"],s=t<0,o=Math.abs(t),i=Math.log10(o)/3|0,c=o/10**(3*i);return parseFloat(`${s?"-":""}${c%1?(Math.floor(10*c)/10).toFixed(r):c}`)+n[i]},exports.unique=f,exports.unlink=o,exports.updateCurrent=h;
|
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e,r)=>t>e?t<r?t:r:e,e=(t,e)=>e[t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2];function r(t,e){return t<=0?e:t+(e-t%e)%e}const n=(t,e,r=1)=>{const n=e||["","k","M","G","T","P"],s=t<0,o=Math.abs(t),i=Math.log10(o)/3|0,c=o/10**(3*i);return parseFloat(`${s?"-":""}${c%1?(Math.floor(10*c)/10).toFixed(r):c}`)+n[i]},s=t=>{if(!t)return"только что";const r=new Date(t),n=Math.floor((Date.now()-r.getTime())/1e3),s=()=>new Intl.DateTimeFormat("RU-ru",{day:"numeric",month:"short"}).format(r).replace(".",""),o=()=>r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),i=(t,r,n)=>Array.isArray(t)?`${n} ${e(n,t)} ${r}`:`${t} ${r}`;switch(!0){case n<0:return"скоро";case n<60:return i(["секунду","секунды","секунд"],"назад",n);case n<3600:return i(["минуту","минуты","минут"],"назад",Math.floor(n/60));case n<7200:return i("час","назад",Math.floor(n/3600));case n<10800:return i("два часа","назад",Math.floor(n/3600));case n<14400:return i("три часа","назад",Math.floor(n/3600));case n<86400:return i(`сегодня в ${o()}`,"",Math.floor(n/3600));case n<172800:return i(`вчера в ${o()}`,"",Math.floor(n/86400));case n<259200:return i("два дня","назад",Math.floor(n/86400));case n<345600:return i("три дня","назад",Math.floor(n/86400));case n<31536e3:return i(`${s()} в ${o()}`,"",Math.floor(n/86400));case n>=31536e3:return i(`${s()} ${r.getFullYear()} г.`,"",Math.floor(n/31536e3))}return"только что"},o=t=>(t||0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,".");function i(t,e,r){if(!r){const t=new Date;r=t.getDate()*t.getFullYear()*(t.getHours()??1)*t.getMilliseconds()}const n=function(t){const e=2**32;let r=t;return function(){var t;return r=(1664525*r+1013904223)%e,t=r,t^=t>>>21,r=(t^=t<<35)^t>>>4,(r>>>0)/e}}(r);return function(t,e,r){if(e>r)throw new Error("Минимальная граница не может быть больше максимальной.");return Math.floor(t()*(r-e+1))+e}(n,t,e)}function c(t,e){let r=0;for(const e in t)r+=t[e];const n=i(0,r,e);let s=0;for(const e in t)if(s+=t[e],n<s)return e;const o=Object.keys(t);return o[i(0,o.length-1,e)]}function a(t,e){var r=Object.prototype.toString.call(t).replace("[object ","").replace("]","").toLowerCase();try{t instanceof Buffer?r="buffer":"number"===r&&isNaN(t)&&(r="nan")}catch{}return void 0!==e?r===e:r}function u(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)||(r[n]=t[n]),r)),{})}function l(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)&&(r[n]=t[n]),r)),{})}const f=async t=>await new Promise((e=>setTimeout(e,t))),h=t=>{if(t){try{navigator.clipboard?.writeText(t)}catch{}try{var e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}catch{}}},g=(t,e)=>{const r=[],n=/{{([^}]+):([^}]+)}}/g;let s,o=0;for(;null!==(s=n.exec(t));)r.push(t.substring(o,s.index)),o=s.index+s[0].length,r.push({key:s[1],text:s[2]});return r.push(t.substring(o)),r.map((t=>"string"==typeof t?t:e(t.key,t.text)))},p=(t,e)=>{switch(a(t)){case"array":if(!function(t,e,r){if(!b(t,e,"array",r))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!p(t[n],e[n]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"object":if(!function(t,e,r){if(!b(t,e,"object",r))return!1;const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(var o of n){if(!e.hasOwnProperty(o))return!1;if(!p(t[o],e[o]))return!1}return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"function":if(!function(t,e,r){return!!b(t,e,"function",r)&&t===e}(t,e,{skipCheckPrev:!0}))return!1;break;case"date":if(!function(t,e,r){return!!b(t,e,"date",r)&&t.getTime()===e.getTime()}(t,e,{skipCheckPrev:!0}))return!1;break;case"map":if(!function(t,e,r){if(!b(t,e,"map",r))return!1;if(t.size!==e.size)return!1;for(const[r,n]of t)if(!p(n,e.get(r)))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"set":if(!function(t,e,r){if(!b(t,e,"set",r))return!1;if(t.size!==e.size)return!1;const n=Array.from(t.keys()),s=Array.from(e.keys());for(var o=0;o<n.length;o++)if(!p(n[o],s[o]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;default:if(t!==e)return!1}return!0};function b(t,e,r,n){return!(!n?.skipCheckPrev&&!a(t,r)||!a(e,r))}const m=t=>{const e=t=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||null===t)return JSON.stringify(t);if(Array.isArray(t))return"["+t.map(e).join(",")+"]";if("object"==typeof t){const r=Object.keys(t).sort();let n="{";for(let s=0;s<r.length;s++){const o=r[s];n+=JSON.stringify(o)+":"+e(t[o]),s<r.length-1&&(n+=",")}return n+="}",n}return String(t)},r=t=>{let e=0;if(0===t.length)return e;for(let r=0;r<t.length;r++){e=(e<<5)-e+t.charCodeAt(r),e|=0}return e};try{const n=e(t);return r(n).toString(16)}catch(e){return console.warn(`Object could not be fully stringified. Using a simple string conversion. Error: ${e}`),r(String(t)).toString(16)}},d=t=>{switch(a(t)){case"array":return y(t);case"object":return k(t);case"number":return Number(String(t));case"string":return String(t);case"bigint":return BigInt(String(t));case"map":return new Map(t);case"set":return new Set(t);default:return t}},y=t=>{const e=[];for(const r of t)e.push(d(r));return e},k=t=>{const e={};for(const r in t)e[r]=d(t[r]);return e},v=new RegExp(/(?:https?:\/\/)?(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),w=new RegExp(/(?:https?:\/\/)(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),j=t=>t,M=(t,e)=>{const r=e?.onToken??j,n=e?.requireProtocol??!1,s=e?.regex??n?w:v,o=[];let i=t+" ",c=s.exec(i);for(;c;){const t=c[0].trim(),e=c.index;e>0&&(o.push(r({type:"raw",value:i.substring(0,e)})),i=i.substring(e)),o.push(r({type:"url",value:t})),i=i.substring(t.length),c=s.exec(i)}return i.length>0&&o.push(r({type:"raw",value:i})),o};function z(t){const e=new Map;return function(...r){const n=JSON.stringify(r);if(e.has(n))return e.get(n);const s=t(...r);return e.set(n,s),s}}function x(t,e,r){return new Promise(((n,s)=>{const o=e=>{t().then(n).catch((t=>{0===e?s(t):(console.log(`Retrying... attempts left: ${e}`),setTimeout((()=>o(e-1)),r))}))};o(e)}))}function O(t){const e={},r=(t.startsWith("?")?t.slice(1):t).split("&");for(const t of r){const[r,n]=t.split("=");if(r){const t=decodeURIComponent(r),s=n?decodeURIComponent(n):"";e[t]=s}}return e}function $(t){const e=t.match(/^(\d+|\*)\.(\d+|\*)\.(\d+|\*)(?:-([a-zA-Z0-9-.]+))?$/);if(!e)throw new Error("Invalid version string");const[,r,n,s,o]=e,i=t=>"*"===t?"*":parseInt(t,10);return{major:i(r),minor:i(n),patch:i(s),prerelease:o||null}}const I=(t,e,r,n={})=>{const{threshold:s=50,resistance:o=.2}=n;if(t<e){const r=e-t;return e-s*(1-Math.exp(-r*o/s))}if(t>r){const e=t-r;return r+s*(1-Math.exp(-e*o/s))}return t};function S(t){return Array.from(new Set(t))}function A(t,e){switch(a(t)){case"object":return function(t,e){const r={},n=Object.keys(t),s=Object.keys(e),o=S([...n,...s]);for(const n of o)r[n]=A(t[n],e[n]);return r}(t,e);case"array":return function(t,e){const r=[];for(var n=0;n<t.length;n++)r.push(A(t?.[n],e?.[n]));for(n=t.length;n<e.length;n++)r.push(A(t?.[n],e?.[n]));return r}(t,e);default:return t??e}}const P=(t,e)=>{const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r},C=(t,e)=>{for(let r=t.length-1;r>0;r--){const n=i(0,r,e);[t[r],t[n]]=[t[n],t[r]]}return t};function N(t,e){return t.reduce(((t,r)=>{const n=e(r);return t[n]||(t[n]=[]),t[n].push(r),t}),{})}function T(t,e){return e.split(".").reduce(((t,e)=>t?t[e]:void 0),t)}function V(t,e){const r=Object.keys(e);return t.slice().sort(((t,n)=>{for(const s of r){const r="desc"===e[s]?-1:1,o=T(t,s),i=T(n,s);if(o<i)return-r;if(o>i)return r}return 0}))}const q=(t,e,r)=>{var n,s,o,i,c,a,u,l;switch(a=r*(1-e),u=r*(1-(c=6*t-(i=Math.floor(6*t)))*e),l=r*(1-(1-c)*e),i%6){case 0:n=r,s=l,o=a;break;case 1:n=u,s=r,o=a;break;case 2:n=a,s=r,o=l;break;case 3:n=a,s=u,o=r;break;case 4:n=l,s=a,o=r;break;case 5:n=r,s=a,o=u}return[Math.round(255*n),Math.round(255*s),Math.round(255*o)]},Z=t=>{const e=t.toString(16);return 1==e.length?"0"+e:e},E=(t,e,r)=>"#"+Z(t)+Z(e)+Z(r),F=(t,e,r)=>{var n=Math.max(t,e,r),s=Math.min(t,e,r),o=n-s,i=0,c=0===n?0:o/n,a=n/255;switch(n){case s:i=0;break;case t:i=e-r+o*(e<r?6:0),i/=6*o;break;case e:i=r-t+2*o,i/=6*o;break;case r:i=t-e+4*o,i/=6*o}return[i,c,a]},R=t=>{if(3===(t=t.replace("#","")).length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)return[0,0,0];const e=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16);return isNaN(e)||isNaN(r)||isNaN(n)||e<0||e>255||r<0||r>255||n<0||n>255?[0,0,0]:[e,r,n]};var D=Object.defineProperty,U=(t,e,r)=>(((t,e,r)=>{e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class B{constructor(){U(this,"e",{})}on(t,e){return this.e[t]||(this.e[t]=[]),this.e[t].push(e),()=>this.off(t,e)}off(t,e){if(!this.e[t])return;const r=this.e[t].findIndex((t=>t===e));-1!==r&&(this.e[t].splice(r,1),0===this.e[t].length&&delete this.e[t])}emit(t,...e){if(!this.e[t])return;const r=this.e[t].slice();for(const n of r)try{n(...e)}catch(e){console.error(`Ошибка в обработчике события ${t}:`,e)}}once(t,e){const r=(...n)=>{this.off(t,r),e(...n)};return this.on(t,r)}clear(t){t?delete this.e[t]:this.e={}}}var J=Object.defineProperty,L=(t,e,r)=>(((t,e,r)=>{e in t?J(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class Y{constructor(t,e){L(this,"cb"),L(this,"o"),L(this,"tId",null),L(this,"s"),this.cb=t,this.o=e,this.s=[]}execute(...t){if(this.cancel(),"[object Function]"===Object.prototype.toString.call(t[0]))this.s=t[0](...this.s);else for(let e=0;e<this.cb.length;e++)this.s[e]=t[e];this.tId=setTimeout(this.executeImmediately.bind(this),this.o.delay)}executeImmediately(){this.cancel(),this.cb(...this.s),this.s=[]}cancel(){this.tId&&(clearTimeout(this.tId),this.tId=null)}}var _=Object.defineProperty,G=(t,e,r)=>(((t,e,r)=>{e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class H{constructor(t){G(this,"getter"),G(this,"initValue"),G(this,"currentValue");const e=t();this.getter=t,this.initValue=d(e),this.currentValue=e}setter(t){this.currentValue=t(this.currentValue)}reset(){const t=this.getter();this.initValue=d(t),this.currentValue=t}isModified(){return!p(this.initValue,this.currentValue)}}export{H as DataKeeper,Y as DebouncedFunction,B as EventEmitter,R as HEXtoRGB,q as HSVtoRGB,E as RGBtoHEX,F as RGBtoHSV,r as alignTo,P as chunks,t as clamp,p as comparison,h as copyText,g as createLinksFromText,e as decWord,I as elasticClamp,o as formatNumber,m as generateUniqueKey,N as groupBy,a as isType,z as memoize,u as omit,V as orderBy,O as parseQueryString,$ as parseVersionString,l as pick,i as random,c as randomByWeight,x as retry,C as shuffle,f as sleep,M as textParserUrl,s as timeAgo,n as toShort,S as unique,d as unlink,A as updateCurrent};
|
|
1
|
+
const t=(t,e,r)=>t>e?t<r?t:r:e,e=(t,e)=>e[t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2];function r(t,e){return t<=0?e:t+(e-t%e)%e}const n=(t,e,r=1)=>{const n=e||["","k","M","G","T","P"],s=t<0,o=Math.abs(t),i=Math.log10(o)/3|0,c=o/10**(3*i);return parseFloat(`${s?"-":""}${c%1?(Math.floor(10*c)/10).toFixed(r):c}`)+n[i]},s=t=>{if(!t)return"только что";const r=new Date(t),n=Math.floor((Date.now()-r.getTime())/1e3),s=()=>new Intl.DateTimeFormat("RU-ru",{day:"numeric",month:"short"}).format(r).replace(".",""),o=()=>r.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),i=(t,r,n)=>Array.isArray(t)?`${n} ${e(n,t)} ${r}`:`${t} ${r}`;switch(!0){case n<0:return"скоро";case n<60:return i(["секунду","секунды","секунд"],"назад",n);case n<3600:return i(["минуту","минуты","минут"],"назад",Math.floor(n/60));case n<7200:return i("час","назад",Math.floor(n/3600));case n<10800:return i("два часа","назад",Math.floor(n/3600));case n<14400:return i("три часа","назад",Math.floor(n/3600));case n<86400:return i(`сегодня в ${o()}`,"",Math.floor(n/3600));case n<172800:return i(`вчера в ${o()}`,"",Math.floor(n/86400));case n<259200:return i("два дня","назад",Math.floor(n/86400));case n<345600:return i("три дня","назад",Math.floor(n/86400));case n<31536e3:return i(`${s()} в ${o()}`,"",Math.floor(n/86400));case n>=31536e3:return i(`${s()} ${r.getFullYear()} г.`,"",Math.floor(n/31536e3))}return"только что"},o=t=>(t||0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,".");function i(t,e,r){if(!r){const t=new Date;r=t.getDate()*t.getFullYear()*(t.getHours()??1)*t.getMilliseconds()}const n=function(t){const e=2**32;let r=t;return function(){var t;return r=(1664525*r+1013904223)%e,t=r,t^=t>>>21,r=(t^=t<<35)^t>>>4,(r>>>0)/e}}(r);return function(t,e,r){if(e>r)throw new Error("Минимальная граница не может быть больше максимальной.");return Math.floor(t()*(r-e+1))+e}(n,t,e)}function c(t,e){let r=0;for(const e in t)r+=t[e];const n=i(0,r,e);let s=0;for(const e in t)if(s+=t[e],n<s)return e;const o=Object.keys(t);return o[i(0,o.length-1,e)]}function a(t,e){var r=Object.prototype.toString.call(t).replace("[object ","").replace("]","").toLowerCase();try{t instanceof Buffer?r="buffer":"number"===r&&isNaN(t)&&(r="nan")}catch{}return void 0!==e?r===e:r}function u(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)||(r[n]=t[n]),r)),{})}function l(t,e){return Object.keys(t).reduce(((r,n)=>(e.includes(n)&&(r[n]=t[n]),r)),{})}const f=async t=>await new Promise((e=>setTimeout(e,t))),h=t=>{if(t){try{navigator.clipboard?.writeText(t)}catch{}try{var e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}catch{}}},g=(t,e)=>{const r=[],n=/{{([^}]+):([^}]+)}}/g;let s,o=0;for(;null!==(s=n.exec(t));)r.push(t.substring(o,s.index)),o=s.index+s[0].length,r.push({key:s[1],text:s[2]});return r.push(t.substring(o)),r.map((t=>"string"==typeof t?t:e(t.key,t.text)))},p=(t,e)=>{switch(a(t)){case"array":if(!function(t,e,r){if(!b(t,e,"array",r))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!p(t[n],e[n]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"object":if(!function(t,e,r){if(!b(t,e,"object",r))return!1;const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(var o of n){if(!e.hasOwnProperty(o))return!1;if(!p(t[o],e[o]))return!1}return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"function":if(!function(t,e,r){return!!b(t,e,"function",r)&&t===e}(t,e,{skipCheckPrev:!0}))return!1;break;case"date":if(!function(t,e,r){return!!b(t,e,"date",r)&&t.getTime()===e.getTime()}(t,e,{skipCheckPrev:!0}))return!1;break;case"map":if(!function(t,e,r){if(!b(t,e,"map",r))return!1;if(t.size!==e.size)return!1;for(const[r,n]of t)if(!p(n,e.get(r)))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;case"set":if(!function(t,e,r){if(!b(t,e,"set",r))return!1;if(t.size!==e.size)return!1;const n=Array.from(t.keys()),s=Array.from(e.keys());for(var o=0;o<n.length;o++)if(!p(n[o],s[o]))return!1;return!0}(t,e,{skipCheckPrev:!0}))return!1;break;default:if(t!==e)return!1}return!0};function b(t,e,r,n){return!(!n?.skipCheckPrev&&!a(t,r)||!a(e,r))}const m=t=>{const e=t=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||null===t)return JSON.stringify(t);if(Array.isArray(t))return"["+t.map(e).join(",")+"]";if("object"==typeof t){const r=Object.keys(t).sort();let n="{";for(let s=0;s<r.length;s++){const o=r[s];n+=JSON.stringify(o)+":"+e(t[o]),s<r.length-1&&(n+=",")}return n+="}",n}return String(t)},r=t=>{let e=0;if(0===t.length)return e;for(let r=0;r<t.length;r++){e=(e<<5)-e+t.charCodeAt(r),e|=0}return e};try{const n=e(t);return r(n).toString(16)}catch(e){return console.warn(`Object could not be fully stringified. Using a simple string conversion. Error: ${e}`),r(String(t)).toString(16)}},d=t=>{switch(a(t)){case"array":return y(t);case"object":return k(t);case"number":return Number(String(t));case"string":return String(t);case"bigint":return BigInt(String(t));case"map":return new Map(t);case"set":return new Set(t);default:return t}},y=t=>{const e=[];for(const r of t)e.push(d(r));return e},k=t=>{const e={};for(const r in t)e[r]=d(t[r]);return e},v=new RegExp(/(?:https?:\/\/)?(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),w=new RegExp(/(?:https?:\/\/)(?:www\.)?([А-Яа-яa-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.(?:ru|com|org|net|me|su|рф|biz|info|co|uk|de|fr|jp|cn|es|it|ca|au|nl|se|no|dk|fi|pl|at|ch|be|cz|ie|pt|ro|hu|gr|sk|bg|hr|si|lt|lv|ee|is|mt|lu|li|mc|sm|va|ad|al|ba|mk|me|rs|tr|ua|by|kz|uz|am|ge|az|tm|kg|tj|md|kg|tj|af|dz|bh|eg|iq|ir|jo|kw|lb|ly|ma|om|ps|qa|sa|sd|sy|tn|ae|ye|ar|bo|br|cl|co|ec|gf|gy|pe|py|sr|uy|ve|ag|ai|aw|bb|bm|bs|bz|ca|cr|cu|dm|do|gd|gp|gt|hn|ht|jm|kn|ky|lc|ms|mx|ni|pa|pr|sv|tc|tt|vc|vg|vi|an|aq|as|fj|fm|gu|hm|id|ki|mh|mp|nc|nf|nr|nu|pf|pg|pw|sb|tk|to|tv|vu|wf|ws)(?:\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?)(?:\s)/),j=t=>t,M=(t,e)=>{const r=e?.onToken??j,n=e?.requireProtocol??!1,s=e?.regex??n?w:v,o=[];let i=t+" ",c=s.exec(i);for(;c;){const t=c[0].trim(),e=c.index;e>0&&(o.push(r({type:"raw",value:i.substring(0,e)})),i=i.substring(e)),o.push(r({type:"url",value:t})),i=i.substring(t.length),c=s.exec(i)}return i.length>0&&o.push(r({type:"raw",value:i})),o};function z(t){const e=new Map;return function(...r){const n=JSON.stringify(r);if(e.has(n))return e.get(n);const s=t(...r);return e.set(n,s),s}}function x(t,e,r){return new Promise(((n,s)=>{const o=e=>{t().then(n).catch((t=>{0===e?s(t):(console.log(`Retrying... attempts left: ${e}`),setTimeout((()=>o(e-1)),r))}))};o(e)}))}function O(t){const e={},r=(t.startsWith("?")?t.slice(1):t).split("&");for(const t of r){const[r,n]=t.split("=");if(r){const t=decodeURIComponent(r),s=n?decodeURIComponent(n):"";e[t]=s}}return e}function $(t){const e=t.match(/^(\d+|\*)\.(\d+|\*)\.(\d+|\*)(?:-([a-zA-Z0-9-.]+))?$/);if(!e)throw new Error("Invalid version string");const[,r,n,s,o]=e,i=t=>"*"===t?"*":parseInt(t,10);return{major:i(r),minor:i(n),patch:i(s),prerelease:o||null}}const I=(t,e,r,n={})=>{const{threshold:s=50,resistance:o=.2}=n;if(t<e){const r=e-t;return e-s*(1-Math.exp(-r*o/s))}if(t>r){const e=t-r;return r+s*(1-Math.exp(-e*o/s))}return t};function S(t){return Array.from(new Set(t))}function P(t,e){switch(a(t)){case"object":return function(t,e){const r={},n=Object.keys(t),s=Object.keys(e),o=S([...n,...s]);for(const n of o)r[n]=P(t[n],e[n]);return r}(t,e);case"array":return function(t,e){const r=[];for(var n=0;n<t.length;n++)r.push(P(t?.[n],e?.[n]));for(n=t.length;n<e.length;n++)r.push(P(t?.[n],e?.[n]));return r}(t,e);default:return t??e}}function A(t,e){switch(a(t)){case"object":return function(t,e){const r={};var n=!1;for(const s in e)if(t.hasOwnProperty(s)){const o=A(t?.[s],e?.[s]);void 0!==o&&(r[s]=o,n=!0)}else r[s]=e[s],n=!0;for(const s in t)s in e||(r[s]=void 0,n=!0);return n?r:void 0}(t,e);case"array":return function(t,e){const r=[];for(var n=!1,s=0;s<t.length;s++){const o=A(t?.[s],e?.[s]);void 0===o&&void 0!==e?.[s]||(r[s]=o,n=!0)}for(s=0;s<e.length;s++){const o=A(t?.[s],e?.[s]);void 0!==o&&(r[s]=o,n=!0)}return n?r:void 0}(t,e);default:if(t!==e)return e}}const C=(t,e)=>{const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r},V=(t,e)=>{for(let r=t.length-1;r>0;r--){const n=i(0,r,e);[t[r],t[n]]=[t[n],t[r]]}return t};function N(t,e){return t.reduce(((t,r)=>{const n=e(r);return t[n]||(t[n]=[]),t[n].push(r),t}),{})}function T(t,e){return e.split(".").reduce(((t,e)=>t?t[e]:void 0),t)}function q(t,e){const r=Object.keys(e);return t.slice().sort(((t,n)=>{for(const s of r){const r="desc"===e[s]?-1:1,o=T(t,s),i=T(n,s);if(o<i)return-r;if(o>i)return r}return 0}))}const Z=(t,e,r)=>{var n,s,o,i,c,a,u,l;switch(a=r*(1-e),u=r*(1-(c=6*t-(i=Math.floor(6*t)))*e),l=r*(1-(1-c)*e),i%6){case 0:n=r,s=l,o=a;break;case 1:n=u,s=r,o=a;break;case 2:n=a,s=r,o=l;break;case 3:n=a,s=u,o=r;break;case 4:n=l,s=a,o=r;break;case 5:n=r,s=a,o=u}return[Math.round(255*n),Math.round(255*s),Math.round(255*o)]},E=t=>{const e=t.toString(16);return 1==e.length?"0"+e:e},F=(t,e,r)=>"#"+E(t)+E(e)+E(r),R=(t,e,r)=>{var n=Math.max(t,e,r),s=Math.min(t,e,r),o=n-s,i=0,c=0===n?0:o/n,a=n/255;switch(n){case s:i=0;break;case t:i=e-r+o*(e<r?6:0),i/=6*o;break;case e:i=r-t+2*o,i/=6*o;break;case r:i=t-e+4*o,i/=6*o}return[i,c,a]},D=t=>{if(3===(t=t.replace("#","")).length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)return[0,0,0];const e=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16);return isNaN(e)||isNaN(r)||isNaN(n)||e<0||e>255||r<0||r>255||n<0||n>255?[0,0,0]:[e,r,n]};var U=Object.defineProperty,B=(t,e,r)=>(((t,e,r)=>{e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class J{constructor(){B(this,"e",{})}on(t,e){return this.e[t]||(this.e[t]=[]),this.e[t].push(e),()=>this.off(t,e)}off(t,e){if(!this.e[t])return;const r=this.e[t].findIndex((t=>t===e));-1!==r&&(this.e[t].splice(r,1),0===this.e[t].length&&delete this.e[t])}emit(t,...e){if(!this.e[t])return;const r=this.e[t].slice();for(const n of r)try{n(...e)}catch(e){console.error(`Ошибка в обработчике события ${t}:`,e)}}once(t,e){const r=(...n)=>{this.off(t,r),e(...n)};return this.on(t,r)}clear(t){t?delete this.e[t]:this.e={}}}var L=Object.defineProperty,Y=(t,e,r)=>(((t,e,r)=>{e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class _{constructor(t,e){Y(this,"cb"),Y(this,"o"),Y(this,"tId",null),Y(this,"s"),this.cb=t,this.o=e,this.s=[]}execute(...t){if(this.cancel(),"[object Function]"===Object.prototype.toString.call(t[0]))this.s=t[0](...this.s);else for(let e=0;e<this.cb.length;e++)this.s[e]=t[e];this.tId=setTimeout(this.executeImmediately.bind(this),this.o.delay)}executeImmediately(){this.cancel(),this.cb(...this.s),this.s=[]}cancel(){this.tId&&(clearTimeout(this.tId),this.tId=null)}}var G=Object.defineProperty,H=(t,e,r)=>(((t,e,r)=>{e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r})(t,"symbol"!=typeof e?e+"":e,r),r);class W{constructor(t){H(this,"initValue"),H(this,"currentValue"),this.initValue=d(t),this.currentValue=t}setter(t){this.currentValue=t(this.currentValue)}reset(t){this.initValue=d(t),this.currentValue=t}isModified(){return!p(this.initValue,this.currentValue)}get updateValues(){return A(this.initValue,this.currentValue)}}export{W as DataKeeper,_ as DebouncedFunction,J as EventEmitter,D as HEXtoRGB,Z as HSVtoRGB,F as RGBtoHEX,R as RGBtoHSV,r as alignTo,C as chunks,t as clamp,p as comparison,h as copyText,g as createLinksFromText,e as decWord,I as elasticClamp,o as formatNumber,m as generateUniqueKey,A as getChangedData,N as groupBy,a as isType,z as memoize,u as omit,q as orderBy,O as parseQueryString,$ as parseVersionString,l as pick,i as random,c as randomByWeight,x as retry,V as shuffle,f as sleep,M as textParserUrl,s as timeAgo,n as toShort,S as unique,d as unlink,P as updateCurrent};
|