UNPKG

@grapecity-software/gcdocs.pdfviewer

Version:
2 lines 18.4 MB
/*! For license information please see wasmSupportApi.js.LICENSE.txt */ !function(A,g){"object"==typeof exports&&"object"==typeof module?module.exports=g():"function"==typeof define&&define.amd?define([],g):"object"==typeof exports?exports.gcpdfviewer=g():A.gcpdfviewer=g()}(this,()=>(()=>{var A={4002:(A,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.toCamelCase=g.htmlDecode=g.unicodeToChar=g.fasterBytesToBase64=g.base64ToBytes=g.bytesToBase64=g.base64ToUtf8=g.utf8ToBase64=void 0,g.unicodeToChar=function(A){return A.replace(/\\u[\dA-F]{4}/gi,function(A){return String.fromCharCode(parseInt(A.replace(/\\u/g,""),16))})},g.htmlDecode=function(A){var g;if(window.DOMParser){g=(new window.DOMParser).parseFromString(A,"text/html").documentElement.textContent||""}else{var I=document.createElement("textarea");I.innerHTML=A,g=(0===I.childNodes.length?"":I.childNodes[0].nodeValue)||""}return g=g.replace("","•")};var I=function(){for(var A=[],g="A".charCodeAt(0),I="a".charCodeAt(0),C="0".charCodeAt(0),B=0;B<26;++B)A.push(String.fromCharCode(g+B));for(B=0;B<26;++B)A.push(String.fromCharCode(I+B));for(B=0;B<10;++B)A.push(String.fromCharCode(C+B));return A.push("+"),A.push("/"),A}();g.fasterBytesToBase64=function(A){for(var g,I="",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=new Uint8Array(A),Q=B.byteLength,E=Q%3,D=Q-E,i=0;i<D;i+=3)I+=C[(16515072&(g=B[i]<<16|B[i+1]<<8|B[i+2]))>>18]+C[(258048&g)>>12]+C[(4032&g)>>6]+C[63&g];return 1==E?I+=C[(252&(g=B[D]))>>2]+C[(3&g)<<4]+"==":2==E&&(I+=C[(64512&(g=B[D]<<8|B[D+1]))>>10]+C[(1008&g)>>4]+C[(15&g)<<2]+"="),I},g.bytesToBase64=function(A){var g,C="",B=A.length;for(g=2;g<B;g+=3)C+=I[A[g-2]>>2],C+=I[(3&A[g-2])<<4|A[g-1]>>4],C+=I[(15&A[g-1])<<2|A[g]>>6],C+=I[63&A[g]];return g===B+1&&(C+=I[A[g-2]>>2],C+=I[(3&A[g-2])<<4],C+="=="),g===B&&(C+=I[A[g-2]>>2],C+=I[(3&A[g-2])<<4|A[g-1]>>4],C+=I[(15&A[g-1])<<2],C+="="),C},g.base64ToBytes=function(A){for(var g=";base64,",I=A.indexOf(g),C=-1!==I?A.substring(I+8):A,B=window.atob(C),Q=B.length,E=new Uint8Array(new ArrayBuffer(Q)),D=0;D<Q;D++)E[D]=B.charCodeAt(D);return E},g.utf8ToBase64=function(A){return window.btoa(unescape(encodeURIComponent(A)))},g.base64ToUtf8=function(A){return decodeURIComponent(escape(window.atob(A)))},g.toCamelCase=function(A){return void 0===A?"":A.toString().replace(/[-_]+(.)?/g,function(A,g){return g?g.toUpperCase():""}).replace(/^./,function(A){return A.toLowerCase()})}},14002:A=>{var g,I=(g="undefined"!=typeof document?document.currentScript?.src:void 0,async function(A={}){var I,C,B,Q=A,E=new Promise((A,g)=>{I=A,C=g}),D=Object.assign({},Q),i="./this.program",w=(A,g)=>{throw g},o="";"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),g&&(o=g),o=o.startsWith("blob:")?"":o.slice(0,o.replace(/[?#].*/,"").lastIndexOf("/")+1),B=async A=>{var g=await fetch(A,{credentials:"same-origin"});if(g.ok)return g.arrayBuffer();throw new Error(g.status+" : "+g.url)};var N=Q.print||function(){}.bind(),R=Q.printErr||function(){}.bind();Object.assign(Q,D),D=null,Q.arguments&&Q.arguments,Q.thisProgram&&(i=Q.thisProgram);var M,F,G,k,Y,U,K,J,y,S,s=Q.wasmBinary,h=!1,H=!1,L=A=>A.startsWith("data:application/octet-stream;base64,");function c(){var A=M.buffer;Q.HEAP8=G=new Int8Array(A),Q.HEAP16=Y=new Int16Array(A),Q.HEAPU8=k=new Uint8Array(A),Q.HEAPU16=new Uint16Array(A),Q.HEAP32=U=new Int32Array(A),Q.HEAPU32=K=new Uint32Array(A),Q.HEAPF32=J=new Float32Array(A),Q.HEAPF64=S=new Float64Array(A),Q.HEAP64=y=new BigInt64Array(A),Q.HEAPU64=new BigUint64Array(A)}var a=[],j=[],T=[],z=[];function Z(A){a.unshift(A)}function x(A){z.unshift(A)}var q,W=0,P=null;function O(A){Q.onAbort?.(A),R(A="Aborted("+A+")"),h=!0,A+=". Build with -sASSERTIONS for more info.",H&&NA();var g=new WebAssembly.RuntimeError(A);throw C(g),g}function f(){var A,g="DsPdf.wasm";return L(g)?g:(A=g,Q.locateFile?Q.locateFile(A,o):o+A)}async function d(A){if(!s)try{var g=await B(A);return new Uint8Array(g)}catch{}return function(A){if(A==q&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}(A)}async function l(A,g,I){if(!A&&"function"==typeof WebAssembly.instantiateStreaming&&!L(g))try{var C=fetch(g,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(C,I)}catch(A){R(`wasm streaming compile failed: ${A}`),R("falling back to ArrayBuffer instantiation")}return async function(A,g){try{var I=await d(A);return await WebAssembly.instantiate(I,g)}catch(A){R(`failed to asynchronously prepare wasm: ${A}`),O(A)}}(g,I)}class V{name="ExitStatus";constructor(A){this.message=`Program terminated with exit(${A})`,this.status=A}}var r=A=>{for(;A.length>0;)A.shift()(Q)},m=Q.noExitRuntime||!0,X="undefined"!=typeof TextDecoder?new TextDecoder:void 0,n=(A,g=0,I=NaN)=>{for(var C=(g>>>=0)+I,B=g;A[B]&&!(B>=C);)++B;if(B-g>16&&A.buffer&&X)return X.decode(A.subarray(g,B));for(var Q="";g<B;){var E=A[g++];if(128&E){var D=63&A[g++];if(192!=(224&E)){var i=63&A[g++];if((E=224==(240&E)?(15&E)<<12|D<<6|i:(7&E)<<18|D<<12|i<<6|63&A[g++])<65536)Q+=String.fromCharCode(E);else{var w=E-65536;Q+=String.fromCharCode(55296|w>>10,56320|1023&w)}}else Q+=String.fromCharCode((31&E)<<6|D)}else Q+=String.fromCharCode(E)}return Q},t=(A,g)=>(A>>>=0)?n(k,A,g):"",b=()=>DA.I,p=A=>{var g=A.getArg(b(),0);return YA(g)},e=A=>MA(A),v=A=>{var g=FA(),I=e(4),C=e(4);UA(A,I,C);var B,Q=K[I>>>2>>>0],E=K[C>>>2>>>0],D=t(Q);return iA(Q),E&&(B=t(E),iA(E)),RA(g),[D,B]},u=A=>{var g=p(A);return v(g)};Q.getExceptionMessage=u;var _=(A,g,I)=>((A,g,I,C)=>{if(!(C>0))return 0;for(var B=I>>>=0,Q=I+C-1,E=0;E<A.length;++E){var D=A.charCodeAt(E);if(D>=55296&&D<=57343&&(D=65536+((1023&D)<<10)|1023&A.charCodeAt(++E)),D<=127){if(I>=Q)break;g[I++>>>0]=D}else if(D<=2047){if(I+1>=Q)break;g[I++>>>0]=192|D>>6,g[I++>>>0]=128|63&D}else if(D<=65535){if(I+2>=Q)break;g[I++>>>0]=224|D>>12,g[I++>>>0]=128|D>>6&63,g[I++>>>0]=128|63&D}else{if(I+3>=Q)break;g[I++>>>0]=240|D>>18,g[I++>>>0]=128|D>>12&63,g[I++>>>0]=128|D>>6&63,g[I++>>>0]=128|63&D}}return g[I>>>0]=0,I-B})(A,k,g,I),$=(A,g)=>Math.ceil(A/g)*g,AA=A=>{var g=(A-M.buffer.byteLength+65535)/65536|0;try{return M.grow(g),c(),1}catch(A){}},gA={},IA=()=>{if(!IA.strings){var A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:i||"./this.program"};for(var g in gA)void 0===gA[g]?delete A[g]:A[g]=gA[g];var I=[];for(var g in A)I.push(`${g}=${A[g]}`);IA.strings=I}return IA.strings},CA=[null,[],[]],BA=(A,g)=>{var I=CA[A];0===g||10===g?((1===A?N:R)(n(I)),I.length=0):I.push(g)},QA=A=>{F=A,m||(Q.onExit?.(A),h=!0),w(0,new V(A))};Q.incrementExceptionRefcount=A=>{var g=p(A);kA(g)},Q.decrementExceptionRefcount=A=>{var g=p(A);GA(g)};var EA={c:function(A,g,I,C){return g>>>=0,C>>>=0,O(`Assertion failed: ${t(A>>>=0)}, at: `+[g?t(g):"unknown filename",I,C?t(C):"unknown function"])},a:A=>{var g=new WebAssembly.Exception(b(),[A],{traceStack:!0});throw g.message=u(g),g},d:()=>O(""),e:function(A,g,I,C){A>>>=0,g>>>=0,I>>>=0,C>>>=0;var B=(new Date).getFullYear(),Q=new Date(B,0,1),E=new Date(B,6,1),D=Q.getTimezoneOffset(),i=E.getTimezoneOffset(),w=Math.max(D,i);K[A>>>2>>>0]=60*w,U[g>>>2>>>0]=Number(D!=i);var o=A=>{var g=A>=0?"-":"+",I=Math.abs(A);return`UTC${g}${String(Math.floor(I/60)).padStart(2,"0")}${String(I%60).padStart(2,"0")}`},N=o(D),R=o(i);i<D?(_(N,I,17),_(R,C,17)):(_(N,C,17),_(R,I,17))},i:function(A){A>>>=0;var g=k.length,I=4294901760;if(A>I)return!1;for(var C=1;C<=4;C*=2){var B=g*(1+.2/C);B=Math.min(B,A+100663296);var Q=Math.min(I,$(Math.max(A,B),65536));if(AA(Q))return!0}return!1},j:function(A,g){A>>>=0,g>>>=0;var I=0;return IA().forEach((C,B)=>{var Q=g+I;K[A+4*B>>>2>>>0]=Q,((A,g)=>{for(var I=0;I<A.length;++I)G[g++>>>0]=A.charCodeAt(I);G[g>>>0]=0})(C,Q),I+=C.length+1}),0},k:function(A,g){A>>>=0,g>>>=0;var I=IA();K[A>>>2>>>0]=I.length;var C=0;return I.forEach(A=>C+=A.length+1),K[g>>>2>>>0]=C,0},f:A=>52,g:function(A,g,I,C){return 52},h:function(A,g,I,C){var B;return g=(B=g)<-9007199254740992||B>9007199254740992?NaN:Number(B),70},b:function(A,g,I,C){g>>>=0,I>>>=0,C>>>=0;for(var B=0,Q=0;Q<I;Q++){var E=K[g>>>2>>>0],D=K[g+4>>>2>>>0];g+=8;for(var i=0;i<D;i++)BA(A,k[E+i>>>0]);B+=D}return K[C>>>2>>>0]=B,0}},DA=await async function(){function A(A,g){var I;return DA=function(A){A=Object.assign({},A);var g=A=>g=>A(g)>>>0,I=A=>()=>A()>>>0;return A.t=g(A.t),A.N=g(A.N),A.O=I(A.O),A}(DA=A.exports),M=DA.l,c(),I=DA.m,j.unshift(I),function(){if(W--,Q.monitorRunDependencies?.(W),0==W&&P){var A=P;P=null,A()}}(),DA}W++,Q.monitorRunDependencies?.(W);var g={a:EA};if(Q.instantiateWasm)try{return Q.instantiateWasm(g,A)}catch(A){R(`Module.instantiateWasm callback failed with error: ${A}`),C(A)}q??=f();try{var I=function(g){return A(g.instance)}(await l(s,q,g));return I}catch(A){return C(A),Promise.reject(A)}}(),iA=(DA.m,Q._free=DA.n),wA=(Q.__ZNK2ds3Pdf14PageCollection5CountEv=DA.p,Q.__ZN2ds3Pdf14PageCollection3AddEff=DA.q,Q.__ZNK2ds3Pdf13DsPdfDocument10LinearizedEv=DA.r,Q._init_random=DA.s,Q._malloc=DA.t),oA=(Q._server_version=DA.u,Q._open_document=DA.v,Q._close_document=DA.w,Q._is_uploaded_file=DA.x,Q._upload_file=DA.y,Q._modify=DA.z,Q._set_save_settings=DA.A,Q._download_modified=DA.B,Q._download_png_pages=DA.C,Q._download_svg_pages=DA.D,Q._clear_image_pages=DA.E,Q._download_unmodified=DA.F,Q._free_globals=DA.G,Q._extract_table_data=DA.H,Q._main=DA.J),NA=(Q.__ZNK2ds3Pdf13DsPdfDocument5PagesEv=DA.K,DA.L),RA=DA.M,MA=DA.N,FA=DA.O,GA=DA.P,kA=DA.Q,YA=DA.R,UA=DA.S;function KA(){var A,g=oA;try{var I=g(0,0);return F=A=I,QA(A),I}catch(A){return(A=>{if(A instanceof V||"unwind"==A)return F;w(0,A)})(A)}}if(Q.setValue=function(A,g,I="i8"){switch(I.endsWith("*")&&(I="*"),I){case"i1":case"i8":G[A>>>0]=g;break;case"i16":Y[A>>>1>>>0]=g;break;case"i32":U[A>>>2>>>0]=g;break;case"i64":y[A>>>3]=BigInt(g);break;case"float":J[A>>>2>>>0]=g;break;case"double":S[A>>>3>>>0]=g;break;case"*":K[A>>>2>>>0]=g;break;default:O(`invalid type for setValue: ${I}`)}},Q.getValue=function(A,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":case"i8":return G[A>>>0];case"i16":return Y[A>>>1>>>0];case"i32":return U[A>>>2>>>0];case"i64":return y[A>>>3];case"float":return J[A>>>2>>>0];case"double":return S[A>>>3>>>0];case"*":return K[A>>>2>>>0];default:O(`invalid type for getValue: ${g}`)}},Q.UTF8ToString=t,Q.stringToNewUTF8=A=>{var g=(A=>{for(var g=0,I=0;I<A.length;++I){var C=A.charCodeAt(I);C<=127?g++:C<=2047?g+=2:C>=55296&&C<=57343?(g+=4,++I):g+=3}return g})(A)+1,I=wA(g);return I&&_(A,I,g),I},Q.preInit)for("function"==typeof Q.preInit&&(Q.preInit=[Q.preInit]);Q.preInit.length>0;)Q.preInit.pop()();return function A(){function g(){Q.calledRun=!0,h||(H=!0,r(j),r(T),I(Q),Q.onRuntimeInitialized?.(),Q.noInitialRun||KA(),function(){if(Q.postRun)for("function"==typeof Q.postRun&&(Q.postRun=[Q.postRun]);Q.postRun.length;)x(Q.postRun.shift());r(z)}())}W>0?P=A:(function(){if(Q.preRun)for("function"==typeof Q.preRun&&(Q.preRun=[Q.preRun]);Q.preRun.length;)Z(Q.preRun.shift());r(a)}(),W>0?P=A:Q.setStatus?(Q.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Q.setStatus(""),1),g()},1)):g())}(),E});A.exports=I,A.exports.default=I},19164:(A,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.createObjectURL=g.addLinkAttributes=g.LinkTarget=g.removeNullCharacters=g.getFilenameFromUrl=g.makeAbsoluteUrl=g.findBaseScriptUrl=void 0;var I=function(){var A="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:{};if(!A.document)return"";for(var g=A.document.getElementsByTagName("script"),I=g.length-1;I>=0;I--)if(g[I].src)return g[I].src.toString();return""}();function C(){var A=-1!==I.indexOf("/js")?I.lastIndexOf("/js"):I.lastIndexOf("/");return I.substr(0,A)}g.findBaseScriptUrl=C,g.makeAbsoluteUrl=function(A,g){return 0===A.indexOf("http://")||0===A.indexOf("https://")?A:(g||(g=C()),g.lastIndexOf("/")!==g.length-1&&(g="".concat(g,"/")),"".concat(g).concat(A))},g.getFilenameFromUrl=function(A){if(!A)return"";var g=A.indexOf("#"),I=A.indexOf("?"),C=Math.min(g>0?g:A.length,I>0?I:A.length),B=A.substring(A.lastIndexOf("/",C)+1,C).substring(A.lastIndexOf("\\",C)+1,C);if(I>0&&-1===(B+"").toLowerCase().indexOf(".pdf")){var Q=A.substr(I)||"",E=Q.toLowerCase().indexOf(".pdf");if(Q&&E>0){var D=(Q=Q.substring(0,E+4)).replace(/[\\?#=]/g,"/").lastIndexOf("/");D>=0&&D<E&&(B=Q.substr(D+1))}}return B};var B=/\x00/g;function Q(A){return"string"!=typeof A?A:A.replace(B,"")}g.removeNullCharacters=Q;var E,D=["","_self","_blank","_parent","_top"];!function(A){A[A.NONE=0]="NONE",A[A.SELF=1]="SELF",A[A.BLANK=2]="BLANK",A[A.PARENT=3]="PARENT",A[A.TOP=4]="TOP"}(E=g.LinkTarget||(g.LinkTarget={})),g.addLinkAttributes=function(A,g){var I=g.url,C=g.target,B=g.rel;if(A.href=A.title=I?Q(I):"",I){var i=Object.values(E).includes(C)?C:E.NONE;A.target=D[i],A.rel="string"==typeof B?B:"noopener noreferrer nofollow"}},g.createObjectURL=function(A,g,I){return void 0===I&&(I=!1),(C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",function(A,g,I){if(void 0===I&&(I=!1),!I&&URL.createObjectURL){var B=function(A,g){if(void 0===g&&(g=""),"undefined"!=typeof Blob)return new Blob([A],{type:g});throw new Error('The "Blob" constructor is not supported.')}(A,g);return URL.createObjectURL(B)}for(var Q="data:"+g+";base64,",E=0,D=A.length;E<D;E+=3){var i=255&A[E],w=255&A[E+1],o=255&A[E+2],N=(3&i)<<4|w>>4,R=E+1<D?(15&w)<<2|o>>6:64,M=E+2<D?63&o:64;Q+=C[i>>2]+C[N]+C[R]+C[M]}return Q})(A,g,I);var C}},24463:function(A,g,I){"use strict";var C,B=this&&this.__awaiter||function(A,g,I,C){return new(I||(I=Promise))(function(B,Q){function E(A){try{i(C.next(A))}catch(A){Q(A)}}function D(A){try{i(C.throw(A))}catch(A){Q(A)}}function i(A){var g;A.done?B(A.value):(g=A.value,g instanceof I?g:new I(function(A){A(g)})).then(E,D)}i((C=C.apply(A,g||[])).next())})},Q=this&&this.__generator||function(A,g){var I,C,B,Q,E={label:0,sent:function(){if(1&B[0])throw B[1];return B[1]},trys:[],ops:[]};return Q={next:D(0),throw:D(1),return:D(2)},"function"==typeof Symbol&&(Q[Symbol.iterator]=function(){return this}),Q;function D(D){return function(i){return function(D){if(I)throw new TypeError("Generator is already executing.");for(;Q&&(Q=0,D[0]&&(E=0)),E;)try{if(I=1,C&&(B=2&D[0]?C.return:D[0]?C.throw||((B=C.return)&&B.call(C),0):C.next)&&!(B=B.call(C,D[1])).done)return B;switch(C=0,B&&(D=[2&D[0],B.value]),D[0]){case 0:case 1:B=D;break;case 4:return E.label++,{value:D[1],done:!1};case 5:E.label++,C=D[1],D=[0];continue;case 7:D=E.ops.pop(),E.trys.pop();continue;default:if(!(B=E.trys,(B=B.length>0&&B[B.length-1])||6!==D[0]&&2!==D[0])){E=0;continue}if(3===D[0]&&(!B||D[1]>B[0]&&D[1]<B[3])){E.label=D[1];break}if(6===D[0]&&E.label<B[1]){E.label=B[1],B=D;break}if(B&&E.label<B[2]){E.label=B[2],E.ops.push(D);break}B[2]&&E.ops.pop(),E.trys.pop();continue}D=g.call(A,E)}catch(A){D=[6,A],C=0}finally{I=B=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([D,i])}}},E=this&&this.__spreadArray||function(A,g,I){if(I||2===arguments.length)for(var C,B=0,Q=g.length;B<Q;B++)!C&&B in g||(C||(C=Array.prototype.slice.call(g,0,B)),C[B]=g[B]);return A.concat(C||Array.prototype.slice.call(g))};Object.defineProperty(g,"__esModule",{value:!0}),g.isAnnotationAllowsSelectTextBehind=g.updateRotationInit=g.findRotationInit=g.calcRotationRectangles=g.initAnnotationRotateSupport=g.insertFirst=g.applyAnnotationRotate=g.applyAnnotationRotate2=g.clearAnnotationRotate=g.updateAnnotationContentPosition=g.updateInputCheckedAppearance=g.setInputCheckedState=g.logError=g.logMessage=g.isEditorModeEnabled=g.sortedIndex=g.getAccentTextColor=g.moveInkLists=g.detachHeadCss=g.detachHeadJs=g.attachHeadCss=g.cleanseRichText=g.stripHtmlTags=g.attachHeadJs=g.setActiveUserName=g.getActiveUserName=g.getDefaultUserName=g.humanReadableFileSize=g.formatDateTime=g.copyStringToClipboard=g.formatRelativeDate=g.dateToPdfDateString=g.pdfDateStringToDate=g.changeOriginToTop=g.changeOriginToBottom=g.changeRectangleOrigin=g.convertToPdfPoint=g.convertToViewportPoint=g.inverseTransform=g.applyInverseTransform=g.applyTransform=g.getAxialAlignedBoundingBox=g.adjustCoordinates=g.getTransformMatrix=g.cloneObject=g.mergeObject=g.isTypedArray=g.resetStampAspectRatio=g.updateInitialRectPosition=g.generateUid=void 0,g.getFontFormatFromUrl=g.loadFileData=g.getValueFromCssText=g.setImageFileFromCanvas=g.generateRichMediaPoster=g.injectSerializableFile=g.getStandardizedLanguageKey=void 0;var D=I(63125),i=I(81495),w=I(41918),o=I(32675),N=I(57998),R=I(19164);function M(A){return(A||"")+Date.now().toString(36)+Math.random().toString(36).substr(2)}function F(A,g){if(A.rotationInit){var I=A.rect,C=A.rotationInit.initRect,B=Math.abs(I[2]-I[0]),Q=Math.abs(I[3]-I[1]),E=Math.abs(C[2]-C[0]),D=Math.abs(C[3]-C[1]),i=E-B,w=D-Q;g&&(I[0]=g[0],I[1]=g[1],I[2]=I[0]+B,I[3]=I[1]+Q);var N=A.rotate||0;switch(N){case 0:case 90:case 180:case 270:var R=(0,o.rotateRect)(I,null,N);C[0]=R[0],C[1]=R[1],C[2]=R[2],C[3]=R[3];break;default:C[0]=I[0]+i/2,C[1]=I[1]-w/2,C[2]=C[0]+E,C[3]=C[1]+D}}}function G(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function k(A,g,I,C){if(void 0===I&&(I=!1),void 0===C&&(C=!1),void 0===g||I&&void 0!==A&&(B=A)!==Object(B))return A;var B;if(G(g))return g;if(void 0===A){if(g instanceof Date)return new Date(g.getTime());if(g instanceof Array)A=[];else{if(!g||"object"!=typeof g)return g;A={}}}if(g){if(g instanceof Array){if(A&&A instanceof Array){for(var Q=[],E=0;E<g.length;E++)A.length>E?Q[E]=k(A[E],g[E]):Q[E]=k(void 0,g[E]);return Q}return g}if("object"==typeof g&&A&&"object"==typeof A){if(A instanceof Array&&(A={}),C)for(var D in A)g.hasOwnProperty(D)||(A[D]=g[D]);for(var D in g)A[D]="implementation"===D||"irtAnnotations"===D||"parentAnnotation"===D||"popupAnnotation"===D||"threads"===D||"bead"===D||"firstBead"===D||"source"===D?g[D]:k(A[D],g[D]);return A}}return g}function Y(A,g,I,C,B){void 0===B&&(B=!1);var Q=A;if(B)return[I,0,0,-C,-Q[0]*I,Q[3]*C];var E=g;switch((E%=360)<0&&(E+=360),E||(E=0),E){case 90:return[0,I,C,0,-Q[1]*I,-Q[0]*C];case 180:return[-I,0,0,C,Q[2]*I,-Q[1]*C];case 270:return[0,-I,-C,0,Q[3]*I,Q[2]*C];default:return[I,0,0,-C,-Q[0]*I,Q[3]*C]}}function U(A,g){return[A[0]*g[0]+A[1]*g[2]+g[4],A[0]*g[1]+A[1]*g[3]+g[5]]}function K(A,g){var I=g[0]*g[3]-g[1]*g[2];return[(A[0]*g[3]-A[1]*g[2]+g[2]*g[5]-g[4]*g[3])/I,(-A[0]*g[1]+A[1]*g[0]+g[4]*g[1]-g[5]*g[0])/I]}function J(A){var g=A[0]*A[3]-A[1]*A[2];return[A[3]/g,-A[1]/g,-A[2]/g,A[0]/g,(A[2]*A[5]-A[4]*A[3])/g,(A[4]*A[1]-A[5]*A[0])/g]}function y(A){var g=document.createElement("textarea");g.value=A,g.style.position="absolute",g.style.left="-9999px",document.body.appendChild(g),g.select(),g.setSelectionRange(0,g.value.length);try{document.execCommand("copy")}catch(A){}document.body.removeChild(g)}function S(A,g){try{if(!A)return"";g||(g="yyyy-mm-dd HH:MM");g={0:"HH:MM",1:"h:MM tt",2:"HH:MM:ss",3:"h:MM:ss tt"}[g]||g;var I=function(A,g){void 0===g&&(g=2);for(var I=String(A);I.length<g;)I="0"+I;return I},C=function(A){return A<12?"am":"pm"},B={yyyy:String(A.getFullYear()),yy:String(A.getFullYear()).slice(-2),mmmm:A.toLocaleString("default",{month:"long"}),mmm:A.toLocaleString("default",{month:"short"}),mm:I(A.getMonth()+1),m:String(A.getMonth()+1),dddd:A.toLocaleString("default",{weekday:"long"}),ddd:A.toLocaleString("default",{weekday:"short"}),dd:I(A.getDate()),d:String(A.getDate()),HH:I(A.getHours()),H:String(A.getHours()),hh:I(A.getHours()%12||12),h:String(A.getHours()%12||12),MM:I(A.getMinutes()),M:String(A.getMinutes()),ss:I(A.getSeconds()),s:String(A.getSeconds()),tt:C(A.getHours()),t:C(A.getHours())[0]};return g.replace(/yyyy|yy|mmmm|mmm|mm|m|dddd|ddd|dd|d|HH|H|hh|h|MM|M|ss|s|tt|t/g,function(A){return B[A]})}catch(g){return String(A)}}g.generateUid=M,g.updateInitialRectPosition=F,g.resetStampAspectRatio=function(A,g,I,C,B,Q){return void 0===Q&&(Q=!0),new Promise(function(E){if(A){var D=window.URL.createObjectURL(new Blob([A.buffer||A])),i=new Image;i.onload=function(){var A={width:i.naturalWidth||i.width,height:i.naturalHeight||i.height};B&&(A.width=72*A.width/B,A.height=72*A.height/B);var o=g.getPageSize(g.pageIndex),N=C.rect,R=Math.abs(N[2]-N[0]),M=Math.abs(N[3]-N[1]),G=Math.max(R,M),k=w.GcMeasurement.fitWithAspectRatio(A,G>10?{width:G,height:G}:o),Y={x:C.rect[0],y:C.rect[1]};Y.x+k.width>o.width&&(Y.x=o.width-k.width),Y.y+k.height>o.height&&(Y.y=o.height-k.height),Y.x<0&&(Y.x=0),Y.y<0&&(Y.y=0);var U=[Y.x,Y.y,Y.x+k.width,Y.y+k.height];C.rect=U,C.rotate&&(C.rotationInit=void 0,P(C,C.rotate),F(C,[Y.x,Y.y])),g.updateAnnotation(I,C).then(function(A){Q&&g.selectAnnotation(A.pageIndex,A.annotation),E(A)}),D&&(URL.revokeObjectURL(D),D=null)},i.onerror=function(){D&&(URL.revokeObjectURL(D),D=null),E(null)},i.src=D}else E(null)})},g.isTypedArray=G,g.mergeObject=k,g.cloneObject=function(A){return k(void 0,A)},g.getTransformMatrix=Y,g.adjustCoordinates=function(A,g,I,C,B,Q){void 0===C&&(C=!0),void 0===B&&(B=!1),void 0===Q&&(Q=1);var E,D=[A[0]<0?-A[0]:A[0],A[1]<0?-A[1]:A[1]],i=!0;A[0]<0&&0===A[2]?(E=[A[0],A[1]-D[1],A[2],A[3]-D[1]],i=!1):E=[A[0]-D[0],A[1]-D[1],A[2]-D[0],A[3]-D[1]];var w=Y(E,I,Q,Q,!1);C&&(w=J(w));var o=U(g,w);return B||(o=[o[0],E[3]-o[1]]),i?[o[0]+A[0],o[1]+A[1]]:[o[0],o[1]+A[1]]},g.getAxialAlignedBoundingBox=function(A,g){var I=U(A,g),C=U(A.slice(2,4),g),B=U([A[0],A[3]],g),Q=U([A[2],A[1]],g);return[Math.min(I[0],C[0],B[0],Q[0]),Math.min(I[1],C[1],B[1],Q[1]),Math.max(I[0],C[0],B[0],Q[0]),Math.max(I[1],C[1],B[1],Q[1])]},g.applyTransform=U,g.applyInverseTransform=K,g.inverseTransform=J,g.convertToViewportPoint=function(A,g,I){return U([A,g],I)},g.convertToPdfPoint=function(A,g,I){return K([A,g],I)},g.changeRectangleOrigin=function(A,g,I,C){void 0===I&&(I="BottomLeft"),void 0===C&&(C=!0);var B=E([],A,!0);if(C){var Q=Math.min(A[1],A[3]),D=Math.max(A[1],A[3]);return("BottomLeft"===I||"TopLeft"===I)&&(B[1]=g[3]-D+g[1],B[3]=g[3]-Q+g[1]),(0,o.normalizeRect)(B)}return Q=A[1],D=A[3],("BottomLeft"===I||"TopLeft"===I)&&(B[1]=g[3]-Q+g[1],B[3]=g[3]-D+g[1]),B},g.changeOriginToBottom=function(A,g){return g[3]-A+g[1]},g.changeOriginToTop=function(A,g){return g[3]-A-g[1]},g.pdfDateStringToDate=function(A){if(!A||"string"!=typeof A)return A&&A.getTime?A:null;C||(C=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var g=C.exec(A);if(!g)return null;var I=parseInt(g[1],10),B=parseInt(g[2],10);B=B>=1&&B<=12?B-1:0;var Q=parseInt(g[3],10);Q=Q>=1&&Q<=31?Q:1;var E=parseInt(g[4],10);E=E>=0&&E<=23?E:0;var D=parseInt(g[5],10);D=D>=0&&D<=59?D:0;var i=parseInt(g[6],10);i=i>=0&&i<=59?i:0;var w=g[7]||"Z",o=parseInt(g[8],10);o=o>=0&&o<=23?o:0;var N=parseInt(g[9],10)||0;return N=N>=0&&N<=59?N:0,"-"===w?(E+=o,D+=N):"+"===w&&(E-=o,D-=N),new Date(Date.UTC(I,B,Q,E,D,i))},g.dateToPdfDateString=function(A){var g=null;if(void 0===A)return null;if(A instanceof Date)g=A;else if("string"==typeof A)g=new Date(A);else if("number"==typeof A)g=new Date(A);else{if(!A||!A.toDate)return null;g=A.toDate()}if(!g)return null;if(isNaN(g.getTime()))return null;var I=g.getUTCFullYear(),C=g.getUTCMonth()+1,B=g.getUTCDate(),Q=g.getUTCHours(),E=g.getUTCMinutes(),D=g.getUTCSeconds(),i=I.toString().padStart(4,"0"),w=C.toString().padStart(2,"0"),o=B.toString().padStart(2,"0"),N=Q.toString().padStart(2,"0"),R=E.toString().padStart(2,"0"),M=D.toString().padStart(2,"0");return"D:".concat(i).concat(w).concat(o).concat(N).concat(R).concat(M,"Z")},g.formatRelativeDate=function(A,g,I){if(!A)return"";var C=new Date,B=A.getTime()-C.getTime(),Q=B>0,E=Math.abs(B);if(E<1e3)return g.t("labels.relative-date.right-now","right now");var D=Math.floor(E/1e3);if(D<60)return Q?g.t("labels.relative-date.in-seconds-format","in {{sec}} sec.",{sec:D}):g.t("labels.relative-date.seconds-ago-format","{{sec}} sec. ago",{sec:D});var i=Math.floor(E/6e4);if(i<60)return Q?g.t("labels.relative-date.in-minutes-format","in {{min}} min.",{min:i}):g.t("labels.relative-date.minutes-ago-format","{{min}} min. ago",{min:i});var w=S(A,I);return Q?g.t("labels.relative-date.at-format","at {{date}}",{date:w}):w},g.copyStringToClipboard=function(A){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(A).then(function(){}).catch(function(g){y(A)}):y(A)},g.formatDateTime=S,g.humanReadableFileSize=function(A,g){var I;I=g?[g.t("labels.fileSize.b","B"),g.t("labels.fileSize.kb","KB"),g.t("labels.fileSize.mb","MB"),g.t("labels.fileSize.gb","GB"),g.t("labels.fileSize.tb","TB"),"PB","EB","ZB","YB"]:["B","KB","MB","GB","TB","PB","EB","ZB","YB"];var C=A?Math.floor(Math.log(A)/Math.log(1024)):0;return 1*(A/Math.pow(1024,C)).toFixed(2)+" "+I[C]};var s="gcpdfviewerusername";function h(){var A=N.SharedRef.i18n;return A?A.t("annotation-defaults.default-user-name","Anonymous"):"Anonymous"}g.getDefaultUserName=h,g.getActiveUserName=function(A){var g=void 0;if(A&&(g=A.userName),!g)try{var I=localStorage.getItem(s);if(I){var C=JSON.parse(I);C&&(g=C.userName)}}catch(A){}return g||(g=h()),g},g.setActiveUserName=function(A,g){A||(A=h());try{var I={userName:A,setBy:g};localStorage.setItem(s,JSON.stringify(I))}catch(A){}};var H={},L={};function c(A,g){try{for(var I=A.querySelector(g),C=0;I&&C<5;)I.remove?I.remove():I.parentNode.removeChild(I),I=A.querySelector(g),C++}catch(A){}}function a(A,g,I){var C=A.closest(".annotationLayer"),B=null==C?void 0:C.querySelectorAll('input[data-name="'+A.getAttribute("data-name")+'"]');B&&B.length>1?B.forEach(function(C){I&&C.hasAttribute("exportValue")&&I===C.getAttribute("exportValue")?j(C,!0):"radio"===A.type&&A!==C&&g?j(C,!1):j(C,A===C?g:void 0)}):j(A,g)}function j(A,g){void 0===g&&(g=!!A.checked);var I=A.closest("section");if(I){var C=I.getAttribute("data-annotation-id");if(C){g?I.classList.add("checked"):I.classList.remove("checked");var B=A.getAttribute("exportValue");if(B){var Q=".gc-annotation-appearance-"+C+"-N",E=".gc-annotation-appearance-"+C+"-N_"+B.replace(/[\s\\\/\n]+/gm,"_"),D=".gc-annotation-appearance-"+C+"-N_Off",i=I.querySelector(Q),w=I.querySelector(D),o=I.querySelector(E);o||(o=I.querySelector(".gc-annotation-appearance-"+C+"-N_Yes")||I.querySelector(".gc-annotation-appearance-"+C+"-N_On")),o&&(i&&(i.style.display="none"),I.classList.add("gc-annotation-has-appearance"),g?(o.style.display="block",w&&(w.style.display="none")):(o.style.display="none",w&&(w.style.display="block")))}}}}function T(A,g,I,C){A.style.position="absolute",A.style.left="",A.style.top="",A.style.right="";var B="100%",Q="100%";switch(g){case-90:case 90:A.style.transformOrigin="0 0",B="".concat(I,"px"),Q="".concat(C,"px"),A.style.left="0px",A.style.top="".concat(I,"px");break;case-180:case 180:A.style.transformOrigin="0 0",A.style.top="".concat(I,"px"),A.style.left="".concat(C,"px");break;case-270:case 270:A.style.transformOrigin="0 0",B="".concat(I,"px"),Q="".concat(C,"px"),A.style.left="".concat(C,"px");break;default:B="".concat(C,"px"),Q="".concat(I,"px"),A.style.transformOrigin="initial"}A.style.width=B,A.style.height=Q}function z(A){for(var g=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),I=0;I<g.length;I++){var C=g[I];C.style.transform="",C.style.transformOrigin="",C.style.left="",C.style.top="",C.style.right="";for(var B=0,Q=Array.from(C.querySelectorAll("IMG"));B<Q.length;B++){var E=Q[B];E.style.transform="",E.style.transformOrigin=""}}}function Z(A,g){var I;if(void 0===g&&(g=[0,0,0,0]),A.rotationInit)I=A.rotationInit.initRect||A.rect||g;else if(!A.fileIdChanged){if(A.appearanceBBox){var C=A.appearanceBBox[2]-A.appearanceBBox[0],B=A.appearanceBBox[3]-A.appearanceBBox[1],Q=(A.rect[2]-A.rect[0]-C)/2,E=(A.rect[3]-A.rect[1]-B)/2,D=A.rect[0]+Q,i=A.rect[1]+E;I=[D,i,D+C,i+B]}!I&&A.rotate&&(I=(0,o.rotateRect)(A.rect||g,null,A.rotate,!0))}return I||(I=A.rect||g),I}function x(A,g,I){void 0===I&&(I=!1);var C=A.closest(".gc-annotation")||A.closest(".gc-widget")||A.closest("section"),B=g.rotate;if(Number.isFinite(B))for(var Q=Z(g,[C.offsetLeft,C.offsetTop,C.offsetLeft+C.offsetWidth,C.offsetTop+C.offsetHeight]),E=g.rect||[C.offsetLeft,C.offsetTop,C.offsetLeft+C.offsetWidth,C.offsetTop+C.offsetHeight],D=Math.abs(Q[2]-Q[0]),i=Math.abs(Q[3]-Q[1]),w=Math.abs(E[2]-E[0]),o=Math.abs(E[3]-E[1]),N=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),R=0;R<N.length;R++){var M=N[R],F=(M.style.transform||"").toString();F=F.replace(/(\s*rotate\(.+\))/gm,""),F+=" rotate("+-B+"deg)",M.style.transform=F,M.style.transformOrigin="",M.style.width=D+"px",M.style.height=i+"px",M.style.position="absolute",M.style.left="".concat((w-D)/2,"px"),M.style.top="".concat((o-i)/2,"px"),M.setAttribute("data-result-width",D.toString());var G=M.querySelector(".gc-text-content");G&&(G.style.width="100%",G.style.height="100%");for(var k=0,Y=Array.from(A.querySelectorAll("IMG"));k<Y.length;k++){var U=Y[k];U.style.width="100%",U.style.height="100%"}}}function q(A,g,I){var C;if(void 0===I&&(I=!1),A&&g)if(g.rotate||g.orientation){if(g.annotationType===D.AnnotationTypeCode.INK)return;if(g.annotationType===D.AnnotationTypeCode.FREETEXT)return;if(!(0,D.isFormFieldWidget)(g))return x(A,g,I);var B=g.rotate||0,Q=g.orientation||0;Q&&(B=Q);var E=A.closest(".gc-annotation")||A.closest(".gc-widget")||A.closest("section");if(!I&&E.classList.contains("gc-annotation-has-appearance")&&!E.classList.contains("gc-use-custom-appearance"))return;for(var i=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),w=0;w<i.length;w++){if(F=(F=((M=i[w]).style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),F+=" rotate("+-B+"deg)",M.style.transform=F,M.style.transformOrigin="",!M.classList.contains("gc-annotation")&&!E.classList.contains("freeTextAnnotation")){E.__borderCopied||(E.__borderCopied=!0,E.style.border&&(M.style.border=E.style.border),E.style.borderColor&&(M.style.borderColor=E.style.borderColor),"none none solid"===E.style.borderStyle?(M.style.borderBottomStyle="solid",M.style.borderBottomWidth=E.style.borderBottomWidth,M.style.borderBottomColor=E.style.borderBottomColor,E.style.paddingBottom=E.style.borderBottomWidth,E.style.borderBottomWidth="0px"):E.style.borderWidth&&(M.style.borderWidth=E.style.borderWidth,E.style.padding=E.style.borderWidth,E.style.borderWidth="0px"),E.style.borderStyle&&(M.style.borderStyle=E.style.borderStyle)),!Q&&B&&B%90==0&&(Q=B);var o=(null===(C=g.rotationInit)||void 0===C?void 0:C.initRect)||g.rect;(!o||Q&&(E.offsetWidth||E.offsetHeight))&&(o=[E.offsetLeft,E.offsetTop,E.offsetLeft+E.offsetWidth,E.offsetTop+E.offsetHeight]);var N=Math.abs(o[2]-o[0]),R=Math.abs(o[3]-o[1]);Q?T(M,Q,R,N):g.rotationInit&&(M.style.width="".concat(N,"px"),M.style.height="".concat(R,"px"),M.style.position="absolute",M.style.left="".concat(g.rotationInit.dx||0,"px"),M.style.top="".concat(g.rotationInit.dy||0,"px"))}}}else for(i=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),w=0;w<i.length;w++){var M,F;(M=i[w]).style.width="100%",M.style.height="100%",M.style.left="0px",M.style.top="0px",F=(F=(M.style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),M.style.transform=F,M.style.transformOrigin=""}}function W(A,g){A.firstChild?A.insertBefore(g,A.firstChild):A.appendChild(g)}function P(A,g,I){if(g){var C=I||Z(A),B=Math.abs(C[2]-C[0]),Q=Math.abs(C[3]-C[1]),E=(0,o.rotateRectAndFillBoth)(C,[C[0]+B/2,C[1]+Q/2],g),D=E.rotatedRect,i=E.transformedRect,w=Math.abs(D[2]-D[0]),N=Math.abs(D[3]-D[1]);A.rotationInit={initRect:C,rotatedRect:D,transformedRect:i,angle:g,dx:(w-B)/2,dy:(N-Q)/2},A.rect=D}else A.rotationInit&&(A.rotationInit.initRect&&(A.rect=A.rotationInit.initRect),A.rotationInit=void 0),I&&(A.rect=I)}function O(A,g){var I=(0,o.rotateRect)(A,null,g,!0),C=(0,o.findLinesIntersection)([I[0],I[3]],[I[2],I[3]],[A[0],A[1]],[A[0],A[3]]),B=(0,o.findLinesIntersection)([I[0],I[1]],[I[2],I[3]],[A[2],A[1]],[A[2],A[3]]);return C&&B?(0,o.normalizeRect)([C[0],C[1],B[0],B[1]]):E([],A,!0)}function f(A,g,I,C,E,D){return void 0===C&&(C="file"),void 0===E&&(E=!0),void 0===D&&(D=""),B(this,void 0,void 0,function(){var i=this;return Q(this,function(w){return D=D||g["".concat(C,"Id")],[2,new Promise(function(w){A.toBlob(function(o){return B(i,void 0,void 0,function(){var B,i,N,R,F,G;return Q(this,function(Q){switch(Q.label){case 0:return Q.trys.push([0,,3,4]),o?[4,o.arrayBuffer()]:[3,2];case 1:B=Q.sent(),i=new Uint8Array(B),N=D||M("".concat(C,"_img")),R="".concat(C,".png"),F=i.length,g["".concat(C,"Id")]=N,g["".concat(C,"Name")]=R,g["".concat(C,"Length")]=F,I.storage.setItem(N,i),G={id:g.id,fileId:N,fileName:R,fileLength:F,filePropName:C},I.viewer.eventBus.dispatch("annotation-image-loaded",G),Q.label=2;case 2:return E&&(A.width=0,A.height=0),[3,4];case 3:return w(),[7];case 4:return[2]}})})},"image/png")})]})})}g.attachHeadJs=function(A,g,I){return new Promise(function(C,B){if(g){if(L[g])return void C();L[g]=!0}var Q=((I=I||document).getElementsByTagName?I.getElementsByTagName("head")[0]:void 0)||I.body||I,E=document.createElement("script");g&&E.setAttribute("id",g),E.type="text/javascript",E.src=A,E.async=!0,E.onerror=function(A){B(A)};var D=!1;E.onload=E.onreadystatechange=function(A){var g=A.target;D||g.readyState&&"complete"!=g.readyState||(D=!0,C())},Q.insertBefore(E,Q.firstChild)})},g.stripHtmlTags=function(A){var g=document.createElement("div");return g.innerHTML=A||"",g.innerText||g.textContent||""},g.cleanseRichText=function(A){return A?A.replace(/<\/?(?:script|iframe|object|embed|form|input|textarea|select|option|button)[^>]*>/gi,"").replace(/<\?xml[^>]*\?>|<body[^>]*>|<\/body>/gi,""):""},g.attachHeadCss=function(A,g,I){if(g){if(H[g])return;H[g]=!0}var C=((I=I||document).getElementsByTagName?I.getElementsByTagName("head")[0]:void 0)||I.body||I,B=document.createElement("link");g&&B.setAttribute("id",g),B.setAttribute("rel","stylesheet"),B.setAttribute("type","text/css"),B.setAttribute("href","data:text/css;charset=UTF-8,"+encodeURIComponent(A)),C.insertBefore(B,C.firstChild)},g.detachHeadJs=function(A,g){A&&(c((g=g||document).head||g,"#"+A),delete L[A])},g.detachHeadCss=function(A,g){A&&(c((g=g||document).head||g,"#"+A),delete H[A])},g.moveInkLists=function(A,g,I){if(A)for(var C=0,B=A;C<B.length;C++)for(var Q=B[C],E=0;E<Q.length;E++)Q[E].x=Q[E].x-g,Q[E].y=Q[E].y-I},g.getAccentTextColor=function(){var A=document.querySelector(".gc-menu__btn-container");return A&&window.getComputedStyle&&window.getComputedStyle(A,null).getPropertyValue("background-color")||"#000000"},g.sortedIndex=function(A,g){for(var I=0,C=A.length;I<C;){var B=I+C>>>1;A[B]<g?I=B+1:C=B}return I},g.isEditorModeEnabled=function(A){return A&&!!(0,i.findSelfOrAncestor)(A,"gc-editor-mode")},g.logMessage=function(A){window.console&&window.console.log(A);var g=document.querySelector("#log-message");if(g){var I=new Date;A=(A=A+(" ("+I.getHours()+":"+I.getSeconds()+"."+I.getMilliseconds()+")")+";<br>"+g.innerHTML).substr(0,Math.min(A.length,512)),g.innerHTML=A}},g.logError=function(A){if("object"==typeof(A=A||"[empty message]")){var g="{ ";for(var I in A)g=g+I+"="+A[I]+"; ";A=g+="}"}window.console&&window.console.log(A);var C=document.querySelector("#log-error-message")||document.querySelector("#log-message");if(C){var B=new Date,Q=" ("+B.getHours()+":"+B.getSeconds()+"."+B.getMilliseconds()+")";C.innerHTML=A+Q}},g.setInputCheckedState=function(A,g,I,C){var B,Q;if(A){var E=A.closest("section"),D=g!==A.checked||E&&(g&&!E.classList.contains("checked")||!g&&E.classList.contains("checked")),i=null;g?(A.setAttribute("checked","true"),A.checked=!0,A.hasAttribute("exportValue")&&(i=A.getAttribute("exportValue")),null===(B=A.closest("section"))||void 0===B||B.classList.add("checked")):(A.removeAttribute("checked"),A.checked=!1,null===(Q=A.closest("section"))||void 0===Q||Q.classList.remove("checked")),a(A,g,i),D&&I&&I.onInputChanged(A,C)}},g.updateInputCheckedAppearance=a,g.updateAnnotationContentPosition=function(A,g,I){if(g||I)switch(A.annotationType){case D.AnnotationTypeCode.LINE:var C=A.lineCoordinates;if(C)for(var B=0;B<C.length;B+=2)g&&(C[B]=C[B]-g),I&&(C[B+1]=C[B+1]-I);break;case D.AnnotationTypeCode.INK:var Q=A.inkLists;if(Q)for(var E=0,i=Q;E<i.length;E++)for(var w=0,o=i[E];w<o.length;w++){var N=o[w];g&&(N.x=N.x-g),I&&(N.y=N.y-I)}break;case D.AnnotationTypeCode.POLYLINE:case D.AnnotationTypeCode.POLYGON:var R=A.vertices;if(R)for(var M=0,F=R;M<F.length;M++){N=F[M];g&&(N.x=N.x-g),I&&(N.y=N.y-I)}}},g.clearAnnotationRotate=z,g.applyAnnotationRotate2=x,g.applyAnnotationRotate=q,g.insertFirst=W,g.initAnnotationRotateSupport=function(A,g,I){var C=A.querySelector(".gc-rotate-support")||document.createElement("div");C.classList.add("gc-rotate-support"),I&&("string"==typeof I?C.innerHTML=I:C.appendChild(I)),W(A,C),g.rotate||g.orientation?q(C,g):z(C)},g.calcRotationRectangles=P,g.findRotationInit=O,g.updateRotationInit=function(A){A.rotationInit&&A.rotate&&(A.rotationInit.initRect=O(A.rect,A.rotate))},g.isAnnotationAllowsSelectTextBehind=function(A){return!A||!!(A.className||"").match(new RegExp("(".concat(["underlineAnnotation","squigglyAnnotation","strikeOutAnnotation","highlightAnnotation"].join("|"),")")))},g.getStandardizedLanguageKey=function(A,g){"auto"===A&&(A=((window.navigator.language||window.navigator.userLanguage)+"").toLowerCase().split("-")[0]),"auto"===g&&(g=((window.navigator.language||window.navigator.userLanguage)+"").toLowerCase().split("-")[0]);var I=(A||"").toLowerCase().split("-")[0];return{zh:"cn",hk:"cn",tw:"cn",jp:"ja",us:"en",ru:"ru",de:"de"}[I]||g||A||I||""},g.injectSerializableFile=function(A,g,I){var C;if(void 0===I&&(I="file"),(A.annotationType===D.AnnotationTypeCode.FILEATTACHMENT||A.annotationType===D.AnnotationTypeCode.RICHMEDIA)&&A[I]){var B=A[I].content,Q=(null===(C=A[I])||void 0===C?void 0:C.filename)||"noname";if(delete A[I],B&&0!==Q.indexOf("__empty.")){A["".concat(I,"Id")]&&g.removeItem(A["".concat(I,"Id")]);var E=(0,R.removeNullCharacters)((0,R.getFilenameFromUrl)(Q||"noname")),i="".concat(E,"_").concat(A.id);A.fileName=E,A["".concat(I,"Id")]=i,A.fileLength=B.length,g.setItem(i,B)}}},g.generateRichMediaPoster=function(A,g,I){return B(this,void 0,void 0,function(){var C,B,E,D,i,w,o,N,R,M;return Q(this,function(Q){switch(Q.label){case 0:return I||(I={}),C=I.drawBackOnly,B=I.filePropName||"file",E=I.knownFileId,D=A.rect&&!I.width?Math.abs(A.rect[2]-A.rect[0]):I.width||320,i=A.rect&&!I.height?Math.abs(A.rect[3]-A.rect[1]):I.height||240,(w=document.createElement("canvas")).width=D,w.height=i,o=w.getContext("2d"),N=I.foreColor||"#ffffff",R=I.backColor||"#000000",o.fillStyle=R,o.fillRect(0,0,D,i),C||(o.fillStyle=N,M=24,o.beginPath(),o.moveTo(12,i-8-M),o.arcTo(32,i-8-M,32,i-8,4),o.arcTo(32,i-8,8,i-8,4),o.arcTo(8,i-8,8,i-8-M,4),o.arcTo(8,i-8-M,32,i-8-M,4),o.closePath(),o.fillStyle=N,o.strokeStyle=N,o.lineWidth=2,o.fill(),o.stroke(),o.beginPath(),o.moveTo(15,i-8-7),o.lineTo(25,i-8-12),o.lineTo(15,i-8-17),o.closePath(),o.fillStyle=R,o.fill()),[4,f(w,A,g,B,!0,E)];case 1:return Q.sent(),[2]}})})},g.setImageFileFromCanvas=f,g.getValueFromCssText=function(A,g){if(!A||!g)return null;var I=new RegExp("".concat(g,":\\s*([^;]+);")),C=A.match(I);return C?C[1].trim():null},g.loadFileData=function(A){return B(this,void 0,void 0,function(){var g,I;return Q(this,function(C){switch(C.label){case 0:return C.trys.push([0,3,,4]),[4,fetch(A)];case 1:if(!(g=C.sent()).ok)throw new Error("Failed to load file from ".concat(A));return[4,g.arrayBuffer()];case 2:return I=C.sent(),[2,new Uint8Array(I)];case 3:throw C.sent();case 4:return[2]}})})},g.getFontFormatFromUrl=function(A,g){var I;try{if(!A)return g;switch((null===(I=A.split(".").pop())||void 0===I?void 0:I.toLowerCase())||""){case"ttc":return"ttc";case"ttf":return"truetype";case"otf":return"opentype";case"woff":return"woff";case"woff2":return"woff2";default:return g}}catch(A){return g}}},29014:A=>{"use strict";A.exports=function(A){for(var g="undefined"!=typeof window&&"function"==typeof window.atob?window.atob(A):Buffer.from(A,"base64").toString("binary"),I=new Uint8Array(g.length),C=0;C<g.length;++C)I[C]=g.charCodeAt(C);return I.buffer}},32675:(A,g)=>{"use strict";function I(A,g,I){return void 0===I||0===+I?Math[A](g):(g=+g,I=+I,isNaN(g)||"number"!=typeof I||I%1!=0?NaN:(g=g.toString().split("e"),+((g=(g=Math[A](+(g[0]+"e"+(g[1]?+g[1]-I:-I)))).toString().split("e"))[0]+"e"+(g[1]?+g[1]+I:I))))}function C(A,g){return I("round",A,g)}function B(A){var g=A.slice(0);return A[0]>A[2]&&(g[0]=A[2],g[2]=A[0]),A[1]>A[3]&&(g[1]=A[3],g[3]=A[1]),g}function Q(A,g,I,B,Q,E){void 0===E&&(E=!0);var D=E?Math.PI/180*Q:Q,i=Math.cos(D),w=Math.sin(D),o=i*(B-g)-w*(I-A)+g;return[C(i*(I-A)+w*(B-g)+A,-1),C(o,-1)]}function E(A,g,I,C){var B=Math.atan2(C-g,I-A)*(180/Math.PI);return B<0&&(B=360+B),B}function D(A,g,I,C){if(void 0===C&&(C=!0),!g){var E=Math.abs(A[2]-A[0]),D=Math.abs(A[3]-A[1]);g=[A[0]+E/2,A[1]+D/2]}var i=Q(g[0],g[1],A[0],A[1],I,C),w=Q(g[0],g[1],A[2],A[3],I,C);return B([i[0],i[1],w[0],w[1]])}Object.defineProperty(g,"__esModule",{value:!0}),g.findLinesIntersection=g.rotateRectAndFillBoth=g.getAngle=g.getDistance=g.reverseRotateRect=g.rotateRect=g.deg2rad=g.rad2Deg=g.findVectorsAngle=g.rotatePoint=g.normalizeRect=g.round10=g.ceil10=g.floor10=void 0,g.floor10=function(A,g){return I("floor",A,g)},g.ceil10=function(A,g){return I("ceil",A,g)},g.round10=C,g.normalizeRect=B,g.rotatePoint=Q,g.findVectorsAngle=function(A,g,I){var C=E(I[0],I[1],A[0],A[1]);return(360+E(I[0],I[1],g[0],g[1])-C)%360},g.rad2Deg=function(A){return 180*A/Math.PI},g.deg2rad=function(A){return A*(Math.PI/180)},g.rotateRect=D,g.reverseRotateRect=function(A,g,I){var C=0;return[{a:-360,sect:1},{a:-321,sect:2},{a:-270,sect:1},{a:-269,sect:2},{a:-232,sect:1},{a:-141,sect:2},{a:-90,sect:1},{a:-89,sect:2},{a:-52,sect:1},{a:39,sect:2},{a:90,sect:1},{a:91,sect:2},{a:128,sect:1},{a:219,sect:2},{a:270,sect:1},{a:271,sect:2},{a:308,sect:1}].forEach(function(A){A.a<=I&&(C=A.sect)}),D(1===C?A:[A[2],A[1],A[0],A[3]],g,-I,!0)},g.getDistance=function(A,g,I,C){var B=I-A,Q=C-g;return Math.sqrt(Q*Q+B*B)},g.getAngle=function(A,g,I,C){var B=I-A,Q=C-g;return Math.atan2(Q,B)},g.rotateRectAndFillBoth=function(A,g,I,C){void 0===C&&(C=!0);var Q=D(A=B(A),g,I,C),E=D([A[2],A[1],A[0],A[3]],g,I,C),i=[Math.min(Q[0],E[0]),Math.min(Q[1],E[1]),Math.max(Q[2],E[2]),Math.max(Q[3],E[3])];return{rotatedRect:B([Math.max(A[0],i[0]),Math.min(A[1],i[1]),Math.min(A[2],i[2]),Math.max(A[3],i[3])]),transformedRect:Q}},g.findLinesIntersection=function(A,g,I,C){var B=g[1]-A[1],Q=A[0]-g[0],E=B*A[0]+Q*A[1],D=C[1]-I[1],i=I[0]-C[0],w=D*I[0]+i*I[1],o=B*i-D*Q;return o?[(i*E-Q*w)/o,(B*w-D*E)/o]:null}},41918:(A,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.GcMeasurement=void 0;var I=function(){function A(){}return A.fitWithAspectRatio=function(A,g){var I=A.width,C=A.height,B=I/C;return I>g.width&&(C=(I=g.width)/B),C>g.height&&(I=(C=g.height)*B),{width:I,height:C}},A.measureDomText=function(A,g,I){var C=document.createElement("div");C.style.fontFamily=g,C.style.fontSize=I,C.style.whiteSpace="nowrap",C.style.width="auto",C.style.height="auto",C.style.visibility="hidden",C.style.position="absolute",C.style.zIndex="-10",C.style.left="-1000px",C.innerHTML=A,document.body.appendChild(C);var B={w:C.clientWidth,h:C.clientHeight};return C.remove(),B},A.getElementOuterSize=function(A){try{var g=getComputedStyle(A),I=void 0,C=void 0;return"BODY"===A.tagName?(I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,C=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth):(I=A.offsetHeight,C=A.offsetWidth),I+=parseFloat(g.marginTop?g.marginTop:"0")+parseFloat(g.marginBottom?g.marginBottom:"0"),{w:C+=parseFloat(g.marginLeft?g.marginLeft:"0")+parseFloat(g.marginRight?g.marginRight:"0"),h:I}}catch(g){return{w:A.offsetWidth,h:A.offsetHeight}}},A.getElementInnerSize=function(A){try{var g=getComputedStyle(A),I=void 0,C=void 0;return"BODY"===A.tagName?(I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,C=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0,I-=parseFloat(g.marginTop?g.marginTop:"0")+parseFloat(g.marginBottom?g.marginBottom:"0"),C-=parseFloat(g.marginLeft?g.marginLeft:"0")+parseFloat(g.marginRight?g.marginRight:"0")):(I=A.offsetHeight,C=A.offsetWidth),I-=parseFloat(g.paddingTop?g.paddingTop:"0")+parseFloat(g.paddingBottom?g.paddingBottom:"0"),{w:C-=parseFloat(g.paddingLeft?g.paddingLeft:"0")+parseFloat(g.paddingRight?g.paddingRight:"0"),h:I}}catch(g){return{w:A.offsetWidth,h:A.offsetHeight}}},A.intersectRect=function(A,g){return!(g.x>A.x+A.w||g.x+g.w<A.x||g.y>A.y+A.h||g.y+g.h<A.y)},A.isPointInBounds=function(A,g){var I=g.x+g.w,C=g.y+g.h;return g.x<=A.x&&A.x<=I&&g.y<=A.y&&A.y<=C},A.getWindowScrollOffsets=function(){var A=document.documentElement;return{left:(window.pageXOffset||A.scrollLeft)-(A.clientLeft||0),top:(window.pageYOffset||A.scrollTop)-(A.clientTop||0)}},A.getWindowSize=function(){return{w:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},A.getAbsoluteOffsetLeft=function(A){for(var g=0;A;)Number.isNaN(A.offsetLeft)||(g+=A.offsetLeft),A=A.offsetParent;return g},A.getAbsoluteOffsetTop=function(A){for(var g=0;A;)Number.isNaN(A.offsetTop)||(g+=A.offsetTop),A=A.offsetParent;return g},A}();g.GcMeasurement=I},57998:(A,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.SharedRef=void 0;var I="___gcpdfviewer_shared_ref",C="___gcpdfviewer_shared_ref18n",B=function(){function A(A,g,I){this.viewer=A,this.moment=g,this.i18n=I,this.i18n}return A.onViewerInitialize=function(g,C){window[I]||(window[I]={}),window[I][g.instanceId]=new A(g,C,g.in17n)},A.get=function(A,g){if(void 0===g&&(g=!1),window[I]||(window[I]={}),!window[I][A]&&g)for(var C in window[I])return window[I][C];if(!A&&!g)throw new Error("Missing instanceId");return window[I][A]},A.dispose=function(g){A.get(g)&&(A.get(g).dispose(),delete window[I][g])},Object.defineProperty(A,"moment",{get:function(){return A.get("",!0).moment},enumerable:!1,configurable:!0}),Object.defineProperty(A,"i18n",{get:function(){var g,I;return null!==(I=null===(g=A.get("",!0))||void 0===g?void 0:g.i18n)&&void 0!==I?I:window[C]},set:function(A){window[C]=A},enumerable:!1,configurable:!0}),Object.defineProperty(A,"count",{get:function(){return window[I]?Object.keys(window[I]).length:0},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"storage",{get:function(){return this.viewer.storage},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){this.releaseResources()},A.prototype.releaseResources=function(){this.storage.releaseResources()},A}();g.SharedRef=B},63125:function(A,g,I){"use strict";var C,B=this&&this.__extends||(C=function(A,g){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,g){A.__proto__=g}||function(A,g){for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&(A[I]=g[I])},C(A,g)},function(A,g){if("function"!=typeof g&&null!==g)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function I(){this.constructor=A}C(A,g),A.prototype=null===g?Object.create(g):(I.prototype=g.prototype,new I)});Object.defineProperty(g,"__esModule",{value:!0}),g.getAnnotationIconKey=g.getAnnotationDisplayName=g.getAnnotationDisplayTitle=g.ChoiceWidget=g.ButtonWidget=g.TextWidget=g.WidgetAnnotation=g.SoundAnnotation=g.FileAttachmentAnnotation=g.StampAnnotation=g.SignatureAnnotation=g.FreeTextAnnotation=g.TextAnnotation=g.LinkAnnotation=g.InkAnnotation=g.ReplaceTextAnnotation=g.RedactAnnotation=g.StrikeOutAnnotation=g.SquigglyAnnotation=g.UnderlineAnnotation=g.HighlightAnnotation=g.SquareAnnotation=g.CircleAnnotation=g.PolygonAnnotation=g.PolyLineAnnotation=g.LineAnnotation=g.MarkupAnnotation=g.PopupAnnotation=g.AnnotationBase=g.edtorModeToButtonKey=g.getAnnotationOptionsKeyName=g.findAnnotationSubType=g.findFieldObjectType=g.isRadioButtonFieldWidget=g.isFormFieldWidget=g.isStatusTextAnnotation=g.TextAlignmentType=g.AnnotationTypeCode=void 0;var Q,E=I(89526),D="Helvetica";function i(A){return!!A&&(A.annotationType===Q.WIDGET||A.annotationType===Q.SIGNATURE)}!function(A){A[A.TEXT=1]="TEXT",A[A.LINK=2]="LINK",A[A.FREETEXT=3]="FREETEXT",A[A.LINE=4]="LINE",A[A.SQUARE=5]="SQUARE",A[A.CIRCLE=6]="CIRCLE",A[A.POLYGON=7]="POLYGON",A[A.POLYLINE=8]="POLYLINE",A[A.HIGHLIGHT=9]="HIGHLIGHT",A[A.UNDERLINE=10]="UNDERLINE",A[A.SQUIGGLY=11]="SQUIGGLY",A[A.STRIKEOUT=12]="STRIKEOUT",A[A.STAMP=13]="STAMP",A[A.CARET=14]="CARET",A[A.INK=15]="INK",A[A.POPUP=16]="POPUP",A[A.FILEATTACHMENT=17]="FILEATTACHMENT",A[A.SOUND=18]="SOUND",A[A.MOVIE=19]="MOVIE",A[A.WIDGET=20]="WIDGET",A[A.SCREEN=21]="SCREEN",A[A.PRINTERMARK=22]="PRINTERMARK",A[A.TRAPNET=23]="TRAPNET",A[A.WATERMARK=24]="WATERMARK",A[A.THREED=25]="THREED",A[A.REDACT=26]="REDACT",A[A.SIGNATURE=27]="SIGNATURE",A[A.RICHMEDIA=90]="RICHMEDIA",A[A.THREADBEAD=150]="THREADBEAD",A[A.REPLACETEXT=500]="REPLACETEXT"}(Q=g.AnnotationTypeCode||(g.AnnotationTypeCode={})),function(A){A[A.Left=0]="Left",A[A.Center=1]="Center",A[A.Right=2]="Right"}(g.TextAlignmentType||(g.TextAlignmentType={})),g.isStatusTextAnnotation=function(A){return"Review"===A.stateModel&&("Accepted"===A.state||"Cancelled"===A.state||"Completed"===A.state||"Rejected"===A.state)},g.isFormFieldWidget=i,g.isRadioButtonFieldWidget=function(A){if(!A)return!1;var g=A;return g.annotationType===Q.WIDGET&&"Btn"===g.fieldType&&!0===g.radioButton},g.findFieldObjectType=function(A){return A.annotationType===Q.SIGNATURE?"signature":"Tx"===A.fieldType?(A.comb||A.multiLine||A.hasPasswordFlag,"text"):"Btn"===A.fieldType?A.checkBox?"checkbox":A.radioButton?"radiobutton":(A.submitForm||A.resetForm||A.pushButton,"button"):"Ch"===A.fieldType?A.combo?"combobox":"listbox":""},g.findAnnotationSubType=function(A,g){switch(A){case Q.TEXT:return"Text";case Q.CARET:return"Caret";case Q.CIRCLE:return"Circle";case Q.FILEATTACHMENT:r