yeda-reader 0.1.7

yeda's PDF reader and annotator
Documentation
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("115",[],t):"object"==typeof exports?exports[115]=t():e[115]=t()}(self,(()=>(()=>{"use strict";function e(e,t){let n=0,r=e.length-1;for(;n<=r;){let a=Math.floor((n+r)/2);if(e[a].start<=t&&t<=e[a].end)return e[a];t<e[a].start?r=a-1:n=a+1}return null}return onmessage=async t=>{let{context:n,term:r,options:a}=t.data;postMessage(function(t,n,r){if(!n)return[];let{text:a,internalCharDataRanges:o}=t,s=[],i=(l=n,l.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"')).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var l;r.entireWord&&(i="\\b"+i+"\\b");let u,c=new RegExp(i,"g"+(r.caseSensitive?"":"i"));for(;u=c.exec(a);){let[t]=u,{charDataID:n,start:r}=e(o,u.index),{charDataID:a,start:i}=e(o,u.index+t.length);s.push({startCharDataID:n,startIndex:u.index-r,endCharDataID:a,endIndex:u.index+t.length-i})}return s}(n,r,a))},{}})()));