file-viewer-demo/public/file-viewer3/assets/PdfView-ea7f4226.js

10 lines
532 KiB
JavaScript
Raw Normal View History

2023-04-24 06:36:37 +00:00
var Yi=Object.defineProperty;var Ki=(W,E,l)=>E in W?Yi(W,E,{enumerable:!0,configurable:!0,writable:!0,value:l}):W[E]=l;var Et=(W,E,l)=>(Ki(W,typeof E!="symbol"?E+"":E,l),l),Fr=(W,E,l)=>{if(!E.has(W))throw TypeError("Cannot "+l)};var Ue=(W,E,l)=>(Fr(W,E,"read from private field"),l?l.call(W):E.get(W)),nt=(W,E,l)=>{if(E.has(W))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(W):E.set(W,l)},rt=(W,E,l,p)=>(Fr(W,E,"write to private field"),p?p.call(W,l):E.set(W,l),l),Kn=(W,E,l,p)=>({set _(v){rt(W,E,v,l)},get _(){return Ue(W,E,p)}});import{c as commonjsGlobal,x as require$$7,d as defineComponent,r as ref,o as onMounted,a as openBlock,b as createElementBlock,k as createBaseVNode,q as pushScopeId,s as popScopeId,_ as _export_sfc}from"./index-0fd2d185.js";import{c as commonjsRequire}from"./_commonjs-dynamic-modules-302442b1.js";import{r as refWorker}from"./worker-ref-fadf3283.js";var pdfExports$1={},pdf$1={get exports(){return pdfExports$1},set exports(W){pdfExports$1=W}},path2dPolyfill_min={},hasRequiredPath2dPolyfill_min;function requirePath2dPolyfill_min(){return hasRequiredPath2dPolyfill_min||(hasRequiredPath2dPolyfill_min=1,function(){function W(n,h,a){if(a||arguments.length===2)for(var d,r=0,i=h.length;r<i;r++)!d&&r in h||(d||(d=Array.prototype.slice.call(h,0,r)),d[r]=h[r]);return n.concat(d||Array.prototype.slice.call(h))}var E={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},l=/([astvzqmhlc])([^astvzqmhlc]*)/gi,p=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function v(n){var h=[],a=String(n).trim();return a[0]!=="M"&&a[0]!=="m"||a.replace(l,function(d,r,i){var o=function(y){var f=y.match(p);return f?f.map(Number):[]}(i),c=r.toLowerCase(),b=r;if(c==="m"&&o.length>2&&(h.push(W([b],o.splice(0,2),!0)),c="l",b=b==="m"?"l":"L"),o.length<E[c])return"";for(h.push(W([b],o.splice(0,E[c]),!0));o.length>=E[c]&&o.length&&E[c];)h.push(W([b],o.splice(0,E[c]),!0));return""}),h}function I(n,h){var a=n.x*Math.cos(h)-n.y*Math.sin(h),d=n.y*Math.cos(h)+n.x*Math.sin(h);n.x=a,n.y=d}function k(n,h){n.x*=h,n.y*=h}var m=function(){function n(h){var a;this.commands=[],h&&h instanceof n?(a=this.commands).push.apply(a,h.commands):h&&(this.commands=v(h))}return n.prototype.addPath=function(h){var a;h&&h instanceof n&&(a=this.commands).push.apply(a,h.commands)},n.prototype.moveTo=function(h,a){this.commands.push(["M",h,a])},n.prototype.lineTo=function(h,a){this.commands.push(["L",h,a])},n.prototype.arc=function(h,a,d,r,i,o){this.commands.push(["AC",h,a,d,r,i,!!o])},n.prototype.arcTo=function(h,a,d,r,i){this.commands.push(["AT",h,a,d,r,i])},n.prototype.ellipse=function(h,a,d,r,i,o,c,b){this.commands.push(["E",h,a,d,r,i,o,c,!!b])},n.prototype.closePath=function(){this.commands.push(["Z"])},n.prototype.bezierCurveTo=function(h,a,d,r,i,o){this.commands.push(["C",h,a,d,r,i,o])},n.prototype.quadraticCurveTo=function(h,a,d,r){this.commands.push(["Q",h,a,d,r])},n.prototype.rect=function(h,a,d,r){this.commands.push(["R",h,a,d,r])},n.prototype.roundRect=function(h,a,d,r,i){i===void 0?this.commands.push(["RR",h,a,d,r,0]):this.commands.push(["RR",h,a,d,r,i])},n}();function R(n,h){var a,d,r,i,o,c,b,y,f,s,g,S,D,w,x,F,X,G,j,N,Q,Y,B,ie,q=0,_=0,H=null,$=null,C=null,P=null,z=null,ee=null;n.beginPath();for(var te=0;te<h.length;++te){(G=h[te][0])!=="S"&&G!=="s"&&G!=="C"&&G!=="c"&&(H=null,$=null),G!=="T"&&G!=="t"&&G!=="Q"&&G!=="q"&&(C=null,P=null);var K=void 0;switch(G){case"m":case"M":K=h[te],G==="m"?(q+=K[1],_+=K[2]):(q=K[1],_=K[2]),G!=="M"&&z||(z={x:q,y:_}),n.moveTo(q,_);break;case"l":q+=(K=h[te])[1],_+=K[2],n.lineTo(q,_);break;case"L":q=(K=h[te])[1],_=K[2],n.lineTo(q,_);break;case"H":q=(K=h[te])[1],n.lineTo(q,_);break;case"h":q+=(K=h[te])[1],n.lineTo(q,_);break;case"V":_=(K=h[te])[1],n.lineTo(q,_);break;case"v":_+=(K=h[te])[1],n.lineTo(q,_);break;case"a":case"A":if(K=h[te],ee===null)throw new Error("This should never happen");G==="a"?(q+=K[6],_+=K[7]):(q=K[6],_=K[7]),w=K[1],x=K[2],b=K[3]*Math.PI/180,r=!!K[4],i=!!K[5],o={x:q,y:_},I(c={x:(ee.x-o.x)/2,y:(ee.y-o.y)/2},-b),(y=c.x*c.x/(w*w)+c.y*c.y/(x*x))>1&&(w*=y=Math.sqrt(y),x*=y),f=w*w*x*x,
`);return Y.join("")}}E.StatTimer=y;function f(Q,Y){try{const{protocol:B}=Y?new URL(Q,Y):new URL(Q);return B==="http:"||B==="https:"}catch{return!1}}function s(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((B,ie)=>{const q=document.createElement("script");q.src=Q,q.onload=function(_){Y&&q.remove(),B(_)},q.onerror=function(){ie(new Error(`Cannot load script at: ${q.src}`))},(document.head||document.documentElement).append(q)})}function g(Q){console.log("Deprecated API usage: "+Q)}let S;class D{static toDateObject(Y){if(!Y||typeof Y!="string")return null;S||(S=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const B=S.exec(Y);if(!B)return null;const ie=parseInt(B[1],10);let q=parseInt(B[2],10);q=q>=1&&q<=12?q-1:0;let _=parseInt(B[3],10);_=_>=1&&_<=31?_:1;let H=parseInt(B[4],10);H=H>=0&&H<=23?H:0;let $=parseInt(B[5],10);$=$>=0&&$<=59?$:0;let C=parseInt(B[6],10);C=C>=0&&C<=59?C:0;const P=B[7]||"Z";let z=parseInt(B[8],10);z=z>=0&&z<=23?z:0;let ee=parseInt(B[9],10)||0;return ee=ee>=0&&ee<=59?ee:0,P==="-"?(H+=z,$+=ee):P==="+"&&(H-=z,$-=ee),new Date(Date.UTC(ie,q,_,H,$,C))}}E.PDFDateString=D;function w(Q,Y){let{scale:B=1,rotation:ie=0}=Y;const{width:q,height:_}=Q.attributes.style,H=[0,0,parseInt(q),parseInt(_)];return new d({viewBox:H,scale:B,rotation:ie})}function x(Q){if(Q.startsWith("#")){const Y=parseInt(Q.slice(1),16);return[(Y&16711680)>>16,(Y&65280)>>8,Y&255]}return Q.startsWith("rgb(")?Q.slice(4,-1).split(",").map(Y=>parseInt(Y)):Q.startsWith("rgba(")?Q.slice(5,-1).split(",").map(Y=>parseInt(Y)).slice(0,3):((0,v.warn)(`Not a valid color format: "${Q}"`),[0,0,0])}function F(Q){const Y=document.createElement("span");Y.style.visibility="hidden",document.body.append(Y);for(const B of Q.keys()){Y.style.color=B;const ie=window.getComputedStyle(Y).color;Q.set(B,x(ie))}Y.remove()}function X(Q){const{a:Y,b:B,c:ie,d:q,e:_,f:H}=Q.getTransform();return[Y,B,ie,q,_,H]}function G(Q){const{a:Y,b:B,c:ie,d:q,e:_,f:H}=Q.getTransform().invertSelf();return[Y,B,ie,q,_,H]}function j(Q,Y){let B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(Y instanceof d){const{pageWidth:q,pageHeight:_}=Y.rawDims,{style:H}=Q,$=`calc(var(--scale-factor) * ${q}px)`,C=`calc(var(--scale-factor) * ${_}px)`;!B||Y.rotation%180===0?(H.width=$,H.height=C):(H.width=C,H.height=$)}ie&&Q.setAttribute("data-main-rotation",Y.rotation)}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.BaseStandardFontDataFactory=E.BaseSVGFactory=E.BaseCanvasFactory=E.BaseCMapReaderFactory=void 0;var p=l(1);class v{constructor(){this.constructor===v&&(0,p.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,n){if(t<=0||n<=0)throw new Error("Invalid canvas size");const h=this._createCanvas(t,n);return{canvas:h,context:h.getContext("2d")}}reset(t,n,h){if(!t.canvas)throw new Error("Canvas is not specified");if(n<=0||h<=0)throw new Error("Invalid canvas size");t.canvas.width=n,t.canvas.height=h}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,n){(0,p.unreachable)("Abstract method `_createCanvas` called.")}}E.BaseCanvasFactory=v;class I{constructor(t){let{baseUrl:n=null,isCompressed:h=!0}=t;this.constructor===I&&(0,p.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=n,this.isCompressed=h}async fetch(t){let{name:n}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!n)throw new Error("CMap name must be specified.");const h=this.baseUrl+n+(this.isCompressed?".bcmap":""),a=this.isCompressed?p.CMapCompressionType.BINARY:p.CMapCompressionType.NONE;return this._fetchData(h,a).catch(d=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${h}`)})}_fetchData(t,n){(0,p.unreachable)("Abstract method `_fetchData` called.")}}E.BaseCMapReaderFactory=I;class k{constructor(t){le
`)}return this.compiledGlyphs[t]=new Function("c","size",h.join(""))}return this.compiledGlyphs[t]=function(h,a){for(const d of n)d.cmd==="scale"&&(d.args=[a,-a]),h[d.cmd].apply(h,d.args)}}}E.FontFaceObject=k},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.CanvasGraphics=void 0;var p=l(1),v=l(139),I=l(144),k=l(145);function m($,C){R($,C),C.add($)}function R($,C){if(C.has($))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t($,C,P){if(!C.has($))throw new TypeError("attempted to get private field on non-instance");return P}const n=16,h=100,a=4096,d=15,r=10,i=1e3,o=16;function c($,C){if($._removeMirroring)throw new Error("Context is already forwarding operations.");$.__originalSave=$.save,$.__originalRestore=$.restore,$.__originalRotate=$.rotate,$.__originalScale=$.scale,$.__originalTranslate=$.translate,$.__originalTransform=$.transform,$.__originalSetTransform=$.setTransform,$.__originalResetTransform=$.resetTransform,$.__originalClip=$.clip,$.__originalMoveTo=$.moveTo,$.__originalLineTo=$.lineTo,$.__originalBezierCurveTo=$.bezierCurveTo,$.__originalRect=$.rect,$.__originalClosePath=$.closePath,$.__originalBeginPath=$.beginPath,$._removeMirroring=()=>{$.save=$.__originalSave,$.restore=$.__originalRestore,$.rotate=$.__originalRotate,$.scale=$.__originalScale,$.translate=$.__originalTranslate,$.transform=$.__originalTransform,$.setTransform=$.__originalSetTransform,$.resetTransform=$.__originalResetTransform,$.clip=$.__originalClip,$.moveTo=$.__originalMoveTo,$.lineTo=$.__originalLineTo,$.bezierCurveTo=$.__originalBezierCurveTo,$.rect=$.__originalRect,$.closePath=$.__originalClosePath,$.beginPath=$.__originalBeginPath,delete $._removeMirroring},$.save=function(){C.save(),this.__originalSave()},$.restore=function(){C.restore(),this.__originalRestore()},$.translate=function(z,ee){C.translate(z,ee),this.__originalTranslate(z,ee)},$.scale=function(z,ee){C.scale(z,ee),this.__originalScale(z,ee)},$.transform=function(z,ee,te,K,ue,fe){C.transform(z,ee,te,K,ue,fe),this.__originalTransform(z,ee,te,K,ue,fe)},$.setTransform=function(z,ee,te,K,ue,fe){C.setTransform(z,ee,te,K,ue,fe),this.__originalSetTransform(z,ee,te,K,ue,fe)},$.resetTransform=function(){C.resetTransform(),this.__originalResetTransform()},$.rotate=function(z){C.rotate(z),this.__originalRotate(z)},$.clip=function(z){C.clip(z),this.__originalClip(z)},$.moveTo=function(P,z){C.moveTo(P,z),this.__originalMoveTo(P,z)},$.lineTo=function(P,z){C.lineTo(P,z),this.__originalLineTo(P,z)},$.bezierCurveTo=function(P,z,ee,te,K,ue){C.bezierCurveTo(P,z,ee,te,K,ue),this.__originalBezierCurveTo(P,z,ee,te,K,ue)},$.rect=function(P,z,ee,te){C.rect(P,z,ee,te),this.__originalRect(P,z,ee,te)},$.closePath=function(){C.closePath(),this.__originalClosePath()},$.beginPath=function(){C.beginPath(),this.__originalBeginPath()}}class b{constructor(C){this.canvasFactory=C,this.cache=Object.create(null)}getCanvas(C,P,z){let ee;return this.cache[C]!==void 0?(ee=this.cache[C],this.canvasFactory.reset(ee,P,z)):(ee=this.canvasFactory.create(P,z),this.cache[C]=ee),ee}delete(C){delete this.cache[C]}clear(){for(const C in this.cache){const P=this.cache[C];this.canvasFactory.destroy(P),delete this.cache[C]}}}function y($,C,P,z,ee,te,K,ue,fe,ye){const[me,we,ge,A,O,M]=(0,v.getCurrentTransform)($);if(we===0&&ge===0){const se=K*me+O,ne=Math.round(se),re=ue*A+M,ve=Math.round(re),he=(K+fe)*me+O,be=Math.abs(Math.round(he)-ne)||1,Ce=(ue+ye)*A+M,Te=Math.abs(Math.round(Ce)-ve)||1;return $.setTransform(Math.sign(me),0,0,Math.sign(A),ne,ve),$.drawImage(C,P,z,ee,te,0,0,be,Te),$.setTransform(me,we,ge,A,O,M),[be,Te]}if(me===0&&A===0){const se=ue*ge+O,ne=Math.round(se),re=K*we+M,ve=Math.round(re),he=(ue+ye)*ge+O,be=Math.abs(Math.round(he)-ne)||1,Ce=(K+fe)*we+M,Te=Math.abs(Math.round(Ce)-ve)||1;return $.setTransform(0,Math.sign(we),Math.sign(ge),0,ne,ve),$.drawImage(C,P,z,ee,te,0,0,Te,be),$.setTransform(me,we,ge,A,O,M),[Te,be]}$.drawImage(C,P,z,ee,te,K,ue,fe,ye);const U=Math.hypot(me,we),Z=Math.hypot(ge,A);return[U*fe,Z*ye]}function f($){const{width:C,height:P}=$;if(C
`)){const ee=document.createElement("div");ee.append(z?document.createTextNode(z):document.createElement("br")),this.editorDiv.append(ee)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(_,H,$){const C=super.deserialize(_,H,$);return i(C,x,_.fontSize),i(C,g,p.Util.makeHexColor(..._.color)),i(C,S,_.value),C}serialize(){if(this.isEmpty())return null;const _=N._internalPadding*this.parentScale,H=this.getRect(_,_),$=I.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:a(this,g));return{annotationType:p.AnnotationEditorType.FREETEXT,color:$,fontSize:a(this,x),value:a(this,S),pageIndex:this.pageIndex,rect:H,rotation:this.rotation}}}E.FreeTextEditor=N;function Q(q){const _=$=>{this.editorDiv.style.fontSize=`calc(${$}px * var(--scale-factor))`,this.translate(0,-($-a(this,x))*this.parentScale),i(this,x,$),r(this,j,ie).call(this)},H=a(this,x);this.addCommands({cmd:()=>{_(q)},undo:()=>{_(H)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Y(q){const _=a(this,g);this.addCommands({cmd:()=>{i(this,g,this.editorDiv.style.color=q)},undo:()=>{i(this,g,this.editorDiv.style.color=_)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function B(){const q=this.editorDiv.getElementsByTagName("div");if(q.length===0)return this.editorDiv.innerText;const _=[];for(const H of q)_.push(H.innerText.replace(/\r\n?|\n/,""));return _.join(`
`)}function ie(){const[q,_]=this.parentDimensions;let H;if(this.isAttachedToDOM)H=this.div.getBoundingClientRect();else{const{currentLayer:$,div:C}=this,P=C.style.display;C.style.display="hidden",$.div.append(this.div),H=C.getBoundingClientRect(),C.remove(),C.style.display=P}this.width=H.width/q,this.height=H.height/_}m(N,"_freeTextDefaultContent",""),m(N,"_l10nPromise",void 0),m(N,"_internalPadding",0),m(N,"_defaultColor",null),m(N,"_defaultFontSize",10),m(N,"_keyboardManager",new v.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],N.prototype.commitOrRemove]])),m(N,"_type","freetext")},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.InkEditor=void 0,Object.defineProperty(E,"fitCurve",{enumerable:!0,get:function(){return I.fitCurve}});var p=l(1),v=l(137),I=l(162),k=l(138);function m(oe,J){a(oe,J),J.add(oe)}function R(oe,J,pe){return J=t(J),J in oe?Object.defineProperty(oe,J,{value:pe,enumerable:!0,configurable:!0,writable:!0}):oe[J]=pe,oe}function t(oe){var J=n(oe,"string");return typeof J=="symbol"?J:String(J)}function n(oe,J){if(typeof oe!="object"||oe===null)return oe;var pe=oe[Symbol.toPrimitive];if(pe!==void 0){var ke=pe.call(oe,J||"default");if(typeof ke!="object")return ke;throw new TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(oe)}function h(oe,J,pe){a(oe,J),J.set(oe,pe)}function a(oe,J){if(J.has(oe))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(oe,J,pe){return r(oe,J),pe}function r(oe,J){if(oe!==J)throw new TypeError("Private static access of wrong provenance")}function i(oe,J,pe){var ke=b(oe,J,"set");return o(oe,ke,pe),pe}function o(oe,J,pe){if(J.set)J.set.call(oe,pe);else{if(!J.writable)throw new TypeError("attempted to set read only private field");J.value=pe}}function c(oe,J){var pe=b(oe,J,"get");return y(oe,pe)}function b(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to "+pe+" private field on non-instance");return J.get(oe)}function y(oe,J){return J.get?J.get.call(oe):J.value}function f(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to get private field on non-instance");return pe}const s=16,g=100;var S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakMap,X=new WeakMap,G=new WeakMap,j=new WeakMap,N=new WeakMap,Q=new WeakMap,Y=new WeakMap,B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakSet,H=new WeakSet,$=new WeakSet,C=new WeakSet,P=new WeakSet,z=new WeakSet,ee=new WeakSet,te=new WeakSet,K=new WeakSet,ue=new WeakSet,fe=new WeakSet,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet,Z=new WeakSet,se=new WeakSet,ne=new WeakSet;class re extends v.AnnotationEditor{constructor(J){super({...J,name:"inkEditor"}),m(this,ne),m(this,se),m(this,Z),m(this,U),m(this,M),m(this,O),m(this,A),m(this,ge),m(this,we),m(this,me),m(this,ye),m(this,fe),m(this,ue),m(this,K),m(this,te),m(this,ee),m(this,z),m(this,P),m(this,C),m(this,$),m(this,H),m(this,_),h(this,S,{writable:!0,value:0}),h(this,D,{writable:!0,value:0}),h(this,w,{writable:!0,value:0}),h(this,x,{writable:!0,value:this.canvasPointermove.bind(this)}),h(this,F,{writable:!0,value:this.canvasPointerleave.bind(this)}),h(this,X,{writable:!0,value:this.canvasPointerup.bind(this)}),h(this,G,{writable:!0,value:this.canvasPointerdown.bind(this)}),h(this,j,{writable:!0,value:!1}),h(this,N,{writable:!0,value:!1}),h(this,Q,{writable:!0,value:null}),h(this,Y,{writable:!0,value:null}),h(this,B,{writable:!0,value:0}),h(this,ie,{writable:!0,value:0}),h(this,q,{writable:!0,value:null}),this.color=J.color||null,this.thickness=J.thickness||null,this.opacity=J.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(J){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(pe=>[pe,J.get(pe)]))}static updateDefaultParams(J,pe){switch(J){case p.AnnotationEditorParamsType.INK_THICKNESS:re._defaultThickness=pe;break;case p.Annot
`}setFont(s){const g=this.current,S=this.commonObjs.get(s[0]);let D=s[1];g.font=S,this.embedFonts&&!S.missingFile&&!this.embeddedFonts[S.loadedName]&&(this.addFontStyle(S),this.embeddedFonts[S.loadedName]=S),g.fontMatrix=S.fontMatrix||v.FONT_IDENTITY_MATRIX;let w="normal";S.black?w="900":S.bold&&(w="bold");const x=S.italic?"italic":"normal";D<0?(D=-D,g.fontDirection=-1):g.fontDirection=1,g.fontSize=D,g.fontFamily=S.loadedName,g.fontWeight=w,g.fontStyle=x,g.tspan=this.svgFactory.createElement("svg:tspan"),g.tspan.setAttributeNS(null,"y",o(-g.y)),g.xcoords=[],g.ycoords=[]}endText(){var s;const g=this.current;g.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&(s=g.txtElement)!==null&&s!==void 0&&s.hasChildNodes()&&(g.element=g.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(s){s>0&&(this.current.lineWidth=s)}setLineCap(s){this.current.lineCap=n[s]}setLineJoin(s){this.current.lineJoin=h[s]}setMiterLimit(s){this.current.miterLimit=s}setStrokeAlpha(s){this.current.strokeAlpha=s}setStrokeRGBColor(s,g,S){this.current.strokeColor=v.Util.makeHexColor(s,g,S)}setFillAlpha(s){this.current.fillAlpha=s}setFillRGBColor(s,g,S){this.current.fillColor=v.Util.makeHexColor(s,g,S),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(s){this.current.strokeColor=this._makeColorN_Pattern(s)}setFillColorN(s){this.current.fillColor=this._makeColorN_Pattern(s)}shadingFill(s){const g=this.viewport.width,S=this.viewport.height,D=v.Util.inverseTransform(this.transformMatrix),w=v.Util.applyTransform([0,0],D),x=v.Util.applyTransform([0,S],D),F=v.Util.applyTransform([g,0],D),X=v.Util.applyTransform([g,S],D),G=Math.min(w[0],x[0],F[0],X[0]),j=Math.min(w[1],x[1],F[1],X[1]),N=Math.max(w[0],x[0],F[0],X[0]),Q=Math.max(w[1],x[1],F[1],X[1]),Y=this.svgFactory.createElement("svg:rect");Y.setAttributeNS(null,"x",G),Y.setAttributeNS(null,"y",j),Y.setAttributeNS(null,"width",N-G),Y.setAttributeNS(null,"height",Q-j),Y.setAttributeNS(null,"fill",this._makeShadingPattern(s)),this.current.fillAlpha<1&&Y.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(Y)}_makeColorN_Pattern(s){return s[0]==="TilingPattern"?this._makeTilingPattern(s):this._makeShadingPattern(s)}_makeTilingPattern(s){const g=s[1],S=s[2],D=s[3]||v.IDENTITY_MATRIX,[w,x,F,X]=s[4],G=s[5],j=s[6],N=s[7],Q=`shading${f++}`,[Y,B,ie,q]=v.Util.normalizeRect([...v.Util.applyTransform([w,x],D),...v.Util.applyTransform([F,X],D)]),[_,H]=v.Util.singularValueDecompose2dScale(D),$=G*_,C=j*H,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",Q),P.setAttributeNS(null,"patternUnits","userSpaceOnUse"),P.setAttributeNS(null,"width",$),P.setAttributeNS(null,"height",C),P.setAttributeNS(null,"x",`${Y}`),P.setAttributeNS(null,"y",`${B}`);const z=this.svg,ee=this.transformMatrix,te=this.current.fillColor,K=this.current.strokeColor,ue=this.svgFactory.create(ie-Y,q-B);if(this.svg=ue,this.transformMatrix=D,N===2){const fe=v.Util.makeHexColor(...g);this.current.fillColor=fe,this.current.strokeColor=fe}return this.executeOpTree(this.convertOpList(S)),this.svg=z,this.transformMatrix=ee,this.current.fillColor=te,this.current.strokeColor=K,P.append(ue.childNodes[0]),this.defs.append(P),`url(#${Q})`}_makeShadingPattern(s){switch(typeof s=="string"&&(s=this.objs.get(s)),s[0]){case"RadialAxial":const g=`shading${f++}`,S=s[3];let D;switch(s[1]){case"axial":const w=s[4],x=s[5];D=this.svgFactory.createElement("svg:linearGradient"),D.setAttributeNS(null,"id",g),D.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),D.setAttributeNS(null,"x1",w[0]),D.setAttributeNS(null,"y1",w[1]),D.setAttributeNS(null,"x2",x[0]),D.setAttributeNS(null,"y2",x[1]);break;case"radial":const F=s[4],X=s[5],G=s[6],j=s[7];D=this.svgFactory.createElement("svg:radialGradient"),D.setAttributeNS(null,"id",g),D.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),D.setAttributeNS(null,"cx",X[0]),D.setAttributeNS(null,"cy",X[1]),D.setAttributeNS(null,"r",j),D.setAttributeNS(null,"fx",F[0]),D.setAttributeNS(null,"fy",
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function _(H,$){var C={},P=/^\s*|\s*$/,z=/^\s*#|^\s*$/,ee=/^\s*\[(.*)\]\s*$/,te=/^\s*@import\s+url\((.*)\)\s*$/i,K=/^([^=\s]*)\s*=\s*(.+)$/;function ue(ye,me,we){var ge=ye.replace(P,"").split(/[\r\n]+/),A="*",O=Q.split("-",1)[0],M=!1,U="";function Z(){for(;;){if(!ge.length){we();return}var se=ge.shift();if(!z.test(se)){if(me){if(U=ee.exec(se),U){A=U[1].toLowerCase(),M=A!=="*"&&A!==Q&&A!==O;continue}else if(M)continue;if(U=te.exec(se),U){fe(ie+U[1],Z);return}}var ne=se.match(K);ne&&ne.length==3&&(C[ne[1]]=q(ne[2]))}}}Z()}function fe(ye,me){f(ye,function(we){ue(we,!1,me)},function(){console.warn(ye+" not found."),me()})}ue(H,!0,function(){$(C)})}f(N,function(H){n+=H,_(H,function($){for(var C in $){var P,z,ee=C.lastIndexOf(".");ee>0?(P=C.substring(0,ee),z=C.substring(ee+1)):(P=C,z=h),t[P]||(t[P]={}),t[P][z]=$[C]}Y&&Y()})},B)}function g(N,Q){N&&(N=N.toLowerCase()),Q=Q||function(){},S(),a=N;var Y=o(),B=Y.length;if(B===0){var ie=c();if(ie&&ie.locales&&ie.default_locale){if(console.log("using the embedded JSON directory, early way out"),t=ie.locales[N],!t){var q=ie.default_locale.toLowerCase();for(var _ in ie.locales)if(_=_.toLowerCase(),_===N){t=ie.locales[N];break}else _===q&&(t=ie.locales[q])}Q()}else console.log("no resource to load, early way out");r="complete";return}var H=null,$=0;H=function(){$++,$>=B&&(Q(),r="complete")};function C(ee){var te=ee.href;this.load=function(K,ue){s(te,K,ue,function(){console.warn(te+" not found."),console.warn('"'+K+'" resource not found'),a="",ue()})}}for(var P=0;P<B;P++){var z=new C(Y[P]);z.load(N,H)}}function S(){t={},n="",a=""}function D(N){var 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};function Y(_,H){return H.indexOf(_)!==-1}function B(_,H,$){return H<=_&&_<=$}var ie={0:function(_){return"other"},1:function(_){return B(_%100,3,10)?"few":_===0?"zero":B(_%100,11,99)?"many":_==2?"two":_==1?"one":"other"},2:function(_){return _!==0&&_%10===0?"many":_==2?"two":_==1?"one":"other"},3:function(_){return _==1?"one":"other"},4:function(_){return B(_,0,1)?"one":"other"},5:function(_){return B(_,0,2)&&_!=2?"one":"other"},6:function(_){return _===0?"zero":_%10==1&&_%100!=11?"one":"other"},7:function(_){return _==2?"two":_==1?"one":"other"},8:function(_){return B(_,3,6)?"few":B(_,7,10)?"many":_==2?"two":_==1?"one":"other"},9:function(_){return _===0||_!=1&&B(_%100,1,19)?"few":_==1?"one":"other"},10:function(_){return B(_%10,2,9)&&!B(_%100,11,19)?"few":_%10==1&&!B(_%100,11,19)?"one":"other"},11:function(_){return B(_%10,2,4)&&!B(_%100,12,14)?"few":_%10===0||B(_%10,5,9)||B(_%100,11,14)?"many":_%10==1&&_%100!=11?"one":"other"},12:function(_){return B(_,2,4)?"few":_==1?"one":"other"},13:function(_){return B(_%10,2,4)&&!B(_%100,12,14)?"few":_!=1&&B(_%10,0,1)||B(_%10,5,9)||B(_%100,12,14)?"many":_==1?"one":"other"},14:function(_){return B(_%100,3,4)?"few":_%100==2?"two":_%100==1?"one":"other"},15:function(_){return _===0||B(_%100,2,10)?"few":B(_%100,11,19)?"many":_==1?"one":"other"},16:function(_){return _%10==1&&_!=11?"one":"other"},17:function(_){return _==3?"few":_===0?"zero":
`),gt=ft?at.length-2:at.length;Je=!0;let mt=gt;st+Qe===((Gt=Re[Ge])===null||Gt===void 0?void 0:Gt[1])&&(mt-=Re[Ge][0],++Ge);for(let Ht=1;Ht<=mt;Ht++)Ne.push([st-1-ze+Ht,ze-Ht]);return ze-=mt,Ke+=mt,ft?(st+=gt-1,Ne.push([st-ze+1,1+ze]),ze+=1,Ke+=1,Qe+=1,at.slice(0,gt)):at}if(yt)return Ne.push([st-ze+1,1+ze]),ze+=1,Ke+=1,Qe+=1,yt.charAt(0);if(Mt)return Ne.push([st-ze+1,ze]),Ke+=1,Qe+=1,Mt.charAt(0);if(At)return Ne.push([st-ze+1,ze-1]),ze-=1,Ke+=1,Qe+=1," ";if(st+Qe===((ht=J[Xe])===null||ht===void 0?void 0:ht[1])){const ft=J[Xe][0]-1;++Xe;for(let gt=1;gt<=ft;gt++)Ne.push([st-(ze-gt),ze-gt]);ze-=ft,Ke+=ft}return St}),Ne.push([Be.length,ze]),[Be,Ne,Je]}function $(oe,J,pe){if(!oe)return[J,pe];const ke=J,Re=J+pe;let Be=(0,t.binarySearchFirstItem)(oe,Ge=>Ge[0]>=ke);oe[Be][0]>ke&&--Be;let Ne=(0,t.binarySearchFirstItem)(oe,Ge=>Ge[0]>=Re,Be);return oe[Ne][0]>Re&&--Ne,[ke+oe[Be][1],pe+oe[Ne][1]-oe[Be][1]]}var C=new WeakMap,P=new WeakMap,z=new WeakSet,ee=new WeakSet,te=new WeakMap,K=new WeakSet,ue=new WeakSet,fe=new WeakSet,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet,Z=new WeakSet,se=new WeakSet,ne=new WeakSet,re=new WeakSet,ve=new WeakSet,he=new WeakSet;class be{constructor(J){let{linkService:pe,eventBus:ke,updateMatchesCountOnProgress:Re=!0}=J;a(this,he),a(this,ve),a(this,re),a(this,ne),a(this,se),a(this,Z),a(this,U),a(this,M),a(this,O),a(this,A),a(this,ge),a(this,we),a(this,me),a(this,ye),a(this,fe),a(this,ue),a(this,K),d(this,te,{get:Ie,set:void 0}),a(this,ee),a(this,z),d(this,C,{writable:!0,value:!0}),d(this,P,{writable:!0,value:0}),this._linkService=pe,this._eventBus=ke,b(this,C,Re),c(this,ee,Te).call(this),ke._on("find",c(this,z,Ce).bind(this)),ke._on("findbarclose",c(this,ne,Ee).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(J){this._pdfDocument&&c(this,ee,Te).call(this),J&&(this._pdfDocument=J,this._firstPageCapability.resolve())}scrollMatchIntoView(J){let{element:pe=null,selectedLeft:ke=0,pageIndex:Re=-1,matchIndex:Be=-1}=J;if(!this._scrollMatches||!pe)return;if(Be===-1||Be!==this._selected.matchIdx)return;if(Re===-1||Re!==this._selected.pageIdx)return;this._scrollMatches=!1;const Ne={top:S,left:ke+D};(0,t.scrollIntoView)(pe,Ne,!0)}}m.PDFFindController=be;function Ce(oe){if(!oe)return;const J=this._pdfDocument,{type:pe}=oe;(this._state===null||c(this,K,He).call(this,oe))&&(this._dirtyMatch=!0),this._state=oe,pe!=="highlightallchange"&&c(this,he,$e).call(this,s.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||J&&this._pdfDocument!==J)return;c(this,we,de).call(this);const ke=!this._highlightMatches,Re=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),pe?this._dirtyMatch?c(this,O,Fe).call(this):pe==="again"?(c(this,O,Fe).call(this),ke&&this._state.highlightAll&&c(this,A,De).call(this)):pe==="highlightallchange"?(Re?c(this,O,Fe).call(this):this._highlightMatches=!0,c(this,A,De).call(this)):c(this,O,Fe).call(this):this._findTimeout=setTimeout(()=>{c(this,O,Fe).call(this),this._findTimeout=null},g)})}function Te(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],b(this,P,0),this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,n.createPromiseCapability)()}function Ie(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,[this._normalizedQuery]=H(this._state.query)),this._normalizedQuery}function He(oe){if(oe.query!==this._state.query)return!0;sw
`);[this._pageContents[J],this._pageDiffs[J],this._hasDiacritics[J]]=H(Be.join("")),ke.resolve()},Re=>{console.error(`Unable to get text content for page ${J+1}`,Re),this._pageContents[J]="",this._pageDiffs[J]=null,this._hasDiacritics[J]=!1,ke.resolve()}))}}function Pe(oe){this._scrollMatches&&this._selected.pageIdx===oe&&(this._linkService.page=oe+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:oe})}function De(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}function Fe(){const oe=this._state.findPrevious,J=this._linkService.page-1,pe=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=J,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,b(this,P,0),this._matchesCountTotal=0,c(this,A,De).call(this);for(let Re=0;Re<pe;Re++)this._pendingFindMatches.has(Re)||(this._pendingFindMatches.add(Re),this._extractTextPromises[Re].then(()=>{this._pendingFindMatches.delete(Re),c(this,me,V).call(this,Re)}))}if(!i(this,te)){c(this,he,$e).call(this,s.FOUND);return}if(this._resumePageIdx)return;const ke=this._offset;if(this._pagesToSearch=pe,ke.matchIdx!==null){const Re=this._pageMatches[ke.pageIdx].length;if(!oe&&ke.matchIdx+1<Re||oe&&ke.matchIdx>0){ke.matchIdx=oe?ke.matchIdx-1:ke.matchIdx+1,c(this,se,ce).call(this,!0);return}c(this,Z,Ae).call(this,oe)}c(this,U,Me).call(this)}function _e(oe){const J=this._offset,pe=oe.length,ke=this._state.findPrevious;return pe?(J.matchIdx=ke?pe-1:0,c(this,se,ce).call(this,!0),!0):(c(this,Z,Ae).call(this,ke),J.wrapped&&(J.matchIdx=null,this._pagesToSearch<0)?(c(this,se,ce).call(this,!1),!0):!1)}function Me(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let oe=null;do{const J=this._offset.pageIdx;if(oe=this._pageMatches[J],!oe){this._resumePageIdx=J;break}}while(!c(this,M,_e).call(this,oe))}function Ae(oe){const J=this._offset,pe=this._linkService.pagesCount;J.pageIdx=oe?J.pageIdx-1:J.pageIdx+1,J.matchIdx=null,this._pagesToSearch--,(J.pageIdx>=pe||J.pageIdx<0)&&(J.pageIdx=oe?pe-1:0,J.wrapped=!0)}function ce(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,J=s.NOT_FOUND;const pe=this._offset.wrapped;if(this._offset.wrapped=!1,oe){const ke=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,J=pe?s.WRAPPED:s.FOUND,ke!==-1&&ke!==this._selected.pageIdx&&c(this,ge,Pe).call(this,ke)}c(this,he,$e).call(this,J,this._state.findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,c(this,ge,Pe).call(this,this._selected.pageIdx))}function Ee(oe){const J=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||J&&this._pdfDocument!==J||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),c(this,he,$e).call(this,s.FOUND),this._highlightMatches=!1,c(this,A,De).call(this))})}function We(){const{pageIdx:oe,matchIdx:J}=this._selected;let pe=0,ke=this._matchesCountTotal;if(J!==-1){for(let Be=0;Be<oe;Be++){var Re;pe+=((Re=this._pageMatches[Be])===null||Re===void 0?void 0:Re.length)||0}pe+=J+1}return(pe<1||pe>ke)&&(pe=ke=0),{current:pe,total:ke}}function Oe(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:c(this,re,We).call(this)})}function $e(oe){var J;let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;!i(this,C)&&(i(this,P)!==this._linkService.pagesCount||oe===s.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:oe,previous:pe,matchesCount:c(this,re,We).call(this),rawQuery:((J=this._state)===null||J===void 0?void 0:J.query)??null})}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CharacterType=void 0,m.getCharacterType=y;const R={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};m