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

10 lines
532 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,s=w*w*c.y*c.y+x*x*c.x*c.x,k(j={x:w*c.y/x,y:-x*c.x/w},i!==r?Math.sqrt((f-s)/s)||0:-Math.sqrt((f-s)/s)||0),d=Math.atan2((c.y-j.y)/x,(c.x-j.x)/w),a=Math.atan2(-(c.y+j.y)/x,-(c.x+j.x)/w),I(j,b),Y=j,B=(o.x+ee.x)/2,ie=(o.y+ee.y)/2,Y.x+=B,Y.y+=ie,n.save(),n.translate(j.x,j.y),n.rotate(b),n.scale(w,x),n.arc(0,0,1,d,a,!i),n.restore();break;case"C":H=(K=h[te])[3],$=K[4],q=K[5],_=K[6],n.bezierCurveTo(K[1],K[2],H,$,q,_);break;case"c":K=h[te],n.bezierCurveTo(K[1]+q,K[2]+_,K[3]+q,K[4]+_,K[5]+q,K[6]+_),H=K[3]+q,$=K[4]+_,q+=K[5],_+=K[6];break;case"S":K=h[te],H!==null&&$!==null||(H=q,$=_),n.bezierCurveTo(2*q-H,2*_-$,K[1],K[2],K[3],K[4]),H=K[1],$=K[2],q=K[3],_=K[4];break;case"s":K=h[te],H!==null&&$!==null||(H=q,$=_),n.bezierCurveTo(2*q-H,2*_-$,K[1]+q,K[2]+_,K[3]+q,K[4]+_),H=K[1]+q,$=K[2]+_,q+=K[3],_+=K[4];break;case"Q":C=(K=h[te])[1],P=K[2],q=K[3],_=K[4],n.quadraticCurveTo(C,P,q,_);break;case"q":C=(K=h[te])[1]+q,P=K[2]+_,q+=K[3],_+=K[4],n.quadraticCurveTo(C,P,q,_);break;case"T":C!==null&&P!==null||(C=q,P=_),C=2*q-C,P=2*_-P,q=(K=h[te])[1],_=K[2],n.quadraticCurveTo(C,P,q,_);break;case"t":C!==null&&P!==null||(C=q,P=_),C=2*q-C,P=2*_-P,q+=(K=h[te])[1],_+=K[2],n.quadraticCurveTo(C,P,q,_);break;case"z":case"Z":z&&(q=z.x,_=z.y),z=null,n.closePath();break;case"AC":q=(K=h[te])[1],_=K[2],D=K[3],d=K[4],a=K[5],N=K[6],n.arc(q,_,D,d,a,N);break;case"AT":g=(K=h[te])[1],S=K[2],q=K[3],_=K[4],D=K[5],n.arcTo(g,S,q,_,D);break;case"E":q=(K=h[te])[1],_=K[2],w=K[3],x=K[4],b=K[5],d=K[6],a=K[7],N=K[8],n.save(),n.translate(q,_),n.rotate(b),n.scale(w,x),n.arc(0,0,1,d,a,N),n.restore();break;case"R":q=(K=h[te])[1],_=K[2],F=K[3],X=K[4],z={x:q,y:_},n.rect(q,_,F,X);break;case"RR":q=(K=h[te])[1],_=K[2],F=K[3],X=K[4],Q=K[5],z={x:q,y:_},n.roundRect(q,_,F,X,Q)}ee?(ee.x=q,ee.y=_):ee={x:q,y:_}}}function t(n,h,a,d,r){var i=this;if(r===void 0&&(r=0),typeof r=="number"&&(r=[r]),Array.isArray(r)){if(r.length===0||r.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(r.length," radii provided. Between one and four radii are necessary."));if(r.forEach(function(s){if(s<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(i.constructor.name,"': Radius value ").concat(s," is negative."))}),r.length===1&&r[0]===0)return this.rect(n,h,a,d);var o,c,b,y=Math.min(a,d)/2,f=o=c=b=Math.min(y,r[0]);r.length===2&&(o=b=Math.min(y,r[1])),r.length===3&&(o=b=Math.min(y,r[1]),c=Math.min(y,r[2])),r.length===4&&(o=Math.min(y,r[1]),c=Math.min(y,r[2]),b=Math.min(y,r[3])),this.moveTo(n,h+d-b),this.arcTo(n,h,n+f,h,f),this.arcTo(n+a,h,n+a,h+o,o),this.arcTo(n+a,h+d,n+a-c,h+d,c),this.arcTo(n,h+d,n,h+d-b,b),this.moveTo(n,h)}}(function(n){if(n&&n.CanvasRenderingContext2D&&!n.Path2D){var h=n.CanvasRenderingContext2D,a=h.prototype.fill,d=h.prototype.stroke,r=h.prototype.isPointInPath;h.prototype.fill=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(!(i[0]instanceof m))return b=i[0]||"nonzero",a.apply(this,[b]);var c=i[0],b=i[1]||"nonzero";R(this,c.commands),a.apply(this,[b])},h.prototype.stroke=function(i){i&&R(this,i.commands),d.apply(this)},h.prototype.isPointInPath=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(i[0]instanceof m){var c=i[0],b=i[1],y=i[2],f=i[3]||"nonzero";return R(this,c.commands),r.apply(this,[b,y,f])}return r.apply(this,i)},n.Path2D=m}})(window),function(n){if(n&&n.CanvasRenderingContext2D){var h=n.CanvasRenderingContext2D,a=n.Path2D;h&&!h.prototype.roundRect&&(h.prototype.roundRect=t),a&&!a.prototype.roundRect&&(a.prototype.roundRect=t)}}(window)}()),path2dPolyfill_min}var ponyfillExports={},ponyfill={get exports(){return ponyfillExports},set exports(W){ponyfillExports=W}},hasRequiredPonyfill;function requirePonyfill(){return hasRequiredPonyfill||(hasRequiredPonyfill=1,function(W,E){(function(l,p){p(E)})(commonjsGlobal,function(l){var p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:function(e){return"Symbol("+e+")"};function v(){}function I(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof commonjsGlobal<"u")return commonjsGlobal}var k=I();function m(e){return typeof e=="object"&&e!==null||typeof e=="function"}var R=v,t=Promise,n=Promise.prototype.then,h=Promise.resolve.bind(t),a=Promise.reject.bind(t);function d(e){return new t(e)}function r(e){return h(e)}function i(e){return a(e)}function o(e,u,L){return n.call(e,u,L)}function c(e,u,L){o(o(e,u,L),void 0,R)}function b(e,u){c(e,u)}function y(e,u){c(e,void 0,u)}function f(e,u,L){return o(e,u,L)}function s(e){o(e,void 0,R)}var g=function(){var e=k&&k.queueMicrotask;if(typeof e=="function")return e;var u=r(void 0);return function(L){return o(u,L)}}();function S(e,u,L){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,u,L)}function D(e,u,L){try{return r(S(e,u,L))}catch(le){return i(le)}}var w=16384,x=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(u){var L=this._back,le=L;L._elements.length===w-1&&(le={_elements:[],_next:void 0}),L._elements.push(u),le!==L&&(this._back=le,L._next=le),++this._size},e.prototype.shift=function(){var u=this._front,L=u,le=this._cursor,Se=le+1,xe=u._elements,Le=xe[le];return Se===w&&(L=u._next,Se=0),--this._size,this._cursor=Se,u!==L&&(this._front=L),xe[le]=void 0,Le},e.prototype.forEach=function(u){for(var L=this._cursor,le=this._front,Se=le._elements;(L!==Se.length||le._next!==void 0)&&!(L===Se.length&&(le=le._next,Se=le._elements,L=0,Se.length===0));)u(Se[L]),++L},e.prototype.peek=function(){var u=this._front,L=this._cursor;return u._elements[L]},e}();function F(e,u){e._ownerReadableStream=u,u._reader=e,u._state==="readable"?N(e):u._state==="closed"?Y(e):Q(e,u._storedError)}function X(e,u){var L=e._ownerReadableStream;return wt(L,u)}function G(e){e._ownerReadableStream._state==="readable"?B(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ie(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function j(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function N(e){e._closedPromise=d(function(u,L){e._closedPromise_resolve=u,e._closedPromise_reject=L})}function Q(e,u){N(e),B(e,u)}function Y(e){N(e),q(e)}function B(e,u){e._closedPromise_reject!==void 0&&(s(e._closedPromise),e._closedPromise_reject(u),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ie(e,u){Q(e,u)}function q(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var _=p("[[AbortSteps]]"),H=p("[[ErrorSteps]]"),$=p("[[CancelSteps]]"),C=p("[[PullSteps]]"),P=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},z=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function ee(e){return typeof e=="object"||typeof e=="function"}function te(e,u){if(e!==void 0&&!ee(e))throw new TypeError(u+" is not an object.")}function K(e,u){if(typeof e!="function")throw new TypeError(u+" is not a function.")}function ue(e){return typeof e=="object"&&e!==null||typeof e=="function"}function fe(e,u){if(!ue(e))throw new TypeError(u+" is not an object.")}function ye(e,u,L){if(e===void 0)throw new TypeError("Parameter "+u+" is required in '"+L+"'.")}function me(e,u,L){if(e===void 0)throw new TypeError(u+" is required in '"+L+"'.")}function we(e){return Number(e)}function ge(e){return e===0?0:e}function A(e){return ge(z(e))}function O(e,u){var L=0,le=Number.MAX_SAFE_INTEGER,Se=Number(e);if(Se=ge(Se),!P(Se))throw new TypeError(u+" is not a finite number");if(Se=A(Se),Se<L||Se>le)throw new TypeError(u+" is outside the accepted range of "+L+" to "+le+", inclusive");return!P(Se)||Se===0?0:Se}function M(e,u){if(!Lt(e))throw new TypeError(u+" is not a ReadableStream.")}function U(e){return new ve(e)}function Z(e,u){e._reader._readRequests.push(u)}function se(e,u,L){var le=e._reader,Se=le._readRequests.shift();L?Se._closeSteps():Se._chunkSteps(u)}function ne(e){return e._reader._readRequests.length}function re(e){var u=e._reader;return!(u===void 0||!he(u))}var ve=function(){function e(u){if(ye(u,1,"ReadableStreamDefaultReader"),M(u,"First parameter"),Ft(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");F(this,u),this._readRequests=new x}return Object.defineProperty(e.prototype,"closed",{get:function(){return he(this)?this._closedPromise:i(Ce("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(u){return u===void 0&&(u=void 0),he(this)?this._ownerReadableStream===void 0?i(j("cancel")):X(this,u):i(Ce("cancel"))},e.prototype.read=function(){if(!he(this))return i(Ce("read"));if(this._ownerReadableStream===void 0)return i(j("read from"));var u,L,le=d(function(xe,Le){u=xe,L=Le}),Se={_chunkSteps:function(xe){return u({value:xe,done:!1})},_closeSteps:function(){return u({value:void 0,done:!0})},_errorSteps:function(xe){return L(xe)}};return be(this,Se),le},e.prototype.releaseLock=function(){if(!he(this))throw Ce("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");G(this)}},e}();Object.defineProperties(ve.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(ve.prototype,p.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function he(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_readRequests")?!1:e instanceof ve}function be(e,u){var L=e._ownerReadableStream;L._disturbed=!0,L._state==="closed"?u._closeSteps():L._state==="errored"?u._errorSteps(L._storedError):L._readableStreamController[C](u)}function Ce(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}var Te,Ie;typeof p.asyncIterator=="symbol"&&(Ie=(Te={},Te[p.asyncIterator]=function(){return this},Te),Object.defineProperty(Ie,p.asyncIterator,{enumerable:!1}));var He=function(){function e(u,L){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=L}return e.prototype.next=function(){var u=this,L=function(){return u._nextSteps()};return this._ongoingPromise=this._ongoingPromise?f(this._ongoingPromise,L,L):L(),this._ongoingPromise},e.prototype.return=function(u){var L=this,le=function(){return L._returnSteps(u)};return this._ongoingPromise?f(this._ongoingPromise,le,le):le()},e.prototype._nextSteps=function(){var u=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var L=this._reader;if(L._ownerReadableStream===void 0)return i(j("iterate"));var le,Se,xe=d(function(je,qe){le=je,Se=qe}),Le={_chunkSteps:function(je){u._ongoingPromise=void 0,g(function(){return le({value:je,done:!1})})},_closeSteps:function(){u._ongoingPromise=void 0,u._isFinished=!0,G(L),le({value:void 0,done:!0})},_errorSteps:function(je){u._ongoingPromise=void 0,u._isFinished=!0,G(L),Se(je)}};return be(L,Le),xe},e.prototype._returnSteps=function(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;var L=this._reader;if(L._ownerReadableStream===void 0)return i(j("finish iterating"));if(!this._preventCancel){var le=X(L,u);return G(L),f(le,function(){return{value:u,done:!0}})}return G(L),r({value:u,done:!0})},e}(),Ve={next:function(){return T(this)?this._asyncIteratorImpl.next():i(V("next"))},return:function(e){return T(this)?this._asyncIteratorImpl.return(e):i(V("return"))}};Ie!==void 0&&Object.setPrototypeOf(Ve,Ie);function ae(e,u){var L=U(e),le=new He(L,u),Se=Object.create(Ve);return Se._asyncIteratorImpl=le,Se}function T(e){if(!m(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof He}catch{return!1}}function V(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}var de=Number.isNaN||function(e){return e!==e};function Pe(e){return e.slice()}function De(e,u,L,le,Se){new Uint8Array(e).set(new Uint8Array(L,le,Se),u)}function Fe(e){return e}function _e(e){return!1}function Me(e,u,L){if(e.slice)return e.slice(u,L);var le=L-u,Se=new ArrayBuffer(le);return De(Se,0,e,u,le),Se}function Ae(e){return!(typeof e!="number"||de(e)||e<0)}function ce(e){var u=Me(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(u)}function Ee(e){var u=e._queue.shift();return e._queueTotalSize-=u.size,e._queueTotalSize<0&&(e._queueTotalSize=0),u.value}function We(e,u,L){if(!Ae(L)||L===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:u,size:L}),e._queueTotalSize+=L}function Oe(e){var u=e._queue.peek();return u.value}function $e(e){e._queue=new x,e._queueTotalSize=0}var oe=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!ke(this))throw In("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(u){if(!ke(this))throw In("respond");if(ye(u,1,"respond"),u=O(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");_e(this._view.buffer),ft(this._associatedReadableByteStreamController,u)},e.prototype.respondWithNewView=function(u){if(!ke(this))throw In("respondWithNewView");if(ye(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");_e(u.buffer),gt(this._associatedReadableByteStreamController,u)},e}();Object.defineProperties(oe.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(oe.prototype,p.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var J=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!pe(this))throw Jt("byobRequest");return Ct(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!pe(this))throw Jt("desiredSize");return Gt(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!pe(this))throw Jt("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError("The stream (in "+u+" state) is not in the readable state and cannot be closed");St(this)},e.prototype.enqueue=function(u){if(!pe(this))throw Jt("enqueue");if(ye(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var L=this._controlledReadableByteStream._state;if(L!=="readable")throw new TypeError("The stream (in "+L+" state) is not in the readable state and cannot be enqueued to");st(this,u)},e.prototype.error=function(u){if(u===void 0&&(u=void 0),!pe(this))throw Jt("error");ht(this,u)},e.prototype[$]=function(u){Be(this),$e(this);var L=this._cancelAlgorithm(u);return At(this),L},e.prototype[C]=function(u){var L=this._controlledReadableByteStream;if(this._queueTotalSize>0){var le=this._queue.shift();this._queueTotalSize-=le.byteLength,Qe(this);var Se=new Uint8Array(le.buffer,le.byteOffset,le.byteLength);u._chunkSteps(Se);return}var xe=this._autoAllocateChunkSize;if(xe!==void 0){var Le=void 0;try{Le=new ArrayBuffer(xe)}catch(qe){u._errorSteps(qe);return}var je={buffer:Le,bufferByteLength:xe,byteOffset:0,byteLength:xe,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(je)}Z(L,u),Re(this)},e}();Object.defineProperties(J.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(J.prototype,p.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function pe(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")?!1:e instanceof J}function ke(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")?!1:e instanceof oe}function Re(e){var u=Mt(e);if(u){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;var L=e._pullAlgorithm();c(L,function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Re(e))},function(le){ht(e,le)})}}function Be(e){Je(e),e._pendingPullIntos=new x}function Ne(e,u){var L=!1;e._state==="closed"&&(L=!0);var le=Ge(u);u.readerType==="default"?se(e,le,L):Br(e,le,L)}function Ge(e){var u=e.bytesFilled,L=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,u/L)}function Xe(e,u,L,le){e._queue.push({buffer:u,byteOffset:L,byteLength:le}),e._queueTotalSize+=le}function ze(e,u){var L=u.elementSize,le=u.bytesFilled-u.bytesFilled%L,Se=Math.min(e._queueTotalSize,u.byteLength-u.bytesFilled),xe=u.bytesFilled+Se,Le=xe-xe%L,je=Se,qe=!1;Le>le&&(je=Le-u.bytesFilled,qe=!0);for(var Ze=e._queue;je>0;){var et=Ze.peek(),tt=Math.min(je,et.byteLength),pt=u.byteOffset+u.bytesFilled;De(u.buffer,pt,et.buffer,et.byteOffset,tt),et.byteLength===tt?Ze.shift():(et.byteOffset+=tt,et.byteLength-=tt),e._queueTotalSize-=tt,Ke(e,tt,u),je-=tt}return qe}function Ke(e,u,L){L.bytesFilled+=u}function Qe(e){e._queueTotalSize===0&&e._closeRequested?(At(e),on(e._controlledReadableByteStream)):Re(e)}function Je(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function dt(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;var u=e._pendingPullIntos.peek();ze(e,u)&&(yt(e),Ne(e._controlledReadableByteStream,u))}}function ot(e,u,L){var le=e._controlledReadableByteStream,Se=1;u.constructor!==DataView&&(Se=u.constructor.BYTES_PER_ELEMENT);var xe=u.constructor,Le=u.buffer,je={buffer:Le,bufferByteLength:Le.byteLength,byteOffset:u.byteOffset,byteLength:u.byteLength,bytesFilled:0,elementSize:Se,viewConstructor:xe,readerType:"byob"};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(je),Qn(le,L);return}if(le._state==="closed"){var qe=new xe(je.buffer,je.byteOffset,0);L._closeSteps(qe);return}if(e._queueTotalSize>0){if(ze(e,je)){var Ze=Ge(je);Qe(e),L._chunkSteps(Ze);return}if(e._closeRequested){var et=new TypeError("Insufficient bytes to fill elements in the given buffer");ht(e,et),L._errorSteps(et);return}}e._pendingPullIntos.push(je),Qn(le,L),Re(e)}function lt(e,u){var L=e._controlledReadableByteStream;if(On(L))for(;Jn(L)>0;){var le=yt(e);Ne(L,le)}}function bt(e,u,L){if(Ke(e,u,L),!(L.bytesFilled<L.elementSize)){yt(e);var le=L.bytesFilled%L.elementSize;if(le>0){var Se=L.byteOffset+L.bytesFilled,xe=Me(L.buffer,Se-le,Se);Xe(e,xe,0,xe.byteLength)}L.bytesFilled-=le,Ne(e._controlledReadableByteStream,L),dt(e)}}function at(e,u){var L=e._pendingPullIntos.peek();Je(e);var le=e._controlledReadableByteStream._state;le==="closed"?lt(e):bt(e,u,L),Re(e)}function yt(e){var u=e._pendingPullIntos.shift();return u}function Mt(e){var u=e._controlledReadableByteStream;if(u._state!=="readable"||e._closeRequested||!e._started)return!1;if(re(u)&&ne(u)>0||On(u)&&Jn(u)>0)return!0;var L=Gt(e);return L>0}function At(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function St(e){var u=e._controlledReadableByteStream;if(!(e._closeRequested||u._state!=="readable")){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0){var L=e._pendingPullIntos.peek();if(L.bytesFilled>0){var le=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ht(e,le),le}}At(e),on(u)}}function st(e,u){var L=e._controlledReadableByteStream;if(!(e._closeRequested||L._state!=="readable")){var le=u.buffer,Se=u.byteOffset,xe=u.byteLength,Le=le;if(e._pendingPullIntos.length>0){var je=e._pendingPullIntos.peek();_e(je.buffer),je.buffer=je.buffer}if(Je(e),re(L))if(ne(L)===0)Xe(e,Le,Se,xe);else{e._pendingPullIntos.length>0&&yt(e);var qe=new Uint8Array(Le,Se,xe);se(L,qe,!1)}else On(L)?(Xe(e,Le,Se,xe),dt(e)):Xe(e,Le,Se,xe);Re(e)}}function ht(e,u){var L=e._controlledReadableByteStream;L._state==="readable"&&(Be(e),$e(e),At(e),Ar(L,u))}function Ct(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){var u=e._pendingPullIntos.peek(),L=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),le=Object.create(oe.prototype);Nr(le,e,L),e._byobRequest=le}return e._byobRequest}function Gt(e){var u=e._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:e._strategyHWM-e._queueTotalSize}function ft(e,u){var L=e._pendingPullIntos.peek(),le=e._controlledReadableByteStream._state;if(le==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(L.bytesFilled+u>L.byteLength)throw new RangeError("bytesWritten out of range")}L.buffer=L.buffer,at(e,u)}function gt(e,u){var L=e._pendingPullIntos.peek(),le=e._controlledReadableByteStream._state;if(le==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(L.byteOffset+L.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(L.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(L.bytesFilled+u.byteLength>L.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var Se=u.byteLength;L.buffer=u.buffer,at(e,Se)}function mt(e,u,L,le,Se,xe,Le){u._controlledReadableByteStream=e,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,$e(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=xe,u._pullAlgorithm=le,u._cancelAlgorithm=Se,u._autoAllocateChunkSize=Le,u._pendingPullIntos=new x,e._readableStreamController=u;var je=L();c(r(je),function(){u._started=!0,Re(u)},function(qe){ht(u,qe)})}function Ht(e,u,L){var le=Object.create(J.prototype),Se=function(){},xe=function(){return r(void 0)},Le=function(){return r(void 0)};u.start!==void 0&&(Se=function(){return u.start(le)}),u.pull!==void 0&&(xe=function(){return u.pull(le)}),u.cancel!==void 0&&(Le=function(qe){return u.cancel(qe)});var je=u.autoAllocateChunkSize;if(je===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");mt(e,le,Se,xe,Le,L,je)}function Nr(e,u,L){e._associatedReadableByteStreamController=u,e._view=L}function In(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function Jt(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function qn(e){return new Zt(e)}function Qn(e,u){e._reader._readIntoRequests.push(u)}function Br(e,u,L){var le=e._reader,Se=le._readIntoRequests.shift();L?Se._closeSteps(u):Se._chunkSteps(u)}function Jn(e){return e._reader._readIntoRequests.length}function On(e){var u=e._reader;return!(u===void 0||!Wt(u))}var Zt=function(){function e(u){if(ye(u,1,"ReadableStreamBYOBReader"),M(u,"First parameter"),Ft(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!pe(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");F(this,u),this._readIntoRequests=new x}return Object.defineProperty(e.prototype,"closed",{get:function(){return Wt(this)?this._closedPromise:i(un("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(u){return u===void 0&&(u=void 0),Wt(this)?this._ownerReadableStream===void 0?i(j("cancel")):X(this,u):i(un("cancel"))},e.prototype.read=function(u){if(!Wt(this))return i(un("read"));if(!ArrayBuffer.isView(u))return i(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return i(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return i(new TypeError("view's buffer must have non-zero byteLength"));if(_e(u.buffer),this._ownerReadableStream===void 0)return i(j("read from"));var L,le,Se=d(function(Le,je){L=Le,le=je}),xe={_chunkSteps:function(Le){return L({value:Le,done:!1})},_closeSteps:function(Le){return L({value:Le,done:!0})},_errorSteps:function(Le){return le(Le)}};return Zn(this,u,xe),Se},e.prototype.releaseLock=function(){if(!Wt(this))throw un("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");G(this)}},e}();Object.defineProperties(Zt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Zt.prototype,p.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Wt(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")?!1:e instanceof Zt}function Zn(e,u,L){var le=e._ownerReadableStream;le._disturbed=!0,le._state==="errored"?L._errorSteps(le._storedError):ot(le._readableStreamController,u,L)}function un(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function en(e,u){var L=e.highWaterMark;if(L===void 0)return u;if(de(L)||L<0)throw new RangeError("Invalid highWaterMark");return L}function dn(e){var u=e.size;return u||function(){return 1}}function hn(e,u){te(e,u);var L=e==null?void 0:e.highWaterMark,le=e==null?void 0:e.size;return{highWaterMark:L===void 0?void 0:we(L),size:le===void 0?void 0:Wr(le,u+" has member 'size' that")}}function Wr(e,u){return K(e,u),function(L){return we(e(L))}}function Ur(e,u){te(e,u);var L=e==null?void 0:e.abort,le=e==null?void 0:e.close,Se=e==null?void 0:e.start,xe=e==null?void 0:e.type,Le=e==null?void 0:e.write;return{abort:L===void 0?void 0:Vr(L,e,u+" has member 'abort' that"),close:le===void 0?void 0:zr(le,e,u+" has member 'close' that"),start:Se===void 0?void 0:Gr(Se,e,u+" has member 'start' that"),write:Le===void 0?void 0:Hr(Le,e,u+" has member 'write' that"),type:xe}}function Vr(e,u,L){return K(e,L),function(le){return D(e,u,[le])}}function zr(e,u,L){return K(e,L),function(){return D(e,u,[])}}function Gr(e,u,L){return K(e,L),function(le){return S(e,u,[le])}}function Hr(e,u,L){return K(e,L),function(le,Se){return D(e,u,[le,Se])}}function er(e,u){if(!jt(e))throw new TypeError(u+" is not a WritableStream.")}function jr(e){if(typeof e!="object"||e===null)return!1;try{return typeof e.aborted=="boolean"}catch{return!1}}var $r=typeof AbortController=="function";function Xr(){if($r)return new AbortController}var tn=function(){function e(u,L){u===void 0&&(u={}),L===void 0&&(L={}),u===void 0?u=null:fe(u,"First parameter");var le=hn(L,"Second parameter"),Se=Ur(u,"First parameter");nr(this);var xe=Se.type;if(xe!==void 0)throw new RangeError("Invalid type is specified");var Le=dn(le),je=en(le,1);oi(this,Se,je,Le)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!jt(this))throw vn("locked");return $t(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(u){return u===void 0&&(u=void 0),jt(this)?$t(this)?i(new TypeError("Cannot abort a stream that already has a writer")):fn(this,u):i(vn("abort"))},e.prototype.close=function(){return jt(this)?$t(this)?i(new TypeError("Cannot close a stream that already has a writer")):Tt(this)?i(new TypeError("Cannot close an already-closing stream")):rr(this):i(vn("close"))},e.prototype.getWriter=function(){if(!jt(this))throw vn("getWriter");return tr(this)},e}();Object.defineProperties(tn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,p.toStringTag,{value:"WritableStream",configurable:!0});function tr(e){return new nn(e)}function Yr(e,u,L,le,Se,xe){Se===void 0&&(Se=1),xe===void 0&&(xe=function(){return 1});var Le=Object.create(tn.prototype);nr(Le);var je=Object.create(Xt.prototype);return cr(Le,je,e,u,L,le,Se,xe),Le}function nr(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new x,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function jt(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")?!1:e instanceof tn}function $t(e){return e._writer!==void 0}function fn(e,u){var L;if(e._state==="closed"||e._state==="errored")return r(void 0);e._writableStreamController._abortReason=u,(L=e._writableStreamController._abortController)===null||L===void 0||L.abort();var le=e._state;if(le==="closed"||le==="errored")return r(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;var Se=!1;le==="erroring"&&(Se=!0,u=void 0);var xe=d(function(Le,je){e._pendingAbortRequest={_promise:void 0,_resolve:Le,_reject:je,_reason:u,_wasAlreadyErroring:Se}});return e._pendingAbortRequest._promise=xe,Se||Ln(e,u),xe}function rr(e){var u=e._state;if(u==="closed"||u==="errored")return i(new TypeError("The stream (in "+u+" state) is not in the writable state and cannot be closed"));var L=d(function(Se,xe){var Le={_resolve:Se,_reject:xe};e._closeRequest=Le}),le=e._writer;return le!==void 0&&e._backpressure&&u==="writable"&&Hn(le),li(e._writableStreamController),L}function Kr(e){var u=d(function(L,le){var Se={_resolve:L,_reject:le};e._writeRequests.push(Se)});return u}function Dn(e,u){var L=e._state;if(L==="writable"){Ln(e,u);return}Fn(e)}function Ln(e,u){var L=e._writableStreamController;e._state="erroring",e._storedError=u;var le=e._writer;le!==void 0&&ar(le,u),!ei(e)&&L._started&&Fn(e)}function Fn(e){e._state="errored",e._writableStreamController[H]();var u=e._storedError;if(e._writeRequests.forEach(function(Se){Se._reject(u)}),e._writeRequests=new x,e._pendingAbortRequest===void 0){pn(e);return}var L=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,L._wasAlreadyErroring){L._reject(u),pn(e);return}var le=e._writableStreamController[_](L._reason);c(le,function(){L._resolve(),pn(e)},function(Se){L._reject(Se),pn(e)})}function qr(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function Qr(e,u){e._inFlightWriteRequest._reject(u),e._inFlightWriteRequest=void 0,Dn(e,u)}function Jr(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0;var u=e._state;u==="erroring"&&(e._storedError=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var L=e._writer;L!==void 0&&fr(L)}function Zr(e,u){e._inFlightCloseRequest._reject(u),e._inFlightCloseRequest=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._reject(u),e._pendingAbortRequest=void 0),Dn(e,u)}function Tt(e){return!(e._closeRequest===void 0&&e._inFlightCloseRequest===void 0)}function ei(e){return!(e._inFlightWriteRequest===void 0&&e._inFlightCloseRequest===void 0)}function ti(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function ni(e){e._inFlightWriteRequest=e._writeRequests.shift()}function pn(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var u=e._writer;u!==void 0&&zn(u,e._storedError)}function Nn(e,u){var L=e._writer;L!==void 0&&u!==e._backpressure&&(u?gi(L):Hn(L)),e._backpressure=u}var nn=function(){function e(u){if(ye(u,1,"WritableStreamDefaultWriter"),er(u,"First parameter"),$t(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;var L=u._state;if(L==="writable")!Tt(u)&&u._backpressure?yn(this):pr(this),bn(this);else if(L==="erroring")Gn(this,u._storedError),bn(this);else if(L==="closed")pr(this),fi(this);else{var le=u._storedError;Gn(this,le),hr(this,le)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return Ut(this)?this._closedPromise:i(Vt("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!Ut(this))throw Vt("desiredSize");if(this._ownerWritableStream===void 0)throw rn("desiredSize");return si(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return Ut(this)?this._readyPromise:i(Vt("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(u){return u===void 0&&(u=void 0),Ut(this)?this._ownerWritableStream===void 0?i(rn("abort")):ri(this,u):i(Vt("abort"))},e.prototype.close=function(){if(!Ut(this))return i(Vt("close"));var u=this._ownerWritableStream;return u===void 0?i(rn("close")):Tt(u)?i(new TypeError("Cannot close an already-closing stream")):ir(this)},e.prototype.releaseLock=function(){if(!Ut(this))throw Vt("releaseLock");var u=this._ownerWritableStream;u!==void 0&&sr(this)},e.prototype.write=function(u){return u===void 0&&(u=void 0),Ut(this)?this._ownerWritableStream===void 0?i(rn("write to")):or(this,u):i(Vt("write"))},e}();Object.defineProperties(nn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,p.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Ut(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")?!1:e instanceof nn}function ri(e,u){var L=e._ownerWritableStream;return fn(L,u)}function ir(e){var u=e._ownerWritableStream;return rr(u)}function ii(e){var u=e._ownerWritableStream,L=u._state;return Tt(u)||L==="closed"?r(void 0):L==="errored"?i(u._storedError):ir(e)}function ai(e,u){e._closedPromiseState==="pending"?zn(e,u):pi(e,u)}function ar(e,u){e._readyPromiseState==="pending"?gr(e,u):mi(e,u)}function si(e){var u=e._ownerWritableStream,L=u._state;return L==="errored"||L==="erroring"?null:L==="closed"?0:ur(u._writableStreamController)}function sr(e){var u=e._ownerWritableStream,L=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ar(e,L),ai(e,L),u._writer=void 0,e._ownerWritableStream=void 0}function or(e,u){var L=e._ownerWritableStream,le=L._writableStreamController,Se=ci(le,u);if(L!==e._ownerWritableStream)return i(rn("write to"));var xe=L._state;if(xe==="errored")return i(L._storedError);if(Tt(L)||xe==="closed")return i(new TypeError("The stream is closing or closed and cannot be written to"));if(xe==="erroring")return i(L._storedError);var Le=Kr(L);return ui(le,u,Se),Le}var lr={},Xt=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"abortReason",{get:function(){if(!Bn(this))throw Vn("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"signal",{get:function(){if(!Bn(this))throw Vn("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),e.prototype.error=function(u){if(u===void 0&&(u=void 0),!Bn(this))throw Vn("error");var L=this._controlledWritableStream._state;L==="writable"&&dr(this,u)},e.prototype[_]=function(u){var L=this._abortAlgorithm(u);return gn(this),L},e.prototype[H]=function(){$e(this)},e}();Object.defineProperties(Xt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Xt.prototype,p.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Bn(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")?!1:e instanceof Xt}function cr(e,u,L,le,Se,xe,Le,je){u._controlledWritableStream=e,e._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,$e(u),u._abortReason=void 0,u._abortController=Xr(),u._started=!1,u._strategySizeAlgorithm=je,u._strategyHWM=Le,u._writeAlgorithm=le,u._closeAlgorithm=Se,u._abortAlgorithm=xe;var qe=Un(u);Nn(e,qe);var Ze=L(),et=r(Ze);c(et,function(){u._started=!0,mn(u)},function(tt){u._started=!0,Dn(e,tt)})}function oi(e,u,L,le){var Se=Object.create(Xt.prototype),xe=function(){},Le=function(){return r(void 0)},je=function(){return r(void 0)},qe=function(){return r(void 0)};u.start!==void 0&&(xe=function(){return u.start(Se)}),u.write!==void 0&&(Le=function(Ze){return u.write(Ze,Se)}),u.close!==void 0&&(je=function(){return u.close()}),u.abort!==void 0&&(qe=function(Ze){return u.abort(Ze)}),cr(e,Se,xe,Le,je,qe,L,le)}function gn(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function li(e){We(e,lr,0),mn(e)}function ci(e,u){try{return e._strategySizeAlgorithm(u)}catch(L){return Wn(e,L),1}}function ur(e){return e._strategyHWM-e._queueTotalSize}function ui(e,u,L){try{We(e,u,L)}catch(xe){Wn(e,xe);return}var le=e._controlledWritableStream;if(!Tt(le)&&le._state==="writable"){var Se=Un(e);Nn(le,Se)}mn(e)}function mn(e){var u=e._controlledWritableStream;if(e._started&&u._inFlightWriteRequest===void 0){var L=u._state;if(L==="erroring"){Fn(u);return}if(e._queue.length!==0){var le=Oe(e);le===lr?di(e):hi(e,le)}}}function Wn(e,u){e._controlledWritableStream._state==="writable"&&dr(e,u)}function di(e){var u=e._controlledWritableStream;ti(u),Ee(e);var L=e._closeAlgorithm();gn(e),c(L,function(){Jr(u)},function(le){Zr(u,le)})}function hi(e,u){var L=e._controlledWritableStream;ni(L);var le=e._writeAlgorithm(u);c(le,function(){qr(L);var Se=L._state;if(Ee(e),!Tt(L)&&Se==="writable"){var xe=Un(e);Nn(L,xe)}mn(e)},function(Se){L._state==="writable"&&gn(e),Qr(L,Se)})}function Un(e){var u=ur(e);return u<=0}function dr(e,u){var L=e._controlledWritableStream;gn(e),Ln(L,u)}function vn(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function Vn(e){return new TypeError("WritableStreamDefaultController.prototype."+e+" can only be used on a WritableStreamDefaultController")}function Vt(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function rn(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function bn(e){e._closedPromise=d(function(u,L){e._closedPromise_resolve=u,e._closedPromise_reject=L,e._closedPromiseState="pending"})}function hr(e,u){bn(e),zn(e,u)}function fi(e){bn(e),fr(e)}function zn(e,u){e._closedPromise_reject!==void 0&&(s(e._closedPromise),e._closedPromise_reject(u),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function pi(e,u){hr(e,u)}function fr(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function yn(e){e._readyPromise=d(function(u,L){e._readyPromise_resolve=u,e._readyPromise_reject=L}),e._readyPromiseState="pending"}function Gn(e,u){yn(e),gr(e,u)}function pr(e){yn(e),Hn(e)}function gr(e,u){e._readyPromise_reject!==void 0&&(s(e._readyPromise),e._readyPromise_reject(u),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function gi(e){yn(e)}function mi(e,u){Gn(e,u)}function Hn(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}var mr=typeof DOMException<"u"?DOMException:void 0;function vi(e){if(!(typeof e=="function"||typeof e=="object"))return!1;try{return new e,!0}catch{return!1}}function bi(){var e=function(L,le){this.message=L||"",this.name=le||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}var yi=vi(mr)?mr:bi();function vr(e,u,L,le,Se,xe){var Le=U(e),je=tr(u);e._disturbed=!0;var qe=!1,Ze=r(void 0);return d(function(et,tt){var pt;if(xe!==void 0){if(pt=function(){var Ye=new yi("Aborted","AbortError"),it=[];le||it.push(function(){return u._state==="writable"?fn(u,Ye):r(void 0)}),Se||it.push(function(){return e._state==="readable"?wt(e,Ye):r(void 0)}),_t(function(){return Promise.all(it.map(function(ut){return ut()}))},!0,Ye)},xe.aborted){pt();return}xe.addEventListener("abort",pt)}function Pt(){return d(function(Ye,it){function ut(xt){xt?Ye():o(qt(),ut,it)}ut(!1)})}function qt(){return qe?r(!0):o(je._readyPromise,function(){return d(function(Ye,it){be(Le,{_chunkSteps:function(ut){Ze=o(or(je,ut),void 0,v),Ye(!1)},_closeSteps:function(){return Ye(!0)},_errorSteps:it})})})}if(vt(e,Le._closedPromise,function(Ye){le?It(!0,Ye):_t(function(){return fn(u,Ye)},!0,Ye)}),vt(u,je._closedPromise,function(Ye){Se?It(!0,Ye):_t(function(){return wt(e,Ye)},!0,Ye)}),kt(e,Le._closedPromise,function(){L?It():_t(function(){return ii(je)})}),Tt(u)||u._state==="closed"){var Nt=new TypeError("the destination writable stream closed before all data could be piped to it");Se?It(!0,Nt):_t(function(){return wt(e,Nt)},!0,Nt)}s(Pt());function Rt(){var Ye=Ze;return o(Ze,function(){return Ye!==Ze?Rt():void 0})}function vt(Ye,it,ut){Ye._state==="errored"?ut(Ye._storedError):y(it,ut)}function kt(Ye,it,ut){Ye._state==="closed"?ut():b(it,ut)}function _t(Ye,it,ut){if(qe)return;qe=!0,u._state==="writable"&&!Tt(u)?b(Rt(),xt):xt();function xt(){c(Ye(),function(){return ct(it,ut)},function(Bt){return ct(!0,Bt)})}}function It(Ye,it){qe||(qe=!0,u._state==="writable"&&!Tt(u)?b(Rt(),function(){return ct(Ye,it)}):ct(Ye,it))}function ct(Ye,it){sr(je),G(Le),xe!==void 0&&xe.removeEventListener("abort",pt),Ye?tt(it):et(void 0)}})}var Yt=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!_n(this))throw wn("desiredSize");return jn(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!_n(this))throw wn("close");if(!Kt(this))throw new TypeError("The stream is not in a state that permits close");sn(this)},e.prototype.enqueue=function(u){if(u===void 0&&(u=void 0),!_n(this))throw wn("enqueue");if(!Kt(this))throw new TypeError("The stream is not in a state that permits enqueue");return An(this,u)},e.prototype.error=function(u){if(u===void 0&&(u=void 0),!_n(this))throw wn("error");Ot(this,u)},e.prototype[$]=function(u){$e(this);var L=this._cancelAlgorithm(u);return Sn(this),L},e.prototype[C]=function(u){var L=this._controlledReadableStream;if(this._queue.length>0){var le=Ee(this);this._closeRequested&&this._queue.length===0?(Sn(this),on(L)):an(this),u._chunkSteps(le)}else Z(L,u),an(this)},e}();Object.defineProperties(Yt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Yt.prototype,p.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function _n(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")?!1:e instanceof Yt}function an(e){var u=br(e);if(u){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;var L=e._pullAlgorithm();c(L,function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,an(e))},function(le){Ot(e,le)})}}function br(e){var u=e._controlledReadableStream;if(!Kt(e)||!e._started)return!1;if(Ft(u)&&ne(u)>0)return!0;var L=jn(e);return L>0}function Sn(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function sn(e){if(Kt(e)){var u=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Sn(e),on(u))}}function An(e,u){if(Kt(e)){var L=e._controlledReadableStream;if(Ft(L)&&ne(L)>0)se(L,u,!1);else{var le=void 0;try{le=e._strategySizeAlgorithm(u)}catch(Se){throw Ot(e,Se),Se}try{We(e,u,le)}catch(Se){throw Ot(e,Se),Se}}an(e)}}function Ot(e,u){var L=e._controlledReadableStream;L._state==="readable"&&($e(e),Sn(e),Ar(L,u))}function jn(e){var u=e._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:e._strategyHWM-e._queueTotalSize}function _i(e){return!br(e)}function Kt(e){var u=e._controlledReadableStream._state;return!e._closeRequested&&u==="readable"}function yr(e,u,L,le,Se,xe,Le){u._controlledReadableStream=e,u._queue=void 0,u._queueTotalSize=void 0,$e(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=Le,u._strategyHWM=xe,u._pullAlgorithm=le,u._cancelAlgorithm=Se,e._readableStreamController=u;var je=L();c(r(je),function(){u._started=!0,an(u)},function(qe){Ot(u,qe)})}function Si(e,u,L,le){var Se=Object.create(Yt.prototype),xe=function(){},Le=function(){return r(void 0)},je=function(){return r(void 0)};u.start!==void 0&&(xe=function(){return u.start(Se)}),u.pull!==void 0&&(Le=function(){return u.pull(Se)}),u.cancel!==void 0&&(je=function(qe){return u.cancel(qe)}),yr(e,Se,xe,Le,je,L,le)}function wn(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function Ai(e,u){return pe(e._readableStreamController)?Pi(e):wi(e)}function wi(e,u){var L=U(e),le=!1,Se=!1,xe=!1,Le=!1,je,qe,Ze,et,tt,pt=d(function(vt){tt=vt});function Pt(){if(le)return Se=!0,r(void 0);le=!0;var vt={_chunkSteps:function(kt){g(function(){Se=!1;var _t=kt,It=kt;xe||An(Ze._readableStreamController,_t),Le||An(et._readableStreamController,It),le=!1,Se&&Pt()})},_closeSteps:function(){le=!1,xe||sn(Ze._readableStreamController),Le||sn(et._readableStreamController),(!xe||!Le)&&tt(void 0)},_errorSteps:function(){le=!1}};return be(L,vt),r(void 0)}function qt(vt){if(xe=!0,je=vt,Le){var kt=Pe([je,qe]),_t=wt(e,kt);tt(_t)}return pt}function Nt(vt){if(Le=!0,qe=vt,xe){var kt=Pe([je,qe]),_t=wt(e,kt);tt(_t)}return pt}function Rt(){}return Ze=$n(Rt,Pt,qt),et=$n(Rt,Pt,Nt),y(L._closedPromise,function(vt){Ot(Ze._readableStreamController,vt),Ot(et._readableStreamController,vt),(!xe||!Le)&&tt(void 0)}),[Ze,et]}function Pi(e){var u=U(e),L=!1,le=!1,Se=!1,xe=!1,Le=!1,je,qe,Ze,et,tt,pt=d(function(ct){tt=ct});function Pt(ct){y(ct._closedPromise,function(Ye){ct===u&&(ht(Ze._readableStreamController,Ye),ht(et._readableStreamController,Ye),(!xe||!Le)&&tt(void 0))})}function qt(){Wt(u)&&(G(u),u=U(e),Pt(u));var ct={_chunkSteps:function(Ye){g(function(){le=!1,Se=!1;var it=Ye,ut=Ye;if(!xe&&!Le)try{ut=ce(Ye)}catch(xt){ht(Ze._readableStreamController,xt),ht(et._readableStreamController,xt),tt(wt(e,xt));return}xe||st(Ze._readableStreamController,it),Le||st(et._readableStreamController,ut),L=!1,le?Rt():Se&&vt()})},_closeSteps:function(){L=!1,xe||St(Ze._readableStreamController),Le||St(et._readableStreamController),Ze._readableStreamController._pendingPullIntos.length>0&&ft(Ze._readableStreamController,0),et._readableStreamController._pendingPullIntos.length>0&&ft(et._readableStreamController,0),(!xe||!Le)&&tt(void 0)},_errorSteps:function(){L=!1}};be(u,ct)}function Nt(ct,Ye){he(u)&&(G(u),u=qn(e),Pt(u));var it=Ye?et:Ze,ut=Ye?Ze:et,xt={_chunkSteps:function(Bt){g(function(){le=!1,Se=!1;var Qt=Ye?Le:xe,cn=Ye?xe:Le;if(cn)Qt||gt(it._readableStreamController,Bt);else{var Lr=void 0;try{Lr=ce(Bt)}catch(Yn){ht(it._readableStreamController,Yn),ht(ut._readableStreamController,Yn),tt(wt(e,Yn));return}Qt||gt(it._readableStreamController,Bt),st(ut._readableStreamController,Lr)}L=!1,le?Rt():Se&&vt()})},_closeSteps:function(Bt){L=!1;var Qt=Ye?Le:xe,cn=Ye?xe:Le;Qt||St(it._readableStreamController),cn||St(ut._readableStreamController),Bt!==void 0&&(Qt||gt(it._readableStreamController,Bt),!cn&&ut._readableStreamController._pendingPullIntos.length>0&&ft(ut._readableStreamController,0)),(!Qt||!cn)&&tt(void 0)},_errorSteps:function(){L=!1}};Zn(u,ct,xt)}function Rt(){if(L)return le=!0,r(void 0);L=!0;var ct=Ct(Ze._readableStreamController);return ct===null?qt():Nt(ct._view,!1),r(void 0)}function vt(){if(L)return Se=!0,r(void 0);L=!0;var ct=Ct(et._readableStreamController);return ct===null?qt():Nt(ct._view,!0),r(void 0)}function kt(ct){if(xe=!0,je=ct,Le){var Ye=Pe([je,qe]),it=wt(e,Ye);tt(it)}return pt}function _t(ct){if(Le=!0,qe=ct,xe){var Ye=Pe([je,qe]),it=wt(e,Ye);tt(it)}return pt}function It(){}return Ze=Sr(It,Rt,kt),et=Sr(It,vt,_t),Pt(u),[Ze,et]}function Ei(e,u){te(e,u);var L=e,le=L==null?void 0:L.autoAllocateChunkSize,Se=L==null?void 0:L.cancel,xe=L==null?void 0:L.pull,Le=L==null?void 0:L.start,je=L==null?void 0:L.type;return{autoAllocateChunkSize:le===void 0?void 0:O(le,u+" has member 'autoAllocateChunkSize' that"),cancel:Se===void 0?void 0:Ci(Se,L,u+" has member 'cancel' that"),pull:xe===void 0?void 0:Ti(xe,L,u+" has member 'pull' that"),start:Le===void 0?void 0:Ri(Le,L,u+" has member 'start' that"),type:je===void 0?void 0:ki(je,u+" has member 'type' that")}}function Ci(e,u,L){return K(e,L),function(le){return D(e,u,[le])}}function Ti(e,u,L){return K(e,L),function(le){return D(e,u,[le])}}function Ri(e,u,L){return K(e,L),function(le){return S(e,u,[le])}}function ki(e,u){if(e=""+e,e!=="bytes")throw new TypeError(u+" '"+e+"' is not a valid enumeration value for ReadableStreamType");return e}function xi(e,u){te(e,u);var L=e==null?void 0:e.mode;return{mode:L===void 0?void 0:Mi(L,u+" has member 'mode' that")}}function Mi(e,u){if(e=""+e,e!=="byob")throw new TypeError(u+" '"+e+"' is not a valid enumeration value for ReadableStreamReaderMode");return e}function Ii(e,u){te(e,u);var L=e==null?void 0:e.preventCancel;return{preventCancel:!!L}}function _r(e,u){te(e,u);var L=e==null?void 0:e.preventAbort,le=e==null?void 0:e.preventCancel,Se=e==null?void 0:e.preventClose,xe=e==null?void 0:e.signal;return xe!==void 0&&Oi(xe,u+" has member 'signal' that"),{preventAbort:!!L,preventCancel:!!le,preventClose:!!Se,signal:xe}}function Oi(e,u){if(!jr(e))throw new TypeError(u+" is not an AbortSignal.")}function Di(e,u){te(e,u);var L=e==null?void 0:e.readable;me(L,"readable","ReadableWritablePair"),M(L,u+" has member 'readable' that");var le=e==null?void 0:e.writable;return me(le,"writable","ReadableWritablePair"),er(le,u+" has member 'writable' that"),{readable:L,writable:le}}var Dt=function(){function e(u,L){u===void 0&&(u={}),L===void 0&&(L={}),u===void 0?u=null:fe(u,"First parameter");var le=hn(L,"Second parameter"),Se=Ei(u,"First parameter");if(Xn(this),Se.type==="bytes"){if(le.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");var xe=en(le,0);Ht(this,Se,xe)}else{var Le=dn(le),xe=en(le,1);Si(this,Se,xe,Le)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!Lt(this))throw zt("locked");return Ft(this)},enumerable:!1,configurable:!0}),e.prototype.cancel=function(u){return u===void 0&&(u=void 0),Lt(this)?Ft(this)?i(new TypeError("Cannot cancel a stream that already has a reader")):wt(this,u):i(zt("cancel"))},e.prototype.getReader=function(u){if(u===void 0&&(u=void 0),!Lt(this))throw zt("getReader");var L=xi(u,"First parameter");return L.mode===void 0?U(this):qn(this)},e.prototype.pipeThrough=function(u,L){if(L===void 0&&(L={}),!Lt(this))throw zt("pipeThrough");ye(u,1,"pipeThrough");var le=Di(u,"First parameter"),Se=_r(L,"Second parameter");if(Ft(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if($t(le.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var xe=vr(this,le.writable,Se.preventClose,Se.preventAbort,Se.preventCancel,Se.signal);return s(xe),le.readable},e.prototype.pipeTo=function(u,L){if(L===void 0&&(L={}),!Lt(this))return i(zt("pipeTo"));if(u===void 0)return i("Parameter 1 is required in 'pipeTo'.");if(!jt(u))return i(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var le;try{le=_r(L,"Second parameter")}catch(Se){return i(Se)}return Ft(this)?i(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):$t(u)?i(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):vr(this,u,le.preventClose,le.preventAbort,le.preventCancel,le.signal)},e.prototype.tee=function(){if(!Lt(this))throw zt("tee");var u=Ai(this);return Pe(u)},e.prototype.values=function(u){if(u===void 0&&(u=void 0),!Lt(this))throw zt("values");var L=Ii(u,"First parameter");return ae(this,L.preventCancel)},e}();Object.defineProperties(Dt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Dt.prototype,p.toStringTag,{value:"ReadableStream",configurable:!0}),typeof p.asyncIterator=="symbol"&&Object.defineProperty(Dt.prototype,p.asyncIterator,{value:Dt.prototype.values,writable:!0,configurable:!0});function $n(e,u,L,le,Se){le===void 0&&(le=1),Se===void 0&&(Se=function(){return 1});var xe=Object.create(Dt.prototype);Xn(xe);var Le=Object.create(Yt.prototype);return yr(xe,Le,e,u,L,le,Se),xe}function Sr(e,u,L){var le=Object.create(Dt.prototype);Xn(le);var Se=Object.create(J.prototype);return mt(le,Se,e,u,L,0,void 0),le}function Xn(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Lt(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")?!1:e instanceof Dt}function Ft(e){return e._reader!==void 0}function wt(e,u){if(e._disturbed=!0,e._state==="closed")return r(void 0);if(e._state==="errored")return i(e._storedError);on(e);var L=e._reader;L!==void 0&&Wt(L)&&(L._readIntoRequests.forEach(function(Se){Se._closeSteps(void 0)}),L._readIntoRequests=new x);var le=e._readableStreamController[$](u);return f(le,v)}function on(e){e._state="closed";var u=e._reader;u!==void 0&&(q(u),he(u)&&(u._readRequests.forEach(function(L){L._closeSteps()}),u._readRequests=new x))}function Ar(e,u){e._state="errored",e._storedError=u;var L=e._reader;L!==void 0&&(B(L,u),he(L)?(L._readRequests.forEach(function(le){le._errorSteps(u)}),L._readRequests=new x):(L._readIntoRequests.forEach(function(le){le._errorSteps(u)}),L._readIntoRequests=new x))}function zt(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function wr(e,u){te(e,u);var L=e==null?void 0:e.highWaterMark;return me(L,"highWaterMark","QueuingStrategyInit"),{highWaterMark:we(L)}}var Pr=function(e){return e.byteLength};try{Object.defineProperty(Pr,"name",{value:"size",configurable:!0})}catch{}var Pn=function(){function e(u){ye(u,1,"ByteLengthQueuingStrategy"),u=wr(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!Cr(this))throw Er("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!Cr(this))throw Er("size");return Pr},enumerable:!1,configurable:!0}),e}();Object.defineProperties(Pn.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Pn.prototype,p.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Er(e){return new TypeError("ByteLengthQueuingStrategy.prototype."+e+" can only be used on a ByteLengthQueuingStrategy")}function Cr(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")?!1:e instanceof Pn}var Tr=function(){return 1};try{Object.defineProperty(Tr,"name",{value:"size",configurable:!0})}catch{}var En=function(){function e(u){ye(u,1,"CountQueuingStrategy"),u=wr(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!kr(this))throw Rr("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!kr(this))throw Rr("size");return Tr},enumerable:!1,configurable:!0}),e}();Object.defineProperties(En.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(En.prototype,p.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Rr(e){return new TypeError("CountQueuingStrategy.prototype."+e+" can only be used on a CountQueuingStrategy")}function kr(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")?!1:e instanceof En}function Li(e,u){te(e,u);var L=e==null?void 0:e.flush,le=e==null?void 0:e.readableType,Se=e==null?void 0:e.start,xe=e==null?void 0:e.transform,Le=e==null?void 0:e.writableType;return{flush:L===void 0?void 0:Fi(L,e,u+" has member 'flush' that"),readableType:le,start:Se===void 0?void 0:Ni(Se,e,u+" has member 'start' that"),transform:xe===void 0?void 0:Bi(xe,e,u+" has member 'transform' that"),writableType:Le}}function Fi(e,u,L){return K(e,L),function(le){return D(e,u,[le])}}function Ni(e,u,L){return K(e,L),function(le){return S(e,u,[le])}}function Bi(e,u,L){return K(e,L),function(le,Se){return D(e,u,[le,Se])}}var Cn=function(){function e(u,L,le){u===void 0&&(u={}),L===void 0&&(L={}),le===void 0&&(le={}),u===void 0&&(u=null);var Se=hn(L,"Second parameter"),xe=hn(le,"Third parameter"),Le=Li(u,"First parameter");if(Le.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(Le.writableType!==void 0)throw new RangeError("Invalid writableType specified");var je=en(xe,0),qe=dn(xe),Ze=en(Se,1),et=dn(Se),tt,pt=d(function(Pt){tt=Pt});Wi(this,pt,Ze,et,je,qe),Vi(this,Le),Le.start!==void 0?tt(Le.start(this._transformStreamController)):tt(void 0)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!xr(this))throw Dr("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!xr(this))throw Dr("writable");return this._writable},enumerable:!1,configurable:!0}),e}();Object.defineProperties(Cn.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(Cn.prototype,p.toStringTag,{value:"TransformStream",configurable:!0});function Wi(e,u,L,le,Se,xe){function Le(){return u}function je(pt){return Hi(e,pt)}function qe(pt){return ji(e,pt)}function Ze(){return $i(e)}e._writable=Yr(Le,je,Ze,qe,L,le);function et(){return Xi(e)}function tt(pt){return Rn(e,pt),r(void 0)}e._readable=$n(Le,et,tt,Se,xe),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,kn(e,!0),e._transformStreamController=void 0}function xr(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")?!1:e instanceof Cn}function Tn(e,u){Ot(e._readable._readableStreamController,u),Rn(e,u)}function Rn(e,u){Mr(e._transformStreamController),Wn(e._writable._writableStreamController,u),e._backpressure&&kn(e,!1)}function kn(e,u){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=d(function(L){e._backpressureChangePromise_resolve=L}),e._backpressure=u}var ln=function(){function e(){throw new TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!xn(this))throw Mn("desiredSize");var u=this._controlledTransformStream._readable._readableStreamController;return jn(u)},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(u){if(u===void 0&&(u=void 0),!xn(this))throw Mn("enqueue");Ir(this,u)},e.prototype.error=function(u){if(u===void 0&&(u=void 0),!xn(this))throw Mn("error");zi(this,u)},e.prototype.terminate=function(){if(!xn(this))throw Mn("terminate");Gi(this)},e}();Object.defineProperties(ln.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof p.toStringTag=="symbol"&&Object.defineProperty(ln.prototype,p.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function xn(e){return!m(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")?!1:e instanceof ln}function Ui(e,u,L,le){u._controlledTransformStream=e,e._transformStreamController=u,u._transformAlgorithm=L,u._flushAlgorithm=le}function Vi(e,u){var L=Object.create(ln.prototype),le=function(xe){try{return Ir(L,xe),r(void 0)}catch(Le){return i(Le)}},Se=function(){return r(void 0)};u.transform!==void 0&&(le=function(xe){return u.transform(xe,L)}),u.flush!==void 0&&(Se=function(){return u.flush(L)}),Ui(e,L,le,Se)}function Mr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Ir(e,u){var L=e._controlledTransformStream,le=L._readable._readableStreamController;if(!Kt(le))throw new TypeError("Readable side is not in a state that permits enqueue");try{An(le,u)}catch(xe){throw Rn(L,xe),L._readable._storedError}var Se=_i(le);Se!==L._backpressure&&kn(L,!0)}function zi(e,u){Tn(e._controlledTransformStream,u)}function Or(e,u){var L=e._transformAlgorithm(u);return f(L,void 0,function(le){throw Tn(e._controlledTransformStream,le),le})}function Gi(e){var u=e._controlledTransformStream,L=u._readable._readableStreamController;sn(L);var le=new TypeError("TransformStream terminated");Rn(u,le)}function Hi(e,u){var L=e._transformStreamController;if(e._backpressure){var le=e._backpressureChangePromise;return f(le,function(){var Se=e._writable,xe=Se._state;if(xe==="erroring")throw Se._storedError;return Or(L,u)})}return Or(L,u)}function ji(e,u){return Tn(e,u),r(void 0)}function $i(e){var u=e._readable,L=e._transformStreamController,le=L._flushAlgorithm();return Mr(L),f(le,function(){if(u._state==="errored")throw u._storedError;sn(u._readableStreamController)},function(Se){throw Tn(e,Se),u._storedError})}function Xi(e){return kn(e,!1),e._backpressureChangePromise}function Mn(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function Dr(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}l.ByteLengthQueuingStrategy=Pn,l.CountQueuingStrategy=En,l.ReadableByteStreamController=J,l.ReadableStream=Dt,l.ReadableStreamBYOBReader=Zt,l.ReadableStreamBYOBRequest=oe,l.ReadableStreamDefaultController=Yt,l.ReadableStreamDefaultReader=ve,l.TransformStream=Cn,l.TransformStreamDefaultController=ln,l.WritableStream=tn,l.WritableStreamDefaultController=Xt,l.WritableStreamDefaultWriter=nn,Object.defineProperty(l,"__esModule",{value:!0})})}(ponyfill,ponyfillExports)),ponyfillExports}var hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,function(module,exports){(function(E,l){module.exports=l()})(globalThis,()=>(()=>{var __webpack_modules__=[,(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.VerbosityLevel=E.Util=E.UnknownErrorException=E.UnexpectedResponseException=E.UNSUPPORTED_FEATURES=E.TextRenderingMode=E.RenderingIntentFlag=E.PermissionFlag=E.PasswordResponses=E.PasswordException=E.PageActionEventType=E.OPS=E.MissingPDFException=E.LINE_FACTOR=E.LINE_DESCENT_FACTOR=E.InvalidPDFException=E.ImageKind=E.IDENTITY_MATRIX=E.FormatError=E.FeatureTest=E.FONT_IDENTITY_MATRIX=E.DocumentActionEventType=E.CMapCompressionType=E.BaseException=E.BASELINE_FACTOR=E.AnnotationType=E.AnnotationStateModelType=E.AnnotationReviewState=E.AnnotationReplyType=E.AnnotationMode=E.AnnotationMarkedState=E.AnnotationFlag=E.AnnotationFieldFlag=E.AnnotationEditorType=E.AnnotationEditorPrefix=E.AnnotationEditorParamsType=E.AnnotationBorderStyleType=E.AnnotationActionEventType=E.AbortException=void 0,E.assert=H,E.bytesToString=we,E.createPromiseCapability=Ve,E.createValidAbsoluteUrl=C,E.getModificationDate=He,E.getVerbosityLevel=B,E.info=ie,E.isArrayBuffer=Te,E.isArrayEqual=Ie,E.objectFromMap=M,E.objectSize=O,E.setVerbosityLevel=Y,E.shadow=P,E.string32=A,E.stringToBytes=ge,E.stringToPDFString=he,E.stringToUTF8String=be,E.unreachable=_,E.utf8StringToString=Ce,E.warn=q,globalThis._pdfjsCompatibilityChecked||(globalThis._pdfjsCompatibilityChecked=!0,l(2));const p=[1,0,0,1,0,0];E.IDENTITY_MATRIX=p;const v=[.001,0,0,.001,0,0];E.FONT_IDENTITY_MATRIX=v;const I=1.35;E.LINE_FACTOR=I;const k=.35;E.LINE_DESCENT_FACTOR=k;const m=k/I;E.BASELINE_FACTOR=m;const R={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};E.RenderingIntentFlag=R;const t={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};E.AnnotationMode=t;const n="pdfjs_internal_editor_";E.AnnotationEditorPrefix=n;const h={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};E.AnnotationEditorType=h;const a={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};E.AnnotationEditorParamsType=a;const d={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};E.PermissionFlag=d;const r={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};E.TextRenderingMode=r;const i={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};E.ImageKind=i;const o={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};E.AnnotationType=o;const c={MARKED:"Marked",REVIEW:"Review"};E.AnnotationStateModelType=c;const b={MARKED:"Marked",UNMARKED:"Unmarked"};E.AnnotationMarkedState=b;const y={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};E.AnnotationReviewState=y;const f={GROUP:"Group",REPLY:"R"};E.AnnotationReplyType=f;const s={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};E.AnnotationFlag=s;const g={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};E.AnnotationFieldFlag=g;const S={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};E.AnnotationBorderStyleType=S;const D={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};E.AnnotationActionEventType=D;const w={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};E.DocumentActionEventType=w;const x={O:"PageOpen",C:"PageClose"};E.PageActionEventType=x;const F={ERRORS:0,WARNINGS:1,INFOS:5};E.VerbosityLevel=F;const X={NONE:0,BINARY:1};E.CMapCompressionType=X;const G={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};E.OPS=G;const j={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};E.UNSUPPORTED_FEATURES=j;const N={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};E.PasswordResponses=N;let Q=F.WARNINGS;function Y(ae){Number.isInteger(ae)&&(Q=ae)}function B(){return Q}function ie(ae){Q>=F.INFOS&&console.log(`Info: ${ae}`)}function q(ae){Q>=F.WARNINGS&&console.log(`Warning: ${ae}`)}function _(ae){throw new Error(ae)}function H(ae,T){ae||_(T)}function $(ae){if(!ae)return!1;switch(ae.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function C(ae){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!ae)return null;try{if(V&&typeof ae=="string"){if(V.addDefaultProtocol&&ae.startsWith("www.")){const Pe=ae.match(/\./g);Pe&&Pe.length>=2&&(ae=`http://${ae}`)}if(V.tryConvertEncoding)try{ae=be(ae)}catch{}}const de=T?new URL(ae,T):new URL(ae);if($(de))return de}catch{}return null}function P(ae,T,V){let de=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(ae,T,{value:V,enumerable:!de,configurable:!0,writable:!1}),V}const z=function(){function T(V,de){this.constructor===T&&_("Cannot initialize BaseException."),this.message=V,this.name=de}return T.prototype=new Error,T.constructor=T,T}();E.BaseException=z;class ee extends z{constructor(T,V){super(T,"PasswordException"),this.code=V}}E.PasswordException=ee;class te extends z{constructor(T,V){super(T,"UnknownErrorException"),this.details=V}}E.UnknownErrorException=te;class K extends z{constructor(T){super(T,"InvalidPDFException")}}E.InvalidPDFException=K;class ue extends z{constructor(T){super(T,"MissingPDFException")}}E.MissingPDFException=ue;class fe extends z{constructor(T,V){super(T,"UnexpectedResponseException"),this.status=V}}E.UnexpectedResponseException=fe;class ye extends z{constructor(T){super(T,"FormatError")}}E.FormatError=ye;class me extends z{constructor(T){super(T,"AbortException")}}E.AbortException=me;function we(ae){(typeof ae!="object"||ae===null||ae.length===void 0)&&_("Invalid argument for bytesToString");const T=ae.length,V=8192;if(T<V)return String.fromCharCode.apply(null,ae);const de=[];for(let Pe=0;Pe<T;Pe+=V){const De=Math.min(Pe+V,T),Fe=ae.subarray(Pe,De);de.push(String.fromCharCode.apply(null,Fe))}return de.join("")}function ge(ae){typeof ae!="string"&&_("Invalid argument for stringToBytes");const T=ae.length,V=new Uint8Array(T);for(let de=0;de<T;++de)V[de]=ae.charCodeAt(de)&255;return V}function A(ae){return String.fromCharCode(ae>>24&255,ae>>16&255,ae>>8&255,ae&255)}function O(ae){return Object.keys(ae).length}function M(ae){const T=Object.create(null);for(const[V,de]of ae)T[V]=de;return T}function U(){const ae=new Uint8Array(4);return ae[0]=1,new Uint32Array(ae.buffer,0,1)[0]===1}function Z(){try{return new Function(""),!0}catch{return!1}}class se{static get isLittleEndian(){return P(this,"isLittleEndian",U())}static get isEvalSupported(){return P(this,"isEvalSupported",Z())}static get isOffscreenCanvasSupported(){return P(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?P(this,"platform",{isWin:!1,isMac:!1}):P(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}}E.FeatureTest=se;const ne=[...Array(256).keys()].map(ae=>ae.toString(16).padStart(2,"0"));class re{static makeHexColor(T,V,de){return`#${ne[T]}${ne[V]}${ne[de]}`}static scaleMinMax(T,V){let de;T[0]?(T[0]<0&&(de=V[0],V[0]=V[1],V[1]=de),V[0]*=T[0],V[1]*=T[0],T[3]<0&&(de=V[2],V[2]=V[3],V[3]=de),V[2]*=T[3],V[3]*=T[3]):(de=V[0],V[0]=V[2],V[2]=de,de=V[1],V[1]=V[3],V[3]=de,T[1]<0&&(de=V[2],V[2]=V[3],V[3]=de),V[2]*=T[1],V[3]*=T[1],T[2]<0&&(de=V[0],V[0]=V[1],V[1]=de),V[0]*=T[2],V[1]*=T[2]),V[0]+=T[4],V[1]+=T[4],V[2]+=T[5],V[3]+=T[5]}static transform(T,V){return[T[0]*V[0]+T[2]*V[1],T[1]*V[0]+T[3]*V[1],T[0]*V[2]+T[2]*V[3],T[1]*V[2]+T[3]*V[3],T[0]*V[4]+T[2]*V[5]+T[4],T[1]*V[4]+T[3]*V[5]+T[5]]}static applyTransform(T,V){const de=T[0]*V[0]+T[1]*V[2]+V[4],Pe=T[0]*V[1]+T[1]*V[3]+V[5];return[de,Pe]}static applyInverseTransform(T,V){const de=V[0]*V[3]-V[1]*V[2],Pe=(T[0]*V[3]-T[1]*V[2]+V[2]*V[5]-V[4]*V[3])/de,De=(-T[0]*V[1]+T[1]*V[0]+V[4]*V[1]-V[5]*V[0])/de;return[Pe,De]}static getAxialAlignedBoundingBox(T,V){const de=re.applyTransform(T,V),Pe=re.applyTransform(T.slice(2,4),V),De=re.applyTransform([T[0],T[3]],V),Fe=re.applyTransform([T[2],T[1]],V);return[Math.min(de[0],Pe[0],De[0],Fe[0]),Math.min(de[1],Pe[1],De[1],Fe[1]),Math.max(de[0],Pe[0],De[0],Fe[0]),Math.max(de[1],Pe[1],De[1],Fe[1])]}static inverseTransform(T){const V=T[0]*T[3]-T[1]*T[2];return[T[3]/V,-T[1]/V,-T[2]/V,T[0]/V,(T[2]*T[5]-T[4]*T[3])/V,(T[4]*T[1]-T[5]*T[0])/V]}static singularValueDecompose2dScale(T){const V=[T[0],T[2],T[1],T[3]],de=T[0]*V[0]+T[1]*V[2],Pe=T[0]*V[1]+T[1]*V[3],De=T[2]*V[0]+T[3]*V[2],Fe=T[2]*V[1]+T[3]*V[3],_e=(de+Fe)/2,Me=Math.sqrt((de+Fe)**2-4*(de*Fe-De*Pe))/2,Ae=_e+Me||1,ce=_e-Me||1;return[Math.sqrt(Ae),Math.sqrt(ce)]}static normalizeRect(T){const V=T.slice(0);return T[0]>T[2]&&(V[0]=T[2],V[2]=T[0]),T[1]>T[3]&&(V[1]=T[3],V[3]=T[1]),V}static intersect(T,V){const de=Math.max(Math.min(T[0],T[2]),Math.min(V[0],V[2])),Pe=Math.min(Math.max(T[0],T[2]),Math.max(V[0],V[2]));if(de>Pe)return null;const De=Math.max(Math.min(T[1],T[3]),Math.min(V[1],V[3])),Fe=Math.min(Math.max(T[1],T[3]),Math.max(V[1],V[3]));return De>Fe?null:[de,De,Pe,Fe]}static bezierBoundingBox(T,V,de,Pe,De,Fe,_e,Me){const Ae=[],ce=[[],[]];let Ee,We,Oe,$e,oe,J,pe,ke;for(let Ge=0;Ge<2;++Ge){if(Ge===0?(We=6*T-12*de+6*De,Ee=-3*T+9*de-9*De+3*_e,Oe=3*de-3*T):(We=6*V-12*Pe+6*Fe,Ee=-3*V+9*Pe-9*Fe+3*Me,Oe=3*Pe-3*V),Math.abs(Ee)<1e-12){if(Math.abs(We)<1e-12)continue;$e=-Oe/We,0<$e&&$e<1&&Ae.push($e);continue}pe=We*We-4*Oe*Ee,ke=Math.sqrt(pe),!(pe<0)&&(oe=(-We+ke)/(2*Ee),0<oe&&oe<1&&Ae.push(oe),J=(-We-ke)/(2*Ee),0<J&&J<1&&Ae.push(J))}let Re=Ae.length,Be;const Ne=Re;for(;Re--;)$e=Ae[Re],Be=1-$e,ce[0][Re]=Be*Be*Be*T+3*Be*Be*$e*de+3*Be*$e*$e*De+$e*$e*$e*_e,ce[1][Re]=Be*Be*Be*V+3*Be*Be*$e*Pe+3*Be*$e*$e*Fe+$e*$e*$e*Me;return ce[0][Ne]=T,ce[1][Ne]=V,ce[0][Ne+1]=_e,ce[1][Ne+1]=Me,ce[0].length=ce[1].length=Ne+2,[Math.min(...ce[0]),Math.min(...ce[1]),Math.max(...ce[0]),Math.max(...ce[1])]}}E.Util=re;const ve=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function he(ae){if(ae[0]>="ï"){let V;if(ae[0]==="þ"&&ae[1]==="ÿ"?V="utf-16be":ae[0]==="ÿ"&&ae[1]==="þ"?V="utf-16le":ae[0]==="ï"&&ae[1]==="»"&&ae[2]==="¿"&&(V="utf-8"),V)try{const de=new TextDecoder(V,{fatal:!0}),Pe=ge(ae);return de.decode(Pe)}catch(de){q(`stringToPDFString: "${de}".`)}}const T=[];for(let V=0,de=ae.length;V<de;V++){const Pe=ve[ae.charCodeAt(V)];T.push(Pe?String.fromCharCode(Pe):ae.charAt(V))}return T.join("")}function be(ae){return decodeURIComponent(escape(ae))}function Ce(ae){return unescape(encodeURIComponent(ae))}function Te(ae){return typeof ae=="object"&&ae!==null&&ae.byteLength!==void 0}function Ie(ae,T){if(ae.length!==T.length)return!1;for(let V=0,de=ae.length;V<de;V++)if(ae[V]!==T[V])return!1;return!0}function He(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[ae.getUTCFullYear().toString(),(ae.getUTCMonth()+1).toString().padStart(2,"0"),ae.getUTCDate().toString().padStart(2,"0"),ae.getUTCHours().toString().padStart(2,"0"),ae.getUTCMinutes().toString().padStart(2,"0"),ae.getUTCSeconds().toString().padStart(2,"0")].join("")}function Ve(){const ae=Object.create(null);let T=!1;return Object.defineProperty(ae,"settled",{get(){return T}}),ae.promise=new Promise(function(V,de){ae.resolve=function(Pe){T=!0,V(Pe)},ae.reject=function(Pe){T=!0,de(Pe)}}),ae}},(W,E,l)=>{var p=l(3);(function(){globalThis.btoa||!p.isNodeJS||(globalThis.btoa=function(I){return Buffer.from(I,"binary").toString("base64")})})(),function(){globalThis.atob||!p.isNodeJS||(globalThis.atob=function(I){return Buffer.from(I,"base64").toString("binary")})}(),function(){globalThis.DOMMatrix||!p.isNodeJS||(globalThis.DOMMatrix=require$$7.DOMMatrix)}(),function(){if(globalThis.Path2D||!p.isNodeJS)return;const{CanvasRenderingContext2D:I}=require$$7,{polyfillPath2D:k}=requirePath2dPolyfill_min();globalThis.CanvasRenderingContext2D=I,k(globalThis)}(),function(){globalThis.ReadableStream||!p.isNodeJS||(globalThis.ReadableStream=requirePonyfill().ReadableStream)}(),function(){Array.prototype.at||l(4)}(),function(){Uint8Array.prototype.at||l(78)}(),function(){globalThis.structuredClone||l(88)}()},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.isNodeJS=void 0;const l=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");E.isNodeJS=l},(W,E,l)=>{l(5);var p=l(77);W.exports=p("Array","at")},(W,E,l)=>{var p=l(6),v=l(43),I=l(67),k=l(65),m=l(72);p({target:"Array",proto:!0},{at:function(t){var n=v(this),h=I(n),a=k(t),d=a>=0?a:h+a;return d<0||d>=h?void 0:n[d]}}),m("at")},(W,E,l)=>{var p=l(7),v=l(8).f,I=l(47),k=l(51),m=l(41),R=l(59),t=l(71);W.exports=function(n,h){var a=n.target,d=n.global,r=n.stat,i,o,c,b,y,f;if(d?o=p:r?o=p[a]||m(a,{}):o=(p[a]||{}).prototype,o)for(c in h){if(y=h[c],n.dontCallGetSet?(f=v(o,c),b=f&&f.value):b=o[c],i=t(d?c:a+(r?".":"#")+c,n.forced),!i&&b!==void 0){if(typeof y==typeof b)continue;R(y,b)}(n.sham||b&&b.sham)&&I(y,"sham",!0),k(o,c,y,n)}}},W=>{var E=function(l){return l&&l.Math==Math&&l};W.exports=E(typeof globalThis=="object"&&globalThis)||E(typeof window=="object"&&window)||E(typeof self=="object"&&self)||E(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||Function("return this")()},(W,E,l)=>{var p=l(9),v=l(11),I=l(13),k=l(14),m=l(15),R=l(21),t=l(42),n=l(45),h=Object.getOwnPropertyDescriptor;E.f=p?h:function(d,r){if(d=m(d),r=R(r),n)try{return h(d,r)}catch{}if(t(d,r))return k(!v(I.f,d,r),d[r])}},(W,E,l)=>{var p=l(10);W.exports=!p(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},W=>{W.exports=function(E){try{return!!E()}catch{return!0}}},(W,E,l)=>{var p=l(12),v=Function.prototype.call;W.exports=p?v.bind(v):function(){return v.apply(v,arguments)}},(W,E,l)=>{var p=l(10);W.exports=!p(function(){var v=function(){}.bind();return typeof v!="function"||v.hasOwnProperty("prototype")})},(W,E)=>{var l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,v=p&&!l.call({1:2},1);E.f=v?function(k){var m=p(this,k);return!!m&&m.enumerable}:l},W=>{W.exports=function(E,l){return{enumerable:!(E&1),configurable:!(E&2),writable:!(E&4),value:l}}},(W,E,l)=>{var p=l(16),v=l(19);W.exports=function(I){return p(v(I))}},(W,E,l)=>{var p=l(17),v=l(10),I=l(18),k=Object,m=p("".split);W.exports=v(function(){return!k("z").propertyIsEnumerable(0)})?function(R){return I(R)=="String"?m(R,""):k(R)}:k},(W,E,l)=>{var p=l(12),v=Function.prototype,I=v.call,k=p&&v.bind.bind(I,I);W.exports=p?k:function(m){return function(){return I.apply(m,arguments)}}},(W,E,l)=>{var p=l(17),v=p({}.toString),I=p("".slice);W.exports=function(k){return I(v(k),8,-1)}},(W,E,l)=>{var p=l(20),v=TypeError;W.exports=function(I){if(p(I))throw v("Can't call method on "+I);return I}},W=>{W.exports=function(E){return E==null}},(W,E,l)=>{var p=l(22),v=l(26);W.exports=function(I){var k=p(I,"string");return v(k)?k:k+""}},(W,E,l)=>{var p=l(11),v=l(23),I=l(26),k=l(33),m=l(36),R=l(37),t=TypeError,n=R("toPrimitive");W.exports=function(h,a){if(!v(h)||I(h))return h;var d=k(h,n),r;if(d){if(a===void 0&&(a="default"),r=p(d,h,a),!v(r)||I(r))return r;throw t("Can't convert object to primitive value")}return a===void 0&&(a="number"),m(h,a)}},(W,E,l)=>{var p=l(24),v=l(25),I=v.all;W.exports=v.IS_HTMLDDA?function(k){return typeof k=="object"?k!==null:p(k)||k===I}:function(k){return typeof k=="object"?k!==null:p(k)}},(W,E,l)=>{var p=l(25),v=p.all;W.exports=p.IS_HTMLDDA?function(I){return typeof I=="function"||I===v}:function(I){return typeof I=="function"}},W=>{var E=typeof document=="object"&&document.all,l=typeof E>"u"&&E!==void 0;W.exports={all:E,IS_HTMLDDA:l}},(W,E,l)=>{var p=l(27),v=l(24),I=l(28),k=l(29),m=Object;W.exports=k?function(R){return typeof R=="symbol"}:function(R){var t=p("Symbol");return v(t)&&I(t.prototype,m(R))}},(W,E,l)=>{var p=l(7),v=l(24),I=function(k){return v(k)?k:void 0};W.exports=function(k,m){return arguments.length<2?I(p[k]):p[k]&&p[k][m]}},(W,E,l)=>{var p=l(17);W.exports=p({}.isPrototypeOf)},(W,E,l)=>{var p=l(30);W.exports=p&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(W,E,l)=>{var p=l(31),v=l(10);W.exports=!!Object.getOwnPropertySymbols&&!v(function(){var I=Symbol();return!String(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&p&&p<41})},(W,E,l)=>{var p=l(7),v=l(32),I=p.process,k=p.Deno,m=I&&I.versions||k&&k.version,R=m&&m.v8,t,n;R&&(t=R.split("."),n=t[0]>0&&t[0]<4?1:+(t[0]+t[1])),!n&&v&&(t=v.match(/Edge\/(\d+)/),(!t||t[1]>=74)&&(t=v.match(/Chrome\/(\d+)/),t&&(n=+t[1]))),W.exports=n},W=>{W.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(W,E,l)=>{var p=l(34),v=l(20);W.exports=function(I,k){var m=I[k];return v(m)?void 0:p(m)}},(W,E,l)=>{var p=l(24),v=l(35),I=TypeError;W.exports=function(k){if(p(k))return k;throw I(v(k)+" is not a function")}},W=>{var E=String;W.exports=function(l){try{return E(l)}catch{return"Object"}}},(W,E,l)=>{var p=l(11),v=l(24),I=l(23),k=TypeError;W.exports=function(m,R){var t,n;if(R==="string"&&v(t=m.toString)&&!I(n=p(t,m))||v(t=m.valueOf)&&!I(n=p(t,m))||R!=="string"&&v(t=m.toString)&&!I(n=p(t,m)))return n;throw k("Can't convert object to primitive value")}},(W,E,l)=>{var p=l(7),v=l(38),I=l(42),k=l(44),m=l(30),R=l(29),t=p.Symbol,n=v("wks"),h=R?t.for||t:t&&t.withoutSetter||k;W.exports=function(a){return I(n,a)||(n[a]=m&&I(t,a)?t[a]:h("Symbol."+a)),n[a]}},(W,E,l)=>{var p=l(39),v=l(40);(W.exports=function(I,k){return v[I]||(v[I]=k!==void 0?k:{})})("versions",[]).push({version:"3.27.2",mode:p?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})},W=>{W.exports=!1},(W,E,l)=>{var p=l(7),v=l(41),I="__core-js_shared__",k=p[I]||v(I,{});W.exports=k},(W,E,l)=>{var p=l(7),v=Object.defineProperty;W.exports=function(I,k){try{v(p,I,{value:k,configurable:!0,writable:!0})}catch{p[I]=k}return k}},(W,E,l)=>{var p=l(17),v=l(43),I=p({}.hasOwnProperty);W.exports=Object.hasOwn||function(m,R){return I(v(m),R)}},(W,E,l)=>{var p=l(19),v=Object;W.exports=function(I){return v(p(I))}},(W,E,l)=>{var p=l(17),v=0,I=Math.random(),k=p(1 .toString);W.exports=function(m){return"Symbol("+(m===void 0?"":m)+")_"+k(++v+I,36)}},(W,E,l)=>{var p=l(9),v=l(10),I=l(46);W.exports=!p&&!v(function(){return Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a!=7})},(W,E,l)=>{var p=l(7),v=l(23),I=p.document,k=v(I)&&v(I.createElement);W.exports=function(m){return k?I.createElement(m):{}}},(W,E,l)=>{var p=l(9),v=l(48),I=l(14);W.exports=p?function(k,m,R){return v.f(k,m,I(1,R))}:function(k,m,R){return k[m]=R,k}},(W,E,l)=>{var p=l(9),v=l(45),I=l(49),k=l(50),m=l(21),R=TypeError,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,h="enumerable",a="configurable",d="writable";E.f=p?I?function(i,o,c){if(k(i),o=m(o),k(c),typeof i=="function"&&o==="prototype"&&"value"in c&&d in c&&!c[d]){var b=n(i,o);b&&b[d]&&(i[o]=c.value,c={configurable:a in c?c[a]:b[a],enumerable:h in c?c[h]:b[h],writable:!1})}return t(i,o,c)}:t:function(i,o,c){if(k(i),o=m(o),k(c),v)try{return t(i,o,c)}catch{}if("get"in c||"set"in c)throw R("Accessors not supported");return"value"in c&&(i[o]=c.value),i}},(W,E,l)=>{var p=l(9),v=l(10);W.exports=p&&v(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})},(W,E,l)=>{var p=l(23),v=String,I=TypeError;W.exports=function(k){if(p(k))return k;throw I(v(k)+" is not an object")}},(W,E,l)=>{var p=l(24),v=l(48),I=l(52),k=l(41);W.exports=function(m,R,t,n){n||(n={});var h=n.enumerable,a=n.name!==void 0?n.name:R;if(p(t)&&I(t,a,n),n.global)h?m[R]=t:k(R,t);else{try{n.unsafe?m[R]&&(h=!0):delete m[R]}catch{}h?m[R]=t:v.f(m,R,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return m}},(W,E,l)=>{var p=l(17),v=l(10),I=l(24),k=l(42),m=l(9),R=l(53).CONFIGURABLE,t=l(54),n=l(55),h=n.enforce,a=n.get,d=String,r=Object.defineProperty,i=p("".slice),o=p("".replace),c=p([].join),b=m&&!v(function(){return r(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),f=W.exports=function(s,g,S){i(d(g),0,7)==="Symbol("&&(g="["+o(d(g),/^Symbol\(([^)]*)\)/,"$1")+"]"),S&&S.getter&&(g="get "+g),S&&S.setter&&(g="set "+g),(!k(s,"name")||R&&s.name!==g)&&(m?r(s,"name",{value:g,configurable:!0}):s.name=g),b&&S&&k(S,"arity")&&s.length!==S.arity&&r(s,"length",{value:S.arity});try{S&&k(S,"constructor")&&S.constructor?m&&r(s,"prototype",{writable:!1}):s.prototype&&(s.prototype=void 0)}catch{}var D=h(s);return k(D,"source")||(D.source=c(y,typeof g=="string"?g:"")),s};Function.prototype.toString=f(function(){return I(this)&&a(this).source||t(this)},"toString")},(W,E,l)=>{var p=l(9),v=l(42),I=Function.prototype,k=p&&Object.getOwnPropertyDescriptor,m=v(I,"name"),R=m&&function(){}.name==="something",t=m&&(!p||p&&k(I,"name").configurable);W.exports={EXISTS:m,PROPER:R,CONFIGURABLE:t}},(W,E,l)=>{var p=l(17),v=l(24),I=l(40),k=p(Function.toString);v(I.inspectSource)||(I.inspectSource=function(m){return k(m)}),W.exports=I.inspectSource},(W,E,l)=>{var p=l(56),v=l(7),I=l(23),k=l(47),m=l(42),R=l(40),t=l(57),n=l(58),h="Object already initialized",a=v.TypeError,d=v.WeakMap,r,i,o,c=function(s){return o(s)?i(s):r(s,{})},b=function(s){return function(g){var S;if(!I(g)||(S=i(g)).type!==s)throw a("Incompatible receiver, "+s+" required");return S}};if(p||R.state){var y=R.state||(R.state=new d);y.get=y.get,y.has=y.has,y.set=y.set,r=function(s,g){if(y.has(s))throw a(h);return g.facade=s,y.set(s,g),g},i=function(s){return y.get(s)||{}},o=function(s){return y.has(s)}}else{var f=t("state");n[f]=!0,r=function(s,g){if(m(s,f))throw a(h);return g.facade=s,k(s,f,g),g},i=function(s){return m(s,f)?s[f]:{}},o=function(s){return m(s,f)}}W.exports={set:r,get:i,has:o,enforce:c,getterFor:b}},(W,E,l)=>{var p=l(7),v=l(24),I=p.WeakMap;W.exports=v(I)&&/native code/.test(String(I))},(W,E,l)=>{var p=l(38),v=l(44),I=p("keys");W.exports=function(k){return I[k]||(I[k]=v(k))}},W=>{W.exports={}},(W,E,l)=>{var p=l(42),v=l(60),I=l(8),k=l(48);W.exports=function(m,R,t){for(var n=v(R),h=k.f,a=I.f,d=0;d<n.length;d++){var r=n[d];!p(m,r)&&!(t&&p(t,r))&&h(m,r,a(R,r))}}},(W,E,l)=>{var p=l(27),v=l(17),I=l(61),k=l(70),m=l(50),R=v([].concat);W.exports=p("Reflect","ownKeys")||function(n){var h=I.f(m(n)),a=k.f;return a?R(h,a(n)):h}},(W,E,l)=>{var p=l(62),v=l(69),I=v.concat("length","prototype");E.f=Object.getOwnPropertyNames||function(m){return p(m,I)}},(W,E,l)=>{var p=l(17),v=l(42),I=l(15),k=l(63).indexOf,m=l(58),R=p([].push);W.exports=function(t,n){var h=I(t),a=0,d=[],r;for(r in h)!v(m,r)&&v(h,r)&&R(d,r);for(;n.length>a;)v(h,r=n[a++])&&(~k(d,r)||R(d,r));return d}},(W,E,l)=>{var p=l(15),v=l(64),I=l(67),k=function(m){return function(R,t,n){var h=p(R),a=I(h),d=v(n,a),r;if(m&&t!=t){for(;a>d;)if(r=h[d++],r!=r)return!0}else for(;a>d;d++)if((m||d in h)&&h[d]===t)return m||d||0;return!m&&-1}};W.exports={includes:k(!0),indexOf:k(!1)}},(W,E,l)=>{var p=l(65),v=Math.max,I=Math.min;W.exports=function(k,m){var R=p(k);return R<0?v(R+m,0):I(R,m)}},(W,E,l)=>{var p=l(66);W.exports=function(v){var I=+v;return I!==I||I===0?0:p(I)}},W=>{var E=Math.ceil,l=Math.floor;W.exports=Math.trunc||function(v){var I=+v;return(I>0?l:E)(I)}},(W,E,l)=>{var p=l(68);W.exports=function(v){return p(v.length)}},(W,E,l)=>{var p=l(65),v=Math.min;W.exports=function(I){return I>0?v(p(I),9007199254740991):0}},W=>{W.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(W,E)=>{E.f=Object.getOwnPropertySymbols},(W,E,l)=>{var p=l(10),v=l(24),I=/#|\.prototype\./,k=function(h,a){var d=R[m(h)];return d==n?!0:d==t?!1:v(a)?p(a):!!a},m=k.normalize=function(h){return String(h).replace(I,".").toLowerCase()},R=k.data={},t=k.NATIVE="N",n=k.POLYFILL="P";W.exports=k},(W,E,l)=>{var p=l(37),v=l(73),I=l(48).f,k=p("unscopables"),m=Array.prototype;m[k]==null&&I(m,k,{configurable:!0,value:v(null)}),W.exports=function(R){m[k][R]=!0}},(W,E,l)=>{var p=l(50),v=l(74),I=l(69),k=l(58),m=l(76),R=l(46),t=l(57),n=">",h="<",a="prototype",d="script",r=t("IE_PROTO"),i=function(){},o=function(s){return h+d+n+s+h+"/"+d+n},c=function(s){s.write(o("")),s.close();var g=s.parentWindow.Object;return s=null,g},b=function(){var s=R("iframe"),g="java"+d+":",S;return s.style.display="none",m.appendChild(s),s.src=String(g),S=s.contentWindow.document,S.open(),S.write(o("document.F=Object")),S.close(),S.F},y,f=function(){try{y=new ActiveXObject("htmlfile")}catch{}f=typeof document<"u"?document.domain&&y?c(y):b():c(y);for(var s=I.length;s--;)delete f[a][I[s]];return f()};k[r]=!0,W.exports=Object.create||function(g,S){var D;return g!==null?(i[a]=p(g),D=new i,i[a]=null,D[r]=g):D=f(),S===void 0?D:v.f(D,S)}},(W,E,l)=>{var p=l(9),v=l(49),I=l(48),k=l(50),m=l(15),R=l(75);E.f=p&&!v?Object.defineProperties:function(n,h){k(n);for(var a=m(h),d=R(h),r=d.length,i=0,o;r>i;)I.f(n,o=d[i++],a[o]);return n}},(W,E,l)=>{var p=l(62),v=l(69);W.exports=Object.keys||function(k){return p(k,v)}},(W,E,l)=>{var p=l(27);W.exports=p("document","documentElement")},(W,E,l)=>{var p=l(7),v=l(17);W.exports=function(I,k){return v(p[I].prototype[k])}},(W,E,l)=>{l(79)},(W,E,l)=>{var p=l(80),v=l(67),I=l(65),k=p.aTypedArray,m=p.exportTypedArrayMethod;m("at",function(t){var n=k(this),h=v(n),a=I(t),d=a>=0?a:h+a;return d<0||d>=h?void 0:n[d]})},(W,E,l)=>{var p=l(81),v=l(9),I=l(7),k=l(24),m=l(23),R=l(42),t=l(82),n=l(35),h=l(47),a=l(51),d=l(48).f,r=l(28),i=l(84),o=l(86),c=l(37),b=l(44),y=l(55),f=y.enforce,s=y.get,g=I.Int8Array,S=g&&g.prototype,D=I.Uint8ClampedArray,w=D&&D.prototype,x=g&&i(g),F=S&&i(S),X=Object.prototype,G=I.TypeError,j=c("toStringTag"),N=b("TYPED_ARRAY_TAG"),Q="TypedArrayConstructor",Y=p&&!!o&&t(I.opera)!=="Opera",B=!1,ie,q,_,H={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},$={BigInt64Array:8,BigUint64Array:8},C=function(ye){if(!m(ye))return!1;var me=t(ye);return me==="DataView"||R(H,me)||R($,me)},P=function(fe){var ye=i(fe);if(m(ye)){var me=s(ye);return me&&R(me,Q)?me[Q]:P(ye)}},z=function(fe){if(!m(fe))return!1;var ye=t(fe);return R(H,ye)||R($,ye)},ee=function(fe){if(z(fe))return fe;throw G("Target is not a typed array")},te=function(fe){if(k(fe)&&(!o||r(x,fe)))return fe;throw G(n(fe)+" is not a typed array constructor")},K=function(fe,ye,me,we){if(v){if(me)for(var ge in H){var A=I[ge];if(A&&R(A.prototype,fe))try{delete A.prototype[fe]}catch{try{A.prototype[fe]=ye}catch{}}}(!F[fe]||me)&&a(F,fe,me?ye:Y&&S[fe]||ye,we)}},ue=function(fe,ye,me){var we,ge;if(v){if(o){if(me){for(we in H)if(ge=I[we],ge&&R(ge,fe))try{delete ge[fe]}catch{}}if(!x[fe]||me)try{return a(x,fe,me?ye:Y&&x[fe]||ye)}catch{}else return}for(we in H)ge=I[we],ge&&(!ge[fe]||me)&&a(ge,fe,ye)}};for(ie in H)q=I[ie],_=q&&q.prototype,_?f(_)[Q]=q:Y=!1;for(ie in $)q=I[ie],_=q&&q.prototype,_&&(f(_)[Q]=q);if((!Y||!k(x)||x===Function.prototype)&&(x=function(){throw G("Incorrect invocation")},Y))for(ie in H)I[ie]&&o(I[ie],x);if((!Y||!F||F===X)&&(F=x.prototype,Y))for(ie in H)I[ie]&&o(I[ie].prototype,F);if(Y&&i(w)!==F&&o(w,F),v&&!R(F,j)){B=!0,d(F,j,{get:function(){return m(this)?this[N]:void 0}});for(ie in H)I[ie]&&h(I[ie],N,ie)}W.exports={NATIVE_ARRAY_BUFFER_VIEWS:Y,TYPED_ARRAY_TAG:B&&N,aTypedArray:ee,aTypedArrayConstructor:te,exportTypedArrayMethod:K,exportTypedArrayStaticMethod:ue,getTypedArrayConstructor:P,isView:C,isTypedArray:z,TypedArray:x,TypedArrayPrototype:F}},W=>{W.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(W,E,l)=>{var p=l(83),v=l(24),I=l(18),k=l(37),m=k("toStringTag"),R=Object,t=I(function(){return arguments}())=="Arguments",n=function(h,a){try{return h[a]}catch{}};W.exports=p?I:function(h){var a,d,r;return h===void 0?"Undefined":h===null?"Null":typeof(d=n(a=R(h),m))=="string"?d:t?I(a):(r=I(a))=="Object"&&v(a.callee)?"Arguments":r}},(W,E,l)=>{var p=l(37),v=p("toStringTag"),I={};I[v]="z",W.exports=String(I)==="[object z]"},(W,E,l)=>{var p=l(42),v=l(24),I=l(43),k=l(57),m=l(85),R=k("IE_PROTO"),t=Object,n=t.prototype;W.exports=m?t.getPrototypeOf:function(h){var a=I(h);if(p(a,R))return a[R];var d=a.constructor;return v(d)&&a instanceof d?d.prototype:a instanceof t?n:null}},(W,E,l)=>{var p=l(10);W.exports=!p(function(){function v(){}return v.prototype.constructor=null,Object.getPrototypeOf(new v)!==v.prototype})},(W,E,l)=>{var p=l(17),v=l(50),I=l(87);W.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var k=!1,m={},R;try{R=p(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),R(m,[]),k=m instanceof Array}catch{}return function(n,h){return v(n),I(h),k?R(n,h):n.__proto__=h,n}}():void 0)},(W,E,l)=>{var p=l(24),v=String,I=TypeError;W.exports=function(k){if(typeof k=="object"||p(k))return k;throw I("Can't set "+v(k)+" as a prototype")}},(W,E,l)=>{l(89),l(96),l(98),l(121),l(123);var p=l(134);W.exports=p.structuredClone},(W,E,l)=>{var p=l(15),v=l(72),I=l(90),k=l(55),m=l(48).f,R=l(91),t=l(95),n=l(39),h=l(9),a="Array Iterator",d=k.set,r=k.getterFor(a);W.exports=R(Array,"Array",function(o,c){d(this,{type:a,target:p(o),index:0,kind:c})},function(){var o=r(this),c=o.target,b=o.kind,y=o.index++;return!c||y>=c.length?(o.target=void 0,t(void 0,!0)):b=="keys"?t(y,!1):b=="values"?t(c[y],!1):t([y,c[y]],!1)},"values");var i=I.Arguments=I.Array;if(v("keys"),v("values"),v("entries"),!n&&h&&i.name!=="values")try{m(i,"name",{value:"values"})}catch{}},W=>{W.exports={}},(W,E,l)=>{var p=l(6),v=l(11),I=l(39),k=l(53),m=l(24),R=l(92),t=l(84),n=l(86),h=l(94),a=l(47),d=l(51),r=l(37),i=l(90),o=l(93),c=k.PROPER,b=k.CONFIGURABLE,y=o.IteratorPrototype,f=o.BUGGY_SAFARI_ITERATORS,s=r("iterator"),g="keys",S="values",D="entries",w=function(){return this};W.exports=function(x,F,X,G,j,N,Q){R(X,F,G);var Y=function(ee){if(ee===j&&H)return H;if(!f&&ee in q)return q[ee];switch(ee){case g:return function(){return new X(this,ee)};case S:return function(){return new X(this,ee)};case D:return function(){return new X(this,ee)}}return function(){return new X(this)}},B=F+" Iterator",ie=!1,q=x.prototype,_=q[s]||q["@@iterator"]||j&&q[j],H=!f&&_||Y(j),$=F=="Array"&&q.entries||_,C,P,z;if($&&(C=t($.call(new x)),C!==Object.prototype&&C.next&&(!I&&t(C)!==y&&(n?n(C,y):m(C[s])||d(C,s,w)),h(C,B,!0,!0),I&&(i[B]=w))),c&&j==S&&_&&_.name!==S&&(!I&&b?a(q,"name",S):(ie=!0,H=function(){return v(_,this)})),j)if(P={values:Y(S),keys:N?H:Y(g),entries:Y(D)},Q)for(z in P)(f||ie||!(z in q))&&d(q,z,P[z]);else p({target:F,proto:!0,forced:f||ie},P);return(!I||Q)&&q[s]!==H&&d(q,s,H,{name:j}),i[F]=H,P}},(W,E,l)=>{var p=l(93).IteratorPrototype,v=l(73),I=l(14),k=l(94),m=l(90),R=function(){return this};W.exports=function(t,n,h,a){var d=n+" Iterator";return t.prototype=v(p,{next:I(+!a,h)}),k(t,d,!1,!0),m[d]=R,t}},(W,E,l)=>{var p=l(10),v=l(24),I=l(23),k=l(73),m=l(84),R=l(51),t=l(37),n=l(39),h=t("iterator"),a=!1,d,r,i;[].keys&&(i=[].keys(),"next"in i?(r=m(m(i)),r!==Object.prototype&&(d=r)):a=!0);var o=!I(d)||p(function(){var c={};return d[h].call(c)!==c});o?d={}:n&&(d=k(d)),v(d[h])||R(d,h,function(){return this}),W.exports={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:a}},(W,E,l)=>{var p=l(48).f,v=l(42),I=l(37),k=I("toStringTag");W.exports=function(m,R,t){m&&!t&&(m=m.prototype),m&&!v(m,k)&&p(m,k,{configurable:!0,value:R})}},W=>{W.exports=function(E,l){return{value:E,done:l}}},(W,E,l)=>{var p=l(83),v=l(51),I=l(97);p||v(Object.prototype,"toString",I,{unsafe:!0})},(W,E,l)=>{var p=l(83),v=l(82);W.exports=p?{}.toString:function(){return"[object "+v(this)+"]"}},(W,E,l)=>{l(99)},(W,E,l)=>{var p=l(100),v=l(118);p("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},v)},(W,E,l)=>{var p=l(6),v=l(7),I=l(17),k=l(71),m=l(51),R=l(101),t=l(108),n=l(115),h=l(24),a=l(20),d=l(23),r=l(10),i=l(116),o=l(94),c=l(117);W.exports=function(b,y,f){var s=b.indexOf("Map")!==-1,g=b.indexOf("Weak")!==-1,S=s?"set":"add",D=v[b],w=D&&D.prototype,x=D,F={},X=function(ie){var q=I(w[ie]);m(w,ie,ie=="add"?function(H){return q(this,H===0?0:H),this}:ie=="delete"?function(_){return g&&!d(_)?!1:q(this,_===0?0:_)}:ie=="get"?function(H){return g&&!d(H)?void 0:q(this,H===0?0:H)}:ie=="has"?function(H){return g&&!d(H)?!1:q(this,H===0?0:H)}:function(H,$){return q(this,H===0?0:H,$),this})},G=k(b,!h(D)||!(g||w.forEach&&!r(function(){new D().entries().next()})));if(G)x=f.getConstructor(y,b,s,S),R.enable();else if(k(b,!0)){var j=new x,N=j[S](g?{}:-0,1)!=j,Q=r(function(){j.has(1)}),Y=i(function(ie){new D(ie)}),B=!g&&r(function(){for(var ie=new D,q=5;q--;)ie[S](q,q);return!ie.has(-0)});Y||(x=y(function(ie,q){n(ie,w);var _=c(new D,ie,x);return a(q)||t(q,_[S],{that:_,AS_ENTRIES:s}),_}),x.prototype=w,w.constructor=x),(Q||B)&&(X("delete"),X("has"),s&&X("get")),(B||N)&&X(S),g&&w.clear&&delete w.clear}return F[b]=x,p({global:!0,constructor:!0,forced:x!=D},F),o(x,b),g||f.setStrong(x,b,s),x}},(W,E,l)=>{var p=l(6),v=l(17),I=l(58),k=l(23),m=l(42),R=l(48).f,t=l(61),n=l(102),h=l(105),a=l(44),d=l(107),r=!1,i=a("meta"),o=0,c=function(S){R(S,i,{value:{objectID:"O"+o++,weakData:{}}})},b=function(S,D){if(!k(S))return typeof S=="symbol"?S:(typeof S=="string"?"S":"P")+S;if(!m(S,i)){if(!h(S))return"F";if(!D)return"E";c(S)}return S[i].objectID},y=function(S,D){if(!m(S,i)){if(!h(S))return!0;if(!D)return!1;c(S)}return S[i].weakData},f=function(S){return d&&r&&h(S)&&!m(S,i)&&c(S),S},s=function(){g.enable=function(){},r=!0;var S=t.f,D=v([].splice),w={};w[i]=1,S(w).length&&(t.f=function(x){for(var F=S(x),X=0,G=F.length;X<G;X++)if(F[X]===i){D(F,X,1);break}return F},p({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:n.f}))},g=W.exports={enable:s,fastKey:b,getWeakData:y,onFreeze:f};I[i]=!0},(W,E,l)=>{var p=l(18),v=l(15),I=l(61).f,k=l(103),m=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],R=function(t){try{return I(t)}catch{return k(m)}};W.exports.f=function(n){return m&&p(n)=="Window"?R(n):I(v(n))}},(W,E,l)=>{var p=l(64),v=l(67),I=l(104),k=Array,m=Math.max;W.exports=function(R,t,n){for(var h=v(R),a=p(t,h),d=p(n===void 0?h:n,h),r=k(m(d-a,0)),i=0;a<d;a++,i++)I(r,i,R[a]);return r.length=i,r}},(W,E,l)=>{var p=l(21),v=l(48),I=l(14);W.exports=function(k,m,R){var t=p(m);t in k?v.f(k,t,I(0,R)):k[t]=R}},(W,E,l)=>{var p=l(10),v=l(23),I=l(18),k=l(106),m=Object.isExtensible,R=p(function(){});W.exports=R||k?function(n){return!v(n)||k&&I(n)=="ArrayBuffer"?!1:m?m(n):!0}:m},(W,E,l)=>{var p=l(10);W.exports=p(function(){if(typeof ArrayBuffer=="function"){var v=new ArrayBuffer(8);Object.isExtensible(v)&&Object.defineProperty(v,"a",{value:8})}})},(W,E,l)=>{var p=l(10);W.exports=!p(function(){return Object.isExtensible(Object.preventExtensions({}))})},(W,E,l)=>{var p=l(109),v=l(11),I=l(50),k=l(35),m=l(111),R=l(67),t=l(28),n=l(112),h=l(113),a=l(114),d=TypeError,r=function(o,c){this.stopped=o,this.result=c},i=r.prototype;W.exports=function(o,c,b){var y=b&&b.that,f=!!(b&&b.AS_ENTRIES),s=!!(b&&b.IS_RECORD),g=!!(b&&b.IS_ITERATOR),S=!!(b&&b.INTERRUPTED),D=p(c,y),w,x,F,X,G,j,N,Q=function(B){return w&&a(w,"normal",B),new r(!0,B)},Y=function(B){return f?(I(B),S?D(B[0],B[1],Q):D(B[0],B[1])):S?D(B,Q):D(B)};if(s)w=o.iterator;else if(g)w=o;else{if(x=h(o),!x)throw d(k(o)+" is not iterable");if(m(x)){for(F=0,X=R(o);X>F;F++)if(G=Y(o[F]),G&&t(i,G))return G;return new r(!1)}w=n(o,x)}for(j=s?o.next:w.next;!(N=v(j,w)).done;){try{G=Y(N.value)}catch(B){a(w,"throw",B)}if(typeof G=="object"&&G&&t(i,G))return G}return new r(!1)}},(W,E,l)=>{var p=l(110),v=l(34),I=l(12),k=p(p.bind);W.exports=function(m,R){return v(m),R===void 0?m:I?k(m,R):function(){return m.apply(R,arguments)}}},(W,E,l)=>{var p=l(18),v=l(17);W.exports=function(I){if(p(I)==="Function")return v(I)}},(W,E,l)=>{var p=l(37),v=l(90),I=p("iterator"),k=Array.prototype;W.exports=function(m){return m!==void 0&&(v.Array===m||k[I]===m)}},(W,E,l)=>{var p=l(11),v=l(34),I=l(50),k=l(35),m=l(113),R=TypeError;W.exports=function(t,n){var h=arguments.length<2?m(t):n;if(v(h))return I(p(h,t));throw R(k(t)+" is not iterable")}},(W,E,l)=>{var p=l(82),v=l(33),I=l(20),k=l(90),m=l(37),R=m("iterator");W.exports=function(t){if(!I(t))return v(t,R)||v(t,"@@iterator")||k[p(t)]}},(W,E,l)=>{var p=l(11),v=l(50),I=l(33);W.exports=function(k,m,R){var t,n;v(k);try{if(t=I(k,"return"),!t){if(m==="throw")throw R;return R}t=p(t,k)}catch(h){n=!0,t=h}if(m==="throw")throw R;if(n)throw t;return v(t),R}},(W,E,l)=>{var p=l(28),v=TypeError;W.exports=function(I,k){if(p(k,I))return I;throw v("Incorrect invocation")}},(W,E,l)=>{var p=l(37),v=p("iterator"),I=!1;try{var k=0,m={next:function(){return{done:!!k++}},return:function(){I=!0}};m[v]=function(){return this},Array.from(m,function(){throw 2})}catch{}W.exports=function(R,t){if(!t&&!I)return!1;var n=!1;try{var h={};h[v]=function(){return{next:function(){return{done:n=!0}}}},R(h)}catch{}return n}},(W,E,l)=>{var p=l(24),v=l(23),I=l(86);W.exports=function(k,m,R){var t,n;return I&&p(t=m.constructor)&&t!==R&&v(n=t.prototype)&&n!==R.prototype&&I(k,n),k}},(W,E,l)=>{var p=l(48).f,v=l(73),I=l(119),k=l(109),m=l(115),R=l(20),t=l(108),n=l(91),h=l(95),a=l(120),d=l(9),r=l(101).fastKey,i=l(55),o=i.set,c=i.getterFor;W.exports={getConstructor:function(b,y,f,s){var g=b(function(F,X){m(F,S),o(F,{type:y,index:v(null),first:void 0,last:void 0,size:0}),d||(F.size=0),R(X)||t(X,F[s],{that:F,AS_ENTRIES:f})}),S=g.prototype,D=c(y),w=function(F,X,G){var j=D(F),N=x(F,X),Q,Y;return N?N.value=G:(j.last=N={index:Y=r(X,!0),key:X,value:G,previous:Q=j.last,next:void 0,removed:!1},j.first||(j.first=N),Q&&(Q.next=N),d?j.size++:F.size++,Y!=="F"&&(j.index[Y]=N)),F},x=function(F,X){var G=D(F),j=r(X),N;if(j!=="F")return G.index[j];for(N=G.first;N;N=N.next)if(N.key==X)return N};return I(S,{clear:function(){for(var X=this,G=D(X),j=G.index,N=G.first;N;)N.removed=!0,N.previous&&(N.previous=N.previous.next=void 0),delete j[N.index],N=N.next;G.first=G.last=void 0,d?G.size=0:X.size=0},delete:function(F){var X=this,G=D(X),j=x(X,F);if(j){var N=j.next,Q=j.previous;delete G.index[j.index],j.removed=!0,Q&&(Q.next=N),N&&(N.previous=Q),G.first==j&&(G.first=N),G.last==j&&(G.last=Q),d?G.size--:X.size--}return!!j},forEach:function(X){for(var G=D(this),j=k(X,arguments.length>1?arguments[1]:void 0),N;N=N?N.next:G.first;)for(j(N.value,N.key,this);N&&N.removed;)N=N.previous},has:function(X){return!!x(this,X)}}),I(S,f?{get:function(X){var G=x(this,X);return G&&G.value},set:function(X,G){return w(this,X===0?0:X,G)}}:{add:function(X){return w(this,X=X===0?0:X,X)}}),d&&p(S,"size",{get:function(){return D(this).size}}),g},setStrong:function(b,y,f){var s=y+" Iterator",g=c(y),S=c(s);n(b,y,function(D,w){o(this,{type:s,target:D,state:g(D),kind:w,last:void 0})},function(){for(var D=S(this),w=D.kind,x=D.last;x&&x.removed;)x=x.previous;return!D.target||!(D.last=x=x?x.next:D.state.first)?(D.target=void 0,h(void 0,!0)):w=="keys"?h(x.key,!1):w=="values"?h(x.value,!1):h([x.key,x.value],!1)},f?"entries":"values",!f,!0),a(y)}}},(W,E,l)=>{var p=l(51);W.exports=function(v,I,k){for(var m in I)p(v,m,I[m],k);return v}},(W,E,l)=>{var p=l(27),v=l(48),I=l(37),k=l(9),m=I("species");W.exports=function(R){var t=p(R),n=v.f;k&&t&&!t[m]&&n(t,m,{configurable:!0,get:function(){return this}})}},(W,E,l)=>{l(122)},(W,E,l)=>{var p=l(100),v=l(118);p("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},v)},(W,E,l)=>{var p=l(39),v=l(6),I=l(7),k=l(27),m=l(17),R=l(10),t=l(44),n=l(24),h=l(124),a=l(20),d=l(23),r=l(26),i=l(108),o=l(50),c=l(82),b=l(42),y=l(104),f=l(47),s=l(67),g=l(125),S=l(126),D=l(128),w=l(129),x=l(130),F=l(31),X=l(131),G=l(132),j=l(133),N=I.Object,Q=I.Array,Y=I.Date,B=I.Error,ie=I.EvalError,q=I.RangeError,_=I.ReferenceError,H=I.SyntaxError,$=I.TypeError,C=I.URIError,P=I.PerformanceMark,z=I.WebAssembly,ee=z&&z.CompileError||B,te=z&&z.LinkError||B,K=z&&z.RuntimeError||B,ue=k("DOMException"),fe=D.Map,ye=D.has,me=D.get,we=D.set,ge=w.Set,A=w.add,O=k("Object","keys"),M=m([].push),U=m((!0).valueOf),Z=m(1 .valueOf),se=m("".valueOf),ne=m(Y.prototype.getTime),re=t("structuredClone"),ve="DataCloneError",he="Transferring",be=function(_e){return!R(function(){var Me=new I.Set([7]),Ae=_e(Me),ce=_e(N(7));return Ae==Me||!Ae.has(7)||typeof ce!="object"||ce!=7})&&_e},Ce=function(_e,Me){return!R(function(){var Ae=new Me,ce=_e({a:Ae,b:Ae});return!(ce&&ce.a===ce.b&&ce.a instanceof Me&&ce.a.stack===Ae.stack)})},Te=function(_e){return!R(function(){var Me=_e(new I.AggregateError([1],re,{cause:3}));return Me.name!="AggregateError"||Me.errors[0]!=1||Me.message!=re||Me.cause!=3})},Ie=I.structuredClone,He=p||!Ce(Ie,B)||!Ce(Ie,ue)||!Te(Ie),Ve=!Ie&&be(function(_e){return new P(re,{detail:_e}).detail}),ae=be(Ie)||Ve,T=function(_e){throw new ue("Uncloneable type: "+_e,ve)},V=function(_e,Me){throw new ue((Me||"Cloning")+" of "+_e+" cannot be properly polyfilled in this engine",ve)},de=function(){var _e;try{_e=new I.DataTransfer}catch{try{_e=new I.ClipboardEvent("").clipboardData}catch{}}return _e&&_e.items&&_e.files?_e:null},Pe=function(_e,Me){if(r(_e)&&T("Symbol"),!d(_e))return _e;if(Me){if(ye(Me,_e))return me(Me,_e)}else Me=new fe;var Ae=c(_e),ce=!1,Ee,We,Oe,$e,oe,J,pe,ke,Re,Be;switch(Ae){case"Array":Oe=Q(s(_e)),ce=!0;break;case"Object":Oe={},ce=!0;break;case"Map":Oe=new fe,ce=!0;break;case"Set":Oe=new ge,ce=!0;break;case"RegExp":Oe=new RegExp(_e.source,S(_e));break;case"Error":switch(We=_e.name,We){case"AggregateError":Oe=k("AggregateError")([]);break;case"EvalError":Oe=ie();break;case"RangeError":Oe=q();break;case"ReferenceError":Oe=_();break;case"SyntaxError":Oe=H();break;case"TypeError":Oe=$();break;case"URIError":Oe=C();break;case"CompileError":Oe=ee();break;case"LinkError":Oe=te();break;case"RuntimeError":Oe=K();break;default:Oe=B()}ce=!0;break;case"DOMException":Oe=new ue(_e.message,_e.name),ce=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":Ee=I[Ae],d(Ee)||V(Ae),Oe=new Ee(Pe(_e.buffer,Me),_e.byteOffset,Ae==="DataView"?_e.byteLength:_e.length);break;case"DOMQuad":try{Oe=new DOMQuad(Pe(_e.p1,Me),Pe(_e.p2,Me),Pe(_e.p3,Me),Pe(_e.p4,Me))}catch{ae?Oe=ae(_e):V(Ae)}break;case"FileList":if($e=de(),$e){for(oe=0,J=s(_e);oe<J;oe++)$e.items.add(Pe(_e[oe],Me));Oe=$e.files}else ae?Oe=ae(_e):V(Ae);break;case"ImageData":try{Oe=new ImageData(Pe(_e.data,Me),_e.width,_e.height,{colorSpace:_e.colorSpace})}catch{ae?Oe=ae(_e):V(Ae)}break;default:if(ae)Oe=ae(_e);else switch(Ae){case"BigInt":Oe=N(_e.valueOf());break;case"Boolean":Oe=N(U(_e));break;case"Number":Oe=N(Z(_e));break;case"String":Oe=N(se(_e));break;case"Date":Oe=new Y(ne(_e));break;case"ArrayBuffer":Ee=I.DataView,!Ee&&typeof _e.slice!="function"&&V(Ae);try{if(typeof _e.slice=="function")Oe=_e.slice(0);else for(J=_e.byteLength,Oe=new ArrayBuffer(J),Re=new Ee(_e),Be=new Ee(Oe),oe=0;oe<J;oe++)Be.setUint8(oe,Re.getUint8(oe))}catch{throw new ue("ArrayBuffer is detached",ve)}break;case"SharedArrayBuffer":Oe=_e;break;case"Blob":try{Oe=_e.slice(0,_e.size,_e.type)}catch{V(Ae)}break;case"DOMPoint":case"DOMPointReadOnly":Ee=I[Ae];try{Oe=Ee.fromPoint?Ee.fromPoint(_e):new Ee(_e.x,_e.y,_e.z,_e.w)}catch{V(Ae)}break;case"DOMRect":case"DOMRectReadOnly":Ee=I[Ae];try{Oe=Ee.fromRect?Ee.fromRect(_e):new Ee(_e.x,_e.y,_e.width,_e.height)}catch{V(Ae)}break;case"DOMMatrix":case"DOMMatrixReadOnly":Ee=I[Ae];try{Oe=Ee.fromMatrix?Ee.fromMatrix(_e):new Ee(_e)}catch{V(Ae)}break;case"AudioData":case"VideoFrame":n(_e.clone)||V(Ae);try{Oe=_e.clone()}catch{T(Ae)}break;case"File":try{Oe=new File([_e],_e.name,_e)}catch{V(Ae)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":V(Ae);default:T(Ae)}}if(we(Me,_e,Oe),ce)switch(Ae){case"Array":case"Object":for(pe=O(_e),oe=0,J=s(pe);oe<J;oe++)ke=pe[oe],y(Oe,ke,Pe(_e[ke],Me));break;case"Map":_e.forEach(function(Ne,Ge){we(Oe,Pe(Ge,Me),Pe(Ne,Me))});break;case"Set":_e.forEach(function(Ne){A(Oe,Pe(Ne,Me))});break;case"Error":f(Oe,"message",Pe(_e.message,Me)),b(_e,"cause")&&f(Oe,"cause",Pe(_e.cause,Me)),We=="AggregateError"&&(Oe.errors=Pe(_e.errors,Me));case"DOMException":x&&f(Oe,"stack",Pe(_e.stack,Me))}return Oe},De=Ie&&!R(function(){if(G&&F>92||j&&F>94||X&&F>97)return!1;var _e=new ArrayBuffer(8),Me=Ie(_e,{transfer:[_e]});return _e.byteLength!=0||Me.byteLength!=8}),Fe=function(_e,Me){if(!d(_e))throw $("Transfer option cannot be converted to a sequence");var Ae=[];i(_e,function(Re){M(Ae,o(Re))});var ce=0,Ee=s(Ae),We,Oe,$e,oe,J,pe,ke;if(De)for(oe=Ie(Ae,{transfer:Ae});ce<Ee;)we(Me,Ae[ce],oe[ce++]);else for(;ce<Ee;){if(We=Ae[ce++],ye(Me,We))throw new ue("Duplicate transferable",ve);switch(Oe=c(We),Oe){case"ImageBitmap":$e=I.OffscreenCanvas,h($e)||V(Oe,he);try{pe=new $e(We.width,We.height),ke=pe.getContext("bitmaprenderer"),ke.transferFromImageBitmap(We),J=pe.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!n(We.clone)||!n(We.close))&&V(Oe,he);try{J=We.clone(),We.close()}catch{}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":V(Oe,he)}if(J===void 0)throw new ue("This object cannot be transferred: "+Oe,ve);we(Me,We,J)}};v({global:!0,enumerable:!0,sham:!De,forced:He},{structuredClone:function(Me){var Ae=g(arguments.length,1)>1&&!a(arguments[1])?o(arguments[1]):void 0,ce=Ae?Ae.transfer:void 0,Ee;return ce!==void 0&&(Ee=new fe,Fe(ce,Ee)),Pe(Me,Ee)}})},(W,E,l)=>{var p=l(17),v=l(10),I=l(24),k=l(82),m=l(27),R=l(54),t=function(){},n=[],h=m("Reflect","construct"),a=/^\s*(?:class|function)\b/,d=p(a.exec),r=!a.exec(t),i=function(b){if(!I(b))return!1;try{return h(t,n,b),!0}catch{return!1}},o=function(b){if(!I(b))return!1;switch(k(b)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return r||!!d(a,R(b))}catch{return!0}};o.sham=!0,W.exports=!h||v(function(){var c;return i(i.call)||!i(Object)||!i(function(){c=!0})||c})?o:i},W=>{var E=TypeError;W.exports=function(l,p){if(l<p)throw E("Not enough arguments");return l}},(W,E,l)=>{var p=l(11),v=l(42),I=l(28),k=l(127),m=RegExp.prototype;W.exports=function(R){var t=R.flags;return t===void 0&&!("flags"in m)&&!v(R,"flags")&&I(m,R)?p(k,R):t}},(W,E,l)=>{var p=l(50);W.exports=function(){var v=p(this),I="";return v.hasIndices&&(I+="d"),v.global&&(I+="g"),v.ignoreCase&&(I+="i"),v.multiline&&(I+="m"),v.dotAll&&(I+="s"),v.unicode&&(I+="u"),v.unicodeSets&&(I+="v"),v.sticky&&(I+="y"),I}},(W,E,l)=>{var p=l(17),v=Map.prototype;W.exports={Map,set:p(v.set),get:p(v.get),has:p(v.has),remove:p(v.delete),proto:v}},(W,E,l)=>{var p=l(17),v=Set.prototype;W.exports={Set,add:p(v.add),has:p(v.has),remove:p(v.delete),proto:v,$has:v.has,$keys:v.keys}},(W,E,l)=>{var p=l(10),v=l(14);W.exports=!p(function(){var I=Error("a");return"stack"in I?(Object.defineProperty(I,"stack",v(1,7)),I.stack!==7):!0})},(W,E,l)=>{var p=l(132),v=l(133);W.exports=!p&&!v&&typeof window=="object"&&typeof document=="object"},W=>{W.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(W,E,l)=>{var p=l(18);W.exports=typeof process<"u"&&p(process)=="process"},(W,E,l)=>{var p=l(7);W.exports=p},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var W,E,p,v,I,k,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(136),_display_utils=__w_pdfjs_require__(139),_font_loader=__w_pdfjs_require__(142),_canvas=__w_pdfjs_require__(143),_worker_options=__w_pdfjs_require__(146),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(147),_metadata=__w_pdfjs_require__(148),_optional_content_config=__w_pdfjs_require__(149),_transport_stream=__w_pdfjs_require__(150),_xfa_text=__w_pdfjs_require__(151);function _classPrivateFieldSet(t,n,h){var a=_classExtractFieldDescriptor(t,n,"set");return _classApplyDescriptorSet(t,a,h),h}function _classApplyDescriptorSet(t,n,h){if(n.set)n.set.call(t,h);else{if(!n.writable)throw new TypeError("attempted to set read only private field");n.value=h}}function _classPrivateMethodInitSpec(t,n){_checkPrivateRedeclaration(t,n),n.add(t)}function _classPrivateFieldInitSpec(t,n,h){_checkPrivateRedeclaration(t,n),n.set(t,h)}function _checkPrivateRedeclaration(t,n){if(n.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,n,h){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return h}function _classPrivateFieldGet(t,n){var h=_classExtractFieldDescriptor(t,n,"get");return _classApplyDescriptorGet(t,h)}function _classExtractFieldDescriptor(t,n,h){if(!n.has(t))throw new TypeError("attempted to "+h+" private field on non-instance");return n.get(t)}function _classApplyDescriptorGet(t,n){return n.get?n.get.call(t):n.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:n,NodeStandardFontDataFactory:h}=__w_pdfjs_require__(152);exports.DefaultCanvasFactory=DefaultCanvasFactory=t,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=n,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=h}let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(153);createPDFNetworkStream=n=>new t(n)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(156),{PDFFetchStream:n}=__w_pdfjs_require__(157);createPDFNetworkStream=h=>(0,_display_utils.isValidFetchUrl)(h.url)?new n(h):new t(h)}function getDocument(t){if(typeof t=="string"||t instanceof URL)t={url:t};else if((0,_util.isArrayBuffer)(t))t={data:t};else if(t instanceof PDFDataRangeTransport)(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead."),t={range:t};else if(typeof t!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const n=new PDFDocumentLoadingTask,h=t.url?getUrlProp(t.url):null,a=t.data?getDataProp(t.data):null,d=t.httpHeaders||null,r=t.withCredentials===!0,i=t.password??null,o=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let b=t.worker instanceof PDFWorker?t.worker:null;const y=t.verbosity,f=typeof t.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(t.docBaseUrl)?t.docBaseUrl:null,s=typeof t.cMapUrl=="string"?t.cMapUrl:null,g=t.cMapPacked!==!1,S=t.CMapReaderFactory||DefaultCMapReaderFactory,D=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,w=t.StandardFontDataFactory||DefaultStandardFontDataFactory,x=t.stopAtErrors!==!0,F=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,X=t.isEvalSupported!==!1,G=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,j=typeof t.disableFontFace=="boolean"?t.disableFontFace:_is_node.isNodeJS,N=t.fontExtraProperties===!0,Q=t.enableXfa===!0,Y=t.ownerDocument||globalThis.document,B=t.disableRange===!0,ie=t.disableStream===!0,q=t.disableAutoFetch===!0,_=t.pdfBug===!0,H=o?o.length:t.length??NaN,$=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!_is_node.isNodeJS&&!j,C=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:S===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(s,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(D,document.baseURI),P=null;(0,_util.setVerbosityLevel)(y);const z=C?null:{cMapReaderFactory:new S({baseUrl:s,isCompressed:g}),standardFontDataFactory:new w({baseUrl:D})};if(!b){const ue={verbosity:y,port:_worker_options.GlobalWorkerOptions.workerPort};b=ue.port?PDFWorker.fromPort(ue):new PDFWorker(ue),n._worker=b}const ee=n.docId,te={docId:ee,apiVersion:"3.4.120",data:a,password:i,disableAutoFetch:q,rangeChunkSize:c,length:H,docBaseUrl:f,enableXfa:Q,evaluatorOptions:{maxImageSize:F,disableFontFace:j,ignoreErrors:x,isEvalSupported:X,isOffscreenCanvasSupported:G,fontExtraProperties:N,useSystemFonts:$,cMapUrl:C?s:null,standardFontDataUrl:C?D:null}},K={ignoreErrors:x,isEvalSupported:X,disableFontFace:j,fontExtraProperties:N,enableXfa:Q,ownerDocument:Y,disableAutoFetch:q,pdfBug:_,styleElement:P};return b.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");const ue=_fetchDocument(b,te),fe=new Promise(function(ye){let me;o?me=new _transport_stream.PDFDataTransportStream({length:H,initialData:o.initialData,progressiveDone:o.progressiveDone,contentDispositionFilename:o.contentDispositionFilename,disableRange:B,disableStream:ie},o):a||(me=createPDFNetworkStream({url:h,length:H,httpHeaders:d,withCredentials:r,rangeChunkSize:c,disableRange:B,disableStream:ie})),ye(me)});return Promise.all([ue,fe]).then(function(ye){let[me,we]=ye;if(n.destroyed)throw new Error("Loading aborted");const ge=new _message_handler.MessageHandler(ee,me,b.port),A=new WorkerTransport(ge,n,we,K,z);n._transport=A,ge.send("Ready",null)})}).catch(n._capability.reject),n}async function _fetchDocument(t,n){if(t.destroyed)throw new Error("Worker was destroyed");const h=await t.messageHandler.sendWithPromise("GetDocRequest",n,n.data?[n.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return h}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_is_node.isNodeJS&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&typeof Buffer<"u"&&t instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(t);if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return(0,_util.stringToBytes)(t);if(typeof t=="object"&&!isNaN(t==null?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const l=class{constructor(){nt(this,E,null);this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId=`d${Kn(l,W)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get onUnsupportedFeature(){return Ue(this,E)}set onUnsupportedFeature(n){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future."),rt(this,E,n)}get promise(){return this._capability.promise}async destroy(){var n;this.destroyed=!0,await((n=this._transport)===null||n===void 0?void 0:n.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let PDFDocumentLoadingTask=l;W=new WeakMap,E=new WeakMap,nt(PDFDocumentLoadingTask,W,0),exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(n,h){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=n,this.initialData=h,this.progressiveDone=a,this.contentDispositionFilename=d,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(n){this._rangeListeners.push(n)}addProgressListener(n){this._progressListeners.push(n)}addProgressiveReadListener(n){this._progressiveReadListeners.push(n)}addProgressiveDoneListener(n){this._progressiveDoneListeners.push(n)}onDataRange(n,h){for(const a of this._rangeListeners)a(n,h)}onDataProgress(n,h){this._readyCapability.promise.then(()=>{for(const a of this._progressListeners)a(n,h)})}onDataProgressiveRead(n){this._readyCapability.promise.then(()=>{for(const h of this._progressiveReadListeners)h(n)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const n of this._progressiveDoneListeners)n()})}transportReady(){this._readyCapability.resolve()}requestDataRange(n,h){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(n,h){this._pdfInfo=n,this._transport=h}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(n){return this._transport.getPage(n)}getPageIndex(n){return this._transport.getPageIndex(n)}getDestinations(){return this._transport.getDestinations()}getDestination(n){return this._transport.getDestination(n)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(n||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(n,h,a,d){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;this._pageIndex=n,this._pageInfo=h,this._ownerDocument=d,this._transport=a,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=a.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:n,rotation:h=this.rotate,offsetX:a=0,offsetY:d=0,dontFlip:r=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:n,rotation:h,offsetX:a,offsetY:d,dontFlip:r})}getAnnotations(){let{intent:n="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=this._transport.getRenderingIntent(n);return this._transport.getAnnotations(this._pageIndex,h.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var n;return((n=this._transport._htmlForXfa)===null||n===void 0?void 0:n.children[this._pageIndex])||null}render(n){var h,a;let{canvasContext:d,viewport:r,intent:i="display",annotationMode:o=_util.AnnotationMode.ENABLE,transform:c=null,canvasFactory:b=null,background:y=null,optionalContentConfigPromise:f=null,annotationCanvasMap:s=null,pageColors:g=null,printAnnotationStorage:S=null}=n;(h=this._stats)===null||h===void 0||h.time("Overall");const D=this._transport.getRenderingIntent(i,o,S);this.pendingCleanup=!1,f||(f=this._transport.getOptionalContentConfig());let w=this._intentStates.get(D.cacheKey);w||(w=Object.create(null),this._intentStates.set(D.cacheKey,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const x=b||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),F=!!(D.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!w.displayReadyCapability){var X;w.displayReadyCapability=(0,_util.createPromiseCapability)(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)===null||X===void 0||X.time("Page Request"),this._pumpOperatorList(D)}const G=Q=>{var Y,B;w.renderTasks.delete(j),(this.cleanupAfterRender||F)&&(this.pendingCleanup=!0),this._tryCleanup(),Q?(j.capability.reject(Q),this._abortOperatorList({intentState:w,reason:Q instanceof Error?Q:new Error(Q)})):j.capability.resolve(),(Y=this._stats)===null||Y===void 0||Y.timeEnd("Rendering"),(B=this._stats)===null||B===void 0||B.timeEnd("Overall")},j=new InternalRenderTask({callback:G,params:{canvasContext:d,viewport:r,transform:c,background:y},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:s,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:x,useRequestAnimationFrame:!F,pdfBug:this._pdfBug,pageColors:g});((a=w).renderTasks||(a.renderTasks=new Set)).add(j);const N=j.task;return Promise.all([w.displayReadyCapability.promise,f]).then(Q=>{var Y;let[B,ie]=Q;if(this.pendingCleanup){G();return}(Y=this._stats)===null||Y===void 0||Y.time("Rendering"),j.initializeGraphics({transparency:B,optionalContentConfig:ie}),j.operatorListChanged()}).catch(G),N}getOperatorList(){let{intent:n="display",annotationMode:h=_util.AnnotationMode.ENABLE,printAnnotationStorage:a=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function d(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(o))}const r=this._transport.getRenderingIntent(n,h,a,!0);let i=this._intentStates.get(r.cacheKey);i||(i=Object.create(null),this._intentStates.set(r.cacheKey,i));let o;if(!i.opListReadCapability){var c,b;o=Object.create(null),o.operatorListChanged=d,i.opListReadCapability=(0,_util.createPromiseCapability)(),((c=i).renderTasks||(c.renderTasks=new Set)).add(o),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(b=this._stats)===null||b===void 0||b.time("Page Request"),this._pumpOperatorList(r)}return i.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:n=!1,includeMarkedContent:h=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const a=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:n!==!0,includeMarkedContent:h===!0},{highWaterMark:a,size(d){return d.items.length}})}getTextContent(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(a=>_xfa_text.XfaText.textContent(a));const h=this.streamTextContent(n);return new Promise(function(a,d){function r(){i.read().then(function(c){let{value:b,done:y}=c;if(y){a(o);return}Object.assign(o.styles,b.styles),o.items.push(...b.items),r()},d)}const i=h.getReader(),o={items:[],styles:Object.create(null)};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const n=[];for(const h of this._intentStates.values())if(this._abortOperatorList({intentState:h,reason:new Error("Page was destroyed."),force:!0}),!h.opListReadCapability)for(const a of h.renderTasks)n.push(a.completed),a.cancel();return this.objs.clear(),this.pendingCleanup=!1,Promise.all(n)}cleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.pendingCleanup=!0,this._tryCleanup(n)}_tryCleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.pendingCleanup)return!1;for(const{renderTasks:h,operatorList:a}of this._intentStates.values())if(h.size>0||!a.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),n&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(n,h){var a,d;const r=this._intentStates.get(h);r&&((a=this._stats)===null||a===void 0||a.timeEnd("Page Request"),(d=r.displayReadyCapability)===null||d===void 0||d.resolve(n))}_renderPageChunk(n,h){for(let a=0,d=n.length;a<d;a++)h.operatorList.fnArray.push(n.fnArray[a]),h.operatorList.argsArray.push(n.argsArray[a]);h.operatorList.lastChunk=n.lastChunk,h.operatorList.separateAnnots=n.separateAnnots;for(const a of h.renderTasks)a.operatorListChanged();n.lastChunk&&this._tryCleanup()}_pumpOperatorList(n){let{renderingIntent:h,cacheKey:a,annotationStorageMap:d}=n;const i=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:h,cacheKey:a,annotationStorage:d}).getReader(),o=this._intentStates.get(a);o.streamReader=i;const c=()=>{i.read().then(b=>{let{value:y,done:f}=b;if(f){o.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(y,o),c())},b=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const y of o.renderTasks)y.operatorListChanged();this._tryCleanup()}if(o.displayReadyCapability)o.displayReadyCapability.reject(b);else if(o.opListReadCapability)o.opListReadCapability.reject(b);else throw b}})};c()}_abortOperatorList(n){let{intentState:h,reason:a,force:d=!1}=n;if(h.streamReader){if(h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null),!d){if(h.renderTasks.size>0)return;if(a instanceof _display_utils.RenderingCancelledException){let r=RENDERING_CANCELLED_TIMEOUT;a.extraDelay>0&&a.extraDelay<1e3&&(r+=a.extraDelay),h.streamReaderCancelTimeout=setTimeout(()=>{h.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:h,reason:a,force:!0})},r);return}}if(h.streamReader.cancel(new _util.AbortException(a.message)).catch(()=>{}),h.streamReader=null,!this._transport.destroyed){for(const[r,i]of this._intentStates)if(i===h){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){nt(this,p,new Set);nt(this,v,Promise.resolve())}postMessage(n,h){const a={data:structuredClone(n,h)};Ue(this,v).then(()=>{for(const d of Ue(this,p))d.call(this,a)})}addEventListener(n,h){Ue(this,p).add(h)}removeEventListener(n,h){Ue(this,p).delete(h)}terminate(){Ue(this,p).clear()}}p=new WeakMap,v=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){var _document,_document$currentScri;const t=(_document=document)===null||_document===void 0||(_document$currentScri=_document.currentScript)===null||_document$currentScri===void 0?void 0:_document$currentScri.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,n){let h;try{if(h=new URL(t),!h.origin||h.origin==="null")return!1}catch{return!1}const a=new URL(n,h);return h.origin===a.origin},PDFWorkerUtil.createCDNWrapper=function(t){const n=`importScripts("${t}");`;return URL.createObjectURL(new Blob([n]))}}const _PDFWorker=class{constructor(){let{name:t=null,port:n=null,verbosity:h=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(n&&Ue(_PDFWorker,I).has(n))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=h,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,n){Ue(_PDFWorker,I).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const n=new Worker(t),h=new _message_handler.MessageHandler("main","worker",n),a=()=>{n.removeEventListener("error",d),h.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},d=()=>{this._webWorker||a()};n.addEventListener("error",d),h.on("test",i=>{if(n.removeEventListener("error",d),this.destroyed){a();return}i?(this._messageHandler=h,this._port=n,this._webWorker=n,this._readyCapability.resolve(),h.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),h.destroy(),n.terminate())}),h.on("ready",i=>{if(n.removeEventListener("error",d),this.destroyed){a();return}try{r()}catch{this._setupFakeWorker()}});const r=()=>{const i=new Uint8Array;h.send("test",i,[i.buffer])};r();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new LoopbackPort;this._port=n;const h=`fake${PDFWorkerUtil.fakeWorkerId++}`,a=new _message_handler.MessageHandler(h+"_worker",h,n);t.setup(a,n);const d=new _message_handler.MessageHandler(h,h+"_worker",n);this._messageHandler=d,this._readyCapability.resolve(),d.send("configure",{verbosity:this.verbosity})}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Ue(_PDFWorker,I).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ue(this,I).has(t.port)?Ue(this,I).get(t.port):new _PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return((t=globalThis.pdfjsWorker)===null||t===void 0?void 0:t.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};let PDFWorker=_PDFWorker;I=new WeakMap,nt(PDFWorker,I,new WeakMap),exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_cacheSimpleMethod=new WeakSet;class WorkerTransport{constructor(n,h,a,d,r){_classPrivateMethodInitSpec(this,_cacheSimpleMethod),_classPrivateFieldInitSpec(this,_methodPromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map}),this.messageHandler=n,this.loadingTask=h,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:d.ownerDocument,styleElement:d.styleElement}),this._params=d,this.cMapReaderFactory=r==null?void 0:r.cMapReaderFactory,this.standardFontDataFactory=r==null?void 0:r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=a,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=_util.RenderingIntentFlag.DISPLAY,i=null;switch(n){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${n}`)}switch(h){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,i=(r&_util.RenderingIntentFlag.PRINT&&a instanceof _annotation_storage.PrintAnnotationStorage?a:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${h}`)}return d&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:`${r}_${_annotation_storage.AnnotationStorage.getHash(i)}`,annotationStorageMap:i}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const n=[];for(const a of _classPrivateFieldGet(this,_pageCache).values())n.push(a._destroy());_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const h=this.messageHandler.sendWithPromise("Terminate",null);return n.push(h),Promise.all(n).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(this,_methodPromises).clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:n,loadingTask:h}=this;n.on("GetReader",(a,d)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},d.onPull=()=>{this._fullReader.read().then(function(r){let{value:i,done:o}=r;if(o){d.close();return}(0,_util.assert)(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),d.enqueue(new Uint8Array(i),1,[i])}).catch(r=>{d.error(r)})},d.onCancel=r=>{this._fullReader.cancel(r),d.ready.catch(i=>{if(!this.destroyed)throw i})}}),n.on("ReaderHeadersReady",a=>{const d=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{if(!r.isStreamingSupported||!r.isRangeSupported){if(this._lastProgress){var i;(i=h.onProgress)===null||i===void 0||i.call(h,this._lastProgress)}r.onProgress=o=>{var c;(c=h.onProgress)===null||c===void 0||c.call(h,{loaded:o.loaded,total:o.total})}}d.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},d.reject),d.promise}),n.on("GetRangeReader",(a,d)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(a.begin,a.end);if(!r){d.close();return}d.onPull=()=>{r.read().then(function(i){let{value:o,done:c}=i;if(c){d.close();return}(0,_util.assert)(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),d.enqueue(new Uint8Array(o),1,[o])}).catch(i=>{d.error(i)})},d.onCancel=i=>{r.cancel(i),d.ready.catch(o=>{if(!this.destroyed)throw o})}}),n.on("GetDoc",a=>{let{pdfInfo:d}=a;this._numPages=d.numPages,this._htmlForXfa=d.htmlForXfa,delete d.htmlForXfa,h._capability.resolve(new PDFDocumentProxy(d,this))}),n.on("DocException",function(a){let d;switch(a.name){case"PasswordException":d=new _util.PasswordException(a.message,a.code);break;case"InvalidPDFException":d=new _util.InvalidPDFException(a.message);break;case"MissingPDFException":d=new _util.MissingPDFException(a.message);break;case"UnexpectedResponseException":d=new _util.UnexpectedResponseException(a.message,a.status);break;case"UnknownErrorException":d=new _util.UnknownErrorException(a.message,a.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}h._capability.reject(d)}),n.on("PasswordRequest",a=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),h.onPassword){const d=r=>{r instanceof Error?this._passwordCapability.reject(r):this._passwordCapability.resolve({password:r})};try{h.onPassword(d,a.code)}catch(r){this._passwordCapability.reject(r)}}else this._passwordCapability.reject(new _util.PasswordException(a.message,a.code));return this._passwordCapability.promise}),n.on("DataLoaded",a=>{var d;(d=h.onProgress)===null||d===void 0||d.call(h,{loaded:a.length,total:a.length}),this.downloadInfoCapability.resolve(a)}),n.on("StartRenderPage",a=>{if(this.destroyed)return;_classPrivateFieldGet(this,_pageCache).get(a.pageIndex)._startRenderPage(a.transparency,a.cacheKey)}),n.on("commonobj",a=>{var d;let[r,i,o]=a;if(!this.destroyed&&!this.commonObjs.has(r))switch(i){case"Font":const c=this._params;if("error"in o){const f=o.error;(0,_util.warn)(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}let b=null;c.pdfBug&&(d=globalThis.FontInspector)!==null&&d!==void 0&&d.enabled&&(b={registerFont(f,s){globalThis.FontInspector.fontAdded(f,s)}});const y=new _font_loader.FontFaceObject(o,{isEvalSupported:c.isEvalSupported,disableFontFace:c.disableFontFace,ignoreErrors:c.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:b});this.fontLoader.bind(y).catch(f=>n.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c.fontExtraProperties&&y.data&&(y.data=null),this.commonObjs.resolve(r,y)});break;case"FontPath":case"Image":this.commonObjs.resolve(r,o);break;default:throw new Error(`Got unknown common object type ${i}`)}}),n.on("obj",a=>{let[d,r,i,o]=a;if(this.destroyed)return;const c=_classPrivateFieldGet(this,_pageCache).get(r);if(!c.objs.has(d))switch(i){case"Image":c.objs.resolve(d,o);const y=8e6;if(o){let f;if(o.bitmap){const{width:s,height:g}=o;f=s*g*4}else{var b;f=((b=o.data)===null||b===void 0?void 0:b.length)||0}f>y&&(c.cleanupAfterRender=!0)}break;case"Pattern":c.objs.resolve(d,o);break;default:throw new Error(`Got unknown object type ${i}`)}}),n.on("DocProgress",a=>{var d;this.destroyed||(d=h.onProgress)===null||d===void 0||d.call(h,{loaded:a.loaded,total:a.total})}),n.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),n.on("FetchBuiltInCMap",a=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(a):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),n.on("FetchStandardFontData",a=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(a):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature(n){var h,a;let{featureId:d}=n;this.destroyed||(h=(a=this.loadingTask).onUnsupportedFeature)===null||h===void 0||h.call(a,d)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var n;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:((n=this._fullReader)===null||n===void 0?void 0:n.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(n){if(!Number.isInteger(n)||n<=0||n>this._numPages)return Promise.reject(new Error("Invalid page request."));const h=n-1,a=_classPrivateFieldGet(this,_pagePromises).get(h);if(a)return a;const d=this.messageHandler.sendWithPromise("GetPage",{pageIndex:h}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(h,r,this,this._params.ownerDocument,this._params.pdfBug);return _classPrivateFieldGet(this,_pageCache).set(h,i),i});return _classPrivateFieldGet(this,_pagePromises).set(h,d),d}getPageIndex(n){return typeof n!="object"||n===null||!Number.isInteger(n.num)||n.num<0||!Number.isInteger(n.gen)||n.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:n.num,gen:n.gen})}getAnnotations(n,h){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:n,intent:h})}getFieldObjects(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetFieldObjects")}hasJSActions(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(n){return typeof n!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:n})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(n){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:n})}getStructTree(n){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:n})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(n=>new _optional_content_config.OptionalContentConfig(n))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const n="GetMetadata",h=_classPrivateFieldGet(this,_methodPromises).get(n);if(h)return h;const a=this.messageHandler.sendWithPromise(n,null).then(d=>{var r,i;return{info:d[0],metadata:d[1]?new _metadata.Metadata(d[1]):null,contentDispositionFilename:((r=this._fullReader)===null||r===void 0?void 0:r.filename)??null,contentLength:((i=this._fullReader)===null||i===void 0?void 0:i.contentLength)??null}});return _classPrivateFieldGet(this,_methodPromises).set(n,a),a}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const h of _classPrivateFieldGet(this,_pageCache).values())if(!h.cleanup())throw new Error(`startCleanup: Page ${h.pageNumber} is currently rendering.`);this.commonObjs.clear(),n||this.fontLoader.clear(),_classPrivateFieldGet(this,_methodPromises).clear()}}get loadingParams(){const{disableAutoFetch:n,enableXfa:h}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:n,enableXfa:h})}}function _cacheSimpleMethod2(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const h=_classPrivateFieldGet(this,_methodPromises).get(t);if(h)return h;const a=this.messageHandler.sendWithPromise(t,n);return _classPrivateFieldGet(this,_methodPromises).set(t,a),a}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj),_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h){const d=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,n);return d.capability.promise.then(()=>h(d.data)),null}const a=_classPrivateFieldGet(this,_objs)[n];if(!(a!=null&&a.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${n}.`);return a.data}has(n){const h=_classPrivateFieldGet(this,_objs)[n];return(h==null?void 0:h.capability.settled)||!1}resolve(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const a=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,n);a.data=h,a.capability.resolve()}clear(){for(const h in _classPrivateFieldGet(this,_objs)){var n;const{data:a}=_classPrivateFieldGet(this,_objs)[h];a==null||(n=a.bitmap)===null||n===void 0||n.close()}_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){const n=_classPrivateFieldGet(this,_objs)[t];return n||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}class RenderTask{constructor(n){nt(this,k,null);rt(this,k,n),this.onContinue=null}get promise(){return Ue(this,k).capability.promise}cancel(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;Ue(this,k).cancel(null,n)}get separateAnnots(){const{separateAnnots:n}=Ue(this,k).operatorList;if(!n)return!1;const{annotationCanvasMap:h}=Ue(this,k);return n.form||n.canvas&&(h==null?void 0:h.size)>0}}k=new WeakMap,exports.RenderTask=RenderTask;const R=class{constructor(n){let{callback:h,params:a,objs:d,commonObjs:r,annotationCanvasMap:i,operatorList:o,pageIndex:c,canvasFactory:b,useRequestAnimationFrame:y=!1,pdfBug:f=!1,pageColors:s=null}=n;this.callback=h,this.params=a,this.objs=d,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=c,this.canvasFactory=b,this._pdfBug=f,this.pageColors=s,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=y===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=a.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(n){var h,a;let{transparency:d=!1,optionalContentConfig:r}=n;if(this.cancelled)return;if(this._canvas){if(Ue(R,m).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Ue(R,m).add(this._canvas)}this._pdfBug&&(h=globalThis.StepperManager)!==null&&h!==void 0&&h.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:o,transform:c,background:b}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:c,viewport:o,transparency:d,background:b}),this.operatorListIdx=0,this.graphicsReady=!0,(a=this.graphicsReadyCallback)===null||a===void 0||a.call(this)}cancel(){var n;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(n=this.gfx)===null||n===void 0||n.endDrawing(),this._canvas&&Ue(R,m).delete(this._canvas),this.callback(h||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",a))}operatorListChanged(){var n;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(n=this.stepper)===null||n===void 0||n.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&Ue(R,m).delete(this._canvas),this.callback())))}};let InternalRenderTask=R;m=new WeakMap,nt(InternalRenderTask,m,new WeakSet);const version="3.4.120";exports.version=version;const build="af6414988";exports.build=build},(W,E,l)=>{var s;Object.defineProperty(E,"__esModule",{value:!0}),E.PrintAnnotationStorage=E.AnnotationStorage=void 0;var p=l(1),v=l(137),I=l(141);function k(g,S){R(g,S),S.add(g)}function m(g,S,D){R(g,S),S.set(g,D)}function R(g,S){if(S.has(g))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t(g,S,D){var w=d(g,S,"set");return n(g,w,D),D}function n(g,S,D){if(S.set)S.set.call(g,D);else{if(!S.writable)throw new TypeError("attempted to set read only private field");S.value=D}}function h(g,S,D){if(!S.has(g))throw new TypeError("attempted to get private field on non-instance");return D}function a(g,S){var D=d(g,S,"get");return r(g,D)}function d(g,S,D){if(!S.has(g))throw new TypeError("attempted to "+D+" private field on non-instance");return S.get(g)}function r(g,S){return S.get?S.get.call(g):S.value}var i=new WeakMap,o=new WeakMap,c=new WeakSet;class b{constructor(){k(this,c),m(this,i,{writable:!0,value:!1}),m(this,o,{writable:!0,value:new Map}),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(S,D){const w=a(this,o).get(S);return w===void 0?D:Object.assign(D,w)}getRawValue(S){return a(this,o).get(S)}remove(S){if(a(this,o).delete(S),a(this,o).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const D of a(this,o).values())if(D instanceof v.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(S,D){const w=a(this,o).get(S);let x=!1;if(w!==void 0)for(const[F,X]of Object.entries(D))w[F]!==X&&(x=!0,w[F]=X);else x=!0,a(this,o).set(S,D);x&&h(this,c,y).call(this),D instanceof v.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(D.constructor._type)}has(S){return a(this,o).has(S)}getAll(){return a(this,o).size>0?(0,p.objectFromMap)(a(this,o)):null}setAll(S){for(const[D,w]of Object.entries(S))this.setValue(D,w)}get size(){return a(this,o).size}resetModified(){a(this,i)&&(t(this,i,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new f(this)}get serializable(){if(a(this,o).size===0)return null;const S=new Map;for(const[D,w]of a(this,o)){const x=w instanceof v.AnnotationEditor?w.serialize():w;x&&S.set(D,x)}return S}static getHash(S){if(!S)return"";const D=new I.MurmurHash3_64;for(const[w,x]of S)D.update(`${w}:${JSON.stringify(x)}`);return D.hexdigest()}}E.AnnotationStorage=b;function y(){a(this,i)||(t(this,i,!0),typeof this.onSetModified=="function"&&this.onSetModified())}class f extends b{constructor(D){super();nt(this,s,null);rt(this,s,structuredClone(D.serializable))}get print(){(0,p.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Ue(this,s)}}s=new WeakMap,E.PrintAnnotationStorage=f},(W,E,l)=>{var k,m,R,t,n,h;Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationEditor=void 0;var p=l(138),v=l(1);const a=class{constructor(r){nt(this,k,this.focusin.bind(this));nt(this,m,this.focusout.bind(this));nt(this,R,!1);nt(this,t,!1);nt(this,n,!1);Et(this,"_uiManager",null);nt(this,h,a._zIndex++);this.constructor===a&&(0,v.unreachable)("Cannot initialize AnnotationEditor."),this.parent=r.parent,this.id=r.id,this.width=this.height=null,this.pageIndex=r.parent.pageIndex,this.name=r.name,this.div=null,this._uiManager=r.uiManager;const{rotation:i,rawDims:{pageWidth:o,pageHeight:c,pageX:b,pageY:y}}=this.parent.viewport;this.rotation=i,this.pageDimensions=[o,c],this.pageTranslation=[b,y];const[f,s]=this.parentDimensions;this.x=r.x/f,this.y=r.y/s,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,v.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(r){this._uiManager.addCommands(r)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Ue(this,h)}setParent(r){r!==null&&(this.pageIndex=r.pageIndex,this.pageDimensions=r.pageDimensions),this.parent=r}focusin(r){Ue(this,R)?rt(this,R,!1):this.parent.setSelected(this)}focusout(r){var i;if(!this.isAttachedToDOM)return;const o=r.relatedTarget;o!=null&&o.closest(`#${this.id}`)||(r.preventDefault(),(i=this.parent)!==null&&i!==void 0&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(r){const i=this.parent.div.getBoundingClientRect();this.startX=r.clientX-i.x,this.startY=r.clientY-i.y,r.dataTransfer.setData("text/plain",this.id),r.dataTransfer.effectAllowed="move"}setAt(r,i,o,c){const[b,y]=this.parentDimensions;[o,c]=this.screenToPageTranslation(o,c),this.x=(r+o)/b,this.y=(i+c)/y,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(r,i){const[o,c]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x+=r/o,this.y+=i/c,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(r,i){switch(this.parentRotation){case 90:return[i,-r];case 180:return[-r,-i];case 270:return[-i,r];default:return[r,i]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:r}=this._uiManager.viewParameters,[i,o]=this.pageDimensions;return[i*r,o*r]}setDims(r,i){const[o,c]=this.parentDimensions;this.div.style.width=`${100*r/o}%`,this.div.style.height=`${100*i/c}%`}fixDims(){const{style:r}=this.div,{height:i,width:o}=r,c=o.endsWith("%"),b=i.endsWith("%");if(c&&b)return;const[y,f]=this.parentDimensions;c||(r.width=`${100*parseFloat(o)/y}%`),b||(r.height=`${100*parseFloat(i)/f}%`)}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Ue(this,k)),this.div.addEventListener("focusout",Ue(this,m));const[r,i]=this.getInitialTranslation();return this.translate(r,i),(0,p.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(r){const{isMac:i}=v.FeatureTest.platform;if(r.button!==0||r.ctrlKey&&i){r.preventDefault();return}r.ctrlKey&&!i||r.shiftKey||r.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this),rt(this,R,!0)}getRect(r,i){const o=this.parentScale,[c,b]=this.pageDimensions,[y,f]=this.pageTranslation,s=r/o,g=i/o,S=this.x*c,D=this.y*b,w=this.width*c,x=this.height*b;switch(this.rotation){case 0:return[S+s+y,b-D-g-x+f,S+s+w+y,b-D-g+f];case 90:return[S+g+y,b-D+s+f,S+g+x+y,b-D+s+w+f];case 180:return[S-s-w+y,b-D+g+f,S-s+y,b-D+g+x+f];case 270:return[S-g-x+y,b-D-s-w+f,S-g+y,b-D-s+f];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(r,i){const[o,c,b,y]=r,f=b-o,s=y-c;switch(this.rotation){case 0:return[o,i-y,f,s];case 90:return[o,i-c,s,f];case 180:return[b,i-c,f,s];case 270:return[b,i-y,s,f];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){rt(this,n,!0)}disableEditMode(){rt(this,n,!1)}isInEditMode(){return Ue(this,n)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var r;(r=this.div)===null||r===void 0||r.addEventListener("focusin",Ue(this,k))}serialize(){(0,v.unreachable)("An editor must be serializable")}static deserialize(r,i,o){const c=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:o});c.rotation=r.rotation;const[b,y]=c.pageDimensions,[f,s,g,S]=c.getRectInCurrentCoords(r.rect,y);return c.x=f/b,c.y=s/y,c.width=g/b,c.height=S/y,c}remove(){this.div.removeEventListener("focusin",Ue(this,k)),this.div.removeEventListener("focusout",Ue(this,m)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var r;(r=this.div)===null||r===void 0||r.classList.add("selectedEditor")}unselect(){var r;(r=this.div)===null||r===void 0||r.classList.remove("selectedEditor")}updateParams(r,i){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return Ue(this,t)}set isEditing(r){rt(this,t,r),r?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};let I=a;k=new WeakMap,m=new WeakMap,R=new WeakMap,t=new WeakMap,n=new WeakMap,h=new WeakMap,Et(I,"_colorManager",new p.ColorManager),Et(I,"_zIndex",1),E.AnnotationEditor=I},(W,E,l)=>{var de,Pe,De,Fe,_e;Object.defineProperty(E,"__esModule",{value:!0}),E.KeyboardManager=E.CommandManager=E.ColorManager=E.AnnotationEditorUIManager=void 0,E.bindEvents=c,E.opacityToHex=b;var p=l(1),v=l(139);function I(Ae,ce,Ee){return ce=k(ce),ce in Ae?Object.defineProperty(Ae,ce,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Ae[ce]=Ee,Ae}function k(Ae){var ce=m(Ae,"string");return typeof ce=="symbol"?ce:String(ce)}function m(Ae,ce){if(typeof Ae!="object"||Ae===null)return Ae;var Ee=Ae[Symbol.toPrimitive];if(Ee!==void 0){var We=Ee.call(Ae,ce||"default");if(typeof We!="object")return We;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ce==="string"?String:Number)(Ae)}function R(Ae,ce,Ee){i(Ae,ce),ce.set(Ae,Ee)}function t(Ae,ce){var Ee=a(Ae,ce,"get");return n(Ae,Ee)}function n(Ae,ce){return ce.get?ce.get.call(Ae):ce.value}function h(Ae,ce,Ee){var We=a(Ae,ce,"set");return d(Ae,We,Ee),Ee}function a(Ae,ce,Ee){if(!ce.has(Ae))throw new TypeError("attempted to "+Ee+" private field on non-instance");return ce.get(Ae)}function d(Ae,ce,Ee){if(ce.set)ce.set.call(Ae,Ee);else{if(!ce.writable)throw new TypeError("attempted to set read only private field");ce.value=Ee}}function r(Ae,ce){i(Ae,ce),ce.add(Ae)}function i(Ae,ce){if(ce.has(Ae))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(Ae,ce,Ee){if(!ce.has(Ae))throw new TypeError("attempted to get private field on non-instance");return Ee}function c(Ae,ce,Ee){for(const We of Ee)ce.addEventListener(We,Ae[We].bind(Ae))}function b(Ae){return Math.round(Math.min(255,Math.max(1,255*Ae))).toString(16).padStart(2,"0")}class y{constructor(){nt(this,de,0)}getId(){return`${p.AnnotationEditorPrefix}${Kn(this,de)._++}`}}de=new WeakMap;class f{constructor(){nt(this,Pe,[]);nt(this,De,!1);nt(this,Fe,void 0);nt(this,_e,-1);let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;rt(this,Fe,ce)}add(ce){let{cmd:Ee,undo:We,mustExec:Oe,type:$e=NaN,overwriteIfSameType:oe=!1,keepUndo:J=!1}=ce;if(Oe&&Ee(),Ue(this,De))return;const pe={cmd:Ee,undo:We,type:$e};if(Ue(this,_e)===-1){Ue(this,Pe).length>0&&(Ue(this,Pe).length=0),rt(this,_e,0),Ue(this,Pe).push(pe);return}if(oe&&Ue(this,Pe)[Ue(this,_e)].type===$e){J&&(pe.undo=Ue(this,Pe)[Ue(this,_e)].undo),Ue(this,Pe)[Ue(this,_e)]=pe;return}const ke=Ue(this,_e)+1;ke===Ue(this,Fe)?Ue(this,Pe).splice(0,1):(rt(this,_e,ke),ke<Ue(this,Pe).length&&Ue(this,Pe).splice(ke)),Ue(this,Pe).push(pe)}undo(){Ue(this,_e)!==-1&&(rt(this,De,!0),Ue(this,Pe)[Ue(this,_e)].undo(),rt(this,De,!1),rt(this,_e,Ue(this,_e)-1))}redo(){Ue(this,_e)<Ue(this,Pe).length-1&&(rt(this,_e,Ue(this,_e)+1),rt(this,De,!0),Ue(this,Pe)[Ue(this,_e)].cmd(),rt(this,De,!1))}hasSomethingToUndo(){return Ue(this,_e)!==-1}hasSomethingToRedo(){return Ue(this,_e)<Ue(this,Pe).length-1}destroy(){rt(this,Pe,null)}}Pe=new WeakMap,De=new WeakMap,Fe=new WeakMap,_e=new WeakMap,E.CommandManager=f;var s=new WeakSet;class g{constructor(ce){r(this,s),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:Ee}=p.FeatureTest.platform;for(const[We,Oe]of ce)for(const $e of We){const oe=$e.startsWith("mac+");Ee&&oe?(this.callbacks.set($e.slice(4),Oe),this.allKeys.add($e.split("+").at(-1))):!Ee&&!oe&&(this.callbacks.set($e,Oe),this.allKeys.add($e.split("+").at(-1)))}}exec(ce,Ee){if(!this.allKeys.has(Ee.key))return;const We=this.callbacks.get(o(this,s,S).call(this,Ee));We&&(We.bind(ce)(),Ee.stopPropagation(),Ee.preventDefault())}}E.KeyboardManager=g;function S(Ae){Ae.altKey&&this.buffer.push("alt"),Ae.ctrlKey&&this.buffer.push("ctrl"),Ae.metaKey&&this.buffer.push("meta"),Ae.shiftKey&&this.buffer.push("shift"),this.buffer.push(Ae.key);const ce=this.buffer.join("+");return this.buffer.length=0,ce}const Me=class{get _colors(){const ce=new Map([["CanvasText",null],["Canvas",null]]);return(0,v.getColorValues)(ce),(0,p.shadow)(this,"_colors",ce)}convert(ce){const Ee=(0,v.getRGB)(ce);if(!window.matchMedia("(forced-colors: active)").matches)return Ee;for(const[We,Oe]of this._colors)if(Oe.every(($e,oe)=>$e===Ee[oe]))return Me._colorsMapping.get(We);return Ee}getHexCode(ce){const Ee=this._colors.get(ce);return Ee?p.Util.makeHexColor(...Ee):ce}};let D=Me;Et(D,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),E.ColorManager=D;var 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 WeakMap,H=new WeakMap,$=new WeakMap,C=new WeakMap,P=new WeakMap,z=new WeakMap,ee=new WeakMap,te=new WeakMap,K=new WeakMap,ue=new WeakMap,fe=new WeakMap,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{constructor(ce,Ee,We){r(this,ne),r(this,se),r(this,Z),r(this,U),r(this,M),r(this,O),r(this,A),r(this,ge),r(this,we),r(this,me),r(this,ye),R(this,w,{writable:!0,value:null}),R(this,x,{writable:!0,value:new Map}),R(this,F,{writable:!0,value:new Map}),R(this,X,{writable:!0,value:null}),R(this,G,{writable:!0,value:new f}),R(this,j,{writable:!0,value:0}),R(this,N,{writable:!0,value:null}),R(this,Q,{writable:!0,value:new Set}),R(this,Y,{writable:!0,value:null}),R(this,B,{writable:!0,value:new y}),R(this,ie,{writable:!0,value:!1}),R(this,q,{writable:!0,value:p.AnnotationEditorType.NONE}),R(this,_,{writable:!0,value:new Set}),R(this,H,{writable:!0,value:this.copy.bind(this)}),R(this,$,{writable:!0,value:this.cut.bind(this)}),R(this,C,{writable:!0,value:this.paste.bind(this)}),R(this,P,{writable:!0,value:this.keydown.bind(this)}),R(this,z,{writable:!0,value:this.onEditingAction.bind(this)}),R(this,ee,{writable:!0,value:this.onPageChanging.bind(this)}),R(this,te,{writable:!0,value:this.onScaleChanging.bind(this)}),R(this,K,{writable:!0,value:this.onRotationChanging.bind(this)}),R(this,ue,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}}),R(this,fe,{writable:!0,value:null}),h(this,fe,ce),h(this,Y,Ee),t(this,Y)._on("editingaction",t(this,z)),t(this,Y)._on("pagechanging",t(this,ee)),t(this,Y)._on("scalechanging",t(this,te)),t(this,Y)._on("rotationchanging",t(this,K)),h(this,X,We),this.viewParameters={realScale:v.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){o(this,me,he).call(this),t(this,Y)._off("editingaction",t(this,z)),t(this,Y)._off("pagechanging",t(this,ee)),t(this,Y)._off("scalechanging",t(this,te)),t(this,Y)._off("rotationchanging",t(this,K));for(const ce of t(this,F).values())ce.destroy();t(this,F).clear(),t(this,x).clear(),t(this,Q).clear(),h(this,w,null),t(this,_).clear(),t(this,G).destroy()}onPageChanging(ce){let{pageNumber:Ee}=ce;h(this,j,Ee-1)}focusMainContainer(){t(this,fe).focus()}addShouldRescale(ce){t(this,Q).add(ce)}removeShouldRescale(ce){t(this,Q).delete(ce)}onScaleChanging(ce){let{scale:Ee}=ce;this.commitOrRemove(),this.viewParameters.realScale=Ee*v.PixelsPerInch.PDF_TO_CSS_UNITS;for(const We of t(this,Q))We.onScaleChanging()}onRotationChanging(ce){let{pagesRotation:Ee}=ce;this.commitOrRemove(),this.viewParameters.rotation=Ee}addToAnnotationStorage(ce){!ce.isEmpty()&&t(this,X)&&!t(this,X).has(ce.id)&&t(this,X).setValue(ce.id,ce)}copy(ce){if(ce.preventDefault(),t(this,w)&&t(this,w).commitOrRemove(),!this.hasSelection)return;const Ee=[];for(const We of t(this,_))We.isEmpty()||Ee.push(We.serialize());Ee.length!==0&&ce.clipboardData.setData("application/pdfjs",JSON.stringify(Ee))}cut(ce){this.copy(ce),this.delete()}paste(ce){ce.preventDefault();let Ee=ce.clipboardData.getData("application/pdfjs");if(!Ee)return;try{Ee=JSON.parse(Ee)}catch(Oe){(0,p.warn)(`paste: "${Oe.message}".`);return}if(!Array.isArray(Ee))return;this.unselectAll();const We=t(this,F).get(t(this,j));try{const Oe=[];for(const J of Ee){const pe=We.deserialize(J);if(!pe)return;Oe.push(pe)}const $e=()=>{for(const J of Oe)o(this,Z,ae).call(this,J);o(this,ne,V).call(this,Oe)},oe=()=>{for(const J of Oe)J.remove()};this.addCommands({cmd:$e,undo:oe,mustExec:!0})}catch(Oe){(0,p.warn)(`paste: "${Oe.message}".`)}}keydown(ce){var Ee;(Ee=this.getActive())!==null&&Ee!==void 0&&Ee.shouldGetKeyboardEvents()||re._keyboardManager.exec(this,ce)}onEditingAction(ce){["undo","redo","delete","selectAll"].includes(ce.name)&&this[ce.name]()}setEditingState(ce){ce?(o(this,ye,ve).call(this),o(this,we,be).call(this),o(this,A,Te).call(this,{isEditing:t(this,q)!==p.AnnotationEditorType.NONE,isEmpty:o(this,se,T).call(this),hasSomethingToUndo:t(this,G).hasSomethingToUndo(),hasSomethingToRedo:t(this,G).hasSomethingToRedo(),hasSelectedEditor:!1})):(o(this,me,he).call(this),o(this,ge,Ce).call(this),o(this,A,Te).call(this,{isEditing:!1}))}registerEditorTypes(ce){if(!t(this,N)){h(this,N,ce);for(const Ee of t(this,N))o(this,O,Ie).call(this,Ee.defaultPropertiesToUpdate)}}getId(){return t(this,B).getId()}get currentLayer(){return t(this,F).get(t(this,j))}get currentPageIndex(){return t(this,j)}addLayer(ce){t(this,F).set(ce.pageIndex,ce),t(this,ie)?ce.enable():ce.disable()}removeLayer(ce){t(this,F).delete(ce.pageIndex)}updateMode(ce){if(h(this,q,ce),ce===p.AnnotationEditorType.NONE)this.setEditingState(!1),o(this,U,Ve).call(this);else{this.setEditingState(!0),o(this,M,He).call(this);for(const Ee of t(this,F).values())Ee.updateMode(ce)}}updateToolbar(ce){ce!==t(this,q)&&t(this,Y).dispatch("switchannotationeditormode",{source:this,mode:ce})}updateParams(ce,Ee){if(t(this,N)){for(const We of t(this,_))We.updateParams(ce,Ee);for(const We of t(this,N))We.updateDefaultParams(ce,Ee)}}getEditors(ce){const Ee=[];for(const We of t(this,x).values())We.pageIndex===ce&&Ee.push(We);return Ee}getEditor(ce){return t(this,x).get(ce)}addEditor(ce){t(this,x).set(ce.id,ce)}removeEditor(ce){var Ee;t(this,x).delete(ce.id),this.unselect(ce),(Ee=t(this,X))===null||Ee===void 0||Ee.remove(ce.id)}setActiveEditor(ce){t(this,w)!==ce&&(h(this,w,ce),ce&&o(this,O,Ie).call(this,ce.propertiesToUpdate))}toggleSelected(ce){if(t(this,_).has(ce)){t(this,_).delete(ce),ce.unselect(),o(this,A,Te).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,_).add(ce),ce.select(),o(this,O,Ie).call(this,ce.propertiesToUpdate),o(this,A,Te).call(this,{hasSelectedEditor:!0})}setSelected(ce){for(const Ee of t(this,_))Ee!==ce&&Ee.unselect();t(this,_).clear(),t(this,_).add(ce),ce.select(),o(this,O,Ie).call(this,ce.propertiesToUpdate),o(this,A,Te).call(this,{hasSelectedEditor:!0})}isSelected(ce){return t(this,_).has(ce)}unselect(ce){ce.unselect(),t(this,_).delete(ce),o(this,A,Te).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,_).size!==0}undo(){t(this,G).undo(),o(this,A,Te).call(this,{hasSomethingToUndo:t(this,G).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:o(this,se,T).call(this)})}redo(){t(this,G).redo(),o(this,A,Te).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,G).hasSomethingToRedo(),isEmpty:o(this,se,T).call(this)})}addCommands(ce){t(this,G).add(ce),o(this,A,Te).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:o(this,se,T).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const ce=[...t(this,_)],Ee=()=>{for(const Oe of ce)Oe.remove()},We=()=>{for(const Oe of ce)o(this,Z,ae).call(this,Oe)};this.addCommands({cmd:Ee,undo:We,mustExec:!0})}commitOrRemove(){var ce;(ce=t(this,w))===null||ce===void 0||ce.commitOrRemove()}selectAll(){for(const ce of t(this,_))ce.commit();o(this,ne,V).call(this,t(this,x).values())}unselectAll(){if(t(this,w)){t(this,w).commitOrRemove();return}if(t(this,_).size!==0){for(const ce of t(this,_))ce.unselect();t(this,_).clear(),o(this,A,Te).call(this,{hasSelectedEditor:!1})}}isActive(ce){return t(this,w)===ce}getActive(){return t(this,w)}getMode(){return t(this,q)}}E.AnnotationEditorUIManager=re;function ve(){t(this,fe).addEventListener("keydown",t(this,P))}function he(){t(this,fe).removeEventListener("keydown",t(this,P))}function be(){document.addEventListener("copy",t(this,H)),document.addEventListener("cut",t(this,$)),document.addEventListener("paste",t(this,C))}function Ce(){document.removeEventListener("copy",t(this,H)),document.removeEventListener("cut",t(this,$)),document.removeEventListener("paste",t(this,C))}function Te(Ae){Object.entries(Ae).some(Ee=>{let[We,Oe]=Ee;return t(this,ue)[We]!==Oe})&&t(this,Y).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,ue),Ae)})}function Ie(Ae){t(this,Y).dispatch("annotationeditorparamschanged",{source:this,details:Ae})}function He(){if(!t(this,ie)){h(this,ie,!0);for(const Ae of t(this,F).values())Ae.enable()}}function Ve(){if(this.unselectAll(),t(this,ie)){h(this,ie,!1);for(const Ae of t(this,F).values())Ae.disable()}}function ae(Ae){const ce=t(this,F).get(Ae.pageIndex);ce?ce.addOrRebuild(Ae):this.addEditor(Ae)}function T(){if(t(this,x).size===0)return!0;if(t(this,x).size===1)for(const Ae of t(this,x).values())return Ae.isEmpty();return!1}function V(Ae){t(this,_).clear();for(const ce of Ae)ce.isEmpty()||(t(this,_).add(ce),ce.select());o(this,A,Te).call(this,{hasSelectedEditor:!0})}I(re,"_keyboardManager",new g([[["ctrl+a","mac+meta+a"],re.prototype.selectAll],[["ctrl+z","mac+meta+z"],re.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],re.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],re.prototype.delete],[["Escape","mac+Escape"],re.prototype.unselectAll]]))},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.StatTimer=E.RenderingCancelledException=E.PixelsPerInch=E.PageViewport=E.PDFDateString=E.DOMStandardFontDataFactory=E.DOMSVGFactory=E.DOMCanvasFactory=E.DOMCMapReaderFactory=E.AnnotationPrefix=void 0,E.deprecated=g,E.getColorValues=F,E.getCurrentTransform=X,E.getCurrentTransformInverse=G,E.getFilenameFromUrl=c,E.getPdfFilenameFromUrl=b,E.getRGB=x,E.getXfaPageViewport=w,E.isDataScheme=i,E.isPdfFile=o,E.isValidFetchUrl=f,E.loadScript=s,E.setLayerDimensions=j;var p=l(140),v=l(1);const I="http://www.w3.org/2000/svg",k="pdfjs_internal_id_";E.AnnotationPrefix=k;const N=class{};let m=N;Et(m,"CSS",96),Et(m,"PDF",72),Et(m,"PDF_TO_CSS_UNITS",N.CSS/N.PDF),E.PixelsPerInch=m;class R extends p.BaseCanvasFactory{constructor(){let{ownerDocument:Y=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=Y}_createCanvas(Y,B){const ie=this._document.createElement("canvas");return ie.width=Y,ie.height=B,ie}}E.DOMCanvasFactory=R;async function t(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(f(Q,document.baseURI)){const B=await fetch(Q);if(!B.ok)throw new Error(B.statusText);return Y?new Uint8Array(await B.arrayBuffer()):(0,v.stringToBytes)(await B.text())}return new Promise((B,ie)=>{const q=new XMLHttpRequest;q.open("GET",Q,!0),Y&&(q.responseType="arraybuffer"),q.onreadystatechange=()=>{if(q.readyState===XMLHttpRequest.DONE){if(q.status===200||q.status===0){let _;if(Y&&q.response?_=new Uint8Array(q.response):!Y&&q.responseText&&(_=(0,v.stringToBytes)(q.responseText)),_){B(_);return}}ie(new Error(q.statusText))}},q.send(null)})}class n extends p.BaseCMapReaderFactory{_fetchData(Y,B){return t(Y,this.isCompressed).then(ie=>({cMapData:ie,compressionType:B}))}}E.DOMCMapReaderFactory=n;class h extends p.BaseStandardFontDataFactory{_fetchData(Y){return t(Y,!0)}}E.DOMStandardFontDataFactory=h;class a extends p.BaseSVGFactory{_createSVG(Y){return document.createElementNS(I,Y)}}E.DOMSVGFactory=a;class d{constructor(Y){let{viewBox:B,scale:ie,rotation:q,offsetX:_=0,offsetY:H=0,dontFlip:$=!1}=Y;this.viewBox=B,this.scale=ie,this.rotation=q,this.offsetX=_,this.offsetY=H;const C=(B[2]+B[0])/2,P=(B[3]+B[1])/2;let z,ee,te,K;switch(q%=360,q<0&&(q+=360),q){case 180:z=-1,ee=0,te=0,K=1;break;case 90:z=0,ee=1,te=1,K=0;break;case 270:z=0,ee=-1,te=-1,K=0;break;case 0:z=1,ee=0,te=0,K=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}$&&(te=-te,K=-K);let ue,fe,ye,me;z===0?(ue=Math.abs(P-B[1])*ie+_,fe=Math.abs(C-B[0])*ie+H,ye=(B[3]-B[1])*ie,me=(B[2]-B[0])*ie):(ue=Math.abs(C-B[0])*ie+_,fe=Math.abs(P-B[1])*ie+H,ye=(B[2]-B[0])*ie,me=(B[3]-B[1])*ie),this.transform=[z*ie,ee*ie,te*ie,K*ie,ue-z*ie*C-te*ie*P,fe-ee*ie*C-K*ie*P],this.width=ye,this.height=me}get rawDims(){const{viewBox:Y}=this;return(0,v.shadow)(this,"rawDims",{pageWidth:Y[2]-Y[0],pageHeight:Y[3]-Y[1],pageX:Y[0],pageY:Y[1]})}clone(){let{scale:Y=this.scale,rotation:B=this.rotation,offsetX:ie=this.offsetX,offsetY:q=this.offsetY,dontFlip:_=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new d({viewBox:this.viewBox.slice(),scale:Y,rotation:B,offsetX:ie,offsetY:q,dontFlip:_})}convertToViewportPoint(Y,B){return v.Util.applyTransform([Y,B],this.transform)}convertToViewportRectangle(Y){const B=v.Util.applyTransform([Y[0],Y[1]],this.transform),ie=v.Util.applyTransform([Y[2],Y[3]],this.transform);return[B[0],B[1],ie[0],ie[1]]}convertToPdfPoint(Y,B){return v.Util.applyInverseTransform([Y,B],this.transform)}}E.PageViewport=d;class r extends v.BaseException{constructor(Y,B){let ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;super(Y,"RenderingCancelledException"),this.type=B,this.extraDelay=ie}}E.RenderingCancelledException=r;function i(Q){const Y=Q.length;let B=0;for(;B<Y&&Q[B].trim()==="";)B++;return Q.substring(B,B+5).toLowerCase()==="data:"}function o(Q){return typeof Q=="string"&&/\.pdf$/i.test(Q)}function c(Q){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||([Q]=Q.split(/[#?]/,1)),Q.substring(Q.lastIndexOf("/")+1)}function b(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof Q!="string")return Y;if(i(Q))return(0,v.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),Y;const B=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ie=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,q=B.exec(Q);let _=ie.exec(q[1])||ie.exec(q[2])||ie.exec(q[3]);if(_&&(_=_[0],_.includes("%")))try{_=ie.exec(decodeURIComponent(_))[0]}catch{}return _||Y}class y{constructor(){Et(this,"started",Object.create(null));Et(this,"times",[])}time(Y){Y in this.started&&(0,v.warn)(`Timer is already running for ${Y}`),this.started[Y]=Date.now()}timeEnd(Y){Y in this.started||(0,v.warn)(`Timer has not been started for ${Y}`),this.times.push({name:Y,start:this.started[Y],end:Date.now()}),delete this.started[Y]}toString(){const Y=[];let B=0;for(const{name:ie}of this.times)B=Math.max(ie.length,B);for(const{name:ie,start:q,end:_}of this.times)Y.push(`${ie.padEnd(B)} ${_-q}ms
`);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){let{baseUrl:n=null}=t;this.constructor===k&&(0,p.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=n}async fetch(t){let{filename:n}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!n)throw new Error("Font filename must be specified.");const h=`${this.baseUrl}${n}`;return this._fetchData(h).catch(a=>{throw new Error(`Unable to load font data at: ${h}`)})}_fetchData(t){(0,p.unreachable)("Abstract method `_fetchData` called.")}}E.BaseStandardFontDataFactory=k;class m{constructor(){this.constructor===m&&(0,p.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,n){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t<=0||n<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),h||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${n}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${n}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,p.unreachable)("Abstract method `_createSVG` called.")}}E.BaseSVGFactory=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.MurmurHash3_64=void 0;var p=l(1);const v=3285377520,I=4294901760,k=65535;class m{constructor(t){this.h1=t?t&4294967295:v,this.h2=t?t&4294967295:v}update(t){let n,h;if(typeof t=="string"){n=new Uint8Array(t.length*2),h=0;for(let S=0,D=t.length;S<D;S++){const w=t.charCodeAt(S);w<=255?n[h++]=w:(n[h++]=w>>>8,n[h++]=w&255)}}else if((0,p.isArrayBuffer)(t))n=t.slice(),h=n.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const a=h>>2,d=h-a*4,r=new Uint32Array(n.buffer,0,a);let i=0,o=0,c=this.h1,b=this.h2;const y=3432918353,f=461845907,s=y&k,g=f&k;for(let S=0;S<a;S++)S&1?(i=r[S],i=i*y&I|i*s&k,i=i<<15|i>>>17,i=i*f&I|i*g&k,c^=i,c=c<<13|c>>>19,c=c*5+3864292196):(o=r[S],o=o*y&I|o*s&k,o=o<<15|o>>>17,o=o*f&I|o*g&k,b^=o,b=b<<13|b>>>19,b=b*5+3864292196);switch(i=0,d){case 3:i^=n[a*4+2]<<16;case 2:i^=n[a*4+1]<<8;case 1:i^=n[a*4],i=i*y&I|i*s&k,i=i<<15|i>>>17,i=i*f&I|i*g&k,a&1?c^=i:b^=i}this.h1=c,this.h2=b}hexdigest(){let t=this.h1,n=this.h2;return t^=n>>>1,t=t*3981806797&I|t*36045&k,n=n*4283543511&I|((n<<16|t>>>16)*2950163797&I)>>>16,t^=n>>>1,t=t*444984403&I|t*60499&k,n=n*3301882366&I|((n<<16|t>>>16)*3120437893&I)>>>16,t^=n>>>1,(t>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}E.MurmurHash3_64=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.FontLoader=E.FontFaceObject=void 0;var p=l(1),v=l(3);class I{constructor(R){let{onUnsupportedFeature:t,ownerDocument:n=globalThis.document,styleElement:h=null}=R;this._onUnsupportedFeature=t,this._document=n,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(R){this.nativeFontFaces.push(R),this._document.fonts.add(R)}insertRule(R){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(R,t.cssRules.length)}clear(){for(const R of this.nativeFontFaces)this._document.fonts.delete(R);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(R){if(R.attached||R.missingFile)return;if(R.attached=!0,this.isFontLoadingAPISupported){const n=R.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(h){throw this._onUnsupportedFeature({featureId:p.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,p.warn)(`Failed to load font '${n.family}': '${h}'.`),R.disableFontFace=!0,h}}return}const t=R.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const h=this._queueLoadingCallback(n);this._prepareFontLoadEvent(R,h)})}}get isFontLoadingAPISupported(){var R;const t=!!((R=this._document)!==null&&R!==void 0&&R.fonts);return(0,p.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let R=!1;return(v.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(R=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",R)}_queueLoadingCallback(R){function t(){for((0,p.assert)(!h.done,"completeRequest() cannot be called twice."),h.done=!0;n.length>0&&n[0].done;){const a=n.shift();setTimeout(a.callback,0)}}const{loadingRequests:n}=this,h={done:!1,complete:t,callback:R};return n.push(h),h}get _loadTestFont(){const R=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",R)}_prepareFontLoadEvent(R,t){function n(F,X){return F.charCodeAt(X)<<24|F.charCodeAt(X+1)<<16|F.charCodeAt(X+2)<<8|F.charCodeAt(X+3)&255}function h(F,X,G,j){const N=F.substring(0,X),Q=F.substring(X+G);return N+j+Q}let a,d;const r=this._document.createElement("canvas");r.width=1,r.height=1;const i=r.getContext("2d");let o=0;function c(F,X){if(++o>30){(0,p.warn)("Load test font never loaded."),X();return}if(i.font="30px "+F,i.fillText(".",0,20),i.getImageData(0,0,1,1).data[3]>0){X();return}setTimeout(c.bind(null,F,X))}const b=`lt${Date.now()}${this.loadTestFontId++}`;let y=this._loadTestFont;y=h(y,976,b.length,b);const s=16,g=1482184792;let S=n(y,s);for(a=0,d=b.length-3;a<d;a+=4)S=S-g+n(b,a)|0;a<b.length&&(S=S-g+n(b+"XXX",a)|0),y=h(y,s,4,(0,p.string32)(S));const D=`url(data:font/opentype;base64,${btoa(y)});`,w=`@font-face {font-family:"${b}";src:${D}}`;this.insertRule(w);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const F of[R.loadedName,b]){const X=this._document.createElement("span");X.textContent="Hi",X.style.fontFamily=F,x.append(X)}this._document.body.append(x),c(b,()=>{x.remove(),t.complete()})}}E.FontLoader=I;class k{constructor(R,t){let{isEvalSupported:n=!0,disableFontFace:h=!1,ignoreErrors:a=!1,onUnsupportedFeature:d,fontRegistry:r=null}=t;this.compiledGlyphs=Object.create(null);for(const i in R)this[i]=R[i];this.isEvalSupported=n!==!1,this.disableFontFace=h===!0,this.ignoreErrors=a===!0,this._onUnsupportedFeature=d,this.fontRegistry=r}createNativeFontFace(){var R;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return(R=this.fontRegistry)===null||R===void 0||R.registerFont(this),t}createFontFaceRule(){var R;if(!this.data||this.disableFontFace)return null;const t=(0,p.bytesToString)(this.data),n=`url(data:${this.mimetype};base64,${btoa(t)});`;let h;if(!this.cssFontInfo)h=`@font-face {font-family:"${this.loadedName}";src:${n}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),h=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${n}}`}return(R=this.fontRegistry)===null||R===void 0||R.registerFont(this,n),h}getPathGenerator(R,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n;try{n=R.get(this.loadedName+"_path_"+t)}catch(h){if(!this.ignoreErrors)throw h;return this._onUnsupportedFeature({featureId:p.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,p.warn)(`getPathGenerator - ignoring character: "${h}".`),this.compiledGlyphs[t]=function(a,d){}}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const h=[];for(const a of n){const d=a.args!==void 0?a.args.join(","):"";h.push("c.",a.cmd,"(",d,`);
`)}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>i||P>i)return null;const z=1e3,ee=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),te=C+1;let K=new Uint8Array(te*(P+1)),ue,fe,ye;const me=C+7&-8;let we=new Uint8Array(me*P),ge=0;for(const Z of $.data){let se=128;for(;se>0;)we[ge++]=Z&se?0:255,se>>=1}let A=0;for(ge=0,we[ge]!==0&&(K[0]=1,++A),fe=1;fe<C;fe++)we[ge]!==we[ge+1]&&(K[fe]=we[ge]?2:1,++A),ge++;for(we[ge]!==0&&(K[fe]=2,++A),ue=1;ue<P;ue++){ge=ue*me,ye=ue*te,we[ge-me]!==we[ge]&&(K[ye]=we[ge]?1:8,++A);let Z=(we[ge]?4:0)+(we[ge-me]?8:0);for(fe=1;fe<C;fe++)Z=(Z>>2)+(we[ge+1]?4:0)+(we[ge-me+1]?8:0),ee[Z]&&(K[ye+fe]=ee[Z],++A),ge++;if(we[ge-me]!==we[ge]&&(K[ye+fe]=we[ge]?2:4,++A),A>z)return null}for(ge=me*(P-1),ye=ue*te,we[ge]!==0&&(K[ye]=8,++A),fe=1;fe<C;fe++)we[ge]!==we[ge+1]&&(K[ye+fe]=we[ge]?4:8,++A),ge++;if(we[ge]!==0&&(K[ye+fe]=4,++A),A>z)return null;const O=new Int32Array([0,te,-1,0,-te,0,0,0,1]),M=new Path2D;for(ue=0;A&&ue<=P;ue++){let Z=ue*te;const se=Z+C;for(;Z<se&&!K[Z];)Z++;if(Z===se)continue;M.moveTo(Z%te,ue);const ne=Z;let re=K[Z];do{const ve=O[re];do Z+=ve;while(!K[Z]);const he=K[Z];he!==5&&he!==10?(re=he,K[Z]=0):(re=he&51*re>>4,K[Z]&=re>>2|re<<2),M.lineTo(Z%te,Z/te|0),K[Z]||--A}while(ne!==Z);--ue}return we=null,K=null,function(Z){Z.save(),Z.scale(1/C,-1/P),Z.translate(0,-P),Z.fill(M),Z.beginPath(),Z.restore()}}class s{constructor(C,P){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=p.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=p.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,C,P])}clone(){const C=Object.create(this);return C.clipBox=this.clipBox.slice(),C}setCurrentPoint(C,P){this.x=C,this.y=P}updatePathMinMax(C,P,z){[P,z]=p.Util.applyTransform([P,z],C),this.minX=Math.min(this.minX,P),this.minY=Math.min(this.minY,z),this.maxX=Math.max(this.maxX,P),this.maxY=Math.max(this.maxY,z)}updateRectMinMax(C,P){const z=p.Util.applyTransform(P,C),ee=p.Util.applyTransform(P.slice(2),C);this.minX=Math.min(this.minX,z[0],ee[0]),this.minY=Math.min(this.minY,z[1],ee[1]),this.maxX=Math.max(this.maxX,z[0],ee[0]),this.maxY=Math.max(this.maxY,z[1],ee[1])}updateScalingPathMinMax(C,P){p.Util.scaleMinMax(C,P),this.minX=Math.min(this.minX,P[0]),this.maxX=Math.max(this.maxX,P[1]),this.minY=Math.min(this.minY,P[2]),this.maxY=Math.max(this.maxY,P[3])}updateCurvePathMinMax(C,P,z,ee,te,K,ue,fe,ye,me){const we=p.Util.bezierBoundingBox(P,z,ee,te,K,ue,fe,ye);if(me){me[0]=Math.min(me[0],we[0],we[2]),me[1]=Math.max(me[1],we[0],we[2]),me[2]=Math.min(me[2],we[1],we[3]),me[3]=Math.max(me[3],we[1],we[3]);return}this.updateRectMinMax(C,we)}getPathBoundingBox(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const z=[this.minX,this.minY,this.maxX,this.maxY];if(C===I.PathType.STROKE){P||(0,p.unreachable)("Stroke bounding box must include transform.");const ee=p.Util.singularValueDecompose2dScale(P),te=ee[0]*this.lineWidth/2,K=ee[1]*this.lineWidth/2;z[0]-=te,z[1]-=K,z[2]+=te,z[3]+=K}return z}updateClipFromPath(){const C=p.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(C||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(C){this.clipBox=C,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return p.Util.intersect(this.clipBox,this.getPathBoundingBox(C,P))}}function g($,C){let P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(typeof ImageData<"u"&&C instanceof ImageData){$.putImageData(C,0,0);return}const z=C.height,ee=C.width,te=z%o,K=(z-te)/o,ue=te===0?K:K+1,fe=$.createImageData(ee,o);let ye=0,me;const we=C.data,ge=fe.data;let A,O,M,U,Z,se,ne,re;if(P)switch(P.length){case 1:Z=P[0],se=P[0],ne=P[0],re=P[0];break;case 4:Z=P[0],se=P[1],ne=P[2],re=P[3];break}if(C.kind===p.ImageKind.GRAYSCALE_1BPP){const ve=we.byteLength,he=new Uint32Array(ge.buffer,0,ge.byteLength>>2),be=he.length,Ce=ee+7>>3;let Te=4294967295,Ie=p.FeatureTest.isLittleEndian?4278190080:255;for(re&&re[0]===255&&re[255]===0&&([Te,Ie]=[Ie,Te]),A=0;A<ue;A++){for(M=A<K?o:te,me=0,O=0;O<M;O++){const He=ve-ye;let Ve=0;const ae=He>Ce?ee:He*8-7,T=ae&-8;let V=0,de=0;for(;Ve<T;Ve+=8)de=we[ye++],he[me++]=de&128?Te:Ie,he[me++]=de&64?Te:Ie,he[me++]=de&32?Te:Ie,he[me++]=de&16?Te:Ie,he[me++]=de&8?Te:Ie,he[me++]=de&4?Te:Ie,he[me++]=de&2?Te:Ie,he[me++]=de&1?Te:Ie;for(;Ve<ae;Ve++)V===0&&(de=we[ye++],V=128),he[me++]=de&V?Te:Ie,V>>=1}for(;me<be;)he[me++]=0;$.putImageData(fe,0,A*o)}}else if(C.kind===p.ImageKind.RGBA_32BPP){const ve=!!(Z||se||ne);for(O=0,U=ee*o*4,A=0;A<K;A++){if(ge.set(we.subarray(ye,ye+U)),ye+=U,ve)for(let he=0;he<U;he+=4)Z&&(ge[he+0]=Z[ge[he+0]]),se&&(ge[he+1]=se[ge[he+1]]),ne&&(ge[he+2]=ne[ge[he+2]]);$.putImageData(fe,0,O),O+=o}if(A<ue){if(U=ee*te*4,ge.set(we.subarray(ye,ye+U)),ve)for(let he=0;he<U;he+=4)Z&&(ge[he+0]=Z[ge[he+0]]),se&&(ge[he+1]=se[ge[he+1]]),ne&&(ge[he+2]=ne[ge[he+2]]);$.putImageData(fe,0,O)}}else if(C.kind===p.ImageKind.RGB_24BPP){const ve=!!(Z||se||ne);for(M=o,U=ee*M,A=0;A<ue;A++){for(A>=K&&(M=te,U=ee*M),me=0,O=U;O--;)ge[me++]=we[ye++],ge[me++]=we[ye++],ge[me++]=we[ye++],ge[me++]=255;if(ve)for(let he=0;he<me;he+=4)Z&&(ge[he+0]=Z[ge[he+0]]),se&&(ge[he+1]=se[ge[he+1]]),ne&&(ge[he+2]=ne[ge[he+2]]);$.putImageData(fe,0,A*o)}}else throw new Error(`bad image kind: ${C.kind}`)}function S($,C){if(C.bitmap){$.drawImage(C.bitmap,0,0);return}const P=C.height,z=C.width,ee=P%o,te=(P-ee)/o,K=ee===0?te:te+1,ue=$.createImageData(z,o);let fe=0;const ye=C.data,me=ue.data;for(let we=0;we<K;we++){const ge=we<te?o:ee;({srcPos:fe}=(0,k.applyMaskImageData)({src:ye,srcPos:fe,dest:me,width:z,height:ge})),$.putImageData(ue,0,we*o)}}function D($,C){const P=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(const z of P)$[z]!==void 0&&(C[z]=$[z]);$.setLineDash!==void 0&&(C.setLineDash($.getLineDash()),C.lineDashOffset=$.lineDashOffset)}function w($,C){$.strokeStyle=$.fillStyle=C||"#000000",$.fillRule="nonzero",$.globalAlpha=1,$.lineWidth=1,$.lineCap="butt",$.lineJoin="miter",$.miterLimit=10,$.globalCompositeOperation="source-over",$.font="10px sans-serif",$.setLineDash!==void 0&&($.setLineDash([]),$.lineDashOffset=0)}function x($,C,P,z){const ee=$.length;for(let te=3;te<ee;te+=4){const K=$[te];if(K===0)$[te-3]=C,$[te-2]=P,$[te-1]=z;else if(K<255){const ue=255-K;$[te-3]=$[te-3]*K+C*ue>>8,$[te-2]=$[te-2]*K+P*ue>>8,$[te-1]=$[te-1]*K+z*ue>>8}}}function F($,C,P){const z=$.length,ee=1/255;for(let te=3;te<z;te+=4){const K=P?P[$[te]]:$[te];C[te]=C[te]*K*ee|0}}function X($,C,P){const z=$.length;for(let ee=3;ee<z;ee+=4){const te=$[ee-3]*77+$[ee-2]*152+$[ee-1]*28;C[ee]=P?C[ee]*P[te>>8]>>8:C[ee]*te>>16}}function G($,C,P,z,ee,te,K,ue,fe,ye,me){const we=!!te,ge=we?te[0]:0,A=we?te[1]:0,O=we?te[2]:0;let M;ee==="Luminosity"?M=X:M=F;const Z=Math.min(z,Math.ceil(1048576/P));for(let se=0;se<z;se+=Z){const ne=Math.min(Z,z-se),re=$.getImageData(ue-ye,se+(fe-me),P,ne),ve=C.getImageData(ue,se+fe,P,ne);we&&x(re.data,ge,A,O),M(re.data,ve.data,K),C.putImageData(ve,ue,se+fe)}}function j($,C,P,z){const ee=z[0],te=z[1],K=z[2]-ee,ue=z[3]-te;K===0||ue===0||(G(C.context,P,K,ue,C.subtype,C.backdrop,C.transferMap,ee,te,C.offsetX,C.offsetY),$.save(),$.globalAlpha=1,$.globalCompositeOperation="source-over",$.setTransform(1,0,0,1,0,0),$.drawImage(P.canvas,0,0),$.restore())}function N($,C){const P=p.Util.singularValueDecompose2dScale($);P[0]=Math.fround(P[0]),P[1]=Math.fround(P[1]);const z=Math.fround((globalThis.devicePixelRatio||1)*v.PixelsPerInch.PDF_TO_CSS_UNITS);return C!==void 0?C:P[0]<=z||P[1]<=z}const Q=["butt","round","square"],Y=["miter","round","bevel"],B={},ie={};var q=new WeakSet;class _{constructor(C,P,z,ee,te,K,ue){let{optionalContentConfig:fe,markedContentStack:ye=null}=te;m(this,q),this.ctx=C,this.current=new s(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=P,this.objs=z,this.canvasFactory=ee,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=ye||[],this.optionalContentConfig=fe,this.cachedCanvases=new b(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=K,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=(ue==null?void 0:ue.background)||null,this.foregroundColor=(ue==null?void 0:ue.foreground)||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(C){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof C=="string"?C.startsWith("g_")?this.commonObjs.get(C):this.objs.get(C):P}beginDrawing(C){let{transform:P,viewport:z,transparency:ee=!1,background:te=null}=C;const K=this.ctx.canvas.width,ue=this.ctx.canvas.height,fe=te||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const ye=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const me=this.backgroundColor=this.ctx.fillStyle;let we=!0,ge=fe;if(this.ctx.fillStyle=fe,ge=this.ctx.fillStyle,we=typeof ge=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ge),ye==="#000000"&&me==="#ffffff"||ye===me||!we)this.foregroundColor=this.backgroundColor=null;else{const[A,O,M]=(0,v.getRGB)(ge),U=se=>(se/=255,se<=.03928?se/12.92:((se+.055)/1.055)**2.4),Z=Math.round(.2126*U(A)+.7152*U(O)+.0722*U(M));this.selectColor=(se,ne,re)=>{const ve=.2126*U(se)+.7152*U(ne)+.0722*U(re);return Math.round(ve)===Z?me:ye}}}if(this.ctx.fillStyle=this.backgroundColor||fe,this.ctx.fillRect(0,0,K,ue),this.ctx.restore(),ee){const ye=this.cachedCanvases.getCanvas("transparent",K,ue);this.compositeCtx=this.ctx,this.transparentCanvas=ye.canvas,this.ctx=ye.context,this.ctx.save(),this.ctx.transform(...(0,v.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),w(this.ctx,this.foregroundColor),P&&(this.ctx.transform(...P),this.outputScaleX=P[0],this.outputScaleY=P[0]),this.ctx.transform(...z.transform),this.viewportScale=z.scale,this.baseTransform=(0,v.getCurrentTransform)(this.ctx)}executeOperatorList(C,P,z,ee){const te=C.argsArray,K=C.fnArray;let ue=P||0;const fe=te.length;if(fe===ue)return ue;const ye=fe-ue>r&&typeof z=="function",me=ye?Date.now()+d:0;let we=0;const ge=this.commonObjs,A=this.objs;let O;for(;;){if(ee!==void 0&&ue===ee.nextBreakPoint)return ee.breakIt(ue,z),ue;if(O=K[ue],O!==p.OPS.dependency)this[O].apply(this,te[ue]);else for(const M of te[ue]){const U=M.startsWith("g_")?ge:A;if(!U.has(M))return U.get(M,z),ue}if(ue++,ue===fe)return ue;if(ye&&++we>r){if(Date.now()>me)return z(),ue;we=0}}}endDrawing(){t(this,q,H).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const C of this._cachedBitmapsMap.values()){for(const P of C.values())typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement&&(P.width=P.height=0);C.clear()}this._cachedBitmapsMap.clear()}_scaleImage(C,P){const z=C.width,ee=C.height;let te=Math.max(Math.hypot(P[0],P[1]),1),K=Math.max(Math.hypot(P[2],P[3]),1),ue=z,fe=ee,ye="prescale1",me,we;for(;te>2&&ue>1||K>2&&fe>1;){let ge=ue,A=fe;te>2&&ue>1&&(ge=Math.ceil(ue/2),te/=ue/ge),K>2&&fe>1&&(A=Math.ceil(fe/2),K/=fe/A),me=this.cachedCanvases.getCanvas(ye,ge,A),we=me.context,we.clearRect(0,0,ge,A),we.drawImage(C,0,0,ue,fe,0,0,ge,A),C=me.canvas,ue=ge,fe=A,ye=ye==="prescale1"?"prescale2":"prescale1"}return{img:C,paintWidth:ue,paintHeight:fe}}_createMaskCanvas(C){const P=this.ctx,{width:z,height:ee}=C,te=this.current.fillColor,K=this.current.patternFill,ue=(0,v.getCurrentTransform)(P);let fe,ye,me,we;if((C.bitmap||C.data)&&C.count>1){const be=C.bitmap||C.data.buffer;ye=JSON.stringify(K?ue:[ue.slice(0,4),te]),fe=this._cachedBitmapsMap.get(be),fe||(fe=new Map,this._cachedBitmapsMap.set(be,fe));const Ce=fe.get(ye);if(Ce&&!K){const Te=Math.round(Math.min(ue[0],ue[2])+ue[4]),Ie=Math.round(Math.min(ue[1],ue[3])+ue[5]);return{canvas:Ce,offsetX:Te,offsetY:Ie}}me=Ce}me||(we=this.cachedCanvases.getCanvas("maskCanvas",z,ee),S(we.context,C));let ge=p.Util.transform(ue,[1/z,0,0,-1/ee,0,0]);ge=p.Util.transform(ge,[1,0,0,1,0,-ee]);const A=p.Util.applyTransform([0,0],ge),O=p.Util.applyTransform([z,ee],ge),M=p.Util.normalizeRect([A[0],A[1],O[0],O[1]]),U=Math.round(M[2]-M[0])||1,Z=Math.round(M[3]-M[1])||1,se=this.cachedCanvases.getCanvas("fillCanvas",U,Z),ne=se.context,re=Math.min(A[0],O[0]),ve=Math.min(A[1],O[1]);ne.translate(-re,-ve),ne.transform(...ge),me||(me=this._scaleImage(we.canvas,(0,v.getCurrentTransformInverse)(ne)),me=me.img,fe&&K&&fe.set(ye,me)),ne.imageSmoothingEnabled=N((0,v.getCurrentTransform)(ne),C.interpolate),y(ne,me,0,0,me.width,me.height,0,0,z,ee),ne.globalCompositeOperation="source-in";const he=p.Util.transform((0,v.getCurrentTransformInverse)(ne),[1,0,0,1,-re,-ve]);return ne.fillStyle=K?te.getPattern(P,this,he,I.PathType.FILL):te,ne.fillRect(0,0,z,ee),fe&&!K&&(this.cachedCanvases.delete("fillCanvas"),fe.set(ye,se.canvas)),{canvas:se.canvas,offsetX:Math.round(re),offsetY:Math.round(ve)}}setLineWidth(C){C!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=C,this.ctx.lineWidth=C}setLineCap(C){this.ctx.lineCap=Q[C]}setLineJoin(C){this.ctx.lineJoin=Y[C]}setMiterLimit(C){this.ctx.miterLimit=C}setDash(C,P){const z=this.ctx;z.setLineDash!==void 0&&(z.setLineDash(C),z.lineDashOffset=P)}setRenderingIntent(C){}setFlatness(C){}setGState(C){for(const[P,z]of C)switch(P){case"LW":this.setLineWidth(z);break;case"LC":this.setLineCap(z);break;case"LJ":this.setLineJoin(z);break;case"ML":this.setMiterLimit(z);break;case"D":this.setDash(z[0],z[1]);break;case"RI":this.setRenderingIntent(z);break;case"FL":this.setFlatness(z);break;case"Font":this.setFont(z[0],z[1]);break;case"CA":this.current.strokeAlpha=z;break;case"ca":this.current.fillAlpha=z,this.ctx.globalAlpha=z;break;case"BM":this.ctx.globalCompositeOperation=z;break;case"SMask":this.current.activeSMask=z?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=z}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const C=this.inSMaskMode;this.current.activeSMask&&!C?this.beginSMaskMode():!this.current.activeSMask&&C&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const C=this.ctx.canvas.width,P=this.ctx.canvas.height,z="smaskGroupAt"+this.groupLevel,ee=this.cachedCanvases.getCanvas(z,C,P);this.suspendedCtx=this.ctx,this.ctx=ee.context;const te=this.ctx;te.setTransform(...(0,v.getCurrentTransform)(this.suspendedCtx)),D(this.suspendedCtx,te),c(te,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),D(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(C){if(!this.current.activeSMask)return;C?(C[0]=Math.floor(C[0]),C[1]=Math.floor(C[1]),C[2]=Math.ceil(C[2]),C[3]=Math.ceil(C[3])):C=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const P=this.current.activeSMask,z=this.suspendedCtx;j(z,P,this.ctx,C),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(D(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const C=this.current;this.stateStack.push(C),this.current=C.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),D(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(C,P,z,ee,te,K){this.ctx.transform(C,P,z,ee,te,K),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(C,P,z){const ee=this.ctx,te=this.current;let K=te.x,ue=te.y,fe,ye;const me=(0,v.getCurrentTransform)(ee),we=me[0]===0&&me[3]===0||me[1]===0&&me[2]===0,ge=we?z.slice(0):null;for(let A=0,O=0,M=C.length;A<M;A++)switch(C[A]|0){case p.OPS.rectangle:K=P[O++],ue=P[O++];const U=P[O++],Z=P[O++],se=K+U,ne=ue+Z;ee.moveTo(K,ue),U===0||Z===0?ee.lineTo(se,ne):(ee.lineTo(se,ue),ee.lineTo(se,ne),ee.lineTo(K,ne)),we||te.updateRectMinMax(me,[K,ue,se,ne]),ee.closePath();break;case p.OPS.moveTo:K=P[O++],ue=P[O++],ee.moveTo(K,ue),we||te.updatePathMinMax(me,K,ue);break;case p.OPS.lineTo:K=P[O++],ue=P[O++],ee.lineTo(K,ue),we||te.updatePathMinMax(me,K,ue);break;case p.OPS.curveTo:fe=K,ye=ue,K=P[O+4],ue=P[O+5],ee.bezierCurveTo(P[O],P[O+1],P[O+2],P[O+3],K,ue),te.updateCurvePathMinMax(me,fe,ye,P[O],P[O+1],P[O+2],P[O+3],K,ue,ge),O+=6;break;case p.OPS.curveTo2:fe=K,ye=ue,ee.bezierCurveTo(K,ue,P[O],P[O+1],P[O+2],P[O+3]),te.updateCurvePathMinMax(me,fe,ye,K,ue,P[O],P[O+1],P[O+2],P[O+3],ge),K=P[O+2],ue=P[O+3],O+=4;break;case p.OPS.curveTo3:fe=K,ye=ue,K=P[O+2],ue=P[O+3],ee.bezierCurveTo(P[O],P[O+1],K,ue,K,ue),te.updateCurvePathMinMax(me,fe,ye,P[O],P[O+1],K,ue,K,ue,ge),O+=4;break;case p.OPS.closePath:ee.closePath();break}we&&te.updateScalingPathMinMax(me,ge),te.setCurrentPoint(K,ue)}closePath(){this.ctx.closePath()}stroke(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const P=this.ctx,z=this.current.strokeColor;P.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof z=="object"&&z!==null&&z!==void 0&&z.getPattern?(P.save(),P.strokeStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.STROKE),this.rescaleAndStroke(!1),P.restore()):this.rescaleAndStroke(!0)),C&&this.consumePath(this.current.getClippedPathBoundingBox()),P.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const P=this.ctx,z=this.current.fillColor,ee=this.current.patternFill;let te=!1;ee&&(P.save(),P.fillStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.FILL),te=!0);const K=this.current.getClippedPathBoundingBox();this.contentVisible&&K!==null&&(this.pendingEOFill?(P.fill("evenodd"),this.pendingEOFill=!1):P.fill()),te&&P.restore(),C&&this.consumePath(K)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=B}eoClip(){this.pendingClip=ie}beginText(){this.current.textMatrix=p.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const C=this.pendingTextPaths,P=this.ctx;if(C===void 0){P.beginPath();return}P.save(),P.beginPath();for(const z of C)P.setTransform(...z.transform),P.translate(z.x,z.y),z.addToPath(P,z.fontSize);P.restore(),P.clip(),P.beginPath(),delete this.pendingTextPaths}setCharSpacing(C){this.current.charSpacing=C}setWordSpacing(C){this.current.wordSpacing=C}setHScale(C){this.current.textHScale=C/100}setLeading(C){this.current.leading=-C}setFont(C,P){const z=this.commonObjs.get(C),ee=this.current;if(!z)throw new Error(`Can't find font for ${C}`);if(ee.fontMatrix=z.fontMatrix||p.FONT_IDENTITY_MATRIX,(ee.fontMatrix[0]===0||ee.fontMatrix[3]===0)&&(0,p.warn)("Invalid font matrix for font "+C),P<0?(P=-P,ee.fontDirection=-1):ee.fontDirection=1,this.current.font=z,this.current.fontSize=P,z.isType3Font)return;const te=z.loadedName||"sans-serif";let K="normal";z.black?K="900":z.bold&&(K="bold");const ue=z.italic?"italic":"normal",fe=`"${te}", ${z.fallbackName}`;let ye=P;P<n?ye=n:P>h&&(ye=h),this.current.fontSizeScale=P/ye,this.ctx.font=`${ue} ${K} ${ye}px ${fe}`}setTextRenderingMode(C){this.current.textRenderingMode=C}setTextRise(C){this.current.textRise=C}moveText(C,P){this.current.x=this.current.lineX+=C,this.current.y=this.current.lineY+=P}setLeadingMoveText(C,P){this.setLeading(-P),this.moveText(C,P)}setTextMatrix(C,P,z,ee,te,K){this.current.textMatrix=[C,P,z,ee,te,K],this.current.textMatrixScale=Math.hypot(C,P),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(C,P,z,ee){const te=this.ctx,K=this.current,ue=K.font,fe=K.textRenderingMode,ye=K.fontSize/K.fontSizeScale,me=fe&p.TextRenderingMode.FILL_STROKE_MASK,we=!!(fe&p.TextRenderingMode.ADD_TO_PATH_FLAG),ge=K.patternFill&&!ue.missingFile;let A;(ue.disableFontFace||we||ge)&&(A=ue.getPathGenerator(this.commonObjs,C)),ue.disableFontFace||ge?(te.save(),te.translate(P,z),te.beginPath(),A(te,ye),ee&&te.setTransform(...ee),(me===p.TextRenderingMode.FILL||me===p.TextRenderingMode.FILL_STROKE)&&te.fill(),(me===p.TextRenderingMode.STROKE||me===p.TextRenderingMode.FILL_STROKE)&&te.stroke(),te.restore()):((me===p.TextRenderingMode.FILL||me===p.TextRenderingMode.FILL_STROKE)&&te.fillText(C,P,z),(me===p.TextRenderingMode.STROKE||me===p.TextRenderingMode.FILL_STROKE)&&te.strokeText(C,P,z)),we&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,v.getCurrentTransform)(te),x:P,y:z,fontSize:ye,addToPath:A})}get isFontSubpixelAAEnabled(){const{context:C}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);C.scale(1.5,1),C.fillText("I",0,10);const P=C.getImageData(0,0,10,10).data;let z=!1;for(let ee=3;ee<P.length;ee+=4)if(P[ee]>0&&P[ee]<255){z=!0;break}return(0,p.shadow)(this,"isFontSubpixelAAEnabled",z)}showText(C){const P=this.current,z=P.font;if(z.isType3Font)return this.showType3Text(C);const ee=P.fontSize;if(ee===0)return;const te=this.ctx,K=P.fontSizeScale,ue=P.charSpacing,fe=P.wordSpacing,ye=P.fontDirection,me=P.textHScale*ye,we=C.length,ge=z.vertical,A=ge?1:-1,O=z.defaultVMetrics,M=ee*P.fontMatrix[0],U=P.textRenderingMode===p.TextRenderingMode.FILL&&!z.disableFontFace&&!P.patternFill;te.save(),te.transform(...P.textMatrix),te.translate(P.x,P.y+P.textRise),ye>0?te.scale(me,-1):te.scale(me,1);let Z;if(P.patternFill){te.save();const he=P.fillColor.getPattern(te,this,(0,v.getCurrentTransformInverse)(te),I.PathType.FILL);Z=(0,v.getCurrentTransform)(te),te.restore(),te.fillStyle=he}let se=P.lineWidth;const ne=P.textMatrixScale;if(ne===0||se===0){const he=P.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;(he===p.TextRenderingMode.STROKE||he===p.TextRenderingMode.FILL_STROKE)&&(se=this.getSinglePixelWidth())}else se/=ne;if(K!==1&&(te.scale(K,K),se/=K),te.lineWidth=se,z.isInvalidPDFjsFont){const he=[];let be=0;for(const Ce of C)he.push(Ce.unicode),be+=Ce.width;te.fillText(he.join(""),0,0),P.x+=be*M*me,te.restore(),this.compose();return}let re=0,ve;for(ve=0;ve<we;++ve){const he=C[ve];if(typeof he=="number"){re+=A*he*ee/1e3;continue}let be=!1;const Ce=(he.isSpace?fe:0)+ue,Te=he.fontChar,Ie=he.accent;let He,Ve,ae=he.width;if(ge){const V=he.vmetric||O,de=-(he.vmetric?V[1]:ae*.5)*M,Pe=V[2]*M;ae=V?-V[0]:ae,He=de/K,Ve=(re+Pe)/K}else He=re/K,Ve=0;if(z.remeasure&&ae>0){const V=te.measureText(Te).width*1e3/ee*K;if(ae<V&&this.isFontSubpixelAAEnabled){const de=ae/V;be=!0,te.save(),te.scale(de,1),He/=de}else ae!==V&&(He+=(ae-V)/2e3*ee/K)}if(this.contentVisible&&(he.isInFont||z.missingFile)){if(U&&!Ie)te.fillText(Te,He,Ve);else if(this.paintChar(Te,He,Ve,Z),Ie){const V=He+ee*Ie.offset.x/K,de=Ve-ee*Ie.offset.y/K;this.paintChar(Ie.fontChar,V,de,Z)}}let T;ge?T=ae*M-Ce*ye:T=ae*M+Ce*ye,re+=T,be&&te.restore()}ge?P.y-=re:P.x+=re*me,te.restore(),this.compose()}showType3Text(C){const P=this.ctx,z=this.current,ee=z.font,te=z.fontSize,K=z.fontDirection,ue=ee.vertical?1:-1,fe=z.charSpacing,ye=z.wordSpacing,me=z.textHScale*K,we=z.fontMatrix||p.FONT_IDENTITY_MATRIX,ge=C.length,A=z.textRenderingMode===p.TextRenderingMode.INVISIBLE;let O,M,U,Z;if(!(A||te===0)){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,P.save(),P.transform(...z.textMatrix),P.translate(z.x,z.y),P.scale(me,K),O=0;O<ge;++O){if(M=C[O],typeof M=="number"){Z=ue*M*te/1e3,this.ctx.translate(Z,0),z.x+=Z*me;continue}const se=(M.isSpace?ye:0)+fe,ne=ee.charProcOperatorList[M.operatorListId];if(!ne){(0,p.warn)(`Type3 character "${M.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=M,this.save(),P.scale(te,te),P.transform(...we),this.executeOperatorList(ne),this.restore()),U=p.Util.applyTransform([M.width,0],we)[0]*te+se,P.translate(U,0),z.x+=U*me}P.restore(),this.processingType3=null}}setCharWidth(C,P){}setCharWidthAndBounds(C,P,z,ee,te,K){this.ctx.rect(z,ee,te-z,K-ee),this.ctx.clip(),this.endPath()}getColorN_Pattern(C){let P;if(C[0]==="TilingPattern"){const z=C[1],ee=this.baseTransform||(0,v.getCurrentTransform)(this.ctx),te={createCanvasGraphics:K=>new _(K,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};P=new I.TilingPattern(C,z,this.ctx,te,ee)}else P=this._getPattern(C[1],C[2]);return P}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(C,P,z){var ee;const te=((ee=this.selectColor)===null||ee===void 0?void 0:ee.call(this,C,P,z))||p.Util.makeHexColor(C,P,z);this.ctx.strokeStyle=te,this.current.strokeColor=te}setFillRGBColor(C,P,z){var ee;const te=((ee=this.selectColor)===null||ee===void 0?void 0:ee.call(this,C,P,z))||p.Util.makeHexColor(C,P,z);this.ctx.fillStyle=te,this.current.fillColor=te,this.current.patternFill=!1}_getPattern(C){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,z;return this.cachedPatterns.has(C)?z=this.cachedPatterns.get(C):(z=(0,I.getShadingPattern)(this.objs.get(C)),this.cachedPatterns.set(C,z)),P&&(z.matrix=P),z}shadingFill(C){if(!this.contentVisible)return;const P=this.ctx;this.save();const z=this._getPattern(C);P.fillStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.SHADING);const ee=(0,v.getCurrentTransformInverse)(P);if(ee){const te=P.canvas,K=te.width,ue=te.height,fe=p.Util.applyTransform([0,0],ee),ye=p.Util.applyTransform([0,ue],ee),me=p.Util.applyTransform([K,0],ee),we=p.Util.applyTransform([K,ue],ee),ge=Math.min(fe[0],ye[0],me[0],we[0]),A=Math.min(fe[1],ye[1],me[1],we[1]),O=Math.max(fe[0],ye[0],me[0],we[0]),M=Math.max(fe[1],ye[1],me[1],we[1]);this.ctx.fillRect(ge,A,O-ge,M-A)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,p.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,p.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(C,P){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(C)&&C.length===6&&this.transform(...C),this.baseTransform=(0,v.getCurrentTransform)(this.ctx),P)){const z=P[2]-P[0],ee=P[3]-P[1];this.ctx.rect(P[0],P[1],z,ee),this.current.updateRectMinMax((0,v.getCurrentTransform)(this.ctx),P),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(C){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const P=this.ctx;C.isolated||(0,p.info)("TODO: Support non-isolated groups."),C.knockout&&(0,p.warn)("Knockout groups not supported.");const z=(0,v.getCurrentTransform)(P);if(C.matrix&&P.transform(...C.matrix),!C.bbox)throw new Error("Bounding box is required.");let ee=p.Util.getAxialAlignedBoundingBox(C.bbox,(0,v.getCurrentTransform)(P));const te=[0,0,P.canvas.width,P.canvas.height];ee=p.Util.intersect(ee,te)||[0,0,0,0];const K=Math.floor(ee[0]),ue=Math.floor(ee[1]);let fe=Math.max(Math.ceil(ee[2])-K,1),ye=Math.max(Math.ceil(ee[3])-ue,1),me=1,we=1;fe>a&&(me=fe/a,fe=a),ye>a&&(we=ye/a,ye=a),this.current.startNewPathAndClipBox([0,0,fe,ye]);let ge="groupAt"+this.groupLevel;C.smask&&(ge+="_smask_"+this.smaskCounter++%2);const A=this.cachedCanvases.getCanvas(ge,fe,ye),O=A.context;O.scale(1/me,1/we),O.translate(-K,-ue),O.transform(...z),C.smask?this.smaskStack.push({canvas:A.canvas,context:O,offsetX:K,offsetY:ue,scaleX:me,scaleY:we,subtype:C.smask.subtype,backdrop:C.smask.backdrop,transferMap:C.smask.transferMap||null,startTransformInverse:null}):(P.setTransform(1,0,0,1,0,0),P.translate(K,ue),P.scale(me,we),P.save()),D(P,O),this.ctx=O,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(P),this.groupLevel++}endGroup(C){if(!this.contentVisible)return;this.groupLevel--;const P=this.ctx,z=this.groupStack.pop();if(this.ctx=z,this.ctx.imageSmoothingEnabled=!1,C.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const ee=(0,v.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...ee);const te=p.Util.getAxialAlignedBoundingBox([0,0,P.canvas.width,P.canvas.height],ee);this.ctx.drawImage(P.canvas,0,0),this.ctx.restore(),this.compose(te)}}beginAnnotation(C,P,z,ee,te){if(t(this,q,H).call(this),w(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(P)&&P.length===4){const K=P[2]-P[0],ue=P[3]-P[1];if(te&&this.annotationCanvasMap){z=z.slice(),z[4]-=P[0],z[5]-=P[1],P=P.slice(),P[0]=P[1]=0,P[2]=K,P[3]=ue;const[fe,ye]=p.Util.singularValueDecompose2dScale((0,v.getCurrentTransform)(this.ctx)),{viewportScale:me}=this,we=Math.ceil(K*this.outputScaleX*me),ge=Math.ceil(ue*this.outputScaleY*me);this.annotationCanvas=this.canvasFactory.create(we,ge);const{canvas:A,context:O}=this.annotationCanvas;this.annotationCanvasMap.set(C,A),this.annotationCanvas.savedCtx=this.ctx,this.ctx=O,this.ctx.setTransform(fe,0,0,-ye,0,ue*ye),w(this.ctx,this.foregroundColor)}else w(this.ctx,this.foregroundColor),this.ctx.rect(P[0],P[1],K,ue),this.ctx.clip(),this.endPath()}this.current=new s(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...z),this.transform(...ee)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(C){if(!this.contentVisible)return;const P=C.count;C=this.getObject(C.data,C),C.count=P;const z=this.ctx,ee=this.processingType3;if(ee&&(ee.compiled===void 0&&(ee.compiled=f(C)),ee.compiled)){ee.compiled(z);return}const te=this._createMaskCanvas(C),K=te.canvas;z.save(),z.setTransform(1,0,0,1,0,0),z.drawImage(K,te.offsetX,te.offsetY),z.restore(),this.compose()}paintImageMaskXObjectRepeat(C,P){let z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,te=arguments.length>4?arguments[4]:void 0,K=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;C=this.getObject(C.data,C);const ue=this.ctx;ue.save();const fe=(0,v.getCurrentTransform)(ue);ue.transform(P,z,ee,te,0,0);const ye=this._createMaskCanvas(C);ue.setTransform(1,0,0,1,ye.offsetX-fe[4],ye.offsetY-fe[5]);for(let me=0,we=K.length;me<we;me+=2){const ge=p.Util.transform(fe,[P,z,ee,te,K[me],K[me+1]]),[A,O]=p.Util.applyTransform([0,0],ge);ue.drawImage(ye.canvas,A,O)}ue.restore(),this.compose()}paintImageMaskXObjectGroup(C){if(!this.contentVisible)return;const P=this.ctx,z=this.current.fillColor,ee=this.current.patternFill;for(const te of C){const{data:K,width:ue,height:fe,transform:ye}=te,me=this.cachedCanvases.getCanvas("maskCanvas",ue,fe),we=me.context;we.save();const ge=this.getObject(K,te);S(we,ge),we.globalCompositeOperation="source-in",we.fillStyle=ee?z.getPattern(we,this,(0,v.getCurrentTransformInverse)(P),I.PathType.FILL):z,we.fillRect(0,0,ue,fe),we.restore(),P.save(),P.transform(...ye),P.scale(1,-1),y(P,me.canvas,0,0,ue,fe,0,-1,1,1),P.restore()}this.compose()}paintImageXObject(C){if(!this.contentVisible)return;const P=this.getObject(C);if(!P){(0,p.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(P)}paintImageXObjectRepeat(C,P,z,ee){if(!this.contentVisible)return;const te=this.getObject(C);if(!te){(0,p.warn)("Dependent image isn't ready yet");return}const K=te.width,ue=te.height,fe=[];for(let ye=0,me=ee.length;ye<me;ye+=2)fe.push({transform:[P,0,0,z,ee[ye],ee[ye+1]],x:0,y:0,w:K,h:ue});this.paintInlineImageXObjectGroup(te,fe)}paintInlineImageXObject(C){if(!this.contentVisible)return;const P=C.width,z=C.height,ee=this.ctx;this.save(),ee.scale(1/P,-1/z);let te;if(typeof HTMLElement=="function"&&C instanceof HTMLElement||!C.data)te=C;else{const ue=this.cachedCanvases.getCanvas("inlineImage",P,z),fe=ue.context;g(fe,C,this.current.transferMaps),te=ue.canvas}const K=this._scaleImage(te,(0,v.getCurrentTransformInverse)(ee));ee.imageSmoothingEnabled=N((0,v.getCurrentTransform)(ee),C.interpolate),y(ee,K.img,0,0,K.paintWidth,K.paintHeight,0,-z,P,z),this.compose(),this.restore()}paintInlineImageXObjectGroup(C,P){if(!this.contentVisible)return;const z=this.ctx,ee=C.width,te=C.height,K=this.cachedCanvases.getCanvas("inlineImage",ee,te),ue=K.context;g(ue,C,this.current.transferMaps);for(const fe of P)z.save(),z.transform(...fe.transform),z.scale(1,-1),y(z,K.canvas,fe.x,fe.y,fe.w,fe.h,0,-1,1,1),z.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(C){}markPointProps(C,P){}beginMarkedContent(C){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(C,P){C==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(P)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(C){const P=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(C);const z=this.ctx;this.pendingClip&&(P||(this.pendingClip===ie?z.clip("evenodd"):z.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),z.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const C=(0,v.getCurrentTransform)(this.ctx);if(C[1]===0&&C[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(C[0]),Math.abs(C[3]));else{const P=Math.abs(C[0]*C[3]-C[2]*C[1]),z=Math.hypot(C[0],C[2]),ee=Math.hypot(C[1],C[3]);this._cachedGetSinglePixelWidth=Math.max(z,ee)/P}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:C}=this.current,P=(0,v.getCurrentTransform)(this.ctx);let z,ee;if(P[1]===0&&P[2]===0){const te=Math.abs(P[0]),K=Math.abs(P[3]);if(C===0)z=1/te,ee=1/K;else{const ue=te*C,fe=K*C;z=ue<1?1/ue:1,ee=fe<1?1/fe:1}}else{const te=Math.abs(P[0]*P[3]-P[2]*P[1]),K=Math.hypot(P[0],P[1]),ue=Math.hypot(P[2],P[3]);if(C===0)z=ue/te,ee=K/te;else{const fe=C*te;z=ue>fe?ue/fe:1,ee=K>fe?K/fe:1}}this._cachedScaleForStroking=[z,ee]}return this._cachedScaleForStroking}rescaleAndStroke(C){const{ctx:P}=this,{lineWidth:z}=this.current,[ee,te]=this.getScaleForStroking();if(P.lineWidth=z||1,ee===1&&te===1){P.stroke();return}let K,ue,fe;C&&(K=(0,v.getCurrentTransform)(P),ue=P.getLineDash().slice(),fe=P.lineDashOffset),P.scale(ee,te);const ye=Math.max(ee,te);P.setLineDash(P.getLineDash().map(me=>me/ye)),P.lineDashOffset/=ye,P.stroke(),C&&(P.setTransform(...K),P.setLineDash(ue),P.lineDashOffset=fe)}isContentVisible(){for(let C=this.markedContentStack.length-1;C>=0;C--)if(!this.markedContentStack[C].visible)return!1;return!0}}E.CanvasGraphics=_;function H(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}for(const $ in p.OPS)_.prototype[$]!==void 0&&(_.prototype[p.OPS[$]]=_.prototype[$])},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.TilingPattern=E.PathType=void 0,E.getShadingPattern=d;var p=l(1),v=l(139);const I={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};E.PathType=I;function k(o,c){if(!c)return;const b=c[2]-c[0],y=c[3]-c[1],f=new Path2D;f.rect(c[0],c[1],b,y),o.clip(f)}class m{constructor(){this.constructor===m&&(0,p.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,p.unreachable)("Abstract method `getPattern` called.")}}class R extends m{constructor(c){super(),this._type=c[1],this._bbox=c[2],this._colorStops=c[3],this._p0=c[4],this._p1=c[5],this._r0=c[6],this._r1=c[7],this.matrix=null}_createGradient(c){let b;this._type==="axial"?b=c.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(b=c.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const y of this._colorStops)b.addColorStop(y[0],y[1]);return b}getPattern(c,b,y,f){let s;if(f===I.STROKE||f===I.FILL){const g=b.current.getClippedPathBoundingBox(f,(0,v.getCurrentTransform)(c))||[0,0,0,0],S=Math.ceil(g[2]-g[0])||1,D=Math.ceil(g[3]-g[1])||1,w=b.cachedCanvases.getCanvas("pattern",S,D,!0),x=w.context;x.clearRect(0,0,x.canvas.width,x.canvas.height),x.beginPath(),x.rect(0,0,x.canvas.width,x.canvas.height),x.translate(-g[0],-g[1]),y=p.Util.transform(y,[1,0,0,1,g[0],g[1]]),x.transform(...b.baseTransform),this.matrix&&x.transform(...this.matrix),k(x,this._bbox),x.fillStyle=this._createGradient(x),x.fill(),s=c.createPattern(w.canvas,"no-repeat");const F=new DOMMatrix(y);s.setTransform(F)}else k(c,this._bbox),s=this._createGradient(c);return s}}function t(o,c,b,y,f,s,g,S){const D=c.coords,w=c.colors,x=o.data,F=o.width*4;let X;D[b+1]>D[y+1]&&(X=b,b=y,y=X,X=s,s=g,g=X),D[y+1]>D[f+1]&&(X=y,y=f,f=X,X=g,g=S,S=X),D[b+1]>D[y+1]&&(X=b,b=y,y=X,X=s,s=g,g=X);const G=(D[b]+c.offsetX)*c.scaleX,j=(D[b+1]+c.offsetY)*c.scaleY,N=(D[y]+c.offsetX)*c.scaleX,Q=(D[y+1]+c.offsetY)*c.scaleY,Y=(D[f]+c.offsetX)*c.scaleX,B=(D[f+1]+c.offsetY)*c.scaleY;if(j>=B)return;const ie=w[s],q=w[s+1],_=w[s+2],H=w[g],$=w[g+1],C=w[g+2],P=w[S],z=w[S+1],ee=w[S+2],te=Math.round(j),K=Math.round(B);let ue,fe,ye,me,we,ge,A,O;for(let M=te;M<=K;M++){if(M<Q){let re;M<j?re=0:re=(j-M)/(j-Q),ue=G-(G-N)*re,fe=ie-(ie-H)*re,ye=q-(q-$)*re,me=_-(_-C)*re}else{let re;M>B?re=1:Q===B?re=0:re=(Q-M)/(Q-B),ue=N-(N-Y)*re,fe=H-(H-P)*re,ye=$-($-z)*re,me=C-(C-ee)*re}let U;M<j?U=0:M>B?U=1:U=(j-M)/(j-B),we=G-(G-Y)*U,ge=ie-(ie-P)*U,A=q-(q-z)*U,O=_-(_-ee)*U;const Z=Math.round(Math.min(ue,we)),se=Math.round(Math.max(ue,we));let ne=F*M+Z*4;for(let re=Z;re<=se;re++)U=(ue-re)/(ue-we),U<0?U=0:U>1&&(U=1),x[ne++]=fe-(fe-ge)*U|0,x[ne++]=ye-(ye-A)*U|0,x[ne++]=me-(me-O)*U|0,x[ne++]=255}}function n(o,c,b){const y=c.coords,f=c.colors;let s,g;switch(c.type){case"lattice":const S=c.verticesPerRow,D=Math.floor(y.length/S)-1,w=S-1;for(s=0;s<D;s++){let x=s*S;for(let F=0;F<w;F++,x++)t(o,b,y[x],y[x+1],y[x+S],f[x],f[x+1],f[x+S]),t(o,b,y[x+S+1],y[x+1],y[x+S],f[x+S+1],f[x+1],f[x+S])}break;case"triangles":for(s=0,g=y.length;s<g;s+=3)t(o,b,y[s],y[s+1],y[s+2],f[s],f[s+1],f[s+2]);break;default:throw new Error("illegal figure")}}class h extends m{constructor(c){super(),this._coords=c[2],this._colors=c[3],this._figures=c[4],this._bounds=c[5],this._bbox=c[7],this._background=c[8],this.matrix=null}_createMeshCanvas(c,b,y){const S=Math.floor(this._bounds[0]),D=Math.floor(this._bounds[1]),w=Math.ceil(this._bounds[2])-S,x=Math.ceil(this._bounds[3])-D,F=Math.min(Math.ceil(Math.abs(w*c[0]*1.1)),3e3),X=Math.min(Math.ceil(Math.abs(x*c[1]*1.1)),3e3),G=w/F,j=x/X,N={coords:this._coords,colors:this._colors,offsetX:-S,offsetY:-D,scaleX:1/G,scaleY:1/j},Q=F+2*2,Y=X+2*2,B=y.getCanvas("mesh",Q,Y,!1),ie=B.context,q=ie.createImageData(F,X);if(b){const H=q.data;for(let $=0,C=H.length;$<C;$+=4)H[$]=b[0],H[$+1]=b[1],H[$+2]=b[2],H[$+3]=255}for(const H of this._figures)n(q,H,N);return ie.putImageData(q,2,2),{canvas:B.canvas,offsetX:S-2*G,offsetY:D-2*j,scaleX:G,scaleY:j}}getPattern(c,b,y,f){k(c,this._bbox);let s;if(f===I.SHADING)s=p.Util.singularValueDecompose2dScale((0,v.getCurrentTransform)(c));else if(s=p.Util.singularValueDecompose2dScale(b.baseTransform),this.matrix){const S=p.Util.singularValueDecompose2dScale(this.matrix);s=[s[0]*S[0],s[1]*S[1]]}const g=this._createMeshCanvas(s,f===I.SHADING?null:this._background,b.cachedCanvases);return f!==I.SHADING&&(c.setTransform(...b.baseTransform),this.matrix&&c.transform(...this.matrix)),c.translate(g.offsetX,g.offsetY),c.scale(g.scaleX,g.scaleY),c.createPattern(g.canvas,"no-repeat")}}class a extends m{getPattern(){return"hotpink"}}function d(o){switch(o[0]){case"RadialAxial":return new R(o);case"Mesh":return new h(o);case"Dummy":return new a}throw new Error(`Unknown IR type: ${o[0]}`)}const r={COLORED:1,UNCOLORED:2};class i{static get MAX_PATTERN_SIZE(){return(0,p.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(c,b,y,f,s){this.operatorList=c[2],this.matrix=c[3]||[1,0,0,1,0,0],this.bbox=c[4],this.xstep=c[5],this.ystep=c[6],this.paintType=c[7],this.tilingType=c[8],this.color=b,this.ctx=y,this.canvasGraphicsFactory=f,this.baseTransform=s}createPatternCanvas(c){const b=this.operatorList,y=this.bbox,f=this.xstep,s=this.ystep,g=this.paintType,S=this.tilingType,D=this.color,w=this.canvasGraphicsFactory;(0,p.info)("TilingType: "+S);const x=y[0],F=y[1],X=y[2],G=y[3],j=p.Util.singularValueDecompose2dScale(this.matrix),N=p.Util.singularValueDecompose2dScale(this.baseTransform),Q=[j[0]*N[0],j[1]*N[1]],Y=this.getSizeAndScale(f,this.ctx.canvas.width,Q[0]),B=this.getSizeAndScale(s,this.ctx.canvas.height,Q[1]),ie=c.cachedCanvases.getCanvas("pattern",Y.size,B.size,!0),q=ie.context,_=w.createCanvasGraphics(q);_.groupLevel=c.groupLevel,this.setFillAndStrokeStyleToContext(_,g,D);let H=x,$=F,C=X,P=G;return x<0&&(H=0,C+=Math.abs(x)),F<0&&($=0,P+=Math.abs(F)),q.translate(-(Y.scale*H),-(B.scale*$)),_.transform(Y.scale,0,0,B.scale,0,0),q.save(),this.clipBbox(_,H,$,C,P),_.baseTransform=(0,v.getCurrentTransform)(_.ctx),_.executeOperatorList(b),_.endDrawing(),{canvas:ie.canvas,scaleX:Y.scale,scaleY:B.scale,offsetX:H,offsetY:$}}getSizeAndScale(c,b,y){c=Math.abs(c);const f=Math.max(i.MAX_PATTERN_SIZE,b);let s=Math.ceil(c*y);return s>=f?s=f:y=s/c,{scale:y,size:s}}clipBbox(c,b,y,f,s){const g=f-b,S=s-y;c.ctx.rect(b,y,g,S),c.current.updateRectMinMax((0,v.getCurrentTransform)(c.ctx),[b,y,f,s]),c.clip(),c.endPath()}setFillAndStrokeStyleToContext(c,b,y){const f=c.ctx,s=c.current;switch(b){case r.COLORED:const g=this.ctx;f.fillStyle=g.fillStyle,f.strokeStyle=g.strokeStyle,s.fillColor=g.fillStyle,s.strokeColor=g.strokeStyle;break;case r.UNCOLORED:const S=p.Util.makeHexColor(y[0],y[1],y[2]);f.fillStyle=S,f.strokeStyle=S,s.fillColor=S,s.strokeColor=S;break;default:throw new p.FormatError(`Unsupported paint type: ${b}`)}}getPattern(c,b,y,f){let s=y;f!==I.SHADING&&(s=p.Util.transform(s,b.baseTransform),this.matrix&&(s=p.Util.transform(s,this.matrix)));const g=this.createPatternCanvas(b);let S=new DOMMatrix(s);S=S.translate(g.offsetX,g.offsetY),S=S.scale(1/g.scaleX,1/g.scaleY);const D=c.createPattern(g.canvas,"repeat");return D.setTransform(S),D}}E.TilingPattern=i},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.applyMaskImageData=v;var p=l(1);function v(I){let{src:k,srcPos:m=0,dest:R,destPos:t=0,width:n,height:h,inverseDecode:a=!1}=I;const d=p.FeatureTest.isLittleEndian?4278190080:255,[r,i]=a?[0,d]:[d,0],o=n>>3,c=n&7,b=k.length;R=new Uint32Array(R.buffer);for(let y=0;y<h;y++){for(const s=m+o;m<s;m++){const g=m<b?k[m]:255;R[t++]=g&128?i:r,R[t++]=g&64?i:r,R[t++]=g&32?i:r,R[t++]=g&16?i:r,R[t++]=g&8?i:r,R[t++]=g&4?i:r,R[t++]=g&2?i:r,R[t++]=g&1?i:r}if(c===0)continue;const f=m<b?k[m++]:255;for(let s=0;s<c;s++)R[t++]=f&1<<7-s?i:r}return{srcPos:m,destPos:t}}},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.GlobalWorkerOptions=void 0;const l=Object.create(null);E.GlobalWorkerOptions=l,l.workerPort=null,l.workerSrc=""},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.MessageHandler=void 0;var p=l(1);const v={UNKNOWN:0,DATA:1,ERROR:2},I={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function k(R){switch(R instanceof Error||typeof R=="object"&&R!==null||(0,p.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),R.name){case"AbortException":return new p.AbortException(R.message);case"MissingPDFException":return new p.MissingPDFException(R.message);case"PasswordException":return new p.PasswordException(R.message,R.code);case"UnexpectedResponseException":return new p.UnexpectedResponseException(R.message,R.status);case"UnknownErrorException":return new p.UnknownErrorException(R.message,R.details);default:return new p.UnknownErrorException(R.message,R.toString())}}class m{constructor(t,n,h){this.sourceName=t,this.targetName=n,this.comObj=h,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const d=a.data;if(d.targetName!==this.sourceName)return;if(d.stream){this._processStreamMessage(d);return}if(d.callback){const i=d.callbackId,o=this.callbackCapabilities[i];if(!o)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],d.callback===v.DATA)o.resolve(d.data);else if(d.callback===v.ERROR)o.reject(k(d.reason));else throw new Error("Unexpected callback case");return}const r=this.actionHandler[d.action];if(!r)throw new Error(`Unknown action from worker: ${d.action}`);if(d.callbackId){const i=this.sourceName,o=d.sourceName;new Promise(function(c){c(r(d.data))}).then(function(c){h.postMessage({sourceName:i,targetName:o,callback:v.DATA,callbackId:d.callbackId,data:c})},function(c){h.postMessage({sourceName:i,targetName:o,callback:v.ERROR,callbackId:d.callbackId,reason:k(c)})});return}if(d.streamId){this._createStreamSink(d);return}r(d.data)},h.addEventListener("message",this._onComObjOnMessage)}on(t,n){const h=this.actionHandler;if(h[t])throw new Error(`There is already an actionName called "${t}"`);h[t]=n}send(t,n,h){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:n},h)}sendWithPromise(t,n,h){const a=this.callbackId++,d=(0,p.createPromiseCapability)();this.callbackCapabilities[a]=d;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:n},h)}catch(r){d.reject(r)}return d.promise}sendWithStream(t,n,h,a){const d=this.streamId++,r=this.sourceName,i=this.targetName,o=this.comObj;return new ReadableStream({start:c=>{const b=(0,p.createPromiseCapability)();return this.streamControllers[d]={controller:c,startCall:b,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:i,action:t,streamId:d,data:n,desiredSize:c.desiredSize},a),b.promise},pull:c=>{const b=(0,p.createPromiseCapability)();return this.streamControllers[d].pullCall=b,o.postMessage({sourceName:r,targetName:i,stream:I.PULL,streamId:d,desiredSize:c.desiredSize}),b.promise},cancel:c=>{(0,p.assert)(c instanceof Error,"cancel must have a valid reason");const b=(0,p.createPromiseCapability)();return this.streamControllers[d].cancelCall=b,this.streamControllers[d].isClosed=!0,o.postMessage({sourceName:r,targetName:i,stream:I.CANCEL,streamId:d,reason:k(c)}),b.promise}},h)}_createStreamSink(t){const n=t.streamId,h=this.sourceName,a=t.sourceName,d=this.comObj,r=this,i=this.actionHandler[t.action],o={enqueue(c){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,y=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=b,f>0&&this.desiredSize<=0&&(this.sinkCapability=(0,p.createPromiseCapability)(),this.ready=this.sinkCapability.promise),d.postMessage({sourceName:h,targetName:a,stream:I.ENQUEUE,streamId:n,chunk:c},y)},close(){this.isCancelled||(this.isCancelled=!0,d.postMessage({sourceName:h,targetName:a,stream:I.CLOSE,streamId:n}),delete r.streamSinks[n])},error(c){(0,p.assert)(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,d.postMessage({sourceName:h,targetName:a,stream:I.ERROR,streamId:n,reason:k(c)}))},sinkCapability:(0,p.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[n]=o,new Promise(function(c){c(i(t.data,o))}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.START_COMPLETE,streamId:n,success:!0})},function(c){d.postMessage({sourceName:h,targetName:a,stream:I.START_COMPLETE,streamId:n,reason:k(c)})})}_processStreamMessage(t){const n=t.streamId,h=this.sourceName,a=t.sourceName,d=this.comObj,r=this.streamControllers[n],i=this.streamSinks[n];switch(t.stream){case I.START_COMPLETE:t.success?r.startCall.resolve():r.startCall.reject(k(t.reason));break;case I.PULL_COMPLETE:t.success?r.pullCall.resolve():r.pullCall.reject(k(t.reason));break;case I.PULL:if(!i){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,success:!0});break}i.desiredSize<=0&&t.desiredSize>0&&i.sinkCapability.resolve(),i.desiredSize=t.desiredSize,new Promise(function(o){o(i.onPull&&i.onPull())}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,success:!0})},function(o){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,reason:k(o)})});break;case I.ENQUEUE:if((0,p.assert)(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case I.CLOSE:if((0,p.assert)(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this._deleteStreamController(r,n);break;case I.ERROR:(0,p.assert)(r,"error should have stream controller"),r.controller.error(k(t.reason)),this._deleteStreamController(r,n);break;case I.CANCEL_COMPLETE:t.success?r.cancelCall.resolve():r.cancelCall.reject(k(t.reason)),this._deleteStreamController(r,n);break;case I.CANCEL:if(!i)break;new Promise(function(o){o(i.onCancel&&i.onCancel(k(t.reason)))}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.CANCEL_COMPLETE,streamId:n,success:!0})},function(o){d.postMessage({sourceName:h,targetName:a,stream:I.CANCEL_COMPLETE,streamId:n,reason:k(o)})}),i.sinkCapability.reject(k(t.reason)),i.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,n){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]),delete this.streamControllers[n]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}E.MessageHandler=m},(W,E,l)=>{var I,k;Object.defineProperty(E,"__esModule",{value:!0}),E.Metadata=void 0;var p=l(1);class v{constructor(R){nt(this,I,void 0);nt(this,k,void 0);let{parsedData:t,rawData:n}=R;rt(this,I,t),rt(this,k,n)}getRaw(){return Ue(this,k)}get(R){return Ue(this,I).get(R)??null}getAll(){return(0,p.objectFromMap)(Ue(this,I))}has(R){return Ue(this,I).has(R)}}I=new WeakMap,k=new WeakMap,E.Metadata=v},(W,E,l)=>{var S;Object.defineProperty(E,"__esModule",{value:!0}),E.OptionalContentConfig=void 0;var p=l(1),v=l(141);function I(D,w){m(D,w),w.add(D)}function k(D,w,x){m(D,w),w.set(D,x)}function m(D,w){if(w.has(D))throw new TypeError("Cannot initialize the same private elements twice on an object")}function R(D,w,x){if(!w.has(D))throw new TypeError("attempted to get private field on non-instance");return x}function t(D,w){var x=a(D,w,"get");return n(D,x)}function n(D,w){return w.get?w.get.call(D):w.value}function h(D,w,x){var F=a(D,w,"set");return d(D,F,x),x}function a(D,w,x){if(!w.has(D))throw new TypeError("attempted to "+x+" private field on non-instance");return w.get(D)}function d(D,w,x){if(w.set)w.set.call(D,x);else{if(!w.writable)throw new TypeError("attempted to set read only private field");w.value=x}}const r=Symbol("INTERNAL");class i{constructor(w,x){nt(this,S,!0);this.name=w,this.intent=x}get visible(){return Ue(this,S)}_setVisible(w,x){w!==r&&(0,p.unreachable)("Internal method `_setVisible` called."),rt(this,S,x)}}S=new WeakMap;var o=new WeakMap,c=new WeakMap,b=new WeakMap,y=new WeakMap,f=new WeakSet;class s{constructor(w){if(I(this,f),k(this,o,{writable:!0,value:null}),k(this,c,{writable:!0,value:new Map}),k(this,b,{writable:!0,value:null}),k(this,y,{writable:!0,value:null}),this.name=null,this.creator=null,w!==null){this.name=w.name,this.creator=w.creator,h(this,y,w.order);for(const x of w.groups)t(this,c).set(x.id,new i(x.name,x.intent));if(w.baseState==="OFF")for(const x of t(this,c).values())x._setVisible(r,!1);for(const x of w.on)t(this,c).get(x)._setVisible(r,!0);for(const x of w.off)t(this,c).get(x)._setVisible(r,!1);h(this,b,this.getHash())}}isVisible(w){if(t(this,c).size===0)return!0;if(!w)return(0,p.warn)("Optional content group not defined."),!0;if(w.type==="OCG")return t(this,c).has(w.id)?t(this,c).get(w.id).visible:((0,p.warn)(`Optional content group not found: ${w.id}`),!0);if(w.type==="OCMD"){if(w.expression)return R(this,f,g).call(this,w.expression);if(!w.policy||w.policy==="AnyOn"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(t(this,c).get(x).visible)return!0}return!1}else if(w.policy==="AllOn"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(!t(this,c).get(x).visible)return!1}return!0}else if(w.policy==="AnyOff"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(!t(this,c).get(x).visible)return!0}return!1}else if(w.policy==="AllOff"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(t(this,c).get(x).visible)return!1}return!0}return(0,p.warn)(`Unknown optional content policy ${w.policy}.`),!0}return(0,p.warn)(`Unknown group type ${w.type}.`),!0}setVisibility(w){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!t(this,c).has(w)){(0,p.warn)(`Optional content group not found: ${w}`);return}t(this,c).get(w)._setVisible(r,!!x),h(this,o,null)}get hasInitialVisibility(){return this.getHash()===t(this,b)}getOrder(){return t(this,c).size?t(this,y)?t(this,y).slice():[...t(this,c).keys()]:null}getGroups(){return t(this,c).size>0?(0,p.objectFromMap)(t(this,c)):null}getGroup(w){return t(this,c).get(w)||null}getHash(){if(t(this,o)!==null)return t(this,o);const w=new v.MurmurHash3_64;for(const[x,F]of t(this,c))w.update(`${x}:${F.visible}`);return h(this,o,w.hexdigest())}}E.OptionalContentConfig=s;function g(D){const w=D.length;if(w<2)return!0;const x=D[0];for(let F=1;F<w;F++){const X=D[F];let G;if(Array.isArray(X))G=R(this,f,g).call(this,X);else if(t(this,c).has(X))G=t(this,c).get(X).visible;else return(0,p.warn)(`Optional content group not found: ${X}`),!0;switch(x){case"And":if(!G)return!1;break;case"Or":if(G)return!0;break;case"Not":return!G;default:return!0}}return x==="And"}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFDataTransportStream=void 0;var p=l(1),v=l(139);class I{constructor(t,n){let{length:h,initialData:a,progressiveDone:d=!1,contentDispositionFilename:r=null,disableRange:i=!1,disableStream:o=!1}=t;if((0,p.assert)(n,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=r,(a==null?void 0:a.length)>0){const c=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=n,this._isStreamingSupported=!o,this._isRangeSupported=!i,this._contentLength=h,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((c,b)=>{this._onReceiveData({begin:c,chunk:b})}),this._pdfDataRangeTransport.addProgressListener((c,b)=>{this._onProgress({loaded:c,total:b})}),this._pdfDataRangeTransport.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:n,chunk:h}=t;const a=h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer;if(n===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{const d=this._rangeReaders.some(function(r){return r._begin!==n?!1:(r._enqueue(a),!0)});(0,p.assert)(d,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)===null||t===void 0?void 0:t._loaded)??0}_onProgress(t){if(t.total===void 0){var n,h;(n=this._rangeReaders[0])===null||n===void 0||(h=n.onProgress)===null||h===void 0||h.call(n,{loaded:t.loaded})}else{var a,d;(a=this._fullRequestReader)===null||a===void 0||(d=a.onProgress)===null||d===void 0||d.call(a,{loaded:t.loaded,total:t.total})}}_onProgressiveDone(){var t;(t=this._fullRequestReader)===null||t===void 0||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const n=this._rangeReaders.indexOf(t);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){(0,p.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new k(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,n){if(n<=this._progressiveDataLength)return null;const h=new m(this,t,n);return this._pdfDataRangeTransport.requestDataRange(t,n),this._rangeReaders.push(h),h}cancelAllRequests(t){var n;(n=this._fullRequestReader)===null||n===void 0||n.cancel(t);for(const h of this._rangeReaders.slice(0))h.cancel(t);this._pdfDataRangeTransport.abort()}}E.PDFDataTransportStream=I;class k{constructor(t,n){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=t,this._done=h||!1,this._filename=(0,v.isPdfFile)(a)?a:null,this._queuedChunks=n||[],this._loaded=0;for(const d of this._queuedChunks)this._loaded+=d.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=(0,p.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class m{constructor(t,n,h){this._stream=t,this._begin=n,this._end=h,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,p.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.XfaText=void 0;class l{static textContent(v){const I=[],k={items:I,styles:Object.create(null)};function m(R){var t;if(!R)return;let n=null;const h=R.name;if(h==="#text")n=R.value;else if(l.shouldBuildText(h))R!=null&&(t=R.attributes)!==null&&t!==void 0&&t.textContent?n=R.attributes.textContent:R.value&&(n=R.value);else return;if(n!==null&&I.push({str:n}),!!R.children)for(const a of R.children)m(a)}return m(v),k}static shouldBuildText(v){return!(v==="textarea"||v==="input"||v==="option"||v==="select")}}E.XfaText=l},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.NodeStandardFontDataFactory=E.NodeCanvasFactory=E.NodeCMapReaderFactory=void 0;var p=l(140);const v=function(R){return new Promise((t,n)=>{require$$7.readFile(R,(a,d)=>{if(a||!d){n(new Error(a));return}t(new Uint8Array(d))})})};class I extends p.BaseCanvasFactory{_createCanvas(t,n){return require$$7.createCanvas(t,n)}}E.NodeCanvasFactory=I;class k extends p.BaseCMapReaderFactory{_fetchData(t,n){return v(t).then(h=>({cMapData:h,compressionType:n}))}}E.NodeCMapReaderFactory=k;class m extends p.BaseStandardFontDataFactory{_fetchData(t){return v(t)}}E.NodeStandardFontDataFactory=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFNodeStream=void 0;var p=l(1),v=l(154);const I=require$$7,k=require$$7,m=require$$7,R=require$$7,t=/^file:\/\/\/[a-zA-Z]:\//;function n(y){const f=R.parse(y);return f.protocol==="file:"||f.host?f:/^[a-z]:[/\\]/i.test(y)?R.parse(`file:///${y}`):(f.host||(f.protocol="file:"),f)}class h{constructor(f){this.source=f,this.url=n(f.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&f.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var f;return((f=this._fullRequestReader)===null||f===void 0?void 0:f._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new c(this):new i(this),this._fullRequestReader}getRangeReader(f,s){if(s<=this._progressiveDataLength)return null;const g=this.isFsUrl?new b(this,f,s):new o(this,f,s);return this._rangeRequestReaders.push(g),g}cancelAllRequests(f){var s;(s=this._fullRequestReader)===null||s===void 0||s.cancel(f);for(const g of this._rangeRequestReaders.slice(0))g.cancel(f)}}E.PDFNodeStream=h;class a{constructor(f){this._url=f.url,this._done=!1,this._storedError=null,this.onProgress=null;const s=f.source;this._contentLength=s.length,this._loaded=0,this._filename=null,this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange,this._readableStream=null,this._readCapability=(0,p.createPromiseCapability)(),this._headersCapability=(0,p.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var f;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const s=this._readableStream.read();return s===null?(this._readCapability=(0,p.createPromiseCapability)(),this.read()):(this._loaded+=s.length,(f=this.onProgress)===null||f===void 0||f.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(s).buffer,done:!1})}cancel(f){if(!this._readableStream){this._error(f);return}this._readableStream.destroy(f)}_error(f){this._storedError=f,this._readCapability.resolve()}_setReadableStream(f){this._readableStream=f,f.on("readable",()=>{this._readCapability.resolve()}),f.on("end",()=>{f.destroy(),this._done=!0,this._readCapability.resolve()}),f.on("error",s=>{this._error(s)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(f){this._url=f.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,p.createPromiseCapability)();const s=f.source;this._isStreamingSupported=!s.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var f;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const s=this._readableStream.read();return s===null?(this._readCapability=(0,p.createPromiseCapability)(),this.read()):(this._loaded+=s.length,(f=this.onProgress)===null||f===void 0||f.call(this,{loaded:this._loaded}),{value:new Uint8Array(s).buffer,done:!1})}cancel(f){if(!this._readableStream){this._error(f);return}this._readableStream.destroy(f)}_error(f){this._storedError=f,this._readCapability.resolve()}_setReadableStream(f){this._readableStream=f,f.on("readable",()=>{this._readCapability.resolve()}),f.on("end",()=>{f.destroy(),this._done=!0,this._readCapability.resolve()}),f.on("error",s=>{this._error(s)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function r(y,f){return{protocol:y.protocol,auth:y.auth,host:y.hostname,port:y.port,path:y.path,method:"GET",headers:f}}class i extends a{constructor(f){super(f);const s=g=>{if(g.statusCode===404){const x=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=x,this._headersCapability.reject(x);return}this._headersCapability.resolve(),this._setReadableStream(g);const S=x=>this._readableStream.headers[x.toLowerCase()],{allowRangeRequests:D,suggestedLength:w}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:S,isHttp:f.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=D,this._contentLength=w||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(S)};this._request=null,this._url.protocol==="http:"?this._request=k.request(r(this._url,f.httpHeaders),s):this._request=m.request(r(this._url,f.httpHeaders),s),this._request.on("error",g=>{this._storedError=g,this._headersCapability.reject(g)}),this._request.end()}}class o extends d{constructor(f,s,g){super(f),this._httpHeaders={};for(const D in f.httpHeaders){const w=f.httpHeaders[D];w!==void 0&&(this._httpHeaders[D]=w)}this._httpHeaders.Range=`bytes=${s}-${g-1}`;const S=D=>{if(D.statusCode===404){const w=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=w;return}this._setReadableStream(D)};this._request=null,this._url.protocol==="http:"?this._request=k.request(r(this._url,this._httpHeaders),S):this._request=m.request(r(this._url,this._httpHeaders),S),this._request.on("error",D=>{this._storedError=D}),this._request.end()}}class c extends a{constructor(f){super(f);let s=decodeURIComponent(this._url.path);t.test(this._url.href)&&(s=s.replace(/^\//,"")),I.lstat(s,(g,S)=>{if(g){g.code==="ENOENT"&&(g=new p.MissingPDFException(`Missing PDF "${s}".`)),this._storedError=g,this._headersCapability.reject(g);return}this._contentLength=S.size,this._setReadableStream(I.createReadStream(s)),this._headersCapability.resolve()})}}class b extends d{constructor(f,s,g){super(f);let S=decodeURIComponent(this._url.path);t.test(this._url.href)&&(S=S.replace(/^\//,"")),this._setReadableStream(I.createReadStream(S,{start:s,end:g-1}))}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.createResponseStatusError=R,E.extractFilenameFromHeader=m,E.validateRangeRequestCapabilities=k,E.validateResponseStatus=t;var p=l(1),v=l(155),I=l(139);function k(n){let{getResponseHeader:h,isHttp:a,rangeChunkSize:d,disableRange:r}=n;const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(h("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*d)||r||!a||h("Accept-Ranges")!=="bytes"||(h("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function m(n){const h=n("Content-Disposition");if(h){let a=(0,v.getFilenameFromContentDispositionHeader)(h);if(a.includes("%"))try{a=decodeURIComponent(a)}catch{}if((0,I.isPdfFile)(a))return a}return null}function R(n,h){return n===404||n===0&&h.startsWith("file:")?new p.MissingPDFException('Missing PDF "'+h+'".'):new p.UnexpectedResponseException(`Unexpected server response (${n}) while retrieving PDF "${h}".`,n)}function t(n){return n===200||n===206}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.getFilenameFromContentDispositionHeader=v;var p=l(1);function v(I){let k=!0,m=R("filename\\*","i").exec(I);if(m){m=m[1];let i=a(m);return i=unescape(i),i=d(i),i=r(i),n(i)}if(m=h(I),m){const i=r(m);return n(i)}if(m=R("filename","i").exec(I),m){m=m[1];let i=a(m);return i=r(i),n(i)}function R(i,o){return new RegExp("(?:^|;)\\s*"+i+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',o)}function t(i,o){if(i){if(!/^[\x00-\xFF]+$/.test(o))return o;try{const c=new TextDecoder(i,{fatal:!0}),b=(0,p.stringToBytes)(o);o=c.decode(b),k=!1}catch{}}return o}function n(i){return k&&/[\x80-\xff]/.test(i)&&(i=t("utf-8",i),k&&(i=t("iso-8859-1",i))),i}function h(i){const o=[];let c;const b=R("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(c=b.exec(i))!==null;){let[,f,s,g]=c;if(f=parseInt(f,10),f in o){if(f===0)break;continue}o[f]=[s,g]}const y=[];for(let f=0;f<o.length&&f in o;++f){let[s,g]=o[f];g=a(g),s&&(g=unescape(g),f===0&&(g=d(g))),y.push(g)}return y.join("")}function a(i){if(i.startsWith('"')){const o=i.slice(1).split('\\"');for(let c=0;c<o.length;++c){const b=o[c].indexOf('"');b!==-1&&(o[c]=o[c].slice(0,b),o.length=c+1),o[c]=o[c].replace(/\\(.)/g,"$1")}i=o.join('"')}return i}function d(i){const o=i.indexOf("'");if(o===-1)return i;const c=i.slice(0,o),y=i.slice(o+1).replace(/^[^']*'/,"");return t(c,y)}function r(i){return!i.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(i)?i:i.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(o,c,b,y){if(b==="q"||b==="Q")return y=y.replace(/_/g," "),y=y.replace(/=([0-9a-fA-F]{2})/g,function(f,s){return String.fromCharCode(parseInt(s,16))}),t(c,y);try{y=atob(y)}catch{}return t(c,y)})}return""}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFNetworkStream=void 0;var p=l(1),v=l(154);const I=200,k=206;function m(a){const d=a.response;return typeof d!="string"?d:(0,p.stringToBytes)(d).buffer}class R{constructor(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=d,this.isHttp=/^https?:/i.test(d),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.getXhr=r.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(d,r,i){const o={begin:d,end:r};for(const c in i)o[c]=i[c];return this.request(o)}requestFull(d){return this.request(d)}request(d){const r=this.getXhr(),i=this.currXhrId++,o=this.pendingRequests[i]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const c in this.httpHeaders){const b=this.httpHeaders[c];b!==void 0&&r.setRequestHeader(c,b)}return this.isHttp&&"begin"in d&&"end"in d?(r.setRequestHeader("Range",`bytes=${d.begin}-${d.end-1}`),o.expectedStatus=k):o.expectedStatus=I,r.responseType="arraybuffer",d.onError&&(r.onerror=function(c){d.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,i),r.onprogress=this.onProgress.bind(this,i),o.onHeadersReceived=d.onHeadersReceived,o.onDone=d.onDone,o.onError=d.onError,o.onProgress=d.onProgress,r.send(null),i}onProgress(d,r){var i;const o=this.pendingRequests[d];o&&((i=o.onProgress)===null||i===void 0||i.call(o,r))}onStateChange(d,r){const i=this.pendingRequests[d];if(!i)return;const o=i.xhr;if(o.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),o.readyState!==4||!(d in this.pendingRequests))return;if(delete this.pendingRequests[d],o.status===0&&this.isHttp){var c;(c=i.onError)===null||c===void 0||c.call(i,o.status);return}const b=o.status||I;if(!(b===I&&i.expectedStatus===k)&&b!==i.expectedStatus){var f;(f=i.onError)===null||f===void 0||f.call(i,o.status);return}const s=m(o);if(b===k){const S=o.getResponseHeader("Content-Range"),D=/bytes (\d+)-(\d+)\/(\d+)/.exec(S);i.onDone({begin:parseInt(D[1],10),chunk:s})}else if(s)i.onDone({begin:0,chunk:s});else{var g;(g=i.onError)===null||g===void 0||g.call(i,o.status)}}getRequestXhr(d){return this.pendingRequests[d].xhr}isPendingRequest(d){return d in this.pendingRequests}abortRequest(d){const r=this.pendingRequests[d].xhr;delete this.pendingRequests[d],r.abort()}}class t{constructor(d){this._source=d,this._manager=new R(d.url,{httpHeaders:d.httpHeaders,withCredentials:d.withCredentials}),this._rangeChunkSize=d.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(d){const r=this._rangeRequestReaders.indexOf(d);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new n(this._manager,this._source),this._fullRequestReader}getRangeReader(d,r){const i=new h(this._manager,d,r);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(d){var r;(r=this._fullRequestReader)===null||r===void 0||r.cancel(d);for(const i of this._rangeRequestReaders.slice(0))i.cancel(d)}}E.PDFNetworkStream=t;class n{constructor(d,r){this._manager=d;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=d.requestFull(i),this._headersReceivedCapability=(0,p.createPromiseCapability)(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const d=this._fullRequestId,r=this._manager.getRequestXhr(d),i=b=>r.getResponseHeader(b),{allowRangeRequests:o,suggestedLength:c}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});o&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest(d),this._headersReceivedCapability.resolve()}_onDone(d){if(d&&(this._requests.length>0?this._requests.shift().resolve({value:d.chunk,done:!1}):this._cachedChunks.push(d.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(d){this._storedError=(0,v.createResponseStatusError)(d,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(d){var r;(r=this.onProgress)===null||r===void 0||r.call(this,{loaded:d.loaded,total:d.lengthComputable?d.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const d=(0,p.createPromiseCapability)();return this._requests.push(d),d.promise}cancel(d){this._done=!0,this._headersReceivedCapability.reject(d);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class h{constructor(d,r,i){this._manager=d;const o={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=d.url,this._requestId=d.requestRange(r,i,o),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var d;(d=this.onClosed)===null||d===void 0||d.call(this,this)}_onDone(d){const r=d.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(d){this._storedError=(0,v.createResponseStatusError)(d,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(d){if(!this.isStreamingSupported){var r;(r=this.onProgress)===null||r===void 0||r.call(this,{loaded:d.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const d=(0,p.createPromiseCapability)();return this._requests.push(d),d.promise}cancel(d){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFFetchStream=void 0;var p=l(1),v=l(154);function I(h,a,d){return{method:"GET",headers:h,signal:d.signal,mode:"cors",credentials:a?"include":"same-origin",redirect:"follow"}}function k(h){const a=new Headers;for(const d in h){const r=h[d];r!==void 0&&a.append(d,r)}return a}function m(h){return h instanceof Uint8Array?h.buffer:h instanceof ArrayBuffer?h:((0,p.warn)(`getArrayBuffer - unexpected data format: ${h}`),new Uint8Array(h).buffer)}class R{constructor(a){this.source=a,this.isHttp=/^https?:/i.test(a.url),this.httpHeaders=this.isHttp&&a.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var a;return((a=this._fullRequestReader)===null||a===void 0?void 0:a._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new t(this),this._fullRequestReader}getRangeReader(a,d){if(d<=this._progressiveDataLength)return null;const r=new n(this,a,d);return this._rangeRequestReaders.push(r),r}cancelAllRequests(a){var d;(d=this._fullRequestReader)===null||d===void 0||d.cancel(a);for(const r of this._rangeRequestReaders.slice(0))r.cancel(a)}}E.PDFFetchStream=R;class t{constructor(a){this._stream=a,this._reader=null,this._loaded=0,this._filename=null;const d=a.source;this._withCredentials=d.withCredentials||!1,this._contentLength=d.length,this._headersCapability=(0,p.createPromiseCapability)(),this._disableRange=d.disableRange||!1,this._rangeChunkSize=d.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!d.disableStream,this._isRangeSupported=!d.disableRange,this._headers=k(this._stream.httpHeaders);const r=d.url;fetch(r,I(this._headers,this._withCredentials,this._abortController)).then(i=>{if(!(0,v.validateResponseStatus)(i.status))throw(0,v.createResponseStatusError)(i.status,r);this._reader=i.body.getReader(),this._headersCapability.resolve();const o=y=>i.headers.get(y),{allowRangeRequests:c,suggestedLength:b}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=b||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(o),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var a;await this._headersCapability.promise;const{value:d,done:r}=await this._reader.read();return r?{value:d,done:r}:(this._loaded+=d.byteLength,(a=this.onProgress)===null||a===void 0||a.call(this,{loaded:this._loaded,total:this._contentLength}),{value:m(d),done:!1})}cancel(a){var d;(d=this._reader)===null||d===void 0||d.cancel(a),this._abortController.abort()}}class n{constructor(a,d,r){this._stream=a,this._reader=null,this._loaded=0;const i=a.source;this._withCredentials=i.withCredentials||!1,this._readCapability=(0,p.createPromiseCapability)(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController,this._headers=k(this._stream.httpHeaders),this._headers.append("Range",`bytes=${d}-${r-1}`);const o=i.url;fetch(o,I(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!(0,v.validateResponseStatus)(c.status))throw(0,v.createResponseStatusError)(c.status,o);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var a;await this._readCapability.promise;const{value:d,done:r}=await this._reader.read();return r?{value:d,done:r}:(this._loaded+=d.byteLength,(a=this.onProgress)===null||a===void 0||a.call(this,{loaded:this._loaded}),{value:m(d),done:!1})}cancel(a){var d;(d=this._reader)===null||d===void 0||d.cancel(a),this._abortController.abort()}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.TextLayerRenderTask=void 0,E.renderTextLayer=i,E.updateTextLayer=o;var p=l(1),v=l(139);const I=1e5,k=30,m=.8,R=new Map;function t(c,b){let y;if(b&&p.FeatureTest.isOffscreenCanvasSupported)y=new OffscreenCanvas(c,c).getContext("2d",{alpha:!1});else{const f=document.createElement("canvas");f.width=f.height=c,y=f.getContext("2d",{alpha:!1})}return y}function n(c,b){const y=R.get(c);if(y)return y;const f=t(k,b);f.font=`${k}px ${c}`;const s=f.measureText("");let g=s.fontBoundingBoxAscent,S=Math.abs(s.fontBoundingBoxDescent);if(g){const w=g/(g+S);return R.set(c,w),f.canvas.width=f.canvas.height=0,w}f.strokeStyle="red",f.clearRect(0,0,k,k),f.strokeText("g",0,0);let D=f.getImageData(0,0,k,k).data;S=0;for(let w=D.length-1-3;w>=0;w-=4)if(D[w]>0){S=Math.ceil(w/4/k);break}f.clearRect(0,0,k,k),f.strokeText("A",0,k),D=f.getImageData(0,0,k,k).data,g=0;for(let w=0,x=D.length;w<x;w+=4)if(D[w]>0){g=k-Math.floor(w/4/k);break}if(f.canvas.width=f.canvas.height=0,g){const w=g/(g+S);return R.set(c,w),w}return R.set(c,m),m}function h(c,b,y){const f=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:b.str!=="",hasEOL:b.hasEOL,fontSize:0};c._textDivs.push(f);const g=p.Util.transform(c._transform,b.transform);let S=Math.atan2(g[1],g[0]);const D=y[b.fontName];D.vertical&&(S+=Math.PI/2);const w=Math.hypot(g[2],g[3]),x=w*n(D.fontFamily,c._isOffscreenCanvasSupported);let F,X;S===0?(F=g[4],X=g[5]-x):(F=g[4]+x*Math.sin(S),X=g[5]-x*Math.cos(S));const G="calc(var(--scale-factor)*",j=f.style;c._container===c._rootContainer?(j.left=`${(100*F/c._pageWidth).toFixed(2)}%`,j.top=`${(100*X/c._pageHeight).toFixed(2)}%`):(j.left=`${G}${F.toFixed(2)}px)`,j.top=`${G}${X.toFixed(2)}px)`),j.fontSize=`${G}${w.toFixed(2)}px)`,j.fontFamily=D.fontFamily,s.fontSize=w,f.setAttribute("role","presentation"),f.textContent=b.str,f.dir=b.dir,c._fontInspectorEnabled&&(f.dataset.fontName=b.fontName),S!==0&&(s.angle=S*(180/Math.PI));let N=!1;if(b.str.length>1)N=!0;else if(b.str!==" "&&b.transform[0]!==b.transform[3]){const Q=Math.abs(b.transform[0]),Y=Math.abs(b.transform[3]);Q!==Y&&Math.max(Q,Y)/Math.min(Q,Y)>1.5&&(N=!0)}N&&(s.canvasWidth=D.vertical?b.height:b.width),c._textDivProperties.set(f,s),c._isReadableStream&&c._layoutText(f)}function a(c){const{div:b,scale:y,properties:f,ctx:s,prevFontSize:g,prevFontFamily:S}=c,{style:D}=b;let w="";if(f.canvasWidth!==0&&f.hasText){const{fontFamily:x}=D,{canvasWidth:F,fontSize:X}=f;(g!==X||S!==x)&&(s.font=`${X*y}px ${x}`,c.prevFontSize=X,c.prevFontFamily=x);const{width:G}=s.measureText(b.textContent);G>0&&(w=`scaleX(${F*y/G})`)}f.angle!==0&&(w=`rotate(${f.angle}deg) ${w}`),w.length>0&&(D.transform=w)}function d(c){if(c._canceled)return;const b=c._textDivs,y=c._capability;if(b.length>I){y.resolve();return}if(!c._isReadableStream)for(const s of b)c._layoutText(s);y.resolve()}class r{constructor(b){var y;let{textContentSource:f,container:s,viewport:g,textDivs:S,textDivProperties:D,textContentItemsStr:w,isOffscreenCanvasSupported:x}=b;this._textContentSource=f,this._isReadableStream=f instanceof ReadableStream,this._container=this._rootContainer=s,this._textDivs=S||[],this._textContentItemsStr=w||[],this._isOffscreenCanvasSupported=x,this._fontInspectorEnabled=!!((y=globalThis.FontInspector)!==null&&y!==void 0&&y.enabled),this._reader=null,this._textDivProperties=D||new WeakMap,this._canceled=!1,this._capability=(0,p.createPromiseCapability)(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:g.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t(0,x)};const{pageWidth:F,pageHeight:X,pageX:G,pageY:j}=g.rawDims;this._transform=[1,0,0,-1,-G,j+X],this._pageWidth=F,this._pageHeight=X,(0,v.setLayerDimensions)(s,g),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new p.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new p.AbortException("TextLayer task cancelled."))}_processItems(b,y){for(const f of b){if(f.str===void 0){if(f.type==="beginMarkedContentProps"||f.type==="beginMarkedContent"){const s=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),f.id!==null&&this._container.setAttribute("id",`${f.id}`),s.append(this._container)}else f.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(f.str),h(this,f,y)}}_layoutText(b){const y=this._layoutTextParams.properties=this._textDivProperties.get(b);if(this._layoutTextParams.div=b,a(this._layoutTextParams),y.hasText&&this._container.append(b),y.hasEOL){const f=document.createElement("br");f.setAttribute("role","presentation"),this._container.append(f)}}_render(){const b=(0,p.createPromiseCapability)();let y=Object.create(null);if(this._isReadableStream){const f=()=>{this._reader.read().then(s=>{let{value:g,done:S}=s;if(S){b.resolve();return}Object.assign(y,g.styles),this._processItems(g.items,y),f()},b.reject)};this._reader=this._textContentSource.getReader(),f()}else if(this._textContentSource){const{items:f,styles:s}=this._textContentSource;this._processItems(f,s),b.resolve()}else throw new Error('No "textContentSource" parameter specified.');b.promise.then(()=>{y=null,d(this)},this._capability.reject)}}E.TextLayerRenderTask=r;function i(c){!c.textContentSource&&(c.textContent||c.textContentStream)&&((0,v.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),c.textContentSource=c.textContent||c.textContentStream);const b=new r(c);return b._render(),b}function o(c){let{container:b,viewport:y,textDivs:f,textDivProperties:s,isOffscreenCanvasSupported:g,mustRotate:S=!0,mustRescale:D=!0}=c;if(S&&(0,v.setLayerDimensions)(b,{rotation:y.rotation}),D){const w=t(0,g),F={prevFontSize:null,prevFontFamily:null,div:null,scale:y.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:w};for(const X of f)F.properties=s.get(X),F.div=X,a(F)}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationEditorLayer=void 0;var p=l(1),v=l(138),I=l(160),k=l(161),m=l(139);function R(_,H){d(_,H),H.add(_)}function t(_,H,$){return H=n(H),H in _?Object.defineProperty(_,H,{value:$,enumerable:!0,configurable:!0,writable:!0}):_[H]=$,_}function n(_){var H=h(_,"string");return typeof H=="symbol"?H:String(H)}function h(_,H){if(typeof _!="object"||_===null)return _;var $=_[Symbol.toPrimitive];if($!==void 0){var C=$.call(_,H||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(_)}function a(_,H,$){d(_,H),H.set(_,$)}function d(_,H){if(H.has(_))throw new TypeError("Cannot initialize the same private elements twice on an object")}function r(_,H,$){if(!H.has(_))throw new TypeError("attempted to get private field on non-instance");return $}function i(_,H){var $=b(_,H,"get");return o(_,$)}function o(_,H){return H.get?H.get.call(_):H.value}function c(_,H,$){var C=b(_,H,"set");return y(_,C,$),$}function b(_,H,$){if(!H.has(_))throw new TypeError("attempted to "+$+" private field on non-instance");return H.get(_)}function y(_,H,$){if(H.set)H.set.call(_,$);else{if(!H.writable)throw new TypeError("attempted to set read only private field");H.value=$}}var f=new WeakMap,s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakMap,X=new WeakSet,G=new WeakSet,j=new WeakSet,N=new WeakSet;class Q{constructor(H){R(this,N),R(this,j),R(this,G),R(this,X),a(this,f,{writable:!0,value:void 0}),a(this,s,{writable:!0,value:!1}),a(this,g,{writable:!0,value:this.pointerup.bind(this)}),a(this,S,{writable:!0,value:this.pointerdown.bind(this)}),a(this,D,{writable:!0,value:new Map}),a(this,w,{writable:!0,value:!1}),a(this,x,{writable:!0,value:!1}),a(this,F,{writable:!0,value:void 0}),Q._initialized||(Q._initialized=!0,I.FreeTextEditor.initialize(H.l10n),k.InkEditor.initialize(H.l10n)),H.uiManager.registerEditorTypes([I.FreeTextEditor,k.InkEditor]),c(this,F,H.uiManager),this.pageIndex=H.pageIndex,this.div=H.div,c(this,f,H.accessibilityManager),i(this,F).addLayer(this)}get isEmpty(){return i(this,D).size===0}updateToolbar(H){i(this,F).updateToolbar(H)}updateMode(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i(this,F).getMode();r(this,N,q).call(this),H===p.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),i(this,F).unselectAll(),H!==p.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",H===p.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",H===p.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(H){if(!H&&i(this,F).getMode()!==p.AnnotationEditorType.INK)return;if(!H){for(const C of i(this,D).values())if(C.isEmpty()){C.setInBackground();return}}r(this,j,ie).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(H){i(this,F).setEditingState(H)}addCommands(H){i(this,F).addCommands(H)}enable(){this.div.style.pointerEvents="auto";for(const H of i(this,D).values())H.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const H of i(this,D).values())H.disableEditing();r(this,N,q).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(H){i(this,F).getActive()!==H&&i(this,F).setActiveEditor(H)}enableClick(){this.div.addEventListener("pointerdown",i(this,S)),this.div.addEventListener("pointerup",i(this,g))}disableClick(){this.div.removeEventListener("pointerdown",i(this,S)),this.div.removeEventListener("pointerup",i(this,g))}attach(H){i(this,D).set(H.id,H)}detach(H){var $;i(this,D).delete(H.id),($=i(this,f))===null||$===void 0||$.removePointerInTextLayer(H.contentDiv)}remove(H){i(this,F).removeEditor(H),this.detach(H),H.div.style.display="none",setTimeout(()=>{H.div.style.display="",H.div.remove(),H.isAttachedToDOM=!1,document.activeElement===document.body&&i(this,F).focusMainContainer()},0),i(this,x)||this.addInkEditorIfNeeded(!1)}add(H){if(r(this,X,Y).call(this,H),i(this,F).addEditor(H),this.attach(H),!H.isAttachedToDOM){const $=H.render();this.div.append($),H.isAttachedToDOM=!0}this.moveEditorInDOM(H),H.onceAdded(),i(this,F).addToAnnotationStorage(H)}moveEditorInDOM(H){var $;($=i(this,f))===null||$===void 0||$.moveElementInDOM(this.div,H.div,H.contentDiv,!0)}addOrRebuild(H){H.needsToBeRebuilt()?H.rebuild():this.add(H)}addANewEditor(H){const $=()=>{this.addOrRebuild(H)},C=()=>{H.remove()};this.addCommands({cmd:$,undo:C,mustExec:!0})}addUndoableEditor(H){const $=()=>{this.addOrRebuild(H)},C=()=>{H.remove()};this.addCommands({cmd:$,undo:C,mustExec:!1})}getNextId(){return i(this,F).getId()}deserialize(H){switch(H.annotationType){case p.AnnotationEditorType.FREETEXT:return I.FreeTextEditor.deserialize(H,this,i(this,F));case p.AnnotationEditorType.INK:return k.InkEditor.deserialize(H,this,i(this,F))}return null}setSelected(H){i(this,F).setSelected(H)}toggleSelected(H){i(this,F).toggleSelected(H)}isSelected(H){return i(this,F).isSelected(H)}unselect(H){i(this,F).unselect(H)}pointerup(H){const{isMac:$}=p.FeatureTest.platform;if(!(H.button!==0||H.ctrlKey&&$)&&H.target===this.div&&i(this,w)){if(c(this,w,!1),!i(this,s)){c(this,s,!0);return}r(this,j,ie).call(this,H)}}pointerdown(H){const{isMac:$}=p.FeatureTest.platform;if(H.button!==0||H.ctrlKey&&$||H.target!==this.div)return;c(this,w,!0);const C=i(this,F).getActive();c(this,s,!C||C.isEmpty())}drop(H){const $=H.dataTransfer.getData("text/plain"),C=i(this,F).getEditor($);if(!C)return;H.preventDefault(),H.dataTransfer.dropEffect="move",r(this,X,Y).call(this,C);const P=this.div.getBoundingClientRect(),z=H.clientX-P.x,ee=H.clientY-P.y;C.translate(z-C.startX,ee-C.startY),this.moveEditorInDOM(C),C.div.focus()}dragover(H){H.preventDefault()}destroy(){var H;((H=i(this,F).getActive())===null||H===void 0?void 0:H.parent)===this&&i(this,F).setActiveEditor(null);for(const C of i(this,D).values()){var $;($=i(this,f))===null||$===void 0||$.removePointerInTextLayer(C.contentDiv),C.setParent(null),C.isAttachedToDOM=!1,C.div.remove()}this.div=null,i(this,D).clear(),i(this,F).removeLayer(this)}render(H){let{viewport:$}=H;this.viewport=$,(0,m.setLayerDimensions)(this.div,$),(0,v.bindEvents)(this,this.div,["dragover","drop"]);for(const C of i(this,F).getEditors(this.pageIndex))this.add(C);this.updateMode()}update(H){let{viewport:$}=H;i(this,F).commitOrRemove(),this.viewport=$,(0,m.setLayerDimensions)(this.div,{rotation:$.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:H,pageHeight:$}=this.viewport.rawDims;return[H,$]}}E.AnnotationEditorLayer=Q;function Y(_){var H;_.parent!==this&&(this.attach(_),(H=_.parent)===null||H===void 0||H.detach(_),_.setParent(this),_.div&&_.isAttachedToDOM&&(_.div.remove(),this.div.append(_.div)))}function B(_){switch(i(this,F).getMode()){case p.AnnotationEditorType.FREETEXT:return new I.FreeTextEditor(_);case p.AnnotationEditorType.INK:return new k.InkEditor(_)}return null}function ie(_){const H=this.getNextId(),$=r(this,G,B).call(this,{parent:this,id:H,x:_.offsetX,y:_.offsetY,uiManager:i(this,F)});return $&&this.add($),$}function q(){c(this,x,!0);for(const _ of i(this,D).values())_.isEmpty()&&_.remove();c(this,x,!1)}t(Q,"_initialized",!1)},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.FreeTextEditor=void 0;var p=l(1),v=l(138),I=l(137);function k(q,_){h(q,_),_.add(q)}function m(q,_,H){return _=R(_),_ in q?Object.defineProperty(q,_,{value:H,enumerable:!0,configurable:!0,writable:!0}):q[_]=H,q}function R(q){var _=t(q,"string");return typeof _=="symbol"?_:String(_)}function t(q,_){if(typeof q!="object"||q===null)return q;var H=q[Symbol.toPrimitive];if(H!==void 0){var $=H.call(q,_||"default");if(typeof $!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(q)}function n(q,_,H){h(q,_),_.set(q,H)}function h(q,_){if(_.has(q))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(q,_){var H=o(q,_,"get");return d(q,H)}function d(q,_){return _.get?_.get.call(q):_.value}function r(q,_,H){if(!_.has(q))throw new TypeError("attempted to get private field on non-instance");return H}function i(q,_,H){var $=o(q,_,"set");return c(q,$,H),H}function o(q,_,H){if(!_.has(q))throw new TypeError("attempted to "+H+" private field on non-instance");return _.get(q)}function c(q,_,H){if(_.set)_.set.call(q,H);else{if(!_.writable)throw new TypeError("attempted to set read only private field");_.value=H}}var b=new WeakMap,y=new WeakMap,f=new WeakMap,s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakSet,X=new WeakSet,G=new WeakSet,j=new WeakSet;class N extends I.AnnotationEditor{constructor(_){super({..._,name:"freeTextEditor"}),k(this,j),k(this,G),k(this,X),k(this,F),n(this,b,{writable:!0,value:this.editorDivBlur.bind(this)}),n(this,y,{writable:!0,value:this.editorDivFocus.bind(this)}),n(this,f,{writable:!0,value:this.editorDivInput.bind(this)}),n(this,s,{writable:!0,value:this.editorDivKeydown.bind(this)}),n(this,g,{writable:!0,value:void 0}),n(this,S,{writable:!0,value:""}),n(this,D,{writable:!0,value:`${this.id}-editor`}),n(this,w,{writable:!0,value:!1}),n(this,x,{writable:!0,value:void 0}),i(this,g,_.color||N._defaultColor||I.AnnotationEditor._defaultLineColor),i(this,x,_.fontSize||N._defaultFontSize)}static initialize(_){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map($=>[$,_.get($)]));const H=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(H.getPropertyValue("--freetext-padding"))}static updateDefaultParams(_,H){switch(_){case p.AnnotationEditorParamsType.FREETEXT_SIZE:N._defaultFontSize=H;break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:N._defaultColor=H;break}}updateParams(_,H){switch(_){case p.AnnotationEditorParamsType.FREETEXT_SIZE:r(this,F,Q).call(this,H);break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:r(this,X,Y).call(this,H);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,N._defaultFontSize],[p.AnnotationEditorParamsType.FREETEXT_COLOR,N._defaultColor||I.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,a(this,x)],[p.AnnotationEditorParamsType.FREETEXT_COLOR,a(this,g)]]}getInitialTranslation(){const _=this.parentScale;return[-N._internalPadding*_,-(N._internalPadding+a(this,x))*_]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(p.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",a(this,s)),this.editorDiv.addEventListener("focus",a(this,y)),this.editorDiv.addEventListener("blur",a(this,b)),this.editorDiv.addEventListener("input",a(this,f)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",a(this,D)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",a(this,s)),this.editorDiv.removeEventListener("focus",a(this,y)),this.editorDiv.removeEventListener("blur",a(this,b)),this.editorDiv.removeEventListener("input",a(this,f)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(_){super.focusin(_),_.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),a(this,w)||(i(this,w,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),i(this,S,r(this,G,B).call(this).trimEnd()),r(this,j,ie).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(_){this.enableEditMode(),this.editorDiv.focus()}keydown(_){_.target===this.div&&_.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(_){N._keyboardManager.exec(this,_)}editorDivFocus(_){this.isEditing=!0}editorDivBlur(_){this.isEditing=!1}editorDivInput(_){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let _,H;this.width&&(_=this.x,H=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",a(this,D)),this.enableEditing(),N._l10nPromise.get("editor_free_text2_aria_label").then(C=>{var P;return(P=this.editorDiv)===null||P===void 0?void 0:P.setAttribute("aria-label",C)}),N._l10nPromise.get("free_text2_default_content").then(C=>{var P;return(P=this.editorDiv)===null||P===void 0?void 0:P.setAttribute("default-content",C)}),this.editorDiv.contentEditable=!0;const{style:$}=this.editorDiv;if($.fontSize=`calc(${a(this,x)}px * var(--scale-factor))`,$.color=a(this,g),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,v.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[C,P]=this.parentDimensions;this.setAt(_*C,H*P,this.width*C,this.height*P);for(const z of a(this,S).split(`
`)){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.AnnotationEditorParamsType.INK_COLOR:re._defaultColor=pe;break;case p.AnnotationEditorParamsType.INK_OPACITY:re._defaultOpacity=pe/100;break}}updateParams(J,pe){switch(J){case p.AnnotationEditorParamsType.INK_THICKNESS:f(this,_,ve).call(this,pe);break;case p.AnnotationEditorParamsType.INK_COLOR:f(this,H,he).call(this,pe);break;case p.AnnotationEditorParamsType.INK_OPACITY:f(this,$,be).call(this,pe);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,re._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,re._defaultColor||v.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(re._defaultOpacity*100)]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||re._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,this.color||re._defaultColor||v.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??re._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(f(this,fe,V).call(this),f(this,ye,de).call(this)),this.isAttachedToDOM||(this.parent.add(this),f(this,me,Pe).call(this)),f(this,se,Oe).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,c(this,Y).disconnect(),i(this,Y,null),super.remove())}setParent(J){!this.parent&&J?this._uiManager.removeShouldRescale(this):this.parent&&J===null&&this._uiManager.addShouldRescale(this),super.setParent(J)}onScaleChanging(){const[J,pe]=this.parentDimensions,ke=this.width*J,Re=this.height*pe;this.setDimensions(ke,Re)}enableEditMode(){c(this,j)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",c(this,G)),this.canvas.addEventListener("pointerup",c(this,X)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",c(this,G)),this.canvas.removeEventListener("pointerup",c(this,X)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){c(this,j)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),i(this,j,!0),this.div.classList.add("disabled"),f(this,se,Oe).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(J){super.focusin(J),this.enableEditMode()}canvasPointerdown(J){J.button!==0||!this.isInEditMode()||c(this,j)||(this.setInForeground(),J.type!=="mouse"&&this.div.focus(),J.stopPropagation(),this.canvas.addEventListener("pointerleave",c(this,F)),this.canvas.addEventListener("pointermove",c(this,x)),f(this,z,Ie).call(this,J.offsetX,J.offsetY))}canvasPointermove(J){J.stopPropagation(),f(this,ee,He).call(this,J.offsetX,J.offsetY)}canvasPointerup(J){J.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(J.stopPropagation(),f(this,ue,T).call(this,J),this.setInBackground())}canvasPointerleave(J){f(this,ue,T).call(this,J),this.setInBackground()}render(){if(this.div)return this.div;let J,pe;this.width&&(J=this.x,pe=this.y),super.render(),re._l10nPromise.get("editor_ink2_aria_label").then(Ge=>{var Xe;return(Xe=this.div)===null||Xe===void 0?void 0:Xe.setAttribute("aria-label",Ge)});const[ke,Re,Be,Ne]=f(this,C,Ce).call(this);if(this.setAt(ke,Re,0,0),this.setDims(Be,Ne),f(this,fe,V).call(this),this.width){const[Ge,Xe]=this.parentDimensions;this.setAt(J*Ge,pe*Xe,this.width*Ge,this.height*Xe),i(this,N,!0),f(this,me,Pe).call(this),this.setDims(this.width*Ge,this.height*Xe),f(this,K,ae).call(this),f(this,ne,$e).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return f(this,ye,de).call(this),this.div}setDimensions(J,pe){const ke=Math.round(J),Re=Math.round(pe);if(c(this,B)===ke&&c(this,ie)===Re)return;i(this,B,ke),i(this,ie,Re),this.canvas.style.visibility="hidden",c(this,S)&&Math.abs(c(this,S)-J/pe)>.01&&(pe=Math.ceil(J/c(this,S)),this.setDims(J,pe));const[Be,Ne]=this.parentDimensions;this.width=J/Be,this.height=pe/Ne,c(this,j)&&f(this,we,De).call(this,J,pe),f(this,me,Pe).call(this),f(this,K,ae).call(this),this.canvas.style.visibility="visible"}static deserialize(J,pe,ke){const Re=super.deserialize(J,pe,ke);Re.thickness=J.thickness,Re.color=p.Util.makeHexColor(...J.color),Re.opacity=J.opacity;const[Be,Ne]=Re.pageDimensions,Ge=Re.width*Be,Xe=Re.height*Ne,ze=Re.parentScale,Ke=J.thickness/2;i(Re,S,Ge/Xe),i(Re,j,!0),i(Re,B,Math.round(Ge)),i(Re,ie,Math.round(Xe));for(const{bezier:Je}of J.paths){const dt=[];Re.paths.push(dt);let ot=ze*(Je[0]-Ke),lt=ze*(Xe-Je[1]-Ke);for(let at=2,yt=Je.length;at<yt;at+=6){const Mt=ze*(Je[at]-Ke),At=ze*(Xe-Je[at+1]-Ke),St=ze*(Je[at+2]-Ke),st=ze*(Xe-Je[at+3]-Ke),ht=ze*(Je[at+4]-Ke),Ct=ze*(Xe-Je[at+5]-Ke);dt.push([[ot,lt],[Mt,At],[St,st],[ht,Ct]]),ot=ht,lt=Ct}const bt=d(this,re,_e).call(this,dt);Re.bezierPath2D.push(bt)}const Qe=f(Re,U,Ee).call(Re);return i(Re,w,Math.max(s,Qe[2]-Qe[0])),i(Re,D,Math.max(s,Qe[3]-Qe[1])),f(Re,we,De).call(Re,Ge,Xe),Re}serialize(){if(this.isEmpty())return null;const J=this.getRect(0,0),pe=this.rotation%180===0?J[3]-J[1]:J[2]-J[0],ke=v.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:p.AnnotationEditorType.INK,color:ke,thickness:this.thickness,opacity:this.opacity,paths:f(this,A,Me).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,pe),pageIndex:this.pageIndex,rect:J,rotation:this.rotation}}}E.InkEditor=re;function ve(oe){const J=this.thickness;this.addCommands({cmd:()=>{this.thickness=oe,f(this,se,Oe).call(this)},undo:()=>{this.thickness=J,f(this,se,Oe).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function he(oe){const J=this.color;this.addCommands({cmd:()=>{this.color=oe,f(this,K,ae).call(this)},undo:()=>{this.color=J,f(this,K,ae).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function be(oe){oe/=100;const J=this.opacity;this.addCommands({cmd:()=>{this.opacity=oe,f(this,K,ae).call(this)},undo:()=>{this.opacity=J,f(this,K,ae).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Ce(){const{parentRotation:oe,parentDimensions:[J,pe]}=this;switch(oe){case 90:return[0,pe,pe,J];case 180:return[J,pe,J,pe];case 270:return[J,0,pe,J];default:return[0,0,J,pe]}}function Te(){const{ctx:oe,color:J,opacity:pe,thickness:ke,parentScale:Re,scaleFactor:Be}=this;oe.lineWidth=ke*Re/Be,oe.lineCap="round",oe.lineJoin="round",oe.miterLimit=10,oe.strokeStyle=`${J}${(0,k.opacityToHex)(pe)}`}function Ie(oe,J){this.isEditing=!0,c(this,N)||(i(this,N,!0),f(this,me,Pe).call(this),this.thickness||(this.thickness=re._defaultThickness),this.color||(this.color=re._defaultColor||v.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=re._defaultOpacity)),this.currentPath.push([oe,J]),i(this,Q,null),f(this,P,Te).call(this),this.ctx.beginPath(),this.ctx.moveTo(oe,J),i(this,q,()=>{c(this,q)&&(c(this,Q)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):f(this,K,ae).call(this),this.ctx.lineTo(...c(this,Q)),i(this,Q,null),this.ctx.stroke()),window.requestAnimationFrame(c(this,q)))}),window.requestAnimationFrame(c(this,q))}function He(oe,J){const[pe,ke]=this.currentPath.at(-1);oe===pe&&J===ke||(this.currentPath.push([oe,J]),i(this,Q,[oe,J]))}function Ve(oe,J){this.ctx.closePath(),i(this,q,null),oe=Math.min(Math.max(oe,0),this.canvas.width),J=Math.min(Math.max(J,0),this.canvas.height);const[pe,ke]=this.currentPath.at(-1);(oe!==pe||J!==ke)&&this.currentPath.push([oe,J]);let Re;if(this.currentPath.length!==1)Re=(0,I.fitCurve)(this.currentPath,30,null);else{const Xe=[oe,J];Re=[[Xe,Xe.slice(),Xe.slice(),Xe]]}const Be=d(re,re,_e).call(re,Re);this.currentPath.length=0;const Ne=()=>{this.paths.push(Re),this.bezierPath2D.push(Be),this.rebuild()},Ge=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(f(this,fe,V).call(this),f(this,ye,de).call(this)),f(this,se,Oe).call(this))};this.addCommands({cmd:Ne,undo:Ge,mustExec:!0})}function ae(){if(this.isEmpty()){f(this,ge,Fe).call(this);return}f(this,P,Te).call(this);const{canvas:oe,ctx:J}=this;J.setTransform(1,0,0,1,0,0),J.clearRect(0,0,oe.width,oe.height),f(this,ge,Fe).call(this);for(const pe of this.bezierPath2D)J.stroke(pe)}function T(oe){f(this,te,Ve).call(this,oe.offsetX,oe.offsetY),this.canvas.removeEventListener("pointerleave",c(this,F)),this.canvas.removeEventListener("pointermove",c(this,x)),this.addToAnnotationStorage()}function V(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",re._l10nPromise.get("editor_ink_canvas_aria_label").then(oe=>{var J;return(J=this.canvas)===null||J===void 0?void 0:J.setAttribute("aria-label",oe)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function de(){let oe=null;i(this,Y,new ResizeObserver(J=>{const pe=J[0].contentRect;pe.width&&pe.height&&(oe!==null&&clearTimeout(oe),oe=setTimeout(()=>{this.fixDims(),oe=null},g),this.setDimensions(pe.width,pe.height))})),c(this,Y).observe(this.div)}function Pe(){if(!c(this,N))return;const[oe,J]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*oe),this.canvas.height=Math.ceil(this.height*J),f(this,ge,Fe).call(this)}function De(oe,J){const pe=f(this,Z,We).call(this),ke=(oe-pe)/c(this,w),Re=(J-pe)/c(this,D);this.scaleFactor=Math.min(ke,Re)}function Fe(){const oe=f(this,Z,We).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+oe,this.translationY*this.scaleFactor+oe)}function _e(oe){const J=new Path2D;for(let pe=0,ke=oe.length;pe<ke;pe++){const[Re,Be,Ne,Ge]=oe[pe];pe===0&&J.moveTo(...Re),J.bezierCurveTo(Be[0],Be[1],Ne[0],Ne[1],Ge[0],Ge[1])}return J}function Me(oe,J,pe,ke){const Be=[],Ne=this.thickness/2;let Ge,Xe;for(const ze of this.paths){Ge=[],Xe=[];for(let Ke=0,Qe=ze.length;Ke<Qe;Ke++){const[Je,dt,ot,lt]=ze[Ke],bt=oe*(Je[0]+J)+Ne,at=ke-oe*(Je[1]+pe)-Ne,yt=oe*(dt[0]+J)+Ne,Mt=ke-oe*(dt[1]+pe)-Ne,At=oe*(ot[0]+J)+Ne,St=ke-oe*(ot[1]+pe)-Ne,st=oe*(lt[0]+J)+Ne,ht=ke-oe*(lt[1]+pe)-Ne;Ke===0&&(Ge.push(bt,at),Xe.push(bt,at)),Ge.push(yt,Mt,At,St,st,ht),f(this,O,Ae).call(this,bt,at,yt,Mt,At,St,st,ht,4,Xe)}Be.push({bezier:Ge,points:Xe})}return Be}function Ae(oe,J,pe,ke,Re,Be,Ne,Ge,Xe,ze){if(f(this,M,ce).call(this,oe,J,pe,ke,Re,Be,Ne,Ge)){ze.push(Ne,Ge);return}for(let Ke=1;Ke<Xe-1;Ke++){const Qe=Ke/Xe,Je=1-Qe;let dt=Qe*oe+Je*pe,ot=Qe*J+Je*ke,lt=Qe*pe+Je*Re,bt=Qe*ke+Je*Be;const at=Qe*Re+Je*Ne,yt=Qe*Be+Je*Ge;dt=Qe*dt+Je*lt,ot=Qe*ot+Je*bt,lt=Qe*lt+Je*at,bt=Qe*bt+Je*yt,dt=Qe*dt+Je*lt,ot=Qe*ot+Je*bt,ze.push(dt,ot)}ze.push(Ne,Ge)}function ce(oe,J,pe,ke,Re,Be,Ne,Ge){const ze=(3*pe-2*oe-Ne)**2,Ke=(3*ke-2*J-Ge)**2,Qe=(3*Re-oe-2*Ne)**2,Je=(3*Be-J-2*Ge)**2;return Math.max(ze,Qe)+Math.max(Ke,Je)<=10}function Ee(){let oe=1/0,J=-1/0,pe=1/0,ke=-1/0;for(const Re of this.paths)for(const[Be,Ne,Ge,Xe]of Re){const ze=p.Util.bezierBoundingBox(...Be,...Ne,...Ge,...Xe);oe=Math.min(oe,ze[0]),pe=Math.min(pe,ze[1]),J=Math.max(J,ze[2]),ke=Math.max(ke,ze[3])}return[oe,pe,J,ke]}function We(){return c(this,j)?Math.ceil(this.thickness*this.parentScale):0}function Oe(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!c(this,j)){f(this,K,ae).call(this);return}const J=f(this,U,Ee).call(this),pe=f(this,Z,We).call(this);i(this,w,Math.max(s,J[2]-J[0])),i(this,D,Math.max(s,J[3]-J[1]));const ke=Math.ceil(pe+c(this,w)*this.scaleFactor),Re=Math.ceil(pe+c(this,D)*this.scaleFactor),[Be,Ne]=this.parentDimensions;this.width=ke/Be,this.height=Re/Ne,i(this,S,ke/Re),f(this,ne,$e).call(this);const Ge=this.translationX,Xe=this.translationY;this.translationX=-J[0],this.translationY=-J[1],f(this,me,Pe).call(this),f(this,K,ae).call(this),i(this,B,ke),i(this,ie,Re),this.setDims(ke,Re);const ze=oe?pe/this.scaleFactor/2:0;this.translate(Ge-this.translationX-ze,Xe-this.translationY-ze)}function $e(){const{style:oe}=this.div;c(this,S)>=1?(oe.minHeight=`${s}px`,oe.minWidth=`${Math.round(c(this,S)*s)}px`):(oe.minWidth=`${s}px`,oe.minHeight=`${Math.round(s/c(this,S))}px`)}R(re,"_defaultColor",null),R(re,"_defaultOpacity",1),R(re,"_defaultThickness",1),R(re,"_l10nPromise",void 0),R(re,"_type","ink")},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.fitCurve=void 0;const p=l(163);E.fitCurve=p},W=>{function E(r,i,o){if(!Array.isArray(r))throw new TypeError("First argument should be an array");if(r.forEach(f=>{if(!Array.isArray(f)||f.some(s=>typeof s!="number")||f.length!==r[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),r=r.filter((f,s)=>s===0||!f.every((g,S)=>g===r[s-1][S])),r.length<2)return[];const c=r.length,b=h(r[1],r[0]),y=h(r[c-2],r[c-1]);return l(r,b,y,i,o)}function l(r,i,o,c,b){var f,s,g,S,D,w,x,F,X,G,j,N,Q;if(r.length===2)return N=a.vectorLen(a.subtract(r[0],r[1]))/3,f=[r[0],a.addArrays(r[0],a.mulItems(i,N)),a.addArrays(r[1],a.mulItems(o,N)),r[1]],[f];if(s=m(r),[f,S,w]=p(r,s,s,i,o,b),S===0||S<c)return[f];if(S<c*c)for(g=s,D=S,x=w,Q=0;Q<20;Q++){if(g=I(f,r,g),[f,S,w]=p(r,s,g,i,o,b),S<c)return[f];if(w===x){let Y=S/D;if(Y>.9999&&Y<1.0001)break}D=S,x=w}return j=[],F=a.subtract(r[w-1],r[w+1]),F.every(Y=>Y===0)&&(F=a.subtract(r[w-1],r[w]),[F[0],F[1]]=[-F[1],F[0]]),X=a.normalize(F),G=a.mulItems(X,-1),j=j.concat(l(r.slice(0,w+1),i,X,c,b)),j=j.concat(l(r.slice(w),G,o,c,b)),j}function p(r,i,o,c,b,y){var f,s,g;return f=v(r,o,c,b),[s,g]=R(r,f,i),y&&y({bez:f,points:r,params:i,maxErr:s,maxPoint:g}),[f,s,g]}function v(r,i,o,c){var b,y,f,s,g,S,D,w,x,F,X,G,j,N,Q,Y,B,ie=r[0],q=r[r.length-1];for(b=[ie,null,null,q],y=a.zeros_Xx2x2(i.length),j=0,N=i.length;j<N;j++)Y=i[j],B=1-Y,f=y[j],f[0]=a.mulItems(o,3*Y*(B*B)),f[1]=a.mulItems(c,3*B*(Y*Y));for(s=[[0,0],[0,0]],g=[0,0],j=0,N=r.length;j<N;j++)Y=i[j],f=y[j],s[0][0]+=a.dot(f[0],f[0]),s[0][1]+=a.dot(f[0],f[1]),s[1][0]+=a.dot(f[0],f[1]),s[1][1]+=a.dot(f[1],f[1]),Q=a.subtract(r[j],d.q([ie,ie,q,q],Y)),g[0]+=a.dot(f[0],Q),g[1]+=a.dot(f[1],Q);return S=s[0][0]*s[1][1]-s[1][0]*s[0][1],D=s[0][0]*g[1]-s[1][0]*g[0],w=g[0]*s[1][1]-g[1]*s[0][1],x=S===0?0:w/S,F=S===0?0:D/S,G=a.vectorLen(a.subtract(ie,q)),X=1e-6*G,x<X||F<X?(b[1]=a.addArrays(ie,a.mulItems(o,G/3)),b[2]=a.addArrays(q,a.mulItems(c,G/3))):(b[1]=a.addArrays(ie,a.mulItems(o,x)),b[2]=a.addArrays(q,a.mulItems(c,F))),b}function I(r,i,o){return o.map((c,b)=>k(r,i[b],c))}function k(r,i,o){var c=a.subtract(d.q(r,o),i),b=d.qprime(r,o),y=a.mulMatrix(c,b),f=a.sum(a.squareItems(b))+2*a.mulMatrix(c,d.qprimeprime(r,o));return f===0?o:o-y/f}function m(r){var i=[],o,c,b;return r.forEach((y,f)=>{o=f?c+a.vectorLen(a.subtract(y,b)):0,i.push(o),c=o,b=y}),i=i.map(y=>y/c),i}function R(r,i,o){var c,b,y,f,s,g,S,D;b=0,y=Math.floor(r.length/2);const w=t(i,10);for(s=0,g=r.length;s<g;s++)S=r[s],D=n(i,o[s],w,10),f=a.subtract(d.q(i,D),S),c=f[0]*f[0]+f[1]*f[1],c>b&&(b=c,y=s);return[b,y]}var t=function(r,i){for(var o,c=[0],b=r[0],y=0,f=1;f<=i;f++)o=d.q(r,f/i),y+=a.vectorLen(a.subtract(o,b)),c.push(y),b=o;return c=c.map(s=>s/y),c};function n(r,i,o,c){if(i<0)return 0;if(i>1)return 1;for(var b,y,f,s,g,S=1;S<=c;S++)if(i<=o[S]){s=(S-1)/c,f=S/c,y=o[S-1],b=o[S],g=(i-y)/(b-y)*(f-s)+s;break}return g}function h(r,i){return a.normalize(a.subtract(r,i))}class a{static zeros_Xx2x2(i){for(var o=[];i--;)o.push([0,0]);return o}static mulItems(i,o){return i.map(c=>c*o)}static mulMatrix(i,o){return i.reduce((c,b,y)=>c+b*o[y],0)}static subtract(i,o){return i.map((c,b)=>c-o[b])}static addArrays(i,o){return i.map((c,b)=>c+o[b])}static addItems(i,o){return i.map(c=>c+o)}static sum(i){return i.reduce((o,c)=>o+c)}static dot(i,o){return a.mulMatrix(i,o)}static vectorLen(i){return Math.hypot(...i)}static divItems(i,o){return i.map(c=>c/o)}static squareItems(i){return i.map(o=>o*o)}static normalize(i){return this.divItems(i,this.vectorLen(i))}}class d{static q(i,o){var c=1-o,b=a.mulItems(i[0],c*c*c),y=a.mulItems(i[1],3*c*c*o),f=a.mulItems(i[2],3*c*o*o),s=a.mulItems(i[3],o*o*o);return a.addArrays(a.addArrays(b,y),a.addArrays(f,s))}static qprime(i,o){var c=1-o,b=a.mulItems(a.subtract(i[1],i[0]),3*c*c),y=a.mulItems(a.subtract(i[2],i[1]),6*c*o),f=a.mulItems(a.subtract(i[3],i[2]),3*o*o);return a.addArrays(a.addArrays(b,y),f)}static qprimeprime(i,o){return a.addArrays(a.mulItems(a.addArrays(a.subtract(i[2],a.mulItems(i[1],2)),i[0]),6*(1-o)),a.mulItems(a.addArrays(a.subtract(i[3],a.mulItems(i[2],2)),i[1]),6*o))}}W.exports=E,W.exports.fitCubic=l,W.exports.createTangent=h},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationLayer=void 0;var p=l(1),v=l(139),I=l(136),k=l(165),m=l(166);function R(ge,A,O){return t(ge,A),O}function t(ge,A){if(ge!==A)throw new TypeError("Private static access of wrong provenance")}function n(ge,A){h(ge,A),A.add(ge)}function h(ge,A){if(A.has(ge))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(ge,A,O){if(!A.has(ge))throw new TypeError("attempted to get private field on non-instance");return O}const d=1e3,r=9,i=new WeakSet;function o(ge){return{width:ge[2]-ge[0],height:ge[3]-ge[1]}}class c{static create(A){switch(A.data.annotationType){case p.AnnotationType.LINK:return new s(A);case p.AnnotationType.TEXT:return new D(A);case p.AnnotationType.WIDGET:switch(A.data.fieldType){case"Tx":return new x(A);case"Btn":return A.data.radioButton?new X(A):A.data.checkBox?new F(A):new G(A);case"Ch":return new j(A)}return new w(A);case p.AnnotationType.POPUP:return new N(A);case p.AnnotationType.FREETEXT:return new Y(A);case p.AnnotationType.LINE:return new B(A);case p.AnnotationType.SQUARE:return new ie(A);case p.AnnotationType.CIRCLE:return new q(A);case p.AnnotationType.POLYLINE:return new _(A);case p.AnnotationType.CARET:return new $(A);case p.AnnotationType.INK:return new C(A);case p.AnnotationType.POLYGON:return new H(A);case p.AnnotationType.HIGHLIGHT:return new P(A);case p.AnnotationType.UNDERLINE:return new z(A);case p.AnnotationType.SQUIGGLY:return new ee(A);case p.AnnotationType.STRIKEOUT:return new te(A);case p.AnnotationType.STAMP:return new K(A);case p.AnnotationType.FILEATTACHMENT:return new ue(A);default:return new b(A)}}}class b{constructor(A){let{isRenderable:O=!1,ignoreBorder:M=!1,createQuadrilaterals:U=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=O,this.data=A.data,this.layer=A.layer,this.page=A.page,this.viewport=A.viewport,this.linkService=A.linkService,this.downloadManager=A.downloadManager,this.imageResourcesPath=A.imageResourcesPath,this.renderForms=A.renderForms,this.svgFactory=A.svgFactory,this.annotationStorage=A.annotationStorage,this.enableScripting=A.enableScripting,this.hasJSActions=A.hasJSActions,this._fieldObjects=A.fieldObjects,O&&(this.container=this._createContainer(M)),U&&(this.quadrilaterals=this._createQuadrilaterals(M))}_createContainer(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{data:O,page:M,viewport:U}=this,Z=document.createElement("section");Z.setAttribute("data-annotation-id",O.id);const{pageWidth:se,pageHeight:ne,pageX:re,pageY:ve}=U.rawDims,{width:he,height:be}=o(O.rect),Ce=p.Util.normalizeRect([O.rect[0],M.view[3]-O.rect[1]+M.view[1],O.rect[2],M.view[3]-O.rect[3]+M.view[1]]);if(!A&&O.borderStyle.width>0){Z.style.borderWidth=`${O.borderStyle.width}px`;const Ie=O.borderStyle.horizontalCornerRadius,He=O.borderStyle.verticalCornerRadius;if(Ie>0||He>0){const ae=`calc(${Ie}px * var(--scale-factor)) / calc(${He}px * var(--scale-factor))`;Z.style.borderRadius=ae}else if(this instanceof X){const ae=`calc(${he}px * var(--scale-factor)) / calc(${be}px * var(--scale-factor))`;Z.style.borderRadius=ae}switch(O.borderStyle.style){case p.AnnotationBorderStyleType.SOLID:Z.style.borderStyle="solid";break;case p.AnnotationBorderStyleType.DASHED:Z.style.borderStyle="dashed";break;case p.AnnotationBorderStyleType.BEVELED:(0,p.warn)("Unimplemented border style: beveled");break;case p.AnnotationBorderStyleType.INSET:(0,p.warn)("Unimplemented border style: inset");break;case p.AnnotationBorderStyleType.UNDERLINE:Z.style.borderBottomStyle="solid";break}const Ve=O.borderColor||null;Ve?Z.style.borderColor=p.Util.makeHexColor(Ve[0]|0,Ve[1]|0,Ve[2]|0):Z.style.borderWidth=0}Z.style.left=`${100*(Ce[0]-re)/se}%`,Z.style.top=`${100*(Ce[1]-ve)/ne}%`;const{rotation:Te}=O;return O.hasOwnCanvas||Te===0?(Z.style.width=`${100*he/se}%`,Z.style.height=`${100*be/ne}%`):this.setRotation(Te,Z),Z}setRotation(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.container;const{pageWidth:M,pageHeight:U}=this.viewport.rawDims,{width:Z,height:se}=o(this.data.rect);let ne,re;A%180===0?(ne=100*Z/M,re=100*se/U):(ne=100*se/M,re=100*Z/U),O.style.width=`${ne}%`,O.style.height=`${re}%`,O.setAttribute("data-main-rotation",(360-A)%360)}get _commonActions(){const A=(O,M,U)=>{const Z=U.detail[O];U.target.style[M]=k.ColorConverters[`${Z[0]}_HTML`](Z.slice(1))};return(0,p.shadow)(this,"_commonActions",{display:O=>{const M=O.detail.display%2===1;this.container.style.visibility=M?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:M,print:O.detail.display===0||O.detail.display===3})},print:O=>{this.annotationStorage.setValue(this.data.id,{print:O.detail.print})},hidden:O=>{this.container.style.visibility=O.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:O.detail.hidden})},focus:O=>{setTimeout(()=>O.target.focus({preventScroll:!1}),0)},userName:O=>{O.target.title=O.detail.userName},readonly:O=>{O.detail.readonly?O.target.setAttribute("readonly",""):O.target.removeAttribute("readonly")},required:O=>{this._setRequired(O.target,O.detail.required)},bgColor:O=>{A("bgColor","backgroundColor",O)},fillColor:O=>{A("fillColor","backgroundColor",O)},fgColor:O=>{A("fgColor","color",O)},textColor:O=>{A("textColor","color",O)},borderColor:O=>{A("borderColor","borderColor",O)},strokeColor:O=>{A("strokeColor","borderColor",O)},rotation:O=>{const M=O.detail.rotation;this.setRotation(M),this.annotationStorage.setValue(this.data.id,{rotation:M})}})}_dispatchEventFromSandbox(A,O){const M=this._commonActions;for(const U of Object.keys(O.detail)){const Z=A[U]||M[U];Z==null||Z(O)}}_setDefaultPropertiesFromJS(A){if(!this.enableScripting)return;const O=this.annotationStorage.getRawValue(this.data.id);if(!O)return;const M=this._commonActions;for(const[U,Z]of Object.entries(O)){const se=M[U];if(se){const ne={detail:{[U]:Z},target:A};se(ne),delete O[U]}}}_createQuadrilaterals(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.data.quadPoints)return null;const O=[],M=this.data.rect;for(const U of this.data.quadPoints)this.data.rect=[U[2].x,U[2].y,U[1].x,U[1].y],O.push(this._createContainer(A));return this.data.rect=M,O}_createPopup(A,O){let M=this.container;this.quadrilaterals&&(A=A||this.quadrilaterals,M=this.quadrilaterals[0]),A||(A=document.createElement("div"),A.className="popupTriggerArea",M.append(A));const Z=new Q({container:M,trigger:A,color:O.color,titleObj:O.titleObj,modificationDate:O.modificationDate,contentsObj:O.contentsObj,richText:O.richText,hideWrapper:!0}).render();Z.style.left="100%",M.append(Z)}_renderQuadrilaterals(A){for(const O of this.quadrilaterals)O.className=A;return this.quadrilaterals}render(){(0,p.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const M=[];if(this._fieldObjects){const U=this._fieldObjects[A];if(U)for(const{page:Z,id:se,exportValues:ne}of U){if(Z===-1||se===O)continue;const re=typeof ne=="string"?ne:null,ve=document.querySelector(`[data-element-id="${se}"]`);if(ve&&!i.has(ve)){(0,p.warn)(`_getElementsByName - element not allowed: ${se}`);continue}M.push({id:se,exportValue:re,domElement:ve})}return M}for(const U of document.getElementsByName(A)){const{exportValue:Z}=U,se=U.getAttribute("data-element-id");se!==O&&i.has(U)&&M.push({id:se,exportValue:Z,domElement:U})}return M}}var y=new WeakSet,f=new WeakSet;class s extends b{constructor(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(A,{isRenderable:!0,ignoreBorder:!!(O!=null&&O.ignoreBorder),createQuadrilaterals:!0}),n(this,f),n(this,y),this.isTooltipOnly=A.data.isTooltipOnly}render(){const{data:A,linkService:O}=this,M=document.createElement("a");M.setAttribute("data-element-id",A.id);let U=!1;return A.url?(O.addLinkAttributes(M,A.url,A.newWindow),U=!0):A.action?(this._bindNamedAction(M,A.action),U=!0):A.attachment?(this._bindAttachment(M,A.attachment),U=!0):A.setOCGState?(a(this,f,S).call(this,M,A.setOCGState),U=!0):A.dest?(this._bindLink(M,A.dest),U=!0):(A.actions&&(A.actions.Action||A.actions["Mouse Up"]||A.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(M,A),U=!0),A.resetForm?(this._bindResetFormAction(M,A.resetForm),U=!0):this.isTooltipOnly&&!U&&(this._bindLink(M,""),U=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((Z,se)=>{const ne=se===0?M:M.cloneNode();return Z.append(ne),Z}):(this.container.className="linkAnnotation",U&&this.container.append(M),this.container)}_bindLink(A,O){A.href=this.linkService.getDestinationHash(O),A.onclick=()=>(O&&this.linkService.goToDestination(O),!1),(O||O==="")&&a(this,y,g).call(this)}_bindNamedAction(A,O){A.href=this.linkService.getAnchorUrl(""),A.onclick=()=>(this.linkService.executeNamedAction(O),!1),a(this,y,g).call(this)}_bindAttachment(A,O){A.href=this.linkService.getAnchorUrl(""),A.onclick=()=>{var M;return(M=this.downloadManager)===null||M===void 0||M.openOrDownloadData(this.container,O.content,O.filename),!1},a(this,y,g).call(this)}_bindJSAction(A,O){A.href=this.linkService.getAnchorUrl("");const M=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const U of Object.keys(O.actions)){const Z=M.get(U);Z&&(A[Z]=()=>{var se;return(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O.id,name:U}}),!1})}A.onclick||(A.onclick=()=>!1),a(this,y,g).call(this)}_bindResetFormAction(A,O){const M=A.onclick;if(M||(A.href=this.linkService.getAnchorUrl("")),a(this,y,g).call(this),!this._fieldObjects){(0,p.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),M||(A.onclick=()=>!1);return}A.onclick=()=>{M==null||M();const{fields:U,refs:Z,include:se}=O,ne=[];if(U.length!==0||Z.length!==0){const be=new Set(Z);for(const Ce of U){const Te=this._fieldObjects[Ce]||[];for(const{id:Ie}of Te)be.add(Ie)}for(const Ce of Object.values(this._fieldObjects))for(const Te of Ce)be.has(Te.id)===se&&ne.push(Te)}else for(const be of Object.values(this._fieldObjects))ne.push(...be);const re=this.annotationStorage,ve=[];for(const be of ne){const{id:Ce}=be;switch(ve.push(Ce),be.type){case"text":{const Ie=be.defaultValue||"";re.setValue(Ce,{value:Ie});break}case"checkbox":case"radiobutton":{const Ie=be.defaultValue===be.exportValues;re.setValue(Ce,{value:Ie});break}case"combobox":case"listbox":{const Ie=be.defaultValue||"";re.setValue(Ce,{value:Ie});break}default:continue}const Te=document.querySelector(`[data-element-id="${Ce}"]`);if(Te){if(!i.has(Te)){(0,p.warn)(`_bindResetFormAction - element not allowed: ${Ce}`);continue}}else continue;Te.dispatchEvent(new Event("resetform"))}if(this.enableScripting){var he;(he=this.linkService.eventBus)===null||he===void 0||he.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:ve,name:"ResetForm"}})}return!1}}}function g(){this.container.setAttribute("data-internal-link","")}function S(ge,A){ge.href=this.linkService.getAnchorUrl(""),ge.onclick=()=>(this.linkService.executeSetOCGState(A),!1),a(this,y,g).call(this)}class D extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z})}render(){this.container.className="textAnnotation";const A=document.createElement("img");return A.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",A.alt="[{{type}} Annotation]",A.dataset.l10nId="text_annotation_type",A.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(A,this.data),this.container.append(A),this.container}}class w extends b{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(A){const{isWin:O,isMac:M}=p.FeatureTest.platform;return O&&A.ctrlKey||M&&A.metaKey}_setEventListener(A,O,M,U){O.includes("mouse")?A.addEventListener(O,Z=>{var se;(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:U(Z),shift:Z.shiftKey,modifier:this._getKeyModifier(Z)}})}):A.addEventListener(O,Z=>{var se;(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:U(Z)}})})}_setEventListeners(A,O,M){for(const[Z,se]of O){var U;(se==="Action"||(U=this.data.actions)!==null&&U!==void 0&&U[se])&&this._setEventListener(A,Z,se,M)}}_setBackgroundColor(A){const O=this.data.backgroundColor||null;A.style.backgroundColor=O===null?"transparent":p.Util.makeHexColor(O[0],O[1],O[2])}_setTextStyle(A){const O=["left","center","right"],{fontColor:M}=this.data.defaultAppearanceData,U=this.data.defaultAppearanceData.fontSize||r,Z=A.style;let se;const ne=2,re=ve=>Math.round(10*ve)/10;if(this.data.multiLine){const ve=Math.abs(this.data.rect[3]-this.data.rect[1]-ne),he=Math.round(ve/(p.LINE_FACTOR*U))||1,be=ve/he;se=Math.min(U,re(be/p.LINE_FACTOR))}else{const ve=Math.abs(this.data.rect[3]-this.data.rect[1]-ne);se=Math.min(U,re(ve/p.LINE_FACTOR))}Z.fontSize=`calc(${se}px * var(--scale-factor))`,Z.color=p.Util.makeHexColor(M[0],M[1],M[2]),this.data.textAlignment!==null&&(Z.textAlign=O[this.data.textAlignment])}_setRequired(A,O){O?A.setAttribute("required",!0):A.removeAttribute("required"),A.setAttribute("aria-required",O)}}class x extends w{constructor(A){const O=A.renderForms||!A.data.hasAppearance&&!!A.data.fieldValue;super(A,{isRenderable:O})}setPropertyOnSiblings(A,O,M,U){const Z=this.annotationStorage;for(const se of this._getElementsByName(A.name,A.id))se.domElement&&(se.domElement[O]=M),Z.setValue(se.id,{[U]:M})}render(){const A=this.annotationStorage,O=this.data.id;this.container.className="textWidgetAnnotation";let M=null;if(this.renderForms){const Z=A.getValue(O,{value:this.data.fieldValue});let se=Z.formattedValue||Z.value||"";const ne=A.getValue(O,{charLimit:this.data.maxLen}).charLimit;ne&&se.length>ne&&(se=se.slice(0,ne));const re={userValue:se,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(M=document.createElement("textarea"),M.textContent=se,this.data.doNotScroll&&(M.style.overflowY="hidden")):(M=document.createElement("input"),M.type="text",M.setAttribute("value",se),this.data.doNotScroll&&(M.style.overflowX="hidden")),i.add(M),M.setAttribute("data-element-id",O),M.disabled=this.data.readOnly,M.name=this.data.fieldName,M.tabIndex=d,this._setRequired(M,this.data.required),ne&&(M.maxLength=ne),M.addEventListener("input",he=>{A.setValue(O,{value:he.target.value}),this.setPropertyOnSiblings(M,"value",he.target.value,"value")}),M.addEventListener("resetform",he=>{const be=this.data.defaultFieldValue??"";M.value=re.userValue=be,re.formattedValue=null});let ve=he=>{const{formattedValue:be}=re;be!=null&&(he.target.value=be),he.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var U;M.addEventListener("focus",be=>{const{target:Ce}=be;re.userValue&&(Ce.value=re.userValue),re.lastCommittedValue=Ce.value,re.commitKey=1}),M.addEventListener("updatefromsandbox",be=>{const Ce={value(Te){re.userValue=Te.detail.value??"",A.setValue(O,{value:re.userValue.toString()}),Te.target.value=re.userValue},formattedValue(Te){const{formattedValue:Ie}=Te.detail;re.formattedValue=Ie,Ie!=null&&Te.target!==document.activeElement&&(Te.target.value=Ie),A.setValue(O,{formattedValue:Ie})},selRange(Te){Te.target.setSelectionRange(...Te.detail.selRange)},charLimit:Te=>{var Ie;const{charLimit:He}=Te.detail,{target:Ve}=Te;if(He===0){Ve.removeAttribute("maxLength");return}Ve.setAttribute("maxLength",He);let ae=re.userValue;!ae||ae.length<=He||(ae=ae.slice(0,He),Ve.value=re.userValue=ae,A.setValue(O,{value:ae}),(Ie=this.linkService.eventBus)===null||Ie===void 0||Ie.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:ae,willCommit:!0,commitKey:1,selStart:Ve.selectionStart,selEnd:Ve.selectionEnd}}))}};this._dispatchEventFromSandbox(Ce,be)}),M.addEventListener("keydown",be=>{var Ce;re.commitKey=1;let Te=-1;if(be.key==="Escape"?Te=0:be.key==="Enter"&&!this.data.multiLine?Te=2:be.key==="Tab"&&(re.commitKey=3),Te===-1)return;const{value:Ie}=be.target;re.lastCommittedValue!==Ie&&(re.lastCommittedValue=Ie,re.userValue=Ie,(Ce=this.linkService.eventBus)===null||Ce===void 0||Ce.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:Ie,willCommit:!0,commitKey:Te,selStart:be.target.selectionStart,selEnd:be.target.selectionEnd}}))});const he=ve;ve=null,M.addEventListener("blur",be=>{if(!be.relatedTarget)return;const{value:Ce}=be.target;if(re.userValue=Ce,re.lastCommittedValue!==Ce){var Te;(Te=this.linkService.eventBus)===null||Te===void 0||Te.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:Ce,willCommit:!0,commitKey:re.commitKey,selStart:be.target.selectionStart,selEnd:be.target.selectionEnd}})}he(be)}),(U=this.data.actions)!==null&&U!==void 0&&U.Keystroke&&M.addEventListener("beforeinput",be=>{var Ce;re.lastCommittedValue=null;const{data:Te,target:Ie}=be,{value:He,selectionStart:Ve,selectionEnd:ae}=Ie;let T=Ve,V=ae;switch(be.inputType){case"deleteWordBackward":{const de=He.substring(0,Ve).match(/\w*[^\w]*$/);de&&(T-=de[0].length);break}case"deleteWordForward":{const de=He.substring(Ve).match(/^[^\w]*\w*/);de&&(V+=de[0].length);break}case"deleteContentBackward":Ve===ae&&(T-=1);break;case"deleteContentForward":Ve===ae&&(V+=1);break}be.preventDefault(),(Ce=this.linkService.eventBus)===null||Ce===void 0||Ce.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:He,change:Te||"",willCommit:!1,selStart:T,selEnd:V}})}),this._setEventListeners(M,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],be=>be.target.value)}if(ve&&M.addEventListener("blur",ve),this.data.comb){const be=(this.data.rect[2]-this.data.rect[0])/ne;M.classList.add("comb"),M.style.letterSpacing=`calc(${be}px * var(--scale-factor) - 1ch)`}}else M=document.createElement("div"),M.textContent=this.data.fieldValue,M.style.verticalAlign="middle",M.style.display="table-cell";return this._setTextStyle(M),this._setBackgroundColor(M),this._setDefaultPropertiesFromJS(M),this.container.append(M),this.container}}class F extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){const A=this.annotationStorage,O=this.data,M=O.id;let U=A.getValue(M,{value:O.exportValue===O.fieldValue}).value;typeof U=="string"&&(U=U!=="Off",A.setValue(M,{value:U})),this.container.className="buttonWidgetAnnotation checkBox";const Z=document.createElement("input");return i.add(Z),Z.setAttribute("data-element-id",M),Z.disabled=O.readOnly,this._setRequired(Z,this.data.required),Z.type="checkbox",Z.name=O.fieldName,U&&Z.setAttribute("checked",!0),Z.setAttribute("exportValue",O.exportValue),Z.tabIndex=d,Z.addEventListener("change",se=>{const{name:ne,checked:re}=se.target;for(const ve of this._getElementsByName(ne,M)){const he=re&&ve.exportValue===O.exportValue;ve.domElement&&(ve.domElement.checked=he),A.setValue(ve.id,{value:he})}A.setValue(M,{value:re})}),Z.addEventListener("resetform",se=>{const ne=O.defaultFieldValue||"Off";se.target.checked=ne===O.exportValue}),this.enableScripting&&this.hasJSActions&&(Z.addEventListener("updatefromsandbox",se=>{const ne={value(re){re.target.checked=re.detail.value!=="Off",A.setValue(M,{value:re.target.checked})}};this._dispatchEventFromSandbox(ne,se)}),this._setEventListeners(Z,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],se=>se.target.checked)),this._setBackgroundColor(Z),this._setDefaultPropertiesFromJS(Z),this.container.append(Z),this.container}}class X extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const A=this.annotationStorage,O=this.data,M=O.id;let U=A.getValue(M,{value:O.fieldValue===O.buttonValue}).value;typeof U=="string"&&(U=U!==O.buttonValue,A.setValue(M,{value:U}));const Z=document.createElement("input");if(i.add(Z),Z.setAttribute("data-element-id",M),Z.disabled=O.readOnly,this._setRequired(Z,this.data.required),Z.type="radio",Z.name=O.fieldName,U&&Z.setAttribute("checked",!0),Z.tabIndex=d,Z.addEventListener("change",se=>{const{name:ne,checked:re}=se.target;for(const ve of this._getElementsByName(ne,M))A.setValue(ve.id,{value:!1});A.setValue(M,{value:re})}),Z.addEventListener("resetform",se=>{const ne=O.defaultFieldValue;se.target.checked=ne!=null&&ne===O.buttonValue}),this.enableScripting&&this.hasJSActions){const se=O.buttonValue;Z.addEventListener("updatefromsandbox",ne=>{const re={value:ve=>{const he=se===ve.detail.value;for(const be of this._getElementsByName(ve.target.name)){const Ce=he&&be.id===M;be.domElement&&(be.domElement.checked=Ce),A.setValue(be.id,{value:Ce})}}};this._dispatchEventFromSandbox(re,ne)}),this._setEventListeners(Z,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ne=>ne.target.checked)}return this._setBackgroundColor(Z),this._setDefaultPropertiesFromJS(Z),this.container.append(Z),this.container}}class G extends s{constructor(A){super(A,{ignoreBorder:A.data.hasAppearance})}render(){const A=super.render();A.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(A.title=this.data.alternativeText);const O=A.lastChild;return this.enableScripting&&this.hasJSActions&&O&&(this._setDefaultPropertiesFromJS(O),O.addEventListener("updatefromsandbox",M=>{this._dispatchEventFromSandbox({},M)})),A}}class j extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const A=this.annotationStorage,O=this.data.id,M=A.getValue(O,{value:this.data.fieldValue}),U=document.createElement("select");i.add(U),U.setAttribute("data-element-id",O),U.disabled=this.data.readOnly,this._setRequired(U,this.data.required),U.name=this.data.fieldName,U.tabIndex=d;let Z=this.data.combo&&this.data.options.length>0;this.data.combo||(U.size=this.data.options.length,this.data.multiSelect&&(U.multiple=!0)),U.addEventListener("resetform",he=>{const be=this.data.defaultFieldValue;for(const Ce of U.options)Ce.selected=Ce.value===be});for(const he of this.data.options){const be=document.createElement("option");be.textContent=he.displayValue,be.value=he.exportValue,M.value.includes(he.exportValue)&&(be.setAttribute("selected",!0),Z=!1),U.append(be)}let se=null;if(Z){const he=document.createElement("option");he.value=" ",he.setAttribute("hidden",!0),he.setAttribute("selected",!0),U.prepend(he),se=()=>{he.remove(),U.removeEventListener("input",se),se=null},U.addEventListener("input",se)}const ne=he=>{const be=he?"value":"textContent",{options:Ce,multiple:Te}=U;return Te?Array.prototype.filter.call(Ce,Ie=>Ie.selected).map(Ie=>Ie[be]):Ce.selectedIndex===-1?null:Ce[Ce.selectedIndex][be]};let re=ne(!1);const ve=he=>{const be=he.target.options;return Array.prototype.map.call(be,Ce=>({displayValue:Ce.textContent,exportValue:Ce.value}))};return this.enableScripting&&this.hasJSActions?(U.addEventListener("updatefromsandbox",he=>{const be={value(Ce){var Te;(Te=se)===null||Te===void 0||Te();const Ie=Ce.detail.value,He=new Set(Array.isArray(Ie)?Ie:[Ie]);for(const Ve of U.options)Ve.selected=He.has(Ve.value);A.setValue(O,{value:ne(!0)}),re=ne(!1)},multipleSelection(Ce){U.multiple=!0},remove(Ce){const Te=U.options,Ie=Ce.detail.remove;Te[Ie].selected=!1,U.remove(Ie),Te.length>0&&Array.prototype.findIndex.call(Te,Ve=>Ve.selected)===-1&&(Te[0].selected=!0),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},clear(Ce){for(;U.length!==0;)U.remove(0);A.setValue(O,{value:null,items:[]}),re=ne(!1)},insert(Ce){const{index:Te,displayValue:Ie,exportValue:He}=Ce.detail.insert,Ve=U.children[Te],ae=document.createElement("option");ae.textContent=Ie,ae.value=He,Ve?Ve.before(ae):U.append(ae),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},items(Ce){const{items:Te}=Ce.detail;for(;U.length!==0;)U.remove(0);for(const Ie of Te){const{displayValue:He,exportValue:Ve}=Ie,ae=document.createElement("option");ae.textContent=He,ae.value=Ve,U.append(ae)}U.options.length>0&&(U.options[0].selected=!0),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},indices(Ce){const Te=new Set(Ce.detail.indices);for(const Ie of Ce.target.options)Ie.selected=Te.has(Ie.index);A.setValue(O,{value:ne(!0)}),re=ne(!1)},editable(Ce){Ce.target.disabled=!Ce.detail.editable}};this._dispatchEventFromSandbox(be,he)}),U.addEventListener("input",he=>{var be;const Ce=ne(!0);A.setValue(O,{value:Ce}),he.preventDefault(),(be=this.linkService.eventBus)===null||be===void 0||be.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:re,changeEx:Ce,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(U,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],he=>he.target.value)):U.addEventListener("input",function(he){A.setValue(O,{value:ne(!0)})}),this.data.combo&&this._setTextStyle(U),this._setBackgroundColor(U),this._setDefaultPropertiesFromJS(U),this.container.append(U),this.container}}const we=class extends b{constructor(A){var O,M,U;const{data:Z}=A,se=!we.IGNORE_TYPES.has(Z.parentType)&&!!((O=Z.titleObj)!==null&&O!==void 0&&O.str||(M=Z.contentsObj)!==null&&M!==void 0&&M.str||(U=Z.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:se})}render(){this.container.className="popupAnnotation";const A=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(A.length===0)return this.container;const O=new Q({container:this.container,trigger:Array.from(A),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),M=this.page,U=p.Util.normalizeRect([this.data.parentRect[0],M.view[3]-this.data.parentRect[1]+M.view[1],this.data.parentRect[2],M.view[3]-this.data.parentRect[3]+M.view[1]]),Z=U[0]+this.data.parentRect[2]-this.data.parentRect[0],se=U[1],{pageWidth:ne,pageHeight:re,pageX:ve,pageY:he}=this.viewport.rawDims;return this.container.style.left=`${100*(Z-ve)/ne}%`,this.container.style.top=`${100*(se-he)/re}%`,this.container.append(O.render()),this.container}};let N=we;Et(N,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));class Q{constructor(A){this.container=A.container,this.trigger=A.trigger,this.color=A.color,this.titleObj=A.titleObj,this.modificationDate=A.modificationDate,this.contentsObj=A.contentsObj,this.richText=A.richText,this.hideWrapper=A.hideWrapper||!1,this.pinned=!1}render(){var A,O;const U=document.createElement("div");U.className="popupWrapper",this.hideElement=this.hideWrapper?U:this.container,this.hideElement.hidden=!0;const Z=document.createElement("div");Z.className="popup";const se=this.color;if(se){const ve=.7*(255-se[0])+se[0],he=.7*(255-se[1])+se[1],be=.7*(255-se[2])+se[2];Z.style.backgroundColor=p.Util.makeHexColor(ve|0,he|0,be|0)}const ne=document.createElement("h1");ne.dir=this.titleObj.dir,ne.textContent=this.titleObj.str,Z.append(ne);const re=v.PDFDateString.toDateObject(this.modificationDate);if(re){const ve=document.createElement("span");ve.className="popupDate",ve.textContent="{{date}}, {{time}}",ve.dataset.l10nId="annotation_date_string",ve.dataset.l10nArgs=JSON.stringify({date:re.toLocaleDateString(),time:re.toLocaleTimeString()}),Z.append(ve)}if((A=this.richText)!==null&&A!==void 0&&A.str&&(!((O=this.contentsObj)!==null&&O!==void 0&&O.str)||this.contentsObj.str===this.richText.str))m.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:Z}),Z.lastChild.className="richText popupContent";else{const ve=this._formatContents(this.contentsObj);Z.append(ve)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const ve of this.trigger)ve.addEventListener("click",this._toggle.bind(this)),ve.addEventListener("mouseover",this._show.bind(this,!1)),ve.addEventListener("mouseout",this._hide.bind(this,!1));return Z.addEventListener("click",this._hide.bind(this,!0)),U.append(Z),U}_formatContents(A){let{str:O,dir:M}=A;const U=document.createElement("p");U.className="popupContent",U.dir=M;const Z=O.split(/(?:\r\n?|\n)/);for(let se=0,ne=Z.length;se<ne;++se){const re=Z[se];U.append(document.createTextNode(re)),se<ne-1&&U.append(document.createElement("br"))}return U}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class Y extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.textContent=A.data.textContent}render(){if(this.container.className="freeTextAnnotation",this.textContent){const A=document.createElement("div");A.className="annotationTextContent",A.setAttribute("role","comment");for(const O of this.textContent){const M=document.createElement("span");M.textContent=O,A.append(M)}this.container.append(A)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class B extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=this.svgFactory.createElement("svg:line");return Z.setAttribute("x1",A.rect[2]-A.lineCoordinates[0]),Z.setAttribute("y1",A.rect[3]-A.lineCoordinates[1]),Z.setAttribute("x2",A.rect[2]-A.lineCoordinates[2]),Z.setAttribute("y2",A.rect[3]-A.lineCoordinates[3]),Z.setAttribute("stroke-width",A.borderStyle.width||1),Z.setAttribute("stroke","transparent"),Z.setAttribute("fill","transparent"),U.append(Z),this.container.append(U),this._createPopup(Z,A),this.container}}class ie extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=A.borderStyle.width,se=this.svgFactory.createElement("svg:rect");return se.setAttribute("x",Z/2),se.setAttribute("y",Z/2),se.setAttribute("width",O-Z),se.setAttribute("height",M-Z),se.setAttribute("stroke-width",Z||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class q extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=A.borderStyle.width,se=this.svgFactory.createElement("svg:ellipse");return se.setAttribute("cx",O/2),se.setAttribute("cy",M/2),se.setAttribute("rx",O/2-Z/2),se.setAttribute("ry",M/2-Z/2),se.setAttribute("stroke-width",Z||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class _ extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0);let Z=[];for(const ne of A.vertices){const re=ne.x-A.rect[0],ve=A.rect[3]-ne.y;Z.push(re+","+ve)}Z=Z.join(" ");const se=this.svgFactory.createElement(this.svgElementName);return se.setAttribute("points",Z),se.setAttribute("stroke-width",A.borderStyle.width||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class H extends _{constructor(A){super(A),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class $ extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class C extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0);for(const Z of A.inkLists){let se=[];for(const re of Z){const ve=re.x-A.rect[0],he=A.rect[3]-re.y;se.push(`${ve},${he}`)}se=se.join(" ");const ne=this.svgFactory.createElement(this.svgElementName);ne.setAttribute("points",se),ne.setAttribute("stroke-width",A.borderStyle.width||1),ne.setAttribute("stroke","transparent"),ne.setAttribute("fill","transparent"),this._createPopup(ne,A),U.append(ne)}return this.container.append(U),this.container}}class P extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class z extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class ee extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class te extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class K extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class ue extends b{constructor(A){var O;super(A,{isRenderable:!0});const{filename:M,content:U}=this.data.file;this.filename=(0,v.getFilenameFromUrl)(M,!0),this.content=U,(O=this.linkService.eventBus)===null||O===void 0||O.dispatch("fileattachmentannotation",{source:this,filename:M,content:U})}render(){var A,O;this.container.className="fileAttachmentAnnotation";let M;return this.data.hasAppearance?M=document.createElement("div"):(M=document.createElement("img"),M.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),M.className="popupTriggerArea",M.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((A=this.data.titleObj)!==null&&A!==void 0&&A.str||(O=this.data.contentsObj)!==null&&O!==void 0&&O.str||this.data.richText)&&this._createPopup(M,this.data),this.container.append(M),this.container}_download(){var A;(A=this.downloadManager)===null||A===void 0||A.openOrDownloadData(this.container,this.content,this.filename)}}class fe{static render(A){const{annotations:O,div:M,viewport:U,accessibilityManager:Z}=A;(0,v.setLayerDimensions)(M,U);const se={data:null,layer:M,page:A.page,viewport:U,linkService:A.linkService,downloadManager:A.downloadManager,imageResourcesPath:A.imageResourcesPath||"",renderForms:A.renderForms!==!1,svgFactory:new v.DOMSVGFactory,annotationStorage:A.annotationStorage||new I.AnnotationStorage,enableScripting:A.enableScripting===!0,hasJSActions:A.hasJSActions,fieldObjects:A.fieldObjects};let ne=0;for(const re of O){if(re.annotationType!==p.AnnotationType.POPUP){const{width:be,height:Ce}=o(re.rect);if(be<=0||Ce<=0)continue}se.data=re;const ve=c.create(se);if(!ve.isRenderable)continue;const he=ve.render();if(re.hidden&&(he.style.visibility="hidden"),Array.isArray(he))for(const be of he)be.style.zIndex=ne++,R(fe,fe,ye).call(fe,be,re.id,M,Z);else he.style.zIndex=ne++,ve instanceof N?M.prepend(he):R(fe,fe,ye).call(fe,he,re.id,M,Z)}R(this,fe,me).call(this,M,A.annotationCanvasMap)}static update(A){const{annotationCanvasMap:O,div:M,viewport:U}=A;(0,v.setLayerDimensions)(M,{rotation:U.rotation}),R(this,fe,me).call(this,M,O),M.hidden=!1}}E.AnnotationLayer=fe;function ye(ge,A,O,M){const U=ge.firstChild||ge;U.id=`${v.AnnotationPrefix}${A}`,O.append(ge),M==null||M.moveElementInDOM(O,ge,U,!1)}function me(ge,A){if(A){for(const[O,M]of A){const U=ge.querySelector(`[data-annotation-id="${O}"]`);if(!U)continue;const{firstChild:Z}=U;Z?Z.nodeName==="CANVAS"?Z.replaceWith(M):Z.before(M):U.append(M)}A.clear()}}},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.ColorConverters=void 0;function l(v){return Math.floor(Math.max(0,Math.min(1,v))*255).toString(16).padStart(2,"0")}class p{static CMYK_G(I){let[k,m,R,t]=I;return["G",1-Math.min(1,.3*k+.59*R+.11*m+t)]}static G_CMYK(I){let[k]=I;return["CMYK",0,0,0,1-k]}static G_RGB(I){let[k]=I;return["RGB",k,k,k]}static G_HTML(I){let[k]=I;const m=l(k);return`#${m}${m}${m}`}static RGB_G(I){let[k,m,R]=I;return["G",.3*k+.59*m+.11*R]}static RGB_HTML(I){let[k,m,R]=I;const t=l(k),n=l(m),h=l(R);return`#${t}${n}${h}`}static T_HTML(){return"#00000000"}static CMYK_RGB(I){let[k,m,R,t]=I;return["RGB",1-Math.min(1,k+t),1-Math.min(1,R+t),1-Math.min(1,m+t)]}static CMYK_HTML(I){const k=this.CMYK_RGB(I).slice(1);return this.RGB_HTML(k)}static RGB_CMYK(I){let[k,m,R]=I;const t=1-k,n=1-m,h=1-R,a=Math.min(t,n,h);return["CMYK",t,n,h,a]}}E.ColorConverters=p},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.XfaLayer=void 0;var p=l(151);class v{static setupStorage(k,m,R,t,n){const h=t.getValue(m,{value:null});switch(R.name){case"textarea":if(h.value!==null&&(k.textContent=h.value),n==="print")break;k.addEventListener("input",a=>{t.setValue(m,{value:a.target.value})});break;case"input":if(R.attributes.type==="radio"||R.attributes.type==="checkbox"){if(h.value===R.attributes.xfaOn?k.setAttribute("checked",!0):h.value===R.attributes.xfaOff&&k.removeAttribute("checked"),n==="print")break;k.addEventListener("change",a=>{t.setValue(m,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(h.value!==null&&k.setAttribute("value",h.value),n==="print")break;k.addEventListener("input",a=>{t.setValue(m,{value:a.target.value})})}break;case"select":if(h.value!==null)for(const a of R.children)a.attributes.value===h.value&&(a.attributes.selected=!0);k.addEventListener("input",a=>{const d=a.target.options,r=d.selectedIndex===-1?"":d[d.selectedIndex].value;t.setValue(m,{value:r})});break}}static setAttributes(k){let{html:m,element:R,storage:t=null,intent:n,linkService:h}=k;const{attributes:a}=R,d=m instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${n}`);for(const[r,i]of Object.entries(a))if(i!=null)switch(r){case"class":i.length&&m.setAttribute(r,i.join(" "));break;case"dataId":break;case"id":m.setAttribute("data-element-id",i);break;case"style":Object.assign(m.style,i);break;case"textContent":m.textContent=i;break;default:(!d||r!=="href"&&r!=="newWindow")&&m.setAttribute(r,i)}d&&h.addLinkAttributes(m,a.href,a.newWindow),t&&a.dataId&&this.setupStorage(m,a.dataId,R,t)}static render(k){const m=k.annotationStorage,R=k.linkService,t=k.xfaHtml,n=k.intent||"display",h=document.createElement(t.name);t.attributes&&this.setAttributes({html:h,element:t,intent:n,linkService:R});const a=[[t,-1,h]],d=k.div;if(d.append(h),k.viewport){const o=`matrix(${k.viewport.transform.join(",")})`;d.style.transform=o}n!=="richText"&&d.setAttribute("class","xfaLayer xfaFont");const r=[];for(;a.length>0;){var i;const[o,c,b]=a.at(-1);if(c+1===o.children.length){a.pop();continue}const y=o.children[++a.at(-1)[1]];if(y===null)continue;const{name:f}=y;if(f==="#text"){const g=document.createTextNode(y.value);r.push(g),b.append(g);continue}let s;if(y!=null&&(i=y.attributes)!==null&&i!==void 0&&i.xmlns?s=document.createElementNS(y.attributes.xmlns,f):s=document.createElement(f),b.append(s),y.attributes&&this.setAttributes({html:s,element:y,storage:m,intent:n,linkService:R}),y.children&&y.children.length>0)a.push([y,-1,s]);else if(y.value){const g=document.createTextNode(y.value);p.XfaText.shouldBuildText(f)&&r.push(g),s.append(g)}}for(const o of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))o.setAttribute("readOnly",!0);return{textDivs:r}}static update(k){const m=`matrix(${k.viewport.transform.join(",")})`;k.div.style.transform=m,k.div.hidden=!1}}E.XfaLayer=v},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.SVGGraphics=void 0;var p=l(139),v=l(1),I=l(3);let k=class{constructor(){(0,v.unreachable)("Not implemented: SVGGraphics")}};E.SVGGraphics=k;{let i=function(s){let g=[];const S=[];for(const D of s){if(D.fn==="save"){g.push({fnId:92,fn:"group",items:[]}),S.push(g),g=g.at(-1).items;continue}D.fn==="restore"?g=S.pop():g.push(D)}return g},o=function(s){if(Number.isInteger(s))return s.toString();const g=s.toFixed(10);let S=g.length-1;if(g[S]!=="0")return g;do S--;while(g[S]==="0");return g.substring(0,g[S]==="."?S:S+1)},c=function(s){if(s[4]===0&&s[5]===0){if(s[1]===0&&s[2]===0)return s[0]===1&&s[3]===1?"":`scale(${o(s[0])} ${o(s[3])})`;if(s[0]===s[3]&&s[1]===-s[2]){const g=Math.acos(s[0])*180/Math.PI;return`rotate(${o(g)})`}}else if(s[0]===1&&s[1]===0&&s[2]===0&&s[3]===1)return`translate(${o(s[4])} ${o(s[5])})`;return`matrix(${o(s[0])} ${o(s[1])} ${o(s[2])} ${o(s[3])} ${o(s[4])} ${o(s[5])})`};const m={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},R="http://www.w3.org/XML/1998/namespace",t="http://www.w3.org/1999/xlink",n=["butt","round","square"],h=["miter","round","bevel"],a=function(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!S)return URL.createObjectURL(new Blob([s],{type:g}));const D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let w=`data:${g};base64,`;for(let x=0,F=s.length;x<F;x+=3){const X=s[x]&255,G=s[x+1]&255,j=s[x+2]&255,N=X>>2,Q=(X&3)<<4|G>>4,Y=x+1<F?(G&15)<<2|j>>6:64,B=x+2<F?j&63:64;w+=D[N]+D[Q]+D[Y]+D[B]}return w},d=function(){const s=new Uint8Array([137,80,78,71,13,10,26,10]),g=12,S=new Int32Array(256);for(let j=0;j<256;j++){let N=j;for(let Q=0;Q<8;Q++)N&1?N=3988292384^N>>1&2147483647:N=N>>1&2147483647;S[j]=N}function D(j,N,Q){let Y=-1;for(let B=N;B<Q;B++){const ie=(Y^j[B])&255,q=S[ie];Y=Y>>>8^q}return Y^-1}function w(j,N,Q,Y){let B=Y;const ie=N.length;Q[B]=ie>>24&255,Q[B+1]=ie>>16&255,Q[B+2]=ie>>8&255,Q[B+3]=ie&255,B+=4,Q[B]=j.charCodeAt(0)&255,Q[B+1]=j.charCodeAt(1)&255,Q[B+2]=j.charCodeAt(2)&255,Q[B+3]=j.charCodeAt(3)&255,B+=4,Q.set(N,B),B+=N.length;const q=D(Q,Y+4,B);Q[B]=q>>24&255,Q[B+1]=q>>16&255,Q[B+2]=q>>8&255,Q[B+3]=q&255}function x(j,N,Q){let Y=1,B=0;for(let ie=N;ie<Q;++ie)Y=(Y+(j[ie]&255))%65521,B=(B+Y)%65521;return B<<16|Y}function F(j){if(!I.isNodeJS)return X(j);try{let N;parseInt(process.versions.node)>=8?N=j:N=Buffer.from(j);const Q=require$$7.deflateSync(N,{level:9});return Q instanceof Uint8Array?Q:new Uint8Array(Q)}catch(N){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+N)}return X(j)}function X(j){let N=j.length;const Q=65535,Y=Math.ceil(N/Q),B=new Uint8Array(2+N+Y*5+4);let ie=0;B[ie++]=120,B[ie++]=156;let q=0;for(;N>Q;)B[ie++]=0,B[ie++]=255,B[ie++]=255,B[ie++]=0,B[ie++]=0,B.set(j.subarray(q,q+Q),ie),ie+=Q,q+=Q,N-=Q;B[ie++]=1,B[ie++]=N&255,B[ie++]=N>>8&255,B[ie++]=~N&65535&255,B[ie++]=(~N&65535)>>8&255,B.set(j.subarray(q),ie),ie+=j.length-q;const _=x(j,0,j.length);return B[ie++]=_>>24&255,B[ie++]=_>>16&255,B[ie++]=_>>8&255,B[ie++]=_&255,B}function G(j,N,Q,Y){const B=j.width,ie=j.height;let q,_,H;const $=j.data;switch(N){case v.ImageKind.GRAYSCALE_1BPP:_=0,q=1,H=B+7>>3;break;case v.ImageKind.RGB_24BPP:_=2,q=8,H=B*3;break;case v.ImageKind.RGBA_32BPP:_=6,q=8,H=B*4;break;default:throw new Error("invalid format")}const C=new Uint8Array((1+H)*ie);let P=0,z=0;for(let ye=0;ye<ie;++ye)C[P++]=0,C.set($.subarray(z,z+H),P),z+=H,P+=H;if(N===v.ImageKind.GRAYSCALE_1BPP&&Y){P=0;for(let ye=0;ye<ie;ye++){P++;for(let me=0;me<H;me++)C[P++]^=255}}const ee=new Uint8Array([B>>24&255,B>>16&255,B>>8&255,B&255,ie>>24&255,ie>>16&255,ie>>8&255,ie&255,q,_,0,0,0]),te=F(C),K=s.length+g*3+ee.length+te.length,ue=new Uint8Array(K);let fe=0;return ue.set(s,fe),fe+=s.length,w("IHDR",ee,ue,fe),fe+=g+ee.length,w("IDATA",te,ue,fe),fe+=g+te.length,w("IEND",new Uint8Array(0),ue,fe),a(ue,"image/png",Q)}return function(N,Q,Y){const B=N.kind===void 0?v.ImageKind.GRAYSCALE_1BPP:N.kind;return G(N,B,Q,Y)}}();class r{constructor(){this.fontSizeScale=1,this.fontWeight=m.fontWeight,this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=m.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(g,S){this.x=g,this.y=S}}let b=0,y=0,f=0;E.SVGGraphics=k=class{constructor(s,g){let S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,p.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new p.DOMSVGFactory,this.current=new r,this.transformMatrix=v.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=s,this.objs=g,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!S,this._operatorIdMapping=[];for(const D in v.OPS)this._operatorIdMapping[v.OPS[D]]=D}getObject(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof s=="string"?s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s):g}save(){this.transformStack.push(this.transformMatrix);const s=this.current;this.extraStack.push(s),this.current=s.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(s){this.save(),this.executeOpTree(s),this.restore()}loadDependencies(s){const g=s.fnArray,S=s.argsArray;for(let D=0,w=g.length;D<w;D++)if(g[D]===v.OPS.dependency)for(const x of S[D]){const F=x.startsWith("g_")?this.commonObjs:this.objs,X=new Promise(G=>{F.get(x,G)});this.current.dependencies.push(X)}return Promise.all(this.current.dependencies)}transform(s,g,S,D,w,x){const F=[s,g,S,D,w,x];this.transformMatrix=v.Util.transform(this.transformMatrix,F),this.tgrp=null}getSVG(s,g){this.viewport=g;const S=this._initialize(g);return this.loadDependencies(s).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(s)),S))}convertOpList(s){const g=this._operatorIdMapping,S=s.argsArray,D=s.fnArray,w=[];for(let x=0,F=D.length;x<F;x++){const X=D[x];w.push({fnId:X,fn:g[X],args:S[x]})}return i(w)}executeOpTree(s){for(const g of s){const S=g.fn,D=g.fnId,w=g.args;switch(D|0){case v.OPS.beginText:this.beginText();break;case v.OPS.dependency:break;case v.OPS.setLeading:this.setLeading(w);break;case v.OPS.setLeadingMoveText:this.setLeadingMoveText(w[0],w[1]);break;case v.OPS.setFont:this.setFont(w);break;case v.OPS.showText:this.showText(w[0]);break;case v.OPS.showSpacedText:this.showText(w[0]);break;case v.OPS.endText:this.endText();break;case v.OPS.moveText:this.moveText(w[0],w[1]);break;case v.OPS.setCharSpacing:this.setCharSpacing(w[0]);break;case v.OPS.setWordSpacing:this.setWordSpacing(w[0]);break;case v.OPS.setHScale:this.setHScale(w[0]);break;case v.OPS.setTextMatrix:this.setTextMatrix(w[0],w[1],w[2],w[3],w[4],w[5]);break;case v.OPS.setTextRise:this.setTextRise(w[0]);break;case v.OPS.setTextRenderingMode:this.setTextRenderingMode(w[0]);break;case v.OPS.setLineWidth:this.setLineWidth(w[0]);break;case v.OPS.setLineJoin:this.setLineJoin(w[0]);break;case v.OPS.setLineCap:this.setLineCap(w[0]);break;case v.OPS.setMiterLimit:this.setMiterLimit(w[0]);break;case v.OPS.setFillRGBColor:this.setFillRGBColor(w[0],w[1],w[2]);break;case v.OPS.setStrokeRGBColor:this.setStrokeRGBColor(w[0],w[1],w[2]);break;case v.OPS.setStrokeColorN:this.setStrokeColorN(w);break;case v.OPS.setFillColorN:this.setFillColorN(w);break;case v.OPS.shadingFill:this.shadingFill(w[0]);break;case v.OPS.setDash:this.setDash(w[0],w[1]);break;case v.OPS.setRenderingIntent:this.setRenderingIntent(w[0]);break;case v.OPS.setFlatness:this.setFlatness(w[0]);break;case v.OPS.setGState:this.setGState(w[0]);break;case v.OPS.fill:this.fill();break;case v.OPS.eoFill:this.eoFill();break;case v.OPS.stroke:this.stroke();break;case v.OPS.fillStroke:this.fillStroke();break;case v.OPS.eoFillStroke:this.eoFillStroke();break;case v.OPS.clip:this.clip("nonzero");break;case v.OPS.eoClip:this.clip("evenodd");break;case v.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case v.OPS.paintImageXObject:this.paintImageXObject(w[0]);break;case v.OPS.paintInlineImageXObject:this.paintInlineImageXObject(w[0]);break;case v.OPS.paintImageMaskXObject:this.paintImageMaskXObject(w[0]);break;case v.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(w[0],w[1]);break;case v.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case v.OPS.closePath:this.closePath();break;case v.OPS.closeStroke:this.closeStroke();break;case v.OPS.closeFillStroke:this.closeFillStroke();break;case v.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case v.OPS.nextLine:this.nextLine();break;case v.OPS.transform:this.transform(w[0],w[1],w[2],w[3],w[4],w[5]);break;case v.OPS.constructPath:this.constructPath(w[0],w[1]);break;case v.OPS.endPath:this.endPath();break;case 92:this.group(g.items);break;default:(0,v.warn)(`Unimplemented operator ${S}`);break}}}setWordSpacing(s){this.current.wordSpacing=s}setCharSpacing(s){this.current.charSpacing=s}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(s,g,S,D,w,x){const F=this.current;F.textMatrix=F.lineMatrix=[s,g,S,D,w,x],F.textMatrixScale=Math.hypot(s,g),F.x=F.lineX=0,F.y=F.lineY=0,F.xcoords=[],F.ycoords=[],F.tspan=this.svgFactory.createElement("svg:tspan"),F.tspan.setAttributeNS(null,"font-family",F.fontFamily),F.tspan.setAttributeNS(null,"font-size",`${o(F.fontSize)}px`),F.tspan.setAttributeNS(null,"y",o(-F.y)),F.txtElement=this.svgFactory.createElement("svg:text"),F.txtElement.append(F.tspan)}beginText(){const s=this.current;s.x=s.lineX=0,s.y=s.lineY=0,s.textMatrix=v.IDENTITY_MATRIX,s.lineMatrix=v.IDENTITY_MATRIX,s.textMatrixScale=1,s.tspan=this.svgFactory.createElement("svg:tspan"),s.txtElement=this.svgFactory.createElement("svg:text"),s.txtgrp=this.svgFactory.createElement("svg:g"),s.xcoords=[],s.ycoords=[]}moveText(s,g){const S=this.current;S.x=S.lineX+=s,S.y=S.lineY+=g,S.xcoords=[],S.ycoords=[],S.tspan=this.svgFactory.createElement("svg:tspan"),S.tspan.setAttributeNS(null,"font-family",S.fontFamily),S.tspan.setAttributeNS(null,"font-size",`${o(S.fontSize)}px`),S.tspan.setAttributeNS(null,"y",o(-S.y))}showText(s){const g=this.current,S=g.font,D=g.fontSize;if(D===0)return;const w=g.fontSizeScale,x=g.charSpacing,F=g.wordSpacing,X=g.fontDirection,G=g.textHScale*X,j=S.vertical,N=j?1:-1,Q=S.defaultVMetrics,Y=D*g.fontMatrix[0];let B=0;for(const _ of s){if(_===null){B+=X*F;continue}else if(typeof _=="number"){B+=N*_*D/1e3;continue}const H=(_.isSpace?F:0)+x,$=_.fontChar;let C,P,z=_.width;if(j){let te;const K=_.vmetric||Q;te=_.vmetric?K[1]:z*.5,te=-te*Y;const ue=K[2]*Y;z=K?-K[0]:z,C=te/w,P=(B+ue)/w}else C=B/w,P=0;(_.isInFont||S.missingFile)&&(g.xcoords.push(g.x+C),j&&g.ycoords.push(-g.y+P),g.tspan.textContent+=$);let ee;j?ee=z*Y-H*X:ee=z*Y+H*X,B+=ee}g.tspan.setAttributeNS(null,"x",g.xcoords.map(o).join(" ")),j?g.tspan.setAttributeNS(null,"y",g.ycoords.map(o).join(" ")):g.tspan.setAttributeNS(null,"y",o(-g.y)),j?g.y-=B:g.x+=B*G,g.tspan.setAttributeNS(null,"font-family",g.fontFamily),g.tspan.setAttributeNS(null,"font-size",`${o(g.fontSize)}px`),g.fontStyle!==m.fontStyle&&g.tspan.setAttributeNS(null,"font-style",g.fontStyle),g.fontWeight!==m.fontWeight&&g.tspan.setAttributeNS(null,"font-weight",g.fontWeight);const ie=g.textRenderingMode&v.TextRenderingMode.FILL_STROKE_MASK;if(ie===v.TextRenderingMode.FILL||ie===v.TextRenderingMode.FILL_STROKE?(g.fillColor!==m.fillColor&&g.tspan.setAttributeNS(null,"fill",g.fillColor),g.fillAlpha<1&&g.tspan.setAttributeNS(null,"fill-opacity",g.fillAlpha)):g.textRenderingMode===v.TextRenderingMode.ADD_TO_PATH?g.tspan.setAttributeNS(null,"fill","transparent"):g.tspan.setAttributeNS(null,"fill","none"),ie===v.TextRenderingMode.STROKE||ie===v.TextRenderingMode.FILL_STROKE){const _=1/(g.textMatrixScale||1);this._setStrokeAttributes(g.tspan,_)}let q=g.textMatrix;g.textRise!==0&&(q=q.slice(),q[5]+=g.textRise),g.txtElement.setAttributeNS(null,"transform",`${c(q)} scale(${o(G)}, -1)`),g.txtElement.setAttributeNS(R,"xml:space","preserve"),g.txtElement.append(g.tspan),g.txtgrp.append(g.txtElement),this._ensureTransformGroup().append(g.txtElement)}setLeadingMoveText(s,g){this.setLeading(-g),this.moveText(s,g)}addFontStyle(s){if(!s.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const g=a(s.data,s.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${s.loadedName}"; src: url(${g}); }
`}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",F[1]),D.setAttributeNS(null,"fr",G);break;default:throw new Error(`Unknown RadialAxial type: ${s[1]}`)}for(const w of S){const x=this.svgFactory.createElement("svg:stop");x.setAttributeNS(null,"offset",w[0]),x.setAttributeNS(null,"stop-color",w[1]),D.append(x)}return this.defs.append(D),`url(#${g})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${s[0]}`)}}setDash(s,g){this.current.dashArray=s,this.current.dashPhase=g}constructPath(s,g){const S=this.current;let D=S.x,w=S.y,x=[],F=0;for(const X of s)switch(X|0){case v.OPS.rectangle:D=g[F++],w=g[F++];const G=g[F++],j=g[F++],N=D+G,Q=w+j;x.push("M",o(D),o(w),"L",o(N),o(w),"L",o(N),o(Q),"L",o(D),o(Q),"Z");break;case v.OPS.moveTo:D=g[F++],w=g[F++],x.push("M",o(D),o(w));break;case v.OPS.lineTo:D=g[F++],w=g[F++],x.push("L",o(D),o(w));break;case v.OPS.curveTo:D=g[F+4],w=g[F+5],x.push("C",o(g[F]),o(g[F+1]),o(g[F+2]),o(g[F+3]),o(D),o(w)),F+=6;break;case v.OPS.curveTo2:x.push("C",o(D),o(w),o(g[F]),o(g[F+1]),o(g[F+2]),o(g[F+3])),D=g[F+2],w=g[F+3],F+=4;break;case v.OPS.curveTo3:D=g[F+2],w=g[F+3],x.push("C",o(g[F]),o(g[F+1]),o(D),o(w),o(D),o(w)),F+=4;break;case v.OPS.closePath:x.push("Z");break}x=x.join(" "),S.path&&s.length>0&&s[0]!==v.OPS.rectangle&&s[0]!==v.OPS.moveTo?x=S.path.getAttributeNS(null,"d")+x:(S.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(S.path)),S.path.setAttributeNS(null,"d",x),S.path.setAttributeNS(null,"fill","none"),S.element=S.path,S.setCurrentPoint(D,w)}endPath(){const s=this.current;if(s.path=null,!this.pendingClip)return;if(!s.element){this.pendingClip=null;return}const g=`clippath${b++}`,S=this.svgFactory.createElement("svg:clipPath");S.setAttributeNS(null,"id",g),S.setAttributeNS(null,"transform",c(this.transformMatrix));const D=s.element.cloneNode(!0);if(this.pendingClip==="evenodd"?D.setAttributeNS(null,"clip-rule","evenodd"):D.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,S.append(D),this.defs.append(S),s.activeClipUrl){s.clipGroup=null;for(const w of this.extraStack)w.clipGroup=null;S.setAttributeNS(null,"clip-path",s.activeClipUrl)}s.activeClipUrl=`url(#${g})`,this.tgrp=null}clip(s){this.pendingClip=s}closePath(){const s=this.current;if(s.path){const g=`${s.path.getAttributeNS(null,"d")}Z`;s.path.setAttributeNS(null,"d",g)}}setLeading(s){this.current.leading=-s}setTextRise(s){this.current.textRise=s}setTextRenderingMode(s){this.current.textRenderingMode=s}setHScale(s){this.current.textHScale=s/100}setRenderingIntent(s){}setFlatness(s){}setGState(s){for(const[g,S]of s)switch(g){case"LW":this.setLineWidth(S);break;case"LC":this.setLineCap(S);break;case"LJ":this.setLineJoin(S);break;case"ML":this.setMiterLimit(S);break;case"D":this.setDash(S[0],S[1]);break;case"RI":this.setRenderingIntent(S);break;case"FL":this.setFlatness(S);break;case"Font":this.setFont(S);break;case"CA":this.setStrokeAlpha(S);break;case"ca":this.setFillAlpha(S);break;default:(0,v.warn)(`Unimplemented graphic state operator ${g}`);break}}fill(){const s=this.current;s.element&&(s.element.setAttributeNS(null,"fill",s.fillColor),s.element.setAttributeNS(null,"fill-opacity",s.fillAlpha),this.endPath())}stroke(){const s=this.current;s.element&&(this._setStrokeAttributes(s.element),s.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const S=this.current;let D=S.dashArray;g!==1&&D.length>0&&(D=D.map(function(w){return g*w})),s.setAttributeNS(null,"stroke",S.strokeColor),s.setAttributeNS(null,"stroke-opacity",S.strokeAlpha),s.setAttributeNS(null,"stroke-miterlimit",o(S.miterLimit)),s.setAttributeNS(null,"stroke-linecap",S.lineCap),s.setAttributeNS(null,"stroke-linejoin",S.lineJoin),s.setAttributeNS(null,"stroke-width",o(g*S.lineWidth)+"px"),s.setAttributeNS(null,"stroke-dasharray",D.map(o).join(" ")),s.setAttributeNS(null,"stroke-dashoffset",o(g*S.dashPhase)+"px")}eoFill(){var s;(s=this.current.element)===null||s===void 0||s.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var s;(s=this.current.element)===null||s===void 0||s.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width","1px"),s.setAttributeNS(null,"height","1px"),s.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(s)}paintImageXObject(s){const g=this.getObject(s);if(!g){(0,v.warn)(`Dependent image with object ID ${s} is not ready yet`);return}this.paintInlineImageXObject(g)}paintInlineImageXObject(s,g){const S=s.width,D=s.height,w=d(s,this.forceDataSchema,!!g),x=this.svgFactory.createElement("svg:rect");x.setAttributeNS(null,"x","0"),x.setAttributeNS(null,"y","0"),x.setAttributeNS(null,"width",o(S)),x.setAttributeNS(null,"height",o(D)),this.current.element=x,this.clip("nonzero");const F=this.svgFactory.createElement("svg:image");F.setAttributeNS(t,"xlink:href",w),F.setAttributeNS(null,"x","0"),F.setAttributeNS(null,"y",o(-D)),F.setAttributeNS(null,"width",o(S)+"px"),F.setAttributeNS(null,"height",o(D)+"px"),F.setAttributeNS(null,"transform",`scale(${o(1/S)} ${o(-1/D)})`),g?g.append(F):this._ensureTransformGroup().append(F)}paintImageMaskXObject(s){const g=this.getObject(s.data,s);if(g.bitmap){(0,v.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const S=this.current,D=g.width,w=g.height,x=S.fillColor;S.maskId=`mask${y++}`;const F=this.svgFactory.createElement("svg:mask");F.setAttributeNS(null,"id",S.maskId);const X=this.svgFactory.createElement("svg:rect");X.setAttributeNS(null,"x","0"),X.setAttributeNS(null,"y","0"),X.setAttributeNS(null,"width",o(D)),X.setAttributeNS(null,"height",o(w)),X.setAttributeNS(null,"fill",x),X.setAttributeNS(null,"mask",`url(#${S.maskId})`),this.defs.append(F),this._ensureTransformGroup().append(X),this.paintInlineImageXObject(g,F)}paintFormXObjectBegin(s,g){if(Array.isArray(s)&&s.length===6&&this.transform(s[0],s[1],s[2],s[3],s[4],s[5]),g){const S=g[2]-g[0],D=g[3]-g[1],w=this.svgFactory.createElement("svg:rect");w.setAttributeNS(null,"x",g[0]),w.setAttributeNS(null,"y",g[1]),w.setAttributeNS(null,"width",o(S)),w.setAttributeNS(null,"height",o(D)),this.current.element=w,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(s){const g=this.svgFactory.create(s.width,s.height),S=this.svgFactory.createElement("svg:defs");g.append(S),this.defs=S;const D=this.svgFactory.createElement("svg:g");return D.setAttributeNS(null,"transform",c(s.transform)),g.append(D),this.svg=D,g}_ensureClipGroup(){if(!this.current.clipGroup){const s=this.svgFactory.createElement("svg:g");s.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(s),this.current.clipGroup=s}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",c(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(W){var E=__webpack_module_cache__[W];if(E!==void 0)return E.exports;var l=__webpack_module_cache__[W]={exports:{}};return __webpack_modules__[W](l,l.exports,__w_pdfjs_require__),l.exports}var __webpack_exports__={};return(()=>{var W=__webpack_exports__;Object.defineProperty(W,"__esModule",{value:!0}),Object.defineProperty(W,"AbortException",{enumerable:!0,get:function(){return E.AbortException}}),Object.defineProperty(W,"AnnotationEditorLayer",{enumerable:!0,get:function(){return I.AnnotationEditorLayer}}),Object.defineProperty(W,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return E.AnnotationEditorParamsType}}),Object.defineProperty(W,"AnnotationEditorType",{enumerable:!0,get:function(){return E.AnnotationEditorType}}),Object.defineProperty(W,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return k.AnnotationEditorUIManager}}),Object.defineProperty(W,"AnnotationLayer",{enumerable:!0,get:function(){return m.AnnotationLayer}}),Object.defineProperty(W,"AnnotationMode",{enumerable:!0,get:function(){return E.AnnotationMode}}),Object.defineProperty(W,"CMapCompressionType",{enumerable:!0,get:function(){return E.CMapCompressionType}}),Object.defineProperty(W,"FeatureTest",{enumerable:!0,get:function(){return E.FeatureTest}}),Object.defineProperty(W,"GlobalWorkerOptions",{enumerable:!0,get:function(){return R.GlobalWorkerOptions}}),Object.defineProperty(W,"InvalidPDFException",{enumerable:!0,get:function(){return E.InvalidPDFException}}),Object.defineProperty(W,"MissingPDFException",{enumerable:!0,get:function(){return E.MissingPDFException}}),Object.defineProperty(W,"OPS",{enumerable:!0,get:function(){return E.OPS}}),Object.defineProperty(W,"PDFDataRangeTransport",{enumerable:!0,get:function(){return l.PDFDataRangeTransport}}),Object.defineProperty(W,"PDFDateString",{enumerable:!0,get:function(){return p.PDFDateString}}),Object.defineProperty(W,"PDFWorker",{enumerable:!0,get:function(){return l.PDFWorker}}),Object.defineProperty(W,"PasswordResponses",{enumerable:!0,get:function(){return E.PasswordResponses}}),Object.defineProperty(W,"PermissionFlag",{enumerable:!0,get:function(){return E.PermissionFlag}}),Object.defineProperty(W,"PixelsPerInch",{enumerable:!0,get:function(){return p.PixelsPerInch}}),Object.defineProperty(W,"RenderingCancelledException",{enumerable:!0,get:function(){return p.RenderingCancelledException}}),Object.defineProperty(W,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(W,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return E.UNSUPPORTED_FEATURES}}),Object.defineProperty(W,"UnexpectedResponseException",{enumerable:!0,get:function(){return E.UnexpectedResponseException}}),Object.defineProperty(W,"Util",{enumerable:!0,get:function(){return E.Util}}),Object.defineProperty(W,"VerbosityLevel",{enumerable:!0,get:function(){return E.VerbosityLevel}}),Object.defineProperty(W,"XfaLayer",{enumerable:!0,get:function(){return n.XfaLayer}}),Object.defineProperty(W,"build",{enumerable:!0,get:function(){return l.build}}),Object.defineProperty(W,"createPromiseCapability",{enumerable:!0,get:function(){return E.createPromiseCapability}}),Object.defineProperty(W,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return E.createValidAbsoluteUrl}}),Object.defineProperty(W,"getDocument",{enumerable:!0,get:function(){return l.getDocument}}),Object.defineProperty(W,"getFilenameFromUrl",{enumerable:!0,get:function(){return p.getFilenameFromUrl}}),Object.defineProperty(W,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return p.getPdfFilenameFromUrl}}),Object.defineProperty(W,"getXfaPageViewport",{enumerable:!0,get:function(){return p.getXfaPageViewport}}),Object.defineProperty(W,"isDataScheme",{enumerable:!0,get:function(){return p.isDataScheme}}),Object.defineProperty(W,"isPdfFile",{enumerable:!0,get:function(){return p.isPdfFile}}),Object.defineProperty(W,"loadScript",{enumerable:!0,get:function(){return p.loadScript}}),Object.defineProperty(W,"renderTextLayer",{enumerable:!0,get:function(){return v.renderTextLayer}}),Object.defineProperty(W,"setLayerDimensions",{enumerable:!0,get:function(){return p.setLayerDimensions}}),Object.defineProperty(W,"shadow",{enumerable:!0,get:function(){return E.shadow}}),Object.defineProperty(W,"updateTextLayer",{enumerable:!0,get:function(){return v.updateTextLayer}}),Object.defineProperty(W,"version",{enumerable:!0,get:function(){return l.version}});var E=__w_pdfjs_require__(1),l=__w_pdfjs_require__(135),p=__w_pdfjs_require__(139),v=__w_pdfjs_require__(158),I=__w_pdfjs_require__(159),k=__w_pdfjs_require__(138),m=__w_pdfjs_require__(164),R=__w_pdfjs_require__(146),t=__w_pdfjs_require__(167),n=__w_pdfjs_require__(166)})(),__webpack_exports__})())}(pdf$1)),pdfExports$1}var pdfExports=requirePdf(),pdf_viewerExports={},pdf_viewer={get exports(){return pdf_viewerExports},set exports(W){pdf_viewerExports=W}};(function(W,E){(function(p,v){W.exports=v()})(globalThis,()=>(()=>{var l=[,(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.SimpleLinkService=m.PDFLinkService=m.LinkTarget=void 0;var t=R(2);function n(X,G){a(X,G),G.add(X)}function h(X,G,j){a(X,G),G.set(X,j)}function a(X,G){if(G.has(X))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(X,G,j){return r(X,G),j}function r(X,G){if(X!==G)throw new TypeError("Private static access of wrong provenance")}function i(X,G,j){if(!G.has(X))throw new TypeError("attempted to get private field on non-instance");return j}function o(X,G){var j=c(X,G,"get");return b(X,j)}function c(X,G,j){if(!G.has(X))throw new TypeError("attempted to "+j+" private field on non-instance");return G.get(X)}function b(X,G){return G.get?G.get.call(X):G.value}const y="noopener noreferrer nofollow",f={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};m.LinkTarget=f;function s(X){let{url:G,target:j,rel:N,enabled:Q=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!G||typeof G!="string")throw new Error('A valid "url" parameter must provided.');const Y=(0,t.removeNullCharacters)(G);Q?X.href=X.title=Y:(X.href="",X.title=`Disabled: ${Y}`,X.onclick=()=>!1);let B="";switch(j){case f.NONE:break;case f.SELF:B="_self";break;case f.BLANK:B="_blank";break;case f.PARENT:B="_parent";break;case f.TOP:B="_top";break}X.target=B,X.rel=typeof N=="string"?N:y}var g=new WeakMap,S=new WeakSet;class D{constructor(){let{eventBus:G,externalLinkTarget:j=null,externalLinkRel:N=null,ignoreDestinationZoom:Q=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(this,S),h(this,g,{writable:!0,value:new Map}),this.eventBus=G,this.externalLinkTarget=j,this.externalLinkRel=N,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=Q,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(G){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.baseUrl=j,this.pdfDocument=G,o(this,g).clear()}setViewer(G){this.pdfViewer=G}setHistory(G){this.pdfHistory=G}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(G){this.pdfViewer.currentPageNumber=G}get rotation(){return this.pdfViewer.pagesRotation}set rotation(G){this.pdfViewer.pagesRotation=G}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}async goToDestination(G){if(!this.pdfDocument)return;let j,N;if(typeof G=="string"?(j=G,N=await this.pdfDocument.getDestination(G)):(j=null,N=await G),!Array.isArray(N)){console.error(`PDFLinkService.goToDestination: "${N}" is not a valid destination array, for dest="${G}".`);return}i(this,S,w).call(this,G,j,N)}goToPage(G){if(!this.pdfDocument)return;const j=typeof G=="string"&&this.pdfViewer.pageLabelToPageNumber(G)||G|0;if(!(Number.isInteger(j)&&j>0&&j<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${G}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(j)),this.pdfViewer.scrollPageIntoView({pageNumber:j})}addLinkAttributes(G,j){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(G,{url:j,target:N?f.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(G){if(typeof G=="string"){if(G.length>0)return this.getAnchorUrl("#"+escape(G))}else if(Array.isArray(G)){const j=JSON.stringify(G);if(j.length>0)return this.getAnchorUrl("#"+escape(j))}return this.getAnchorUrl("")}getAnchorUrl(G){return(this.baseUrl||"")+G}setHash(G){if(!this.pdfDocument)return;let j,N;if(G.includes("=")){const Q=(0,t.parseQueryString)(G);if(Q.has("search")&&this.eventBus.dispatch("findfromurlhash",{source:this,query:Q.get("search").replace(/"/g,""),phraseSearch:Q.get("phrase")==="true"}),Q.has("page")&&(j=Q.get("page")|0||1),Q.has("zoom")){const Y=Q.get("zoom").split(","),B=Y[0],ie=parseFloat(B);B.includes("Fit")?B==="Fit"||B==="FitB"?N=[null,{name:B}]:B==="FitH"||B==="FitBH"||B==="FitV"||B==="FitBV"?N=[null,{name:B},Y.length>1?Y[1]|0:null]:B==="FitR"?Y.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):N=[null,{name:B},Y[1]|0,Y[2]|0,Y[3]|0,Y[4]|0]:console.error(`PDFLinkService.setHash: "${B}" is not a valid zoom value.`):N=[null,{name:"XYZ"},Y.length>1?Y[1]|0:null,Y.length>2?Y[2]|0:null,ie?ie/100:B]}N?this.pdfViewer.scrollPageIntoView({pageNumber:j||this.page,destArray:N,allowNegativeOffset:!0}):j&&(this.page=j),Q.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:Q.get("pagemode")}),Q.has("nameddest")&&this.goToDestination(Q.get("nameddest"))}else{N=unescape(G);try{N=JSON.parse(N),Array.isArray(N)||(N=N.toString())}catch{}if(typeof N=="string"||d(D,D,x).call(D,N)){this.goToDestination(N);return}console.error(`PDFLinkService.setHash: "${unescape(G)}" is not a valid destination.`)}}executeNamedAction(G){var j,N;switch(G){case"GoBack":(j=this.pdfHistory)===null||j===void 0||j.back();break;case"GoForward":(N=this.pdfHistory)===null||N===void 0||N.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:G})}async executeSetOCGState(G){const j=this.pdfDocument,N=await this.pdfViewer.optionalContentConfigPromise;if(j!==this.pdfDocument)return;let Q;for(const Y of G.state){switch(Y){case"ON":case"OFF":case"Toggle":Q=Y;continue}switch(Q){case"ON":N.setVisibility(Y,!0);break;case"OFF":N.setVisibility(Y,!1);break;case"Toggle":const B=N.getGroup(Y);B&&N.setVisibility(Y,!B.visible);break}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(N)}cachePageRef(G,j){if(!j)return;const N=j.gen===0?`${j.num}R`:`${j.num}R${j.gen}`;o(this,g).set(N,G)}_cachedPageNumber(G){if(!G)return null;const j=G.gen===0?`${G.num}R`:`${G.num}R${G.gen}`;return o(this,g).get(j)||null}isPageVisible(G){return this.pdfViewer.isPageVisible(G)}isPageCached(G){return this.pdfViewer.isPageCached(G)}}m.PDFLinkService=D;function w(X){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,j=arguments.length>2?arguments[2]:void 0;const N=j[0];let Q;if(typeof N=="object"&&N!==null){if(Q=this._cachedPageNumber(N),!Q){this.pdfDocument.getPageIndex(N).then(Y=>{this.cachePageRef(Y+1,N),i(this,S,w).call(this,X,G,j)}).catch(()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${N}" is not a valid page reference, for dest="${X}".`)});return}}else if(Number.isInteger(N))Q=N+1;else{console.error(`PDFLinkService.#goToDestinationHelper: "${N}" is not a valid destination reference, for dest="${X}".`);return}if(!Q||Q<1||Q>this.pagesCount){console.error(`PDFLinkService.#goToDestinationHelper: "${Q}" is not a valid page number, for dest="${X}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:G,explicitDest:j,pageNumber:Q})),this.pdfViewer.scrollPageIntoView({pageNumber:Q,destArray:j,ignoreDestinationZoom:this._ignoreDestinationZoom})}function x(X){if(!Array.isArray(X))return!1;const G=X.length;if(G<2)return!1;const j=X[0];if(!(typeof j=="object"&&Number.isInteger(j.num)&&Number.isInteger(j.gen))&&!(Number.isInteger(j)&&j>=0))return!1;const N=X[1];if(!(typeof N=="object"&&typeof N.name=="string"))return!1;let Q=!0;switch(N.name){case"XYZ":if(G!==5)return!1;break;case"Fit":case"FitB":return G===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(G!==3)return!1;break;case"FitR":if(G!==6)return!1;Q=!1;break;default:return!1}for(let Y=2;Y<G;Y++){const B=X[Y];if(!(typeof B=="number"||Q&&B===null))return!1}return!0}class F{constructor(){this.externalLinkEnabled=!0}get pagesCount(){return 0}get page(){return 0}set page(G){}get rotation(){return 0}set rotation(G){}get isInPresentationMode(){return!1}async goToDestination(G){}goToPage(G){}addLinkAttributes(G,j){s(G,{url:j,enabled:this.externalLinkEnabled})}getDestinationHash(G){return"#"}getAnchorUrl(G){return"#"}setHash(G){}executeNamedAction(G){}executeSetOCGState(G){}cachePageRef(G,j){}isPageVisible(G){return!0}isPageCached(G){return!0}}m.SimpleLinkService=F},(k,m)=>{var O,M,U,Z,se;Object.defineProperty(m,"__esModule",{value:!0}),m.animationStarted=m.VERTICAL_PADDING=m.UNKNOWN_SCALE=m.TextLayerMode=m.SpreadMode=m.SidebarView=m.ScrollMode=m.SCROLLBAR_PADDING=m.RenderingStates=m.RendererType=m.ProgressBar=m.PresentationModeState=m.OutputScale=m.MIN_SCALE=m.MAX_SCALE=m.MAX_AUTO_SCALE=m.DEFAULT_SCALE_VALUE=m.DEFAULT_SCALE_DELTA=m.DEFAULT_SCALE=m.CursorTool=m.AutoPrintRegExp=void 0,m.apiPageLayoutToViewerModes=ge,m.apiPageModeToSidebarView=A,m.approximateFraction=B,m.backtrackBeforeAllVisibleElements=_,m.binarySearchFirstItem=Y,m.docStyle=void 0,m.getActiveOrFocusedElement=we,m.getPageSizeInches=q,m.getVisibleElements=H,m.isPortraitOrientation=K,m.isValidRotation=z,m.isValidScrollMode=ee,m.isValidSpreadMode=te,m.noContextMenuHandler=$,m.normalizeWheelEventDelta=P,m.normalizeWheelEventDirection=C,m.parseQueryString=G,m.removeNullCharacters=Q,m.roundToDivide=ie,m.scrollIntoView=F,m.watchScroll=X;const R="auto";m.DEFAULT_SCALE_VALUE=R;const t=1;m.DEFAULT_SCALE=t;const n=1.1;m.DEFAULT_SCALE_DELTA=n;const h=.1;m.MIN_SCALE=h;const a=10;m.MAX_SCALE=a;const d=0;m.UNKNOWN_SCALE=d;const r=1.25;m.MAX_AUTO_SCALE=r;const i=40;m.SCROLLBAR_PADDING=i;const o=5;m.VERTICAL_PADDING=o;const c={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};m.RenderingStates=c;const b={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};m.PresentationModeState=b;const y={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};m.SidebarView=y;const f={CANVAS:"canvas",SVG:"svg"};m.RendererType=f;const s={DISABLE:0,ENABLE:1};m.TextLayerMode=s;const g={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};m.ScrollMode=g;const S={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};m.SpreadMode=S;const D={SELECT:0,HAND:1,ZOOM:2};m.CursorTool=D;const w=/\bprint\s*\(/;m.AutoPrintRegExp=w;class x{constructor(){const re=window.devicePixelRatio||1;this.sx=re,this.sy=re}get scaled(){return this.sx!==1||this.sy!==1}}m.OutputScale=x;function F(ne,re){let ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,he=ne.offsetParent;if(!he){console.error("offsetParent is not set -- cannot scroll");return}let be=ne.offsetTop+ne.clientTop,Ce=ne.offsetLeft+ne.clientLeft;for(;he.clientHeight===he.scrollHeight&&he.clientWidth===he.scrollWidth||ve&&(he.classList.contains("markedContent")||getComputedStyle(he).overflow==="hidden");)if(be+=he.offsetTop,Ce+=he.offsetLeft,he=he.offsetParent,!he)return;re&&(re.top!==void 0&&(be+=re.top),re.left!==void 0&&(Ce+=re.left,he.scrollLeft=Ce)),he.scrollTop=be}function X(ne,re){const ve=function(Ce){be||(be=window.requestAnimationFrame(function(){be=null;const Ie=ne.scrollLeft,He=he.lastX;Ie!==He&&(he.right=Ie>He),he.lastX=Ie;const Ve=ne.scrollTop,ae=he.lastY;Ve!==ae&&(he.down=Ve>ae),he.lastY=Ve,re(he)}))},he={right:!0,down:!0,lastX:ne.scrollLeft,lastY:ne.scrollTop,_eventHandler:ve};let be=null;return ne.addEventListener("scroll",ve,!0),he}function G(ne){const re=new Map;for(const[ve,he]of new URLSearchParams(ne))re.set(ve.toLowerCase(),he);return re}const j=/\x00/g,N=/[\x01-\x1F]/g;function Q(ne){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return typeof ne!="string"?(console.error("The argument must be a string."),ne):(re&&(ne=ne.replace(N," ")),ne.replace(j,""))}function Y(ne,re){let he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,be=ne.length-1;if(be<0||!re(ne[be]))return ne.length;if(re(ne[he]))return he;for(;he<be;){const Ce=he+be>>1,Te=ne[Ce];re(Te)?be=Ce:he=Ce+1}return he}function B(ne){if(Math.floor(ne)===ne)return[ne,1];const re=1/ne,ve=8;if(re>ve)return[1,ve];if(Math.floor(re)===re)return[1,re];const he=ne>1?re:ne;let be=0,Ce=1,Te=1,Ie=1;for(;;){const Ve=be+Te,ae=Ce+Ie;if(ae>ve)break;he<=Ve/ae?(Te=Ve,Ie=ae):(be=Ve,Ce=ae)}let He;return he-be/Ce<Te/Ie-he?He=he===ne?[be,Ce]:[Ce,be]:He=he===ne?[Te,Ie]:[Ie,Te],He}function ie(ne,re){const ve=ne%re;return ve===0?ne:Math.round(ne-ve+re)}function q(ne){let{view:re,userUnit:ve,rotate:he}=ne;const[be,Ce,Te,Ie]=re,He=he%180!==0,Ve=(Te-be)/72*ve,ae=(Ie-Ce)/72*ve;return{width:He?ae:Ve,height:He?Ve:ae}}function _(ne,re,ve){if(ne<2)return ne;let he=re[ne].div,be=he.offsetTop+he.clientTop;be>=ve&&(he=re[ne-1].div,be=he.offsetTop+he.clientTop);for(let Ce=ne-2;Ce>=0&&(he=re[Ce].div,!(he.offsetTop+he.clientTop+he.clientHeight<=be));--Ce)ne=Ce;return ne}function H(ne){let{scrollEl:re,views:ve,sortByVisibility:he=!1,horizontal:be=!1,rtl:Ce=!1}=ne;const Te=re.scrollTop,Ie=Te+re.clientHeight,He=re.scrollLeft,Ve=He+re.clientWidth;function ae(Ae){const ce=Ae.div;return ce.offsetTop+ce.clientTop+ce.clientHeight>Te}function T(Ae){const ce=Ae.div,Ee=ce.offsetLeft+ce.clientLeft,We=Ee+ce.clientWidth;return Ce?Ee<Ve:We>He}const V=[],de=new Set,Pe=ve.length;let De=Y(ve,be?T:ae);De>0&&De<Pe&&!be&&(De=_(De,ve,Te));let Fe=be?Ve:-1;for(let Ae=De;Ae<Pe;Ae++){const ce=ve[Ae],Ee=ce.div,We=Ee.offsetLeft+Ee.clientLeft,Oe=Ee.offsetTop+Ee.clientTop,$e=Ee.clientWidth,oe=Ee.clientHeight,J=We+$e,pe=Oe+oe;if(Fe===-1)pe>=Ie&&(Fe=pe);else if((be?We:Oe)>Fe)break;if(pe<=Te||Oe>=Ie||J<=He||We>=Ve)continue;const ke=Math.max(0,Te-Oe)+Math.max(0,pe-Ie),Re=Math.max(0,He-We)+Math.max(0,J-Ve),Be=(oe-ke)/oe,Ne=($e-Re)/$e,Ge=Be*Ne*100|0;V.push({id:ce.id,x:We,y:Oe,view:ce,percent:Ge,widthPercent:Ne*100|0}),de.add(ce.id)}const _e=V[0],Me=V.at(-1);return he&&V.sort(function(Ae,ce){const Ee=Ae.percent-ce.percent;return Math.abs(Ee)>.001?-Ee:Ae.id-ce.id}),{first:_e,last:Me,views:V,ids:de}}function $(ne){ne.preventDefault()}function C(ne){let re=Math.hypot(ne.deltaX,ne.deltaY);const ve=Math.atan2(ne.deltaY,ne.deltaX);return-.25*Math.PI<ve&&ve<.75*Math.PI&&(re=-re),re}function P(ne){const re=ne.deltaMode;let ve=C(ne);const he=30,be=30;return re===WheelEvent.DOM_DELTA_PIXEL?ve/=he*be:re===WheelEvent.DOM_DELTA_LINE&&(ve/=be),ve}function z(ne){return Number.isInteger(ne)&&ne%90===0}function ee(ne){return Number.isInteger(ne)&&Object.values(g).includes(ne)&&ne!==g.UNKNOWN}function te(ne){return Number.isInteger(ne)&&Object.values(S).includes(ne)&&ne!==S.UNKNOWN}function K(ne){return ne.width<=ne.height}const ue=new Promise(function(ne){window.requestAnimationFrame(ne)});m.animationStarted=ue;const fe=document.documentElement.style;m.docStyle=fe;function ye(ne,re,ve){return Math.min(Math.max(ne,re),ve)}class me{constructor(re){nt(this,O,null);nt(this,M,null);nt(this,U,0);nt(this,Z,null);nt(this,se,!0);rt(this,O,re.classList),rt(this,Z,re.style)}get percent(){return Ue(this,U)}set percent(re){if(rt(this,U,ye(re,0,100)),isNaN(re)){Ue(this,O).add("indeterminate");return}Ue(this,O).remove("indeterminate"),Ue(this,Z).setProperty("--progressBar-percent",`${Ue(this,U)}%`)}setWidth(re){if(!re)return;const he=re.parentNode.offsetWidth-re.offsetWidth;he>0&&Ue(this,Z).setProperty("--progressBar-end-offset",`${he}px`)}setDisableAutoFetch(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;isNaN(Ue(this,U))||(Ue(this,M)&&clearTimeout(Ue(this,M)),this.show(),rt(this,M,setTimeout(()=>{rt(this,M,null),this.hide()},re)))}hide(){Ue(this,se)&&(rt(this,se,!1),Ue(this,O).add("hidden"))}show(){Ue(this,se)||(rt(this,se,!0),Ue(this,O).remove("hidden"))}}O=new WeakMap,M=new WeakMap,U=new WeakMap,Z=new WeakMap,se=new WeakMap,m.ProgressBar=me;function we(){let ne=document,re=ne.activeElement||ne.querySelector(":focus");for(;(ve=re)!==null&&ve!==void 0&&ve.shadowRoot;){var ve;ne=re.shadowRoot,re=ne.activeElement||ne.querySelector(":focus")}return re}function ge(ne){let re=g.VERTICAL,ve=S.NONE;switch(ne){case"SinglePage":re=g.PAGE;break;case"OneColumn":break;case"TwoPageLeft":re=g.PAGE;case"TwoColumnLeft":ve=S.ODD;break;case"TwoPageRight":re=g.PAGE;case"TwoColumnRight":ve=S.EVEN;break}return{scrollMode:re,spreadMode:ve}}function A(ne){switch(ne){case"UseNone":return y.NONE;case"UseThumbs":return y.THUMBS;case"UseOutlines":return y.OUTLINE;case"UseAttachments":return y.ATTACHMENTS;case"UseOC":return y.LAYERS}return y.NONE}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.AnnotationLayerBuilder=void 0;var t=R(4),n=R(5),h=R(2);function a(x,F){r(x,F),F.add(x)}function d(x,F,X){r(x,F),F.set(x,X)}function r(x,F){if(F.has(x))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(x,F,X){if(!F.has(x))throw new TypeError("attempted to get private field on non-instance");return X}function o(x,F,X){var G=y(x,F,"set");return c(x,G,X),X}function c(x,F,X){if(F.set)F.set.call(x,X);else{if(!F.writable)throw new TypeError("attempted to set read only private field");F.value=X}}function b(x,F){var X=y(x,F,"get");return f(x,X)}function y(x,F,X){if(!F.has(x))throw new TypeError("attempted to "+X+" private field on non-instance");return F.get(x)}function f(x,F){return F.get?F.get.call(x):F.value}var s=new WeakMap,g=new WeakMap,S=new WeakSet;class D{constructor(F){let{pageDiv:X,pdfPage:G,linkService:j,downloadManager:N,annotationStorage:Q=null,imageResourcesPath:Y="",renderForms:B=!0,l10n:ie=n.NullL10n,enableScripting:q=!1,hasJSActionsPromise:_=null,fieldObjectsPromise:H=null,annotationCanvasMap:$=null,accessibilityManager:C=null}=F;a(this,S),d(this,s,{writable:!0,value:0}),d(this,g,{writable:!0,value:null}),this.pageDiv=X,this.pdfPage=G,this.linkService=j,this.downloadManager=N,this.imageResourcesPath=Y,this.renderForms=B,this.l10n=ie,this.annotationStorage=Q,this.enableScripting=q,this._hasJSActionsPromise=_||Promise.resolve(!1),this._fieldObjectsPromise=H||Promise.resolve(null),this._annotationCanvasMap=$,this._accessibilityManager=C,this.div=null,this._cancelled=!1,this._eventBus=j.eventBus}async render(F){let X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(this.div){if(this._cancelled||b(this,s)===0)return;t.AnnotationLayer.update({viewport:F.clone({dontFlip:!0}),div:this.div,annotationCanvasMap:this._annotationCanvasMap});return}const[G,j,N]=await Promise.all([this.pdfPage.getAnnotations({intent:X}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(!this._cancelled){if(o(this,s,G.length),this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.append(this.div),b(this,s)===0){this.hide();return}if(t.AnnotationLayer.render({viewport:F.clone({dontFlip:!0}),div:this.div,annotations:G,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:j,fieldObjects:N,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager}),this.l10n.translate(this.div),this.linkService.isInPresentationMode&&i(this,S,w).call(this,h.PresentationModeState.FULLSCREEN),!b(this,g)){var Q;o(this,g,Y=>{i(this,S,w).call(this,Y.state)}),(Q=this._eventBus)===null||Q===void 0||Q._on("presentationmodechanged",b(this,g))}}}cancel(){if(this._cancelled=!0,b(this,g)){var F;(F=this._eventBus)===null||F===void 0||F._off("presentationmodechanged",b(this,g)),o(this,g,null)}}hide(){this.div&&(this.div.hidden=!0)}}m.AnnotationLayerBuilder=D;function w(x){if(!this.div)return;let F=!1;switch(x){case h.PresentationModeState.FULLSCREEN:F=!0;break;case h.PresentationModeState.NORMAL:break;default:return}for(const X of this.div.childNodes)X.hasAttribute("data-internal-link")||(X.inert=F)}},k=>{let m;typeof window<"u"&&window["pdfjs-dist/build/pdf"]?m=window["pdfjs-dist/build/pdf"]:m=requirePdf(),k.exports=m},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.NullL10n=void 0,m.fixupLangCode=h,m.getL10nFallback=t;const R={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",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",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_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.",rendering_error:"An error occurred while rendering the page.",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.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image"};R.print_progress_percent="{{progress}}%";function t(r,i){switch(r){case"find_match_count":r=`find_match_count[${i.total===1?"one":"other"}]`;break;case"find_match_count_limit":r=`find_match_count_limit[${i.limit===1?"one":"other"}]`;break}return R[r]||""}const n={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 h(r){return n[r==null?void 0:r.toLowerCase()]||r}function a(r,i){return i?r.replace(/\{\{\s*(\w+)\s*\}\}/g,(o,c)=>c in i?i[c]:"{{"+c+"}}"):r}const d={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t(r,i);return a(o,i)},async translate(r){}};m.NullL10n=d},(k,m,R)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.DownloadManager=void 0;var t=R(4);function n(d,r){const i=document.createElement("a");if(!i.click)throw new Error('DownloadManager: "a.click()" is not supported.');i.href=d,i.target="_parent","download"in i&&(i.download=r),(document.body||document.documentElement).append(i),i.click(),i.remove()}class h{constructor(){nt(this,a,new WeakMap)}downloadUrl(r,i){if(!(0,t.createValidAbsoluteUrl)(r,"http://example.com")){console.error(`downloadUrl - not a valid URL: ${r}`);return}n(r+"#pdfjs.action=download",i)}downloadData(r,i,o){const c=URL.createObjectURL(new Blob([r],{type:o}));n(c,i)}openOrDownloadData(r,i,o){const b=(0,t.isPdfFile)(o)?"application/pdf":"";return this.downloadData(i,o,b),!1}download(r,i,o){const c=URL.createObjectURL(r);n(c,o)}}a=new WeakMap,m.DownloadManager=h},(k,m)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.WaitOnType=m.EventBus=m.AutomationEventBus=void 0,m.waitOnEventOrTimeout=t;const R={EVENT:"event",TIMEOUT:"timeout"};m.WaitOnType=R;function t(d){let{target:r,name:i,delay:o=0}=d;return new Promise(function(c,b){if(typeof r!="object"||!(i&&typeof i=="string")||!(Number.isInteger(o)&&o>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function y(S){r instanceof n?r._off(i,f):r.removeEventListener(i,f),g&&clearTimeout(g),c(S)}const f=y.bind(null,R.EVENT);r instanceof n?r._on(i,f):r.addEventListener(i,f);const s=y.bind(null,R.TIMEOUT),g=setTimeout(s,o)})}class n{constructor(){nt(this,a,Object.create(null))}on(r,i){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._on(r,i,{external:!0,once:o==null?void 0:o.once})}off(r,i){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._off(r,i,{external:!0,once:o==null?void 0:o.once})}dispatch(r,i){const o=Ue(this,a)[r];if(!o||o.length===0)return;let c;for(const{listener:b,external:y,once:f}of o.slice(0)){if(f&&this._off(r,b),y){(c||(c=[])).push(b);continue}b(i)}if(c){for(const b of c)b(i);c=null}}_on(r,i){var o;let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;((o=Ue(this,a))[r]||(o[r]=[])).push({listener:i,external:(c==null?void 0:c.external)===!0,once:(c==null?void 0:c.once)===!0})}_off(r,i){const o=Ue(this,a)[r];if(o){for(let c=0,b=o.length;c<b;c++)if(o[c].listener===i){o.splice(c,1);return}}}}a=new WeakMap,m.EventBus=n;class h extends n{dispatch(r,i){throw new Error("Not implemented: AutomationEventBus.dispatch")}}m.AutomationEventBus=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.GenericL10n=void 0,R(9);var t=R(5);const n=document.webL10n;class h{constructor(d){this._lang=d,this._ready=new Promise((r,i)=>{n.setLanguage((0,t.fixupLangCode)(d),()=>{r(n)})})}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,t.getL10nFallback)(d,r);return(await this._ready).get(d,r,i)}async translate(d){return(await this._ready).translate(d)}}m.GenericL10n=h},()=>{document.webL10n=function(k,m,R){var t={},n="",h="textContent",a="",d={},r="loading",i=!0;function o(){return m.querySelectorAll('link[type="application/l10n"]')}function c(){var N=m.querySelector('script[type="application/l10n"]');return N?JSON.parse(N.innerHTML):null}function b(N){return N?N.querySelectorAll("*[data-l10n-id]"):[]}function y(N){if(!N)return{};var Q=N.getAttribute("data-l10n-id"),Y=N.getAttribute("data-l10n-args"),B={};if(Y)try{B=JSON.parse(Y)}catch{console.warn("could not parse arguments for #"+Q)}return{id:Q,args:B}}function f(N,Q,Y){Q=Q||function(q){},Y=Y||function(){};var B=new XMLHttpRequest;B.open("GET",N,i),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){B.readyState==4&&(B.status==200||B.status===0?Q(B.responseText):Y())},B.onerror=Y,B.ontimeout=Y;try{B.send(null)}catch{Y()}}function s(N,Q,Y,B){var ie=N.replace(/[^\/]*$/,"")||"./";function q(H){return H.lastIndexOf("\\")<0?H:H.replace(/\\\\/g,"\\").replace(/\\n/g,`
`).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":_==6?"many":_==2?"two":_==1?"one":"other"},18:function(_){return _===0?"zero":B(_,0,2)&&_!==0&&_!=2?"one":"other"},19:function(_){return B(_,2,10)?"few":B(_,0,1)?"one":"other"},20:function(_){return(B(_%10,3,4)||_%10==9)&&!(B(_%100,10,19)||B(_%100,70,79)||B(_%100,90,99))?"few":_%1e6===0&&_!==0?"many":_%10==2&&!Y(_%100,[12,72,92])?"two":_%10==1&&!Y(_%100,[11,71,91])?"one":"other"},21:function(_){return _===0?"zero":_==1?"one":"other"},22:function(_){return B(_,0,1)||B(_,11,99)?"one":"other"},23:function(_){return B(_%10,1,2)||_%20===0?"one":"other"},24:function(_){return B(_,3,10)||B(_,13,19)?"few":Y(_,[2,12])?"two":Y(_,[1,11])?"one":"other"}},q=Q[N.replace(/-.*$/,"")];return q in ie?ie[q]:(console.warn("plural form unknown for ["+N+"]"),function(){return"other"})}d.plural=function(N,Q,Y,B){var ie=parseFloat(Q);if(isNaN(ie)||B!=h)return N;d._pluralRules||(d._pluralRules=D(a));var q="["+d._pluralRules(ie)+"]";return ie===0&&Y+"[zero]"in t?N=t[Y+"[zero]"][B]:ie==1&&Y+"[one]"in t?N=t[Y+"[one]"][B]:ie==2&&Y+"[two]"in t?N=t[Y+"[two]"][B]:Y+q in t?N=t[Y+q][B]:Y+"[other]"in t&&(N=t[Y+"[other]"][B]),N};function w(N,Q,Y){var B=t[N];if(!B){if(console.warn("#"+N+" is undefined."),!Y)return null;B=Y}var ie={};for(var q in B){var _=B[q];_=x(_,Q,N,q),_=F(_,Q,N),ie[q]=_}return ie}function x(N,Q,Y,B){var ie=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/,q=ie.exec(N);if(!q||!q.length)return N;var _=q[1],H=q[2],$;if(Q&&H in Q?$=Q[H]:H in t&&($=t[H]),_ in d){var C=d[_];N=C(N,$,Y,B)}return N}function F(N,Q,Y){var B=/\{\{\s*(.+?)\s*\}\}/g;return N.replace(B,function(ie,q){return Q&&q in Q?Q[q]:q in t?t[q]:(console.log("argument {{"+q+"}} for #"+Y+" is undefined."),ie)})}function X(N){var Q=y(N);if(Q.id){var Y=w(Q.id,Q.args);if(!Y){console.warn("#"+Q.id+" is undefined.");return}if(Y[h]){if(G(N)===0)N[h]=Y[h];else{for(var B=N.childNodes,ie=!1,q=0,_=B.length;q<_;q++)B[q].nodeType===3&&/\S/.test(B[q].nodeValue)&&(ie?B[q].nodeValue="":(B[q].nodeValue=Y[h],ie=!0));if(!ie){var H=m.createTextNode(Y[h]);N.prepend(H)}}delete Y[h]}for(var $ in Y)N[$]=Y[$]}}function G(N){if(N.children)return N.children.length;if(typeof N.childElementCount<"u")return N.childElementCount;for(var Q=0,Y=0;Y<N.childNodes.length;Y++)Q+=N.nodeType===1?1:0;return Q}function j(N){N=N||m.documentElement;for(var Q=b(N),Y=Q.length,B=0;B<Y;B++)X(Q[B]);X(N)}return{get:function(N,Q,Y){var B=N.lastIndexOf("."),ie=h;B>0&&(ie=N.substring(B+1),N=N.substring(0,B));var q;Y&&(q={},q[ie]=Y);var _=w(N,Q,q);return _&&ie in _?_[ie]:"{{"+N+"}}"},getData:function(){return t},getText:function(){return n},getLanguage:function(){return a},setLanguage:function(N,Q){g(N,function(){Q&&Q()})},getDirection:function(){var N=["ar","he","fa","ps","ur"],Q=a.split("-",1)[0];return N.indexOf(Q)>=0?"rtl":"ltr"},translate:j,getReadyState:function(){return r},ready:function(N){if(N)r=="complete"||r=="interactive"?k.setTimeout(function(){N()}):m.addEventListener&&m.addEventListener("localized",function Q(){m.removeEventListener("localized",Q),N()});else return}}}(window,document)},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFFindController=m.FindState=void 0;var t=R(2),n=R(4),h=R(11);function a(oe,J){r(oe,J),J.add(oe)}function d(oe,J,pe){r(oe,J),J.set(oe,pe)}function r(oe,J){if(J.has(oe))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(oe,J){var pe=y(oe,J,"get");return o(oe,pe)}function o(oe,J){return J.get?J.get.call(oe):J.value}function c(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to get private field on non-instance");return pe}function b(oe,J,pe){var ke=y(oe,J,"set");return f(oe,ke,pe),pe}function y(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to "+pe+" private field on non-instance");return J.get(oe)}function f(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}}const s={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};m.FindState=s;const g=250,S=-50,D=-400,w={"":"-","":"'","":"'","":"'","":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},x=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let F;const X=/\p{M}+/gu,G=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,j=/([^\p{M}])\p{M}*$/u,N=/^\p{M}*([^\p{M}])/u,Q=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Y=new Map,B="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",ie=new Map;let q=null,_=null;function H(oe){const J=[];let pe;for(;(pe=Q.exec(oe))!==null;){let{index:dt}=pe;for(const ot of pe[0]){let lt=Y.get(ot);lt||(lt=ot.normalize("NFD").length,Y.set(ot,lt)),J.push([lt,dt++])}}let ke;if(J.length===0&&q)ke=q;else if(J.length>0&&_)ke=_;else{const at=`([${Object.keys(w).join("")}])|([①-⑳Ⓐ-⓿㉄-㊿㋐-㋾＀-￯])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[぀-ヿ])\\n)|(\\n)`;J.length===0?ke=q=new RegExp(at+"|(\\u0000)","gum"):ke=_=new RegExp(at+`|(${B})`,"gum")}const Re=[];for(;(pe=X.exec(oe))!==null;)Re.push([pe[0].length,pe.index]);let Be=oe.normalize("NFD");const Ne=[[0,0]];let Ge=0,Xe=0,ze=0,Ke=0,Qe=0,Je=!1;return Be=Be.replace(ke,(dt,ot,lt,bt,at,yt,Mt,At,St,st)=>{var ht;if(st-=Ke,ot){const ft=w[ot],gt=ft.length;for(let mt=1;mt<gt;mt++)Ne.push([st-ze+mt,ze-mt]);return ze-=gt-1,ft}if(lt){let ft=ie.get(lt);ft||(ft=lt.normalize("NFKC"),ie.set(lt,ft));const gt=ft.length;for(let mt=1;mt<gt;mt++)Ne.push([st-ze+mt,ze-mt]);return ze-=gt-1,ft}if(bt){var Ct;return Je=!0,st+Qe===((Ct=Re[Ge])===null||Ct===void 0?void 0:Ct[1])?++Ge:(Ne.push([st-1-ze+1,ze-1]),ze-=1,Ke+=1),Ne.push([st-ze+1,ze]),Ke+=1,Qe+=1,bt.charAt(0)}if(at){var Gt;const ft=at.endsWith(`
`),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;switch(oe.type){case"again":const J=this._selected.pageIdx+1,pe=this._linkService;return J>=1&&J<=pe.pagesCount&&J!==pe.page&&!pe.isPageVisible(J);case"highlightallchange":return!1}return!0}function Ve(oe,J,pe){let ke=oe.slice(0,J).match(j);if(ke){const Re=oe.charCodeAt(J),Be=ke[1].charCodeAt(0);if((0,h.getCharacterType)(Re)===(0,h.getCharacterType)(Be))return!1}if(ke=oe.slice(J+pe).match(N),ke){const Re=oe.charCodeAt(J+pe-1),Be=ke[1].charCodeAt(0);if((0,h.getCharacterType)(Re)===(0,h.getCharacterType)(Be))return!1}return!0}function ae(oe,J,pe,ke){const Re=this._pageMatches[pe]=[],Be=this._pageMatchesLength[pe]=[];if(!oe)return;const Ne=this._pageDiffs[pe];let Ge;for(;(Ge=oe.exec(ke))!==null;){if(J&&!c(this,ue,Ve).call(this,ke,Ge.index,Ge[0].length))continue;const[Xe,ze]=$(Ne,Ge.index,Ge[0].length);ze&&(Re.push(Xe),Be.push(ze))}}function T(oe,J){const{matchDiacritics:pe}=this._state;let ke=!1;oe=oe.replace(G,(Be,Ne,Ge,Xe,ze,Ke)=>Ne?`[ ]*\\${Ne}[ ]*`:Ge?`[ ]*${Ge}[ ]*`:Xe?"[ ]+":pe?ze||Ke:ze?x.has(ze.charCodeAt(0))?ze:"":J?(ke=!0,`${Ke}\\p{M}*`):Ke);const Re="[ ]*";return oe.endsWith(Re)&&(oe=oe.slice(0,oe.length-Re.length)),pe&&J&&(F||(F=String.fromCharCode(...x)),ke=!0,oe=`${oe}(?=[${F}]|[^\\p{M}]|$)`),[ke,oe]}function V(oe){var J;let pe=i(this,te);if(!pe)return;const{caseSensitive:ke,entireWord:Re,phraseSearch:Be}=this._state,Ne=this._pageContents[oe],Ge=this._hasDiacritics[oe];let Xe=!1;if(Be)[Xe,pe]=c(this,ye,T).call(this,pe,Ge);else{const Qe=pe.match(/\S+/g);Qe&&(pe=Qe.sort().reverse().map(Je=>{const[dt,ot]=c(this,ye,T).call(this,Je,Ge);return Xe||(Xe=dt),`(${ot})`}).join("|"))}const ze=`g${Xe?"u":""}${ke?"":"i"}`;pe=pe?new RegExp(pe,ze):null,c(this,fe,ae).call(this,pe,Re,oe,Ne),this._state.highlightAll&&c(this,ge,Pe).call(this,oe),this._resumePageIdx===oe&&(this._resumePageIdx=null,c(this,U,Me).call(this));const Ke=this._pageMatches[oe].length;this._matchesCountTotal+=Ke,i(this,C)?Ke>0&&c(this,ve,Oe).call(this):b(this,P,(J=i(this,P),++J))===this._linkService.pagesCount&&c(this,ve,Oe).call(this)}function de(){if(this._extractTextPromises.length>0)return;let oe=Promise.resolve();for(let J=0,pe=this._linkService.pagesCount;J<pe;J++){const ke=(0,n.createPromiseCapability)();this._extractTextPromises[J]=ke.promise,oe=oe.then(()=>this._pdfDocument.getPage(J+1).then(Re=>Re.getTextContent()).then(Re=>{const Be=[];for(const Ne of Re.items)Be.push(Ne.str),Ne.hasEOL&&Be.push(`
`);[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.CharacterType=R;function t(f){return f<11904}function n(f){return(f&65408)===0}function h(f){return f>=97&&f<=122||f>=65&&f<=90}function a(f){return f>=48&&f<=57}function d(f){return f===32||f===9||f===13||f===10}function r(f){return f>=13312&&f<=40959||f>=63744&&f<=64255}function i(f){return f>=12448&&f<=12543}function o(f){return f>=12352&&f<=12447}function c(f){return f>=65376&&f<=65439}function b(f){return(f&65408)===3584}function y(f){return t(f)?n(f)?d(f)?R.SPACE:h(f)||a(f)||f===95?R.ALPHA_LETTER:R.PUNCT:b(f)?R.THAI_LETTER:f===160?R.SPACE:R.ALPHA_LETTER:r(f)?R.HAN_LETTER:i(f)?R.KATAKANA_LETTER:o(f)?R.HIRAGANA_LETTER:c(f)?R.HALFWIDTH_KATAKANA_LETTER:R.ALPHA_LETTER}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFHistory=void 0,m.isDestArraysEqual=c,m.isDestHashesEqual=o;var t=R(2),n=R(7);const h=1e3,a=50,d=1e3;function r(){return document.location.hash}class i{constructor(y){let{linkService:f,eventBus:s}=y;this.linkService=f,this.eventBus=s,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",g=>{this._isPagesLoaded=!!g.pagesCount},{once:!0})})}initialize(y){let{fingerprint:f,resetHistory:s=!1,updateUrl:g=!1}=y;if(!f||typeof f!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const S=this._fingerprint!==""&&this._fingerprint!==f;this._fingerprint=f,this._updateUrl=g===!0,this._initialized=!0,this._bindEvents();const D=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=r(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(D,!0)||s){const{hash:x,page:F,rotation:X}=this._parseCurrentHash(!0);if(!x||S||s){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:x,page:F,rotation:X},!0);return}const w=D.destination;this._updateInternalState(w,D.uid,!0),w.rotation!==void 0&&(this._initialRotation=w.rotation),w.dest?(this._initialBookmark=JSON.stringify(w.dest),this._destination.page=null):w.hash?this._initialBookmark=w.hash:w.page&&(this._initialBookmark=`page=${w.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push(y){let{namedDest:f=null,explicitDest:s,pageNumber:g}=y;if(!this._initialized)return;if(f&&typeof f!="string"){console.error(`PDFHistory.push: "${f}" is not a valid namedDest parameter.`);return}else if(Array.isArray(s)){if(!this._isValidPage(g)&&(g!==null||this._destination)){console.error(`PDFHistory.push: "${g}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${s}" is not a valid explicitDest parameter.`);return}const S=f||JSON.stringify(s);if(!S)return;let D=!1;if(this._destination&&(o(this._destination.hash,S)||c(this._destination.dest,s))){if(this._destination.page)return;D=!0}this._popStateInProgress&&!D||(this._pushOrReplaceState({dest:s,hash:S,page:g,rotation:this.linkService.rotation},D),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(y){var f;if(this._initialized){if(!this._isValidPage(y)){console.error(`PDFHistory.pushPage: "${y}" is not a valid page number.`);return}((f=this._destination)===null||f===void 0?void 0:f.page)!==y&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${y}`,page:y,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const y=window.history.state;this._isValidState(y)&&y.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const y=window.history.state;this._isValidState(y)&&y.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(y){const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||!this._destination,g={fingerprint:this._fingerprint,uid:s?this._uid:this._uid+1,destination:y};this._updateInternalState(y,g.uid);let S;if(this._updateUrl&&y!==null&&y!==void 0&&y.hash){const D=document.location.href.split("#")[0];D.startsWith("file://")||(S=`${D}#${y.hash}`)}s?window.history.replaceState(g,"",S):window.history.pushState(g,"",S)}_tryPushCurrentPosition(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this._position)return;let f=this._position;if(y&&(f=Object.assign(Object.create(null),this._position),f.temporary=!0),!this._destination){this._pushOrReplaceState(f);return}if(this._destination.temporary){this._pushOrReplaceState(f,!0);return}if(this._destination.hash===f.hash||!this._destination.page&&this._numPositionUpdates<=a)return;let s=!1;if(this._destination.page>=f.first&&this._destination.page<=f.page){if(this._destination.dest!==void 0||!this._destination.first)return;s=!0}this._pushOrReplaceState(f,s)}_isValidPage(y){return Number.isInteger(y)&&y>0&&y<=this.linkService.pagesCount}_isValidState(y){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!y)return!1;if(y.fingerprint!==this._fingerprint)if(f){if(typeof y.fingerprint!="string"||y.fingerprint.length!==this._fingerprint.length)return!1;const[s]=performance.getEntriesByType("navigation");if((s==null?void 0:s.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(y.uid)||y.uid<0||y.destination===null||typeof y.destination!="object")}_updateInternalState(y,f){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),s&&y!==null&&y!==void 0&&y.temporary&&delete y.temporary,this._destination=y,this._uid=f,this._maxUid=Math.max(this._maxUid,f),this._numPositionUpdates=0}_parseCurrentHash(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const f=unescape(r()).substring(1),s=(0,t.parseQueryString)(f),g=s.get("nameddest")||"";let S=s.get("page")|0;return(!this._isValidPage(S)||y&&g.length>0)&&(S=null),{hash:f,page:S,rotation:this.linkService.rotation}}_updateViewarea(y){let{location:f}=y;this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:f.pdfOpenParams.substring(1),page:this.linkService.page,first:f.pageNumber,rotation:f.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null},d))}_popState(y){let{state:f}=y;const s=r(),g=this._currentHash!==s;if(this._currentHash=s,!f){this._uid++;const{hash:D,page:w,rotation:x}=this._parseCurrentHash();this._pushOrReplaceState({hash:D,page:w,rotation:x},!0);return}if(!this._isValidState(f))return;this._popStateInProgress=!0,g&&(this._blockHashChange++,(0,n.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:h}).then(()=>{this._blockHashChange--}));const S=f.destination;this._updateInternalState(S,f.uid,!0),(0,t.isValidRotation)(S.rotation)&&(this.linkService.rotation=S.rotation),S.dest?this.linkService.goToDestination(S.dest):S.hash?this.linkService.setHash(S.hash):S.page&&(this.linkService.page=S.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}_pageHide(){(!this._destination||this._destination.temporary)&&this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}m.PDFHistory=i;function o(b,y){return typeof b!="string"||typeof y!="string"?!1:b===y||(0,t.parseQueryString)(b).get("nameddest")===y}function c(b,y){function f(s,g){if(typeof s!=typeof g||Array.isArray(s)||Array.isArray(g))return!1;if(s!==null&&typeof s=="object"&&g!==null){if(Object.keys(s).length!==Object.keys(g).length)return!1;for(const S in s)if(!f(s[S],g[S]))return!1;return!0}return s===g||Number.isNaN(s)&&Number.isNaN(g)}if(!(Array.isArray(b)&&Array.isArray(y))||b.length!==y.length)return!1;for(let s=0,g=b.length;s<g;s++)if(!f(b[s],y[s]))return!1;return!0}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFPageView=void 0;var t=R(4),n=R(2),h=R(14),a=R(3),d=R(15),r=R(5),i=R(1),o=R(16),c=R(17),b=R(18),y=R(19),f=R(20);function s(O,M){S(O,M),M.add(O)}function g(O,M,U){S(O,M),M.set(O,U)}function S(O,M){if(M.has(O))throw new TypeError("Cannot initialize the same private elements twice on an object")}function D(O,M){var U=X(O,M,"get");return w(O,U)}function w(O,M){return M.get?M.get.call(O):M.value}function x(O,M,U){if(!M.has(O))throw new TypeError("attempted to get private field on non-instance");return U}function F(O,M,U){var Z=X(O,M,"set");return G(O,Z,U),U}function X(O,M,U){if(!M.has(O))throw new TypeError("attempted to "+U+" private field on non-instance");return M.get(O)}function G(O,M,U){if(M.set)M.set.call(O,U);else{if(!M.writable)throw new TypeError("attempted to set read only private field");M.value=U}}const j=d.compatibilityParams.maxCanvasPixels||16777216,N=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new i.SimpleLinkService}});var Q=new WeakMap,Y=new WeakMap,B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakMap,H=new WeakSet,$=new WeakSet,C=new WeakSet,P=new WeakSet,z=new WeakSet,ee=new WeakSet,te=new WeakSet;class K{constructor(M){var U;s(this,te),s(this,ee),s(this,z),s(this,P),s(this,C),s(this,$),s(this,H),g(this,Q,{writable:!0,value:t.AnnotationMode.ENABLE_FORMS}),g(this,Y,{writable:!0,value:null}),g(this,B,{writable:!0,value:null}),g(this,ie,{writable:!0,value:null}),g(this,q,{writable:!0,value:n.RenderingStates.INITIAL}),g(this,_,{writable:!0,value:{initialOptionalContent:!0,regularAnnotations:!0}});const Z=M.container,se=M.defaultViewport;this.id=M.id,this.renderingId="page"+this.id,F(this,Y,M.layerProperties||N),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=M.scale||n.DEFAULT_SCALE,this.viewport=se,this.pdfPageRotate=se.rotation,this._optionalContentConfigPromise=M.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.textLayerMode=M.textLayerMode??n.TextLayerMode.ENABLE,F(this,Q,M.annotationMode??t.AnnotationMode.ENABLE_FORMS),this.imageResourcesPath=M.imageResourcesPath||"",this.useOnlyCssZoom=M.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=M.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=M.maxCanvasPixels||j,this.pageColors=M.pageColors||null,this.eventBus=M.eventBus,this.renderingQueue=M.renderingQueue,this.renderer=M.renderer||n.RendererType.CANVAS,this.l10n=M.l10n||r.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.resume=null,this._renderError=null,this._isStandalone=!((U=this.renderingQueue)!==null&&U!==void 0&&U.hasViewer()),this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const ne=document.createElement("div");if(ne.className="page",ne.setAttribute("data-page-number",this.id),ne.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then(re=>{ne.setAttribute("aria-label",re)}),this.div=ne,x(this,H,ue).call(this),Z==null||Z.append(ne),this._isStandalone){Z==null||Z.style.setProperty("--scale-factor",this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:re}=M;re&&re.then(ve=>{re===this._optionalContentConfigPromise&&(D(this,_).initialOptionalContent=ve.hasInitialVisibility)})}}get renderingState(){return D(this,q)}set renderingState(M){if(M!==D(this,q))switch(F(this,q,M),D(this,B)&&(clearTimeout(D(this,B)),F(this,B,null)),M){case n.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case n.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),F(this,B,setTimeout(()=>{this.div.classList.add("loading"),F(this,B,null)},0));break;case n.RenderingStates.INITIAL:case n.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(M){this.pdfPage=M,this.pdfPageRotate=M.rotate;const U=(this.rotation+this.pdfPageRotate)%360;this.viewport=M.getViewport({scale:this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:U}),x(this,H,ue).call(this),this.reset()}destroy(){var M;this.reset(),(M=this.pdfPage)===null||M===void 0||M.cleanup()}get _textHighlighter(){return(0,t.shadow)(this,"_textHighlighter",new b.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:D(this,Y).call(this).findController}))}_resetZoomLayer(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.zoomLayer)return;const U=this.zoomLayer.firstChild;this.paintedViewportMap.delete(U),U.width=0,U.height=0,M&&this.zoomLayer.remove(),this.zoomLayer=null}reset(){var M,U,Z,se,ne;let{keepZoomLayer:re=!1,keepAnnotationLayer:ve=!1,keepAnnotationEditorLayer:he=!1,keepXfaLayer:be=!1,keepTextLayer:Ce=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.cancelRendering({keepAnnotationLayer:ve,keepAnnotationEditorLayer:he,keepXfaLayer:be,keepTextLayer:Ce}),this.renderingState=n.RenderingStates.INITIAL;const Te=this.div,Ie=Te.childNodes,He=re&&this.zoomLayer||null,Ve=ve&&((M=this.annotationLayer)===null||M===void 0?void 0:M.div)||null,ae=he&&((U=this.annotationEditorLayer)===null||U===void 0?void 0:U.div)||null,T=be&&((Z=this.xfaLayer)===null||Z===void 0?void 0:Z.div)||null,V=Ce&&((se=this.textLayer)===null||se===void 0?void 0:se.div)||null;for(let de=Ie.length-1;de>=0;de--){const Pe=Ie[de];switch(Pe){case He:case Ve:case ae:case T:case V:continue}Pe.remove()}Te.removeAttribute("data-loaded"),Ve&&this.annotationLayer.hide(),ae&&this.annotationEditorLayer.hide(),T&&this.xfaLayer.hide(),V&&this.textLayer.hide(),(ne=this.structTreeLayer)===null||ne===void 0||ne.hide(),He||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg)}update(M){let{scale:U=0,rotation:Z=null,optionalContentConfigPromise:se=null,drawingDelay:ne=-1}=M;this.scale=U||this.scale,typeof Z=="number"&&(this.rotation=Z),se instanceof Promise&&(this._optionalContentConfigPromise=se,se.then(Ce=>{se===this._optionalContentConfigPromise&&(D(this,_).initialOptionalContent=Ce.hasInitialVisibility)}));const re=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:re}),x(this,H,ue).call(this),this._isStandalone){var ve;(ve=this.div.parentNode)===null||ve===void 0||ve.style.setProperty("--scale-factor",this.viewport.scale)}if(this.svg){this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!0}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}let he=!1;if(this.canvas&&this.maxCanvasPixels>0){const Ce=this.outputScale;(Math.floor(this.viewport.width)*Ce.sx|0)*(Math.floor(this.viewport.height)*Ce.sy|0)>this.maxCanvasPixels&&(he=!0)}const be=ne>=0&&ne<1e3;if(this.canvas){if(be||this.useOnlyCssZoom||this.hasRestrictedScaling&&he){be&&this.renderingState!==n.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:ne}),this.renderingState=n.RenderingStates.FINISHED),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!be,hideTextLayer:be}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering(){let{keepAnnotationLayer:M=!1,keepAnnotationEditorLayer:U=!1,keepXfaLayer:Z=!1,keepTextLayer:se=!1,cancelExtraDelay:ne=0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.paintTask&&(this.paintTask.cancel(ne),this.paintTask=null),this.resume=null,this.textLayer&&(!se||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationLayer&&(!M||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.annotationEditorLayer&&(!U||!this.annotationEditorLayer.div)&&(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!Z||!this.xfaLayer.div)){var re;this.xfaLayer.cancel(),this.xfaLayer=null,(re=this._textHighlighter)===null||re===void 0||re.disable()}}cssTransform(M){let{target:U,redrawAnnotationLayer:Z=!1,redrawAnnotationEditorLayer:se=!1,redrawXfaLayer:ne=!1,redrawTextLayer:re=!1,hideTextLayer:ve=!1}=M;if(U instanceof HTMLCanvasElement){if(!U.hasAttribute("zooming")){U.setAttribute("zooming",!0);const{style:Ce}=U;Ce.width=Ce.height=""}}else{const Ce=this.div,{width:Te,height:Ie}=this.viewport;U.style.width=U.parentNode.style.width=Ce.style.width=Math.floor(Te)+"px",U.style.height=U.parentNode.style.height=Ce.style.height=Math.floor(Ie)+"px"}const he=this.paintedViewportMap.get(U);if(this.viewport!==he){const Ce=this.viewport.rotation-he.rotation,Te=Math.abs(Ce);let Ie=1,He=1;if(Te===90||Te===270){const{width:Ve,height:ae}=this.viewport;Ie=ae/Ve,He=Ve/ae}Te!==0&&(U.style.transform=`rotate(${Ce}deg) scale(${Ie}, ${He})`)}if(Z&&this.annotationLayer&&x(this,$,fe).call(this),se&&this.annotationEditorLayer&&x(this,C,ye).call(this),ne&&this.xfaLayer&&x(this,P,me).call(this),this.textLayer)if(ve){var be;this.textLayer.hide(),(be=this.structTreeLayer)===null||be===void 0||be.hide()}else re&&x(this,z,we).call(this)}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(M,U){return this.viewport.convertToPdfPoint(M,U)}draw(){var M=this;this.renderingState!==n.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:U,pdfPage:Z}=this;if(!Z)return this.renderingState=n.RenderingStates.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=n.RenderingStates.RUNNING;const se=document.createElement("div");if(se.classList.add("canvasWrapper"),U.append(se),!this.textLayer&&this.textLayerMode!==n.TextLayerMode.DISABLE&&!Z.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new c.TextAccessibilityManager),this.textLayer=new y.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),U.append(this.textLayer.div)),!this.annotationLayer&&D(this,Q)!==t.AnnotationMode.DISABLE){const{annotationStorage:be,downloadManager:Ce,enableScripting:Te,fieldObjectsPromise:Ie,hasJSActionsPromise:He,linkService:Ve}=D(this,Y).call(this);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:U,pdfPage:Z,annotationStorage:be,imageResourcesPath:this.imageResourcesPath,renderForms:D(this,Q)===t.AnnotationMode.ENABLE_FORMS,linkService:Ve,downloadManager:Ce,l10n:this.l10n,enableScripting:Te,hasJSActionsPromise:He,fieldObjectsPromise:Ie,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}let ne=null;this.renderingQueue&&(ne=be=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=n.RenderingStates.PAUSED,this.resume=()=>{this.renderingState=n.RenderingStates.RUNNING,be()};return}be()});const re=async function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(ve===M.paintTask&&(M.paintTask=null),be instanceof t.RenderingCancelledException){M._renderError=null;return}if(M._renderError=be,M.renderingState=n.RenderingStates.FINISHED,M._resetZoomLayer(!0),D(M,_).regularAnnotations=!ve.separateAnnots,M.eventBus.dispatch("pagerendered",{source:M,pageNumber:M.id,cssTransform:!1,timestamp:performance.now(),error:M._renderError}),be)throw be},ve=this.renderer===n.RendererType.SVG?this.paintOnSvg(se):this.paintOnCanvas(se);ve.onRenderContinue=ne,this.paintTask=ve;const he=ve.promise.then(()=>re(null).then(async()=>{if(x(this,z,we).call(this),this.annotationLayer&&await x(this,$,fe).call(this),!this.annotationEditorLayer){const{annotationEditorUIManager:be}=D(this,Y).call(this);if(!be)return;this.annotationEditorLayer=new h.AnnotationEditorLayerBuilder({uiManager:be,pageDiv:U,pdfPage:Z,l10n:this.l10n,accessibilityManager:this._accessibilityManager})}x(this,C,ye).call(this)}),function(be){return re(be)});if(Z.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&U.append(this.xfaLayer.div);else{const{annotationStorage:be,linkService:Ce}=D(this,Y).call(this);this.xfaLayer=new f.XfaLayerBuilder({pageDiv:U,pdfPage:Z,annotationStorage:be,linkService:Ce})}x(this,P,me).call(this)}return U.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),he}paintOnCanvas(M){const U=(0,t.createPromiseCapability)(),Z={promise:U.promise,onRenderContinue(de){de()},cancel(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;V.cancel(de)},get separateAnnots(){return V.separateAnnots}},se=this.viewport,{width:ne,height:re}=se,ve=document.createElement("canvas");ve.setAttribute("role","presentation"),ve.hidden=!0;let he=!0;const be=function(){he&&(ve.hidden=!1,he=!1)};M.append(ve),this.canvas=ve;const Ce=ve.getContext("2d",{alpha:!1}),Te=this.outputScale=new n.OutputScale;if(this.useOnlyCssZoom){const de=se.clone({scale:t.PixelsPerInch.PDF_TO_CSS_UNITS});Te.sx*=de.width/ne,Te.sy*=de.height/re}if(this.maxCanvasPixels>0){const de=ne*re,Pe=Math.sqrt(this.maxCanvasPixels/de);Te.sx>Pe||Te.sy>Pe?(Te.sx=Pe,Te.sy=Pe,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const Ie=(0,n.approximateFraction)(Te.sx),He=(0,n.approximateFraction)(Te.sy);ve.width=(0,n.roundToDivide)(se.width*Te.sx,Ie[0]),ve.height=(0,n.roundToDivide)(se.height*Te.sy,He[0]);const{style:Ve}=ve;Ve.width=(0,n.roundToDivide)(se.width,Ie[1])+"px",Ve.height=(0,n.roundToDivide)(se.height,He[1])+"px",this.paintedViewportMap.set(ve,se);const ae=Te.scaled?[Te.sx,0,0,Te.sy,0,0]:null,T={canvasContext:Ce,transform:ae,viewport:se,annotationMode:D(this,Q),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors},V=this.pdfPage.render(T);return V.onContinue=function(de){be(),Z.onRenderContinue?Z.onRenderContinue(de):de()},V.promise.then(function(){be(),U.resolve()},function(de){de instanceof t.RenderingCancelledException||be(),U.reject(de)}),Z}paintOnSvg(M){let U=!1;const Z=()=>{if(U)throw new t.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},se=this.pdfPage,ne=this.viewport.clone({scale:t.PixelsPerInch.PDF_TO_CSS_UNITS});return{promise:se.getOperatorList({annotationMode:D(this,Q)}).then(ve=>(Z(),new t.SVGGraphics(se.commonObjs,se.objs).getSVG(ve,ne).then(be=>{Z(),this.svg=be,this.paintedViewportMap.set(be,ne),be.style.width=M.style.width,be.style.height=M.style.height,this.renderingState=n.RenderingStates.FINISHED,M.append(be)}))),onRenderContinue(ve){ve()},cancel(){U=!0},get separateAnnots(){return!1}}}setPageLabel(M){this.pageLabel=typeof M=="string"?M:null,this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{initialOptionalContent:M,regularAnnotations:U}=D(this,_);return M&&U?this.canvas:null}}m.PDFPageView=K;function ue(){const{viewport:O}=this;if(this.pdfPage){if(D(this,ie)===O.rotation)return;F(this,ie,O.rotation)}(0,t.setLayerDimensions)(this.div,O,!0,!1)}async function fe(){let O=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(M){console.error(`#renderAnnotationLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:O})}}async function ye(){let O=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(M){console.error(`#renderAnnotationEditorLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:O})}}async function me(){let O=null;try{const M=await this.xfaLayer.render(this.viewport,"display");M!=null&&M.textDivs&&this._textHighlighter&&x(this,te,A).call(this,M.textDivs)}catch(M){console.error(`#renderXfaLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:O})}}async function we(){const{pdfPage:O,textLayer:M,viewport:U}=this;if(!M)return;let Z=null;try{if(!M.renderingDone){const se=O.streamTextContent({includeMarkedContent:!0});M.setTextContentSource(se)}await M.render(U)}catch(se){if(se instanceof t.AbortException)return;console.error(`#renderTextLayer: "${se}".`),Z=se}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:M.numTextDivs,error:Z}),x(this,ee,ge).call(this)}async function ge(){var O,M;if(!this.textLayer)return;this.structTreeLayer||(this.structTreeLayer=new o.StructTreeLayerBuilder);const U=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),Z=(O=this.structTreeLayer)===null||O===void 0?void 0:O.render(U);if(Z){var se;(se=this.canvas)===null||se===void 0||se.append(Z)}(M=this.structTreeLayer)===null||M===void 0||M.show()}async function A(O){const M=await this.pdfPage.getTextContent(),U=[];for(const Z of M.items)U.push(Z.str);this._textHighlighter.setTextMapping(O,U),this._textHighlighter.enable()}},(k,m,R)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.AnnotationEditorLayerBuilder=void 0;var t=R(4),n=R(5);class h{constructor(r){nt(this,a,void 0);this.pageDiv=r.pageDiv,this.pdfPage=r.pdfPage,this.accessibilityManager=r.accessibilityManager,this.l10n=r.l10n||n.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,rt(this,a,r.uiManager)}async render(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(i!=="display"||this._cancelled)return;const o=r.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:o}),this.show();return}const c=this.div=document.createElement("div");c.className="annotationEditorLayer",c.tabIndex=0,c.hidden=!0,this.pageDiv.append(c),this.annotationEditorLayer=new t.AnnotationEditorLayer({uiManager:Ue(this,a),div:c,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:o});const b={viewport:o,div:c,annotations:null,intent:i};this.annotationEditorLayer.render(b),this.show()}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isEmpty||(this.div.hidden=!1)}}a=new WeakMap,m.AnnotationEditorLayerBuilder=h},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.compatibilityParams=m.OptionKind=m.AppOptions=void 0;const R=Object.create(null);m.compatibilityParams=R;{const d=navigator.userAgent||"",r=navigator.platform||"",i=navigator.maxTouchPoints||1,o=/Android/.test(d),c=/\b(iPad|iPhone|iPod)(?=;)/.test(d)||r==="MacIntel"&&i>1;(function(){(c||o)&&(R.maxCanvasPixels=5242880)})()}const t={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};m.OptionKind=t;const n={annotationEditorMode:{value:0,kind:t.VIEWER+t.PREFERENCE},annotationMode:{value:2,kind:t.VIEWER+t.PREFERENCE},cursorToolOnLoad:{value:0,kind:t.VIEWER+t.PREFERENCE},defaultZoomDelay:{value:400,kind:t.VIEWER+t.PREFERENCE},defaultZoomValue:{value:"",kind:t.VIEWER+t.PREFERENCE},disableHistory:{value:!1,kind:t.VIEWER},disablePageLabels:{value:!1,kind:t.VIEWER+t.PREFERENCE},enablePermissions:{value:!1,kind:t.VIEWER+t.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:t.VIEWER+t.PREFERENCE},enableScripting:{value:!0,kind:t.VIEWER+t.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:t.VIEWER},externalLinkTarget:{value:0,kind:t.VIEWER+t.PREFERENCE},historyUpdateUrl:{value:!1,kind:t.VIEWER+t.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:t.VIEWER+t.PREFERENCE},imageResourcesPath:{value:"./images/",kind:t.VIEWER},maxCanvasPixels:{value:16777216,kind:t.VIEWER},forcePageColors:{value:!1,kind:t.VIEWER+t.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:t.VIEWER+t.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:t.VIEWER+t.PREFERENCE},pdfBugEnabled:{value:!1,kind:t.VIEWER+t.PREFERENCE},printResolution:{value:150,kind:t.VIEWER},sidebarViewOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},scrollModeOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},spreadModeOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},textLayerMode:{value:1,kind:t.VIEWER+t.PREFERENCE},useOnlyCssZoom:{value:!1,kind:t.VIEWER+t.PREFERENCE},viewerCssTheme:{value:0,kind:t.VIEWER+t.PREFERENCE},viewOnLoad:{value:0,kind:t.VIEWER+t.PREFERENCE},cMapPacked:{value:!0,kind:t.API},cMapUrl:{value:"../web/cmaps/",kind:t.API},disableAutoFetch:{value:!1,kind:t.API+t.PREFERENCE},disableFontFace:{value:!1,kind:t.API+t.PREFERENCE},disableRange:{value:!1,kind:t.API+t.PREFERENCE},disableStream:{value:!1,kind:t.API+t.PREFERENCE},docBaseUrl:{value:"",kind:t.API},enableXfa:{value:!0,kind:t.API+t.PREFERENCE},fontExtraProperties:{value:!1,kind:t.API},isEvalSupported:{value:!0,kind:t.API},isOffscreenCanvasSupported:{value:!0,kind:t.API},maxImageSize:{value:-1,kind:t.API},pdfBug:{value:!1,kind:t.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:t.API},verbosity:{value:1,kind:t.API},workerPort:{value:null,kind:t.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:t.WORKER}};n.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:t.VIEWER},n.disablePreferences={value:!1,kind:t.VIEWER},n.locale={value:navigator.language||"en-US",kind:t.VIEWER},n.renderer={value:"canvas",kind:t.VIEWER+t.PREFERENCE},n.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:t.VIEWER};const h=Object.create(null);class a{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(r){const i=h[r];if(i!==void 0)return i;const o=n[r];if(o!==void 0)return R[r]??o.value}static getAll(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const i=Object.create(null);for(const o in n){const c=n[o];if(r){if(!(r&c.kind))continue;if(r===t.PREFERENCE){const y=c.value,f=typeof y;if(f==="boolean"||f==="string"||f==="number"&&Number.isInteger(y)){i[o]=y;continue}throw new Error(`Invalid type for preference: ${o}`)}}const b=h[o];i[o]=b!==void 0?b:R[o]??c.value}return i}static set(r,i){h[r]=i}static setAll(r){for(const i in r)h[i]=r[i]}static remove(r){delete h[r]}}m.AppOptions=a,a._hasUserOptions=function(){return Object.keys(h).length>0}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.StructTreeLayerBuilder=void 0;function R(w,x){n(w,x),x.add(w)}function t(w,x,F){n(w,x),x.set(w,F)}function n(w,x){if(x.has(w))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(w,x,F){var X=i(w,x,"set");return a(w,X,F),F}function a(w,x,F){if(x.set)x.set.call(w,F);else{if(!x.writable)throw new TypeError("attempted to set read only private field");x.value=F}}function d(w,x,F){if(!x.has(w))throw new TypeError("attempted to get private field on non-instance");return F}function r(w,x){var F=i(w,x,"get");return o(w,F)}function i(w,x,F){if(!x.has(w))throw new TypeError("attempted to "+F+" private field on non-instance");return x.get(w)}function o(w,x){return x.get?x.get.call(w):x.value}const c={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},b=/^H(\d+)$/;var y=new WeakMap,f=new WeakSet,s=new WeakSet;class g{constructor(){R(this,s),R(this,f),t(this,y,{writable:!0,value:void 0})}get renderingDone(){return r(this,y)!==void 0}render(x){if(r(this,y)!==void 0)return r(this,y);const F=d(this,s,D).call(this,x);return F==null||F.classList.add("structTree"),h(this,y,F)}hide(){r(this,y)&&!r(this,y).hidden&&(r(this,y).hidden=!0)}show(){var x;(x=r(this,y))!==null&&x!==void 0&&x.hidden&&(r(this,y).hidden=!1)}}m.StructTreeLayerBuilder=g;function S(w,x){w.alt!==void 0&&x.setAttribute("aria-label",w.alt),w.id!==void 0&&x.setAttribute("aria-owns",w.id),w.lang!==void 0&&x.setAttribute("lang",w.lang)}function D(w){if(!w)return null;const x=document.createElement("span");if("role"in w){const{role:F}=w,X=F.match(b);X?(x.setAttribute("role","heading"),x.setAttribute("aria-level",X[1])):c[F]&&x.setAttribute("role",c[F])}if(d(this,f,S).call(this,w,x),w.children)if(w.children.length===1&&"id"in w.children[0])d(this,f,S).call(this,w.children[0],x);else for(const F of w.children)x.append(d(this,s,D).call(this,F));return x}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextAccessibilityManager=void 0;var t=R(2);function n(G,j){a(G,j),j.add(G)}function h(G,j,N){a(G,j),j.set(G,N)}function a(G,j){if(j.has(G))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(G,j,N){if(!j.has(G))throw new TypeError("attempted to get private field on non-instance");return N}function r(G,j,N){return i(G,j),N}function i(G,j){if(G!==j)throw new TypeError("Private static access of wrong provenance")}function o(G,j){var N=y(G,j,"get");return c(G,N)}function c(G,j){return j.get?j.get.call(G):j.value}function b(G,j,N){var Q=y(G,j,"set");return f(G,Q,N),N}function y(G,j,N){if(!j.has(G))throw new TypeError("attempted to "+N+" private field on non-instance");return j.get(G)}function f(G,j,N){if(j.set)j.set.call(G,N);else{if(!j.writable)throw new TypeError("attempted to set read only private field");j.value=N}}var s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakSet;class x{constructor(){n(this,w),h(this,s,{writable:!0,value:!1}),h(this,g,{writable:!0,value:null}),h(this,S,{writable:!0,value:new Map}),h(this,D,{writable:!0,value:new Map})}setTextMapping(j){b(this,g,j)}enable(){if(o(this,s))throw new Error("TextAccessibilityManager is already enabled.");if(!o(this,g))throw new Error("Text divs and strings have not been set.");if(b(this,s,!0),b(this,g,o(this,g).slice()),o(this,g).sort(r(x,x,F)),o(this,S).size>0){const j=o(this,g);for(const[N,Q]of o(this,S)){if(!document.getElementById(N)){o(this,S).delete(N);continue}d(this,w,X).call(this,N,j[Q])}}for(const[j,N]of o(this,D))this.addPointerInTextLayer(j,N);o(this,D).clear()}disable(){o(this,s)&&(o(this,D).clear(),b(this,g,null),b(this,s,!1))}removePointerInTextLayer(j){var N;if(!o(this,s)){o(this,D).delete(j);return}const Q=o(this,g);if(!Q||Q.length===0)return;const{id:Y}=j,B=o(this,S).get(Y);if(B===void 0)return;const ie=Q[B];o(this,S).delete(Y);let q=ie.getAttribute("aria-owns");(N=q)!==null&&N!==void 0&&N.includes(Y)&&(q=q.split(" ").filter(_=>_!==Y).join(" "),q?ie.setAttribute("aria-owns",q):(ie.removeAttribute("aria-owns"),ie.setAttribute("role","presentation")))}addPointerInTextLayer(j,N){const{id:Q}=j;if(!Q)return;if(!o(this,s)){o(this,D).set(j,N);return}N&&this.removePointerInTextLayer(j);const Y=o(this,g);if(!Y||Y.length===0)return;const B=(0,t.binarySearchFirstItem)(Y,q=>r(x,x,F).call(x,j,q)<0),ie=Math.max(0,B-1);d(this,w,X).call(this,Q,Y[ie]),o(this,S).set(Q,ie)}moveElementInDOM(j,N,Q,Y){if(this.addPointerInTextLayer(Q,Y),!j.hasChildNodes()){j.append(N);return}const B=Array.from(j.childNodes).filter(_=>_!==N);if(B.length===0)return;const ie=Q||N,q=(0,t.binarySearchFirstItem)(B,_=>r(x,x,F).call(x,ie,_)<0);q===0?B[0].before(N):B[q-1].after(N)}}m.TextAccessibilityManager=x;function F(G,j){const N=G.getBoundingClientRect(),Q=j.getBoundingClientRect();if(N.width===0&&N.height===0)return 1;if(Q.width===0&&Q.height===0)return-1;const Y=N.y,B=N.y+N.height,ie=N.y+N.height/2,q=Q.y,_=Q.y+Q.height,H=Q.y+Q.height/2;if(ie<=q&&H>=B)return-1;if(H<=Y&&ie>=_)return 1;const $=N.x+N.width/2,C=Q.x+Q.width/2;return $-C}function X(G,j){const N=j.getAttribute("aria-owns");N!=null&&N.includes(G)||j.setAttribute("aria-owns",N?`${N} ${G}`:G),j.removeAttribute("role")}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextHighlighter=void 0;class R{constructor(n){let{findController:h,eventBus:a,pageIndex:d}=n;this.findController=h,this.matches=[],this.eventBus=a,this.pageIdx=d,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(n,h){this.textDivs=n,this.textContentItemsStr=h}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=n=>{(n.pageIndex===this.pageIdx||n.pageIndex===-1)&&this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(n,h){if(!n)return[];const{textContentItemsStr:a}=this;let d=0,r=0;const i=a.length-1,o=[];for(let c=0,b=n.length;c<b;c++){let y=n[c];for(;d!==i&&y>=r+a[d].length;)r+=a[d].length,d++;d===a.length&&console.error("Could not find a matching mapping");const f={begin:{divIdx:d,offset:y-r}};for(y+=h[c];d!==i&&y>r+a[d].length;)r+=a[d].length,d++;f.end={divIdx:d,offset:y-r},o.push(f)}return o}_renderMatches(n){if(n.length===0)return;const{findController:h,pageIdx:a}=this,{textContentItemsStr:d,textDivs:r}=this,i=a===h.selected.pageIdx,o=h.selected.matchIdx,c=h.state.highlightAll;let b=null;const y={divIdx:-1,offset:void 0};function f(D,w){const x=D.divIdx;return r[x].textContent="",s(x,0,D.offset,w)}function s(D,w,x,F){let X=r[D];if(X.nodeType===Node.TEXT_NODE){const N=document.createElement("span");X.before(N),N.append(X),r[D]=N,X=N}const G=d[D].substring(w,x),j=document.createTextNode(G);if(F){const N=document.createElement("span");return N.className=`${F} appended`,N.append(j),X.append(N),F.includes("selected")?N.offsetLeft:0}return X.append(j),0}let g=o,S=g+1;if(c)g=0,S=n.length;else if(!i)return;for(let D=g;D<S;D++){const w=n[D],x=w.begin,F=w.end,X=i&&D===o,G=X?" selected":"";let j=0;if(!b||x.divIdx!==b.divIdx?(b!==null&&s(b.divIdx,b.offset,y.offset),f(x)):s(b.divIdx,b.offset,x.offset),x.divIdx===F.divIdx)j=s(x.divIdx,x.offset,F.offset,"highlight"+G);else{j=s(x.divIdx,x.offset,y.offset,"highlight begin"+G);for(let N=x.divIdx+1,Q=F.divIdx;N<Q;N++)r[N].className="highlight middle"+G;f(F,"highlight end"+G)}b=F,X&&h.scrollMatchIntoView({element:r[x.divIdx],selectedLeft:j,pageIndex:a,matchIndex:o})}b&&s(b.divIdx,b.offset,y.offset)}_updateMatches(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.enabled&&!n)return;const{findController:h,matches:a,pageIdx:d}=this,{textContentItemsStr:r,textDivs:i}=this;let o=-1;for(const y of a){const f=Math.max(o,y.begin.divIdx);for(let s=f,g=y.end.divIdx;s<=g;s++){const S=i[s];S.textContent=r[s],S.className=""}o=y.end.divIdx+1}if(!(h!=null&&h.highlightMatches)||n)return;const c=h.pageMatches[d]||null,b=h.pageMatchesLength[d]||null;this.matches=this._convertMatches(c,b),this._renderMatches(this.matches)}}m.TextHighlighter=R},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextLayerBuilder=void 0;var t=R(4);function n(F,X){a(F,X),X.add(F)}function h(F,X,G){a(F,X),X.set(F,G)}function a(F,X){if(X.has(F))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(F,X,G){var j=o(F,X,"set");return r(F,j,G),G}function r(F,X,G){if(X.set)X.set.call(F,G);else{if(!X.writable)throw new TypeError("attempted to set read only private field");X.value=G}}function i(F,X){var G=o(F,X,"get");return c(F,G)}function o(F,X,G){if(!X.has(F))throw new TypeError("attempted to "+G+" private field on non-instance");return X.get(F)}function c(F,X){return X.get?X.get.call(F):X.value}function b(F,X,G){if(!X.has(F))throw new TypeError("attempted to get private field on non-instance");return G}var y=new WeakMap,f=new WeakMap,s=new WeakMap,g=new WeakSet,S=new WeakSet;class D{constructor(X){let{highlighter:G=null,accessibilityManager:j=null,isOffscreenCanvasSupported:N=!0}=X;n(this,S),n(this,g),h(this,y,{writable:!0,value:0}),h(this,f,{writable:!0,value:0}),h(this,s,{writable:!0,value:null}),this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=G,this.accessibilityManager=j,this.isOffscreenCanvasSupported=N,this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}get numTextDivs(){return this.textDivs.length}async render(X){var G,j,N;if(!i(this,s))throw new Error('No "textContentSource" parameter specified.');const Q=X.scale*(globalThis.devicePixelRatio||1),{rotation:Y}=X;if(this.renderingDone){const B=Y!==i(this,y),ie=Q!==i(this,f);(B||ie)&&(this.hide(),(0,t.updateTextLayer)({container:this.div,viewport:X,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:ie,mustRotate:B}),d(this,f,Q),d(this,y,Y)),this.show();return}this.cancel(),(G=this.highlighter)===null||G===void 0||G.setTextMapping(this.textDivs,this.textContentItemsStr),(j=this.accessibilityManager)===null||j===void 0||j.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,t.renderTextLayer)({textContentSource:i(this,s),container:this.div,viewport:X,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),await this.textLayerRenderTask.promise,b(this,g,w).call(this),d(this,f,Q),d(this,y,Y),this.show(),(N=this.accessibilityManager)===null||N===void 0||N.enable()}hide(){if(!this.div.hidden){var X;(X=this.highlighter)===null||X===void 0||X.disable(),this.div.hidden=!0}}show(){if(this.div.hidden&&this.renderingDone){var X;this.div.hidden=!1,(X=this.highlighter)===null||X===void 0||X.enable()}}cancel(){var X,G;this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),(X=this.highlighter)===null||X===void 0||X.disable(),(G=this.accessibilityManager)===null||G===void 0||G.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(X){this.cancel(),d(this,s,X)}}m.TextLayerBuilder=D;function w(){this.renderingDone=!0;const F=document.createElement("div");F.className="endOfContent",this.div.append(F),b(this,S,x).call(this)}function x(){const{div:F}=this;F.addEventListener("mousedown",X=>{const G=F.querySelector(".endOfContent");if(!G)return;let j=X.target!==F;if(j&&(j=getComputedStyle(G).getPropertyValue("-moz-user-select")!=="none"),j){const N=F.getBoundingClientRect(),Q=Math.max(0,(X.pageY-N.top)/N.height);G.style.top=(Q*100).toFixed(2)+"%"}G.classList.add("active")}),F.addEventListener("mouseup",()=>{const X=F.querySelector(".endOfContent");X&&(X.style.top="",X.classList.remove("active"))})}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.XfaLayerBuilder=void 0;var t=R(4);class n{constructor(a){let{pageDiv:d,pdfPage:r,annotationStorage:i=null,linkService:o,xfaHtml:c=null}=a;this.pageDiv=d,this.pdfPage=r,this.annotationStorage=i,this.linkService=o,this.xfaHtml=c,this.div=null,this._cancelled=!1}async render(a){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(d==="print"){const o={viewport:a.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:d},c=document.createElement("div");return this.pageDiv.append(c),o.div=c,t.XfaLayer.render(o)}const r=await this.pdfPage.getXfa();if(this._cancelled||!r)return{textDivs:[]};const i={viewport:a.clone({dontFlip:!0}),div:this.div,xfaHtml:r,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:d};return this.div?t.XfaLayer.update(i):(this.div=document.createElement("div"),this.pageDiv.append(this.div),i.div=this.div,t.XfaLayer.render(i))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}m.XfaLayerBuilder=n},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFScriptingManager=void 0;var t=R(2),n=R(4);class h{constructor(d){let{eventBus:r,sandboxBundleSrc:i=null,scriptingFactory:o=null,docPropertiesLookup:c=null}=d;this._pdfDocument=null,this._pdfViewer=null,this._closeCapability=null,this._destroyCapability=null,this._scripting=null,this._ready=!1,this._eventBus=r,this._sandboxBundleSrc=i,this._scriptingFactory=o,this._docPropertiesLookup=c,this._scriptingFactory||window.addEventListener("updatefromsandbox",b=>{this._eventBus.dispatch("updatefromsandbox",{source:window,detail:b.detail})})}setViewer(d){this._pdfViewer=d}async setDocument(d){var r;if(this._pdfDocument&&await this._destroyScripting(),this._pdfDocument=d,!d)return;const[i,o,c]=await Promise.all([d.getFieldObjects(),d.getCalculationOrderIds(),d.getJSActions()]);if(!i&&!c){await this._destroyScripting();return}if(d===this._pdfDocument){try{this._scripting=this._createScripting()}catch(b){console.error(`PDFScriptingManager.setDocument: "${b==null?void 0:b.message}".`),await this._destroyScripting();return}this._internalEvents.set("updatefromsandbox",b=>{(b==null?void 0:b.source)===window&&this._updateFromSandbox(b.detail)}),this._internalEvents.set("dispatcheventinsandbox",b=>{var y;(y=this._scripting)===null||y===void 0||y.dispatchEventInSandbox(b.detail)}),this._internalEvents.set("pagechanging",b=>{let{pageNumber:y,previous:f}=b;y!==f&&(this._dispatchPageClose(f),this._dispatchPageOpen(y))}),this._internalEvents.set("pagerendered",b=>{let{pageNumber:y}=b;this._pageOpenPending.has(y)&&y===this._pdfViewer.currentPageNumber&&this._dispatchPageOpen(y)}),this._internalEvents.set("pagesdestroy",async b=>{var y,f;await this._dispatchPageClose(this._pdfViewer.currentPageNumber),await((y=this._scripting)===null||y===void 0?void 0:y.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(f=this._closeCapability)===null||f===void 0||f.resolve()});for(const[b,y]of this._internalEvents)this._eventBus._on(b,y);try{const b=await this._getDocProperties();if(d!==this._pdfDocument)return;await this._scripting.createSandbox({objects:i,calculationOrder:o,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...b,actions:c}}),this._eventBus.dispatch("sandboxcreated",{source:this})}catch(b){console.error(`PDFScriptingManager.setDocument: "${b==null?void 0:b.message}".`),await this._destroyScripting();return}await((r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"Open"})),await this._dispatchPageOpen(this._pdfViewer.currentPageNumber,!0),Promise.resolve().then(()=>{d===this._pdfDocument&&(this._ready=!0)})}}async dispatchWillSave(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var d;return((d=this._destroyCapability)===null||d===void 0?void 0:d.promise)||null}get ready(){return this._ready}get _internalEvents(){return(0,n.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,n.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,n.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(d){const r=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:i,siblings:o,command:c,value:b}=d;if(!i){switch(c){case"clear":console.clear();break;case"error":console.error(b);break;case"layout":{if(r)return;const s=(0,t.apiPageLayoutToViewerModes)(b);this._pdfViewer.spreadMode=s.spreadMode;break}case"page-num":this._pdfViewer.currentPageNumber=b+1;break;case"print":await this._pdfViewer.pagesPromise,this._eventBus.dispatch("print",{source:this});break;case"println":console.log(b);break;case"zoom":if(r)return;this._pdfViewer.currentScaleValue=b;break;case"SaveAs":this._eventBus.dispatch("download",{source:this});break;case"FirstPage":this._pdfViewer.currentPageNumber=1;break;case"LastPage":this._pdfViewer.currentPageNumber=this._pdfViewer.pagesCount;break;case"NextPage":this._pdfViewer.nextPage();break;case"PrevPage":this._pdfViewer.previousPage();break;case"ZoomViewIn":if(r)return;this._pdfViewer.increaseScale();break;case"ZoomViewOut":if(r)return;this._pdfViewer.decreaseScale();break}return}if(r&&d.focus)return;delete d.id,delete d.siblings;const y=o?[i,...o]:[i];for(const s of y){const g=document.querySelector(`[data-element-id="${s}"]`);if(g)g.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:d}));else{var f;(f=this._pdfDocument)===null||f===void 0||f.annotationStorage.setValue(s,d)}}}async _dispatchPageOpen(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this._pdfDocument,o=this._visitedPages;if(r&&(this._closeCapability=(0,n.createPromiseCapability)()),!this._closeCapability)return;const c=this._pdfViewer.getPageView(d-1);if((c==null?void 0:c.renderingState)!==t.RenderingStates.FINISHED){this._pageOpenPending.add(d);return}this._pageOpenPending.delete(d);const b=(async()=>{var y,f;const s=await(o.has(d)?null:(y=c.pdfPage)===null||y===void 0?void 0:y.getJSActions());i===this._pdfDocument&&await((f=this._scripting)===null||f===void 0?void 0:f.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:d,actions:s}))})();o.set(d,b)}async _dispatchPageClose(d){var r;const i=this._pdfDocument,o=this._visitedPages;if(!this._closeCapability||this._pageOpenPending.has(d))return;const c=o.get(d);c&&(o.set(d,null),await c,i===this._pdfDocument&&await((r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:d})))}async _getDocProperties(){if(this._docPropertiesLookup)return this._docPropertiesLookup(this._pdfDocument);const{docPropertiesLookup:d}=R(22);return d(this._pdfDocument)}_createScripting(){if(this._destroyCapability=(0,n.createPromiseCapability)(),this._scripting)throw new Error("_createScripting: Scripting already exists.");if(this._scriptingFactory)return this._scriptingFactory.createScripting({sandboxBundleSrc:this._sandboxBundleSrc});const{GenericScripting:d}=R(22);return new d(this._sandboxBundleSrc)}async _destroyScripting(){var d;if(!this._scripting){var r;this._pdfDocument=null,(r=this._destroyCapability)===null||r===void 0||r.resolve();return}this._closeCapability&&(await Promise.race([this._closeCapability.promise,new Promise(i=>{setTimeout(i,1e3)})]).catch(i=>{}),this._closeCapability=null),this._pdfDocument=null;try{await this._scripting.destroySandbox()}catch{}for(const[i,o]of this._internalEvents)this._eventBus._off(i,o);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this._scripting=null,this._ready=!1,(d=this._destroyCapability)===null||d===void 0||d.resolve()}}m.PDFScriptingManager=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.GenericScripting=void 0,m.docPropertiesLookup=n;var t=R(4);async function n(a){const d="",r=d.split("#")[0];let{info:i,metadata:o,contentDispositionFilename:c,contentLength:b}=await a.getMetadata();if(!b){const{length:y}=await a.getDownloadInfo();b=y}return{...i,baseURL:r,filesize:b,filename:c||(0,t.getPdfFilenameFromUrl)(d),metadata:o==null?void 0:o.getRaw(),authors:o==null?void 0:o.get("dc:creator"),numPages:a.numPages,URL:d}}class h{constructor(d){this._ready=(0,t.loadScript)(d,!0).then(()=>window.pdfjsSandbox.QuickJSSandbox())}async createSandbox(d){(await this._ready).create(d)}async dispatchEventInSandbox(d){const r=await this._ready;setTimeout(()=>r.dispatchEvent(d),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}m.GenericScripting=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFSinglePageViewer=void 0;var t=R(2),n=R(24);class h extends n.PDFViewer{_resetView(){super._resetView(),this._scrollMode=t.ScrollMode.PAGE,this._spreadMode=t.SpreadMode.NONE}set scrollMode(d){}_updateScrollMode(){}set spreadMode(d){}_updateSpreadMode(){}}m.PDFSinglePageViewer=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PagesCountLimit=m.PDFViewer=m.PDFPageViewBuffer=void 0;var t=R(4),n=R(2),h=R(5),a=R(13),d=R(25),r=R(1);let i;function o(ae,T){b(ae,T),T.add(ae)}function c(ae,T,V){b(ae,T),T.set(ae,V)}function b(ae,T){if(T.has(ae))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(ae,T,V){if(!T.has(ae))throw new TypeError("attempted to get private field on non-instance");return V}function f(ae,T){var V=S(ae,T,"get");return s(ae,V)}function s(ae,T){return T.get?T.get.call(ae):T.value}function g(ae,T,V){var de=S(ae,T,"set");return D(ae,de,V),V}function S(ae,T,V){if(!T.has(ae))throw new TypeError("attempted to "+V+" private field on non-instance");return T.get(ae)}function D(ae,T,V){if(T.set)T.set.call(ae,V);else{if(!T.writable)throw new TypeError("attempted to set read only private field");T.value=V}}const w=10,x="enablePermissions",F={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};m.PagesCountLimit=F;function X(ae){return Object.values(t.AnnotationEditorType).includes(ae)&&ae!==t.AnnotationEditorType.DISABLE}var G=new WeakMap,j=new WeakMap,N=new WeakSet;i=Symbol.iterator;class Q{constructor(T){o(this,N),c(this,G,{writable:!0,value:new Set}),c(this,j,{writable:!0,value:0}),g(this,j,T)}push(T){const V=f(this,G);V.has(T)&&V.delete(T),V.add(T),V.size>f(this,j)&&y(this,N,Y).call(this)}resize(T){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;g(this,j,T);const de=f(this,G);if(V){const Pe=de.size;let De=1;for(const Fe of de)if(V.has(Fe.id)&&(de.delete(Fe),de.add(Fe)),++De>Pe)break}for(;de.size>f(this,j);)y(this,N,Y).call(this)}has(T){return f(this,G).has(T)}[i](){return f(this,G).keys()}}m.PDFPageViewBuffer=Q;function Y(){const ae=f(this,G).keys().next().value;ae==null||ae.destroy(),f(this,G).delete(ae)}var B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,C=new WeakMap,P=new WeakMap,z=new WeakMap,ee=new WeakMap,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;class Z{constructor(T){var V,de;o(this,U),o(this,M),o(this,O),o(this,A),o(this,ge),o(this,we),o(this,me),o(this,ye),o(this,fe),o(this,ue),o(this,K),c(this,B,{writable:!0,value:null}),c(this,ie,{writable:!0,value:t.AnnotationEditorType.NONE}),c(this,q,{writable:!0,value:null}),c(this,_,{writable:!0,value:t.AnnotationMode.ENABLE_FORMS}),c(this,H,{writable:!0,value:null}),c(this,$,{writable:!0,value:!1}),c(this,C,{writable:!0,value:0}),c(this,P,{writable:!0,value:new ResizeObserver(y(this,U,Ve).bind(this))}),c(this,z,{writable:!0,value:null}),c(this,ee,{writable:!0,value:null}),c(this,te,{writable:!0,value:null});const Pe="3.4.120";if(t.version!==Pe)throw new Error(`The API version "${t.version}" does not match the Viewer version "${Pe}".`);if(this.container=T.container,this.viewer=T.viewer||T.container.firstElementChild,((V=this.container)===null||V===void 0?void 0:V.tagName)!=="DIV"||((de=this.viewer)===null||de===void 0?void 0:de.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");f(this,P).observe(this.container),this.eventBus=T.eventBus,this.linkService=T.linkService||new r.SimpleLinkService,this.downloadManager=T.downloadManager||null,this.findController=T.findController||null,this._scriptingManager=T.scriptingManager||null,this.textLayerMode=T.textLayerMode??n.TextLayerMode.ENABLE,g(this,_,T.annotationMode??t.AnnotationMode.ENABLE_FORMS),g(this,ie,T.annotationEditorMode??t.AnnotationEditorType.NONE),this.imageResourcesPath=T.imageResourcesPath||"",this.enablePrintAutoRotate=T.enablePrintAutoRotate||!1,this.removePageBorders=T.removePageBorders||!1,this.renderer=T.renderer||n.RendererType.CANVAS,this.useOnlyCssZoom=T.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=T.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=T.maxCanvasPixels,this.l10n=T.l10n||h.NullL10n,g(this,$,T.enablePermissions||!1),this.pageColors=T.pageColors||null,this.pageColors&&!(CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground))&&((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.defaultRenderingQueue=!T.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new d.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=T.renderingQueue,this.scroll=(0,n.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=n.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),y(this,M,He).call(this)}get pagesCount(){return this._pages.length}getPageView(T){return this._pages[T]}get pageViewsReady(){return this._pagesCapability.settled?this._pages.every(function(T){return T==null?void 0:T.pdfPage}):!1}get renderForms(){return f(this,_)===t.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(T){if(!Number.isInteger(T))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(T,!0)||console.error(`currentPageNumber: "${T}" is not a valid page.`))}_setCurrentPageNumber(T){var V;let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this._currentPageNumber===T)return de&&y(this,ge,Ce).call(this),!0;if(!(0<T&&T<=this.pagesCount))return!1;const Pe=this._currentPageNumber;return this._currentPageNumber=T,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:T,pageLabel:((V=this._pageLabels)===null||V===void 0?void 0:V[T-1])??null,previous:Pe}),de&&y(this,ge,Ce).call(this),!0}get currentPageLabel(){var T;return((T=this._pageLabels)===null||T===void 0?void 0:T[this._currentPageNumber-1])??null}set currentPageLabel(T){if(!this.pdfDocument)return;let V=T|0;if(this._pageLabels){const de=this._pageLabels.indexOf(T);de>=0&&(V=de+1)}this._setCurrentPageNumber(V,!0)||console.error(`currentPageLabel: "${T}" is not a valid page.`)}get currentScale(){return this._currentScale!==n.UNKNOWN_SCALE?this._currentScale:n.DEFAULT_SCALE}set currentScale(T){if(isNaN(T))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(T,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(T){this.pdfDocument&&this._setScale(T,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(T){if(!(0,n.isValidRotation)(T))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(T%=360,T<0&&(T+=360),this._pagesRotation===T))return;this._pagesRotation=T;const V=this._currentPageNumber;this.refresh(!0,{rotation:T}),this._currentScaleValue&&this._setScale(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:T,pageNumber:V}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}setDocument(T){if(this.pdfDocument){var V,de;this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(V=this.findController)===null||V===void 0||V.setDocument(null),(de=this._scriptingManager)===null||de===void 0||de.setDocument(null),f(this,q)&&(f(this,q).destroy(),g(this,q,null))}if(this.pdfDocument=T,!T)return;const Pe=T.numPages,De=T.getPage(1),Fe=T.getOptionalContentConfig(),_e=f(this,$)?T.getPermissions():Promise.resolve();if(Pe>F.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const Me=this._scrollMode=n.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:Me})}this._pagesCapability.promise.then(()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:Pe})},()=>{}),this._onBeforeDraw=Me=>{const Ae=this._pages[Me.pageNumber-1];Ae&&f(this,B).push(Ae)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=Me=>{Me.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:Me.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,f(this,ee)&&(document.removeEventListener("visibilitychange",f(this,ee)),g(this,ee,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([De,_e]).then(Me=>{let[Ae,ce]=Me;if(T!==this.pdfDocument)return;this._firstPageCapability.resolve(Ae),this._optionalContentConfigPromise=Fe;const{annotationEditorMode:Ee,annotationMode:We,textLayerMode:Oe}=y(this,ue,ne).call(this,ce);if(Ee!==t.AnnotationEditorType.DISABLE){const Re=Ee;T.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):X(Re)?(g(this,q,new t.AnnotationEditorUIManager(this.container,this.eventBus,T==null?void 0:T.annotationStorage)),Re!==t.AnnotationEditorType.NONE&&f(this,q).updateMode(Re)):console.error(`Invalid AnnotationEditor mode: ${Re}`)}const $e=y(this,K,se).bind(this),oe=this._scrollMode===n.ScrollMode.PAGE?null:this.viewer,J=this.currentScale,pe=Ae.getViewport({scale:J*t.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",pe.scale);for(let Re=1;Re<=Pe;++Re){const Be=new a.PDFPageView({container:oe,eventBus:this.eventBus,id:Re,scale:J,defaultViewport:pe.clone(),optionalContentConfigPromise:Fe,renderingQueue:this.renderingQueue,textLayerMode:Oe,annotationMode:We,imageResourcesPath:this.imageResourcesPath,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:$e});this._pages.push(Be)}const ke=this._pages[0];ke&&(ke.setPdfPage(Ae),this.linkService.cachePageRef(1,Ae.ref)),this._scrollMode===n.ScrollMode.PAGE?y(this,ye,ve).call(this):this._spreadMode!==n.SpreadMode.NONE&&this._updateSpreadMode(),y(this,fe,re).call(this).then(async()=>{var Re,Be;if((Re=this.findController)===null||Re===void 0||Re.setDocument(T),(Be=this._scriptingManager)===null||Be===void 0||Be.setDocument(T),f(this,q)&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:f(this,ie)}),T.loadingParams.disableAutoFetch||Pe>F.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let Ne=Pe-1;if(Ne<=0){this._pagesCapability.resolve();return}for(let Ge=2;Ge<=Pe;++Ge){const Xe=T.getPage(Ge).then(ze=>{const Ke=this._pages[Ge-1];Ke.pdfPage||Ke.setPdfPage(ze),this.linkService.cachePageRef(Ge,ze.ref),--Ne===0&&this._pagesCapability.resolve()},ze=>{console.error(`Unable to get page ${Ge} to initialize viewer`,ze),--Ne===0&&this._pagesCapability.resolve()});Ge%F.PAUSE_EAGER_PAGE_INIT===0&&await Xe}}),this.eventBus.dispatch("pagesinit",{source:this}),T.getMetadata().then(Re=>{let{info:Be}=Re;T===this.pdfDocument&&Be.Language&&(this.viewer.lang=Be.Language)}),this.defaultRenderingQueue&&this.update()}).catch(Me=>{console.error("Unable to initialize viewer",Me),this._pagesCapability.reject(Me)})}setPageLabels(T){if(this.pdfDocument){T?Array.isArray(T)&&this.pdfDocument.numPages===T.length?this._pageLabels=T:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let de=0,Pe=this._pages.length;de<Pe;de++){var V;this._pages[de].setPageLabel(((V=this._pageLabels)===null||V===void 0?void 0:V[de])??null)}}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=n.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,g(this,B,new Q(w)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=(0,t.createPromiseCapability)(),this._onePageRenderedCapability=(0,t.createPromiseCapability)(),this._pagesCapability=(0,t.createPromiseCapability)(),this._scrollMode=n.ScrollMode.VERTICAL,this._previousScrollMode=n.ScrollMode.UNKNOWN,this._spreadMode=n.SpreadMode.NONE,g(this,z,{previousPageNumber:1,scrollDown:!0,pages:[]}),this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),f(this,ee)&&(document.removeEventListener("visibilitychange",f(this,ee)),g(this,ee,null)),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.viewer.classList.remove(x)}_scrollUpdate(){this.pagesCount!==0&&this.update()}_setScaleUpdatePages(T,V,de){let{noScroll:Pe=!1,preset:De=!1,drawingDelay:Fe=-1}=de;if(this._currentScaleValue=V.toString(),y(this,we,be).call(this,T)){De&&this.eventBus.dispatch("scalechanging",{source:this,scale:T,presetValue:V});return}this.viewer.style.setProperty("--scale-factor",T*t.PixelsPerInch.PDF_TO_CSS_UNITS);const _e=Fe>=0&&Fe<1e3;if(this.refresh(!0,{scale:T,drawingDelay:_e?Fe:-1}),_e&&g(this,te,setTimeout(()=>{g(this,te,null),this.refresh()},Fe)),this._currentScale=T,!Pe){let Me=this._currentPageNumber,Ae;this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(Me=this._location.pageNumber,Ae=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:Me,destArray:Ae,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:T,presetValue:De?V:void 0}),this.defaultRenderingQueue&&this.update()}get _pageWidthScaleFactor(){return this._spreadMode!==n.SpreadMode.NONE&&this._scrollMode!==n.ScrollMode.HORIZONTAL?2:1}_setScale(T,V){let de=parseFloat(T);if(de>0)V.preset=!1,this._setScaleUpdatePages(de,T,V);else{const Pe=this._pages[this._currentPageNumber-1];if(!Pe)return;let De=n.SCROLLBAR_PADDING,Fe=n.VERTICAL_PADDING;this.isInPresentationMode?(De=Fe=4,this._spreadMode!==n.SpreadMode.NONE&&(De*=2)):this.removePageBorders?De=Fe=0:this._scrollMode===n.ScrollMode.HORIZONTAL&&([De,Fe]=[Fe,De]);const _e=(this.container.clientWidth-De)/Pe.width*Pe.scale/this._pageWidthScaleFactor,Me=(this.container.clientHeight-Fe)/Pe.height*Pe.scale;switch(T){case"page-actual":de=1;break;case"page-width":de=_e;break;case"page-height":de=Me;break;case"page-fit":de=Math.min(_e,Me);break;case"auto":const Ae=(0,n.isPortraitOrientation)(Pe)?_e:Math.min(Me,_e);de=Math.min(n.MAX_AUTO_SCALE,Ae);break;default:console.error(`_setScale: "${T}" is an unknown zoom value.`);return}V.preset=!0,this._setScaleUpdatePages(de,T,V)}}pageLabelToPageNumber(T){if(!this._pageLabels)return null;const V=this._pageLabels.indexOf(T);return V<0?null:V+1}scrollPageIntoView(T){let{pageNumber:V,destArray:de=null,allowNegativeOffset:Pe=!1,ignoreDestinationZoom:De=!1}=T;if(!this.pdfDocument)return;const Fe=Number.isInteger(V)&&this._pages[V-1];if(!Fe){console.error(`scrollPageIntoView: "${V}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!de){this._setCurrentPageNumber(V,!0);return}let _e=0,Me=0,Ae=0,ce=0,Ee,We;const Oe=Fe.rotation%180!==0,$e=(Oe?Fe.height:Fe.width)/Fe.scale/t.PixelsPerInch.PDF_TO_CSS_UNITS,oe=(Oe?Fe.width:Fe.height)/Fe.scale/t.PixelsPerInch.PDF_TO_CSS_UNITS;let J=0;switch(de[1].name){case"XYZ":_e=de[2],Me=de[3],J=de[4],_e=_e!==null?_e:0,Me=Me!==null?Me:oe;break;case"Fit":case"FitB":J="page-fit";break;case"FitH":case"FitBH":Me=de[2],J="page-width",Me===null&&this._location?(_e=this._location.left,Me=this._location.top):(typeof Me!="number"||Me<0)&&(Me=oe);break;case"FitV":case"FitBV":_e=de[2],Ae=$e,ce=oe,J="page-height";break;case"FitR":_e=de[2],Me=de[3],Ae=de[4]-_e,ce=de[5]-Me;let Be=n.SCROLLBAR_PADDING,Ne=n.VERTICAL_PADDING;this.removePageBorders&&(Be=Ne=0),Ee=(this.container.clientWidth-Be)/Ae/t.PixelsPerInch.PDF_TO_CSS_UNITS,We=(this.container.clientHeight-Ne)/ce/t.PixelsPerInch.PDF_TO_CSS_UNITS,J=Math.min(Math.abs(Ee),Math.abs(We));break;default:console.error(`scrollPageIntoView: "${de[1].name}" is not a valid destination type.`);return}if(De||(J&&J!==this._currentScale?this.currentScaleValue=J:this._currentScale===n.UNKNOWN_SCALE&&(this.currentScaleValue=n.DEFAULT_SCALE_VALUE)),J==="page-fit"&&!de[4]){y(this,me,he).call(this,Fe);return}const pe=[Fe.viewport.convertToViewportPoint(_e,Me),Fe.viewport.convertToViewportPoint(_e+Ae,Me+ce)];let ke=Math.min(pe[0][0],pe[1][0]),Re=Math.min(pe[0][1],pe[1][1]);Pe||(ke=Math.max(ke,0),Re=Math.max(Re,0)),y(this,me,he).call(this,Fe,{left:ke,top:Re})}_updateLocation(T){const V=this._currentScale,de=this._currentScaleValue,Pe=parseFloat(de)===V?Math.round(V*1e4)/100:de,De=T.id,Fe=this._pages[De-1],_e=this.container,Me=Fe.getPagePoint(_e.scrollLeft-T.x,_e.scrollTop-T.y),Ae=Math.round(Me[0]),ce=Math.round(Me[1]);let Ee=`#page=${De}`;this.isInPresentationMode||(Ee+=`&zoom=${Pe},${Ae},${ce}`),this._location={pageNumber:De,scale:Pe,top:ce,left:Ae,rotation:this._pagesRotation,pdfOpenParams:Ee}}update(){const T=this._getVisiblePages(),V=T.views,de=V.length;if(de===0)return;const Pe=Math.max(w,2*de+1);f(this,B).resize(Pe,T.ids),this.renderingQueue.renderHighestPriority(T);const De=this._spreadMode===n.SpreadMode.NONE&&(this._scrollMode===n.ScrollMode.PAGE||this._scrollMode===n.ScrollMode.VERTICAL),Fe=this._currentPageNumber;let _e=!1;for(const Me of V){if(Me.percent<100)break;if(Me.id===Fe&&De){_e=!0;break}}this._setCurrentPageNumber(_e?Fe:V[0].id),this._updateLocation(T.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(T){return this.container.contains(T)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===n.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===n.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const T=this._scrollMode===n.ScrollMode.PAGE?f(this,z).pages:this._pages,V=this._scrollMode===n.ScrollMode.HORIZONTAL,de=V&&this._isContainerRtl;return(0,n.getVisibleElements)({scrollEl:this.container,views:T,sortByVisibility:!0,horizontal:V,rtl:de})}isPageVisible(T){return this.pdfDocument?Number.isInteger(T)&&T>0&&T<=this.pagesCount?this._getVisiblePages().ids.has(T):(console.error(`isPageVisible: "${T}" is not a valid page.`),!1):!1}isPageCached(T){if(!this.pdfDocument)return!1;if(!(Number.isInteger(T)&&T>0&&T<=this.pagesCount))return console.error(`isPageCached: "${T}" is not a valid page.`),!1;const V=this._pages[T-1];return f(this,B).has(V)}cleanup(){for(const T of this._pages)T.renderingState!==n.RenderingStates.FINISHED&&T.reset()}_cancelRendering(){for(const T of this._pages)T.cancelRendering()}forceRendering(T){const V=T||this._getVisiblePages(),de=y(this,O,Ie).call(this,V),Pe=this._spreadMode!==n.SpreadMode.NONE&&this._scrollMode!==n.ScrollMode.HORIZONTAL,De=this.renderingQueue.getHighestPriority(V,this._pages,de,Pe);return De?(y(this,A,Te).call(this,De).then(()=>{this.renderingQueue.renderView(De)}),!0):!1}get hasEqualPageSizes(){const T=this._pages[0];for(let V=1,de=this._pages.length;V<de;++V){const Pe=this._pages[V];if(Pe.width!==T.width||Pe.height!==T.height)return!1}return!0}getPagesOverview(){return this._pages.map(T=>{const V=T.pdfPage.getViewport({scale:1});return!this.enablePrintAutoRotate||(0,n.isPortraitOrientation)(V)?{width:V.width,height:V.height,rotation:V.rotation}:{width:V.height,height:V.width,rotation:(V.rotation-90)%360}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(T){if(!(T instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${T}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=T,this.refresh(!1,{optionalContentConfigPromise:T}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:T}))}get scrollMode(){return this._scrollMode}set scrollMode(T){if(this._scrollMode!==T){if(!(0,n.isValidScrollMode)(T))throw new Error(`Invalid scroll mode: ${T}`);this.pagesCount>F.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=T,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:T}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const V=this._scrollMode,de=this.viewer;de.classList.toggle("scrollHorizontal",V===n.ScrollMode.HORIZONTAL),de.classList.toggle("scrollWrapped",V===n.ScrollMode.WRAPPED),!(!this.pdfDocument||!T)&&(V===n.ScrollMode.PAGE?y(this,ye,ve).call(this):this._previousScrollMode===n.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(T,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(T){if(this._spreadMode!==T){if(!(0,n.isValidSpreadMode)(T))throw new Error(`Invalid spread mode: ${T}`);this._spreadMode=T,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:T}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(!this.pdfDocument)return;const V=this.viewer,de=this._pages;if(this._scrollMode===n.ScrollMode.PAGE)y(this,ye,ve).call(this);else if(V.textContent="",this._spreadMode===n.SpreadMode.NONE)for(const Pe of this._pages)V.append(Pe.div);else{const Pe=this._spreadMode-1;let De=null;for(let Fe=0,_e=de.length;Fe<_e;++Fe)De===null?(De=document.createElement("div"),De.className="spread",V.append(De)):Fe%2===Pe&&(De=De.cloneNode(!1),V.append(De)),De.append(de[Fe].div)}T&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(T,!0),this.update())}_getPageAdvance(T){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;switch(this._scrollMode){case n.ScrollMode.WRAPPED:{const{views:de}=this._getVisiblePages(),Pe=new Map;for(const{id:De,y:Fe,percent:_e,widthPercent:Me}of de){if(_e===0||Me<100)continue;let Ae=Pe.get(Fe);Ae||Pe.set(Fe,Ae||(Ae=[])),Ae.push(De)}for(const De of Pe.values()){const Fe=De.indexOf(T);if(Fe===-1)continue;const _e=De.length;if(_e===1)break;if(V)for(let Me=Fe-1,Ae=0;Me>=Ae;Me--){const ce=De[Me],Ee=De[Me+1]-1;if(ce<Ee)return T-Ee}else for(let Me=Fe+1,Ae=_e;Me<Ae;Me++){const ce=De[Me],Ee=De[Me-1]+1;if(ce>Ee)return Ee-T}if(V){const Me=De[0];if(Me<T)return T-Me+1}else{const Me=De[_e-1];if(Me>T)return Me-T+1}break}break}case n.ScrollMode.HORIZONTAL:break;case n.ScrollMode.PAGE:case n.ScrollMode.VERTICAL:{if(this._spreadMode===n.SpreadMode.NONE)break;const de=this._spreadMode-1;if(V&&T%2!==de)break;if(!V&&T%2===de)break;const{views:Pe}=this._getVisiblePages(),De=V?T-1:T+1;for(const{id:Fe,percent:_e,widthPercent:Me}of Pe)if(Fe===De){if(_e>0&&Me===100)return 2;break}break}}return 1}nextPage(){const T=this._currentPageNumber,V=this.pagesCount;if(T>=V)return!1;const de=this._getPageAdvance(T,!1)||1;return this.currentPageNumber=Math.min(T+de,V),!0}previousPage(){const T=this._currentPageNumber;if(T<=1)return!1;const V=this._getPageAdvance(T,!0)||1;return this.currentPageNumber=Math.max(T-V,1),!0}increaseScale(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(typeof T=="number"&&(console.error("The `increaseScale` method-signature was updated, please use an object instead."),T={steps:T}),!this.pdfDocument)return;T||(T=Object.create(null));let V=this._currentScale;if(T.scaleFactor>1)V=Math.min(n.MAX_SCALE,Math.round(V*T.scaleFactor*100)/100);else{let de=T.steps??1;do V=(V*n.DEFAULT_SCALE_DELTA).toFixed(2),V=Math.ceil(V*10)/10,V=Math.min(n.MAX_SCALE,V);while(--de>0&&V<n.MAX_SCALE)}T.noScroll=!1,this._setScale(V,T)}decreaseScale(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(typeof T=="number"&&(console.error("The `decreaseScale` method-signature was updated, please use an object instead."),T={steps:T}),!this.pdfDocument)return;T||(T=Object.create(null));let V=this._currentScale;if(T.scaleFactor>0&&T.scaleFactor<1)V=Math.max(n.MIN_SCALE,Math.round(V*T.scaleFactor*100)/100);else{let de=T.steps??1;do V=(V/n.DEFAULT_SCALE_DELTA).toFixed(2),V=Math.floor(V*10)/10,V=Math.max(n.MIN_SCALE,V);while(--de>0&&V>n.MIN_SCALE)}T.noScroll=!1,this._setScale(V,T)}get containerTopLeft(){return f(this,H)||g(this,H,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return f(this,q)?f(this,ie):t.AnnotationEditorType.DISABLE}set annotationEditorMode(T){if(!f(this,q))throw new Error("The AnnotationEditor is not enabled.");if(f(this,ie)!==T){if(!X(T))throw new Error(`Invalid AnnotationEditor mode: ${T}`);this.pdfDocument&&(g(this,ie,T),this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:T}),f(this,q).updateMode(T))}}set annotationEditorParams(T){let{type:V,value:de}=T;if(!f(this,q))throw new Error("The AnnotationEditor is not enabled.");f(this,q).updateParams(V,de)}refresh(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null);if(this.pdfDocument){for(const de of this._pages)de.update(V);f(this,te)!==null&&(clearTimeout(f(this,te)),g(this,te,null)),T||this.update()}}}m.PDFViewer=Z;function se(){const ae=this;return{get annotationEditorUIManager(){return f(ae,q)},get annotationStorage(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.annotationStorage},get downloadManager(){return ae.downloadManager},get enableScripting(){return!!ae._scriptingManager},get fieldObjectsPromise(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.getFieldObjects()},get findController(){return ae.findController},get hasJSActionsPromise(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.hasJSActions()},get linkService(){return ae.linkService}}}function ne(ae){const T={annotationEditorMode:f(this,ie),annotationMode:f(this,_),textLayerMode:this.textLayerMode};return ae&&(ae.includes(t.PermissionFlag.COPY)||this.viewer.classList.add(x),ae.includes(t.PermissionFlag.MODIFY_CONTENTS)||(T.annotationEditorMode=t.AnnotationEditorType.DISABLE),!ae.includes(t.PermissionFlag.MODIFY_ANNOTATIONS)&&!ae.includes(t.PermissionFlag.FILL_INTERACTIVE_FORMS)&&f(this,_)===t.AnnotationMode.ENABLE_FORMS&&(T.annotationMode=t.AnnotationMode.ENABLE)),T}function re(){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return Promise.resolve();const ae=new Promise(T=>{g(this,ee,()=>{document.visibilityState==="hidden"&&(T(),document.removeEventListener("visibilitychange",f(this,ee)),g(this,ee,null))}),document.addEventListener("visibilitychange",f(this,ee))});return Promise.race([this._onePageRenderedCapability.promise,ae])}function ve(){if(this._scrollMode!==n.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const ae=this._currentPageNumber,T=f(this,z),V=this.viewer;if(V.textContent="",T.pages.length=0,this._spreadMode===n.SpreadMode.NONE&&!this.isInPresentationMode){const de=this._pages[ae-1];V.append(de.div),T.pages.push(de)}else{const de=new Set,Pe=this._spreadMode-1;Pe===-1?de.add(ae-1):ae%2!==Pe?(de.add(ae-1),de.add(ae)):(de.add(ae-2),de.add(ae-1));const De=document.createElement("div");if(De.className="spread",this.isInPresentationMode){const Fe=document.createElement("div");Fe.className="dummyPage",De.append(Fe)}for(const Fe of de){const _e=this._pages[Fe];_e&&(De.append(_e.div),T.pages.push(_e))}V.append(De)}T.scrollDown=ae>=T.previousPageNumber,T.previousPageNumber=ae}function he(ae){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const{div:V,id:de}=ae;if(this._currentPageNumber!==de&&this._setCurrentPageNumber(de),this._scrollMode===n.ScrollMode.PAGE&&(y(this,ye,ve).call(this),this.update()),!T&&!this.isInPresentationMode){const Pe=V.offsetLeft+V.clientLeft,De=Pe+V.clientWidth,{scrollLeft:Fe,clientWidth:_e}=this.container;(this._scrollMode===n.ScrollMode.HORIZONTAL||Pe<Fe||De>Fe+_e)&&(T={left:0,top:0})}(0,n.scrollIntoView)(V,T),!this._currentScaleValue&&this._location&&(this._location=null)}function be(ae){return ae===this._currentScale||Math.abs(ae-this._currentScale)<1e-15}function Ce(){const ae=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this._setScale(this._currentScaleValue,{noScroll:!0}),y(this,me,he).call(this,ae)}async function Te(ae){if(ae.pdfPage)return ae.pdfPage;try{var T,V;const de=await this.pdfDocument.getPage(ae.id);return ae.pdfPage||ae.setPdfPage(de),(T=(V=this.linkService)._cachedPageNumber)!==null&&T!==void 0&&T.call(V,de.ref)||this.linkService.cachePageRef(ae.id,de.ref),de}catch(de){return console.error("Unable to get page for page view",de),null}}function Ie(ae){var T,V;if(((T=ae.first)===null||T===void 0?void 0:T.id)===1)return!0;if(((V=ae.last)===null||V===void 0?void 0:V.id)===this.pagesCount)return!1;switch(this._scrollMode){case n.ScrollMode.PAGE:return f(this,z).scrollDown;case n.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}function He(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.container.clientHeight;ae!==f(this,C)&&(g(this,C,ae),n.docStyle.setProperty("--viewer-container-height",`${ae}px`))}function Ve(ae){for(const T of ae)if(T.target===this.container){y(this,M,He).call(this,Math.floor(T.borderBoxSize[0].blockSize)),g(this,H,null);break}}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFRenderingQueue=void 0;var t=R(4),n=R(2);const h=3e4;class a{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(r){this.pdfViewer=r}setThumbnailViewer(r){this.pdfThumbnailViewer=r}isHighestPriority(r){return this.highestPriorityPage===r.renderingId}hasViewer(){return!!this.pdfViewer}renderHighestPriority(r){var i;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(r)&&(this.isThumbnailViewEnabled&&(i=this.pdfThumbnailViewer)!==null&&i!==void 0&&i.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),h)))}getHighestPriority(r,i,o){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const b=r.views,y=b.length;if(y===0)return null;for(let D=0;D<y;D++){const w=b[D].view;if(!this.isViewFinished(w))return w}const f=r.first.id,s=r.last.id;if(s-f+1>y){const D=r.ids;for(let w=1,x=s-f;w<x;w++){const F=o?f+w:s-w;if(D.has(F))continue;const X=i[F-1];if(!this.isViewFinished(X))return X}}let g=o?s:f-2,S=i[g];return S&&!this.isViewFinished(S)||c&&(g+=o?1:-1,S=i[g],S&&!this.isViewFinished(S))?S:null}isViewFinished(r){return r.renderingState===n.RenderingStates.FINISHED}renderView(r){switch(r.renderingState){case n.RenderingStates.FINISHED:return!1;case n.RenderingStates.PAUSED:this.highestPriorityPage=r.renderingId,r.resume();break;case n.RenderingStates.RUNNING:this.highestPriorityPage=r.renderingId;break;case n.RenderingStates.INITIAL:this.highestPriorityPage=r.renderingId,r.draw().finally(()=>{this.renderHighestPriority()}).catch(i=>{i instanceof t.RenderingCancelledException||console.error(`renderView: "${i}"`)});break}return!0}}m.PDFRenderingQueue=a}],p={};function v(k){var m=p[k];if(m!==void 0)return m.exports;var R=p[k]={exports:{}};return l[k](R,R.exports,v),R.exports}var I={};return(()=>{var k=I;Object.defineProperty(k,"__esModule",{value:!0}),Object.defineProperty(k,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return t.AnnotationLayerBuilder}}),k.DefaultXfaLayerFactory=k.DefaultTextLayerFactory=k.DefaultStructTreeLayerFactory=k.DefaultAnnotationLayerFactory=void 0,Object.defineProperty(k,"DownloadManager",{enumerable:!0,get:function(){return n.DownloadManager}}),Object.defineProperty(k,"EventBus",{enumerable:!0,get:function(){return h.EventBus}}),Object.defineProperty(k,"GenericL10n",{enumerable:!0,get:function(){return a.GenericL10n}}),Object.defineProperty(k,"LinkTarget",{enumerable:!0,get:function(){return m.LinkTarget}}),Object.defineProperty(k,"NullL10n",{enumerable:!0,get:function(){return d.NullL10n}}),Object.defineProperty(k,"PDFFindController",{enumerable:!0,get:function(){return r.PDFFindController}}),Object.defineProperty(k,"PDFHistory",{enumerable:!0,get:function(){return i.PDFHistory}}),Object.defineProperty(k,"PDFLinkService",{enumerable:!0,get:function(){return m.PDFLinkService}}),Object.defineProperty(k,"PDFPageView",{enumerable:!0,get:function(){return o.PDFPageView}}),Object.defineProperty(k,"PDFScriptingManager",{enumerable:!0,get:function(){return c.PDFScriptingManager}}),Object.defineProperty(k,"PDFSinglePageViewer",{enumerable:!0,get:function(){return b.PDFSinglePageViewer}}),Object.defineProperty(k,"PDFViewer",{enumerable:!0,get:function(){return y.PDFViewer}}),Object.defineProperty(k,"ProgressBar",{enumerable:!0,get:function(){return R.ProgressBar}}),Object.defineProperty(k,"RenderingStates",{enumerable:!0,get:function(){return R.RenderingStates}}),Object.defineProperty(k,"ScrollMode",{enumerable:!0,get:function(){return R.ScrollMode}}),Object.defineProperty(k,"SimpleLinkService",{enumerable:!0,get:function(){return m.SimpleLinkService}}),Object.defineProperty(k,"SpreadMode",{enumerable:!0,get:function(){return R.SpreadMode}}),Object.defineProperty(k,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return f.StructTreeLayerBuilder}}),Object.defineProperty(k,"TextLayerBuilder",{enumerable:!0,get:function(){return s.TextLayerBuilder}}),Object.defineProperty(k,"XfaLayerBuilder",{enumerable:!0,get:function(){return g.XfaLayerBuilder}}),Object.defineProperty(k,"parseQueryString",{enumerable:!0,get:function(){return R.parseQueryString}});var m=v(1),R=v(2),t=v(3),n=v(6),h=v(7),a=v(8),d=v(5),r=v(10),i=v(12),o=v(13),c=v(21),b=v(23),y=v(24),f=v(16),s=v(19),g=v(20);class S{constructor(){throw new Error("The `DefaultAnnotationLayerFactory` has been removed, please use the `annotationMode` option when initializing the `PDFPageView`-instance to control AnnotationLayer rendering.")}}k.DefaultAnnotationLayerFactory=S;class D{constructor(){throw new Error("The `DefaultStructTreeLayerFactory` has been removed, this functionality is automatically enabled when the TextLayer is used.")}}k.DefaultStructTreeLayerFactory=D;class w{constructor(){throw new Error("The `DefaultTextLayerFactory` has been removed, please use the `textLayerMode` option when initializing the `PDFPageView`-instance to control TextLayer rendering.")}}k.DefaultTextLayerFactory=w;class x{constructor(){throw new Error("The `DefaultXfaLayerFactory` has been removed, please use the `enableXfa` option when calling the `getDocument`-function to control XfaLayer rendering.")}}k.DefaultXfaLayerFactory=x})(),I})())})(pdf_viewer);const pdf="",PDFWorker={create(){return refWorker("pdf.worker.js").defaults(()=>new Worker(new URL(""+new URL("pdf.worker-909112bf.js",import.meta.url).href,self.location),{type:"module"}))}},_withScopeId=W=>(pushScopeId("data-v-9bad3887"),W=W(),popScopeId(),W),_hoisted_1={class:"container"},_hoisted_2={class:"pdf_down"},_hoisted_3=_withScopeId(()=>createBaseVNode("div",{id:"viewer",class:"pdfViewer"},null,-1)),_hoisted_4=[_hoisted_3],_sfc_main=defineComponent({__name:"PdfView",props:{data:null},setup(W){const E=W,l=ref(null),p={viewer:null,search:"",pdf_scale:1};!pdfExports.GlobalWorkerOptions.workerPort&&typeof window<"u"&&"Worker"in window&&(pdfExports.GlobalWorkerOptions.workerPort=PDFWorker.create()),(()=>{async function k(){if(!l.value)return;const m=new pdf_viewerExports.EventBus,R=new pdf_viewerExports.PDFLinkService({eventBus:m}),t=new pdf_viewerExports.PDFFindController({eventBus:m,linkService:R,updateMatchesCountOnProgress:!0}),n=new pdf_viewerExports.PDFViewer({container:l.value,eventBus:m,linkService:R,findController:t,l10n:new pdf_viewerExports.GenericL10n("zh-CN")});R.setViewer(n),m.on("pagesinit",()=>{var r;const d=(r=n.getPageView(0))==null?void 0:r.viewport;(d==null?void 0:d.width)>window.innerWidth?n.currentScaleValue="0.5":n.currentScaleValue="1"});const a=await pdfExports.getDocument({data:E.data,cMapUrl:`https://npm.onmicrosoft.cn/pdfjs-dist@${pdfExports.version}/cmaps/`,useWorkerFetch:!0,cMapPacked:!0,enableXfa:!0}).promise;n.setDocument(a),R.setDocument(a,null),p.viewer=n}onMounted(k)})();function v(){if(!p.viewer)return;const k=p.viewer.currentScale;let m=0;window.screen.width>1440?m=1.4:m=1.2,!(k>=m)&&(p.viewer.currentScale=k+.1)}function I(){if(!p.viewer)return;const k=p.viewer.currentScale;k<=.5||(p.viewer.currentScale=k-.1)}return(k,m)=>(openBlock(),createElementBlock("div",_hoisted_1,[createBaseVNode("div",_hoisted_2,[createBaseVNode("div",{class:"pdf_set_left",onClick:m[0]||(m[0]=R=>v())},""),createBaseVNode("div",{class:"pdf_set_middle",onClick:m[1]||(m[1]=R=>I())},"")]),createBaseVNode("div",{ref_key:"container",ref:l,class:"pdf-wrapper"},_hoisted_4,512)]))}}),PdfView_vue_vue_type_style_index_0_scoped_9bad3887_lang="",PdfView=_export_sfc(_sfc_main,[["__scopeId","data-v-9bad3887"]]);export{PdfView as default};