@oardi/ts-utils 0.0.63 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -10
- package/index.mjs +283 -1034
- package/index.umd.js +1 -10
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
(function(A,me){typeof exports=="object"&&typeof module<"u"?me(exports):typeof define=="function"&&define.amd?define(["exports"],me):(A=typeof globalThis<"u"?globalThis:A||self,me(A["ts-utils"]={}))})(this,(function(A){"use strict";const me={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600};class ke{static getScreenWidth(){return document.documentElement.clientWidth}static getScreenHeight(){return document.documentElement.clientHeight}}class de{static breakPoints=me;static getCurrentBreakpoint(){return de.getBreakpointByScreenWidth(ke.getScreenWidth())}static getBreakpointByScreenWidth(e=ke.getScreenWidth()){let n="xs";for(const s of Object.keys(de.breakPoints))de.breakPoints[s]<=e&&(n=s);return{breakpoint:n,screenWidth:e}}static isScreenGreaterThan(e){return ke.getScreenWidth()>de.breakPoints[e]}static isScreenSmallerThan(e){return ke.getScreenWidth()<de.breakPoints[e]}}var ee=(a=>(a.opera="opera",a.firefox="firefox",a.safari="safari",a.ie="ie",a.edgeLegacy="edgeLegacy",a.edg="edg",a.chrome="chrome",a.iOS="iOS",a.iOsSafari="iOsSafari",a.edgiOs="edgiOs",a.headlessChrome="headlessChrome",a.nodeRuntime="nodeRuntime",a.electron="electron",a))(ee||{});class Z{static getUserAgent(){return this.isBrowserEnv()?navigator.userAgent.toLowerCase():""}static resolveUserAgent(e){return(e??this.getUserAgent()).toLowerCase()}static isBrowserEnv(){return typeof window<"u"&&typeof navigator<"u"}static isOpera(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return n.includes("opr/")||n.includes("opera")}static isFirefox(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("firefox")||typeof globalThis.InstallTrigger<"u":!1}static isSafari(e){if(!this.isBrowserEnv())return!1;const n=navigator.vendor.includes("Apple"),s=this.resolveUserAgent(e),d=s.includes("safari"),_=!(s.includes("crios")||s.includes("chrome")||s.includes("android")||s.includes("opr/")||s.includes("edg"));return n&&d&&_}static isIOS(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e),s=/iphone|ipad|ipod/.test(n),d=n.includes("macintosh")&&navigator.maxTouchPoints>1;return s||d}static isIosSafari(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return this.isIOS(n)&&this.isSafari(n)}static isEdgeLegacy(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return!!window.StyleMedia&&!n.includes("edg/")}static isEdg(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("edg/"):!1}static isEdgeIos(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return this.isIOS(n)&&n.includes("edgios")}static isIE(){return this.isBrowserEnv()?typeof document<"u"&&!!document.documentMode:!1}static isChrome(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e),s=navigator.vendor.includes("Google"),d=n.includes("chrome")||n.includes("crios"),_=!this.isEdg(n)&&!this.isOpera(n);return s&&d&&_}static isElectron(e){const n=!!(typeof process<"u"&&process.versions?.electron),s=this.resolveUserAgent(e);return n||s.includes("electron")}static isHeadlessChrome(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("headlesschrome"):!1}static isNodeRuntime(){return typeof process<"u"&&!!process.versions?.node&&!this.isBrowserEnv()}static getCurrentBrowser(){const e=Z.getUserAgent();if(Z.isElectron(e))return ee.electron;if(Z.isNodeRuntime())return ee.nodeRuntime;if(Z.isOpera(e))return ee.opera;if(Z.isFirefox(e))return ee.firefox;if(Z.isEdgeIos(e))return ee.edgiOs;if(Z.isIosSafari(e))return ee.iOsSafari;if(Z.isIOS(e))return ee.iOS;if(Z.isHeadlessChrome(e))return ee.headlessChrome;if(Z.isIE())return ee.ie;if(Z.isEdgeLegacy(e))return ee.edgeLegacy;if(Z.isEdg(e))return ee.edg;if(Z.isChrome(e))return ee.chrome;if(Z.isSafari(e))return ee.safari;throw new Error("Browser could not be detected: "+e)}}class Be{static toBlob(e,n,s=!1,d){return new Promise((_,j)=>{e.toBlob(U=>{U?_(U):j(new Error("canvas.toBlob returned null"))},n,s?d:void 0)})}}function Ye(a){return navigator.clipboard.writeText(a)}function Ee(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Oe={exports:{}};var Pe=Oe.exports,Re;function We(){return Re||(Re=1,(function(a,e){((n,s)=>{a.exports=s()})(Pe,function n(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},d,_=!s.document&&!!s.postMessage,j=s.IS_PAPA_WORKER||!1,U={},J=0,p={};function F(t){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(r){var i=le(r);i.chunkSize=parseInt(i.chunkSize),r.step||r.chunk||(i.chunkSize=null),this._handle=new ie(i),(this._handle.streamer=this)._config=i}).call(this,t),this.parseChunk=function(r,i){var u=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<u){let E=this._config.newline;E||(y=this._config.quoteChar||'"',E=this._handle.guessLineEndings(r,y)),r=[...r.split(E).slice(u)].join(E)}this.isFirstChunk&&L(this._config.beforeFirstChunk)&&(y=this._config.beforeFirstChunk(r))!==void 0&&(r=y),this.isFirstChunk=!1,this._halted=!1;var u=this._partialLine+r,y=(this._partialLine="",this._handle.parse(u,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(r=y.meta.cursor,u=(this._finished||(this._partialLine=u.substring(r-this._baseIndex),this._baseIndex=r),y&&y.data&&(this._rowCount+=y.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),j)s.postMessage({results:y,workerId:p.WORKER_ID,finished:u});else if(L(this._config.chunk)&&!i){if(this._config.chunk(y,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=y=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(y.data),this._completeResults.errors=this._completeResults.errors.concat(y.errors),this._completeResults.meta=y.meta),this._completed||!u||!L(this._config.complete)||y&&y.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||y&&y.meta.paused||this._nextChunk(),y}this._halted=!0},this._sendError=function(r){L(this._config.error)?this._config.error(r):j&&this._config.error&&s.postMessage({workerId:p.WORKER_ID,error:r,finished:!1})}}function B(t){var r;(t=t||{}).chunkSize||(t.chunkSize=p.RemoteChunkSize),F.call(this,t),this._nextChunk=_?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(i){this._input=i,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),_||(r.onload=G(this._chunkLoaded,this),r.onerror=G(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!_),this._config.downloadRequestHeaders){var i,u=this._config.downloadRequestHeaders;for(i in u)r.setRequestHeader(i,u[i])}var y;this._config.chunkSize&&(y=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+y));try{r.send(this._config.downloadRequestBody)}catch(E){this._chunkError(E.message)}_&&r.status===0&&this._chunkError()}},this._chunkLoaded=function(){r.readyState===4&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(i=>(i=i.getResponseHeader("Content-Range"))!==null?parseInt(i.substring(i.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)))},this._chunkError=function(i){i=r.statusText||i,this._sendError(new Error(i))}}function V(t){(t=t||{}).chunkSize||(t.chunkSize=p.LocalChunkSize),F.call(this,t);var r,i,u=typeof FileReader<"u";this.stream=function(y){this._input=y,i=y.slice||y.webkitSlice||y.mozSlice,u?((r=new FileReader).onload=G(this._chunkLoaded,this),r.onerror=G(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var y=this._input,E=(this._config.chunkSize&&(E=Math.min(this._start+this._config.chunkSize,this._input.size),y=i.call(y,this._start,E)),r.readAsText(y,this._config.encoding));u||this._chunkLoaded({target:{result:E}})},this._chunkLoaded=function(y){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(y.target.result)},this._chunkError=function(){this._sendError(r.error)}}function K(t){var r;F.call(this,t=t||{}),this.stream=function(i){return r=i,this._nextChunk()},this._nextChunk=function(){var i,u;if(!this._finished)return i=this._config.chunkSize,r=i?(u=r.substring(0,i),r.substring(i)):(u=r,""),this._finished=!r,this.parseChunk(u)}}function re(t){F.call(this,t=t||{});var r=[],i=!0,u=!1;this.pause=function(){F.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){F.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(y){this._input=y,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){u&&r.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):i=!0},this._streamData=G(function(y){try{r.push(typeof y=="string"?y:y.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(E){this._streamError(E)}},this),this._streamError=G(function(y){this._streamCleanUp(),this._sendError(y)},this),this._streamEnd=G(function(){this._streamCleanUp(),u=!0,this._streamData("")},this),this._streamCleanUp=G(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ie(t){var r,i,u,y,E=Math.pow(2,53),v=-E,h=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,f=/^((\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)))$/,o=this,c=0,l=0,w=!1,m=!1,k=[],g={data:[],errors:[],meta:{}};function M(b){return t.skipEmptyLines==="greedy"?b.join("").trim()==="":b.length===1&&b[0].length===0}function C(){if(g&&u&&(q("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+p.DefaultDelimiter+"'"),u=!1),t.skipEmptyLines&&(g.data=g.data.filter(function(S){return!M(S)})),Y()){let S=function(R,P){L(t.transformHeader)&&(R=t.transformHeader(R,P)),k.push(R)};if(g)if(Array.isArray(g.data[0])){for(var b=0;Y()&&b<g.data.length;b++)g.data[b].forEach(S);g.data.splice(0,1)}else g.data.forEach(S)}function D(S,R){for(var P=t.header?{}:[],I=0;I<S.length;I++){var z=I,$=S[I],$=((se,O)=>(N=>(t.dynamicTypingFunction&&t.dynamicTyping[N]===void 0&&(t.dynamicTyping[N]=t.dynamicTypingFunction(N)),(t.dynamicTyping[N]||t.dynamicTyping)===!0))(se)?O==="true"||O==="TRUE"||O!=="false"&&O!=="FALSE"&&((N=>{if(h.test(N)&&(N=parseFloat(N),v<N&&N<E))return 1})(O)?parseFloat(O):f.test(O)?new Date(O):O===""?null:O):O)(z=t.header?I>=k.length?"__parsed_extra":k[I]:z,$=t.transform?t.transform($,z):$);z==="__parsed_extra"?(P[z]=P[z]||[],P[z].push($)):P[z]=$}return t.header&&(I>k.length?q("FieldMismatch","TooManyFields","Too many fields: expected "+k.length+" fields but parsed "+I,l+R):I<k.length&&q("FieldMismatch","TooFewFields","Too few fields: expected "+k.length+" fields but parsed "+I,l+R)),P}var x;g&&(t.header||t.dynamicTyping||t.transform)&&(x=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(D),x=g.data.length):g.data=D(g.data,0),t.header&&g.meta&&(g.meta.fields=k),l+=x)}function Y(){return t.header&&k.length===0}function q(b,D,x,S){b={type:b,code:D,message:x},S!==void 0&&(b.row=S),g.errors.push(b)}L(t.step)&&(y=t.step,t.step=function(b){g=b,Y()?C():(C(),g.data.length!==0&&(c+=b.data.length,t.preview&&c>t.preview?i.abort():(g.data=g.data[0],y(g,o))))}),this.parse=function(b,D,x){var S=t.quoteChar||'"',S=(t.newline||(t.newline=this.guessLineEndings(b,S)),u=!1,t.delimiter?L(t.delimiter)&&(t.delimiter=t.delimiter(b),g.meta.delimiter=t.delimiter):((S=((R,P,I,z,$)=>{var se,O,N,pe;$=$||[","," ","|",";",p.RECORD_SEP,p.UNIT_SEP];for(var ve=0;ve<$.length;ve++){for(var ae,_e=$[ve],X=0,oe=0,Q=0,ne=(N=void 0,new ye({comments:z,delimiter:_e,newline:P,preview:10}).parse(R)),fe=0;fe<ne.data.length;fe++)I&&M(ne.data[fe])?Q++:(ae=ne.data[fe].length,oe+=ae,N===void 0?N=ae:0<ae&&(X+=Math.abs(ae-N),N=ae));0<ne.data.length&&(oe/=ne.data.length-Q),(O===void 0||X<=O)&&(pe===void 0||pe<oe)&&1.99<oe&&(O=X,se=_e,pe=oe)}return{successful:!!(t.delimiter=se),bestDelimiter:se}})(b,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=S.bestDelimiter:(u=!0,t.delimiter=p.DefaultDelimiter),g.meta.delimiter=t.delimiter),le(t));return t.preview&&t.header&&S.preview++,r=b,i=new ye(S),g=i.parse(r,D,x),C(),w?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return w},this.pause=function(){w=!0,i.abort(),r=L(t.chunk)?"":r.substring(i.getCharIndex())},this.resume=function(){o.streamer._halted?(w=!1,o.streamer.parseChunk(r,!0)):setTimeout(o.resume,3)},this.aborted=function(){return m},this.abort=function(){m=!0,i.abort(),g.meta.aborted=!0,L(t.complete)&&t.complete(g),r=""},this.guessLineEndings=function(R,S){R=R.substring(0,1048576);var S=new RegExp(ce(S)+"([^]*?)"+ce(S),"gm"),x=(R=R.replace(S,"")).split("\r"),S=R.split(`
|
|
2
|
-
`),R=1<S.length&&S[0].length<x[0].length;if(x.length===1||R)return`
|
|
3
|
-
`;for(var P=0,I=0;I<x.length;I++)x[I][0]===`
|
|
4
|
-
`&&P++;return P>=x.length/2?`\r
|
|
5
|
-
`:"\r"}}function ce(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(t){var r=(t=t||{}).delimiter,i=t.newline,u=t.comments,y=t.step,E=t.preview,v=t.fastMode,h=null,f=!1,o=t.quoteChar==null?'"':t.quoteChar,c=o;if(t.escapeChar!==void 0&&(c=t.escapeChar),(typeof r!="string"||-1<p.BAD_DELIMITERS.indexOf(r))&&(r=","),u===r)throw new Error("Comment character same as delimiter");u===!0?u="#":(typeof u!="string"||-1<p.BAD_DELIMITERS.indexOf(u))&&(u=!1),i!==`
|
|
6
|
-
`&&i!=="\r"&&i!==`\r
|
|
7
|
-
`&&(i=`
|
|
8
|
-
`);var l=0,w=!1;this.parse=function(m,k,g){if(typeof m!="string")throw new Error("Input must be a string");var M=m.length,C=r.length,Y=i.length,q=u.length,b=L(y),D=[],x=[],S=[],R=l=0;if(!m)return X();if(v||v!==!1&&m.indexOf(o)===-1){for(var P=m.split(i),I=0;I<P.length;I++){if(S=P[I],l+=S.length,I!==P.length-1)l+=i.length;else if(g)return X();if(!u||S.substring(0,q)!==u){if(b){if(D=[],pe(S.split(r)),oe(),w)return X()}else pe(S.split(r));if(E&&E<=I)return D=D.slice(0,E),X(!0)}}return X()}for(var z=m.indexOf(r,l),$=m.indexOf(i,l),se=new RegExp(ce(c)+ce(o),"g"),O=m.indexOf(o,l);;)if(m[l]===o)for(O=l,l++;;){if((O=m.indexOf(o,O+1))===-1)return g||x.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:D.length,index:l}),ae();if(O===M-1)return ae(m.substring(l,O).replace(se,o));if(o===c&&m[O+1]===c)O++;else if(o===c||O===0||m[O-1]!==c){z!==-1&&z<O+1&&(z=m.indexOf(r,O+1));var N=ve(($=$!==-1&&$<O+1?m.indexOf(i,O+1):$)===-1?z:Math.min(z,$));if(m.substr(O+1+N,C)===r){S.push(m.substring(l,O).replace(se,o)),m[l=O+1+N+C]!==o&&(O=m.indexOf(o,l)),z=m.indexOf(r,l),$=m.indexOf(i,l);break}if(N=ve($),m.substring(O+1+N,O+1+N+Y)===i){if(S.push(m.substring(l,O).replace(se,o)),_e(O+1+N+Y),z=m.indexOf(r,l),O=m.indexOf(o,l),b&&(oe(),w))return X();if(E&&D.length>=E)return X(!0);break}x.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:D.length,index:l}),O++}}else if(u&&S.length===0&&m.substring(l,l+q)===u){if($===-1)return X();l=$+Y,$=m.indexOf(i,l),z=m.indexOf(r,l)}else if(z!==-1&&(z<$||$===-1))S.push(m.substring(l,z)),l=z+C,z=m.indexOf(r,l);else{if($===-1)break;if(S.push(m.substring(l,$)),_e($+Y),b&&(oe(),w))return X();if(E&&D.length>=E)return X(!0)}return ae();function pe(Q){D.push(Q),R=l}function ve(Q){var ne=0;return ne=Q!==-1&&(Q=m.substring(O+1,Q))&&Q.trim()===""?Q.length:ne}function ae(Q){return g||(Q===void 0&&(Q=m.substring(l)),S.push(Q),l=M,pe(S),b&&oe()),X()}function _e(Q){l=Q,pe(S),S=[],$=m.indexOf(i,l)}function X(Q){if(t.header&&!k&&D.length&&!f){var ne=D[0],fe=Object.create(null),Le=new Set(ne);let ze=!1;for(let we=0;we<ne.length;we++){let ue=ne[we];if(fe[ue=L(t.transformHeader)?t.transformHeader(ue,we):ue]){let be,je=fe[ue];for(;be=ue+"_"+je,je++,Le.has(be););Le.add(be),ne[we]=be,fe[ue]++,ze=!0,(h=h===null?{}:h)[be]=ue}else fe[ue]=1,ne[we]=ue;Le.add(ue)}ze&&console.warn("Duplicate headers found and renamed."),f=!0}return{data:D,errors:x,meta:{delimiter:r,linebreak:i,aborted:w,truncated:!!Q,cursor:R+(k||0),renamedHeaders:h}}}function oe(){y(X()),D=[],x=[]}},this.abort=function(){w=!0},this.getCharIndex=function(){return l}}function Se(t){var r=t.data,i=U[r.workerId],u=!1;if(r.error)i.userError(r.error,r.file);else if(r.results&&r.results.data){var y={abort:function(){u=!0,he(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Ce,resume:Ce};if(L(i.userStep)){for(var E=0;E<r.results.data.length&&(i.userStep({data:r.results.data[E],errors:r.results.errors,meta:r.results.meta},y),!u);E++);delete r.results}else L(i.userChunk)&&(i.userChunk(r.results,y,r.file),delete r.results)}r.finished&&!u&&he(r.workerId,r.results)}function he(t,r){var i=U[t];L(i.userComplete)&&i.userComplete(r),i.terminate(),delete U[t]}function Ce(){throw new Error("Not implemented.")}function le(t){if(typeof t!="object"||t===null)return t;var r,i=Array.isArray(t)?[]:{};for(r in t)i[r]=le(t[r]);return i}function G(t,r){return function(){t.apply(r,arguments)}}function L(t){return typeof t=="function"}return p.parse=function(t,r){var i=(r=r||{}).dynamicTyping||!1;if(L(i)&&(r.dynamicTypingFunction=i,i={}),r.dynamicTyping=i,r.transform=!!L(r.transform)&&r.transform,!r.worker||!p.WORKERS_SUPPORTED)return i=null,p.NODE_STREAM_INPUT,typeof t=="string"?(t=(u=>u.charCodeAt(0)!==65279?u:u.slice(1))(t),i=new(r.download?B:K)(r)):t.readable===!0&&L(t.read)&&L(t.on)?i=new re(r):(s.File&&t instanceof File||t instanceof Object)&&(i=new V(r)),i.stream(t);(i=(()=>{var u;return!!p.WORKERS_SUPPORTED&&(u=(()=>{var y=s.URL||s.webkitURL||null,E=n.toString();return p.BLOB_URL||(p.BLOB_URL=y.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; ","(",E,")();"],{type:"text/javascript"})))})(),(u=new s.Worker(u)).onmessage=Se,u.id=J++,U[u.id]=u)})()).userStep=r.step,i.userChunk=r.chunk,i.userComplete=r.complete,i.userError=r.error,r.step=L(r.step),r.chunk=L(r.chunk),r.complete=L(r.complete),r.error=L(r.error),delete r.worker,i.postMessage({input:t,config:r,workerId:i.id})},p.unparse=function(t,r){var i=!1,u=!0,y=",",E=`\r
|
|
9
|
-
`,v='"',h=v+v,f=!1,o=null,c=!1,l=((()=>{if(typeof r=="object"){if(typeof r.delimiter!="string"||p.BAD_DELIMITERS.filter(function(k){return r.delimiter.indexOf(k)!==-1}).length||(y=r.delimiter),typeof r.quotes!="boolean"&&typeof r.quotes!="function"&&!Array.isArray(r.quotes)||(i=r.quotes),typeof r.skipEmptyLines!="boolean"&&typeof r.skipEmptyLines!="string"||(f=r.skipEmptyLines),typeof r.newline=="string"&&(E=r.newline),typeof r.quoteChar=="string"&&(v=r.quoteChar),typeof r.header=="boolean"&&(u=r.header),Array.isArray(r.columns)){if(r.columns.length===0)throw new Error("Option columns is empty");o=r.columns}r.escapeChar!==void 0&&(h=r.escapeChar+v),r.escapeFormulae instanceof RegExp?c=r.escapeFormulae:typeof r.escapeFormulae=="boolean"&&r.escapeFormulae&&(c=/^[=+\-@\t\r].*$/)}})(),new RegExp(ce(v),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return w(null,t,f);if(typeof t[0]=="object")return w(o||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||o),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),w(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function w(k,g,M){var C="",Y=(typeof k=="string"&&(k=JSON.parse(k)),typeof g=="string"&&(g=JSON.parse(g)),Array.isArray(k)&&0<k.length),q=!Array.isArray(g[0]);if(Y&&u){for(var b=0;b<k.length;b++)0<b&&(C+=y),C+=m(k[b],b);0<g.length&&(C+=E)}for(var D=0;D<g.length;D++){var x=(Y?k:g[D]).length,S=!1,R=Y?Object.keys(g[D]).length===0:g[D].length===0;if(M&&!Y&&(S=M==="greedy"?g[D].join("").trim()==="":g[D].length===1&&g[D][0].length===0),M==="greedy"&&Y){for(var P=[],I=0;I<x;I++){var z=q?k[I]:I;P.push(g[D][z])}S=P.join("").trim()===""}if(!S){for(var $=0;$<x;$++){0<$&&!R&&(C+=y);var se=Y&&q?k[$]:$;C+=m(g[D][se],$)}D<g.length-1&&(!M||0<x&&!R)&&(C+=E)}}return C}function m(k,g){var M,C;return k==null?"":k.constructor===Date?JSON.stringify(k).slice(1,25):(C=!1,c&&typeof k=="string"&&c.test(k)&&(k="'"+k,C=!0),M=k.toString().replace(l,h),(C=C||i===!0||typeof i=="function"&&i(k,g)||Array.isArray(i)&&i[g]||((Y,q)=>{for(var b=0;b<q.length;b++)if(-1<Y.indexOf(q[b]))return!0;return!1})(M,p.BAD_DELIMITERS)||-1<M.indexOf(y)||M.charAt(0)===" "||M.charAt(M.length-1)===" ")?v+M+v:M)}},p.RECORD_SEP="",p.UNIT_SEP="",p.BYTE_ORDER_MARK="\uFEFF",p.BAD_DELIMITERS=["\r",`
|
|
10
|
-
`,'"',p.BYTE_ORDER_MARK],p.WORKERS_SUPPORTED=!_&&!!s.Worker,p.NODE_STREAM_INPUT=1,p.LocalChunkSize=10485760,p.RemoteChunkSize=5242880,p.DefaultDelimiter=",",p.Parser=ye,p.ParserHandle=ie,p.NetworkStreamer=B,p.FileStreamer=V,p.StringStreamer=K,p.ReadableStreamStreamer=re,s.jQuery&&((d=s.jQuery).fn.parse=function(t){var r=t.config||{},i=[];return this.each(function(E){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var v=0;v<this.files.length;v++)i.push({file:this.files[v],inputElem:this,instanceConfig:d.extend({},r)})}),u(),this;function u(){if(i.length===0)L(t.complete)&&t.complete();else{var E,v,h,f,o=i[0];if(L(t.before)){var c=t.before(o.file,o.inputElem);if(typeof c=="object"){if(c.action==="abort")return E="AbortError",v=o.file,h=o.inputElem,f=c.reason,void(L(t.error)&&t.error({name:E},v,h,f));if(c.action==="skip")return void y();typeof c.config=="object"&&(o.instanceConfig=d.extend(o.instanceConfig,c.config))}else if(c==="skip")return void y()}var l=o.instanceConfig.complete;o.instanceConfig.complete=function(w){L(l)&&l(w,o.file,o.inputElem),y()},p.parse(o.file,o.instanceConfig)}}function y(){i.splice(0,1),u()}}),j&&(s.onmessage=function(t){t=t.data,p.WORKER_ID===void 0&&t&&(p.WORKER_ID=t.workerId),typeof t.input=="string"?s.postMessage({workerId:p.WORKER_ID,results:p.parse(t.input,t.config),finished:!0}):(s.File&&t.input instanceof File||t.input instanceof Object)&&(t=p.parse(t.input,t.config))&&s.postMessage({workerId:p.WORKER_ID,results:t,finished:!0})}),(B.prototype=Object.create(F.prototype)).constructor=B,(V.prototype=Object.create(F.prototype)).constructor=V,(K.prototype=Object.create(K.prototype)).constructor=K,(re.prototype=Object.create(F.prototype)).constructor=re,p})})(Oe)),Oe.exports}var Ne=We();const qe=Ee(Ne),{parse:Ke,unparse:Je}=qe;class Qe{static unparse(e,n){return Je(e,n)}static parse(e){return new Promise((n,s)=>{Ke(e,{header:!0,complete:d=>n(d),error:d=>s(d)})})}}class Ae{static revokeObjectUrlDelay=4e4;static utf8BomMimeType=/^\s*(?:text\/\S*|application\/xml|\S+\/\S+\+xml)\s*;\s*charset\s*=\s*utf-8/i;static saveAs(e,n,s={}){this.assertBrowserEnvironment();const d=this.resolveFileName(e,n),_=s.autoBom?this.addUtf8Bom(e):e;this.downloadBlob(_,d)}static resolveFileName(e,n){return typeof n=="string"&&n.trim().length>0?n:typeof File<"u"&&e instanceof File&&e.name.trim().length>0?e.name:"download"}static addUtf8Bom(e){return this.utf8BomMimeType.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}static assertBrowserEnvironment(){if(typeof window>"u"||typeof document>"u"||typeof URL>"u"||typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function")throw new Error("DownloadHelper is only available in a browser environment with object URL support.")}static downloadBlob(e,n){const s=URL.createObjectURL(e);try{this.clickDownloadLink(s,n)}finally{window.setTimeout(()=>URL.revokeObjectURL(s),this.revokeObjectUrlDelay)}}static clickDownloadLink(e,n){const s=document.body??document.documentElement;if(!s)throw new Error("DownloadHelper.saveAs requires an initialized document.");const d=document.createElement("a");try{d.download=n,d.href=e,d.target="_blank",d.rel="noopener noreferrer",d.style.display="none",s.appendChild(d),d.click()}finally{d.remove()}}}class Ve{static getEnumValue(e,n){if(n in e)return e[n];throw Error(`${n} not found in ${e}`)}static getKeyValues(e){return Object.keys(e).filter(n=>!isNaN(Number(n))).map(n=>({key:Number(n),value:e[n]}))}}class Ze{static getFileExtension(e){let n="";const s=e.lastIndexOf(".");return s>0&&s<e.length-1&&(n=`.${e.substring(s+1).toLowerCase()}`),n}static readAsText(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=()=>{n.onload=null,n.onerror=null,typeof n.result=="string"?s(n.result):d(new Error("Unexpected result type"))},n.onerror=()=>{const _=n.error??new Error("FileReader error");n.onload=null,n.onerror=null,d(_)},n.readAsText(e)})}static readAsArrayBuffer(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=()=>{n.onload=null,n.onerror=null,n.result instanceof ArrayBuffer?s(n.result):d(new Error("Unexpected result type"))},n.onerror=()=>{const _=n.error??new Error("FileReader error");n.onload=null,n.onerror=null,d(_)},n.readAsArrayBuffer(e)})}static readAsDataUrl(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=_=>{s(_)},n.onerror=_=>d(_),n.readAsDataURL(e)})}static formatFileSize(e,n=2,s){if(e===0)return"0 Bytes";const d=1024,_=["Bytes","KB","MB","GB","TB"];let j=Math.floor(Math.log(e)/Math.log(d));s&&_.includes(s)&&(j=_.indexOf(s));const U=e/Math.pow(d,j);return`${parseFloat(U.toFixed(n))} ${_[j]}`}static isWithinSizeLimit(e,n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("maxBytes must be a non-negative safe integer.");return e.size<=n}static save(e,n,s){const d=new Blob([e],{type:s});Ae.saveAs(d,n)}}class He{static hasAllowedMimeType(e,n){const s=e.type.trim().toLowerCase();return s.length>0&&n.some(d=>d.trim().toLowerCase()===s)}static load(e){const n=URL.createObjectURL(e);return this.loadSource(n).finally(()=>URL.revokeObjectURL(n))}static async compress(e,n=.8,s="image/jpeg"){const d=await this.loadSource(e),{canvas:_}=this.resize(d,d.width,d.height);return _.toDataURL(s,n)}static resize(e,n,s){let{width:d,height:_}=e;const j=n/d,U=s/_,J=Math.min(j,U,1);d=Math.floor(d*J),_=Math.floor(_*J);const p=document.createElement("canvas");p.width=d,p.height=_;const F=p.getContext("2d");return F.clearRect(0,0,d,_),F.drawImage(e,0,0,d,_),{canvas:p,width:d,height:_}}static loadSource(e){return new Promise((n,s)=>{const d=new Image;d.onload=()=>n(d),d.onerror=s,d.src=e})}}class De{static set(e,n){localStorage.setItem(e,JSON.stringify(n))}static get(e){let n=null;const s=localStorage.getItem(e);return s&&(n=JSON.parse(s)),n}static remove(e){const n=localStorage.getItem(e)!==null;return n&&localStorage.removeItem(e),n}static removeAll(){localStorage.clear()}static getKeysBy(e){return Object.keys(localStorage).filter(n=>n.startsWith(e))}}var ge=(a=>(a.log="log",a.info="info",a.warn="warn",a.debug="debug",a.error="error",a))(ge||{});class H{static listeners=new Set;static enabled=!0;static log(...e){H.doLog(ge.log,e)}static info(...e){H.doLog(ge.info,e)}static warn(...e){H.doLog(ge.warn,e)}static debug(...e){H.doLog(ge.debug,e)}static error(...e){H.doLog(ge.error,e)}static clearListeners(){H.listeners.clear()}static setEnabled(e){H.enabled=e}static doLog(e,n){if(!H.enabled)return;const s={type:e,args:n,timestamp:new Date().toISOString()};for(const d of H.listeners)try{if(d(s)===!1)return}catch{}console[e].apply(console,n)}static onLog(e,n=!1){if(n){const s=d=>{try{return e(d)}finally{H.listeners.delete(s)}};return H.listeners.add(s),()=>H.listeners.delete(s)}return H.listeners.add(e),()=>H.listeners.delete(e)}}const Ge=(a,e,n)=>a.localeCompare(e)*(n?1:-1),Xe=(a,e)=>a<e?-1:a===e?0:1,et=(a,e,n)=>Xe(a,e)*(n?1:-1),tt=(a,e,n)=>typeof a=="string"&&typeof e=="string"?Ge(a,e,n):et(a,e,n),Te=(a,e,n,s)=>{const d=n(a),_=n(e);return tt(d,_,s)};class rt{static get(e){return De.get(e)}static set(e,n){De.set(e,n)}static remove(e){De.remove(e)}}class T{static listeners=new Set;static initialized=!1;static resizeTimeout=null;static lastWidth=null;static onResize(e){return T.initialized||T.init(),T.listeners.add(e),()=>T.off(e)}static handleResize=()=>{T.resizeTimeout!==null&&(window.clearTimeout(T.resizeTimeout),T.resizeTimeout=null),T.resizeTimeout=window.setTimeout(()=>{const e=window.innerWidth;if(T.resizeTimeout=null,e!==T.lastWidth){T.lastWidth=e;for(const n of T.listeners)n(e)}},150)};static init(){if(!T.initialized){if(typeof window>"u")throw new Error("WindowResizeHelper is only available in browser environments");T.lastWidth=window.innerWidth,window.addEventListener("resize",T.handleResize,{passive:!0}),T.initialized=!0}}static off(e){T.initialized&&(T.listeners.delete(e),T.listeners.size===0&&(T.resizeTimeout!==null&&(window.clearTimeout(T.resizeTimeout),T.resizeTimeout=null),window.removeEventListener("resize",T.handleResize),T.initialized=!1,T.lastWidth=null))}}function W(a,e,n){Object.defineProperty(a,e,{configurable:!0,enumerable:!1,value:n,writable:!0})}function nt(){W(Array.prototype,"distinct",function(a){return a?this.filter((n,s,d)=>d.findIndex(_=>a(_,n))===s):this.filter((n,s,d)=>d.indexOf(n)===s)}),W(Array.prototype,"filterBy",function(a){return this.filter(e=>a(e))}),W(Array.prototype,"first",function(){return this.length>0?this[0]:null}),W(Array.prototype,"groupBy",function(a){return this.reduce((e,n)=>{const s=a(n);return Object.hasOwn(e,s)||(e[s]=[]),e[s].push(n),e},Object.create(null))}),W(Array.prototype,"orderBy",function(a,e=!0){return this?.sort((n,s)=>Te(n,s,a,e)),this}),W(Array.prototype,"removeBy",function(a,e){return this.filter(n=>a(n)!==e)})}var xe={exports:{}},it=xe.exports,Ie;function st(){return Ie||(Ie=1,(function(a,e){(function(n,s){a.exports=s()})(it,(function(){var n=1e3,s=6e4,d=36e5,_="millisecond",j="second",U="minute",J="hour",p="day",F="week",B="month",V="quarter",K="year",re="date",ie="Invalid Date",ce=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ye=/\[([^\]]+)]|YYYY|YY|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,Se={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(v){var h=["th","st","nd","rd"],f=v%100;return"["+v+(h[(f-20)%10]||h[f]||h[0])+"]"}},he=function(v,h,f){var o=String(v);return!o||o.length>=h?v:""+Array(h+1-o.length).join(f)+v},Ce={s:he,z:function(v){var h=-v.utcOffset(),f=Math.abs(h),o=Math.floor(f/60),c=f%60;return(h<=0?"+":"-")+he(o,2,"0")+":"+he(c,2,"0")},m:function v(h,f){if(h.date()<f.date())return-v(f,h);var o=12*(f.year()-h.year())+(f.month()-h.month()),c=h.clone().add(o,B),l=f-c<0,w=h.clone().add(o+(l?-1:1),B);return+(-(o+(f-c)/(l?c-w:w-c))||0)},a:function(v){return v<0?Math.ceil(v)||0:Math.floor(v)},p:function(v){return{M:B,y:K,w:F,d:p,D:re,h:J,m:U,s:j,ms:_,Q:V}[v]||String(v||"").toLowerCase().replace(/s$/,"")},u:function(v){return v===void 0}},le="en",G={};G[le]=Se;var L="$isDayjsObject",t=function(v){return v instanceof y||!(!v||!v[L])},r=function v(h,f,o){var c;if(!h)return le;if(typeof h=="string"){var l=h.toLowerCase();G[l]&&(c=l),f&&(G[l]=f,c=l);var w=h.split("-");if(!c&&w.length>1)return v(w[0])}else{var m=h.name;G[m]=h,c=m}return!o&&c&&(le=c),c||!o&&le},i=function(v,h){if(t(v))return v.clone();var f=typeof h=="object"?h:{};return f.date=v,f.args=arguments,new y(f)},u=Ce;u.l=r,u.i=t,u.w=function(v,h){return i(v,{locale:h.$L,utc:h.$u,x:h.$x,$offset:h.$offset})};var y=(function(){function v(f){this.$L=r(f.locale,null,!0),this.parse(f),this.$x=this.$x||f.x||{},this[L]=!0}var h=v.prototype;return h.parse=function(f){this.$d=(function(o){var c=o.date,l=o.utc;if(c===null)return new Date(NaN);if(u.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var w=c.match(ce);if(w){var m=w[2]-1||0,k=(w[7]||"0").substring(0,3);return l?new Date(Date.UTC(w[1],m,w[3]||1,w[4]||0,w[5]||0,w[6]||0,k)):new Date(w[1],m,w[3]||1,w[4]||0,w[5]||0,w[6]||0,k)}}return new Date(c)})(f),this.init()},h.init=function(){var f=this.$d;this.$y=f.getFullYear(),this.$M=f.getMonth(),this.$D=f.getDate(),this.$W=f.getDay(),this.$H=f.getHours(),this.$m=f.getMinutes(),this.$s=f.getSeconds(),this.$ms=f.getMilliseconds()},h.$utils=function(){return u},h.isValid=function(){return this.$d.toString()!==ie},h.isSame=function(f,o){var c=i(f);return this.startOf(o)<=c&&c<=this.endOf(o)},h.isAfter=function(f,o){return i(f)<this.startOf(o)},h.isBefore=function(f,o){return this.endOf(o)<i(f)},h.$g=function(f,o,c){return u.u(f)?this[o]:this.set(c,f)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(f,o){var c=this,l=!!u.u(o)||o,w=u.p(f),m=function(D,x){var S=u.w(c.$u?Date.UTC(c.$y,x,D):new Date(c.$y,x,D),c);return l?S:S.endOf(p)},k=function(D,x){return u.w(c.toDate()[D].apply(c.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(x)),c)},g=this.$W,M=this.$M,C=this.$D,Y="set"+(this.$u?"UTC":"");switch(w){case K:return l?m(1,0):m(31,11);case B:return l?m(1,M):m(0,M+1);case F:var q=this.$locale().weekStart||0,b=(g<q?g+7:g)-q;return m(l?C-b:C+(6-b),M);case p:case re:return k(Y+"Hours",0);case J:return k(Y+"Minutes",1);case U:return k(Y+"Seconds",2);case j:return k(Y+"Milliseconds",3);default:return this.clone()}},h.endOf=function(f){return this.startOf(f,!1)},h.$set=function(f,o){var c,l=u.p(f),w="set"+(this.$u?"UTC":""),m=(c={},c[p]=w+"Date",c[re]=w+"Date",c[B]=w+"Month",c[K]=w+"FullYear",c[J]=w+"Hours",c[U]=w+"Minutes",c[j]=w+"Seconds",c[_]=w+"Milliseconds",c)[l],k=l===p?this.$D+(o-this.$W):o;if(l===B||l===K){var g=this.clone().set(re,1);g.$d[m](k),g.init(),this.$d=g.set(re,Math.min(this.$D,g.daysInMonth())).$d}else m&&this.$d[m](k);return this.init(),this},h.set=function(f,o){return this.clone().$set(f,o)},h.get=function(f){return this[u.p(f)]()},h.add=function(f,o){var c,l=this;f=Number(f);var w=u.p(o),m=function(M){var C=i(l);return u.w(C.date(C.date()+Math.round(M*f)),l)};if(w===B)return this.set(B,this.$M+f);if(w===K)return this.set(K,this.$y+f);if(w===p)return m(1);if(w===F)return m(7);var k=(c={},c[U]=s,c[J]=d,c[j]=n,c)[w]||1,g=this.$d.getTime()+f*k;return u.w(g,this)},h.subtract=function(f,o){return this.add(-1*f,o)},h.format=function(f){var o=this,c=this.$locale();if(!this.isValid())return c.invalidDate||ie;var l=f||"YYYY-MM-DDTHH:mm:ssZ",w=u.z(this),m=this.$H,k=this.$m,g=this.$M,M=c.weekdays,C=c.months,Y=c.meridiem,q=function(x,S,R,P){return x&&(x[S]||x(o,l))||R[S].slice(0,P)},b=function(x){return u.s(m%12||12,x,"0")},D=Y||function(x,S,R){var P=x<12?"AM":"PM";return R?P.toLowerCase():P};return l.replace(ye,(function(x,S){return S||(function(R){switch(R){case"YY":return String(o.$y).slice(-2);case"YYYY":return u.s(o.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return q(c.monthsShort,g,C,3);case"MMMM":return q(C,g);case"D":return o.$D;case"DD":return u.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return q(c.weekdaysMin,o.$W,M,2);case"ddd":return q(c.weekdaysShort,o.$W,M,3);case"dddd":return M[o.$W];case"H":return String(m);case"HH":return u.s(m,2,"0");case"h":return b(1);case"hh":return b(2);case"a":return D(m,k,!0);case"A":return D(m,k,!1);case"m":return String(k);case"mm":return u.s(k,2,"0");case"s":return String(o.$s);case"ss":return u.s(o.$s,2,"0");case"SSS":return u.s(o.$ms,3,"0");case"Z":return w}return null})(x)||w.replace(":","")}))},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(f,o,c){var l,w=this,m=u.p(o),k=i(f),g=(k.utcOffset()-this.utcOffset())*s,M=this-k,C=function(){return u.m(w,k)};switch(m){case K:l=C()/12;break;case B:l=C();break;case V:l=C()/3;break;case F:l=(M-g)/6048e5;break;case p:l=(M-g)/864e5;break;case J:l=M/d;break;case U:l=M/s;break;case j:l=M/n;break;default:l=M}return c?l:u.a(l)},h.daysInMonth=function(){return this.endOf(B).$D},h.$locale=function(){return G[this.$L]},h.locale=function(f,o){if(!f)return this.$L;var c=this.clone(),l=r(f,o,!0);return l&&(c.$L=l),c},h.clone=function(){return u.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},v})(),E=y.prototype;return i.prototype=E,[["$ms",_],["$s",j],["$m",U],["$H",J],["$W",p],["$M",B],["$y",K],["$D",re]].forEach((function(v){E[v[1]]=function(h){return this.$g(h,v[0],v[1])}})),i.extend=function(v,h){return v.$i||(v(h,y,i),v.$i=!0),i},i.locale=r,i.isDayjs=t,i.unix=function(v){return i(1e3*v)},i.en=G[le],i.Ls=G,i.p={},i}))})(xe)),xe.exports}var at=st();const te=Ee(at);var Me={exports:{}},ot=Me.exports,Ue;function ut(){return Ue||(Ue=1,(function(a,e){(function(n,s){a.exports=s()})(ot,(function(){var n="day";return function(s,d,_){var j=function(p){return p.add(4-p.isoWeekday(),n)},U=d.prototype;U.isoWeekYear=function(){return j(this).year()},U.isoWeek=function(p){if(!this.$utils().u(p))return this.add(7*(p-this.isoWeek()),n);var F,B,V,K,re=j(this),ie=(F=this.isoWeekYear(),B=this.$u,V=(B?_.utc:_)().year(F).startOf("year"),K=4-V.isoWeekday(),V.isoWeekday()>4&&(K+=7),V.add(K,n));return re.diff(ie,"week")+1},U.isoWeekday=function(p){return this.$utils().u(p)?this.day()||7:this.day(this.day()%7?p:p-7)};var J=U.startOf;U.startOf=function(p,F){var B=this.$utils(),V=!!B.u(F)||F;return B.p(p)==="isoweek"?V?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):J.bind(this)(p,F)}}}))})(Me)),Me.exports}var ct=ut();const lt=Ee(ct);var $e={exports:{}},ft=$e.exports,Fe;function dt(){return Fe||(Fe=1,(function(a,e){(function(n,s){a.exports=s()})(ft,(function(){var n={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(s,d,_){var j=d.prototype,U=j.format;_.en.formats=n,j.format=function(J){J===void 0&&(J="YYYY-MM-DDTHH:mm:ssZ");var p=this.$locale().formats,F=(function(B,V){return B.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(K,re,ie){var ce=ie&&ie.toUpperCase();return re||V[ie]||n[ie]||V[ce].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(ye,Se,he){return Se||he.slice(1)}))}))})(J,p===void 0?{}:p);return U.call(this,F)}}}))})($e)),$e.exports}var ht=dt();const pt=Ee(ht);te.extend(pt),te.extend(lt);function gt(){W(Date.prototype,"add",function(a,e){return te(this).add(a,e).toDate()}),W(Date.prototype,"diff",function(a,e){return te(this).diff(a,e)}),W(Date.prototype,"endOf",function(a){return te(this).endOf(a).toDate()}),W(Date.prototype,"firstDayOfMonth",function(){return te(this).startOf("month").toDate()}),W(Date.prototype,"format",function(a){return te(this).format(a)}),W(Date.prototype,"isAfter",function(a,e){return te(this).isAfter(a,e)}),W(Date.prototype,"isBefore",function(a,e){return te(this).isBefore(a,e)}),W(Date.prototype,"isValid",function(){return te(this).isValid()}),W(Date.prototype,"isoWeek",function(){return te(this).isoWeek()}),W(Date.prototype,"subtract",function(a,e){return te(this).subtract(a,e).toDate()}),W(Date.prototype,"lastDayOfMonth",function(){return te(this).endOf("month").toDate()}),W(Date.prototype,"set",function(a,e){return te(this).set(a,e).toDate()}),W(Date.prototype,"startOf",function(a){return te(this).startOf(a).toDate()})}function mt(){W(String.prototype,"capitalize",function(){return this.charAt(0).toUpperCase()+this.slice(1)}),W(String.prototype,"isNumber",function(){return!isNaN(Number(this))&&this.trim()!==""}),W(String.prototype,"isEmpty",function(){return this===void 0||!this||this.length===0}),W(String.prototype,"stripTags",function(){return new DOMParser().parseFromString(this.toString(),"text/html").body.textContent||""})}class yt{resizeListener=null;onResizeCallbacks=new Set;emitTimeoutId=null;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.resizeListener=this.onResize,window.addEventListener("resize",this.resizeListener,{passive:!0}))}destroy(){typeof window<"u"&&this.resizeListener!==null&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.emitTimeoutId!==null&&(clearTimeout(this.emitTimeoutId),this.emitTimeoutId=null),this.onResizeCallbacks.clear()}onResizeChange(e){this.onResizeCallbacks.add(e)}offResizeChange(e){this.onResizeCallbacks.delete(e)}onResize=()=>{if(typeof window>"u")return;const e=window.innerWidth;this.emitTimeoutId!==null&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.emitTimeoutId=null;const n=de.getBreakpointByScreenWidth(e);for(const s of this.onResizeCallbacks)s(e,n)},this.duplicateThresholdMs)}}A.BreakPointHelper=de,A.BreakPoints=me,A.BrowserHelper=Z,A.BrowserService=yt,A.BrowserType=ee,A.CanvasHelper=Be,A.CsvHelper=Qe,A.DownloadHelper=Ae,A.EnumHelper=Ve,A.FileHelper=Ze,A.ImageHelper=He,A.LocalStorageHelper=De,A.LoggerHelper=H,A.LoggerType=ge,A.ScreenHelper=ke,A.TokenHelper=rt,A.WindowResizeHelper=T,A.copyToClipboard=Ye,A.initArrayExtensions=nt,A.initDateExtensions=gt,A.initStringExtensions=mt,A.sortHelper=Te,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(o,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("papaparse"),require("dayjs"),require("dayjs/plugin/isoWeek.js"),require("dayjs/plugin/localizedFormat.js")):typeof define=="function"&&define.amd?define(["exports","papaparse","dayjs","dayjs/plugin/isoWeek.js","dayjs/plugin/localizedFormat.js"],y):(o=typeof globalThis<"u"?globalThis:o||self,y(o["ts-utils"]={},o.Papa,o.dayjs,o.dayjs_plugin_isoWeek,o.dayjs_plugin_localizedFormat))})(this,(function(o,y,d,D,L){"use strict";const b={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600};class v{static getScreenWidth(){return document.documentElement.clientWidth}static getScreenHeight(){return document.documentElement.clientHeight}}class h{static breakPoints=b;static getCurrentBreakpoint(){return h.getBreakpointByScreenWidth(v.getScreenWidth())}static getBreakpointByScreenWidth(e=v.getScreenWidth()){let t="xs";for(const r of Object.keys(h.breakPoints))h.breakPoints[r]<=e&&(t=r);return{breakpoint:t,screenWidth:e}}static isScreenGreaterThan(e){return v.getScreenWidth()>h.breakPoints[e]}static isScreenSmallerThan(e){return v.getScreenWidth()<h.breakPoints[e]}}var f=(i=>(i.opera="opera",i.firefox="firefox",i.safari="safari",i.ie="ie",i.edgeLegacy="edgeLegacy",i.edg="edg",i.chrome="chrome",i.iOS="iOS",i.iOsSafari="iOsSafari",i.edgiOs="edgiOs",i.headlessChrome="headlessChrome",i.nodeRuntime="nodeRuntime",i.electron="electron",i))(f||{});class l{static getUserAgent(){return this.isBrowserEnv()?navigator.userAgent.toLowerCase():""}static resolveUserAgent(e){return(e??this.getUserAgent()).toLowerCase()}static isBrowserEnv(){return typeof window<"u"&&typeof navigator<"u"}static isOpera(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return t.includes("opr/")||t.includes("opera")}static isFirefox(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("firefox")||typeof globalThis.InstallTrigger<"u":!1}static isSafari(e){if(!this.isBrowserEnv())return!1;const t=navigator.vendor.includes("Apple"),r=this.resolveUserAgent(e),n=r.includes("safari"),s=!(r.includes("crios")||r.includes("chrome")||r.includes("android")||r.includes("opr/")||r.includes("edg"));return t&&n&&s}static isIOS(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e),r=/iphone|ipad|ipod/.test(t),n=t.includes("macintosh")&&navigator.maxTouchPoints>1;return r||n}static isIosSafari(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return this.isIOS(t)&&this.isSafari(t)}static isEdgeLegacy(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return!!window.StyleMedia&&!t.includes("edg/")}static isEdg(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("edg/"):!1}static isEdgeIos(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return this.isIOS(t)&&t.includes("edgios")}static isIE(){return this.isBrowserEnv()?typeof document<"u"&&!!document.documentMode:!1}static isChrome(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e),r=navigator.vendor.includes("Google"),n=t.includes("chrome")||t.includes("crios"),s=!this.isEdg(t)&&!this.isOpera(t);return r&&n&&s}static isElectron(e){const t=!!(typeof process<"u"&&process.versions?.electron),r=this.resolveUserAgent(e);return t||r.includes("electron")}static isHeadlessChrome(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("headlesschrome"):!1}static isNodeRuntime(){return typeof process<"u"&&!!process.versions?.node&&!this.isBrowserEnv()}static getCurrentBrowser(){const e=l.getUserAgent();if(l.isElectron(e))return f.electron;if(l.isNodeRuntime())return f.nodeRuntime;if(l.isOpera(e))return f.opera;if(l.isFirefox(e))return f.firefox;if(l.isEdgeIos(e))return f.edgiOs;if(l.isIosSafari(e))return f.iOsSafari;if(l.isIOS(e))return f.iOS;if(l.isHeadlessChrome(e))return f.headlessChrome;if(l.isIE())return f.ie;if(l.isEdgeLegacy(e))return f.edgeLegacy;if(l.isEdg(e))return f.edg;if(l.isChrome(e))return f.chrome;if(l.isSafari(e))return f.safari;throw new Error("Browser could not be detected: "+e)}}class T{static toBlob(e,t,r=!1,n){return new Promise((s,g)=>{e.toBlob(p=>{p?s(p):g(new Error("canvas.toBlob returned null"))},t,r?n:void 0)})}}function C(i){return navigator.clipboard.writeText(i)}const{parse:I,unparse:x}=y;class B{static unparse(e,t){return x(e,t)}static parse(e){return new Promise((t,r)=>{I(e,{header:!0,complete:n=>t(n),error:n=>r(n)})})}}class O{static revokeObjectUrlDelay=4e4;static utf8BomMimeType=/^\s*(?:text\/\S*|application\/xml|\S+\/\S+\+xml)\s*;\s*charset\s*=\s*utf-8/i;static saveAs(e,t,r={}){this.assertBrowserEnvironment();const n=this.resolveFileName(e,t),s=r.autoBom?this.addUtf8Bom(e):e;this.downloadBlob(s,n)}static resolveFileName(e,t){return typeof t=="string"&&t.trim().length>0?t:typeof File<"u"&&e instanceof File&&e.name.trim().length>0?e.name:"download"}static addUtf8Bom(e){return this.utf8BomMimeType.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}static assertBrowserEnvironment(){if(typeof window>"u"||typeof document>"u"||typeof URL>"u"||typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function")throw new Error("DownloadHelper is only available in a browser environment with object URL support.")}static downloadBlob(e,t){const r=URL.createObjectURL(e);try{this.clickDownloadLink(r,t)}finally{window.setTimeout(()=>URL.revokeObjectURL(r),this.revokeObjectUrlDelay)}}static clickDownloadLink(e,t){const r=document.body??document.documentElement;if(!r)throw new Error("DownloadHelper.saveAs requires an initialized document.");const n=document.createElement("a");try{n.download=t,n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.style.display="none",r.appendChild(n),n.click()}finally{n.remove()}}}class z{static getEnumValue(e,t){if(t in e)return e[t];throw Error(`${t} not found in ${e}`)}static getKeyValues(e){return Object.keys(e).filter(t=>!isNaN(Number(t))).map(t=>({key:Number(t),value:e[t]}))}}class F{static getFileExtension(e){let t="";const r=e.lastIndexOf(".");return r>0&&r<e.length-1&&(t=`.${e.substring(r+1).toLowerCase()}`),t}static readAsText(e){const t=new FileReader;return new Promise((r,n)=>{t.onload=()=>{t.onload=null,t.onerror=null,typeof t.result=="string"?r(t.result):n(new Error("Unexpected result type"))},t.onerror=()=>{const s=t.error??new Error("FileReader error");t.onload=null,t.onerror=null,n(s)},t.readAsText(e)})}static readAsArrayBuffer(e){const t=new FileReader;return new Promise((r,n)=>{t.onload=()=>{t.onload=null,t.onerror=null,t.result instanceof ArrayBuffer?r(t.result):n(new Error("Unexpected result type"))},t.onerror=()=>{const s=t.error??new Error("FileReader error");t.onload=null,t.onerror=null,n(s)},t.readAsArrayBuffer(e)})}static readAsDataUrl(e){const t=new FileReader;return new Promise((r,n)=>{t.onload=s=>{r(s)},t.onerror=s=>n(s),t.readAsDataURL(e)})}static formatFileSize(e,t=2,r){if(e===0)return"0 Bytes";const n=1024,s=["Bytes","KB","MB","GB","TB"];let g=Math.floor(Math.log(e)/Math.log(n));r&&s.includes(r)&&(g=s.indexOf(r));const p=e/Math.pow(n,g);return`${parseFloat(p.toFixed(t))} ${s[g]}`}static isWithinSizeLimit(e,t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError("maxBytes must be a non-negative safe integer.");return e.size<=t}static save(e,t,r){const n=new Blob([e],{type:r});O.saveAs(n,t)}}class M{static hasAllowedMimeType(e,t){const r=e.type.trim().toLowerCase();return r.length>0&&t.some(n=>n.trim().toLowerCase()===r)}static load(e){const t=URL.createObjectURL(e);return this.loadSource(t).finally(()=>URL.revokeObjectURL(t))}static async compress(e,t=.8,r="image/jpeg"){const n=await this.loadSource(e),{canvas:s}=this.resize(n,n.width,n.height);return s.toDataURL(r,t)}static resize(e,t,r){let{width:n,height:s}=e;const g=t/n,p=r/s,E=Math.min(g,p,1);n=Math.floor(n*E),s=Math.floor(s*E);const S=document.createElement("canvas");S.width=n,S.height=s;const k=S.getContext("2d");return k.clearRect(0,0,n,s),k.drawImage(e,0,0,n,s),{canvas:S,width:n,height:s}}static loadSource(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=r,n.src=e})}}class w{static set(e,t){localStorage.setItem(e,JSON.stringify(t))}static get(e){let t=null;const r=localStorage.getItem(e);return r&&(t=JSON.parse(r)),t}static remove(e){const t=localStorage.getItem(e)!==null;return t&&localStorage.removeItem(e),t}static removeAll(){localStorage.clear()}static getKeysBy(e){return Object.keys(localStorage).filter(t=>t.startsWith(e))}}var m=(i=>(i.log="log",i.info="info",i.warn="warn",i.debug="debug",i.error="error",i))(m||{});class u{static listeners=new Set;static enabled=!0;static log(...e){u.doLog(m.log,e)}static info(...e){u.doLog(m.info,e)}static warn(...e){u.doLog(m.warn,e)}static debug(...e){u.doLog(m.debug,e)}static error(...e){u.doLog(m.error,e)}static clearListeners(){u.listeners.clear()}static setEnabled(e){u.enabled=e}static doLog(e,t){if(!u.enabled)return;const r={type:e,args:t,timestamp:new Date().toISOString()};for(const n of u.listeners)try{if(n(r)===!1)return}catch{}console[e].apply(console,t)}static onLog(e,t=!1){if(t){const r=n=>{try{return e(n)}finally{u.listeners.delete(r)}};return u.listeners.add(r),()=>u.listeners.delete(r)}return u.listeners.add(e),()=>u.listeners.delete(e)}}const R=(i,e,t)=>i.localeCompare(e)*(t?1:-1),P=(i,e)=>i<e?-1:i===e?0:1,N=(i,e,t)=>P(i,e)*(t?1:-1),j=(i,e,t)=>typeof i=="string"&&typeof e=="string"?R(i,e,t):N(i,e,t),A=(i,e,t,r)=>{const n=t(i),s=t(e);return j(n,s,r)};class q{static get(e){return w.get(e)}static set(e,t){w.set(e,t)}static remove(e){w.remove(e)}}class a{static listeners=new Set;static initialized=!1;static resizeTimeout=null;static lastWidth=null;static onResize(e){return a.initialized||a.init(),a.listeners.add(e),()=>a.off(e)}static handleResize=()=>{a.resizeTimeout!==null&&(window.clearTimeout(a.resizeTimeout),a.resizeTimeout=null),a.resizeTimeout=window.setTimeout(()=>{const e=window.innerWidth;if(a.resizeTimeout=null,e!==a.lastWidth){a.lastWidth=e;for(const t of a.listeners)t(e)}},150)};static init(){if(!a.initialized){if(typeof window>"u")throw new Error("WindowResizeHelper is only available in browser environments");a.lastWidth=window.innerWidth,window.addEventListener("resize",a.handleResize,{passive:!0}),a.initialized=!0}}static off(e){a.initialized&&(a.listeners.delete(e),a.listeners.size===0&&(a.resizeTimeout!==null&&(window.clearTimeout(a.resizeTimeout),a.resizeTimeout=null),window.removeEventListener("resize",a.handleResize),a.initialized=!1,a.lastWidth=null))}}function c(i,e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value:t,writable:!0})}function V(){c(Array.prototype,"distinct",function(i){return i?this.filter((t,r,n)=>n.findIndex(s=>i(s,t))===r):this.filter((t,r,n)=>n.indexOf(t)===r)}),c(Array.prototype,"filterBy",function(i){return this.filter(e=>i(e))}),c(Array.prototype,"first",function(){return this.length>0?this[0]:null}),c(Array.prototype,"groupBy",function(i){return this.reduce((e,t)=>{const r=i(t);return Object.hasOwn(e,r)||(e[r]=[]),e[r].push(t),e},Object.create(null))}),c(Array.prototype,"orderBy",function(i,e=!0){return this?.sort((t,r)=>A(t,r,i,e)),this}),c(Array.prototype,"removeBy",function(i,e){return this.filter(t=>i(t)!==e)})}let U=!1;function $(){U||(d.extend(L),d.extend(D),U=!0),c(Date.prototype,"add",function(i,e){return d(this).add(i,e).toDate()}),c(Date.prototype,"diff",function(i,e){return d(this).diff(i,e)}),c(Date.prototype,"endOf",function(i){return d(this).endOf(i).toDate()}),c(Date.prototype,"firstDayOfMonth",function(){return d(this).startOf("month").toDate()}),c(Date.prototype,"format",function(i){return d(this).format(i)}),c(Date.prototype,"isAfter",function(i,e){return d(this).isAfter(i,e)}),c(Date.prototype,"isBefore",function(i,e){return d(this).isBefore(i,e)}),c(Date.prototype,"isValid",function(){return d(this).isValid()}),c(Date.prototype,"isoWeek",function(){return d(this).isoWeek()}),c(Date.prototype,"subtract",function(i,e){return d(this).subtract(i,e).toDate()}),c(Date.prototype,"lastDayOfMonth",function(){return d(this).endOf("month").toDate()}),c(Date.prototype,"set",function(i,e){return d(this).set(i,e).toDate()}),c(Date.prototype,"startOf",function(i){return d(this).startOf(i).toDate()})}function W(){c(String.prototype,"capitalize",function(){return this.charAt(0).toUpperCase()+this.slice(1)}),c(String.prototype,"isNumber",function(){return!isNaN(Number(this))&&this.trim()!==""}),c(String.prototype,"isEmpty",function(){return this===void 0||!this||this.length===0}),c(String.prototype,"stripTags",function(){return new DOMParser().parseFromString(this.toString(),"text/html").body.textContent||""})}class G{resizeListener=null;onResizeCallbacks=new Set;emitTimeoutId=null;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.resizeListener=this.onResize,window.addEventListener("resize",this.resizeListener,{passive:!0}))}destroy(){typeof window<"u"&&this.resizeListener!==null&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.emitTimeoutId!==null&&(clearTimeout(this.emitTimeoutId),this.emitTimeoutId=null),this.onResizeCallbacks.clear()}onResizeChange(e){this.onResizeCallbacks.add(e)}offResizeChange(e){this.onResizeCallbacks.delete(e)}onResize=()=>{if(typeof window>"u")return;const e=window.innerWidth;this.emitTimeoutId!==null&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.emitTimeoutId=null;const t=h.getBreakpointByScreenWidth(e);for(const r of this.onResizeCallbacks)r(e,t)},this.duplicateThresholdMs)}}o.BreakPointHelper=h,o.BreakPoints=b,o.BrowserHelper=l,o.BrowserService=G,o.BrowserType=f,o.CanvasHelper=T,o.CsvHelper=B,o.DownloadHelper=O,o.EnumHelper=z,o.FileHelper=F,o.ImageHelper=M,o.LocalStorageHelper=w,o.LoggerHelper=u,o.LoggerType=m,o.ScreenHelper=v,o.TokenHelper=q,o.WindowResizeHelper=a,o.copyToClipboard=C,o.initArrayExtensions=V,o.initDateExtensions=$,o.initStringExtensions=W,o.sortHelper=A,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
|