UNPKG

reactjs-file-preview

Version:

Effortlessly preview images, videos, and PDFs in your React applications with MyFilePreview. This lightweight and customizable component intelligently detects file types and displays them.

33 lines (31 loc) 235 kB
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".preview-file{width:100%;height:100%;object-fit:contain}.loader-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%}.loader{width:50px;height:50px;border:5px solid #e0e0e0;border-top:5px solid #606060;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.hidden{visibility:hidden;width:0;height:0}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); (function(V,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(V=typeof globalThis<"u"?globalThis:V||self,r(V["npmjs-file-preview"]={},V.React))})(this,function(exports,require$$0){"use strict";function getAugmentedNamespace(V){if(V.__esModule)return V;var r=V.default;if(typeof r=="function"){var _=function t(){return this instanceof t?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};_.prototype=r.prototype}else _={};return Object.defineProperty(_,"__esModule",{value:!0}),Object.keys(V).forEach(function(t){var g=Object.getOwnPropertyDescriptor(V,t);Object.defineProperty(_,t,g.get?g:{enumerable:!0,get:function(){return V[t]}})}),_}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var V=require$$0,r=Symbol.for("react.element"),_=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,g=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function R(O,m,d){var f,E={},N=null,P=null;d!==void 0&&(N=""+d),m.key!==void 0&&(N=""+m.key),m.ref!==void 0&&(P=m.ref);for(f in m)t.call(m,f)&&!x.hasOwnProperty(f)&&(E[f]=m[f]);if(O&&O.defaultProps)for(f in m=O.defaultProps,m)E[f]===void 0&&(E[f]=m[f]);return{$$typeof:r,type:O,key:N,ref:P,props:E,_owner:g.current}}return reactJsxRuntime_production_min.Fragment=_,reactJsxRuntime_production_min.jsx=R,reactJsxRuntime_production_min.jsxs=R,reactJsxRuntime_production_min}var reactJsxRuntime_development={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactJsxRuntime_development;function requireReactJsxRuntime_development(){return hasRequiredReactJsxRuntime_development||(hasRequiredReactJsxRuntime_development=1,process.env.NODE_ENV!=="production"&&function(){var V=require$$0,r=Symbol.for("react.element"),_=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),O=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),W=Symbol.iterator,c="@@iterator";function S(C){if(C===null||typeof C!="object")return null;var K=W&&C[W]||C[c];return typeof K=="function"?K:null}var I=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(C){{for(var K=arguments.length,Z=new Array(K>1?K-1:0),re=1;re<K;re++)Z[re-1]=arguments[re];b("error",C,Z)}}function b(C,K,Z){{var re=I.ReactDebugCurrentFrame,pe=re.getStackAddendum();pe!==""&&(K+="%s",Z=Z.concat([pe]));var _e=Z.map(function(he){return String(he)});_e.unshift("Warning: "+K),Function.prototype.apply.call(console[C],console,_e)}}var n=!1,s=!1,u=!1,y=!1,p=!1,M;M=Symbol.for("react.module.reference");function k(C){return!!(typeof C=="string"||typeof C=="function"||C===t||C===x||p||C===g||C===d||C===f||y||C===P||n||s||u||typeof C=="object"&&C!==null&&(C.$$typeof===N||C.$$typeof===E||C.$$typeof===R||C.$$typeof===O||C.$$typeof===m||C.$$typeof===M||C.getModuleId!==void 0))}function X(C,K,Z){var re=C.displayName;if(re)return re;var pe=K.displayName||K.name||"";return pe!==""?Z+"("+pe+")":Z}function D(C){return C.displayName||"Context"}function v(C){if(C==null)return null;if(typeof C.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case t:return"Fragment";case _:return"Portal";case x:return"Profiler";case g:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case O:var K=C;return D(K)+".Consumer";case R:var Z=C;return D(Z._context)+".Provider";case m:return X(C,C.render,"ForwardRef");case E:var re=C.displayName||null;return re!==null?re:v(C.type)||"Memo";case N:{var pe=C,_e=pe._payload,he=pe._init;try{return v(he(_e))}catch{return null}}}return null}var L=Object.assign,j=0,$,F,o,e,i,a,h;function l(){}l.__reactDisabledLog=!0;function A(){{if(j===0){$=console.log,F=console.info,o=console.warn,e=console.error,i=console.group,a=console.groupCollapsed,h=console.groupEnd;var C={configurable:!0,enumerable:!0,value:l,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}j++}}function w(){{if(j--,j===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},C,{value:$}),info:L({},C,{value:F}),warn:L({},C,{value:o}),error:L({},C,{value:e}),group:L({},C,{value:i}),groupCollapsed:L({},C,{value:a}),groupEnd:L({},C,{value:h})})}j<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var U=I.ReactCurrentDispatcher,G;function B(C,K,Z){{if(G===void 0)try{throw Error()}catch(pe){var re=pe.stack.trim().match(/\n( *(at )?)/);G=re&&re[1]||""}return` `+G+C}}var Y=!1,J;{var Q=typeof WeakMap=="function"?WeakMap:Map;J=new Q}function te(C,K){if(!C||Y)return"";{var Z=J.get(C);if(Z!==void 0)return Z}var re;Y=!0;var pe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var _e;_e=U.current,U.current=null,A();try{if(K){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(Te){re=Te}Reflect.construct(C,[],he)}else{try{he.call()}catch(Te){re=Te}C.call(he.prototype)}}else{try{throw Error()}catch(Te){re=Te}C()}}catch(Te){if(Te&&re&&typeof Te.stack=="string"){for(var le=Te.stack.split(` `),Pe=re.stack.split(` `),ve=le.length-1,Ce=Pe.length-1;ve>=1&&Ce>=0&&le[ve]!==Pe[Ce];)Ce--;for(;ve>=1&&Ce>=0;ve--,Ce--)if(le[ve]!==Pe[Ce]){if(ve!==1||Ce!==1)do if(ve--,Ce--,Ce<0||le[ve]!==Pe[Ce]){var Fe=` `+le[ve].replace(" at new "," at ");return C.displayName&&Fe.includes("<anonymous>")&&(Fe=Fe.replace("<anonymous>",C.displayName)),typeof C=="function"&&J.set(C,Fe),Fe}while(ve>=1&&Ce>=0);break}}}finally{Y=!1,U.current=_e,w(),Error.prepareStackTrace=pe}var Ne=C?C.displayName||C.name:"",Ie=Ne?B(Ne):"";return typeof C=="function"&&J.set(C,Ie),Ie}function oe(C,K,Z){return te(C,!1)}function ie(C){var K=C.prototype;return!!(K&&K.isReactComponent)}function de(C,K,Z){if(C==null)return"";if(typeof C=="function")return te(C,ie(C));if(typeof C=="string")return B(C);switch(C){case d:return B("Suspense");case f:return B("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case m:return oe(C.render);case E:return de(C.type,K,Z);case N:{var re=C,pe=re._payload,_e=re._init;try{return de(_e(pe),K,Z)}catch{}}}return""}var ae=Object.prototype.hasOwnProperty,ue={},ye=I.ReactDebugCurrentFrame;function ne(C){if(C){var K=C._owner,Z=de(C.type,C._source,K?K.type:null);ye.setExtraStackFrame(Z)}else ye.setExtraStackFrame(null)}function be(C,K,Z,re,pe){{var _e=Function.call.bind(ae);for(var he in C)if(_e(C,he)){var le=void 0;try{if(typeof C[he]!="function"){var Pe=Error((re||"React class")+": "+Z+" type `"+he+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[he]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pe.name="Invariant Violation",Pe}le=C[he](K,he,re,Z,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ve){le=ve}le&&!(le instanceof Error)&&(ne(pe),T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",re||"React class",Z,he,typeof le),ne(null)),le instanceof Error&&!(le.message in ue)&&(ue[le.message]=!0,ne(pe),T("Failed %s type: %s",Z,le.message),ne(null))}}}var me=Array.isArray;function Se(C){return me(C)}function Ae(C){{var K=typeof Symbol=="function"&&Symbol.toStringTag,Z=K&&C[Symbol.toStringTag]||C.constructor.name||"Object";return Z}}function we(C){try{return xe(C),!1}catch{return!0}}function xe(C){return""+C}function Re(C){if(we(C))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ae(C)),xe(C)}var Ee=I.ReactCurrentOwner,ke={key:!0,ref:!0,__self:!0,__source:!0},ge,Oe;function je(C){if(ae.call(C,"ref")){var K=Object.getOwnPropertyDescriptor(C,"ref").get;if(K&&K.isReactWarning)return!1}return C.ref!==void 0}function Ge(C){if(ae.call(C,"key")){var K=Object.getOwnPropertyDescriptor(C,"key").get;if(K&&K.isReactWarning)return!1}return C.key!==void 0}function He(C,K){typeof C.ref=="string"&&Ee.current}function $e(C,K){{var Z=function(){ge||(ge=!0,T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};Z.isReactWarning=!0,Object.defineProperty(C,"key",{get:Z,configurable:!0})}}function Ve(C,K){{var Z=function(){Oe||(Oe=!0,T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};Z.isReactWarning=!0,Object.defineProperty(C,"ref",{get:Z,configurable:!0})}}var Xe=function(C,K,Z,re,pe,_e,he){var le={$$typeof:r,type:C,key:K,ref:Z,props:he,_owner:_e};return le._store={},Object.defineProperty(le._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(le,"_self",{configurable:!1,enumerable:!1,writable:!1,value:re}),Object.defineProperty(le,"_source",{configurable:!1,enumerable:!1,writable:!1,value:pe}),Object.freeze&&(Object.freeze(le.props),Object.freeze(le)),le};function ze(C,K,Z,re,pe){{var _e,he={},le=null,Pe=null;Z!==void 0&&(Re(Z),le=""+Z),Ge(K)&&(Re(K.key),le=""+K.key),je(K)&&(Pe=K.ref,He(K,pe));for(_e in K)ae.call(K,_e)&&!ke.hasOwnProperty(_e)&&(he[_e]=K[_e]);if(C&&C.defaultProps){var ve=C.defaultProps;for(_e in ve)he[_e]===void 0&&(he[_e]=ve[_e])}if(le||Pe){var Ce=typeof C=="function"?C.displayName||C.name||"Unknown":C;le&&$e(he,Ce),Pe&&Ve(he,Ce)}return Xe(C,le,Pe,pe,re,Ee.current,he)}}var Ue=I.ReactCurrentOwner,z=I.ReactDebugCurrentFrame;function q(C){if(C){var K=C._owner,Z=de(C.type,C._source,K?K.type:null);z.setExtraStackFrame(Z)}else z.setExtraStackFrame(null)}var H;H=!1;function ee(C){return typeof C=="object"&&C!==null&&C.$$typeof===r}function se(){{if(Ue.current){var C=v(Ue.current.type);if(C)return` Check the render method of \``+C+"`."}return""}}function ce(C){return""}var fe={};function Me(C){{var K=se();if(!K){var Z=typeof C=="string"?C:C.displayName||C.name;Z&&(K=` Check the top-level render call using <`+Z+">.")}return K}}function Le(C,K){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var Z=Me(K);if(fe[Z])return;fe[Z]=!0;var re="";C&&C._owner&&C._owner!==Ue.current&&(re=" It was passed a child from "+v(C._owner.type)+"."),q(C),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Z,re),q(null)}}function De(C,K){{if(typeof C!="object")return;if(Se(C))for(var Z=0;Z<C.length;Z++){var re=C[Z];ee(re)&&Le(re,K)}else if(ee(C))C._store&&(C._store.validated=!0);else if(C){var pe=S(C);if(typeof pe=="function"&&pe!==C.entries)for(var _e=pe.call(C),he;!(he=_e.next()).done;)ee(he.value)&&Le(he.value,K)}}}function qe(C){{var K=C.type;if(K==null||typeof K=="string")return;var Z;if(typeof K=="function")Z=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===m||K.$$typeof===E))Z=K.propTypes;else return;if(Z){var re=v(K);be(Z,C.props,"prop",re,C)}else if(K.PropTypes!==void 0&&!H){H=!0;var pe=v(K);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",pe||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ye(C){{for(var K=Object.keys(C.props),Z=0;Z<K.length;Z++){var re=K[Z];if(re!=="children"&&re!=="key"){q(C),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",re),q(null);break}}C.ref!==null&&(q(C),T("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var We={};function Be(C,K,Z,re,pe,_e){{var he=k(C);if(!he){var le="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(le+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pe=ce();Pe?le+=Pe:le+=se();var ve;C===null?ve="null":Se(C)?ve="array":C!==void 0&&C.$$typeof===r?(ve="<"+(v(C.type)||"Unknown")+" />",le=" Did you accidentally export a JSX literal instead of a component?"):ve=typeof C,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ve,le)}var Ce=ze(C,K,Z,pe,_e);if(Ce==null)return Ce;if(he){var Fe=K.children;if(Fe!==void 0)if(re)if(Se(Fe)){for(var Ne=0;Ne<Fe.length;Ne++)De(Fe[Ne],C);Object.freeze&&Object.freeze(Fe)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(Fe,C)}if(ae.call(K,"key")){var Ie=v(C),Te=Object.keys(K).filter(function(nt){return nt!=="key"}),Je=Te.length>0?"{key: someKey, "+Te.join(": ..., ")+": ...}":"{key: someKey}";if(!We[Ie+Je]){var tt=Te.length>0?"{"+Te.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,Je,Ie,tt,Ie),We[Ie+Je]=!0}}return C===t?Ye(Ce):qe(Ce),Ce}}function Ke(C,K,Z){return Be(C,K,Z,!0)}function Qe(C,K,Z){return Be(C,K,Z,!1)}var Ze=Qe,et=Ke;reactJsxRuntime_development.Fragment=t,reactJsxRuntime_development.jsx=Ze,reactJsxRuntime_development.jsxs=et}()),reactJsxRuntime_development}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,process.env.NODE_ENV==="production"?jsxRuntime.exports=requireReactJsxRuntime_production_min():jsxRuntime.exports=requireReactJsxRuntime_development()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime();function commonjsRequire(V){throw new Error('Could not dynamically require "'+V+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);var pdf=pdf$1.exports,hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,function(module,exports){(function(r,_){module.exports=_()})(pdf,function(){return(()=>{var __webpack_modules__=[,(V,r,_)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addLinkAttributes=c,r.deprecated=y,r.getFilenameFromUrl=T,r.getPdfFilenameFromUrl=b,r.getXfaPageViewport=k,r.isDataScheme=S,r.isPdfFile=I,r.isValidFetchUrl=s,r.loadScript=u,r.StatTimer=r.RenderingCancelledException=r.PDFDateString=r.PageViewport=r.LinkTarget=r.DOMSVGFactory=r.DOMStandardFontDataFactory=r.DOMCMapReaderFactory=r.DOMCanvasFactory=r.DEFAULT_LINK_REL=void 0;var t=_(2),g=_(5);const x="noopener noreferrer nofollow";r.DEFAULT_LINK_REL=x;const R="http://www.w3.org/2000/svg";class O extends g.BaseCanvasFactory{constructor({ownerDocument:D=globalThis.document}={}){super(),this._document=D}_createCanvas(D,v){const L=this._document.createElement("canvas");return L.width=D,L.height=v,L}}r.DOMCanvasFactory=O;async function m(X,D=!1){if(s(X,document.baseURI)){const v=await fetch(X);if(!v.ok)throw new Error(v.statusText);return D?new Uint8Array(await v.arrayBuffer()):(0,t.stringToBytes)(await v.text())}return new Promise((v,L)=>{const j=new XMLHttpRequest;j.open("GET",X,!0),D&&(j.responseType="arraybuffer"),j.onreadystatechange=()=>{if(j.readyState===XMLHttpRequest.DONE){if(j.status===200||j.status===0){let $;if(D&&j.response?$=new Uint8Array(j.response):!D&&j.responseText&&($=(0,t.stringToBytes)(j.responseText)),$){v($);return}}L(new Error(j.statusText))}},j.send(null)})}class d extends g.BaseCMapReaderFactory{_fetchData(D,v){return m(D,this.isCompressed).then(L=>({cMapData:L,compressionType:v}))}}r.DOMCMapReaderFactory=d;class f extends g.BaseStandardFontDataFactory{_fetchData(D){return m(D,!0)}}r.DOMStandardFontDataFactory=f;class E extends g.BaseSVGFactory{_createSVG(D){return document.createElementNS(R,D)}}r.DOMSVGFactory=E;class N{constructor({viewBox:D,scale:v,rotation:L,offsetX:j=0,offsetY:$=0,dontFlip:F=!1}){this.viewBox=D,this.scale=v,this.rotation=L,this.offsetX=j,this.offsetY=$;const o=(D[2]+D[0])/2,e=(D[3]+D[1])/2;let i,a,h,l;switch(L%=360,L<0&&(L+=360),L){case 180:i=-1,a=0,h=0,l=1;break;case 90:i=0,a=1,h=1,l=0;break;case 270:i=0,a=-1,h=-1,l=0;break;case 0:i=1,a=0,h=0,l=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}F&&(h=-h,l=-l);let A,w,U,G;i===0?(A=Math.abs(e-D[1])*v+j,w=Math.abs(o-D[0])*v+$,U=Math.abs(D[3]-D[1])*v,G=Math.abs(D[2]-D[0])*v):(A=Math.abs(o-D[0])*v+j,w=Math.abs(e-D[1])*v+$,U=Math.abs(D[2]-D[0])*v,G=Math.abs(D[3]-D[1])*v),this.transform=[i*v,a*v,h*v,l*v,A-i*v*o-h*v*e,w-a*v*o-l*v*e],this.width=U,this.height=G}clone({scale:D=this.scale,rotation:v=this.rotation,offsetX:L=this.offsetX,offsetY:j=this.offsetY,dontFlip:$=!1}={}){return new N({viewBox:this.viewBox.slice(),scale:D,rotation:v,offsetX:L,offsetY:j,dontFlip:$})}convertToViewportPoint(D,v){return t.Util.applyTransform([D,v],this.transform)}convertToViewportRectangle(D){const v=t.Util.applyTransform([D[0],D[1]],this.transform),L=t.Util.applyTransform([D[2],D[3]],this.transform);return[v[0],v[1],L[0],L[1]]}convertToPdfPoint(D,v){return t.Util.applyInverseTransform([D,v],this.transform)}}r.PageViewport=N;class P extends t.BaseException{constructor(D,v){super(D),this.type=v}}r.RenderingCancelledException=P;const W={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};r.LinkTarget=W;function c(X,{url:D,target:v,rel:L,enabled:j=!0}={}){(0,t.assert)(D&&typeof D=="string",'addLinkAttributes: A valid "url" parameter must provided.');const $=(0,t.removeNullCharacters)(D);j?X.href=X.title=$:(X.href="",X.title=`Disabled: ${$}`,X.onclick=()=>!1);let F="";switch(v){case W.NONE:break;case W.SELF:F="_self";break;case W.BLANK:F="_blank";break;case W.PARENT:F="_parent";break;case W.TOP:F="_top";break}X.target=F,X.rel=typeof L=="string"?L:x}function S(X){const D=X.length;let v=0;for(;v<D&&X[v].trim()==="";)v++;return X.substring(v,v+5).toLowerCase()==="data:"}function I(X){return typeof X=="string"&&/\.pdf$/i.test(X)}function T(X){const D=X.indexOf("#"),v=X.indexOf("?"),L=Math.min(D>0?D:X.length,v>0?v:X.length);return X.substring(X.lastIndexOf("/",L)+1,L)}function b(X,D="document.pdf"){if(typeof X!="string")return D;if(S(X))return(0,t.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),D;const v=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,L=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,j=v.exec(X);let $=L.exec(j[1])||L.exec(j[2])||L.exec(j[3]);if($&&($=$[0],$.includes("%")))try{$=L.exec(decodeURIComponent($))[0]}catch{}return $||D}class n{constructor(){this.started=Object.create(null),this.times=[]}time(D){D in this.started&&(0,t.warn)(`Timer is already running for ${D}`),this.started[D]=Date.now()}timeEnd(D){D in this.started||(0,t.warn)(`Timer has not been started for ${D}`),this.times.push({name:D,start:this.started[D],end:Date.now()}),delete this.started[D]}toString(){const D=[];let v=0;for(const L of this.times){const j=L.name;j.length>v&&(v=j.length)}for(const L of this.times){const j=L.end-L.start;D.push(`${L.name.padEnd(v)} ${j}ms `)}return D.join("")}}r.StatTimer=n;function s(X,D){try{const{protocol:v}=D?new URL(X,D):new URL(X);return v==="http:"||v==="https:"}catch{return!1}}function u(X,D=!1){return new Promise((v,L)=>{const j=document.createElement("script");j.src=X,j.onload=function($){D&&j.remove(),v($)},j.onerror=function(){L(new Error(`Cannot load script at: ${j.src}`))},(document.head||document.documentElement).appendChild(j)})}function y(X){console.log("Deprecated API usage: "+X)}let p;class M{static toDateObject(D){if(!D||!(0,t.isString)(D))return null;p||(p=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const v=p.exec(D);if(!v)return null;const L=parseInt(v[1],10);let j=parseInt(v[2],10);j=j>=1&&j<=12?j-1:0;let $=parseInt(v[3],10);$=$>=1&&$<=31?$:1;let F=parseInt(v[4],10);F=F>=0&&F<=23?F:0;let o=parseInt(v[5],10);o=o>=0&&o<=59?o:0;let e=parseInt(v[6],10);e=e>=0&&e<=59?e:0;const i=v[7]||"Z";let a=parseInt(v[8],10);a=a>=0&&a<=23?a:0;let h=parseInt(v[9],10)||0;return h=h>=0&&h<=59?h:0,i==="-"?(F+=a,o+=h):i==="+"&&(F-=a,o-=h),new Date(Date.UTC(L,j,$,F,o,e))}}r.PDFDateString=M;function k(X,{scale:D=1,rotation:v=0}){const{width:L,height:j}=X.attributes.style,$=[0,0,parseInt(L),parseInt(j)];return new N({viewBox:$,scale:D,rotation:v})}},(V,r,_)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.arrayByteLength=oe,r.arraysToBytes=ie,r.assert=$,r.bytesToString=Q,r.createObjectURL=Ue,r.createPromiseCapability=ze,r.createValidAbsoluteUrl=e,r.escapeString=Re,r.getModificationDate=Xe,r.getVerbosityLevel=D,r.info=v,r.isArrayBuffer=$e,r.isArrayEqual=Ve,r.isAscii=Ee,r.isBool=je,r.isNum=Ge,r.isSameOrigin=F,r.isString=He,r.objectFromMap=ue,r.objectSize=ae,r.removeNullCharacters=J,r.setVerbosityLevel=X,r.shadow=i,r.string32=de,r.stringToBytes=te,r.stringToPDFString=xe,r.stringToUTF16BEString=ke,r.stringToUTF8String=ge,r.unreachable=j,r.utf8StringToString=Oe,r.warn=L,r.VerbosityLevel=r.Util=r.UNSUPPORTED_FEATURES=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.StreamType=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,_(3);const t=[1,0,0,1,0,0];r.IDENTITY_MATRIX=t;const g=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=g;const x={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=x;const R={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=R;const O={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=O;const m={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=m;const d={MARKED:"Marked",REVIEW:"Review"};r.AnnotationStateModelType=d;const f={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationMarkedState=f;const E={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReviewState=E;const N={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=N;const P={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=P;const W={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=W;const c={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=c;const S={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=S;const I={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=I;const T={O:"PageOpen",C:"PageClose"};r.PageActionEventType=T;const b={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.StreamType=b;const n={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};r.FontType=n;const s={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=s;const u={NONE:0,BINARY:1,STREAM:2};r.CMapCompressionType=u;const y={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=y;const p={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent"};r.UNSUPPORTED_FEATURES=p;const M={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=M;let k=s.WARNINGS;function X(z){Number.isInteger(z)&&(k=z)}function D(){return k}function v(z){k>=s.INFOS&&console.log(`Info: ${z}`)}function L(z){k>=s.WARNINGS&&console.log(`Warning: ${z}`)}function j(z){throw new Error(z)}function $(z,q){z||j(q)}function F(z,q){let H;try{if(H=new URL(z),!H.origin||H.origin==="null")return!1}catch{return!1}const ee=new URL(q,H);return H.origin===ee.origin}function o(z){if(!z)return!1;switch(z.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function e(z,q){if(!z)return null;try{const H=q?new URL(z,q):new URL(z);if(o(H))return H}catch{}return null}function i(z,q,H){return Object.defineProperty(z,q,{value:H,enumerable:!0,configurable:!0,writable:!1}),H}const a=function(){function q(H){this.constructor===q&&j("Cannot initialize BaseException."),this.message=H,this.name=this.constructor.name}return q.prototype=new Error,q.constructor=q,q}();r.BaseException=a;class h extends a{constructor(q,H){super(q),this.code=H}}r.PasswordException=h;class l extends a{constructor(q,H){super(q),this.details=H}}r.UnknownErrorException=l;class A extends a{}r.InvalidPDFException=A;class w extends a{}r.MissingPDFException=w;class U extends a{constructor(q,H){super(q),this.status=H}}r.UnexpectedResponseException=U;class G extends a{}r.FormatError=G;class B extends a{}r.AbortException=B;const Y=/\x00/g;function J(z){return typeof z!="string"?(L("The argument for removeNullCharacters must be a string."),z):z.replace(Y,"")}function Q(z){$(z!==null&&typeof z=="object"&&z.length!==void 0,"Invalid argument for bytesToString");const q=z.length,H=8192;if(q<H)return String.fromCharCode.apply(null,z);const ee=[];for(let se=0;se<q;se+=H){const ce=Math.min(se+H,q),fe=z.subarray(se,ce);ee.push(String.fromCharCode.apply(null,fe))}return ee.join("")}function te(z){$(typeof z=="string","Invalid argument for stringToBytes");const q=z.length,H=new Uint8Array(q);for(let ee=0;ee<q;++ee)H[ee]=z.charCodeAt(ee)&255;return H}function oe(z){return z.length!==void 0?z.length:($(z.byteLength!==void 0,"arrayByteLength - invalid argument."),z.byteLength)}function ie(z){const q=z.length;if(q===1&&z[0]instanceof Uint8Array)return z[0];let H=0;for(let ce=0;ce<q;ce++)H+=oe(z[ce]);let ee=0;const se=new Uint8Array(H);for(let ce=0;ce<q;ce++){let fe=z[ce];fe instanceof Uint8Array||(typeof fe=="string"?fe=te(fe):fe=new Uint8Array(fe));const Me=fe.byteLength;se.set(fe,ee),ee+=Me}return se}function de(z){return String.fromCharCode(z>>24&255,z>>16&255,z>>8&255,z&255)}function ae(z){return Object.keys(z).length}function ue(z){const q=Object.create(null);for(const[H,ee]of z)q[H]=ee;return q}function ye(){const z=new Uint8Array(4);return z[0]=1,new Uint32Array(z.buffer,0,1)[0]===1}const ne={get value(){return i(this,"value",ye())}};r.IsLittleEndianCached=ne;function be(){try{return new Function(""),!0}catch{return!1}}const me={get value(){return i(this,"value",be())}};r.IsEvalSupportedCached=me;const Se=[...Array(256).keys()].map(z=>z.toString(16).padStart(2,"0"));class Ae{static makeHexColor(q,H,ee){return`#${Se[q]}${Se[H]}${Se[ee]}`}static transform(q,H){return[q[0]*H[0]+q[2]*H[1],q[1]*H[0]+q[3]*H[1],q[0]*H[2]+q[2]*H[3],q[1]*H[2]+q[3]*H[3],q[0]*H[4]+q[2]*H[5]+q[4],q[1]*H[4]+q[3]*H[5]+q[5]]}static applyTransform(q,H){const ee=q[0]*H[0]+q[1]*H[2]+H[4],se=q[0]*H[1]+q[1]*H[3]+H[5];return[ee,se]}static applyInverseTransform(q,H){const ee=H[0]*H[3]-H[1]*H[2],se=(q[0]*H[3]-q[1]*H[2]+H[2]*H[5]-H[4]*H[3])/ee,ce=(-q[0]*H[1]+q[1]*H[0]+H[4]*H[1]-H[5]*H[0])/ee;return[se,ce]}static getAxialAlignedBoundingBox(q,H){const ee=Ae.applyTransform(q,H),se=Ae.applyTransform(q.slice(2,4),H),ce=Ae.applyTransform([q[0],q[3]],H),fe=Ae.applyTransform([q[2],q[1]],H);return[Math.min(ee[0],se[0],ce[0],fe[0]),Math.min(ee[1],se[1],ce[1],fe[1]),Math.max(ee[0],se[0],ce[0],fe[0]),Math.max(ee[1],se[1],ce[1],fe[1])]}static inverseTransform(q){const H=q[0]*q[3]-q[1]*q[2];return[q[3]/H,-q[1]/H,-q[2]/H,q[0]/H,(q[2]*q[5]-q[4]*q[3])/H,(q[4]*q[1]-q[5]*q[0])/H]}static apply3dTransform(q,H){return[q[0]*H[0]+q[1]*H[1]+q[2]*H[2],q[3]*H[0]+q[4]*H[1]+q[5]*H[2],q[6]*H[0]+q[7]*H[1]+q[8]*H[2]]}static singularValueDecompose2dScale(q){const H=[q[0],q[2],q[1],q[3]],ee=q[0]*H[0]+q[1]*H[2],se=q[0]*H[1]+q[1]*H[3],ce=q[2]*H[0]+q[3]*H[2],fe=q[2]*H[1]+q[3]*H[3],Me=(ee+fe)/2,Le=Math.sqrt((ee+fe)**2-4*(ee*fe-ce*se))/2,De=Me+Le||1,qe=Me-Le||1;return[Math.sqrt(De),Math.sqrt(qe)]}static normalizeRect(q){const H=q.slice(0);return q[0]>q[2]&&(H[0]=q[2],H[2]=q[0]),q[1]>q[3]&&(H[1]=q[3],H[3]=q[1]),H}static intersect(q,H){function ee(Me,Le){return Me-Le}const se=[q[0],q[2],H[0],H[2]].sort(ee),ce=[q[1],q[3],H[1],H[3]].sort(ee),fe=[];if(q=Ae.normalizeRect(q),H=Ae.normalizeRect(H),se[0]===q[0]&&se[1]===H[0]||se[0]===H[0]&&se[1]===q[0])fe[0]=se[1],fe[2]=se[2];else return null;if(ce[0]===q[1]&&ce[1]===H[1]||ce[0]===H[1]&&ce[1]===q[1])fe[1]=ce[1],fe[3]=ce[2];else return null;return fe}}r.Util=Ae;const we=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function xe(z){const q=z.length,H=[];if(z[0]==="þ"&&z[1]==="ÿ")for(let ee=2;ee<q;ee+=2)H.push(String.fromCharCode(z.charCodeAt(ee)<<8|z.charCodeAt(ee+1)));else if(z[0]==="ÿ"&&z[1]==="þ")for(let ee=2;ee<q;ee+=2)H.push(String.fromCharCode(z.charCodeAt(ee+1)<<8|z.charCodeAt(ee)));else for(let ee=0;ee<q;++ee){const se=we[z.charCodeAt(ee)];H.push(se?String.fromCharCode(se):z.charAt(ee))}return H.join("")}function Re(z){return z.replace(/([()\\\n\r])/g,q=>q===` `?"\\n":q==="\r"?"\\r":`\\${q}`)}function Ee(z){return/^[\x00-\x7F]*$/.test(z)}function ke(z){const q=["þÿ"];for(let H=0,ee=z.length;H<ee;H++){const se=z.charCodeAt(H);q.push(String.fromCharCode(se>>8&255),String.fromCharCode(se&255))}return q.join("")}function ge(z){return decodeURIComponent(escape(z))}function Oe(z){return unescape(encodeURIComponent(z))}function je(z){return typeof z=="boolean"}function Ge(z){return typeof z=="number"}function He(z){return typeof z=="string"}function $e(z){return typeof z=="object"&&z!==null&&z.byteLength!==void 0}function Ve(z,q){if(z.length!==q.length)return!1;for(let H=0,ee=z.length;H<ee;H++)if(z[H]!==q[H])return!1;return!0}function Xe(z=new Date){return[z.getUTCFullYear().toString(),(z.getUTCMonth()+1).toString().padStart(2,"0"),z.getUTCDate().toString().padStart(2,"0"),z.getUTCHours().toString().padStart(2,"0"),z.getUTCMinutes().toString().padStart(2,"0"),z.getUTCSeconds().toString().padStart(2,"0")].join("")}function ze(){const z=Object.create(null);let q=!1;return Object.defineProperty(z,"settled",{get(){return q}}),z.promise=new Promise(function(H,ee){z.resolve=function(se){q=!0,H(se)},z.reject=function(se){q=!0,ee(se)}}),z}function Ue(z,q="",H=!1){if(URL.createObjectURL&&!H)return URL.createObjectURL(new Blob([z],{type:q}));const ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let se=`data:${q};base64,`;for(let ce=0,fe=z.length;ce<fe;ce+=3){const Me=z[ce]&255,Le=z[ce+1]&255,De=z[ce+2]&255,qe=Me>>2,Ye=(Me&3)<<4|Le>>4,We=ce+1<fe?(Le&15)<<2|De>>6:64,Be=ce+2<fe?De&63:64;se+=ee[qe]+ee[Ye]+ee[We]+ee[Be]}return se}},(V,r,_)=>{_(4)},(V,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isNodeJS=void 0;const _=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=_},(V,r,_)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseSVGFactory=r.BaseStandardFontDataFactory=r.BaseCMapReaderFactory=r.BaseCanvasFactory=void 0;var t=_(2);class g{constructor(){this.constructor===g&&(0,t.unreachable)("Cannot initialize BaseCanvasFactory.")}create(d,f){if(d<=0||f<=0)throw new Error("Invalid canvas size");const E=this._createCanvas(d,f);return{canvas:E,context:E.getContext("2d")}}reset(d,f,E){if(!d.canvas)throw new Error("Canvas is not specified");if(f<=0||E<=0)throw new Error("Invalid canvas size");d.canvas.width=f,d.canvas.height=E}destroy(d){if(!d.canvas)throw new Error("Canvas is not specified");d.canvas.width=0,d.canvas.height=0,d.canvas=null,d.context=null}_createCanvas(d,f){(0,t.unreachable)("Abstract method `_createCanvas` called.")}}r.BaseCanvasFactory=g;class x{constructor({baseUrl:d=null,isCompressed:f=!1}){this.constructor===x&&(0,t.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=d,this.isCompressed=f}async fetch({name:d}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!d)throw new Error("CMap name must be specified.");const f=this.baseUrl+d+(this.isCompressed?".bcmap":""),E=this.isCompressed?t.CMapCompressionType.BINARY:t.CMapCompressionType.NONE;return this._fetchData(f,E).catch(N=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${f}`)})}_fetchData(d,f){(0,t.unreachable)("Abstract method `_fetchData` called.")}}r.BaseCMapReaderFactory=x;class R{constructor({baseUrl:d=null}){this.constructor===R&&(0,t.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=d}async fetch({filename:d}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!d)throw new Error("Font filename must be specified.");const f=`${this.baseUrl}${d}`;return this._fetchData(f).catch(E=>{throw new Error(`Unable to load font data at: ${f}`)})}_fetchData(d){(0,t.unreachable)("Abstract method `_fetchData` called.")}}r.BaseStandardFontDataFactory=R;class O{constructor(){this.constructor===O&&(0,t.unreachable)("Cannot initialize BaseSVGFactory.")}create(d,f){if(d<=0||f<=0)throw new Error("Invalid SVG dimensions");const E=this._createSVG("svg:svg");return E.setAttribute("version","1.1"),E.setAttribute("width",`${d}px`),E.setAttribute("height",`${f}px`),E.setAttribute("preserveAspectRatio","none"),E.setAttribute("viewBox",`0 0 ${d} ${f}`),E}createElement(d){if(typeof d!="string")throw new Error("Invalid SVG element type");return this._createSVG(d)}_createSVG(d){(0,t.unreachable)("Abstract method `_createSVG` called.")}}r.BaseSVGFactory=O},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCMapReaderFactory=exports.DefaultCanvasFactory=exports.build=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(7),_node_utils=__w_pdfjs_require__(8),_annotation_storage=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(10),_worker_options=__w_pdfjs_require__(12),_is_node=__w_pdfjs_require__(4),_message_handler=__w_pdfjs_require__(13),_metadata=__w_pdfjs_require__(14),_optional_content_config=__w_pdfjs_require__(15),_transport_stream=__w_pdfjs_require__(16);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultStandardFontDataFactory=_is_node.isNodeJS?_node_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;let createPDFNetworkStream;function setPDFNetworkStreamFactory(V){createPDFNetworkStream=V}function getDocument(V){const r=new PDFDocumentLoadingTask;let _;if(typeof V=="string"||V instanceof URL)_={url:V};else if((0,_util.isArrayBuffer)(V))_={data:V};else if(V instanceof PDFDataRangeTransport)_={range:V};else{if(typeof V!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!V.url&&!V.data&&!V.range)throw new Error("Invalid parameter object: need either .data, .range or .url");_=V}const t=Object.create(null);let g=null,x=null;for(const O in _){const m=_[O];switch(O){case"url":if(typeof window<"u")try{t[O]=new URL(m,window.location).href;continue}catch(d){(0,_util.warn)(`Cannot create valid URL: "${d}".`)}else if(typeof m=="string"||m instanceof URL){t[O]=m.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":g=m;continue;case"worker":x=m;continue;case"data":if(_is_node.isNodeJS&&typeof Buffer<"u"&&m instanceof Buffer)t[O]=new Uint8Array(m);else{if(m instanceof Uint8Array)break;if(typeof m=="string")t[O]=(0,_util.stringToBytes)(m);else if(typeof m=="object"&&m!==null&&!isNaN(m.length))t[O]=new Uint8Array(m);else if((0,_util.isArrayBuffer)(m))t[O]=new Uint8Array(m);else throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.")}continue}t[O]=m}if(t.rangeChunkSize=t.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,t.CMapReaderFactory=t.CMapReaderFactory||DefaultCMapReaderFactory,t.StandardFontDataFactory=t.StandardFontDataFactory||DefaultStandardFontDataFactory,t.ignoreErrors=t.stopAtErrors!==!0,t.fontExtraProperties=t.fontExtraProperties===!0,t.pdfBug=t.pdfBug===!0,t.enableXfa=t.enableXfa===!0,(typeof t.docBaseUrl!="string"||(0,_display_utils.isDataScheme)(t.docBaseUrl))&&(t.docBaseUrl=null),Number.isInteger(t.maxImageSize)||(t.maxImageSize=-1),typeof t.useWorkerFetch!="boolean"&&(t.useWorkerFetch=t.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&t.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),typeof t.isEvalSupported!="boolean"&&(t.isEvalSupported=!0),typeof t.disableFontFace!="boolean"&&(t.disableFontFace=_is_node.isNodeJS),typeof t.useSystemFonts!="boolean"&&(t.useSystemFonts=!_is_node.isNodeJS&&!t.disableFontFace),typeof t.ownerDocument>"u"&&(t.ownerDocument=globalThis.document),typeof t.disableRange!="boolean"&&(t.disableRange=!1),typeof t.disableStream!="boolean"&&(t.disableStream=!1),typeof t.disableAutoFetch!="boolean"&&(t.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(t.verbosity),!x){const O={verbosity:t.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};x=O.port?PDFWorker.fromPort(O):new PDFWorker(O),r._worker=x}const R=r.docId;return x.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");const O=_fetchDocument(x,t,g,R),m=new Promise(function(d){let f;g?f=new _transport_stream.PDFDataTransportStream({length:t.length,initialData:t.initialData,progressiveDone:t.progressiveDone,contentDispositionFilename:t.contentDispositionFilename,disableRange:t.disableRange,disableStream:t.disableStream},g):t.data||(f=createPDFNetworkStream({url:t.url,length:t.length,httpHeaders:t.httpHeaders,withCredentials:t.withCredentials,rangeChunkSize:t.rangeChunkSize,disableRange:t.disableRange,disableStream:t.disableStream})),d(f)});return Promise.all([O,m]).then(function([d,f]){if(r.destroyed)throw new Error("Loading aborted");const E=new _message_handler.MessageHandler(R,d,x.port);E.postMessageTransfers=x.postMessageTransfers;const N=new WorkerTransport(E,r,f,t);r._transport=N,E.send("Ready",null)})}).catch(r._capability.reject),r}function _fetchDocument(V,r,_,t){return V.destroyed?Promise.reject(new Error("Worker was destroyed")):(_&&(r.length=_.length,r.initialData=_.initialData,r.progressiveDone=_.progressiveDone,r.contentDispositionFilename=_.contentDispositionFilename),V.messageHandler.sendWithPromise("GetDocRequest",{docId:t,apiVersion:"2.10.377",source:{data:r.data,url:r.url,password:r.password,disableAutoFetch:r.disableAutoFetch,rangeChunkSize:r.rangeChunkSize,length:r.length},maxImageSize:r.maxImageSize,disableFontFace:r.disableFontFace,postMessageTransfers:V.postMessageTransfers,docBaseUrl:r.docBaseUrl,ignoreErrors:r.ignoreErrors,isEvalSupported:r.isEvalSupported,fontExtraProperties:r.fontExtraProperties,enableXfa:r.enableXfa,useSystemFonts:r.useSystemFonts,cMapUrl:r.useWorkerFetch?r.cMapUrl:null,standardFontDataUrl:r.useWorkerFetch?r.standardFontDataUrl:null}).then(function(g){if(V.destroyed)throw new Error("Worker was destroyed");return g}))}const PDFDocumentLoadingTask=function(){let r=0;class _{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+r++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then(()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}}return _}();class PDFDataRangeTransport{constructor(r,_,t=!1,g=null){this.length=r,this.initialData=_,this.progressiveDone=t,this.contentDispositionFilename=g,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(r){this._rangeListeners.push(r)}addProgressListener(r){this._progressListeners.push(r)}addProgressiveReadListener(r){this._progressiveReadListeners.push(r)}addProgressiveDoneListener(r){this._progressiveDoneListeners.push(r)}onDataRange(r,_){for(const t of this._rangeListeners)t(r,_)}onDataProgress(r,_){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(r,_)})}onDataProgressiveRead(r){this._readyCapability.promise.then(()=>{for(const _ of this._progressiveReadListeners)_(r)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const r of this._progressiveDoneListeners)r()})}transportReady(){this._readyCapability.resolve()}requestDataRange(r,_){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(r,_){this._pdfInfo=r,this._transport=_,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(r){return this._transport.getPage(r)}getPageIndex(r){return this._transport.getPageIndex(r)}getDestinations(){return this._transport.getDestinations()}getDestination(r){return this._transport.getDestination(r)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(r=!1){return this._transport.startCleanup(r||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(r,_,t,g,x=!1){this._pageIndex=r,this._pageInfo=_,this._ownerDocument=g,this._transport=t,this._stats=