PageSourceSearch

https://explainify-ailearniverse-96.vercel.app/assets/index-BZU9upL2.js

js explainify-ailearniverse-96.vercel.app collected 2026-10-03 06:55:16 UTC 17,439 bytes, 1 lines download raw bytes

1import{c as de}from"./_commonjs-dynamic-modules-TDtrdbi3.js";function fe(n,o){for(var i=0;i<o.length;i++){const l=o[i];if(typeof l!="string"&&!Array.isArray(l)){for(const h in l)if(h!=="default"&&!(h in n)){const y=Object.getOwnPropertyDescriptor(l,h);y&&Object.defineProperty(n,h,y.get?y:{enumerable:!0,get:()=>l[h]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var pe={exports:{}};(function(n){var o=function(i){var l=Object.prototype,h=l.hasOwnProperty,y=Object.defineProperty||function(t,e,r){t[e]=r.value},g,v=typeof Symbol=="function"?Symbol:{},E=v.iterator||"@@iterator",W=v.asyncIterator||"@@asyncIterator",$=v.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch{f=function(e,r,s){return e[r]=s}}function m(t,e,r,s){var a=e&&e.prototype instanceof z?e:z,d=Object.create(a.prototype),w=new K(s||[]);return y(d,"_invoke",{value:V(t,r,w)}),d}i.wrap=m;function A(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(s){return{type:"throw",arg:s}}}var j="suspendedStart",N="suspendedYield",R="executing",b="completed",p={};function z(){}function M(){}function _(){}var B={};f(B,E,function(){return this});var F=Object.getPrototypeOf,C=F&&F(F(c([])));C&&C!==l&&h.call(C,E)&&(B=C);var T=_.prototype=z.prototype=Object.create(B);M.prototype=_,y(T,"constructor",{value:_,configurable:!0}),y(_,"constructor",{value:M,configurable:!0}),M.displayName=f(_,$,"GeneratorFunction");function G(t){["next","throw","return"].forEach(function(e){f(t,e,function(r){return this._invoke(e,r)})})}i.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return e?e===M||(e.displayName||e.name)==="GeneratorFunction":!1},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,$,"GeneratorFunction")),t.prototype=Object.create(T),t},i.awrap=function(t){return{__await:t}};function U(t,e){function r(d,w,L,k){var S=A(t[d],t,w);if(S.type==="throw")k(S.arg);else{var Q=S.arg,H=Q.value;return H&&typeof H=="object"&&h.call(H,"__await")?e.resolve(H.__await).then(function(I){r("next",I,L,k)},function(I){r("throw",I,L,k)}):e.resolve(H).then(function(I){Q.value=I,L(Q)},function(I){return r("throw",I,L,k)})}}var s;function a(d,w){function L(){return new e(function(k,S){r(d,w,k,S)})}return s=s?s.then(L,L):L()}y(this,"_invoke",{value:a})}G(U.prototype),f(U.prototype,W,function(){return this}),i.AsyncIterator=U,i.async=function(t,e,r,s,a){a===void 0&&(a=Promise);var d=new U(m(t,e,r,s),a);return i.isGeneratorFunction(e)?d:d.next().then(function(w){return w.done?w.value:d.next()})};function V(t,e,r){var s=j;return function(d,w){if(s===R)throw new Error("Generator is already running");if(s===b){if(d==="throw")throw w;return u()}for(r.method=d,r.arg=w;;){var L=r.delegate;if(L){var k=J(L,r);if(k){if(k===p)continue;return k}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(s===j)throw s=b,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);s=R;var S=A(t,e,r);if(S.type==="normal"){if(s=r.done?b:N,S.arg===p)continue;return{value:S.arg,done:r.done}}else S.type==="throw"&&(s=b,r.method="throw",r.arg=S.arg)}}}function J(t,e){var r=e.method,s=t.iterator[r];if(s===g)return e.delegate=null,r==="throw"&&t.iterator.return&&(e.method="return",e.arg=g,J(t,e),e.method==="throw")||r!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var a=A(s,t.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,p;var d=a.arg;if(!d)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p;if(d.done)e[t.resultName]=d.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=g);else return d;return e.delegate=null,p}G(T),f(T,$,"Generator"),f(T,E,function(){return this}),f(T,"toString",function(){return"[object Generator]"});function Z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Z,this),this.reset(!0)}i.keys=function(t){var e=Object(t),r=[];for(var s in e)r.push(s);return r.reverse(),function a(){for(;r.length;){var d=r.pop();if(d in e)return a.value=d,a.done=!1,a}return a.done=!0,a}};function c(t){if(t){var e=t[E];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var r=-1,s=function a(){for(;++r<t.length;)if(h.call(t,r))return a.value=t[r],a.done=!1,a;return a.value=g,a.done=!0,a};return s.next=s}}return{next:u}}i.values=c;function u(){return{value:g,done:!0}}return K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEac
1h(Y),!t)for(var e in this)e.charAt(0)==="t"&&h.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(k,S){return d.type="throw",d.arg=t,e.next=k,S&&(e.method="next",e.arg=g),!!S}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],d=a.completion;if(a.tryLoc==="root")return r("end");if(a.tryLoc<=this.prev){var w=h.call(a,"catchLoc"),L=h.call(a,"finallyLoc");if(w&&L){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(w){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else if(L){if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&h.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var a=s;break}}a&&(t==="break"||t==="continue")&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var d=a?a.completion:{};return d.type=t,d.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(d)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),Y(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var s=r.completion;if(s.type==="throw"){var a=s.arg;Y(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:c(t),resultName:e,nextLoc:r},this.method==="next"&&(this.arg=g),p}},i}(n.exports);try{regeneratorRuntime=o}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}})(pe);var ee=(n,o)=>`${n}-${o}-${Math.random().toString(16).slice(3,8)}`;const he=ee;let re=0;var ie=({id:n,action:o,payload:i={}})=>{let l=n;return typeof l>"u"&&(l=he("Job",re),re+=1),{id:l,action:o,payload:i}},D={};let te=!1;D.logging=te;D.setLogging=n=>{te=n};D.log=(...n)=>te?console.log.apply(void 0,n):null;const ge=ie,{log:q}=D,ve=ee;let ne=0;var me=()=>{const n=ve("Scheduler",ne),o={},i={};let l=[];ne+=1;const h=()=>l.length,y=()=>Object.keys(o).length,g=()=>{if(l.length!==0){const f=Object.keys(o);for(let m=0;m<f.length;m+=1)if(typeof i[f[m]]>"u"){l[0](o[f[m]]);break}}},v=(f,m)=>new Promise((A,j)=>{const N=ge({action:f,payload:m});l.push(async R=>{l.shift(),i[R.id]=N;try{A(await R[f].apply(void 0,[...m,N.id]))}catch(b){j(b)}finally{delete i[R.id],g()}}),q(`[${n}]: Add ${N.id} to JobQueue`),q(`[${n}]: JobQueue length=${l.length}`),g()});return{addWorker:f=>(o[f.id]=f,q(`[${n}]: Add ${f.id}`),q(`[${n}]: Number of workers=${y()}`),g(),f.id),addJob:async(f,...m)=>{if(y()===0)throw Error(`[${n}]: You need to have at least one worker before adding jobs`);return v(f,m)},terminate:async()=>{Object.keys(o).forEach(async f=>{await o[f].terminate()}),l=[]},getQueueLen:h,getNumWorkers:y}},we=n=>{const o={};return typeof WorkerGlobalScope<"u"?o.type="webworker":typeof document=="object"?o.type="browser":typeof process=="object"&&typeof de=="function"&&(o.type="node"),typeof n>"u"?o:o[n]};const ye=we("type")==="browser",be=ye?n=>new URL(n,window.location.href).href:n=>n;var Le=n=>{const o={...n};return["corePath","workerPath","langPath"].forEach(i=>{n[i]&&(o[i]=be(o[i]))}),o},ce={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3};const Se="tesseract.js",ke="6.0.0",Ee="Pure Javascript Multilingual OCR",Oe="src/index.js",Ae="src/index.d.ts",_e="dist/tesseract.min.js",Te="dist/tesseract.min.js",$e={start:"node scripts/server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js && rollup -c scripts/rollup.esm.mjs","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",prepublishOnly:"npm run build",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.min.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:* test:node:
1all","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser-tpl":"mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:detect":"npm run test:browser-tpl -- -f ./tests/detect.test.html","test:browser:recognize":"npm run test:browser-tpl -- -f ./tests/recognize.test.html","test:browser:scheduler":"npm run test:browser-tpl -- -f ./tests/scheduler.test.html","test:browser:FS":"npm run test:browser-tpl -- -f ./tests/FS.test.html",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true"},Re={"./src/worker/node/index.js":"./src/worker/browser/index.js"},je="",Ne=["jeromewu"],Ie="Apache-2.0",Pe={"@babel/core":"^7.21.4","@babel/eslint-parser":"^7.21.3","@babel/preset-env":"^7.21.4","@rollup/plugin-commonjs":"^24.1.0",acorn:"^8.8.2","babel-loader":"^9.1.2",buffer:"^6.0.3",cors:"^2.8.5",eslint:"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.27.5","expect.js":"^0.3.1",express:"^4.18.2",mocha:"^10.2.0","mocha-headless-chrome":"^4.0.0","npm-run-all":"^4.1.5",nyc:"^15.1.0",rimraf:"^5.0.0",rollup:"^3.20.7","wait-on":"^7.0.1",webpack:"^5.79.0","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-middleware":"^6.0.2","rollup-plugin-sourcemaps":"^0.6.3"},Me={"bmp-js":"^0.1.0","idb-keyval":"^6.2.0","is-url":"^1.2.4","node-fetch":"^2.6.9","opencollective-postinstall":"^2.0.3","regenerator-runtime":"^0.13.3","tesseract.js-core":"^6.0.0","wasm-feature-detect":"^1.2.11",zlibjs:"^0.3.1"},Ce={"@rollup/pluginutils":"^5.0.2"},Ge={type:"git",url:"https://github.com/naptha/tesseract.js.git"},Ue={url:"https://github.com/naptha/tesseract.js/issues"},De="https://github.com/naptha/tesseract.js",We={type:"opencollective",url:"https://opencollective.com/tesseractjs"},ze={name:Se,version:ke,description:Ee,main:Oe,types:Ae,unpkg:_e,jsdelivr:Te,scripts:$e,browser:Re,author:je,contributors:Ne,license:Ie,devDependencies:Pe,dependencies:Me,overrides:Ce,repository:Ge,bugs:Ue,homepage:De,collective:We};var Be={workerBlobURL:!0,logger:()=>{}};const Fe=ze.version,Ye=Be;var Ke={...Ye,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${Fe}/dist/worker.min.js`},He=({workerPath:n,workerBlobURL:o})=>{let i;if(Blob&&URL&&o){const l=new Blob([`importScripts("${n}");`],{type:"application/javascript"});i=new Worker(URL.createObjectURL(l))}else i=new Worker(n);return i},Je=n=>{n.terminate()},qe=(n,o)=>{n.onmessage=({data:i})=>{o(i)}},Ve=async(n,o)=>{n.postMessage(o)};const X=n=>new Promise((o,i)=>{const l=new FileReader;l.onload=()=>{o(l.result)},l.onerror=({target:{error:{code:h}}})=>{i(Error(`File could not be read! Code=${h}`))},l.readAsArrayBuffer(n)}),x=async n=>{let o=n;if(typeof n>"u")return"undefined";if(typeof n=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(n)?o=atob(n.split(",")[1]).split("").map(i=>i.charCodeAt(0)):o=await(await fetch(n)).arrayBuffer();else if(typeof HTMLElement<"u"&&n instanceof HTMLElement)n.tagName==="IMG"&&(o=await x(n.src)),n.tagName==="VIDEO"&&(o=await x(n.poster)),n.tagName==="CANVAS"&&await new Promise(i=>{n.toBlob(async l=>{o=await X(l),i()})});else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas){const i=await n.convertToBlob();o=await X(i)}else(n instanceof File||n instanceof Blob)&&(o=await X(n));return new Uint8Array(o)};var Ze=x;const Qe=Ke,Xe=He,xe=Je,et=qe,tt=Ve,rt=Ze;var nt={defaultOptions:Qe,spawnWorker:Xe,terminateWorker:xe,onMessage:et,send:tt,loadImage:rt};const ot=Le,O=ie,{log:oe}=D,at=ee,P=ce,{defaultOptions:st,spawnWorker:it,terminateWorker:ct,onMessage:lt,loadImage:ae,send:ut}=nt;let se=0;var le=async(n="eng",o=P.LSTM_ONLY,i={},l={})=>{const h=at("Worker",se),{logger:y,errorHandler:g,...v}=ot({...st,...i}),E={},W=typeof n=="string"?n.split("+"):n;let $=o,f=l;const m=[P.DEFAULT,P.LSTM_ONLY].includes(o)&&!v.legacyCore;let A,j;const N=new Promise((c,u)=>{j=c,A=u}),R=c=>{A(c.message)};let b=it(v);b.onerror=R,se+=1;const p=({id:c,action:u,payload:t})=>new Promise((e,r)=>{oe(`[${h}]: Start ${c}, action=${u}`);const s=`${u}-${c}`;E[s]={resolve:e,reject:r},ut(b,{workerId:h,jobId:c,action:u,payload:t})}),z=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),M=c=>p(O({id:c,action:"load",payload:{options:{lstmOnly:m,corePath:v.corePath,logging:v.logging}}})),_=(c,u,t)=>p(O({id:t,action:"FS",payload:{method:"writeFile",args:[c,u]}})),B=(c,u)=>p(O({id:u,action:"FS",payload:{method:"readFile",args:[c,{encoding:"utf8"}]}})),F=(c,u)=>p(O({id:u,action:"FS",payload:{method:"unlink",args:[c]}})),C=(c,u,t)=>p(O({id:t,action:"FS",payload:{method:c,args:u}})),T=(c,u)=>p(O({id:u,action:"loadLanguage",payload:{langs:c,options:{langPath:v.langPath,dataPath:v.dataPath,cachePath:v.cachePath,cacheMethod:v.cacheMethod,gzip:v.gzip,lstmOnly:[P.DEFAULT,P.LSTM_ONLY].includes($)&&!v.legacyLang}}})),G=(c,u,t,e)=>p(O({id:e,action:"initialize",payload:{langs:c,oem:u,config:t}})),U=(c="eng",u,t,e)=>{if(m&&[P.TESSERACT_ONLY,P.TESSERACT_LSTM_COMBINED].includes(u))throw Error("Legacy model requested but code missing.");const r=u||$;$=r;const s=t||f;f=s;const d=(typeof c=="string"?c.split("+"):c).filter(w=>!W.includes(w));return W.push(...d),d.length>0?T(d,e).then(()=>G(c,r,s,e)):G(c,r,s,e)},V=(c={},u)=>p(O({id:u,action:"setParameters",payload:{params:c}})),J=async(c,u={},t={text:!0},e)=>p(O({id:e,action:"recognize",payload:{image:await ae(c),options:u,output:t}})),Z=async(c,u)=>{if(m)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return p(O({id:u,action:"detect",payload:{image:await ae(c)}}))},Y=async()=>(b!==null&&(ct(b),b=null),Promise.resolve());lt(b,({workerId:c,jobId:u,status:t,action:e,data:r})=>{const s=`${e}-${u}`;if(t==="resolve")oe(`[${c}]: Complete ${u}`),E[s].resolve({jobId:u,data:r}),delete E[s];else if(t==="reject")if(E[s].reject(r),delete E[s],e==="load"&&A(r),g)g(r);else throw Error(r);else t==="progress"&&y({...r,userJobId:u})});const K={id:h,worker:b,load:z,writeText:_,readText:B,removeFile:F,FS:C,reinitialize:U,setParameters:V,recognize:J,detect:Z,terminate:Y};return M().then(()=>T(n)).then(()=>G(n,o,l)).then(()=>j(K)).catch(()=>{}),N};const ue=le,dt=async(n,o,i)=>{const l=await ue(o,1,i);return l.recognize(n).finally(async()=>{await l.terminate()})},ft=async(n,o)=>{const i=await ue("osd",0,o);return i.detect(n).finally(async()=>{await i.terminate()})};var pt={recognize:dt,detect:ft},ht={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"},gt={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"};const vt=me,mt=le,wt=pt,yt=ht,bt=ce,Lt=gt,{setLogging:St}=D;var kt={languages:yt,OEM:bt,PSM:Lt,createScheduler:vt,createWorker:mt,setLogging:St,...wt};const Ot=fe({__proto__:null},[kt]);export{Ot 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.