PageSourceSearch

https://localpdf.online/app/assets/index-TC7YGpMm.js

js localpdf.online collected 2026-10-02 01:10:04 UTC 17,214 bytes, 1 lines download raw bytes

1import{k as ir}from"./worker-entrypoint-Cpi_3YOf.js";import{c as ar}from"./_commonjs-dynamic-modules-TDtrdbi3.js";function sr(o,a){return a.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(s){if(s!=="default"&&!(s in o)){var u=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,u.get?u:{enumerable:!0,get:function(){return t[s]}})}})}),Object.freeze(o)}var ne={exports:{}},Ae;function ur(){return Ae||(Ae=1,(function(o){var a=(function(t){var s=Object.prototype,u=s.hasOwnProperty,c=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 $(r,e,n,l){var i=e&&e.prototype instanceof G?e:G,p=Object.create(i.prototype),E=new J(l||[]);return c(p,"_invoke",{value:X(r,n,E)}),p}t.wrap=$;function C(r,e,n){try{return{type:"normal",arg:r.call(e,n)}}catch(l){return{type:"throw",arg:l}}}var F="suspendedStart",g="suspendedYield",S="executing",M="completed",O={};function G(){}function y(){}function q(){}var Y={};R(Y,_,function(){return this});var K=Object.getPrototypeOf,W=K&&K(K(V([])));W&&W!==s&&u.call(W,_)&&(Y=W);var j=q.prototype=G.prototype=Object.create(Y);y.prototype=q,c(j,"constructor",{value:q,configurable:!0}),c(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 z(r,e){function n(p,E,m,A){var w=C(r[p],r,E);if(w.type==="throw")A(w.arg);else{var Z=w.arg,B=Z.value;return B&&typeof B=="object"&&u.call(B,"__await")?e.resolve(B.__await).then(function(D){n("next",D,m,A)},function(D){n("throw",D,m,A)}):e.resolve(B).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()}c(this,"_invoke",{value:i})}H(z.prototype),R(z.prototype,I,function(){return this}),t.AsyncIterator=z,t.async=function(r,e,n,l,i){i===void 0&&(i=Promise);var p=new z($(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=F;return function(p,E){if(l===S)throw new Error("Generator is already running");if(l===M){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===F)throw l=M,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);l=S;var w=C(r,e,n);if(w.type==="normal"){if(l=n.done?M:g,w.arg===O)continue;return{value:w.arg,done:n.done}}else w.type==="throw"&&(l=M,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=C(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(u.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"&&u.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=u.call(i,"catchLoc"),m=u.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&&u.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=a}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}})(ne)),ne.exports}var oe,Te;function Re(){return Te||(Te=1,oe=(o,a)=>`${o}-${a}-${Math.random().toString(16).slice(3,8)}`),oe}var ie,_e;function Ze(){if(_e)return ie;_e=1;const o=Re();let a=0;return ie=({id:t,action:s,payload:u={}})=>{let c=t;return typeof c>"u"&&(c=o("Job",a),a+=1),{id:c,action:s,payload:u}},ie}var Q={},Pe;function ke(){if(Pe)return Q;Pe=1;let o=!1;return Q.logging=o,Q.setLogging=a=>{o=a},Q.log=(...a)=>o?console.log.apply(this,a):null,Q}var ae,qe;function cr(){if(qe)return ae;qe=1;const o=Ze(),{log:a}=ke(),t=Re();let s=0;return ae=()=>{const u=t("Scheduler",s),c={},h={};let v=[];s+=1;const _=()=>v.length,I=()=>Object.keys(c).length,P=()=>{if(v.length!==0){const g=Object.keys(c);for(let S=0;S<g.length;S+=1)if(typeof h[g[S]]>"u"){v[0](c[g[S]]);break}}},R=(g,S)=>new Promise((M,O)=>{const G=o({action:g,payload:S});v.push(async y=>{v.shift(),h[y.id]=G;try{M(await y[g].apply(this,[...S,G.id]))}catch(q){O(q)}finally{delete h[y.id],P()}}),a(`[${u}]: Add ${G.id} to JobQueue`),a(`[${u}]: JobQueue length=${v.length}`),P()});return{addWorker:g=>(c[g.id]=g,a(`[${u}]: Add ${g.id}`),a(`[${u}]: Number of workers=${I()}`),P(),g.id),addJob:async(g,...S)=>{if(I()===0)throw Error(`[${u}]: You need to have at least one worker before adding jobs`);return R(g,S)},terminate:async()=>{Object.keys(c).forEach(async g=>{await c[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=a=>{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 a>"u"?t:t[a]},ue}var ce,Ce;function dr(){if(Ce)return ce;Ce=1;const a=fr()("type")==="browser"?t=>new URL(t,window.location.href).href:t=>t;return ce=t=>{const s={...t};return["corePath","workerPath","langPath"].forEach(u=>{t[u]&&(s[u]=a(s[u]))}),s},ce}var le,Me;function hr(){return Me||(Me=1,le=o=>{const a=[],t=[],s=[],u=[],c=[];return o.blocks&&o.blocks.forEach(h=>{h.paragraphs.forEach(v=>
1{v.lines.forEach(_=>{_.words.forEach(I=>{I.symbols.forEach(P=>{c.push({...P,page:o,block:h,paragraph:v,line:_,word:I})}),u.push({...I,page:o,block:h,paragraph:v,line:_})}),s.push({..._,page:o,block:h,paragraph:v})}),t.push({...v,page:o,block:h})}),a.push({...h,page:o})}),{...o,blocks:a,paragraphs:t,lines:s,words:u,symbols:c}}),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";var vr={version:pr},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,Ue;function wr(){return Ue||(Ue=1,pe=({workerPath:o,workerBlobURL:a})=>{let t;if(Blob&&URL&&a){const s=new Blob([`importScripts("${o}");`],{type:"application/javascript"});t=new Worker(URL.createObjectURL(s))}else t=new Worker(o);return t}),pe}var ve,We;function mr(){return We||(We=1,ve=o=>{o.terminate()}),ve}var ge,ze;function Lr(){return ze||(ze=1,ge=(o,a)=>{o.onmessage=({data:t})=>{a(t)}}),ge}var ye,Fe;function Er(){return Fe||(Fe=1,ye=async(o,a)=>{o.postMessage(a)}),ye}var we,Be;function Sr(){if(Be)return we;Be=1;const o=t=>new Promise((s,u)=>{const c=new FileReader;c.onload=()=>{s(c.result)},c.onerror=({target:{error:{code:h}}})=>{u(Error(`File could not be read! Code=${h}`))},c.readAsArrayBuffer(t)}),a=async t=>{let s=t;if(typeof t>"u")return"undefined";if(typeof t=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)?s=atob(t.split(",")[1]).split("").map(u=>u.charCodeAt(0)):s=await(await fetch(t)).arrayBuffer();else if(typeof HTMLElement<"u"&&t instanceof HTMLElement)t.tagName==="IMG"&&(s=await a(t.src)),t.tagName==="VIDEO"&&(s=await a(t.poster)),t.tagName==="CANVAS"&&await new Promise(u=>{t.toBlob(async c=>{s=await o(c),u()})});else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas){const u=await t.convertToBlob();s=await o(u)}else(t instanceof File||t instanceof Blob)&&(s=await o(t));return new Uint8Array(s)};return we=a,we}var me,$e;function Or(){if($e)return me;$e=1;const o=yr(),a=wr(),t=mr(),s=Lr(),u=Er(),c=Sr();return me={defaultOptions:o,spawnWorker:a,terminateWorker:t,onMessage:s,send:u,loadImage:c},me}var Le,Ye;
1function Xe(){if(Ye)return Le;Ye=1;const o=dr(),a=hr(),t=Ze(),{log:s}=ke(),u=Re(),c=Qe(),{defaultOptions:h,spawnWorker:v,terminateWorker:_,onMessage:I,loadImage:P,send:R}=Or();let $=0;return Le=async(C="eng",F=c.LSTM_ONLY,g={},S={})=>{const M=u("Worker",$),{logger:O,errorHandler:G,...y}=o({...h,...g}),q={},Y={},K=typeof C=="string"?C.split("+"):C;let W=F,j=S;const H=[c.DEFAULT,c.LSTM_ONLY].includes(F)&&!y.legacyCore;let z,X;const x=new Promise((f,d)=>{X=f,z=d}),re=f=>{z(f.message)};let N=v(y);N.onerror=re,$+=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)=>{s(`[${M}]: Start ${f}, action=${d}`);const U=`${d}-${f}`;J(U,T),V(U,b),R(N,{workerId:M,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:[c.DEFAULT,c.LSTM_ONLY].includes(W)&&!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&&[c.TESSERACT_ONLY,c.TESSERACT_LSTM_COMBINED].includes(d))throw Error("Legacy model requested but code missing.");const b=d||W;W=b;const U=L||j;j=U;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,U,T)):w(f,b,U,T)},B=(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 U=`${T}-${d}`;if(L==="resolve"){s(`[${f}]: Complete ${d}`);let ee=b;T==="recognize"?ee=a(b):T==="getPDF"&&(ee=Array.from({...b,length:Object.keys(b).length})),q[U]({jobId:d,data:ee})}else if(L==="reject")if(Y[U](b),T==="load"&&z(b),G)G(b);else throw Error(b);else L==="progress"&&O({...b,userJobId:d})});const nr={id:M,worker:N,setResolve:J,setReject:V,load:r,writeText:n,readText:l,removeFile:i,FS:p,loadLanguage:E,initialize:A,reinitialize:Z,setParameters:B,recognize:D,getPDF:er,detect:rr,terminate:tr};return e().then(()=>m(C)).then(()=>w(C,F,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(s,u,c)=>{const h=await o(u,1,c);return h.recognize(s).finally(async()=>{await h.terminate()})},detect:async(s,u)=>{const c=await o("osd",0,u);return c.detect(s).finally(async()=>{await c.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(),a=Xe(),t=br(),s=Rr(),u=Qe(),c=kr(),{setLogging:h}=ke();return be={languages:s,OEM:u,PSM:c,createScheduler:o,createWorker:a,setLogging:h,...t},be}var xe=Ar(),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.