diff --git a/asset-manifest.json b/asset-manifest.json index cc369e8..f15a649 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,24 +1,24 @@ { "files": { - "main.css": "/EgzaminyZawodoweINF/static/css/main.16c2af67.css", - "main.js": "/EgzaminyZawodoweINF/static/js/main.d7bf75f9.js", - "static/js/453.5b6c109b.chunk.js": "/EgzaminyZawodoweINF/static/js/453.5b6c109b.chunk.js", - "static/media/egz1.jpg": "/EgzaminyZawodoweINF/static/media/egz1.9ba0183330fc2d77497a.jpg", - "static/media/egz2.jpg": "/EgzaminyZawodoweINF/static/media/egz2.cbc94405d8ec34608d22.jpg", - "static/media/materialhomehtml.png": "/EgzaminyZawodoweINF/static/media/materialhomehtml.450e4bae7c0877ae99ac.png", - "static/media/materialhome.png": "/EgzaminyZawodoweINF/static/media/materialhome.2c5a437177b3617f8ddf.png", - "static/media/materialhomephp.png": "/EgzaminyZawodoweINF/static/media/materialhomephp.d71b0a76124a62912997.png", - "static/media/materialhomejs.png": "/EgzaminyZawodoweINF/static/media/materialhomejs.271d52829124c2e39f5e.png", - "static/media/logo.png": "/EgzaminyZawodoweINF/static/media/logo.912b09f45a2be369a42b.png", - "static/media/php.svg": "/EgzaminyZawodoweINF/static/media/php.099cd051f27e93830fcdb7b1ac05bc40.svg", - "static/media/js.svg": "/EgzaminyZawodoweINF/static/media/js.fef7215d0d3e578f01ad70419d4c4308.svg", - "index.html": "/EgzaminyZawodoweINF/index.html", - "main.16c2af67.css.map": "/EgzaminyZawodoweINF/static/css/main.16c2af67.css.map", - "main.d7bf75f9.js.map": "/EgzaminyZawodoweINF/static/js/main.d7bf75f9.js.map", - "453.5b6c109b.chunk.js.map": "/EgzaminyZawodoweINF/static/js/453.5b6c109b.chunk.js.map" + "main.css": "/static/css/main.16c2af67.css", + "main.js": "/static/js/main.edc679b0.js", + "static/js/453.5b6c109b.chunk.js": "/static/js/453.5b6c109b.chunk.js", + "static/media/egz1.jpg": "/static/media/egz1.9ba0183330fc2d77497a.jpg", + "static/media/egz2.jpg": "/static/media/egz2.cbc94405d8ec34608d22.jpg", + "static/media/materialhomehtml.png": "/static/media/materialhomehtml.450e4bae7c0877ae99ac.png", + "static/media/materialhome.png": "/static/media/materialhome.2c5a437177b3617f8ddf.png", + "static/media/materialhomephp.png": "/static/media/materialhomephp.d71b0a76124a62912997.png", + "static/media/materialhomejs.png": "/static/media/materialhomejs.271d52829124c2e39f5e.png", + "static/media/logo.png": "/static/media/logo.912b09f45a2be369a42b.png", + "static/media/php.svg": "/static/media/php.099cd051f27e93830fcdb7b1ac05bc40.svg", + "static/media/js.svg": "/static/media/js.fef7215d0d3e578f01ad70419d4c4308.svg", + "index.html": "/index.html", + "main.16c2af67.css.map": "/static/css/main.16c2af67.css.map", + "main.edc679b0.js.map": "/static/js/main.edc679b0.js.map", + "453.5b6c109b.chunk.js.map": "/static/js/453.5b6c109b.chunk.js.map" }, "entrypoints": [ "static/css/main.16c2af67.css", - "static/js/main.d7bf75f9.js" + "static/js/main.edc679b0.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 7696da6..cd58821 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -EgzaminyZawodoweINF
\ No newline at end of file +EgzaminyZawodoweINF
\ No newline at end of file diff --git a/static/js/main.d7bf75f9.js b/static/js/main.edc679b0.js similarity index 74% rename from static/js/main.d7bf75f9.js rename to static/js/main.edc679b0.js index 7cc4854..0d30bad 100644 --- a/static/js/main.d7bf75f9.js +++ b/static/js/main.edc679b0.js @@ -1,3 +1,3 @@ -/*! For license information please see main.d7bf75f9.js.LICENSE.txt */ -(()=>{var __webpack_modules__={1738:(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>T,afterRead:()=>b,afterWrite:()=>A,applyStyles:()=>D,arrow:()=>Z,auto:()=>o,basePlacements:()=>l,beforeMain:()=>S,beforeRead:()=>f,beforeWrite:()=>y,bottom:()=>r,clippingParents:()=>u,computeStyles:()=>ne,createPopper:()=>ke,createPopperBase:()=>De,createPopperLite:()=>Pe,detectOverflow:()=>Ee,end:()=>d,eventListeners:()=>re,flip:()=>be,hide:()=>Te,left:()=>s,main:()=>v,modifierPhases:()=>N,offset:()=>ye,placements:()=>g,popper:()=>_,popperGenerator:()=>xe,popperOffsets:()=>Ce,preventOverflow:()=>Ae,read:()=>E,reference:()=>m,right:()=>i,start:()=>c,top:()=>a,variationPlacements:()=>h,viewport:()=>p,write:()=>C});var a="top",r="bottom",i="right",s="left",o="auto",l=[a,r,i,s],c="start",d="end",u="clippingParents",p="viewport",_="popper",m="reference",h=l.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+d])}),[]),g=[].concat(l,[o]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+d])}),[]),f="beforeRead",E="read",b="afterRead",S="beforeMain",v="main",T="afterMain",y="beforeWrite",C="write",A="afterWrite",N=[f,E,b,S,v,T,y,C,A];function R(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof O(e).Element||e instanceof Element}function w(e){return e instanceof O(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!==typeof ShadowRoot&&(e instanceof O(e).ShadowRoot||e instanceof ShadowRoot)}const D={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},a=t.attributes[e]||{},r=t.elements[e];w(r)&&R(r)&&(Object.assign(r.style,n),Object.keys(a).forEach((function(e){var t=a[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var a=t.elements[e],r=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});w(a)&&R(a)&&(Object.assign(a.style,i),Object.keys(r).forEach((function(e){a.removeAttribute(e)})))}))}},requires:["computeStyles"]};function k(e){return e.split("-")[0]}var P=Math.max,M=Math.min,L=Math.round;function F(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(F())}function U(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var a=e.getBoundingClientRect(),r=1,i=1;t&&w(e)&&(r=e.offsetWidth>0&&L(a.width)/e.offsetWidth||1,i=e.offsetHeight>0&&L(a.height)/e.offsetHeight||1);var s=(I(e)?O(e):window).visualViewport,o=!B()&&n,l=(a.left+(o&&s?s.offsetLeft:0))/r,c=(a.top+(o&&s?s.offsetTop:0))/i,d=a.width/r,u=a.height/i;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function G(e){var t=U(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function z(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&x(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function H(e){return O(e).getComputedStyle(e)}function Y(e){return["table","td","th"].indexOf(R(e))>=0}function j(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function V(e){return"html"===R(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||j(e)}function q(e){return w(e)&&"fixed"!==H(e).position?e.offsetParent:null}function W(e){for(var t=O(e),n=q(e);n&&Y(n)&&"static"===H(n).position;)n=q(n);return n&&("html"===R(n)||"body"===R(n)&&"static"===H(n).position)?t:n||function(e){var t=/firefox/i.test(F());if(/Trident/i.test(F())&&w(e)&&"fixed"===H(e).position)return null;var n=V(e);for(x(n)&&(n=n.host);w(n)&&["html","body"].indexOf(R(n))<0;){var a=H(n);if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||t&&"filter"===a.willChange||t&&a.filter&&"none"!==a.filter)return n;n=n.parentNode}return null}(e)||t}function K(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Q(e,t,n){return P(e,M(t,n))}function $(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Z={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,c=e.options,d=n.elements.arrow,u=n.modifiersData.popperOffsets,p=k(n.placement),_=K(p),m=[s,i].indexOf(p)>=0?"height":"width";if(d&&u){var h=function(e,t){return $("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,l))}(c.padding,n),g=G(d),f="y"===_?a:s,E="y"===_?r:i,b=n.rects.reference[m]+n.rects.reference[_]-u[_]-n.rects.popper[m],S=u[_]-n.rects.reference[_],v=W(d),T=v?"y"===_?v.clientHeight||0:v.clientWidth||0:0,y=b/2-S/2,C=h[f],A=T-g[m]-h[E],N=T/2-g[m]/2+y,R=Q(C,N,A),O=_;n.modifiersData[o]=((t={})[O]=R,t.centerOffset=R-N,t)}},effect:function(e){var t=e.state,n=e.options.element,a=void 0===n?"[data-popper-arrow]":n;null!=a&&("string"!==typeof a||(a=t.elements.popper.querySelector(a)))&&z(t.elements.popper,a)&&(t.elements.arrow=a)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function J(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,o=e.popperRect,l=e.placement,c=e.variation,u=e.offsets,p=e.position,_=e.gpuAcceleration,m=e.adaptive,h=e.roundOffsets,g=e.isFixed,f=u.x,E=void 0===f?0:f,b=u.y,S=void 0===b?0:b,v="function"===typeof h?h({x:E,y:S}):{x:E,y:S};E=v.x,S=v.y;var T=u.hasOwnProperty("x"),y=u.hasOwnProperty("y"),C=s,A=a,N=window;if(m){var R=W(n),I="clientHeight",w="clientWidth";if(R===O(n)&&"static"!==H(R=j(n)).position&&"absolute"===p&&(I="scrollHeight",w="scrollWidth"),l===a||(l===s||l===i)&&c===d)A=r,S-=(g&&R===N&&N.visualViewport?N.visualViewport.height:R[I])-o.height,S*=_?1:-1;if(l===s||(l===a||l===r)&&c===d)C=i,E-=(g&&R===N&&N.visualViewport?N.visualViewport.width:R[w])-o.width,E*=_?1:-1}var x,D=Object.assign({position:p},m&&ee),k=!0===h?function(e,t){var n=e.x,a=e.y,r=t.devicePixelRatio||1;return{x:L(n*r)/r||0,y:L(a*r)/r||0}}({x:E,y:S},O(n)):{x:E,y:S};return E=k.x,S=k.y,_?Object.assign({},D,((x={})[A]=y?"0":"",x[C]=T?"0":"",x.transform=(N.devicePixelRatio||1)<=1?"translate("+E+"px, "+S+"px)":"translate3d("+E+"px, "+S+"px, 0)",x)):Object.assign({},D,((t={})[A]=y?S+"px":"",t[C]=T?E+"px":"",t.transform="",t))}const ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=void 0===a||a,i=n.adaptive,s=void 0===i||i,o=n.roundOffsets,l=void 0===o||o,c={placement:k(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ae={passive:!0};const re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=void 0===r||r,s=a.resize,o=void 0===s||s,l=O(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,ae)})),o&&l.addEventListener("resize",n.update,ae),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ae)})),o&&l.removeEventListener("resize",n.update,ae)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var oe={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function ce(e){var t=O(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function de(e){return U(j(e)).left+ce(e).scrollLeft}function ue(e){var t=H(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function pe(e){return["html","body","#document"].indexOf(R(e))>=0?e.ownerDocument.body:w(e)&&ue(e)?e:pe(V(e))}function _e(e,t){var n;void 0===t&&(t=[]);var a=pe(e),r=a===(null==(n=e.ownerDocument)?void 0:n.body),i=O(a),s=r?[i].concat(i.visualViewport||[],ue(a)?a:[]):a,o=t.concat(s);return r?o:o.concat(_e(V(s)))}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function he(e,t,n){return t===p?me(function(e,t){var n=O(e),a=j(e),r=n.visualViewport,i=a.clientWidth,s=a.clientHeight,o=0,l=0;if(r){i=r.width,s=r.height;var c=B();(c||!c&&"fixed"===t)&&(o=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:o+de(e),y:l}}(e,n)):I(t)?function(e,t){var n=U(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):me(function(e){var t,n=j(e),a=ce(e),r=null==(t=e.ownerDocument)?void 0:t.body,i=P(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=P(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-a.scrollLeft+de(e),l=-a.scrollTop;return"rtl"===H(r||n).direction&&(o+=P(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:s,x:o,y:l}}(j(e)))}function ge(e,t,n,a){var r="clippingParents"===t?function(e){var t=_e(V(e)),n=["absolute","fixed"].indexOf(H(e).position)>=0&&w(e)?W(e):e;return I(n)?t.filter((function(e){return I(e)&&z(e,n)&&"body"!==R(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),s=i[0],o=i.reduce((function(t,n){var r=he(e,n,a);return t.top=P(r.top,t.top),t.right=M(r.right,t.right),t.bottom=M(r.bottom,t.bottom),t.left=P(r.left,t.left),t}),he(e,s,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function fe(e){var t,n=e.reference,o=e.element,l=e.placement,u=l?k(l):null,p=l?J(l):null,_=n.x+n.width/2-o.width/2,m=n.y+n.height/2-o.height/2;switch(u){case a:t={x:_,y:n.y-o.height};break;case r:t={x:_,y:n.y+n.height};break;case i:t={x:n.x+n.width,y:m};break;case s:t={x:n.x-o.width,y:m};break;default:t={x:n.x,y:n.y}}var h=u?K(u):null;if(null!=h){var g="y"===h?"height":"width";switch(p){case c:t[h]=t[h]-(n[g]/2-o[g]/2);break;case d:t[h]=t[h]+(n[g]/2-o[g]/2)}}return t}function Ee(e,t){void 0===t&&(t={});var n=t,s=n.placement,o=void 0===s?e.placement:s,c=n.strategy,d=void 0===c?e.strategy:c,h=n.boundary,g=void 0===h?u:h,f=n.rootBoundary,E=void 0===f?p:f,b=n.elementContext,S=void 0===b?_:b,v=n.altBoundary,T=void 0!==v&&v,y=n.padding,C=void 0===y?0:y,A=$("number"!==typeof C?C:X(C,l)),N=S===_?m:_,R=e.rects.popper,O=e.elements[T?N:S],w=ge(I(O)?O:O.contextElement||j(e.elements.popper),g,E,d),x=U(e.elements.reference),D=fe({reference:x,element:R,strategy:"absolute",placement:o}),k=me(Object.assign({},R,D)),P=S===_?k:x,M={top:w.top-P.top+A.top,bottom:P.bottom-w.bottom+A.bottom,left:w.left-P.left+A.left,right:P.right-w.right+A.right},L=e.modifiersData.offset;if(S===_&&L){var F=L[o];Object.keys(M).forEach((function(e){var t=[i,r].indexOf(e)>=0?1:-1,n=[a,r].indexOf(e)>=0?"y":"x";M[e]+=F[n]*t}))}return M}const be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,d=e.name;if(!t.modifiersData[d]._skip){for(var u=n.mainAxis,p=void 0===u||u,_=n.altAxis,m=void 0===_||_,f=n.fallbackPlacements,E=n.padding,b=n.boundary,S=n.rootBoundary,v=n.altBoundary,T=n.flipVariations,y=void 0===T||T,C=n.allowedAutoPlacements,A=t.options.placement,N=k(A),R=f||(N===A||!y?[se(A)]:function(e){if(k(e)===o)return[];var t=se(e);return[le(e),t,le(t)]}(A)),O=[A].concat(R).reduce((function(e,n){return e.concat(k(n)===o?function(e,t){void 0===t&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,c=n.allowedAutoPlacements,d=void 0===c?g:c,u=J(a),p=u?o?h:h.filter((function(e){return J(e)===u})):l,_=p.filter((function(e){return d.indexOf(e)>=0}));0===_.length&&(_=p);var m=_.reduce((function(t,n){return t[n]=Ee(e,{placement:n,boundary:r,rootBoundary:i,padding:s})[k(n)],t}),{});return Object.keys(m).sort((function(e,t){return m[e]-m[t]}))}(t,{placement:n,boundary:b,rootBoundary:S,padding:E,flipVariations:y,allowedAutoPlacements:C}):n)}),[]),I=t.rects.reference,w=t.rects.popper,x=new Map,D=!0,P=O[0],M=0;M=0,G=U?"width":"height",z=Ee(t,{placement:L,boundary:b,rootBoundary:S,altBoundary:v,padding:E}),H=U?B?i:s:B?r:a;I[G]>w[G]&&(H=se(H));var Y=se(H),j=[];if(p&&j.push(z[F]<=0),m&&j.push(z[H]<=0,z[Y]<=0),j.every((function(e){return e}))){P=L,D=!1;break}x.set(L,j)}if(D)for(var V=function(e){var t=O.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return P=t,"break"},q=y?3:1;q>0;q--){if("break"===V(q))break}t.placement!==P&&(t.modifiersData[d]._skip=!0,t.placement=P,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Se(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ve(e){return[a,i,r,s].some((function(t){return e[t]>=0}))}const Te={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,s=Ee(t,{elementContext:"reference"}),o=Ee(t,{altBoundary:!0}),l=Se(s,a),c=Se(o,r,i),d=ve(l),u=ve(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};const ye={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,l=void 0===o?[0,0]:o,c=g.reduce((function(e,n){return e[n]=function(e,t,n){var r=k(e),o=[s,a].indexOf(r)>=0?-1:1,l="function"===typeof n?n(Object.assign({},t,{placement:e})):n,c=l[0],d=l[1];return c=c||0,d=(d||0)*o,[s,i].indexOf(r)>=0?{x:d,y:c}:{x:c,y:d}}(n,t.rects,l),e}),{}),d=c[t.placement],u=d.x,p=d.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}};const Ce={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=fe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Ae={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,l=n.mainAxis,d=void 0===l||l,u=n.altAxis,p=void 0!==u&&u,_=n.boundary,m=n.rootBoundary,h=n.altBoundary,g=n.padding,f=n.tether,E=void 0===f||f,b=n.tetherOffset,S=void 0===b?0:b,v=Ee(t,{boundary:_,rootBoundary:m,padding:g,altBoundary:h}),T=k(t.placement),y=J(t.placement),C=!y,A=K(T),N="x"===A?"y":"x",R=t.modifiersData.popperOffsets,O=t.rects.reference,I=t.rects.popper,w="function"===typeof S?S(Object.assign({},t.rects,{placement:t.placement})):S,x="number"===typeof w?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(R){if(d){var F,B="y"===A?a:s,U="y"===A?r:i,z="y"===A?"height":"width",H=R[A],Y=H+v[B],j=H-v[U],V=E?-I[z]/2:0,q=y===c?O[z]:I[z],$=y===c?-I[z]:-O[z],X=t.elements.arrow,Z=E&&X?G(X):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[B],ne=ee[U],ae=Q(0,O[z],Z[z]),re=C?O[z]/2-V-ae-te-x.mainAxis:q-ae-te-x.mainAxis,ie=C?-O[z]/2+V+ae+ne+x.mainAxis:$+ae+ne+x.mainAxis,se=t.elements.arrow&&W(t.elements.arrow),oe=se?"y"===A?se.clientTop||0:se.clientLeft||0:0,le=null!=(F=null==D?void 0:D[A])?F:0,ce=H+ie-le,de=Q(E?M(Y,H+re-le-oe):Y,H,E?P(j,ce):j);R[A]=de,L[A]=de-H}if(p){var ue,pe="x"===A?a:s,_e="x"===A?r:i,me=R[N],he="y"===N?"height":"width",ge=me+v[pe],fe=me-v[_e],be=-1!==[a,s].indexOf(T),Se=null!=(ue=null==D?void 0:D[N])?ue:0,ve=be?ge:me-O[he]-I[he]-Se+x.altAxis,Te=be?me+O[he]+I[he]-Se-x.altAxis:fe,ye=E&&be?function(e,t,n){var a=Q(e,t,n);return a>n?n:a}(ve,me,Te):Q(E?ve:ge,me,E?Te:fe);R[N]=ye,L[N]=ye-me}t.modifiersData[o]=L}},requiresIfExists:["offset"]};function Ne(e,t,n){void 0===n&&(n=!1);var a=w(t),r=w(t)&&function(e){var t=e.getBoundingClientRect(),n=L(t.width)/e.offsetWidth||1,a=L(t.height)/e.offsetHeight||1;return 1!==n||1!==a}(t),i=j(t),s=U(e,r,n),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(a||!a&&!n)&&(("body"!==R(t)||ue(i))&&(o=function(e){return e!==O(e)&&w(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:ce(e);var t}(t)),w(t)?((l=U(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=de(i))),{x:s.left+o.scrollLeft-l.x,y:s.top+o.scrollTop-l.y,width:s.width,height:s.height}}function Re(e){var t=new Map,n=new Set,a=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var a=t.get(e);a&&r(a)}})),a.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),a}function Oe(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Ie={placement:"bottom",modifiers:[],strategy:"absolute"};function we(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";var a=n(5043),r=n(6749);function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s,o=i(a),l=i(r);t.UJ=void 0,(s=t.UJ||(t.UJ={}))[s.Text=1]="Text",s[s.Link=2]="Link",s[s.FreeText=3]="FreeText",s[s.Line=4]="Line",s[s.Square=5]="Square",s[s.Circle=6]="Circle",s[s.Polygon=7]="Polygon",s[s.Polyline=8]="Polyline",s[s.Highlight=9]="Highlight",s[s.Underline=10]="Underline",s[s.Squiggly=11]="Squiggly",s[s.StrikeOut=12]="StrikeOut",s[s.Stamp=13]="Stamp",s[s.Caret=14]="Caret",s[s.Ink=15]="Ink",s[s.Popup=16]="Popup",s[s.FileAttachment=17]="FileAttachment";var c=function(e,t){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},c(e,t)};function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u,p=function(){return p=Object.assign||function(e){for(var t,n=1,a=arguments.length;nL}));if(!e.length)return-1;for(var t=e[0].pageIndex,a=e[e.length-1].pageIndex,r=e.length,s=0;s=0&&i.current.visibilities[t-1].renderStatus!==y.Rendered?t-1:-1},isInRange:function(e){return e>=i.current.startRange&&e<=i.current.endRange},markNotRendered:function(){for(var e=0;et)&&(i.current.visibilities[a].visibility=L,i.current.visibilities[a].renderStatus=y.NotRenderedYet)},setVisibility:s}},B={core:{askingPassword:{requirePasswordToOpen:"This document requires a password to open",submit:"Submit"},wrongPassword:{tryAgain:"The password is wrong. Please try again"},pageLabel:"Page {{pageIndex}}"}},U=o.createContext({l10n:B,setL10n:function(){}}),G=0,z=function(){return G++},H=function(e,t,n){var a=function(e){var a=t.current;if(a){var r=e.target;if(r instanceof Element&&r.shadowRoot){var i=e.composedPath();i.length>0&&!a.contains(i[0])&&n()}else a.contains(r)||n()}};o.useEffect((function(){if(e){var t={capture:!0};return document.addEventListener("click",a,t),function(){document.removeEventListener("click",a,t)}}}),[])},Y=function(e){var t=function(t){"Escape"===t.key&&e()};o.useEffect((function(){return document.addEventListener("keyup",t),function(){document.removeEventListener("keyup",t)}}),[])},j=function(e){var n=e.ariaControlsSuffix,a=e.children,r=e.closeOnClickOutside,i=e.closeOnEscape,s=e.onToggle,l=o.useRef(),c=o.useContext(m).direction===t.z4.RightToLeft;return o.useEffect((function(){var e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}),[]),Y((function(){l.current&&i&&s()})),H(r,l,s),g((function(){var e=l.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight="".concat(t,"px"))}}),[]),o.createElement("div",{"aria-modal":"true",className:h({"rpv-core__modal-body":!0,"rpv-core__modal-body--rtl":c}),id:"rpv-core__modal-body-".concat(n),ref:l,role:"dialog",tabIndex:-1},a)},V=function(e){var t=e.children;return o.createElement("div",{className:"rpv-core__modal-overlay"},t)};t.$K=void 0,(M=t.$K||(t.$K={})).Close="Close",M.Open="Open",M.Toggle="Toggle";var q,W=function(e){var n=o.useState(e),a=n[0],r=n[1];return{opened:a,toggle:function(e){switch(e){case t.$K.Close:r(!1);break;case t.$K.Open:r(!0);break;case t.$K.Toggle:default:r((function(e){return!e}))}}}},K=function(e){var t=e.content,n=e.isOpened,a=void 0!==n&&n,r=e.target,i=W(a),s=i.opened,l=i.toggle;return o.createElement(o.Fragment,null,r&&r(l,s),s&&t(l))};t.yX=void 0,(q=t.yX||(t.yX={})).TopLeft="TOP_LEFT",q.TopCenter="TOP_CENTER",q.TopRight="TOP_RIGHT",q.RightTop="RIGHT_TOP",q.RightCenter="RIGHT_CENTER",q.RightBottom="RIGHT_BOTTOM",q.BottomLeft="BOTTOM_LEFT",q.BottomCenter="BOTTOM_CENTER",q.BottomRight="BOTTOM_RIGHT",q.LeftTop="LEFT_TOP",q.LeftCenter="LEFT_CENTER",q.LeftBottom="LEFT_BOTTOM";var Q,$,X,Z,J,ee,te,ne,ae=function(e,n,a,r,i){g((function(){var s=n.current,o=e.current,l=a.current;if(o&&s&&l){var c=l.getBoundingClientRect(),d=function(e,n,a,r){var i=n.getBoundingClientRect(),s=e.getBoundingClientRect(),o=s.height,l=s.width,c=0,d=0;switch(a){case t.yX.TopLeft:c=i.top-o,d=i.left;break;case t.yX.TopCenter:c=i.top-o,d=i.left+i.width/2-l/2;break;case t.yX.TopRight:c=i.top-o,d=i.left+i.width-l;break;case t.yX.RightTop:c=i.top,d=i.left+i.width;break;case t.yX.RightCenter:c=i.top+i.height/2-o/2,d=i.left+i.width;break;case t.yX.RightBottom:c=i.top+i.height-o,d=i.left+i.width;break;case t.yX.BottomLeft:c=i.top+i.height,d=i.left;break;case t.yX.BottomCenter:c=i.top+i.height,d=i.left+i.width/2-l/2;break;case t.yX.BottomRight:c=i.top+i.height,d=i.left+i.width-l;break;case t.yX.LeftTop:c=i.top,d=i.left-l;break;case t.yX.LeftCenter:c=i.top+i.height/2-o/2,d=i.left-l;break;case t.yX.LeftBottom:c=i.top+i.height-o,d=i.left-l}return{left:d+(r.left||0),top:c+(r.top||0)}}(o,s,r,i),u=d.top,p=d.left;o.style.top="".concat(u-c.top,"px"),o.style.left="".concat(p-c.left,"px")}}),[])},re=function(e){var n,a=e.customClassName,r=e.position;return o.createElement("div",{className:h((n={"rpv-core__arrow":!0,"rpv-core__arrow--tl":r===t.yX.TopLeft,"rpv-core__arrow--tc":r===t.yX.TopCenter,"rpv-core__arrow--tr":r===t.yX.TopRight,"rpv-core__arrow--rt":r===t.yX.RightTop,"rpv-core__arrow--rc":r===t.yX.RightCenter,"rpv-core__arrow--rb":r===t.yX.RightBottom,"rpv-core__arrow--bl":r===t.yX.BottomLeft,"rpv-core__arrow--bc":r===t.yX.BottomCenter,"rpv-core__arrow--br":r===t.yX.BottomRight,"rpv-core__arrow--lt":r===t.yX.LeftTop,"rpv-core__arrow--lc":r===t.yX.LeftCenter,"rpv-core__arrow--lb":r===t.yX.LeftBottom},n["".concat(a)]=""!==a,n))})},ie=function(e){var n=e.ariaControlsSuffix,a=e.children,r=e.closeOnClickOutside,i=e.offset,s=e.position,l=e.targetRef,c=e.onClose,d=o.useRef(),u=o.useRef(),p=o.useRef(),_=o.useContext(m).direction===t.z4.RightToLeft;H(r,d,c),ae(d,l,p,s,i),g((function(){var e=u.current;if(e){var t=.75*document.body.clientHeight;e.getBoundingClientRect().height>=t&&(e.style.overflow="auto",e.style.maxHeight="".concat(t,"px"))}}),[]);var f="rpv-core__popover-body-inner-".concat(n);return o.createElement(o.Fragment,null,o.createElement("div",{ref:p,style:{left:0,position:"absolute",top:0}}),o.createElement("div",{"aria-describedby":f,className:h({"rpv-core__popover-body":!0,"rpv-core__popover-body--rtl":_}),id:"rpv-core__popover-body-".concat(n),ref:d,role:"dialog",tabIndex:-1},o.createElement(re,{customClassName:"rpv-core__popover-body-arrow",position:s}),o.createElement("div",{id:f,ref:u},a)))},se=function(e){var t=e.closeOnEscape,n=e.onClose,a=o.useRef();return Y((function(){a.current&&t&&n()})),o.createElement("div",{className:"rpv-core__popover-overlay",ref:a})},oe=function(e){var n=e.ariaControlsSuffix,a=e.children,r=e.contentRef,i=e.offset,s=e.position,l=e.targetRef,c=o.useRef(),d=o.useContext(m).direction===t.z4.RightToLeft;return ae(r,l,c,s,i),o.createElement(o.Fragment,null,o.createElement("div",{ref:c,style:{left:0,position:"absolute",top:0}}),o.createElement("div",{className:h({"rpv-core__tooltip-body":!0,"rpv-core__tooltip-body--rtl":d}),id:"rpv-core__tooltip-body-".concat(n),ref:r,role:"tooltip"},o.createElement(re,{customClassName:"rpv-core__tooltip-body-arrow",position:s}),o.createElement("div",{className:"rpv-core__tooltip-body-content"},a)))};t.HG=void 0,(Q=t.HG||(t.HG={})).Normal="Normal",Q.Entering="Entering",Q.Entered="Entered",Q.EnteredCompletely="EnteredCompletely",Q.Exitting="Exitting",Q.Exited="Exited",t._8=void 0,($=t._8||(t._8={}))[$.PreRender=0]="PreRender",$[$.DidRender=1]="DidRender",t.bH=void 0,(X=t.bH||(t.bH={})).Attachments="UseAttachments",X.Bookmarks="UseOutlines",X.ContentGroup="UseOC",X.Default="UserNone",X.FullScreen="FullScreen",X.Thumbnails="UseThumbs",t.a9=void 0,(Z=t.a9||(t.a9={})).RequiredPassword="RequiredPassword",Z.WrongPassword="WrongPassword",t.pT=void 0,(J=t.pT||(t.pT={})).Backward="Backward",J.Forward="Forward",t.VT=void 0,(ee=t.VT||(t.VT={})).Page="Page",ee.Horizontal="Horizontal",ee.Vertical="Vertical",ee.Wrapped="Wrapped",t.dD=void 0,(te=t.dD||(t.dD={})).ActualSize="ActualSize",te.PageFit="PageFit",te.PageWidth="PageWidth",t.nE=void 0,(ne=t.nE||(t.nE={})).DualPage="DualPage",ne.DualPageWithCover="DualPageWithCover",ne.SinglePage="SinglePage";var le,ce=function(e,t){return e.reduce((function(e,n,a){return a%t?e[e.length-1].push(n):e.push([n]),e}),[])},de=function(e,n){switch(n[1].name){case"XYZ":return{bottomOffset:function(e,t){return null===n[3]?t:n[3]},leftOffset:function(e,t){return null===n[2]?0:n[2]},pageIndex:e,scaleTo:n[4]};case"Fit":case"FitB":return{bottomOffset:0,leftOffset:0,pageIndex:e,scaleTo:t.dD.PageFit};case"FitH":case"FitBH":return{bottomOffset:n[2],leftOffset:0,pageIndex:e,scaleTo:t.dD.PageWidth};default:return{bottomOffset:0,leftOffset:0,pageIndex:e,scaleTo:1}}},ue=new Map,pe=new Map,_e=function(e,t){return"".concat(e.loadingTask.docId,"___").concat(t.num,"R").concat(0===t.gen?"":t.gen)},me=function(e,t,n){ue.set(_e(e,t),n)},he=function(e,t){if(!e)return Promise.reject("The document is not loaded yet");var n="".concat(e.loadingTask.docId,"___").concat(t),a=pe.get(n);return a?Promise.resolve(a):new Promise((function(a,r){e.getPage(t+1).then((function(r){pe.set(n,r),r.ref&&me(e,r.ref,t),a(r)}))}))},ge=function(e,t){return new Promise((function(n){new Promise((function(n){"string"==typeof t?e.getDestination(t).then((function(e){n(e)})):n(t)})).then((function(a){if("object"==typeof a[0]&&null!==a[0]){var r=a[0],i=function(e,t){var n=_e(e,t);return ue.has(n)?ue.get(n):null}(e,r);null===i?e.getPageIndex(r).then((function(a){me(e,r,a),ge(e,t).then((function(e){return n(e)}))})):n(de(i,a))}else{var s=de(a[0],a);n(s)}}))}))};!function(e){e[e.Solid=1]="Solid",e[e.Dashed=2]="Dashed",e[e.Beveled=3]="Beveled",e[e.Inset=4]="Inset",e[e.Underline=5]="Underline"}(le||(le={}));var fe,Ee=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),be=function(e,t,n,a){var r=parseInt(e,10);return r>=t&&r<=n?r:a},Se=function(e){return e.contentsObj?e.contentsObj.str:e.contents||""},ve=function(e){return e.titleObj?e.titleObj.str:e.title||""},Te=function(e){var n=e.annotation,a=o.useContext(m).direction,r=ve(n),i=Se(n),s=a===t.z4.RightToLeft,l=o.useRef(),c="";if(n.modificationDate){var d=function(e){var t=Ee.exec(e);if(!t)return null;var n=parseInt(t[1],10),a=be(t[2],1,12,1)-1,r=be(t[3],1,31,1),i=be(t[4],0,23,0),s=be(t[5],0,59,0),o=be(t[6],0,59,0),l=t[7]||"Z",c=be(t[8],0,23,0),d=be(t[9],0,59,0);switch(l){case"-":i+=c,s+=d;break;case"+":i-=c,s-=d}return new Date(Date.UTC(n,a,r,i,s,o))}(n.modificationDate);c=d?"".concat(d.toLocaleDateString(),", ").concat(d.toLocaleTimeString()):""}return o.useLayoutEffect((function(){if(l.current){var e=document.querySelector('[data-annotation-id="'.concat(n.id,'"]'));if(e){var t=e;return t.style.zIndex+=1,function(){t.style.zIndex="".concat(parseInt(t.style.zIndex,10)-1)}}}}),[]),o.createElement("div",{ref:l,className:h({"rpv-core__annotation-popup-wrapper":!0,"rpv-core__annotation-popup-wrapper--rtl":s}),style:{top:n.annotationType===t.UJ.Popup?"":"100%"}},r&&o.createElement(o.Fragment,null,o.createElement("div",{className:h({"rpv-core__annotation-popup-title":!0,"rpv-core__annotation-popup-title--ltr":!s,"rpv-core__annotation-popup-title--rtl":s})},r),o.createElement("div",{className:"rpv-core__annotation-popup-date"},c)),i&&o.createElement("div",{className:"rpv-core__annotation-popup-content"},i.split("\n").map((function(e,t){return o.createElement(o.Fragment,{key:t},e,o.createElement("br",null))}))))};!function(e){e.Click="Click",e.Hover="Hover"}(fe||(fe={}));var ye,Ce=function(e){var n,a=e.annotation,r=e.children,i=e.ignoreBorder,s=e.hasPopup,l=e.isRenderable,c=e.page,d=e.viewport,u=a.rect,p=function(){var e=W(!1),n=e.opened,a=e.toggle,r=o.useState(fe.Hover),i=r[0],s=r[1];return{opened:n,closeOnHover:function(){i===fe.Hover&&a(t.$K.Close)},openOnHover:function(){i===fe.Hover&&a(t.$K.Open)},toggleOnClick:function(){switch(i){case fe.Click:n&&s(fe.Hover),a(t.$K.Toggle);break;case fe.Hover:s(fe.Click),a(t.$K.Open)}}}}(),_=p.closeOnHover,m=p.opened,h=p.openOnHover,g=p.toggleOnClick,f=(n=[u[0],c.view[3]+c.view[1]-u[1],u[2],c.view[3]+c.view[1]-u[3]],[Math.min(n[0],n[2]),Math.min(n[1],n[3]),Math.max(n[0],n[2]),Math.max(n[1],n[3])]),E=u[2]-u[0],b=u[3]-u[1],S={borderColor:"",borderRadius:"",borderStyle:"",borderWidth:""};if(!i&&a.borderStyle.width>0){switch(a.borderStyle.style){case le.Dashed:S.borderStyle="dashed";break;case le.Solid:S.borderStyle="solid";break;case le.Underline:S=Object.assign({borderBottomStyle:"solid"},S);case le.Beveled:case le.Inset:}var v=a.borderStyle.width;S.borderWidth="".concat(v,"px"),a.borderStyle.style!==le.Underline&&(E-=2*v,b-=2*v);var T=a.borderStyle,y=T.horizontalCornerRadius,C=T.verticalCornerRadius;(y>0||C>0)&&(S.borderRadius="".concat(y,"px / ").concat(C,"px")),a.color?S.borderColor="rgb(".concat(0|a.color[0],", ").concat(0|a.color[1],", ").concat(0|a.color[2],")"):S.borderWidth="0"}return o.createElement(o.Fragment,null,l&&r({popup:{opened:m,closeOnHover:_,openOnHover:h,toggleOnClick:g},slot:{attrs:{style:Object.assign({height:"".concat(b,"px"),left:"".concat(f[0],"px"),top:"".concat(f[1],"px"),transform:"matrix(".concat(d.transform.join(","),")"),transformOrigin:"-".concat(f[0],"px -").concat(f[1],"px"),width:"".concat(E,"px")},S)},children:o.createElement(o.Fragment,null,s&&m&&o.createElement(Te,{annotation:a}))}}))},Ae=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--caret","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Ne=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--circle","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},o.createElement("circle",{cy:u/2,fill:"none",rx:d/2-_/2,ry:u/2-_/2,stroke:"transparent",strokeWidth:_||1})),e.slot.children)}))},Re=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=ve(t),i=Se(t),s=!(!1!==t.hasPopup||!r&&!i),l=function(){var e,n,a,r,i=t.file;i&&(e=i.filename,a="string"==typeof(n=i.content)?"":URL.createObjectURL(new Blob([n],{type:""})),(r=document.createElement("a")).style.display="none",r.href=a||e,r.setAttribute("download",function(e){var t=e.split("/").pop();return t?t.split("#")[0].split("?")[0]:e}(e)),document.body.appendChild(r),r.click(),document.body.removeChild(r),a&&URL.revokeObjectURL(a))};return o.createElement(Ce,{annotation:t,hasPopup:s,ignoreBorder:!0,isRenderable:!0,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--file-attachment","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onDoubleClick:l,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Oe=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--free-text","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Ie=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=ve(t),i=Se(t),s=!(!r&&!i),l=!t.parentType||-1!==["Circle","Ink","Line","Polygon","PolyLine","Square"].indexOf(t.parentType);return g((function(){if(t.parentId){var e=document.querySelector('[data-annotation-id="'.concat(t.parentId,'"]')),n=document.querySelector('[data-annotation-id="'.concat(t.id,'"]'));if(e&&n){var a=parseFloat(e.style.left),r=parseFloat(e.style.top)+parseFloat(e.style.height);n.style.left="".concat(a,"px"),n.style.top="".concat(r,"px"),n.style.transformOrigin="-".concat(a,"px -").concat(r,"px")}}}),[]),o.createElement(Ce,{annotation:t,hasPopup:l,ignoreBorder:!1,isRenderable:s,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--popup","data-annotation-id":t.id}),o.createElement(Te,{annotation:t}))}))},we=function(e){var n=e.annotation,a=e.childAnnotation,r=e.page,i=e.viewport,s=!1===n.hasPopup,l=ve(n),c=Se(n),d=!!(n.hasPopup||l||c);if(n.quadPoints&&n.quadPoints.length>0){var u=n.quadPoints.map((function(e){return Object.assign({},n,{rect:[e[2].x,e[2].y,e[1].x,e[1].y],quadPoints:[]})}));return o.createElement(o.Fragment,null,u.map((function(e,t){return o.createElement(we,{key:t,annotation:e,childAnnotation:a,page:r,viewport:i})})))}return o.createElement(Ce,{annotation:n,hasPopup:s,ignoreBorder:!0,isRenderable:d,page:r,viewport:i},(function(e){return o.createElement(o.Fragment,null,o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--highlight","data-annotation-id":n.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children),a&&a.annotationType===t.UJ.Popup&&e.popup.opened&&o.createElement(Ie,{annotation:a,page:r,viewport:i}))}))},xe=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--ink","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.inkLists&&t.inkLists.length&&o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},t.inkLists.map((function(e,t){return o.createElement("polyline",{key:t,fill:"none",stroke:"transparent",strokeWidth:_||1,points:e.map((function(e){return"".concat(e.x-c[0],",").concat(c[3]-e.y)})).join(" ")})}))),e.slot.children)}))},De=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--line","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},o.createElement("line",{stroke:"transparent",strokeWidth:_||1,x1:c[2]-t.lineCoordinates[0],x2:c[2]-t.lineCoordinates[2],y1:c[3]-t.lineCoordinates[1],y2:c[3]-t.lineCoordinates[3]})),e.slot.children)}))},ke=/^([^\w]*)(javascript|data|vbscript)/im,Pe=/&#(\w+)(^\w|;)?/g,Me=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Le=/^([^:]+):/gm,Fe=function(e){var t,n=e.annotation,a=e.annotationContainerRef,r=e.doc,i=e.outlines,s=e.page,l=e.pageIndex,c=e.scale,d=e.viewport,u=e.onExecuteNamedAction,_=e.onJumpFromLinkAnnotation,m=e.onJumpToDest,h=o.useRef(),g=i&&i.length&&n.dest&&"string"==typeof n.dest?null===(t=i.find((function(e){return e.dest===n.dest})))||void 0===t?void 0:t.title:"",f=!!(n.url||n.dest||n.action||n.unsafeUrl),E={};if(n.url||n.unsafeUrl){var b=function(e,t){void 0===t&&(t="about:blank");var n,a=(n=e||"",n.replace(Pe,(function(e,t){return String.fromCharCode(t)}))).replace(Me,"").trim();if(!a)return t;var r=a[0];if("."===r||"/"===r)return a;var i=a.match(Le);if(!i)return a;var s=i[0];return ke.test(s)?t:a}(n.url||n.unsafeUrl,"");b?E={"data-target":"external",href:b,rel:"noopener noreferrer nofollow",target:n.newWindow?"_blank":"",title:b}:f=!1}else E={href:"","data-annotation-link":n.id,onClick:function(e){e.preventDefault(),n.action?u(n.action):ge(r,n.dest).then((function(e){var t=h.current,n=a.current;if(t&&n){var r=t.getBoundingClientRect();n.style.setProperty("height","100%"),n.style.setProperty("width","100%");var i=n.getBoundingClientRect();n.style.removeProperty("height"),n.style.removeProperty("width");var s=(r.left-i.left)/c,o=(i.bottom-r.bottom+r.height)/c;_({bottomOffset:o,label:g,leftOffset:s,pageIndex:l})}m(e)}))}};return g&&(E=Object.assign({},E,{title:g,"aria-label":g})),o.createElement(Ce,{annotation:n,hasPopup:!1,ignoreBorder:!1,isRenderable:f,page:s,viewport:d},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--link","data-annotation-id":n.id,"data-testid":"core__annotation--link-".concat(n.id)}),o.createElement("a",p({ref:h},E)))}))},Be=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polygon","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},o.createElement("polygon",{fill:"none",stroke:"transparent",strokeWidth:_||1,points:t.vertices.map((function(e){return"".concat(e.x-c[0],",").concat(c[3]-e.y)})).join(" ")})),e.slot.children)}))},Ue=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polyline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),t.vertices&&t.vertices.length&&o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},o.createElement("polyline",{fill:"none",stroke:"transparent",strokeWidth:_||1,points:t.vertices.map((function(e){return"".concat(e.x-c[0],",").concat(c[3]-e.y)})).join(" ")})),e.slot.children)}))},Ge=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s),c=t.rect,d=c[2]-c[0],u=c[3]-c[1],_=t.borderStyle.width;return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--square","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),o.createElement("svg",{height:"".concat(u,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(d," ").concat(u),width:"".concat(d,"px")},o.createElement("rect",{height:u-_,fill:"none",stroke:"transparent",strokeWidth:_||1,x:_/2,y:_/2,width:d-_})),e.slot.children)}))},ze=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--squiggly","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},He=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--stamp","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Ye=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--strike-out","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},je=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M.5,16.5a1,1,0,0,0,1,1h2v4l4-4h15a1,1,0,0,0,1-1V3.5a1,1,0,0,0-1-1H1.5a1,1,0,0,0-1,1Z"}),o.createElement("path",{d:"M7.25,9.75A.25.25,0,1,1,7,10a.25.25,0,0,1,.25-.25"}),o.createElement("path",{d:"M12,9.75a.25.25,0,1,1-.25.25A.25.25,0,0,1,12,9.75"}),o.createElement("path",{d:"M16.75,9.75a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"}))},Ve=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M0.500 12.001 A11.500 11.500 0 1 0 23.500 12.001 A11.500 11.500 0 1 0 0.500 12.001 Z"}),o.createElement("path",{d:"M6.000 12.001 A6.000 6.000 0 1 0 18.000 12.001 A6.000 6.000 0 1 0 6.000 12.001 Z"}),o.createElement("path",{d:"M21.423 5.406L17.415 9.414"}),o.createElement("path",{d:"M14.587 6.585L18.607 2.565"}),o.createElement("path",{d:"M5.405 21.424L9.413 17.416"}),o.createElement("path",{d:"M6.585 14.588L2.577 18.596"}),o.createElement("path",{d:"M18.602 21.419L14.595 17.412"}),o.createElement("path",{d:"M17.419 14.58L21.428 18.589"}),o.createElement("path",{d:"M2.582 5.399L6.588 9.406"}),o.createElement("path",{d:"M9.421 6.581L5.412 2.572"}))},qe=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M4.000 18.500 A1.500 1.500 0 1 0 7.000 18.500 A1.500 1.500 0 1 0 4.000 18.500 Z"}),o.createElement("path",{d:"M20.5.5l-9.782,9.783a7,7,0,1,0,3,3L17,10h1.5V8.5L19,8h1.5V6.5L21,6h1.5V4.5l1-1V.5Z"}))},We=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M2.000 2.500 L22.000 2.500 L22.000 23.500 L2.000 23.500 Z"}),o.createElement("path",{d:"M6 4.5L6 0.5"}),o.createElement("path",{d:"M18 4.5L18 0.5"}),o.createElement("path",{d:"M10 4.5L10 0.5"}),o.createElement("path",{d:"M14 4.5L14 0.5"}))},Ke=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M17.5 0.498L17.5 23.498"}),o.createElement("path",{d:"M10.5 0.498L10.5 23.498"}),o.createElement("path",{d:"M23.5.5H6.5a6,6,0,0,0,0,12h4"}))},Qe=function(){return o.createElement(E,{size:16},o.createElement("path",{d:"M2.5 22.995L12 6.005 21.5 22.995 2.5 22.995z"}))},$e=function(e){var n=e.annotation,a=e.childAnnotation,r=e.page,i=e.viewport,s=!1===n.hasPopup,l=ve(n),c=Se(n),d=!!(n.hasPopup||l||c),u=n.name?n.name.toLowerCase():"";return o.createElement(Ce,{annotation:n,hasPopup:s,ignoreBorder:!1,isRenderable:d,page:r,viewport:i},(function(e){return o.createElement(o.Fragment,null,o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--text","data-annotation-id":n.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),u&&o.createElement("div",{className:"rpv-core__annotation-text-icon"},"check"===u&&o.createElement(b,null),"comment"===u&&o.createElement(je,null),"help"===u&&o.createElement(Ve,null),"insert"===u&&o.createElement(Qe,null),"key"===u&&o.createElement(qe,null),"note"===u&&o.createElement(We,null),("newparagraph"===u||"paragraph"===u)&&o.createElement(Ke,null)),e.slot.children),a&&a.annotationType===t.UJ.Popup&&e.popup.opened&&o.createElement(Ie,{annotation:a,page:r,viewport:i}))}))},Xe=function(e){var t=e.annotation,n=e.page,a=e.viewport,r=!1===t.hasPopup,i=ve(t),s=Se(t),l=!!(t.hasPopup||i||s);return o.createElement(Ce,{annotation:t,hasPopup:r,ignoreBorder:!0,isRenderable:l,page:n,viewport:a},(function(e){return o.createElement("div",p({},e.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--underline","data-annotation-id":t.id,onClick:e.popup.toggleOnClick,onMouseEnter:e.popup.openOnHover,onMouseLeave:e.popup.closeOnHover}),e.slot.children)}))},Ze=function(e){var n=e.annotations,a=e.doc,r=e.outlines,i=e.page,s=e.pageIndex,l=e.plugins,c=e.rotation,d=e.scale,u=e.onExecuteNamedAction,p=e.onJumpFromLinkAnnotation,_=e.onJumpToDest,m=o.useRef(),h=i.getViewport({rotation:c,scale:d}).clone({dontFlip:!0}),f=n.filter((function(e){return!e.parentId}));return g((function(){var e=m.current;e&&l.forEach((function(t){t.onAnnotationLayerRender&&t.onAnnotationLayerRender({annotations:f,container:e,pageIndex:s,rotation:c,scale:d})}))}),[]),o.createElement("div",{ref:m,className:"rpv-core__annotation-layer","data-testid":"core__annotation-layer-".concat(s)},f.map((function(e){var l=n.find((function(t){return t.parentId===e.id}));switch(e.annotationType){case t.UJ.Caret:return o.createElement(Ae,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Circle:return o.createElement(Ne,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.FileAttachment:return o.createElement(Re,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.FreeText:return o.createElement(Oe,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Highlight:return o.createElement(we,{key:e.id,annotation:e,childAnnotation:l,page:i,viewport:h});case t.UJ.Ink:return o.createElement(xe,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Line:return o.createElement(De,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Link:return o.createElement(Fe,{key:e.id,annotation:e,annotationContainerRef:m,doc:a,outlines:r,page:i,pageIndex:s,scale:d,viewport:h,onExecuteNamedAction:u,onJumpFromLinkAnnotation:p,onJumpToDest:_});case t.UJ.Polygon:return o.createElement(Be,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Polyline:return o.createElement(Ue,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Popup:return o.createElement(Ie,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Square:return o.createElement(Ge,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Squiggly:return o.createElement(ze,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Stamp:return o.createElement(He,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.StrikeOut:return o.createElement(Ye,{key:e.id,annotation:e,page:i,viewport:h});case t.UJ.Text:return o.createElement($e,{key:e.id,annotation:e,childAnnotation:l,page:i,viewport:h});case t.UJ.Underline:return o.createElement(Xe,{key:e.id,annotation:e,page:i,viewport:h});default:return o.createElement(o.Fragment,{key:e.id})}})))},Je=function(e){var t=e.page,n=e.renderAnnotations,a=k(),r=o.useState({loading:!0,annotations:[]}),i=r[0],s=r[1];return o.useEffect((function(){t.getAnnotations({intent:"display"}).then((function(e){a.current&&s({loading:!1,annotations:e})}))}),[]),i.loading?o.createElement(o.Fragment,null):n(i.annotations)},et=function(e){var t=e.doc,n=e.outlines,a=e.page,r=e.pageIndex,i=e.plugins,s=e.rotation,l=e.scale,c=e.onExecuteNamedAction,d=e.onJumpFromLinkAnnotation,u=e.onJumpToDest;return o.createElement(Je,{page:a,renderAnnotations:function(e){return o.createElement(Ze,{annotations:e,doc:t,outlines:n,page:a,pageIndex:r,plugins:i,rotation:s,scale:l,onExecuteNamedAction:c,onJumpFromLinkAnnotation:d,onJumpToDest:u})}})},tt=function(e,t){var n=e%t;return 0===n?e:Math.floor(e-n)},nt=function(e){var n=e.canvasLayerRef,a=e.height,r=e.page,i=e.pageIndex,s=e.plugins,l=e.rotation,c=e.scale,d=e.width,u=e.onRenderCanvasCompleted,p=o.useRef();return g((function(){var e=p.current;e&&e.cancel();var a=n.current;a.removeAttribute("data-testid"),s.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:a,pageIndex:i,rotation:l,scale:c,status:t._8.PreRender})}));var o=r.getViewport({rotation:l,scale:c}),d=window.devicePixelRatio||1,_=Math.sqrt(16777216/(o.width*o.height)),m=d>_;m?a.style.transform="scale(1, 1)":a.style.removeProperty("transform");var h=Math.min(_,d),g=function(e,t){var n,a;if(Math.floor(e)===e)return[e,1];var r=1/e;if(r>8)return[1,8];if(Math.floor(r)===r)return[1,r];for(var i=e>1?r:e,s=0,o=1,l=1,c=1;;){var d=s+l,u=o+c;if(u>8)break;i<=d/u?(l=(n=[d,u])[0],c=n[1]):(s=(a=[d,u])[0],o=a[1])}return i<(s/o+l/c)/2?i===e?[s,o]:[o,s]:i===e?[l,c]:[c,l]}(h),f=g[0],E=g[1];a.width=tt(o.width*h,f),a.height=tt(o.height*h,f),a.style.width="".concat(tt(o.width,E),"px"),a.style.height="".concat(tt(o.height,E),"px"),a.hidden=!0;var b=a.getContext("2d",{alpha:!1}),S=m||1!==d?[h,0,0,h,0,0]:null;return p.current=r.render({canvasContext:b,transform:S,viewport:o}),p.current.promise.then((function(){a.hidden=!1,a.setAttribute("data-testid","core__canvas-layer-".concat(i)),s.forEach((function(e){e.onCanvasLayerRender&&e.onCanvasLayerRender({ele:a,pageIndex:i,rotation:l,scale:c,status:t._8.DidRender})})),u()}),(function(){u()})),function(){a&&(a.width=0,a.height=0)}}),[]),o.createElement("div",{className:"rpv-core__canvas-layer",style:{height:"".concat(a,"px"),width:"".concat(d,"px")}},o.createElement("canvas",{ref:n}))},at=function(e){var t=e.height,n=e.page,a=e.rotation,r=e.scale,i=e.width,s=o.useRef();return g((function(){var e=s.current,o=n.getViewport({rotation:a,scale:r});n.getOperatorList().then((function(a){!function(){var e=s.current;e&&(e.innerHTML="")}(),new l.SVGGraphics(n.commonObjs,n.objs).getSVG(a,o).then((function(n){n.style.height="".concat(t,"px"),n.style.width="".concat(i,"px"),e.appendChild(n)}))}))}),[]),o.createElement("div",{className:"rpv-core__svg-layer",ref:s})},rt=function(e){var n=e.containerRef,a=e.page,r=e.pageIndex,i=e.plugins,s=e.rotation,c=e.scale,d=e.onRenderTextCompleted,u=o.useRef(),p=function(){var e=n.current;e&&([].slice.call(e.querySelectorAll(".rpv-core__text-layer-text")).forEach((function(t){return e.removeChild(t)})),[].slice.call(e.querySelectorAll('br[role="presentation"]')).forEach((function(t){return e.removeChild(t)})))};return g((function(){var e=u.current;e&&e.cancel();var o=n.current;if(o){o.removeAttribute("data-testid");var _=a.getViewport({rotation:s,scale:c});return i.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:o,pageIndex:r,scale:c,status:t._8.PreRender})})),a.getTextContent().then((function(e){p(),u.current=l.renderTextLayer({container:o,textContent:e,textContentSource:e,viewport:_}),u.current.promise.then((function(){o.setAttribute("data-testid","core__text-layer-".concat(r)),[].slice.call(o.children).forEach((function(e){e.classList.contains("rpv-core__text-layer-text--not")||e.classList.add("rpv-core__text-layer-text")})),i.forEach((function(e){e.onTextLayerRender&&e.onTextLayerRender({ele:o,pageIndex:r,scale:c,status:t._8.DidRender})})),d()}),(function(){o.removeAttribute("data-testid"),d()}))})),function(){var e;p(),null===(e=u.current)||void 0===e||e.cancel()}}}),[]),o.createElement("div",{className:"rpv-core__text-layer",ref:n})},it=function(e){var n=e.doc,a=e.measureRef,r=e.outlines,i=e.pageIndex,s=e.pageRotation,l=e.pageSize,c=e.plugins,d=e.renderPage,u=e.renderQueueKey,p=e.rotation,_=e.scale,m=e.shouldRender,g=e.viewMode,f=e.onExecuteNamedAction,E=e.onJumpFromLinkAnnotation,b=e.onJumpToDest,S=e.onRenderCompleted,T=e.onRotatePage,y=k(),C=o.useState(null),A=C[0],N=C[1],R=o.useState(!1),O=R[0],I=R[1],w=o.useState(!1),x=w[0],D=w[1],P=o.useRef(),M=o.useRef(),L=Math.abs(p+s)%180==0,F=l.pageWidth*_,B=l.pageHeight*_,U=L?F:B,G=L?B:F,z=(l.rotation+p+s)%360,H=o.useRef(0),Y=d||function(e){return o.createElement(o.Fragment,null,e.canvasLayer.children,e.textLayer.children,e.annotationLayer.children)};return o.useEffect((function(){N(null),I(!1),D(!1)}),[s,p,_]),o.useEffect((function(){m&&y.current&&!A&&he(n,i).then((function(e){y.current&&(H.current=u,N(e))}))}),[m,A]),o.useEffect((function(){O&&x&&(u!==H.current?(N(null),I(!1),D(!1)):S(i))}),[O,x]),o.createElement("div",{className:h({"rpv-core__page-layer":!0,"rpv-core__page-layer--dual":g===t.nE.DualPage,"rpv-core__page-layer--dual-cover":g===t.nE.DualPageWithCover,"rpv-core__page-layer--single":g===t.nE.SinglePage}),"data-testid":"core__page-layer-".concat(i),ref:a,style:{height:"".concat(G,"px"),width:"".concat(U,"px")}},A?o.createElement(o.Fragment,null,Y({annotationLayer:{attrs:{},children:o.createElement(et,{doc:n,outlines:r,page:A,pageIndex:i,plugins:c,rotation:z,scale:_,onExecuteNamedAction:f,onJumpFromLinkAnnotation:E,onJumpToDest:b})},canvasLayer:{attrs:{},children:o.createElement(nt,{canvasLayerRef:P,height:G,page:A,pageIndex:i,plugins:c,rotation:z,scale:_,width:U,onRenderCanvasCompleted:function(){y.current&&I(!0)}})},canvasLayerRendered:O,doc:n,height:G,pageIndex:i,rotation:z,scale:_,svgLayer:{attrs:{},children:o.createElement(at,{height:G,page:A,rotation:z,scale:_,width:U})},textLayer:{attrs:{},children:o.createElement(rt,{containerRef:M,page:A,pageIndex:i,plugins:c,rotation:z,scale:_,onRenderTextCompleted:function(){y.current&&D(!0)}})},textLayerRendered:x,width:U,markRendered:S,onRotatePage:function(e){return T(i,e)}}),c.map((function(e,t){return e.renderPageLayer?o.createElement(o.Fragment,{key:t},e.renderPageLayer({canvasLayerRef:P,canvasLayerRendered:O,doc:n,height:G,pageIndex:i,rotation:z,scale:_,textLayerRef:M,textLayerRendered:x,width:U})):o.createElement(o.Fragment,{key:t})}))):o.createElement(v,{testId:"core__page-layer-loading-".concat(i)}))},st=function(e,t){var n=t.rect;return e.height!==n.height||e.width!==n.width?n:e};!function(e){e.Horizontal="Horizontal",e.Vertical="Vertical",e.Both="Both"}(ye||(ye={}));var ot=function(e){return 1-Math.pow(1-e,4)},lt=1e-4,ct={left:0,top:0},dt={capture:!1,passive:!0},ut=function(e,t,n){return Math.max(e,Math.min(n,t))},pt=function(e,n){if(n!==t.nE.DualPageWithCover)return 0;if(!function(e){var t=e.length;if(1===t)return!1;for(var n=1;nn))return r;t=r-1}}return e>0?e-1:0}(0,i,r,(function(n){switch(e){case ye.Horizontal:return t[n].start.left;case ye.Both:case ye.Vertical:default:return t[n].start.top}}));if(e===ye.Both)for(var o=t[s].start.top;s-1>=0&&t[s-1].start.top===o&&t[s-1].start.left>=a.left;)s--;for(var l=s;l<=i;){var c={top:t[l].start.top-a.top,left:t[l].start.left-a.left},d={height:n.height-c.top,width:n.width-c.left};if(e===ye.Horizontal&&d.width<0)break;if(e===ye.Vertical&&d.height<0)break;if(e===ye.Both&&(d.width<0||d.height<0))break;l++}return{start:s,end:l}}(b,w,y,v),n=e.start,a=e.end,i=n+R.slice(ut(0,r,n),ut(0,r,a)).reduce((function(e,t,n,a){return t>a[e]?n:e}),0),o=i=ut(0,r-1,i),l=s({endPage:a,numPages:r,startPage:n}),c=l.startPage,u=l.endPage;switch(c=Math.max(c,0),u=Math.min(u,r-1),d){case t.nE.DualPageWithCover:i>0&&(o=i%2==1?i:i-1),c=0===c?0:c%2==1?c:c-1,r-(u=u%2==1?u-1:u)<=2&&(u=r-1);break;case t.nE.DualPage:o=i%2==0?i:i-1,c=c%2==0?c:c-1,u=u%2==1?u:u-1;break;case t.nE.SinglePage:default:o=i}return{startPage:c,endPage:u,maxVisbilityIndex:o}}),[w,y,v,d,R]),k=D.startPage,P=D.endPage,M=D.maxVisbilityIndex,L=o.useMemo((function(){for(var e=[],t=function(t){var n=w[t],a=p(p({},n),{visibility:void 0!==R[t]?R[t]:-1,measureRef:function(e){e&&(e.setAttribute(bt,"".concat(t)),I.observe(e))}});e.push(a)},n=k;n<=P;n++)t(n);return e}),[k,P,R,w]),F=o.useCallback((function(e,a){var i=C.current.measurements[ut(0,r-1,e)],s=f.current===t.VT.Page?Et:a;return i?T({left:s.left+i.start.left,top:s.top+i.start.top},n):Promise.resolve()}),[T,n]),B=o.useCallback((function(e,n){var a=C.current.measurements,r=a[e].start,i=a.find((function(e){return e.start.top-r.top>1e-12}));if(!i)return Promise.resolve();var s=i.index;switch(E.current){case t.nE.DualPage:s=s%2==0?s:s+1;break;case t.nE.DualPageWithCover:s=s%2==1?s:s+1}return F(s,n)}),[]),U=o.useCallback((function(e,n){for(var a=C.current.measurements,i=a[e].start,s=e,o=!1,l=r-1;l>=0;l--)if(i.top-a[l].start.top>1e-12){o=!0,s=a[l].index;break}if(!o)return Promise.resolve();switch(E.current){case t.nE.DualPage:s=s%2==0?s:s-1;break;case t.nE.DualPageWithCover:s=s%2==0?s-1:s}return s===e&&(s=e-1),F(s,n)}),[]),G=o.useCallback((function(e,n){if(E.current===t.nE.DualPageWithCover||E.current===t.nE.DualPage)return B(e,n);switch(f.current){case t.VT.Wrapped:return B(e,n);case t.VT.Horizontal:case t.VT.Vertical:default:return F(e+1,n)}}),[]),z=o.useCallback((function(e,n){if(E.current===t.nE.DualPageWithCover||E.current===t.nE.DualPage)return U(e,n);switch(f.current){case t.VT.Wrapped:return U(e,n);case t.VT.Horizontal:case t.VT.Vertical:default:return F(e-1,n)}}),[]),H=o.useCallback((function(){return function(e,n){switch(n){case t.VT.Horizontal:return{position:"relative",height:"100%",width:"".concat(e.width,"px")};case t.VT.Vertical:default:return{position:"relative",height:"".concat(e.height,"px"),width:"100%"}}}(x,f.current)}),[x]),Y=o.useCallback((function(e){return function(e,n,a){return a!==t.VT.Page?{}:{height:"".concat(n.height,"px"),width:"100%",position:"absolute",top:0,transform:"translateY(".concat(e.start.top,"px)")}}(e,y,f.current)}),[y]),j=o.useCallback((function(e){return function(e,n,a,r,i){var s,o,l,c,d,u,p,_=n?"right":"left",m=n?-1:1,h=a.length,g=e.start.left*m,f=e.size,E=f.height,b=f.width;if(r===t.nE.DualPageWithCover){var S=i===t.VT.Page?0:e.start.top;return 0===e.index||h%2==0&&e.index===h-1?((s={height:"".concat(E,"px"),minWidth:"".concat(pt(a,r),"px"),width:"100%"})[_]=0,s.position="absolute",s.top=0,s.transform="translate(".concat(g,"px, ").concat(S,"px)"),s):((o={height:"".concat(E,"px"),width:"".concat(b,"px")})[_]=0,o.position="absolute",o.top=0,o.transform="translate(".concat(g,"px, ").concat(S,"px)"),o)}if(r===t.nE.DualPage)return(l={height:"".concat(E,"px"),width:"".concat(b,"px")})[_]=0,l.position="absolute",l.top=0,l.transform="translate(".concat(g,"px, ").concat(i===t.VT.Page?0:e.start.top,"px)"),l;switch(i){case t.VT.Horizontal:return(c={height:"100%",width:"".concat(b,"px")})[_]=0,c.position="absolute",c.top=0,c.transform="translateX(".concat(g,"px)"),c;case t.VT.Page:return(d={height:"".concat(E,"px"),width:"".concat(b,"px")})[_]=0,d.position="absolute",d.top=0,d;case t.VT.Wrapped:return(u={height:"".concat(E,"px"),width:"".concat(b,"px")})[_]=0,u.position="absolute",u.top=0,u.transform="translate(".concat(g,"px, ").concat(e.start.top,"px)"),u;case t.VT.Vertical:default:return(p={height:"".concat(E,"px"),width:"100%"})[_]=0,p.position="absolute",p.top=0,p.transform="translateY(".concat(e.start.top,"px)"),p}}(e,a,l,E.current,f.current)}),[a,l]),V=o.useCallback((function(e,n){var a=C.current,i=a.measurements,s=a.scrollOffset,o=i[ut(0,r-1,n)];if(o){var l=f.current===t.VT.Page?{left:o.start.left,top:o.start.top}:{left:s.left*e,top:s.top*e};return T(l,!1)}return Promise.resolve()}),[]);return o.useEffect((function(){return function(){I.disconnect()}}),[]),{boundingClientRect:y,isSmoothScrolling:_,startPage:k,endPage:P,maxVisbilityIndex:M,virtualItems:L,getContainerStyles:H,getItemContainerStyles:Y,getItemStyles:j,scrollToItem:F,scrollToNextItem:G,scrollToPreviousItem:z,zoom:V}},Tt=function(e,n,a,r,i,s){var o=a;switch(!0){case i===t.nE.DualPageWithCover&&s>=3:case i===t.nE.DualPage&&s>=3:o=2*a;break;default:o=a}switch(r){case t.dD.ActualSize:return 1;case t.dD.PageFit:return Math.min((e.clientWidth-17)/o,(e.clientHeight-16)/n);case t.dD.PageWidth:return(e.clientWidth-17)/o}},yt=function(e){var t=[];return e.map((function(e){t=t.concat(e).concat(function(e){var t=[];return e.items&&e.items.length>0&&(t=t.concat(yt(e.items))),t}(e))})),t},Ct={capture:!1,passive:!0},At={height:0,width:0},Nt={height:0,width:0},Rt=function(e){var n=e.getCurrentPage,a=e.getCurrentScrollMode,r=e.jumpToPage,i=e.targetRef,s=o.useState(t.HG.Normal),l=s[0],c=s[1],d=function(){var e=o.useState(At),t=e[0],n=e[1],a=D((function(){n({height:window.innerHeight,width:window.innerWidth})}),100);return g((function(){return window.addEventListener("resize",a,Ct),function(){window.removeEventListener("resize",a,Ct)}}),[]),t}(),u=o.useState(Nt),p=u[0],_=u[1],m=o.useRef(Nt),h=o.useRef(n()),f=o.useRef(Nt),E=o.useState(i.current),b=E[0],S=E[1],v=o.useRef();g((function(){i.current!==b&&S(i.current)}),[]),g((function(){if(b){var e=new ResizeObserver((function(e){e.forEach((function(e){var t=e.target.getBoundingClientRect(),n=t.height,a=t.width;_({height:n,width:a})}))}));return e.observe(b),function(){e.unobserve(b),e.disconnect()}}}),[b]);var T=o.useCallback((function(e){var n=x();return n&&n!==e?(c(t.HG.Normal),w(n)):Promise.resolve()}),[]),y=o.useCallback((function(e){e&&I()&&(S(e),T(e).then((function(){v.current=e,c(t.HG.Entering),function(e){R&&e[O.RequestFullScreen]()}(e)})))}),[]),C=o.useCallback((function(){x()&&(c(t.HG.Exitting),w(document))}),[]),A=o.useCallback((function(){b&&x()!==b&&c(t.HG.Exitting)}),[b]);return o.useEffect((function(){switch(l){case t.HG.Entering:v.current&&(v.current.style.backgroundColor="var(--rpv-core__full-screen-target-background-color)"),h.current=n(),m.current={height:window.innerHeight,width:window.innerWidth};break;case t.HG.Entered:a()===t.VT.Page?r(h.current).then((function(){c(t.HG.EnteredCompletely)})):c(t.HG.EnteredCompletely);break;case t.HG.Exitting:v.current&&(v.current.style.backgroundColor="",v.current=null),h.current=n();break;case t.HG.Exited:c(t.HG.Normal),a()===t.VT.Page&&r(h.current)}}),[l]),o.useEffect((function(){if(l!==t.HG.Normal)return l===t.HG.Entering&&d.height===p.height&&d.width===p.width&&d.height>0&&d.width>0&&(0===f.current.height||d.height==f.current.height)?(f.current={height:window.innerHeight,width:window.innerWidth},void c(t.HG.Entered)):void(l===t.HG.Exitting&&m.current.height===d.height&&m.current.width===d.width&&d.height>0&&d.width>0&&c(t.HG.Exited))}),[l,d,p]),o.useEffect((function(){var e;return e=A,R&&document.addEventListener(O.FullScreenChange,e),function(){!function(e){R&&document.removeEventListener(O.FullScreenChange,e)}(A)}}),[b]),{enterFullScreenMode:y,exitFullScreenMode:C,fullScreenMode:l}},Ot={buildPageStyles:function(){return{}},transformSize:function(e){return e.size}},It={left:0,top:0},wt=function(e){var n=e.currentFile,a=e.defaultScale,r=e.doc,i=e.enableSmoothScroll,s=e.initialPage,l=e.initialRotation,c=e.initialScale,d=e.pageLayout,u=e.pageSizes,_=e.plugins,f=e.renderPage,E=e.scrollMode,b=e.setRenderRange,S=e.viewMode,v=e.viewerState,T=e.onDocumentLoad,y=e.onOpenFile,C=e.onPageChange,A=e.onRotate,N=e.onRotatePage,R=e.onZoom,O=r.numPages,I=r.loadingTask.docId,w=o.useContext(U).l10n,x=o.useContext(m),M=x.direction===t.z4.RightToLeft,L=o.useRef(),B=o.useRef(),G=o.useState(s),z=G[0],H=G[1],Y=o.useRef(null),j=function(e){var t,n=e.getCurrentPage,a=(t=o.useRef([]),o.useEffect((function(){return function(){t.current=[]}}),[]),{push:function(e){var n=t.current;n.length+1>50&&n.shift(),n.push(e),t.current=n},map:function(e){return t.current.map((function(t){return e(t)}))},pop:function(){var e=t.current;if(0===e.length)return null;var n=e.pop();return t.current=e,n}}),r=function(e){var t=o.useRef([]);return o.useEffect((function(){return function(){t.current=[]}}),[]),{dequeue:function(){var e=t.current;if(0===e.length)return null;var n=e.shift();return t.current=e,n||null},enqueue:function(e){var n=t.current;n.length+1>50&&n.pop(),t.current=[e].concat(n)},map:function(e){return t.current.map((function(t){return e(t)}))}}}(),i=function(){var e=r.dequeue();return e&&a.push(e),e&&e.pageIndex===n()?i():e},s=function(){var e=a.pop();return e&&r.enqueue(e),e&&e.pageIndex===n()?s():e},l=o.useCallback((function(e){a.push(e)}),[]);return{getNextDestination:i,getPreviousDestination:s,markVisitedDestination:l}}({getCurrentPage:function(){return Ee.current.pageIndex}}),V=o.useState(l),q=V[0],W=V[1],K=P(q),Q=o.useState(!1),$=Q[0],X=Q[1],Z=o.useState(new Map),J=Z[0],ee=Z[1],te=o.useState(E),ne=te[0],ae=te[1],re=P(ne),ie=o.useState(S),se=ie[0],oe=ie[1],le=P(se),de=function(e){var t=k(),n=o.useState([]),a=n[0],r=n[1];return o.useEffect((function(){e.getOutline().then((function(e){if(t.current&&null!==e){var n=yt(e);r(n)}}))}),[]),a}(r),_e=o.useState(c),me=_e[0],ge=_e[1],fe=P(me),Ee=o.useRef(v),be=o.useRef("string"==typeof a?a:null),Se=o.useRef(-1),ve=o.useRef(-1),Te=o.useRef(s),ye=Rt({getCurrentPage:function(){return Ee.current.pageIndex},getCurrentScrollMode:function(){return Ee.current.scrollMode},jumpToPage:function(e){return je(e)},targetRef:B}),Ce=o.useState(-1),Ae=Ce[0],Ne=Ce[1],Re=o.useState(0),Oe=Re[0],Ie=Re[1],we=F({doc:r});o.useEffect((function(){return function(){ue.clear(),pe.clear()}}),[I]);var xe=o.useMemo((function(){return Object.assign({},Ot,d)}),[]),De=o.useMemo((function(){return Array(O).fill(0).map((function(e,t){var n=[u[t].pageHeight,u[t].pageWidth],a=Math.abs(q)%180==0?{height:n[0],width:n[1]}:{height:n[1],width:n[0]},r={height:a.height*me,width:a.width*me};return xe.transformSize({numPages:O,pageIndex:t,size:r})}))}),[q,me]),ke=vt({enableSmoothScroll:i,isRtl:M,numberOfItems:O,parentRef:B,scrollMode:ne,setRenderRange:b,sizes:De,viewMode:se}),Pe=D((function(){!be.current||Ee.current.fullScreenMode!==t.HG.Normal||s>0&&Te.current===s||Xe(be.current)}),200);!function(e){var t=e.targetRef,n=e.onResize;g((function(){var e=new ResizeObserver((function(e){e.forEach((function(e){n(e.target)}))})),a=t.current;if(a)return e.observe(a),function(){e.unobserve(a)}}),[])}({targetRef:B,onResize:Pe});var Me=function(e){var t=e;_.forEach((function(e){e.onViewerStateChange&&(t=e.onViewerStateChange(t))})),Ee.current=t},Le=function(){return B.current},Fe=function(){return Ee.current},Be=o.useCallback((function(e){j.markVisitedDestination(e)}),[]),Ue=o.useCallback((function(e){var n=e.pageIndex,a=e.bottomOffset,i=e.leftOffset,s=e.scaleTo,o=B.current,l=Ee.current;return o&&l?new Promise((function(e,c){he(r,n).then((function(r){var c=r.getViewport({scale:1}),d=0,p=("function"==typeof a?a(c.width,c.height):a)||0,_=("function"==typeof i?i(c.width,c.height):i)||0,m=l.scale;switch(s){case t.dD.PageFit:d=0,_=0,Xe(t.dD.PageFit);break;case t.dD.PageWidth:m=Tt(o,u[n].pageHeight,u[n].pageWidth,t.dD.PageWidth,S,O),d=(c.height-p)*m,_*=m,Xe(m);break;default:d=(c.height-p)*m,_*=m}switch(l.scrollMode){case t.VT.Horizontal:ke.scrollToItem(n,{left:_,top:0}).then((function(){e()}));break;case t.VT.Vertical:default:ke.scrollToItem(n,{left:0,top:d}).then((function(){e()}))}}))})):Promise.resolve()}),[]),Ge=o.useCallback((function(e){return j.markVisitedDestination(e),Ue(e)}),[]),ze=o.useCallback((function(){var e=j.getNextDestination();return e?Ue(e):Promise.resolve()}),[]),He=o.useCallback((function(){var e=j.getPreviousDestination();return e?Ue(e):Promise.resolve()}),[]),Ye=o.useCallback((function(){return ke.scrollToNextItem(Ee.current.pageIndex,It)}),[]),je=o.useCallback((function(e){return 0<=e&&e=O)){var a=u[n].pageHeight,i=u[n].pageWidth,s=t?"string"==typeof e?Tt(t,a,i,e,Ee.current.viewMode,O):e:1;be.current="string"==typeof e?e:null,s!==Ee.current.scale&&(Ie((function(e){return e+1})),we.markNotRendered(),ge(s),R({doc:r,scale:s}),Me(p(p({},Ee.current),{scale:s})))}}),[]),Ze=o.useCallback((function(e){ye.enterFullScreenMode(e)}),[]),Je=o.useCallback((function(){ye.exitFullScreenMode()}),[]);o.useEffect((function(){Me(p(p({},Ee.current),{fullScreenMode:ye.fullScreenMode}))}),[ye.fullScreenMode]),o.useEffect((function(){var e={enterFullScreenMode:Ze,exitFullScreenMode:Je,getPagesContainer:Le,getViewerState:Fe,jumpToDestination:Ge,jumpToNextDestination:ze,jumpToPreviousDestination:He,jumpToNextPage:Ye,jumpToPreviousPage:Ve,jumpToPage:je,openFile:qe,rotate:We,rotatePage:Ke,setViewerState:Me,switchScrollMode:Qe,switchViewMode:$e,zoom:Xe};return _.forEach((function(t){t.install&&t.install(e)})),function(){_.forEach((function(t){t.uninstall&&t.uninstall(e)}))}}),[I]),o.useEffect((function(){T({doc:r,file:n}),_.forEach((function(e){e.onDocumentLoad&&e.onDocumentLoad({doc:r,file:n})}))}),[I]);var et,tt,nt,at=ke.boundingClientRect;et=function(){s&&je(s)},tt=at.height>0&&at.width>0,nt=o.useRef(!1),g((function(){tt&&!nt.current&&(nt.current=!0,et())}),[et,tt]),g((function(){var e=Ee.current.pageIndex;e>-1&&re!==ne&&ke.scrollToItem(e,It).then((function(){ye.fullScreenMode===t.HG.EnteredCompletely&&(i||we.markNotRendered(),Se.current=-1)}))}),[ne]),g((function(){var e=Ee.current.pageIndex;e>-1&&K!==q&&ke.scrollToItem(e,It)}),[q]),g((function(){0!=fe&&fe!=Ee.current.scale&&ke.zoom(Ee.current.scale/fe,Ee.current.pageIndex).then((function(){ye.fullScreenMode===t.HG.EnteredCompletely&&(ve.current=-1)}))}),[me]),g((function(){if(le!==Ee.current.viewMode){var e=ke.startPage,t=ke.endPage,n=ke.virtualItems;we.markNotRendered(),we.setRange(e,t);for(var a=function(e){var t=n.find((function(t){return t.index===e}));t&&we.setVisibility(e,t.visibility)},r=e;r<=t;r++)a(r);st()}}),[se]),g((function(){var e=Ee.current.pageIndex;e>-1&&le!==se&&ke.scrollToItem(e,It)}),[se]),g((function(){var e=Ee.current.pageIndex;e>0&&e===s&&Te.current===s&&be.current&&(Te.current=-1,Xe(be.current))}),[z]),o.useEffect((function(){ke.isSmoothScrolling||null!==Y.current&&Y.current===z||(Y.current=z,C({currentPage:z,doc:r}))}),[z,ke.isSmoothScrolling]),o.useEffect((function(){ye.fullScreenMode===t.HG.Entering&&Ee.current.scrollMode===t.VT.Page&&(Se.current=Ee.current.pageIndex),ye.fullScreenMode===t.HG.EnteredCompletely&&Ee.current.scrollMode===t.VT.Page&&i&&(Se.current=-1),ye.fullScreenMode===t.HG.EnteredCompletely&&be.current&&(ve.current=Ee.current.pageIndex,Xe(be.current))}),[ye.fullScreenMode]),o.useEffect((function(){if(ye.fullScreenMode!==t.HG.Entering&&ye.fullScreenMode!==t.HG.Exitting&&!ke.isSmoothScrolling){var e=ke.startPage,n=ke.endPage,a=ke.maxVisbilityIndex,r=ke.virtualItems,i=a,s=ye.fullScreenMode===t.HG.Entered||ye.fullScreenMode===t.HG.EnteredCompletely;if(!(s&&i!==Se.current&&Se.current>-1||s&&i!==ve.current&&ve.current>-1)){H(i),Me(p(p({},Ee.current),{pageIndex:i})),we.setRange(e,n);for(var o=function(e){var t=r.find((function(t){return t.index===e}));t&&we.setVisibility(e,t.visibility)},l=e;l<=n;l++)o(l);st()}}}),[ke.startPage,ke.endPage,ke.isSmoothScrolling,ke.maxVisbilityIndex,ye.fullScreenMode,$,q,me]);var rt=o.useCallback((function(e){we.markRendered(e),st()}),[Oe]),st=function(){var e=we.getHighestPriorityPage();e>-1&&we.isInRange(e)&&(we.markRendering(e),Ne(e))},ot=function(e){var t=z-1,n=z+1;switch(e){case"FirstPage":je(0);break;case"LastPage":je(O-1);break;case"NextPage":n=0&&je(t)}},lt=o.useCallback((function(){var e=ke.virtualItems,n=[];switch(se){case t.nE.DualPage:n=ce(e,2);break;case t.nE.DualPageWithCover:e.length&&(n=0===e[0].index?[[e[0]]].concat(ce(e.slice(1),2)):ce(e,2));break;case t.nE.SinglePage:default:n=ce(e,1)}var a=w&&w.core?w.core.pageLabel:"Page {{pageIndex}}",i={attrs:{className:"rpv-core__inner-container","data-testid":"core__inner-container",ref:L,style:{height:"100%"}},children:o.createElement(o.Fragment,null),subSlot:{attrs:{"data-testid":"core__inner-pages",className:h({"rpv-core__inner-pages":!0,"rpv-core__inner-pages--horizontal":ne===t.VT.Horizontal,"rpv-core__inner-pages--rtl":M,"rpv-core__inner-pages--single":ne===t.VT.Page,"rpv-core__inner-pages--vertical":ne===t.VT.Vertical,"rpv-core__inner-pages--wrapped":ne===t.VT.Wrapped}),ref:B,style:{height:"100%",position:"relative"}},children:o.createElement("div",{"data-testid":"core__inner-current-page-".concat(z),style:Object.assign({"--scale-factor":me},ke.getContainerStyles())},n.map((function(e){return o.createElement("div",{className:h({"rpv-core__inner-page-container":!0,"rpv-core__inner-page-container--single":ne===t.VT.Page}),style:ke.getItemContainerStyles(e[0]),key:"".concat(e[0].index,"-").concat(se)},e.map((function(e){var n=se===t.nE.DualPageWithCover&&(0===e.index||O%2==0&&e.index===O-1);return o.createElement("div",{"aria-label":a.replace("{{pageIndex}}","".concat(e.index+1)),className:h({"rpv-core__inner-page":!0,"rpv-core__inner-page--dual-even":se===t.nE.DualPage&&e.index%2==0,"rpv-core__inner-page--dual-odd":se===t.nE.DualPage&&e.index%2==1,"rpv-core__inner-page--dual-cover":n,"rpv-core__inner-page--dual-cover-even":se===t.nE.DualPageWithCover&&!n&&e.index%2==0,"rpv-core__inner-page--dual-cover-odd":se===t.nE.DualPageWithCover&&!n&&e.index%2==1,"rpv-core__inner-page--single":se===t.nE.SinglePage&&ne===t.VT.Page}),role:"region",key:"".concat(e.index,"-").concat(se),style:Object.assign({},ke.getItemStyles(e),xe.buildPageStyles({numPages:O,pageIndex:e.index,scrollMode:ne,viewMode:se}))},o.createElement(it,{doc:r,measureRef:e.measureRef,outlines:de,pageIndex:e.index,pageRotation:J.has(e.index)?J.get(e.index):0,pageSize:u[e.index],plugins:_,renderPage:f,renderQueueKey:Oe,rotation:q,scale:me,shouldRender:Ae===e.index,viewMode:se,onExecuteNamedAction:ot,onJumpFromLinkAnnotation:Be,onJumpToDest:Ge,onRenderCompleted:rt,onRotatePage:Ke}))})))})))}};return _.forEach((function(e){e.renderViewer&&(i=e.renderViewer({containerRef:L,doc:r,pagesContainerRef:B,pagesRotation:J,pageSizes:u,rotation:q,slot:i,themeContext:x,jumpToPage:je,openFile:qe,rotate:We,rotatePage:Ke,switchScrollMode:Qe,switchViewMode:$e,zoom:Xe}))})),i}),[_,ke]),ct=o.useCallback((function(e){return o.createElement("div",p({},e.attrs,{style:e.attrs&&e.attrs.style?e.attrs.style:{}}),e.children,e.subSlot&&ct(e.subSlot))}),[]);return ct(lt())},xt=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],Dt=function(e){var n=e.defaultScale,a=e.doc,r=e.render,i=e.scrollMode,s=e.viewMode,l=o.useRef(),c=o.useState({pageSizes:[],scale:0}),d=c[0],u=c[1];return o.useLayoutEffect((function(){var e=Array(a.numPages).fill(0).map((function(e,t){return new Promise((function(e,n){he(a,t).then((function(t){var n=t.getViewport({scale:1});e({pageHeight:n.height,pageWidth:n.width,rotation:n.rotation})}))}))}));Promise.all(e).then((function(e){var r=l.current;if(r&&0!==e.length){var o=e[0].pageWidth,c=e[0].pageHeight,d=r.parentElement,p=(d.clientWidth-45)/o,_=(d.clientHeight-45)/c,m=p;switch(i){case t.VT.Horizontal:m=Math.min(p,_);break;case t.VT.Vertical:default:m=p}var h,g,f=n?"string"==typeof n?Tt(d,c,o,n,s,a.numPages):n:(h=m,-1===(g=xt.findIndex((function(e){return e>=h})))||0===g?h:xt[g-1]);u({pageSizes:e,scale:f})}}))}),[a.loadingTask.docId]),0===d.pageSizes.length||0===d.scale?o.createElement("div",{className:"rpv-core__page-size-calculator","data-testid":"core__page-size-calculating",ref:l},o.createElement(v,null)):r(d.pageSizes,d.scale)},kt=function(){},Pt=function(e){function t(t,n){var a=e.call(this)||this;return a.verifyPassword=t,a.passwordStatus=n,a}return d(t,e),t}(kt),Mt=function(e){var n=e.passwordStatus,a=e.renderProtectedView,r=e.verifyPassword,i=e.onDocumentAskPassword,s=o.useContext(U).l10n,l=o.useState(""),c=l[0],d=l[1],u=o.useContext(m).direction===t.z4.RightToLeft,p=function(){return r(c)};return o.useEffect((function(){i&&i({verifyPassword:r})}),[]),a?a({passwordStatus:n,verifyPassword:r}):o.createElement("div",{className:"rpv-core__asking-password-wrapper"},o.createElement("div",{className:h({"rpv-core__asking-password":!0,"rpv-core__asking-password--rtl":u})},o.createElement("div",{className:"rpv-core__asking-password-message"},n===t.a9.RequiredPassword&&s.core.askingPassword.requirePasswordToOpen,n===t.a9.WrongPassword&&s.core.wrongPassword.tryAgain),o.createElement("div",{className:"rpv-core__asking-password-body"},o.createElement("div",{className:h({"rpv-core__asking-password-input":!0,"rpv-core__asking-password-input--ltr":!u,"rpv-core__asking-password-input--rtl":u})},o.createElement(T,{testId:"core__asking-password-input",type:"password",value:c,onChange:d,onKeyDown:function(e){"Enter"===e.key&&p()}})),o.createElement(S,{onClick:p},s.core.askingPassword.submit))))},Lt=function(e){function t(t){var n=e.call(this)||this;return n.doc=t,n}return d(t,e),t}(kt),Ft=function(e){function t(t){var n=e.call(this)||this;return n.error=t,n}return d(t,e),t}(kt),Bt=function(e){function t(t){var n=e.call(this)||this;return n.percentages=t,n}return d(t,e),t}(kt),Ut=function(e){var n=e.characterMap,a=e.file,r=e.httpHeaders,i=e.render,s=e.renderError,c=e.renderLoader,d=e.renderProtectedView,u=e.transformGetDocumentParams,p=e.withCredentials,_=e.onDocumentAskPassword,g=o.useContext(m).direction===t.z4.RightToLeft,f=o.useState(new Bt(0)),E=f[0],b=f[1],S=o.useRef(""),T=k();return o.useEffect((function(){S.current="",b(new Bt(0));var e=new l.PDFWorker({name:"PDFWorker_".concat(Date.now())}),i=Object.assign({httpHeaders:r,withCredentials:p,worker:e},"string"==typeof a?{url:a}:{data:a},n?{cMapUrl:n.url,cMapPacked:n.isCompressed}:{}),s=u?u(i):i,o=l.getDocument(s);return o.onPassword=function(e,n){switch(n){case l.PasswordResponses.NEED_PASSWORD:T.current&&b(new Pt(e,t.a9.RequiredPassword));break;case l.PasswordResponses.INCORRECT_PASSWORD:T.current&&b(new Pt(e,t.a9.WrongPassword))}},o.onProgress=function(e){var t=e.total>0?Math.min(100,100*e.loaded/e.total):100;T.current&&""===S.current&&b(new Bt(t))},o.promise.then((function(e){S.current=e.loadingTask.docId,T.current&&b(new Lt(e))}),(function(t){return T.current&&!e.destroyed&&b(new Ft({message:t.message||"Cannot load document",name:t.name}))})),function(){o.destroy(),e.destroy()}}),[a]),E instanceof Pt?o.createElement(Mt,{passwordStatus:E.passwordStatus,renderProtectedView:d,verifyPassword:E.verifyPassword,onDocumentAskPassword:_}):E instanceof Lt?i(E.doc):E instanceof Ft?s?s(E.error):o.createElement("div",{className:h({"rpv-core__doc-error":!0,"rpv-core__doc-error--rtl":g})},o.createElement("div",{className:"rpv-core__doc-error-text"},E.error.message)):o.createElement("div",{"data-testid":"core__doc-loading",className:h({"rpv-core__doc-loading":!0,"rpv-core__doc-loading--rtl":g})},c?c(E.percentages):o.createElement(v,null))},Gt=function(e){return{startPage:e.startPage-3,endPage:e.endPage+3}};t.Viewer=function(e){var n=e.characterMap,a=e.defaultScale,r=e.enableSmoothScroll,i=void 0===r||r,s=e.fileUrl,l=e.httpHeaders,c=void 0===l?{}:l,d=e.initialPage,u=void 0===d?0:d,p=e.pageLayout,_=e.initialRotation,h=void 0===_?0:_,g=e.localization,E=e.plugins,b=void 0===E?[]:E,S=e.renderError,v=e.renderLoader,T=e.renderPage,y=e.renderProtectedView,C=e.scrollMode,A=void 0===C?t.VT.Vertical:C,N=e.setRenderRange,R=void 0===N?Gt:N,O=e.transformGetDocumentParams,I=e.theme,w=void 0===I?{direction:t.z4.LeftToRight,theme:"light"}:I,x=e.viewMode,D=void 0===x?t.nE.SinglePage:x,k=e.withCredentials,M=void 0!==k&&k,L=e.onDocumentAskPassword,F=e.onDocumentLoad,G=void 0===F?function(){}:F,z=e.onPageChange,H=void 0===z?function(){}:z,Y=e.onRotate,j=void 0===Y?function(){}:Y,V=e.onRotatePage,q=void 0===V?function(){}:V,W=e.onSwitchTheme,K=void 0===W?function(){}:W,Q=e.onZoom,$=void 0===Q?function(){}:Q,X=o.useState({data:s,name:"string"==typeof s?s:"",shouldLoad:!1}),Z=X[0],J=X[1],ee=function(e,t){J({data:t,name:e,shouldLoad:!0})},te=o.useState(!1),ne=te[0],ae=te[1],re=P(Z);o.useEffect((function(){var e,t,n,a;e=re.data,a=typeof(t=s),"string"===(n=typeof e)&&"string"===a&&e===t||"object"===n&&"object"===a&&e.length===t.length&&e.every((function(e,n){return e===t[n]}))||J({data:s,name:"string"==typeof s?s:"",shouldLoad:ne})}),[s,ne]);var ie=f({onVisibilityChanged:function(e){ae(e.isVisible),e.isVisible&&J((function(e){return Object.assign({},e,{shouldLoad:!0})}))}}),se="string"==typeof w?{direction:t.z4.LeftToRight,theme:w}:w,oe=o.useState(g||B),le=oe[0],ce=oe[1],de={l10n:le,setL10n:ce},ue=Object.assign({},{direction:se.direction},function(e,t){var n=o.useMemo((function(){return"auto"===e?"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}),[]),a=o.useState(n),r=a[0],i=a[1],s=P(r);return o.useEffect((function(){if("auto"===e){var t=window.matchMedia("(prefers-color-scheme: dark)"),n=function(e){i(e.matches?"dark":"light")};return t.addEventListener("change",n),function(){return t.removeEventListener("change",n)}}}),[]),o.useEffect((function(){r!==s&&t&&t(r)}),[r]),o.useEffect((function(){e!==r&&i(e)}),[e]),{currentTheme:r,setCurrentTheme:i}}(se.theme||"light",K));return o.useEffect((function(){g&&ce(g)}),[g]),o.createElement(U.Provider,{value:de},o.createElement(m.Provider,{value:ue},o.createElement("div",{ref:ie,className:"rpv-core__viewer rpv-core__viewer--".concat(ue.currentTheme),"data-testid":"core__viewer",style:{height:"100%",width:"100%"}},Z.shouldLoad&&o.createElement(Ut,{characterMap:n,file:Z.data,httpHeaders:c,render:function(e){return o.createElement(Dt,{defaultScale:a,doc:e,render:function(n,r){return o.createElement(wt,{currentFile:{data:Z.data,name:Z.name},defaultScale:a,doc:e,enableSmoothScroll:i,initialPage:u,initialRotation:h,initialScale:r,pageLayout:p,pageSizes:n,plugins:b,renderPage:T,scrollMode:A,setRenderRange:R,viewMode:D,viewerState:{file:Z,fullScreenMode:t.HG.Normal,pageIndex:-1,pageHeight:n[0].pageHeight,pageWidth:n[0].pageWidth,pagesRotation:new Map,rotation:h,scale:r,scrollMode:A,viewMode:D},onDocumentLoad:G,onOpenFile:ee,onPageChange:H,onRotate:j,onRotatePage:q,onZoom:$})},scrollMode:A,viewMode:D})},renderError:S,renderLoader:v,renderProtectedView:y,transformGetDocumentParams:O,withCredentials:M,onDocumentAskPassword:L}))))},t.Worker=function(e){var t=e.children,n=e.workerUrl;return l.GlobalWorkerOptions.workerSrc=n,o.createElement(o.Fragment,null,t)}},3237:(e,t,n)=>{"use strict";e.exports=n(4839)},7629:function(e,t,n){e.exports=function(e){"use strict";function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const n=t(e),a=new Map,r={set(e,t,n){a.has(e)||a.set(e,new Map);const r=a.get(e);r.has(t)||0===r.size?r.set(t,n):console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(r.keys())[0],"."))},get:(e,t)=>a.has(e)&&a.get(e).get(t)||null,remove(e,t){if(!a.has(e))return;const n=a.get(e);n.delete(t),0===n.size&&a.delete(e)}},i=1e6,s=1e3,o="transitionend",l=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>"#".concat(CSS.escape(t))))),e),c=e=>null===e||void 0===e?"".concat(e):Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),d=e=>{do{e+=Math.floor(Math.random()*i)}while(document.getElementById(e));return e},u=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const a=Number.parseFloat(t),r=Number.parseFloat(n);return a||r?(t=t.split(",")[0],n=n.split(",")[0],(Number.parseFloat(t)+Number.parseFloat(n))*s):0},p=e=>{e.dispatchEvent(new Event(o))},_=e=>!(!e||"object"!==typeof e)&&("undefined"!==typeof e.jquery&&(e=e[0]),"undefined"!==typeof e.nodeType),m=e=>_(e)?e.jquery?e[0]:e:"string"===typeof e&&e.length>0?document.querySelector(l(e)):null,h=e=>{if(!_(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},g=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||("undefined"!==typeof e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),f=e=>{if(!document.documentElement.attachShadow)return null;if("function"===typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?f(e.parentNode):null},E=()=>{},b=e=>{e.offsetHeight},S=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,v=[],T=e=>{"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of v)e()})),v.push(e)):e()},y=()=>"rtl"===document.documentElement.dir,C=e=>{T((()=>{const t=S();if(t){const n=e.NAME,a=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=a,e.jQueryInterface)}}))},A=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"===typeof e?e(...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]):t},N=function(e,t){if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])return void A(e);const n=5,a=u(t)+n;let r=!1;const i=n=>{let{target:a}=n;a===t&&(r=!0,t.removeEventListener(o,i),A(e))};t.addEventListener(o,i),setTimeout((()=>{r||p(t)}),a)},R=(e,t,n,a)=>{const r=e.length;let i=e.indexOf(t);return-1===i?!n&&a?e[r-1]:e[0]:(i+=n?1:-1,a&&(i=(i+r)%r),e[Math.max(0,Math.min(i,r-1))])},O=/[^.]*(?=\..*)\.|.*/,I=/\..*/,w=/::\d+$/,x={};let D=1;const k={mouseenter:"mouseover",mouseleave:"mouseout"},P=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function M(e,t){return t&&"".concat(t,"::").concat(D++)||e.uidEvent||D++}function L(e){const t=M(e);return e.uidEvent=t,x[t]=x[t]||{},x[t]}function F(e,t){return function n(a){return q(a,{delegateTarget:e}),n.oneOff&&V.off(e,a.type,t),t.apply(e,[a])}}function B(e,t,n){return function a(r){const i=e.querySelectorAll(t);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(const o of i)if(o===s)return q(r,{delegateTarget:s}),a.oneOff&&V.off(e,r.type,t,n),n.apply(s,[r])}}function U(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function G(e,t,n){const a="string"===typeof t,r=a?n:t||n;let i=j(e);return P.has(i)||(i=e),[a,r,i]}function z(e,t,n,a,r){if("string"!==typeof t||!e)return;let[i,s,o]=G(t,n,a);if(t in k){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const l=L(e),c=l[o]||(l[o]={}),d=U(c,s,i?n:null);if(d)return void(d.oneOff=d.oneOff&&r);const u=M(s,t.replace(O,"")),p=i?B(e,n,s):F(e,s);p.delegationSelector=i?n:null,p.callable=s,p.oneOff=r,p.uidEvent=u,c[u]=p,e.addEventListener(o,p,i)}function H(e,t,n,a,r){const i=U(t[n],a,r);i&&(e.removeEventListener(n,i,Boolean(r)),delete t[n][i.uidEvent])}function Y(e,t,n,a){const r=t[n]||{};for(const[i,s]of Object.entries(r))i.includes(a)&&H(e,t,n,s.callable,s.delegationSelector)}function j(e){return e=e.replace(I,""),k[e]||e}const V={on(e,t,n,a){z(e,t,n,a,!1)},one(e,t,n,a){z(e,t,n,a,!0)},off(e,t,n,a){if("string"!==typeof t||!e)return;const[r,i,s]=G(t,n,a),o=s!==t,l=L(e),c=l[s]||{},d=t.startsWith(".");if("undefined"===typeof i){if(d)for(const n of Object.keys(l))Y(e,l,n,t.slice(1));for(const[n,a]of Object.entries(c)){const r=n.replace(w,"");o&&!t.includes(r)||H(e,l,s,a.callable,a.delegationSelector)}}else{if(!Object.keys(c).length)return;H(e,l,s,i,r?n:null)}},trigger(e,t,n){if("string"!==typeof t||!e)return null;const a=S();let r=null,i=!0,s=!0,o=!1;t!==j(t)&&a&&(r=a.Event(t,n),a(e).trigger(r),i=!r.isPropagationStopped(),s=!r.isImmediatePropagationStopped(),o=r.isDefaultPrevented());const l=q(new Event(t,{bubbles:i,cancelable:!0}),n);return o&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function q(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const[a,r]of Object.entries(t))try{e[a]=r}catch(n){Object.defineProperty(e,a,{configurable:!0,get:()=>r})}return e}function W(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!==typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function K(e){return e.replace(/[A-Z]/g,(e=>"-".concat(e.toLowerCase())))}const Q={setDataAttribute(e,t,n){e.setAttribute("data-bs-".concat(K(t)),n)},removeDataAttribute(e,t){e.removeAttribute("data-bs-".concat(K(t)))},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const a of n){let n=a.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=W(e.dataset[a])}return t},getDataAttribute:(e,t)=>W(e.getAttribute("data-bs-".concat(K(t))))};class ${static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=_(t)?Q.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"===typeof n?n:{},..._(t)?Q.getDataAttributes(t):{},..."object"===typeof e?e:{}}}_typeCheckConfig(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType;for(const[n,a]of Object.entries(t)){const t=e[n],r=_(t)?"element":c(t);if(!new RegExp(a).test(r))throw new TypeError("".concat(this.constructor.NAME.toUpperCase(),': Option "').concat(n,'" provided type "').concat(r,'" but expected type "').concat(a,'".'))}}}const X="5.3.3";class Z extends ${constructor(e,t){super(),(e=m(e))&&(this._element=e,this._config=this._getConfig(t),r.set(this._element,this.constructor.DATA_KEY,this))}dispose(){r.remove(this._element,this.constructor.DATA_KEY),V.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t){N(e,t,!(arguments.length>2&&void 0!==arguments[2])||arguments[2])}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return r.get(m(e),this.DATA_KEY)}static getOrCreateInstance(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"===typeof t?t:null)}static get VERSION(){return X}static get DATA_KEY(){return"bs.".concat(this.NAME)}static get EVENT_KEY(){return".".concat(this.DATA_KEY)}static eventName(e){return"".concat(e).concat(this.EVENT_KEY)}}const J=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((e=>l(e))).join(","):null},ee={find(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let a=e.parentNode.closest(t);for(;a;)n.push(a),a=a.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>"".concat(e,':not([tabindex^="-"])'))).join(",");return this.find(t,e).filter((e=>!g(e)&&h(e)))},getSelectorFromElement(e){const t=J(e);return t&&ee.findOne(t)?t:null},getElementFromSelector(e){const t=J(e);return t?ee.findOne(t):null},getMultipleElementsFromSelector(e){const t=J(e);return t?ee.find(t):[]}},te=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide";const n="click.dismiss".concat(e.EVENT_KEY),a=e.NAME;V.on(document,n,'[data-bs-dismiss="'.concat(a,'"]'),(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),g(this))return;const r=ee.getElementFromSelector(this)||this.closest(".".concat(a));e.getOrCreateInstance(r)[t]()}))},ne="alert",ae=".".concat("bs.alert"),re="close".concat(ae),ie="closed".concat(ae),se="fade",oe="show";class le extends Z{static get NAME(){return ne}close(){if(V.trigger(this._element,re).defaultPrevented)return;this._element.classList.remove(oe);const e=this._element.classList.contains(se);this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),V.trigger(this._element,ie),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=le.getOrCreateInstance(this);if("string"===typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}te(le,"close"),C(le);const ce="button",de=".".concat("bs.button"),ue=".data-api",pe="active",_e='[data-bs-toggle="button"]',me="click".concat(de).concat(ue);class he extends Z{static get NAME(){return ce}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(pe))}static jQueryInterface(e){return this.each((function(){const t=he.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}V.on(document,me,_e,(e=>{e.preventDefault();const t=e.target.closest(_e);he.getOrCreateInstance(t).toggle()})),C(he);const ge="swipe",fe=".bs.swipe",Ee="touchstart".concat(fe),be="touchmove".concat(fe),Se="touchend".concat(fe),ve="pointerdown".concat(fe),Te="pointerup".concat(fe),ye="touch",Ce="pen",Ae="pointer-event",Ne=40,Re={endCallback:null,leftCallback:null,rightCallback:null},Oe={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ie extends ${constructor(e,t){super(),this._element=e,e&&Ie.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Re}static get DefaultType(){return Oe}static get NAME(){return ge}dispose(){V.off(this._element,fe)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),A(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=Ne)return;const t=e/this._deltaX;this._deltaX=0,t&&A(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(V.on(this._element,ve,(e=>this._start(e))),V.on(this._element,Te,(e=>this._end(e))),this._element.classList.add(Ae)):(V.on(this._element,Ee,(e=>this._start(e))),V.on(this._element,be,(e=>this._move(e))),V.on(this._element,Se,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===Ce||e.pointerType===ye)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const we="carousel",xe=".".concat("bs.carousel"),De=".data-api",ke="ArrowLeft",Pe="ArrowRight",Me=500,Le="next",Fe="prev",Be="left",Ue="right",Ge="slide".concat(xe),ze="slid".concat(xe),He="keydown".concat(xe),Ye="mouseenter".concat(xe),je="mouseleave".concat(xe),Ve="dragstart".concat(xe),qe="load".concat(xe).concat(De),We="click".concat(xe).concat(De),Ke="carousel",Qe="active",$e="slide",Xe="carousel-item-end",Ze="carousel-item-start",Je="carousel-item-next",et="carousel-item-prev",tt=".active",nt=".carousel-item",at=tt+nt,rt=".carousel-item img",it=".carousel-indicators",st="[data-bs-slide], [data-bs-slide-to]",ot='[data-bs-ride="carousel"]',lt={[ke]:Ue,[Pe]:Be},ct={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},dt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ut extends Z{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ee.findOne(it,this._element),this._addEventListeners(),this._config.ride===Ke&&this.cycle()}static get Default(){return ct}static get DefaultType(){return dt}static get NAME(){return we}next(){this._slide(Le)}nextWhenVisible(){!document.hidden&&h(this._element)&&this.next()}prev(){this._slide(Fe)}pause(){this._isSliding&&p(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?V.one(this._element,ze,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void V.one(this._element,ze,(()=>this.to(e)));const n=this._getItemIndex(this._getActive());if(n===e)return;const a=e>n?Le:Fe;this._slide(a,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&V.on(this._element,He,(e=>this._keydown(e))),"hover"===this._config.pause&&(V.on(this._element,Ye,(()=>this.pause())),V.on(this._element,je,(()=>this._maybeEnableCycle()))),this._config.touch&&Ie.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of ee.find(rt,this._element))V.on(t,Ve,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder(Be)),rightCallback:()=>this._slide(this._directionToOrder(Ue)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),Me+this._config.interval))}};this._swipeHelper=new Ie(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=lt[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=ee.findOne(tt,this._indicatorsElement);t.classList.remove(Qe),t.removeAttribute("aria-current");const n=ee.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(Qe),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this._isSliding)return;const n=this._getActive(),a=e===Le,r=t||R(this._getItems(),n,a,this._config.wrap);if(r===n)return;const i=this._getItemIndex(r),s=t=>V.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:i});if(s(Ge).defaultPrevented)return;if(!n||!r)return;const o=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(i),this._activeElement=r;const l=a?Ze:Xe,c=a?Je:et;r.classList.add(c),b(r),n.classList.add(l),r.classList.add(l);const d=()=>{r.classList.remove(l,c),r.classList.add(Qe),n.classList.remove(Qe,c,l),this._isSliding=!1,s(ze)};this._queueCallback(d,n,this._isAnimated()),o&&this.cycle()}_isAnimated(){return this._element.classList.contains($e)}_getActive(){return ee.findOne(at,this._element)}_getItems(){return ee.find(nt,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return y()?e===Be?Fe:Le:e===Be?Le:Fe}_orderToDirection(e){return y()?e===Fe?Be:Ue:e===Fe?Ue:Be}static jQueryInterface(e){return this.each((function(){const t=ut.getOrCreateInstance(this,e);if("number"!==typeof e){if("string"===typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}else t.to(e)}))}}V.on(document,We,st,(function(e){const t=ee.getElementFromSelector(this);if(!t||!t.classList.contains(Ke))return;e.preventDefault();const n=ut.getOrCreateInstance(t),a=this.getAttribute("data-bs-slide-to");return a?(n.to(a),void n._maybeEnableCycle()):"next"===Q.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())})),V.on(window,qe,(()=>{const e=ee.find(ot);for(const t of e)ut.getOrCreateInstance(t)})),C(ut);const pt="collapse",_t=".".concat("bs.collapse"),mt=".data-api",ht="show".concat(_t),gt="shown".concat(_t),ft="hide".concat(_t),Et="hidden".concat(_t),bt="click".concat(_t).concat(mt),St="show",vt="collapse",Tt="collapsing",yt="collapsed",Ct=":scope .".concat(vt," .").concat(vt),At="collapse-horizontal",Nt="width",Rt="height",Ot=".collapse.show, .collapse.collapsing",It='[data-bs-toggle="collapse"]',wt={parent:null,toggle:!0},xt={parent:"(null|element)",toggle:"boolean"};class Dt extends Z{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=ee.find(It);for(const a of n){const e=ee.getSelectorFromElement(a),t=ee.find(e).filter((e=>e===this._element));null!==e&&t.length&&this._triggerArray.push(a)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return wt}static get DefaultType(){return xt}static get NAME(){return pt}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(Ot).filter((e=>e!==this._element)).map((e=>Dt.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(V.trigger(this._element,ht).defaultPrevented)return;for(const i of e)i.hide();const t=this._getDimension();this._element.classList.remove(vt),this._element.classList.add(Tt),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=()=>{this._isTransitioning=!1,this._element.classList.remove(Tt),this._element.classList.add(vt,St),this._element.style[t]="",V.trigger(this._element,gt)},a=t[0].toUpperCase()+t.slice(1),r="scroll".concat(a);this._queueCallback(n,this._element,!0),this._element.style[t]="".concat(this._element[r],"px")}hide(){if(this._isTransitioning||!this._isShown())return;if(V.trigger(this._element,ft).defaultPrevented)return;const e=this._getDimension();this._element.style[e]="".concat(this._element.getBoundingClientRect()[e],"px"),b(this._element),this._element.classList.add(Tt),this._element.classList.remove(vt,St);for(const n of this._triggerArray){const e=ee.getElementFromSelector(n);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([n],!1)}this._isTransitioning=!0;const t=()=>{this._isTransitioning=!1,this._element.classList.remove(Tt),this._element.classList.add(vt),V.trigger(this._element,Et)};this._element.style[e]="",this._queueCallback(t,this._element,!0)}_isShown(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._element).classList.contains(St)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=m(e.parent),e}_getDimension(){return this._element.classList.contains(At)?Nt:Rt}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(It);for(const t of e){const e=ee.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=ee.find(Ct,this._config.parent);return ee.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle(yt,!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"===typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const n=Dt.getOrCreateInstance(this,t);if("string"===typeof e){if("undefined"===typeof n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}V.on(document,bt,It,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const t of ee.getMultipleElementsFromSelector(this))Dt.getOrCreateInstance(t,{toggle:!1}).toggle()})),C(Dt);const kt="dropdown",Pt=".".concat("bs.dropdown"),Mt=".data-api",Lt="Escape",Ft="Tab",Bt="ArrowUp",Ut="ArrowDown",Gt=2,zt="hide".concat(Pt),Ht="hidden".concat(Pt),Yt="show".concat(Pt),jt="shown".concat(Pt),Vt="click".concat(Pt).concat(Mt),qt="keydown".concat(Pt).concat(Mt),Wt="keyup".concat(Pt).concat(Mt),Kt="show",Qt="dropup",$t="dropend",Xt="dropstart",Zt="dropup-center",Jt="dropdown-center",en='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',tn="".concat(en,".").concat(Kt),nn=".dropdown-menu",an=".navbar",rn=".navbar-nav",sn=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",on=y()?"top-end":"top-start",ln=y()?"top-start":"top-end",cn=y()?"bottom-end":"bottom-start",dn=y()?"bottom-start":"bottom-end",un=y()?"left-start":"right-start",pn=y()?"right-start":"left-start",_n="top",mn="bottom",hn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},gn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class fn extends Z{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=ee.next(this._element,nn)[0]||ee.prev(this._element,nn)[0]||ee.findOne(nn,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return hn}static get DefaultType(){return gn}static get NAME(){return kt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(g(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!V.trigger(this._element,Yt,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(rn))for(const e of[].concat(...document.body.children))V.on(e,"mouseover",E);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Kt),this._element.classList.add(Kt),V.trigger(this._element,jt,e)}}hide(){if(g(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!V.trigger(this._element,zt,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))V.off(e,"mouseover",E);this._popper&&this._popper.destroy(),this._menu.classList.remove(Kt),this._element.classList.remove(Kt),this._element.setAttribute("aria-expanded","false"),Q.removeDataAttribute(this._menu,"popper"),V.trigger(this._element,Ht,e)}}_getConfig(e){if("object"===typeof(e=super._getConfig(e)).reference&&!_(e.reference)&&"function"!==typeof e.reference.getBoundingClientRect)throw new TypeError("".concat(kt.toUpperCase(),': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'));return e}_createPopper(){if("undefined"===typeof n)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:_(this._config.reference)?e=m(this._config.reference):"object"===typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=n.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Kt)}_getPlacement(){const e=this._parent;if(e.classList.contains($t))return un;if(e.classList.contains(Xt))return pn;if(e.classList.contains(Zt))return _n;if(e.classList.contains(Jt))return mn;const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains(Qt)?t?ln:on:t?dn:cn}_detectNavbar(){return null!==this._element.closest(an)}_getOffset(){const{offset:e}=this._config;return"string"===typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"===typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Q.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...A(this._config.popperConfig,[e])}}_selectMenuItem(e){let{key:t,target:n}=e;const a=ee.find(sn,this._menu).filter((e=>h(e)));a.length&&R(a,n,t===Ut,!a.includes(n)).focus()}static jQueryInterface(e){return this.each((function(){const t=fn.getOrCreateInstance(this,e);if("string"===typeof e){if("undefined"===typeof t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}static clearMenus(e){if(e.button===Gt||"keyup"===e.type&&e.key!==Ft)return;const t=ee.find(tn);for(const n of t){const t=fn.getInstance(n);if(!t||!1===t._config.autoClose)continue;const a=e.composedPath(),r=a.includes(t._menu);if(a.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&e.key===Ft||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const i={relatedTarget:t._element};"click"===e.type&&(i.clickEvent=e),t._completeHide(i)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n=e.key===Lt,a=[Bt,Ut].includes(e.key);if(!a&&!n)return;if(t&&!n)return;e.preventDefault();const r=this.matches(en)?this:ee.prev(this,en)[0]||ee.next(this,en)[0]||ee.findOne(en,e.delegateTarget.parentNode),i=fn.getOrCreateInstance(r);if(a)return e.stopPropagation(),i.show(),void i._selectMenuItem(e);i._isShown()&&(e.stopPropagation(),i.hide(),r.focus())}}V.on(document,qt,en,fn.dataApiKeydownHandler),V.on(document,qt,nn,fn.dataApiKeydownHandler),V.on(document,Vt,fn.clearMenus),V.on(document,Wt,fn.clearMenus),V.on(document,Vt,en,(function(e){e.preventDefault(),fn.getOrCreateInstance(this).toggle()})),C(fn);const En="backdrop",bn="fade",Sn="show",vn="mousedown.bs.".concat(En),Tn={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},yn={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Cn extends ${constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Tn}static get DefaultType(){return yn}static get NAME(){return En}show(e){if(!this._config.isVisible)return void A(e);this._append();const t=this._getElement();this._config.isAnimated&&b(t),t.classList.add(Sn),this._emulateAnimation((()=>{A(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(Sn),this._emulateAnimation((()=>{this.dispose(),A(e)}))):A(e)}dispose(){this._isAppended&&(V.off(this._element,vn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(bn),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=m(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),V.on(e,vn,(()=>{A(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){N(e,this._getElement(),this._config.isAnimated)}}const An="focustrap",Nn=".".concat("bs.focustrap"),Rn="focusin".concat(Nn),On="keydown.tab".concat(Nn),In="Tab",wn="forward",xn="backward",Dn={autofocus:!0,trapElement:null},kn={autofocus:"boolean",trapElement:"element"};class Pn extends ${constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Dn}static get DefaultType(){return kn}static get NAME(){return An}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),V.off(document,Nn),V.on(document,Rn,(e=>this._handleFocusin(e))),V.on(document,On,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,V.off(document,Nn))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=ee.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===xn?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){e.key===In&&(this._lastTabNavDirection=e.shiftKey?xn:wn)}}const Mn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ln=".sticky-top",Fn="padding-right",Bn="margin-right";class Un{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Fn,(t=>t+e)),this._setElementAttributes(Mn,Fn,(t=>t+e)),this._setElementAttributes(Ln,Bn,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Fn),this._resetElementAttributes(Mn,Fn),this._resetElementAttributes(Ln,Bn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const a=this.getWidth(),r=e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+a)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(r)),"px"))};this._applyManipulationCallback(e,r)}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&Q.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){const n=e=>{const n=Q.getDataAttribute(e,t);null!==n?(Q.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)};this._applyManipulationCallback(e,n)}_applyManipulationCallback(e,t){if(_(e))t(e);else for(const n of ee.find(e,this._element))t(n)}}const Gn="modal",zn=".".concat("bs.modal"),Hn=".data-api",Yn="Escape",jn="hide".concat(zn),Vn="hidePrevented".concat(zn),qn="hidden".concat(zn),Wn="show".concat(zn),Kn="shown".concat(zn),Qn="resize".concat(zn),$n="click.dismiss".concat(zn),Xn="mousedown.dismiss".concat(zn),Zn="keydown.dismiss".concat(zn),Jn="click".concat(zn).concat(Hn),ea="modal-open",ta="fade",na="show",aa="modal-static",ra=".modal.show",ia=".modal-dialog",sa=".modal-body",oa='[data-bs-toggle="modal"]',la={backdrop:!0,focus:!0,keyboard:!0},ca={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class da extends Z{constructor(e,t){super(e,t),this._dialog=ee.findOne(ia,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Un,this._addEventListeners()}static get Default(){return la}static get DefaultType(){return ca}static get NAME(){return Gn}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||V.trigger(this._element,Wn,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(ea),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){this._isShown&&!this._isTransitioning&&(V.trigger(this._element,jn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(na),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){V.off(window,zn),V.off(this._dialog,zn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Cn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Pn({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=ee.findOne(sa,this._dialog);t&&(t.scrollTop=0),b(this._element),this._element.classList.add(na);const n=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,V.trigger(this._element,Kn,{relatedTarget:e})};this._queueCallback(n,this._dialog,this._isAnimated())}_addEventListeners(){V.on(this._element,Zn,(e=>{e.key===Yn&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),V.on(window,Qn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),V.on(this._element,Xn,(e=>{V.one(this._element,$n,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(ea),this._resetAdjustments(),this._scrollBar.reset(),V.trigger(this._element,qn)}))}_isAnimated(){return this._element.classList.contains(ta)}_triggerBackdropTransition(){if(V.trigger(this._element,Vn).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(aa)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(aa),this._queueCallback((()=>{this._element.classList.remove(aa),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=y()?"paddingLeft":"paddingRight";this._element.style[e]="".concat(t,"px")}if(!n&&e){const e=y()?"paddingRight":"paddingLeft";this._element.style[e]="".concat(t,"px")}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=da.getOrCreateInstance(this,e);if("string"===typeof e){if("undefined"===typeof n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](t)}}))}}V.on(document,Jn,oa,(function(e){const t=ee.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),V.one(t,Wn,(e=>{e.defaultPrevented||V.one(t,qn,(()=>{h(this)&&this.focus()}))}));const n=ee.findOne(ra);n&&da.getInstance(n).hide(),da.getOrCreateInstance(t).toggle(this)})),te(da),C(da);const ua="offcanvas",pa=".".concat("bs.offcanvas"),_a=".data-api",ma="load".concat(pa).concat(_a),ha="Escape",ga="show",fa="showing",Ea="hiding",ba="offcanvas-backdrop",Sa=".offcanvas.show",va="show".concat(pa),Ta="shown".concat(pa),ya="hide".concat(pa),Ca="hidePrevented".concat(pa),Aa="hidden".concat(pa),Na="resize".concat(pa),Ra="click".concat(pa).concat(_a),Oa="keydown.dismiss".concat(pa),Ia='[data-bs-toggle="offcanvas"]',wa={backdrop:!0,keyboard:!0,scroll:!1},xa={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Da extends Z{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return wa}static get DefaultType(){return xa}static get NAME(){return ua}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(V.trigger(this._element,va,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Un).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(fa);const t=()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(ga),this._element.classList.remove(fa),V.trigger(this._element,Ta,{relatedTarget:e})};this._queueCallback(t,this._element,!0)}hide(){if(!this._isShown)return;if(V.trigger(this._element,ya).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ea),this._backdrop.hide();const e=()=>{this._element.classList.remove(ga,Ea),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Un).reset(),V.trigger(this._element,Aa)};this._queueCallback(e,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{"static"!==this._config.backdrop?this.hide():V.trigger(this._element,Ca)},t=Boolean(this._config.backdrop);return new Cn({className:ba,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new Pn({trapElement:this._element})}_addEventListeners(){V.on(this._element,Oa,(e=>{e.key===ha&&(this._config.keyboard?this.hide():V.trigger(this._element,Ca))}))}static jQueryInterface(e){return this.each((function(){const t=Da.getOrCreateInstance(this,e);if("string"===typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}V.on(document,Ra,Ia,(function(e){const t=ee.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),g(this))return;V.one(t,Aa,(()=>{h(this)&&this.focus()}));const n=ee.findOne(Sa);n&&n!==t&&Da.getInstance(n).hide(),Da.getOrCreateInstance(t).toggle(this)})),V.on(window,ma,(()=>{for(const e of ee.find(Sa))Da.getOrCreateInstance(e).show()})),V.on(window,Na,(()=>{for(const e of ee.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&Da.getOrCreateInstance(e).hide()})),te(Da),C(Da);const ka={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Pa=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Ma=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,La=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!Pa.has(n)||Boolean(Ma.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(n)))};function Fa(e,t,n){if(!e.length)return e;if(n&&"function"===typeof n)return n(e);const a=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...a.body.querySelectorAll("*"));for(const i of r){const e=i.nodeName.toLowerCase();if(!Object.keys(t).includes(e)){i.remove();continue}const n=[].concat(...i.attributes),a=[].concat(t["*"]||[],t[e]||[]);for(const t of n)La(t,a)||i.removeAttribute(t.nodeName)}return a.body.innerHTML}const Ba="TemplateFactory",Ua={allowList:ka,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Ga={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},za={entry:"(string|element|function|null)",selector:"(string|element)"};class Ha extends ${constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Ua}static get DefaultType(){return Ga}static get NAME(){return Ba}getContent(){return Object.values(this._config.content).map((e=>this._resolvePossibleFunction(e))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[a,r]of Object.entries(this._config.content))this._setContent(e,r,a);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},za)}_setContent(e,t,n){const a=ee.findOne(n,e);a&&((t=this._resolvePossibleFunction(t))?_(t)?this._putElementInTemplate(m(t),a):this._config.html?a.innerHTML=this._maybeSanitize(t):a.textContent=t:a.remove())}_maybeSanitize(e){return this._config.sanitize?Fa(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return A(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const Ya="tooltip",ja=new Set(["sanitize","allowList","sanitizeFn"]),Va="fade",qa="show",Wa=".tooltip-inner",Ka=".".concat("modal"),Qa="hide.bs.modal",$a="hover",Xa="focus",Za="click",Ja="manual",er="hide",tr="hidden",nr="show",ar="shown",rr="inserted",ir="click",sr="focusin",or="focusout",lr="mouseenter",cr="mouseleave",dr={AUTO:"auto",TOP:"top",RIGHT:y()?"left":"right",BOTTOM:"bottom",LEFT:y()?"right":"left"},ur={allowList:ka,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},pr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class _r extends Z{constructor(e,t){if("undefined"===typeof n)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return ur}static get DefaultType(){return pr}static get NAME(){return Ya}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),V.off(this._element.closest(Ka),Qa,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=V.trigger(this._element,this.constructor.eventName(nr)),t=(f(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:a}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(n),V.trigger(this._element,this.constructor.eventName(rr))),this._popper=this._createPopper(n),n.classList.add(qa),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))V.on(i,"mouseover",E);const r=()=>{V.trigger(this._element,this.constructor.eventName(ar)),!1===this._isHovered&&this._leave(),this._isHovered=!1};this._queueCallback(r,this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(V.trigger(this._element,this.constructor.eventName(er)).defaultPrevented)return;if(this._getTipElement().classList.remove(qa),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))V.off(t,"mouseover",E);this._activeTrigger[Za]=!1,this._activeTrigger[Xa]=!1,this._activeTrigger[$a]=!1,this._isHovered=null;const e=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),V.trigger(this._element,this.constructor.eventName(tr)))};this._queueCallback(e,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Va,qa),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));const n=d(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(Va),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Ha({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Wa]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Va)}_isShown(){return this.tip&&this.tip.classList.contains(qa)}_createPopper(e){const t=A(this._config.placement,[this,e,this._element]),a=dr[t.toUpperCase()];return n.createPopper(this._element,e,this._getPopperConfig(a))}_getOffset(){const{offset:e}=this._config;return"string"===typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"===typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return A(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...A(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)V.on(this._element,this.constructor.eventName(ir),this._config.selector,(e=>{this._initializeOnDelegatedTarget(e).toggle()}));else if(t!==Ja){const e=t===$a?this.constructor.eventName(lr):this.constructor.eventName(sr),n=t===$a?this.constructor.eventName(cr):this.constructor.eventName(or);V.on(this._element,e,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Xa:$a]=!0,t._enter()})),V.on(this._element,n,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Xa:$a]=t._element.contains(e.relatedTarget),t._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},V.on(this._element.closest(Ka),Qa,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Q.getDataAttributes(this._element);for(const n of Object.keys(t))ja.has(n)&&delete t[n];return e={...t,..."object"===typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:m(e.container),"number"===typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"===typeof e.title&&(e.title=e.title.toString()),"number"===typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each((function(){const t=_r.getOrCreateInstance(this,e);if("string"===typeof e){if("undefined"===typeof t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}C(_r);const mr="popover",hr=".popover-header",gr=".popover-body",fr={..._r.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Er={..._r.DefaultType,content:"(null|string|element|function)"};class br extends _r{static get Default(){return fr}static get DefaultType(){return Er}static get NAME(){return mr}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[hr]:this._getTitle(),[gr]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each((function(){const t=br.getOrCreateInstance(this,e);if("string"===typeof e){if("undefined"===typeof t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}C(br);const Sr="scrollspy",vr=".".concat("bs.scrollspy"),Tr=".data-api",yr="activate".concat(vr),Cr="click".concat(vr),Ar="load".concat(vr).concat(Tr),Nr="dropdown-item",Rr="active",Or='[data-bs-spy="scroll"]',Ir="[href]",wr=".nav, .list-group",xr=".nav-link",Dr=".nav-item",kr=".list-group-item",Pr="".concat(xr,", ").concat(Dr," > ").concat(xr,", ").concat(kr),Mr=".dropdown",Lr=".dropdown-toggle",Fr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Br={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ur extends Z{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Fr}static get DefaultType(){return Br}static get NAME(){return Sr}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=m(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"===typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(V.off(this._config.target,Cr),V.on(this._config.target,Cr,Ir,(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,a=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:a,behavior:"smooth"});n.scrollTop=a}})))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get("#".concat(e.target.id)),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},a=(this._rootElement||document.documentElement).scrollTop,r=a>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=a;for(const i of e){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(i));continue}const e=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(n(i),!a)return}else r||e||n(i)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=ee.find(Ir,this._config.target);for(const t of e){if(!t.hash||g(t))continue;const e=ee.findOne(decodeURI(t.hash),this._element);h(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Rr),this._activateParents(e),V.trigger(this._element,yr,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(Nr))ee.findOne(Lr,e.closest(Mr)).classList.add(Rr);else for(const t of ee.parents(e,wr))for(const e of ee.prev(t,Pr))e.classList.add(Rr)}_clearActiveClass(e){e.classList.remove(Rr);const t=ee.find("".concat(Ir,".").concat(Rr),e);for(const n of t)n.classList.remove(Rr)}static jQueryInterface(e){return this.each((function(){const t=Ur.getOrCreateInstance(this,e);if("string"===typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}V.on(window,Ar,(()=>{for(const e of ee.find(Or))Ur.getOrCreateInstance(e)})),C(Ur);const Gr="tab",zr=".".concat("bs.tab"),Hr="hide".concat(zr),Yr="hidden".concat(zr),jr="show".concat(zr),Vr="shown".concat(zr),qr="click".concat(zr),Wr="keydown".concat(zr),Kr="load".concat(zr),Qr="ArrowLeft",$r="ArrowRight",Xr="ArrowUp",Zr="ArrowDown",Jr="Home",ei="End",ti="active",ni="fade",ai="show",ri="dropdown",ii=".dropdown-toggle",si=".dropdown-menu",oi=":not(".concat(ii,")"),li='.list-group, .nav, [role="tablist"]',ci=".nav-item, .list-group-item",di=".nav-link".concat(oi,", .list-group-item").concat(oi,', [role="tab"]').concat(oi),ui='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',pi="".concat(di,", ").concat(ui),_i=".".concat(ti,'[data-bs-toggle="tab"], .').concat(ti,'[data-bs-toggle="pill"], .').concat(ti,'[data-bs-toggle="list"]');class mi extends Z{constructor(e){super(e),this._parent=this._element.closest(li),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),V.on(this._element,Wr,(e=>this._keydown(e))))}static get NAME(){return Gr}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?V.trigger(t,Hr,{relatedTarget:e}):null;V.trigger(e,jr,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(ti),this._activate(ee.getElementFromSelector(e));const n=()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),V.trigger(e,Vr,{relatedTarget:t})):e.classList.add(ai)};this._queueCallback(n,e,e.classList.contains(ni))}_deactivate(e,t){if(!e)return;e.classList.remove(ti),e.blur(),this._deactivate(ee.getElementFromSelector(e));const n=()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),V.trigger(e,Yr,{relatedTarget:t})):e.classList.remove(ai)};this._queueCallback(n,e,e.classList.contains(ni))}_keydown(e){if(![Qr,$r,Xr,Zr,Jr,ei].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter((e=>!g(e)));let n;if([Jr,ei].includes(e.key))n=t[e.key===Jr?0:t.length-1];else{const a=[$r,Zr].includes(e.key);n=R(t,e.target,a,!0)}n&&(n.focus({preventScroll:!0}),mi.getOrCreateInstance(n).show())}_getChildren(){return ee.find(pi,this._parent)}_getActiveElem(){return this._getChildren().find((e=>this._elemIsActive(e)))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=ee.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains(ri))return;const a=(e,a)=>{const r=ee.findOne(e,n);r&&r.classList.toggle(a,t)};a(ii,ti),a(si,ai),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(ti)}_getInnerElement(e){return e.matches(pi)?e:ee.findOne(pi,e)}_getOuterElement(e){return e.closest(ci)||e}static jQueryInterface(e){return this.each((function(){const t=mi.getOrCreateInstance(this);if("string"===typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}V.on(document,qr,ui,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),g(this)||mi.getOrCreateInstance(this).show()})),V.on(window,Kr,(()=>{for(const e of ee.find(_i))mi.getOrCreateInstance(e)})),C(mi);const hi="toast",gi=".".concat("bs.toast"),fi="mouseover".concat(gi),Ei="mouseout".concat(gi),bi="focusin".concat(gi),Si="focusout".concat(gi),vi="hide".concat(gi),Ti="hidden".concat(gi),yi="show".concat(gi),Ci="shown".concat(gi),Ai="fade",Ni="hide",Ri="show",Oi="showing",Ii={animation:"boolean",autohide:"boolean",delay:"number"},wi={animation:!0,autohide:!0,delay:5e3};class xi extends Z{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return wi}static get DefaultType(){return Ii}static get NAME(){return hi}show(){if(V.trigger(this._element,yi).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Ai);const e=()=>{this._element.classList.remove(Oi),V.trigger(this._element,Ci),this._maybeScheduleHide()};this._element.classList.remove(Ni),b(this._element),this._element.classList.add(Ri,Oi),this._queueCallback(e,this._element,this._config.animation)}hide(){if(!this.isShown())return;if(V.trigger(this._element,vi).defaultPrevented)return;const e=()=>{this._element.classList.add(Ni),this._element.classList.remove(Oi,Ri),V.trigger(this._element,Ti)};this._element.classList.add(Oi),this._queueCallback(e,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ri),super.dispose()}isShown(){return this._element.classList.contains(Ri)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){V.on(this._element,fi,(e=>this._onInteraction(e,!0))),V.on(this._element,Ei,(e=>this._onInteraction(e,!1))),V.on(this._element,bi,(e=>this._onInteraction(e,!0))),V.on(this._element,Si,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=xi.getOrCreateInstance(this,e);if("string"===typeof e){if("undefined"===typeof t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}return te(xi),C(xi),{Alert:le,Button:he,Carousel:ut,Collapse:Dt,Dropdown:fn,Modal:da,Offcanvas:Da,Popover:br,ScrollSpy:Ur,Tab:mi,Toast:xi,Tooltip:_r}}(n(1738))},3240:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var a,r=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;for(a in e);return"undefined"===typeof a||t.call(e,a)},o=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,a,r,c,d,u=arguments[0],p=1,_=arguments.length,m=!1;for("boolean"===typeof u&&(m=u,u=arguments[1]||{},p=2),(null==u||"object"!==typeof u&&"function"!==typeof u)&&(u={});p<_;++p)if(null!=(t=arguments[p]))for(n in t)a=l(u,n),u!==(r=l(t,n))&&(m&&r&&(s(r)||(c=i(r)))?(c?(c=!1,d=a&&i(a)?a:[]):d=a&&s(a)?a:{},o(u,{name:n,newValue:e(m,d,r)})):"undefined"!==typeof r&&o(u,{name:n,newValue:r}));return u}},4403:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function d(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!==typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var u=1,p=1;function _(e){var t=e.match(n);t&&(u+=t.length);var a=e.lastIndexOf("\n");p=~a?e.length-a:p+e.length}function m(){var e={line:u,column:p};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:u,column:p},this.source=l.source}h.prototype.content=e;var g=[];function f(t){var n=new Error(l.source+":"+u+":"+p+": "+t);if(n.reason=t,n.filename=l.source,n.line=u,n.column=p,n.source=e,!l.silent)throw n;g.push(n)}function E(t){var n=t.exec(e);if(n){var a=n[0];return _(a),e=e.slice(a.length),n}}function b(){E(a)}function S(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return f("End of comment missing");var a=e.slice(2,n-2);return p+=2,_(a),e=e.slice(n),p+=2,t({type:"comment",comment:a})}}function T(){var e=m(),n=E(r);if(n){if(v(),!E(i))return f("property missing ':'");var a=E(s),l=e({type:"declaration",property:d(n[0].replace(t,c)),value:a?d(a[0].replace(t,c)):c});return E(o),l}}return b(),function(){var e,t=[];for(S(t);e=T();)!1!==e&&(t.push(e),S(t));return t}()}},6749:(module,__unused_webpack_exports,__webpack_require__)=>{var _classPrivateGetter=__webpack_require__(183).default,_defineProperty=__webpack_require__(3693).default,_classPrivateMethodInitSpec=__webpack_require__(3312).default,_assertClassBrand=__webpack_require__(1756).default,_classPrivateFieldInitSpec=__webpack_require__(2459).default,_classPrivateFieldGet=__webpack_require__(6668).default,_classPrivateFieldSet=__webpack_require__(7088).default,root,factory;root=globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationPrefix=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||o(t)},t.bytesToString=d,t.createValidAbsoluteUrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(n&&"string"===typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);(null===t||void 0===t?void 0:t.length)>=2&&(e="http://".concat(e))}if(n.tryConvertEncoding)try{e=m(e)}catch{}}const a=t?new URL(e,t):new URL(e);if(function(e){switch(null===e||void 0===e?void 0:e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch{}return null},t.getModificationDate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){var e,t;if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.randomUUID))return crypto.randomUUID();const n=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.getRandomValues))crypto.getRandomValues(n);else for(let a=0;a<32;a++)n[a]=Math.floor(255*Math.random());return d(n)},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=r.INFOS&&console.log("Info: ".concat(e))},t.isArrayBuffer=function(e){return"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.byteLength)},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,a=e.length;nt?t.normalize("NFKC"):f.get(n)))},t.objectFromMap=function(e){const t=Object.create(null);for(const[n,a]of e)t[n]=a;return t},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=u,t.stringToPDFString=function(e){if(e[0]>="\xef"){let t;if("\xfe"===e[0]&&"\xff"===e[1]?t="utf-16be":"\xff"===e[0]&&"\xfe"===e[1]?t="utf-16le":"\xef"===e[0]&&"\xbb"===e[1]&&"\xbf"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),a=u(e);return n.decode(a)}catch(n){s('stringToPDFString: "'.concat(n,'".'))}}const t=[];for(let a=0,r=e.length;a=r.WARNINGS&&console.log("Warning: ".concat(e))}function o(e){throw new Error(e)}function l(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(e,t,{value:n,enumerable:!a,configurable:!0,writable:!1}),n}const c=function(){function e(t,n){this.constructor===e&&o("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function d(e){"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.length)||o("Invalid argument for bytesToString");const t=e.length,n=8192;if(te.toString(16).padStart(2,"0")));t.Util=class{static makeHexColor(e,t,n){return"#".concat(p[e]).concat(p[t]).concat(p[n])}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=this.applyTransform(e,t),a=this.applyTransform(e.slice(2,4),t),r=this.applyTransform([e[0],e[3]],t),i=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],a[0],r[0],i[0]),Math.min(n[1],a[1],r[1],i[1]),Math.max(n[0],a[0],r[0],i[0]),Math.max(n[1],a[1],r[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],a=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(n+i)/2,o=Math.sqrt((n+i)**2-4*(n*i-r*a))/2,l=s+o||1,c=s-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),a=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>a)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>i?null:[n,r,a,i]}static bezierBoundingBox(e,t,n,a,r,i,s,o){const l=[],c=[[],[]];let d,u,p,_,m,h,g,f;for(let v=0;v<2;++v)if(0===v?(u=6*e-12*n+6*r,d=-3*e+9*n-9*r+3*s,p=3*n-3*e):(u=6*t-12*a+6*i,d=-3*t+9*a-9*i+3*o,p=3*a-3*t),Math.abs(d)<1e-12){if(Math.abs(u)<1e-12)continue;_=-p/u,0<_&&_<1&&l.push(_)}else g=u*u-4*p*d,f=Math.sqrt(g),g<0||(m=(-u+f)/(2*d),0{this.resolve=t=>{_classPrivateFieldSet(h,this,!0),e(t)},this.reject=e=>{_classPrivateFieldSet(h,this,!0),t(e)}}))}get settled(){return _classPrivateFieldGet(h,this)}};let g=null,f=null;t.AnnotationPrefix="pdfjs_internal_id_"},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(e){var t,n;if("string"===typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!==typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const a=new PDFDocumentLoadingTask,{docId:r}=a,i=e.url?getUrlProp(e.url):null,s=e.data?getDataProp(e.data):null,o=e.httpHeaders||null,l=!0===e.withCredentials,c=null!==(t=e.password)&&void 0!==t?t:null,d=e.range instanceof PDFDataRangeTransport?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let p=e.worker instanceof PDFWorker?e.worker:null;const _=e.verbosity,m="string"!==typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,h="string"===typeof e.cMapUrl?e.cMapUrl:null,g=!1!==e.cMapPacked,f=e.CMapReaderFactory||DefaultCMapReaderFactory,E="string"===typeof e.standardFontDataUrl?e.standardFontDataUrl:null,b=e.StandardFontDataFactory||DefaultStandardFontDataFactory,S=!0!==e.stopAtErrors,v=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,T=!1!==e.isEvalSupported,y="boolean"===typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_util.isNodeJS,C=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,A="boolean"===typeof e.disableFontFace?e.disableFontFace:_util.isNodeJS,N=!0===e.fontExtraProperties,R=!0===e.enableXfa,O=e.ownerDocument||globalThis.document,I=!0===e.disableRange,w=!0===e.disableStream,x=!0===e.disableAutoFetch,D=!0===e.pdfBug,k=d?d.length:null!==(n=e.length)&&void 0!==n?n:NaN,P="boolean"===typeof e.useSystemFonts?e.useSystemFonts:!_util.isNodeJS&&!A,M="boolean"===typeof e.useWorkerFetch?e.useWorkerFetch:f===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&h&&E&&(0,_display_utils.isValidFetchUrl)(h,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(E,document.baseURI),L=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:O}),F=e.filterFactory||new DefaultFilterFactory({docId:r,ownerDocument:O});(0,_util.setVerbosityLevel)(_);const B={canvasFactory:L,filterFactory:F};if(M||(B.cMapReaderFactory=new f({baseUrl:h,isCompressed:g}),B.standardFontDataFactory=new b({baseUrl:E})),!p){const e={verbosity:_,port:_worker_options.GlobalWorkerOptions.workerPort};p=e.port?PDFWorker.fromPort(e):new PDFWorker(e),a._worker=p}const U={docId:r,apiVersion:"3.11.174",data:s,password:c,disableAutoFetch:x,rangeChunkSize:u,length:k,docBaseUrl:m,enableXfa:R,evaluatorOptions:{maxImageSize:v,disableFontFace:A,ignoreErrors:S,isEvalSupported:T,isOffscreenCanvasSupported:y,canvasMaxAreaInBytes:C,fontExtraProperties:N,useSystemFonts:P,cMapUrl:M?h:null,standardFontDataUrl:M?E:null}},G={ignoreErrors:S,isEvalSupported:T,disableFontFace:A,fontExtraProperties:N,enableXfa:R,ownerDocument:O,disableAutoFetch:x,pdfBug:D,styleElement:null};return p.promise.then((function(){if(a.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(p,U),t=new Promise((function(e){let t;var n;d?t=new _transport_stream.PDFDataTransportStream({length:k,initialData:d.initialData,progressiveDone:d.progressiveDone,contentDispositionFilename:d.contentDispositionFilename,disableRange:I,disableStream:w},d):s||(n={url:i,length:k,httpHeaders:o,withCredentials:l,rangeChunkSize:u,disableRange:I,disableStream:w},t=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(n):(0,_display_utils.isValidFetchUrl)(n.url)?new _displayFetch_stream.PDFFetchStream(n):new _displayNetwork.PDFNetworkStream(n)),e(t)}));return Promise.all([e,t]).then((function(e){let[t,n]=e;if(a.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(r,t,p.port),s=new WorkerTransport(i,a,n,G,B);a._transport=s,i.send("Ready",null)}))})).catch(a._capability.reject),a}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(_util.isNodeJS&&"string"===typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_util.isNodeJS&&"undefined"!==typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"===typeof e)return(0,_util.stringToBytes)(e);if("object"===typeof e&&!isNaN(null===e||void 0===e?void 0:e.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{constructor(){var e,t;this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat((_docId._=(e=_docId._,t=e++,e),t)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var e,t;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(t=this._transport)||void 0===t?void 0:t.destroy())}catch(a){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,a}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var _docId={_:0};exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then((e=>{if(!e)return e;const t=[];for(const n in e)t.push(...e[n]);return t})))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}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(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}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 e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(e||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;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_PDFPageProxy_brand=new WeakSet;class PDFPageProxy{constructor(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,_PDFPageProxy_brand),_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,null),_classPrivateFieldInitSpec(this,_pendingCleanup,!1),this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=a?new _display_utils.StatTimer:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!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:e,rotation:t=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:a,dontFlip:r})}getAnnotations(){let{intent:e="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return(null===(e=this._transport._htmlForXfa)||void 0===e?void 0:e.children[this._pageIndex])||null}render(e){var t,n;let{canvasContext:a,viewport:r,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:u=null,printAnnotationStorage:p=null}=e;null===(t=this._stats)||void 0===t||t.time("Overall");const _=this._transport.getRenderingIntent(i,s,p);_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),c||(c=this._transport.getOptionalContentConfig());let m=this._intentStates.get(_.cacheKey);m||(m=Object.create(null),this._intentStates.set(_.cacheKey,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const h=!!(_.renderingIntent&_util.RenderingIntentFlag.PRINT);var g;m.displayReadyCapability||(m.displayReadyCapability=new _util.PromiseCapability,m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(g=this._stats)||void 0===g||g.time("Page Request"),this._pumpOperatorList(_));const f=e=>{var t,n;m.renderTasks.delete(E),(this._maybeCleanupAfterRender||h)&&_classPrivateFieldSet(_pendingCleanup,this,!0),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!h),e?(E.capability.reject(e),this._abortOperatorList({intentState:m,reason:e instanceof Error?e:new Error(e)})):E.capability.resolve(),null===(t=this._stats)||void 0===t||t.timeEnd("Rendering"),null===(n=this._stats)||void 0===n||n.timeEnd("Overall")},E=new InternalRenderTask({callback:f,params:{canvasContext:a,viewport:r,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!h,pdfBug:this._pdfBug,pageColors:u});((n=m).renderTasks||(n.renderTasks=new Set)).add(E);const b=E.task;return Promise.all([m.displayReadyCapability.promise,c]).then((e=>{var t;let[n,a]=e;this.destroyed?f():(null===(t=this._stats)||void 0===t||t.time("Rendering"),E.initializeGraphics({transparency:n,optionalContentConfig:a}),E.operatorListChanged())})).catch(f),b}getOperatorList(){let{intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=this._transport.getRenderingIntent(e,t,n,!0);let r,i=this._intentStates.get(a.cacheKey);var s,o;return i||(i=Object.create(null),this._intentStates.set(a.cacheKey,i)),i.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(r))},i.opListReadCapability=new _util.PromiseCapability,((s=i).renderTasks||(s.renderTasks=new Set)).add(r),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(a)),i.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:e=!1,disableNormalization:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,n){const a=t.getReader(),r={items:[],styles:Object.create(null)};!function t(){a.read().then((function(n){let{value:a,done:i}=n;i?e(r):(Object.assign(r.styles,a.styles),r.items.push(...a.items),t())}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),Promise.all(e)}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(_pendingCleanup,this,!0);const t=_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1);return e&&t&&this._stats&&(this._stats=new _display_utils.StatTimer),t}_startRenderPage(e,t){var n,a;const r=this._intentStates.get(t);r&&(null===(n=this._stats)||void 0===n||n.timeEnd("Page Request"),null===(a=r.displayReadyCapability)||void 0===a||a.resolve(e))}_renderPageChunk(e,t){for(let n=0,a=e.length;n{s.read().then((e=>{let{value:t,done:n}=e;n?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,o),l())}),(e=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const e of o.renderTasks)e.operatorListChanged();_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(e);else{if(!o.opListReadCapability)throw e;o.opListReadCapability.reject(e)}}}))};l()}_abortOperatorList(e){let{intentState:t,reason:n,force:a=!1}=e;if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!a){if(t.renderTasks.size>0)return;if(n instanceof _display_utils.RenderingCancelledException){let e=RENDERING_CANCELLED_TIMEOUT;return n.extraDelay>0&&n.extraDelay<1e3&&(e+=n.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:n,force:!0})}),e))}}if(t.streamReader.cancel(new _util.AbortException(n.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[e,n]of this._intentStates)if(n===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}function _tryCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),!_classPrivateFieldGet(_pendingCleanup,this)||this.destroyed)return!1;if(e)return _classPrivateFieldSet(_delayedCleanupTimeout,this,setTimeout((()=>{_classPrivateFieldSet(_delayedCleanupTimeout,this,null),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1)}),DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:t,operatorList:n}of this._intentStates.values())if(t.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),!0}function _abortDelayedCleanup(){_classPrivateFieldGet(_delayedCleanupTimeout,this)&&(clearTimeout(_classPrivateFieldGet(_delayedCleanupTimeout,this)),_classPrivateFieldSet(_delayedCleanupTimeout,this,null))}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,new Set),_classPrivateFieldInitSpec(this,_deferred,Promise.resolve())}postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};_classPrivateFieldGet(_deferred,this).then((()=>{for(const e of _classPrivateFieldGet(_listeners,this))e.call(this,n)}))}addEventListener(e,t){_classPrivateFieldGet(_listeners,this).add(t)}removeEventListener(e,t){_classPrivateFieldGet(_listeners,this).delete(t)}terminate(){_classPrivateFieldGet(_listeners,this).clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){var _document;const e=null===(_document=document)||void 0===_document||null===(_document=_document.currentScript)||void 0===_document?void 0:_document.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch{return!1}const a=new URL(t,n);return n.origin===a.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t='importScripts("'.concat(e,'");');return URL.createObjectURL(new Blob([t]))};class PDFWorker{constructor(){let{name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,t){var a;if(null!==(a=_workerPorts._)&&void 0!==a&&a.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return(_workerPorts._||(_workerPorts._=new WeakMap)).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),a=()=>{t.removeEventListener("error",r),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||a()};t.addEventListener("error",r),n.on("test",(e=>{t.removeEventListener("error",r),this.destroyed?a():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",r),this.destroyed)a();else try{i()}catch{this._setupFakeWorker()}}));const i=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void i()}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((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake".concat(PDFWorkerUtil.fakeWorkerId++),a=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(a,t);const r=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(e.message,'".')))}))}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(e=_workerPorts._)||void 0===e||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var t;if(null===e||void 0===e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=null===(t=_assertClassBrand(PDFWorker,this,_workerPorts)._)||void 0===t?void 0:t.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS){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())}}var _workerPorts={_:void 0};exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_passwordCapability=new WeakMap,_WorkerTransport_brand=new WeakSet;class WorkerTransport{constructor(e,t,n,a,r){_classPrivateMethodInitSpec(this,_WorkerTransport_brand),_classPrivateFieldInitSpec(this,_methodPromises,new Map),_classPrivateFieldInitSpec(this,_pageCache,new Map),_classPrivateFieldInitSpec(this,_pagePromises,new Map),_classPrivateFieldInitSpec(this,_passwordCapability,null),this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this._params=a,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=_util.RenderingIntentFlag.DISPLAY,i=_annotation_storage.SerializableEmpty;switch(e){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(e))}switch(t){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&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(t))}return a&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:"".concat(r,"_").concat(i.hash),annotationStorageSerializable:i}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,null===(e=_classPrivateFieldGet(_passwordCapability,this))||void 0===e||e.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const a of _classPrivateFieldGet(_pageCache,this).values())t.push(a._destroy());_classPrivateFieldGet(_pageCache,this).clear(),_classPrivateFieldGet(_pagePromises,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then((()=>{var e;this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(),null===(e=this._networkStream)||void 0===e||e.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:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function(e){let{value:n,done:a}=e;a?t.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=new _util.PromiseCapability,a=this._fullReader;return a.headersReady.then((()=>{var e;a.isStreamingSupported&&a.isRangeSupported||(this._lastProgress&&(null===(e=t.onProgress)||void 0===e||e.call(t,this._lastProgress)),a.onProgress=e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})});n.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function(e){let{value:n,done:a}=e;a?t.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(e=>{let{pdfInfo:n}=e;this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(n,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(_classPrivateFieldSet(_passwordCapability,this,new _util.PromiseCapability),t.onPassword){const a=e=>{e instanceof Error?_classPrivateFieldGet(_passwordCapability,this).reject(e):_classPrivateFieldGet(_passwordCapability,this).resolve({password:e})};try{t.onPassword(a,e.code)}catch(n){_classPrivateFieldGet(_passwordCapability,this).reject(n)}}else _classPrivateFieldGet(_passwordCapability,this).reject(new _util.PasswordException(e.message,e.code));return _classPrivateFieldGet(_passwordCapability,this).promise})),e.on("DataLoaded",(e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||_classPrivateFieldGet(_pageCache,this).get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(t=>{var n;let[a,r,i]=t;if(!this.destroyed&&!this.commonObjs.has(a))switch(r){case"Font":const t=this._params;if("error"in i){const e=i.error;(0,_util.warn)("Error during font loading: ".concat(e)),this.commonObjs.resolve(a,e);break}const s=t.pdfBug&&null!==(n=globalThis.FontInspector)&&void 0!==n&&n.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,o=new _font_loader.FontFaceObject(i,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,inspectFont:s});this.fontLoader.bind(o).catch((t=>e.sendWithPromise("FontFallback",{id:a}))).finally((()=>{!t.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(a,o)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(a,i);break;default:throw new Error("Got unknown common object type ".concat(r))}})),e.on("obj",(e=>{let[t,n,a,r]=e;if(this.destroyed)return;const i=_classPrivateFieldGet(_pageCache,this).get(n);if(!i.objs.has(t))switch(a){case"Image":if(i.objs.resolve(t,r),r){let e;if(r.bitmap){const{width:t,height:n}=r;e=t*n*4}else{var s;e=(null===(s=r.data)||void 0===s?void 0:s.length)||0}e>_util.MAX_IMAGE_SIZE_TO_CACHE&&(i._maybeCleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(t,r);break;default:throw new Error("Got unknown object type ".concat(a))}})),e.on("DocProgress",(e=>{var n;this.destroyed||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})})),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e,t;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:n,transfers:a}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:n,filename:null!==(e=null===(t=this._fullReader)||void 0===t?void 0:t.filename)&&void 0!==e?e:null},a).finally((()=>{this.annotationStorage.resetModified()}))}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=_classPrivateFieldGet(_pagePromises,this).get(t);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.pdfBug);return _classPrivateFieldGet(_pageCache,this).set(t,n),n}));return _classPrivateFieldGet(_pagePromises,this).set(t,a),a}getPageIndex(e){return"object"!==typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetFieldObjects")}hasJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!==typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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)}getDocJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=_classPrivateFieldGet(_methodPromises,this).get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then((e=>{var t,n,a,r;return{info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:null!==(t=null===(n=this._fullReader)||void 0===n?void 0:n.filename)&&void 0!==t?t:null,contentLength:null!==(a=null===(r=this._fullReader)||void 0===r?void 0:r.contentLength)&&void 0!==a?a:null}}));return _classPrivateFieldGet(_methodPromises,this).set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of _classPrivateFieldGet(_pageCache,this).values())if(!e.cleanup())throw new Error("startCleanup: Page ".concat(e.pageNumber," is currently rendering."));this.commonObjs.clear(),e||this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}function _cacheSimpleMethod(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_classPrivateFieldGet(_methodPromises,this).get(e);if(n)return n;const a=this.messageHandler.sendWithPromise(e,t);return _classPrivateFieldGet(_methodPromises,this).set(e,a),a}var _objs=new WeakMap,_PDFObjects_brand=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_PDFObjects_brand),_classPrivateFieldInitSpec(this,_objs,Object.create(null))}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t){const n=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,e);return n.capability.promise.then((()=>t(n.data))),null}const n=_classPrivateFieldGet(_objs,this)[e];if(null===n||void 0===n||!n.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(e,"."));return n.data}has(e){const t=_classPrivateFieldGet(_objs,this)[e];return(null===t||void 0===t?void 0:t.capability.settled)||!1}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,e);n.data=t,n.capability.resolve()}clear(){for(const t in _classPrivateFieldGet(_objs,this)){var e;const{data:n}=_classPrivateFieldGet(_objs,this)[t];null===n||void 0===n||null===(e=n.bitmap)||void 0===e||e.close()}_classPrivateFieldSet(_objs,this,Object.create(null))}}function _ensureObj(e){var t;return(t=_classPrivateFieldGet(_objs,this))[e]||(t[e]={capability:new _util.PromiseCapability,data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(e){_classPrivateFieldInitSpec(this,_internalRenderTask,null),_classPrivateFieldSet(_internalRenderTask,this,e),this.onContinue=null}get promise(){return _classPrivateFieldGet(_internalRenderTask,this).capability.promise}cancel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_classPrivateFieldGet(_internalRenderTask,this).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=_classPrivateFieldGet(_internalRenderTask,this).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=_classPrivateFieldGet(_internalRenderTask,this);return e.form||e.canvas&&(null===t||void 0===t?void 0:t.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(e){let{callback:t,params:n,objs:a,commonObjs:r,annotationCanvasMap:i,operatorList:s,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:p=null}=e;this.callback=t,this.params=n,this.objs=a,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,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=n.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(e){var t,n;let{transparency:a=!1,optionalContentConfig:r}=e;if(this.cancelled)return;if(this._canvas){if(_canvasInUse._.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.");_canvasInUse._.add(this._canvas)}this._pdfBug&&null!==(t=globalThis.StepperManager)&&void 0!==t&&t.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:s,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:s,transparency:a,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(n=this.graphicsReadyCallback)||void 0===n||n.call(this)}cancel(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(e=this.gfx)||void 0===e||e.endDrawing(),_canvasInUse._.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),n))}operatorListChanged(){var e;this.graphicsReady?(null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_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(),_canvasInUse._.delete(this._canvas),this.callback())))}}var _canvasInUse={_:new WeakSet};const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SerializableEmpty=t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var a=n(1),r=n(4),i=n(8);const s=Object.freeze({map:null,hash:"",transfers:void 0});t.SerializableEmpty=s;var o=new WeakMap,l=new WeakMap,c=new WeakSet;class d{constructor(){_classPrivateMethodInitSpec(this,c),_classPrivateFieldInitSpec(this,o,!1),_classPrivateFieldInitSpec(this,l,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=_classPrivateFieldGet(l,this).get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return _classPrivateFieldGet(l,this).get(e)}remove(e){if(_classPrivateFieldGet(l,this).delete(e),0===_classPrivateFieldGet(l,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const e of _classPrivateFieldGet(l,this).values())if(e instanceof r.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=_classPrivateFieldGet(l,this).get(e);let a=!1;if(void 0!==n)for(const[r,i]of Object.entries(t))n[r]!==i&&(a=!0,n[r]=i);else a=!0,_classPrivateFieldGet(l,this).set(e,t);a&&_assertClassBrand(c,this,u).call(this),t instanceof r.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return _classPrivateFieldGet(l,this).has(e)}getAll(){return _classPrivateFieldGet(l,this).size>0?(0,a.objectFromMap)(_classPrivateFieldGet(l,this)):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return _classPrivateFieldGet(l,this).size}resetModified(){_classPrivateFieldGet(o,this)&&(_classPrivateFieldSet(o,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new _(this)}get serializable(){if(0===_classPrivateFieldGet(l,this).size)return s;const e=new Map,t=new i.MurmurHash3_64,n=[],a=Object.create(null);let o=!1;for(const[i,s]of _classPrivateFieldGet(l,this)){const n=s instanceof r.AnnotationEditor?s.serialize(!1,a):s;n&&(e.set(i,n),t.update("".concat(i,":").concat(JSON.stringify(n))),o||(o=!!n.bitmap))}if(o)for(const r of e.values())r.bitmap&&n.push(r.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfers:n}:s}}function u(){_classPrivateFieldGet(o,this)||(_classPrivateFieldSet(o,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}t.AnnotationStorage=d;var p=new WeakMap;class _ extends d{constructor(e){super(),_classPrivateFieldInitSpec(this,p,void 0);const{map:t,hash:n,transfers:a}=e.serializable,r=structuredClone(t,a?{transfer:a}:null);_classPrivateFieldSet(p,this,{map:r,hash:n,transfers:a})}get print(){(0,a.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return _classPrivateFieldGet(p,this)}}t.PrintAnnotationStorage=_},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var r=n(5),i=n(1),s=n(6),o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap,E=new WeakMap,b=new WeakMap,S=new WeakMap,v=new WeakSet;class T{constructor(e){_classPrivateMethodInitSpec(this,v),_classPrivateFieldInitSpec(this,o,""),_classPrivateFieldInitSpec(this,l,!1),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,p,!1),_classPrivateFieldInitSpec(this,_,null),_classPrivateFieldInitSpec(this,m,this.focusin.bind(this)),_classPrivateFieldInitSpec(this,h,this.focusout.bind(this)),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldInitSpec(this,E,!1),_defineProperty(this,"_initialOptions",Object.create(null)),_defineProperty(this,"_uiManager",null),_defineProperty(this,"_focusEventsAllowed",!0),_defineProperty(this,"_l10nPromise",null),_classPrivateFieldInitSpec(this,b,!1),_classPrivateFieldInitSpec(this,S,T._zIndex++),this.constructor===T&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:a,pageX:r,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[r,s];const[y,C]=this.parentDimensions;this.x=e.x/y,this.y=e.y/C,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new D({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(T._l10nPromise||(T._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map((t=>[t,e.get(t)])))),null!==t&&void 0!==t&&t.strings)for(const a of t.strings)T._l10nPromise.set(a,e.get(a));if(-1!==T._borderLineWidth)return;const n=getComputedStyle(document.documentElement);T._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){(0,i.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return _classPrivateFieldGet(b,this)}set _isDraggable(e){var t;_classPrivateFieldSet(b,this,e),null===(t=this.div)||void 0===t||t.classList.toggle("draggable",e)}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(S,this)}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(_classPrivateFieldGet(g,this)?_classPrivateFieldSet(g,this,!1):this.parent.setSelected(this))}focusout(e){var t;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const n=e.relatedTarget;null!==n&&void 0!==n&&n.closest("#".concat(this.id))||(e.preventDefault(),null!==(t=this.parent)&&void 0!==t&&t.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,a){const[r,i]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(e+n)/r,this.y=(t+a)/i,this.fixAndSetPosition()}translate(e,t){_assertClassBrand(v,this,y).call(this,this.parentDimensions,e,t)}translateInPage(e,t){_assertClassBrand(v,this,y).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){const[n,a]=this.parentDimensions;if(this.x+=e/n,this.y+=t/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:i}=this;const[s,o]=_assertClassBrand(v,this,C).call(this);r+=s,i+=o,this.div.style.left="".concat((100*r).toFixed(2),"%"),this.div.style.top="".concat((100*i).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[e,t]=this.pageDimensions;let{x:n,y:a,width:r,height:i}=this;switch(r*=e,i*=t,n*=e,a*=t,this.rotation){case 0:n=Math.max(0,Math.min(e-r,n)),a=Math.max(0,Math.min(t-i,a));break;case 90:n=Math.max(0,Math.min(e-i,n)),a=Math.min(t,Math.max(r,a));break;case 180:n=Math.min(e,Math.max(r,n)),a=Math.min(t,Math.max(i,a));break;case 270:n=Math.min(e,Math.max(i,n)),a=Math.max(0,Math.min(t-r,a))}this.x=n/=e,this.y=a/=t;const[s,o]=_assertClassBrand(v,this,C).call(this);n+=s,a+=o;const{style:l}=this.div;l.left="".concat((100*n).toFixed(2),"%"),l.top="".concat((100*a).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(e,t){return A.call(T,e,t,this.parentRotation)}pageTranslationToScreen(e,t){return A.call(T,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,n]}=this,a=t*e,r=n*e;return i.FeatureTest.isCSSRoundSupported?[Math.round(a),Math.round(r)]:[a,r]}setDims(e,t){var n;const[a,r]=this.parentDimensions;this.div.style.width="".concat((100*e/a).toFixed(2),"%"),_classPrivateFieldGet(p,this)||(this.div.style.height="".concat((100*t/r).toFixed(2),"%")),null===(n=_classPrivateFieldGet(c,this))||void 0===n||n.classList.toggle("small",ee.stopPropagation())),e.addEventListener("click",(e=>{e.preventDefault(),this._uiManager.editAltText(this)}),{capture:!0}),e.addEventListener("keydown",(t=>{t.target===e&&"Enter"===t.key&&(t.preventDefault(),this._uiManager.editAltText(this))})),_assertClassBrand(v,this,w).call(this),this.div.append(e),!T.SMALL_EDITOR_SIZE){const t=40;T.SMALL_EDITOR_SIZE=Math.min(128,Math.round(e.getBoundingClientRect().width*(1+t/100)))}}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:_classPrivateFieldGet(o,this),decorative:_classPrivateFieldGet(l,this)}}set altTextData(e){let{altText:t,decorative:n}=e;_classPrivateFieldGet(o,this)===t&&_classPrivateFieldGet(l,this)===n||(_classPrivateFieldSet(o,this,t),_classPrivateFieldSet(l,this,n),_assertClassBrand(v,this,w).call(this))}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",_classPrivateFieldGet(m,this)),this.div.addEventListener("focusout",_classPrivateFieldGet(h,this));const[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*t/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/t).toFixed(2),"%"));const[n,a]=this.getInitialTranslation();return this.translate(n,a),(0,r.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(_classPrivateFieldSet(g,this,!0),_assertClassBrand(v,this,x).call(this,e))}moveInDOM(){var e;null===(e=this.parent)||void 0===e||e.moveEditorInDOM(this)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition()}getRect(e,t){const n=this.parentScale,[a,r]=this.pageDimensions,[i,s]=this.pageTranslation,o=e/n,l=t/n,c=this.x*a,d=this.y*r,u=this.width*a,p=this.height*r;switch(this.rotation){case 0:return[c+o+i,r-d-l-p+s,c+o+u+i,r-d-l+s];case 90:return[c+l+i,r-d+o+s,c+l+p+i,r-d+o+u+s];case 180:return[c-o-u+i,r-d+l+s,c-o+i,r-d+l+p+s];case 270:return[c-l-p+i,r-d-o-u+s,c-l+i,r-d-o+s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,a,r,i]=e,s=r-n,o=i-a;switch(this.rotation){case 0:return[n,t-i,s,o];case 90:return[n,t-a,o,s];case 180:return[r,t-a,s,o];case 270:return[r,t-i,o,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(E,this,!0)}disableEditMode(){_classPrivateFieldSet(E,this,!1)}isInEditMode(){return _classPrivateFieldGet(E,this)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var e,t;null===(e=this.div)||void 0===e||e.addEventListener("focusin",_classPrivateFieldGet(m,this)),null===(t=this.div)||void 0===t||t.addEventListener("focusout",_classPrivateFieldGet(h,this))}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const a=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});a.rotation=e.rotation;const[r,i]=a.pageDimensions,[s,o,l,c]=a.getRectInCurrentCoords(e.rect,i);return a.x=s/r,a.y=o/i,a.width=l/r,a.height=c/i,a}remove(){var e;this.div.removeEventListener("focusin",_classPrivateFieldGet(m,this)),this.div.removeEventListener("focusout",_classPrivateFieldGet(h,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),null===(e=_classPrivateFieldGet(c,this))||void 0===e||e.remove(),_classPrivateFieldSet(c,this,null),_classPrivateFieldSet(d,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(_assertClassBrand(v,this,R).call(this),_classPrivateFieldGet(_,this).classList.remove("hidden"))}select(){var e;this.makeResizable(),null===(e=this.div)||void 0===e||e.classList.add("selectedEditor")}unselect(){var e,t,n;null===(e=_classPrivateFieldGet(_,this))||void 0===e||e.classList.add("hidden"),null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor"),null!==(n=this.div)&&void 0!==n&&n.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(e,t){}disableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!0)}enableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(f,this)}set isEditing(e){_classPrivateFieldSet(f,this,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){_classPrivateFieldSet(p,this,!0);const n=e/t,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}}function y(e,t,n){let[a,r]=e;[t,n]=this.screenToPageTranslation(t,n),this.x+=t/a,this.y+=n/r,this.fixAndSetPosition()}function C(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=a,r=n/e,i=n/t;switch(this.rotation){case 90:return[-r,i];case 180:return[r,i];case 270:return[r,-i];default:return[-r,-i]}}function A(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}function N(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}function R(){if(_classPrivateFieldGet(_,this))return;_classPrivateFieldSet(_,this,document.createElement("div")),_classPrivateFieldGet(_,this).classList.add("resizers");const e=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||e.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const t of e){const e=document.createElement("div");_classPrivateFieldGet(_,this).append(e),e.classList.add("resizer",t),e.addEventListener("pointerdown",_assertClassBrand(v,this,O).bind(this,t)),e.addEventListener("contextmenu",s.noContextMenu)}this.div.prepend(_classPrivateFieldGet(_,this))}function O(e,t){t.preventDefault();const{isMac:n}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&n)return;const a=_assertClassBrand(v,this,I).bind(this,e),r=this._isDraggable;this._isDraggable=!1;const s={passive:!0,capture:!0};window.addEventListener("pointermove",a,s);const o=this.x,l=this.y,c=this.width,d=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const _=()=>{this._isDraggable=r,window.removeEventListener("pointerup",_),window.removeEventListener("blur",_),window.removeEventListener("pointermove",a,s),this.parent.div.style.cursor=u,this.div.style.cursor=p;const e=this.x,t=this.y,n=this.width,i=this.height;e===o&&t===l&&n===c&&i===d||this.addCommands({cmd:()=>{this.width=n,this.height=i,this.x=e,this.y=t;const[a,r]=this.parentDimensions;this.setDims(a*n,r*i),this.fixAndSetPosition()},undo:()=>{this.width=c,this.height=d,this.x=o,this.y=l;const[e,t]=this.parentDimensions;this.setDims(e*c,t*d),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",_),window.addEventListener("blur",_)}function I(e,t){const[n,r]=this.parentDimensions,i=this.x,s=this.y,o=this.width,l=this.height,c=a.MIN_SIZE/n,d=a.MIN_SIZE/r,u=e=>Math.round(1e4*e)/1e4,p=_assertClassBrand(v,this,N).call(this,this.rotation),_=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],m=_assertClassBrand(v,this,N).call(this,360-this.rotation);let h,g,f=!1,E=!1;switch(e){case"topLeft":f=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":f=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":E=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":f=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":f=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":E=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}const b=h(o,l),S=g(o,l);let T=_(...S);const y=u(i+T[0]),C=u(s+T[1]);let A=1,R=1,[O,I]=this.screenToPageTranslation(t.movementX,t.movementY);var w,x;if([O,I]=(w=O/n,x=I/r,[m[0]*w+m[2]*x,m[1]*w+m[3]*x]),f){const e=Math.hypot(o,l);A=R=Math.max(Math.min(Math.hypot(S[0]-b[0]-O,S[1]-b[1]-I)/e,1/o,1/l),c/o,d/l)}else E?A=Math.max(c,Math.min(1,Math.abs(S[0]-b[0]-O)))/o:R=Math.max(d,Math.min(1,Math.abs(S[1]-b[1]-I)))/l;const D=u(o*A),k=u(l*R);T=_(...g(D,k));const P=y-T[0],M=C-T[1];this.width=D,this.height=k,this.x=P,this.y=M,this.setDims(n*D,r*k),this.fixAndSetPosition()}async function w(){const e=_classPrivateFieldGet(c,this);if(!e)return;var t;if(!_classPrivateFieldGet(o,this)&&!_classPrivateFieldGet(l,this))return e.classList.remove("done"),void(null===(t=_classPrivateFieldGet(d,this))||void 0===t||t.remove());a._l10nPromise.get("editor_alt_text_edit_button_label").then((t=>{e.setAttribute("aria-label",t)}));let n=_classPrivateFieldGet(d,this);if(!n){_classPrivateFieldSet(d,this,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const t=n.id="alt-text-tooltip-".concat(this.id);e.setAttribute("aria-describedby",t);const a=100;e.addEventListener("mouseenter",(()=>{_classPrivateFieldSet(u,this,setTimeout((()=>{_classPrivateFieldSet(u,this,null),_classPrivateFieldGet(d,this).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})}),a))})),e.addEventListener("mouseleave",(()=>{var e;clearTimeout(_classPrivateFieldGet(u,this)),_classPrivateFieldSet(u,this,null),null===(e=_classPrivateFieldGet(d,this))||void 0===e||e.classList.remove("show")}))}e.classList.add("done"),n.innerText=_classPrivateFieldGet(l,this)?await a._l10nPromise.get("editor_alt_text_decorative_tooltip"):_classPrivateFieldGet(o,this),n.parentNode||e.append(n)}function x(e){if(!this._isDraggable)return;const t=this._uiManager.isSelected(this);let n,a;this._uiManager.setUpDragSession(),t&&(n={passive:!0,capture:!0},a=e=>{const[t,n]=this.screenToPageTranslation(e.movementX,e.movementY);this._uiManager.dragSelectedEditors(t,n)},window.addEventListener("pointermove",a,n));const r=()=>{if(window.removeEventListener("pointerup",r),window.removeEventListener("blur",r),t&&window.removeEventListener("pointermove",a,n),_classPrivateFieldSet(g,this,!1),!this._uiManager.endDragSession()){const{isMac:t}=i.FeatureTest.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",r),window.addEventListener("blur",r)}a=T,_defineProperty(T,"_borderLineWidth",-1),_defineProperty(T,"_colorManager",new r.ColorManager),_defineProperty(T,"_zIndex",1),_defineProperty(T,"SMALL_EDITOR_SIZE",0),t.AnnotationEditor=T;class D extends T{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const a of n)t.addEventListener(a,e[a].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var r=n(1),i=n(6),s=new WeakMap;class o{constructor(){_classPrivateFieldInitSpec(this,s,0)}getId(){var e,t;return"".concat(r.AnnotationEditorPrefix).concat((_classPrivateFieldSet(s,this,(e=_classPrivateFieldGet(s,this),t=e++,e)),t))}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakSet;class p{constructor(){_classPrivateMethodInitSpec(this,u),_classPrivateFieldInitSpec(this,l,(0,r.getUuid)()),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,null)}static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d"),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,';const n=t.decode().then((()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])));return(0,r.shadow)(this,"_isSVGFittingCanvas",n)}async getFromFile(e){const{lastModified:t,name:n,size:a,type:r}=e;return _assertClassBrand(u,this,_).call(this,"".concat(t,"_").concat(n,"_").concat(a,"_").concat(r),e)}async getFromUrl(e){return _assertClassBrand(u,this,_).call(this,e,e)}async getFromId(e){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const t=_classPrivateFieldGet(d,this).get(e);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(e){const t=_classPrivateFieldGet(d,this).get(e);return null!==t&&void 0!==t&&t.isSvg?t.svgUrl:null}deleteId(e){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const t=_classPrivateFieldGet(d,this).get(e);t&&(t.refCounter-=1,0===t.refCounter&&(t.bitmap=null))}isValidId(e){return e.startsWith("image_".concat(_classPrivateFieldGet(l,this),"_"))}}async function _(e,t){var n;_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);let r=_classPrivateFieldGet(d,this).get(e);if(null===r)return null;if(null!==(n=r)&&void 0!==n&&n.bitmap)return r.refCounter+=1,r;try{var i,s;let e;if(r||(r={bitmap:null,id:"image_".concat(_classPrivateFieldGet(l,this),"_").concat((_classPrivateFieldSet(c,this,(i=_classPrivateFieldGet(c,this),s=i++,i)),s)),refCounter:0,isSvg:!1}),"string"===typeof t){r.url=t;const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);e=await n.blob()}else e=r.file=t;if("image/svg+xml"===e.type){const t=a._isSVGFittingCanvas,n=new FileReader,i=new Image,s=new Promise(((e,a)=>{i.onload=()=>{r.bitmap=i,r.isSvg=!0,e()},n.onload=async()=>{const e=r.svgUrl=n.result;i.src=await t?"".concat(e,"#svgView(preserveAspectRatio(none))"):e},i.onerror=n.onerror=a}));n.readAsDataURL(e),await s}else r.bitmap=await createImageBitmap(e);r.refCounter=1}catch(o){console.error(o),r=null}return _classPrivateFieldGet(d,this).set(e,r),r&&_classPrivateFieldGet(d,this).set(r.id,r),r}a=p;var m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap;class E{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,m,[]),_classPrivateFieldInitSpec(this,h,!1),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,f,-1),_classPrivateFieldSet(g,this,e)}add(e){let{cmd:t,undo:n,mustExec:a,type:r=NaN,overwriteIfSameType:i=!1,keepUndo:s=!1}=e;if(a&&t(),_classPrivateFieldGet(h,this))return;const o={cmd:t,undo:n,type:r};if(-1===_classPrivateFieldGet(f,this))return _classPrivateFieldGet(m,this).length>0&&(_classPrivateFieldGet(m,this).length=0),_classPrivateFieldSet(f,this,0),void _classPrivateFieldGet(m,this).push(o);if(i&&_classPrivateFieldGet(m,this)[_classPrivateFieldGet(f,this)].type===r)return s&&(o.undo=_classPrivateFieldGet(m,this)[_classPrivateFieldGet(f,this)].undo),void(_classPrivateFieldGet(m,this)[_classPrivateFieldGet(f,this)]=o);const l=_classPrivateFieldGet(f,this)+1;l===_classPrivateFieldGet(g,this)?_classPrivateFieldGet(m,this).splice(0,1):(_classPrivateFieldSet(f,this,l),l<_classPrivateFieldGet(m,this).length&&_classPrivateFieldGet(m,this).splice(l)),_classPrivateFieldGet(m,this).push(o)}undo(){-1!==_classPrivateFieldGet(f,this)&&(_classPrivateFieldSet(h,this,!0),_classPrivateFieldGet(m,this)[_classPrivateFieldGet(f,this)].undo(),_classPrivateFieldSet(h,this,!1),_classPrivateFieldSet(f,this,_classPrivateFieldGet(f,this)-1))}redo(){_classPrivateFieldGet(f,this)<_classPrivateFieldGet(m,this).length-1&&(_classPrivateFieldSet(f,this,_classPrivateFieldGet(f,this)+1),_classPrivateFieldSet(h,this,!0),_classPrivateFieldGet(m,this)[_classPrivateFieldGet(f,this)].cmd(),_classPrivateFieldSet(h,this,!1))}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(f,this)}hasSomethingToRedo(){return _classPrivateFieldGet(f,this)<_classPrivateFieldGet(m,this).length-1}destroy(){_classPrivateFieldSet(m,this,null)}}t.CommandManager=E;var b=new WeakSet;class S{constructor(e){_classPrivateMethodInitSpec(this,b),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=r.FeatureTest.platform;for(const[n,a,r={}]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),{callback:a,options:r}),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,{callback:a,options:r}),this.allKeys.add(e.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(_assertClassBrand(b,this,v).call(this,t));if(!n)return;const{callback:a,options:{bubbles:r=!1,args:i=[],checker:s=null}}=n;s&&!s(e,t)||(a.bind(e,...i)(),r||(t.stopPropagation(),t.preventDefault()))}}function v(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}t.KeyboardManager=S;class T{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,r.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[n,a]of this._colors)if(a.every(((e,n)=>e===t[n])))return T._colorsMapping.get(n);return t}getHexCode(e){const t=this._colors.get(e);return t?r.Util.makeHexColor(...t):e}}_defineProperty(T,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),t.ColorManager=T;var y=new WeakMap,C=new WeakMap,A=new WeakMap,N=new WeakMap,R=new WeakMap,O=new WeakMap,I=new WeakMap,w=new WeakMap,x=new WeakMap,D=new WeakMap,k=new WeakMap,P=new WeakMap,M=new WeakMap,L=new WeakMap,F=new WeakMap,B=new WeakMap,U=new WeakMap,G=new WeakMap,z=new WeakMap,H=new WeakMap,Y=new WeakMap,j=new WeakMap,V=new WeakMap,q=new WeakMap,W=new WeakMap,K=new WeakMap,Q=new WeakMap,$=new WeakMap,X=new WeakMap,Z=new WeakMap,J=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,ae=new WeakSet;class re{static get _keyboardManager(){const e=re.prototype,t=e=>{const{activeElement:t}=document;return t&&_classPrivateFieldGet(te,e).contains(t)&&e.hasSomethingToControl()},n=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new S([[["ctrl+a","mac+meta+a"],e.selectAll],[["ctrl+z","mac+meta+z"],e.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}]]))}constructor(e,t,n,a,s,l){_classPrivateMethodInitSpec(this,ae),_classPrivateFieldInitSpec(this,y,null),_classPrivateFieldInitSpec(this,C,new Map),_classPrivateFieldInitSpec(this,A,new Map),_classPrivateFieldInitSpec(this,N,null),_classPrivateFieldInitSpec(this,R,null),_classPrivateFieldInitSpec(this,O,new E),_classPrivateFieldInitSpec(this,I,0),_classPrivateFieldInitSpec(this,w,new Set),_classPrivateFieldInitSpec(this,x,null),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,k,new Set),_classPrivateFieldInitSpec(this,P,null),_classPrivateFieldInitSpec(this,M,new o),_classPrivateFieldInitSpec(this,L,!1),_classPrivateFieldInitSpec(this,F,!1),_classPrivateFieldInitSpec(this,B,null),_classPrivateFieldInitSpec(this,U,r.AnnotationEditorType.NONE),_classPrivateFieldInitSpec(this,G,new Set),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,H,this.blur.bind(this)),_classPrivateFieldInitSpec(this,Y,this.focus.bind(this)),_classPrivateFieldInitSpec(this,j,this.copy.bind(this)),_classPrivateFieldInitSpec(this,V,this.cut.bind(this)),_classPrivateFieldInitSpec(this,q,this.paste.bind(this)),_classPrivateFieldInitSpec(this,W,this.keydown.bind(this)),_classPrivateFieldInitSpec(this,K,this.onEditingAction.bind(this)),_classPrivateFieldInitSpec(this,Q,this.onPageChanging.bind(this)),_classPrivateFieldInitSpec(this,$,this.onScaleChanging.bind(this)),_classPrivateFieldInitSpec(this,X,this.onRotationChanging.bind(this)),_classPrivateFieldInitSpec(this,Z,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),_classPrivateFieldInitSpec(this,J,[0,0]),_classPrivateFieldInitSpec(this,ee,null),_classPrivateFieldInitSpec(this,te,null),_classPrivateFieldInitSpec(this,ne,null),_classPrivateFieldSet(te,this,e),_classPrivateFieldSet(ne,this,t),_classPrivateFieldSet(N,this,n),this._eventBus=a,this._eventBus._on("editingaction",_classPrivateFieldGet(K,this)),this._eventBus._on("pagechanging",_classPrivateFieldGet(Q,this)),this._eventBus._on("scalechanging",_classPrivateFieldGet($,this)),this._eventBus._on("rotationchanging",_classPrivateFieldGet(X,this)),_classPrivateFieldSet(R,this,s.annotationStorage),_classPrivateFieldSet(P,this,s.filterFactory),_classPrivateFieldSet(z,this,l),this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_assertClassBrand(ae,this,le).call(this),_assertClassBrand(ae,this,se).call(this),this._eventBus._off("editingaction",_classPrivateFieldGet(K,this)),this._eventBus._off("pagechanging",_classPrivateFieldGet(Q,this)),this._eventBus._off("scalechanging",_classPrivateFieldGet($,this)),this._eventBus._off("rotationchanging",_classPrivateFieldGet(X,this));for(const e of _classPrivateFieldGet(A,this).values())e.destroy();_classPrivateFieldGet(A,this).clear(),_classPrivateFieldGet(C,this).clear(),_classPrivateFieldGet(k,this).clear(),_classPrivateFieldSet(y,this,null),_classPrivateFieldGet(G,this).clear(),_classPrivateFieldGet(O,this).destroy(),_classPrivateFieldGet(N,this).destroy()}get hcmFilter(){return(0,r.shadow)(this,"hcmFilter",_classPrivateFieldGet(z,this)?_classPrivateFieldGet(P,this).addHCMFilter(_classPrivateFieldGet(z,this).foreground,_classPrivateFieldGet(z,this).background):"none")}get direction(){return(0,r.shadow)(this,"direction",getComputedStyle(_classPrivateFieldGet(te,this)).direction)}editAltText(e){var t;null===(t=_classPrivateFieldGet(N,this))||void 0===t||t.editAltText(this,e)}onPageChanging(e){let{pageNumber:t}=e;_classPrivateFieldSet(I,this,t-1)}focusMainContainer(){_classPrivateFieldGet(te,this).focus()}findParent(e,t){for(const n of _classPrivateFieldGet(A,this).values()){const{x:a,y:r,width:i,height:s}=n.div.getBoundingClientRect();if(e>=a&&e<=a+i&&t>=r&&t<=r+s)return n}return null}disableUserSelect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldGet(ne,this).classList.toggle("noUserSelect",e)}addShouldRescale(e){_classPrivateFieldGet(k,this).add(e)}removeShouldRescale(e){_classPrivateFieldGet(k,this).delete(e)}onScaleChanging(e){let{scale:t}=e;this.commitOrRemove(),this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const n of _classPrivateFieldGet(k,this))n.onScaleChanging()}onRotationChanging(e){let{pagesRotation:t}=e;this.commitOrRemove(),this.viewParameters.rotation=t}addToAnnotationStorage(e){e.isEmpty()||!_classPrivateFieldGet(R,this)||_classPrivateFieldGet(R,this).has(e.id)||_classPrivateFieldGet(R,this).setValue(e.id,e)}blur(){if(!this.hasSelection)return;const{activeElement:e}=document;for(const t of _classPrivateFieldGet(G,this))if(t.div.contains(e)){_classPrivateFieldSet(B,this,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!_classPrivateFieldGet(B,this))return;const[e,t]=_classPrivateFieldGet(B,this);_classPrivateFieldSet(B,this,null),t.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),t.focus()}addEditListeners(){_assertClassBrand(ae,this,oe).call(this),_assertClassBrand(ae,this,ce).call(this)}removeEditListeners(){_assertClassBrand(ae,this,le).call(this),_assertClassBrand(ae,this,de).call(this)}copy(e){var t;if(e.preventDefault(),null===(t=_classPrivateFieldGet(y,this))||void 0===t||t.commitOrRemove(),!this.hasSelection)return;const n=[];for(const a of _classPrivateFieldGet(G,this)){const e=a.serialize(!0);e&&n.push(e)}0!==n.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:t}=e;for(const r of t.items)for(const e of _classPrivateFieldGet(D,this))if(e.isHandlingMimeForPasting(r.type))return void e.paste(r,this.currentLayer);let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(i){return void(0,r.warn)('paste: "'.concat(i.message,'".'))}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const e=[];for(const i of n){const t=a.deserialize(i);if(!t)return;e.push(t)}const t=()=>{for(const t of e)_assertClassBrand(ae,this,he).call(this,t);_assertClassBrand(ae,this,fe).call(this,e)},r=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:r,mustExec:!0})}catch(i){(0,r.warn)('paste: "'.concat(i.message,'".'))}}keydown(e){var t;null!==(t=this.getActive())&&void 0!==t&&t.shouldGetKeyboardEvents()||re._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}setEditingState(e){e?(_assertClassBrand(ae,this,ie).call(this),_assertClassBrand(ae,this,oe).call(this),_assertClassBrand(ae,this,ce).call(this),_assertClassBrand(ae,this,ue).call(this,{isEditing:_classPrivateFieldGet(U,this)!==r.AnnotationEditorType.NONE,isEmpty:_assertClassBrand(ae,this,ge).call(this),hasSomethingToUndo:_classPrivateFieldGet(O,this).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(O,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(_assertClassBrand(ae,this,se).call(this),_assertClassBrand(ae,this,le).call(this),_assertClassBrand(ae,this,de).call(this),_assertClassBrand(ae,this,ue).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!_classPrivateFieldGet(D,this)){_classPrivateFieldSet(D,this,e);for(const e of _classPrivateFieldGet(D,this))_assertClassBrand(ae,this,pe).call(this,e.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(M,this).getId()}get currentLayer(){return _classPrivateFieldGet(A,this).get(_classPrivateFieldGet(I,this))}getLayer(e){return _classPrivateFieldGet(A,this).get(e)}get currentPageIndex(){return _classPrivateFieldGet(I,this)}addLayer(e){_classPrivateFieldGet(A,this).set(e.pageIndex,e),_classPrivateFieldGet(L,this)?e.enable():e.disable()}removeLayer(e){_classPrivateFieldGet(A,this).delete(e.pageIndex)}updateMode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(_classPrivateFieldGet(U,this)!==e){if(_classPrivateFieldSet(U,this,e),e===r.AnnotationEditorType.NONE)return this.setEditingState(!1),void _assertClassBrand(ae,this,me).call(this);this.setEditingState(!0),_assertClassBrand(ae,this,_e).call(this),this.unselectAll();for(const t of _classPrivateFieldGet(A,this).values())t.updateMode(e);if(t)for(const e of _classPrivateFieldGet(C,this).values())if(e.annotationElementId===t){this.setSelected(e),e.enterInEditMode();break}}}updateToolbar(e){e!==_classPrivateFieldGet(U,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(_classPrivateFieldGet(D,this))if(e!==r.AnnotationEditorParamsType.CREATE){for(const n of _classPrivateFieldGet(G,this))n.updateParams(e,t);for(const n of _classPrivateFieldGet(D,this))n.updateDefaultParams(e,t)}else this.currentLayer.addNewEditor(e)}enableWaiting(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_classPrivateFieldGet(F,this)!==e){_classPrivateFieldSet(F,this,e);for(const t of _classPrivateFieldGet(A,this).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const n of _classPrivateFieldGet(C,this).values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return _classPrivateFieldGet(C,this).get(e)}addEditor(e){_classPrivateFieldGet(C,this).set(e.id,e)}removeEditor(e){var t;_classPrivateFieldGet(C,this).delete(e.id),this.unselect(e),e.annotationElementId&&_classPrivateFieldGet(w,this).has(e.annotationElementId)||null===(t=_classPrivateFieldGet(R,this))||void 0===t||t.remove(e.id)}addDeletedAnnotationElement(e){_classPrivateFieldGet(w,this).add(e.annotationElementId),e.deleted=!0}isDeletedAnnotationElement(e){return _classPrivateFieldGet(w,this).has(e)}removeDeletedAnnotationElement(e){_classPrivateFieldGet(w,this).delete(e.annotationElementId),e.deleted=!1}setActiveEditor(e){_classPrivateFieldGet(y,this)!==e&&(_classPrivateFieldSet(y,this,e),e&&_assertClassBrand(ae,this,pe).call(this,e.propertiesToUpdate))}toggleSelected(e){if(_classPrivateFieldGet(G,this).has(e))return _classPrivateFieldGet(G,this).delete(e),e.unselect(),void _assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:this.hasSelection});_classPrivateFieldGet(G,this).add(e),e.select(),_assertClassBrand(ae,this,pe).call(this,e.propertiesToUpdate),_assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const t of _classPrivateFieldGet(G,this))t!==e&&t.unselect();_classPrivateFieldGet(G,this).clear(),_classPrivateFieldGet(G,this).add(e),e.select(),_assertClassBrand(ae,this,pe).call(this,e.propertiesToUpdate),_assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:!0})}isSelected(e){return _classPrivateFieldGet(G,this).has(e)}unselect(e){e.unselect(),_classPrivateFieldGet(G,this).delete(e),_assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(G,this).size}undo(){_classPrivateFieldGet(O,this).undo(),_assertClassBrand(ae,this,ue).call(this,{hasSomethingToUndo:_classPrivateFieldGet(O,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_assertClassBrand(ae,this,ge).call(this)})}redo(){_classPrivateFieldGet(O,this).redo(),_assertClassBrand(ae,this,ue).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(O,this).hasSomethingToRedo(),isEmpty:_assertClassBrand(ae,this,ge).call(this)})}addCommands(e){_classPrivateFieldGet(O,this).add(e),_assertClassBrand(ae,this,ue).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_assertClassBrand(ae,this,ge).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[..._classPrivateFieldGet(G,this)];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)_assertClassBrand(ae,this,he).call(this,t)},mustExec:!0})}commitOrRemove(){var e;null===(e=_classPrivateFieldGet(y,this))||void 0===e||e.commitOrRemove()}hasSomethingToControl(){return _classPrivateFieldGet(y,this)||this.hasSelection}selectAll(){for(const e of _classPrivateFieldGet(G,this))e.commit();_assertClassBrand(ae,this,fe).call(this,_classPrivateFieldGet(C,this).values())}unselectAll(){if(_classPrivateFieldGet(y,this))_classPrivateFieldGet(y,this).commitOrRemove();else if(this.hasSelection){for(const e of _classPrivateFieldGet(G,this))e.unselect();_classPrivateFieldGet(G,this).clear(),_assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;_classPrivateFieldGet(J,this)[0]+=e,_classPrivateFieldGet(J,this)[1]+=t;const[n,a]=_classPrivateFieldGet(J,this),r=[..._classPrivateFieldGet(G,this)];_classPrivateFieldGet(ee,this)&&clearTimeout(_classPrivateFieldGet(ee,this)),_classPrivateFieldSet(ee,this,setTimeout((()=>{_classPrivateFieldSet(ee,this,null),_classPrivateFieldGet(J,this)[0]=_classPrivateFieldGet(J,this)[1]=0,this.addCommands({cmd:()=>{for(const e of r)_classPrivateFieldGet(C,this).has(e.id)&&e.translateInPage(n,a)},undo:()=>{for(const e of r)_classPrivateFieldGet(C,this).has(e.id)&&e.translateInPage(-n,-a)},mustExec:!1})}),1e3));for(const i of r)i.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),_classPrivateFieldSet(x,this,new Map);for(const e of _classPrivateFieldGet(G,this))_classPrivateFieldGet(x,this).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!_classPrivateFieldGet(x,this))return!1;this.disableUserSelect(!1);const e=_classPrivateFieldGet(x,this);_classPrivateFieldSet(x,this,null);let t=!1;for(const[{x:a,y:r,pageIndex:i},s]of e)s.newX=a,s.newY=r,s.newPageIndex=i,t||(t=a!==s.savedX||r!==s.savedY||i!==s.savedPageIndex);if(!t)return!1;const n=(e,t,n,a)=>{if(_classPrivateFieldGet(C,this).has(e.id)){const r=_classPrivateFieldGet(A,this).get(a);r?e._setParentAndPosition(r,t,n):(e.pageIndex=a,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(const[t,{newX:a,newY:r,newPageIndex:i}]of e)n(t,a,r,i)},undo:()=>{for(const[t,{savedX:a,savedY:r,savedPageIndex:i}]of e)n(t,a,r,i)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(_classPrivateFieldGet(x,this))for(const n of _classPrivateFieldGet(x,this).keys())n.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}isActive(e){return _classPrivateFieldGet(y,this)===e}getActive(){return _classPrivateFieldGet(y,this)}getMode(){return _classPrivateFieldGet(U,this)}get imageManager(){return(0,r.shadow)(this,"imageManager",new p)}}function ie(){window.addEventListener("focus",_classPrivateFieldGet(Y,this)),window.addEventListener("blur",_classPrivateFieldGet(H,this))}function se(){window.removeEventListener("focus",_classPrivateFieldGet(Y,this)),window.removeEventListener("blur",_classPrivateFieldGet(H,this))}function oe(){window.addEventListener("keydown",_classPrivateFieldGet(W,this),{capture:!0})}function le(){window.removeEventListener("keydown",_classPrivateFieldGet(W,this),{capture:!0})}function ce(){document.addEventListener("copy",_classPrivateFieldGet(j,this)),document.addEventListener("cut",_classPrivateFieldGet(V,this)),document.addEventListener("paste",_classPrivateFieldGet(q,this))}function de(){document.removeEventListener("copy",_classPrivateFieldGet(j,this)),document.removeEventListener("cut",_classPrivateFieldGet(V,this)),document.removeEventListener("paste",_classPrivateFieldGet(q,this))}function ue(e){Object.entries(e).some((e=>{let[t,n]=e;return _classPrivateFieldGet(Z,this)[t]!==n}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(Z,this),e)})}function pe(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}function _e(){if(!_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!0);for(const e of _classPrivateFieldGet(A,this).values())e.enable()}}function me(){if(this.unselectAll(),_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!1);for(const e of _classPrivateFieldGet(A,this).values())e.disable()}}function he(e){const t=_classPrivateFieldGet(A,this).get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}function ge(){if(0===_classPrivateFieldGet(C,this).size)return!0;if(1===_classPrivateFieldGet(C,this).size)for(const e of _classPrivateFieldGet(C,this).values())return e.isEmpty();return!1}function fe(e){_classPrivateFieldGet(G,this).clear();for(const t of e)t.isEmpty()||(_classPrivateFieldGet(G,this).add(t),t.select());_assertClassBrand(ae,this,ue).call(this,{hasSelectedEditor:!0})}_defineProperty(re,"TRANSLATE_SMALL",1),_defineProperty(re,"TRANSLATE_BIG",10),t.AnnotationEditorUIManager=re},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const a=window.getComputedStyle(t).color;e.set(n,B(a))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:a,d:r,e:i,f:s}=e.getTransform();return[t,n,a,r,i,s]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:a,d:r,e:i,f:s}=e.getTransform().invertSelf();return[t,n,a,r,i,s]},t.getFilenameFromUrl=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof e)return t;if(M(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let r=n.exec(a[1])||n.exec(a[2])||n.exec(a[3]);if(r&&(r=r[0],r.includes("%")))try{r=n.exec(decodeURIComponent(r))[0]}catch{}return r||t},t.getRGB=B,t.getXfaPageViewport=function(e,t){let{scale:n=1,rotation:a=0}=t;const{width:r,height:i}=e.attributes.style,s=[0,0,parseInt(r),parseInt(i)];return new k({viewBox:s,scale:n,rotation:a})},t.isDataScheme=M,t.isPdfFile=function(e){return"string"===typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=L,t.loadScript=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((n,a)=>{const r=document.createElement("script");r.src=e,r.onload=function(e){t&&r.remove(),n(e)},r.onerror=function(){a(new Error("Cannot load script at: ".concat(r.src)))},(document.head||document.documentElement).append(r)}))},t.noContextMenu=function(e){e.preventDefault()},t.setLayerDimensions=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof k){const{pageWidth:a,pageHeight:r}=t.rawDims,{style:s}=e,o=i.FeatureTest.isCSSRoundSupported,l="var(--scale-factor) * ".concat(a,"px"),c="var(--scale-factor) * ".concat(r,"px"),d=o?"round(".concat(l,", 1px)"):"calc(".concat(l,")"),u=o?"round(".concat(c,", 1px)"):"calc(".concat(c,")");n&&t.rotation%180!==0?(s.width=u,s.height=d):(s.width=d,s.height=u)}a&&e.setAttribute("data-main-rotation",t.rotation)};var r=n(7),i=n(1);const s="http://www.w3.org/2000/svg";class o{}a=o,_defineProperty(o,"CSS",96),_defineProperty(o,"PDF",72),_defineProperty(o,"PDF_TO_CSS_UNITS",a.CSS/a.PDF),t.PixelsPerInch=o;var l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap,E=new WeakMap,b=new WeakSet;class S extends r.BaseFilterFactory{constructor(){let{docId:e,ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,l,void 0),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,void 0),_classPrivateFieldInitSpec(this,u,void 0),_classPrivateFieldInitSpec(this,p,void 0),_classPrivateFieldInitSpec(this,_,void 0),_classPrivateFieldInitSpec(this,m,void 0),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,f,void 0),_classPrivateFieldInitSpec(this,E,0),_classPrivateFieldSet(d,this,e),_classPrivateFieldSet(u,this,t)}addFilter(e){var t,n;if(!e)return"none";let a,r,i,s,o=_classPrivateGetter(b,this,v).get(e);if(o)return o;if(1===e.length){const t=e[0],n=new Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;s=a=r=i=n.join(",")}else{const[t,n,o]=e,l=new Array(256),c=new Array(256),d=new Array(256);for(let e=0;e<256;e++)l[e]=t[e]/255,c[e]=n[e]/255,d[e]=o[e]/255;a=l.join(","),r=c.join(","),i=d.join(","),s="".concat(a).concat(r).concat(i)}if(o=_classPrivateGetter(b,this,v).get(s),o)return _classPrivateGetter(b,this,v).set(e,o),o;const l="g_".concat(_classPrivateFieldGet(d,this),"_transfer_map_").concat((_classPrivateFieldSet(E,this,(t=_classPrivateFieldGet(E,this),n=t++,t)),n)),c="url(#".concat(l,")");_classPrivateGetter(b,this,v).set(e,c),_classPrivateGetter(b,this,v).set(s,c);const u=_assertClassBrand(b,this,C).call(this,l);return _assertClassBrand(b,this,N).call(this,a,r,i,u),c}addHCMFilter(e,t){var n;const a="".concat(e,"-").concat(t);if(_classPrivateFieldGet(_,this)===a)return _classPrivateFieldGet(m,this);if(_classPrivateFieldSet(_,this,a),_classPrivateFieldSet(m,this,"none"),null===(n=_classPrivateFieldGet(p,this))||void 0===n||n.remove(),!e||!t)return _classPrivateFieldGet(m,this);const r=_assertClassBrand(b,this,R).call(this,e);e=i.Util.makeHexColor(...r);const s=_assertClassBrand(b,this,R).call(this,t);if(t=i.Util.makeHexColor(...s),_classPrivateGetter(b,this,T).style.color="","#000000"===e&&"#ffffff"===t||e===t)return _classPrivateFieldGet(m,this);const o=new Array(256);for(let i=0;i<=255;i++){const e=i/255;o[i]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const l=o.join(","),c="g_".concat(_classPrivateFieldGet(d,this),"_hcm_filter"),u=_classPrivateFieldSet(h,this,_assertClassBrand(b,this,C).call(this,c));_assertClassBrand(b,this,N).call(this,l,l,l,u),_assertClassBrand(b,this,y).call(this,u);const g=(e,t)=>{const n=r[e]/255,a=s[e]/255,i=new Array(t+1);for(let r=0;r<=t;r++)i[r]=n+r/t*(a-n);return i.join(",")};return _assertClassBrand(b,this,N).call(this,g(0,5),g(1,5),g(2,5),u),_classPrivateFieldSet(m,this,"url(#".concat(c,")")),_classPrivateFieldGet(m,this)}addHighlightHCMFilter(e,t,n,a){var r;const i="".concat(e,"-").concat(t,"-").concat(n,"-").concat(a);if(_classPrivateFieldGet(g,this)===i)return _classPrivateFieldGet(f,this);if(_classPrivateFieldSet(g,this,i),_classPrivateFieldSet(f,this,"none"),null===(r=_classPrivateFieldGet(h,this))||void 0===r||r.remove(),!e||!t)return _classPrivateFieldGet(f,this);const[s,o]=[e,t].map(_assertClassBrand(b,this,R).bind(this));let l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),[u,p]=[n,a].map(_assertClassBrand(b,this,R).bind(this));c{const a=new Array(256),r=(c-l)/n,i=e/255,s=(t-e)/(255*n);let o=0;for(let c=0;c<=n;c++){const e=Math.round(l+c*r),t=i+c*s;for(let n=o;n<=e;n++)a[n]=t;o=e+1}for(let l=o;l<256;l++)a[l]=a[o-1];return a.join(",")},m="g_".concat(_classPrivateFieldGet(d,this),"_hcm_highlight_filter"),E=_classPrivateFieldSet(h,this,_assertClassBrand(b,this,C).call(this,m));return _assertClassBrand(b,this,y).call(this,E),_assertClassBrand(b,this,N).call(this,_(u[0],p[0],5),_(u[1],p[1],5),_(u[2],p[2],5),E),_classPrivateFieldSet(f,this,"url(#".concat(m,")")),_classPrivateFieldGet(f,this)}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(_classPrivateFieldGet(m,this)||_classPrivateFieldGet(f,this))||(_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).parentNode.parentNode.remove(),_classPrivateFieldSet(c,this,null)),_classPrivateFieldGet(l,this)&&(_classPrivateFieldGet(l,this).clear(),_classPrivateFieldSet(l,this,null)),_classPrivateFieldSet(E,this,0))}}function v(e){return _classPrivateFieldGet(l,e)||_classPrivateFieldSet(l,e,new Map)}function T(e){if(!_classPrivateFieldGet(c,e)){const t=_classPrivateFieldGet(u,e).createElement("div"),{style:n}=t;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const a=_classPrivateFieldGet(u,e).createElementNS(s,"svg");a.setAttribute("width",0),a.setAttribute("height",0),_classPrivateFieldSet(c,e,_classPrivateFieldGet(u,e).createElementNS(s,"defs")),t.append(a),a.append(_classPrivateFieldGet(c,e)),_classPrivateFieldGet(u,e).body.append(t)}return _classPrivateFieldGet(c,e)}function y(e){const t=_classPrivateFieldGet(u,this).createElementNS(s,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}function C(e){const t=_classPrivateFieldGet(u,this).createElementNS(s,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),_classPrivateGetter(b,this,T).append(t),t}function A(e,t,n){const a=_classPrivateFieldGet(u,this).createElementNS(s,t);a.setAttribute("type","discrete"),a.setAttribute("tableValues",n),e.append(a)}function N(e,t,n,a){const r=_classPrivateFieldGet(u,this).createElementNS(s,"feComponentTransfer");a.append(r),_assertClassBrand(b,this,A).call(this,r,"feFuncR",e),_assertClassBrand(b,this,A).call(this,r,"feFuncG",t),_assertClassBrand(b,this,A).call(this,r,"feFuncB",n)}function R(e){return _classPrivateGetter(b,this,T).style.color=e,B(getComputedStyle(_classPrivateGetter(b,this,T)).getPropertyValue("color"))}t.DOMFilterFactory=S;class O extends r.BaseCanvasFactory{constructor(){let{ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function I(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(L(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,i.stringToBytes)(await n.text())}return new Promise(((n,a)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),t&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let e;if(t&&r.response?e=new Uint8Array(r.response):!t&&r.responseText&&(e=(0,i.stringToBytes)(r.responseText)),e)return void n(e)}a(new Error(r.statusText))}},r.send(null)}))}t.DOMCanvasFactory=O;class w extends r.BaseCMapReaderFactory{_fetchData(e,t){return I(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=w;class x extends r.BaseStandardFontDataFactory{_fetchData(e){return I(e,!0)}}t.DOMStandardFontDataFactory=x;class D extends r.BaseSVGFactory{_createSVG(e){return document.createElementNS(s,e)}}t.DOMSVGFactory=D;class k{constructor(e){let{viewBox:t,scale:n,rotation:a,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}=e;this.viewBox=t,this.scale=n,this.rotation=a,this.offsetX=r,this.offsetY=i;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,d,u,p,_,m,h,g;switch(a%=360,a<0&&(a+=360),a){case 180:c=-1,d=0,u=0,p=1;break;case 90:c=0,d=1,u=1,p=0;break;case 270:c=0,d=-1,u=-1,p=0;break;case 0:c=1,d=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(u=-u,p=-p),0===c?(_=Math.abs(l-t[1])*n+r,m=Math.abs(o-t[0])*n+i,h=(t[3]-t[1])*n,g=(t[2]-t[0])*n):(_=Math.abs(o-t[0])*n+r,m=Math.abs(l-t[1])*n+i,h=(t[2]-t[0])*n,g=(t[3]-t[1])*n),this.transform=[c*n,d*n,u*n,p*n,_-c*n*o-u*n*l,m-d*n*o-p*n*l],this.width=h,this.height=g}get rawDims(){const{viewBox:e}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone(){let{scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:a=this.offsetY,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new k({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:a,dontFlip:r})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=k;class P extends i.BaseException{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(e,"RenderingCancelledException"),this.extraDelay=t}}function M(e){const t=e.length;let n=0;for(;n>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,i.warn)('Not a valid color format: "'.concat(e,'"')),[0,0,0])}t.RenderingCancelledException=P,t.StatTimer=class{constructor(){_defineProperty(this,"started",Object.create(null)),_defineProperty(this,"times",[])}time(e){e in this.started&&(0,i.warn)("Timer is already running for ".concat(e)),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)("Timer has not been started for ".concat(e)),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:n}of this.times)t=Math.max(n.length,t);for(const{name:n,start:a,end:r}of this.times)e.push("".concat(n.padEnd(t)," ").concat(r-a,"ms\n"));return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!==typeof e)return null;F||(F=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=F.exec(e);if(!t)return null;const n=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r:1;let i=parseInt(t[4],10);i=i>=0&&i<=23?i:0;let s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(i+=c,s+=d):"+"===l&&(i-=c,s-=d),new Date(Date.UTC(n,a,r,i,s,o))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var a=n(1);class r{constructor(){this.constructor===r&&(0,a.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,n,a){return"none"}destroy(){}}t.BaseFilterFactory=r;class i{constructor(){this.constructor===i&&(0,a.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,a.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class s{constructor(e){let{baseUrl:t=null,isCompressed:n=!0}=e;this.constructor===s&&(0,a.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=n}async fetch(e){let{name:t}=e;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const n=this.baseUrl+t+(this.isCompressed?".bcmap":""),r=this.isCompressed?a.CMapCompressionType.BINARY:a.CMapCompressionType.NONE;return this._fetchData(n,r).catch((e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(n))}))}_fetchData(e,t){(0,a.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=s;class o{constructor(e){let{baseUrl:t=null}=e;this.constructor===o&&(0,a.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(e){let{filename:t}=e;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const n="".concat(this.baseUrl).concat(t);return this._fetchData(n).catch((e=>{throw new Error("Unable to load font data at: ".concat(n))}))}_fetchData(e){(0,a.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,a.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),n||(a.setAttribute("width","".concat(e,"px")),a.setAttribute("height","".concat(t,"px"))),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox","0 0 ".concat(e," ").concat(t)),a}createElement(e){if("string"!==typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,a.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var a=n(1);const r=3285377520,i=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:r,this.h2=e?4294967295&e:r}update(e){let t,n;if("string"===typeof e){t=new Uint8Array(2*e.length),n=0;for(let a=0,r=e.length;a>>8,t[n++]=255&r)}}else{if(!(0,a.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const r=n>>2,o=n-4*r,l=new Uint32Array(t.buffer,0,r);let c=0,d=0,u=this.h1,p=this.h2;const _=3432918353,m=461845907,h=11601,g=13715;for(let a=0;a>>17,c=c*m&i|c*g&s,u^=c,u=u<<13|u>>>19,u=5*u+3864292196):(d=l[a],d=d*_&i|d*h&s,d=d<<15|d>>>17,d=d*m&i|d*g&s,p^=d,p=p<<13|p>>>19,p=5*p+3864292196);switch(c=0,o){case 3:c^=t[4*r+2]<<16;case 2:c^=t[4*r+1]<<8;case 1:c^=t[4*r],c=c*_&i|c*h&s,c=c<<15|c>>>17,c=c*m&i|c*g&s,1&r?u^=c:p^=c}this.h1=u,this.h2=p}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&i|36045*e&s,t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,e=444984403*e&i|60499*e&s,t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var a=n(1),r=new WeakMap;t.FontLoader=class{constructor(e){let{ownerDocument:t=globalThis.document,styleElement:n=null}=e;_classPrivateFieldInitSpec(this,r,new Set),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),_classPrivateFieldGet(r,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(e){if(e&&!_classPrivateFieldGet(r,this).has(e.loadedName))if((0,a.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:i}=e,s=new FontFace(t,n,i);this.addNativeFontFace(s);try{await s.load(),_classPrivateFieldGet(r,this).add(t)}catch{(0,a.warn)("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(s)}}else(0,a.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e.systemFontInfo);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw(0,a.warn)("Failed to load font '".concat(t.family,"': '").concat(n,"'.")),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)}))}}get isFontLoadingAPISupported(){var e;const t=!(null===(e=this._document)||void 0===e||!e.fonts);return(0,a.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let e=!1;return(a.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,a.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,a.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,a.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,a){return e.substring(0,t)+a+e.substring(t+n)}let i,s;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const d="lt".concat(Date.now()).concat(this.loadTestFontId++);let u=this._loadTestFont;u=r(u,976,d.length,d);const p=1482184792;let _=n(u,16);for(i=0,s=d.length-3;i30)return(0,a.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(d,(()=>{g.remove(),t.complete()}))}},t.FontFaceObject=class{constructor(e,t){let{isEvalSupported:n=!0,disableFontFace:a=!1,ignoreErrors:r=!1,inspectFont:i=null}=t;this.compiledGlyphs=Object.create(null);for(const s in e)this[s]=e[s];this.isEvalSupported=!1!==n,this.disableFontFace=!0===a,this.ignoreErrors=!0===r,this._inspectFont=i}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return null===(e=this._inspectFont)||void 0===e||e.call(this,this),t}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const t=(0,a.bytesToString)(this.data),n="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");");let r;if(this.cssFontInfo){let e="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(e+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),r='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(e,"src:").concat(n,"}")}else r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(n,"}");return null===(e=this._inspectFont)||void 0===e||e.call(this,this,n),r}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(r){if(!this.ignoreErrors)throw r;return(0,a.warn)('getPathGenerator - ignoring character: "'.concat(r,'".')),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&a.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const a of n)"scale"===a.cmd&&(a.args=[t,-t]),e[a.cmd].apply(e,a.args)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var a=n(7);n(1);const r=function(e){return new Promise(((t,n)=>{__webpack_require__(5618).readFile(e,((e,a)=>{!e&&a?t(new Uint8Array(a)):n(new Error(e))}))}))};class i extends a.BaseFilterFactory{}t.NodeFilterFactory=i;class s extends a.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(7640).createCanvas(e,t)}}t.NodeCanvasFactory=s;class o extends a.BaseCMapReaderFactory{_fetchData(e,t){return r(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=o;class l extends a.BaseStandardFontDataFactory{_fetchData(e){return r(e)}}t.NodeStandardFontDataFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var a=n(1),r=n(6),i=n(12),s=n(13);const o=4096,l=16;class c{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let a;return void 0!==this.cache[e]?(a=this.cache[e],this.canvasFactory.reset(a,t,n)):(a=this.canvasFactory.create(t,n),this.cache[e]=a),a}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function d(e,t,n,a,i,s,o,l,c,d){const[u,p,_,m,h,g]=(0,r.getCurrentTransform)(e);if(0===p&&0===_){const r=o*u+h,f=Math.round(r),E=l*m+g,b=Math.round(E),S=(o+c)*u+h,v=Math.abs(Math.round(S)-f)||1,T=(l+d)*m+g,y=Math.abs(Math.round(T)-b)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(m),f,b),e.drawImage(t,n,a,i,s,0,0,v,y),e.setTransform(u,p,_,m,h,g),[v,y]}if(0===u&&0===m){const r=l*_+h,f=Math.round(r),E=o*p+g,b=Math.round(E),S=(l+d)*_+h,v=Math.abs(Math.round(S)-f)||1,T=(o+c)*p+g,y=Math.abs(Math.round(T)-b)||1;return e.setTransform(0,Math.sign(p),Math.sign(_),0,f,b),e.drawImage(t,n,a,i,s,0,0,y,v),e.setTransform(u,p,_,m,h,g),[y,v]}return e.drawImage(t,n,a,i,s,o,l,c,d),[Math.hypot(u,p)*c,Math.hypot(_,m)*d]}class u{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=a.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=a.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=a.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="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=a.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=a.Util.applyTransform(t,e),r=a.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],r[0]),this.minY=Math.min(this.minY,n[1],r[1]),this.maxX=Math.max(this.maxX,n[0],r[0]),this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(e,t){a.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,i,s,o,l,c,d){const u=a.Util.bezierBoundingBox(t,n,r,i,s,o,l,c);if(d)return d[0]=Math.min(d[0],u[0],u[2]),d[1]=Math.max(d[1],u[0],u[2]),d[2]=Math.min(d[2],u[1],u[3]),void(d[3]=Math.max(d[3],u[1],u[3]));this.updateRectMinMax(e,u)}getPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===i.PathType.STROKE){t||(0,a.unreachable)("Stroke bounding box must include transform.");const e=a.Util.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,i=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=i,n[2]+=r,n[3]+=i}return n}updateClipFromPath(){const e=a.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return a.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function p(e,t){if("undefined"!==typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,r=t.width,i=n%l,s=(n-i)/l,o=0===i?s:s+1,c=e.createImageData(r,l);let d,u=0;const p=t.data,_=c.data;let m,h,g,f;if(t.kind===a.ImageKind.GRAYSCALE_1BPP){const t=p.byteLength,n=new Uint32Array(_.buffer,0,_.byteLength>>2),f=n.length,E=r+7>>3,b=4294967295,S=a.FeatureTest.isLittleEndian?4278190080:255;for(m=0;mE?r:8*e-7,s=-8&i;let o=0,l=0;for(;a>=1}for(;d=s&&(g=i,f=r*g),d=0,h=f;h--;)_[d++]=p[u++],_[d++]=p[u++],_[d++]=p[u++],_[d++]=255;e.putImageData(c,0,m*l)}}}function _(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,a=t.width,r=n%l,i=(n-r)/l,o=0===r?i:i+1,c=e.createImageData(a,l);let d=0;const u=t.data,p=c.data;for(let _=0;_>8,e[i-2]=e[i-2]*r+n*s>>8,e[i-1]=e[i-1]*r+a*s>>8}}}function f(e,t,n){const a=e.length,r=1/255;for(let i=3;i>8]>>8:t[r]*a>>16}}function b(e,t,n,a){const r=a[0],i=a[1],s=a[2]-r,o=a[3]-i;0!==s&&0!==o&&(function(e,t,n,a,r,i,s,o,l,c,d){const u=!!i,p=u?i[0]:0,_=u?i[1]:0,m=u?i[2]:0,h="Luminosity"===r?E:f,b=Math.min(a,Math.ceil(1048576/n));for(let f=0;f1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing(e){let{transform:t,viewport:n,transparency:a=!1,background:i=null}=e;const s=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,o),this.ctx.fillStyle=l,a){const e=this.cachedCanvases.getCanvas("transparent",s,o);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),h(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=(0,r.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,r){const i=e.argsArray,s=e.fnArray;let o=t||0;const l=i.length;if(l===o)return o;const c=l-o>10&&"function"===typeof n,d=c?Date.now()+15:0;let u=0;const p=this.commonObjs,_=this.objs;let m;for(;;){if(void 0!==r&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if(m=s[o],m!==a.OPS.dependency)this[m].apply(this,i[o]);else for(const e of i[o]){const t=e.startsWith("g_")?p:_;if(!t.has(e))return t.get(e,n),o}if(o++,o===l)return o;if(c&&++u>10){if(Date.now()>d)return n(),o;u=0}}}endDrawing(){_assertClassBrand(A,this,R).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),_assertClassBrand(A,this,O).call(this)}_scaleImage(e,t){const n=e.width,a=e.height;let r,i,s=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=a,d="prescale1";for(;s>2&&l>1||o>2&&c>1;){let t=l,n=c;s>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),s/=l/t),o>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/n),r=this.cachedCanvases.getCanvas(d,t,n),i=r.context,i.clearRect(0,0,t,n),i.drawImage(e,0,0,l,c,0,0,t,n),e=r.canvas,l=t,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:s}=e,o=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(t);let u,p,m,h;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;p=JSON.stringify(l?c:[c.slice(0,4),o]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const n=u.get(p);if(n&&!l)return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};m=n}m||(h=this.cachedCanvases.getCanvas("maskCanvas",n,s),_(h.context,e));let g=a.Util.transform(c,[1/n,0,0,-1/s,0,0]);g=a.Util.transform(g,[1,0,0,1,0,-s]);const f=a.Util.applyTransform([0,0],g),E=a.Util.applyTransform([n,s],g),b=a.Util.normalizeRect([f[0],f[1],E[0],E[1]]),v=Math.round(b[2]-b[0])||1,T=Math.round(b[3]-b[1])||1,y=this.cachedCanvases.getCanvas("fillCanvas",v,T),C=y.context,A=Math.min(f[0],E[0]),N=Math.min(f[1],E[1]);C.translate(-A,-N),C.transform(...g),m||(m=this._scaleImage(h.canvas,(0,r.getCurrentTransformInverse)(C)),m=m.img,u&&l&&u.set(p,m)),C.imageSmoothingEnabled=S((0,r.getCurrentTransform)(C),e.interpolate),d(C,m,0,0,m.width,m.height,0,0,n,s),C.globalCompositeOperation="source-in";const R=a.Util.transform((0,r.getCurrentTransformInverse)(C),[1,0,0,1,-A,-N]);return C.fillStyle=l?o.getPattern(t,this,R,i.PathType.FILL):o,C.fillRect(0,0,n,s),u&&!l&&(this.cachedCanvases.delete("fillCanvas"),u.set(p,y.canvas)),{canvas:y.canvas,offsetX:Math.round(A),offsetY:Math.round(N)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=v[e]}setLineJoin(e){this.ctx.lineJoin=T[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=a.context;const i=this.ctx;i.setTransform(...(0,r.getCurrentTransform)(this.suspendedCtx)),m(this.suspendedCtx,i),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,a,r,i,s){t.transform(e,n,a,r,i,s),this.__originalTransform(e,n,a,r,i,s)},e.setTransform=function(e,n,a,r,i,s){t.setTransform(e,n,a,r,i,s),this.__originalSetTransform(e,n,a,r,i,s)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,a,r,i,s){t.bezierCurveTo(e,n,a,r,i,s),this.__originalBezierCurveTo(e,n,a,r,i,s)},e.rect=function(e,n,a,r){t.rect(e,n,a,r),this.__originalRect(e,n,a,r)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(i,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(),m(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;b(this.suspendedCtx,t,this.ctx,e),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?(m(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),m(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,a,r,i){this.ctx.transform(e,t,n,a,r,i),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const i=this.ctx,s=this.current;let o,l,c=s.x,d=s.y;const u=(0,r.getCurrentTransform)(i),p=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],_=p?n.slice(0):null;for(let r=0,m=0,h=e.length;r0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof n&&null!==n&&void 0!==n&&n.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.fillColor;let a=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.FILL),a=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),a&&t.restore(),e&&this.consumePath(s)}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=y}eoClip(){this.pendingClip=C}beginText(){this.current.textMatrix=a.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const n of e)t.setTransform(...n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){var n;const r=this.commonObjs.get(e),i=this.current;if(!r)throw new Error("Can't find font for ".concat(e));if(i.fontMatrix=r.fontMatrix||a.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,a.warn)("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;const s=r.loadedName||"sans-serif",o=(null===(n=r.systemFontInfo)||void 0===n?void 0:n.css)||'"'.concat(s,'", ').concat(r.fallbackName);let l="normal";r.black?l="900":r.bold&&(l="bold");const c=r.italic?"italic":"normal";let d=t;t<16?d=16:t>100&&(d=100),this.current.fontSizeScale=t/d,this.ctx.font="".concat(c," ").concat(l," ").concat(d,"px ").concat(o)}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,a,r,i){this.current.textMatrix=[e,t,n,a,r,i],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,i){const s=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=c&a.TextRenderingMode.FILL_STROKE_MASK,p=!!(c&a.TextRenderingMode.ADD_TO_PATH_FLAG),_=o.patternFill&&!l.missingFile;let m;(l.disableFontFace||p||_)&&(m=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||_?(s.save(),s.translate(t,n),s.beginPath(),m(s,d),i&&s.setTransform(...i),u!==a.TextRenderingMode.FILL&&u!==a.TextRenderingMode.FILL_STROKE||s.fill(),u!==a.TextRenderingMode.STROKE&&u!==a.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(u!==a.TextRenderingMode.FILL&&u!==a.TextRenderingMode.FILL_STROKE||s.fillText(e,t,n),u!==a.TextRenderingMode.STROKE&&u!==a.TextRenderingMode.FILL_STROKE||s.strokeText(e,t,n)),p&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,r.getCurrentTransform)(s),x:t,y:n,fontSize:d,addToPath:m})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let a=3;a0&&t[a]<255){n=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const s=t.fontSize;if(0===s)return;const o=this.ctx,l=t.fontSizeScale,c=t.charSpacing,d=t.wordSpacing,u=t.fontDirection,p=t.textHScale*u,_=e.length,m=n.vertical,h=m?1:-1,g=n.defaultVMetrics,f=s*t.fontMatrix[0],E=t.textRenderingMode===a.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(o.save(),o.transform(...t.textMatrix),o.translate(t.x,t.y+t.textRise),u>0?o.scale(p,-1):o.scale(p,1),t.patternFill){o.save();const e=t.fillColor.getPattern(o,this,(0,r.getCurrentTransformInverse)(o),i.PathType.FILL);b=(0,r.getCurrentTransform)(o),o.restore(),o.fillStyle=e}let S=t.lineWidth;const v=t.textMatrixScale;if(0===v||0===S){const e=t.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;e!==a.TextRenderingMode.STROKE&&e!==a.TextRenderingMode.FILL_STROKE||(S=this.getSinglePixelWidth())}else S/=v;if(1!==l&&(o.scale(l,l),S/=l),o.lineWidth=S,n.isInvalidPDFjsFont){const n=[];let a=0;for(const t of e)n.push(t.unicode),a+=t.width;return o.fillText(n.join(""),0,0),t.x+=a*f*p,o.restore(),void this.compose()}let T,y=0;for(T=0;T<_;++T){const t=e[T];if("number"===typeof t){y+=h*t*s/1e3;continue}let a=!1;const r=(t.isSpace?d:0)+c,i=t.fontChar,p=t.accent;let _,S,v=t.width;if(m){const e=t.vmetric||g,n=-(t.vmetric?e[1]:.5*v)*f,a=e[2]*f;v=e?-e[0]:v,_=n/l,S=(y+a)/l}else _=y/l,S=0;if(n.remeasure&&v>0){const e=1e3*o.measureText(i).width/s*l;if(vnew N(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new i.TilingPattern(e,n,this.ctx,s,a)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const r=a.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,t,n){const r=a.Util.makeHexColor(e,t,n);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(e)?t=this.cachedPatterns.get(e):(t=(0,i.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,t)),n&&(t.matrix=n),t}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.SHADING);const s=(0,r.getCurrentTransformInverse)(t);if(s){const{width:e,height:n}=t.canvas,[r,i,o,l]=a.Util.getAxialAlignedBoundingBox([0,0,e,n],s);this.ctx.fillRect(r,i,o-r,l-i)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,a.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,a.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,r.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,a.info)("TODO: Support non-isolated groups."),e.knockout&&(0,a.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=a.Util.getAxialAlignedBoundingBox(e.bbox,(0,r.getCurrentTransform)(t));const s=[0,0,t.canvas.width,t.canvas.height];i=a.Util.intersect(i,s)||[0,0,0,0];const l=Math.floor(i[0]),c=Math.floor(i[1]);let d=Math.max(Math.ceil(i[2])-l,1),u=Math.max(Math.ceil(i[3])-c,1),p=1,_=1;d>o&&(p=d/o,d=o),u>o&&(_=u/o,u=o),this.current.startNewPathAndClipBox([0,0,d,u]);let h="groupAt"+this.groupLevel;e.smask&&(h+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(h,d,u),f=g.context;f.scale(1/p,1/_),f.translate(-l,-c),f.transform(...n),e.smask?this.smaskStack.push({canvas:g.canvas,context:f,offsetX:l,offsetY:c,scaleX:p,scaleY:_,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(l,c),t.scale(p,_),t.save()),m(t,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,r.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=a.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,i,s){if(_assertClassBrand(A,this,R).call(this),h(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const i=t[2]-t[0],o=t[3]-t[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=i,t[3]=o;const[s,l]=a.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(i*this.outputScaleX*c),u=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,u);const{canvas:p,context:_}=this.annotationCanvas;this.annotationCanvasMap.set(e,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=_,this.ctx.save(),this.ctx.setTransform(s,0,0,-l,0,o*l),h(this.ctx)}else h(this.ctx),this.ctx.rect(t[0],t[1],i,o),this.ctx.clip(),this.endPath()}this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),_assertClassBrand(A,this,O).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,a=this.processingType3;if(a&&(void 0===a.compiled&&(a.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=t+1;let i,s,o,l=new Uint8Array(r*(n+1));const c=t+7&-8;let d=new Uint8Array(c*n),u=0;for(const h of e.data){let e=128;for(;e>0;)d[u++]=h&e?0:255,e>>=1}let p=0;for(u=0,0!==d[u]&&(l[0]=1,++p),s=1;s>2)+(d[u+1]?4:0)+(d[u-c+1]?8:0),a[e]&&(l[o+s]=a[e],++p),u++;if(d[u-c]!==d[u]&&(l[o+s]=d[u]?2:4,++p),p>1e3)return null}for(u=c*(n-1),o=i*r,0!==d[u]&&(l[o]=8,++p),s=1;s1e3)return null;const _=new Int32Array([0,r,-1,0,-r,0,0,0,1]),m=new Path2D;for(i=0;p&&i<=n;i++){let e=i*r;const n=e+t;for(;e>4,l[e]&=s>>2|s<<2),m.lineTo(e%r,e/r|0),l[e]||--p}while(a!==e);--i}return d=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(m),e.beginPath(),e.restore()}}(e)),a.compiled))return void a.compiled(n);const r=this._createMaskCanvas(e),i=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,r.offsetX,r.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(t,n,i,s,0,0);const d=this._createMaskCanvas(e);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let r=0,u=o.length;rt?c/t:1,s=l>t?l/t:1}}this._cachedScaleForStroking[0]=i,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[a,r]=this.getScaleForStroking();if(t.lineWidth=n||1,1===a&&1===r)return void t.stroke();const i=t.getLineDash();if(e&&t.save(),t.scale(a,r),i.length>0){const e=Math.max(a,r);t.setLineDash(i.map((t=>t/e))),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}function R(){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)}function O(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}t.CanvasGraphics=N;for(const I in a.OPS)void 0!==N.prototype[I]&&(N.prototype[a.OPS[I]]=N.prototype[I])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new l(e);case"Mesh":return new u(e);case"Dummy":return new p}throw new Error("Unknown IR type: ".concat(e[0]))};var a=n(1),r=n(6);const i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function s(e,t){if(!t)return;const n=t[2]-t[0],a=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],n,a),e.clip(r)}t.PathType=i;class o{constructor(){this.constructor===o&&(0,a.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,a.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)t.addColorStop(n[0],n[1]);return t}getPattern(e,t,n,o){let l;if(o===i.STROKE||o===i.FILL){const i=t.current.getClippedPathBoundingBox(o,(0,r.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(i[2]-i[0])||1,d=Math.ceil(i[3]-i[1])||1,u=t.cachedCanvases.getCanvas("pattern",c,d,!0),p=u.context;p.clearRect(0,0,p.canvas.width,p.canvas.height),p.beginPath(),p.rect(0,0,p.canvas.width,p.canvas.height),p.translate(-i[0],-i[1]),n=a.Util.transform(n,[1,0,0,1,i[0],i[1]]),p.transform(...t.baseTransform),this.matrix&&p.transform(...this.matrix),s(p,this._bbox),p.fillStyle=this._createGradient(p),p.fill(),l=e.createPattern(u.canvas,"no-repeat");const _=new DOMMatrix(n);l.setTransform(_)}else s(e,this._bbox),l=this._createGradient(e);return l}}function c(e,t,n,a,r,i,s,o){const l=t.coords,c=t.colors,d=e.data,u=4*e.width;let p;l[n+1]>l[a+1]&&(p=n,n=a,a=p,p=i,i=s,s=p),l[a+1]>l[r+1]&&(p=a,a=r,r=p,p=s,s=o,o=p),l[n+1]>l[a+1]&&(p=n,n=a,a=p,p=i,i=s,s=p);const _=(l[n]+t.offsetX)*t.scaleX,m=(l[n+1]+t.offsetY)*t.scaleY,h=(l[a]+t.offsetX)*t.scaleX,g=(l[a+1]+t.offsetY)*t.scaleY,f=(l[r]+t.offsetX)*t.scaleX,E=(l[r+1]+t.offsetY)*t.scaleY;if(m>=E)return;const b=c[i],S=c[i+1],v=c[i+2],T=c[s],y=c[s+1],C=c[s+2],A=c[o],N=c[o+1],R=c[o+2],O=Math.round(m),I=Math.round(E);let w,x,D,k,P,M,L,F;for(let B=O;B<=I;B++){if(BE?1:g===E?0:(g-B)/(g-E),w=h-(h-f)*e,x=T-(T-A)*e,D=y-(y-N)*e,k=C-(C-R)*e}let e;e=BE?1:(m-B)/(m-E),P=_-(_-f)*e,M=b-(b-A)*e,L=S-(S-N)*e,F=v-(v-R)*e;const t=Math.round(Math.min(w,P)),n=Math.round(Math.max(w,P));let a=u*B+4*t;for(let r=t;r<=n;r++)e=(w-r)/(w-P),e<0?e=0:e>1&&(e=1),d[a++]=x-(x-M)*e|0,d[a++]=D-(D-L)*e|0,d[a++]=k-(k-F)*e|0,d[a++]=255}}function d(e,t,n){const a=t.coords,r=t.colors;let i,s;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(a.length/o)-1,d=o-1;for(i=0;i=a?r=a:n=r/e,{scale:n,size:r}}clipBbox(e,t,n,a,i){const s=a-t,o=i-n;e.ctx.rect(t,n,s,o),e.current.updateRectMinMax((0,r.getCurrentTransform)(e.ctx),[t,n,a,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const r=e.ctx,i=e.current;switch(t){case _:const e=this.ctx;r.fillStyle=e.fillStyle,r.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case m:const s=a.Util.makeHexColor(n[0],n[1],n[2]);r.fillStyle=s,r.strokeStyle=s,i.fillColor=s,i.strokeColor=s;break;default:throw new a.FormatError("Unsupported paint type: ".concat(t))}}getPattern(e,t,n,r){let s=n;r!==i.SHADING&&(s=a.Util.transform(s,t.baseTransform),this.matrix&&(s=a.Util.transform(s,this.matrix)));const o=this.createPatternCanvas(t);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}_defineProperty(h,"MAX_PATTERN_SIZE",3e3),t.TilingPattern=h},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=r,t.convertToRGBA=function(e){switch(e.kind){case a.ImageKind.GRAYSCALE_1BPP:return r(e);case a.ImageKind.RGB_24BPP:return function(e){let{src:t,srcPos:n=0,dest:r,destPos:i=0,width:s,height:o}=e,l=0;const c=t.length>>2,d=new Uint32Array(t.buffer,n,c);if(a.FeatureTest.isLittleEndian){for(;l>>24|t<<8|4278190080,r[i+2]=t>>>16|n<<16|4278190080,r[i+3]=n>>>8|4278190080}for(let e=4*l,n=t.length;e>>8|255,r[i+2]=t<<16|n>>>16|255,r[i+3]=n<<8|255}for(let e=4*l,n=t.length;e>3,_=7&i,m=t.length;r=new Uint32Array(r.buffer);let h=0;for(let a=0;a{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var a=n(1);const r=1,i=2,s=1,o=2,l=3,c=4,d=5,u=6,p=7,_=8;function m(e){switch(e instanceof Error||"object"===typeof e&&null!==e||(0,a.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new a.AbortException(e.message);case"MissingPDFException":return new a.MissingPDFException(e.message);case"PasswordException":return new a.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new a.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new a.UnknownErrorException(e.message,e.details);default:return new a.UnknownErrorException(e.message,e.toString())}}var h=new WeakSet;function g(e){const t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,s=this,o=this.actionHandler[e.action],u={enqueue(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=s,l>0&&this.desiredSize<=0&&(this.sinkCapability=new a.PromiseCapability,this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:c,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:l,streamId:t}),delete s.streamSinks[t])},error(e){(0,a.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:d,streamId:t,reason:m(e)}))},sinkCapability:new a.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,new Promise((function(t){t(o(e.data,u))})).then((function(){i.postMessage({sourceName:n,targetName:r,stream:_,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:r,stream:_,streamId:t,reason:m(e)})}))}function f(e){const t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,g=this.streamControllers[t],f=this.streamSinks[t];switch(e.stream){case _:e.success?g.startCall.resolve():g.startCall.reject(m(e.reason));break;case p:e.success?g.pullCall.resolve():g.pullCall.reject(m(e.reason));break;case u:if(!f){i.postMessage({sourceName:n,targetName:r,stream:p,streamId:t,success:!0});break}f.desiredSize<=0&&e.desiredSize>0&&f.sinkCapability.resolve(),f.desiredSize=e.desiredSize,new Promise((function(e){var t;e(null===(t=f.onPull)||void 0===t?void 0:t.call(f))})).then((function(){i.postMessage({sourceName:n,targetName:r,stream:p,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:r,stream:p,streamId:t,reason:m(e)})}));break;case c:if((0,a.assert)(g,"enqueue should have stream controller"),g.isClosed)break;g.controller.enqueue(e.chunk);break;case l:if((0,a.assert)(g,"close should have stream controller"),g.isClosed)break;g.isClosed=!0,g.controller.close(),_assertClassBrand(h,this,E).call(this,g,t);break;case d:(0,a.assert)(g,"error should have stream controller"),g.controller.error(m(e.reason)),_assertClassBrand(h,this,E).call(this,g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(m(e.reason)),_assertClassBrand(h,this,E).call(this,g,t);break;case s:if(!f)break;new Promise((function(t){var n;t(null===(n=f.onCancel)||void 0===n?void 0:n.call(f,m(e.reason)))})).then((function(){i.postMessage({sourceName:n,targetName:r,stream:o,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:r,stream:o,streamId:t,reason:m(e)})})),f.sinkCapability.reject(m(e.reason)),f.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async function E(e,t){var n,a,r;await Promise.allSettled([null===(n=e.startCall)||void 0===n?void 0:n.promise,null===(a=e.pullCall)||void 0===a?void 0:a.promise,null===(r=e.cancelCall)||void 0===r?void 0:r.promise]),delete this.streamControllers[t]}t.MessageHandler=class{constructor(e,t,n){_classPrivateMethodInitSpec(this,h),this.sourceName=e,this.targetName=t,this.comObj=n,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=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void _assertClassBrand(h,this,f).call(this,t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error("Cannot resolve callback ".concat(e));if(delete this.callbackCapabilities[e],t.callback===r)n.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");n.reject(m(t.reason))}return}const a=this.actionHandler[t.action];if(!a)throw new Error("Unknown action from worker: ".concat(t.action));if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(a(t.data))})).then((function(a){n.postMessage({sourceName:e,targetName:s,callback:r,callbackId:t.callbackId,data:a})}),(function(a){n.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:m(a)})}))}else t.streamId?_assertClassBrand(h,this,g).call(this,t):a(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error('There is already an actionName called "'.concat(e,'"'));n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const r=this.callbackId++,i=new a.PromiseCapability;this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(s){i.reject(s)}return i.promise}sendWithStream(e,t,n,r){const i=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const s=new a.PromiseCapability;return this.streamControllers[i]={controller:n,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),s.promise},pull:e=>{const t=new a.PromiseCapability;return this.streamControllers[i].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:u,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,a.assert)(e instanceof Error,"cancel must have a valid reason");const t=new a.PromiseCapability;return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:i,reason:m(e)}),t.promise}},n)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var a=n(1),r=new WeakMap,i=new WeakMap;t.Metadata=class{constructor(e){let{parsedData:t,rawData:n}=e;_classPrivateFieldInitSpec(this,r,void 0),_classPrivateFieldInitSpec(this,i,void 0),_classPrivateFieldSet(r,this,t),_classPrivateFieldSet(i,this,n)}getRaw(){return _classPrivateFieldGet(i,this)}get(e){var t;return null!==(t=_classPrivateFieldGet(r,this).get(e))&&void 0!==t?t:null}getAll(){return(0,a.objectFromMap)(_classPrivateFieldGet(r,this))}has(e){return _classPrivateFieldGet(r,this).has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var a=n(1),r=n(8);const i=Symbol("INTERNAL");var s=new WeakMap;class o{constructor(e,t){_classPrivateFieldInitSpec(this,s,!0),this.name=e,this.intent=t}get visible(){return _classPrivateFieldGet(s,this)}_setVisible(e,t){e!==i&&(0,a.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(s,this,t)}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakSet;function _(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let r=1;r1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(c,this).has(e)?(_classPrivateFieldGet(c,this).get(e)._setVisible(i,!!t),_classPrivateFieldSet(l,this,null)):(0,a.warn)("Optional content group not found: ".concat(e))}get hasInitialVisibility(){return null===_classPrivateFieldGet(d,this)||this.getHash()===_classPrivateFieldGet(d,this)}getOrder(){return _classPrivateFieldGet(c,this).size?_classPrivateFieldGet(u,this)?_classPrivateFieldGet(u,this).slice():[..._classPrivateFieldGet(c,this).keys()]:null}getGroups(){return _classPrivateFieldGet(c,this).size>0?(0,a.objectFromMap)(_classPrivateFieldGet(c,this)):null}getGroup(e){return _classPrivateFieldGet(c,this).get(e)||null}getHash(){if(null!==_classPrivateFieldGet(l,this))return _classPrivateFieldGet(l,this);const e=new r.MurmurHash3_64;for(const[t,n]of _classPrivateFieldGet(c,this))e.update("".concat(t,":").concat(n.visible));return _classPrivateFieldSet(l,this,e.hexdigest())}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var a=n(1),r=n(6);t.PDFDataTransportStream=class{constructor(e,t){let{length:n,initialData:r,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:o=!1,disableStream:l=!1}=e;if((0,a.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,(null===r||void 0===r?void 0:r.length)>0){const e=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){let{begin:t,chunk:n}=e;const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const e=this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(r),!0)}));(0,a.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}_onProgress(e){var t,n,a,r;void 0===e.total?null===(t=this._rangeReaders[0])||void 0===t||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded}):null===(a=this._fullRequestReader)||void 0===a||null===(r=a.onProgress)||void 0===r||r.call(a,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;null===(e=this._fullRequestReader)||void 0===e||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new i(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}};class i{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=e,this._done=n||!1,this._filename=(0,r.isPdfFile)(a)?a:null,this._queuedChunks=t||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=new a.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class s{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.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 e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new a.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var a=n(1),r=n(20);function i(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function s(e){const t=new Headers;for(const n in e){const a=e[n];void 0!==a&&t.append(n,a)}return t}function o(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,a.warn)("getArrayBuffer - unexpected data format: ".concat(e)),new Uint8Array(e).buffer)}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class l{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new a.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=s(this._stream.httpHeaders);const n=t.url;fetch(n,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:i,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new a.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 e;await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:o(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new a.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=s(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(t,"-").concat(n-1));const l=o.url;fetch(l,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:o(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new a.MissingPDFException('Missing PDF "'+t+'".'):new a.UnexpectedResponseException("Unexpected server response (".concat(e,') while retrieving PDF "').concat(t,'".'),e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,r.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,i.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function(e){let{getResponseHeader:t,isHttp:n,rangeChunkSize:a,disableRange:r}=e;const i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return Number.isInteger(s)?(i.suggestedLength=s,s<=2*a||r||!n||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var a=n(1),r=n(21),i=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=r("filename\\*","i").exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=l(e),e=c(e),s(e)}if(n=function(e){const t=[];let n;const a=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=a.exec(e));){let[,e,a,r]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[a,r]}const i=[];for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var a=n(1),r=n(20);class i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const a={begin:e,end:t};for(const r in n)a[r]=n[r];return this.request(a)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const r in this.httpHeaders){const e=this.httpHeaders[r];void 0!==e&&t.setRequestHeader(r,e)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(e.end-1)),a.expectedStatus=206):a.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=e.onHeadersReceived,a.onDone=e.onDone,a.onError=e.onError,a.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){var n;const a=this.pendingRequests[e];a&&(null===(n=a.onProgress)||void 0===n||n.call(a,t))}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==r.readyState)return;if(!(e in this.pendingRequests))return;var i;if(delete this.pendingRequests[e],0===r.status&&this.isHttp)return void(null===(i=n.onError)||void 0===i||i.call(n,r.status));const s=r.status||200;var o;if((200!==s||206!==n.expectedStatus)&&s!==n.expectedStatus)return void(null===(o=n.onError)||void 0===o||o.call(n,r.status));const l=function(e){const t=e.response;return"string"!==typeof t?t:(0,a.stringToBytes)(t).buffer}(r);if(206===s){const e=r.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:l})}else if(l)n.onDone({begin:0,chunk:l});else{var c;null===(c=n.onError)||void 0===c||c.call(n,r.status)}}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new i(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new o(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class s{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=new a.PromiseCapability,this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:a,suggestedLength:i}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.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 e=new a.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(e,t,n){this._manager=e;const a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new a.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var a=n(1),r=n(20);const i=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=__webpack_require__(6671),n=t.parse(e);return"file:"===n.protocol||n.host?n:/^[a-z]:[/\\]/i.test(e)?t.parse("file:///".concat(e)):(n.host||(n.protocol="file:"),n)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new u(this):new c(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new p(this,e,t):new d(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class s{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new a.PromiseCapability,this._headersCapability=new a.PromiseCapability}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 e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new a.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new a.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new a.PromiseCapability;const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new a.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function l(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class c extends s{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new a.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:i,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n)};if(this._request=null,"http:"===this._url.protocol){const n=__webpack_require__(7492);this._request=n.request(l(this._url,e.httpHeaders),t)}else{const n=__webpack_require__(1815);this._request=n.request(l(this._url,e.httpHeaders),t)}this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class d extends o{constructor(e,t,n){super(e),this._httpHeaders={};for(const a in e.httpHeaders){const t=e.httpHeaders[a];void 0!==t&&(this._httpHeaders[a]=t)}this._httpHeaders.Range="bytes=".concat(t,"-").concat(n-1);const r=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new a.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=e}};if(this._request=null,"http:"===this._url.protocol){const e=__webpack_require__(7492);this._request=e.request(l(this._url,this._httpHeaders),r)}else{const e=__webpack_require__(1815);this._request=e.request(l(this._url,this._httpHeaders),r)}this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class u extends s{constructor(e){super(e);let t=decodeURIComponent(this._url.path);i.test(this._url.href)&&(t=t.replace(/^\//,""));const n=__webpack_require__(5618);n.lstat(t,((e,r)=>{if(e)return"ENOENT"===e.code&&(e=new a.MissingPDFException('Missing PDF "'.concat(t,'".'))),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=r.size,this._setReadableStream(n.createReadStream(t)),this._headersCapability.resolve()}))}}class p extends o{constructor(e,t,n){super(e);let a=decodeURIComponent(this._url.path);i.test(this._url.href)&&(a=a.replace(/^\//,""));const r=__webpack_require__(5618);this._setReadableStream(r.createReadStream(a,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var a=n(6),r=n(1);const i="normal",s="normal",o="#000000",l=["butt","round","square"],c=["miter","round","bevel"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r="data:".concat(t,";base64,");for(let i=0,s=e.length;i>2]+a[(3&t)<<4|n>>4]+a[i+1>6:64]+a[i+2>1&2147483647:e>>1&2147483647;t[r]=e}function n(e,n,a,r){let i=r;const s=n.length;a[i]=s>>24&255,a[i+1]=s>>16&255,a[i+2]=s>>8&255,a[i+3]=255&s,i+=4,a[i]=255&e.charCodeAt(0),a[i+1]=255&e.charCodeAt(1),a[i+2]=255&e.charCodeAt(2),a[i+3]=255&e.charCodeAt(3),i+=4,a.set(n,i),i+=n.length;const o=function(e,n,a){let r=-1;for(let i=n;i>>8^t[n]}return~r}(a,r+4,i);a[i]=o>>24&255,a[i+1]=o>>16&255,a[i+2]=o>>8&255,a[i+3]=255&o}function a(e){let t=e.length;const n=65535,a=Math.ceil(t/n),r=new Uint8Array(2+t+5*a+4);let i=0;r[i++]=120,r[i++]=156;let s=0;for(;t>n;)r[i++]=0,r[i++]=255,r[i++]=255,r[i++]=0,r[i++]=0,r.set(e.subarray(s,s+n),i),i+=n,s+=n,t-=n;r[i++]=1,r[i++]=255&t,r[i++]=t>>8&255,r[i++]=255&~t,r[i++]=(65535&~t)>>8&255,r.set(e.subarray(s),i),i+=e.length-s;const o=function(e,t,n){let a=1,r=0;for(let i=t;i>24&255,r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o,r}function i(t,i,s,o){const l=t.width,c=t.height;let u,p,_;const m=t.data;switch(i){case r.ImageKind.GRAYSCALE_1BPP:p=0,u=1,_=l+7>>3;break;case r.ImageKind.RGB_24BPP:p=2,u=8,_=3*l;break;case r.ImageKind.RGBA_32BPP:p=6,u=8,_=4*l;break;default:throw new Error("invalid format")}const h=new Uint8Array((1+_)*c);let g=0,f=0;for(let e=0;e>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,u,p,0,0,0]),b=function(e){if(!r.isNodeJS)return a(e);try{const t=parseInt(process.versions.node)>=8?e:Buffer.from(e),n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return a(e)}(h),S=e.length+36+E.length+b.length,v=new Uint8Array(S);let T=0;return v.set(e,T),T+=e.length,n("IHDR",E,v,T),T+=12+E.length,n("IDATA",b,v,T),T+=12+b.length,n("IEND",new Uint8Array(0),v,T),d(v,"image/png",s)}return function(e,t,n){return i(e,void 0===e.kind?r.ImageKind.GRAYSCALE_1BPP:e.kind,t,n)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=s,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=r.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=o,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(e,t){this.x=e,this.y=t}}function _(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function m(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":"scale(".concat(_(e[0])," ").concat(_(e[3]),")");if(e[0]===e[3]&&e[1]===-e[2]){const t=180*Math.acos(e[0])/Math.PI;return"rotate(".concat(_(t),")")}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return"translate(".concat(_(e[4])," ").concat(_(e[5]),")");return"matrix(".concat(_(e[0])," ").concat(_(e[1])," ").concat(_(e[2])," ").concat(_(e[3])," ").concat(_(e[4])," ")+"".concat(_(e[5]),")")}let h=0,g=0,f=0;t.SVGGraphics=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,a.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new a.DOMSVGFactory,this.current=new p,this.transformMatrix=r.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const a in r.OPS)this._operatorIdMapping[r.OPS[a]]=a}getObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let a=0,i=t.length;a{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,a,i,s){const o=[e,t,n,a,i,s];this.transformMatrix=r.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=r.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,a=e.fnArray,r=[];for(let i=0,s=a.length;i0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=l[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=r.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=r.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const{width:t,height:n}=this.viewport,a=r.Util.inverseTransform(this.transformMatrix),[i,s,o,l]=r.Util.getAxialAlignedBoundingBox([0,0,t,n],a),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",i),c.setAttributeNS(null,"y",s),c.setAttributeNS(null,"width",o-i),c.setAttributeNS(null,"height",l-s),c.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(c)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],a=e[3]||r.IDENTITY_MATRIX,[i,s,o,l]=e[4],c=e[5],d=e[6],u=e[7],p="shading".concat(f++),[_,m,h,g]=r.Util.normalizeRect([...r.Util.applyTransform([i,s],a),...r.Util.applyTransform([o,l],a)]),[E,b]=r.Util.singularValueDecompose2dScale(a),S=c*E,v=d*b,T=this.svgFactory.createElement("svg:pattern");T.setAttributeNS(null,"id",p),T.setAttributeNS(null,"patternUnits","userSpaceOnUse"),T.setAttributeNS(null,"width",S),T.setAttributeNS(null,"height",v),T.setAttributeNS(null,"x","".concat(_)),T.setAttributeNS(null,"y","".concat(m));const y=this.svg,C=this.transformMatrix,A=this.current.fillColor,N=this.current.strokeColor,R=this.svgFactory.create(h-_,g-m);if(this.svg=R,this.transformMatrix=a,2===u){const e=r.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=y,this.transformMatrix=C,this.current.fillColor=A,this.current.strokeColor=N,T.append(R.childNodes[0]),this.defs.append(T),"url(#".concat(p,")")}_makeShadingPattern(e){switch("string"===typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading".concat(f++),n=e[3];let a;switch(e[1]){case"axial":const n=e[4],r=e[5];a=this.svgFactory.createElement("svg:linearGradient"),a.setAttributeNS(null,"id",t),a.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),a.setAttributeNS(null,"x1",n[0]),a.setAttributeNS(null,"y1",n[1]),a.setAttributeNS(null,"x2",r[0]),a.setAttributeNS(null,"y2",r[1]);break;case"radial":const i=e[4],s=e[5],o=e[6],l=e[7];a=this.svgFactory.createElement("svg:radialGradient"),a.setAttributeNS(null,"id",t),a.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),a.setAttributeNS(null,"cx",s[0]),a.setAttributeNS(null,"cy",s[1]),a.setAttributeNS(null,"r",l),a.setAttributeNS(null,"fx",i[0]),a.setAttributeNS(null,"fy",i[1]),a.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),a.append(t)}return this.defs.append(a),"url(#".concat(t,")");case"Mesh":return(0,r.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let a=n.x,i=n.y,s=[],o=0;for(const l of e)switch(0|l){case r.OPS.rectangle:a=t[o++],i=t[o++];const e=a+t[o++],n=i+t[o++];s.push("M",_(a),_(i),"L",_(e),_(i),"L",_(e),_(n),"L",_(a),_(n),"Z");break;case r.OPS.moveTo:a=t[o++],i=t[o++],s.push("M",_(a),_(i));break;case r.OPS.lineTo:a=t[o++],i=t[o++],s.push("L",_(a),_(i));break;case r.OPS.curveTo:a=t[o+4],i=t[o+5],s.push("C",_(t[o]),_(t[o+1]),_(t[o+2]),_(t[o+3]),_(a),_(i)),o+=6;break;case r.OPS.curveTo2:s.push("C",_(a),_(i),_(t[o]),_(t[o+1]),_(t[o+2]),_(t[o+3])),a=t[o+2],i=t[o+3],o+=4;break;case r.OPS.curveTo3:a=t[o+2],i=t[o+3],s.push("C",_(t[o]),_(t[o+1]),_(a),_(i),_(a),_(i)),o+=4;break;case r.OPS.closePath:s.push("Z")}s=s.join(" "),n.path&&e.length>0&&e[0]!==r.OPS.rectangle&&e[0]!==r.OPS.moveTo?s=n.path.getAttributeNS(null,"d")+s:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",s),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(a,i)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath".concat(h++),n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",m(this.transformMatrix));const a=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?a.setAttributeNS(null,"clip-rule","evenodd"):a.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(a),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl="url(#".concat(t,")"),this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t="".concat(e.path.getAttributeNS(null,"d"),"Z");e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,r.warn)("Unimplemented graphic state operator ".concat(t))}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=this.current;let a=n.dashArray;1!==t&&a.length>0&&(a=a.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",_(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",_(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",a.map(_).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",_(t*n.dashPhase)+"px")}eoFill(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,r.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}paintInlineImageXObject(e,t){const n=e.width,a=e.height,r=u(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",_(n)),i.setAttributeNS(null,"height",_(a)),this.current.element=i,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",_(-a)),s.setAttributeNS(null,"width",_(n)+"px"),s.setAttributeNS(null,"height",_(a)+"px"),s.setAttributeNS(null,"transform","scale(".concat(_(1/n)," ").concat(_(-1/a),")")),t?t.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,r.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,a=t.width,i=t.height,s=n.fillColor;n.maskId="mask".concat(g++);const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",_(a)),l.setAttributeNS(null,"height",_(i)),l.setAttributeNS(null,"fill",s),l.setAttributeNS(null,"mask","url(#".concat(n.maskId,")")),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,o)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",t[0]),a.setAttributeNS(null,"y",t[1]),a.setAttributeNS(null,"width",_(e)),a.setAttributeNS(null,"height",_(n)),this.current.element=a,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const a=this.svgFactory.createElement("svg:g");return a.setAttributeNS(null,"transform",m(e.transform)),t.append(a),this.svg=a,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",m(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],a={items:t,styles:Object.create(null)};return function e(a){var r;if(!a)return;let i=null;const s=a.name;if("#text"===s)i=a.value;else{if(!n.shouldBuildText(s))return;null!==a&&void 0!==a&&null!==(r=a.attributes)&&void 0!==r&&r.textContent?i=a.attributes.textContent:a.value&&(i=a.value)}if(null!==i&&t.push({str:i}),a.children)for(const t of a.children)e(t)}(e),a}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,r.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const{container:t,viewport:n}=e,a=getComputedStyle(t),i=a.getPropertyValue("visibility"),s=parseFloat(a.getPropertyValue("--scale-factor"));"visible"===i&&(!s||Math.abs(s-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new u(e);return o._render(),o},t.updateTextLayer=function(e){let{container:t,viewport:n,textDivs:a,textDivProperties:i,isOffscreenCanvasSupported:s,mustRotate:o=!0,mustRescale:c=!0}=e;if(o&&(0,r.setLayerDimensions)(t,{rotation:n.rotation}),c){const e=l(0,s),t={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const n of a)t.properties=i.get(n),t.div=n,d(t)}};var a=n(1),r=n(6);const i=30,s=.8,o=new Map;function l(e,t){let n;if(t&&a.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function c(e,t,n){const r=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(r);const d=a.Util.transform(e._transform,t.transform);let u=Math.atan2(d[1],d[0]);const p=n[t.fontName];p.vertical&&(u+=Math.PI/2);const _=Math.hypot(d[2],d[3]),m=_*function(e,t){const n=o.get(e);if(n)return n;const a=l(i,t);a.font="".concat(i,"px ").concat(e);const r=a.measureText("");let c=r.fontBoundingBoxAscent,d=Math.abs(r.fontBoundingBoxDescent);if(c){const t=c/(c+d);return o.set(e,t),a.canvas.width=a.canvas.height=0,t}a.strokeStyle="red",a.clearRect(0,0,i,i),a.strokeText("g",0,0);let u=a.getImageData(0,0,i,i).data;d=0;for(let s=u.length-1-3;s>=0;s-=4)if(u[s]>0){d=Math.ceil(s/4/i);break}a.clearRect(0,0,i,i),a.strokeText("A",0,i),u=a.getImageData(0,0,i,i).data,c=0;for(let s=0,o=u.length;s0){c=i-Math.floor(s/4/i);break}if(a.canvas.width=a.canvas.height=0,c){const t=c/(c+d);return o.set(e,t),t}return o.set(e,s),s}(p.fontFamily,e._isOffscreenCanvasSupported);let h,g;0===u?(h=d[4],g=d[5]-m):(h=d[4]+m*Math.sin(u),g=d[5]-m*Math.cos(u));const f="calc(var(--scale-factor)*",E=r.style;e._container===e._rootContainer?(E.left="".concat((100*h/e._pageWidth).toFixed(2),"%"),E.top="".concat((100*g/e._pageHeight).toFixed(2),"%")):(E.left="".concat(f).concat(h.toFixed(2),"px)"),E.top="".concat(f).concat(g.toFixed(2),"px)")),E.fontSize="".concat(f).concat(_.toFixed(2),"px)"),E.fontFamily=p.fontFamily,c.fontSize=_,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,e._fontInspectorEnabled&&(r.dataset.fontName=t.fontName),0!==u&&(c.angle=u*(180/Math.PI));let b=!1;if(t.str.length>1)b=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(b=!0)}b&&(c.canvasWidth=p.vertical?t.height:t.width),e._textDivProperties.set(r,c),e._isReadableStream&&e._layoutText(r)}function d(e){const{div:t,scale:n,properties:a,ctx:r,prevFontSize:i,prevFontFamily:s}=e,{style:o}=t;let l="";if(0!==a.canvasWidth&&a.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:u}=a;i===u&&s===c||(r.font="".concat(u*n,"px ").concat(c),e.prevFontSize=u,e.prevFontFamily=c);const{width:p}=r.measureText(t.textContent);p>0&&(l="scaleX(".concat(d*n/p,")"))}0!==a.angle&&(l="rotate(".concat(a.angle,"deg) ").concat(l)),l.length>0&&(o.transform=l)}class u{constructor(e){var t;let{textContentSource:n,container:i,viewport:s,textDivs:o,textDivProperties:c,textContentItemsStr:d,isOffscreenCanvasSupported:u}=e;this._textContentSource=n,this._isReadableStream=n instanceof ReadableStream,this._container=this._rootContainer=i,this._textDivs=o||[],this._textContentItemsStr=d||[],this._isOffscreenCanvasSupported=u,this._fontInspectorEnabled=!(null===(t=globalThis.FontInspector)||void 0===t||!t.enabled),this._reader=null,this._textDivProperties=c||new WeakMap,this._canceled=!1,this._capability=new a.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l(0,u)};const{pageWidth:p,pageHeight:_,pageX:m,pageY:h}=s.rawDims;this._transform=[1,0,0,-1,-m,h+_],this._pageWidth=p,this._pageHeight=_,(0,r.setLayerDimensions)(i,s),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new a.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new a.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),c(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id","".concat(n.id)),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,d(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=new a.PromiseCapability;let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then((a=>{let{value:r,done:i}=a;i?e.resolve():(Object.assign(t,r.styles),this._processItems(r.items,t),n())}),e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then((()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}t.TextLayerRenderTask=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var a=n(1),r=n(4),i=n(28),s=n(33),o=n(6),l=n(34),c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap,E=new WeakMap,b=new WeakSet;class S{constructor(e){let{uiManager:t,pageIndex:n,div:a,accessibilityManager:r,annotationLayer:o,viewport:v,l10n:T}=e;_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,!1),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,p,this.pointerup.bind(this)),_classPrivateFieldInitSpec(this,_,this.pointerdown.bind(this)),_classPrivateFieldInitSpec(this,m,new Map),_classPrivateFieldInitSpec(this,h,!1),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldInitSpec(this,E,void 0);const y=[i.FreeTextEditor,s.InkEditor,l.StampEditor];if(!S._initialized){S._initialized=!0;for(const e of y)e.initialize(T)}t.registerEditorTypes(y),_classPrivateFieldSet(E,this,t),this.pageIndex=n,this.div=a,_classPrivateFieldSet(c,this,r),_classPrivateFieldSet(u,this,o),this.viewport=v,_classPrivateFieldGet(E,this).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(m,this).size}updateToolbar(e){_classPrivateFieldGet(E,this).updateToolbar(e)}updateMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(E,this).getMode();_assertClassBrand(b,this,C).call(this),e===a.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),e!==a.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===a.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===a.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",e===a.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||_classPrivateFieldGet(E,this).getMode()===a.AnnotationEditorType.INK){if(!e)for(const e of _classPrivateFieldGet(m,this).values())if(e.isEmpty())return void e.setInBackground();_assertClassBrand(b,this,T).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){_classPrivateFieldGet(E,this).setEditingState(e)}addCommands(e){_classPrivateFieldGet(E,this).addCommands(e)}enable(){this.div.style.pointerEvents="auto";const e=new Set;for(const n of _classPrivateFieldGet(m,this).values())n.enableEditing(),n.annotationElementId&&e.add(n.annotationElementId);if(!_classPrivateFieldGet(u,this))return;const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){if(n.hide(),_classPrivateFieldGet(E,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){_classPrivateFieldSet(f,this,!0),this.div.style.pointerEvents="none";const e=new Set;for(const n of _classPrivateFieldGet(m,this).values()){var t;n.disableEditing(),n.annotationElementId&&null===n.serialize()?(null===(t=this.getEditableAnnotation(n.annotationElementId))||void 0===t||t.show(),n.remove()):e.add(n.annotationElementId)}if(_classPrivateFieldGet(u,this)){const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){const{id:t}=n.data;e.has(t)||_classPrivateFieldGet(E,this).isDeletedAnnotationElement(t)||n.show()}}_assertClassBrand(b,this,C).call(this),this.isEmpty&&(this.div.hidden=!0),_classPrivateFieldSet(f,this,!1)}getEditableAnnotation(e){var t;return(null===(t=_classPrivateFieldGet(u,this))||void 0===t?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){_classPrivateFieldGet(E,this).getActive()!==e&&_classPrivateFieldGet(E,this).setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(_,this)),this.div.addEventListener("pointerup",_classPrivateFieldGet(p,this))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(_,this)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(p,this))}attach(e){_classPrivateFieldGet(m,this).set(e.id,e);const{annotationElementId:t}=e;t&&_classPrivateFieldGet(E,this).isDeletedAnnotationElement(t)&&_classPrivateFieldGet(E,this).removeDeletedAnnotationElement(e)}detach(e){var t;_classPrivateFieldGet(m,this).delete(e.id),null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(e.contentDiv),!_classPrivateFieldGet(f,this)&&e.annotationElementId&&_classPrivateFieldGet(E,this).addDeletedAnnotationElement(e)}remove(e){this.detach(e),_classPrivateFieldGet(E,this).removeEditor(e),e.div.contains(document.activeElement)&&setTimeout((()=>{_classPrivateFieldGet(E,this).focusMainContainer()}),0),e.div.remove(),e.isAttachedToDOM=!1,_classPrivateFieldGet(g,this)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.annotationElementId&&(_classPrivateFieldGet(E,this).addDeletedAnnotationElement(e.annotationElementId),r.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),null===(t=e.parent)||void 0===t||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.changeParent(e),_classPrivateFieldGet(E,this).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),_classPrivateFieldGet(E,this).addToAnnotationStorage(e)}moveEditorInDOM(e){var t;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&(e._focusEventsAllowed=!1,setTimeout((()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),n.focus())}),0)),e._structTreeParentId=null===(t=_classPrivateFieldGet(c,this))||void 0===t?void 0:t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(E,this).getId()}pasteEditor(e,t){_classPrivateFieldGet(E,this).updateToolbar(e),_classPrivateFieldGet(E,this).updateMode(e);const{offsetX:n,offsetY:a}=_assertClassBrand(b,this,y).call(this),r=this.getNextId(),i=_assertClassBrand(b,this,v).call(this,{parent:this,id:r,x:n,y:a,uiManager:_classPrivateFieldGet(E,this),isCentered:!0,...t});i&&this.add(i)}deserialize(e){var t;switch(null!==(t=e.annotationType)&&void 0!==t?t:e.annotationEditorType){case a.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(e,this,_classPrivateFieldGet(E,this));case a.AnnotationEditorType.INK:return s.InkEditor.deserialize(e,this,_classPrivateFieldGet(E,this));case a.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(e,this,_classPrivateFieldGet(E,this))}return null}addNewEditor(){_assertClassBrand(b,this,T).call(this,_assertClassBrand(b,this,y).call(this),!0)}setSelected(e){_classPrivateFieldGet(E,this).setSelected(e)}toggleSelected(e){_classPrivateFieldGet(E,this).toggleSelected(e)}isSelected(e){return _classPrivateFieldGet(E,this).isSelected(e)}unselect(e){_classPrivateFieldGet(E,this).unselect(e)}pointerup(e){const{isMac:t}=a.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&_classPrivateFieldGet(h,this)&&(_classPrivateFieldSet(h,this,!1),_classPrivateFieldGet(d,this)?_classPrivateFieldGet(E,this).getMode()!==a.AnnotationEditorType.STAMP?_assertClassBrand(b,this,T).call(this,e,!1):_classPrivateFieldGet(E,this).unselectAll():_classPrivateFieldSet(d,this,!0))}pointerdown(e){if(_classPrivateFieldGet(h,this))return void _classPrivateFieldSet(h,this,!1);const{isMac:t}=a.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;_classPrivateFieldSet(h,this,!0);const n=_classPrivateFieldGet(E,this).getActive();_classPrivateFieldSet(d,this,!n||n.isEmpty())}findNewParent(e,t,n){const a=_classPrivateFieldGet(E,this).findParent(t,n);return null!==a&&a!==this&&(a.changeParent(e),!0)}destroy(){var e;(null===(e=_classPrivateFieldGet(E,this).getActive())||void 0===e?void 0:e.parent)===this&&(_classPrivateFieldGet(E,this).commitOrRemove(),_classPrivateFieldGet(E,this).setActiveEditor(null));for(const n of _classPrivateFieldGet(m,this).values()){var t;null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove()}this.div=null,_classPrivateFieldGet(m,this).clear(),_classPrivateFieldGet(E,this).removeLayer(this)}render(e){let{viewport:t}=e;this.viewport=t,(0,o.setLayerDimensions)(this.div,t);for(const n of _classPrivateFieldGet(E,this).getEditors(this.pageIndex))this.add(n);this.updateMode()}update(e){let{viewport:t}=e;_classPrivateFieldGet(E,this).commitOrRemove(),this.viewport=t,(0,o.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}function v(e){switch(_classPrivateFieldGet(E,this).getMode()){case a.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(e);case a.AnnotationEditorType.INK:return new s.InkEditor(e);case a.AnnotationEditorType.STAMP:return new l.StampEditor(e)}return null}function T(e,t){const n=this.getNextId(),a=_assertClassBrand(b,this,v).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:_classPrivateFieldGet(E,this),isCentered:t});return a&&this.add(a),a}function y(){const{x:e,y:t,width:n,height:a}=this.div.getBoundingClientRect(),r=Math.max(0,e),i=Math.max(0,t),s=(r+Math.min(window.innerWidth,e+n))/2-e,o=(i+Math.min(window.innerHeight,t+a))/2-t,[l,c]=this.viewport.rotation%180===0?[s,o]:[o,s];return{offsetX:l,offsetY:c}}function C(){_classPrivateFieldSet(g,this,!0);for(const e of _classPrivateFieldGet(m,this).values())e.isEmpty()&&e.remove();_classPrivateFieldSet(g,this,!1)}_defineProperty(S,"_initialized",!1),t.AnnotationEditorLayer=S},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var r=n(1),i=n(5),s=n(4),o=n(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakSet;class E extends s.AnnotationEditor{static get _keyboardManager(){const e=E.prototype,t=e=>e.isEmpty(),n=i.AnnotationEditorUIManager.TRANSLATE_SMALL,a=i.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,a],checker:t}]]))}constructor(e){super({...e,name:"freeTextEditor"}),_classPrivateMethodInitSpec(this,f),_classPrivateFieldInitSpec(this,l,this.editorDivBlur.bind(this)),_classPrivateFieldInitSpec(this,c,this.editorDivFocus.bind(this)),_classPrivateFieldInitSpec(this,d,this.editorDivInput.bind(this)),_classPrivateFieldInitSpec(this,u,this.editorDivKeydown.bind(this)),_classPrivateFieldInitSpec(this,p,void 0),_classPrivateFieldInitSpec(this,_,""),_classPrivateFieldInitSpec(this,m,"".concat(this.id,"-editor")),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,g,null),_classPrivateFieldSet(p,this,e.color||E._defaultColor||s.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(h,this,e.fontSize||E._defaultFontSize)}static initialize(e){s.AnnotationEditor.initialize(e,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:E._defaultFontSize=t;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:E._defaultColor=t}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:_assertClassBrand(f,this,b).call(this,t);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:_assertClassBrand(f,this,S).call(this,t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,E._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,E._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(h,this)],[r.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(p,this)]]}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-E._internalPadding*e,-(E._internalPadding+_classPrivateFieldGet(h,this))*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(d,this)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(m,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(d,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var e;this.width?_assertClassBrand(f,this,A).call(this):(this.enableEditMode(),this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=_classPrivateFieldGet(_,this),t=_classPrivateFieldSet(_,this,_assertClassBrand(f,this,v).call(this).trimEnd());if(e===t)return;const n=e=>{_classPrivateFieldSet(_,this,e),e?(_assertClassBrand(f,this,y).call(this),this._uiManager.rebuild(this),_assertClassBrand(f,this,T).call(this)):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),_assertClassBrand(f,this,T).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){E._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(m,this)),this.enableEditing(),s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("aria-label",e)})),s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)})),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize="calc(".concat(_classPrivateFieldGet(h,this),"px * var(--scale-factor))"),n.color=_classPrivateFieldGet(p,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,a]=this.parentDimensions;if(this.annotationElementId){const{position:r}=_classPrivateFieldGet(g,this);let[i,s]=this.getInitialTranslation();[i,s]=this.pageTranslationToScreen(i,s);const[o,l]=this.pageDimensions,[c,d]=this.pageTranslation;let u,p;switch(this.rotation){case 0:u=e+(r[0]-c)/o,p=t+this.height-(r[1]-d)/l;break;case 90:u=e+(r[0]-c)/o,p=t-(r[1]-d)/l,[i,s]=[s,-i];break;case 180:u=e-this.width+(r[0]-c)/o,p=t-(r[1]-d)/l,[i,s]=[-i,-s];break;case 270:u=e+(r[0]-c-this.height*l)/o,p=t+(r[1]-d-this.width*o)/l,[i,s]=[-s,i]}this.setAt(u*n,p*a,i,s)}else this.setAt(e*n,t*a,this.width*n,this.height*a);_assertClassBrand(f,this,y).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){let a=null;if(e instanceof o.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:i,rotation:s,id:o},textContent:l,textPosition:c,parent:{page:{pageNumber:d}}}=e;if(!l||0===l.length)return null;a=e={annotationType:r.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),position:c,pageIndex:d-1,rect:i,rotation:s,id:o,deleted:!1}}const i=super.deserialize(e,t,n);return _classPrivateFieldSet(h,i,e.fontSize),_classPrivateFieldSet(p,i,r.Util.makeHexColor(...e.color)),_classPrivateFieldSet(_,i,e.value),i.annotationElementId=e.id||null,_classPrivateFieldSet(g,i,a),i}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=E._internalPadding*this.parentScale,n=this.getRect(t,t),a=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(p,this)),i={annotationType:r.AnnotationEditorType.FREETEXT,color:a,fontSize:_classPrivateFieldGet(h,this),value:_classPrivateFieldGet(_,this),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?i:this.annotationElementId&&!_assertClassBrand(f,this,C).call(this,i)?null:(i.id=this.annotationElementId,i)}}function b(e){const t=e=>{this.editorDiv.style.fontSize="calc(".concat(e,"px * var(--scale-factor))"),this.translate(0,-(e-_classPrivateFieldGet(h,this))*this.parentScale),_classPrivateFieldSet(h,this,e),_assertClassBrand(f,this,T).call(this)},n=_classPrivateFieldGet(h,this);this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function S(e){const t=_classPrivateFieldGet(p,this);this.addCommands({cmd:()=>{_classPrivateFieldSet(p,this,this.editorDiv.style.color=e)},undo:()=>{_classPrivateFieldSet(p,this,this.editorDiv.style.color=t)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function v(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}function T(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,a=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=a}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}function y(){if(this.editorDiv.replaceChildren(),_classPrivateFieldGet(_,this))for(const e of _classPrivateFieldGet(_,this).split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}function C(e){const{value:t,fontSize:n,color:a,rect:r,pageIndex:i}=_classPrivateFieldGet(g,this);return e.value!==t||e.fontSize!==n||e.rect.some(((e,t)=>Math.abs(e-r[t])>=1))||e.color.some(((e,t)=>e!==a[t]))||e.pageIndex!==i}function A(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(_assertClassBrand(f,this,T).call(this),!e&&(0===this.width||0===this.height))return void setTimeout((()=>_assertClassBrand(f,this,A).call(this,!0)),0);const t=a._internalPadding*this.parentScale;_classPrivateFieldGet(g,this).rect=this.getRect(t,t)}a=E,_defineProperty(E,"_freeTextDefaultContent",""),_defineProperty(E,"_internalPadding",0),_defineProperty(E,"_defaultColor",null),_defineProperty(E,"_defaultFontSize",10),_defineProperty(E,"_type","freetext"),t.FreeTextEditor=E},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0;var a=n(1),r=n(6),i=n(3),s=n(30),o=n(31),l=n(32);const c=1e3,d=new WeakSet;function u(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class p{static create(e){switch(e.data.annotationType){case a.AnnotationType.LINK:return new g(e);case a.AnnotationType.TEXT:return new b(e);case a.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new v(e);case"Btn":return e.data.radioButton?new C(e):e.data.checkBox?new y(e):new A(e);case"Ch":return new N(e);case"Sig":return new T(e)}return new S(e);case a.AnnotationType.POPUP:return new R(e);case a.AnnotationType.FREETEXT:return new X(e);case a.AnnotationType.LINE:return new J(e);case a.AnnotationType.SQUARE:return new te(e);case a.AnnotationType.CIRCLE:return new ae(e);case a.AnnotationType.POLYLINE:return new ie(e);case a.AnnotationType.CARET:return new oe(e);case a.AnnotationType.INK:return new ce(e);case a.AnnotationType.POLYGON:return new se(e);case a.AnnotationType.HIGHLIGHT:return new de(e);case a.AnnotationType.UNDERLINE:return new ue(e);case a.AnnotationType.SQUIGGLY:return new pe(e);case a.AnnotationType.STRIKEOUT:return new _e(e);case a.AnnotationType.STAMP:return new me(e);case a.AnnotationType.FILEATTACHMENT:return new fe(e);default:return new m(e)}}}var _=new WeakMap;class m{constructor(e){let{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classPrivateFieldInitSpec(this,_,!1),this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData(e){let{titleObj:t,contentsObj:n,richText:a}=e;return!!(null!==t&&void 0!==t&&t.str||null!==n&&void 0!==n&&n.str||null!==a&&void 0!==a&&a.str)}get hasPopupData(){return m._hasPopupData(this.data)}_createContainer(e){const{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),this instanceof S||(i.tabIndex=c),i.style.zIndex=this.parent.zIndex++,this.data.popupRef&&i.setAttribute("aria-haspopup","dialog"),t.noRotate&&i.classList.add("norotate");const{pageWidth:s,pageHeight:o,pageX:l,pageY:d}=r.rawDims;if(!t.rect||this instanceof R){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,i),i}const{width:p,height:m}=u(t.rect),h=a.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){i.style.borderWidth="".concat(t.borderStyle.width,"px");const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t="calc(".concat(e,"px * var(--scale-factor)) / calc(").concat(n,"px * var(--scale-factor))");i.style.borderRadius=t}else if(this instanceof C){const e="calc(".concat(p,"px * var(--scale-factor)) / calc(").concat(m,"px * var(--scale-factor))");i.style.borderRadius=e}switch(t.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}const r=t.borderColor||null;r?(_classPrivateFieldSet(_,this,!0),i.style.borderColor=a.Util.makeHexColor(0|r[0],0|r[1],0|r[2])):i.style.borderWidth=0}i.style.left="".concat(100*(h[0]-l)/s,"%"),i.style.top="".concat(100*(h[1]-d)/o,"%");const{rotation:g}=t;return t.hasOwnCanvas||0===g?(i.style.width="".concat(100*p/s,"%"),i.style.height="".concat(100*m/o,"%")):this.setRotation(g,i),i}setRotation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:r,height:i}=u(this.data.rect);let s,o;e%180===0?(s=100*r/n,o=100*i/a):(s=100*i/n,o=100*r/a),t.style.width="".concat(s,"%"),t.style.height="".concat(o,"%"),t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const a=n.detail[e],r=a[0],i=a.slice(1);n.target.style[t]=s.ColorConverters["".concat(r,"_HTML")](i),this.annotationStorage.setValue(this.data.id,{[t]:s.ColorConverters["".concat(r,"_rgb")](i)})};return(0,a.shadow)(this,"_commonActions",{display:e=>{const{display:t}=e.detail,n=t%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const a of Object.keys(t.detail)){const r=e[a]||n[a];null===r||void 0===r||r(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[a,r]of Object.entries(t)){const i=n[a];i&&(i({detail:{[a]:r},target:e}),delete t[a])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,a,r]=this.data.rect;if(1===e.length){const[,{x:i,y:s},{x:o,y:l}]=e[0];if(a===i&&r===s&&t===o&&n===l)return}const{style:i}=this.container;let s;if(_classPrivateFieldGet(_,this)){const{borderColor:e,borderWidth:t}=i;i.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'','')],this.container.classList.add("hasBorder")}const o=a-t,l=r-n,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const u=c.createElement("defs");d.append(u);const p=c.createElement("clipPath"),m="clippath_".concat(this.data.id);p.setAttribute("id",m),p.setAttribute("clipPathUnits","objectBoundingBox"),u.append(p);for(const[,{x:_,y:g},{x:f,y:E}]of e){var h;const e=c.createElement("rect"),n=(f-t)/o,a=(r-g)/l,i=(_-f)/o,d=(g-E)/l;e.setAttribute("x",n),e.setAttribute("y",a),e.setAttribute("width",i),e.setAttribute("height",d),p.append(e),null===(h=s)||void 0===h||h.push(''))}_classPrivateFieldGet(_,this)&&(s.push("')"),i.backgroundImage=s.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(m,")")}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const n=new R({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){(0,a.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const r=this._fieldObjects[e];if(r)for(const{page:e,id:i,exportValues:s}of r){if(-1===e)continue;if(i===t)continue;const r="string"===typeof s?s:null,o=document.querySelector('[data-element-id="'.concat(i,'"]'));!o||d.has(o)?n.push({id:i,exportValue:r,domElement:o}):(0,a.warn)("_getElementsByName - element not allowed: ".concat(i))}return n}for(const a of document.getElementsByName(e)){const{exportValue:e}=a,r=a.getAttribute("data-element-id");r!==t&&d.has(a)&&n.push({id:r,exportValue:e,domElement:a})}return n}show(){var e;this.container&&(this.container.hidden=!1),null===(e=this.popup)||void 0===e||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),null===(e=this.popup)||void 0===e||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",(()=>{var n;null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})}))}}var h=new WeakSet;class g extends m{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(e,{isRenderable:!0,ignoreBorder:!(null===t||void 0===t||!t.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(this,h),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let a=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),a=!0):e.action?(this._bindNamedAction(n,e.action),a=!0):e.attachment?(this._bindAttachment(n,e.attachment),a=!0):e.setOCGState?(_assertClassBrand(h,this,E).call(this,n,e.setOCGState),a=!0):e.dest?(this._bindLink(n,e.dest),a=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),a=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&_assertClassBrand(h,this,f).call(this)}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),_assertClassBrand(h,this,f).call(this)}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>{var e;return null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,t.content,t.filename),!1},_assertClassBrand(h,this,f).call(this)}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(t.actions)){const r=n.get(a);r&&(e[r]=()=>{var e;return null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:a}}),!1})}e.onclick||(e.onclick=()=>!1),_assertClassBrand(h,this,f).call(this)}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),_assertClassBrand(h,this,f).call(this),!this._fieldObjects)return(0,a.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{null===n||void 0===n||n();const{fields:e,refs:r,include:i}=t,s=[];if(0!==e.length||0!==r.length){const t=new Set(r);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===i&&s.push(n)}else for(const t of Object.values(this._fieldObjects))s.push(...t);const o=this.annotationStorage,l=[];for(const t of s){const{id:e}=t;switch(l.push(e),t.type){case"text":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;o.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}default:continue}const n=document.querySelector('[data-element-id="'.concat(e,'"]'));n&&(d.has(n)?n.dispatchEvent(new Event("resetform")):(0,a.warn)("_bindResetFormAction - element not allowed: ".concat(e)))}var c;return this.enableScripting&&(null===(c=this.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}function f(){this.container.setAttribute("data-internal-link","")}function E(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),_assertClassBrand(h,this,f).call(this)}class b extends m{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class S extends m{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&("CANVAS"===(null===(t=e.previousSibling)||void 0===t?void 0:t.nodeName)&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){const{isWin:t,isMac:n}=a.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,a,r){n.includes("mouse")?e.addEventListener(n,(e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(n,(e=>{var i;if("blur"===n){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===n){if(t.focused)return;t.focused=!0}r&&(null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:r(e)}}))}))}_setEventListeners(e,t,n,a){for(const[o,l]of n){var r,i,s;("Action"===l||null!==(r=this.data.actions)&&void 0!==r&&r[l])&&("Focus"!==l&&"Blur"!==l||t||(t={focused:!1}),this._setEventListener(e,t,o,l,a),"Focus"!==l||null!==(i=this.data.actions)&&void 0!==i&&i.Blur?"Blur"!==l||null!==(s=this.data.actions)&&void 0!==s&&s.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":a.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,i=e.style;let s;const o=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(a.LINE_FACTOR*r))||1);s=Math.min(r,o(t/a.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(r,o(e/a.LINE_FACTOR))}i.fontSize="calc(".concat(s,"px * var(--scale-factor))"),i.color=a.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class v extends S{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,a){const r=this.annotationStorage;for(const i of this._getElementsByName(e.name,e.id))i.domElement&&(i.domElement[t]=n),r.setValue(i.id,{[a]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){var a;const o=e.getValue(t,{value:this.data.fieldValue});let l=o.value||"";const u=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;u&&l.length>u&&(l=l.slice(0,u));let p=o.formattedValue||(null===(a=this.data.textContent)||void 0===a?void 0:a.join("\n"))||null;p&&this.data.comb&&(p=p.replaceAll(/\s+/g,""));const _={userValue:l,formattedValue:p,lastCommittedValue:null,commitKey:1,focused:!1};var r,i;this.data.multiLine?(n=document.createElement("textarea"),n.textContent=null!==(r=p)&&void 0!==r?r:l,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",null!==(i=p)&&void 0!==i?i:l),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),d.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=c,this._setRequired(n,this.data.required),u&&(n.maxLength=u),n.addEventListener("input",(a=>{e.setValue(t,{value:a.target.value}),this.setPropertyOnSiblings(n,"value",a.target.value,"value"),_.formattedValue=null})),n.addEventListener("resetform",(e=>{var t;const a=null!==(t=this.data.defaultFieldValue)&&void 0!==t?t:"";n.value=_.userValue=a,_.formattedValue=null}));let m=e=>{const{formattedValue:t}=_;null!==t&&void 0!==t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;n.addEventListener("focus",(e=>{if(_.focused)return;const{target:t}=e;_.userValue&&(t.value=_.userValue),_.lastCommittedValue=t.value,_.commitKey=1,_.focused=!0})),n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const a={value(n){var a;_.userValue=null!==(a=n.detail.value)&&void 0!==a?a:"",e.setValue(t,{value:_.userValue.toString()}),n.target.value=_.userValue},formattedValue(n){const{formattedValue:a}=n.detail;_.formattedValue=a,null!==a&&void 0!==a&&n.target!==document.activeElement&&(n.target.value=a),e.setValue(t,{formattedValue:a})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{var a;const{charLimit:r}=n.detail,{target:i}=n;if(0===r)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",r);let s=_.userValue;!s||s.length<=r||(s=s.slice(0,r),i.value=_.userValue=s,e.setValue(t,{value:s}),null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(a,n)})),n.addEventListener("keydown",(e=>{var n;_.commitKey=1;let a=-1;if("Escape"===e.key?a=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(_.commitKey=3):a=2,-1===a)return;const{value:r}=e.target;_.lastCommittedValue!==r&&(_.lastCommittedValue=r,_.userValue=r,null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:a,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const a=m;m=null,n.addEventListener("blur",(e=>{if(!_.focused||!e.relatedTarget)return;_.focused=!1;const{value:n}=e.target;var r;_.userValue=n,_.lastCommittedValue!==n&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:_.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),a(e)})),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&n.addEventListener("beforeinput",(e=>{var n;_.lastCommittedValue=null;const{data:a,target:r}=e,{value:i,selectionStart:s,selectionEnd:o}=r;let l=s,c=o;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,s).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=i.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===o&&(l-=1);break;case"deleteContentForward":s===o&&(c+=1)}e.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:a||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(n,_,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(m&&n.addEventListener("blur",m),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/u;n.classList.add("comb"),n.style.letterSpacing="calc(".concat(e,"px * var(--scale-factor) - 1ch)")}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class T extends S{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class y extends S{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let a=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"===typeof a&&(a="Off"!==a,e.setValue(n,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return d.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.fieldName,a&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=c,r.addEventListener("change",(a=>{const{name:r,checked:i}=a.target;for(const s of this._getElementsByName(r,n)){const n=i&&s.exportValue===t.exportValue;s.domElement&&(s.domElement.checked=n),e.setValue(s.id,{value:n})}e.setValue(n,{value:i})})),r.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",(t=>{const a={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(a,t)})),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class C extends S{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let a=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"===typeof a&&(a=a!==t.buttonValue,e.setValue(n,{value:a}));const r=document.createElement("input");if(d.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.fieldName,a&&r.setAttribute("checked",!0),r.tabIndex=c,r.addEventListener("change",(t=>{const{name:a,checked:r}=t.target;for(const i of this._getElementsByName(a,n))e.setValue(i.id,{value:!1});e.setValue(n,{value:r})})),r.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!==n&&void 0!==n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;r.addEventListener("updatefromsandbox",(t=>{const r={value:t=>{const r=a===t.detail.value;for(const a of this._getElementsByName(t.target.name)){const t=r&&a.id===n;a.domElement&&(a.domElement.checked=t),e.setValue(a.id,{value:t})}}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class A extends g{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class N extends S{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),a=document.createElement("select");d.add(a),a.setAttribute("data-element-id",t),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=c;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const n of a.options)n.selected=n.value===t}));for(const c of this.data.options){const e=document.createElement("option");e.textContent=c.displayValue,e.value=c.exportValue,n.value.includes(c.exportValue)&&(e.setAttribute("selected",!0),r=!1),a.append(e)}let i=null;if(r){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),a.prepend(e),i=()=>{e.remove(),a.removeEventListener("input",i),i=null},a.addEventListener("input",i)}const s=e=>{const t=e?"value":"textContent",{options:n,multiple:r}=a;return r?Array.prototype.filter.call(n,(e=>e.selected)).map((e=>e[t])):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let o=s(!1);const l=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",(n=>{const r={value(n){var r;null===(r=i)||void 0===r||r();const l=n.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const e of a.options)e.selected=c.has(e.value);e.setValue(t,{value:s(!0)}),o=s(!1)},multipleSelection(e){a.multiple=!0},remove(n){const r=a.options,i=n.detail.remove;r[i].selected=!1,a.remove(i),r.length>0&&-1===Array.prototype.findIndex.call(r,(e=>e.selected))&&(r[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},clear(n){for(;0!==a.length;)a.remove(0);e.setValue(t,{value:null,items:[]}),o=s(!1)},insert(n){const{index:r,displayValue:i,exportValue:c}=n.detail.insert,d=a.children[r],u=document.createElement("option");u.textContent=i,u.value=c,d?d.before(u):a.append(u),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},items(n){const{items:r}=n.detail;for(;0!==a.length;)a.remove(0);for(const e of r){const{displayValue:t,exportValue:n}=e,r=document.createElement("option");r.textContent=t,r.value=n,a.append(r)}a.options.length>0&&(a.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),o=s(!1)},indices(n){const a=new Set(n.detail.indices);for(const e of n.target.options)e.selected=a.has(e.index);e.setValue(t,{value:s(!0)}),o=s(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(r,n)})),a.addEventListener("input",(n=>{var a;const r=s(!0);e.setValue(t,{value:r}),n.preventDefault(),null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))):a.addEventListener("input",(function(n){e.setValue(t,{value:s(!0)})})),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class R extends m{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:m._hasPopupData(t)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const e=new q({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const n of this.elements)n.popup=e,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map((e=>"".concat(a.AnnotationPrefix).concat(e))).join(",")),this.container}}var O=new WeakMap,I=new WeakMap,w=new WeakMap,x=new WeakMap,D=new WeakMap,k=new WeakMap,P=new WeakMap,M=new WeakMap,L=new WeakMap,F=new WeakMap,B=new WeakMap,U=new WeakMap,G=new WeakMap,z=new WeakMap,H=new WeakMap,Y=new WeakMap,j=new WeakMap,V=new WeakSet;class q{constructor(e){let{container:t,color:n,elements:a,titleObj:i,modificationDate:s,contentsObj:o,richText:l,parent:c,rect:d,parentRect:u,open:p}=e;_classPrivateMethodInitSpec(this,V),_classPrivateFieldInitSpec(this,O,null),_classPrivateFieldInitSpec(this,I,_assertClassBrand(V,this,W).bind(this)),_classPrivateFieldInitSpec(this,w,_assertClassBrand(V,this,$).bind(this)),_classPrivateFieldInitSpec(this,x,_assertClassBrand(V,this,Q).bind(this)),_classPrivateFieldInitSpec(this,D,_assertClassBrand(V,this,K).bind(this)),_classPrivateFieldInitSpec(this,k,null),_classPrivateFieldInitSpec(this,P,null),_classPrivateFieldInitSpec(this,M,null),_classPrivateFieldInitSpec(this,L,null),_classPrivateFieldInitSpec(this,F,null),_classPrivateFieldInitSpec(this,B,null),_classPrivateFieldInitSpec(this,U,!1),_classPrivateFieldInitSpec(this,G,null),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,H,null),_classPrivateFieldInitSpec(this,Y,null),_classPrivateFieldInitSpec(this,j,!1),_classPrivateFieldSet(P,this,t),_classPrivateFieldSet(Y,this,i),_classPrivateFieldSet(M,this,o),_classPrivateFieldSet(H,this,l),_classPrivateFieldSet(F,this,c),_classPrivateFieldSet(k,this,n),_classPrivateFieldSet(z,this,d),_classPrivateFieldSet(B,this,u),_classPrivateFieldSet(L,this,a);const _=r.PDFDateString.toDateObject(s);_&&_classPrivateFieldSet(O,this,c.l10n.get("annotation_date_string",{date:_.toLocaleDateString(),time:_.toLocaleTimeString()})),this.trigger=a.flatMap((e=>e.getElementsToTriggerPopup()));for(const r of this.trigger)r.addEventListener("click",_classPrivateFieldGet(D,this)),r.addEventListener("mouseenter",_classPrivateFieldGet(x,this)),r.addEventListener("mouseleave",_classPrivateFieldGet(w,this)),r.classList.add("popupTriggerArea");for(const r of a){var m;null===(m=r.container)||void 0===m||m.addEventListener("keydown",_classPrivateFieldGet(I,this))}_classPrivateFieldGet(P,this).hidden=!0,p&&_assertClassBrand(V,this,K).call(this)}render(){if(_classPrivateFieldGet(G,this))return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=_classPrivateFieldGet(F,this),s=_classPrivateFieldSet(G,this,document.createElement("div"));if(s.className="popup",_classPrivateFieldGet(k,this)){const e=s.style.outlineColor=a.Util.makeHexColor(..._classPrivateFieldGet(k,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))s.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;s.style.backgroundColor=a.Util.makeHexColor(..._classPrivateFieldGet(k,this).map((t=>Math.floor(e*(255-t)+t))))}}const o=document.createElement("span");o.className="header";const c=document.createElement("h1");if(o.append(c),({dir:c.dir,str:c.textContent}=_classPrivateFieldGet(Y,this)),s.append(o),_classPrivateFieldGet(O,this)){const e=document.createElement("span");e.classList.add("popupDate"),_classPrivateFieldGet(O,this).then((t=>{e.textContent=t})),o.append(e)}const d=_classPrivateFieldGet(M,this),u=_classPrivateFieldGet(H,this);if(null===u||void 0===u||!u.str||null!==d&&void 0!==d&&d.str&&d.str!==u.str){const e=this._formatContents(d);s.append(e)}else l.XfaLayer.render({xfaHtml:u.html,intent:"richText",div:s}),s.lastChild.classList.add("richText","popupContent");let p=!!_classPrivateFieldGet(B,this),_=_classPrivateFieldGet(p?B:z,this);for(const l of _classPrivateFieldGet(L,this))if(!_||null!==a.Util.intersect(l.data.rect,_)){_=l.data.rect,p=!0;break}const m=a.Util.normalizeRect([_[0],e[3]-_[1]+e[1],_[2],e[3]-_[3]+e[1]]),h=p?_[2]-_[0]+5:0,g=m[0]+h,f=m[1],{style:E}=_classPrivateFieldGet(P,this);E.left="".concat(100*(g-r)/t,"%"),E.top="".concat(100*(f-i)/n,"%"),_classPrivateFieldGet(P,this).append(s)}_formatContents(e){let{str:t,dir:n}=e;const a=document.createElement("p");a.classList.add("popupContent"),a.dir=n;const r=t.split(/(?:\r\n?|\n)/);for(let i=0,s=r.length;i{"Enter"===e.key&&(r?e.metaKey:e.ctrlKey)&&_assertClassBrand(ge,this,Ee).call(this)})),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return _classPrivateFieldGet(he,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function Ee(){var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,this.content,this.filename)}var be=new WeakMap,Se=new WeakMap,ve=new WeakMap,Te=new WeakSet;function ye(e,t){var n;const r=e.firstChild||e;r.id="".concat(a.AnnotationPrefix).concat(t),this.div.append(e),null===(n=_classPrivateFieldGet(be,this))||void 0===n||n.moveElementInDOM(this.div,e,r,!1)}function Ce(){if(!_classPrivateFieldGet(Se,this))return;const e=this.div;for(const[t,n]of _classPrivateFieldGet(Se,this)){const a=e.querySelector('[data-annotation-id="'.concat(t,'"]'));if(!a)continue;const{firstChild:r}=a;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.before(n):a.append(n)}_classPrivateFieldGet(Se,this).clear()}t.AnnotationLayer=class{constructor(e){let{div:t,accessibilityManager:n,annotationCanvasMap:a,l10n:r,page:i,viewport:s}=e;_classPrivateMethodInitSpec(this,Te),_classPrivateFieldInitSpec(this,be,null),_classPrivateFieldInitSpec(this,Se,null),_classPrivateFieldInitSpec(this,ve,new Map),this.div=t,_classPrivateFieldSet(be,this,n),_classPrivateFieldSet(Se,this,a),this.l10n=r,this.page=i,this.viewport=s,this.zIndex=0,this.l10n||(this.l10n=o.NullL10n)}async render(e){const{annotations:t}=e,n=this.div;(0,r.setLayerDimensions)(n,this.viewport);const s=new Map,o={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new r.DOMSVGFactory,annotationStorage:e.annotationStorage||new i.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const r of t){if(r.noHTML)continue;const e=r.annotationType===a.AnnotationType.POPUP;if(e){const e=s.get(r.id);if(!e)continue;o.elements=e}else{const{width:e,height:t}=u(r.rect);if(e<=0||t<=0)continue}o.data=r;const t=p.create(o);if(!t.isRenderable)continue;if(!e&&r.popupRef){const e=s.get(r.popupRef);e?e.push(t):s.set(r.popupRef,[t])}t.annotationEditorType>0&&_classPrivateFieldGet(ve,this).set(t.data.id,t);const n=t.render();r.hidden&&(n.style.visibility="hidden"),_assertClassBrand(Te,this,ye).call(this,n,r.id)}_assertClassBrand(Te,this,Ce).call(this),await this.l10n.translate(n)}update(e){let{viewport:t}=e;const n=this.div;this.viewport=t,(0,r.setLayerDimensions)(n,{rotation:t.rotation}),_assertClassBrand(Te,this,Ce).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(_classPrivateFieldGet(ve,this).values())}getEditableAnnotation(e){return _classPrivateFieldGet(ve,this).get(e)}}},(e,t)=>{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function a(e){return Math.max(0,Math.min(255,255*e))}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G(e){let[t,n,a,r]=e;return["G",1-Math.min(1,.3*t+.59*a+.11*n+r)]}static G_CMYK(e){let[t]=e;return["CMYK",0,0,0,1-t]}static G_RGB(e){let[t]=e;return["RGB",t,t,t]}static G_rgb(e){let[t]=e;return t=a(t),[t,t,t]}static G_HTML(e){let[t]=e;const a=n(t);return"#".concat(a).concat(a).concat(a)}static RGB_G(e){let[t,n,a]=e;return["G",.3*t+.59*n+.11*a]}static RGB_rgb(e){return e.map(a)}static RGB_HTML(e){return"#".concat(e.map(n).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(e){let[t,n,a,r]=e;return["RGB",1-Math.min(1,t+r),1-Math.min(1,a+r),1-Math.min(1,n+r)]}static CMYK_rgb(e){let[t,n,r,i]=e;return[a(1-Math.min(1,t+i)),a(1-Math.min(1,r+i)),a(1-Math.min(1,n+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(e){let[t,n,a]=e;const r=1-t,i=1-n,s=1-a;return["CMYK",r,i,s,Math.min(r,i,s)]}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=a;const n={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}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{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.",annotation_date_string:"{{date}}, {{time}}",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\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function a(e,t){switch(e){case"find_match_count":e="find_match_count[".concat(1===t.total?"one":"other","]");break;case"find_match_count_limit":e="find_match_count_limit[".concat(1===t.limit?"one":"other","]")}return n[e]||""}n.print_progress_percent="{{progress}}%";const r={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:a(e,t),t)},async translate(e){}};t.NullL10n=r},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var a=n(25);t.XfaLayer=class{static setupStorage(e,t,n,a,r){const i=a.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(e.textContent=i.value),"print"===r)break;e.addEventListener("input",(e=>{a.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(i.value===n.attributes.xfaOn?e.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",(e=>{a.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==i.value&&e.setAttribute("value",i.value),"print"===r)break;e.addEventListener("input",(e=>{a.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==i.value){e.setAttribute("value",i.value);for(const e of n.children)e.attributes.value===i.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",(e=>{const n=e.target.options,r=-1===n.selectedIndex?"":n[n.selectedIndex].value;a.setValue(t,{value:r})}))}}static setAttributes(e){let{html:t,element:n,storage:a=null,intent:r,linkService:i}=e;const{attributes:s}=n,o=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name="".concat(s.name,"-").concat(r));for(const[l,c]of Object.entries(s))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&t.setAttribute(l,c)}o&&i.addLinkAttributes(t,s.href,s.newWindow),a&&s.dataId&&this.setupStorage(t,s.dataId,n,a)}static render(e){const t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||"display",s=document.createElement(r.name);r.attributes&&this.setAttributes({html:s,element:r,intent:i,linkService:n});const o=[[r,-1,s]],l=e.div;if(l.append(s),e.viewport){const t="matrix(".concat(e.viewport.transform.join(","),")");l.style.transform=t}"richText"!==i&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[e,r,s]=o.at(-1);if(r+1===e.children.length){o.pop();continue}const l=e.children[++o.at(-1)[1]];if(null===l)continue;const{name:u}=l;if("#text"===u){const e=document.createTextNode(l.value);c.push(e),s.append(e);continue}const p=null!==l&&void 0!==l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,u):document.createElement(u);if(s.append(p),l.attributes&&this.setAttributes({html:p,element:l,storage:t,intent:i,linkService:n}),l.children&&l.children.length>0)o.push([l,-1,p]);else if(l.value){const e=document.createTextNode(l.value);a.XfaText.shouldBuildText(u)&&c.push(e),p.append(e)}}for(const a of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))a.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0;var r=n(1),i=n(4),s=n(29),o=n(6),l=n(5),c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap,E=new WeakMap,b=new WeakMap,S=new WeakMap,v=new WeakMap,T=new WeakMap,y=new WeakSet;class C extends i.AnnotationEditor{constructor(e){super({...e,name:"inkEditor"}),_classPrivateMethodInitSpec(this,y),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,0),_classPrivateFieldInitSpec(this,u,this.canvasPointermove.bind(this)),_classPrivateFieldInitSpec(this,p,this.canvasPointerleave.bind(this)),_classPrivateFieldInitSpec(this,_,this.canvasPointerup.bind(this)),_classPrivateFieldInitSpec(this,m,this.canvasPointerdown.bind(this)),_classPrivateFieldInitSpec(this,h,new Path2D),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldInitSpec(this,E,!1),_classPrivateFieldInitSpec(this,b,null),_classPrivateFieldInitSpec(this,S,0),_classPrivateFieldInitSpec(this,v,0),_classPrivateFieldInitSpec(this,T,null),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e){i.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:C._defaultThickness=t;break;case r.AnnotationEditorParamsType.INK_COLOR:C._defaultColor=t;break;case r.AnnotationEditorParamsType.INK_OPACITY:C._defaultOpacity=t/100}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:_assertClassBrand(y,this,A).call(this,t);break;case r.AnnotationEditorParamsType.INK_COLOR:_assertClassBrand(y,this,N).call(this,t);break;case r.AnnotationEditorParamsType.INK_OPACITY:_assertClassBrand(y,this,R).call(this,t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,C._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,C._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*C._defaultOpacity)]]}get propertiesToUpdate(){var e;return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||C._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||C._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(e=this.opacity)&&void 0!==e?e:C._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(_assertClassBrand(y,this,U).call(this),_assertClassBrand(y,this,G).call(this)),this.isAttachedToDOM||(this.parent.add(this),_assertClassBrand(y,this,z).call(this)),_assertClassBrand(y,this,$).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(b,this).disconnect(),_classPrivateFieldSet(b,this,null),super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,a=this.height*t;this.setDimensions(n,a)}enableEditMode(){_classPrivateFieldGet(g,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(m,this)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(m,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){_classPrivateFieldGet(g,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(g,this,!0),this.div.classList.add("disabled"),_assertClassBrand(y,this,$).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!_classPrivateFieldGet(g,this)&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),_assertClassBrand(y,this,w).call(this,e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),_assertClassBrand(y,this,x).call(this,e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),_assertClassBrand(y,this,B).call(this,e)}canvasPointerleave(e){_assertClassBrand(y,this,B).call(this,e)}get isResizable(){return!this.isEmpty()&&_classPrivateFieldGet(g,this)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),i.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((e=>{var t;return null===(t=this.div)||void 0===t?void 0:t.setAttribute("aria-label",e)}));const[n,a,r,s]=_assertClassBrand(y,this,O).call(this);if(this.setAt(n,a,0,0),this.setDims(r,s),_assertClassBrand(y,this,U).call(this),this.width){const[n,a]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*a),this.setAt(e*n,t*a,this.width*n,this.height*a),_classPrivateFieldSet(E,this,!0),_assertClassBrand(y,this,z).call(this),this.setDims(this.width*n,this.height*a),_assertClassBrand(y,this,F).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _assertClassBrand(y,this,G).call(this),this.div}setDimensions(e,t){const n=Math.round(e),a=Math.round(t);if(_classPrivateFieldGet(S,this)===n&&_classPrivateFieldGet(v,this)===a)return;_classPrivateFieldSet(S,this,n),_classPrivateFieldSet(v,this,a),this.canvas.style.visibility="hidden";const[r,i]=this.parentDimensions;this.width=e/r,this.height=t/i,this.fixAndSetPosition(),_classPrivateFieldGet(g,this)&&_assertClassBrand(y,this,H).call(this,e,t),_assertClassBrand(y,this,z).call(this),_assertClassBrand(y,this,F).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(e,t,n){if(e instanceof s.InkAnnotationElement)return null;const a=super.deserialize(e,t,n);a.thickness=e.thickness,a.color=r.Util.makeHexColor(...e.color),a.opacity=e.opacity;const[o,l]=a.pageDimensions,u=a.width*o,p=a.height*l,_=a.parentScale,m=e.thickness/2;_classPrivateFieldSet(g,a,!0),_classPrivateFieldSet(S,a,Math.round(u)),_classPrivateFieldSet(v,a,Math.round(p));const{paths:h,rect:f,rotation:E}=e;for(let{bezier:r}of h){r=q.call(C,r,f,E);const e=[];a.paths.push(e);let t=_*(r[0]-m),n=_*(r[1]-m);for(let a=2,s=r.length;a{this.thickness=e,_assertClassBrand(y,this,$).call(this)},undo:()=>{this.thickness=t,_assertClassBrand(y,this,$).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function N(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,_assertClassBrand(y,this,F).call(this)},undo:()=>{this.color=t,_assertClassBrand(y,this,F).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function R(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,_assertClassBrand(y,this,F).call(this)},undo:()=>{this.opacity=t,_assertClassBrand(y,this,F).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function O(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}function I(){const{ctx:e,color:t,opacity:n,thickness:a,parentScale:r,scaleFactor:i}=this;e.lineWidth=a*r/i,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle="".concat(t).concat((0,l.opacityToHex)(n))}function w(e,t){var n;this.canvas.addEventListener("contextmenu",o.noContextMenu),this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(p,this)),this.canvas.addEventListener("pointermove",_classPrivateFieldGet(u,this)),this.canvas.addEventListener("pointerup",_classPrivateFieldGet(_,this)),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(m,this)),this.isEditing=!0,_classPrivateFieldGet(E,this)||(_classPrivateFieldSet(E,this,!0),_assertClassBrand(y,this,z).call(this),this.thickness||(this.thickness=a._defaultThickness),this.color||(this.color=a._defaultColor||i.AnnotationEditor._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=a._defaultOpacity)),this.currentPath.push([e,t]),_classPrivateFieldSet(f,this,!1),_assertClassBrand(y,this,I).call(this),_classPrivateFieldSet(T,this,(()=>{_assertClassBrand(y,this,P).call(this),_classPrivateFieldGet(T,this)&&window.requestAnimationFrame(_classPrivateFieldGet(T,this))})),window.requestAnimationFrame(_classPrivateFieldGet(T,this))}function x(e,t){const[n,a]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===n&&t===a)return;const r=this.currentPath;let i=_classPrivateFieldGet(h,this);if(r.push([e,t]),_classPrivateFieldSet(f,this,!0),r.length<=2)return i.moveTo(...r[0]),void i.lineTo(e,t);3===r.length&&(_classPrivateFieldSet(h,this,i=new Path2D),i.moveTo(...r[0])),_assertClassBrand(y,this,M).call(this,i,...r.at(-3),...r.at(-2),e,t)}function D(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);_classPrivateFieldGet(h,this).lineTo(...e)}function k(e,t){let n;if(_classPrivateFieldSet(T,this,null),e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),_assertClassBrand(y,this,x).call(this,e,t),_assertClassBrand(y,this,D).call(this),1!==this.currentPath.length)n=_assertClassBrand(y,this,L).call(this);else{const a=[e,t];n=[[a,a.slice(),a.slice(),a]]}const a=_classPrivateFieldGet(h,this),r=this.currentPath;this.currentPath=[],_classPrivateFieldSet(h,this,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(r),this.paths.push(n),this.bezierPath2D.push(a),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_assertClassBrand(y,this,U).call(this),_assertClassBrand(y,this,G).call(this)),_assertClassBrand(y,this,$).call(this))},mustExec:!0})}function P(){if(!_classPrivateFieldGet(f,this))return;_classPrivateFieldSet(f,this,!1);Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),t=e.map((e=>e[0])),n=e.map((e=>e[1])),{ctx:a}=(Math.min(...t),Math.max(...t),Math.min(...n),Math.max(...n),this);a.save(),a.clearRect(0,0,this.canvas.width,this.canvas.height);for(const r of this.bezierPath2D)a.stroke(r);a.stroke(_classPrivateFieldGet(h,this)),a.restore()}function M(e,t,n,a,r,i,s){const o=(t+a)/2,l=(n+r)/2,c=(a+i)/2,d=(r+s)/2;e.bezierCurveTo(o+2*(a-o)/3,l+2*(r-l)/3,c+2*(a-c)/3,d+2*(r-d)/3,c,d)}function L(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let n,[a,r]=e[0];for(n=1;n{this.canvas.removeEventListener("contextmenu",o.noContextMenu)}),10),_assertClassBrand(y,this,k).call(this,e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function U(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",i.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>{var t;return null===(t=this.canvas)||void 0===t?void 0:t.setAttribute("aria-label",e)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function G(){_classPrivateFieldSet(b,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}))),_classPrivateFieldGet(b,this).observe(this.div)}function z(){if(!_classPrivateFieldGet(E,this))return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),_assertClassBrand(y,this,Y).call(this)}function H(e,t){const n=_assertClassBrand(y,this,Q).call(this),a=(e-n)/_classPrivateFieldGet(d,this),r=(t-n)/_classPrivateFieldGet(c,this);this.scaleFactor=Math.min(a,r)}function Y(){const e=_assertClassBrand(y,this,Q).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}function j(e){const t=new Path2D;for(let n=0,a=e.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(g,this))return void _assertClassBrand(y,this,F).call(this);const t=_assertClassBrand(y,this,K).call(this),n=_assertClassBrand(y,this,Q).call(this);_classPrivateFieldSet(d,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[2]-t[0])),_classPrivateFieldSet(c,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[3]-t[1]));const a=Math.ceil(n+_classPrivateFieldGet(d,this)*this.scaleFactor),r=Math.ceil(n+_classPrivateFieldGet(c,this)*this.scaleFactor),[s,o]=this.parentDimensions;this.width=a/s,this.height=r/o,this.setAspectRatio(a,r);const l=this.translationX,u=this.translationY;this.translationX=-t[0],this.translationY=-t[1],_assertClassBrand(y,this,z).call(this),_assertClassBrand(y,this,F).call(this),_classPrivateFieldSet(S,this,a),_classPrivateFieldSet(v,this,r),this.setDims(a,r);const p=e?n/this.scaleFactor/2:0;this.translate(l-this.translationX-p,u-this.translationY-p)}a=C,_defineProperty(C,"_defaultColor",null),_defineProperty(C,"_defaultOpacity",1),_defineProperty(C,"_defaultThickness",1),_defineProperty(C,"_type","ink"),t.InkEditor=C},(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.StampEditor=void 0;var r=n(1),i=n(4),s=n(6),o=n(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,f=new WeakMap,E=new WeakSet;class b extends i.AnnotationEditor{constructor(e){super({...e,name:"stampEditor"}),_classPrivateMethodInitSpec(this,E),_classPrivateFieldInitSpec(this,l,null),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,p,null),_classPrivateFieldInitSpec(this,_,null),_classPrivateFieldInitSpec(this,m,null),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,f,!1),_classPrivateFieldSet(u,this,e.bitmapUrl),_classPrivateFieldSet(p,this,e.bitmapFile)}static initialize(e){i.AnnotationEditor.initialize(e)}static get supportedTypes(){return(0,r.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((e=>"image/".concat(e))))}static get supportedTypesStr(){return(0,r.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(r.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}remove(){var e,t;_classPrivateFieldGet(c,this)&&(_classPrivateFieldSet(l,this,null),this._uiManager.imageManager.deleteId(_classPrivateFieldGet(c,this)),null===(e=_classPrivateFieldGet(_,this))||void 0===e||e.remove(),_classPrivateFieldSet(_,this,null),null===(t=_classPrivateFieldGet(m,this))||void 0===t||t.disconnect(),_classPrivateFieldSet(m,this,null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(_classPrivateFieldGet(c,this)&&_assertClassBrand(E,this,T).call(this),this.isAttachedToDOM||this.parent.add(this))):_classPrivateFieldGet(c,this)&&_assertClassBrand(E,this,T).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(_classPrivateFieldGet(d,this)||_classPrivateFieldGet(l,this)||_classPrivateFieldGet(u,this)||_classPrivateFieldGet(p,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,_classPrivateFieldGet(l,this)?_assertClassBrand(E,this,y).call(this):_assertClassBrand(E,this,T).call(this),this.width){const[n,a]=this.parentDimensions;this.setAt(e*n,t*a,this.width*n,this.height*a)}return this.div}static deserialize(e,t,n){if(e instanceof o.StampAnnotationElement)return null;const a=super.deserialize(e,t,n),{rect:r,bitmapUrl:i,bitmapId:s,isSvg:l,accessibilityData:d}=e;s&&n.imageManager.isValidId(s)?_classPrivateFieldSet(c,a,s):_classPrivateFieldSet(u,a,i),_classPrivateFieldSet(g,a,l);const[p,_]=a.pageDimensions;return a.width=(r[2]-r[0])/p,a.height=(r[3]-r[1])/_,d&&(a.altTextData=d),a}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:r.AnnotationEditorType.STAMP,bitmapId:_classPrivateFieldGet(c,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_classPrivateFieldGet(g,this),structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=_assertClassBrand(E,this,R).call(this,!0),n.accessibilityData=this.altTextData,n;const{decorative:a,altText:i}=this.altTextData;if(!a&&i&&(n.accessibilityData={type:"Figure",alt:i}),null===t)return n;t.stamps||(t.stamps=new Map);const s=_classPrivateFieldGet(g,this)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has(_classPrivateFieldGet(c,this))){if(_classPrivateFieldGet(g,this)){const e=t.stamps.get(_classPrivateFieldGet(c,this));s>e.area&&(e.area=s,e.serialized.bitmap.close(),e.serialized.bitmap=_assertClassBrand(E,this,R).call(this,!1))}}else t.stamps.set(_classPrivateFieldGet(c,this),{area:s,serialized:n}),n.bitmap=_assertClassBrand(E,this,R).call(this,!1);return n}}function S(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?(_classPrivateFieldSet(l,this,e.bitmap),t||(_classPrivateFieldSet(c,this,e.id),_classPrivateFieldSet(g,this,e.isSvg)),_assertClassBrand(E,this,y).call(this)):this.remove()}function v(){_classPrivateFieldSet(d,this,null),this._uiManager.enableWaiting(!1),_classPrivateFieldGet(_,this)&&this.div.focus()}function T(){if(_classPrivateFieldGet(c,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_classPrivateFieldGet(c,this)).then((e=>_assertClassBrand(E,this,S).call(this,e,!0))).finally((()=>_assertClassBrand(E,this,v).call(this)));if(_classPrivateFieldGet(u,this)){const e=_classPrivateFieldGet(u,this);return _classPrivateFieldSet(u,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromUrl(e).then((e=>_assertClassBrand(E,this,S).call(this,e))).finally((()=>_assertClassBrand(E,this,v).call(this))))}if(_classPrivateFieldGet(p,this)){const e=_classPrivateFieldGet(p,this);return _classPrivateFieldSet(p,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromFile(e).then((e=>_assertClassBrand(E,this,S).call(this,e))).finally((()=>_assertClassBrand(E,this,v).call(this))))}const e=document.createElement("input");e.type="file",e.accept=a.supportedTypesStr,_classPrivateFieldSet(d,this,new Promise((t=>{e.addEventListener("change",(async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);_assertClassBrand(E,this,S).call(this,t)}else this.remove();t()})),e.addEventListener("cancel",(()=>{this.remove(),t()}))})).finally((()=>_assertClassBrand(E,this,v).call(this)))),e.click()}function y(){const{div:e}=this;let{width:t,height:n}=_classPrivateFieldGet(l,this);const[a,r]=this.pageDimensions,i=.75;if(this.width)t=this.width*a,n=this.height*r;else if(t>i*a||n>i*r){const e=Math.min(i*a/t,i*r/n);t*=e,n*=e}const[s,o]=this.parentDimensions;this.setDims(t*s/a,n*o/r),this._uiManager.enableWaiting(!1);const c=_classPrivateFieldSet(_,this,document.createElement("canvas"));e.append(c),e.hidden=!1,_assertClassBrand(E,this,N).call(this,t,n),_assertClassBrand(E,this,O).call(this),_classPrivateFieldGet(f,this)||(this.parent.addUndoableEditor(this),_classPrivateFieldSet(f,this,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}function C(e,t){var n;const[a,r]=this.parentDimensions;this.width=e/a,this.height=t/r,this.setDims(e,t),null!==(n=this._initialOptions)&&void 0!==n&&n.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_classPrivateFieldGet(h,this)&&clearTimeout(_classPrivateFieldGet(h,this)),_classPrivateFieldSet(h,this,setTimeout((()=>{_classPrivateFieldSet(h,this,null),_assertClassBrand(E,this,N).call(this,e,t)}),200))}function A(e,t){const{width:n,height:a}=_classPrivateFieldGet(l,this);let r=n,i=a,s=_classPrivateFieldGet(l,this);for(;r>2*e||i>2*t;){const n=r,a=i;r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2));const o=new OffscreenCanvas(r,i);o.getContext("2d").drawImage(s,0,0,n,a,0,0,r,i),s=o.transferToImageBitmap()}return s}function N(e,t){e=Math.ceil(e),t=Math.ceil(t);const n=_classPrivateFieldGet(_,this);if(!n||n.width===e&&n.height===t)return;n.width=e,n.height=t;const a=_classPrivateFieldGet(g,this)?_classPrivateFieldGet(l,this):_assertClassBrand(E,this,A).call(this,e,t),r=n.getContext("2d");r.filter=this._uiManager.hcmFilter,r.drawImage(a,0,0,a.width,a.height,0,0,e,t)}function R(e){if(e){if(_classPrivateFieldGet(g,this)){const e=this._uiManager.imageManager.getSvgUrl(_classPrivateFieldGet(c,this));if(e)return e}const e=document.createElement("canvas");return({width:e.width,height:e.height}=_classPrivateFieldGet(l,this)),e.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0),e.toDataURL()}if(_classPrivateFieldGet(g,this)){const[e,t]=this.pageDimensions,n=Math.round(this.width*e*s.PixelsPerInch.PDF_TO_CSS_UNITS),a=Math.round(this.height*t*s.PixelsPerInch.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(n,a);return r.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0,_classPrivateFieldGet(l,this).width,_classPrivateFieldGet(l,this).height,0,0,n,a),r.transferToImageBitmap()}return structuredClone(_classPrivateFieldGet(l,this))}function O(){_classPrivateFieldSet(m,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&_assertClassBrand(E,this,C).call(this,t.width,t.height)}))),_classPrivateFieldGet(m,this).observe(this.div)}a=b,_defineProperty(b,"_type","stamp"),t.StampEditor=b}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return s.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"DOMSVGFactory",{enumerable:!0,get:function(){return a.DOMSVGFactory}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return a.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return a.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return a.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return n.SVGGraphics}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return a.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return a.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return a.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return a.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return a.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return a.loadScript}}),Object.defineProperty(e,"noContextMenu",{enumerable:!0,get:function(){return a.noContextMenu}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return r.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return a.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return r.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),a=__w_pdfjs_require__(6),r=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),s=__w_pdfjs_require__(5),o=__w_pdfjs_require__(29),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})(),module.exports=root.pdfjsLib=factory()},1497:(e,t,n)=>{"use strict";var a=n(3218);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==a){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},5173:(e,t,n)=>{e.exports=n(1497)()},3218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7212:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,r=function(){function e(e,t){for(var n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n{"use strict";var a=i(n(724)),r=i(n(7212));function i(e){return e&&e.__esModule?e:{default:e}}var s={Google:a.default,Baidu:r.default};t.A=s},2730:(e,t,n)=>{"use strict";var a=n(5043),r=n(8853);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n