@oardi/ts-utils 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/enums/browsertype.enum.d.ts +14 -0
- package/enums/browsertype.enum.d.ts.map +1 -0
- package/extensions/string-extensions.d.ts +1 -0
- package/extensions/string-extensions.d.ts.map +1 -1
- package/index.cjs.js +6 -6
- package/index.es.js +293 -291
- package/index.umd.js +6 -6
- package/interfaces/browser.interface.d.ts +6 -0
- package/interfaces/browser.interface.d.ts.map +1 -0
- package/interfaces/index.d.ts +1 -0
- package/interfaces/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/services/browser.service.d.ts +5 -21
- package/services/browser.service.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/size.type.d.ts +2 -0
- package/types/size.type.d.ts.map +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum BrowserType {
|
|
2
|
+
opera = "opera",
|
|
3
|
+
firefox = "firefox",
|
|
4
|
+
safari = "safari",
|
|
5
|
+
ie = "ie",
|
|
6
|
+
edge = "edge",
|
|
7
|
+
edg = "edg",
|
|
8
|
+
electron = "electron",
|
|
9
|
+
chrome = "chrome",
|
|
10
|
+
iOsSafari = "iOsSafari",
|
|
11
|
+
edgiOs = "edgiOs",
|
|
12
|
+
headlessChrome = "headlessChrome"
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=browsertype.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browsertype.enum.d.ts","sourceRoot":"","sources":["../../../src/lib/enums/browsertype.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACtB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,EAAE,OAAO;IACT,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,cAAc,mBAAmB;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-extensions.d.ts","sourceRoot":"","sources":["../../../src/lib/extensions/string-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,IAAI,MAAM,CAAC;QACrB,QAAQ,IAAI,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"string-extensions.d.ts","sourceRoot":"","sources":["../../../src/lib/extensions/string-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,IAAI,MAAM,CAAC;QACrB,QAAQ,IAAI,OAAO,CAAC;QACpB,OAAO,IAAI,OAAO,CAAC;KACnB;CACD"}
|
package/index.cjs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function De(i,r,s){const f=s?.mimeType??Ae(r),$=Le(i,f);if("showSaveFilePicker"in window&&s?.showSaveFilePicker)try{const q=await(await window.showSaveFilePicker({suggestedName:r,types:[{description:"Datei",accept:{[f]:[`.${Ce(r)}`]}}]})).createWritable();await q.write($),await q.close();return}catch{}const C=URL.createObjectURL($),z=document.createElement("a");z.href=C,z.download=r,z.rel="noopener",z.style.display="none",document.body.appendChild(z),Ie(z),window.setTimeout(()=>{document.body.removeChild(z),URL.revokeObjectURL(C)},0),Te()&&window.open(C,"_blank","noopener,noreferrer")}function Le(i,r){if(i instanceof Blob)return i.type?i:new Blob([i],{type:r});if(i instanceof ArrayBuffer||i instanceof Uint8Array){const s=i instanceof Uint8Array?i:new Uint8Array(i);return new Blob([s],{type:r})}return new Blob([i],{type:r||"text/plain;charset=utf-8"})}function Ae(i){switch(Ce(i).toLowerCase()){case"txt":return"text/plain;charset=utf-8";case"csv":return"text/csv;charset=utf-8";case"json":return"application/json;charset=utf-8";case"pdf":return"application/pdf";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"svg":return"image/svg+xml";case"zip":return"application/zip";default:return"application/octet-stream"}}function Ce(i){const r=i.lastIndexOf(".");return r>=0&&r<i.length-1?i.slice(r+1):""}function Ie(i){const r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r)}function Te(){const i=navigator.userAgent,r=/iPad|iPhone|iPod/.test(i),s=/^((?!chrome|android).)*safari/i.test(i);return r||s}class Fe{static getEnumValue(r,s){if(s in r)return r[s];throw Error(`${s} not found in ${r}`)}static getKeyValues(r){return Object.keys(r).filter(s=>!isNaN(Number(s))).map(s=>({key:Number(s),value:r[s]}))}}const ze=(i,r,s)=>i.localeCompare(r)*(s?1:-1),je=(i,r)=>i<r?-1:i===r?0:1,Be=(i,r,s)=>je(i,r)*(s?1:-1),We=(i,r,s)=>{let f=0;return typeof i=="string"&&typeof r=="string"?f=ze(i,r,s):f=Be(i,r,s),f},Me=(i,r,s,f)=>{const $=s(i),C=s(r);return We($,C,f)};Array.prototype.distinct=function(i){const r=this;return i?r.filter((f,$,C)=>C.findIndex(z=>i(z,f))===$):r.filter((f,$,C)=>C.indexOf(f)===$)};Array.prototype.filterBy=function(i){return this.filter(r=>{let s=!1;return i&&r[i]?s=r[i]===i:s=r===i,s})};Array.prototype.first=function(){return this?.length>0?this[0]:null};Array.prototype.groupBy=function(i){return this.reduce((r,s)=>{const f=i(s);return(r[f]=r[f]||[]).push(s),r},{})};Array.prototype.orderBy=function(i,r=!0){return this?.sort((s,f)=>Me(s,f,i,r)),this};Array.prototype.removeBy=function(i,r){return this.filter(s=>i(s)!==r)};function $e(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ge={exports:{}},Pe=ge.exports,Se;function Ue(){return Se||(Se=1,function(i,r){(function(s,f){i.exports=f()})(Pe,function(){var s=1e3,f=6e4,$=36e5,C="millisecond",z="second",N="minute",q="hour",v="day",U="week",W="month",G="quarter",K="year",Q="date",X="Invalid Date",ne=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ue=/\[([^\]]+)]|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,de={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(m){var d=["th","st","nd","rd"],c=m%100;return"["+m+(d[(c-20)%10]||d[c]||d[0])+"]"}},ae=function(m,d,c){var a=String(m);return!a||a.length>=d?m:""+Array(d+1-a.length).join(c)+m},pe={s:ae,z:function(m){var d=-m.utcOffset(),c=Math.abs(d),a=Math.floor(c/60),u=c%60;return(d<=0?"+":"-")+ae(a,2,"0")+":"+ae(u,2,"0")},m:function m(d,c){if(d.date()<c.date())return-m(c,d);var a=12*(c.year()-d.year())+(c.month()-d.month()),u=d.clone().add(a,W),h=c-u<0,y=d.clone().add(a+(h?-1:1),W);return+(-(a+(c-u)/(h?u-y:y-u))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:W,y:K,w:U,d:v,D:Q,h:q,m:N,s:z,ms:C,Q:G}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},ie="en",Y={};Y[ie]=de;var R="$isDayjsObject",e=function(m){return m instanceof g||!(!m||!m[R])},t=function m(d,c,a){var u;if(!d)return ie;if(typeof d=="string"){var h=d.toLowerCase();Y[h]&&(u=h),c&&(Y[h]=c,u=h);var y=d.split("-");if(!u&&y.length>1)return m(y[0])}else{var p=d.name;Y[p]=d,u=p}return!a&&u&&(ie=u),u||!a&&ie},n=function(m,d){if(e(m))return m.clone();var c=typeof d=="object"?d:{};return c.date=m,c.args=arguments,new g(c)},o=pe;o.l=t,o.i=e,o.w=function(m,d){return n(m,{locale:d.$L,utc:d.$u,x:d.$x,$offset:d.$offset})};var g=function(){function m(c){this.$L=t(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[R]=!0}var d=m.prototype;return d.parse=function(c){this.$d=function(a){var u=a.date,h=a.utc;if(u===null)return new Date(NaN);if(o.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var y=u.match(ne);if(y){var p=y[2]-1||0,_=(y[7]||"0").substring(0,3);return h?new Date(Date.UTC(y[1],p,y[3]||1,y[4]||0,y[5]||0,y[6]||0,_)):new Date(y[1],p,y[3]||1,y[4]||0,y[5]||0,y[6]||0,_)}}return new Date(u)}(c),this.init()},d.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()},d.$utils=function(){return o},d.isValid=function(){return this.$d.toString()!==X},d.isSame=function(c,a){var u=n(c);return this.startOf(a)<=u&&u<=this.endOf(a)},d.isAfter=function(c,a){return n(c)<this.startOf(a)},d.isBefore=function(c,a){return this.endOf(a)<n(c)},d.$g=function(c,a,u){return o.u(c)?this[a]:this.set(u,c)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(c,a){var u=this,h=!!o.u(a)||a,y=o.p(c),p=function(E,O){var w=o.w(u.$u?Date.UTC(u.$y,O,E):new Date(u.$y,O,E),u);return h?w:w.endOf(v)},_=function(E,O){return o.w(u.toDate()[E].apply(u.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(O)),u)},l=this.$W,x=this.$M,M=this.$D,T="set"+(this.$u?"UTC":"");switch(y){case K:return h?p(1,0):p(31,11);case W:return h?p(1,x):p(0,x+1);case U:var B=this.$locale().weekStart||0,k=(l<B?l+7:l)-B;return p(h?M-k:M+(6-k),x);case v:case Q:return _(T+"Hours",0);case q:return _(T+"Minutes",1);case N:return _(T+"Seconds",2);case z:return _(T+"Milliseconds",3);default:return this.clone()}},d.endOf=function(c){return this.startOf(c,!1)},d.$set=function(c,a){var u,h=o.p(c),y="set"+(this.$u?"UTC":""),p=(u={},u[v]=y+"Date",u[Q]=y+"Date",u[W]=y+"Month",u[K]=y+"FullYear",u[q]=y+"Hours",u[N]=y+"Minutes",u[z]=y+"Seconds",u[C]=y+"Milliseconds",u)[h],_=h===v?this.$D+(a-this.$W):a;if(h===W||h===K){var l=this.clone().set(Q,1);l.$d[p](_),l.init(),this.$d=l.set(Q,Math.min(this.$D,l.daysInMonth())).$d}else p&&this.$d[p](_);return this.init(),this},d.set=function(c,a){return this.clone().$set(c,a)},d.get=function(c){return this[o.p(c)]()},d.add=function(c,a){var u,h=this;c=Number(c);var y=o.p(a),p=function(x){var M=n(h);return o.w(M.date(M.date()+Math.round(x*c)),h)};if(y===W)return this.set(W,this.$M+c);if(y===K)return this.set(K,this.$y+c);if(y===v)return p(1);if(y===U)return p(7);var _=(u={},u[N]=f,u[q]=$,u[z]=s,u)[y]||1,l=this.$d.getTime()+c*_;return o.w(l,this)},d.subtract=function(c,a){return this.add(-1*c,a)},d.format=function(c){var a=this,u=this.$locale();if(!this.isValid())return u.invalidDate||X;var h=c||"YYYY-MM-DDTHH:mm:ssZ",y=o.z(this),p=this.$H,_=this.$m,l=this.$M,x=u.weekdays,M=u.months,T=u.meridiem,B=function(O,w,L,F){return O&&(O[w]||O(a,h))||L[w].slice(0,F)},k=function(O){return o.s(p%12||12,O,"0")},E=T||function(O,w,L){var F=O<12?"AM":"PM";return L?F.toLowerCase():F};return h.replace(ue,function(O,w){return w||function(L){switch(L){case"YY":return String(a.$y).slice(-2);case"YYYY":return o.s(a.$y,4,"0");case"M":return l+1;case"MM":return o.s(l+1,2,"0");case"MMM":return B(u.monthsShort,l,M,3);case"MMMM":return B(M,l);case"D":return a.$D;case"DD":return o.s(a.$D,2,"0");case"d":return String(a.$W);case"dd":return B(u.weekdaysMin,a.$W,x,2);case"ddd":return B(u.weekdaysShort,a.$W,x,3);case"dddd":return x[a.$W];case"H":return String(p);case"HH":return o.s(p,2,"0");case"h":return k(1);case"hh":return k(2);case"a":return E(p,_,!0);case"A":return E(p,_,!1);case"m":return String(_);case"mm":return o.s(_,2,"0");case"s":return String(a.$s);case"ss":return o.s(a.$s,2,"0");case"SSS":return o.s(a.$ms,3,"0");case"Z":return y}return null}(O)||y.replace(":","")})},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(c,a,u){var h,y=this,p=o.p(a),_=n(c),l=(_.utcOffset()-this.utcOffset())*f,x=this-_,M=function(){return o.m(y,_)};switch(p){case K:h=M()/12;break;case W:h=M();break;case G:h=M()/3;break;case U:h=(x-l)/6048e5;break;case v:h=(x-l)/864e5;break;case q:h=x/$;break;case N:h=x/f;break;case z:h=x/s;break;default:h=x}return u?h:o.a(h)},d.daysInMonth=function(){return this.endOf(W).$D},d.$locale=function(){return Y[this.$L]},d.locale=function(c,a){if(!c)return this.$L;var u=this.clone(),h=t(c,a,!0);return h&&(u.$L=h),u},d.clone=function(){return o.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},m}(),b=g.prototype;return n.prototype=b,[["$ms",C],["$s",z],["$m",N],["$H",q],["$W",v],["$M",W],["$y",K],["$D",Q]].forEach(function(m){b[m[1]]=function(d){return this.$g(d,m[0],m[1])}}),n.extend=function(m,d){return m.$i||(m(d,g,n),m.$i=!0),n},n.locale=t,n.isDayjs=e,n.unix=function(m){return n(1e3*m)},n.en=Y[ie],n.Ls=Y,n.p={},n})}(ge)),ge.exports}var Ye=Ue();const Z=$e(Ye);var me={exports:{}},He=me.exports,Ee;function Ne(){return Ee||(Ee=1,function(i,r){(function(s,f){i.exports=f()})(He,function(){var s={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(f,$,C){var z=$.prototype,N=z.format;C.en.formats=s,z.format=function(q){q===void 0&&(q="YYYY-MM-DDTHH:mm:ssZ");var v=this.$locale().formats,U=function(W,G){return W.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(K,Q,X){var ne=X&&X.toUpperCase();return Q||G[X]||s[X]||G[ne].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(ue,de,ae){return de||ae.slice(1)})})}(q,v===void 0?{}:v);return N.call(this,U)}}})}(me)),me.exports}var qe=Ne();const Ke=$e(qe);Z.extend(Ke);Date.prototype.isAfter=function(i,r){return Z(this).isAfter(i,r)};Date.prototype.isBefore=function(i,r){return Z(this).isBefore(i,r)};Date.prototype.format=function(i){return Z(this).format(i)};Date.prototype.isValid=function(){return Z(this).isValid()};Date.prototype.add=function(i,r){return Z(this).add(i,r).toDate()};Date.prototype.subtract=function(i,r){return Z(this).subtract(i,r).toDate()};Date.prototype.firstDayOfMonth=function(){return Z(this).startOf("month").toDate()};Date.prototype.lastDayOfMonth=function(){return Z(this).endOf("month").toDate()};Date.prototype.set=function(i,r){return Z(this).set(i,r).toDate()};Date.prototype.diff=function(i,r){return Z(this).diff(i,r)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.isNumber=function(){return!isNaN(Number(this))&&this.trim()!==""};var Re=(i=>(i.opera="opera",i.firefox="firefox",i.safari="safari",i.ie="ie",i.edge="edge",i.edg="edg",i.electron="electron",i.chrome="chrome",i.iOsSafari="iOsSafari",i.edgiOs="edgiOs",i.headlessChrome="headlessChrome",i))(Re||{});const ye=[{breakpoint:"xs",screenWidth:0},{breakpoint:"sm",screenWidth:576},{breakpoint:"md",screenWidth:768},{breakpoint:"lg",screenWidth:992},{breakpoint:"xl",screenWidth:1200},{breakpoint:"xxl",screenWidth:1400},{breakpoint:"xxxl",screenWidth:1600}];class Je{screenWidth=0;lastBreakpoint;resizeListener;breakpointChangeCallbacks=new Set;onResizeCallbacks=new Set;rafId=null;emitTimeoutId=null;pendingWidth;pendingBreakpoint;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener,{passive:!0}),this.lastBreakpoint=this.getBreakpointBySize(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.breakpointChangeCallbacks.clear(),this.onResizeCallbacks.clear(),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getCurrentBreakpoint(){return this.lastBreakpoint}getCurrentScreenWidth(){return this.screenWidth}onBreakpointChange(r){this.breakpointChangeCallbacks.add(r)}offBreakpointChange(r){this.breakpointChangeCallbacks.delete(r)}onResizeChange(r){this.onResizeCallbacks.add(r)}offResizeChange(r){this.onResizeCallbacks.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 s=ye[0];for(const f of ye)f.screenWidth<=r&&(s=f);return s}isScreenGreaterThan(r){const s=this.getBreakpoint(r);return this.screenWidth>(s?.screenWidth??0)}isScreenSmallerThan(r){const s=this.getBreakpoint(r);return this.screenWidth<(s?.screenWidth??0)}getBreakpoint(r){return ye.find(s=>s.breakpoint===r)}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof globalThis.InstallTrigger<"u"}isSafari(){return typeof window>"u"?!1:/constructor/i.test(window.HTMLElement)||(r=>r.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return typeof document>"u"?!1:!!document.documentMode}isEdge(){return typeof window>"u"?!1:!this.isIE()&&!!window.StyleMedia}isEdg(){return typeof navigator>"u"?!1:navigator.userAgent.toLowerCase().includes("edg")}isElectron(r){return r.includes("electron")}isChrome(){return typeof window>"u"?!1:!!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")&&typeof document<"u"&&"ontouchend"in document&&r.includes("safari")}isEdgiOs(r){return r.includes("edgios")}isHeadlessChrome(r){return r.includes("headlesschrome")}onResize=()=>{if(typeof window>"u")return;const r=window.innerWidth,s=this.getBreakpointBySize(r);this.lastBreakpoint?.breakpoint!==s?.breakpoint&&(this.lastBreakpoint=s,s&&this.breakpointChangeCallbacks.forEach(f=>f(s))),this.pendingWidth=r,this.pendingBreakpoint=s,this.emitTimeoutId&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.pendingBreakpoint&&this.onResizeCallbacks.forEach(f=>f(this.pendingWidth,this.pendingBreakpoint)),this.pendingWidth=void 0,this.pendingBreakpoint=void 0,this.emitTimeoutId=null},this.duplicateThresholdMs)}}class Qe{copy(r){return navigator.clipboard.writeText(r)}}var _e={exports:{}};/* @license
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function Ce(i,r,s){const f=s?.mimeType??Ae(r),$=Le(i,f);if("showSaveFilePicker"in window&&s?.showSaveFilePicker)try{const q=await(await window.showSaveFilePicker({suggestedName:r,types:[{description:"Datei",accept:{[f]:[`.${Me(r)}`]}}]})).createWritable();await q.write($),await q.close();return}catch{}const C=URL.createObjectURL($),j=document.createElement("a");j.href=C,j.download=r,j.rel="noopener",j.style.display="none",document.body.appendChild(j),Ie(j),window.setTimeout(()=>{document.body.removeChild(j),URL.revokeObjectURL(C)},0),Te()&&window.open(C,"_blank","noopener,noreferrer")}function Le(i,r){if(i instanceof Blob)return i.type?i:new Blob([i],{type:r});if(i instanceof ArrayBuffer||i instanceof Uint8Array){const s=i instanceof Uint8Array?i:new Uint8Array(i);return new Blob([s],{type:r})}return new Blob([i],{type:r||"text/plain;charset=utf-8"})}function Ae(i){switch(Me(i).toLowerCase()){case"txt":return"text/plain;charset=utf-8";case"csv":return"text/csv;charset=utf-8";case"json":return"application/json;charset=utf-8";case"pdf":return"application/pdf";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"svg":return"image/svg+xml";case"zip":return"application/zip";default:return"application/octet-stream"}}function Me(i){const r=i.lastIndexOf(".");return r>=0&&r<i.length-1?i.slice(r+1):""}function Ie(i){const r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r)}function Te(){const i=navigator.userAgent,r=/iPad|iPhone|iPod/.test(i),s=/^((?!chrome|android).)*safari/i.test(i);return r||s}class Fe{static getEnumValue(r,s){if(s in r)return r[s];throw Error(`${s} not found in ${r}`)}static getKeyValues(r){return Object.keys(r).filter(s=>!isNaN(Number(s))).map(s=>({key:Number(s),value:r[s]}))}}const je=(i,r,s)=>i.localeCompare(r)*(s?1:-1),ze=(i,r)=>i<r?-1:i===r?0:1,Be=(i,r,s)=>ze(i,r)*(s?1:-1),We=(i,r,s)=>{let f=0;return typeof i=="string"&&typeof r=="string"?f=je(i,r,s):f=Be(i,r,s),f},$e=(i,r,s,f)=>{const $=s(i),C=s(r);return We($,C,f)};Array.prototype.distinct=function(i){const r=this;return i?r.filter((f,$,C)=>C.findIndex(j=>i(j,f))===$):r.filter((f,$,C)=>C.indexOf(f)===$)};Array.prototype.filterBy=function(i){return this.filter(r=>{let s=!1;return i&&r[i]?s=r[i]===i:s=r===i,s})};Array.prototype.first=function(){return this?.length>0?this[0]:null};Array.prototype.groupBy=function(i){return this.reduce((r,s)=>{const f=i(s);return(r[f]=r[f]||[]).push(s),r},{})};Array.prototype.orderBy=function(i,r=!0){return this?.sort((s,f)=>$e(s,f,i,r)),this};Array.prototype.removeBy=function(i,r){return this.filter(s=>i(s)!==r)};function Re(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ye={exports:{}},Pe=ye.exports,Ee;function Ue(){return Ee||(Ee=1,function(i,r){(function(s,f){i.exports=f()})(Pe,function(){var s=1e3,f=6e4,$=36e5,C="millisecond",j="second",N="minute",q="hour",v="day",U="week",W="month",X="quarter",K="year",Q="date",ee="Invalid Date",ie=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,he=/\[([^\]]+)]|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,fe={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(m){var l=["th","st","nd","rd"],c=m%100;return"["+m+(l[(c-20)%10]||l[c]||l[0])+"]"}},oe=function(m,l,c){var a=String(m);return!a||a.length>=l?m:""+Array(l+1-a.length).join(c)+m},me={s:oe,z:function(m){var l=-m.utcOffset(),c=Math.abs(l),a=Math.floor(c/60),u=c%60;return(l<=0?"+":"-")+oe(a,2,"0")+":"+oe(u,2,"0")},m:function m(l,c){if(l.date()<c.date())return-m(c,l);var a=12*(c.year()-l.year())+(c.month()-l.month()),u=l.clone().add(a,W),h=c-u<0,y=l.clone().add(a+(h?-1:1),W);return+(-(a+(c-u)/(h?u-y:y-u))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:W,y:K,w:U,d:v,D:Q,h:q,m:N,s:j,ms:C,Q:X}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},se="en",Y={};Y[se]=fe;var R="$isDayjsObject",e=function(m){return m instanceof g||!(!m||!m[R])},t=function m(l,c,a){var u;if(!l)return se;if(typeof l=="string"){var h=l.toLowerCase();Y[h]&&(u=h),c&&(Y[h]=c,u=h);var y=l.split("-");if(!u&&y.length>1)return m(y[0])}else{var p=l.name;Y[p]=l,u=p}return!a&&u&&(se=u),u||!a&&se},n=function(m,l){if(e(m))return m.clone();var c=typeof l=="object"?l:{};return c.date=m,c.args=arguments,new g(c)},o=me;o.l=t,o.i=e,o.w=function(m,l){return n(m,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var g=function(){function m(c){this.$L=t(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[R]=!0}var l=m.prototype;return l.parse=function(c){this.$d=function(a){var u=a.date,h=a.utc;if(u===null)return new Date(NaN);if(o.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var y=u.match(ie);if(y){var p=y[2]-1||0,_=(y[7]||"0").substring(0,3);return h?new Date(Date.UTC(y[1],p,y[3]||1,y[4]||0,y[5]||0,y[6]||0,_)):new Date(y[1],p,y[3]||1,y[4]||0,y[5]||0,y[6]||0,_)}}return new Date(u)}(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 o},l.isValid=function(){return this.$d.toString()!==ee},l.isSame=function(c,a){var u=n(c);return this.startOf(a)<=u&&u<=this.endOf(a)},l.isAfter=function(c,a){return n(c)<this.startOf(a)},l.isBefore=function(c,a){return this.endOf(a)<n(c)},l.$g=function(c,a,u){return o.u(c)?this[a]:this.set(u,c)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(c,a){var u=this,h=!!o.u(a)||a,y=o.p(c),p=function(E,O){var w=o.w(u.$u?Date.UTC(u.$y,O,E):new Date(u.$y,O,E),u);return h?w:w.endOf(v)},_=function(E,O){return o.w(u.toDate()[E].apply(u.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(O)),u)},d=this.$W,x=this.$M,M=this.$D,T="set"+(this.$u?"UTC":"");switch(y){case K:return h?p(1,0):p(31,11);case W:return h?p(1,x):p(0,x+1);case U:var B=this.$locale().weekStart||0,k=(d<B?d+7:d)-B;return p(h?M-k:M+(6-k),x);case v:case Q:return _(T+"Hours",0);case q:return _(T+"Minutes",1);case N:return _(T+"Seconds",2);case j:return _(T+"Milliseconds",3);default:return this.clone()}},l.endOf=function(c){return this.startOf(c,!1)},l.$set=function(c,a){var u,h=o.p(c),y="set"+(this.$u?"UTC":""),p=(u={},u[v]=y+"Date",u[Q]=y+"Date",u[W]=y+"Month",u[K]=y+"FullYear",u[q]=y+"Hours",u[N]=y+"Minutes",u[j]=y+"Seconds",u[C]=y+"Milliseconds",u)[h],_=h===v?this.$D+(a-this.$W):a;if(h===W||h===K){var d=this.clone().set(Q,1);d.$d[p](_),d.init(),this.$d=d.set(Q,Math.min(this.$D,d.daysInMonth())).$d}else p&&this.$d[p](_);return this.init(),this},l.set=function(c,a){return this.clone().$set(c,a)},l.get=function(c){return this[o.p(c)]()},l.add=function(c,a){var u,h=this;c=Number(c);var y=o.p(a),p=function(x){var M=n(h);return o.w(M.date(M.date()+Math.round(x*c)),h)};if(y===W)return this.set(W,this.$M+c);if(y===K)return this.set(K,this.$y+c);if(y===v)return p(1);if(y===U)return p(7);var _=(u={},u[N]=f,u[q]=$,u[j]=s,u)[y]||1,d=this.$d.getTime()+c*_;return o.w(d,this)},l.subtract=function(c,a){return this.add(-1*c,a)},l.format=function(c){var a=this,u=this.$locale();if(!this.isValid())return u.invalidDate||ee;var h=c||"YYYY-MM-DDTHH:mm:ssZ",y=o.z(this),p=this.$H,_=this.$m,d=this.$M,x=u.weekdays,M=u.months,T=u.meridiem,B=function(O,w,L,F){return O&&(O[w]||O(a,h))||L[w].slice(0,F)},k=function(O){return o.s(p%12||12,O,"0")},E=T||function(O,w,L){var F=O<12?"AM":"PM";return L?F.toLowerCase():F};return h.replace(he,function(O,w){return w||function(L){switch(L){case"YY":return String(a.$y).slice(-2);case"YYYY":return o.s(a.$y,4,"0");case"M":return d+1;case"MM":return o.s(d+1,2,"0");case"MMM":return B(u.monthsShort,d,M,3);case"MMMM":return B(M,d);case"D":return a.$D;case"DD":return o.s(a.$D,2,"0");case"d":return String(a.$W);case"dd":return B(u.weekdaysMin,a.$W,x,2);case"ddd":return B(u.weekdaysShort,a.$W,x,3);case"dddd":return x[a.$W];case"H":return String(p);case"HH":return o.s(p,2,"0");case"h":return k(1);case"hh":return k(2);case"a":return E(p,_,!0);case"A":return E(p,_,!1);case"m":return String(_);case"mm":return o.s(_,2,"0");case"s":return String(a.$s);case"ss":return o.s(a.$s,2,"0");case"SSS":return o.s(a.$ms,3,"0");case"Z":return y}return null}(O)||y.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(c,a,u){var h,y=this,p=o.p(a),_=n(c),d=(_.utcOffset()-this.utcOffset())*f,x=this-_,M=function(){return o.m(y,_)};switch(p){case K:h=M()/12;break;case W:h=M();break;case X:h=M()/3;break;case U:h=(x-d)/6048e5;break;case v:h=(x-d)/864e5;break;case q:h=x/$;break;case N:h=x/f;break;case j:h=x/s;break;default:h=x}return u?h:o.a(h)},l.daysInMonth=function(){return this.endOf(W).$D},l.$locale=function(){return Y[this.$L]},l.locale=function(c,a){if(!c)return this.$L;var u=this.clone(),h=t(c,a,!0);return h&&(u.$L=h),u},l.clone=function(){return o.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()},m}(),b=g.prototype;return n.prototype=b,[["$ms",C],["$s",j],["$m",N],["$H",q],["$W",v],["$M",W],["$y",K],["$D",Q]].forEach(function(m){b[m[1]]=function(l){return this.$g(l,m[0],m[1])}}),n.extend=function(m,l){return m.$i||(m(l,g,n),m.$i=!0),n},n.locale=t,n.isDayjs=e,n.unix=function(m){return n(1e3*m)},n.en=Y[se],n.Ls=Y,n.p={},n})}(ye)),ye.exports}var Ye=Ue();const G=Re(Ye);var _e={exports:{}},He=_e.exports,Oe;function Ne(){return Oe||(Oe=1,function(i,r){(function(s,f){i.exports=f()})(He,function(){var s={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(f,$,C){var j=$.prototype,N=j.format;C.en.formats=s,j.format=function(q){q===void 0&&(q="YYYY-MM-DDTHH:mm:ssZ");var v=this.$locale().formats,U=function(W,X){return W.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(K,Q,ee){var ie=ee&&ee.toUpperCase();return Q||X[ee]||s[ee]||X[ie].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(he,fe,oe){return fe||oe.slice(1)})})}(q,v===void 0?{}:v);return N.call(this,U)}}})}(_e)),_e.exports}var qe=Ne();const Ke=Re(qe);G.extend(Ke);Date.prototype.isAfter=function(i,r){return G(this).isAfter(i,r)};Date.prototype.isBefore=function(i,r){return G(this).isBefore(i,r)};Date.prototype.format=function(i){return G(this).format(i)};Date.prototype.isValid=function(){return G(this).isValid()};Date.prototype.add=function(i,r){return G(this).add(i,r).toDate()};Date.prototype.subtract=function(i,r){return G(this).subtract(i,r).toDate()};Date.prototype.firstDayOfMonth=function(){return G(this).startOf("month").toDate()};Date.prototype.lastDayOfMonth=function(){return G(this).endOf("month").toDate()};Date.prototype.set=function(i,r){return G(this).set(i,r).toDate()};Date.prototype.diff=function(i,r){return G(this).diff(i,r)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.isNumber=function(){return!isNaN(Number(this))&&this.trim()!==""};String.prototype.isEmpty=function(){return this===void 0||!this||this.length===0};var V=(i=>(i.opera="opera",i.firefox="firefox",i.safari="safari",i.ie="ie",i.edge="edge",i.edg="edg",i.electron="electron",i.chrome="chrome",i.iOsSafari="iOsSafari",i.edgiOs="edgiOs",i.headlessChrome="headlessChrome",i))(V||{});const de={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600};class Je{screenWidth=0;lastBreakpoint;resizeListener;breakpointChangeCallbacks=new Set;onResizeCallbacks=new Set;rafId=null;emitTimeoutId=null;pendingWidth;pendingBreakpoint;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener,{passive:!0}),this.lastBreakpoint=this.getBreakpointByScreenWidth(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.breakpointChangeCallbacks.clear(),this.onResizeCallbacks.clear(),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getCurrentBreakpoint(){return this.lastBreakpoint}getCurrentScreenWidth(){return this.screenWidth}onBreakpointChange(r){this.breakpointChangeCallbacks.add(r)}offBreakpointChange(r){this.breakpointChangeCallbacks.delete(r)}onResizeChange(r){this.onResizeCallbacks.add(r)}offResizeChange(r){this.onResizeCallbacks.delete(r)}getCurrentBrowser(){const r=navigator.userAgent.toLowerCase();if(this.isOpera())return V.opera;if(this.isFirefox())return V.firefox;if(this.isSafari())return V.safari;if(this.isIE())return V.ie;if(this.isEdge())return V.edge;if(this.isEdg())return V.edg;if(this.isElectron(r))return V.electron;if(this.isChrome())return V.chrome;if(this.isIOsSafari(r))return V.iOsSafari;if(this.isEdgiOs(r))return V.edgiOs;if(this.isHeadlessChrome(r))return V.headlessChrome;throw new Error("Browser could not be detected: "+r)}getBreakpointByScreenWidth(r=this.screenWidth){let s="xs";for(const f of Object.keys(de))de[f]<=r&&(s=f);return{breakpoint:s,screenWidth:de[s]}}isScreenGreaterThan(r){return this.screenWidth>de[r]}isScreenSmallerThan(r){return this.screenWidth<de[r]}getBreakpoint(r){return{breakpoint:r,screenWidth:de[r]}}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof globalThis.InstallTrigger<"u"}isSafari(){return typeof window>"u"?!1:/constructor/i.test(window.HTMLElement)||(r=>r.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return typeof document>"u"?!1:!!document.documentMode}isEdge(){return typeof window>"u"?!1:!this.isIE()&&!!window.StyleMedia}isEdg(){return typeof navigator>"u"?!1:navigator.userAgent.toLowerCase().includes("edg")}isElectron(r){return r.includes("electron")}isChrome(){return typeof window>"u"?!1:!!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")&&typeof document<"u"&&"ontouchend"in document&&r.includes("safari")}isEdgiOs(r){return r.includes("edgios")}isHeadlessChrome(r){return r.includes("headlesschrome")}onResize=()=>{if(typeof window>"u")return;const r=window.innerWidth,s=this.getBreakpointByScreenWidth(r);this.lastBreakpoint?.breakpoint!==s?.breakpoint&&(this.lastBreakpoint=s,s&&this.breakpointChangeCallbacks.forEach(f=>f(s))),this.pendingWidth=r,this.pendingBreakpoint=s,this.emitTimeoutId&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.pendingBreakpoint&&this.onResizeCallbacks.forEach(f=>f(this.pendingWidth,this.pendingBreakpoint)),this.pendingWidth=void 0,this.pendingBreakpoint=void 0,this.emitTimeoutId=null},this.duplicateThresholdMs)}}class Qe{copy(r){return navigator.clipboard.writeText(r)}}var ve={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.5.3
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
5
5
|
License: MIT
|
|
6
|
-
*/var Ve=
|
|
6
|
+
*/var Ve=ve.exports,xe;function Ze(){return xe||(xe=1,function(i,r){((s,f)=>{i.exports=f()})(Ve,function s(){var f=typeof self<"u"?self:typeof window<"u"?window:f!==void 0?f:{},$,C=!f.document&&!!f.postMessage,j=f.IS_PAPA_WORKER||!1,N={},q=0,v={};function U(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=se(t);n.chunkSize=parseInt(n.chunkSize),t.step||t.chunk||(n.chunkSize=null),this._handle=new ee(n),(this._handle.streamer=this)._config=n}).call(this,e),this.parseChunk=function(t,n){var o=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<o){let b=this._config.newline;b||(g=this._config.quoteChar||'"',b=this._handle.guessLineEndings(t,g)),t=[...t.split(b).slice(o)].join(b)}this.isFirstChunk&&R(this._config.beforeFirstChunk)&&(g=this._config.beforeFirstChunk(t))!==void 0&&(t=g),this.isFirstChunk=!1,this._halted=!1;var o=this._partialLine+t,g=(this._partialLine="",this._handle.parse(o,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(t=g.meta.cursor,o=(this._finished||(this._partialLine=o.substring(t-this._baseIndex),this._baseIndex=t),g&&g.data&&(this._rowCount+=g.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),j)f.postMessage({results:g,workerId:v.WORKER_ID,finished:o});else if(R(this._config.chunk)&&!n){if(this._config.chunk(g,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=g=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(g.data),this._completeResults.errors=this._completeResults.errors.concat(g.errors),this._completeResults.meta=g.meta),this._completed||!o||!R(this._config.complete)||g&&g.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),o||g&&g.meta.paused||this._nextChunk(),g}this._halted=!0},this._sendError=function(t){R(this._config.error)?this._config.error(t):j&&this._config.error&&f.postMessage({workerId:v.WORKER_ID,error:t,finished:!1})}}function W(e){var t;(e=e||{}).chunkSize||(e.chunkSize=v.RemoteChunkSize),U.call(this,e),this._nextChunk=C?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),C||(t.onload=Y(this._chunkLoaded,this),t.onerror=Y(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!C),this._config.downloadRequestHeaders){var n,o=this._config.downloadRequestHeaders;for(n in o)t.setRequestHeader(n,o[n])}var g;this._config.chunkSize&&(g=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+g));try{t.send(this._config.downloadRequestBody)}catch(b){this._chunkError(b.message)}C&&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 X(e){(e=e||{}).chunkSize||(e.chunkSize=v.LocalChunkSize),U.call(this,e);var t,n,o=typeof FileReader<"u";this.stream=function(g){this._input=g,n=g.slice||g.webkitSlice||g.mozSlice,o?((t=new FileReader).onload=Y(this._chunkLoaded,this),t.onerror=Y(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 g=this._input,b=(this._config.chunkSize&&(b=Math.min(this._start+this._config.chunkSize,this._input.size),g=n.call(g,this._start,b)),t.readAsText(g,this._config.encoding));o||this._chunkLoaded({target:{result:b}})},this._chunkLoaded=function(g){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(g.target.result)},this._chunkError=function(){this._sendError(t.error)}}function K(e){var t;U.call(this,e=e||{}),this.stream=function(n){return t=n,this._nextChunk()},this._nextChunk=function(){var n,o;if(!this._finished)return n=this._config.chunkSize,t=n?(o=t.substring(0,n),t.substring(n)):(o=t,""),this._finished=!t,this.parseChunk(o)}}function Q(e){U.call(this,e=e||{});var t=[],n=!0,o=!1;this.pause=function(){U.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){U.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(g){this._input=g,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){o&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=Y(function(g){try{t.push(typeof g=="string"?g:g.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(b){this._streamError(b)}},this),this._streamError=Y(function(g){this._streamCleanUp(),this._sendError(g)},this),this._streamEnd=Y(function(){this._streamCleanUp(),o=!0,this._streamData("")},this),this._streamCleanUp=Y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ee(e){var t,n,o,g,b=Math.pow(2,53),m=-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)))$/,a=this,u=0,h=0,y=!1,p=!1,_=[],d={data:[],errors:[],meta:{}};function x(k){return e.skipEmptyLines==="greedy"?k.join("").trim()==="":k.length===1&&k[0].length===0}function M(){if(d&&o&&(B("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+v.DefaultDelimiter+"'"),o=!1),e.skipEmptyLines&&(d.data=d.data.filter(function(w){return!x(w)})),T()){let w=function(L,F){R(e.transformHeader)&&(L=e.transformHeader(L,F)),_.push(L)};if(d)if(Array.isArray(d.data[0])){for(var k=0;T()&&k<d.data.length;k++)d.data[k].forEach(w);d.data.splice(0,1)}else d.data.forEach(w)}function E(w,L){for(var F=e.header?{}:[],A=0;A<w.length;A++){var I=A,D=w[A],D=((Z,S)=>(z=>(e.dynamicTypingFunction&&e.dynamicTyping[z]===void 0&&(e.dynamicTyping[z]=e.dynamicTypingFunction(z)),(e.dynamicTyping[z]||e.dynamicTyping)===!0))(Z)?S==="true"||S==="TRUE"||S!=="false"&&S!=="FALSE"&&((z=>{if(l.test(z)&&(z=parseFloat(z),m<z&&z<b))return 1})(S)?parseFloat(S):c.test(S)?new Date(S):S===""?null:S):S)(I=e.header?A>=_.length?"__parsed_extra":_[A]:I,D=e.transform?e.transform(D,I):D);I==="__parsed_extra"?(F[I]=F[I]||[],F[I].push(D)):F[I]=D}return e.header&&(A>_.length?B("FieldMismatch","TooManyFields","Too many fields: expected "+_.length+" fields but parsed "+A,h+L):A<_.length&&B("FieldMismatch","TooFewFields","Too few fields: expected "+_.length+" fields but parsed "+A,h+L)),F}var O;d&&(e.header||e.dynamicTyping||e.transform)&&(O=1,!d.data.length||Array.isArray(d.data[0])?(d.data=d.data.map(E),O=d.data.length):d.data=E(d.data,0),e.header&&d.meta&&(d.meta.fields=_),h+=O)}function T(){return e.header&&_.length===0}function B(k,E,O,w){k={type:k,code:E,message:O},w!==void 0&&(k.row=w),d.errors.push(k)}R(e.step)&&(g=e.step,e.step=function(k){d=k,T()?M():(M(),d.data.length!==0&&(u+=k.data.length,e.preview&&u>e.preview?n.abort():(d.data=d.data[0],g(d,a))))}),this.parse=function(k,E,O){var w=e.quoteChar||'"',w=(e.newline||(e.newline=this.guessLineEndings(k,w)),o=!1,e.delimiter?R(e.delimiter)&&(e.delimiter=e.delimiter(k),d.meta.delimiter=e.delimiter):((w=((L,F,A,I,D)=>{var Z,S,z,ue;D=D||[","," ","|",";",v.RECORD_SEP,v.UNIT_SEP];for(var ce=0;ce<D.length;ce++){for(var te,pe=D[ce],H=0,re=0,P=0,J=(z=void 0,new he({comments:I,delimiter:pe,newline:F,preview:10}).parse(L)),ae=0;ae<J.data.length;ae++)A&&x(J.data[ae])?P++:(te=J.data[ae].length,re+=te,z===void 0?z=te:0<te&&(H+=Math.abs(te-z),z=te));0<J.data.length&&(re/=J.data.length-P),(S===void 0||H<=S)&&(ue===void 0||ue<re)&&1.99<re&&(S=H,Z=pe,ue=re)}return{successful:!!(e.delimiter=Z),bestDelimiter:Z}})(k,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=w.bestDelimiter:(o=!0,e.delimiter=v.DefaultDelimiter),d.meta.delimiter=e.delimiter),se(e));return e.preview&&e.header&&w.preview++,t=k,n=new he(w),d=n.parse(t,E,O),M(),y?{meta:{paused:!0}}:d||{meta:{paused:!1}}},this.paused=function(){return y},this.pause=function(){y=!0,n.abort(),t=R(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){a.streamer._halted?(y=!1,a.streamer.parseChunk(t,!0)):setTimeout(a.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,n.abort(),d.meta.aborted=!0,R(e.complete)&&e.complete(d),t=""},this.guessLineEndings=function(L,w){L=L.substring(0,1048576);var w=new RegExp(ie(w)+"([^]*?)"+ie(w),"gm"),O=(L=L.replace(w,"")).split("\r"),w=L.split(`
|
|
7
7
|
`),L=1<w.length&&w[0].length<O[0].length;if(O.length===1||L)return`
|
|
8
8
|
`;for(var F=0,A=0;A<O.length;A++)O[A][0]===`
|
|
9
9
|
`&&F++;return F>=O.length/2?`\r
|
|
10
|
-
`:"\r"}}function
|
|
10
|
+
`:"\r"}}function ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e){var t=(e=e||{}).delimiter,n=e.newline,o=e.comments,g=e.step,b=e.preview,m=e.fastMode,l=null,c=!1,a=e.quoteChar==null?'"':e.quoteChar,u=a;if(e.escapeChar!==void 0&&(u=e.escapeChar),(typeof t!="string"||-1<v.BAD_DELIMITERS.indexOf(t))&&(t=","),o===t)throw new Error("Comment character same as delimiter");o===!0?o="#":(typeof o!="string"||-1<v.BAD_DELIMITERS.indexOf(o))&&(o=!1),n!==`
|
|
11
11
|
`&&n!=="\r"&&n!==`\r
|
|
12
12
|
`&&(n=`
|
|
13
|
-
`);var h=0,y=!1;this.parse=function(p,_,
|
|
14
|
-
`,m='"',
|
|
15
|
-
`,'"',v.BYTE_ORDER_MARK],v.WORKERS_SUPPORTED=!C&&!!f.Worker,v.NODE_STREAM_INPUT=1,v.LocalChunkSize=10485760,v.RemoteChunkSize=5242880,v.DefaultDelimiter=",",v.Parser=
|
|
13
|
+
`);var h=0,y=!1;this.parse=function(p,_,d){if(typeof p!="string")throw new Error("Input must be a string");var x=p.length,M=t.length,T=n.length,B=o.length,k=R(g),E=[],O=[],w=[],L=h=0;if(!p)return H();if(m||m!==!1&&p.indexOf(a)===-1){for(var F=p.split(n),A=0;A<F.length;A++){if(w=F[A],h+=w.length,A!==F.length-1)h+=n.length;else if(d)return H();if(!o||w.substring(0,B)!==o){if(k){if(E=[],ue(w.split(t)),re(),y)return H()}else ue(w.split(t));if(b&&b<=A)return E=E.slice(0,b),H(!0)}}return H()}for(var I=p.indexOf(t,h),D=p.indexOf(n,h),Z=new RegExp(ie(u)+ie(a),"g"),S=p.indexOf(a,h);;)if(p[h]===a)for(S=h,h++;;){if((S=p.indexOf(a,S+1))===-1)return d||O.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:E.length,index:h}),te();if(S===x-1)return te(p.substring(h,S).replace(Z,a));if(a===u&&p[S+1]===u)S++;else if(a===u||S===0||p[S-1]!==u){I!==-1&&I<S+1&&(I=p.indexOf(t,S+1));var z=ce((D=D!==-1&&D<S+1?p.indexOf(n,S+1):D)===-1?I:Math.min(I,D));if(p.substr(S+1+z,M)===t){w.push(p.substring(h,S).replace(Z,a)),p[h=S+1+z+M]!==a&&(S=p.indexOf(a,h)),I=p.indexOf(t,h),D=p.indexOf(n,h);break}if(z=ce(D),p.substring(S+1+z,S+1+z+T)===n){if(w.push(p.substring(h,S).replace(Z,a)),pe(S+1+z+T),I=p.indexOf(t,h),S=p.indexOf(a,h),k&&(re(),y))return H();if(b&&E.length>=b)return H(!0);break}O.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:E.length,index:h}),S++}}else if(o&&w.length===0&&p.substring(h,h+B)===o){if(D===-1)return H();h=D+T,D=p.indexOf(n,h),I=p.indexOf(t,h)}else if(I!==-1&&(I<D||D===-1))w.push(p.substring(h,I)),h=I+M,I=p.indexOf(t,h);else{if(D===-1)break;if(w.push(p.substring(h,D)),pe(D+T),k&&(re(),y))return H();if(b&&E.length>=b)return H(!0)}return te();function ue(P){E.push(P),L=h}function ce(P){var J=0;return J=P!==-1&&(P=p.substring(S+1,P))&&P.trim()===""?P.length:J}function te(P){return d||(P===void 0&&(P=p.substring(h)),w.push(P),h=x,ue(w),k&&re()),H()}function pe(P){h=P,ue(w),w=[],D=p.indexOf(n,h)}function H(P){if(e.header&&!_&&E.length&&!c){var J=E[0],ae=Object.create(null),we=new Set(J);let be=!1;for(let le=0;le<J.length;le++){let ne=J[le];if(ae[ne=R(e.transformHeader)?e.transformHeader(ne,le):ne]){let ge,Se=ae[ne];for(;ge=ne+"_"+Se,Se++,we.has(ge););we.add(ge),J[le]=ge,ae[ne]++,be=!0,(l=l===null?{}:l)[ge]=ne}else ae[ne]=1,J[le]=ne;we.add(ne)}be&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:E,errors:O,meta:{delimiter:t,linebreak:n,aborted:y,truncated:!!P,cursor:L+(_||0),renamedHeaders:l}}}function re(){g(H()),E=[],O=[]}},this.abort=function(){y=!0},this.getCharIndex=function(){return h}}function fe(e){var t=e.data,n=N[t.workerId],o=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var g={abort:function(){o=!0,oe(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:me,resume:me};if(R(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},g),!o);b++);delete t.results}else R(n.userChunk)&&(n.userChunk(t.results,g,t.file),delete t.results)}t.finished&&!o&&oe(t.workerId,t.results)}function oe(e,t){var n=N[e];R(n.userComplete)&&n.userComplete(t),n.terminate(),delete N[e]}function me(){throw new Error("Not implemented.")}function se(e){if(typeof e!="object"||e===null)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=se(e[t]);return n}function Y(e,t){return function(){e.apply(t,arguments)}}function R(e){return typeof e=="function"}return v.parse=function(e,t){var n=(t=t||{}).dynamicTyping||!1;if(R(n)&&(t.dynamicTypingFunction=n,n={}),t.dynamicTyping=n,t.transform=!!R(t.transform)&&t.transform,!t.worker||!v.WORKERS_SUPPORTED)return n=null,v.NODE_STREAM_INPUT,typeof e=="string"?(e=(o=>o.charCodeAt(0)!==65279?o:o.slice(1))(e),n=new(t.download?W:K)(t)):e.readable===!0&&R(e.read)&&R(e.on)?n=new Q(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new X(t)),n.stream(e);(n=(()=>{var o;return!!v.WORKERS_SUPPORTED&&(o=(()=>{var g=f.URL||f.webkitURL||null,b=s.toString();return v.BLOB_URL||(v.BLOB_URL=g.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"})))})(),(o=new f.Worker(o)).onmessage=fe,o.id=q++,N[o.id]=o)})()).userStep=t.step,n.userChunk=t.chunk,n.userComplete=t.complete,n.userError=t.error,t.step=R(t.step),t.chunk=R(t.chunk),t.complete=R(t.complete),t.error=R(t.error),delete t.worker,n.postMessage({input:e,config:t,workerId:n.id})},v.unparse=function(e,t){var n=!1,o=!0,g=",",b=`\r
|
|
14
|
+
`,m='"',l=m+m,c=!1,a=null,u=!1,h=((()=>{if(typeof t=="object"){if(typeof t.delimiter!="string"||v.BAD_DELIMITERS.filter(function(_){return t.delimiter.indexOf(_)!==-1}).length||(g=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"&&(m=t.quoteChar),typeof t.header=="boolean"&&(o=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");a=t.columns}t.escapeChar!==void 0&&(l=t.escapeChar+m),t.escapeFormulae instanceof RegExp?u=t.escapeFormulae:typeof t.escapeFormulae=="boolean"&&t.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),new RegExp(ie(m),"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(a||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||a),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(_,d,x){var M="",T=(typeof _=="string"&&(_=JSON.parse(_)),typeof d=="string"&&(d=JSON.parse(d)),Array.isArray(_)&&0<_.length),B=!Array.isArray(d[0]);if(T&&o){for(var k=0;k<_.length;k++)0<k&&(M+=g),M+=p(_[k],k);0<d.length&&(M+=b)}for(var E=0;E<d.length;E++){var O=(T?_:d[E]).length,w=!1,L=T?Object.keys(d[E]).length===0:d[E].length===0;if(x&&!T&&(w=x==="greedy"?d[E].join("").trim()==="":d[E].length===1&&d[E][0].length===0),x==="greedy"&&T){for(var F=[],A=0;A<O;A++){var I=B?_[A]:A;F.push(d[E][I])}w=F.join("").trim()===""}if(!w){for(var D=0;D<O;D++){0<D&&!L&&(M+=g);var Z=T&&B?_[D]:D;M+=p(d[E][Z],D)}E<d.length-1&&(!x||0<O&&!L)&&(M+=b)}}return M}function p(_,d){var x,M;return _==null?"":_.constructor===Date?JSON.stringify(_).slice(1,25):(M=!1,u&&typeof _=="string"&&u.test(_)&&(_="'"+_,M=!0),x=_.toString().replace(h,l),(M=M||n===!0||typeof n=="function"&&n(_,d)||Array.isArray(n)&&n[d]||((T,B)=>{for(var k=0;k<B.length;k++)if(-1<T.indexOf(B[k]))return!0;return!1})(x,v.BAD_DELIMITERS)||-1<x.indexOf(g)||x.charAt(0)===" "||x.charAt(x.length-1)===" ")?m+x+m:x)}},v.RECORD_SEP="",v.UNIT_SEP="",v.BYTE_ORDER_MARK="\uFEFF",v.BAD_DELIMITERS=["\r",`
|
|
15
|
+
`,'"',v.BYTE_ORDER_MARK],v.WORKERS_SUPPORTED=!C&&!!f.Worker,v.NODE_STREAM_INPUT=1,v.LocalChunkSize=10485760,v.RemoteChunkSize=5242880,v.DefaultDelimiter=",",v.Parser=he,v.ParserHandle=ee,v.NetworkStreamer=W,v.FileStreamer=X,v.StringStreamer=K,v.ReadableStreamStreamer=Q,f.jQuery&&(($=f.jQuery).fn.parse=function(e){var t=e.config||{},n=[];return this.each(function(b){if(!($(this).prop("tagName").toUpperCase()==="INPUT"&&$(this).attr("type").toLowerCase()==="file"&&f.FileReader)||!this.files||this.files.length===0)return!0;for(var m=0;m<this.files.length;m++)n.push({file:this.files[m],inputElem:this,instanceConfig:$.extend({},t)})}),o(),this;function o(){if(n.length===0)R(e.complete)&&e.complete();else{var b,m,l,c,a=n[0];if(R(e.before)){var u=e.before(a.file,a.inputElem);if(typeof u=="object"){if(u.action==="abort")return b="AbortError",m=a.file,l=a.inputElem,c=u.reason,void(R(e.error)&&e.error({name:b},m,l,c));if(u.action==="skip")return void g();typeof u.config=="object"&&(a.instanceConfig=$.extend(a.instanceConfig,u.config))}else if(u==="skip")return void g()}var h=a.instanceConfig.complete;a.instanceConfig.complete=function(y){R(h)&&h(y,a.file,a.inputElem),g()},v.parse(a.file,a.instanceConfig)}}function g(){n.splice(0,1),o()}}),j&&(f.onmessage=function(e){e=e.data,v.WORKER_ID===void 0&&e&&(v.WORKER_ID=e.workerId),typeof e.input=="string"?f.postMessage({workerId:v.WORKER_ID,results:v.parse(e.input,e.config),finished:!0}):(f.File&&e.input instanceof File||e.input instanceof Object)&&(e=v.parse(e.input,e.config))&&f.postMessage({workerId:v.WORKER_ID,results:e,finished:!0})}),(W.prototype=Object.create(U.prototype)).constructor=W,(X.prototype=Object.create(U.prototype)).constructor=X,(K.prototype=Object.create(K.prototype)).constructor=K,(Q.prototype=Object.create(U.prototype)).constructor=Q,v})}(ve)),ve.exports}var De=Ze();class Ge{readAsText(r){const s=new FileReader;return new Promise((f,$)=>{s.onload=C=>{f(C)},s.onerror=C=>{$(C)},s.readAsText(r)})}readAsBinaryString(r){const s=new FileReader;return new Promise((f,$)=>{s.onload=C=>{f(C)},s.onerror=C=>{$(C)},s.readAsBinaryString(r)})}readAsDataUrl(r){const s=new FileReader;return new Promise((f,$)=>{s.onload=C=>{f(C)},s.onerror=C=>$(C),s.readAsDataURL(r)})}unparse(r,s){return De.unparse(r,s)}parse(r){return new Promise((s,f)=>{De.parse(r,{header:!0,complete:$=>s($),error:$=>f($)})})}getFileExtension(r){let s="-";return/[.]/.exec(r)&&(s=`.${/[^.]+$/.exec(r)?.[0]}`),s}save(r,s,f){const $=new Blob([r],{type:f});Ce($,s)}}class Xe{set(r,s){localStorage.setItem(r,JSON.stringify(s))}get(r){let s=null;const f=localStorage.getItem(r);return f&&(s=JSON.parse(f)),s}remove(r){let s=!!this.get(r);return s&&localStorage.removeItem(r),s}removeAll(){localStorage.clear()}getKeysBy(r){return Object.keys(localStorage).filter(s=>s.startsWith(r))}}var ke=(i=>(i.log="log",i.info="info",i.warn="warn",i.debug="debug",i.error="error",i))(ke||{});class et{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,...s){console[r].apply(console,s)}}class tt{constructor(r){this.localService=r}get(r){return this.localService.get(r)}set(r,s){this.localService.set(r,s)}remove(r){this.localService.remove(r)}}exports.BrowserService=Je;exports.ClipboardService=Qe;exports.EnumHelper=Fe;exports.FileService=Ge;exports.LocalService=Xe;exports.LogType=ke;exports.LoggerService=et;exports.TokenService=tt;exports.saveAs=Ce;exports.sortHelper=$e;
|