@oardi/ts-utils 0.0.6 → 0.0.7
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/README.md +15 -0
- package/index.cjs.js +11 -11
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.es.js +831 -456
- package/index.umd.js +11 -11
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @oardi/ts-utils
|
|
2
|
+
|
|
3
|
+
Powerful set of Typescript Utility Extensions Methods, Helpers, Interfaces, Services and Types.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### Install npm package
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm i @oardi/ts-utils
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### about
|
|
14
|
+
|
|
15
|
+
Developed and maintained by [oardi](https://github.com/oardi)
|
package/index.cjs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Re=(b=>(b.opera="opera",b.firefox="firefox",b.safari="safari",b.ie="ie",b.edge="edge",b.edg="edg",b.electron="electron",b.chrome="chrome",b.iOsSafari="iOsSafari",b.edgiOs="edgiOs",b.headlessChrome="headlessChrome",b))(Re||{});const ce=[{breakpoint:"xs",screenWidth:0},{breakpoint:"sm",screenWidth:375},{breakpoint:"md",screenWidth:768},{breakpoint:"lg",screenWidth:992},{breakpoint:"xl",screenWidth:1200},{breakpoint:"xxl",screenWidth:1400},{breakpoint:"xxxl",screenWidth:1600}];class xe{screenWidth=0;lastBreakpoint;resizeListener;resizeCallbacks=new Set;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),this.lastBreakpoint=this.getBreakpointBySize(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.resizeCallbacks.clear()}onBreakpointChange(i){this.resizeCallbacks.add(i)}offBreakpointChange(i){this.resizeCallbacks.delete(i)}getCurrentBrowser(){const i=navigator.userAgent.toLowerCase();if(this.isOpera())return"opera";if(this.isFirefox())return"firefox";if(this.isSafari())return"safari";if(this.isIE())return"ie";if(this.isEdge())return"edge";if(this.isEdg())return"edg";if(this.isElectron(i))return"electron";if(this.isChrome())return"chrome";if(this.isIOsSafari(i))return"iOsSafari";if(this.isEdgiOs(i))return"edgiOs";if(this.isHeadlessChrome(i))return"headlessChrome";throw new Error("Browser could not be detected: "+i)}getBreakpointBySize(i=this.screenWidth){let u=ce[0];for(const l of ce)l.screenWidth<=i&&(u=l);return u}isScreenGreaterThan(i){const u=this.getBreakpoint(i);return this.screenWidth>(u?.screenWidth??0)}isScreenSmallerThan(i){const u=this.getBreakpoint(i);return this.screenWidth<(u?.screenWidth??0)}getBreakpoint(i){return ce.find(u=>u.breakpoint===i)}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof InstallTrigger<"u"}isSafari(){return/constructor/i.test(window.HTMLElement)||(i=>i.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return!!document.documentMode}isEdge(){return!this.isIE()&&!!window.StyleMedia}isEdg(){return navigator.userAgent.toLowerCase().includes("edg")}isElectron(i){return i.includes("electron")}isChrome(){return typeof window<"u"&&!!window.chrome&&!this.isOpera()&&!this.isEdge()&&!this.isEdg()&&!this.isFirefox()&&!this.isSafari()&&!this.isIE()}isIOsSafari(i){return i.includes("iphone")||i.includes("ipad")||i.includes("macintosh")&&"ontouchend"in document&&i.includes("safari")}isEdgiOs(i){return i.includes("edgios")}isHeadlessChrome(i){return i.includes("headlesschrome")}onResize(i){const u=i.target.innerWidth;this.screenWidth=u;const l=this.getBreakpointBySize(u);this.lastBreakpoint?.breakpoint!==l?.breakpoint&&(this.lastBreakpoint=l,this.resizeCallbacks.forEach(O=>O(l)))}}class Oe{copy(i){return navigator.clipboard.writeText(i)}}var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pe={exports:{}},Ce=pe.exports,be;function Le(){return be||(be=1,function(b,i){(function(u,l){l()})(Ce,function(){function u(n,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\uFEFF",n],{type:n.type}):n}function l(n,p,P){var k=new XMLHttpRequest;k.open("GET",n),k.responseType="blob",k.onload=function(){ie(k.response,p,P)},k.onerror=function(){console.error("could not download file")},k.send()}function O(n){var p=new XMLHttpRequest;p.open("HEAD",n,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function C(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(p)}}var q=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof fe=="object"&&fe.global===fe?fe:void 0,re=q.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),ie=q.saveAs||(typeof window!="object"||window!==q?function(){}:"download"in HTMLAnchorElement.prototype&&!re?function(n,p,P){var k=q.URL||q.webkitURL,F=document.createElement("a");p=p||n.name||"download",F.download=p,F.rel="noopener",typeof n=="string"?(F.href=n,F.origin===location.origin?C(F):O(F.href)?l(n,p,P):C(F,F.target="_blank")):(F.href=k.createObjectURL(n),setTimeout(function(){k.revokeObjectURL(F.href)},4e4),setTimeout(function(){C(F)},0))}:"msSaveOrOpenBlob"in navigator?function(n,p,P){if(p=p||n.name||"download",typeof n!="string")navigator.msSaveOrOpenBlob(u(n,P),p);else if(O(n))l(n,p,P);else{var k=document.createElement("a");k.href=n,k.target="_blank",setTimeout(function(){C(k)})}}:function(n,p,P,k){if(k=k||open("","_blank"),k&&(k.document.title=k.document.body.innerText="downloading..."),typeof n=="string")return l(n,p,P);var F=n.type==="application/octet-stream",ne=/constructor/i.test(q.HTMLElement)||q.safari,ue=/CriOS\/[\d]+/.test(navigator.userAgent);if((ue||F&&ne||re)&&typeof FileReader<"u"){var Z=new FileReader;Z.onloadend=function(){var V=Z.result;V=ue?V:V.replace(/^data:[^;]*;/,"data:attachment/file;"),k?k.location.href=V:location=V,k=null},Z.readAsDataURL(n)}else{var se=q.URL||q.webkitURL,le=se.createObjectURL(n);k?k.location=le:location.href=le,k=null,setTimeout(function(){se.revokeObjectURL(le)},4e4)}});q.saveAs=ie.saveAs=ie,b.exports=ie})}(pe)),pe.exports}var Ae=Le(),ge={exports:{}};/* @license
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=(h,r,f)=>h.localeCompare(r)*(f?1:-1),Te=(h,r)=>h<r?-1:h===r?0:1,Fe=(h,r,f)=>Te(h,r)*(f?1:-1),Ie=(h,r,f)=>{let d=0;return typeof h=="string"&&typeof r=="string"?d=Ae(h,r,f):d=Fe(h,r,f),d},$e=(h,r,f,d)=>{const C=f(h),$=f(r);return Ie(C,$,d)};Array.prototype.groupBy=function(h){return this.reduce((r,f)=>{const d=h(f);return(r[d]=r[d]||[]).push(f),r},{})};Array.prototype.removeBy=function(h,r){return this.filter(f=>h(f)!==r)};Array.prototype.orderBy=function(h,r=!0){return this?.sort((f,d)=>$e(f,d,h,r)),this};Array.prototype.filterBy=function(h){return this.filter(r=>{let f=!1;return h&&r[h]?f=r[h]===h:f=r===h,f})};Array.prototype.distinct=function(h){const r=this;return h?r.filter((d,C,$)=>$.findIndex(z=>h(z,d))===C):r.filter((d,C,$)=>$.indexOf(d)===C)};var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ce(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var me={exports:{}},je=me.exports,Oe;function ze(){return Oe||(Oe=1,function(h,r){(function(f,d){h.exports=d()})(je,function(){var f=1e3,d=6e4,C=36e5,$="millisecond",z="second",N="minute",q="hour",o="day",S="week",A="month",D="quarter",T="year",Q="date",G="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,se=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ae={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var l=["th","st","nd","rd"],c=_%100;return"["+_+(l[(c-20)%10]||l[c]||l[0])+"]"}},Z=function(_,l,c){var i=String(_);return!i||i.length>=l?_:""+Array(l+1-i.length).join(c)+_},pe={s:Z,z:function(_){var l=-_.utcOffset(),c=Math.abs(l),i=Math.floor(c/60),a=c%60;return(l<=0?"+":"-")+Z(i,2,"0")+":"+Z(a,2,"0")},m:function _(l,c){if(l.date()<c.date())return-_(c,l);var i=12*(c.year()-l.year())+(c.month()-l.month()),a=l.clone().add(i,A),u=c-a<0,y=l.clone().add(i+(u?-1:1),A);return+(-(i+(c-a)/(u?a-y:y-a))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:A,y:T,w:S,d:o,D:Q,h:q,m:N,s:z,ms:$,Q:D}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},oe="en",K={};K[oe]=ae;var F="$isDayjsObject",e=function(_){return _ instanceof m||!(!_||!_[F])},t=function _(l,c,i){var a;if(!l)return oe;if(typeof l=="string"){var u=l.toLowerCase();K[u]&&(a=u),c&&(K[u]=c,a=u);var y=l.split("-");if(!a&&y.length>1)return _(y[0])}else{var g=l.name;K[g]=l,a=g}return!i&&a&&(oe=a),a||!i&&oe},n=function(_,l){if(e(_))return _.clone();var c=typeof l=="object"?l:{};return c.date=_,c.args=arguments,new m(c)},s=pe;s.l=t,s.i=e,s.w=function(_,l){return n(_,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var m=function(){function _(c){this.$L=t(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[F]=!0}var l=_.prototype;return l.parse=function(c){this.$d=function(i){var a=i.date,u=i.utc;if(a===null)return new Date(NaN);if(s.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var y=a.match(X);if(y){var g=y[2]-1||0,v=(y[7]||"0").substring(0,3);return u?new Date(Date.UTC(y[1],g,y[3]||1,y[4]||0,y[5]||0,y[6]||0,v)):new Date(y[1],g,y[3]||1,y[4]||0,y[5]||0,y[6]||0,v)}}return new Date(a)}(c),this.init()},l.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},l.$utils=function(){return s},l.isValid=function(){return this.$d.toString()!==G},l.isSame=function(c,i){var a=n(c);return this.startOf(i)<=a&&a<=this.endOf(i)},l.isAfter=function(c,i){return n(c)<this.startOf(i)},l.isBefore=function(c,i){return this.endOf(i)<n(c)},l.$g=function(c,i,a){return s.u(c)?this[i]:this.set(a,c)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(c,i){var a=this,u=!!s.u(i)||i,y=s.p(c),g=function(O,x){var w=s.w(a.$u?Date.UTC(a.$y,x,O):new Date(a.$y,x,O),a);return u?w:w.endOf(o)},v=function(O,x){return s.w(a.toDate()[O].apply(a.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(x)),a)},p=this.$W,M=this.$M,L=this.$D,B="set"+(this.$u?"UTC":"");switch(y){case T:return u?g(1,0):g(31,11);case A:return u?g(1,M):g(0,M+1);case S:var Y=this.$locale().weekStart||0,k=(p<Y?p+7:p)-Y;return g(u?L-k:L+(6-k),M);case o:case Q:return v(B+"Hours",0);case q:return v(B+"Minutes",1);case N:return v(B+"Seconds",2);case z:return v(B+"Milliseconds",3);default:return this.clone()}},l.endOf=function(c){return this.startOf(c,!1)},l.$set=function(c,i){var a,u=s.p(c),y="set"+(this.$u?"UTC":""),g=(a={},a[o]=y+"Date",a[Q]=y+"Date",a[A]=y+"Month",a[T]=y+"FullYear",a[q]=y+"Hours",a[N]=y+"Minutes",a[z]=y+"Seconds",a[$]=y+"Milliseconds",a)[u],v=u===o?this.$D+(i-this.$W):i;if(u===A||u===T){var p=this.clone().set(Q,1);p.$d[g](v),p.init(),this.$d=p.set(Q,Math.min(this.$D,p.daysInMonth())).$d}else g&&this.$d[g](v);return this.init(),this},l.set=function(c,i){return this.clone().$set(c,i)},l.get=function(c){return this[s.p(c)]()},l.add=function(c,i){var a,u=this;c=Number(c);var y=s.p(i),g=function(M){var L=n(u);return s.w(L.date(L.date()+Math.round(M*c)),u)};if(y===A)return this.set(A,this.$M+c);if(y===T)return this.set(T,this.$y+c);if(y===o)return g(1);if(y===S)return g(7);var v=(a={},a[N]=d,a[q]=C,a[z]=f,a)[y]||1,p=this.$d.getTime()+c*v;return s.w(p,this)},l.subtract=function(c,i){return this.add(-1*c,i)},l.format=function(c){var i=this,a=this.$locale();if(!this.isValid())return a.invalidDate||G;var u=c||"YYYY-MM-DDTHH:mm:ssZ",y=s.z(this),g=this.$H,v=this.$m,p=this.$M,M=a.weekdays,L=a.months,B=a.meridiem,Y=function(x,w,I,U){return x&&(x[w]||x(i,u))||I[w].slice(0,U)},k=function(x){return s.s(g%12||12,x,"0")},O=B||function(x,w,I){var U=x<12?"AM":"PM";return I?U.toLowerCase():U};return u.replace(se,function(x,w){return w||function(I){switch(I){case"YY":return String(i.$y).slice(-2);case"YYYY":return s.s(i.$y,4,"0");case"M":return p+1;case"MM":return s.s(p+1,2,"0");case"MMM":return Y(a.monthsShort,p,L,3);case"MMMM":return Y(L,p);case"D":return i.$D;case"DD":return s.s(i.$D,2,"0");case"d":return String(i.$W);case"dd":return Y(a.weekdaysMin,i.$W,M,2);case"ddd":return Y(a.weekdaysShort,i.$W,M,3);case"dddd":return M[i.$W];case"H":return String(g);case"HH":return s.s(g,2,"0");case"h":return k(1);case"hh":return k(2);case"a":return O(g,v,!0);case"A":return O(g,v,!1);case"m":return String(v);case"mm":return s.s(v,2,"0");case"s":return String(i.$s);case"ss":return s.s(i.$s,2,"0");case"SSS":return s.s(i.$ms,3,"0");case"Z":return y}return null}(x)||y.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(c,i,a){var u,y=this,g=s.p(i),v=n(c),p=(v.utcOffset()-this.utcOffset())*d,M=this-v,L=function(){return s.m(y,v)};switch(g){case T:u=L()/12;break;case A:u=L();break;case D:u=L()/3;break;case S:u=(M-p)/6048e5;break;case o:u=(M-p)/864e5;break;case q:u=M/C;break;case N:u=M/d;break;case z:u=M/f;break;default:u=M}return a?u:s.a(u)},l.daysInMonth=function(){return this.endOf(A).$D},l.$locale=function(){return K[this.$L]},l.locale=function(c,i){if(!c)return this.$L;var a=this.clone(),u=t(c,i,!0);return u&&(a.$L=u),a},l.clone=function(){return s.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},_}(),b=m.prototype;return n.prototype=b,[["$ms",$],["$s",z],["$m",N],["$H",q],["$W",o],["$M",A],["$y",T],["$D",Q]].forEach(function(_){b[_[1]]=function(l){return this.$g(l,_[0],_[1])}}),n.extend=function(_,l){return _.$i||(_(l,m,n),_.$i=!0),n},n.locale=t,n.isDayjs=e,n.unix=function(_){return n(1e3*_)},n.en=K[oe],n.Ls=K,n.p={},n})}(me)),me.exports}var We=ze();const te=Ce(We);var _e={exports:{}},Be=_e.exports,xe;function Ue(){return xe||(xe=1,function(h,r){(function(f,d){h.exports=d()})(Be,function(){var f={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(d,C,$){var z=C.prototype,N=z.format;$.en.formats=f,z.format=function(q){q===void 0&&(q="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,S=function(A,D){return A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,Q,G){var X=G&&G.toUpperCase();return Q||D[G]||f[G]||D[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(se,ae,Z){return ae||Z.slice(1)})})}(q,o===void 0?{}:o);return N.call(this,S)}}})}(_e)),_e.exports}var He=Ue();const Ye=Ce(He);te.extend(Ye);Date.prototype.isAfter=function(h,r){return te(this).isAfter(h,r)};Date.prototype.isBefore=function(h,r){return te(this).isBefore(h,r)};Date.prototype.format=function(h){return te(this).format(h)};Date.prototype.isValid=function(){return te(this).isValid()};Date.prototype.add=function(h,r){return te(this).add(h,r).toDate()};Date.prototype.subtract=function(h,r){return te(this).subtract(h,r).toDate()};Date.prototype.firstDayOfMonth=function(){return te(this).startOf("month").toDate()};Date.prototype.lastDayOfMonth=function(){return te(this).endOf("month").toDate()};Date.prototype.set=function(h,r){return te(this).set(h,r).toDate()};Date.prototype.diff=function(h,r){return te(this).diff(h,r)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var Le=(h=>(h.opera="opera",h.firefox="firefox",h.safari="safari",h.ie="ie",h.edge="edge",h.edg="edg",h.electron="electron",h.chrome="chrome",h.iOsSafari="iOsSafari",h.edgiOs="edgiOs",h.headlessChrome="headlessChrome",h))(Le||{});const ye=[{breakpoint:"xs",screenWidth:0},{breakpoint:"sm",screenWidth:375},{breakpoint:"md",screenWidth:768},{breakpoint:"lg",screenWidth:992},{breakpoint:"xl",screenWidth:1200},{breakpoint:"xxl",screenWidth:1400},{breakpoint:"xxxl",screenWidth:1600}];class Pe{screenWidth=0;lastBreakpoint;resizeListener;resizeCallbacks=new Set;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),this.lastBreakpoint=this.getBreakpointBySize(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.resizeCallbacks.clear()}onBreakpointChange(r){this.resizeCallbacks.add(r)}offBreakpointChange(r){this.resizeCallbacks.delete(r)}getCurrentBrowser(){const r=navigator.userAgent.toLowerCase();if(this.isOpera())return"opera";if(this.isFirefox())return"firefox";if(this.isSafari())return"safari";if(this.isIE())return"ie";if(this.isEdge())return"edge";if(this.isEdg())return"edg";if(this.isElectron(r))return"electron";if(this.isChrome())return"chrome";if(this.isIOsSafari(r))return"iOsSafari";if(this.isEdgiOs(r))return"edgiOs";if(this.isHeadlessChrome(r))return"headlessChrome";throw new Error("Browser could not be detected: "+r)}getBreakpointBySize(r=this.screenWidth){let f=ye[0];for(const d of ye)d.screenWidth<=r&&(f=d);return f}isScreenGreaterThan(r){const f=this.getBreakpoint(r);return this.screenWidth>(f?.screenWidth??0)}isScreenSmallerThan(r){const f=this.getBreakpoint(r);return this.screenWidth<(f?.screenWidth??0)}getBreakpoint(r){return ye.find(f=>f.breakpoint===r)}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof InstallTrigger<"u"}isSafari(){return/constructor/i.test(window.HTMLElement)||(r=>r.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return!!document.documentMode}isEdge(){return!this.isIE()&&!!window.StyleMedia}isEdg(){return navigator.userAgent.toLowerCase().includes("edg")}isElectron(r){return r.includes("electron")}isChrome(){return typeof window<"u"&&!!window.chrome&&!this.isOpera()&&!this.isEdge()&&!this.isEdg()&&!this.isFirefox()&&!this.isSafari()&&!this.isIE()}isIOsSafari(r){return r.includes("iphone")||r.includes("ipad")||r.includes("macintosh")&&"ontouchend"in document&&r.includes("safari")}isEdgiOs(r){return r.includes("edgios")}isHeadlessChrome(r){return r.includes("headlesschrome")}onResize(r){const f=r.target.innerWidth;this.screenWidth=f;const d=this.getBreakpointBySize(f);this.lastBreakpoint?.breakpoint!==d?.breakpoint&&(this.lastBreakpoint=d,this.resizeCallbacks.forEach(C=>C(d)))}}class qe{copy(r){return navigator.clipboard.writeText(r)}}var ve={exports:{}},Ne=ve.exports,De;function Ke(){return De||(De=1,function(h,r){(function(f,d){d()})(Ne,function(){function f(o,S){return typeof S>"u"?S={autoBom:!1}:typeof S!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),S={autoBom:!S}),S.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\uFEFF",o],{type:o.type}):o}function d(o,S,A){var D=new XMLHttpRequest;D.open("GET",o),D.responseType="blob",D.onload=function(){q(D.response,S,A)},D.onerror=function(){console.error("could not download file")},D.send()}function C(o){var S=new XMLHttpRequest;S.open("HEAD",o,!1);try{S.send()}catch{}return 200<=S.status&&299>=S.status}function $(o){try{o.dispatchEvent(new MouseEvent("click"))}catch{var S=document.createEvent("MouseEvents");S.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),o.dispatchEvent(S)}}var z=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,N=z.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),q=z.saveAs||(typeof window!="object"||window!==z?function(){}:"download"in HTMLAnchorElement.prototype&&!N?function(o,S,A){var D=z.URL||z.webkitURL,T=document.createElement("a");S=S||o.name||"download",T.download=S,T.rel="noopener",typeof o=="string"?(T.href=o,T.origin===location.origin?$(T):C(T.href)?d(o,S,A):$(T,T.target="_blank")):(T.href=D.createObjectURL(o),setTimeout(function(){D.revokeObjectURL(T.href)},4e4),setTimeout(function(){$(T)},0))}:"msSaveOrOpenBlob"in navigator?function(o,S,A){if(S=S||o.name||"download",typeof o!="string")navigator.msSaveOrOpenBlob(f(o,A),S);else if(C(o))d(o,S,A);else{var D=document.createElement("a");D.href=o,D.target="_blank",setTimeout(function(){$(D)})}}:function(o,S,A,D){if(D=D||open("","_blank"),D&&(D.document.title=D.document.body.innerText="downloading..."),typeof o=="string")return d(o,S,A);var T=o.type==="application/octet-stream",Q=/constructor/i.test(z.HTMLElement)||z.safari,G=/CriOS\/[\d]+/.test(navigator.userAgent);if((G||T&&Q||N)&&typeof FileReader<"u"){var X=new FileReader;X.onloadend=function(){var Z=X.result;Z=G?Z:Z.replace(/^data:[^;]*;/,"data:attachment/file;"),D?D.location.href=Z:location=Z,D=null},X.readAsDataURL(o)}else{var se=z.URL||z.webkitURL,ae=se.createObjectURL(o);D?D.location=ae:location.href=ae,D=null,setTimeout(function(){se.revokeObjectURL(ae)},4e4)}});z.saveAs=q.saveAs=q,h.exports=q})}(ve)),ve.exports}var Je=Ke(),we={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.5.3
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
5
5
|
License: MIT
|
|
6
|
-
*/var
|
|
7
|
-
`),
|
|
8
|
-
`;for(var
|
|
9
|
-
`&&
|
|
10
|
-
`:"\r"}}function
|
|
11
|
-
`&&
|
|
12
|
-
`&&(
|
|
13
|
-
`);var
|
|
14
|
-
`,
|
|
15
|
-
`,'"',
|
|
6
|
+
*/var Qe=we.exports,Me;function Ze(){return Me||(Me=1,function(h,r){((f,d)=>{h.exports=d()})(Qe,function f(){var d=typeof self<"u"?self:typeof window<"u"?window:d!==void 0?d:{},C,$=!d.document&&!!d.postMessage,z=d.IS_PAPA_WORKER||!1,N={},q=0,o={};function S(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(t){var n=oe(t);n.chunkSize=parseInt(n.chunkSize),t.step||t.chunk||(n.chunkSize=null),this._handle=new G(n),(this._handle.streamer=this)._config=n}).call(this,e),this.parseChunk=function(t,n){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let b=this._config.newline;b||(m=this._config.quoteChar||'"',b=this._handle.guessLineEndings(t,m)),t=[...t.split(b).slice(s)].join(b)}this.isFirstChunk&&F(this._config.beforeFirstChunk)&&(m=this._config.beforeFirstChunk(t))!==void 0&&(t=m),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+t,m=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(t=m.meta.cursor,s=(this._finished||(this._partialLine=s.substring(t-this._baseIndex),this._baseIndex=t),m&&m.data&&(this._rowCount+=m.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),z)d.postMessage({results:m,workerId:o.WORKER_ID,finished:s});else if(F(this._config.chunk)&&!n){if(this._config.chunk(m,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=m=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(m.data),this._completeResults.errors=this._completeResults.errors.concat(m.errors),this._completeResults.meta=m.meta),this._completed||!s||!F(this._config.complete)||m&&m.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||m&&m.meta.paused||this._nextChunk(),m}this._halted=!0},this._sendError=function(t){F(this._config.error)?this._config.error(t):z&&this._config.error&&d.postMessage({workerId:o.WORKER_ID,error:t,finished:!1})}}function A(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),S.call(this,e),this._nextChunk=$?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(n){this._input=n,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),$||(t.onload=K(this._chunkLoaded,this),t.onerror=K(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!$),this._config.downloadRequestHeaders){var n,s=this._config.downloadRequestHeaders;for(n in s)t.setRequestHeader(n,s[n])}var m;this._config.chunkSize&&(m=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+m));try{t.send(this._config.downloadRequestBody)}catch(b){this._chunkError(b.message)}$&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(n=>(n=n.getResponseHeader("Content-Range"))!==null?parseInt(n.substring(n.lastIndexOf("/")+1)):-1)(t),this.parseChunk(t.responseText)))},this._chunkError=function(n){n=t.statusText||n,this._sendError(new Error(n))}}function D(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),S.call(this,e);var t,n,s=typeof FileReader<"u";this.stream=function(m){this._input=m,n=m.slice||m.webkitSlice||m.mozSlice,s?((t=new FileReader).onload=K(this._chunkLoaded,this),t.onerror=K(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var m=this._input,b=(this._config.chunkSize&&(b=Math.min(this._start+this._config.chunkSize,this._input.size),m=n.call(m,this._start,b)),t.readAsText(m,this._config.encoding));s||this._chunkLoaded({target:{result:b}})},this._chunkLoaded=function(m){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(m.target.result)},this._chunkError=function(){this._sendError(t.error)}}function T(e){var t;S.call(this,e=e||{}),this.stream=function(n){return t=n,this._nextChunk()},this._nextChunk=function(){var n,s;if(!this._finished)return n=this._config.chunkSize,t=n?(s=t.substring(0,n),t.substring(n)):(s=t,""),this._finished=!t,this.parseChunk(s)}}function Q(e){S.call(this,e=e||{});var t=[],n=!0,s=!1;this.pause=function(){S.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){S.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(m){this._input=m,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=K(function(m){try{t.push(typeof m=="string"?m:m.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(b){this._streamError(b)}},this),this._streamError=K(function(m){this._streamCleanUp(),this._sendError(m)},this),this._streamEnd=K(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=K(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function G(e){var t,n,s,m,b=Math.pow(2,53),_=-b,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,c=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,i=this,a=0,u=0,y=!1,g=!1,v=[],p={data:[],errors:[],meta:{}};function M(k){return e.skipEmptyLines==="greedy"?k.join("").trim()==="":k.length===1&&k[0].length===0}function L(){if(p&&s&&(Y("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),e.skipEmptyLines&&(p.data=p.data.filter(function(w){return!M(w)})),B()){let w=function(I,U){F(e.transformHeader)&&(I=e.transformHeader(I,U)),v.push(I)};if(p)if(Array.isArray(p.data[0])){for(var k=0;B()&&k<p.data.length;k++)p.data[k].forEach(w);p.data.splice(0,1)}else p.data.forEach(w)}function O(w,I){for(var U=e.header?{}:[],j=0;j<w.length;j++){var W=j,R=w[j],R=((ee,E)=>(H=>(e.dynamicTypingFunction&&e.dynamicTyping[H]===void 0&&(e.dynamicTyping[H]=e.dynamicTypingFunction(H)),(e.dynamicTyping[H]||e.dynamicTyping)===!0))(ee)?E==="true"||E==="TRUE"||E!=="false"&&E!=="FALSE"&&((H=>{if(l.test(H)&&(H=parseFloat(H),_<H&&H<b))return 1})(E)?parseFloat(E):c.test(E)?new Date(E):E===""?null:E):E)(W=e.header?j>=v.length?"__parsed_extra":v[j]:W,R=e.transform?e.transform(R,W):R);W==="__parsed_extra"?(U[W]=U[W]||[],U[W].push(R)):U[W]=R}return e.header&&(j>v.length?Y("FieldMismatch","TooManyFields","Too many fields: expected "+v.length+" fields but parsed "+j,u+I):j<v.length&&Y("FieldMismatch","TooFewFields","Too few fields: expected "+v.length+" fields but parsed "+j,u+I)),U}var x;p&&(e.header||e.dynamicTyping||e.transform)&&(x=1,!p.data.length||Array.isArray(p.data[0])?(p.data=p.data.map(O),x=p.data.length):p.data=O(p.data,0),e.header&&p.meta&&(p.meta.fields=v),u+=x)}function B(){return e.header&&v.length===0}function Y(k,O,x,w){k={type:k,code:O,message:x},w!==void 0&&(k.row=w),p.errors.push(k)}F(e.step)&&(m=e.step,e.step=function(k){p=k,B()?L():(L(),p.data.length!==0&&(a+=k.data.length,e.preview&&a>e.preview?n.abort():(p.data=p.data[0],m(p,i))))}),this.parse=function(k,O,x){var w=e.quoteChar||'"',w=(e.newline||(e.newline=this.guessLineEndings(k,w)),s=!1,e.delimiter?F(e.delimiter)&&(e.delimiter=e.delimiter(k),p.meta.delimiter=e.delimiter):((w=((I,U,j,W,R)=>{var ee,E,H,ce;R=R||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var he=0;he<R.length;he++){for(var re,le=R[he],J=0,ne=0,P=0,V=(H=void 0,new se({comments:W,delimiter:le,newline:U,preview:10}).parse(I)),ue=0;ue<V.data.length;ue++)j&&M(V.data[ue])?P++:(re=V.data[ue].length,ne+=re,H===void 0?H=re:0<re&&(J+=Math.abs(re-H),H=re));0<V.data.length&&(ne/=V.data.length-P),(E===void 0||J<=E)&&(ce===void 0||ce<ne)&&1.99<ne&&(E=J,ee=le,ce=ne)}return{successful:!!(e.delimiter=ee),bestDelimiter:ee}})(k,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=w.bestDelimiter:(s=!0,e.delimiter=o.DefaultDelimiter),p.meta.delimiter=e.delimiter),oe(e));return e.preview&&e.header&&w.preview++,t=k,n=new se(w),p=n.parse(t,O,x),L(),y?{meta:{paused:!0}}:p||{meta:{paused:!1}}},this.paused=function(){return y},this.pause=function(){y=!0,n.abort(),t=F(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){i.streamer._halted?(y=!1,i.streamer.parseChunk(t,!0)):setTimeout(i.resume,3)},this.aborted=function(){return g},this.abort=function(){g=!0,n.abort(),p.meta.aborted=!0,F(e.complete)&&e.complete(p),t=""},this.guessLineEndings=function(I,w){I=I.substring(0,1048576);var w=new RegExp(X(w)+"([^]*?)"+X(w),"gm"),x=(I=I.replace(w,"")).split("\r"),w=I.split(`
|
|
7
|
+
`),I=1<w.length&&w[0].length<x[0].length;if(x.length===1||I)return`
|
|
8
|
+
`;for(var U=0,j=0;j<x.length;j++)x[j][0]===`
|
|
9
|
+
`&&U++;return U>=x.length/2?`\r
|
|
10
|
+
`:"\r"}}function X(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function se(e){var t=(e=e||{}).delimiter,n=e.newline,s=e.comments,m=e.step,b=e.preview,_=e.fastMode,l=null,c=!1,i=e.quoteChar==null?'"':e.quoteChar,a=i;if(e.escapeChar!==void 0&&(a=e.escapeChar),(typeof t!="string"||-1<o.BAD_DELIMITERS.indexOf(t))&&(t=","),s===t)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||-1<o.BAD_DELIMITERS.indexOf(s))&&(s=!1),n!==`
|
|
11
|
+
`&&n!=="\r"&&n!==`\r
|
|
12
|
+
`&&(n=`
|
|
13
|
+
`);var u=0,y=!1;this.parse=function(g,v,p){if(typeof g!="string")throw new Error("Input must be a string");var M=g.length,L=t.length,B=n.length,Y=s.length,k=F(m),O=[],x=[],w=[],I=u=0;if(!g)return J();if(_||_!==!1&&g.indexOf(i)===-1){for(var U=g.split(n),j=0;j<U.length;j++){if(w=U[j],u+=w.length,j!==U.length-1)u+=n.length;else if(p)return J();if(!s||w.substring(0,Y)!==s){if(k){if(O=[],ce(w.split(t)),ne(),y)return J()}else ce(w.split(t));if(b&&b<=j)return O=O.slice(0,b),J(!0)}}return J()}for(var W=g.indexOf(t,u),R=g.indexOf(n,u),ee=new RegExp(X(a)+X(i),"g"),E=g.indexOf(i,u);;)if(g[u]===i)for(E=u,u++;;){if((E=g.indexOf(i,E+1))===-1)return p||x.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:O.length,index:u}),re();if(E===M-1)return re(g.substring(u,E).replace(ee,i));if(i===a&&g[E+1]===a)E++;else if(i===a||E===0||g[E-1]!==a){W!==-1&&W<E+1&&(W=g.indexOf(t,E+1));var H=he((R=R!==-1&&R<E+1?g.indexOf(n,E+1):R)===-1?W:Math.min(W,R));if(g.substr(E+1+H,L)===t){w.push(g.substring(u,E).replace(ee,i)),g[u=E+1+H+L]!==i&&(E=g.indexOf(i,u)),W=g.indexOf(t,u),R=g.indexOf(n,u);break}if(H=he(R),g.substring(E+1+H,E+1+H+B)===n){if(w.push(g.substring(u,E).replace(ee,i)),le(E+1+H+B),W=g.indexOf(t,u),E=g.indexOf(i,u),k&&(ne(),y))return J();if(b&&O.length>=b)return J(!0);break}x.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:O.length,index:u}),E++}}else if(s&&w.length===0&&g.substring(u,u+Y)===s){if(R===-1)return J();u=R+B,R=g.indexOf(n,u),W=g.indexOf(t,u)}else if(W!==-1&&(W<R||R===-1))w.push(g.substring(u,W)),u=W+L,W=g.indexOf(t,u);else{if(R===-1)break;if(w.push(g.substring(u,R)),le(R+B),k&&(ne(),y))return J();if(b&&O.length>=b)return J(!0)}return re();function ce(P){O.push(P),I=u}function he(P){var V=0;return V=P!==-1&&(P=g.substring(E+1,P))&&P.trim()===""?P.length:V}function re(P){return p||(P===void 0&&(P=g.substring(u)),w.push(P),u=M,ce(w),k&&ne()),J()}function le(P){u=P,ce(w),w=[],R=g.indexOf(n,u)}function J(P){if(e.header&&!v&&O.length&&!c){var V=O[0],ue=Object.create(null),Se=new Set(V);let be=!1;for(let fe=0;fe<V.length;fe++){let ie=V[fe];if(ue[ie=F(e.transformHeader)?e.transformHeader(ie,fe):ie]){let de,Ee=ue[ie];for(;de=ie+"_"+Ee,Ee++,Se.has(de););Se.add(de),V[fe]=de,ue[ie]++,be=!0,(l=l===null?{}:l)[de]=ie}else ue[ie]=1,V[fe]=ie;Se.add(ie)}be&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:O,errors:x,meta:{delimiter:t,linebreak:n,aborted:y,truncated:!!P,cursor:I+(v||0),renamedHeaders:l}}}function ne(){m(J()),O=[],x=[]}},this.abort=function(){y=!0},this.getCharIndex=function(){return u}}function ae(e){var t=e.data,n=N[t.workerId],s=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var m={abort:function(){s=!0,Z(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:pe,resume:pe};if(F(n.userStep)){for(var b=0;b<t.results.data.length&&(n.userStep({data:t.results.data[b],errors:t.results.errors,meta:t.results.meta},m),!s);b++);delete t.results}else F(n.userChunk)&&(n.userChunk(t.results,m,t.file),delete t.results)}t.finished&&!s&&Z(t.workerId,t.results)}function Z(e,t){var n=N[e];F(n.userComplete)&&n.userComplete(t),n.terminate(),delete N[e]}function pe(){throw new Error("Not implemented.")}function oe(e){if(typeof e!="object"||e===null)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=oe(e[t]);return n}function K(e,t){return function(){e.apply(t,arguments)}}function F(e){return typeof e=="function"}return o.parse=function(e,t){var n=(t=t||{}).dynamicTyping||!1;if(F(n)&&(t.dynamicTypingFunction=n,n={}),t.dynamicTyping=n,t.transform=!!F(t.transform)&&t.transform,!t.worker||!o.WORKERS_SUPPORTED)return n=null,o.NODE_STREAM_INPUT,typeof e=="string"?(e=(s=>s.charCodeAt(0)!==65279?s:s.slice(1))(e),n=new(t.download?A:T)(t)):e.readable===!0&&F(e.read)&&F(e.on)?n=new Q(t):(d.File&&e instanceof File||e instanceof Object)&&(n=new D(t)),n.stream(e);(n=(()=>{var s;return!!o.WORKERS_SUPPORTED&&(s=(()=>{var m=d.URL||d.webkitURL||null,b=f.toString();return o.BLOB_URL||(o.BLOB_URL=m.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",b,")();"],{type:"text/javascript"})))})(),(s=new d.Worker(s)).onmessage=ae,s.id=q++,N[s.id]=s)})()).userStep=t.step,n.userChunk=t.chunk,n.userComplete=t.complete,n.userError=t.error,t.step=F(t.step),t.chunk=F(t.chunk),t.complete=F(t.complete),t.error=F(t.error),delete t.worker,n.postMessage({input:e,config:t,workerId:n.id})},o.unparse=function(e,t){var n=!1,s=!0,m=",",b=`\r
|
|
14
|
+
`,_='"',l=_+_,c=!1,i=null,a=!1,u=((()=>{if(typeof t=="object"){if(typeof t.delimiter!="string"||o.BAD_DELIMITERS.filter(function(v){return t.delimiter.indexOf(v)!==-1}).length||(m=t.delimiter),typeof t.quotes!="boolean"&&typeof t.quotes!="function"&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!="boolean"&&typeof t.skipEmptyLines!="string"||(c=t.skipEmptyLines),typeof t.newline=="string"&&(b=t.newline),typeof t.quoteChar=="string"&&(_=t.quoteChar),typeof t.header=="boolean"&&(s=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");i=t.columns}t.escapeChar!==void 0&&(l=t.escapeChar+_),t.escapeFormulae instanceof RegExp?a=t.escapeFormulae:typeof t.escapeFormulae=="boolean"&&t.escapeFormulae&&(a=/^[=+\-@\t\r].*$/)}})(),new RegExp(X(_),"g"));if(typeof e=="string"&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return y(null,e,c);if(typeof e[0]=="object")return y(i||Object.keys(e[0]),e,c)}else if(typeof e=="object")return typeof e.data=="string"&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||i),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]=="object"?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]=="object"||(e.data=[e.data])),y(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function y(v,p,M){var L="",B=(typeof v=="string"&&(v=JSON.parse(v)),typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(v)&&0<v.length),Y=!Array.isArray(p[0]);if(B&&s){for(var k=0;k<v.length;k++)0<k&&(L+=m),L+=g(v[k],k);0<p.length&&(L+=b)}for(var O=0;O<p.length;O++){var x=(B?v:p[O]).length,w=!1,I=B?Object.keys(p[O]).length===0:p[O].length===0;if(M&&!B&&(w=M==="greedy"?p[O].join("").trim()==="":p[O].length===1&&p[O][0].length===0),M==="greedy"&&B){for(var U=[],j=0;j<x;j++){var W=Y?v[j]:j;U.push(p[O][W])}w=U.join("").trim()===""}if(!w){for(var R=0;R<x;R++){0<R&&!I&&(L+=m);var ee=B&&Y?v[R]:R;L+=g(p[O][ee],R)}O<p.length-1&&(!M||0<x&&!I)&&(L+=b)}}return L}function g(v,p){var M,L;return v==null?"":v.constructor===Date?JSON.stringify(v).slice(1,25):(L=!1,a&&typeof v=="string"&&a.test(v)&&(v="'"+v,L=!0),M=v.toString().replace(u,l),(L=L||n===!0||typeof n=="function"&&n(v,p)||Array.isArray(n)&&n[p]||((B,Y)=>{for(var k=0;k<Y.length;k++)if(-1<B.indexOf(Y[k]))return!0;return!1})(M,o.BAD_DELIMITERS)||-1<M.indexOf(m)||M.charAt(0)===" "||M.charAt(M.length-1)===" ")?_+M+_:M)}},o.RECORD_SEP="",o.UNIT_SEP="",o.BYTE_ORDER_MARK="\uFEFF",o.BAD_DELIMITERS=["\r",`
|
|
15
|
+
`,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!$&&!!d.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=se,o.ParserHandle=G,o.NetworkStreamer=A,o.FileStreamer=D,o.StringStreamer=T,o.ReadableStreamStreamer=Q,d.jQuery&&((C=d.jQuery).fn.parse=function(e){var t=e.config||{},n=[];return this.each(function(b){if(!(C(this).prop("tagName").toUpperCase()==="INPUT"&&C(this).attr("type").toLowerCase()==="file"&&d.FileReader)||!this.files||this.files.length===0)return!0;for(var _=0;_<this.files.length;_++)n.push({file:this.files[_],inputElem:this,instanceConfig:C.extend({},t)})}),s(),this;function s(){if(n.length===0)F(e.complete)&&e.complete();else{var b,_,l,c,i=n[0];if(F(e.before)){var a=e.before(i.file,i.inputElem);if(typeof a=="object"){if(a.action==="abort")return b="AbortError",_=i.file,l=i.inputElem,c=a.reason,void(F(e.error)&&e.error({name:b},_,l,c));if(a.action==="skip")return void m();typeof a.config=="object"&&(i.instanceConfig=C.extend(i.instanceConfig,a.config))}else if(a==="skip")return void m()}var u=i.instanceConfig.complete;i.instanceConfig.complete=function(y){F(u)&&u(y,i.file,i.inputElem),m()},o.parse(i.file,i.instanceConfig)}}function m(){n.splice(0,1),s()}}),z&&(d.onmessage=function(e){e=e.data,o.WORKER_ID===void 0&&e&&(o.WORKER_ID=e.workerId),typeof e.input=="string"?d.postMessage({workerId:o.WORKER_ID,results:o.parse(e.input,e.config),finished:!0}):(d.File&&e.input instanceof File||e.input instanceof Object)&&(e=o.parse(e.input,e.config))&&d.postMessage({workerId:o.WORKER_ID,results:e,finished:!0})}),(A.prototype=Object.create(S.prototype)).constructor=A,(D.prototype=Object.create(S.prototype)).constructor=D,(T.prototype=Object.create(T.prototype)).constructor=T,(Q.prototype=Object.create(S.prototype)).constructor=Q,o})}(we)),we.exports}var Re=Ze();class Ve{readAsText(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>{C($)},f.readAsText(r)})}readAsBinaryString(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>{C($)},f.readAsBinaryString(r)})}readAsDataUrl(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>C($),f.readAsDataURL(r)})}unparse(r,f){return Re.unparse(r,f)}parse(r){return new Promise((f,d)=>{Re.parse(r,{header:!0,complete:C=>f(C),error:C=>d(C)})})}getFileExtension(r){let f="-";return/[.]/.exec(r)&&(f=`.${/[^.]+$/.exec(r)?.[0]}`),f}save(r,f,d){const C=new Blob([r],{type:d});Je.saveAs(C,f,{autoBom:!0})}}class Ge{set(r,f){localStorage.setItem(r,JSON.stringify(f))}get(r){let f=null;const d=localStorage.getItem(r);return d&&(f=JSON.parse(d)),f}remove(r){localStorage.removeItem(r)}removeAll(){localStorage.clear()}getKeysBy(r){return Object.keys(localStorage).filter(f=>f.startsWith(r))}}var ke=(h=>(h.log="log",h.info="info",h.warn="warn",h.debug="debug",h.error="error",h))(ke||{});class Xe{logType=ke;log(...r){this._doLog(this.logType.log,r.join(" "))}info(...r){this._doLog(this.logType.info,r.join(" "))}warn(...r){this._doLog(this.logType.warn,r.join(" "))}debug(...r){this._doLog(this.logType.debug,r.join(" "))}error(...r){this._doLog(this.logType.error,r.join(" "))}_doLog(r,...f){console[r].apply(console,f)}}class et{constructor(r){this.localService=r}get(r){return this.localService.get(r)}set(r,f){this.localService.set(r,f)}remove(r){this.localService.remove(r)}}exports.BrowserService=Pe;exports.BrowserType=Le;exports.ClipboardService=qe;exports.FileService=Ve;exports.LocalService=Ge;exports.LogType=ke;exports.LoggerService=Xe;exports.ScreenBreakpoints=ye;exports.TokenService=et;exports.sortHelper=$e;
|
package/index.d.ts
CHANGED
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|