parser_x.js 1.1.49 → 1.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/parser_x.js +1 -1
  2. package/package.json +1 -1
package/dist/parser_x.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I(require("parser_helper_x.js"),require("axios")):"function"==typeof define&&define.amd?define([,"axios"],I):"object"==typeof exports?exports.parser_x=I(require("parser_helper_x.js"),require("axios")):A.parser_x=I(A.parser_helper_x,A.axios)}(window,(function(A,I){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}([function(A,I,g){"use strict";g.r(I),g.d(I,"OFDPrintApi",(function(){return V})),g.d(I,"ajaxUtils",(function(){return j})),g.d(I,"getToSign",(function(){return X})),g.d(I,"packageSigned",(function(){return O})),g.d(I,"free",(function(){return u})),g.d(I,"hashOfdDocument",(function(){return z})),g.d(I,"parseOfdDocument",(function(){return v})),g.d(I,"parseOfdDocumentFromBase64",(function(){return _})),g.d(I,"getOFDPageCount",(function(){return $})),g.d(I,"getAllAttachments",(function(){return AA})),g.d(I,"getAttachmentById",(function(){return IA})),g.d(I,"getAttachmentArrayBuffer",(function(){return gA})),g.d(I,"pageSize",(function(){return BA})),g.d(I,"getCustomTag",(function(){return QA})),g.d(I,"getTextObjects",(function(){return CA})),g.d(I,"renderOfd",(function(){return EA})),g.d(I,"renderOfdByIndex",(function(){return DA})),g.d(I,"getFileStream",(function(){return oA})),g.d(I,"setLanguage",(function(){return wA})),g.d(I,"openMetaBaseViewer",(function(){return GA})),g.d(I,"openOFDBaseViewer",(function(){return FA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return NA})),g.d(I,"verifySignature",(function(){return yA})),g.d(I,"printOFD",(function(){return hA})),g.d(I,"getEventBus",(function(){return RA})),g.d(I,"initOFDViewer",(function(){return MA})),g.d(I,"openOFDViewer",(function(){return UA})),g.d(I,"openFile",(function(){return cA})),g.d(I,"openFileBase64",(function(){return aA})),g.d(I,"openOFD",(function(){return sA})),g.d(I,"openOFDWithHeader",(function(){return kA}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=g(6),i=g.n(D),o=g(7),w=g.n(o),G=g(9),F=g(12),N=g(20),y=g(88),h=g(89),R=g(90),M=g(91),U=g(92),c=g(93),a=g(94),s=g(96),k=g(35),S=g(98),Y=g(32),K=g(30),H=g(36),J=g(99),L=g(100),t=g.n(L),d=g(101),e=g(102),n=g(103),l=g(104),Z=g(31),r=g(105),q=g.n(r),W=g(106),f=g.n(W),x=g(107);function p(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return b(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return b(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function b(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var V=S.Print_api,m=window.Module,T={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},j=f.a,X=function(A,I){return Object(Y.JSGetToSign)(A,I)},O=function(A,I){return Object(Y.JSPackageSigned)(A,I)},u=function(){T.ofdCore&&Object(Y.freeOFD)(T.ofdCore)},z=function(A){if(A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){A.success&&A.success(Object(Y.JSBase64ByHashFile)(I.result,A.list,A.method))}}else A.ofd instanceof ArrayBuffer?A.success&&A.success(Object(Y.JSBase64ByHashFile)(A.ofd,A.list,A.method)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(Y.readOFD)(I.data,A.secret,A.digest);P(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},P=function(A,I){0===A.code?(T.ofdCore=new k.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(T.waterText=I.waterText),I.digest||(T.waterText="demotest"),I.signatureClickCallback&&(T.eventBus=new F.EventBus,T.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(T.ofdCore.getAllSignature(0)),I.success&&I.success(T.ofdCore)):I.fail&&I.fail(A.msg)},v=function(A){iA(i()(w.a.mark((function I(){var g,B,Q;return w.a.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(T.ofdCore&&(Object(Y.freeOFD)(T.ofdCore),T.ofdCore=null,T.ofdRender=null),Object(Y.CreateLibrary)(),!(A.ofd instanceof File)){I.next=8;break}(g=new FileReader).readAsArrayBuffer(A.ofd),g.onload=function(){var I=Object(Y.readOFD)(g.result,A.secret,A.digest);P(I,A)},I.next=20;break;case 8:if(!(A.ofd instanceof Blob)){I.next=19;break}return I.t0=Y.readOFD,I.next=12,A.ofd.arrayBuffer();case 12:I.t1=I.sent,I.t2=A.secret,I.t3=A.digest,B=(0,I.t0)(I.t1,I.t2,I.t3),P(B,A),I.next=20;break;case 19:A.ofd instanceof ArrayBuffer?(Q=Object(Y.readOFD)(A.ofd,A.secret,A.digest),P(Q,A)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");T.fileName=g[g.length-1]}var B=Object(Y.readOFD)(I.data,A.secret,A.digest);P(B,A)})).catch((function(I){A.fail&&A.fail(I)}));case 20:case"end":return I.stop()}}),I)}))))},_=function(A){iA((function(){T.ofdCore&&(Object(Y.freeOFD)(T.ofdCore),T.ofdCore=null,T.ofdRender=null),Object(Y.CreateLibrary)();var I=Object(Y.readOFDByBase64)(A.ofd,A.secret,A.digest);P(I,A)}))},$=function(A){return T.ofdCore.getOFDPageCount(A)},AA=function(A){return T.ofdCore.getAllAttachment(A)},IA=function(A,I){return T.ofdCore.getAttachmentByID(A,I)},gA=function(A,I){return new Promise((function(g,B){var Q=T.ofdCore.getAttachmentByID(A,I);Q?gI(Q.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},BA=function(A,I,g){var B=96;g&&(B=g/T.ofdCore.pageWidth(A,I)*25.4);var Q=new H.Ofd_Core_Helper(B);return{width:T.ofdCore.pageWidth(A,I),height:T.ofdCore.pageHeight(A,I),renderWidth:Q.pageRenderWidth(A,I,T.ofdCore),renderHeight:Q.pageRenderHeight(A,I,T.ofdCore)}},QA=function(A){return T.ofdCore.getCustomTag(A)},CA=function(A){return T.ofdCore.getAllTextObject(A)},EA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/T.ofdCore.pageWidth(A,0)*25.4);var Q=new H.Ofd_Core_Helper(B);g.waterText?Q.setWaterText(g.waterText):T.waterText&&Q.setWaterText(T.waterText),T.ofdRender?T.ofdRender.setDpi(B):T.ofdRender=new K.Ofd_Render(T.ofdCore,Q),g.mixBlendMode&&T.ofdRender.setMixBlendMode(g.mixBlendMode);var C=[];if(!T.ofdCore.readOfdDocument(A))return C;var E=T.ofdCore.getOFDPageCount(A);g.frontPages>0&&g.frontPages<E&&(E=g.frontPages);for(var D=0;D<E;D++){var i=document.createElement("div"),o=Q.pageRenderWidth(0,D,T.ofdCore),w=Q.pageRenderHeight(0,D,T.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),T.ofdRender.renderPage(i,0,D),C.push(i)}return C},DA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},Q=96;g&&"number"==typeof g&&!isNaN(g)&&(Q=g/T.ofdCore.pageWidth(A,I)*25.4);var C=new H.Ofd_Core_Helper(Q);B.waterText?C.setWaterText(B.waterText):T.waterText&&C.setWaterText(T.waterText),T.ofdRender?T.ofdRender.setDpi(Q):T.ofdRender=new K.Ofd_Render(T.ofdCore,C),B.mixBlendMode&&T.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=C.pageRenderWidth(0,I,T.ofdCore),i=C.pageRenderHeight(0,I,T.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),T.ofdRender.renderPage(E,0,I),E},iA=function(A){if(m)Object(Y.setYYDS)(m),A&&A();else{Object(Y.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;t()({locateFile:function(){return d.wsdsb}}).then((function(I){var g=I.Module;Object(Y.setYYDS)(g),A&&A()}))}},oA=function(){return Object(Y.getStreamData)()},wA=function(A){T.viewer.toolbar&&T.viewer.toolbar.setLanguage(A)},GA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}T.ofdCore&&(T.eventBus=new F.EventBus,T.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(T.ofdCore))},FA=function(A){setTimeout((function(){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}v({ofd:A.ofd,secret:A.secret,digest:A.digest,headers:A.headers,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(I),A.renderOFDCallback&&A.renderOFDCallback()},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,A.container.appendChild(g)}})}),200)},NA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}_({ofd:A.ofd,secret:A.secret,digest:A.digest,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I.ofd),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(I)},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.textContent=I,A.container.appendChild(g)}})},yA=function(A){var I=T.ofdCore.findSignature(0,A.pageRef,A.signatureId),g={signer:I.SignCert.subject,provider:I.SignedInfo.Provider.ProviderName,hashedValue:I.HashHex,HashValid:I.HashValid,signedValue:I.signatureHex,signMethod:I.SignedInfo.SignatureMethod,signVersion:I.SignedInfo.Seal.esVersion,signatureVerify:I.SignatureValid,sealID:I.SignedInfo.Seal.esID,sealName:I.SignedInfo.Seal.Property.name,sealType:I.SignedInfo.Seal.Property.type,sealAuthTime:"".concat(I.SignedInfo.Seal.Property.validStart," 至 ").concat(I.SignedInfo.Seal.Property.validEnd),sealMakeTime:I.SignedInfo.Seal.Property.createDate,sealVersion:I.SignedInfo.Seal.Header.version};A.signatureCallback&&A.signatureCallback(g),setTimeout((function(){var g,B="",Q=p(I.SignedInfo.References);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B+="".concat(Object(Z.replaceFirstSlash)(C.FileRef),"|")}}catch(A){Q.e(A)}finally{Q.f()}var E,D=Object(Y.hashPath)(T.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=p(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,G=w.CheckValue,F=D["".concat(Object(Z.replaceFirstSlash)(w.FileRef))];i&=G===F}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},hA=function(){T.viewer.ofdPrint&&xA()},RA=function(){return T.viewer.eventBus},MA=function(A){UA(A)},UA=function(A){var I;T.viewer&&((I=T.viewer.eventBus)._off("resize",eA),I._off("fileinputchange",nA),I._off("openfile",KA),I._off("nextpage",rA),I._off("previouspage",qA),I._off("pagenumberchanged",WA),I._off("pagechanging",fA),I._off("print",xA),I._off("firstpage",lA),I._off("lastpage",ZA),I._off("zoomin",pA),I._off("zoomout",bA),I._off("scalechanging",VA),I._off("scalechanged",TA),I._off("viewportchanging",mA),I._off("switchspreadmode",jA),I._off("scrollmodechanged",XA),I._off("switchscrollmode",OA),I._off("rotatecw",uA),I._off("rotateccw",zA),I._off("documentproperties",PA),I._off("signatureclick",_A),I._off("attachmentclick",$A),I._off("customtagclick",II),I._off("download",LA),I._off("langchanged",JA),I._off("pageViewerClick",AI),I._off("closePage",HA),I._off("printCallback",tA),I._off("printFinishCallback",dA)),T.viewer=new YA(A)},cA=function(A){sA(A)},aA=function(A){T.viewer&&(A?(T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer),_({ofd:A,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A}})):T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail("file undefined"))},sA=function(A){SA({file:A})},kA=function(A,I){SA({file:A,headers:I})},SA=function(A){T.viewer&&(A.file?(T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer),v({ofd:A.file,headers:A.headers,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?T.viewer.l10n.get("error_10001").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&T.viewer.l10n.get("error_10002").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A}))}})):T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail("file undefined"))},YA=Q()((function A(I){var g=this;E()(this,A),this.config=I,this.l10n=new G.GenericL10n("zh-CN"),this.eventBus=new F.EventBus,this.ofdViewer=new N.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),I.sidebar.thumbnailView&&(this.ofdThumbnailViewer=new y.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),this.ofdSignatureViewer=new e.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new n.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new x.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new h.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.overlayManager=new R.OverlayManager,I.signatureProperties&&(this.signatureProperties=new J.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new M.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new U.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new c.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var B=document.createElement("input");B.id="fileInput",B.className="fileInput",B.setAttribute("type","file"),B.setAttribute("accept",".ofd"),document.body.appendChild(B);var Q=this;B.addEventListener("click",(function(A){A.target.value=null})),B.addEventListener("change",(function(A){var I=A.target.files;I&&0!==I.length&&Q.eventBus.dispatch("fileinputchange",{source:this,fileInput:A.target,eventBus:Q.eventBus})})),new a.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var C=document.getElementById("printServiceDialog");C&&(this.ofdPrint=new s.Print(C,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback));var D=I.appContainer||document.documentElement;this.l10n.translate(D).then((function(){g.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",tA),this.eventBus._on("printFinishCallback",dA),this.eventBus._on("resize",eA),this.eventBus._on("fileinputchange",nA),this.eventBus._on("openfile",KA),this.eventBus._on("nextpage",rA),this.eventBus._on("previouspage",qA),this.eventBus._on("pagenumberchanged",WA),this.eventBus._on("pagechanging",fA),this.eventBus._on("print",xA),this.eventBus._on("firstpage",lA),this.eventBus._on("lastpage",ZA),this.eventBus._on("zoomin",pA),this.eventBus._on("zoomout",bA),this.eventBus._on("scalechanging",VA),this.eventBus._on("viewportchanging",mA),this.eventBus._on("scalechanged",TA),this.eventBus._on("switchspreadmode",jA),this.eventBus._on("scrollmodechanged",XA),this.eventBus._on("switchscrollmode",OA),this.eventBus._on("rotatecw",uA),this.eventBus._on("rotateccw",zA),this.eventBus._on("documentproperties",PA),this.eventBus._on("signatureclick",_A),this.eventBus._on("attachmentclick",$A),this.eventBus._on("customtagclick",II),this.eventBus._on("download",LA),this.eventBus._on("langchanged",JA),this.eventBus._on("pageViewerClick",AI),this.eventBus._on("closePage",HA),window.addEventListener("click",vA),window.addEventListener("resize",(function(){g.eventBus.dispatch("resize",{source:window})})),I.errorWrapper.closeButton.onclick=function(){I.errorWrapper.container.hidden=!0},I.toolbar.presentationModeButton&&(I.toolbar.presentationModeButton.hidden=!0),I.toolbar.viewBookmark&&(I.toolbar.viewBookmark.hidden=!0),I.secondaryToolbar.presentationModeButton&&(I.secondaryToolbar.presentationModeButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),C&&"function"!=typeof C.showModal&&(C&&(C.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function KA(){document.getElementById("fileInput").click()}function HA(){T.viewer.config.closeCallback&&T.viewer.config.closeCallback()}function JA(A){T.viewer.l10n.setLanguage(A.value),T.viewer.l10n.translate(T.viewer.appContainer).then((function(){T.viewer.eventBus.dispatch("localized",{})}))}function LA(){var A=Object(Y.getStreamData)();if(A){if(T.viewer.config.downloadCallback)T.viewer.config.downloadCallback(new Blob([A]));else{var I=window.URL.createObjectURL(new Blob([A])),g=document.createElement("a");g.style.display="none",g.href=I,g.setAttribute("download",T.fileName),document.body.append(g),g.click()}T.viewer.config.downloadFinishEvent&&T.viewer.config.downloadFinishEvent()}var B=Object(Y.getStreamDataBase64)();if(B){var Q=function(A){for(var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",g=atob(A),B=[],Q=0;Q<g.length;Q++)B.push(g.charCodeAt(Q));var C=new Uint8Array(B);return new Blob([C],{type:I})}(B,"application/ofd");if(T.viewer.config.downloadCallback)T.viewer.config.downloadCallback(Q);else{var C=window.URL.createObjectURL(Q),E=document.createElement("a");E.style.display="none",E.href=C,E.setAttribute("download",T.fileName),document.body.append(E),E.click()}T.viewer.config.downloadFinishEvent&&T.viewer.config.downloadFinishEvent()}}function tA(A){T.viewer.config.onPrintContentCallback&&T.viewer.config.onPrintContentCallback(A.html)}function dA(A){T.viewer.config.onPrintFinishEvent&&T.viewer.config.onPrintFinishEvent()}function eA(){var A=T.ofdCore,I=T.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),T.viewer.eventBus.dispatch("stampResize",{source:null})}}function nA(A){T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.pdfSidebar.isOpen&&T.viewer.pdfSidebar.close();var I=A.fileInput.files[0];T.fileName=I.name,T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer);(new Date).getTime();v({ofd:I,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?T.viewer.l10n.get("error_10001").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&T.viewer.l10n.get("error_10002").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A}))}})}function lA(){T.viewer.ofdViewer.firstPage()}function ZA(){T.viewer.ofdViewer.lastPage()}function rA(){T.viewer.ofdViewer.nextPage()}function qA(){T.viewer.ofdViewer.previousPage()}function WA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),T.viewer.toolbar.setPageNumber(A.value,null),T.viewer.secondaryToolbar.setPageNumber(A.value,null)}function fA(A){var I=A.pageNumber;T.viewer.toolbar.setPageNumber(I,null),T.viewer.secondaryToolbar.setPageNumber(I,null),T.viewer.pdfSidebar.isThumbnailViewVisible&&T.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(I),T.viewer.config.onPageChanging&&T.viewer.config.onPageChanging(I)}function xA(){T.viewer.ofdPrint.setOfdCore(T.ofdCore),T.viewer.ofdPrint.open()}function pA(){T.viewer.ofdViewer.increaseScale()}function bA(){T.viewer.ofdViewer.decreaseScale()}function VA(A){T.viewer.toolbar.setPageScale(A.presetValue,A.scale),T.viewer.config.onPageScale&&T.viewer.config.onPageScale(A.scale)}function mA(A){T.viewer.config.onViewportChange&&T.viewer.config.onViewportChange(T.viewer.ofdViewer)}function TA(A){T.viewer.ofdViewer.zoom(A.value)}function jA(A){T.viewer.ofdViewer.setSpreadMode(A.mode)}function XA(A){}function OA(A){T.viewer.ofdViewer.setScrollMode(A.mode)}function uA(){T.viewer.ofdViewer.setRotation(90)}function zA(){T.viewer.ofdViewer.setRotation(-90)}function PA(){T.viewer.ofdDocumentProperties.setOfdCore(T.ofdCore),T.viewer.ofdDocumentProperties.open()}function vA(A){T.viewer.secondaryToolbar.isOpen&&(T.viewer.config.mainContainer.contains(A.target)||T.viewer.config.toolbar.container.contains(A.target)&&A.target!==T.viewer.config.secondaryToolbar.toggleButton)&&T.viewer.secondaryToolbar.close()}function _A(A){if(T.viewer.signatureProperties)if(T.viewer.signatureProperties.setOfdCore(T.ofdCore),A.pageRef||A.signatureId){var I=T.ofdCore.findSignature(0,A.pageRef,A.signatureId);T.viewer.signatureProperties.open(I)}else T.viewer.signatureProperties.open(A.sign.Signature)}function $A(A){var I=A.attachment.FileLocAbs.split("/"),g=A.attachment.Name;g||(g=I[I.length-1]),g.indexOf(".")<0&&(g="".concat(g,".").concat(A.attachment.Format)),gI(A.attachment.FileLocAbs,A.attachment.FileLocPln).then((function(A){var I=window.URL.createObjectURL(new Blob([A])),B=document.createElement("a");B.style.display="none",B.href=I,B.setAttribute("download",g),document.body.append(B),B.click()})).catch((function(A){}))}function AI(A){T.viewer.ofdViewer&&T.viewer.ofdViewer.removeHighLight()}function II(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),T.viewer.toolbar.setPageNumber(A.pageIndex+1,null),T.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function gI(A,I,g){return new Promise((function(g,B){if(Object(Y.getStreamData)()){var Q=Object(Y.JSGetPathEncode)(T.ofdCore.ofdParserPtr,A,I);null!=Q?g(Q):B(1)}}))}},function(A,I,g){var B=g(2);function Q(A,I){for(var g=0;g<I.length;g++){var Q=I[g];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(A,B(Q.key),Q)}}A.exports=function(A,I,g){return I&&Q(A.prototype,I),g&&Q(A,g),Object.defineProperty(A,"prototype",{writable:!1}),A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(4);A.exports=function(A){var I=Q(A,"string");return"symbol"===B(I)?I:String(I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default;A.exports=function(A,I){if("object"!==B(A)||null===A)return A;var g=A[Symbol.toPrimitive];if(void 0!==g){var Q=g.call(A,I||"default");if("object"!==B(Q))return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(A,I,g,B,Q,C,E){try{var D=A[C](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,Q)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(Q,C){var E=A.apply(I,B);function D(A){g(E,Q,C,D,i,"next",A)}function i(A){g(E,Q,C,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(8)();A.exports=B;try{regeneratorRuntime=B}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},function(A,I,g){var B=g(3).default;function Q(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},C=Object.prototype,E=C.hasOwnProperty,D=Object.defineProperty||function(A,I,g){A[I]=g.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",w=i.asyncIterator||"@@asyncIterator",G=i.toStringTag||"@@toStringTag";function F(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{F({},"")}catch(I){F=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var Q=I&&I.prototype instanceof a?I:a,C=Object.create(Q.prototype),E=new l(B||[]);return D(C,"_invoke",{value:t(A,g,E)}),C}function y(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}g.wrap=N;var h="suspendedStart",R="suspendedYield",M="executing",U="completed",c={};function a(){}function s(){}function k(){}var S={};F(S,o,(function(){return this}));var Y=Object.getPrototypeOf,K=Y&&Y(Y(Z([])));K&&K!==C&&E.call(K,o)&&(S=K);var H=k.prototype=a.prototype=Object.create(S);function J(A){["next","throw","return"].forEach((function(I){F(A,I,(function(A){return this._invoke(I,A)}))}))}function L(A,I){function g(Q,C,D,i){var o=y(A[Q],A,C);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&E.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;D(this,"_invoke",{value:function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}})}function t(A,g,B){var Q=h;return function(C,E){if(Q===M)throw new Error("Generator is already running");if(Q===U){if("throw"===C)throw E;return{value:I,done:!0}}for(B.method=C,B.arg=E;;){var D=B.delegate;if(D){var i=d(D,B);if(i){if(i===c)continue;return i}}if("next"===B.method)B.sent=B._sent=B.arg;else if("throw"===B.method){if(Q===h)throw Q=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);Q=M;var o=y(A,g,B);if("normal"===o.type){if(Q=B.done?U:R,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(Q=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,Q=A.iterator[B];if(Q===I)return g.delegate=null,"throw"===B&&A.iterator.return&&(g.method="return",g.arg=I,d(A,g),"throw"===g.method)||"return"!==B&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+B+"' method")),c;var C=y(Q,A.iterator,g.arg);if("throw"===C.type)return g.method="throw",g.arg=C.arg,g.delegate=null,c;var E=C.arg;return E?E.done?(g[A.resultName]=E.value,g.next=A.nextLoc,"return"!==g.method&&(g.method="next",g.arg=I),g.delegate=null,c):E:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,c)}function e(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function n(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function l(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(e,this),this.reset(!0)}function Z(A){if(A||""===A){var g=A[o];if(g)return g.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var Q=-1,C=function g(){for(;++Q<A.length;)if(E.call(A,Q))return g.value=A[Q],g.done=!1,g;return g.value=I,g.done=!0,g};return C.next=C}}throw new TypeError(B(A)+" is not iterable")}return s.prototype=k,D(H,"constructor",{value:k,configurable:!0}),D(k,"constructor",{value:s,configurable:!0}),s.displayName=F(k,G,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===s||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,k):(A.__proto__=k,F(A,G,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},J(L.prototype),F(L.prototype,w,(function(){return this})),g.AsyncIterator=L,g.async=function(A,I,B,Q,C){void 0===C&&(C=Promise);var E=new L(N(A,I,B,Q),C);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},J(H),F(H,G,"Generator"),F(H,o,(function(){return this})),F(H,"toString",(function(){return"[object Generator]"})),g.keys=function(A){var I=Object(A),g=[];for(var B in I)g.push(B);return g.reverse(),function A(){for(;g.length;){var B=g.pop();if(B in I)return A.value=B,A.done=!1,A}return A.done=!0,A}},g.values=Z,l.prototype={constructor:l,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=I,this.done=!1,this.delegate=null,this.method="next",this.arg=I,this.tryEntries.forEach(n),!A)for(var g in this)"t"===g.charAt(0)&&E.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=I)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var g=this;function B(B,Q){return D.type="throw",D.arg=A,g.next=B,Q&&(g.method="next",g.arg=I),!!Q}for(var Q=this.tryEntries.length-1;Q>=0;--Q){var C=this.tryEntries[Q],D=C.completion;if("root"===C.tryLoc)return B("end");if(C.tryLoc<=this.prev){var i=E.call(C,"catchLoc"),o=E.call(C,"finallyLoc");if(i&&o){if(this.prev<C.catchLoc)return B(C.catchLoc,!0);if(this.prev<C.finallyLoc)return B(C.finallyLoc)}else if(i){if(this.prev<C.catchLoc)return B(C.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return B(C.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&E.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var C=Q?Q.completion:{};return C.type=A,C.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,c):this.complete(C)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),c},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),n(g),c}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;n(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:Z(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"GenericL10n",(function(){return N}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(10),g(11)),F=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}))}var I,g,B,C,D;return i()(A,[{key:"setLanguage",value:(D=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(C=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getLanguage());case 4:case"end":return A.stop()}}),A,this)}))),function(){return C.apply(this,arguments)})},{key:"getDirection",value:(B=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getDirection());case 4:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"get",value:(g=Q()(w.a.mark((function A(I){var g,B,Q,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=C.length>1&&void 0!==C[1]?C[1]:null,B=C.length>2&&void 0!==C[2]?C[2]:Object(G.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return Q=A.sent,A.abrupt("return",Q.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=Q()(w.a.mark((function A(I){var g;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return g=A.sent,A.abrupt("return",g.translate(I));case 4:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading",o=!0;function w(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,o),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function G(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}w(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,w){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",h=I.split("-",1)[0],R=!1,M="";!function A(){for(;;){if(!F.length)return void w();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),R="*"!==y&&y!==I&&y!==h;continue}if(R)continue;if(M=o.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function F(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,w,F=0;w=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,w)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var h=y.default_locale.toLowerCase();for(var R in y.locales){if((R=R.toLowerCase())===A){B=y.locales[A];break}R===h&&(B=y.locales[h])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){G(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=h(D=y(D,I,A,E),I,A),C[E]=D}return C}function y(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function h(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function R(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=N(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=N(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){F(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)R(g[Q]);R(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(6),Q=g.n(B),C=g(7),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return s})),g.d(I,"EventBus",(function(){return a})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),Q=g.n(B),C=g(16),E=g.n(C),D=g(18),i=g.n(D),o=g(15),w=g.n(o),G=g(5),F=g.n(G),N=g(1),y=g.n(N);function h(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof a?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof a?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var a=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=R(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=R(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]),this._listeners[A].push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),s=function(A){E()(g,A);var I=h(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(a)},function(A,I,g){var B=g(14);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(17);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(19);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return a}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(21),w=g.n(o),G=g(7),F=g.n(G),N=g(22),y=g(29),h=g(30),R=g(87),M=g(36);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var a=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new h.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new R.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E,D,i,o,w;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=27;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),C=this,E=U(document.getElementsByName("seal_img_div_".concat(g.id-1))),A.prev=8,i=F.a.mark((function A(){var I;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=D.value).addEventListener("click",(function(){C.eventBus.dispatch("signatureclick",{source:C,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 2:case"end":return A.stop()}}),A)})),E.s();case 11:if((D=E.n()).done){A.next=15;break}return A.delegateYield(i(),"t0",13);case 13:A.next=11;break;case 15:A.next=20;break;case 17:A.prev=17,A.t1=A.catch(8),E.e(A.t1);case 20:return A.prev=20,E.f(),A.finish(20);case 23:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),o=0;o<g.id-10;o++)(w=this._pages[o]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(w.div.firstChild),w.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 27:return A.abrupt("return",!1);case 28:case"end":return A.stop()}}),A,this,[[8,17,20,23]])}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I,g){var B=g(2);A.exports=function(A,I,g){return(I=B(I))in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return q})),g.d(I,"AutoPrintRegExp",(function(){return J})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return x})),g.d(I,"binarySearchFirstItem",(function(){return r})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return f})),g.d(I,"getVisibleElements",(function(){return p})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return j})),g.d(I,"isValidSpreadMode",(function(){return X})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return h})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return b})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return V})),g.d(I,"OutputScale",(function(){return L})),g.d(I,"parseQueryString",(function(){return e})),g.d(I,"PresentationModeState",(function(){return s})),g.d(I,"ProgressBar",(function(){return z})),g.d(I,"removeNullCharacters",(function(){return Z})),g.d(I,"RendererType",(function(){return S})),g.d(I,"RenderingStates",(function(){return a})),g.d(I,"roundToDivide",(function(){return W})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return k})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return Y})),g.d(I,"UNKNOWN_SCALE",(function(){return R})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(23),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,h=10,R=0,M=1.25,U=40,c=5,a={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},s={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},k={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},S={CANVAS:"canvas",SVG:"svg"},Y={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},J=/\bprint\s*\(/,L=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function e(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,l=/[\x01-\x1F]/g;function Z(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(l," ")),A.replace(n,""))}function r(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=A.length-1;if(B<0||!I(A[B]))return A.length;if(I(A[g]))return g;for(;g<B;){var Q=g+B>>1;I(A[Q])?B=Q:g=Q+1}return g}function q(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function W(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function f(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function x(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function p(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,h=g.length,R=r(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});R>0&&R<h&&!E&&(R=x(R,g,o));for(var M=E?F:-1,U=R;U<h;U++){var c=g[U],a=c.div,s=a.offsetLeft+a.clientLeft,k=a.offsetTop+a.clientTop,S=a.clientWidth,Y=a.clientHeight,K=s+S,H=k+Y;if(-1===M)H>=w&&(M=H);else if((E?s:k)>M)break;if(!(H<=o||k>=w||K<=G||s>=F)){var J=Math.max(0,o-k)+Math.max(0,H-w),L=(S-(Math.max(0,G-s)+Math.max(0,K-F)))/S,t=(Y-J)/Y*L*100|0;N.push({id:c.id,x:s,y:k,view:c,percent:t,widthPercent:100*L|0}),y.add(c.id)}}var d=N[0],e=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:e,views:N,ids:y}}function b(A){A.preventDefault()}function V(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=V(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function j(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function X(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var u=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var z=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return k.NONE;case"UseThumbs":return k.THUMBS;case"UseOutlines":return k.OUTLINE;case"UseAttachments":return k.ATTACHMENTS;case"UseOC":return k.LAYERS}return k.NONE}},function(A,I,g){var B=g(24),Q=g(25),C=g(26),E=g(28);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C,E,D=[],i=!0,o=!1;try{if(C=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=C.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,Q=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw Q}}return D}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(27);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(22);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var h=I[y-1];if(!C(h))return h}}var R=g?w:o-2,M=I[R];return M&&!C(M)||B&&(M=I[R+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return U}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=g(31),F=g(32),N=g(35),y=(g(36),g(37)),h=g.n(y);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],y=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,a=R(i);try{for(a.s();!(c=a.n()).done;){var s,k=c.value,S=R(w);try{for(S.s();!(s=S.n()).done;){var Y=s.value;if(Y.ID==k.TemplateID){if((Y=B?B.readPageFromTemplate(Y):this.core.readPageFromTemplate(Y)).Page.Content){var K,H=R(Y.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var J=K.value;this.renderLayer(C,Q,g,A,y,h,U,M,J,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){S.e(A)}finally{S.f()}}}catch(A){a.e(A)}finally{a.f()}}if(D.Page.Content){var L,t=R(D.Page.Content.Layer);try{for(t.s();!(L=t.n()).done;){var d=L.value;this.renderLayer(C,Q,g,A,y,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var e,n=R(o);try{for(n.s();!(e=n.n()).done;){var l=e.value;if(D.ID==l.PageID){var Z,r=R(l.PageAnnot.Annot);try{for(r.s();!(Z=r.n()).done;){var q=Z.value;this.renderAnnotation(C,Q,A,q,y,h,U,M,g)}}catch(A){r.e(A)}finally{r.f()}}}}catch(A){n.e(A)}finally{n.f()}var W,f=R(F);try{for(f.s();!(W=f.n()).done;){var x,p=W.value,b=R(p.Signature.SignedInfo.StampAnnot);try{for(b.s();!(x=b.n()).done;){var V=x.value,m=V.PageRef;if(D.ID==m){var T=V.Boundary;if(p.Signature.PicType&&p.Signature.PicType.length>0)if("ofd"===p.Signature.PicType)for(var j=new N.Ofd_Core(p.Signature.ofd),X=0;X<j.getOFDPageCount(0);X++)this.renderSealPage(A,X,j,!0,T,m,V.ID,g,p.Signature.ZipName);else if("svg"===p.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=p.Signature.svg;var z=void 0,P=u.children[0].width.baseVal.value,v=u.children[0].height.baseVal.value;P!==O.w&&(z="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),u.setAttribute("style","".concat(z,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",V.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(p.Signature.PicType,";base64,").concat(p.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,V.Clip,!0,m,V.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),p.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",V.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){f.e(A)}finally{f.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),h=document.createElement("div");h.setAttribute("name","seal_img_div_".concat(D)),h.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),h.setAttribute("data-signature-id",E),h.setAttribute("data-page-ref",C),this.renderPage(h,0,I,g,E,i);var R=document.createElement("div");R.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),R.appendChild(h),A.appendChild(R)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var a=Object(G.getDrawParam)(C,c.Relative);a&&(a.StrokeColor&&(c.StrokeColor=a.StrokeColor),a.FillColor&&(c.FillColor=a.FillColor),a.LineWidth&&(c.LineWidth=a.LineWidth))}c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var s=i.PageBlock;if(s){var k,S=R(s);try{for(S.s();!(k=S.n()).done;){var Y=k.value;if("ImageObject"==Y.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,Y,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==Y.Type){var H=this.renderPathObject(A,I,g,C,Y,y,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==Y.Type){if(i.ctm){var J=i.ctm.split(" ");Y.CTM={a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}var L=this.renderTextObject(B,Q,Y,y,h,C,w,F,N);B.appendChild(L)}else if("CompositeObject"==Y.Type){var t,d=R(D);try{for(d.s();!(t=d.n()).done;){var e=t.value;if(e.ID===Y.ResourceID){var n=Y.Alpha,l=Y.Boundary,Z=Y.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,e,!1,n,l,Z);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){S.e(A)}finally{S.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var h=Object(G.getMultiMedia)(C,y);if(!h.MediaFile)return null;var R,M=E.ImageMask;if(M>0&&(R=Object(G.getMultiMedia)(C,M)).MediaFile&&!(R.width>0||R.height>0)&&R.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);U.ext,R.width=U.width,R.height=U.height,R.FileBase64=U.fileBase64}if(!(h.width>0||h.height>0)&&h.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;h.width=c.width,h.height=c.height,h.FileBase64=c.fileBase64}var a=E.CTM,s=E.Clips,k=E.BlendMode,S=E.Alpha;return this.renderImageOnDiv(g,B,Q,h.FileBase64,h.width,h.height,N,!1,D,null,null,a,i,o,s,E.ID,k,S,M>0&&R.FileBase64?R.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,y,h,M,U,c,a,s){var k=parseFloat(I.replace("px","")),S=parseFloat(g.replace("px","")),Y=E.w>k?k:E.w,K=E.h>S?S:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),J=document.createElementNS("http://www.w3.org/2000/svg","image"),L="";i&&(L="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(Y," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),J.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;J.setAttribute("xlink:href",B),J.href.baseVal=B,J.setAttribute("width","".concat(t,"px")),J.setAttribute("height","".concat(d,"px")),c&&J.setAttribute("opacity","".concat(c/255));var e="";if(F){var n=1,l=1;if(s){var Z=s.split(" ");n=Z[0],l=Z[3]}e="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*l," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}y&&(e="".concat(e," matrix(").concat(y.a," ").concat(y.b," ").concat(y.c," ").concat(y.d," ").concat(Object(G.converterDpi)(y.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(y.f,this.coreHelper.dpi),")")),J.setAttribute("transform",e);var r="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),r="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var q=[];if(h&&h.length>0)for(var W=0;W<h.length;W++){var f=document.createElementNS("http://www.w3.org/2000/svg","clipPath");f.setAttribute("id","image-clip-path-".concat(M,"-").concat(W));for(var x=h[W].Clip,p=0;p<x.length;p++){var b=x[p].Area,V=0,m=0,T=0,j=0;b.Path.Boundary&&(V=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,j=b.Path.Boundary.h);var X=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)F=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");X.setAttribute("transform",O)}var u,z="",P=R(b.Path.AbbreviatedData);try{for(P.s();!(u=P.n()).done;){var v=u.value;"M"===v.cmd||"S"===v.cmd?z+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}X.setAttribute("d",z),f.appendChild(X)}q.push(f)}if(a){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",a),$.href.baseVal=a,$.setAttribute("width","".concat(t,"px")),$.setAttribute("height","".concat(d,"px")),$.setAttribute("filter"," invert(100%)"),_.appendChild($),H.appendChild(_),J.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(J);var AA,IA=E.x,gA=E.y;if(y){var BA=y.a,QA=y.b,CA=y.c,EA=y.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(L,"overflow: visible; position: absolute; width: ").concat(Y,"px; height: ").concat(K,"px; ").concat(r,";").concat(AA,";");if(q.length>0)if(1==q.length)H.appendChild(q[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=R(q);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,y=g.HScale,M=g.Font,U=g.Weight,c=g.Alpha/255,a=g.Size>0;N&&!a&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var s=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),k=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,a,y),S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("version","1.1"),S.setAttribute("id",g.ID);var Y,K,H,J=g.FillColor,L=!1,t=g.DrawParam;if(t){var d=Object(G.getDrawParam)(C,t);d.FillColor&&(J&&J.Value||(J=d.FillColor))}if(J){J.Value&&(B=Object(G.parseColor)(J.Value)),o=J.alpha/255;var e=J.axialShd;if(e){L=!0;var n=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");n.setAttribute("id","".concat(g.ID)),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","100%");var l,Z=R(e.Segment);try{for(Z.s();!(l=Z.n()).done;){var r=l.value;if(r){var q=document.createElement("stop");q.setAttribute("offset","".concat(100*r.position,"%")),q.setAttribute("style","stop-color:".concat(Object(G.parseColor)(r.color.Value),";stop-opacity:1")),n.appendChild(q),B=Object(G.parseColor)(r.color.Value)}}}catch(A){Z.e(A)}finally{Z.f()}S.appendChild(n)}}g.Stroke&&(Y=Object(G.parseColor)(g.StrokeColor.Value),K=g.LineWidth,H=g.LineWidth),g.Fill||(o=0);var W=w.w,f=w.h,x=w.x,p=w.y,b=s,V=s,m=0;if(N){var T=N.a,j=N.b,X=N.c,O=N.d,u=T>0?Math.sign(T)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),z=O>0?Math.sign(O)*Math.sqrt(j*j+O*O):Math.sqrt(j*j+O*O);0==(m=Math.atan2(-j,O))&&0!=T&&1==O||(b*=u,V*=z,H*=u),0==m&&0!=T&&1==O&&(b*=u,V*=z,H*=u),0==m&&y-0==1&&(y=T/O)>0&&(b*=y)}if(i){var P=i.a,v=i.b,_=i.c,$=i.d,AA=P>0?Math.sign(P)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),IA=$>0?Math.sign($)*Math.sqrt(v*v+$*$):Math.sqrt(v*v+$*$);0==(m=Math.atan2(-v,$))&&0!=P&&1==$||(b*=AA,V*=IA,p*=IA,x*=AA,W*=AA,f*=IA)}var gA=Object(G.getFont)(I,M),BA="",QA="",CA="",EA="";N&&(EA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(EA="".concat(EA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),y&&(EA="".concat(EA," scale(").concat(y,", 1)"));for(var DA=!1,iA=0;iA<k.length;iA++){var oA=k[iA];if(oA&&!isNaN(oA.x)){if(oA.glyph&&gA&&gA.face){DA=!0;var wA=Object(F.loadFaceInfo)(gA.face),GA=Object(F.FT_Glyph_Get_Measure)(gA.face,oA.glyph),FA=this.drawGlyph(GA.glyphPath,GA.horiUnderlinePosition,wA.units_per_EM,b,V,Q||B,o,Y,H,g.ID);if(0===m)FA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(oA.cx),"px; top: ").concat(oA.cy-FA.yScale*GA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),A.appendChild(FA.img);else{var NA=document.createElement("div");NA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-m,"rad);position:absolute; left: ").concat(oA.cx,"px; top: ").concat(oA.cy-FA.yScale*GA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),FA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),NA.appendChild(FA.img),A.appendChild(NA)}}if(BA=y?"".concat(BA).concat(oA.x+y*oA.x," "):"".concat(BA).concat(oA.x," "),QA="".concat(QA).concat(oA.y," "),CA=" "==oA.text?"".concat(CA," "):"".concat(CA).concat(oA.text),k.length>1&&y){var yA=document.createElementNS("http://www.w3.org/2000/svg","text");yA.setAttribute("x",oA.x),yA.setAttribute("y",oA.y),yA.innerHTML=oA.text,yA.setAttribute("transform",EA),L?yA.setAttribute("fill",B):(yA.setAttribute("fill",Q),yA.setAttribute("fill",B),yA.setAttribute("fill-opacity",DA?0:o<c?o:c)),DA||(hA&&S.appendChild(hA),yA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&K>0&&(yA.setAttribute("stroke",Y),yA.setAttribute("stroke-width",Object(G.converterDpi)(K,this.coreHelper.dpi))),yA.setAttribute("style","font-weight: ".concat(U,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(gA),";")),DA||S.appendChild(yA)}}}var hA=null,RA=g.Clips;if(RA&&RA.length>0){for(var MA=[],UA=0;UA<RA.length;UA++){(hA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(UA));for(var cA=RA[UA].Clip,aA=0;aA<cA.length;aA++){var sA=cA[aA].Area,kA=document.createElementNS("http://www.w3.org/2000/svg","path"),SA="",YA=0,KA=0;sA.Path.Boundary&&(YA=sA.Path.Boundary.x,KA=sA.Path.Boundary.y),DA&&(KA=-KA);var HA,JA=R(sA.Path.AbbreviatedData);try{for(JA.s();!(HA=JA.n()).done;){var LA=HA.value;"M"===LA.cmd||"S"===LA.cmd?SA+="M ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," "):"L"===LA.cmd?SA+="L ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," "):"B"===LA.cmd?SA+="C ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[4]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5]+KA,this.coreHelper.dpi)," "):"Q"===LA.cmd?SA+="Q ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+KA,this.coreHelper.dpi)," "):"A"===LA.cmd?SA+="A ".concat(Object(G.converterDpi)(LA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[6],this.coreHelper.dpi)):"C"===LA.cmd&&(SA+="Z")}}catch(A){JA.e(A)}finally{JA.f()}kA.setAttribute("d",SA),hA.appendChild(kA),MA.push(hA)}}if(MA.length>0)if(1==MA.length)S.appendChild(MA[0]);else{var tA,dA=R(MA);try{for(dA.s();!(tA=dA.n()).done;){var eA=tA.value;void 0!==eA.children[0].getAttribute("d")&&"clip-path:path('".concat(eA.children[0].getAttribute("d"),"');")}}catch(A){dA.e(A)}finally{dA.f()}}}if(!y){var nA=document.createElementNS("http://www.w3.org/2000/svg","text");if(nA.setAttribute("x",BA),nA.setAttribute("y",QA),nA.textContent=CA,nA.setAttribute("transform",EA),L?nA.setAttribute("fill",B):(nA.setAttribute("fill",Q),nA.setAttribute("fill",B),nA.setAttribute("fill-opacity",DA?0:o<c?o:c)),g.Visible||nA.setAttribute("fill-opacity",0),DA||(hA&&S.appendChild(hA),nA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&K>0&&(nA.setAttribute("stroke",Y),nA.setAttribute("stroke-width",Object(G.converterDpi)(K,this.coreHelper.dpi))),nA.setAttribute("style","font-weight: ".concat(U,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(gA),";")),Object(G.getFontFamily)(gA)&&Object(G.getFontFamily)(gA).indexOf("BarCode")>=0)return"*"==CA||(h()(S,CA,{width:5,fontSize:s,text:"*".concat(CA,"*")}),S.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(f,"px;left:").concat(x,"px;top:").concat(p,"px;")),S.childNodes[1].lastChild.style.letterSpacing="20px"),S;DA&&(nA.setAttribute("fill",""),nA.setAttribute("stroke","")),S.appendChild(nA)}if(D){var lA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=lA.x,p+=lA.y}return S.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(f,"px;left:").concat(x,"px;top:").concat(p,"px;")),S}},{key:"renderPathObjectByCanvas",value:function(A,I,g,B,Q,C,E,D,i,o,w){var F=I.Boundary;if(F){F=Object(G.converterBox)(F,this.coreHelper.dpi);var N=Math.ceil(F.w),y=Math.ceil(F.h),h=F.x,M=F.y;if(N-0!=0&&y-0!=0){var U=document.createElement("canvas"),c=U.getContext("2d");U.width=1*N,U.height=1*y,U.style.width="".concat(N,"px"),U.style.height="".concat(y,"px");var a=I.LineWidth,s=I.AbbreviatedData,k=I.CTM,S=I.StrokeColor,Y=I.FillColor;a&&(Q=Object(G.converterDpi)(a,this.coreHelper.dpi));var K=I.DrawParam;if(K){var H=Object(G.getDrawParam)(A,K);(a=H.LineWidth)&&(Q=Object(G.converterDpi)(a,this.coreHelper.dpi)),H.FillColor&&(Y&&Y.Value||(Y=H.FillColor)),H.StrokeColor&&(S&&S.Value||(S=H.StrokeColor))}k&&c.transform(k.a,k.b,k.c,k.d,Object(G.converterDpi)(k.e,this.coreHelper.dpi),Object(G.converterDpi)(k.f,this.coreHelper.dpi));var J=!1;if(S){S.Value&&(B=Object(G.parseColor)(S.Value));var L=S.axialShd;if(L){J=!0;var t,d=Object(G.parseCtm)(L.StartPoint),e=Object(G.parseCtm)(L.EndPoint),n=c.createLinearGradient(d[0],d[1],e[0],e[1]),l=R(L.Segment);try{for(l.s();!(t=l.n()).done;){var Z=t.value;Z&&n.addColorStop(Z.position,Object(G.parseColor)(Z.color.Value))}}catch(A){l.e(A)}finally{l.f()}c.lineWidth=Q,c.strokeStyle=n}}var r=!1;if(Y){Y.Value&&(g=Object(G.parseColor)(Y.Value)),Y.Alpha&&0===Y.Alpha&&(c.globalAlpha=0);var q=Y.AxialShd;if(q){r=!0;var W,f=Object(G.parseCtm)(q.StartPoint),x=Object(G.parseCtm)(q.EndPoint),p=c.createLinearGradient(f[0],f[1],x[0],x[1]),b=R(q.Segment);try{for(b.s();!(W=b.n()).done;){var V=W.value;V&&p.addColorStop(V.position,Object(G.parseColor)(V.color.Value))}}catch(A){b.e(A)}finally{b.f()}c.fillStyle=p}}Q>0&&!B&&((B=g)||(B="rgb(0, 0, 0)"));var m=I.Clips;if(m&&m.length>0)for(var T=[],j=0;j<m.length;j++){for(var X=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),O=m[j].Clip,u=0;u<O.length;u++){var z=O[u].Area,P=document.createElementNS("http://www.w3.org/2000/svg","path"),v=0,_=0,$=0,AA=0;if(z.Path.Boundary&&(v=z.Path.Boundary.x,_=z.Path.Boundary.y,$=z.Path.Boundary.w,AA=z.Path.Boundary.h),!z.TransFlag&&z.CTM){var IA=z.CTM,gA=void 0;if(gA=k?"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e-k.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f-k.f,this.coreHelper.dpi),")"):"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f,this.coreHelper.dpi),")"),k){var BA=[[k.a,k.c,0],[k.b,k.d,0],[0,0,1]],QA=Object(G.inv)(BA);isNaN(QA[0][0])||QA[0][0]===1/0||(gA="".concat(gA," matrix(").concat(QA[0][0]," ").concat(QA[1][0]," ").concat(QA[0][1]," ").concat(QA[1][1]," 0 0)"))}P.setAttribute("transform",gA)}if(!z.TransFlag&&z.Path.CTM){var CA=z.Path.CTM,EA="matrix(".concat(CA.a," ").concat(CA.b," ").concat(CA.c," ").concat(CA.d," ").concat(Object(G.converterDpi)(CA.e-k.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(CA.f-k.f,this.coreHelper.dpi),")");if(k){var DA=[[k.a,k.c,0],[k.b,k.d,0],[0,0,1]],iA=Object(G.inv)(DA);isNaN(iA[0][0])||iA[0][0]===1/0||(EA="".concat(EA," matrix(").concat(iA[0][0]," ").concat(iA[1][0]," ").concat(iA[0][1]," ").concat(iA[1][1]," 0 0)"))}P.setAttribute("transform",EA)}c.beginPath();var oA,wA=R(z.Path.AbbreviatedData);try{for(wA.s();!(oA=wA.n()).done;){var GA=oA.value;"M"===GA.cmd||"S"===GA.cmd?c.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"L"===GA.cmd?c.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"B"===GA.cmd&&c.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[2]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[3]+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[4]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[5]+_,this.coreHelper.dpi))}}catch(A){wA.e(A)}finally{wA.f()}c.closePath(),c.clip()}T.push(X)}if(I.Join&&c.setLineJoin(I["@_Join"]),I.Cap&&c.setLineCap(I["@_Cap"]),I.DashPattern){var FA=I.DashPattern,NA=Object(G.parseCtm)(FA);I.DashOffset&&I.DashOffset,c.setLineDash([Object(G.converterDpi)(NA[0],this.coreHelper.dpi),Object(G.converterDpi)(NA[1],this.coreHelper.dpi)])}c.beginPath();var yA,hA=R(s);try{for(hA.s();!(yA=hA.n()).done;){var RA=yA.value;"M"===RA.cmd||"S"===RA.cmd?c.moveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"L"===RA.cmd?c.lineTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"B"===RA.cmd?c.bezierCurveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[5],this.coreHelper.dpi)):"Q"===RA.cmd?c.quadraticCurveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[3],this.coreHelper.dpi)):"A"===RA.cmd||"C"===RA.cmd&&c.closePath()}}catch(A){hA.e(A)}finally{hA.f()}I.Stroke&&(J||(c.strokeStyle=B,c.lineWidth=Q),c.stroke());var MA=Y.pattern;if(!I.Fill||MA?c.fillStyle="none":(r||(c.fillStyle=g),c.fill(I.Rule)),D){var UA=document.createElement("canvas"),cA=Object(G.converterBox)(D,this.coreHelper.dpi),aA=cA.w,sA=cA.h;cA.x,cA.y;UA.width=1*aA,UA.height=1*sA,UA.style.width="".concat(aA,"px"),UA.style.height="".concat(sA,"px");var kA=UA.getContext("2d");i&&kA.transform(i.a,i.b,i.c,i.d,Object(G.converterDpi)(i.e,this.coreHelper.dpi),Object(G.converterDpi)(i.f,this.coreHelper.dpi)),E&&(kA.globalAlpha=E/255),kA.drawImage(U,h,M)}return U}}}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,y){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};var U=(M=Object(G.converterBox)(M,this.coreHelper.dpi)).w,c=M.h,a=M.x,s=M.y,k="overflow:hidden;position:absolute;width:".concat(Math.ceil(U),"px;height:").concat(Math.ceil(c),"px;"),S=Q.Clips;if(S&&S.length>1)return{svg:this.renderPathObjectByCanvas(d,Q,C,E,D,i,o,w,F,N,y),style:k,left:a,top:s};var Y=Q.LineWidth,K=Q.AbbreviatedData,H=Q.StrokeColor,J=Q.FillColor,L=Q.CTM,t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("ID",Q.ID),Y&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi));var d=Q.DrawParam;if(d){var e=Object(G.getDrawParam)(B,d);(Y=e.LineWidth)&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi)),e.FillColor&&(J&&J.Value||(J=e.FillColor)),e.StrokeColor&&(H&&H.Value||(H=e.StrokeColor))}L?t.setAttribute("transform","matrix(".concat(L.a," ").concat(L.b," ").concat(L.c," ").concat(L.d," ").concat(Object(G.converterDpi)(L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(L.f,this.coreHelper.dpi),")")):F&&t.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(H){H.Value&&(E=Object(G.parseColor)(H.Value));var n=H.axialShd;if(n){!0;var l=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");l.setAttribute("id","".concat(Q.ID)),l.setAttribute("x1","0%"),l.setAttribute("y1","0%"),l.setAttribute("x2","100%"),l.setAttribute("y2","100%");var Z,r=R(n.Segment);try{for(r.s();!(Z=r.n()).done;){var q=Z.value;if(q){var W=document.createElement("stop");W.setAttribute("offset","".concat(100*q.position,"%")),W.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),l.appendChild(W),E=Object(G.parseColor)(q.color.Value)}}}catch(A){r.e(A)}finally{r.f()}h.appendChild(l)}}if(J){J.Value&&(C=Object(G.parseColor)(J.Value)),void 0!==J.Alpha&&0===J.Alpha&&(C="none"),void 0!==J.alpha&&0===J.alpha?C="none":t.setAttribute("fill-opacity","".concat(J.alpha/255));var f=J.axialShd;if(f){!0;var x=document.createElement("linearGradient");x.setAttribute("id","".concat(Q.ID)),x.setAttribute("x1","0%"),x.setAttribute("y1","0%"),x.setAttribute("x2","100%"),x.setAttribute("y2","100%");var p,b=R(f.Segment);try{for(b.s();!(p=b.n()).done;){var V=p.value;if(V){var m=document.createElement("stop");m.setAttribute("offset","".concat(100*V.position,"%")),m.setAttribute("style","stop-color:".concat(Object(G.parseColor)(V.color.Value),";stop-opacity:1")),x.appendChild(m),C=Object(G.parseColor)(V.color.Value)}}}catch(A){b.e(A)}finally{b.f()}h.appendChild(x)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&t.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(t.setAttribute("stroke","".concat(E)),t.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(t.setAttribute("fill-rule",Q.Rule),t.setAttribute("fill","".concat(i?"none":C||"none"))):t.setAttribute("fill","none"),Q.Join&&t.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&t.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var T=Q.DashPattern,j=Object(G.parseCtm)(T),X=0;Q.DashOffset&&(X=Q.DashOffset),t.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(j[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(j[1],this.coreHelper.dpi))),t.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(X,this.coreHelper.dpi),"px"))}var O,u="",z=R(K);try{for(z.s();!(O=z.n()).done;){var P=O.value;"M"===P.cmd||"S"===P.cmd?u+="M ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"L"===P.cmd?u+="L ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"B"===P.cmd?u+="C ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi)," "):"Q"===P.cmd?u+="Q ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," "):"A"===P.cmd?u+="A ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(P.crds[2]," ").concat(P.crds[3],",").concat(P.crds[4]," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(P.crds[6],this.coreHelper.dpi)," "):"C"===P.cmd&&(u+="Z")}}catch(A){z.e(A)}finally{z.f()}t.setAttribute("d",u),h.appendChild(t);var v=J.pattern;if(v){var _=document.createElementNS("http://www.w3.org/2000/svg","defs"),$=document.createElementNS("http://www.w3.org/2000/svg","pattern");$.setAttribute("width",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),v.ctm&&$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)+Object(G.converterDpi)(v.ctm.split(" ")[5],this.coreHelper.dpi)),$.setAttribute("x",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("y",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),$.setAttribute("id","pattern1-".concat(Q.ID)),$.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,$,y,B,N,null,v,!1,null,null,null),_.appendChild($),h.appendChild(_);var AA=document.createElementNS("http://www.w3.org/2000/svg","rect");AA.setAttribute("width",U),AA.setAttribute("height",c),AA.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(AA)}if(S&&S.length>0){for(var IA=[],gA=0;gA<S.length;gA++){var BA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");BA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(gA));for(var QA=S[gA].Clip,CA=0;CA<QA.length;CA++){var EA=QA[CA].Area,DA=document.createElementNS("http://www.w3.org/2000/svg","path"),iA="",oA=0,wA=0,GA=0,FA=0;if(EA.Path.Boundary&&(oA=EA.Path.Boundary.x,wA=EA.Path.Boundary.y,GA=EA.Path.Boundary.w,FA=EA.Path.Boundary.h),!EA.TransFlag&&EA.CTM){var NA=EA.CTM,yA=void 0;if(yA=L?"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f-L.f,this.coreHelper.dpi),")"):"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f,this.coreHelper.dpi),")"),L){var hA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],RA=Object(G.inv)(hA);isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}DA.setAttribute("transform",yA)}var MA,UA=R(EA.Path.AbbreviatedData);try{for(UA.s();!(MA=UA.n()).done;){var cA=MA.value;"M"===cA.cmd||"S"===cA.cmd?iA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"L"===cA.cmd?iA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"B"===cA.cmd?iA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[4]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[5]+wA,this.coreHelper.dpi)," "):"Q"===cA.cmd?iA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," "):"A"===cA.cmd?iA+="A ".concat(Object(G.converterDpi)(cA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[6],this.coreHelper.dpi)):"C"===cA.cmd&&(iA+="Z")}}catch(A){UA.e(A)}finally{UA.f()}if(!EA.TransFlag&&EA.Path.CTM){var aA=EA.Path.CTM,sA="matrix(".concat(aA.a," ").concat(aA.b," ").concat(aA.c," ").concat(aA.d," ").concat(Object(G.converterDpi)(aA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.f,this.coreHelper.dpi),")");if(L){sA="matrix(".concat(aA.a," ").concat(aA.b," ").concat(aA.c," ").concat(aA.d," ").concat(Object(G.converterDpi)(aA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.f-L.f,this.coreHelper.dpi),")");var kA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],SA=Object(G.inv)(kA);isNaN(SA[0][0])||SA[0][0]===1/0||(sA="".concat(sA," matrix(").concat(SA[0][0]," ").concat(SA[1][0]," ").concat(SA[0][1]," ").concat(SA[1][1]," 0 0)"))}DA.setAttribute("transform",sA)}DA.setAttribute("d",iA),BA.appendChild(DA),EA.TransFlag&&EA.Path.CTM&&BA.setAttribute("id","none")}IA.push(BA)}if(IA.length>0)if(1==IA.length)h.appendChild(IA[0]),t.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var YA,KA="",HA=R(IA);try{for(HA.s();!(YA=HA.n()).done;){var JA=YA.value;void 0!==JA.children[0].getAttribute("d")&&(KA+="clip-path:path('".concat(JA.children[0].getAttribute("d"),"');"))}}catch(A){HA.e(A)}finally{HA.f()}t.setAttribute("style",KA)}}if(w){var LA=document.createElementNS("http://www.w3.org/2000/svg","svg");LA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),eA=Math.ceil(tA.h),nA=tA.x+a,lA=tA.y+s;return k="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(eA,"px;"),F&&L&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),LA.appendChild(h),{svg:LA,style:k,left:nA,top:lA}}return{svg:h,style:k,left:a,top:s}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth))-.015*D,i=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;i=Math.max(i,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>D)&&(I.watermark_cols=parseInt((D-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((D-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>i)&&(I.watermark_rows=parseInt((I.watermark_y_space+i-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((i-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var o=0;o<I.watermark_rows;o++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var G=document.createElement("div");G.id="mask_div"+o+w,G.className="mask_div",G.innerHTML=I.watermark_txt,G.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",G.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",G.style.msTransform="rotate(-"+I.watermark_angle+"deg)",G.style.OTransform="rotate(-"+I.watermark_angle+"deg)",G.style.transform="rotate(-"+I.watermark_angle+"deg)",G.style.visibility="",G.style.position="absolute",G.style.left=Q+"px",G.style.top=C+"px",G.style.overflow="hidden",G.style.zIndex="9999",G.style.pointerEvents="none",G.style.opacity=I.watermark_alpha,G.style.fontSize=I.watermark_fontsize,G.style.fontFamily=I.watermark_font,G.style.color=I.watermark_color,G.style.textAlign="center",G.style.width=I.watermark_width+"px",G.style.height=I.watermark_height+"px",G.style.display="block",E.appendChild(G)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return R})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return s})),g.d(I,"Uint8ArrayToHexString",(function(){return k})),g.d(I,"replaceFirstSlash",(function(){return S})),g.d(I,"replaceFirstTarget",(function(){return Y})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return J})),g.d(I,"getFont",(function(){return L})),g.d(I,"inv",(function(){return e}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var h=0,R=0,M=0,U=0,c=[];if(!I)return c;var a,s=B(I);try{for(s.s();!(a=s.n()).done;){var k=a.value;if(k){if(h=F?parseFloat(k.X):-parseFloat(k.X),R=F?parseFloat(k.Y):-parseFloat(k.Y),isNaN(h)&&(h=0),isNaN(R)&&(R=0),M=h,U=R,Q){var S=D(M,U,Q);M=S.cx,U=S.cy}var Y=[],K=[];k.DeltaX&&k.DeltaX.length>0&&(Y=k.DeltaX),k.DeltaY&&k.DeltaY.length>0&&(K=k.DeltaY);var H=k.text;if(H){H=(H=y(H+="")).replace(/&#x20;/g," ");for(var J=0;J<H.length;J++){if(J>0&&Y.length>0){var L=J-1;if(L>=Y.length&&(L=Y.length-1),h+=N?F?Y[L]/N:-Y[L]/N:F?Y[L]:-Y[L],Q)M+=i(F?Y[J-1]:-Y[J-1],0,Q).ctmX;else M=h}if(J>0&&K.length>0){var t=J-1;if(t>=K.length&&(t=K.length-1),R+=F?K[t]:-K[t],Q)U+=i(0,F?K[J-1]:-K[J-1],Q).ctmY;else U=R}var d=H.substring(J,J+1),e=o(M,U,E);G&&(e=D(e.cx,e.cy,G));var n={x:C(h,A),y:C(R,A),text:d,cx:C(e.cx,A),cy:C(e.cy,A)};c.push(n)}}}}}catch(A){s.e(A)}finally{s.f()}if(c.length>0){var l,Z=B(g);try{for(Z.s();!(l=Z.n()).done;)for(var r=l.value,q=r.CodePosition,W=r.GlyphCount,f=q;f<W+q;f++)if(c.length<=f){var x="".concat(c[c.length-1].glyph," ").concat(r.Glyphs[f-q]);c[c.length-1].glyph=x}else c[f].glyph=r.Glyphs[f-q]}catch(A){Z.e(A)}finally{Z.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&quot;":'"',"&copy;":"","&apos;":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},h={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New",ChangFangSong:"ChangFangSong, FangSong"},R=function(A){if(!A)return h["宋体"];var I=A.FamilyName;I||(I=A.FontName),h[I.toLowerCase()]&&(I=h[I.toLowerCase()]);for(var g=0,B=Object.keys(h);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return h[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=a(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},a=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},s=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},k=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},S=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},Y=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function e(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return w})),g.d(I,"setYYDS",(function(){return G})),g.d(I,"freeMemory",(function(){return F})),g.d(I,"getStreamData",(function(){return N})),g.d(I,"getStreamDataBase64",(function(){return y})),g.d(I,"CreateLibrary",(function(){return h})),g.d(I,"CreateNativeStream",(function(){return R})),g.d(I,"FT_Open_Face",(function(){return M})),g.d(I,"loadFaceInfo",(function(){return U})),g.d(I,"FT_Glyph_Get_Measure",(function(){return c})),g.d(I,"freeOFD",(function(){return a})),g.d(I,"readOFD",(function(){return s})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return Y})),g.d(I,"SHA1",(function(){return K})),g.d(I,"SM3",(function(){return H})),g.d(I,"base64EncodeByByte",(function(){return J})),g.d(I,"base64Encode",(function(){return L})),g.d(I,"base64DecodeToUint8Array",(function(){return t})),g.d(I,"JSBase64ByHashFile",(function(){return d})),g.d(I,"JSGetImageInfoByBase64",(function(){return e})),g.d(I,"JSGetImageInfoByPath",(function(){return n})),g.d(I,"JSReadPageInfo",(function(){return l})),g.d(I,"JSGetPathEncode",(function(){return Z})),g.d(I,"JSPackageSigned",(function(){return r})),g.d(I,"JSGetToSign",(function(){return q}));var B,Q,C,E,D,i=g(33),o=g(34),w=function(){return!B},G=function(A){B=A},F=function(A){B._ASC_FT_Free(A.data),A.data=0},N=function(){return E},y=function(){return D},h=function(){Q=B._ASC_FT_Init()},R=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},M=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},U=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new i.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var D=C[E++];D;)g.family_name+=String.fromCharCode(D),D=C[E++];for(D=C[E++];D;)g.style_name+=String.fromCharCode(D),D=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=W(C[E++]),g.os2_ulUnicodeRange2=W(C[E++]),g.os2_ulUnicodeRange3=W(C[E++]),g.os2_ulUnicodeRange4=W(C[E++]),g.os2_ulCodePageRange1=W(C[E++]),g.os2_ulCodePageRange2=W(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},c=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new o.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,i="";D<Q;)switch(C[D++]){case 0:i+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:i+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:i+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:i+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=i,B._ASC_FT_Free(g),C=null,E},a=function(A){if(F(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},s=function(A,I,g){E=A,C=R(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){D=A;var C=B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(0!==C.code)switch(C.msg){case"10001":C.msg="授权信息错误";break;case"10002":C.msg="授权时间过期";break;case"10003":var E="非ofd文件无法打开";switch(C.file_type){case 0:break;case 9:E="PDF文件无法打开";break;default:E="图片文件无法打开"}C.msg=E}return C},S=function(A,I,g){return B.JSHashPath(A,I,g)},Y=function(A){return B.JSMD5(A)},K=function(A){return B.JSSHA1(A)},H=function(A){return B.JSSM3(A)},J=function(A){var I=R(A),g=B.JSBase64EncodeByByte(I.data,I.length);return F(I),g},L=function(A){return B.JSBase64Encode(A)},t=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},d=function(A,I,g){var Q=R(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},e=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},n=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},l=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},Z=function(A,I,g){var Q=B.JSGetPathEncode(A,I,g);if(0===Q.code)return new Uint8Array(B.HEAPU8.buffer,Q.ptr,Q.ptr_len).slice(0,Q.ptr_len)},r=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},q=function(A,I){return B.JSGetToSign(A,I)},W=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=(g(31),g(32));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g=this.readOfdDocument(A);if(g)return null==g||null===(I=g.CommonData)||void 0===I||null===(I=I.Res)||void 0===I?void 0:I.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",h=i(F.TextCode);try{for(h.s();!(N=h.n()).done;){var R=N.value;y="".concat(y).concat(R.text)}}catch(A){h.e(A)}finally{h.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(31),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";var B=F(g(38)),Q=F(g(73)),C=F(g(74)),E=F(g(75)),D=F(g(76)),i=F(g(78)),o=F(g(86)),w=g(85),G=F(g(79));function F(A){return A&&A.__esModule?A:{default:A}}var N=function(){},y=function(A,I,g){var B=new N;if(void 0===A)throw Error("No element to render on was provided.");return B._renderProperties=(0,D.default)(A),B._encodings=[],B._options=G.default,B._errorHandler=new o.default(B),void 0!==I&&((g=g||{}).format||(g.format=U()),B.options(g)[g.format](I,g).render()),B};for(var h in y.getModule=function(A){return B.default[A]},B.default)B.default.hasOwnProperty(h)&&R(B.default,h);function R(A,I){N.prototype[I]=N.prototype[I.toUpperCase()]=N.prototype[I.toLowerCase()]=function(g,B){var C=this;return C._errorHandler.wrapBarcodeCall((function(){B.text=void 0===B.text?void 0:""+B.text;var E=(0,Q.default)(C._options,B);E=(0,i.default)(E);var D=A[I],o=M(g,D,E);return C._encodings.push(o),C}))}}function M(A,I,g){var B=new I(A=""+A,g);if(!B.valid())throw new w.InvalidInputException(B.constructor.name,A);var E=B.encode();E=(0,C.default)(E);for(var D=0;D<E.length;D++)E[D].options=(0,Q.default)(g,E[D].options);return E}function U(){return B.default.CODE128?"CODE128":Object.keys(B.default)[0]}function c(A,I,g){I=(0,C.default)(I);for(var B=0;B<I.length;B++)I[B].options=(0,Q.default)(g,I[B].options),(0,E.default)(I[B].options);(0,E.default)(g),new(0,A.renderer)(A.element,I,g).render(),A.afterRender&&A.afterRender()}N.prototype.options=function(A){return this._options=(0,Q.default)(this._options,A),this},N.prototype.blank=function(A){var I=new Array(A+1).join("0");return this._encodings.push({data:I}),this},N.prototype.init=function(){var A;if(this._renderProperties)for(var I in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){A=this._renderProperties[I];var g=(0,Q.default)(this._options,A.options);"auto"==g.format&&(g.format=U()),this._errorHandler.wrapBarcodeCall((function(){var I=M(g.value,B.default[g.format.toUpperCase()],g);c(A,I,g)}))}},N.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var A=0;A<this._renderProperties.length;A++)c(this._renderProperties[A],this._encodings,this._options);else c(this._renderProperties,this._encodings,this._options);return this},N.prototype._defaults=G.default,"undefined"!=typeof window&&(window.JsBarcode=y),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(A,I){var g=[];return jQuery(this).each((function(){g.push(this)})),y(g,A,I)}),A.exports=y},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(39),Q=g(41),C=g(49),E=g(59),D=g(63),i=g(70),o=g(71),w=g(72);I.default={CODE39:B.CODE39,CODE128:Q.CODE128,CODE128A:Q.CODE128A,CODE128B:Q.CODE128B,CODE128C:Q.CODE128C,EAN13:C.EAN13,EAN8:C.EAN8,EAN5:C.EAN5,EAN2:C.EAN2,UPC:C.UPC,UPCE:C.UPCE,ITF14:E.ITF14,ITF:E.ITF,MSI:D.MSI,MSI10:D.MSI10,MSI11:D.MSI11,MSI1010:D.MSI1010,MSI1110:D.MSI1110,pharmacode:i.pharmacode,codabar:o.codabar,GenericBarcode:w.GenericBarcode}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE39=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A=A.toUpperCase(),g.mod43&&(A+=function(A){return D[A]}(function(A){for(var I=0,g=0;g<A.length;g++)I+=w(A[g]);return I%=43}(A))),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A=o("*"),I=0;I<this.data.length;I++)A+=o(this.data[I])+"0";return{data:A+=o("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default),D=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],i=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function o(A){return function(A){return i[A].toString(2)}(w(A))}function w(A){return D.indexOf(A)}I.CODE39=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.default=function A(I,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.data=I,this.text=g.text||I,this.options=g}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE128C=I.CODE128B=I.CODE128A=I.CODE128=void 0;var B=D(g(42)),Q=D(g(46)),C=D(g(47)),E=D(g(48));function D(A){return A&&A.__esModule?A:{default:A}}I.CODE128=B.default,I.CODE128A=Q.default,I.CODE128B=C.default,I.CODE128C=E.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=C(g(43)),Q=C(g(45));function C(A){return A&&A.__esModule?A:{default:A}}function E(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var D=function(A){function I(A,g){if(function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),/^[\x00-\x7F\xC8-\xD3]+$/.test(A))var B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,(0,Q.default)(A),g));else B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return E(B)}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(B.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.substring(1),g));return B.bytes=A.split("").map((function(A){return A.charCodeAt(0)})),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var A=this.bytes,g=A.shift()-105,B=D.SET_BY_CODE[g];if(void 0===B)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&A.unshift(D.FNC1);var Q=I.next(A,1,B);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:I.getBar(g)+Q.result+I.getBar((Q.checksum+g)%D.MODULO)+I.getBar(D.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var A=this.options.ean128||!1;return"string"==typeof A&&(A="true"===A.toLowerCase()),A}}],[{key:"getBar",value:function(A){return D.BARS[A]?D.BARS[A].toString():""}},{key:"correctIndex",value:function(A,I){if(I===D.SET_A){var g=A.shift();return g<32?g+64:g-32}return I===D.SET_B?A.shift()-32:10*(A.shift()-48)+A.shift()-48}},{key:"next",value:function(A,g,B){if(!A.length)return{result:"",checksum:0};var Q=void 0,C=void 0;if(A[0]>=200){C=A.shift()-105;var E=D.SWAP[C];void 0!==E?Q=I.next(A,g+1,E):(B!==D.SET_A&&B!==D.SET_B||C!==D.SHIFT||(A[0]=B===D.SET_A?A[0]>95?A[0]-96:A[0]:A[0]<32?A[0]+96:A[0]),Q=I.next(A,g+1,B))}else C=I.correctIndex(A,B),Q=I.next(A,g+1,B);var i=C*g;return{result:I.getBar(C)+Q.result,checksum:i+Q.checksum}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";var B;function Q(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}Object.defineProperty(I,"__esModule",{value:!0});var C=I.SET_A=0,E=I.SET_B=1,D=I.SET_C=2,i=(I.SHIFT=98,I.START_A=103),o=I.START_B=104,w=I.START_C=105;I.MODULO=103,I.STOP=106,I.FNC1=207,I.SET_BY_CODE=(Q(B={},i,C),Q(B,o,E),Q(B,w,D),B),I.SWAP={101:C,100:E,99:D},I.A_START_CHAR=String.fromCharCode(208),I.B_START_CHAR=String.fromCharCode(209),I.C_START_CHAR=String.fromCharCode(210),I.A_CHARS="[\0-_È-Ï]",I.B_CHARS="[ -È-Ï]",I.C_CHARS="(Ï*[0-9]{2}Ï*)",I.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(44),Q=function(A){return A.match(new RegExp("^"+B.A_CHARS+"*"))[0].length},C=function(A){return A.match(new RegExp("^"+B.B_CHARS+"*"))[0].length},E=function(A){return A.match(new RegExp("^"+B.C_CHARS+"*"))[0]};function D(A,I){var g=I?B.A_CHARS:B.B_CHARS,Q=A.match(new RegExp("^("+g+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(Q)return Q[1]+String.fromCharCode(204)+i(A.substring(Q[1].length));var C=A.match(new RegExp("^"+g+"+"))[0];return C.length===A.length?A:C+String.fromCharCode(I?205:206)+D(A.substring(C.length),!I)}function i(A){var I=E(A),g=I.length;if(g===A.length)return A;A=A.substring(g);var B=Q(A)>=C(A);return I+String.fromCharCode(B?206:205)+D(A,B)}I.default=function(A){var I=void 0;if(E(A).length>=2)I=B.C_START_CHAR+i(A);else{var g=Q(A)>C(A);I=(g?B.A_START_CHAR:B.B_START_CHAR)+D(A,g)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(A,I){return String.fromCharCode(203)+I}))}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.A_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.A_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.B_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.B_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.C_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.C_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.UPCE=I.UPC=I.EAN2=I.EAN5=I.EAN8=I.EAN13=void 0;var B=o(g(50)),Q=o(g(54)),C=o(g(55)),E=o(g(56)),D=o(g(57)),i=o(g(58));function o(A){return A&&A.__esModule?A:{default:A}}I.EAN13=B.default,I.EAN8=Q.default,I.EAN5=C.default,I.EAN2=E.default,I.UPC=D.default,I.UPCE=i.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=function A(I,g,B){null===I&&(I=Function.prototype);var Q=Object.getOwnPropertyDescriptor(I,g);if(void 0===Q){var C=Object.getPrototypeOf(I);return null===C?void 0:A(C,g,B)}if("value"in Q)return Q.value;var E=Q.get;return void 0!==E?E.call(B):void 0},E=g(51),D=g(52),i=(B=D)&&B.__esModule?B:{default:B};var o=function(A){return(10-A.substr(0,12).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+3*I:A+I}),0)%10)%10},w=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{12}$/)&&(A+=o(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.lastChar=g.lastChar,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var A=this.data.substr(1,6),g=E.EAN13_STRUCTURE[this.data[0]];return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,g)}},{key:"rightText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var A=this.data.substr(7,6);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRRRR")}},{key:"encodeGuarded",value:function(){var A=C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(A.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(A.push({data:"00"}),A.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),A}}]),I}(i.default);I.default=w},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.SIDE_BIN="101",I.MIDDLE_BIN="01010",I.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},I.EAN2_STRUCTURE=["LL","LG","GL","GG"],I.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],I.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.fontSize=!g.flat&&g.fontSize>10*g.width?10*g.width:g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(A,I){return this.text.substr(A,I)}},{key:"leftEncode",value:function(A,I){return(0,C.default)(A,I)}},{key:"rightText",value:function(A,I){return this.text.substr(A,I)}},{key:"rightEncode",value:function(A,I){return(0,C.default)(A,I)}},{key:"encodeGuarded",value:function(){var A={fontSize:this.fontSize},I={height:this.guardHeight};return[{data:Q.SIDE_BIN,options:I},{data:this.leftEncode(),text:this.leftText(),options:A},{data:Q.MIDDLE_BIN,options:I},{data:this.rightEncode(),text:this.rightText(),options:A},{data:Q.SIDE_BIN,options:I}]}},{key:"encodeFlat",value:function(){return{data:[Q.SIDE_BIN,this.leftEncode(),Q.MIDDLE_BIN,this.rightEncode(),Q.SIDE_BIN].join(""),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(51);I.default=function(A,I,g){var Q=A.split("").map((function(A,g){return B.BINARIES[I[g]]})).map((function(I,g){return I?I[A[g]]:""}));if(g){var C=A.length-1;Q=Q.map((function(A,I){return I<C?A+g:A}))}return Q.join("")}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=function A(I,g,B){null===I&&(I=Function.prototype);var Q=Object.getOwnPropertyDescriptor(I,g);if(void 0===Q){var C=Object.getPrototypeOf(I);return null===C?void 0:A(C,g,B)}if("value"in Q)return Q.value;var E=Q.get;return void 0!==E?E.call(B):void 0},E=g(52),D=(B=E)&&B.__esModule?B:{default:B};var i=function(A){return(10-A.substr(0,7).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+I:A+3*I}),0)%10)%10},o=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{7}$/)&&(A+=i(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===i(this.data)}},{key:"leftText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var A=this.data.substr(0,4);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,"LLLL")}},{key:"rightText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var A=this.data.substr(4,4);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRR")}}]),I}(D.default);I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=D(g(53)),E=D(g(40));function D(A){return A&&A.__esModule?A:{default:A}}var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var A,I=Q.EAN5_STRUCTURE[(A=this.data,A.split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+9*I:A+3*I}),0)%10)];return{data:"1011"+(0,C.default)(this.data,I,"01"),text:this.text}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var A=Q.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,C.default)(this.data,A,"01"),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();I.checksum=D;var Q=C(g(53));function C(A){return A&&A.__esModule?A:{default:A}}var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{11}$/)&&(A+=D(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==D(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=(0,Q.default)(this.data.substr(0,6),"LLLLLL"),A+="01010",A+=(0,Q.default)(this.data.substr(6,6),"RRRRRR"),{data:A+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101"+(0,Q.default)(this.data[0],"L"),options:{height:this.guardHeight}}),A.push({data:(0,Q.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),A.push({data:"01010",options:{height:this.guardHeight}}),A.push({data:(0,Q.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),A.push({data:(0,Q.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),A}}]),I}(C(g(40)).default);function D(A){var I,g=0;for(I=1;I<11;I+=2)g+=parseInt(A[I]);for(I=0;I<11;I+=2)g+=3*parseInt(A[I]);return(10-g%10)%10}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=D(g(53)),C=D(g(40)),E=g(57);function D(A){return A&&A.__esModule?A:{default:A}}function i(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var o=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],w=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],G=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=i(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));if(B.isValid=!1,-1!==A.search(/^[0-9]{6}$/))B.middleDigits=A,B.upcA=F(A,"0"),B.text=g.text||""+B.upcA[0]+A+B.upcA[B.upcA.length-1],B.isValid=!0;else{if(-1===A.search(/^[01][0-9]{7}$/))return i(B);if(B.middleDigits=A.substring(1,A.length-1),B.upcA=F(B.middleDigits,A[0]),B.upcA[B.upcA.length-1]!==A[A.length-1])return i(B);B.isValid=!0}return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=this.encodeMiddleDigits(),{data:A+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101",options:{height:this.guardHeight}}),A.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),A.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),A}},{key:"encodeMiddleDigits",value:function(){var A=this.upcA[0],I=this.upcA[this.upcA.length-1],g=w[parseInt(I)][parseInt(A)];return(0,Q.default)(this.middleDigits,g)}}]),I}(C.default);function F(A,I){for(var g=parseInt(A[A.length-1]),B=o[g],Q="",C=0,D=0;D<B.length;D++){var i=B[D];Q+="X"===i?A[C++]:i}return""+(Q=""+I+Q)+(0,E.checksum)(Q)}I.default=G},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.ITF14=I.ITF=void 0;var B=C(g(60)),Q=C(g(62));function C(A){return A&&A.__esModule?A:{default:A}}I.ITF=B.default,I.ITF14=Q.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(61),E=g(40);var D=function(A){function I(){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var A=this,I=this.data.match(/.{2}/g).map((function(I){return A.encodePair(I)})).join("");return{data:C.START_BIN+I+C.END_BIN,text:this.text}}},{key:"encodePair",value:function(A){var I=C.BINARIES[A[1]];return C.BINARIES[A[0]].split("").map((function(A,g){return("1"===A?"111":"1")+("1"===I[g]?"000":"0")})).join("")}}]),I}(((B=E)&&B.__esModule?B:{default:B}).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.START_BIN="1010",I.END_BIN="11101",I.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(60),E=(B=C)&&B.__esModule?B:{default:B};var D=function(A){var I=A.substr(0,13).split("").map((function(A){return parseInt(A,10)})).reduce((function(A,I,g){return A+I*(3-g%2*2)}),0);return 10*Math.ceil(I/10)-I},i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{13}$/)&&(A+=D(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.MSI1110=I.MSI1010=I.MSI11=I.MSI10=I.MSI=void 0;var B=i(g(64)),Q=i(g(65)),C=i(g(67)),E=i(g(68)),D=i(g(69));function i(A){return A&&A.__esModule?A:{default:A}}I.MSI=B.default,I.MSI10=Q.default,I.MSI11=C.default,I.MSI1010=E.default,I.MSI1110=D.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A="110",I=0;I<this.data.length;I++){var g=parseInt(this.data[I]).toString(2);g=D(g,4-g.length);for(var B=0;B<g.length;B++)A+="0"==g[B]?"100":"110"}return{data:A+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);function D(A,I){for(var g=0;g<I;g++)A="0"+A;return A}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod10)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.mod10=function(A){for(var I=0,g=0;g<A.length;g++){var B=parseInt(A[g]);(g+A.length)%2==0?I+=B:I+=2*B%10+Math.floor(2*B/10)}return(10-I%10)%10},I.mod11=function(A){for(var I=0,g=[2,3,4,5,6,7],B=0;B<A.length;B++){var Q=parseInt(A[A.length-1-B]);I+=g[B%g.length]*Q}return(11-I%11)%11}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod11)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod10)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod11)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.pharmacode=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.number=parseInt(A,10),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A=this.number,I="";!isNaN(A)&&0!=A;)A%2==0?(I="11100"+I,A=(A-2)/2):(I="100"+I,A=(A-1)/2);return{data:I=I.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.pharmacode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.codabar=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),0===A.search(/^[0-9\-\$\:\.\+\/]+$/)&&(A="A"+A+"A");var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.toUpperCase(),g));return B.text=B.options.text||B.text.replace(/[A-D]/g,""),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var A=[],I=this.getEncodings(),g=0;g<this.data.length;g++)A.push(I[this.data.charAt(g)]),g!==this.data.length-1&&A.push("0");return{text:this.text,data:A.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.codabar=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.GenericBarcode=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.GenericBarcode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var B in g)Object.prototype.hasOwnProperty.call(g,B)&&(A[B]=g[B])}return A};I.default=function(A,I){return B({},A,I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=[];return function A(g){if(Array.isArray(g))for(var B=0;B<g.length;B++)A(g[B]);else g.text=g.text||"",g.data=g.data||"",I.push(g)}(A),I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){return A.marginTop=A.marginTop||A.margin,A.marginBottom=A.marginBottom||A.margin,A.marginRight=A.marginRight||A.margin,A.marginLeft=A.marginLeft||A.margin,A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Q=D(g(77)),C=D(g(80)),E=g(85);function D(A){return A&&A.__esModule?A:{default:A}}function i(A){if("string"==typeof A)return function(A){var I=document.querySelectorAll(A);if(0===I.length)return;for(var g=[],B=0;B<I.length;B++)g.push(i(I[B]));return g}(A);if(Array.isArray(A)){for(var I=[],g=0;g<A.length;g++)I.push(i(A[g]));return I}if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLImageElement)return D=A,{element:o=document.createElement("canvas"),options:(0,Q.default)(D),renderer:C.default.CanvasRenderer,afterRender:function(){D.setAttribute("src",o.toDataURL())}};if(A&&A.nodeName&&"svg"===A.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&A instanceof SVGElement)return{element:A,options:(0,Q.default)(A),renderer:C.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLCanvasElement)return{element:A,options:(0,Q.default)(A),renderer:C.default.CanvasRenderer};if(A&&A.getContext)return{element:A,renderer:C.default.CanvasRenderer};if(A&&"object"===(void 0===A?"undefined":B(A))&&!A.nodeName)return{element:A,renderer:C.default.ObjectRenderer};throw new E.InvalidElementException;var D,o}I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=C(g(78)),Q=C(g(79));function C(A){return A&&A.__esModule?A:{default:A}}I.default=function(A){var I={};for(var g in Q.default)Q.default.hasOwnProperty(g)&&(A.hasAttribute("jsbarcode-"+g.toLowerCase())&&(I[g]=A.getAttribute("jsbarcode-"+g.toLowerCase())),A.hasAttribute("data-"+g.toLowerCase())&&(I[g]=A.getAttribute("data-"+g.toLowerCase())));return I.value=A.getAttribute("jsbarcode-value")||A.getAttribute("data-value"),I=(0,B.default)(I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var g in I)I.hasOwnProperty(g)&&"string"==typeof A[g=I[g]]&&(A[g]=parseInt(A[g],10));"string"==typeof A.displayValue&&(A.displayValue="false"!=A.displayValue);return A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};I.default=B},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=E(g(81)),Q=E(g(83)),C=E(g(84));function E(A){return A&&A.__esModule?A:{default:A}}I.default={CanvasRenderer:B.default,SVGRenderer:Q.default,ObjectRenderer:C.default}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(73),E=(B=C)&&B.__esModule?B:{default:B},D=g(82);var i=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.canvas=I,this.encodings=g,this.options=B}return Q(A,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var A=0;A<this.encodings.length;A++){var I=(0,E.default)(this.options,this.encodings[A].options);this.drawCanvasBarcode(I,this.encodings[A]),this.drawCanvasText(I,this.encodings[A]),this.moveCanvasDrawing(this.encodings[A])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var A=this.canvas.getContext("2d");A.save(),(0,D.calculateEncodingAttributes)(this.encodings,this.options,A);var I=(0,D.getTotalWidthOfEncodings)(this.encodings),g=(0,D.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=I+this.options.marginLeft+this.options.marginRight,this.canvas.height=g,A.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(A.fillStyle=this.options.background,A.fillRect(0,0,this.canvas.width,this.canvas.height)),A.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(A,I){var g,B=this.canvas.getContext("2d"),Q=I.data;g="top"==A.textPosition?A.marginTop+A.fontSize+A.textMargin:A.marginTop,B.fillStyle=A.lineColor;for(var C=0;C<Q.length;C++){var E=C*A.width+I.barcodePadding;"1"===Q[C]?B.fillRect(E,g,A.width,A.height):Q[C]&&B.fillRect(E,g,A.width,A.height*Q[C])}}},{key:"drawCanvasText",value:function(A,I){var g,B,Q=this.canvas.getContext("2d"),C=A.fontOptions+" "+A.fontSize+"px "+A.font;A.displayValue&&(B="top"==A.textPosition?A.marginTop+A.fontSize-A.textMargin:A.height+A.textMargin+A.marginTop+A.fontSize,Q.font=C,"left"==A.textAlign||I.barcodePadding>0?(g=0,Q.textAlign="left"):"right"==A.textAlign?(g=I.width-1,Q.textAlign="right"):(g=I.width/2,Q.textAlign="center"),Q.fillText(I.text,g,B))}},{key:"moveCanvasDrawing",value:function(A){this.canvas.getContext("2d").translate(A.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),A}();I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.getTotalWidthOfEncodings=I.calculateEncodingAttributes=I.getBarcodePadding=I.getEncodingHeight=I.getMaximumHeightOfEncodings=void 0;var B,Q=g(73),C=(B=Q)&&B.__esModule?B:{default:B};function E(A,I){return I.height+(I.displayValue&&A.text.length>0?I.fontSize+I.textMargin:0)+I.marginTop+I.marginBottom}function D(A,I,g){if(g.displayValue&&I<A){if("center"==g.textAlign)return Math.floor((A-I)/2);if("left"==g.textAlign)return 0;if("right"==g.textAlign)return Math.floor(A-I)}return 0}function i(A,I,g){var B;if(g)B=g;else{if("undefined"==typeof document)return 0;B=document.createElement("canvas").getContext("2d")}B.font=I.fontOptions+" "+I.fontSize+"px "+I.font;var Q=B.measureText(A);return Q?Q.width:0}I.getMaximumHeightOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)A[g].height>I&&(I=A[g].height);return I},I.getEncodingHeight=E,I.getBarcodePadding=D,I.calculateEncodingAttributes=function(A,I,g){for(var B=0;B<A.length;B++){var Q,o=A[B],w=(0,C.default)(I,o.options);Q=w.displayValue?i(o.text,w,g):0;var G=o.data.length*w.width;o.width=Math.ceil(Math.max(Q,G)),o.height=E(o,w),o.barcodePadding=D(Q,G,w)}},I.getTotalWidthOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)I+=A[g].width;return I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(73),E=(B=C)&&B.__esModule?B:{default:B},D=g(82);var i="http://www.w3.org/2000/svg",o=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.svg=I,this.encodings=g,this.options=B,this.document=B.xmlDocument||document}return Q(A,[{key:"render",value:function(){var A=this.options.marginLeft;this.prepareSVG();for(var I=0;I<this.encodings.length;I++){var g=this.encodings[I],B=(0,E.default)(this.options,g.options),Q=this.createGroup(A,B.marginTop,this.svg);this.setGroupOptions(Q,B),this.drawSvgBarcode(Q,B,g),this.drawSVGText(Q,B,g),A+=g.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,D.calculateEncodingAttributes)(this.encodings,this.options);var A=(0,D.getTotalWidthOfEncodings)(this.encodings),I=(0,D.getMaximumHeightOfEncodings)(this.encodings),g=A+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(g,I),this.options.background&&this.drawRect(0,0,g,I,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(A,I,g){var B,Q=g.data;B="top"==I.textPosition?I.fontSize+I.textMargin:0;for(var C=0,E=0,D=0;D<Q.length;D++)E=D*I.width+g.barcodePadding,"1"===Q[D]?C++:C>0&&(this.drawRect(E-I.width*C,B,I.width*C,I.height,A),C=0);C>0&&this.drawRect(E-I.width*(C-1),B,I.width*C,I.height,A)}},{key:"drawSVGText",value:function(A,I,g){var B,Q,C=this.document.createElementNS(i,"text");I.displayValue&&(C.setAttribute("style","font:"+I.fontOptions+" "+I.fontSize+"px "+I.font),Q="top"==I.textPosition?I.fontSize-I.textMargin:I.height+I.textMargin+I.fontSize,"left"==I.textAlign||g.barcodePadding>0?(B=0,C.setAttribute("text-anchor","start")):"right"==I.textAlign?(B=g.width-1,C.setAttribute("text-anchor","end")):(B=g.width/2,C.setAttribute("text-anchor","middle")),C.setAttribute("x",B),C.setAttribute("y",Q),C.appendChild(this.document.createTextNode(g.text)),A.appendChild(C))}},{key:"setSvgAttributes",value:function(A,I){var g=this.svg;g.setAttribute("width",A+"px"),g.setAttribute("height",I+"px"),g.setAttribute("x","0px"),g.setAttribute("y","0px"),g.setAttribute("viewBox","0 0 "+A+" "+I),g.setAttribute("xmlns",i),g.setAttribute("version","1.1"),g.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(A,I,g){var B=this.document.createElementNS(i,"g");return B.setAttribute("transform","translate("+A+", "+I+")"),g.appendChild(B),B}},{key:"setGroupOptions",value:function(A,I){A.setAttribute("style","fill:"+I.lineColor+";")}},{key:"drawRect",value:function(A,I,g,B,Q){var C=this.document.createElementNS(i,"rect");return C.setAttribute("x",A),C.setAttribute("y",I),C.setAttribute("width",g),C.setAttribute("height",B),Q.appendChild(C),C}}]),A}();I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var Q=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.object=I,this.encodings=g,this.options=B}return B(A,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),A}();I.default=Q},function(A,I,g){"use strict";function B(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function Q(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}function C(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}Object.defineProperty(I,"__esModule",{value:!0});var E=function(A){function I(A,g){B(this,I);var C=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return C.name="InvalidInputException",C.symbology=A,C.input=g,C.message='"'+C.input+'" is not a valid input for '+C.symbology,C}return C(I,Error),I}(),D=function(A){function I(){B(this,I);var A=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="InvalidElementException",A.message="Not supported type to render on",A}return C(I,Error),I}(),i=function(A){function I(){B(this,I);var A=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="NoElementException",A.message="No element to render on.",A}return C(I,Error),I}();I.InvalidInputException=E,I.InvalidElementException=D,I.NoElementException=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var Q=function(){function A(I){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.api=I}return B(A,[{key:"handleCatch",value:function(A){if("InvalidInputException"!==A.name)throw A;if(this.api._options.valid===this.api._defaults.valid)throw A.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(A){try{var I=A.apply(void 0,arguments);return this.api._options.valid(!0),I}catch(A){return this.handleCatch(A),this.api}}}]),A}();I.default=Q},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=g(31),F=g(32),N=g(35),y=g(30);function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,R,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D,i,o,y,R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(D=C?C.readOfdDocument(B):this.core.readOfdDocument(B),i=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),o=i.Page.Template,D.Annotations,y=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),R=D.Signatures?D.Signatures.Signature:[],M=D.CommonData.Res.Fonts,U=D.CommonData.Res.DrawParams,D.CommonData.Res.ColorSpaces,c=D.CommonData.Res.CompositeGraphicUnits,a=D.CommonData.Res.MultiMedias,!o){A.next=64;break}s=h(o),A.prev=13,s.s();case 15:if((k=s.n()).done){A.next=56;break}S=k.value,Y=h(y),A.prev=18,Y.s();case 20:if((K=Y.n()).done){A.next=46;break}if((H=K.value).ID!=S.TemplateID){A.next=44;break}if(!(H=C?C.readPageFromTemplate(H):this.core.readPageFromTemplate(H)).Page.Content){A.next=43;break}J=H.Page.Content.Layer,L=h(J),A.prev=27,L.s();case 29:if((t=L.n()).done){A.next=35;break}return d=t.value,A.next=33,this.renderLayerByCanvas(E,I,g,M,U,a,c,d,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),L.e(A.t0);case 40:return A.prev=40,L.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),Y.e(A.t1);case 51:return A.prev=51,Y.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),s.e(A.t2);case 61:return A.prev=61,s.f(),A.finish(61);case 64:if(!i.Page.Content){A.next=83;break}e=i.Page.Content.Layer,n=h(e),A.prev=67,n.s();case 69:if((l=n.n()).done){A.next=75;break}return Z=l.value,A.next=73,this.renderLayerByCanvas(E,I,g,M,U,a,c,Z,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),n.e(A.t3);case 80:return A.prev=80,n.f(),A.finish(80);case 83:r=h(R),A.prev=84,r.s();case 86:if((q=r.n()).done){A.next=134;break}W=q.value,f=h(W.Signature.SignedInfo.StampAnnot),A.prev=89,f.s();case 91:if((x=f.n()).done){A.next=124;break}if(p=x.value,b=p.PageRef,i.ID!=b){A.next=122;break}if(V=p.Boundary,!(W.Signature.PicType&&W.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==W.Signature.PicType){A.next=108;break}m=new N.Ofd_Core(W.Signature.ofd,this.coreHelper.dpi),T=0;case 100:if(!(T<m.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,T,m,!0,V,b,p.ID,Q,W.Signature.ZipName);case 103:T++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==W.Signature.PicType){A.next=114;break}return j="data:image/svg+xml;base64,".concat(W.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,j,V);case 112:A.next=122;break;case 114:return X=V.w,O=V.h,u=Object(G.converterBox)(V,this.coreHelper.dpi),z=Object(F.JSGetImageInfoByBase64)(W.Signature.PicValue),P=z.fileBase64,v={a:X,b:0,c:0,d:O,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,P,z.width,z.height,u,p.Clip,!0,b,p.ID,v);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),f.e(A.t4);case 129:return A.prev=129,f.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),r.e(A.t5);case 139:return A.prev=139,r.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q,C){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(zipName,N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(R=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F){var N,y,h,R,M,U,c,a,s,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return N={x:0,y:0,w:0,h:0},N=E,y={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},h=Object(G.converterBox)(y,this.coreHelper.dpi),R=1,(M=document.createElement("canvas")).style.height="".concat(h.w,"px"),M.style.width="".concat(h.h,"px"),M.width=h.w,M.height=h.h,U=M.getContext("2d"),A.next=13,this.renderPageByCanvas(M,U,0,B,Q,F);case 13:U.scale(R,R),y.w!==N.w?(c=N.h/y.h<N.w/y.w?N.h/y.h:N.w/y.w,a=document.createElement("canvas"),s=Object(G.converterBox)(N,this.coreHelper.dpi),a.style.height="".concat(s.w,"px"),a.style.width="".concat(s.h,"px"),a.width=s.w,a.height=s.h,(k=a.getContext("2d")).scale(c,c),k.drawImage(M,0,0),g.drawImage(a,h.x,h.y)):g.drawImage(M,h.x,h.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D,i,o){return R.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y){var R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(R=null,M=null,U=Object(G.converterDpi)(.353,this.coreHelper.dpi),(c=i.DrawParam)&&Object(G.getDrawParam)(C,c)&&(a=Object(G.getDrawParam)(C,c),Object(G.getDrawParam)(C,a.Relative)&&(a=Object(G.getDrawParam)(C,a.Relative)),a.FillColor&&(R=Object(G.parseColor)(a.FillColor.Value)),a.StrokeColor&&(R=Object(G.parseColor)(a.StrokeColor.Value)),a.LineWidth&&(U=Object(G.converterDpi)(a.LineWidth,this.coreHelper.dpi))),!(s=i.PageBlock)){A.next=60;break}k=h(s),A.prev=8,k.s();case 10:if((S=k.n()).done){A.next=52;break}if("ImageObject"!=(Y=S.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,B,E,Y,o,N,y);case 15:A.next=50;break;case 17:if("PathObject"!=Y.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,B,C,Y,R,M,U,o,F,N,y,E,Q);case 20:A.next=50;break;case 22:if("TextObject"!=Y.Type){A.next=27;break}return A.next=25,this.renderTextObject(g,B,Q,Y,R,M,C,F,N,y);case 25:A.next=50;break;case 27:if("CompositeObject"!=Y.Type){A.next=50;break}K=h(D),A.prev=29,K.s();case 31:if((H=K.n()).done){A.next=42;break}if((J=H.value).ID!==Y.ResourceID){A.next=40;break}return L=Y.Alpha,t=Y.Boundary,d=Y.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,D,J,!1,L,t,d);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),K.e(A.t0);case 47:return A.prev=47,K.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),k.e(A.t1);case 57:return A.prev=57,k.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G,F){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,N,y,h,R,M,U,c,a;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(o=C.Boundary,o=Object(G.converterBox)(o,this.coreHelper.dpi),N=C.ResourceID){A.next=5;break}return A.abrupt("return");case 5:if((y=Object(G.getMultiMedia)(Q,N)).MediaFile){A.next=8;break}return A.abrupt("return",null);case 8:if((h=C.ImageMask)>0&&(R=Object(G.getMultiMedia)(Q,h)).MediaFile&&(R.width>0||R.height>0||!R.MediaFile||((M=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),I)).ext,R.width=M.width,R.height=M.height,R.FileBase64=M.fileBase64)),y.width>0||y.height>0||!y.MediaFile){A.next=17;break}if("other"!==(U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,y.MediaFile,y.MediaFileResPln,this.core.getDocPln(0),I)).ext){A.next=14;break}return A.abrupt("return",null);case 14:y.width=U.width,y.height=U.height,y.FileBase64=U.fileBase64;case 17:return c=C.CTM,a=C.Clips,A.next=21,this.renderImageOnCanvas(g,B,y.FileBase64,y.width,y.height,o,!1,E,null,null,c,D,i,a);case 21:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,i){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,R,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,a=U.h,s=U.x,k=U.y;F.width=c,F.height=a,F.style.width="".concat(c,"px"),F.style.height="".concat(a,"px");var S=F.getContext("2d");R&&S.transform(R.a,R.b,R.c,R.d,Object(G.converterDpi)(R.e,w.coreHelper.dpi),Object(G.converterDpi)(R.f,w.coreHelper.dpi)),S.drawImage(I,D,i),g.drawImage(F,s,k)}else{var Y=document.createElement("canvas");Y.width=Math.ceil(E.w),Y.height=Math.ceil(E.h),Y.style.width="".concat(Math.ceil(E.w),"px"),Y.style.height="".concat(Math.ceil(E.h),"px");var K=Y.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var J=M[H].Clip,L=0;L<J.length;L++){var t=J[L].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var e,n=h(t.Path.AbbreviatedData);try{for(n.s();!(e=n.n()).done;){var l=e.value;if("M"===l.cmd||"S"===l.cmd){var Z=l.crds[0],r=l.crds[1];if(d){var q=w.ctmCalPoint(Z,r,d);Z=q.ctmX,r=q.ctmY}K.moveTo(Object(G.converterDpi)(Z,w.coreHelper.dpi),Object(G.converterDpi)(r,w.coreHelper.dpi))}else if("L"===l.cmd){var W=l.crds[0],f=l.crds[1];if(d){var x=w.ctmCalPoint(W,f,d);W=x.ctmX,f=x.ctmY}K.lineTo(Object(G.converterDpi)(W,w.coreHelper.dpi),Object(G.converterDpi)(f,w.coreHelper.dpi))}else if("B"===l.cmd){var p=l.crds[0],b=l.crds[1],V=l.crds[2],m=l.crds[3],T=l.crds[4],j=l.crds[5];if(d){var X=w.ctmCalPoint(p,b,d);p=X.ctmX,b=X.ctmY;var O=w.ctmCalPoint(V,m,d);V=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,j,d);T=u.ctmX,j=u.ctmY}K.bezierCurveTo(Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(j,w.coreHelper.dpi))}else if("Q"===l.cmd){var z=l.crds[0],P=l.crds[1],v=l.crds[2],_=l.crds[3];if(d){var $=w.ctmCalPoint(z,P,d);z=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(z,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===l.cmd||"C"===l.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(Y,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,R,M){var U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA,yA,hA,RA,MA,UA,cA,aA,sA,kA,SA,YA,KA,HA,JA,LA,tA,dA,eA,nA,lA,ZA,rA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(U=C.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(c=1,U=Object(G.converterBox)(U,this.coreHelper.dpi),a=Math.ceil(U.w),s=Math.ceil(U.h),k=U.x,S=U.y,a-0!=0&&s-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(Y=document.createElement("canvas"),K=Y.getContext("2d"),Y.width=a*c,Y.height=s*c,Y.style.width="".concat(a,"px"),Y.style.height="".concat(s,"px"),H=C.LineWidth,J=C.AbbreviatedData,L=C.CTM,t=C.StrokeColor,d=C.FillColor,H&&(i=Object(G.converterDpi)(H,this.coreHelper.dpi)),(e=C.DrawParam)&&(n=Object(G.getDrawParam)(Q,e),(H=n.LineWidth)&&(i=Object(G.converterDpi)(H,this.coreHelper.dpi)),n.FillColor&&(d&&d.Value||(d=n.FillColor)),n.StrokeColor&&(t&&t.Value||(t=n.StrokeColor))),L&&K.transform(L.a,L.b,L.c,L.d,Object(G.converterDpi)(L.e,this.coreHelper.dpi),Object(G.converterDpi)(L.f,this.coreHelper.dpi)),l=!1,t&&(t.Value&&(D=Object(G.parseColor)(t.Value)),Z=t.axialShd)){l=!0,r=Object(G.parseCtm)(Z.StartPoint),q=Object(G.parseCtm)(Z.EndPoint),W=K.createLinearGradient(r[0],r[1],q[0],q[1]),f=h(Z.Segment);try{for(f.s();!(x=f.n()).done;)(p=x.value)&&W.addColorStop(p.position,Object(G.parseColor)(p.color.Value))}catch(A){f.e(A)}finally{f.f()}K.lineWidth=i,K.strokeStyle=W}if(b=!1,d&&(d.Value&&(E=Object(G.parseColor)(d.Value)),d.Alpha&&0===d.Alpha&&(K.globalAlpha=0),V=d.AxialShd)){b=!0,m=Object(G.parseCtm)(V.StartPoint),T=Object(G.parseCtm)(V.EndPoint),j=K.createLinearGradient(m[0],m[1],T[0],T[1]),X=h(V.Segment);try{for(X.s();!(O=X.n()).done;)(u=O.value)&&j.addColorStop(u.position,Object(G.parseColor)(u.color.Value))}catch(A){X.e(A)}finally{X.f()}K.fillStyle=j}if(i>0&&!D&&((D=E)||(D="rgb(0, 0, 0)")),(z=C.Clips)&&z.length>0)for(P=[],v=0;v<z.length;v++){for(_=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),$=z[v],AA=$.Clip,IA=0;IA<AA.length;IA++){gA=AA[IA],BA=gA.Area,QA=document.createElementNS("http://www.w3.org/2000/svg","path"),CA=0,EA=0,DA=0,iA=0,BA.Path.Boundary&&(CA=BA.Path.Boundary.x,EA=BA.Path.Boundary.y,DA=BA.Path.Boundary.w,iA=BA.Path.Boundary.h),!BA.TransFlag&&BA.CTM&&(oA=BA.CTM,wA=void 0,wA=L?"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(G.converterDpi)(oA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(oA.f-L.f,this.coreHelper.dpi),")"):"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(G.converterDpi)(oA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(oA.f,this.coreHelper.dpi),")"),L&&(GA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],FA=Object(G.inv)(GA),isNaN(FA[0][0])||FA[0][0]===1/0||(wA="".concat(wA," matrix(").concat(FA[0][0]," ").concat(FA[1][0]," ").concat(FA[0][1]," ").concat(FA[1][1]," 0 0)"))),QA.setAttribute("transform",wA)),!BA.TransFlag&&BA.Path.CTM&&(NA=BA.Path.CTM,yA="matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f-L.f,this.coreHelper.dpi),")"),L&&(hA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],RA=Object(G.inv)(hA),isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))),QA.setAttribute("transform",yA)),K.beginPath(),MA=h(BA.Path.AbbreviatedData);try{for(MA.s();!(UA=MA.n()).done;)"M"===(cA=UA.value).cmd||"S"===cA.cmd?K.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"L"===cA.cmd?K.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"B"===cA.cmd&&K.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[2]+CA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[3]+EA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[4]+CA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[5]+EA,this.coreHelper.dpi))}catch(A){MA.e(A)}finally{MA.f()}K.closePath(),K.clip()}P.push(_)}C.Join&&K.setLineJoin(C["@_Join"]),C.Cap&&K.setLineCap(C["@_Cap"]),C.DashPattern&&(aA=C.DashPattern,sA=Object(G.parseCtm)(aA),C.DashOffset&&C.DashOffset,K.setLineDash([Object(G.converterDpi)(sA[0],this.coreHelper.dpi),Object(G.converterDpi)(sA[1],this.coreHelper.dpi)])),K.beginPath(),kA=h(J);try{for(kA.s();!(SA=kA.n()).done;)"M"===(YA=SA.value).cmd||"S"===YA.cmd?K.moveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi)):"L"===YA.cmd?K.lineTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi)):"B"===YA.cmd?K.bezierCurveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[5],this.coreHelper.dpi)):"Q"===YA.cmd?K.quadraticCurveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[3],this.coreHelper.dpi)):"A"===YA.cmd||"C"===YA.cmd&&K.closePath()}catch(A){kA.e(A)}finally{kA.f()}if(C.Stroke&&(l||(K.strokeStyle=D,K.lineWidth=i),K.stroke()),KA=d.pattern,!C.Fill||KA?K.fillStyle="none":(b||(K.fillStyle=E),K.fill(C.Rule)),!KA){A.next=54;break}return K.save(),HA=document.createElement("canvas"),JA=HA.getContext("2d"),HA.width=Object(G.converterDpi)(KA.width,this.coreHelper.dpi),HA.height=Object(G.converterDpi)(KA.height,this.coreHelper.dpi),A.next=50,this.renderLayerByCanvas(I,HA,JA,M,Q,R,null,KA,!1,null,null,null);case 50:LA=K.createPattern(HA,"repeat"),K.fillStyle=LA,K.fillRect(0,0,a,s),K.restore();case 54:N?(tA=document.createElement("canvas"),dA=Object(G.converterBox)(N,this.coreHelper.dpi),eA=dA.w,nA=dA.h,lA=dA.x,ZA=dA.y,tA.width=eA*c,tA.height=nA*c,tA.style.width="".concat(eA,"px"),tA.style.height="".concat(nA,"px"),rA=tA.getContext("2d"),y&&rA.transform(y.a,y.b,y.c,y.d,Object(G.converterDpi)(y.e,this.coreHelper.dpi),Object(G.converterDpi)(y.f,this.coreHelper.dpi)),F&&(rA.globalAlpha=F/255),rA.drawImage(Y,k,S),B.drawImage(tA,lA,ZA)):B.drawImage(Y,k,S);case 55:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N,y){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,R=Q.Boundary,R=Object(G.converterBox)(R,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,a=Q.Weight,s=Q.Size>0,M&&!s&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),k=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,s),(Y=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(J=Q.DrawParam)&&(L=Object(G.getDrawParam)(D,J)).FillColor&&(K&&K.Value||(K=L.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%"),n=h(d.Segment);try{for(n.s();!(l=n.n()).done;)(Z=l.value)&&((r=document.createElement("stop")).setAttribute("offset","".concat(100*Z.position,"%")),r.setAttribute("style","stop-color:".concat(Object(G.parseColor)(Z.color.Value),";stop-opacity:1")),e.appendChild(r),C=Object(G.parseColor)(Z.color.Value))}catch(A){n.e(A)}finally{n.f()}Y.appendChild(e)}Q.Fill||(y=0),q=R.w,W=R.h,f=R.x,x=R.y,p=k,b=k,V=0,M&&(m=M.a,T=M.b,j=M.c,X=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+j*j):Math.sqrt(m*m+j*j),u=X>0?Math.sign(X)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),0==(V=Math.atan2(-T,X))&&0!=m&&1==X||(p*=O,b*=u),0==V&&U-0==1&&(U=m/X)>0&&(p*=U)),N&&(z=N.a,P=N.b,v=N.c,_=N.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(V=Math.atan2(-P,_))&&0!=z&&1==_||(p*=$,b*=AA,x*=AA,f*=$,q*=$,W*=AA)),IA=Object(G.getFont)(B,c),gA=h(S),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!(QA.glyph&&IA&&IA.face&&M&&M.b>=0&&Q.Fill)){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,p,b,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(p),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==V){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(p),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(p),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,V,Math.ceil(p)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(a,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),Y.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return Y.setAttribute("style","overflow:visible;width:".concat(q,"px;height:").concat(W,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(Y.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,f,x);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(29),o=g(87),w=g(36);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return G}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(22),function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var A in this.fields){var I=this.fieldData[A];this.fields[A].textContent=I||0===I?I:"-"}}else for(var g in this.fields)this.fields[g].textContent="-"}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}())},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return y}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=g(22);function F(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return N(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return N(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function N(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var y=function(){function A(I,g,B){E()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,langSelect:I.langSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}var I;return i()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"setLanguage",value:(I=Q()(w.a.mark((function A(I){var g,B,Q;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.l10n.getLanguage();case 2:if(A.sent!=I){A.next=5;break}return A.abrupt("return");case 5:if(this.eventBus.dispatch("langchanged",{source:self,value:I}),this.items.langSelect){A.next=8;break}return A.abrupt("return");case 8:g=F(this.items.langSelect.options),A.prev=9,g.s();case 11:if((B=g.n()).done){A.next=19;break}if((Q=B.value).value===I){A.next=16;break}return Q.selected=!1,A.abrupt("continue",17);case 16:Q.selected=!0;case 17:A.next=11;break;case 19:A.next=24;break;case 21:A.prev=21,A.t0=A.catch(9),g.e(A.t0);case 24:return A.prev=24,g.f(),A.finish(24);case 27:case"end":return A.stop()}}),A,this,[[9,21,24,27]])}))),function(A){return I.apply(this,arguments)})},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=G.DEFAULT_SCALE_VALUE,this.pageScale=G.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=g.langSelect,E=this,D=F(this.buttons);try{var i=function(){var g=A.value,B=g.element,Q=g.eventName;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,{source:I})}))};for(D.s();!(A=D.n()).done;)i()}catch(A){D.e(A)}finally{D.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){E.eventBus.dispatch("pagenumberchanged",{source:E,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=G.noContextMenuHandler,C&&C.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=G.MIN_SCALE,C.zoomIn.disabled=Q>=G.MAX_SCALE;var E,D=!1,i=F(C.scaleSelect.options);try{for(i.s();!(E=i.n()).done;){var o=E.value;o.value===B?(o.selected=!0,D=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}D||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.items.pageNumber.classList.toggle("visiblePageIsLoading",A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(94);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var h=I.pagesCount>15e3;g.disabled=h,B.disabled=h,Q.disabled=h,C.disabled=h,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(95),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(87),g(30)),F=g(36),N=g(97),y=g.n(N);function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=h(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
1
+ !function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I(require("parser_helper_x.js"),require("axios")):"function"==typeof define&&define.amd?define([,"axios"],I):"object"==typeof exports?exports.parser_x=I(require("parser_helper_x.js"),require("axios")):A.parser_x=I(A.parser_helper_x,A.axios)}(window,(function(A,I){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}([function(A,I,g){"use strict";g.r(I),g.d(I,"OFDPrintApi",(function(){return V})),g.d(I,"ajaxUtils",(function(){return j})),g.d(I,"getToSign",(function(){return X})),g.d(I,"packageSigned",(function(){return O})),g.d(I,"free",(function(){return u})),g.d(I,"hashOfdDocument",(function(){return z})),g.d(I,"parseOfdDocument",(function(){return v})),g.d(I,"parseOfdDocumentFromBase64",(function(){return _})),g.d(I,"getOFDPageCount",(function(){return $})),g.d(I,"getAllAttachments",(function(){return AA})),g.d(I,"getAttachmentById",(function(){return IA})),g.d(I,"getAttachmentArrayBuffer",(function(){return gA})),g.d(I,"pageSize",(function(){return BA})),g.d(I,"getCustomTag",(function(){return QA})),g.d(I,"getTextObjects",(function(){return CA})),g.d(I,"renderOfd",(function(){return EA})),g.d(I,"renderOfdByIndex",(function(){return DA})),g.d(I,"getFileStream",(function(){return oA})),g.d(I,"setLanguage",(function(){return wA})),g.d(I,"openMetaBaseViewer",(function(){return GA})),g.d(I,"openOFDBaseViewer",(function(){return FA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return NA})),g.d(I,"verifySignature",(function(){return yA})),g.d(I,"printOFD",(function(){return hA})),g.d(I,"getEventBus",(function(){return RA})),g.d(I,"initOFDViewer",(function(){return MA})),g.d(I,"openOFDViewer",(function(){return UA})),g.d(I,"openFile",(function(){return cA})),g.d(I,"openFileBase64",(function(){return aA})),g.d(I,"openOFD",(function(){return sA})),g.d(I,"openOFDWithHeader",(function(){return kA}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=g(6),i=g.n(D),o=g(7),w=g.n(o),G=g(9),F=g(12),N=g(20),y=g(88),h=g(89),R=g(90),M=g(91),U=g(92),c=g(93),a=g(94),s=g(96),k=g(35),S=g(98),Y=g(32),K=g(30),H=g(36),J=g(99),L=g(100),t=g.n(L),d=g(101),e=g(102),n=g(103),l=g(104),Z=g(31),r=g(105),q=g.n(r),W=g(106),f=g.n(W),x=g(107);function p(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return b(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return b(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function b(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var V=S.Print_api,m=window.Module,T={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},j=f.a,X=function(A,I){return Object(Y.JSGetToSign)(A,I)},O=function(A,I){return Object(Y.JSPackageSigned)(A,I)},u=function(){T.ofdCore&&Object(Y.freeOFD)(T.ofdCore)},z=function(A){if(A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){A.success&&A.success(Object(Y.JSBase64ByHashFile)(I.result,A.list,A.method))}}else A.ofd instanceof ArrayBuffer?A.success&&A.success(Object(Y.JSBase64ByHashFile)(A.ofd,A.list,A.method)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(Y.readOFD)(I.data,A.secret,A.digest);P(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},P=function(A,I){0===A.code?(T.ofdCore=new k.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(T.waterText=I.waterText),I.digest||(T.waterText="demotest"),I.signatureClickCallback&&(T.eventBus=new F.EventBus,T.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(T.ofdCore.getAllSignature(0)),I.success&&I.success(T.ofdCore)):I.fail&&I.fail(A.msg)},v=function(A){iA(i()(w.a.mark((function I(){var g,B,Q;return w.a.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(T.ofdCore&&(Object(Y.freeOFD)(T.ofdCore),T.ofdCore=null,T.ofdRender=null),Object(Y.CreateLibrary)(),!(A.ofd instanceof File)){I.next=8;break}(g=new FileReader).readAsArrayBuffer(A.ofd),g.onload=function(){var I=Object(Y.readOFD)(g.result,A.secret,A.digest);P(I,A)},I.next=20;break;case 8:if(!(A.ofd instanceof Blob)){I.next=19;break}return I.t0=Y.readOFD,I.next=12,A.ofd.arrayBuffer();case 12:I.t1=I.sent,I.t2=A.secret,I.t3=A.digest,B=(0,I.t0)(I.t1,I.t2,I.t3),P(B,A),I.next=20;break;case 19:A.ofd instanceof ArrayBuffer?(Q=Object(Y.readOFD)(A.ofd,A.secret,A.digest),P(Q,A)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");T.fileName=g[g.length-1]}var B=Object(Y.readOFD)(I.data,A.secret,A.digest);P(B,A)})).catch((function(I){A.fail&&A.fail(I)}));case 20:case"end":return I.stop()}}),I)}))))},_=function(A){iA((function(){T.ofdCore&&(Object(Y.freeOFD)(T.ofdCore),T.ofdCore=null,T.ofdRender=null),Object(Y.CreateLibrary)();var I=Object(Y.readOFDByBase64)(A.ofd,A.secret,A.digest);P(I,A)}))},$=function(A){return T.ofdCore.getOFDPageCount(A)},AA=function(A){return T.ofdCore.getAllAttachment(A)},IA=function(A,I){return T.ofdCore.getAttachmentByID(A,I)},gA=function(A,I){return new Promise((function(g,B){var Q=T.ofdCore.getAttachmentByID(A,I);Q?BI(Q.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},BA=function(A,I,g){var B=96;g&&(B=g/T.ofdCore.pageWidth(A,I)*25.4);var Q=new H.Ofd_Core_Helper(B);return{width:T.ofdCore.pageWidth(A,I),height:T.ofdCore.pageHeight(A,I),renderWidth:Q.pageRenderWidth(A,I,T.ofdCore),renderHeight:Q.pageRenderHeight(A,I,T.ofdCore)}},QA=function(A){return T.ofdCore.getCustomTag(A)},CA=function(A){return T.ofdCore.getAllTextObject(A)},EA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/T.ofdCore.pageWidth(A,0)*25.4);var Q=new H.Ofd_Core_Helper(B);g.waterText?Q.setWaterText(g.waterText):T.waterText&&Q.setWaterText(T.waterText),T.ofdRender?T.ofdRender.setDpi(B):T.ofdRender=new K.Ofd_Render(T.ofdCore,Q),g.mixBlendMode&&T.ofdRender.setMixBlendMode(g.mixBlendMode);var C=[];if(!T.ofdCore.readOfdDocument(A))return C;var E=T.ofdCore.getOFDPageCount(A);g.frontPages>0&&g.frontPages<E&&(E=g.frontPages);for(var D=0;D<E;D++){var i=document.createElement("div"),o=Q.pageRenderWidth(0,D,T.ofdCore),w=Q.pageRenderHeight(0,D,T.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),T.ofdRender.renderPage(i,0,D),C.push(i)}return C},DA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},Q=96;g&&"number"==typeof g&&!isNaN(g)&&(Q=g/T.ofdCore.pageWidth(A,I)*25.4);var C=new H.Ofd_Core_Helper(Q);B.waterText?C.setWaterText(B.waterText):T.waterText&&C.setWaterText(T.waterText),T.ofdRender?T.ofdRender.setDpi(Q):T.ofdRender=new K.Ofd_Render(T.ofdCore,C),B.mixBlendMode&&T.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=C.pageRenderWidth(0,I,T.ofdCore),i=C.pageRenderHeight(0,I,T.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),T.ofdRender.renderPage(E,0,I),E},iA=function(A){if(m)Object(Y.setYYDS)(m),A&&A();else{Object(Y.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;t()({locateFile:function(){return d.wsdsb}}).then((function(I){var g=I.Module;Object(Y.setYYDS)(g),A&&A()}))}},oA=function(){return Object(Y.getStreamData)()},wA=function(A){T.viewer.toolbar&&T.viewer.toolbar.setLanguage(A)},GA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}T.ofdCore&&(T.eventBus=new F.EventBus,T.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(T.ofdCore))},FA=function(A){setTimeout((function(){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}v({ofd:A.ofd,secret:A.secret,digest:A.digest,headers:A.headers,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(I),A.renderOFDCallback&&A.renderOFDCallback()},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,A.container.appendChild(g)}})}),200)},NA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}_({ofd:A.ofd,secret:A.secret,digest:A.digest,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I.ofd),new l.OfdBaseViewer(A.container,A.width,T.eventBus,T.waterText).setOfdCore(I)},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.textContent=I,A.container.appendChild(g)}})},yA=function(A){var I=T.ofdCore.findSignature(0,A.pageRef,A.signatureId),g={signer:I.SignCert.subject,provider:I.SignedInfo.Provider.ProviderName,hashedValue:I.HashHex,HashValid:I.HashValid,signedValue:I.signatureHex,signMethod:I.SignedInfo.SignatureMethod,signVersion:I.SignedInfo.Seal.esVersion,signatureVerify:I.SignatureValid,sealID:I.SignedInfo.Seal.esID,sealName:I.SignedInfo.Seal.Property.name,sealType:I.SignedInfo.Seal.Property.type,sealAuthTime:"".concat(I.SignedInfo.Seal.Property.validStart," 至 ").concat(I.SignedInfo.Seal.Property.validEnd),sealMakeTime:I.SignedInfo.Seal.Property.createDate,sealVersion:I.SignedInfo.Seal.Header.version};A.signatureCallback&&A.signatureCallback(g),setTimeout((function(){var g,B="",Q=p(I.SignedInfo.References);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B+="".concat(Object(Z.replaceFirstSlash)(C.FileRef),"|")}}catch(A){Q.e(A)}finally{Q.f()}var E,D=Object(Y.hashPath)(T.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=p(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,G=w.CheckValue,F=D["".concat(Object(Z.replaceFirstSlash)(w.FileRef))];i&=G===F}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},hA=function(){T.viewer.ofdPrint&&pA()},RA=function(){return T.viewer.eventBus},MA=function(A){UA(A)},UA=function(A){var I;T.viewer&&((I=T.viewer.eventBus)._off("resize",nA),I._off("fileinputchange",lA),I._off("openfile",KA),I._off("nextpage",qA),I._off("previouspage",WA),I._off("pagenumberchanged",fA),I._off("pagechanging",xA),I._off("print",pA),I._off("firstpage",ZA),I._off("lastpage",rA),I._off("zoomin",bA),I._off("zoomout",VA),I._off("scalechanging",mA),I._off("scalechanged",jA),I._off("viewportchanging",TA),I._off("switchspreadmode",XA),I._off("scrollmodechanged",OA),I._off("switchscrollmode",uA),I._off("rotatecw",zA),I._off("rotateccw",PA),I._off("documentproperties",vA),I._off("signatureclick",$A),I._off("attachmentclick",AI),I._off("customtagclick",gI),I._off("download",tA),I._off("langchanged",LA),I._off("pageViewerClick",II),I._off("closePage",JA),I._off("printCallback",dA),I._off("printFinishCallback",eA),I._off("switchannotationeditormode",HA)),T.viewer=new YA(A)},cA=function(A){sA(A)},aA=function(A){T.viewer&&(A?(T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer),_({ofd:A,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A}})):T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail("file undefined"))},sA=function(A){SA({file:A})},kA=function(A,I){SA({file:A,headers:I})},SA=function(A){T.viewer&&(A.file?(T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer),v({ofd:A.file,headers:A.headers,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?T.viewer.l10n.get("error_10001").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&T.viewer.l10n.get("error_10002").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A}))}})):T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail("file undefined"))},YA=Q()((function A(I){var g=this;E()(this,A),this.config=I,this.l10n=new G.GenericL10n("zh-CN"),this.eventBus=new F.EventBus,this.ofdViewer=new N.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),I.sidebar.thumbnailView&&(this.ofdThumbnailViewer=new y.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),this.ofdSignatureViewer=new e.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new n.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new x.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new h.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.overlayManager=new R.OverlayManager,I.signatureProperties&&(this.signatureProperties=new J.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new M.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new U.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new c.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var B=document.createElement("input");B.id="fileInput",B.className="fileInput",B.setAttribute("type","file"),B.setAttribute("accept",".ofd"),document.body.appendChild(B);var Q=this;B.addEventListener("click",(function(A){A.target.value=null})),B.addEventListener("change",(function(A){var I=A.target.files;I&&0!==I.length&&Q.eventBus.dispatch("fileinputchange",{source:this,fileInput:A.target,eventBus:Q.eventBus})})),new a.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var C=document.getElementById("printServiceDialog");C&&(this.ofdPrint=new s.Print(C,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback));var D=I.appContainer||document.documentElement;this.l10n.translate(D).then((function(){g.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",dA),this.eventBus._on("printFinishCallback",eA),this.eventBus._on("resize",nA),this.eventBus._on("fileinputchange",lA),this.eventBus._on("openfile",KA),this.eventBus._on("nextpage",qA),this.eventBus._on("previouspage",WA),this.eventBus._on("pagenumberchanged",fA),this.eventBus._on("pagechanging",xA),this.eventBus._on("print",pA),this.eventBus._on("firstpage",ZA),this.eventBus._on("lastpage",rA),this.eventBus._on("zoomin",bA),this.eventBus._on("zoomout",VA),this.eventBus._on("scalechanging",mA),this.eventBus._on("viewportchanging",TA),this.eventBus._on("scalechanged",jA),this.eventBus._on("switchspreadmode",XA),this.eventBus._on("scrollmodechanged",OA),this.eventBus._on("switchscrollmode",uA),this.eventBus._on("rotatecw",zA),this.eventBus._on("rotateccw",PA),this.eventBus._on("documentproperties",vA),this.eventBus._on("signatureclick",$A),this.eventBus._on("attachmentclick",AI),this.eventBus._on("customtagclick",gI),this.eventBus._on("download",tA),this.eventBus._on("langchanged",LA),this.eventBus._on("pageViewerClick",II),this.eventBus._on("closePage",JA),this.eventBus._on("switchannotationeditormode",HA),window.addEventListener("click",_A),window.addEventListener("resize",(function(){g.eventBus.dispatch("resize",{source:window})})),I.errorWrapper.closeButton.onclick=function(){I.errorWrapper.container.hidden=!0},I.toolbar.presentationModeButton&&(I.toolbar.presentationModeButton.hidden=!0),I.toolbar.viewBookmark&&(I.toolbar.viewBookmark.hidden=!0),I.secondaryToolbar.presentationModeButton&&(I.secondaryToolbar.presentationModeButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),C&&"function"!=typeof C.showModal&&(C&&(C.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function KA(){document.getElementById("fileInput").click()}function HA(A){T.viewer.ofdViewer.annotationEditorMode=A}function JA(){T.viewer.config.closeCallback&&T.viewer.config.closeCallback()}function LA(A){T.viewer.l10n.setLanguage(A.value),T.viewer.l10n.translate(T.viewer.appContainer).then((function(){T.viewer.eventBus.dispatch("localized",{})}))}function tA(){var A=Object(Y.getStreamData)();if(A){if(T.viewer.config.downloadCallback)T.viewer.config.downloadCallback(new Blob([A]));else{var I=window.URL.createObjectURL(new Blob([A])),g=document.createElement("a");g.style.display="none",g.href=I,g.setAttribute("download",T.fileName),document.body.append(g),g.click()}T.viewer.config.downloadFinishEvent&&T.viewer.config.downloadFinishEvent()}var B=Object(Y.getStreamDataBase64)();if(B){var Q=function(A){for(var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",g=atob(A),B=[],Q=0;Q<g.length;Q++)B.push(g.charCodeAt(Q));var C=new Uint8Array(B);return new Blob([C],{type:I})}(B,"application/ofd");if(T.viewer.config.downloadCallback)T.viewer.config.downloadCallback(Q);else{var C=window.URL.createObjectURL(Q),E=document.createElement("a");E.style.display="none",E.href=C,E.setAttribute("download",T.fileName),document.body.append(E),E.click()}T.viewer.config.downloadFinishEvent&&T.viewer.config.downloadFinishEvent()}}function dA(A){T.viewer.config.onPrintContentCallback&&T.viewer.config.onPrintContentCallback(A.html)}function eA(A){T.viewer.config.onPrintFinishEvent&&T.viewer.config.onPrintFinishEvent()}function nA(){var A=T.ofdCore,I=T.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),T.viewer.eventBus.dispatch("stampResize",{source:null})}}function lA(A){T.viewer.config.openFileTip&&(T.viewer.config.openFileTip.hidden=!0),T.viewer.pdfSidebar.isOpen&&T.viewer.pdfSidebar.close();var I=A.fileInput.files[0];T.fileName=I.name,T.viewer.ofdViewer.freeDocument(),T.viewer.config.loadingContainer&&T.viewer.ofdViewer.viewer.appendChild(T.viewer.config.loadingContainer);(new Date).getTime();v({ofd:I,secret:T.viewer.config.secret,digest:T.viewer.config.digest,waterText:T.viewer.config.waterText,success:function(A){(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;T.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),T.viewer.config.exceedTimeLimit&&T.viewer.config.exceedTimeLimit()}T.viewer.config.parserOFDSuccess&&T.viewer.config.parserOFDSuccess(A.ofd),T.ofdCore=A,T.viewer.ofdViewer.setWaterText(T.waterText),T.viewer.ofdViewer.setWaterSetting(T.viewer.config.waterSetting),T.viewer.ofdViewer.setOfdCore(A),T.viewer.ofdThumbnailViewer&&T.viewer.ofdThumbnailViewer.setOfdCore(A),T.viewer.config.signaturesCallback&&T.viewer.config.signaturesCallback(A.getAllSignature(0)),T.viewer.ofdSignatureViewer.setOfdCore(A,T.viewer.config.signatureViewerForceCheck),T.viewer.ofdAttachmentViewer.setOfdCore(A),T.viewer.ofdCustomTagViewer.setOfdCore(A),T.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),T.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),T.viewer.config.sidebarForceOpen&&setTimeout((function(){T.viewer.pdfSidebar.open()}),500)},fail:function(A){T.viewer.config.parserOFDFail&&T.viewer.config.parserOFDFail(A),T.viewer.ofdViewer.freeDocument(),T.viewer.config.errorWrapper.moreInfoButton.hidden=!0,T.viewer.config.errorWrapper.container.hidden=!1,T.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?T.viewer.l10n.get("error_10001").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&T.viewer.l10n.get("error_10002").then((function(A){T.viewer.config.errorWrapper.errorMessage.textContent=A}))}})}function ZA(){T.viewer.ofdViewer.firstPage()}function rA(){T.viewer.ofdViewer.lastPage()}function qA(){T.viewer.ofdViewer.nextPage()}function WA(){T.viewer.ofdViewer.previousPage()}function fA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),T.viewer.toolbar.setPageNumber(A.value,null),T.viewer.secondaryToolbar.setPageNumber(A.value,null)}function xA(A){var I=A.pageNumber;T.viewer.toolbar.setPageNumber(I,null),T.viewer.secondaryToolbar.setPageNumber(I,null),T.viewer.pdfSidebar.isThumbnailViewVisible&&T.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(I),T.viewer.config.onPageChanging&&T.viewer.config.onPageChanging(I)}function pA(){T.viewer.ofdPrint.setOfdCore(T.ofdCore),T.viewer.ofdPrint.open()}function bA(){T.viewer.ofdViewer.increaseScale()}function VA(){T.viewer.ofdViewer.decreaseScale()}function mA(A){T.viewer.toolbar.setPageScale(A.presetValue,A.scale),T.viewer.config.onPageScale&&T.viewer.config.onPageScale(A.scale)}function TA(A){T.viewer.config.onViewportChange&&T.viewer.config.onViewportChange(T.viewer.ofdViewer)}function jA(A){T.viewer.ofdViewer.zoom(A.value)}function XA(A){T.viewer.ofdViewer.setSpreadMode(A.mode)}function OA(A){}function uA(A){T.viewer.ofdViewer.setScrollMode(A.mode)}function zA(){T.viewer.ofdViewer.setRotation(90)}function PA(){T.viewer.ofdViewer.setRotation(-90)}function vA(){T.viewer.ofdDocumentProperties.setOfdCore(T.ofdCore),T.viewer.ofdDocumentProperties.open()}function _A(A){T.viewer.secondaryToolbar.isOpen&&(T.viewer.config.mainContainer.contains(A.target)||T.viewer.config.toolbar.container.contains(A.target)&&A.target!==T.viewer.config.secondaryToolbar.toggleButton)&&T.viewer.secondaryToolbar.close()}function $A(A){if(T.viewer.signatureProperties)if(T.viewer.signatureProperties.setOfdCore(T.ofdCore),A.pageRef||A.signatureId){var I=T.ofdCore.findSignature(0,A.pageRef,A.signatureId);T.viewer.signatureProperties.open(I)}else T.viewer.signatureProperties.open(A.sign.Signature)}function AI(A){var I=A.attachment.FileLocAbs.split("/"),g=A.attachment.Name;g||(g=I[I.length-1]),g.indexOf(".")<0&&(g="".concat(g,".").concat(A.attachment.Format)),BI(A.attachment.FileLocAbs,A.attachment.FileLocPln).then((function(A){var I=window.URL.createObjectURL(new Blob([A])),B=document.createElement("a");B.style.display="none",B.href=I,B.setAttribute("download",g),document.body.append(B),B.click()})).catch((function(A){}))}function II(A){T.viewer.ofdViewer&&T.viewer.ofdViewer.removeHighLight()}function gI(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),T.viewer.toolbar.setPageNumber(A.pageIndex+1,null),T.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function BI(A,I,g){return new Promise((function(g,B){if(Object(Y.getStreamData)()){var Q=Object(Y.JSGetPathEncode)(T.ofdCore.ofdParserPtr,A,I);null!=Q?g(Q):B(1)}}))}},function(A,I,g){var B=g(2);function Q(A,I){for(var g=0;g<I.length;g++){var Q=I[g];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(A,B(Q.key),Q)}}A.exports=function(A,I,g){return I&&Q(A.prototype,I),g&&Q(A,g),Object.defineProperty(A,"prototype",{writable:!1}),A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(4);A.exports=function(A){var I=Q(A,"string");return"symbol"===B(I)?I:String(I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default;A.exports=function(A,I){if("object"!==B(A)||null===A)return A;var g=A[Symbol.toPrimitive];if(void 0!==g){var Q=g.call(A,I||"default");if("object"!==B(Q))return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(A,I,g,B,Q,C,E){try{var D=A[C](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,Q)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(Q,C){var E=A.apply(I,B);function D(A){g(E,Q,C,D,i,"next",A)}function i(A){g(E,Q,C,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(8)();A.exports=B;try{regeneratorRuntime=B}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},function(A,I,g){var B=g(3).default;function Q(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},C=Object.prototype,E=C.hasOwnProperty,D=Object.defineProperty||function(A,I,g){A[I]=g.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",w=i.asyncIterator||"@@asyncIterator",G=i.toStringTag||"@@toStringTag";function F(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{F({},"")}catch(I){F=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var Q=I&&I.prototype instanceof a?I:a,C=Object.create(Q.prototype),E=new l(B||[]);return D(C,"_invoke",{value:t(A,g,E)}),C}function y(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}g.wrap=N;var h="suspendedStart",R="suspendedYield",M="executing",U="completed",c={};function a(){}function s(){}function k(){}var S={};F(S,o,(function(){return this}));var Y=Object.getPrototypeOf,K=Y&&Y(Y(Z([])));K&&K!==C&&E.call(K,o)&&(S=K);var H=k.prototype=a.prototype=Object.create(S);function J(A){["next","throw","return"].forEach((function(I){F(A,I,(function(A){return this._invoke(I,A)}))}))}function L(A,I){function g(Q,C,D,i){var o=y(A[Q],A,C);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&E.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;D(this,"_invoke",{value:function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}})}function t(A,g,B){var Q=h;return function(C,E){if(Q===M)throw new Error("Generator is already running");if(Q===U){if("throw"===C)throw E;return{value:I,done:!0}}for(B.method=C,B.arg=E;;){var D=B.delegate;if(D){var i=d(D,B);if(i){if(i===c)continue;return i}}if("next"===B.method)B.sent=B._sent=B.arg;else if("throw"===B.method){if(Q===h)throw Q=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);Q=M;var o=y(A,g,B);if("normal"===o.type){if(Q=B.done?U:R,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(Q=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,Q=A.iterator[B];if(Q===I)return g.delegate=null,"throw"===B&&A.iterator.return&&(g.method="return",g.arg=I,d(A,g),"throw"===g.method)||"return"!==B&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+B+"' method")),c;var C=y(Q,A.iterator,g.arg);if("throw"===C.type)return g.method="throw",g.arg=C.arg,g.delegate=null,c;var E=C.arg;return E?E.done?(g[A.resultName]=E.value,g.next=A.nextLoc,"return"!==g.method&&(g.method="next",g.arg=I),g.delegate=null,c):E:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,c)}function e(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function n(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function l(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(e,this),this.reset(!0)}function Z(A){if(A||""===A){var g=A[o];if(g)return g.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var Q=-1,C=function g(){for(;++Q<A.length;)if(E.call(A,Q))return g.value=A[Q],g.done=!1,g;return g.value=I,g.done=!0,g};return C.next=C}}throw new TypeError(B(A)+" is not iterable")}return s.prototype=k,D(H,"constructor",{value:k,configurable:!0}),D(k,"constructor",{value:s,configurable:!0}),s.displayName=F(k,G,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===s||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,k):(A.__proto__=k,F(A,G,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},J(L.prototype),F(L.prototype,w,(function(){return this})),g.AsyncIterator=L,g.async=function(A,I,B,Q,C){void 0===C&&(C=Promise);var E=new L(N(A,I,B,Q),C);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},J(H),F(H,G,"Generator"),F(H,o,(function(){return this})),F(H,"toString",(function(){return"[object Generator]"})),g.keys=function(A){var I=Object(A),g=[];for(var B in I)g.push(B);return g.reverse(),function A(){for(;g.length;){var B=g.pop();if(B in I)return A.value=B,A.done=!1,A}return A.done=!0,A}},g.values=Z,l.prototype={constructor:l,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=I,this.done=!1,this.delegate=null,this.method="next",this.arg=I,this.tryEntries.forEach(n),!A)for(var g in this)"t"===g.charAt(0)&&E.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=I)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var g=this;function B(B,Q){return D.type="throw",D.arg=A,g.next=B,Q&&(g.method="next",g.arg=I),!!Q}for(var Q=this.tryEntries.length-1;Q>=0;--Q){var C=this.tryEntries[Q],D=C.completion;if("root"===C.tryLoc)return B("end");if(C.tryLoc<=this.prev){var i=E.call(C,"catchLoc"),o=E.call(C,"finallyLoc");if(i&&o){if(this.prev<C.catchLoc)return B(C.catchLoc,!0);if(this.prev<C.finallyLoc)return B(C.finallyLoc)}else if(i){if(this.prev<C.catchLoc)return B(C.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return B(C.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&E.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var C=Q?Q.completion:{};return C.type=A,C.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,c):this.complete(C)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),c},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),n(g),c}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;n(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:Z(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"GenericL10n",(function(){return N}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(10),g(11)),F=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}))}var I,g,B,C,D;return i()(A,[{key:"setLanguage",value:(D=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(C=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getLanguage());case 4:case"end":return A.stop()}}),A,this)}))),function(){return C.apply(this,arguments)})},{key:"getDirection",value:(B=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getDirection());case 4:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"get",value:(g=Q()(w.a.mark((function A(I){var g,B,Q,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=C.length>1&&void 0!==C[1]?C[1]:null,B=C.length>2&&void 0!==C[2]?C[2]:Object(G.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return Q=A.sent,A.abrupt("return",Q.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=Q()(w.a.mark((function A(I){var g;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return g=A.sent,A.abrupt("return",g.translate(I));case 4:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading",o=!0;function w(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,o),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function G(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}w(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,w){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",h=I.split("-",1)[0],R=!1,M="";!function A(){for(;;){if(!F.length)return void w();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),R="*"!==y&&y!==I&&y!==h;continue}if(R)continue;if(M=o.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function F(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,w,F=0;w=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,w)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var h=y.default_locale.toLowerCase();for(var R in y.locales){if((R=R.toLowerCase())===A){B=y.locales[A];break}R===h&&(B=y.locales[h])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){G(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=h(D=y(D,I,A,E),I,A),C[E]=D}return C}function y(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function h(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function R(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=N(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=N(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){F(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)R(g[Q]);R(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(6),Q=g.n(B),C=g(7),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return s})),g.d(I,"EventBus",(function(){return a})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),Q=g.n(B),C=g(16),E=g.n(C),D=g(18),i=g.n(D),o=g(15),w=g.n(o),G=g(5),F=g.n(G),N=g(1),y=g.n(N);function h(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof a?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof a?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var a=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=R(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=R(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]),this._listeners[A].push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),s=function(A){E()(g,A);var I=h(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(a)},function(A,I,g){var B=g(14);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(17);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(19);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return a}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(21),w=g.n(o),G=g(7),F=g.n(G),N=g(22),y=g(29),h=g(30),R=g(87),M=g(36);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var a=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new h.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new R.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E,D,i,o,w;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=27;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),C=this,E=U(document.getElementsByName("seal_img_div_".concat(g.id-1))),A.prev=8,i=F.a.mark((function A(){var I;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=D.value).addEventListener("click",(function(){C.eventBus.dispatch("signatureclick",{source:C,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 2:case"end":return A.stop()}}),A)})),E.s();case 11:if((D=E.n()).done){A.next=15;break}return A.delegateYield(i(),"t0",13);case 13:A.next=11;break;case 15:A.next=20;break;case 17:A.prev=17,A.t1=A.catch(8),E.e(A.t1);case 20:return A.prev=20,E.f(),A.finish(20);case 23:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),o=0;o<g.id-10;o++)(w=this._pages[o]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(w.div.firstChild),w.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 27:return A.abrupt("return",!1);case 28:case"end":return A.stop()}}),A,this,[[8,17,20,23]])}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale,pageWidthMM:this.core.pageWidth(0,g),pageHeightMM:this.core.pageHeight(0,g)};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I,g){var B=g(2);A.exports=function(A,I,g){return(I=B(I))in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return q})),g.d(I,"AutoPrintRegExp",(function(){return J})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return x})),g.d(I,"binarySearchFirstItem",(function(){return r})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return f})),g.d(I,"getVisibleElements",(function(){return p})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return j})),g.d(I,"isValidSpreadMode",(function(){return X})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return h})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return b})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return V})),g.d(I,"OutputScale",(function(){return L})),g.d(I,"parseQueryString",(function(){return e})),g.d(I,"PresentationModeState",(function(){return s})),g.d(I,"ProgressBar",(function(){return z})),g.d(I,"removeNullCharacters",(function(){return Z})),g.d(I,"RendererType",(function(){return S})),g.d(I,"RenderingStates",(function(){return a})),g.d(I,"roundToDivide",(function(){return W})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return k})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return Y})),g.d(I,"UNKNOWN_SCALE",(function(){return R})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(23),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,h=10,R=0,M=1.25,U=40,c=5,a={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},s={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},k={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},S={CANVAS:"canvas",SVG:"svg"},Y={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},J=/\bprint\s*\(/,L=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function e(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,l=/[\x01-\x1F]/g;function Z(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(l," ")),A.replace(n,""))}function r(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=A.length-1;if(B<0||!I(A[B]))return A.length;if(I(A[g]))return g;for(;g<B;){var Q=g+B>>1;I(A[Q])?B=Q:g=Q+1}return g}function q(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function W(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function f(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function x(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function p(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,h=g.length,R=r(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});R>0&&R<h&&!E&&(R=x(R,g,o));for(var M=E?F:-1,U=R;U<h;U++){var c=g[U],a=c.div,s=a.offsetLeft+a.clientLeft,k=a.offsetTop+a.clientTop,S=a.clientWidth,Y=a.clientHeight,K=s+S,H=k+Y;if(-1===M)H>=w&&(M=H);else if((E?s:k)>M)break;if(!(H<=o||k>=w||K<=G||s>=F)){var J=Math.max(0,o-k)+Math.max(0,H-w),L=(S-(Math.max(0,G-s)+Math.max(0,K-F)))/S,t=(Y-J)/Y*L*100|0;N.push({id:c.id,x:s,y:k,view:c,percent:t,widthPercent:100*L|0}),y.add(c.id)}}var d=N[0],e=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:e,views:N,ids:y}}function b(A){A.preventDefault()}function V(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=V(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function j(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function X(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var u=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var z=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return k.NONE;case"UseThumbs":return k.THUMBS;case"UseOutlines":return k.OUTLINE;case"UseAttachments":return k.ATTACHMENTS;case"UseOC":return k.LAYERS}return k.NONE}},function(A,I,g){var B=g(24),Q=g(25),C=g(26),E=g(28);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C,E,D=[],i=!0,o=!1;try{if(C=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=C.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,Q=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw Q}}return D}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(27);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(22);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var h=I[y-1];if(!C(h))return h}}var R=g?w:o-2,M=I[R];return M&&!C(M)||B&&(M=I[R+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return U}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=g(31),F=g(32),N=g(35),y=(g(36),g(37)),h=g.n(y);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],y=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,a=R(i);try{for(a.s();!(c=a.n()).done;){var s,k=c.value,S=R(w);try{for(S.s();!(s=S.n()).done;){var Y=s.value;if(Y.ID==k.TemplateID){if((Y=B?B.readPageFromTemplate(Y):this.core.readPageFromTemplate(Y)).Page.Content){var K,H=R(Y.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var J=K.value;this.renderLayer(C,Q,g,A,y,h,U,M,J,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){S.e(A)}finally{S.f()}}}catch(A){a.e(A)}finally{a.f()}}if(D.Page.Content){var L,t=R(D.Page.Content.Layer);try{for(t.s();!(L=t.n()).done;){var d=L.value;this.renderLayer(C,Q,g,A,y,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var e,n=R(o);try{for(n.s();!(e=n.n()).done;){var l=e.value;if(D.ID==l.PageID){var Z,r=R(l.PageAnnot.Annot);try{for(r.s();!(Z=r.n()).done;){var q=Z.value;this.renderAnnotation(C,Q,A,q,y,h,U,M,g)}}catch(A){r.e(A)}finally{r.f()}}}}catch(A){n.e(A)}finally{n.f()}var W,f=R(F);try{for(f.s();!(W=f.n()).done;){var x,p=W.value,b=R(p.Signature.SignedInfo.StampAnnot);try{for(b.s();!(x=b.n()).done;){var V=x.value,m=V.PageRef;if(D.ID==m){var T=V.Boundary;if(p.Signature.PicType&&p.Signature.PicType.length>0)if("ofd"===p.Signature.PicType)for(var j=new N.Ofd_Core(p.Signature.ofd),X=0;X<j.getOFDPageCount(0);X++)this.renderSealPage(A,X,j,!0,T,m,V.ID,g,p.Signature.ZipName);else if("svg"===p.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=p.Signature.svg;var z=void 0,P=u.children[0].width.baseVal.value,v=u.children[0].height.baseVal.value;P!==O.w&&(z="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),u.setAttribute("style","".concat(z,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",V.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(p.Signature.PicType,";base64,").concat(p.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,V.Clip,!0,m,V.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),p.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",V.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){f.e(A)}finally{f.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),h=document.createElement("div");h.setAttribute("name","seal_img_div_".concat(D)),h.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),h.setAttribute("data-signature-id",E),h.setAttribute("data-page-ref",C),this.renderPage(h,0,I,g,E,i);var R=document.createElement("div");R.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),R.appendChild(h),A.appendChild(R)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var a=Object(G.getDrawParam)(C,c.Relative);a&&(a.StrokeColor&&(c.StrokeColor=a.StrokeColor),a.FillColor&&(c.FillColor=a.FillColor),a.LineWidth&&(c.LineWidth=a.LineWidth))}c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var s=i.PageBlock;if(s){var k,S=R(s);try{for(S.s();!(k=S.n()).done;){var Y=k.value;if("ImageObject"==Y.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,Y,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==Y.Type){var H=this.renderPathObject(A,I,g,C,Y,y,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==Y.Type){if(i.ctm){var J=i.ctm.split(" ");Y.CTM={a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}var L=this.renderTextObject(B,Q,Y,y,h,C,w,F,N);B.appendChild(L)}else if("CompositeObject"==Y.Type){var t,d=R(D);try{for(d.s();!(t=d.n()).done;){var e=t.value;if(e.ID===Y.ResourceID){var n=Y.Alpha,l=Y.Boundary,Z=Y.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,e,!1,n,l,Z);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){S.e(A)}finally{S.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var h=Object(G.getMultiMedia)(C,y);if(!h.MediaFile)return null;var R,M=E.ImageMask;if(M>0&&(R=Object(G.getMultiMedia)(C,M)).MediaFile&&!(R.width>0||R.height>0)&&R.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);U.ext,R.width=U.width,R.height=U.height,R.FileBase64=U.fileBase64}if(!(h.width>0||h.height>0)&&h.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;h.width=c.width,h.height=c.height,h.FileBase64=c.fileBase64}var a=E.CTM,s=E.Clips,k=E.BlendMode,S=E.Alpha;return this.renderImageOnDiv(g,B,Q,h.FileBase64,h.width,h.height,N,!1,D,null,null,a,i,o,s,E.ID,k,S,M>0&&R.FileBase64?R.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,y,h,M,U,c,a,s){var k=parseFloat(I.replace("px","")),S=parseFloat(g.replace("px","")),Y=E.w>k?k:E.w,K=E.h>S?S:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),J=document.createElementNS("http://www.w3.org/2000/svg","image"),L="";i&&(L="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(Y," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),J.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;J.setAttribute("xlink:href",B),J.href.baseVal=B,J.setAttribute("width","".concat(t,"px")),J.setAttribute("height","".concat(d,"px")),c&&J.setAttribute("opacity","".concat(c/255));var e="";if(F){var n=1,l=1;if(s){var Z=s.split(" ");n=Z[0],l=Z[3]}e="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*l," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}y&&(e="".concat(e," matrix(").concat(y.a," ").concat(y.b," ").concat(y.c," ").concat(y.d," ").concat(Object(G.converterDpi)(y.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(y.f,this.coreHelper.dpi),")")),J.setAttribute("transform",e);var r="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),r="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var q=[];if(h&&h.length>0)for(var W=0;W<h.length;W++){var f=document.createElementNS("http://www.w3.org/2000/svg","clipPath");f.setAttribute("id","image-clip-path-".concat(M,"-").concat(W));for(var x=h[W].Clip,p=0;p<x.length;p++){var b=x[p].Area,V=0,m=0,T=0,j=0;b.Path.Boundary&&(V=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,j=b.Path.Boundary.h);var X=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)F=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");X.setAttribute("transform",O)}var u,z="",P=R(b.Path.AbbreviatedData);try{for(P.s();!(u=P.n()).done;){var v=u.value;"M"===v.cmd||"S"===v.cmd?z+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}X.setAttribute("d",z),f.appendChild(X)}q.push(f)}if(a){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",a),$.href.baseVal=a,$.setAttribute("width","".concat(t,"px")),$.setAttribute("height","".concat(d,"px")),$.setAttribute("filter"," invert(100%)"),_.appendChild($),H.appendChild(_),J.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(J);var AA,IA=E.x,gA=E.y;if(y){var BA=y.a,QA=y.b,CA=y.c,EA=y.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(L,"overflow: visible; position: absolute; width: ").concat(Y,"px; height: ").concat(K,"px; ").concat(r,";").concat(AA,";");if(q.length>0)if(1==q.length)H.appendChild(q[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=R(q);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,y=g.HScale,M=g.Font,U=g.Weight,c=g.Alpha/255,a=g.Size>0;N&&!a&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var s=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),k=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,a,y),S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("version","1.1"),S.setAttribute("id",g.ID);var Y,K,H,J=g.FillColor,L=!1,t=g.DrawParam;if(t){var d=Object(G.getDrawParam)(C,t);d.FillColor&&(J&&J.Value||(J=d.FillColor))}if(J){J.Value&&(B=Object(G.parseColor)(J.Value)),o=J.alpha/255;var e=J.axialShd;if(e){L=!0;var n=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");n.setAttribute("id","".concat(g.ID)),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","100%");var l,Z=R(e.Segment);try{for(Z.s();!(l=Z.n()).done;){var r=l.value;if(r){var q=document.createElement("stop");q.setAttribute("offset","".concat(100*r.position,"%")),q.setAttribute("style","stop-color:".concat(Object(G.parseColor)(r.color.Value),";stop-opacity:1")),n.appendChild(q),B=Object(G.parseColor)(r.color.Value)}}}catch(A){Z.e(A)}finally{Z.f()}S.appendChild(n)}}g.Stroke&&(Y=Object(G.parseColor)(g.StrokeColor.Value),K=g.LineWidth,H=g.LineWidth),g.Fill||(o=0);var W=w.w,f=w.h,x=w.x,p=w.y,b=s,V=s,m=0;if(N){var T=N.a,j=N.b,X=N.c,O=N.d,u=T>0?Math.sign(T)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),z=O>0?Math.sign(O)*Math.sqrt(j*j+O*O):Math.sqrt(j*j+O*O);0==(m=Math.atan2(-j,O))&&0!=T&&1==O||(b*=u,V*=z,H*=u),0==m&&0!=T&&1==O&&(b*=u,V*=z,H*=u),0==m&&y-0==1&&(y=T/O)>0&&(b*=y)}if(i){var P=i.a,v=i.b,_=i.c,$=i.d,AA=P>0?Math.sign(P)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),IA=$>0?Math.sign($)*Math.sqrt(v*v+$*$):Math.sqrt(v*v+$*$);0==(m=Math.atan2(-v,$))&&0!=P&&1==$||(b*=AA,V*=IA,p*=IA,x*=AA,W*=AA,f*=IA)}var gA=Object(G.getFont)(I,M),BA="",QA="",CA="",EA="";N&&(EA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(EA="".concat(EA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),y&&(EA="".concat(EA," scale(").concat(y,", 1)"));for(var DA=!1,iA=0;iA<k.length;iA++){var oA=k[iA];if(oA&&!isNaN(oA.x)){if(oA.glyph&&gA&&gA.face){DA=!0;var wA=Object(F.loadFaceInfo)(gA.face),GA=Object(F.FT_Glyph_Get_Measure)(gA.face,oA.glyph);H=g.LineWidth;var FA=this.drawGlyph(GA.glyphPath,GA.horiUnderlinePosition,wA.units_per_EM,b,V,Q||B,o,Y,H,g.ID);if(0===m)FA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(oA.cx),"px; top: ").concat(oA.cy-FA.yScale*GA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),A.appendChild(FA.img);else{var NA=document.createElement("div");NA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-m,"rad);position:absolute; left: ").concat(oA.cx,"px; top: ").concat(oA.cy-FA.yScale*GA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),FA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),NA.appendChild(FA.img),A.appendChild(NA)}}if(BA=y?"".concat(BA).concat(oA.x+y*oA.x," "):"".concat(BA).concat(oA.x," "),QA="".concat(QA).concat(oA.y," "),CA=" "==oA.text?"".concat(CA," "):"".concat(CA).concat(oA.text),k.length>1&&y){var yA=document.createElementNS("http://www.w3.org/2000/svg","text");yA.setAttribute("x",oA.x),yA.setAttribute("y",oA.y),yA.innerHTML=oA.text,yA.setAttribute("transform",EA),L?yA.setAttribute("fill",B):(yA.setAttribute("fill",Q),yA.setAttribute("fill",B),yA.setAttribute("fill-opacity",DA?0:o<c?o:c)),DA||(hA&&S.appendChild(hA),yA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&K>0&&(yA.setAttribute("stroke",Y),yA.setAttribute("stroke-width",Object(G.converterDpi)(K,this.coreHelper.dpi))),yA.setAttribute("style","font-weight: ".concat(U,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(gA),";")),DA||S.appendChild(yA)}}}var hA=null,RA=g.Clips;if(RA&&RA.length>0){for(var MA=[],UA=0;UA<RA.length;UA++){(hA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(UA));for(var cA=RA[UA].Clip,aA=0;aA<cA.length;aA++){var sA=cA[aA].Area,kA=document.createElementNS("http://www.w3.org/2000/svg","path"),SA="",YA=0,KA=0;sA.Path.Boundary&&(YA=sA.Path.Boundary.x,KA=sA.Path.Boundary.y),DA&&(KA=-KA);var HA,JA=R(sA.Path.AbbreviatedData);try{for(JA.s();!(HA=JA.n()).done;){var LA=HA.value;"M"===LA.cmd||"S"===LA.cmd?SA+="M ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," "):"L"===LA.cmd?SA+="L ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," "):"B"===LA.cmd?SA+="C ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[4]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5]+KA,this.coreHelper.dpi)," "):"Q"===LA.cmd?SA+="Q ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+KA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+KA,this.coreHelper.dpi)," "):"A"===LA.cmd?SA+="A ".concat(Object(G.converterDpi)(LA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[6],this.coreHelper.dpi)):"C"===LA.cmd&&(SA+="Z")}}catch(A){JA.e(A)}finally{JA.f()}kA.setAttribute("d",SA),hA.appendChild(kA),MA.push(hA)}}if(MA.length>0)if(1==MA.length)S.appendChild(MA[0]);else{var tA,dA=R(MA);try{for(dA.s();!(tA=dA.n()).done;){var eA=tA.value;void 0!==eA.children[0].getAttribute("d")&&"clip-path:path('".concat(eA.children[0].getAttribute("d"),"');")}}catch(A){dA.e(A)}finally{dA.f()}}}if(!y){var nA=document.createElementNS("http://www.w3.org/2000/svg","text");if(nA.setAttribute("x",BA),nA.setAttribute("y",QA),nA.textContent=CA,nA.setAttribute("transform",EA),L?nA.setAttribute("fill",B):(nA.setAttribute("fill",Q),nA.setAttribute("fill",B),nA.setAttribute("fill-opacity",DA?0:o<c?o:c)),g.Visible||nA.setAttribute("fill-opacity",0),DA||(hA&&S.appendChild(hA),nA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&K>0&&(nA.setAttribute("stroke",Y),nA.setAttribute("stroke-width",Object(G.converterDpi)(K,this.coreHelper.dpi))),nA.setAttribute("style","font-weight: ".concat(U,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(gA),";")),Object(G.getFontFamily)(gA)&&Object(G.getFontFamily)(gA).indexOf("BarCode")>=0)return"*"==CA||(h()(S,CA,{width:5,fontSize:s,text:"*".concat(CA,"*")}),S.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(f,"px;left:").concat(x,"px;top:").concat(p,"px;")),S.childNodes[1].lastChild.style.letterSpacing="20px"),S;DA&&(nA.setAttribute("fill",""),nA.setAttribute("stroke","")),S.appendChild(nA)}if(D){var lA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=lA.x,p+=lA.y}return S.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(f,"px;left:").concat(x,"px;top:").concat(p,"px;")),S}},{key:"renderPathObjectByCanvas",value:function(A,I,g,B,Q,C,E,D,i,o,w){var F=I.Boundary;if(F){F=Object(G.converterBox)(F,this.coreHelper.dpi);var N=Math.ceil(F.w),y=Math.ceil(F.h),h=F.x,M=F.y;if(N-0!=0&&y-0!=0){var U=document.createElement("canvas"),c=U.getContext("2d");U.width=1*N,U.height=1*y,U.style.width="".concat(N,"px"),U.style.height="".concat(y,"px");var a=I.LineWidth,s=I.AbbreviatedData,k=I.CTM,S=I.StrokeColor,Y=I.FillColor;a&&(Q=Object(G.converterDpi)(a,this.coreHelper.dpi));var K=I.DrawParam;if(K){var H=Object(G.getDrawParam)(A,K);(a=H.LineWidth)&&(Q=Object(G.converterDpi)(a,this.coreHelper.dpi)),H.FillColor&&(Y&&Y.Value||(Y=H.FillColor)),H.StrokeColor&&(S&&S.Value||(S=H.StrokeColor))}k&&c.transform(k.a,k.b,k.c,k.d,Object(G.converterDpi)(k.e,this.coreHelper.dpi),Object(G.converterDpi)(k.f,this.coreHelper.dpi));var J=!1;if(S){S.Value&&(B=Object(G.parseColor)(S.Value));var L=S.axialShd;if(L){J=!0;var t,d=Object(G.parseCtm)(L.StartPoint),e=Object(G.parseCtm)(L.EndPoint),n=c.createLinearGradient(d[0],d[1],e[0],e[1]),l=R(L.Segment);try{for(l.s();!(t=l.n()).done;){var Z=t.value;Z&&n.addColorStop(Z.position,Object(G.parseColor)(Z.color.Value))}}catch(A){l.e(A)}finally{l.f()}c.lineWidth=Q,c.strokeStyle=n}}var r=!1;if(Y){Y.Value&&(g=Object(G.parseColor)(Y.Value)),Y.Alpha&&0===Y.Alpha&&(c.globalAlpha=0);var q=Y.AxialShd;if(q){r=!0;var W,f=Object(G.parseCtm)(q.StartPoint),x=Object(G.parseCtm)(q.EndPoint),p=c.createLinearGradient(f[0],f[1],x[0],x[1]),b=R(q.Segment);try{for(b.s();!(W=b.n()).done;){var V=W.value;V&&p.addColorStop(V.position,Object(G.parseColor)(V.color.Value))}}catch(A){b.e(A)}finally{b.f()}c.fillStyle=p}}Q>0&&!B&&((B=g)||(B="rgb(0, 0, 0)"));var m=I.Clips;if(m&&m.length>0)for(var T=[],j=0;j<m.length;j++){for(var X=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),O=m[j].Clip,u=0;u<O.length;u++){var z=O[u].Area,P=document.createElementNS("http://www.w3.org/2000/svg","path"),v=0,_=0,$=0,AA=0;if(z.Path.Boundary&&(v=z.Path.Boundary.x,_=z.Path.Boundary.y,$=z.Path.Boundary.w,AA=z.Path.Boundary.h),!z.TransFlag&&z.CTM){var IA=z.CTM,gA=void 0;if(gA=k?"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e-k.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f-k.f,this.coreHelper.dpi),")"):"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f,this.coreHelper.dpi),")"),k){var BA=[[k.a,k.c,0],[k.b,k.d,0],[0,0,1]],QA=Object(G.inv)(BA);isNaN(QA[0][0])||QA[0][0]===1/0||(gA="".concat(gA," matrix(").concat(QA[0][0]," ").concat(QA[1][0]," ").concat(QA[0][1]," ").concat(QA[1][1]," 0 0)"))}P.setAttribute("transform",gA)}if(!z.TransFlag&&z.Path.CTM){var CA=z.Path.CTM,EA="matrix(".concat(CA.a," ").concat(CA.b," ").concat(CA.c," ").concat(CA.d," ").concat(Object(G.converterDpi)(CA.e-k.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(CA.f-k.f,this.coreHelper.dpi),")");if(k){var DA=[[k.a,k.c,0],[k.b,k.d,0],[0,0,1]],iA=Object(G.inv)(DA);isNaN(iA[0][0])||iA[0][0]===1/0||(EA="".concat(EA," matrix(").concat(iA[0][0]," ").concat(iA[1][0]," ").concat(iA[0][1]," ").concat(iA[1][1]," 0 0)"))}P.setAttribute("transform",EA)}c.beginPath();var oA,wA=R(z.Path.AbbreviatedData);try{for(wA.s();!(oA=wA.n()).done;){var GA=oA.value;"M"===GA.cmd||"S"===GA.cmd?c.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"L"===GA.cmd?c.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"B"===GA.cmd&&c.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[2]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[3]+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[4]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[5]+_,this.coreHelper.dpi))}}catch(A){wA.e(A)}finally{wA.f()}c.closePath(),c.clip()}T.push(X)}if(I.Join&&c.setLineJoin(I["@_Join"]),I.Cap&&c.setLineCap(I["@_Cap"]),I.DashPattern){var FA=I.DashPattern,NA=Object(G.parseCtm)(FA);I.DashOffset&&I.DashOffset,c.setLineDash([Object(G.converterDpi)(NA[0],this.coreHelper.dpi),Object(G.converterDpi)(NA[1],this.coreHelper.dpi)])}c.beginPath();var yA,hA=R(s);try{for(hA.s();!(yA=hA.n()).done;){var RA=yA.value;"M"===RA.cmd||"S"===RA.cmd?c.moveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"L"===RA.cmd?c.lineTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"B"===RA.cmd?c.bezierCurveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[5],this.coreHelper.dpi)):"Q"===RA.cmd?c.quadraticCurveTo(Object(G.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(RA.crds[3],this.coreHelper.dpi)):"A"===RA.cmd||"C"===RA.cmd&&c.closePath()}}catch(A){hA.e(A)}finally{hA.f()}I.Stroke&&(J||(c.strokeStyle=B,c.lineWidth=Q),c.stroke());var MA=Y.pattern;if(!I.Fill||MA?c.fillStyle="none":(r||(c.fillStyle=g),c.fill(I.Rule)),D){var UA=document.createElement("canvas"),cA=Object(G.converterBox)(D,this.coreHelper.dpi),aA=cA.w,sA=cA.h;cA.x,cA.y;UA.width=1*aA,UA.height=1*sA,UA.style.width="".concat(aA,"px"),UA.style.height="".concat(sA,"px");var kA=UA.getContext("2d");i&&kA.transform(i.a,i.b,i.c,i.d,Object(G.converterDpi)(i.e,this.coreHelper.dpi),Object(G.converterDpi)(i.f,this.coreHelper.dpi)),E&&(kA.globalAlpha=E/255),kA.drawImage(U,h,M)}return U}}}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,y){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};var U=(M=Object(G.converterBox)(M,this.coreHelper.dpi)).w,c=M.h,a=M.x,s=M.y,k="overflow:hidden;position:absolute;width:".concat(Math.ceil(U),"px;height:").concat(Math.ceil(c),"px;"),S=Q.Clips;if(S&&S.length>1)return{svg:this.renderPathObjectByCanvas(d,Q,C,E,D,i,o,w,F,N,y),style:k,left:a,top:s};var Y=Q.LineWidth,K=Q.AbbreviatedData,H=Q.StrokeColor,J=Q.FillColor,L=Q.CTM,t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("ID",Q.ID),Y&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi));var d=Q.DrawParam;if(d){var e=Object(G.getDrawParam)(B,d);(Y=e.LineWidth)&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi)),e.FillColor&&(J&&J.Value||(J=e.FillColor)),e.StrokeColor&&(H&&H.Value||(H=e.StrokeColor))}L?t.setAttribute("transform","matrix(".concat(L.a," ").concat(L.b," ").concat(L.c," ").concat(L.d," ").concat(Object(G.converterDpi)(L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(L.f,this.coreHelper.dpi),")")):F&&t.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(H){H.Value&&(E=Object(G.parseColor)(H.Value));var n=H.axialShd;if(n){!0;var l=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");l.setAttribute("id","".concat(Q.ID)),l.setAttribute("x1","0%"),l.setAttribute("y1","0%"),l.setAttribute("x2","100%"),l.setAttribute("y2","100%");var Z,r=R(n.Segment);try{for(r.s();!(Z=r.n()).done;){var q=Z.value;if(q){var W=document.createElement("stop");W.setAttribute("offset","".concat(100*q.position,"%")),W.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),l.appendChild(W),E=Object(G.parseColor)(q.color.Value)}}}catch(A){r.e(A)}finally{r.f()}h.appendChild(l)}}if(J){J.Value&&(C=Object(G.parseColor)(J.Value)),void 0!==J.Alpha&&0===J.Alpha&&(C="none"),void 0!==J.alpha&&0===J.alpha?C="none":t.setAttribute("fill-opacity","".concat(J.alpha/255));var f=J.axialShd;if(f){!0;var x=document.createElement("linearGradient");x.setAttribute("id","".concat(Q.ID)),x.setAttribute("x1","0%"),x.setAttribute("y1","0%"),x.setAttribute("x2","100%"),x.setAttribute("y2","100%");var p,b=R(f.Segment);try{for(b.s();!(p=b.n()).done;){var V=p.value;if(V){var m=document.createElement("stop");m.setAttribute("offset","".concat(100*V.position,"%")),m.setAttribute("style","stop-color:".concat(Object(G.parseColor)(V.color.Value),";stop-opacity:1")),x.appendChild(m),C=Object(G.parseColor)(V.color.Value)}}}catch(A){b.e(A)}finally{b.f()}h.appendChild(x)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&t.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(t.setAttribute("stroke","".concat(E)),t.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(t.setAttribute("fill-rule",Q.Rule),t.setAttribute("fill","".concat(i?"none":C||"none"))):t.setAttribute("fill","none"),Q.Join&&t.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&t.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var T=Q.DashPattern,j=Object(G.parseCtm)(T),X=0;Q.DashOffset&&(X=Q.DashOffset),t.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(j[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(j[1],this.coreHelper.dpi))),t.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(X,this.coreHelper.dpi),"px"))}var O,u="",z=R(K);try{for(z.s();!(O=z.n()).done;){var P=O.value;"M"===P.cmd||"S"===P.cmd?u+="M ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"L"===P.cmd?u+="L ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"B"===P.cmd?u+="C ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi)," "):"Q"===P.cmd?u+="Q ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," "):"A"===P.cmd?u+="A ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(P.crds[2]," ").concat(P.crds[3],",").concat(P.crds[4]," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(P.crds[6],this.coreHelper.dpi)," "):"C"===P.cmd&&(u+="Z")}}catch(A){z.e(A)}finally{z.f()}t.setAttribute("d",u),h.appendChild(t);var v=J.pattern;if(v){var _=document.createElementNS("http://www.w3.org/2000/svg","defs"),$=document.createElementNS("http://www.w3.org/2000/svg","pattern");$.setAttribute("width",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),v.ctm&&$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)+Object(G.converterDpi)(v.ctm.split(" ")[5],this.coreHelper.dpi)),$.setAttribute("x",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("y",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),$.setAttribute("id","pattern1-".concat(Q.ID)),$.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,$,y,B,N,null,v,!1,null,null,null),_.appendChild($),h.appendChild(_);var AA=document.createElementNS("http://www.w3.org/2000/svg","rect");AA.setAttribute("width",U),AA.setAttribute("height",c),AA.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(AA)}if(S&&S.length>0){for(var IA=[],gA=0;gA<S.length;gA++){var BA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");BA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(gA));for(var QA=S[gA].Clip,CA=0;CA<QA.length;CA++){var EA=QA[CA].Area,DA=document.createElementNS("http://www.w3.org/2000/svg","path"),iA="",oA=0,wA=0,GA=0,FA=0;if(EA.Path.Boundary&&(oA=EA.Path.Boundary.x,wA=EA.Path.Boundary.y,GA=EA.Path.Boundary.w,FA=EA.Path.Boundary.h),!EA.TransFlag&&EA.CTM){var NA=EA.CTM,yA=void 0;if(yA=L?"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f-L.f,this.coreHelper.dpi),")"):"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f,this.coreHelper.dpi),")"),L){var hA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],RA=Object(G.inv)(hA);isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}DA.setAttribute("transform",yA)}var MA,UA=R(EA.Path.AbbreviatedData);try{for(UA.s();!(MA=UA.n()).done;){var cA=MA.value;"M"===cA.cmd||"S"===cA.cmd?iA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"L"===cA.cmd?iA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"B"===cA.cmd?iA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[4]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[5]+wA,this.coreHelper.dpi)," "):"Q"===cA.cmd?iA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," "):"A"===cA.cmd?iA+="A ".concat(Object(G.converterDpi)(cA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(cA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(cA.crds[6],this.coreHelper.dpi)):"C"===cA.cmd&&(iA+="Z")}}catch(A){UA.e(A)}finally{UA.f()}if(!EA.TransFlag&&EA.Path.CTM){var aA=EA.Path.CTM,sA="matrix(".concat(aA.a," ").concat(aA.b," ").concat(aA.c," ").concat(aA.d," ").concat(Object(G.converterDpi)(aA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.f,this.coreHelper.dpi),")");if(L){sA="matrix(".concat(aA.a," ").concat(aA.b," ").concat(aA.c," ").concat(aA.d," ").concat(Object(G.converterDpi)(aA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.f-L.f,this.coreHelper.dpi),")");var kA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],SA=Object(G.inv)(kA);isNaN(SA[0][0])||SA[0][0]===1/0||(sA="".concat(sA," matrix(").concat(SA[0][0]," ").concat(SA[1][0]," ").concat(SA[0][1]," ").concat(SA[1][1]," 0 0)"))}DA.setAttribute("transform",sA)}DA.setAttribute("d",iA),BA.appendChild(DA),EA.TransFlag&&EA.Path.CTM&&BA.setAttribute("id","none")}IA.push(BA)}if(IA.length>0)if(1==IA.length)h.appendChild(IA[0]),t.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var YA,KA="",HA=R(IA);try{for(HA.s();!(YA=HA.n()).done;){var JA=YA.value;void 0!==JA.children[0].getAttribute("d")&&(KA+="clip-path:path('".concat(JA.children[0].getAttribute("d"),"');"))}}catch(A){HA.e(A)}finally{HA.f()}t.setAttribute("style",KA)}}if(w){var LA=document.createElementNS("http://www.w3.org/2000/svg","svg");LA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),eA=Math.ceil(tA.h),nA=tA.x+a,lA=tA.y+s;return k="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(eA,"px;"),F&&L&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),LA.appendChild(h),{svg:LA,style:k,left:nA,top:lA}}return{svg:h,style:k,left:a,top:s}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(3*Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth))-.015*D,i=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;i=Math.max(i,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>D)&&(I.watermark_cols=parseInt((D-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((D-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>i)&&(I.watermark_rows=parseInt((I.watermark_y_space+i-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((i-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var o=0;o<I.watermark_rows;o++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var G=document.createElement("div");G.id="mask_div"+o+w,G.className="mask_div",G.innerHTML=I.watermark_txt,G.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",G.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",G.style.msTransform="rotate(-"+I.watermark_angle+"deg)",G.style.OTransform="rotate(-"+I.watermark_angle+"deg)",G.style.transform="rotate(-"+I.watermark_angle+"deg)",G.style.visibility="",G.style.position="absolute",G.style.left=Q+"px",G.style.top=C+"px",G.style.overflow="hidden",G.style.zIndex="9999",G.style.pointerEvents="none",G.style.opacity=I.watermark_alpha,G.style.fontSize=I.watermark_fontsize,G.style.fontFamily=I.watermark_font,G.style.color=I.watermark_color,G.style.textAlign="center",G.style.width=I.watermark_width+"px",G.style.height=I.watermark_height+"px",G.style.display="block",E.appendChild(G)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return R})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return s})),g.d(I,"Uint8ArrayToHexString",(function(){return k})),g.d(I,"replaceFirstSlash",(function(){return S})),g.d(I,"replaceFirstTarget",(function(){return Y})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return J})),g.d(I,"getFont",(function(){return L})),g.d(I,"inv",(function(){return e}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var h=0,R=0,M=0,U=0,c=[];if(!I)return c;var a,s=B(I);try{for(s.s();!(a=s.n()).done;){var k=a.value;if(k){if(h=F?parseFloat(k.X):-parseFloat(k.X),R=F?parseFloat(k.Y):-parseFloat(k.Y),isNaN(h)&&(h=0),isNaN(R)&&(R=0),M=h,U=R,Q){var S=D(M,U,Q);M=S.cx,U=S.cy}var Y=[],K=[];k.DeltaX&&k.DeltaX.length>0&&(Y=k.DeltaX),k.DeltaY&&k.DeltaY.length>0&&(K=k.DeltaY);var H=k.text;if(H){H=(H=y(H+="")).replace(/&#x20;/g," ");for(var J=0;J<H.length;J++){if(J>0&&Y.length>0){var L=J-1;if(L>=Y.length&&(L=Y.length-1),h+=N?F?Y[L]/N:-Y[L]/N:F?Y[L]:-Y[L],Q)M+=i(F?Y[J-1]:-Y[J-1],0,Q).ctmX;else M=h}if(J>0&&K.length>0){var t=J-1;if(t>=K.length&&(t=K.length-1),R+=F?K[t]:-K[t],Q)U+=i(0,F?K[J-1]:-K[J-1],Q).ctmY;else U=R}var d=H.substring(J,J+1),e=o(M,U,E);G&&(e=D(e.cx,e.cy,G));var n={x:C(h,A),y:C(R,A),text:d,cx:C(e.cx,A),cy:C(e.cy,A)};c.push(n)}}}}}catch(A){s.e(A)}finally{s.f()}if(c.length>0){var l,Z=B(g);try{for(Z.s();!(l=Z.n()).done;)for(var r=l.value,q=r.CodePosition,W=r.GlyphCount,f=q;f<W+q;f++)if(c.length<=f){var x="".concat(c[c.length-1].glyph," ").concat(r.Glyphs[f-q]);c[c.length-1].glyph=x}else c[f].glyph=r.Glyphs[f-q]}catch(A){Z.e(A)}finally{Z.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&quot;":'"',"&copy;":"","&apos;":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},h={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New",ChangFangSong:"ChangFangSong, FangSong",FangSong_GB2312:"FangSong"},R=function(A){if(!A)return h["宋体"];var I=A.FamilyName;I||(I=A.FontName),h[I.toLowerCase()]&&(I=h[I.toLowerCase()]);for(var g=0,B=Object.keys(h);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return h[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=a(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},a=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},s=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},k=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},S=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},Y=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function e(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return w})),g.d(I,"setYYDS",(function(){return G})),g.d(I,"freeMemory",(function(){return F})),g.d(I,"getStreamData",(function(){return N})),g.d(I,"getStreamDataBase64",(function(){return y})),g.d(I,"CreateLibrary",(function(){return h})),g.d(I,"CreateNativeStream",(function(){return R})),g.d(I,"FT_Open_Face",(function(){return M})),g.d(I,"loadFaceInfo",(function(){return U})),g.d(I,"FT_Glyph_Get_Measure",(function(){return c})),g.d(I,"freeOFD",(function(){return a})),g.d(I,"readOFD",(function(){return s})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return Y})),g.d(I,"SHA1",(function(){return K})),g.d(I,"SM3",(function(){return H})),g.d(I,"base64EncodeByByte",(function(){return J})),g.d(I,"base64Encode",(function(){return L})),g.d(I,"base64DecodeToUint8Array",(function(){return t})),g.d(I,"JSBase64ByHashFile",(function(){return d})),g.d(I,"JSGetImageInfoByBase64",(function(){return e})),g.d(I,"JSGetImageInfoByPath",(function(){return n})),g.d(I,"JSReadPageInfo",(function(){return l})),g.d(I,"JSGetPathEncode",(function(){return Z})),g.d(I,"JSPackageSigned",(function(){return r})),g.d(I,"JSGetToSign",(function(){return q}));var B,Q,C,E,D,i=g(33),o=g(34),w=function(){return!B},G=function(A){B=A},F=function(A){B._ASC_FT_Free(A.data),A.data=0},N=function(){return E},y=function(){return D},h=function(){Q=B._ASC_FT_Init()},R=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},M=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},U=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new i.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var D=C[E++];D;)g.family_name+=String.fromCharCode(D),D=C[E++];for(D=C[E++];D;)g.style_name+=String.fromCharCode(D),D=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=W(C[E++]),g.os2_ulUnicodeRange2=W(C[E++]),g.os2_ulUnicodeRange3=W(C[E++]),g.os2_ulUnicodeRange4=W(C[E++]),g.os2_ulCodePageRange1=W(C[E++]),g.os2_ulCodePageRange2=W(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},c=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new o.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,i="";D<Q;)switch(C[D++]){case 0:i+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:i+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:i+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:i+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=i,B._ASC_FT_Free(g),C=null,E},a=function(A){if(F(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},s=function(A,I,g){E=A,C=R(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){D=A;var C=B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(0!==C.code)switch(C.msg){case"10001":C.msg="授权信息错误";break;case"10002":C.msg="授权时间过期";break;case"10003":var E="非ofd文件无法打开";switch(C.file_type){case 0:break;case 9:E="PDF文件无法打开";break;default:E="图片文件无法打开"}C.msg=E}return C},S=function(A,I,g){return B.JSHashPath(A,I,g)},Y=function(A){return B.JSMD5(A)},K=function(A){return B.JSSHA1(A)},H=function(A){return B.JSSM3(A)},J=function(A){var I=R(A),g=B.JSBase64EncodeByByte(I.data,I.length);return F(I),g},L=function(A){return B.JSBase64Encode(A)},t=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},d=function(A,I,g){var Q=R(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},e=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},n=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},l=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},Z=function(A,I,g){var Q=B.JSGetPathEncode(A,I,g);if(0===Q.code)return new Uint8Array(B.HEAPU8.buffer,Q.ptr,Q.ptr_len).slice(0,Q.ptr_len)},r=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},q=function(A,I){return B.JSGetToSign(A,I)},W=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=(g(31),g(32));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g=this.readOfdDocument(A);if(g)return null==g||null===(I=g.CommonData)||void 0===I||null===(I=I.Res)||void 0===I?void 0:I.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",h=i(F.TextCode);try{for(h.s();!(N=h.n()).done;){var R=N.value;y="".concat(y).concat(R.text)}}catch(A){h.e(A)}finally{h.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(31),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";var B=F(g(38)),Q=F(g(73)),C=F(g(74)),E=F(g(75)),D=F(g(76)),i=F(g(78)),o=F(g(86)),w=g(85),G=F(g(79));function F(A){return A&&A.__esModule?A:{default:A}}var N=function(){},y=function(A,I,g){var B=new N;if(void 0===A)throw Error("No element to render on was provided.");return B._renderProperties=(0,D.default)(A),B._encodings=[],B._options=G.default,B._errorHandler=new o.default(B),void 0!==I&&((g=g||{}).format||(g.format=U()),B.options(g)[g.format](I,g).render()),B};for(var h in y.getModule=function(A){return B.default[A]},B.default)B.default.hasOwnProperty(h)&&R(B.default,h);function R(A,I){N.prototype[I]=N.prototype[I.toUpperCase()]=N.prototype[I.toLowerCase()]=function(g,B){var C=this;return C._errorHandler.wrapBarcodeCall((function(){B.text=void 0===B.text?void 0:""+B.text;var E=(0,Q.default)(C._options,B);E=(0,i.default)(E);var D=A[I],o=M(g,D,E);return C._encodings.push(o),C}))}}function M(A,I,g){var B=new I(A=""+A,g);if(!B.valid())throw new w.InvalidInputException(B.constructor.name,A);var E=B.encode();E=(0,C.default)(E);for(var D=0;D<E.length;D++)E[D].options=(0,Q.default)(g,E[D].options);return E}function U(){return B.default.CODE128?"CODE128":Object.keys(B.default)[0]}function c(A,I,g){I=(0,C.default)(I);for(var B=0;B<I.length;B++)I[B].options=(0,Q.default)(g,I[B].options),(0,E.default)(I[B].options);(0,E.default)(g),new(0,A.renderer)(A.element,I,g).render(),A.afterRender&&A.afterRender()}N.prototype.options=function(A){return this._options=(0,Q.default)(this._options,A),this},N.prototype.blank=function(A){var I=new Array(A+1).join("0");return this._encodings.push({data:I}),this},N.prototype.init=function(){var A;if(this._renderProperties)for(var I in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){A=this._renderProperties[I];var g=(0,Q.default)(this._options,A.options);"auto"==g.format&&(g.format=U()),this._errorHandler.wrapBarcodeCall((function(){var I=M(g.value,B.default[g.format.toUpperCase()],g);c(A,I,g)}))}},N.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var A=0;A<this._renderProperties.length;A++)c(this._renderProperties[A],this._encodings,this._options);else c(this._renderProperties,this._encodings,this._options);return this},N.prototype._defaults=G.default,"undefined"!=typeof window&&(window.JsBarcode=y),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(A,I){var g=[];return jQuery(this).each((function(){g.push(this)})),y(g,A,I)}),A.exports=y},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(39),Q=g(41),C=g(49),E=g(59),D=g(63),i=g(70),o=g(71),w=g(72);I.default={CODE39:B.CODE39,CODE128:Q.CODE128,CODE128A:Q.CODE128A,CODE128B:Q.CODE128B,CODE128C:Q.CODE128C,EAN13:C.EAN13,EAN8:C.EAN8,EAN5:C.EAN5,EAN2:C.EAN2,UPC:C.UPC,UPCE:C.UPCE,ITF14:E.ITF14,ITF:E.ITF,MSI:D.MSI,MSI10:D.MSI10,MSI11:D.MSI11,MSI1010:D.MSI1010,MSI1110:D.MSI1110,pharmacode:i.pharmacode,codabar:o.codabar,GenericBarcode:w.GenericBarcode}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE39=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A=A.toUpperCase(),g.mod43&&(A+=function(A){return D[A]}(function(A){for(var I=0,g=0;g<A.length;g++)I+=w(A[g]);return I%=43}(A))),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A=o("*"),I=0;I<this.data.length;I++)A+=o(this.data[I])+"0";return{data:A+=o("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default),D=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],i=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function o(A){return function(A){return i[A].toString(2)}(w(A))}function w(A){return D.indexOf(A)}I.CODE39=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.default=function A(I,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.data=I,this.text=g.text||I,this.options=g}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE128C=I.CODE128B=I.CODE128A=I.CODE128=void 0;var B=D(g(42)),Q=D(g(46)),C=D(g(47)),E=D(g(48));function D(A){return A&&A.__esModule?A:{default:A}}I.CODE128=B.default,I.CODE128A=Q.default,I.CODE128B=C.default,I.CODE128C=E.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=C(g(43)),Q=C(g(45));function C(A){return A&&A.__esModule?A:{default:A}}function E(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var D=function(A){function I(A,g){if(function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),/^[\x00-\x7F\xC8-\xD3]+$/.test(A))var B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,(0,Q.default)(A),g));else B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return E(B)}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(B.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.substring(1),g));return B.bytes=A.split("").map((function(A){return A.charCodeAt(0)})),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var A=this.bytes,g=A.shift()-105,B=D.SET_BY_CODE[g];if(void 0===B)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&A.unshift(D.FNC1);var Q=I.next(A,1,B);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:I.getBar(g)+Q.result+I.getBar((Q.checksum+g)%D.MODULO)+I.getBar(D.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var A=this.options.ean128||!1;return"string"==typeof A&&(A="true"===A.toLowerCase()),A}}],[{key:"getBar",value:function(A){return D.BARS[A]?D.BARS[A].toString():""}},{key:"correctIndex",value:function(A,I){if(I===D.SET_A){var g=A.shift();return g<32?g+64:g-32}return I===D.SET_B?A.shift()-32:10*(A.shift()-48)+A.shift()-48}},{key:"next",value:function(A,g,B){if(!A.length)return{result:"",checksum:0};var Q=void 0,C=void 0;if(A[0]>=200){C=A.shift()-105;var E=D.SWAP[C];void 0!==E?Q=I.next(A,g+1,E):(B!==D.SET_A&&B!==D.SET_B||C!==D.SHIFT||(A[0]=B===D.SET_A?A[0]>95?A[0]-96:A[0]:A[0]<32?A[0]+96:A[0]),Q=I.next(A,g+1,B))}else C=I.correctIndex(A,B),Q=I.next(A,g+1,B);var i=C*g;return{result:I.getBar(C)+Q.result,checksum:i+Q.checksum}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";var B;function Q(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}Object.defineProperty(I,"__esModule",{value:!0});var C=I.SET_A=0,E=I.SET_B=1,D=I.SET_C=2,i=(I.SHIFT=98,I.START_A=103),o=I.START_B=104,w=I.START_C=105;I.MODULO=103,I.STOP=106,I.FNC1=207,I.SET_BY_CODE=(Q(B={},i,C),Q(B,o,E),Q(B,w,D),B),I.SWAP={101:C,100:E,99:D},I.A_START_CHAR=String.fromCharCode(208),I.B_START_CHAR=String.fromCharCode(209),I.C_START_CHAR=String.fromCharCode(210),I.A_CHARS="[\0-_È-Ï]",I.B_CHARS="[ -È-Ï]",I.C_CHARS="(Ï*[0-9]{2}Ï*)",I.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(44),Q=function(A){return A.match(new RegExp("^"+B.A_CHARS+"*"))[0].length},C=function(A){return A.match(new RegExp("^"+B.B_CHARS+"*"))[0].length},E=function(A){return A.match(new RegExp("^"+B.C_CHARS+"*"))[0]};function D(A,I){var g=I?B.A_CHARS:B.B_CHARS,Q=A.match(new RegExp("^("+g+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(Q)return Q[1]+String.fromCharCode(204)+i(A.substring(Q[1].length));var C=A.match(new RegExp("^"+g+"+"))[0];return C.length===A.length?A:C+String.fromCharCode(I?205:206)+D(A.substring(C.length),!I)}function i(A){var I=E(A),g=I.length;if(g===A.length)return A;A=A.substring(g);var B=Q(A)>=C(A);return I+String.fromCharCode(B?206:205)+D(A,B)}I.default=function(A){var I=void 0;if(E(A).length>=2)I=B.C_START_CHAR+i(A);else{var g=Q(A)>C(A);I=(g?B.A_START_CHAR:B.B_START_CHAR)+D(A,g)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(A,I){return String.fromCharCode(203)+I}))}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.A_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.A_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.B_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.B_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(43),E=(B=C)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.C_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return new RegExp("^"+D.C_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.UPCE=I.UPC=I.EAN2=I.EAN5=I.EAN8=I.EAN13=void 0;var B=o(g(50)),Q=o(g(54)),C=o(g(55)),E=o(g(56)),D=o(g(57)),i=o(g(58));function o(A){return A&&A.__esModule?A:{default:A}}I.EAN13=B.default,I.EAN8=Q.default,I.EAN5=C.default,I.EAN2=E.default,I.UPC=D.default,I.UPCE=i.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=function A(I,g,B){null===I&&(I=Function.prototype);var Q=Object.getOwnPropertyDescriptor(I,g);if(void 0===Q){var C=Object.getPrototypeOf(I);return null===C?void 0:A(C,g,B)}if("value"in Q)return Q.value;var E=Q.get;return void 0!==E?E.call(B):void 0},E=g(51),D=g(52),i=(B=D)&&B.__esModule?B:{default:B};var o=function(A){return(10-A.substr(0,12).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+3*I:A+I}),0)%10)%10},w=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{12}$/)&&(A+=o(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.lastChar=g.lastChar,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var A=this.data.substr(1,6),g=E.EAN13_STRUCTURE[this.data[0]];return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,g)}},{key:"rightText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var A=this.data.substr(7,6);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRRRR")}},{key:"encodeGuarded",value:function(){var A=C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(A.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(A.push({data:"00"}),A.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),A}}]),I}(i.default);I.default=w},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.SIDE_BIN="101",I.MIDDLE_BIN="01010",I.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},I.EAN2_STRUCTURE=["LL","LG","GL","GG"],I.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],I.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.fontSize=!g.flat&&g.fontSize>10*g.width?10*g.width:g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(A,I){return this.text.substr(A,I)}},{key:"leftEncode",value:function(A,I){return(0,C.default)(A,I)}},{key:"rightText",value:function(A,I){return this.text.substr(A,I)}},{key:"rightEncode",value:function(A,I){return(0,C.default)(A,I)}},{key:"encodeGuarded",value:function(){var A={fontSize:this.fontSize},I={height:this.guardHeight};return[{data:Q.SIDE_BIN,options:I},{data:this.leftEncode(),text:this.leftText(),options:A},{data:Q.MIDDLE_BIN,options:I},{data:this.rightEncode(),text:this.rightText(),options:A},{data:Q.SIDE_BIN,options:I}]}},{key:"encodeFlat",value:function(){return{data:[Q.SIDE_BIN,this.leftEncode(),Q.MIDDLE_BIN,this.rightEncode(),Q.SIDE_BIN].join(""),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(51);I.default=function(A,I,g){var Q=A.split("").map((function(A,g){return B.BINARIES[I[g]]})).map((function(I,g){return I?I[A[g]]:""}));if(g){var C=A.length-1;Q=Q.map((function(A,I){return I<C?A+g:A}))}return Q.join("")}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=function A(I,g,B){null===I&&(I=Function.prototype);var Q=Object.getOwnPropertyDescriptor(I,g);if(void 0===Q){var C=Object.getPrototypeOf(I);return null===C?void 0:A(C,g,B)}if("value"in Q)return Q.value;var E=Q.get;return void 0!==E?E.call(B):void 0},E=g(52),D=(B=E)&&B.__esModule?B:{default:B};var i=function(A){return(10-A.substr(0,7).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+I:A+3*I}),0)%10)%10},o=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{7}$/)&&(A+=i(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===i(this.data)}},{key:"leftText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var A=this.data.substr(0,4);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,"LLLL")}},{key:"rightText",value:function(){return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var A=this.data.substr(4,4);return C(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRR")}}]),I}(D.default);I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=D(g(53)),E=D(g(40));function D(A){return A&&A.__esModule?A:{default:A}}var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var A,I=Q.EAN5_STRUCTURE[(A=this.data,A.split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+9*I:A+3*I}),0)%10)];return{data:"1011"+(0,C.default)(this.data,I,"01"),text:this.text}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(51),C=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var A=Q.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,C.default)(this.data,A,"01"),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();I.checksum=D;var Q=C(g(53));function C(A){return A&&A.__esModule?A:{default:A}}var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{11}$/)&&(A+=D(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==D(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=(0,Q.default)(this.data.substr(0,6),"LLLLLL"),A+="01010",A+=(0,Q.default)(this.data.substr(6,6),"RRRRRR"),{data:A+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101"+(0,Q.default)(this.data[0],"L"),options:{height:this.guardHeight}}),A.push({data:(0,Q.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),A.push({data:"01010",options:{height:this.guardHeight}}),A.push({data:(0,Q.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),A.push({data:(0,Q.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),A}}]),I}(C(g(40)).default);function D(A){var I,g=0;for(I=1;I<11;I+=2)g+=parseInt(A[I]);for(I=0;I<11;I+=2)g+=3*parseInt(A[I]);return(10-g%10)%10}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=D(g(53)),C=D(g(40)),E=g(57);function D(A){return A&&A.__esModule?A:{default:A}}function i(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var o=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],w=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],G=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=i(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));if(B.isValid=!1,-1!==A.search(/^[0-9]{6}$/))B.middleDigits=A,B.upcA=F(A,"0"),B.text=g.text||""+B.upcA[0]+A+B.upcA[B.upcA.length-1],B.isValid=!0;else{if(-1===A.search(/^[01][0-9]{7}$/))return i(B);if(B.middleDigits=A.substring(1,A.length-1),B.upcA=F(B.middleDigits,A[0]),B.upcA[B.upcA.length-1]!==A[A.length-1])return i(B);B.isValid=!0}return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=this.encodeMiddleDigits(),{data:A+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101",options:{height:this.guardHeight}}),A.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),A.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),A}},{key:"encodeMiddleDigits",value:function(){var A=this.upcA[0],I=this.upcA[this.upcA.length-1],g=w[parseInt(I)][parseInt(A)];return(0,Q.default)(this.middleDigits,g)}}]),I}(C.default);function F(A,I){for(var g=parseInt(A[A.length-1]),B=o[g],Q="",C=0,D=0;D<B.length;D++){var i=B[D];Q+="X"===i?A[C++]:i}return""+(Q=""+I+Q)+(0,E.checksum)(Q)}I.default=G},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.ITF14=I.ITF=void 0;var B=C(g(60)),Q=C(g(62));function C(A){return A&&A.__esModule?A:{default:A}}I.ITF=B.default,I.ITF14=Q.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(61),E=g(40);var D=function(A){function I(){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var A=this,I=this.data.match(/.{2}/g).map((function(I){return A.encodePair(I)})).join("");return{data:C.START_BIN+I+C.END_BIN,text:this.text}}},{key:"encodePair",value:function(A){var I=C.BINARIES[A[1]];return C.BINARIES[A[0]].split("").map((function(A,g){return("1"===A?"111":"1")+("1"===I[g]?"000":"0")})).join("")}}]),I}(((B=E)&&B.__esModule?B:{default:B}).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.START_BIN="1010",I.END_BIN="11101",I.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(60),E=(B=C)&&B.__esModule?B:{default:B};var D=function(A){var I=A.substr(0,13).split("").map((function(A){return parseInt(A,10)})).reduce((function(A,I,g){return A+I*(3-g%2*2)}),0);return 10*Math.ceil(I/10)-I},i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{13}$/)&&(A+=D(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.MSI1110=I.MSI1010=I.MSI11=I.MSI10=I.MSI=void 0;var B=i(g(64)),Q=i(g(65)),C=i(g(67)),E=i(g(68)),D=i(g(69));function i(A){return A&&A.__esModule?A:{default:A}}I.MSI=B.default,I.MSI10=Q.default,I.MSI11=C.default,I.MSI1010=E.default,I.MSI1110=D.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A="110",I=0;I<this.data.length;I++){var g=parseInt(this.data[I]).toString(2);g=D(g,4-g.length);for(var B=0;B<g.length;B++)A+="0"==g[B]?"100":"110"}return{data:A+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);function D(A,I){for(var g=0;g<I;g++)A="0"+A;return A}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod10)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.mod10=function(A){for(var I=0,g=0;g<A.length;g++){var B=parseInt(A[g]);(g+A.length)%2==0?I+=B:I+=2*B%10+Math.floor(2*B/10)}return(10-I%10)%10},I.mod11=function(A){for(var I=0,g=[2,3,4,5,6,7],B=0;B<A.length;B++){var Q=parseInt(A[A.length-1-B]);I+=g[B%g.length]*Q}return(11-I%11)%11}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod11)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod10)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=g(64),C=(B=Q)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod11)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(C.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.pharmacode=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.number=parseInt(A,10),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){for(var A=this.number,I="";!isNaN(A)&&0!=A;)A%2==0?(I="11100"+I,A=(A-2)/2):(I="100"+I,A=(A-1)/2);return{data:I=I.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.pharmacode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.codabar=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),0===A.search(/^[0-9\-\$\:\.\+\/]+$/)&&(A="A"+A+"A");var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.toUpperCase(),g));return B.text=B.options.text||B.text.replace(/[A-D]/g,""),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var A=[],I=this.getEncodings(),g=0;g<this.data.length;g++)A.push(I[this.data.charAt(g)]),g!==this.data.length-1&&A.push("0");return{text:this.text,data:A.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.codabar=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.GenericBarcode=void 0;var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),Q(I,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),I}(((B=C)&&B.__esModule?B:{default:B}).default);I.GenericBarcode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var B in g)Object.prototype.hasOwnProperty.call(g,B)&&(A[B]=g[B])}return A};I.default=function(A,I){return B({},A,I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=[];return function A(g){if(Array.isArray(g))for(var B=0;B<g.length;B++)A(g[B]);else g.text=g.text||"",g.data=g.data||"",I.push(g)}(A),I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){return A.marginTop=A.marginTop||A.margin,A.marginBottom=A.marginBottom||A.margin,A.marginRight=A.marginRight||A.margin,A.marginLeft=A.marginLeft||A.margin,A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Q=D(g(77)),C=D(g(80)),E=g(85);function D(A){return A&&A.__esModule?A:{default:A}}function i(A){if("string"==typeof A)return function(A){var I=document.querySelectorAll(A);if(0===I.length)return;for(var g=[],B=0;B<I.length;B++)g.push(i(I[B]));return g}(A);if(Array.isArray(A)){for(var I=[],g=0;g<A.length;g++)I.push(i(A[g]));return I}if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLImageElement)return D=A,{element:o=document.createElement("canvas"),options:(0,Q.default)(D),renderer:C.default.CanvasRenderer,afterRender:function(){D.setAttribute("src",o.toDataURL())}};if(A&&A.nodeName&&"svg"===A.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&A instanceof SVGElement)return{element:A,options:(0,Q.default)(A),renderer:C.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLCanvasElement)return{element:A,options:(0,Q.default)(A),renderer:C.default.CanvasRenderer};if(A&&A.getContext)return{element:A,renderer:C.default.CanvasRenderer};if(A&&"object"===(void 0===A?"undefined":B(A))&&!A.nodeName)return{element:A,renderer:C.default.ObjectRenderer};throw new E.InvalidElementException;var D,o}I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=C(g(78)),Q=C(g(79));function C(A){return A&&A.__esModule?A:{default:A}}I.default=function(A){var I={};for(var g in Q.default)Q.default.hasOwnProperty(g)&&(A.hasAttribute("jsbarcode-"+g.toLowerCase())&&(I[g]=A.getAttribute("jsbarcode-"+g.toLowerCase())),A.hasAttribute("data-"+g.toLowerCase())&&(I[g]=A.getAttribute("data-"+g.toLowerCase())));return I.value=A.getAttribute("jsbarcode-value")||A.getAttribute("data-value"),I=(0,B.default)(I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var g in I)I.hasOwnProperty(g)&&"string"==typeof A[g=I[g]]&&(A[g]=parseInt(A[g],10));"string"==typeof A.displayValue&&(A.displayValue="false"!=A.displayValue);return A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};I.default=B},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=E(g(81)),Q=E(g(83)),C=E(g(84));function E(A){return A&&A.__esModule?A:{default:A}}I.default={CanvasRenderer:B.default,SVGRenderer:Q.default,ObjectRenderer:C.default}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(73),E=(B=C)&&B.__esModule?B:{default:B},D=g(82);var i=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.canvas=I,this.encodings=g,this.options=B}return Q(A,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var A=0;A<this.encodings.length;A++){var I=(0,E.default)(this.options,this.encodings[A].options);this.drawCanvasBarcode(I,this.encodings[A]),this.drawCanvasText(I,this.encodings[A]),this.moveCanvasDrawing(this.encodings[A])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var A=this.canvas.getContext("2d");A.save(),(0,D.calculateEncodingAttributes)(this.encodings,this.options,A);var I=(0,D.getTotalWidthOfEncodings)(this.encodings),g=(0,D.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=I+this.options.marginLeft+this.options.marginRight,this.canvas.height=g,A.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(A.fillStyle=this.options.background,A.fillRect(0,0,this.canvas.width,this.canvas.height)),A.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(A,I){var g,B=this.canvas.getContext("2d"),Q=I.data;g="top"==A.textPosition?A.marginTop+A.fontSize+A.textMargin:A.marginTop,B.fillStyle=A.lineColor;for(var C=0;C<Q.length;C++){var E=C*A.width+I.barcodePadding;"1"===Q[C]?B.fillRect(E,g,A.width,A.height):Q[C]&&B.fillRect(E,g,A.width,A.height*Q[C])}}},{key:"drawCanvasText",value:function(A,I){var g,B,Q=this.canvas.getContext("2d"),C=A.fontOptions+" "+A.fontSize+"px "+A.font;A.displayValue&&(B="top"==A.textPosition?A.marginTop+A.fontSize-A.textMargin:A.height+A.textMargin+A.marginTop+A.fontSize,Q.font=C,"left"==A.textAlign||I.barcodePadding>0?(g=0,Q.textAlign="left"):"right"==A.textAlign?(g=I.width-1,Q.textAlign="right"):(g=I.width/2,Q.textAlign="center"),Q.fillText(I.text,g,B))}},{key:"moveCanvasDrawing",value:function(A){this.canvas.getContext("2d").translate(A.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),A}();I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.getTotalWidthOfEncodings=I.calculateEncodingAttributes=I.getBarcodePadding=I.getEncodingHeight=I.getMaximumHeightOfEncodings=void 0;var B,Q=g(73),C=(B=Q)&&B.__esModule?B:{default:B};function E(A,I){return I.height+(I.displayValue&&A.text.length>0?I.fontSize+I.textMargin:0)+I.marginTop+I.marginBottom}function D(A,I,g){if(g.displayValue&&I<A){if("center"==g.textAlign)return Math.floor((A-I)/2);if("left"==g.textAlign)return 0;if("right"==g.textAlign)return Math.floor(A-I)}return 0}function i(A,I,g){var B;if(g)B=g;else{if("undefined"==typeof document)return 0;B=document.createElement("canvas").getContext("2d")}B.font=I.fontOptions+" "+I.fontSize+"px "+I.font;var Q=B.measureText(A);return Q?Q.width:0}I.getMaximumHeightOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)A[g].height>I&&(I=A[g].height);return I},I.getEncodingHeight=E,I.getBarcodePadding=D,I.calculateEncodingAttributes=function(A,I,g){for(var B=0;B<A.length;B++){var Q,o=A[B],w=(0,C.default)(I,o.options);Q=w.displayValue?i(o.text,w,g):0;var G=o.data.length*w.width;o.width=Math.ceil(Math.max(Q,G)),o.height=E(o,w),o.barcodePadding=D(Q,G,w)}},I.getTotalWidthOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)I+=A[g].width;return I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,Q=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(73),E=(B=C)&&B.__esModule?B:{default:B},D=g(82);var i="http://www.w3.org/2000/svg",o=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.svg=I,this.encodings=g,this.options=B,this.document=B.xmlDocument||document}return Q(A,[{key:"render",value:function(){var A=this.options.marginLeft;this.prepareSVG();for(var I=0;I<this.encodings.length;I++){var g=this.encodings[I],B=(0,E.default)(this.options,g.options),Q=this.createGroup(A,B.marginTop,this.svg);this.setGroupOptions(Q,B),this.drawSvgBarcode(Q,B,g),this.drawSVGText(Q,B,g),A+=g.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,D.calculateEncodingAttributes)(this.encodings,this.options);var A=(0,D.getTotalWidthOfEncodings)(this.encodings),I=(0,D.getMaximumHeightOfEncodings)(this.encodings),g=A+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(g,I),this.options.background&&this.drawRect(0,0,g,I,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(A,I,g){var B,Q=g.data;B="top"==I.textPosition?I.fontSize+I.textMargin:0;for(var C=0,E=0,D=0;D<Q.length;D++)E=D*I.width+g.barcodePadding,"1"===Q[D]?C++:C>0&&(this.drawRect(E-I.width*C,B,I.width*C,I.height,A),C=0);C>0&&this.drawRect(E-I.width*(C-1),B,I.width*C,I.height,A)}},{key:"drawSVGText",value:function(A,I,g){var B,Q,C=this.document.createElementNS(i,"text");I.displayValue&&(C.setAttribute("style","font:"+I.fontOptions+" "+I.fontSize+"px "+I.font),Q="top"==I.textPosition?I.fontSize-I.textMargin:I.height+I.textMargin+I.fontSize,"left"==I.textAlign||g.barcodePadding>0?(B=0,C.setAttribute("text-anchor","start")):"right"==I.textAlign?(B=g.width-1,C.setAttribute("text-anchor","end")):(B=g.width/2,C.setAttribute("text-anchor","middle")),C.setAttribute("x",B),C.setAttribute("y",Q),C.appendChild(this.document.createTextNode(g.text)),A.appendChild(C))}},{key:"setSvgAttributes",value:function(A,I){var g=this.svg;g.setAttribute("width",A+"px"),g.setAttribute("height",I+"px"),g.setAttribute("x","0px"),g.setAttribute("y","0px"),g.setAttribute("viewBox","0 0 "+A+" "+I),g.setAttribute("xmlns",i),g.setAttribute("version","1.1"),g.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(A,I,g){var B=this.document.createElementNS(i,"g");return B.setAttribute("transform","translate("+A+", "+I+")"),g.appendChild(B),B}},{key:"setGroupOptions",value:function(A,I){A.setAttribute("style","fill:"+I.lineColor+";")}},{key:"drawRect",value:function(A,I,g,B,Q){var C=this.document.createElementNS(i,"rect");return C.setAttribute("x",A),C.setAttribute("y",I),C.setAttribute("width",g),C.setAttribute("height",B),Q.appendChild(C),C}}]),A}();I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var Q=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.object=I,this.encodings=g,this.options=B}return B(A,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),A}();I.default=Q},function(A,I,g){"use strict";function B(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function Q(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}function C(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}Object.defineProperty(I,"__esModule",{value:!0});var E=function(A){function I(A,g){B(this,I);var C=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return C.name="InvalidInputException",C.symbology=A,C.input=g,C.message='"'+C.input+'" is not a valid input for '+C.symbology,C}return C(I,Error),I}(),D=function(A){function I(){B(this,I);var A=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="InvalidElementException",A.message="Not supported type to render on",A}return C(I,Error),I}(),i=function(A){function I(){B(this,I);var A=Q(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="NoElementException",A.message="No element to render on.",A}return C(I,Error),I}();I.InvalidInputException=E,I.InvalidElementException=D,I.NoElementException=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var Q=function(){function A(I){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.api=I}return B(A,[{key:"handleCatch",value:function(A){if("InvalidInputException"!==A.name)throw A;if(this.api._options.valid===this.api._defaults.valid)throw A.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(A){try{var I=A.apply(void 0,arguments);return this.api._options.valid(!0),I}catch(A){return this.handleCatch(A),this.api}}}]),A}();I.default=Q},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=g(31),F=g(32),N=g(35),y=g(30);function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,R,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D,i,o,y,R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(D=C?C.readOfdDocument(B):this.core.readOfdDocument(B),i=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),o=i.Page.Template,D.Annotations,y=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),R=D.Signatures?D.Signatures.Signature:[],M=D.CommonData.Res.Fonts,U=D.CommonData.Res.DrawParams,D.CommonData.Res.ColorSpaces,c=D.CommonData.Res.CompositeGraphicUnits,a=D.CommonData.Res.MultiMedias,!o){A.next=64;break}s=h(o),A.prev=13,s.s();case 15:if((k=s.n()).done){A.next=56;break}S=k.value,Y=h(y),A.prev=18,Y.s();case 20:if((K=Y.n()).done){A.next=46;break}if((H=K.value).ID!=S.TemplateID){A.next=44;break}if(!(H=C?C.readPageFromTemplate(H):this.core.readPageFromTemplate(H)).Page.Content){A.next=43;break}J=H.Page.Content.Layer,L=h(J),A.prev=27,L.s();case 29:if((t=L.n()).done){A.next=35;break}return d=t.value,A.next=33,this.renderLayerByCanvas(E,I,g,M,U,a,c,d,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),L.e(A.t0);case 40:return A.prev=40,L.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),Y.e(A.t1);case 51:return A.prev=51,Y.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),s.e(A.t2);case 61:return A.prev=61,s.f(),A.finish(61);case 64:if(!i.Page.Content){A.next=83;break}e=i.Page.Content.Layer,n=h(e),A.prev=67,n.s();case 69:if((l=n.n()).done){A.next=75;break}return Z=l.value,A.next=73,this.renderLayerByCanvas(E,I,g,M,U,a,c,Z,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),n.e(A.t3);case 80:return A.prev=80,n.f(),A.finish(80);case 83:r=h(R),A.prev=84,r.s();case 86:if((q=r.n()).done){A.next=134;break}W=q.value,f=h(W.Signature.SignedInfo.StampAnnot),A.prev=89,f.s();case 91:if((x=f.n()).done){A.next=124;break}if(p=x.value,b=p.PageRef,i.ID!=b){A.next=122;break}if(V=p.Boundary,!(W.Signature.PicType&&W.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==W.Signature.PicType){A.next=108;break}m=new N.Ofd_Core(W.Signature.ofd,this.coreHelper.dpi),T=0;case 100:if(!(T<m.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,T,m,!0,V,b,p.ID,Q,W.Signature.ZipName);case 103:T++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==W.Signature.PicType){A.next=114;break}return j="data:image/svg+xml;base64,".concat(W.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,j,V);case 112:A.next=122;break;case 114:return X=V.w,O=V.h,u=Object(G.converterBox)(V,this.coreHelper.dpi),z=Object(F.JSGetImageInfoByBase64)(W.Signature.PicValue),P=z.fileBase64,v={a:X,b:0,c:0,d:O,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,P,z.width,z.height,u,p.Clip,!0,b,p.ID,v);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),f.e(A.t4);case 129:return A.prev=129,f.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),r.e(A.t5);case 139:return A.prev=139,r.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q,C){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(zipName,N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(R=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F){var N,y,h,R,M,U,c,a,s,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return N={x:0,y:0,w:0,h:0},N=E,y={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},h=Object(G.converterBox)(y,this.coreHelper.dpi),R=1,(M=document.createElement("canvas")).style.height="".concat(h.w,"px"),M.style.width="".concat(h.h,"px"),M.width=h.w,M.height=h.h,U=M.getContext("2d"),A.next=13,this.renderPageByCanvas(M,U,0,B,Q,F);case 13:U.scale(R,R),y.w!==N.w?(c=N.h/y.h<N.w/y.w?N.h/y.h:N.w/y.w,a=document.createElement("canvas"),s=Object(G.converterBox)(N,this.coreHelper.dpi),a.style.height="".concat(s.w,"px"),a.style.width="".concat(s.h,"px"),a.width=s.w,a.height=s.h,(k=a.getContext("2d")).scale(c,c),k.drawImage(M,0,0),g.drawImage(a,h.x,h.y)):g.drawImage(M,h.x,h.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D,i,o){return R.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y){var R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(R=null,M=null,U=Object(G.converterDpi)(.353,this.coreHelper.dpi),(c=i.DrawParam)&&Object(G.getDrawParam)(C,c)&&(a=Object(G.getDrawParam)(C,c),Object(G.getDrawParam)(C,a.Relative)&&(a=Object(G.getDrawParam)(C,a.Relative)),a.FillColor&&(R=Object(G.parseColor)(a.FillColor.Value)),a.StrokeColor&&(R=Object(G.parseColor)(a.StrokeColor.Value)),a.LineWidth&&(U=Object(G.converterDpi)(a.LineWidth,this.coreHelper.dpi))),!(s=i.PageBlock)){A.next=60;break}k=h(s),A.prev=8,k.s();case 10:if((S=k.n()).done){A.next=52;break}if("ImageObject"!=(Y=S.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,B,E,Y,o,N,y);case 15:A.next=50;break;case 17:if("PathObject"!=Y.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,B,C,Y,R,M,U,o,F,N,y,E,Q);case 20:A.next=50;break;case 22:if("TextObject"!=Y.Type){A.next=27;break}return A.next=25,this.renderTextObject(g,B,Q,Y,R,M,C,F,N,y);case 25:A.next=50;break;case 27:if("CompositeObject"!=Y.Type){A.next=50;break}K=h(D),A.prev=29,K.s();case 31:if((H=K.n()).done){A.next=42;break}if((J=H.value).ID!==Y.ResourceID){A.next=40;break}return L=Y.Alpha,t=Y.Boundary,d=Y.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,D,J,!1,L,t,d);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),K.e(A.t0);case 47:return A.prev=47,K.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),k.e(A.t1);case 57:return A.prev=57,k.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G,F){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,N,y,h,R,M,U,c,a;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(o=C.Boundary,o=Object(G.converterBox)(o,this.coreHelper.dpi),N=C.ResourceID){A.next=5;break}return A.abrupt("return");case 5:if((y=Object(G.getMultiMedia)(Q,N)).MediaFile){A.next=8;break}return A.abrupt("return",null);case 8:if((h=C.ImageMask)>0&&(R=Object(G.getMultiMedia)(Q,h)).MediaFile&&(R.width>0||R.height>0||!R.MediaFile||((M=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),I)).ext,R.width=M.width,R.height=M.height,R.FileBase64=M.fileBase64)),y.width>0||y.height>0||!y.MediaFile){A.next=17;break}if("other"!==(U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,y.MediaFile,y.MediaFileResPln,this.core.getDocPln(0),I)).ext){A.next=14;break}return A.abrupt("return",null);case 14:y.width=U.width,y.height=U.height,y.FileBase64=U.fileBase64;case 17:return c=C.CTM,a=C.Clips,A.next=21,this.renderImageOnCanvas(g,B,y.FileBase64,y.width,y.height,o,!1,E,null,null,c,D,i,a);case 21:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,i){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,R,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,a=U.h,s=U.x,k=U.y;F.width=c,F.height=a,F.style.width="".concat(c,"px"),F.style.height="".concat(a,"px");var S=F.getContext("2d");R&&S.transform(R.a,R.b,R.c,R.d,Object(G.converterDpi)(R.e,w.coreHelper.dpi),Object(G.converterDpi)(R.f,w.coreHelper.dpi)),S.drawImage(I,D,i),g.drawImage(F,s,k)}else{var Y=document.createElement("canvas");Y.width=Math.ceil(E.w),Y.height=Math.ceil(E.h),Y.style.width="".concat(Math.ceil(E.w),"px"),Y.style.height="".concat(Math.ceil(E.h),"px");var K=Y.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var J=M[H].Clip,L=0;L<J.length;L++){var t=J[L].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var e,n=h(t.Path.AbbreviatedData);try{for(n.s();!(e=n.n()).done;){var l=e.value;if("M"===l.cmd||"S"===l.cmd){var Z=l.crds[0],r=l.crds[1];if(d){var q=w.ctmCalPoint(Z,r,d);Z=q.ctmX,r=q.ctmY}K.moveTo(Object(G.converterDpi)(Z,w.coreHelper.dpi),Object(G.converterDpi)(r,w.coreHelper.dpi))}else if("L"===l.cmd){var W=l.crds[0],f=l.crds[1];if(d){var x=w.ctmCalPoint(W,f,d);W=x.ctmX,f=x.ctmY}K.lineTo(Object(G.converterDpi)(W,w.coreHelper.dpi),Object(G.converterDpi)(f,w.coreHelper.dpi))}else if("B"===l.cmd){var p=l.crds[0],b=l.crds[1],V=l.crds[2],m=l.crds[3],T=l.crds[4],j=l.crds[5];if(d){var X=w.ctmCalPoint(p,b,d);p=X.ctmX,b=X.ctmY;var O=w.ctmCalPoint(V,m,d);V=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,j,d);T=u.ctmX,j=u.ctmY}K.bezierCurveTo(Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(j,w.coreHelper.dpi))}else if("Q"===l.cmd){var z=l.crds[0],P=l.crds[1],v=l.crds[2],_=l.crds[3];if(d){var $=w.ctmCalPoint(z,P,d);z=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(z,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===l.cmd||"C"===l.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(Y,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,R,M){var U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA,yA,hA,RA,MA,UA,cA,aA,sA,kA,SA,YA,KA,HA,JA,LA,tA,dA,eA,nA,lA,ZA,rA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(U=C.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(c=1,U=Object(G.converterBox)(U,this.coreHelper.dpi),a=Math.ceil(U.w),s=Math.ceil(U.h),k=U.x,S=U.y,a-0!=0&&s-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(Y=document.createElement("canvas"),K=Y.getContext("2d"),Y.width=a*c,Y.height=s*c,Y.style.width="".concat(a,"px"),Y.style.height="".concat(s,"px"),H=C.LineWidth,J=C.AbbreviatedData,L=C.CTM,t=C.StrokeColor,d=C.FillColor,H&&(i=Object(G.converterDpi)(H,this.coreHelper.dpi)),(e=C.DrawParam)&&(n=Object(G.getDrawParam)(Q,e),(H=n.LineWidth)&&(i=Object(G.converterDpi)(H,this.coreHelper.dpi)),n.FillColor&&(d&&d.Value||(d=n.FillColor)),n.StrokeColor&&(t&&t.Value||(t=n.StrokeColor))),L&&K.transform(L.a,L.b,L.c,L.d,Object(G.converterDpi)(L.e,this.coreHelper.dpi),Object(G.converterDpi)(L.f,this.coreHelper.dpi)),l=!1,t&&(t.Value&&(D=Object(G.parseColor)(t.Value)),Z=t.axialShd)){l=!0,r=Object(G.parseCtm)(Z.StartPoint),q=Object(G.parseCtm)(Z.EndPoint),W=K.createLinearGradient(r[0],r[1],q[0],q[1]),f=h(Z.Segment);try{for(f.s();!(x=f.n()).done;)(p=x.value)&&W.addColorStop(p.position,Object(G.parseColor)(p.color.Value))}catch(A){f.e(A)}finally{f.f()}K.lineWidth=i,K.strokeStyle=W}if(b=!1,d&&(d.Value&&(E=Object(G.parseColor)(d.Value)),d.Alpha&&0===d.Alpha&&(K.globalAlpha=0),V=d.AxialShd)){b=!0,m=Object(G.parseCtm)(V.StartPoint),T=Object(G.parseCtm)(V.EndPoint),j=K.createLinearGradient(m[0],m[1],T[0],T[1]),X=h(V.Segment);try{for(X.s();!(O=X.n()).done;)(u=O.value)&&j.addColorStop(u.position,Object(G.parseColor)(u.color.Value))}catch(A){X.e(A)}finally{X.f()}K.fillStyle=j}if(i>0&&!D&&((D=E)||(D="rgb(0, 0, 0)")),(z=C.Clips)&&z.length>0)for(P=[],v=0;v<z.length;v++){for(_=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),$=z[v],AA=$.Clip,IA=0;IA<AA.length;IA++){gA=AA[IA],BA=gA.Area,QA=document.createElementNS("http://www.w3.org/2000/svg","path"),CA=0,EA=0,DA=0,iA=0,BA.Path.Boundary&&(CA=BA.Path.Boundary.x,EA=BA.Path.Boundary.y,DA=BA.Path.Boundary.w,iA=BA.Path.Boundary.h),!BA.TransFlag&&BA.CTM&&(oA=BA.CTM,wA=void 0,wA=L?"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(G.converterDpi)(oA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(oA.f-L.f,this.coreHelper.dpi),")"):"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(G.converterDpi)(oA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(oA.f,this.coreHelper.dpi),")"),L&&(GA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],FA=Object(G.inv)(GA),isNaN(FA[0][0])||FA[0][0]===1/0||(wA="".concat(wA," matrix(").concat(FA[0][0]," ").concat(FA[1][0]," ").concat(FA[0][1]," ").concat(FA[1][1]," 0 0)"))),QA.setAttribute("transform",wA)),!BA.TransFlag&&BA.Path.CTM&&(NA=BA.Path.CTM,yA="matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f-L.f,this.coreHelper.dpi),")"),L&&(hA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],RA=Object(G.inv)(hA),isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))),QA.setAttribute("transform",yA)),K.beginPath(),MA=h(BA.Path.AbbreviatedData);try{for(MA.s();!(UA=MA.n()).done;)"M"===(cA=UA.value).cmd||"S"===cA.cmd?K.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"L"===cA.cmd?K.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"B"===cA.cmd&&K.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[0],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[2]+CA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[3]+EA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[4]+CA,this.coreHelper.dpi),Object(G.converterDpi)(cA.crds[5]+EA,this.coreHelper.dpi))}catch(A){MA.e(A)}finally{MA.f()}K.closePath(),K.clip()}P.push(_)}C.Join&&K.setLineJoin(C["@_Join"]),C.Cap&&K.setLineCap(C["@_Cap"]),C.DashPattern&&(aA=C.DashPattern,sA=Object(G.parseCtm)(aA),C.DashOffset&&C.DashOffset,K.setLineDash([Object(G.converterDpi)(sA[0],this.coreHelper.dpi),Object(G.converterDpi)(sA[1],this.coreHelper.dpi)])),K.beginPath(),kA=h(J);try{for(kA.s();!(SA=kA.n()).done;)"M"===(YA=SA.value).cmd||"S"===YA.cmd?K.moveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi)):"L"===YA.cmd?K.lineTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi)):"B"===YA.cmd?K.bezierCurveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[5],this.coreHelper.dpi)):"Q"===YA.cmd?K.quadraticCurveTo(Object(G.converterDpi)(YA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(YA.crds[3],this.coreHelper.dpi)):"A"===YA.cmd||"C"===YA.cmd&&K.closePath()}catch(A){kA.e(A)}finally{kA.f()}if(C.Stroke&&(l||(K.strokeStyle=D,K.lineWidth=i),K.stroke()),KA=d.pattern,!C.Fill||KA?K.fillStyle="none":(b||(K.fillStyle=E),K.fill(C.Rule)),!KA){A.next=54;break}return K.save(),HA=document.createElement("canvas"),JA=HA.getContext("2d"),HA.width=Object(G.converterDpi)(KA.width,this.coreHelper.dpi),HA.height=Object(G.converterDpi)(KA.height,this.coreHelper.dpi),A.next=50,this.renderLayerByCanvas(I,HA,JA,M,Q,R,null,KA,!1,null,null,null);case 50:LA=K.createPattern(HA,"repeat"),K.fillStyle=LA,K.fillRect(0,0,a,s),K.restore();case 54:N?(tA=document.createElement("canvas"),dA=Object(G.converterBox)(N,this.coreHelper.dpi),eA=dA.w,nA=dA.h,lA=dA.x,ZA=dA.y,tA.width=eA*c,tA.height=nA*c,tA.style.width="".concat(eA,"px"),tA.style.height="".concat(nA,"px"),rA=tA.getContext("2d"),y&&rA.transform(y.a,y.b,y.c,y.d,Object(G.converterDpi)(y.e,this.coreHelper.dpi),Object(G.converterDpi)(y.f,this.coreHelper.dpi)),F&&(rA.globalAlpha=F/255),rA.drawImage(Y,k,S),B.drawImage(tA,lA,ZA)):B.drawImage(Y,k,S);case 55:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N,y){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,R,M,U,c,a,s,k,S,Y,K,H,J,L,t,d,e,n,l,Z,r,q,W,f,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,R=Q.Boundary,R=Object(G.converterBox)(R,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,a=Q.Weight,s=Q.Size>0,M&&!s&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),k=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,s),(Y=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(J=Q.DrawParam)&&(L=Object(G.getDrawParam)(D,J)).FillColor&&(K&&K.Value||(K=L.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%"),n=h(d.Segment);try{for(n.s();!(l=n.n()).done;)(Z=l.value)&&((r=document.createElement("stop")).setAttribute("offset","".concat(100*Z.position,"%")),r.setAttribute("style","stop-color:".concat(Object(G.parseColor)(Z.color.Value),";stop-opacity:1")),e.appendChild(r),C=Object(G.parseColor)(Z.color.Value))}catch(A){n.e(A)}finally{n.f()}Y.appendChild(e)}Q.Fill||(y=0),q=R.w,W=R.h,f=R.x,x=R.y,p=k,b=k,V=0,M&&(m=M.a,T=M.b,j=M.c,X=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+j*j):Math.sqrt(m*m+j*j),u=X>0?Math.sign(X)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),0==(V=Math.atan2(-T,X))&&0!=m&&1==X||(p*=O,b*=u),0==V&&U-0==1&&(U=m/X)>0&&(p*=U)),N&&(z=N.a,P=N.b,v=N.c,_=N.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(V=Math.atan2(-P,_))&&0!=z&&1==_||(p*=$,b*=AA,x*=AA,f*=$,q*=$,W*=AA)),IA=Object(G.getFont)(B,c),gA=h(S),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!(QA.glyph&&IA&&IA.face&&M&&M.b>=0&&Q.Fill)){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,p,b,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(p),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==V){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(p),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(p),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,V,Math.ceil(p)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(a,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),Y.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return Y.setAttribute("style","overflow:visible;width:".concat(q,"px;height:").concat(W,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(Y.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,f,x);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(29),o=g(87),w=g(36);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return G}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(22),function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var A in this.fields){var I=this.fieldData[A];this.fields[A].textContent=I||0===I?I:"-"}}else for(var g in this.fields)this.fields[g].textContent="-"}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}())},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return U}));var B=g(21),Q=g.n(B),C=g(6),E=g.n(C),D=g(5),i=g.n(D),o=g(1),w=g.n(o),G=g(7),F=g.n(G),N=g(22);function y(A,I){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(A);I&&(B=B.filter((function(I){return Object.getOwnPropertyDescriptor(A,I).enumerable}))),g.push.apply(g,B)}return g}function h(A){for(var I=1;I<arguments.length;I++){var g=null!=arguments[I]?arguments[I]:{};I%2?y(Object(g),!0).forEach((function(I){Q()(A,I,g[I])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(g)):y(Object(g)).forEach((function(I){Object.defineProperty(A,I,Object.getOwnPropertyDescriptor(g,I))}))}return A}function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U=function(){function A(I,g,B){i()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null},{element:I.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){return I.editorInkButton.classList.contains("toggled")?AnnotationEditorType.NONE:AnnotationEditorType.INK}}}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,langSelect:I.langSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}var I;return w()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"setLanguage",value:(I=E()(F.a.mark((function A(I){var g,B,Q;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.l10n.getLanguage();case 2:if(A.sent!=I){A.next=5;break}return A.abrupt("return");case 5:if(this.eventBus.dispatch("langchanged",{source:self,value:I}),this.items.langSelect){A.next=8;break}return A.abrupt("return");case 8:g=R(this.items.langSelect.options),A.prev=9,g.s();case 11:if((B=g.n()).done){A.next=19;break}if((Q=B.value).value===I){A.next=16;break}return Q.selected=!1,A.abrupt("continue",17);case 16:Q.selected=!0;case 17:A.next=11;break;case 19:A.next=24;break;case 21:A.prev=21,A.t0=A.catch(9),g.e(A.t0);case 24:return A.prev=24,g.f(),A.finish(24);case 27:case"end":return A.stop()}}),A,this,[[9,21,24,27]])}))),function(A){return I.apply(this,arguments)})},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=N.DEFAULT_SCALE_VALUE,this.pageScale=N.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=g.langSelect,E=this,D=R(this.buttons);try{var i=function(){var g=A.value,B=g.element,Q=g.eventName,C=g.eventDetails;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,h(h({source:I},C),{},{isFromKeyboard:0===A.detail}))}))};for(D.s();!(A=D.n()).done;)i()}catch(A){D.e(A)}finally{D.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){E.eventBus.dispatch("pagenumberchanged",{source:E,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=N.noContextMenuHandler,C&&C.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=N.MIN_SCALE,C.zoomIn.disabled=Q>=N.MAX_SCALE;var E,D=!1,i=R(C.scaleSelect.options);try{for(i.s();!(E=i.n()).done;){var o=E.value;o.value===B?(o.selected=!0,D=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}D||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.items.pageNumber.classList.toggle("visiblePageIsLoading",A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(94);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var h=I.pagesCount>15e3;g.disabled=h,B.disabled=h,Q.disabled=h,C.disabled=h,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(95),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(6),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(7),w=g.n(o),G=(g(87),g(30)),F=g(36),N=g(97),y=g.n(N);function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=h(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
2
2
  /*!**********************!*\
3
3
  !*** ./src/index.js ***!
4
4
  \**********************/