(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[275],{35607:(e,t,a)=>{"use strict";var o=a(24994);t.A=void 0;var r=o(a(79526)),n=a(44414);t.A=(0,r.default)((0,n.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},13004:(e,t,a)=>{"use strict";var o=a(24994);t.A=void 0;var r=o(a(79526)),n=a(44414);t.A=(0,r.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,n.jsx)("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"PhotoCamera")},57669:(e,t,a)=>{"use strict";var o=a(24994);t.A=void 0;var r=o(a(79526)),n=a(44414);t.A=(0,r.default)((0,n.jsx)("path",{d:"M19.8 10.7 4.2 5l-.7 1.9L17.6 12H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5.5c0-.8-.5-1.6-1.2-1.8M7 17H5v-2h2zm12 0H9v-2h10z"}),"Scanner")},48089:(e,t,a)=>{"use strict";a.d(t,{A:()=>b});var o=a(58168),r=a(98587),n=a(9950),i=a(72004),s=a(74061),c=a(59254),l=a(48283),d=a(2235),u=a(80863),p=a(68483);function g(e){return(0,p.Ay)("MuiCard",e)}(0,u.A)("MuiCard",["root"]);var f=a(44414);const m=["className","raised"],h=(0,c.Ay)(d.A,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({overflow:"hidden"}))),b=n.forwardRef((function(e,t){const a=(0,l.A)({props:e,name:"MuiCard"}),{className:n,raised:c=!1}=a,d=(0,r.A)(a,m),u=(0,o.A)({},a,{raised:c}),p=(e=>{const{classes:t}=e;return(0,s.A)({root:["root"]},g,t)})(u);return(0,f.jsx)(h,(0,o.A)({className:(0,i.A)(p.root,n),elevation:c?8:void 0,ref:t,ownerState:u},d))}))},50704:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var o=a(58168),r=a(98587),n=a(9950),i=a(72004),s=a(74061),c=a(59254),l=a(48283),d=a(80863),u=a(68483);function p(e){return(0,u.Ay)("MuiCardContent",e)}(0,d.A)("MuiCardContent",["root"]);var g=a(44414);const f=["className","component"],m=(0,c.Ay)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),h=n.forwardRef((function(e,t){const a=(0,l.A)({props:e,name:"MuiCardContent"}),{className:n,component:c="div"}=a,d=(0,r.A)(a,f),u=(0,o.A)({},a,{component:c}),h=(e=>{const{classes:t}=e;return(0,s.A)({root:["root"]},p,t)})(u);return(0,g.jsx)(m,(0,o.A)({as:c,className:(0,i.A)(h.root,n),ownerState:u,ref:t},d))}))},66699:(e,t,a)=>{"use strict";a.d(t,{A:()=>U});var o=a(57528),r=a(98587),n=a(58168),i=a(9950),s=a(72004),c=a(74061),l=a(88283),d=a(99269),u=a(44730),p=a(61676),g=a(59254),f=a(48283),m=a(80863),h=a(68483);function b(e){return(0,h.Ay)("MuiLinearProgress",e)}(0,m.A)("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);var v,y,A,w,S,C,L=a(44414);const k=["className","color","value","valueBuffer","variant"];let E,R,M,O,x,N;const I=(0,l.i7)(E||(E=v||(v=(0,o.A)(["\n  0% {\n    left: -35%;\n    right: 100%;\n  }\n\n  60% {\n    left: 100%;\n    right: -90%;\n  }\n\n  100% {\n    left: 100%;\n    right: -90%;\n  }\n"])))),T=(0,l.i7)(R||(R=y||(y=(0,o.A)(["\n  0% {\n    left: -200%;\n    right: 100%;\n  }\n\n  60% {\n    left: 107%;\n    right: -8%;\n  }\n\n  100% {\n    left: 107%;\n    right: -8%;\n  }\n"])))),P=(0,l.i7)(M||(M=A||(A=(0,o.A)(["\n  0% {\n    opacity: 1;\n    background-position: 0 -23px;\n  }\n\n  60% {\n    opacity: 0;\n    background-position: 0 -23px;\n  }\n\n  100% {\n    opacity: 1;\n    background-position: -200px -23px;\n  }\n"])))),_=(e,t)=>"inherit"===t?"currentColor":e.vars?e.vars.palette.LinearProgress["".concat(t,"Bg")]:"light"===e.palette.mode?(0,d.a)(e.palette[t].main,.62):(0,d.e$)(e.palette[t].main,.5),B=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t["color".concat((0,p.A)(a.color))],t[a.variant]]}})((e=>{let{ownerState:t,theme:a}=e;return(0,n.A)({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:_(a,t.color)},"inherit"===t.color&&"buffer"!==t.variant&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},"buffer"===t.variant&&{backgroundColor:"transparent"},"query"===t.variant&&{transform:"rotate(180deg)"})})),j=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.dashed,t["dashedColor".concat((0,p.A)(a.color))]]}})((e=>{let{ownerState:t,theme:a}=e;const o=_(a,t.color);return(0,n.A)({position:"absolute",marginTop:0,height:"100%",width:"100%"},"inherit"===t.color&&{opacity:.3},{backgroundImage:"radial-gradient(".concat(o," 0%, ").concat(o," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})}),(0,l.AH)(O||(O=w||(w=(0,o.A)(["\n    animation: "," 3s infinite linear;\n  "]))),P)),D=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.bar,t["barColor".concat((0,p.A)(a.color))],("indeterminate"===a.variant||"query"===a.variant)&&t.bar1Indeterminate,"determinate"===a.variant&&t.bar1Determinate,"buffer"===a.variant&&t.bar1Buffer]}})((e=>{let{ownerState:t,theme:a}=e;return(0,n.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===t.color?"currentColor":(a.vars||a).palette[t.color].main},"determinate"===t.variant&&{transition:"transform .".concat(4,"s linear")},"buffer"===t.variant&&{zIndex:1,transition:"transform .".concat(4,"s linear")})}),(e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,l.AH)(x||(x=S||(S=(0,o.A)(["\n      width: auto;\n      animation: "," 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n    "]))),I)})),z=(0,g.Ay)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.bar,t["barColor".concat((0,p.A)(a.color))],("indeterminate"===a.variant||"query"===a.variant)&&t.bar2Indeterminate,"buffer"===a.variant&&t.bar2Buffer]}})((e=>{let{ownerState:t,theme:a}=e;return(0,n.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==t.variant&&{backgroundColor:"inherit"===t.color?"currentColor":(a.vars||a).palette[t.color].main},"inherit"===t.color&&{opacity:.3},"buffer"===t.variant&&{backgroundColor:_(a,t.color),transition:"transform .".concat(4,"s linear")})}),(e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,l.AH)(N||(N=C||(C=(0,o.A)(["\n      width: auto;\n      animation: "," 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;\n    "]))),T)})),U=i.forwardRef((function(e,t){const a=(0,f.A)({props:e,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:l,valueBuffer:d,variant:g="indeterminate"}=a,m=(0,r.A)(a,k),h=(0,n.A)({},a,{color:i,variant:g}),v=(e=>{const{classes:t,variant:a,color:o}=e,r={root:["root","color".concat((0,p.A)(o)),a],dashed:["dashed","dashedColor".concat((0,p.A)(o))],bar1:["bar","barColor".concat((0,p.A)(o)),("indeterminate"===a||"query"===a)&&"bar1Indeterminate","determinate"===a&&"bar1Determinate","buffer"===a&&"bar1Buffer"],bar2:["bar","buffer"!==a&&"barColor".concat((0,p.A)(o)),"buffer"===a&&"color".concat((0,p.A)(o)),("indeterminate"===a||"query"===a)&&"bar2Indeterminate","buffer"===a&&"bar2Buffer"]};return(0,c.A)(r,b,t)})(h),y=(0,u.I)(),A={},w={bar1:{},bar2:{}};if("determinate"===g||"buffer"===g)if(void 0!==l){A["aria-valuenow"]=Math.round(l),A["aria-valuemin"]=0,A["aria-valuemax"]=100;let e=l-100;y&&(e=-e),w.bar1.transform="translateX(".concat(e,"%)")}else 0;if("buffer"===g)if(void 0!==d){let e=(d||0)-100;y&&(e=-e),w.bar2.transform="translateX(".concat(e,"%)")}else 0;return(0,L.jsxs)(B,(0,n.A)({className:(0,s.A)(v.root,o),ownerState:h,role:"progressbar"},A,{ref:t},m,{children:["buffer"===g?(0,L.jsx)(j,{className:v.dashed,ownerState:h}):null,(0,L.jsx)(D,{className:v.bar1,ownerState:h,style:w.bar1}),"determinate"===g?null:(0,L.jsx)(z,{className:v.bar2,ownerState:h,style:w.bar2})]}))}))},23266:(e,t,a)=>{"use strict";a.d(t,{A:()=>E});var o=a(98587),r=a(58168),n=a(9950),i=a(72004),s=a(74061),c=a(99269),l=a(59254),d=a(19608),u=a(48283),p=a(13372),g=a(24184),f=a(79044),m=a(31506),h=a(40777),b=a(92455),v=a(88543),y=a(80863),A=a(68483);function w(e){return(0,A.Ay)("MuiMenuItem",e)}const S=(0,y.A)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var C=a(44414);const L=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],k=(0,l.Ay)(g.A,{shouldForwardProp:e=>(0,d.A)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,a.dense&&t.dense,a.divider&&t.divider,!a.disableGutters&&t.gutters]}})((e=>{let{theme:t,ownerState:a}=e;return(0,r.A)({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.divider&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider),backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(S.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,c.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(S.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,c.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},["&.".concat(S.selected,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,c.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,c.X4)(t.palette.primary.main,t.palette.action.selectedOpacity)}},["&.".concat(S.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(S.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},["& + .".concat(h.A.root)]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},["& + .".concat(h.A.inset)]:{marginLeft:52},["& .".concat(v.A.root)]:{marginTop:0,marginBottom:0},["& .".concat(v.A.inset)]:{paddingLeft:36},["& .".concat(b.A.root)]:{minWidth:36}},!a.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},a.dense&&(0,r.A)({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{["& .".concat(b.A.root," svg")]:{fontSize:"1.25rem"}}))})),E=n.forwardRef((function(e,t){const a=(0,u.A)({props:e,name:"MuiMenuItem"}),{autoFocus:c=!1,component:l="li",dense:d=!1,divider:g=!1,disableGutters:h=!1,focusVisibleClassName:b,role:v="menuitem",tabIndex:y,className:A}=a,S=(0,o.A)(a,L),E=n.useContext(p.A),R=n.useMemo((()=>({dense:d||E.dense||!1,disableGutters:h})),[E.dense,d,h]),M=n.useRef(null);(0,f.A)((()=>{c&&M.current&&M.current.focus()}),[c]);const O=(0,r.A)({},a,{dense:R.dense,divider:g,disableGutters:h}),x=(e=>{const{disabled:t,dense:a,divider:o,disableGutters:n,selected:i,classes:c}=e,l={root:["root",a&&"dense",t&&"disabled",!n&&"gutters",o&&"divider",i&&"selected"]},d=(0,s.A)(l,w,c);return(0,r.A)({},c,d)})(a),N=(0,m.A)(M,t);let I;return a.disabled||(I=void 0!==y?y:-1),(0,C.jsx)(p.A.Provider,{value:R,children:(0,C.jsx)(k,(0,r.A)({ref:N,role:v,tabIndex:I,component:l,focusVisibleClassName:(0,i.A)(x.focusVisible,b),className:(0,i.A)(x.root,A)},S,{ownerState:O,classes:x}))})}))},59152:(e,t,a)=>{var o=a(85224);e.exports=function(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||(!("undefined"===typeof o||"object"!==typeof o.versions||!o.versions.electron)||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0)}},51519:(e,t,a)=>{const o=a(12275);e.exports={recognize:async(e,t,a)=>{const r=await o(t,1,a);return r.recognize(e).finally((async()=>{await r.terminate()}))},detect:async(e,t)=>{const a=await o("osd",0,t);return a.detect(e).finally((async()=>{await a.terminate()}))}}},76356:e=>{e.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}},22379:e=>{e.exports={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"}},18086:e=>{e.exports={workerBlobURL:!0,logger:()=>{}}},63152:e=>{e.exports={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",SPA:"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"}},12894:(e,t,a)=>{const o=a(3254);let r=0;e.exports=e=>{let{id:t,action:a,payload:n={}}=e,i=t;return"undefined"===typeof i&&(i=o("Job",r),r+=1),{id:i,action:a,payload:n}}},24420:function(e,t,a){const o=a(12894),{log:r}=a(4369),n=a(3254);let i=0;e.exports=()=>{const e=n("Scheduler",i),t={},a={};let s=[];i+=1;const c=()=>Object.keys(t).length,l=()=>{if(0!==s.length){const e=Object.keys(t);for(let o=0;o<e.length;o+=1)if("undefined"===typeof a[e[o]]){s[0](t[e[o]]);break}}},d=(t,n)=>new Promise(((i,c)=>{const d=o({action:t,payload:n});s.push((async e=>{s.shift(),a[e.id]=d;try{i(await e[t].apply(this,[...n,d.id]))}catch(o){c(o)}finally{delete a[e.id],l()}})),r("[".concat(e,"]: Add ").concat(d.id," to JobQueue")),r("[".concat(e,"]: JobQueue length=").concat(s.length)),l()}));return{addWorker:a=>(t[a.id]=a,r("[".concat(e,"]: Add ").concat(a.id)),r("[".concat(e,"]: Number of workers=").concat(c())),l(),a.id),addJob:async function(t){if(0===c())throw Error("[".concat(e,"]: You need to have at least one worker before adding jobs"));for(var a=arguments.length,o=new Array(a>1?a-1:0),r=1;r<a;r++)o[r-1]=arguments[r];return d(t,o)},terminate:async()=>{Object.keys(t).forEach((async e=>{await t[e].terminate()})),s=[]},getQueueLen:()=>s.length,getNumWorkers:c}}},12275:(e,t,a)=>{const o=a(25731),r=a(29242),n=a(12894),{log:i}=a(4369),s=a(3254),c=a(76356),{defaultOptions:l,spawnWorker:d,terminateWorker:u,onMessage:p,loadImage:g,send:f}=a(33659);let m=0;e.exports=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"eng",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.LSTM_ONLY,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const b=s("Worker",m),{logger:v,errorHandler:y,...A}=o({...l,...a}),w={},S={},C="string"===typeof e?e.split("+"):e;let L=t,k=h;const E=[c.DEFAULT,c.LSTM_ONLY].includes(t)&&!A.legacyCore;let R,M;const O=new Promise(((e,t)=>{M=e,R=t}));let x=d(A);x.onerror=e=>{R(e.message)},m+=1;const N=(e,t)=>{w[e]=t},I=(e,t)=>{S[e]=t},T=e=>{let{id:t,action:a,payload:o}=e;return new Promise(((e,r)=>{i("[".concat(b,"]: Start ").concat(t,", action=").concat(a));const n="".concat(a,"-").concat(t);N(n,e),I(n,r),f(x,{workerId:b,jobId:t,action:a,payload:o})}))},P=(e,t)=>T(n({id:t,action:"loadLanguage",payload:{langs:e,options:{langPath:A.langPath,dataPath:A.dataPath,cachePath:A.cachePath,cacheMethod:A.cacheMethod,gzip:A.gzip,lstmOnly:[c.LSTM_ONLY,c.TESSERACT_LSTM_COMBINED].includes(L)&&!A.legacyLang}}})),_=(e,t,a,o)=>T(n({id:o,action:"initialize",payload:{langs:e,oem:t,config:a}}));p(x,(e=>{let{workerId:t,jobId:a,status:o,action:n,data:s}=e;const c="".concat(n,"-").concat(a);if("resolve"===o){i("[".concat(t,"]: Complete ").concat(a));let e=s;"recognize"===n?e=r(s):"getPDF"===n&&(e=Array.from({...s,length:Object.keys(s).length})),w[c]({jobId:a,data:e})}else if("reject"===o){if(S[c](s),"load"===n&&R(s),!y)throw Error(s);y(s)}else"progress"===o&&v({...s,userJobId:a})}));const B={id:b,worker:x,setResolve:N,setReject:I,load:()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),writeText:(e,t,a)=>T(n({id:a,action:"FS",payload:{method:"writeFile",args:[e,t]}})),readText:(e,t)=>T(n({id:t,action:"FS",payload:{method:"readFile",args:[e,{encoding:"utf8"}]}})),removeFile:(e,t)=>T(n({id:t,action:"FS",payload:{method:"unlink",args:[e]}})),FS:(e,t,a)=>T(n({id:a,action:"FS",payload:{method:e,args:t}})),loadLanguage:()=>console.warn("`loadLanguage` is depreciated and should be removed from code (workers now come with language pre-loaded)"),initialize:()=>console.warn("`initialize` is depreciated and should be removed from code (workers now come pre-initialized)"),reinitialize:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"eng",t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(E&&[c.TESSERACT_ONLY,c.TESSERACT_LSTM_COMBINED].includes(t))throw Error("Legacy model requested but code missing.");const r=t||L;L=r;const n=a||k;k=n;const i=("string"===typeof e?e.split("+"):e).filter((e=>!C.includes(e)));return C.push(...i),i.length>0?P(i,o).then((()=>_(e,r,n,o))):_(e,r,n,o)},setParameters:function(){return T(n({id:arguments.length>1?arguments[1]:void 0,action:"setParameters",payload:{params:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}))},recognize:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{blocks:!0,text:!0,hocr:!0,tsv:!0};return T(n({id:arguments.length>3?arguments[3]:void 0,action:"recognize",payload:{image:await g(e),options:t,output:a}}))},getPDF:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Tesseract OCR Result",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2?arguments[2]:void 0;return console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),T(n({id:a,action:"getPDF",payload:{title:e,textonly:t}}))},detect:async(e,t)=>{if(E)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return T(n({id:t,action:"detect",payload:{image:await g(e)}}))},terminate:async()=>(null!==x&&(u(x),x=null),Promise.resolve())};var j;return T(n({id:j,action:"load",payload:{options:{lstmOnly:E,corePath:A.corePath,logging:A.logging}}})).then((()=>P(e))).then((()=>_(e,t,h))).then((()=>M(B))).catch((()=>{})),O}},90797:(e,t,a)=>{const o=a(24420),r=a(12275),n=a(51519),i=a(63152),s=a(76356),c=a(22379),{setLogging:l}=a(4369);e.exports={languages:i,OEM:s,PSM:c,createScheduler:o,createWorker:r,setLogging:l,...n}},29242:e=>{e.exports=e=>{const t=[],a=[],o=[],r=[],n=[];return e.blocks&&e.blocks.forEach((i=>{i.paragraphs.forEach((t=>{t.lines.forEach((a=>{a.words.forEach((o=>{o.symbols.forEach((r=>{n.push({...r,page:e,block:i,paragraph:t,line:a,word:o})})),r.push({...o,page:e,block:i,paragraph:t,line:a})})),o.push({...a,page:e,block:i,paragraph:t})})),a.push({...t,page:e,block:i})})),t.push({...i,page:e})})),{...e,blocks:t,paragraphs:a,lines:o,words:r,symbols:n}}},9610:(e,t,a)=>{var o=a(85224);const r=a(59152);e.exports=e=>{const t={};return"undefined"!==typeof WorkerGlobalScope?t.type="webworker":r()?t.type="electron":"object"===typeof document?t.type="browser":"object"===typeof o&&(t.type="node"),"undefined"===typeof e?t:t[e]}},3254:e=>{e.exports=(e,t)=>"".concat(e,"-").concat(t,"-").concat(Math.random().toString(16).slice(3,8))},4369:function(e,t){var a=this;let o=!1;t.logging=o,t.setLogging=e=>{o=e},t.log=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o?console.log.apply(a,t):null}},25731:(e,t,a)=>{const o="browser"===a(9610)("type")?e=>new URL(e,window.location.href).href:e=>e;e.exports=e=>{const t={...e};return["corePath","workerPath","langPath"].forEach((a=>{e[a]&&(t[a]=o(t[a]))})),t}},66662:(e,t,a)=>{const o=a(76125).rE,r=a(18086);e.exports={...r,workerPath:"https://cdn.jsdelivr.net/npm/tesseract.js@v".concat(o,"/dist/worker.min.js")}},33659:(e,t,a)=>{const o=a(66662),r=a(22726),n=a(82918),i=a(25471),s=a(6217),c=a(74946);e.exports={defaultOptions:o,spawnWorker:r,terminateWorker:n,onMessage:i,send:s,loadImage:c}},74946:e=>{const t=e=>new Promise(((t,a)=>{const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=e=>{let{target:{error:{code:t}}}=e;a(Error("File could not be read! Code=".concat(t)))},o.readAsArrayBuffer(e)})),a=async e=>{let o=e;if("undefined"===typeof e)return"undefined";if("string"===typeof e)if(/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(e))o=atob(e.split(",")[1]).split("").map((e=>e.charCodeAt(0)));else{const t=await fetch(e);o=await t.arrayBuffer()}else if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)"IMG"===e.tagName&&(o=await a(e.src)),"VIDEO"===e.tagName&&(o=await a(e.poster)),"CANVAS"===e.tagName&&await new Promise((a=>{e.toBlob((async e=>{o=await t(e),a()}))}));else if("undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas){const a=await e.convertToBlob();o=await t(a)}else(e instanceof File||e instanceof Blob)&&(o=await t(e));return new Uint8Array(o)};e.exports=a},25471:e=>{e.exports=(e,t)=>{e.onmessage=e=>{let{data:a}=e;t(a)}}},6217:e=>{e.exports=async(e,t)=>{e.postMessage(t)}},22726:e=>{e.exports=e=>{let t,{workerPath:a,workerBlobURL:o}=e;if(Blob&&URL&&o){const e=new Blob(['importScripts("'.concat(a,'");')],{type:"application/javascript"});t=new Worker(URL.createObjectURL(e))}else t=new Worker(a);return t}},82918:e=>{e.exports=e=>{e.terminate()}},76125:e=>{"use strict";e.exports={rE:"5.1.0"}}}]);