PageSourceSearch

https://toolbo.pages.dev/assets/index-D9pFecqn.js

js toolbo.pages.dev collected 2026-10-03 05:58:43 UTC 65,331 bytes, 40 lines download raw bytes

1import{f as xe,u as Pe,m as Ie,j as t,L as je,B as be,E as De,c as pe,G as Oe,l as ke,i as Ce,k as Ke}from"./index-C0SOoweL.js";import{g as Be,c as Ge,r as F}from"./react-vendor-DbVP0aMU.js";import{J as Me}from"./zip-vendor-BauE-niW.js";import{f as ve,d as ze}from"./download-DFhLbSJS.js";import{U as Je}from"./upload-cloud-D625IgnK.js";import{R as Ue}from"./rotate-ccw-CgBd7Dcq.js";import{M as He}from"./move-Cay_IJsI.js";import{S as $e}from"./sliders-FfvVK-sg.js";import{M as We}from"./maximize-2-DgnXbNv0.js";import{D as Ze}from"./download-BBPfn1tx.js";import{C as qe}from"./chevron-down-j_V9jyXP.js";import{C as Xe}from"./check-Dr6CSq7z.js";import"./pdf-vendor-D7HrI6pR.js";/**
2 * @license lucide-react v0.344.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ve=xe("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]]);/**
7 * @license lucide-react v0.344.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ye=xe("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]]);/**
12 * @license lucide-react v0.344.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Qe=xe("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]);/**
17 * @license lucide-react v0.344.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const _e=xe("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
22 * @license lucide-react v0.344.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const et=xe("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);var Te={exports:{}};/* @license
27Papa Parse
28v5.7.0
29https://github.com/mholt/PapaParse
30License: MIT
31*/(function(p,T){((I,v)=>{p.exports=v()})(Ge,function I(){var v=typeof self<"u"?self:typeof window<"u"?window:v!==void 0?v:{},X=!v.document&&!!v.postMessage,$=v.IS_PAPA_WORKER||!1,W={},h=0,m={};function o(a){return a.charCodeAt(0)===65279?a.slice(1):a}function P(a){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(e){var r=V(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new ae(r),(this._handle.streamer=this)._config=r}).call(this,a),this.parseChunk=function(e,r){var u=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<u){let k=this._config.newline;k||(c=this._config.quoteChar||'"',k=this._handle.guessLineEndings(e,c)),e=[...e.split(k).slice(u)].join(k)}this.isFirstChunk&&L(this._config.beforeFirstChunk)&&(c=this._config.beforeFirstChunk(e))!==void 0&&(e=c),this.isFirstChunk=!1,this._halted=!1;var u=this._partialLine+e,c=(this._partialLine="",this._handle.parse(u,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=c.meta.cursor,u=(this._finished||(this._partialLine=u.substring(e-this._baseIndex),this._baseIndex=e),c&&c.data&&(this._rowCount+=c.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),$)v.postMessage({results:c,workerId:m.WORKER_ID,finished:u});else if(L(this._config.chunk)&&!r){if(this._config.chunk(c,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=c=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(c.data),this._completeResults.errors=this._completeResults.errors.concat(c.errors),this._completeResults.meta=c.meta),this._completed||!u||!L(this._config.complete)||c&&c.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||c&&c.meta.paused||this._nextChunk(),c}this._halted=!0},this._sendError=function(e){L(this._config.error)?this._config.error(e):$&&this._config.error&&v.postMessage({workerId:m.WORKER_ID,error:e,finished:!1})}}function _(a){var e;(a=a||{}).chunkSize||(a.chunkSize=m.RemoteChunkSize),P.call(this,a),this._nextChunk=X?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),X||(e.onload=Y(this._chunkLoaded,this),e.onerror=Y(this._chunkError,this)),e.ontimeout=Y(this._chunkTimeout,this),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!X),this._config.downloadTimeout&&!X&&(e.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var r,u=this._config.downloadRequestHeaders;for(r in u)e.setRequestHeader(r,u[r])}var c;this._config.chunkSize&&(c=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+c));try{e.send(this._config.downloadRequestBody)}catch(k){this._chunkError(k.message)}X&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function A(a){(a=a||{}).chunkSize||(a.chunkSize=m.LocalChunkSize),P.call(this,a);var e,r,u=typeof FileReader<"u";this.stream=function(c){this._input=c,r=c.slice||c.webkitSlice||c.mozSlice,u?((e=new FileReader).onload=Y(this._chunkLoaded,this),e.onerror=Y(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var c=this._input,k=(this._config.chunkSize&&(k=Math.min(this._start+this._config.chunkSize,this._input.size),c=r.call(c,this._start,k)),e.readAsText(c,this._config.encoding));u||this._chunkLoaded({target:{result:k}})},this._chunkLoaded=function(c){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(c.target.result)},this._chunkError=function(){this._sendError(e.error)}}function R(a){var e;P.call(this,a=a||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,u;if(!this._finished)return r=this._config.chunkSize,e=r?(u=e.substring(0,r),e.substring(r)):(u=e,""),this._finished=!e,this.parseChunk(u)}}function K(a){P.call(this,a=a||{});var e=[],r=!0,u=!1;this.pause=function(){P.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){P.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(c){this._input=c,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){u&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=Y(function(c){try{e.push(typeof c=="string"?c:c.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(k){this._streamError(k)}},this),this._streamError=Y(function(c){this._streamCleanUp(),this._sendError(c)},this),this._streamEnd=Y(function(){this._streamCleanUp(),u=!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 ae(a){var e,r,u,c,k=Math.pow(2,53),Z=-k,re=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,oe=/^((\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,Q=0,S=0,H=!1,w=!1,N=[],f={data:[],errors:[],meta:{}};function ee(n){return a.skipEmptyLines==="greedy"?n.join("").trim()==="":n.length===1&&n[0].length===0}function D(){if(f&&u&&(d("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+m.DefaultDelimiter+"'"),u=!1),a.skipEmptyLines&&(f.data=f.data.filter(function(l){return!ee(l)})),s()){let l=function(C){N.push(C)};if(f)if(Array.isArray(f.data[0])){for(var n=0;s()&&n<f.data.length;
vendor: 7,414 bytes, lines 31-38
31n++)f.data[n].forEach(l);f.data.splice(0,1)}else f.data.forEach(l)}function i(l,C){for(var M=a.header?{}:[],y=0;y<l.length;y++){var j=y,x=l[y],x=((G,b)=>(E=>(a.dynamicTypingFunction&&a.dynamicTyping[E]===void 0&&(a.dynamicTyping[E]=a.dynamicTypingFunction(E)),(a.dynamicTyping[E]||a.dynamicTyping)===!0))(G)?b==="true"||b==="TRUE"||b!=="false"&&b!=="FALSE"&&((E=>{if(re.test(E)&&(E=parseFloat(E),Z<E&&E<k))return 1})(b)?parseFloat(b):oe.test(b)?new Date(b):b===""?null:b):b)(j=a.header?y>=N.length?"__parsed_extra":N[y]:j,x=a.transform?a.transform(x,j):x);j==="__parsed_extra"?(M[j]=M[j]||[],M[j].push(x)):M[j]=x}return a.header&&(y>N.length?d("FieldMismatch","TooManyFields","Too many fields: expected "+N.length+" fields but parsed "+y,S+C):y<N.length&&d("FieldMismatch","TooFewFields","Too few fields: expected "+N.length+" fields but parsed "+y,S+C)),M}var g;f&&(a.header||a.dynamicTyping||a.transform)&&(g=1,!f.data.length||Array.isArray(f.data[0])?(f.data=f.data.map(i),g=f.data.length):f.data=i(f.data,0),a.header&&f.meta&&(f.meta.fields=N),S+=g)}function s(){return a.header&&N.length===0}function d(n,i,g,l){n={type:n,code:i,message:g},l!==void 0&&(n.row=l),f.errors.push(n)}L(a.step)&&(c=a.step,a.step=function(n){f=n,s()?D():(D(),f.data.length!==0&&(Q+=n.data.length,a.preview&&Q>a.preview?r.abort():(f.data=f.data[0],c(f,O))))}),this.parse=function(n,i,g){var l=a.quoteChar||'"',l=(a.newline||(a.newline=this.guessLineEndings(n,l)),u=!1,a.delimiter?L(a.delimiter)&&(a.delimiter=a.delimiter(n),f.meta.delimiter=a.delimiter):((l=((C,M,y,j,x)=>{var G,b,E,de;x=x||[",","	","|",";",m.RECORD_SEP,m.UNIT_SEP];for(var he=0;he<x.length;he++){for(var te,fe=x[he],U=0,se=0,B=0,q=(E=void 0,new ie({comments:j,delimiter:fe,newline:M,preview:10}).parse(C)),le=0;le<q.data.length;le++)y&&ee(q.data[le])?B++:(te=q.data[le].length,se+=te,E===void 0?E=te:0<te&&(U+=Math.abs(te-E),E=te));0<q.data.length&&(se/=q.data.length-B),1.99<se&&(b===void 0||U<b||U===b&&de<se)&&(b=U,G=fe,de=se)}return{successful:!!(a.delimiter=G),bestDelimiter:G}})(n,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=l.bestDelimiter:(u=!0,a.delimiter=m.DefaultDelimiter),f.meta.delimiter=a.delimiter),V(a));return l.header=s(),a.preview&&a.header&&l.preview++,e=n,r=new ie(l),f=r.parse(e,i,g),D(),H?{meta:{paused:!0}}:f||{meta:{paused:!1}}},this.paused=function(){return H},this.pause=function(){H=!0,r.abort(),e=L(a.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){O.streamer._halted?(H=!1,O.streamer.parseChunk(e,!0)):setTimeout(O.resume,3)},this.aborted=function(){return w},this.abort=function(){w=!0,r.abort(),f.meta.aborted=!0,L(a.complete)&&a.complete(f),e=""},this.guessLineEndings=function(C,l){C=C.substring(0,1048576);var l=new RegExp(z(l)+"([^]*?)"+z(l),"gm"),g=(C=C.replace(l,"")).split("\r"),l=C.split(`
32`),C=1<l.length&&l[0].length<g[0].length;if(g.length===1||C)return`
33`;for(var M=0,y=0;y<g.length;y++)g[y][0]===`
34`&&M++;return M>=g.length/2?`\r
35`:"\r"}}function z(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(a){var e=(a=a||{}).delimiter,r=a.newline,u=a.comments,c=a.step,k=a.preview,Z=a.fastMode,re=null,oe=!1,O=a.quoteChar==null?'"':a.quoteChar,Q=O;if(a.escapeChar!==void 0&&(Q=a.escapeChar),(typeof e!="string"||-1<m.BAD_DELIMITERS.indexOf(e))&&(e=","),u===e)throw new Error("Comment character same as delimiter");u===!0?u="#":(typeof u!="string"||-1<m.BAD_DELIMITERS.indexOf(u))&&(u=!1),r!==`
36`&&r!=="\r"&&r!==`\r
37`&&(r=`
38`);var S=0,H=!1;this.parse=function(w,N,f){if(typeof w!="string")throw new Error("Input must be a string");var ee=w.length,D=e.length,s=r.length,d=u.length,n=L(c),i=[],g=[],l=[],C=S=0;if(!w)return U();if(Z||Z!==!1&&w.indexOf(O)===-1){for(var M=w.split(r),y=0;y<M.length;y++){if(l=M[y],S+=l.length,y!==M.length-1)S+=r.length;else if(f)return U();if(!u||l.substring(0,d)!==u){if(n){if(i=[],de(l.split(e)),se(),H)return U()}else de(l.split(e));if(k&&k<=y)return i=i.slice(0,k),U(!0)}}return U()}for(var j=w.indexOf(e,S),x=w.indexOf(r,S),G=new RegExp(z(Q)+z(O),"g"),b=w.indexOf(O,S);;)if(w[S]===O)for(b=S,S++;;){if((b=w.indexOf(O,b+1))===-1)return f||g.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:i.length,index:S}),te();if(b===ee-1)return te(w.substring(S,b).replace(G,O));if(O===Q&&w[b+1]===Q)b++;else if(O===Q||b===0||w[b-1]!==Q){j!==-1&&j<b+1&&(j=w.indexOf(e,b+1));var E=he((x=x!==-1&&x<b+1?w.indexOf(r,b+1):x)===-1?j:Math.min(j,x));if(w.substr(b+1+E,D)===e){l.push(w.substring(S,b).replace(G,O)),w[S=b+1+E+D]!==O&&(b=w.indexOf(O,S)),j=w.indexOf(e,S),x=w.indexOf(r,S);break}if(E=he(x),w.substring(b+1+E,b+1+E+s)===r){if(l.push(w.substring(S,b).replace(G,O)),fe(b+1+E+s),j=w.indexOf(e,S),b=w.indexOf(O,S),n&&(se(),H))return U();if(k&&i.length>=k)return U(!0);break}g.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:i.length,index:S}),b++}}else if(u&&l.length===0&&w.substring(S,S+d)===u){if(x===-1)return U();S=x+s,x=w.indexOf(r,S),j=w.indexOf(e,S)}else if(j!==-1&&(j<x||x===-1))l.push(w.substring(S,j)),S=j+D,j=w.indexOf(e,S);else{if(x===-1)break;if(l.push(w.substring(S,x)),fe(x+s),n&&(se(),H))return U();if(k&&i.length>=k)return U(!0)}return te();function de(B){i.push(B),C=S}function he(B){var q=0;return q=B!==-1&&(B=w.substring(b+1,B))&&B.trim()===""?B.length:q}function te(B){return f||(B===void 0&&(B=w.substring(S)),l.push(B),S=ee,de(l),n&&se()),U()}function fe(B){S=B,de(l),l=[],x=w.indexOf(r,S)}function U(B){if(a.header&&!N&&i.length&&!oe){var q=i[0],le=Object.create(null),ge=new Set(q);let Se=!1;for(let me=0;me<q.length;me++){let ce=o(q[me]);if(le[ce=L(a.transformHeader)?a.transformHeader(ce,me):ce]){let ye,Ne=le[ce];for(;ye=ce+"_"+Ne,Ne++,ge.has(ye););ge.add(ye),q[me]=ye,le[ce]++,Se=!0,(re=re===null?{}:re)[ye]=ce}else le[ce]=1,q[me]=ce;ge.add(ce)}Se&&console.warn("Duplicate headers found and renamed."),oe=!0}return{data:i,errors:g,meta:{delimiter:e,linebreak:r,aborted:H,truncated:!!B,cursor:C+(N||0),renamedHeaders:re}}}function se(){c(U()),i=[],g=[]}},this.abort=function(){H=!0},this.getCharIndex=function(){return S}}function J(a){var e=a.data,r=W[e.workerId],u=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var c={abort:function(){u=!0,ne(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:ue,resume:ue};if(L(r.userStep)){for(var k=0;k<e.results.data.length&&(r.userStep({data:e.results.data[k],errors:e.results.errors,meta:e.results.meta},c),!u);k++);delete e.results}else L(r.userChunk)&&(r.userChunk(e.results,c,e.file),delete e.results)}e.finished&&!u&&ne(e.workerId,e.results)}function ne(a,e){var r=W[a];L(r.userComplete)&&r.userComplete(e),r.terminate(),delete W[a]}function ue(){throw new Error("Not implemented.")}function V(a){if(typeof a!="object"||a===null)return a;var e,r=Array.isArray(a)?[]:{};for(e in a)r[e]=V(a[e]);return r}function Y(a,e){return function(){a.apply(e,arguments)}}function L(a){return typeof a=="function"}return m.parse=function(a,e){var r=(e=e||{}).dynamicTyping||!1;if(L(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=!!L(e.transform)&&e.transform,e.downloadTimeout!==void 0){var r=parseInt(e.downloadTimeout);if(isNaN(r))throw new Error("Config downloadTimeout value ("+e.downloadTimeout+") not parsable by parseInt(val).");e.downloadTimeout=r}if(!e.worker||!m.WORKERS_SUPPORTED)return r=null,m.NODE_STREAM_INPUT,typeof a=="str
38ing"?(a=o(a),r=new(e.download?_:R)(e)):a.readable===!0&&L(a.read)&&L(a.on)?r=new K(e):(v.File&&a instanceof File||a instanceof Object)&&(r=new A(e)),r.stream(a);(r=(()=>{var u;return!!m.WORKERS_SUPPORTED&&(u=(()=>{var c=v.URL||v.webkitURL||null,k=I.toString();return m.BLOB_URL||(m.BLOB_URL=c.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; ","(",k,")();"],{type:"text/javascript"})))})(),(u=new v.Worker(u)).onmessage=J,u.id=h++,W[u.id]=u)})()).userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=L(e.step),e.chunk=L(e.chunk),e.complete=L(e.complete),e.error=L(e.error),delete e.worker,r.postMessage({input:a,config:e,workerId:r.id})},m.unparse=function(a,e){var r=!1,u=!0,c=",",k=`\r
39`,Z='"',re=Z+Z,oe=!1,O=null,Q=!1,S=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||m.BAD_DELIMITERS.filter(function(N){return e.delimiter.indexOf(N)!==-1}).length||(c=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(r=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(oe=e.skipEmptyLines),typeof e.newline=="string"&&(k=e.newline),typeof e.quoteChar=="string"&&(Z=e.quoteChar,re=Z+Z),typeof e.header=="boolean"&&(u=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");O=e.columns}e.escapeChar!==void 0&&(re=e.escapeChar+Z),e.escapeFormulae instanceof RegExp?Q=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(Q=/^[=+\-@\t\r].*$/)}})(),new RegExp(z(Z),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return H(null,a,oe);if(typeof a[0]=="object")return H(O||Object.keys(a[0]),a,oe)}else if(typeof a=="object")return typeof a.data=="string"&&(a.data=JSON.parse(a.data)),Array.isArray(a.data)&&(a.fields||(a.fields=a.meta&&a.meta.fields||O),a.fields||(a.fields=Array.isArray(a.data[0])?a.fields:typeof a.data[0]=="object"?Object.keys(a.data[0]):[]),Array.isArray(a.data[0])||typeof a.data[0]=="object"||(a.data=[a.data])),H(a.fields||[],a.data||[],oe);throw new Error("Unable to serialize unrecognized input");function H(N,f,ee){var D="",s=(typeof N=="string"&&(N=JSON.parse(N)),typeof f=="string"&&(f=JSON.parse(f)),Array.isArray(N)&&0<N.length),d=!Array.isArray(f[0]);if(s&&u){for(var n=0;n<N.length;n++)0<n&&(D+=c),D+=w(N[n],n);0<f.length&&(D+=k)}for(var i=0;i<f.length;i++){var g=(s?N:f[i]).length,l=!1,C=s?Object.keys(f[i]).length===0:f[i].length===0;if(ee&&!s&&(l=ee==="greedy"?f[i].join("").trim()==="":f[i].length===1&&f[i][0].length===0),ee==="greedy"&&s){for(var M=[],y=0;y<g;y++){var j=d?N[y]:y;M.push(f[i][j])}l=M.join("").trim()===""}if(!l){for(var x=0;x<g;x++){0<x&&!C&&(D+=c);var G=s&&d?N[x]:x;D+=w(f[i][G],x)}i<f.length-1&&(!ee||0<g&&!C)&&(D+=k)}}return D}function w(N,f){var ee,D,s;return N==null?"":N.constructor===Date?isNaN(N.getTime())?"":N.toISOString():(s=!1,Q&&typeof N=="string"&&Q.test(N)&&(N="'"+N,s=!0),D=(ee=N.toString()).replace(S,re),(s=s||r===!0||typeof r=="function"&&r(N,f)||Array.isArray(r)&&r[f]||((d,n)=>{for(var i=0;i<n.length;i++)if(-1<d.indexOf(n[i]))return!0;return!1})(D,m.BAD_DELIMITERS)||-1<D.indexOf(c)||-1<ee.indexOf(Z)||D.charAt(0)===" "||D.charAt(D.length-1)===" ")?Z+D+Z:D)}},m.RECORD_SEP="�",m.UNIT_SEP="�",m.BYTE_ORDER_MARK="\uFEFF",m.BAD_DELIMITERS=["\r",`
40`,'"',m.BYTE_ORDER_MARK],m.WORKERS_SUPPORTED=!X&&!!v.Worker,m.NODE_STREAM_INPUT=1,m.LocalChunkSize=10485760,m.RemoteChunkSize=5242880,m.DefaultDelimiter=",",m.Parser=ie,m.ParserHandle=ae,m.NetworkStreamer=_,m.FileStreamer=A,m.StringStreamer=R,m.ReadableStreamStreamer=K,$&&(v.onmessage=function(a){a=a.data,m.WORKER_ID===void 0&&a&&(m.WORKER_ID=a.workerId),typeof a.input=="string"?v.postMessage({workerId:m.WORKER_ID,results:m.parse(a.input,a.config),finished:!0}):(v.File&&a.input instanceof File||a.input instanceof Object)&&(a=m.parse(a.input,a.config))&&v.postMessage({workerId:m.WORKER_ID,results:a,finished:!0})}),(_.prototype=Object.create(P.prototype)).constructor=_,(A.prototype=Object.create(P.prototype)).constructor=A,(R.prototype=Object.create(R.prototype)).constructor=R,(K.prototype=Object.create(P.prototype)).constructor=K,m})})(Te);var tt=Te.exports;const at=Be(tt),we=[{name:"Cairo",value:"Cairo, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Amiri",value:"Amiri, Georgia, serif",category:"Arabic",scripts:["arabic"]},{name:"Tajawal",value:"Tajawal, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Almarai",value:"Almarai, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"IBM Plex Sans Arabic",value:'"IBM Plex Sans Arabic", system-ui, sans-serif',category:"Arabic",scripts:["arabic"]},{name:"Readex Pro",value:'"Readex Pro", system-ui, sans-serif',category:"Arabic",scripts:["arabic"]},{name:"Noto Sans Arabic",value:'"Noto Sans Arabic", system-ui, sans-serif',category:"Arabic",scripts:["arabic"]}
40,{name:"Noto Naskh Arabic",value:'"Noto Naskh Arabic", Georgia, serif',category:"Arabic",scripts:["arabic"]},{name:"Noto Kufi Arabic",value:'"Noto Kufi Arabic", system-ui, sans-serif',category:"Arabic",scripts:["arabic"]},{name:"Alexandria",value:"Alexandria, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Changa",value:"Changa, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Lalezar",value:"Lalezar, cursive, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Marhey",value:"Marhey, cursive, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Rakkas",value:"Rakkas, cursive, serif",category:"Arabic",scripts:["arabic"]},{name:"Reem Kufi",value:'"Reem Kufi", system-ui, sans-serif',category:"Arabic",scripts:["arabic"]},{name:"Lemonada",value:"Lemonada, cursive, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"El Messiri",value:'"El Messiri", cursive, sans-serif',category:"Arabic",scripts:["arabic"]},{name:"Mada",value:"Mada, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Scheherazade New",value:'"Scheherazade New", serif',category:"Arabic",scripts:["arabic"]},{name:"Qahiri",value:"Qahiri, cursive, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Aref Ruqaa",value:'"Aref Ruqaa", serif',category:"Arabic",scripts:["arabic"]},{name:"Markazi Text",value:'"Markazi Text", serif',category:"Arabic",scripts:["arabic"]},{name:"Vibes",value:"Vibes, cursive, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Kufam",value:"Kufam, system-ui, sans-serif",category:"Arabic",scripts:["arabic"]},{name:"Katibeh",value:"Katibeh, cursive, serif",category:"Arabic",scripts:["arabic"]},{name:"Inter",value:"Inter, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Roboto",value:"Roboto, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Montserrat",value:"Montserrat, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Open Sans",value:'"Open Sans", system-ui, sans-serif',category:"Latin",scripts:["latin"]},{name:"Poppins",value:"Poppins, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Playfair Display",value:'"Playfair Display", Georgia, serif',category:"Latin",scripts:["latin"]},{name:"Oswald",value:"Oswald, Impact, sans-serif",category:"Latin",scripts:["latin"]},{name:"Merriweather",value:"Merriweather, Georgia, serif",category:"Latin",scripts:["latin"]},{name:"Lato",value:"Lato, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Raleway",value:"Raleway, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Nunito",value:"Nunito, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Rubik",value:"Rubik, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Bebas Neue",value:'"Bebas Neue", Impact, sans-serif',category:"Latin",scripts:["latin"]},{name:"Cinzel",value:"Cinzel, Georgia, serif",category:"Latin",scripts:["latin"]},{name:"Dancing Script",value:'"Dancing Script", cursive',category:"Latin",scripts:["latin"]},{name:"Pacifico",value:"Pacifico, cursive",category:"Latin",scripts:["latin"]},{name:"Caveat",value:"Caveat, cursive",category:"Latin",scripts:["latin"]},{name:"Righteous",value:"Righteous, cursive, sans-serif",category:"Latin",scripts:["latin"]},{name:"Comfortaa",value:"Comfortaa, cursive, sans-serif",category:"Latin",scripts:["latin"]},{name:"Fira Sans",value:'"Fira Sans", system-ui, sans-serif',category:"Latin",scripts:["latin"]},{name:"Ubuntu",value:"Ubuntu, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Syne",value:"Syne, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Space Grotesk",value:'"Space Grotesk", monospace, sans-serif',category:"Latin",scripts:["latin"]},{name:"Lobster",value:"Lobster, cursive",category:"Latin",scripts:["latin"]},{name:"Outfit",value:"Outfit, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"DM Sans",value:'"DM Sans", system-ui, sans-serif',category:"Latin",scripts:["latin"]},{name:"Plus Jakarta Sans",value:'"Plus Jakarta Sans", system-ui, sans-serif',category:"Latin",scripts:["latin"]},{name:"Work Sans",value:'"Work Sans", system-ui, sans-serif',category:"Latin",scripts:["latin"]},{name:"Quicksand",value:"Quicksand, system-ui, sans-serif",category:"Latin",scripts:["latin"]},{name:"Archivo Black",value:'"Archivo Black", sans-serif',category:"Latin",scripts:["latin"]},{name:"Abril Fatface",value:'"Abril Fatface", serif',category:"Latin",scripts:["latin"]},{name:"Anton",value:"Anton, sans-serif",category:"Latin",scripts:["latin"]},{name:"Cormorant Garamond",value:'"Cormorant Garamond", serif',category:"Latin",scripts:["latin"]},{name:"Arial",value:'Arial, "Helvetica Neue", Helvetica, sans-serif',category:"System",scripts:["latin"]},{name:"Georgia",value:'Georgia, Times, "Times New Roman", serif',category:"System",scripts:["latin"]},{name:"Times New Roman",value:'"Times New Roman", Times, serif',category:"System",scripts:["latin"]},{name:"Courier New",value:'"Courier New", Courier, monospace',category:"System",scripts:["latin"]},{name:"Impact",value:'Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif',category:"System",scripts:["latin"]},{name:"Verdana",value:"Verdana, Geneva, sans-serif",category:"System",scripts:["latin"]},{name:"Roboto (Cyrillic)",value:"Roboto, system-ui, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Inter (Cyrillic)",value:"Inter, system-ui, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Montserrat (Cyrillic)",value:"Montserrat, system-ui, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Open Sans (Cyrillic)",value:'"Open Sans", system-ui, sans-serif',category:"Latin",scripts:["cyrillic"]},{name:"Playfair Display (Cyrillic)",value:'"Playfair Display", Georgia, serif',category:"Latin",scripts:["cyrillic"]},{name:"Merriweather (Cyrillic)",value:"Merriweather, Georgia, serif",category:"Latin",scripts:["cyrillic"]},{name:"Oswald (Cyrillic)",value:"Oswald, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Nunito (Cyrillic)",value:"Nunito, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Rubik (Cyrillic)",value:"Rubik, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"Fira Sans (Cyrillic)",value:'"Fira Sans", sans-serif',category:"Latin",scripts:["cyrillic"]},{name:"Ubuntu (Cyrillic)",value:"Ubuntu, sans-serif",category:"Latin",scripts:["cyrillic"]},{name:"PT Sans",value:'"PT Sans", sans-serif',category:"Latin",scripts:["cyrillic"]},{name:"PT Serif",value:'"PT Serif", serif',category:"Latin",scripts:["cyrillic"]},{name:"Comfortaa (Cyrillic)",value:"Comfortaa, cursive",category:"Latin",scripts:["cyrillic"]},{name:"Caveat (Cyrillic)",value:"Caveat, cursive",category:"Latin",scripts:["cyrillic"]},{name:"Ruslan Display",value:'"Ruslan Display", cursive',category:"Latin",scripts:["cyrillic"]},{name:"Noto Sans SC (简体中文)",value:'"Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',category:"CJK",scripts:["chinese"]},{name:"Noto Serif SC (宋体)",value:'"Noto Serif SC", "Songti SC", "SimSun", serif',category:"CJK",scripts:["chinese"]},{name:"Noto Sans TC (繁體中文)",value:'"Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif',category:"CJK",scripts:["chinese"]},{name:"Noto Serif TC (明體)",value:'"Noto Serif TC", "Songti TC", serif',category:"CJK",scripts:["chinese"]},{name:"Ma Shan Zheng (楷书)",value:'"Ma Shan Zheng", cursive, serif',category:"CJK",scripts:["chinese"]},{name:"ZCOOL XiaoWei (小薇)",value:'"ZCOOL XiaoWei", serif',category:"CJK",scripts:["chinese"]},{name:"ZCOOL QingKe HuangYou (黄油)",value:'"ZCOOL QingKe HuangYou", cursive, sans-serif',category:"CJK",scripts:["chinese"]},{name:"Long Cang (草书)",value:'"Long Cang", cursive',category:"CJK",scripts:["chinese"]},{name:"Zhi Mang Xing (行书)",value:'"Zhi Mang Xing", cursive',category:"CJK",scripts:["chinese"]},{name:"Noto Sans JP (ゴシック)",value:'"Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif',category:"CJK",scripts:["japanese"]},{name:"Noto Serif JP (明朝)",value:'"Noto Serif JP", "Hiragino Mincho ProN", serif',category:"CJK",scripts:["japanese"]},{name:"M PLUS 1p",value:'"M PLUS 1p", sans-serif',category:"CJK",scripts:["japanese"]},{name:"M PLUS Rounded 1c",value:'"M PLUS Rounded 1c", sans-serif',category:"CJK",scripts:["japanese"]},{name:"Sawarabi Mincho",value:'"Sawarabi Mincho", serif',category:"CJK",scripts:["japanese"]},{name:"Sawarabi Gothic",value:'"Sawarabi Gothic", sans-serif',category:"CJK",scripts:["japanese"]},{name:"Kosugi Maru",value:'"Kosugi Maru", sans-serif',category:"CJK",scripts:["japanese"]},{name:"Kaisei Tokumin",value:'"Kaisei Tokumin", serif',category:"CJK",scripts:["japanese"]},{name:"Shippori Mincho",value:'"Shippori Mincho", serif',category:"CJK",scripts:["japanese"]},{name:"Hachi Maru Pop",value:'"Hachi Maru Pop", cursive',category:"CJK",scripts:["japanese"]},{name:"Zen Kaku Gothic New",value:'"Zen Kaku Gothic New", sans-serif',category:"CJK",scripts:["japanese"]},{name:"Yuji Boku",value:'"Yuji Boku", cursive, serif',category:"CJK",scripts:["japanese"]},{name:"Noto Sans KR (고딕)",value:'"Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif',category:"CJK",scripts:["korean"]},{name:"Noto Serif KR (명조)",value:'"Noto Serif KR", "Batang", serif',category:"CJK",scripts:["korean"]},{name:"Nanum Gothic",value:'"Nanum Gothic", sans-serif',category:"CJK",scripts:["korean"]},{name:"Nanum Myeongjo",value:'"Nanum Myeongjo", serif',category:"CJK",scripts:["korean"]},{name:"Nanum Pen Script",value:'"Nanum Pen Script", cursive',category:"CJK",scripts:["korean"]},{name:"Black Han Sans",value:'"Black Han Sans", sans-serif',category:"CJK",scripts:["korean"]},{name:"Do Hyeon",value:'"Do Hyeon", sans-serif',category:"CJK",scripts:["korean"]},{name:"Jua",value:"Jua, cursive, sans-serif",category:"CJK",scripts:["korean"]},{name:"Song Myung",value:'"Song Myung", serif',category:"CJK",scripts:["korean"]},{name:"Gowun Dodum",value:'"Gowun Dodum", sans-serif',category:"CJK",scripts:["korean"]},{name:"Gowun Batang",value:'"Gowun Batang", serif',category:"CJK",scripts:["korean"]},{name:"Sunflower",value:"Sunflower, sans-serif",category:"CJK",scripts:["korean"]},{name:"Noto Sans Devanagari",value:'"Noto Sans Devanagari", sans-serif',category:"Indic",scripts:["indic"]},{name:"Noto Serif Devanagari",value:'"Noto Serif Devanagari", serif',category:"Indic",scripts:["indic"]},{name:"Hind Siliguri",value:'"Hind Siliguri", "Noto Sans Bengali", sans-serif',category:"Indic",scripts:["indic"]},{name:"Noto Sans Bengali",value:'"Noto Sans Bengali", sans-serif',category:"Indic",scripts:["indic"]}
40,{name:"Kalam",value:"Kalam, cursive",category:"Indic",scripts:["indic"]},{name:"Rozha One",value:'"Rozha One", serif',category:"Indic",scripts:["indic"]},{name:"Rajdhani",value:"Rajdhani, sans-serif",category:"Indic",scripts:["indic"]},{name:"Mukta",value:"Mukta, sans-serif",category:"Indic",scripts:["indic"]},{name:"Tiro Devanagari Hindi",value:'"Tiro Devanagari Hindi", serif',category:"Indic",scripts:["indic"]},{name:"Noto Sans Tamil",value:'"Noto Sans Tamil", sans-serif',category:"Indic",scripts:["indic"]},{name:"Noto Sans Telugu",value:'"Noto Sans Telugu", sans-serif',category:"Indic",scripts:["indic"]},{name:"Noto Sans Gujarati",value:'"Noto Sans Gujarati", sans-serif',category:"Indic",scripts:["indic"]}];function st(p){return!p||p.trim().length===0?"unknown":/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(p)?"arabic":/[\u3040-\u309F\u30A0-\u30FF]/.test(p)?"japanese":/[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F]/.test(p)?"korean":/[\u4E00-\u9FFF\u3400-\u4DBF]/.test(p)?"chinese":/[\u0900-\u097F\u0980-\u09FF\u0A00-\u0DFF]/.test(p)?"indic":/[\u0400-\u04FF\u0500-\u052F]/.test(p)?"cyrillic":/[a-zA-Z\u00C0-\u024F]/.test(p)?"latin":"unknown"}function rt(p){switch(p){case"arabic":return"Arabic Fonts";case"latin":return"Latin Fonts";case"cyrillic":return"Cyrillic Fonts";case"chinese":return"Chinese Fonts";case"japanese":return"Japanese Fonts";case"korean":return"Korean Fonts";case"indic":return"Indic Fonts";default:return"Fonts"}}function Re(p,T){return T==="arabic"&&p.scripts.includes("arabic")?"أ ب ت ث ج ح خ د":T==="cyrillic"&&p.scripts.includes("cyrillic")?"Аа Бб Вв Гг Дд":T==="chinese"&&p.scripts.includes("chinese")?"永 汉字 天地玄黄":T==="japanese"&&p.scripts.includes("japanese")?"あいうえおかき":T==="korean"&&p.scripts.includes("korean")?"가나다라마바사":T==="indic"&&p.scripts.includes("indic")?p.name.includes("Bengali")||p.name.includes("Siliguri")?"অ আ ই ক খ গ":p.name.includes("Tamil")?"அ ஆ இ ஈ உ ஊ":p.name.includes("Telugu")?"అ ఆ ఇ ఈ ఉ ఊ":p.name.includes("Gujarati")?"અ આ ઇ ઈ ઉ ઊ":"अ आ इ क ख ग":T==="latin"&&p.scripts.includes("latin")?"Aa Bb Cc Dd Ee":p.scripts.includes("arabic")?"أ ب ت ث ج ح خ د":p.scripts.includes("cyrillic")?"Аа Бб Вв Гг Дд":p.scripts.includes("chinese")?"永 汉字 天地玄黄":p.scripts.includes("japanese")?"あいうえおかき":p.scripts.includes("korean")?"가나다라마바사":p.scripts.includes("indic")?"अ आ इ क ख ग":"Aa Bb Cc Dd Ee"}function it(p){return p==="unknown"?[]:we.filter(T=>T.scripts.includes(p))}const nt=["https://fonts.googleapis.com/css2?family=Alexandria:wght@400;600;700;800&family=Almarai:wght@400;700;800&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Aref+Ruqaa:wght@400;700&family=Cairo:wght@400;600;700;800;900&family=Changa:wght@400;600;700;800&family=El+Messiri:wght@400;600;700&family=IBM+Plex+Sans+Arabic:wght@400;600;700&display=swap","https://fonts.googleapis.com/css2?family=Katibeh&family=Kufam:ital,wght@0,400;0,700;1,400&family=Lalezar&family=Lemonada:wght@400;600;700&family=Mada:wght@400;600;700&family=Marhey:wght@400;700&family=Markazi+Text:wght@400;600;700&family=Noto+Kufi+Arabic:wght@400;700;800&family=Noto+Naskh+Arabic:wght@400;700&family=Noto+Sans+Arabic:wght@400;600;700;800&family=Qahiri&family=Rakkas&family=Readex+Pro:wght@400;600;700&family=Reem+Kufi:wght@400;700&family=Scheherazade+New:wght@400;700&family=Tajawal:wght@400;500;700;800&family=Vibes&display=swap","https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Anton&family=Archivo+Black&family=Bebas+Neue&family=Caveat:wght@400;700&family=Cinzel:wght@400;700&family=Comfortaa:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,700;1,400&family=Dancing+Script:wght@400;700&family=DM+Sans:ital,wght@0,400;0,700;1,400&family=Fira+Sans:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;600;700;800&family=Lato:ital,wght@0,400;0,700;1,400&family=Lobster&family=Merriweather:ital,wght@0,400;0,700;1,400&family=Montserrat:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap","https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,700;1,400&family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&family=Oswald:wght@400;600;700&family=Outfit:wght@400;600;700&family=Pacifico&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:ital,wght@0,400;0,700;1,400&family=Poppins:ital,wght@0,400;0,600;0,700;1,400&family=PT+Sans:ital,wght@0,400;0,700;1,400&family=PT+Serif:ital,wght@0,400;0,700;1,400&family=Quicksand:wght@400;600;700&family=Raleway:ital,wght@0,400;0,700;1,400&family=Righteous&family=Roboto:ital,wght@0,400;0,500;0,700;1,400&family=Rubik:ital,wght@0,400;0,700;1,400&family=Ruslan+Display&family=Space+Grotesk:wght@400;600;700&family=Syne:wght@400;700;
40800&family=Ubuntu:ital,wght@0,400;0,700;1,400&family=Work+Sans:ital,wght@0,400;0,700;1,400&display=swap","https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Do+Hyeon&family=Gowun+Batang:wght@400;700&family=Gowun+Dodum&family=Hachi+Maru+Pop&family=Hind+Siliguri:wght@400;600;700&family=Jua&family=Kaisei+Tokumin:wght@400;700&family=Kalam:wght@400;700&family=Kosugi+Maru&family=Long+Cang&family=M+PLUS+1p:wght@400;700&family=M+PLUS+Rounded+1c:wght@400;700&family=Ma+Shan+Zheng&family=Mukta:wght@400;700&family=Nanum+Gothic:wght@400;700&family=Nanum+Myeongjo:wght@400;700&family=Nanum+Pen+Script&family=Noto+Sans+Bengali:wght@400;700&family=Noto+Sans+Devanagari:wght@400;700&family=Noto+Sans+Gujarati:wght@400;700&family=Noto+Sans+JP:wght@400;700&family=Noto+Sans+KR:wght@400;700&family=Noto+Sans+SC:wght@400;700&family=Noto+Sans+Tamil:wght@400;700&family=Noto+Sans+TC:wght@400;700&family=Noto+Sans+Telugu:wght@400;700&family=Noto+Serif+Devanagari:wght@400;700&family=Noto+Serif+JP:wght@400;700&family=Noto+Serif+KR:wght@400;700&family=Noto+Serif+SC:wght@400;700&family=Noto+Serif+TC:wght@400;700&family=Rajdhani:wght@400;600;700&family=Rozha+One&family=Sawarabi+Gothic&family=Sawarabi+Mincho&family=Shippori+Mincho:wght@400;700&family=Song+Myung&family=Sunflower:wght@300;500;700&family=Tiro+Devanagari+Hindi&family=Yuji+Boku&family=ZCOOL+QingKe+HuangYou&family=ZCOOL+XiaoWei&family=Zen+Kaku+Gothic+New:wght@400;700&family=Zhi+Mang+Xing&display=swap"];let Ee=!1;function Fe(){typeof document>"u"||Ee||(nt.forEach((p,T)=>{const I=`toolbo-bulk-fonts-${T}`;if(!document.getElementById(I)){const v=document.createElement("link");v.id=I,v.rel="stylesheet",v.href=p,document.head.appendChild(v)}}),Ee=!0)}async function Le(p,T=48,I="Test 123"){if(Fe(),!(typeof document>"u"||!("fonts"in document)))try{const v=`${T}px ${p}`;await document.fonts.load(v,I),await document.fonts.ready}catch{}}function Ae(p){return/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(p)}function ot(p,T){const I=p.trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/\s+/g,"_").slice(0,50);return I.length>0?I:`image_${T+1}`}async function lt(p){const T=await Me.loadAsync(p),I=new DOMParser,v=[],X=T.file("xl/sharedStrings.xml")||T.file("xl/SharedStrings.xml");
40if(X){const _=await X.async("text"),R=I.parseFromString(_,"application/xml").getElementsByTagName("si");for(let K=0;K<R.length;K++){const ae=R[K];let z="";const ie=ae.getElementsByTagName("t");for(let J=0;J<ie.length;J++)z+=ie[J].textContent||"";v.push(z)}}const $=T.file("xl/worksheets/sheet1.xml")||T.file("xl/worksheets/Sheet1.xml")||T.file(/^xl\/worksheets\/sheet.*\.xml$/i)[0];if(!$)throw new Error("No worksheet found in Excel file.");const W=await $.async("text"),m=I.parseFromString(W,"application/xml").getElementsByTagName("row"),o=[],P=_=>{let A=0;for(let R=0;R<_.length;R++)A=A*26+(_.charCodeAt(R)-64);return A-1};for(let _=0;_<m.length;_++){const R=m[_].getElementsByTagName("c"),K=[];for(let ae=0;ae<R.length;ae++){const z=R[ae],ie=z.getAttribute("r")||"",J=z.getAttribute("t"),ne=z.getElementsByTagName("v")[0],ue=z.getElementsByTagName("is")[0];let V="";if(J==="s"&&ne){const L=parseInt(ne.textContent||"-1",10);V=v[L]||""}else J==="inlineStr"&&ue?V=ue.textContent||"":ne&&(V=ne.textContent||"");const Y=ie.match(/^([A-Z]+)(\d+)$/);if(Y){const L=P(Y[1]);for(;K.length<L;)K.push("");K[L]=V}else K.push(V)}K.some(ae=>ae&&ae.trim().length>0)&&o.push(K)}return o}function ct({selectedFontValue:p,onSelectFont:T,previewText:I}){const[v,X]=F.useState(!1),$=F.useRef(null),W=F.useMemo(()=>st(I),[I]),h=F.useMemo(()=>it(W),[W]),m=h.length>0,o=F.useMemo(()=>m?h.find(R=>R.value===p)||h[0]:we.find(A=>A.value===p)||we[0],[p,h,m]);F.useEffect(()=>{m&&!h.some(A=>A.value===p)&&T(h[0])},[m,h,p,T]);const P=F.useMemo(()=>Re(o,W),[o,W]),_=F.useMemo(()=>rt(W),[W]);return F.useEffect(()=>{const A=R=>{$.current&&!$.current.contains(R.target)&&X(!1)};return v&&document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[v]),t.jsxs("div",{className:"relative",ref:$,children:[t.jsxs("button",{type:"button",onClick:()=>X(A=>!A),className:"flex h-11 w-full items-center justify-between gap-2 rounded-xl border border-border bg-secondary/30 px-3 text-left text-sm font-medium text-foreground outline-none transition-colors hover:bg-secondary/50 focus:border-primary focus:ring-2 focus:ring-primary/20","aria-haspopup":"listbox","aria-expanded":v,children:[m?t.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[t.jsx("span",{className:"font-semibold text-foreground truncate shrink-0",children:o.name}),t.jsx("span",{style:{fontFamily:o.value},className:"truncate text-xs text-muted-foreground font-normal px-2 py-0.5 rounded-md bg-secondary/70 border border-border/50",dir:"auto",children:P})]}):t.jsx("span",{className:"text-muted-foreground text-xs italic",children:"Enter preview text to view fonts"}),t.jsx(qe,{className:pe("h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-150",v&&"rotate-180")})]}),v&&t.jsx("div",{className:"absolute left-0 top-full z-50 mt-1.5 max-h-72 w-full overflow-y-auto rounded-xl border border-border bg-card p-1.5 shadow-xl backdrop-blur-md",children:m?t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1 text-[11px] font-semibold uppercase tracking-wider text-primary",children:[t.jsx("span",{children:_}),t.jsxs("span",{className:"text-[10px] lowercase text-muted-foreground font-normal",children:["(",h.length," fonts)"]})]}),t.jsx("div",{className:"space-y-0.5 mt-0.5",children:h.map(A=>{const R=A.value===o.value,K=Re(A,W);return t.jsxs("button",{type:"button",onClick:()=>{T(A),X(!1)},className:pe("flex w-full items-center justify-between gap-2.5 rounded-lg px-2.5 py-2 text-left text-sm transition-colors",R?"bg-primary/10 font-semibold text-primary":"text-foreground hover:bg-secondary/70"),children:[t.jsx("span",{className:"font-medium shrink-0",children:A.name}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 ms-auto",children:[t.jsx("span",{style:{fontFamily:A.value},className:pe("text-sm tracking-wide truncate max-w-[130px] sm:max-w-[170px]",R?"text-primary":"text-muted-foreground"),dir:"auto",children:K}),R&&t.jsx(Xe,{className:"h-4 w-4 shrink-0 text-primary"})]})]},`font-${A.name}`)})})]}):t.jsxs("div",{className:"p-4 text-center",children:[t.jsx("p",{className:"text-xs font-medium text-foreground",children:"No fonts currently available"}),t.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground leading-relaxed",children:'Please type text in the "Sample Preview Text" field above to preview matching fonts.'})]})})]})}function Nt(p){const{t:T}=Pe(),{toast:I}=Ie();F.useEffect(()=>{Fe()},[]);const[v,X]=F.useState(null),[$,W]=F.useState(null),[h,m]=F.useState(null),[o,P]=F.useState({fontFamily:"Cairo, system-ui, sans-serif",fontSize:64,color:"#1e293b",align:"center",bold:!0,italic:!1,xPercent:50,yPercent:50,previewSample:"Sample"}),[_,A]=F.useState(null),[R,K]=F.useState(""),[ae,z]=F.useState(!1),[ie,J]=F.useState(null),[ne,ue]=F.useState(!1),[V,Y]=F.useState({current:0,total:0}),[L,a]=F.useState(null),e=F.useRef(null),r=F.useRef(!1),u=F.useCallback((s,d)=>{const n=e.current;if(!n)return;const i=n.getBoundingClientRect();if(i.width===0||i.height===0)return;
40const g=s-i.left,l=d-i.top,C=Math.max(0,Math.min(100,g/i.width*100)),M=Math.max(0,Math.min(100,l/i.height*100));P(y=>({...y,xPercent:Math.round(C*10)/10,yPercent:Math.round(M*10)/10}))},[]),c=s=>{s.preventDefault(),r.current=!0,u(s.clientX,s.clientY)},k=s=>{r.current&&(s.preventDefault(),u(s.clientX,s.clientY))},Z=()=>{r.current=!1},re=s=>{s.touches.length>0&&(r.current=!0,u(s.touches[0].clientX,s.touches[0].clientY))},oe=s=>{!r.current||s.touches.length===0||u(s.touches[0].clientX,s.touches[0].clientY)},O=()=>{r.current=!1},Q=s=>{const d=s[0];if(!d)return;if(!["image/png","image/jpeg","image/jpg","image/webp"].includes(d.type)){I("error","Unsupported Image Format","Please upload a PNG, JPG, or WebP image template.");return}const n=new Image,i=URL.createObjectURL(d);n.onload=()=>{W(n),m({width:n.naturalWidth,height:n.naturalHeight}),X(d),a(null);const g=Math.max(24,Math.round(n.naturalWidth/25));P(l=>({...l,fontSize:g})),I("success","Template Loaded",`${d.name} (${n.naturalWidth} × ${n.naturalHeight}px)`)},n.onerror=()=>{I("error","Image Error","Could not load the template image file."),URL.revokeObjectURL(i)},n.src=i},S=async s=>{var i;const d=s[0];if(!d)return;z(!0),J(null),A(null),K(""),a(null);const n=(i=d.name.split(".").pop())==null?void 0:i.toLowerCase();try{if(n==="csv"||n==="txt")at.parse(d,{header:!0,skipEmptyLines:"greedy",complete:g=>{var M,y;if(z(!1),g.errors&&g.errors.length>0&&g.data.length===0){J(`CSV parsing error: ${((M=g.errors[0])==null?void 0:M.message)||"Invalid format"}`);return}const l=((y=g.meta.fields)==null?void 0:y.filter(j=>j&&j.trim().length>0))||[];if(l.length===0){J("The CSV file does not contain valid column headers in the first row.");return}const C=g.data.filter(j=>Object.values(j).some(x=>x!=null&&String(x).trim().length>0));if(C.length===0){J("The CSV file contains column headers but has no data rows.");return}A({fileName:d.name,headers:l,rows:C,totalRows:C.length}),K(l[0]),I("success","Spreadsheet Loaded",`Detected ${C.length} rows and ${l.length} columns.`)},error:g=>{z(!1),J(`Failed to parse CSV: ${g.message}`)}});else if(n==="xlsx"||n==="xls"){const g=await lt(d);if(z(!1),!g||g.length===0){J("The Excel file is empty.");return}const C=g[0].map(y=>y!=null?String(y).trim():"").filter(y=>y.length>0);if(C.length===0){J("The Excel file does not contain valid column headers in the first row.");return}const M=[];for(let y=1;y<g.length;y++){const j=g[y];if(!j||j.every(G=>!G||String(G).trim()===""))continue;const x={};C.forEach((G,b)=>{const E=j[b];x[G]=E!=null?String(E).trim():""}),M.push(x)}
40if(M.length===0){J("The Excel file has headers but contains no data rows.");return}A({fileName:d.name,headers:C,rows:M,totalRows:M.length}),K(C[0]),I("success","Excel File Loaded",`Detected ${M.length} rows and ${C.length} columns.`)}else z(!1),J("Unsupported file format. Please upload a CSV (.csv) or Excel (.xlsx, .xls) file.")}catch(g){z(!1),J(g instanceof Error?g.message:"Error reading spreadsheet file.")}},H=F.useMemo(()=>{if(!_||!R)return{missingCount:0,missingRowIndices:[]};const s=[];return _.rows.forEach((d,n)=>{const i=d[R];(i==null||String(i).trim().length===0)&&s.push(n+1)}),{missingCount:s.length,missingRowIndices:s}},[_,R]),w=F.useMemo(()=>{var d;if(!_||!R)return o.previewSample||"Sample";const s=(d=_.rows[0])==null?void 0:d[R];return s&&s.trim().length>0?s:o.previewSample||"Sample"},[_,R,o.previewSample]),N=F.useCallback(async()=>{const s=e.current;if(!s||!$||!h)return;const d=s.getContext("2d");if(!d)return;await Le(o.fontFamily,o.fontSize,w),s.width=h.width,s.height=h.height,d.clearRect(0,0,s.width,s.height),d.drawImage($,0,0,s.width,s.height);const n=o.xPercent/100*s.width,i=o.yPercent/100*s.height,g=`${o.italic?"italic ":""}${o.bold?"bold ":""}${o.fontSize}px ${o.fontFamily}`;d.font=g,d.fillStyle=o.color,d.textAlign=o.align,d.textBaseline="middle";const l=w;d.direction=Ae(l)?"rtl":"ltr",d.fillText(l,n,i),d.save(),d.strokeStyle="#2d7cf6",d.lineWidth=Math.max(2,Math.round(s.width/700)),d.setLineDash([6,6]),d.beginPath(),d.arc(n,i,Math.max(8,Math.round(s.width/250)),0,Math.PI*2),d.stroke(),d.restore()},[$,h,o,w]);F.useEffect(()=>{N()},[N]);const f=async()=>{if(!$||!h||!_||!R){I("error","Missing Requirements","Please upload a template and spreadsheet data before generating.");return}if(H.missingCount===_.totalRows){I("error","Cannot Generate","All rows in the selected column are empty.");return}ue(!0),Y({current:0,total:_.totalRows}),a(null);try{await Le(o.fontFamily,o.fontSize,"Generation Test Text 123");const s=new Me,d=new Set,n=document.createElement("canvas");n.width=h.width,n.height=h.height;const i=n.getContext("2d",{alpha:!0});if(!i)throw new Error("Could not create offscreen rendering canvas context.");const g=`${o.italic?"italic ":""}${o.bold?"bold ":""}${o.fontSize}px ${o.fontFamily}`,l=o.xPercent/100*h.width,C=o.yPercent/100*h.height,M=_.rows,y=M.length,j=10;for(let G=0;G<y;G+=j){const b=Math.min(G+j,y);for(let E=G;E<b;E++){const he=M[E][R]||"",te=String(he).trim();i.clearRect(0,0,h.width,h.height),i.drawImage($,0,0,h.width,h.height),te.length>0&&(i.font=g,i.fillStyle=o.color,i.textAlign=o.align,i.textBaseline="middle",i.direction=Ae(te)?"rtl":"ltr",i.fillText(te,l,C));const U=await new Promise(le=>{n.toBlob(ge=>le(ge||new Blob),(v==null?void 0:v.type)==="image/png"?"image/png":"image/jpeg",.94)}),se=ot(te,E);let B=`${se}.png`,q=1;for(;d.has(B);)B=`${se}_${q}.png`,q++;d.add(B),s.file(B,U)}Y({current:b,total:y}),await new Promise(E=>setTimeout(E,0))}const x=await s.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}});a({blob:x,size:x.size,count:y}),I("success","Generation Complete!",`Successfully generated ${y} images packed into ZIP (${ve(x.size)}).`)}catch(s){console.error("Bulk generation error:",s),I("error","Generation Failed",s instanceof Error?s.message:"An error occurred during image generation.")}finally{ue(!1)}},ee=()=>{if(!L)return;const s=v?v.name.replace(/\.[^/.]+$/,""):"bulk_images";ze(L.blob,`${s}_generated.zip`)},D=()=>{X(null),W(null),m(null),A(null),K(""),J(null),a(null),Y({current:0,total:0}),P({fontFamily:"Cairo, system-ui, sans-serif",fontSize:64,color:"#1e293b",align:"center",bold:!0,italic:!1,xPercent:50,yPercent:50,previewSample:"Sample"})};return t.jsx("div",{className:"mx-auto max-w-5xl space-y-8 pb-12",children:$?t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-2xl border border-border bg-card p-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary",children:t.jsx(je,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-semibold text-foreground",children:v==null?void 0:v.name}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Original Resolution: ",t.jsxs("strong",{className:"text-foreground",children:[h==null?void 0:h.width," × ",h==null?void 0:h.height," px"]})," • ",v?ve(v.size):""]})]})]}),t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(be,{variant:"outline",size:"sm",onClick:D,leftIcon:t.jsx(Ue,{className:"h-3.5 w-3.5"}),children:T("common.startOver")})})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-12",children:[t.jsxs("div",{className:"space-y-3 lg:col-span-7",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[t.jsx(De,{className:"h-3.5 w-3.5 text-primary"}),"Live Preview"]}),t.jsx("div",{className:"relative flex min-h-[340px] max-h-[560px] w-full items-center justify-center overflow-hidden rounded-2xl border border-border bg-secondary/30 p-4",children:t.jsx("canvas",{ref:e,onMouseDown:c,onMouseMove:k,onMouseUp:Z,onTouchStart:re,onTouchMove:oe,onTouchEnd:O,className:"cursor-crosshair max-h-[500px] max-w-full rounded-xl border border-border/60 bg-white object-contain shadow-md select-none",style:{minWidth:h&&h.width<400?"280px":"auto",minHeight:h&&h.height<300?"200px":"auto",aspectRatio:h?`${h.width} / ${h.height}`:"auto"}})}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-1 text-xs text-muted-foreground",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(He,{className:"h-3 w-3 text-primary"})," Drag text or adjust coordinates: ",t.jsxs("strong",{className:"text-foreground",children:["X: ",o.xPercent,"%"]}),", ",t.jsxs("strong",{className:"text-foreground",children:["Y: ",o.yPercent,"%"]})]}),t.jsxs("span",{className:"text-xs text-primary font-medium",children:["Export coordinates mapped 1:1 to original ",h==null?void 0:h.width,"×",h==null?void 0:h.height,"px"]})]})]}),t.jsxs("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-5 lg:col-span-5",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border pb-3",children:[t.jsx($e,{className:"h-4 w-4 text-primary"}),t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Text & Typography"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Sample Preview Text"}),t.jsx("input",{type:"text",value:o.previewSample,onChange:s=>P({...o,previewSample:s.target.value}),placeholder:"Sample",className:"mt-1.5 h-10 w-full rounded-xl border border-border bg-secondary/30 px-3 text-sm text-foreground outline-none transition-colors focus:border-primary focus:ring-2 focus:ring-primary/20"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Font"}),t.jsx("div",{className:"mt-1.5",children:t.jsx(ct,{selectedFontValue:o.fontFamily,onSelectFont:s=>P(d=>({...d,fontFamily:s.value})),previewText:o.previewSample||w})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Font Size (px)"}),t.jsxs("div",{className:"relative mt-1.5",children:[t.jsx("input",{type:"number",min:"1",step:"1",value:o.fontSize,onChange:s=>{const d=parseInt(s.target.value,10);P(n=>({...n,fontSize:isNaN(d)||d<1?1:d}))},className:"h-10 w-full rounded-xl border border-border bg-secondary/30 px-3 pr-8 text-sm font-medium text-foreground outline-none transition-colors focus:border-primary focus:ring-2 focus:ring-primary/20",placeholder:"64"}),t.jsx("span",{className:"pointer-events-none absolute right-3 top-2.5 text-xs text-muted-foreground",children:"px"})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Color"}),t.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[t.jsx("input",{type:"color",value:o.color,onChange:s=>P({...o,color:s.target.value}),className:"h-10 w-12 cursor-pointer rounded-lg border border-border bg-transparent p-1"}),t.jsx("input",{type:"text",value:o.color,onChange:s=>P({...o,color:s.target.value}),className:"h-10 w-full rounded-xl border border-border bg-secondary/30 px-2 text-xs font-mono uppercase text-foreground outline-none focus:border-primary"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Style"}),t.jsxs("div",{className:"mt-1.5 flex gap-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>P({...o,bold:!o.bold}),className:pe("flex flex-1 items-center justify-center gap-1 rounded-xl border py-2 text-xs font-semibold transition-colors",o.bold?"border-primary bg-primary/10 text-primary":"border-border bg-secondary/20 text-muted-foreground hover:bg-secondary/40"),children:[t.jsx(Qe,{className:"h-4 w-4"})," Bold"]}),t.jsxs("button",{type:"button",onClick:()=>P({...o,italic:!o.italic}),className:pe("flex flex-1 items-center justify-center gap-1 rounded-xl border py-2 text-xs font-semibold transition-colors",o.italic?"border-primary bg-primary/10 text-primary":"border-border bg-secondary/20 text-muted-foreground hover:bg-secondary/40"),children:[t.jsx(et,{className:"h-4 w-4"})," Italic"]})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Alignment"}),t.jsx("div",{className:"mt-1.5 flex rounded-xl border border-border bg-secondary/20 p-1",children:["left","center","right"].map(s=>t.jsxs("button",{type:"button",onClick:()=>P({...o,align:s}),className:pe("flex flex-1 items-center justify-center gap-1.5 rounded-lg py-1.5 text-xs font-medium capitalize transition-colors",o.align===s?"bg-primary text-primary-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),title:`Align ${s}`,children:[s==="left"&&t.jsx(Oe,{className:"h-4 w-4"}),s==="center"&&t.jsx(Ve,{className:"h-4 w-4"}),s==="right"&&t.jsx(Ye,{className:"h-4 w-4"}),t.jsx("span",{children:s})]},s))})]}),t.jsxs("div",{className:"space-y-3 rounded-xl border border-border/80 bg-secondary/20 p-3 pt-2",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs font-medium text-foreground",children:[t.jsx("span",{children:"Horizontal (X Coordinate)"}),t.jsxs("span",{className:"font-mono text-primary",children:[o.xPercent,"%"]})]}),t.jsx("input",{type:"range",min:"0",max:"100",step:"0.5",value:o.xPercent,onChange:s=>P({...o,xPercent:Number(s.target.value)}),className:"w-full accent-primary"}),t.jsxs("div",{className:"flex items-center justify-between text-xs font-medium text-foreground",children:[t.jsx("span",{children:"Vertical (Y Coordinate)"}),t.jsxs("span",{className:"font-mono text-primary",children:[o.yPercent,"%"]})]}),t.jsx("input",{type:"range",min:"0",max:"100",step:"0.5",value:o.yPercent,onChange:s=>P({...o,yPercent:Number(s.target.value)}),className:"w-full accent-primary"})]})]})]}),t.jsxs("div",{className:"card-base space-y-5 p-6",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-border pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary",children:t.jsx(_e,{className:"h-5 w-5"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-bold text-foreground",children:"Connect Data Source (CSV / Excel)"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload your list of names, certificate IDs, or text values in CSV or XLSX format."})]})]})}),_?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 roun
40ded-xl bg-secondary/30 p-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Uploaded File"}),t.jsx("p",{className:"text-sm font-bold text-foreground",children:_.fileName}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.totalRows," data rows • ",_.headers.length," columns detected"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("label",{className:"text-xs font-semibold text-foreground whitespace-nowrap",children:"Text Column:"}),t.jsx("select",{value:R,onChange:s=>K(s.target.value),className:"h-10 rounded-xl border border-border bg-card px-3 text-sm font-semibold text-foreground outline-none focus:border-primary",children:_.headers.map(s=>t.jsx("option",{value:s,children:s},s))})]})]}),H.missingCount>0&&t.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-amber-500/10 p-3 text-xs text-amber-600 dark:text-amber-400",children:[t.jsx(Ce,{className:"h-4 w-4 shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("strong",{children:"Notice:"})," ",H.missingCount,' row(s) have empty values in column "',R,'". Empty rows will render blank templates without text.']})]})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex justify-center",children:t.jsxs("label",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-2xl border-2 border-dashed border-border bg-secondary/20 p-8 text-center transition-colors hover:border-primary hover:bg-secondary/40",children:[t.jsx(_e,{className:"h-9 w-9 text-primary"}),t.jsx("span",{className:"mt-3 text-sm font-semibold text-foreground",children:"Upload CSV or Excel Spreadsheet (.csv, .xlsx, .xls)"}),t.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:'First row must contain column header names (e.g. "Full Name", "ID")'}),t.jsx("input",{type:"file",accept:".csv,.xlsx,.xls,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",className:"hidden",onChange:s=>{s.target.files&&s.target.files.length>0&&S(Array.from(s.target.files))}})]})}),ae&&t.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-primary",children:[t.jsx(ke,{className:"h-4 w-4 animate-spin"}),t.jsx("span",{children:"Parsing spreadsheet in browser..."})]}),ie&&t.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-destructive/10 p-3 text-sm text-destructive",children:[t.jsx(Ce,{className:"h-4 w-4 shrink-0"}),t.jsx("span",{children:ie})]})]})]}),_&&t.jsxs("div",{className:"card-base p-6 space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-bold text-foreground",children:"Generate Image Batch"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Generates ",_.totalRows," high-resolution images (",h==null?void 0:h.width," × ",h==null?void 0:h.height,"px) packaged in a single ZIP download."]})]}),t.jsx("div",{className:"flex items-center gap-3",children:L?t.jsxs(be,{onClick:ee,size:"lg",className:"gap-2 bg-emerald-600 hover:bg-emerald-700 text-white",children:[t.jsx(Ze,{className:"h-4 w-4"}),t.jsxs("span",{children:["Download ZIP (",L.count," images • ",ve(L.size),")"]})]}):t.jsx(be,{onClick:f,disabled:ne,size:"lg",className:"gap-2",children:ne?t.jsxs(t.Fragment,{children:[t.jsx(ke,{className:"h-4 w-4 animate-spin"}),t.jsxs("span",{children:["Generating (",V.current,"/",V.total,")..."]})]}):t.jsxs(t.Fragment,{children:[t.jsx(We,{className:"h-4 w-4"}),t.jsxs("span",{children:["Generate ",_.totalRows," Images"]})]})})})]}),ne&&t.jsxs("div",{className:"space-y-1.5 pt-2",children:[t.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[t.jsx("span",{children:"Rendering images on client..."}),t.jsxs("span",{children:[Math.round(V.current/V.total*100),"%"]})]}),t.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:t.jsx("div",{className:"h-full bg-primary transition-all duration-150",style:{width:`${V.current/V.total*100}%`}})})]}),L&&t.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-emerald-500/10 p-3 text-xs text-emerald-600 dark:text-emerald-400",children:[t.jsx(Ke,{className:"h-4 w-4 shrink-0"}),t.jsxs("span",{children:["Images generated successfully at original ",h==null?void 0:h.width,"×",h==null?void 0:h.height,"px resolution and packaged in ZIP."]})]})]})]}):t.jsxs("div",{className:"card-base p-8 text-center sm:p-12",children:[t.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:t.jsx(je,{className:"h-8 w-8"})}),t.jsx("h2",{className:"text-xl font-bold text-foreground sm:text-2xl",children:"Upload Base Image Template"}),t.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm text-muted-foreground",children:"Upload your certificate, badge, greeting card, or social card template in PNG, JPG, or WebP. All rendering is 100% private in your browser."}),t.jsx("div",{className:"mt-6 flex justify-center",children:t.jsxs("label",{className:"flex cursor-pointer flex-col items-center justify-center rounded-2xl border-2 border-dashed border-border bg-secondary/30 px-8 py-10 transition-colors hover:border-primary hover:bg-secondary/50",children:[t.jsx(Je,{className:"h-10 w-10 text-primary"}),t.jsx("span",{className:"mt-3 text-sm font-semibold text-foreground",children:"Click to select template image"}),t.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:"PNG, JPG, or WebP (Full resolution preserved)"}),t.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:s=>{s.target.files&&s.target.files.length>0&&Q(Array.from(s.target.files))}})]})})]})})}export{Nt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.