b.matchIdx+1<d||a&&0<b.matchIdx){this.hadMatch=!0;b.matchIdx=a?b.matchIdx-1:b.matchIdx+1;this.updateMatch(!0);return}this.advanceOffsetPage(a)}this.nextPageMatch()}},nextPageMatch:function(){null!==this.resumePageIdx&&console.error("There can only be one pending page.");vara=function(a){varb=this.offset;a=a.length;varc=this.state.findPrevious;if(a)this.hadMatch=!0,b.matchIdx=c?a-1:0,this.updateMatch(!0);else{this.advanceOffsetPage(c);if(b.wrapped&&(b.matchIdx=null,!this.hadMatch)){this.updateMatch(!1);
function(){a.dispatchEvent("casesensitivitychange")})},dispatchEvent:function(a,b){varc=document.createEvent("CustomEvent");c.initCustomEvent("find"+a,!0,!0,{query:this.findField.value,caseSensitive:this.caseSensitive.checked,highlightAll:this.highlightAll.checked,findPrevious:b});returnwindow.dispatchEvent(c)},updateUIState:function(a,b){varc=!1,d="",e="";switch(a){caseFindStates.FIND_PENDING:e="pending";break;caseFindStates.FIND_NOTFOUND:d=mozL10n.get("find_not_found",null,"Phrase not found");
c=!0;break;caseFindStates.FIND_WRAPPED:d=b?mozL10n.get("find_reached_top",null,"Reached top of document, continued from bottom"):mozL10n.get("find_reached_bottom",null,"Reached end of document, continued from top")}c?this.findField.classList.add("notFound"):this.findField.classList.remove("notFound");this.findField.setAttribute("data-status",e);this.findMsg.textContent=d},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.bar.classList.remove("hidden"),this.findField.select(),
null,"An error occurred while loading the PDF."),a);break}PDFView.open(b.data,0)}});FirefoxCom.requestSync("initPassiveLoading",null)},setTitleUsingUrl:function(a){this.url=a;try{this.setTitle(decodeURIComponent(getFileName(a))||a)}catch(b){this.setTitle(a)}},setTitle:function(a){document.title=a},open:function(a,b,c){vard={password:c};"string"===typeofa?(this.setTitleUsingUrl(a),d.url=a):a&&"byteLength"ina&&(d.data=a);PDFView.loadingBar||(PDFView.loadingBar=newProgressBar("#loadingBar",{}));
this.pdfDocument=null;vare=this;e.loading=!0;PDFJS.getDocument(d).then(function(a){e.load(a,b);e.loading=!1},function(d,f){if(f&&"PasswordException"===f.name&&"needpassword"===f.code){varh=mozL10n.get("request_password",null,"PDF is protected by a password:");if((c=prompt(h))&&0<c.length)returnPDFView.open(a,b,c)}h=mozL10n.get("loading_error",null,"An error occurred while loading the PDF.");f&&"InvalidPDFException"===f.name&&(h=mozL10n.get("invalid_file_error",null,"Invalid or corrupted PDF file."));
!0);for(vara=0,b=this.pages.length;a<b;++a)this.pages[a].beforePrint()}elsea=mozL10n.get("printing_not_supported",null,"Warning: Printing is not fully supported by this browser."),this.error(a)},afterPrint:function(){for(vara=document.getElementById("printContainer");a.hasChildNodes();)a.removeChild(a.lastChild)},fullscreen:function(){if(document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen)return!1;vara=document.getElementById("viewerContainer");if(document.documentElement.requestFullscreen)a.requestFullscreen();
deleten.loadingIconDiv);d&&PDFView.error(mozL10n.get("rendering_error",null,"An error occurred while rendering the page."),d);n.stats=b.stats;n.updateStats();if(n.onAfterDraw)n.onAfterDraw();cache.push(n);a()}this.renderingState!==RenderingStates.INITIAL&&error("Must be in new state before drawing");this.renderingState=RenderingStates.RUNNING;vard=document.createElement("canvas");d.id="page"+this.id;d.mozOpaque=!0;e.appendChild(d);this.canvas=d;varg=null;PDFJS.disableTextLayer||(g=document.createElement("div"),
this.resume=null};this.drawingRequired=function(){return!this.hasImage};this.draw=function(a){this.renderingState!==RenderingStates.INITIAL&&error("Must be in new state before drawing");this.renderingState=RenderingStates.RUNNING;if(this.hasImage)a();else{varc=this,e=d(),j=b.getViewport(n,f);b.render({canvasContext:e,viewport:j,continueCallback:function(a){PDFView.highestPriorityPage!=="thumbnail"+c.id?(c.renderingState=RenderingStates.PAUSED,c.resume=function(){c.renderingState=RenderingStates.RUNNING;
this.textContent.bidiTexts,c=0;c<b.length;c++){varf=b[c],h=a[c];h.textContent=f.str;h.dir=f.ltr?"ltr":"rtl"}this.setupRenderLayoutTimer()}};this.setTextContent=function(a){this.textContent=a;this.insertDivContent()};this.convertMatches=function(a){for(varb=0,c=0,f=this.textContent.bidiTexts,h=f.length-1,g=PDFFindController.state.query.length,m=[],k=0;k<a.length;k++){for(varl=a[k];b!==h&&l>=c+f[b].str.length;)c+=f[b].str.length,b++;b==f.length&&console.error("Could not find matching mapping");for(varn=