1import{g as ir}from"./react-DcbKnVvw.js";import{c as ar}from"./_commonjs-dynamic-modules-TDtrdbi3.js";function sr(o,s){for(var t=0;t<s.length;t++){const c=s[t];if(typeof c!="string"&&!Array.isArray(c)){for(const a in c)if(a!=="default"&&!(a in o)){const u=Object.getOwnPropertyDescriptor(c,a);u&&Object.defineProperty(o,a,u.get?u:{enumerable:!0,get:()=>c[a]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var ne={exports:{}},Ae;function ur(){return Ae||(Ae=1,(function(o){var s=(function(t){var c=Object.prototype,a=c.hasOwnProperty,u=Object.defineProperty||function(r,e,n){r[e]=n.value},h,v=typeof Symbol=="function"?Symbol:{},_=v.iterator||"@@iterator",I=v.asyncIterator||"@@asyncIterator",P=v.toStringTag||"@@toStringTag";function R(r,e,n){return Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{R({},"")}catch{R=function(e,n,l){return e[n]=l}}function B(r,e,n,l){var i=e&&e.prototype instanceof G?e:G,p=Object.create(i.prototype),E=new J(l||[]);return u(p,"_invoke",{value:X(r,n,E)}),p}t.wrap=B;function M(r,e,n){try{return{type:"normal",arg:r.call(e,n)}}catch(l){return{type:"throw",arg:l}}}var z="suspendedStart",g="suspendedYield",S="executing",C="completed",O={};function G(){}function y(){}function q(){}var Y={};R(Y,_,function(){return this});var K=Object.getPrototypeOf,U=K&&K(K(V([])));U&&U!==c&&a.call(U,_)&&(Y=U);var j=q.prototype=G.prototype=Object.create(Y);y.prototype=q,u(j,"constructor",{value:q,configurable:!0}),u(q,"constructor",{value:y,configurable:!0}),y.displayName=R(q,P,"GeneratorFunction");function H(r){["next","throw","return"].forEach(function(e){R(r,e,function(n){return this._invoke(e,n)})})}t.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return e?e===y||(e.displayName||e.name)==="GeneratorFunction":!1},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,q):(r.__proto__=q,R(r,P,"GeneratorFunction")),r.prototype=Object.create(j),r},t.awrap=function(r){return{__await:r}};function W(r,e){function n(p,E,m,A){var w=M(r[p],r,E);if(w.type==="throw")A(w.arg);else{var Z=w.arg,F=Z.value;return F&&typeof F=="object"&&a.call(F,"__await")?e.resolve(F.__await).then(function(D){n("next",D,m,A)},function(D){n("throw",D,m,A)}):e.resolve(F).then(function(D){Z.value=D,m(Z)},function(D){return n("throw",D,m,A)})}}var l;function i(p,E){function m(){return new e(function(A,w){n(p,E,A,w)})}return l=l?l.then(m,m):m()}u(this,"_invoke",{value:i})}H(W.prototype),R(W.prototype,I,function(){return this}),t.AsyncIterator=W,t.async=function(r,e,n,l,i){i===void 0&&(i=Promise);var p=new W(B(r,e,n,l),i);return t.isGeneratorFunction(e)?p:p.next().then(function(E){return E.done?E.value:p.next()})};function X(r,e,n){var l=z;return function(p,E){if(l===S)throw new Error("Generator is already running");if(l===C){if(p==="throw")throw E;return k()}for(n.method=p,n.arg=E;;){var m=n.delegate;if(m){var A=x(m,n);if(A){if(A===O)continue;return A}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(l===z)throw l=C,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);l=S;var w=M(r,e,n);if(w.type==="normal"){if(l=n.done?C:g,w.arg===O)continue;return{value:w.arg,done:n.done}}else w.type==="throw"&&(l=C,n.method="throw",n.arg=w.arg)}}}function x(r,e){var n=e.method,l=r.iterator[n];if(l===h)return e.delegate=null,n==="throw"&&r.iterator.return&&(e.method="return",e.arg=h,x(r,e),e.method==="throw")||n!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),O;var i=M(l,r.iterator,e.arg);if(i.type==="throw")return e.method="throw",e.arg=i.arg,e.delegate=null,O;var p=i.arg;if(!p)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,O;if(p.done)e[r.resultName]=p.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=h);else return p;return e.delegate=null,O}H(j),R(j,P,"Generator"),R(j,_,function(){return this}),R(j,"toString",function(){return"[object Generator]"});function re(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function N(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function J(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(re,this),this.reset(!0)}t.keys=function(r){var e=Object(r),n=[];for(var l in e)n.push(l);return n.reverse(),function i(){for(;n.length;){var p=n.pop();if(p in e)return i.value=p,i.done=!1,i}return i.done=!0,i}};function V(r){if(r){var e=r[_];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,l=function i(){for(;++n<r.length;)if(a.call(r,n))return i.value=r[n],i.done=!1,i;return i.value=h,i.done=!0,i};return l.next=l}}return{next:k}}t.values=V;function k(){return{value:h,done:!0}}return J.prototype={constructor:J,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=h,this.done=!1,this.delegate=null,this.method="next",this.arg=h,this.tryEntries.forEac
1h(N),!r)for(var e in this)e.charAt(0)==="t"&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=h)},stop:function(){this.done=!0;var r=this.tryEntries[0],e=r.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(A,w){return p.type="throw",p.arg=r,e.next=A,w&&(e.method="next",e.arg=h),!!w}for(var l=this.tryEntries.length-1;l>=0;--l){var i=this.tryEntries[l],p=i.completion;if(i.tryLoc==="root")return n("end");if(i.tryLoc<=this.prev){var E=a.call(i,"catchLoc"),m=a.call(i,"finallyLoc");if(E&&m){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(E){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else if(m){if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,e){for(var n=this.tryEntries.length-1;n>=0;--n){var l=this.tryEntries[n];if(l.tryLoc<=this.prev&&a.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var i=l;break}}i&&(r==="break"||r==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var p=i?i.completion:{};return p.type=r,p.arg=e,i?(this.method="next",this.next=i.finallyLoc,O):this.complete(p)},complete:function(r,e){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&e&&(this.next=e),O},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),N(n),O}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var l=n.completion;if(l.type==="throw"){var i=l.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:V(r),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=h),O}},t})(o.exports);try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}})(ne)),ne.exports}var oe,Te;function Re(){return Te||(Te=1,oe=(o,s)=>`${o}-${s}-${Math.random().toString(16).slice(3,8)}`),oe}var ie,_e;function Ze(){if(_e)return ie;_e=1;const o=Re();let s=0;return ie=({id:t,action:c,payload:a={}})=>{let u=t;return typeof u>"u"&&(u=o("Job",s),s+=1),{id:u,action:c,payload:a}},ie}var Q={},Pe;function ke(){if(Pe)return Q;Pe=1;let o=!1;return Q.logging=o,Q.setLogging=s=>{o=s},Q.log=(...s)=>o?console.log.apply(this,s):null,Q}var ae,qe;function cr(){if(qe)return ae;qe=1;const o=Ze(),{log:s}=ke(),t=Re();let c=0;return ae=()=>{const a=t("Scheduler",c),u={},h={};let v=[];c+=1;const _=()=>v.length,I=()=>Object.keys(u).length,P=()=>{if(v.length!==0){const g=Object.keys(u);for(let S=0;S<g.length;S+=1)if(typeof h[g[S]]>"u"){v[0](u[g[S]]);break}}},R=(g,S)=>new Promise((C,O)=>{const G=o({action:g,payload:S});v.push(async y=>{v.shift(),h[y.id]=G;try{C(await y[g].apply(this,[...S,G.id]))}catch(q){O(q)}finally{delete h[y.id],P()}}),s(`[${a}]: Add ${G.id} to JobQueue`),s(`[${a}]: JobQueue length=${v.length}`),P()});return{addWorker:g=>(u[g.id]=g,s(`[${a}]: Add ${g.id}`),s(`[${a}]: Number of workers=${I()}`),P(),g.id),addJob:async(g,...S)=>{if(I()===0)throw Error(`[${a}]: You need to have at least one worker before adding jobs`);return R(g,S)},terminate:async()=>{Object.keys(u).forEach(async g=>{await u[g].terminate()}),v=[]},getQueueLen:_,getNumWorkers:I}},ae}var se,Ie;function lr(){if(Ie)return se;Ie=1;function o(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}return se=o,se}var ue,Ne;function fr(){if(Ne)return ue;Ne=1;const o=lr();return ue=s=>{const t={};return typeof WorkerGlobalScope<"u"?t.type="webworker":o()?t.type="electron":typeof document=="object"?t.type="browser":typeof process=="object"&&typeof ar=="function"&&(t.type="node"),typeof s>"u"?t:t[s]},ue}var ce,Me;function dr(){if(Me)return ce;Me=1;const s=fr()("type")==="browser"?t=>new URL(t,window.location.href).href:t=>t;return ce=t=>{const c={...t};return["corePath","workerPath","langPath"].forEach(a=>{t[a]&&(c[a]=s(c[a]))}),c},ce}var le,Ce;function hr(){return Ce||(Ce=1,le=o=>{const s=[],t=[],c=[],a=[],u=[];return o.blocks&&o.blocks.forEach(h=>{h.paragraphs.forEach(v=>
1{v.lines.forEach(_=>{_.words.forEach(I=>{I.symbols.forEach(P=>{u.push({...P,page:o,block:h,paragraph:v,line:_,word:I})}),a.push({...I,page:o,block:h,paragraph:v,line:_})}),c.push({..._,page:o,block:h,paragraph:v})}),t.push({...v,page:o,block:h})}),s.push({...h,page:o})}),{...o,blocks:s,paragraphs:t,lines:c,words:a,symbols:u}}),le}var fe,Ge;function Qe(){return Ge||(Ge=1,fe={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}),fe}const pr="5.1.1",vr={version:pr};var de,je;function gr(){return je||(je=1,de={workerBlobURL:!0,logger:()=>{}}),de}var he,De;function yr(){if(De)return he;De=1;const o=vr.version;return he={...gr(),workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${o}/dist/worker.min.js`},he}var pe,$e;function wr(){return $e||($e=1,pe=({workerPath:o,workerBlobURL:s})=>{let t;if(Blob&&URL&&s){const c=new Blob([`importScripts("${o}");`],{type:"application/javascript"});t=new Worker(URL.createObjectURL(c))}else t=new Worker(o);return t}),pe}var ve,Ue;function mr(){return Ue||(Ue=1,ve=o=>{o.terminate()}),ve}var ge,We;function Lr(){return We||(We=1,ge=(o,s)=>{o.onmessage=({data:t})=>{s(t)}}),ge}var ye,ze;function Er(){return ze||(ze=1,ye=async(o,s)=>{o.postMessage(s)}),ye}var we,Fe;function Sr(){if(Fe)return we;Fe=1;const o=t=>new Promise((c,a)=>{const u=new FileReader;u.onload=()=>{c(u.result)},u.onerror=({target:{error:{code:h}}})=>{a(Error(`File could not be read! Code=${h}`))},u.readAsArrayBuffer(t)}),s=async t=>{let c=t;if(typeof t>"u")return"undefined";if(typeof t=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)?c=atob(t.split(",")[1]).split("").map(a=>a.charCodeAt(0)):c=await(await fetch(t)).arrayBuffer();else if(typeof HTMLElement<"u"&&t instanceof HTMLElement)t.tagName==="IMG"&&(c=await s(t.src)),t.tagName==="VIDEO"&&(c=await s(t.poster)),t.tagName==="CANVAS"&&await new Promise(a=>{t.toBlob(async u=>{c=await o(u),a()})});else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas){const a=await t.convertToBlob();c=await o(a)}else(t instanceof File||t instanceof Blob)&&(c=await o(t));return new Uint8Array(c)};return we=s,we}var me,Be;function Or(){if(Be)return me;Be=1;const o=yr(),s=wr(),t=mr(),c=Lr(),a=Er(),u=Sr();return me={defaultOptions:o,spawnWorker:s,terminateWorker:t,onMessage:c,send:a,loadImage:u},me}var Le,Ye;
1function Xe(){if(Ye)return Le;Ye=1;const o=dr(),s=hr(),t=Ze(),{log:c}=ke(),a=Re(),u=Qe(),{defaultOptions:h,spawnWorker:v,terminateWorker:_,onMessage:I,loadImage:P,send:R}=Or();let B=0;return Le=async(M="eng",z=u.LSTM_ONLY,g={},S={})=>{const C=a("Worker",B),{logger:O,errorHandler:G,...y}=o({...h,...g}),q={},Y={},K=typeof M=="string"?M.split("+"):M;let U=z,j=S;const H=[u.DEFAULT,u.LSTM_ONLY].includes(z)&&!y.legacyCore;let W,X;const x=new Promise((f,d)=>{X=f,W=d}),re=f=>{W(f.message)};let N=v(y);N.onerror=re,B+=1;const J=(f,d)=>{q[f]=d},V=(f,d)=>{Y[f]=d},k=({id:f,action:d,payload:L})=>new Promise((T,b)=>{c(`[${C}]: Start ${f}, action=${d}`);const $=`${d}-${f}`;J($,T),V($,b),R(N,{workerId:C,jobId:f,action:d,payload:L})}),r=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),e=f=>k(t({id:f,action:"load",payload:{options:{lstmOnly:H,corePath:y.corePath,logging:y.logging}}})),n=(f,d,L)=>k(t({id:L,action:"FS",payload:{method:"writeFile",args:[f,d]}})),l=(f,d)=>k(t({id:d,action:"FS",payload:{method:"readFile",args:[f,{encoding:"utf8"}]}})),i=(f,d)=>k(t({id:d,action:"FS",payload:{method:"unlink",args:[f]}})),p=(f,d,L)=>k(t({id:L,action:"FS",payload:{method:f,args:d}})),E=()=>console.warn("`loadLanguage` is depreciated and should be removed from code (workers now come with language pre-loaded)"),m=(f,d)=>k(t({id:d,action:"loadLanguage",payload:{langs:f,options:{langPath:y.langPath,dataPath:y.dataPath,cachePath:y.cachePath,cacheMethod:y.cacheMethod,gzip:y.gzip,lstmOnly:[u.DEFAULT,u.LSTM_ONLY].includes(U)&&!y.legacyLang}}})),A=()=>console.warn("`initialize` is depreciated and should be removed from code (workers now come pre-initialized)"),w=(f,d,L,T)=>k(t({id:T,action:"initialize",payload:{langs:f,oem:d,config:L}})),Z=(f="eng",d,L,T)=>{if(H&&[u.TESSERACT_ONLY,u.TESSERACT_LSTM_COMBINED].includes(d))throw Error("Legacy model requested but code missing.");const b=d||U;U=b;const $=L||j;j=$;const te=(typeof f=="string"?f.split("+"):f).filter(or=>!K.includes(or));return K.push(...te),te.length>0?m(te,T).then(()=>w(f,b,$,T)):w(f,b,$,T)},F=(f={},d)=>k(t({id:d,action:"setParameters",payload:{params:f}})),D=async(f,d={},L={blocks:!0,text:!0,hocr:!0,tsv:!0},T)=>k(t({id:T,action:"recognize",payload:{image:await P(f),options:d,output:L}})),er=(f="Tesseract OCR Result",d=!1,L)=>(console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),k(t({id:L,action:"getPDF",payload:{title:f,textonly:d}}))),rr=async(f,d)=>{if(H)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return k(t({id:d,action:"detect",payload:{image:await P(f)}}))},tr=async()=>(N!==null&&(_(N),N=null),Promise.resolve());I(N,({workerId:f,jobId:d,status:L,action:T,data:b})=>{const $=`${T}-${d}`;if(L==="resolve"){c(`[${f}]: Complete ${d}`);let ee=b;T==="recognize"?ee=s(b):T==="getPDF"&&(ee=Array.from({...b,length:Object.keys(b).length})),q[$]({jobId:d,data:ee})}else if(L==="reject")if(Y[$](b),T==="load"&&W(b),G)G(b);else throw Error(b);else L==="progress"&&O({...b,userJobId:d})});const nr={id:C,worker:N,setResolve:J,setReject:V,load:r,writeText:n,readText:l,removeFile:i,FS:p,loadLanguage:E,initialize:A,reinitialize:Z,setParameters:F,recognize:D,getPDF:er,detect:rr,terminate:tr};return e().then(()=>m(M)).then(()=>w(M,z,S)).then(()=>X(nr)).catch(()=>{}),x},Le}var Ee,Ke;function br(){if(Ke)return Ee;Ke=1;const o=Xe();return Ee={recognize:async(c,a,u)=>{const h=await o(a,1,u);return h.recognize(c).finally(async()=>{await h.terminate()})},detect:async(c,a)=>{const u=await o("osd",0,a);return u.detect(c).finally(async()=>{await u.terminate()})}},Ee}var Se,He;function Rr(){return He||(He=1,Se={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",
1SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}),Se}var Oe,Je;function kr(){return Je||(Je=1,Oe={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}),Oe}var be,Ve;function Ar(){if(Ve)return be;Ve=1,ur();const o=cr(),s=Xe(),t=br(),c=Rr(),a=Qe(),u=kr(),{setLogging:h}=ke();return be={languages:c,OEM:a,PSM:u,createScheduler:o,createWorker:s,setLogging:h,...t},be}var xe=Ar();const Tr=ir(xe),qr=sr({__proto__:null,default:Tr},[xe]);export{qr as i};
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.