@gamelearn/arcade-components 3.9.1 → 3.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ Check the render method of \``+ge+"`."}return""}}function Ie(ge){{if(ge!==void 0
24
24
 
25
25
  Check your code at `+He+":"+Je+"."}return""}}var nt={};function bt(ge){{var He=Be();if(!He){var Je=typeof ge=="string"?ge:ge.displayName||ge.name;Je&&(He=`
26
26
 
27
- Check the top-level render call using <`+Je+">.")}return He}}function st(ge,He){{if(!ge._store||ge._store.validated||ge.key!=null)return;ge._store.validated=!0;var Je=bt(He);if(nt[Je])return;nt[Je]=!0;var St="";ge&&ge._owner&&ge._owner!==jt.current&&(St=" It was passed a child from "+H(ge._owner.type)+"."),dt(ge),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Je,St),dt(null)}}function It(ge,He){{if(typeof ge!="object")return;if(ht(ge))for(var Je=0;Je<ge.length;Je++){var St=ge[Je];Wr(St)&&st(St,He)}else if(Wr(ge))ge._store&&(ge._store.validated=!0);else if(ge){var qt=x(ge);if(typeof qt=="function"&&qt!==ge.entries)for(var Ht=qt.call(ge),Ut;!(Ut=Ht.next()).done;)Wr(Ut.value)&&st(Ut.value,He)}}}function ir(ge){{var He=ge.type;if(He==null||typeof He=="string")return;var Je;if(typeof He=="function")Je=He.propTypes;else if(typeof He=="object"&&(He.$$typeof===f||He.$$typeof===y))Je=He.propTypes;else return;if(Je){var St=H(He);yt(Je,ge.props,"prop",St,ge)}else if(He.PropTypes!==void 0&&!vr){vr=!0;var qt=H(He);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",qt||"Unknown")}typeof He.getDefaultProps=="function"&&!He.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yr(ge){{for(var He=Object.keys(ge.props),Je=0;Je<He.length;Je++){var St=He[Je];if(St!=="children"&&St!=="key"){dt(ge),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",St),dt(null);break}}ge.ref!==null&&(dt(ge),R("Invalid attribute `ref` supplied to `React.Fragment`."),dt(null))}}function $i(ge,He,Je,St,qt,Ht){{var Ut=D(ge);if(!Ut){var $t="";(ge===void 0||typeof ge=="object"&&ge!==null&&Object.keys(ge).length===0)&&($t+=" 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 Cr=Ie(qt);Cr?$t+=Cr:$t+=Be();var fr;ge===null?fr="null":ht(ge)?fr="array":ge!==void 0&&ge.$$typeof===e?(fr="<"+(H(ge.type)||"Unknown")+" />",$t=" Did you accidentally export a JSX literal instead of a component?"):fr=typeof ge,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fr,$t)}var hr=ze(ge,He,Je,qt,Ht);if(hr==null)return hr;if(Ut){var Rr=He.children;if(Rr!==void 0)if(St)if(ht(Rr)){for(var ua=0;ua<Rr.length;ua++)It(Rr[ua],ge);Object.freeze&&Object.freeze(Rr)}else R("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 It(Rr,ge)}return ge===t?Yr(hr):ir(hr),hr}}function ja(ge,He,Je){return $i(ge,He,Je,!0)}function la(ge,He,Je){return $i(ge,He,Je,!1)}var Ui=la,kr=ja;reactJsxRuntime_development.Fragment=t,reactJsxRuntime_development.jsx=Ui,reactJsxRuntime_development.jsxs=kr}()),reactJsxRuntime_development}process.env.NODE_ENV==="production"?jsxRuntime.exports=requireReactJsxRuntime_production_min():jsxRuntime.exports=requireReactJsxRuntime_development();var jsxRuntimeExports=jsxRuntime.exports;const useTimeout=()=>{const o=React$2.useRef(),e=(t,n)=>{o.current=setTimeout(t,n)},r=()=>{o.current&&clearTimeout(o.current)};return React$2.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{start:e,stop:r,running:!!o.current}},LangIsRtl=()=>{const o=["ar","fa","he","ku","ur"],e=document.querySelector("html").getAttribute("lang");return!!o.includes(e)};function NoticeComponent({title:o,text:e,buttonText:r,emitEvent:t,soundActions:n,keyboardControl:a,styles:l,autoEnd:u}){const[f]=n,{start:c,stop:h}=useTimeout(),y=75,E=React$2.useCallback(()=>{f("click-ui"),t({type:"success"})},[t,f]);return React$2.useEffect(()=>{if(u){const g=y*((e.length||0)+(o.length||0));c(E,g<4e3?4e3:g)}return()=>{h()}},[u,E,c,h,e]),a(null,E,E),jsxRuntimeExports.jsx("div",{className:`notice--layer notice--layer--${l}`,children:jsxRuntimeExports.jsxs("div",{className:`notice notice--${l}`,children:[jsxRuntimeExports.jsxs("div",{className:"notice--head__title--wrapper",children:[["classic","futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title",children:o}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part2"}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part3"})]}),jsxRuntimeExports.jsxs("div",{className:"notice--info",children:[["notification-light","notification-dark","minimalist"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--info__title",children:o}),jsxRuntimeExports.jsxs("div",{className:"notice--info__item",children:[jsxRuntimeExports.jsx("span",{className:"notice--info__text",style:{whiteSpace:"pre-line"},children:e}),["classic"].includes(l)?jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",onClick:E,type:"button",children:r}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:E,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})]})})}NoticeComponent.defaultProps={title:"",buttonText:"X",color:"#CCC",text:"",context:{},styles:"classic",autoEnd:!1};new three.Vector3(1,0,0);new three.Vector3(0,1,0);new three.Vector3(0,0,1);const bones=["Jaw_M","Head_M","L_lip_jnt","L_lip","L_lip_grp","HeadEnd_M","Neck_M","NeckPart1","NeckPart1_M","R_lip_jnt","R_lip","R_lip_grp","lowerTeeths","upperTeeths","tongue","joint4","transform1"],BASIC_ACTIONS_TYPES_WHITELIST=["61408041e917240012e96b17","61407ff1e917240012e96a8a","6140701be917240012e7fdc6","61407ffbe917240012e96a90","6140802ce917240012e96b11","61408008e917240012e96af4","61408012e917240012e96afd","6140801be917240012e96b00","632abcddbfc7ee0012ec45a0","66694b97bacee052f121d446","5dc2812707659c3aa49dbed1","61408037e917240012e96b14","622a11e69fce97001284ffb6"],objectFit=new three.Box3,targetSize=new three.Vector3,targetCenter=new three.Vector3,getCurrentVisible=(o,e)=>{if(!o)return null;let r;return e.traverseVisible(t=>{t.uid===o&&!r&&(r=t)}),r},cameraFitAnyObject=(o,e,r=null,t=null)=>{e.updateMatrixWorld(),o.updateMatrixWorld(!0);const n=e.clone(),a=r||1.25;objectFit.setFromObject(o),objectFit.getCenter(targetCenter);const l=new three.Vector3(0,targetCenter.y,0);objectFit.getSize(targetSize);const u=Math.max(targetSize.x,targetSize.y,targetSize.z),f=n.fov*(Math.PI/180);let c=Math.abs(u*Math.sqrt(2)/2*Math.tan(f*2));c*=a;const h=new three.Vector3;h.setFromMatrixPosition(o.matrixWorld);const E=new three.Vector3(1,1,1).normalize();n.position.copy(E.multiplyScalar(c)),n.lookAt(h);const g=objectFit.min.z,_=g<0?-g+c:c-g;return n.far=_*3,n.near=.01,n.updateProjectionMatrix(),n.lookAt(l),t&&(t.target=l,t.maxDistance=_*2,t.saveState()),e.copy(n),null},mixWithTalkingClip=(o,e)=>{const r=o.clone(),t=e.clone(),n=l=>bones.find(u=>l.name.toLowerCase().includes(u.toLowerCase())),a=r.tracks.filter(n);return t.tracks=t.tracks.filter(l=>!n(l)),t.tracks.push(...a),t.resetDuration(),t.name+="_talking",t.duration>4?three.AnimationUtils.subclip(t,t.name,0,120,30):t};function LightSet(){return jsxRuntimeExports.jsxs("group",{children:[jsxRuntimeExports.jsx("pointLight",{position:[-2.29,17.35,2.56],color:16773785,intensity:12,power:150,distance:0,decay:1,castShadow:!0,"shadow-bias":-.002}),jsxRuntimeExports.jsx("pointLight",{position:[2.25,16.57,-1.9],color:4234239,intensity:20,power:250,distance:0,decay:1,"shadow-bias":-.002}),jsxRuntimeExports.jsx("hemisphereLight",{color:7918828,groundColor:7429837,intensity:4,position:[0,500,0]})]})}function Item$1(o){const e=fiber.useThree(n=>n.controls),r=fiber.useThree(n=>n.camera),t=n=>{n&&e&&(n.updateMatrixWorld(!0),n.position.set(0,0,0),r.position.z+=10,r.fov=35,r.updateProjectionMatrix(),cameraFitAnyObject(n,r,null,e))};return jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{...o,onLoad:t})}function InventoryItem({name:o,description:e,element:r,onFinish:t,soundActions:n,keyboardControl:a,emitEvent:l}){const[u]=n,f=h=>l({type:"translate",payload:h});if(!r)return t(),null;const c=()=>{u("click-ui"),t()};return a&&a(null,c,c),jsxRuntimeExports.jsx("div",{className:"inventory--layer__info",dir:"auto",children:jsxRuntimeExports.jsxs("div",{className:`inventory-popup fadeIn--animation ${e?"inventory-popup--withdescription":""}`,children:[jsxRuntimeExports.jsx("button",{type:"button","aria-label":f("inventory.closeDetail"),className:"inventory-popup__close",onClick:()=>{c()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})}),jsxRuntimeExports.jsx("h2",{className:"inventory-popup__title",children:o}),e&&jsxRuntimeExports.jsx("div",{tabIndex:"0",className:"inventory-popup__description",children:e}),jsxRuntimeExports.jsx("div",{className:"inventory-popup__image",children:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{fullscreen:!1,gl:{alpha:!0},onCreated:({gl:h})=>{h.setClearColor(16777215)},style:{height:"100%"},children:[jsxRuntimeExports.jsx(drei.OrbitControls,{makeDefault:!0,enableKeys:!1,enableZoom:!1,enablePan:!1}),jsxRuntimeExports.jsxs(React$2.Suspense,{fallback:null,children:[jsxRuntimeExports.jsx(LightSet,{}),jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:"divideby16",children:jsxRuntimeExports.jsx(Item$1,{url:r.url,position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],material:r.material||{},name:r.name},`${r.uid}`)})]})]})})]})})}function commonjsRequire(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$4=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(e,r){module.exports=r()})(commonjsGlobal,function(){return function(o){var e={};function r(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return o[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=o,r.c=e,r.d=function(t,n,a){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:a})},r.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(n&1&&(t=r(t)),n&8||n&4&&typeof t=="object"&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),n&2&&typeof t!="string")for(var l in t)r.d(a,l,(function(u){return t[u]}).bind(null,l));return a},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=0)}([function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return t.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return t.getFilenameFromUrl}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return t.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return t.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return t.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return t.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return a.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return a.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return a.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return a.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return a.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return a.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return a.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return a.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return a.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return a.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return a.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return a.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return a.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return a.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return a.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return l.AnnotationLayer}}),Object.defineProperty(e,"apiCompatibilityParams",{enumerable:!0,get:function(){return u.apiCompatibilityParams}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return f.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}});var t=r(1),n=r(5),a=r(2),l=r(16),u=r(7),f=r(10),c=r(17),h=r(18);{const{isNodeJS:y}=r(4);if(y){const E=r(19).PDFNodeStream;(0,n.setPDFNetworkStreamFactory)(g=>new E(g))}else{const E=r(22).PDFNetworkStream;let g;(0,t.isFetchSupported)()&&(g=r(23).PDFFetchStream),(0,n.setPDFNetworkStreamFactory)(_=>g&&(0,t.isValidFetchUrl)(_.url)?new g(_):new E(_))}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.addLinkAttributes=E,e.getFilenameFromUrl=g,e.isFetchSupported=p,e.isValidFetchUrl=x,e.loadScript=C,e.deprecated=R,e.PDFDateString=e.StatTimer=e.DOMSVGFactory=e.DOMCMapReaderFactory=e.DOMCanvasFactory=e.DEFAULT_LINK_REL=e.LinkTarget=e.RenderingCancelledException=e.PageViewport=void 0;var t=r(2);const n="noopener noreferrer nofollow";e.DEFAULT_LINK_REL=n;const a="http://www.w3.org/2000/svg";class l{create(P,w){if(P<=0||w<=0)throw new Error("Invalid canvas size");const O=document.createElement("canvas"),k=O.getContext("2d");return O.width=P,O.height=w,{canvas:O,context:k}}reset(P,w,O){if(!P.canvas)throw new Error("Canvas is not specified");if(w<=0||O<=0)throw new Error("Invalid canvas size");P.canvas.width=w,P.canvas.height=O}destroy(P){if(!P.canvas)throw new Error("Canvas is not specified");P.canvas.width=0,P.canvas.height=0,P.canvas=null,P.context=null}}e.DOMCanvasFactory=l;class u{constructor({baseUrl:P=null,isCompressed:w=!1}){this.baseUrl=P,this.isCompressed=w}async fetch({name:P}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!P)throw new Error("CMap name must be specified.");const w=this.baseUrl+P+(this.isCompressed?".bcmap":""),O=this.isCompressed?t.CMapCompressionType.BINARY:t.CMapCompressionType.NONE;return p()&&x(w,document.baseURI)?fetch(w).then(async k=>{if(!k.ok)throw new Error(k.statusText);let D;return this.isCompressed?D=new Uint8Array(await k.arrayBuffer()):D=(0,t.stringToBytes)(await k.text()),{cMapData:D,compressionType:O}}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${w}`)}):new Promise((k,D)=>{const F=new XMLHttpRequest;F.open("GET",w,!0),this.isCompressed&&(F.responseType="arraybuffer"),F.onreadystatechange=()=>{if(F.readyState===XMLHttpRequest.DONE){if(F.status===200||F.status===0){let U;if(this.isCompressed&&F.response?U=new Uint8Array(F.response):!this.isCompressed&&F.responseText&&(U=(0,t.stringToBytes)(F.responseText)),U){k({cMapData:U,compressionType:O});return}}D(new Error(F.statusText))}},F.send(null)}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${w}`)})}}e.DOMCMapReaderFactory=u;class f{create(P,w){(0,t.assert)(P>0&&w>0,"Invalid SVG dimensions");const O=document.createElementNS(a,"svg:svg");return O.setAttribute("version","1.1"),O.setAttribute("width",P+"px"),O.setAttribute("height",w+"px"),O.setAttribute("preserveAspectRatio","none"),O.setAttribute("viewBox","0 0 "+P+" "+w),O}createElement(P){return(0,t.assert)(typeof P=="string","Invalid SVG element type"),document.createElementNS(a,P)}}e.DOMSVGFactory=f;class c{constructor({viewBox:P,scale:w,rotation:O,offsetX:k=0,offsetY:D=0,dontFlip:F=!1}){this.viewBox=P,this.scale=w,this.rotation=O,this.offsetX=k,this.offsetY=D;const U=(P[2]+P[0])/2,H=(P[3]+P[1])/2;let W,ee,q,B;switch(O=O%360,O=O<0?O+360:O,O){case 180:W=-1,ee=0,q=0,B=1;break;case 90:W=0,ee=1,q=1,B=0;break;case 270:W=0,ee=-1,q=-1,B=0;break;case 0:W=1,ee=0,q=0,B=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}F&&(q=-q,B=-B);let G,I,$,V;W===0?(G=Math.abs(H-P[1])*w+k,I=Math.abs(U-P[0])*w+D,$=Math.abs(P[3]-P[1])*w,V=Math.abs(P[2]-P[0])*w):(G=Math.abs(U-P[0])*w+k,I=Math.abs(H-P[1])*w+D,$=Math.abs(P[2]-P[0])*w,V=Math.abs(P[3]-P[1])*w),this.transform=[W*w,ee*w,q*w,B*w,G-W*w*U-q*w*H,I-ee*w*U-B*w*H],this.width=$,this.height=V}clone({scale:P=this.scale,rotation:w=this.rotation,offsetX:O=this.offsetX,offsetY:k=this.offsetY,dontFlip:D=!1}={}){return new c({viewBox:this.viewBox.slice(),scale:P,rotation:w,offsetX:O,offsetY:k,dontFlip:D})}convertToViewportPoint(P,w){return t.Util.applyTransform([P,w],this.transform)}convertToViewportRectangle(P){const w=t.Util.applyTransform([P[0],P[1]],this.transform),O=t.Util.applyTransform([P[2],P[3]],this.transform);return[w[0],w[1],O[0],O[1]]}convertToPdfPoint(P,w){return t.Util.applyInverseTransform([P,w],this.transform)}}e.PageViewport=c;class h extends t.BaseException{constructor(P,w){super(P),this.type=w}}e.RenderingCancelledException=h;const y={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};e.LinkTarget=y;function E(T,{url:P,target:w,rel:O,enabled:k=!0}={}){(0,t.assert)(P&&typeof P=="string",'addLinkAttributes: A valid "url" parameter must provided.');const D=(0,t.removeNullCharacters)(P);k?T.href=T.title=D:(T.href="",T.title=`Disabled: ${D}`,T.onclick=()=>!1);let F="";switch(w){case y.NONE:break;case y.SELF:F="_self";break;case y.BLANK:F="_blank";break;case y.PARENT:F="_parent";break;case y.TOP:F="_top";break}T.target=F,T.rel=typeof O=="string"?O:n}function g(T){const P=T.indexOf("#"),w=T.indexOf("?"),O=Math.min(P>0?P:T.length,w>0?w:T.length);return T.substring(T.lastIndexOf("/",O)+1,O)}class _{constructor(){this.started=Object.create(null),this.times=[]}time(P){P in this.started&&(0,t.warn)(`Timer is already running for ${P}`),this.started[P]=Date.now()}timeEnd(P){P in this.started||(0,t.warn)(`Timer has not been started for ${P}`),this.times.push({name:P,start:this.started[P],end:Date.now()}),delete this.started[P]}toString(){const P=[];let w=0;for(const O of this.times){const k=O.name;k.length>w&&(w=k.length)}for(const O of this.times){const k=O.end-O.start;P.push(`${O.name.padEnd(w)} ${k}ms
27
+ Check the top-level render call using <`+Je+">.")}return He}}function st(ge,He){{if(!ge._store||ge._store.validated||ge.key!=null)return;ge._store.validated=!0;var Je=bt(He);if(nt[Je])return;nt[Je]=!0;var St="";ge&&ge._owner&&ge._owner!==jt.current&&(St=" It was passed a child from "+H(ge._owner.type)+"."),dt(ge),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Je,St),dt(null)}}function It(ge,He){{if(typeof ge!="object")return;if(ht(ge))for(var Je=0;Je<ge.length;Je++){var St=ge[Je];Wr(St)&&st(St,He)}else if(Wr(ge))ge._store&&(ge._store.validated=!0);else if(ge){var qt=x(ge);if(typeof qt=="function"&&qt!==ge.entries)for(var Ht=qt.call(ge),Ut;!(Ut=Ht.next()).done;)Wr(Ut.value)&&st(Ut.value,He)}}}function ir(ge){{var He=ge.type;if(He==null||typeof He=="string")return;var Je;if(typeof He=="function")Je=He.propTypes;else if(typeof He=="object"&&(He.$$typeof===f||He.$$typeof===y))Je=He.propTypes;else return;if(Je){var St=H(He);yt(Je,ge.props,"prop",St,ge)}else if(He.PropTypes!==void 0&&!vr){vr=!0;var qt=H(He);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",qt||"Unknown")}typeof He.getDefaultProps=="function"&&!He.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yr(ge){{for(var He=Object.keys(ge.props),Je=0;Je<He.length;Je++){var St=He[Je];if(St!=="children"&&St!=="key"){dt(ge),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",St),dt(null);break}}ge.ref!==null&&(dt(ge),R("Invalid attribute `ref` supplied to `React.Fragment`."),dt(null))}}function $i(ge,He,Je,St,qt,Ht){{var Ut=D(ge);if(!Ut){var $t="";(ge===void 0||typeof ge=="object"&&ge!==null&&Object.keys(ge).length===0)&&($t+=" 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 Cr=Ie(qt);Cr?$t+=Cr:$t+=Be();var fr;ge===null?fr="null":ht(ge)?fr="array":ge!==void 0&&ge.$$typeof===e?(fr="<"+(H(ge.type)||"Unknown")+" />",$t=" Did you accidentally export a JSX literal instead of a component?"):fr=typeof ge,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fr,$t)}var hr=ze(ge,He,Je,qt,Ht);if(hr==null)return hr;if(Ut){var Rr=He.children;if(Rr!==void 0)if(St)if(ht(Rr)){for(var ua=0;ua<Rr.length;ua++)It(Rr[ua],ge);Object.freeze&&Object.freeze(Rr)}else R("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 It(Rr,ge)}return ge===t?Yr(hr):ir(hr),hr}}function ja(ge,He,Je){return $i(ge,He,Je,!0)}function la(ge,He,Je){return $i(ge,He,Je,!1)}var Ui=la,kr=ja;reactJsxRuntime_development.Fragment=t,reactJsxRuntime_development.jsx=Ui,reactJsxRuntime_development.jsxs=kr}()),reactJsxRuntime_development}process.env.NODE_ENV==="production"?jsxRuntime.exports=requireReactJsxRuntime_production_min():jsxRuntime.exports=requireReactJsxRuntime_development();var jsxRuntimeExports=jsxRuntime.exports;const useTimeout=()=>{const o=React$2.useRef(),e=(t,n)=>{o.current=setTimeout(t,n)},r=()=>{o.current&&clearTimeout(o.current)};return React$2.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{start:e,stop:r,running:!!o.current}},LangIsRtl=()=>{const o=["ar","fa","he","ku","ur"],e=document.querySelector("html").getAttribute("lang");return!!o.includes(e)};function NoticeComponent({title:o,text:e,buttonText:r,emitEvent:t,soundActions:n,keyboardControl:a,styles:l,autoEnd:u}){const[f]=n,{start:c,stop:h}=useTimeout(),y=75,E=React$2.useCallback(()=>{f("click-ui"),t({type:"success"})},[t,f]);return React$2.useEffect(()=>{if(u){const g=y*((e.length||0)+(o.length||0));c(E,g<4e3?4e3:g)}return()=>{h()}},[u,E,c,h,e]),a(null,E,E),jsxRuntimeExports.jsx("div",{className:`notice--layer notice--layer--${l}`,children:jsxRuntimeExports.jsxs("div",{className:`notice notice--${l}`,children:[jsxRuntimeExports.jsxs("div",{className:"notice--head__title--wrapper",children:[["classic","futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title",children:o}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part2"}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part3"})]}),jsxRuntimeExports.jsxs("div",{className:"notice--info",children:[["notification-light","notification-dark","minimalist"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--info__title",children:o}),jsxRuntimeExports.jsxs("div",{className:"notice--info__item",children:[jsxRuntimeExports.jsx("span",{className:"notice--info__text",style:{whiteSpace:"pre-line"},children:e}),["classic"].includes(l)?jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",onClick:E,type:"button",children:r}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:E,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})]})})}NoticeComponent.defaultProps={title:"",buttonText:"X",color:"#CCC",text:"",context:{},styles:"classic",autoEnd:!1};new three.Vector3(1,0,0);new three.Vector3(0,1,0);new three.Vector3(0,0,1);const bones=["Jaw_M","L_lip_jnt","R_lip_jnt","R_LowerLid_jnt","L_LowerLid_jnt","L_UpperLid_jnt","L_outerEyebrow_jnt","R_UpperLid_jnt","L_innerEyebrow_jnt","L_innerEyebrow_jnt1","L_outerEyebrow_jnt1"],BASIC_ACTIONS_TYPES_WHITELIST=["61408041e917240012e96b17","61407ff1e917240012e96a8a","6140701be917240012e7fdc6","61407ffbe917240012e96a90","6140802ce917240012e96b11","61408008e917240012e96af4","61408012e917240012e96afd","6140801be917240012e96b00","632abcddbfc7ee0012ec45a0","66694b97bacee052f121d446","5dc2812707659c3aa49dbed1","61408037e917240012e96b14","622a11e69fce97001284ffb6"],objectFit=new three.Box3,targetSize=new three.Vector3,targetCenter=new three.Vector3,getCurrentVisible=(o,e)=>{if(!o)return null;let r;return e.traverseVisible(t=>{t.uid===o&&!r&&(r=t)}),r},cameraFitAnyObject=(o,e,r=null,t=null)=>{e.updateMatrixWorld(),o.updateMatrixWorld(!0);const n=e.clone(),a=r||1.25;objectFit.setFromObject(o),objectFit.getCenter(targetCenter);const l=new three.Vector3(0,targetCenter.y,0);objectFit.getSize(targetSize);const u=Math.max(targetSize.x,targetSize.y,targetSize.z),f=n.fov*(Math.PI/180);let c=Math.abs(u*Math.sqrt(2)/2*Math.tan(f*2));c*=a;const h=new three.Vector3;h.setFromMatrixPosition(o.matrixWorld);const E=new three.Vector3(1,1,1).normalize();n.position.copy(E.multiplyScalar(c)),n.lookAt(h);const g=objectFit.min.z,_=g<0?-g+c:c-g;return n.far=_*3,n.near=.01,n.updateProjectionMatrix(),n.lookAt(l),t&&(t.target=l,t.maxDistance=_*2,t.saveState()),e.copy(n),null},mixWithTalkingClip=(o,e)=>{const r=o.clone(),t=e.clone(),n=l=>bones.find(u=>l.name.toLowerCase().includes(u.toLowerCase())),a=r.tracks.filter(n);return t.tracks=t.tracks.filter(l=>!n(l)),t.tracks.push(...a),t.resetDuration(),t.name+="_talking",t.duration>4?three.AnimationUtils.subclip(t,t.name,0,120,30):t};function LightSet(){return jsxRuntimeExports.jsxs("group",{children:[jsxRuntimeExports.jsx("pointLight",{position:[-2.29,17.35,2.56],color:16773785,intensity:12,power:150,distance:0,decay:1,castShadow:!0,"shadow-bias":-.002}),jsxRuntimeExports.jsx("pointLight",{position:[2.25,16.57,-1.9],color:4234239,intensity:20,power:250,distance:0,decay:1,"shadow-bias":-.002}),jsxRuntimeExports.jsx("hemisphereLight",{color:7918828,groundColor:7429837,intensity:4,position:[0,500,0]})]})}function Item$1(o){const e=fiber.useThree(n=>n.controls),r=fiber.useThree(n=>n.camera),t=n=>{n&&e&&(n.updateMatrixWorld(!0),n.position.set(0,0,0),r.position.z+=10,r.fov=35,r.updateProjectionMatrix(),cameraFitAnyObject(n,r,null,e))};return jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{...o,onLoad:t})}function InventoryItem({name:o,description:e,element:r,onFinish:t,soundActions:n,keyboardControl:a,emitEvent:l}){const[u]=n,f=h=>l({type:"translate",payload:h});if(!r)return t(),null;const c=()=>{u("click-ui"),t()};return a&&a(null,c,c),jsxRuntimeExports.jsx("div",{className:"inventory--layer__info",dir:"auto",children:jsxRuntimeExports.jsxs("div",{className:`inventory-popup fadeIn--animation ${e?"inventory-popup--withdescription":""}`,children:[jsxRuntimeExports.jsx("button",{type:"button","aria-label":f("inventory.closeDetail"),className:"inventory-popup__close",onClick:()=>{c()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})}),jsxRuntimeExports.jsx("h2",{className:"inventory-popup__title",children:o}),e&&jsxRuntimeExports.jsx("div",{tabIndex:"0",className:"inventory-popup__description",children:e}),jsxRuntimeExports.jsx("div",{className:"inventory-popup__image",children:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{fullscreen:!1,gl:{alpha:!0},onCreated:({gl:h})=>{h.setClearColor(16777215)},style:{height:"100%"},children:[jsxRuntimeExports.jsx(drei.OrbitControls,{makeDefault:!0,enableKeys:!1,enableZoom:!1,enablePan:!1}),jsxRuntimeExports.jsxs(React$2.Suspense,{fallback:null,children:[jsxRuntimeExports.jsx(LightSet,{}),jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:"divideby16",children:jsxRuntimeExports.jsx(Item$1,{url:r.url,position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],material:r.material||{},name:r.name},`${r.uid}`)})]})]})})]})})}function commonjsRequire(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$4=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(e,r){module.exports=r()})(commonjsGlobal,function(){return function(o){var e={};function r(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return o[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=o,r.c=e,r.d=function(t,n,a){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:a})},r.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(n&1&&(t=r(t)),n&8||n&4&&typeof t=="object"&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),n&2&&typeof t!="string")for(var l in t)r.d(a,l,(function(u){return t[u]}).bind(null,l));return a},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=0)}([function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return t.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return t.getFilenameFromUrl}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return t.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return t.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return t.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return t.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return a.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return a.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return a.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return a.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return a.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return a.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return a.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return a.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return a.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return a.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return a.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return a.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return a.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return a.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return a.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return l.AnnotationLayer}}),Object.defineProperty(e,"apiCompatibilityParams",{enumerable:!0,get:function(){return u.apiCompatibilityParams}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return f.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}});var t=r(1),n=r(5),a=r(2),l=r(16),u=r(7),f=r(10),c=r(17),h=r(18);{const{isNodeJS:y}=r(4);if(y){const E=r(19).PDFNodeStream;(0,n.setPDFNetworkStreamFactory)(g=>new E(g))}else{const E=r(22).PDFNetworkStream;let g;(0,t.isFetchSupported)()&&(g=r(23).PDFFetchStream),(0,n.setPDFNetworkStreamFactory)(_=>g&&(0,t.isValidFetchUrl)(_.url)?new g(_):new E(_))}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.addLinkAttributes=E,e.getFilenameFromUrl=g,e.isFetchSupported=p,e.isValidFetchUrl=x,e.loadScript=C,e.deprecated=R,e.PDFDateString=e.StatTimer=e.DOMSVGFactory=e.DOMCMapReaderFactory=e.DOMCanvasFactory=e.DEFAULT_LINK_REL=e.LinkTarget=e.RenderingCancelledException=e.PageViewport=void 0;var t=r(2);const n="noopener noreferrer nofollow";e.DEFAULT_LINK_REL=n;const a="http://www.w3.org/2000/svg";class l{create(P,w){if(P<=0||w<=0)throw new Error("Invalid canvas size");const O=document.createElement("canvas"),k=O.getContext("2d");return O.width=P,O.height=w,{canvas:O,context:k}}reset(P,w,O){if(!P.canvas)throw new Error("Canvas is not specified");if(w<=0||O<=0)throw new Error("Invalid canvas size");P.canvas.width=w,P.canvas.height=O}destroy(P){if(!P.canvas)throw new Error("Canvas is not specified");P.canvas.width=0,P.canvas.height=0,P.canvas=null,P.context=null}}e.DOMCanvasFactory=l;class u{constructor({baseUrl:P=null,isCompressed:w=!1}){this.baseUrl=P,this.isCompressed=w}async fetch({name:P}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!P)throw new Error("CMap name must be specified.");const w=this.baseUrl+P+(this.isCompressed?".bcmap":""),O=this.isCompressed?t.CMapCompressionType.BINARY:t.CMapCompressionType.NONE;return p()&&x(w,document.baseURI)?fetch(w).then(async k=>{if(!k.ok)throw new Error(k.statusText);let D;return this.isCompressed?D=new Uint8Array(await k.arrayBuffer()):D=(0,t.stringToBytes)(await k.text()),{cMapData:D,compressionType:O}}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${w}`)}):new Promise((k,D)=>{const F=new XMLHttpRequest;F.open("GET",w,!0),this.isCompressed&&(F.responseType="arraybuffer"),F.onreadystatechange=()=>{if(F.readyState===XMLHttpRequest.DONE){if(F.status===200||F.status===0){let U;if(this.isCompressed&&F.response?U=new Uint8Array(F.response):!this.isCompressed&&F.responseText&&(U=(0,t.stringToBytes)(F.responseText)),U){k({cMapData:U,compressionType:O});return}}D(new Error(F.statusText))}},F.send(null)}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${w}`)})}}e.DOMCMapReaderFactory=u;class f{create(P,w){(0,t.assert)(P>0&&w>0,"Invalid SVG dimensions");const O=document.createElementNS(a,"svg:svg");return O.setAttribute("version","1.1"),O.setAttribute("width",P+"px"),O.setAttribute("height",w+"px"),O.setAttribute("preserveAspectRatio","none"),O.setAttribute("viewBox","0 0 "+P+" "+w),O}createElement(P){return(0,t.assert)(typeof P=="string","Invalid SVG element type"),document.createElementNS(a,P)}}e.DOMSVGFactory=f;class c{constructor({viewBox:P,scale:w,rotation:O,offsetX:k=0,offsetY:D=0,dontFlip:F=!1}){this.viewBox=P,this.scale=w,this.rotation=O,this.offsetX=k,this.offsetY=D;const U=(P[2]+P[0])/2,H=(P[3]+P[1])/2;let W,ee,q,B;switch(O=O%360,O=O<0?O+360:O,O){case 180:W=-1,ee=0,q=0,B=1;break;case 90:W=0,ee=1,q=1,B=0;break;case 270:W=0,ee=-1,q=-1,B=0;break;case 0:W=1,ee=0,q=0,B=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}F&&(q=-q,B=-B);let G,I,$,V;W===0?(G=Math.abs(H-P[1])*w+k,I=Math.abs(U-P[0])*w+D,$=Math.abs(P[3]-P[1])*w,V=Math.abs(P[2]-P[0])*w):(G=Math.abs(U-P[0])*w+k,I=Math.abs(H-P[1])*w+D,$=Math.abs(P[2]-P[0])*w,V=Math.abs(P[3]-P[1])*w),this.transform=[W*w,ee*w,q*w,B*w,G-W*w*U-q*w*H,I-ee*w*U-B*w*H],this.width=$,this.height=V}clone({scale:P=this.scale,rotation:w=this.rotation,offsetX:O=this.offsetX,offsetY:k=this.offsetY,dontFlip:D=!1}={}){return new c({viewBox:this.viewBox.slice(),scale:P,rotation:w,offsetX:O,offsetY:k,dontFlip:D})}convertToViewportPoint(P,w){return t.Util.applyTransform([P,w],this.transform)}convertToViewportRectangle(P){const w=t.Util.applyTransform([P[0],P[1]],this.transform),O=t.Util.applyTransform([P[2],P[3]],this.transform);return[w[0],w[1],O[0],O[1]]}convertToPdfPoint(P,w){return t.Util.applyInverseTransform([P,w],this.transform)}}e.PageViewport=c;class h extends t.BaseException{constructor(P,w){super(P),this.type=w}}e.RenderingCancelledException=h;const y={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};e.LinkTarget=y;function E(T,{url:P,target:w,rel:O,enabled:k=!0}={}){(0,t.assert)(P&&typeof P=="string",'addLinkAttributes: A valid "url" parameter must provided.');const D=(0,t.removeNullCharacters)(P);k?T.href=T.title=D:(T.href="",T.title=`Disabled: ${D}`,T.onclick=()=>!1);let F="";switch(w){case y.NONE:break;case y.SELF:F="_self";break;case y.BLANK:F="_blank";break;case y.PARENT:F="_parent";break;case y.TOP:F="_top";break}T.target=F,T.rel=typeof O=="string"?O:n}function g(T){const P=T.indexOf("#"),w=T.indexOf("?"),O=Math.min(P>0?P:T.length,w>0?w:T.length);return T.substring(T.lastIndexOf("/",O)+1,O)}class _{constructor(){this.started=Object.create(null),this.times=[]}time(P){P in this.started&&(0,t.warn)(`Timer is already running for ${P}`),this.started[P]=Date.now()}timeEnd(P){P in this.started||(0,t.warn)(`Timer has not been started for ${P}`),this.times.push({name:P,start:this.started[P],end:Date.now()}),delete this.started[P]}toString(){const P=[];let w=0;for(const O of this.times){const k=O.name;k.length>w&&(w=k.length)}for(const O of this.times){const k=O.end-O.start;P.push(`${O.name.padEnd(w)} ${k}ms
28
28
  `)}return P.join("")}}e.StatTimer=_;function p(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&typeof ReadableStream<"u"}function x(T,P){try{const{protocol:w}=P?new URL(T,P):new URL(T);return w==="http:"||w==="https:"}catch{return!1}}function C(T){return new Promise((P,w)=>{const O=document.createElement("script");O.src=T,O.onload=P,O.onerror=function(){w(new Error(`Cannot load script at: ${O.src}`))},(document.head||document.documentElement).appendChild(O)})}function R(T){console.log("Deprecated API usage: "+T)}let S;class A{static toDateObject(P){if(!P||!(0,t.isString)(P))return null;S||(S=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const w=S.exec(P);if(!w)return null;const O=parseInt(w[1],10);let k=parseInt(w[2],10);k=k>=1&&k<=12?k-1:0;let D=parseInt(w[3],10);D=D>=1&&D<=31?D:1;let F=parseInt(w[4],10);F=F>=0&&F<=23?F:0;let U=parseInt(w[5],10);U=U>=0&&U<=59?U:0;let H=parseInt(w[6],10);H=H>=0&&H<=59?H:0;const W=w[7]||"Z";let ee=parseInt(w[8],10);ee=ee>=0&&ee<=23?ee:0;let q=parseInt(w[9],10)||0;return q=q>=0&&q<=59?q:0,W==="-"?(F+=ee,U+=q):W==="+"&&(F-=ee,U-=q),new Date(Date.UTC(O,k,D,F,U,H))}}e.PDFDateString=A},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.arrayByteLength=de,e.arraysToBytes=fe,e.assert=H,e.bytesToString=se,e.createPromiseCapability=mt,e.getVerbosityLevel=k,e.info=D,e.isArrayBuffer=Ft,e.isArrayEqual=Ke,e.isBool=Ot,e.isEmptyObj=er,e.isNum=_t,e.isString=kt,e.isSameOrigin=W,e.createValidAbsoluteUrl=q,e.removeNullCharacters=Z,e.setVerbosityLevel=O,e.shadow=B,e.string32=ce,e.stringToBytes=oe,e.stringToPDFString=yt,e.stringToUTF8String=at,e.utf8StringToString=ht,e.warn=F,e.unreachable=U,e.IsEvalSupportedCached=e.IsLittleEndianCached=e.createObjectURL=e.FormatError=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.StreamType=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.MissingPDFException=e.InvalidPDFException=e.AbortException=e.CMapCompressionType=e.ImageKind=e.FontType=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.UNSUPPORTED_FEATURES=e.VerbosityLevel=e.OPS=e.IDENTITY_MATRIX=e.FONT_IDENTITY_MATRIX=e.BaseException=void 0,r(3);const t=[1,0,0,1,0,0];e.IDENTITY_MATRIX=t;const n=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=n;const a={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.PermissionFlag=a;const l={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.TextRenderingMode=l;const u={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=u;const f={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationType=f;const c={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=c;const h={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=h;const y={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=y;const E={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=E;const g={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=g;const _={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationFieldFlag=_;const p={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=p;const x={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=x;const C={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=C;const R={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=R;const S={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=S;const A={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};e.OPS=A;const T={unknown:"unknown",forms:"forms",javaScript:"javaScript",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",errorFontGetPath:"errorFontGetPath"};e.UNSUPPORTED_FEATURES=T;const P={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=P;let w=R.WARNINGS;function O(he){Number.isInteger(he)&&(w=he)}function k(){return w}function D(he){w>=R.INFOS&&console.log(`Info: ${he}`)}function F(he){w>=R.WARNINGS&&console.log(`Warning: ${he}`)}function U(he){throw new Error(he)}function H(he,pe){he||U(pe)}function W(he,pe){let ve;try{if(ve=new URL(he),!ve.origin||ve.origin==="null")return!1}catch{return!1}const Ce=new URL(pe,ve);return ve.origin===Ce.origin}function ee(he){if(!he)return!1;switch(he.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function q(he,pe){if(!he)return null;try{const ve=pe?new URL(he,pe):new URL(he);if(ee(ve))return ve}catch{}return null}function B(he,pe,ve){return Object.defineProperty(he,pe,{value:ve,enumerable:!0,configurable:!0,writable:!1}),ve}const G=function(){function pe(ve){this.constructor===pe&&U("Cannot initialize BaseException."),this.message=ve,this.name=this.constructor.name}return pe.prototype=new Error,pe.constructor=pe,pe}();e.BaseException=G;class I extends G{constructor(pe,ve){super(pe),this.code=ve}}e.PasswordException=I;class $ extends G{constructor(pe,ve){super(pe),this.details=ve}}e.UnknownErrorException=$;class V extends G{}e.InvalidPDFException=V;class X extends G{}e.MissingPDFException=X;class Q extends G{constructor(pe,ve){super(pe),this.status=ve}}e.UnexpectedResponseException=Q;class J extends G{}e.FormatError=J;class ie extends G{}e.AbortException=ie;const ne=/\x00/g;function Z(he){return typeof he!="string"?(F("The argument for removeNullCharacters must be a string."),he):he.replace(ne,"")}function se(he){H(he!==null&&typeof he=="object"&&he.length!==void 0,"Invalid argument for bytesToString");const pe=he.length,ve=8192;if(pe<ve)return String.fromCharCode.apply(null,he);const Ce=[];for(let De=0;De<pe;De+=ve){const We=Math.min(De+ve,pe),je=he.subarray(De,We);Ce.push(String.fromCharCode.apply(null,je))}return Ce.join("")}function oe(he){H(typeof he=="string","Invalid argument for stringToBytes");const pe=he.length,ve=new Uint8Array(pe);for(let Ce=0;Ce<pe;++Ce)ve[Ce]=he.charCodeAt(Ce)&255;return ve}function de(he){return he.length!==void 0?he.length:(H(he.byteLength!==void 0,"arrayByteLength - invalid argument."),he.byteLength)}function fe(he){const pe=he.length;if(pe===1&&he[0]instanceof Uint8Array)return he[0];let ve=0;for(let We=0;We<pe;We++)ve+=de(he[We]);let Ce=0;const De=new Uint8Array(ve);for(let We=0;We<pe;We++){let je=he[We];je instanceof Uint8Array||(typeof je=="string"?je=oe(je):je=new Uint8Array(je));const ze=je.byteLength;De.set(je,Ce),Ce+=ze}return De}function ce(he){return String.fromCharCode(he>>24&255,he>>16&255,he>>8&255,he&255)}function xe(){const he=new Uint8Array(4);return he[0]=1,new Uint32Array(he.buffer,0,1)[0]===1}const Oe={get value(){return B(this,"value",xe())}};e.IsLittleEndianCached=Oe;function Te(){try{return new Function(""),!0}catch{return!1}}const Ve={get value(){return B(this,"value",Te())}};e.IsEvalSupportedCached=Ve;const Ge=["rgb(",0,",",0,",",0,")"];class qe{static makeCssRgb(pe,ve,Ce){return Ge[1]=pe,Ge[3]=ve,Ge[5]=Ce,Ge.join("")}static transform(pe,ve){return[pe[0]*ve[0]+pe[2]*ve[1],pe[1]*ve[0]+pe[3]*ve[1],pe[0]*ve[2]+pe[2]*ve[3],pe[1]*ve[2]+pe[3]*ve[3],pe[0]*ve[4]+pe[2]*ve[5]+pe[4],pe[1]*ve[4]+pe[3]*ve[5]+pe[5]]}static applyTransform(pe,ve){const Ce=pe[0]*ve[0]+pe[1]*ve[2]+ve[4],De=pe[0]*ve[1]+pe[1]*ve[3]+ve[5];return[Ce,De]}static applyInverseTransform(pe,ve){const Ce=ve[0]*ve[3]-ve[1]*ve[2],De=(pe[0]*ve[3]-pe[1]*ve[2]+ve[2]*ve[5]-ve[4]*ve[3])/Ce,We=(-pe[0]*ve[1]+pe[1]*ve[0]+ve[4]*ve[1]-ve[5]*ve[0])/Ce;return[De,We]}static getAxialAlignedBoundingBox(pe,ve){const Ce=qe.applyTransform(pe,ve),De=qe.applyTransform(pe.slice(2,4),ve),We=qe.applyTransform([pe[0],pe[3]],ve),je=qe.applyTransform([pe[2],pe[1]],ve);return[Math.min(Ce[0],De[0],We[0],je[0]),Math.min(Ce[1],De[1],We[1],je[1]),Math.max(Ce[0],De[0],We[0],je[0]),Math.max(Ce[1],De[1],We[1],je[1])]}static inverseTransform(pe){const ve=pe[0]*pe[3]-pe[1]*pe[2];return[pe[3]/ve,-pe[1]/ve,-pe[2]/ve,pe[0]/ve,(pe[2]*pe[5]-pe[4]*pe[3])/ve,(pe[4]*pe[1]-pe[5]*pe[0])/ve]}static apply3dTransform(pe,ve){return[pe[0]*ve[0]+pe[1]*ve[1]+pe[2]*ve[2],pe[3]*ve[0]+pe[4]*ve[1]+pe[5]*ve[2],pe[6]*ve[0]+pe[7]*ve[1]+pe[8]*ve[2]]}static singularValueDecompose2dScale(pe){const ve=[pe[0],pe[2],pe[1],pe[3]],Ce=pe[0]*ve[0]+pe[1]*ve[2],De=pe[0]*ve[1]+pe[1]*ve[3],We=pe[2]*ve[0]+pe[3]*ve[2],je=pe[2]*ve[1]+pe[3]*ve[3],ze=(Ce+je)/2,jt=Math.sqrt((Ce+je)*(Ce+je)-4*(Ce*je-We*De))/2,Mt=ze+jt||1,dt=ze-jt||1;return[Math.sqrt(Mt),Math.sqrt(dt)]}static normalizeRect(pe){const ve=pe.slice(0);return pe[0]>pe[2]&&(ve[0]=pe[2],ve[2]=pe[0]),pe[1]>pe[3]&&(ve[1]=pe[3],ve[3]=pe[1]),ve}static intersect(pe,ve){function Ce(ze,jt){return ze-jt}const De=[pe[0],pe[2],ve[0],ve[2]].sort(Ce),We=[pe[1],pe[3],ve[1],ve[3]].sort(Ce),je=[];if(pe=qe.normalizeRect(pe),ve=qe.normalizeRect(ve),De[0]===pe[0]&&De[1]===ve[0]||De[0]===ve[0]&&De[1]===pe[0])je[0]=De[1],je[2]=De[2];else return null;if(We[0]===pe[1]&&We[1]===ve[1]||We[0]===ve[1]&&We[1]===pe[1])je[1]=We[1],je[3]=We[2];else return null;return je}}e.Util=qe;const pt=[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 yt(he){const pe=he.length,ve=[];if(he[0]==="þ"&&he[1]==="ÿ")for(let Ce=2;Ce<pe;Ce+=2)ve.push(String.fromCharCode(he.charCodeAt(Ce)<<8|he.charCodeAt(Ce+1)));else if(he[0]==="ÿ"&&he[1]==="þ")for(let Ce=2;Ce<pe;Ce+=2)ve.push(String.fromCharCode(he.charCodeAt(Ce+1)<<8|he.charCodeAt(Ce)));else for(let Ce=0;Ce<pe;++Ce){const De=pt[he.charCodeAt(Ce)];ve.push(De?String.fromCharCode(De):he.charAt(Ce))}return ve.join("")}function at(he){return decodeURIComponent(escape(he))}function ht(he){return unescape(encodeURIComponent(he))}function er(he){for(const pe in he)return!1;return!0}function Ot(he){return typeof he=="boolean"}function _t(he){return typeof he=="number"}function kt(he){return typeof he=="string"}function Ft(he){return typeof he=="object"&&he!==null&&he.byteLength!==void 0}function Ke(he,pe){return he.length!==pe.length?!1:he.every(function(ve,Ce){return ve===pe[Ce]})}function mt(){const he=Object.create(null);let pe=!1;return Object.defineProperty(he,"settled",{get(){return pe}}),he.promise=new Promise(function(ve,Ce){he.resolve=function(De){pe=!0,ve(De)},he.reject=function(De){pe=!0,Ce(De)}}),he}const ct=function(){const pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(Ce,De,We=!1){if(!We&&URL.createObjectURL){const ze=new Blob([Ce],{type:De});return URL.createObjectURL(ze)}let je=`data:${De};base64,`;for(let ze=0,jt=Ce.length;ze<jt;ze+=3){const Mt=Ce[ze]&255,dt=Ce[ze+1]&255,vr=Ce[ze+2]&255,Wr=Mt>>2,Be=(Mt&3)<<4|dt>>4,Ie=ze+1<jt?(dt&15)<<2|vr>>6:64,nt=ze+2<jt?vr&63:64;je+=pe[Wr]+pe[Be]+pe[Ie]+pe[nt]}return je}}();e.createObjectURL=ct},function(o,e,r){r(4)},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;const t=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;e.isNodeJS=t},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.build=exports.version=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFWorker=exports.PDFDataRangeTransport=exports.LoopbackPort=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(6),_api_compatibility=__w_pdfjs_require__(7),_canvas=__w_pdfjs_require__(8),_worker_options=__w_pdfjs_require__(10),_is_node=__w_pdfjs_require__(4),_message_handler=__w_pdfjs_require__(11),_metadata=__w_pdfjs_require__(12),_transport_stream=__w_pdfjs_require__(14),_webgl=__w_pdfjs_require__(15);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let createPDFNetworkStream;function setPDFNetworkStreamFactory(o){createPDFNetworkStream=o}function getDocument(o){const e=new PDFDocumentLoadingTask;let r;if(typeof o=="string")r={url:o};else if((0,_util.isArrayBuffer)(o))r={data:o};else if(o instanceof PDFDataRangeTransport)r={range:o};else{if(typeof o!="object")throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!o.url&&!o.data&&!o.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=o}const t=Object.create(null);let n=null,a=null;for(const u in r){if(u==="url"&&typeof window<"u"){t[u]=new URL(r[u],window.location).href;continue}else if(u==="range"){n=r[u];continue}else if(u==="worker"){a=r[u];continue}else if(u==="data"&&!(r[u]instanceof Uint8Array)){const f=r[u];if(typeof f=="string")t[u]=(0,_util.stringToBytes)(f);else if(typeof f=="object"&&f!==null&&!isNaN(f.length))t[u]=new Uint8Array(f);else if((0,_util.isArrayBuffer)(f))t[u]=new Uint8Array(f);else throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");continue}t[u]=r[u]}if(t.rangeChunkSize=t.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,t.CMapReaderFactory=t.CMapReaderFactory||_display_utils.DOMCMapReaderFactory,t.ignoreErrors=t.stopAtErrors!==!0,t.fontExtraProperties=t.fontExtraProperties===!0,t.pdfBug=t.pdfBug===!0,Number.isInteger(t.maxImageSize)||(t.maxImageSize=-1),typeof t.isEvalSupported!="boolean"&&(t.isEvalSupported=!0),typeof t.disableFontFace!="boolean"&&(t.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1),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),!a){const u={verbosity:t.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};a=u.port?PDFWorker.fromPort(u):new PDFWorker(u),e._worker=a}const l=e.docId;return a.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const u=_fetchDocument(a,t,n,l),f=new Promise(function(c){let h;n?h=new _transport_stream.PDFDataTransportStream({length:t.length,initialData:t.initialData,progressiveDone:t.progressiveDone,disableRange:t.disableRange,disableStream:t.disableStream},n):t.data||(h=createPDFNetworkStream({url:t.url,length:t.length,httpHeaders:t.httpHeaders,withCredentials:t.withCredentials,rangeChunkSize:t.rangeChunkSize,disableRange:t.disableRange,disableStream:t.disableStream})),c(h)});return Promise.all([u,f]).then(function([c,h]){if(e.destroyed)throw new Error("Loading aborted");const y=new _message_handler.MessageHandler(l,c,a.port);y.postMessageTransfers=a.postMessageTransfers;const E=new WorkerTransport(y,e,h,t);e._transport=E,y.send("Ready",null)})}).catch(e._capability.reject),e}function _fetchDocument(o,e,r,t){return o.destroyed?Promise.reject(new Error("Worker was destroyed")):(r&&(e.length=r.length,e.initialData=r.initialData,e.progressiveDone=r.progressiveDone),o.messageHandler.sendWithPromise("GetDocRequest",{docId:t,apiVersion:"2.5.207",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,postMessageTransfers:o.postMessageTransfers,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then(function(n){if(o.destroyed)throw new Error("Worker was destroyed");return n}))}const PDFDocumentLoadingTask=function(){let e=0;class r{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,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 r}();class PDFDataRangeTransport{constructor(e,r,t=!1){this.length=e,this.initialData=r,this.progressiveDone=t,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}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,r){for(const t of this._rangeListeners)t(e,r)}onDataProgress(e,r){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,r){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,r){this._pdfInfo=e,this._transport=r}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}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()}getOpenActionDestination(){return(0,_display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."),this.getOpenAction().then(function(e){return e&&e.dest?e.dest:null})}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,r,t,n=!1){this._pageIndex=e,this._pageInfo=r,this._transport=t,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=t.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),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({scale:e,rotation:r=this.rotate,offsetX:t=0,offsetY:n=0,dontFlip:a=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:r,offsetX:t,offsetY:n,dontFlip:a})}getAnnotations({intent:e=null}={}){return(!this.annotationsPromise||this.annotationsIntent!==e)&&(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:r,intent:t="display",enableWebGL:n=!1,renderInteractiveForms:a=!1,transform:l=null,imageLayer:u=null,canvasFactory:f=null,background:c=null}){this._stats&&this._stats.time("Overall");const h=t==="print"?"print":"display";this.pendingCleanup=!1,this.intentStates[h]||(this.intentStates[h]=Object.create(null));const y=this.intentStates[h];y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const E=f||new _display_utils.DOMCanvasFactory,g=new _webgl.WebGLContext({enable:n});y.displayReadyCapability||(y.displayReadyCapability=(0,_util.createPromiseCapability)(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:h,renderInteractiveForms:a===!0}));const _=C=>{const R=y.renderTasks.indexOf(p);R>=0&&y.renderTasks.splice(R,1),(this.cleanupAfterRender||h==="print")&&(this.pendingCleanup=!0),this._tryCleanup(),C?(p.capability.reject(C),this._abortOperatorList({intentState:y,reason:C})):p.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},p=new InternalRenderTask({callback:_,params:{canvasContext:e,viewport:r,transform:l,imageLayer:u,background:c},objs:this.objs,commonObjs:this.commonObjs,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:E,webGLContext:g,useRequestAnimationFrame:h!=="print",pdfBug:this._pdfBug});y.renderTasks||(y.renderTasks=[]),y.renderTasks.push(p);const x=p.task;return y.displayReadyCapability.promise.then(C=>{if(this.pendingCleanup){_();return}this._stats&&this._stats.time("Rendering"),p.initializeGraphics(C),p.operatorListChanged()}).catch(_),x}getOperatorList(){function e(){if(t.operatorList.lastChunk){t.opListReadCapability.resolve(t.operatorList);const a=t.renderTasks.indexOf(n);a>=0&&t.renderTasks.splice(a,1)}}const r="oplist";this.intentStates[r]||(this.intentStates[r]=Object.create(null));const t=this.intentStates[r];let n;return t.opListReadCapability||(n={},n.operatorListChanged=e,t.opListReadCapability=(0,_util.createPromiseCapability)(),t.renderTasks=[],t.renderTasks.push(n),t.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:r})),t.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:e===!0,combineTextItems:r!==!0},{highWaterMark:100,size(n){return n.items.length}})}getTextContent(e={}){const r=this.streamTextContent(e);return new Promise(function(t,n){function a(){l.read().then(function({value:f,done:c}){if(c){t(u);return}Object.assign(u.styles,f.styles),u.items.push(...f.items),a()},n)}const l=r.getReader(),u={items:[],styles:Object.create(null)};a()})}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];return Object.keys(this.intentStates).forEach(r=>{const t=this.intentStates[r];this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),r!=="oplist"&&t.renderTasks.forEach(function(n){const a=n.capability.promise.catch(function(){});e.push(a),n.cancel()})}),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){return!this.pendingCleanup||Object.keys(this.intentStates).some(r=>{const t=this.intentStates[r];return t.renderTasks.length!==0||!t.operatorList.lastChunk})?!1:(Object.keys(this.intentStates).forEach(r=>{delete this.intentStates[r]}),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0)}_startRenderPage(e,r){const t=this.intentStates[r];t&&(this._stats&&this._stats.timeEnd("Page Request"),t.displayReadyCapability&&t.displayReadyCapability.resolve(e))}_renderPageChunk(e,r){for(let t=0,n=e.length;t<n;t++)r.operatorList.fnArray.push(e.fnArray[t]),r.operatorList.argsArray.push(e.argsArray[t]);r.operatorList.lastChunk=e.lastChunk;for(let t=0;t<r.renderTasks.length;t++)r.renderTasks[t].operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){(0,_util.assert)(e.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');const t=this._transport.messageHandler.sendWithStream("GetOperatorList",e).getReader(),n=this.intentStates[e.intent];n.streamReader=t;const a=()=>{t.read().then(({value:l,done:u})=>{if(u){n.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(l,n),a())},l=>{if(n.streamReader=null,!this._transport.destroyed){if(n.operatorList){n.operatorList.lastChunk=!0;for(let u=0;u<n.renderTasks.length;u++)n.renderTasks[u].operatorListChanged();this._tryCleanup()}if(n.displayReadyCapability)n.displayReadyCapability.reject(l);else if(n.opListReadCapability)n.opListReadCapability.reject(l);else throw l}})};a()}_abortOperatorList({intentState:e,reason:r,force:t=!1}){if((0,_util.assert)(r instanceof Error||typeof r=="object"&&r!==null,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),!!e.streamReader){if(!t){if(e.renderTasks.length!==0)return;if(r instanceof _display_utils.RenderingCancelledException){e.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:e,reason:r,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}e.streamReader.cancel(new _util.AbortException(r&&r.message)),e.streamReader=null,!this._transport.destroyed&&(Object.keys(this.intentStates).some(n=>this.intentStates[n]===e?(delete this.intentStates[n],!0):!1),this.cleanup())}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,r){function t(l){if(typeof l!="object"||l===null)return l;if(n.has(l))return n.get(l);let u,f;if((u=l.buffer)&&(0,_util.isArrayBuffer)(u))return r&&r.includes(u)?f=new l.constructor(u,l.byteOffset,l.byteLength):f=new l.constructor(l),n.set(l,f),f;f=Array.isArray(l)?[]:{},n.set(l,f);for(const c in l){let h,y=l;for(;!(h=Object.getOwnPropertyDescriptor(y,c));)y=Object.getPrototypeOf(y);if(!(typeof h.value>"u")){if(typeof h.value=="function"){if(l.hasOwnProperty&&l.hasOwnProperty(c))throw new Error(`LoopbackPort.postMessage - cannot clone: ${l[c]}`);continue}f[c]=t(h.value)}}return f}if(!this._defer){this._listeners.forEach(l=>{l.call(this,{data:e})});return}const n=new WeakMap,a={data:t(e)};this._deferred.then(()=>{this._listeners.forEach(l=>{l.call(this,a)})})}addEventListener(e,r){this._listeners.push(r)}removeEventListener(e,r){const t=this._listeners.indexOf(r);this._listeners.splice(t,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS&&typeof commonjsRequire=="function")isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"&&"currentScript"in document){const o=document.currentScript&&document.currentScript.src;o&&(fallbackWorkerSrc=o.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(typeof fallbackWorkerSrc<"u")return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let o;try{o=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch{}return o||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(o){const e="importScripts('"+o+"');";return URL.createObjectURL(new Blob([e]))}class PDFWorker{constructor({name:e=null,port:r=null,verbosity:t=(0,_util.getVerbosityLevel)()}={}){if(r&&pdfWorkerPorts.has(r))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=t,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,r){pdfWorkerPorts.set(r,this),this._initializeFromPort(r);return}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()}_initialize(){if(typeof Worker<"u"&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const r=new Worker(e),t=new _message_handler.MessageHandler("main","worker",r),n=()=>{r.removeEventListener("error",a),t.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=()=>{this._webWorker||n()};r.addEventListener("error",a),t.on("test",u=>{if(r.removeEventListener("error",a),this.destroyed){n();return}u?(this._messageHandler=t,this._port=r,this._webWorker=r,u.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),t.destroy(),r.terminate())}),t.on("ready",u=>{if(r.removeEventListener("error",a),this.destroyed){n();return}try{l()}catch{this._setupFakeWorker()}});const l=()=>{const u=new Uint8Array([this.postMessageTransfers?255:0]);try{t.send("test",u,[u.buffer])}catch{(0,_util.warn)("Cannot use postMessage transfers."),u[0]=0,t.send("test",u)}};l();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new LoopbackPort;this._port=r;const t="fake"+nextFakeWorkerId++,n=new _message_handler.MessageHandler(t+"_worker",t,r);e.setup(n,r);const a=new _message_handler.MessageHandler(t,t+"_worker",r);this._messageHandler=a,this._readyCapability.resolve(),a.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,r,t,n){this.messageHandler=e,this.loadingTask=r,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:r.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=n,this.CMapReaderFactory=new n.CMapReaderFactory({baseUrl:n.cMapUrl,isCompressed:n.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=t,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];this.pageCache.forEach(function(t){t&&e.push(t._destroy())}),this.pageCache.length=0,this.pagePromises.length=0;const r=this.messageHandler.sendWithPromise("Terminate",null);return e.push(r),Promise.all(e).then(()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:r}=this;e.on("GetReader",(t,n)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},n.onPull=()=>{this._fullReader.read().then(function({value:a,done:l}){if(l){n.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(a),"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{n.error(a)})},n.onCancel=a=>{this._fullReader.cancel(a)}}),e.on("ReaderHeadersReady",t=>{const n=(0,_util.createPromiseCapability)(),a=this._fullReader;return a.headersReady.then(()=>{(!a.isStreamingSupported||!a.isRangeSupported)&&(this._lastProgress&&r.onProgress&&r.onProgress(this._lastProgress),a.onProgress=l=>{r.onProgress&&r.onProgress({loaded:l.loaded,total:l.total})}),n.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(t,n)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(t.begin,t.end);if(!a){n.close();return}n.onPull=()=>{a.read().then(function({value:l,done:u}){if(u){n.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(l),"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{n.error(l)})},n.onCancel=l=>{a.cancel(l)}}),e.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,r._capability.resolve(new PDFDocumentProxy(t,this))}),e.on("DocException",function(t){let n;switch(t.name){case"PasswordException":n=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":n=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(t.message,t.details);break}r._capability.reject(n)}),e.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),r.onPassword){const n=a=>{this._passwordCapability.resolve({password:a})};try{r.onPassword(n,t.code)}catch(a){this._passwordCapability.reject(a)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),e.on("DataLoaded",t=>{r.onProgress&&r.onProgress({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),e.on("StartRenderPage",t=>{if(this.destroyed)return;this.pageCache[t.pageIndex]._startRenderPage(t.transparency,t.intent)}),e.on("commonobj",t=>{if(this.destroyed)return;const[n,a,l]=t;if(!this.commonObjs.has(n))switch(a){case"Font":const u=this._params;if("error"in l){const h=l.error;(0,_util.warn)(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let f=null;u.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(f={registerFont(h,y){globalThis.FontInspector.fontAdded(h,y)}});const c=new _font_loader.FontFaceObject(l,{isEvalSupported:u.isEvalSupported,disableFontFace:u.disableFontFace,ignoreErrors:u.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:f});this.fontLoader.bind(c).catch(h=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!u.fontExtraProperties&&c.data&&(c.data=null),this.commonObjs.resolve(n,c)});break;case"FontPath":case"FontType3Res":case"Image":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}}),e.on("obj",t=>{if(this.destroyed)return;const[n,a,l,u]=t,f=this.pageCache[a];if(!f.objs.has(n))switch(l){case"Image":f.objs.resolve(n,u),u&&"data"in u&&u.data.length>8e6&&(f.cleanupAfterRender=!0);break;default:throw new Error(`Got unknown object type ${l}`)}}),e.on("DocProgress",t=>{this.destroyed||r.onProgress&&r.onProgress({loaded:t.loaded,total:t.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(t,n)=>{if(this.destroyed){n.error(new Error("Worker was destroyed"));return}let a=!1;n.onPull=()=>{if(a){n.close();return}a=!0,this.CMapReaderFactory.fetch(t).then(function(l){n.enqueue(l,1,[l.cMapData.buffer])}).catch(function(l){n.error(l)})}})}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const r=e-1;if(r in this.pagePromises)return this.pagePromises[r];const t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");const a=new PDFPageProxy(r,n,this,this._params.pdfBug);return this.pageCache[r]=a,a});return this.pagePromises[r]=t,t}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(r){return Promise.reject(new Error(r))})}getAnnotations(e,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:r})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null}))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then(()=>{for(let e=0,r=this.pageCache.length;e<r;e++){const t=this.pageCache[e];if(t&&!t.cleanup())throw new Error(`startCleanup: Page ${e+1} is currently rendering.`)}this.commonObjs.clear(),this.fontLoader.clear()})}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,disableFontFace:e.disableFontFace})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(e){return this._objs[e]?this._objs[e]:this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(e,r=null){if(r)return this._ensureObj(e).capability.promise.then(r),null;const t=this._objs[e];if(!t||!t.resolved)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return t.data}has(e){const r=this._objs[e];return r?r.resolved:!1}resolve(e,r){const t=this._ensureObj(e);t.resolved=!0,t.data=r,t.capability.resolve(r)}clear(){this._objs=Object.create(null)}}class RenderTask{constructor(e){this._internalRenderTask=e,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}const InternalRenderTask=function o(){const e=new WeakSet;class r{constructor({callback:n,params:a,objs:l,commonObjs:u,operatorList:f,pageIndex:c,canvasFactory:h,webGLContext:y,useRequestAnimationFrame:E=!1,pdfBug:g=!1}){this.callback=n,this.params=a,this.objs=l,this.commonObjs=u,this.operatorListIdx=null,this.operatorList=f,this._pageIndex=c,this.canvasFactory=h,this.webGLContext=y,this._pdfBug=g,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=E===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=a.canvasContext.canvas}initializeGraphics(n=!1){if(this.cancelled)return;if(this._canvas){if(e.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.");e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager&&globalThis.StepperManager.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:l,transform:u,imageLayer:f,background:c}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,f),this.gfx.beginDrawing({transform:u,viewport:l,transparency:n,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(n=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback(n||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&this.stepper.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this.cancel.bind(this))}):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback())))}}return r}(),version="2.5.207";exports.version=version;const build="0974d605";exports.build=build},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var t=r(2);class n{constructor({docId:f,onUnsupportedFeature:c}){this.constructor===n&&(0,t.unreachable)("Cannot initialize BaseFontLoader."),this.docId=f,this._onUnsupportedFeature=c,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(f){this.nativeFontFaces.push(f),document.fonts.add(f)}insertRule(f){let c=this.styleElement;c||(c=this.styleElement=document.createElement("style"),c.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,document.documentElement.getElementsByTagName("head")[0].appendChild(c));const h=c.sheet;h.insertRule(f,h.cssRules.length)}clear(){this.nativeFontFaces.forEach(function(f){document.fonts.delete(f)}),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(f){if(f.attached||f.missingFile)return;if(f.attached=!0,this.isFontLoadingAPISupported){const h=f.createNativeFontFace();if(h){this.addNativeFontFace(h);try{await h.loaded}catch(y){throw this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,t.warn)(`Failed to load font '${h.family}': '${y}'.`),f.disableFontFace=!0,y}}return}const c=f.createFontFaceRule();if(c){if(this.insertRule(c),this.isSyncFontLoadingSupported)return;await new Promise(h=>{const y=this._queueLoadingCallback(h);this._prepareFontLoadEvent([c],[f],y)})}}_queueLoadingCallback(f){(0,t.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const f=typeof document<"u"&&!!document.fonts;return(0,t.shadow)(this,"isFontLoadingAPISupported",f)}get isSyncFontLoadingSupported(){(0,t.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,t.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(f,c,h){(0,t.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let a;e.FontLoader=a,e.FontLoader=a=class extends n{constructor(f){super(f),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let f=!1;if(typeof navigator>"u")f=!0;else{const c=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);c&&c[1]>=14&&(f=!0)}return(0,t.shadow)(this,"isSyncFontLoadingSupported",f)}_queueLoadingCallback(f){function c(){for((0,t.assert)(!y.done,"completeRequest() cannot be called twice."),y.done=!0;h.requests.length>0&&h.requests[0].done;){const E=h.requests.shift();setTimeout(E.callback,0)}}const h=this.loadingContext,y={id:`pdfjs-font-loading-${h.nextRequestId++}`,done:!1,complete:c,callback:f};return h.requests.push(y),y}get _loadTestFont(){const f=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,t.shadow)(this,"_loadTestFont",f())}_prepareFontLoadEvent(f,c,h){function y(H,W){return H.charCodeAt(W)<<24|H.charCodeAt(W+1)<<16|H.charCodeAt(W+2)<<8|H.charCodeAt(W+3)&255}function E(H,W,ee,q){const B=H.substring(0,W),G=H.substring(W+ee);return B+q+G}let g,_;const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d");let C=0;function R(H,W){if(C++,C>30){(0,t.warn)("Load test font never loaded."),W();return}if(x.font="30px "+H,x.fillText(".",0,20),x.getImageData(0,0,1,1).data[3]>0){W();return}setTimeout(R.bind(null,H,W))}const S=`lt${Date.now()}${this.loadTestFontId++}`;let A=this._loadTestFont;A=E(A,976,S.length,S);const P=16,w=1482184792;let O=y(A,P);for(g=0,_=S.length-3;g<_;g+=4)O=O-w+y(S,g)|0;g<S.length&&(O=O-w+y(S+"XXX",g)|0),A=E(A,P,4,(0,t.string32)(O));const k=`url(data:font/opentype;base64,${btoa(A)});`,D=`@font-face {font-family:"${S}";src:${k}}`;this.insertRule(D);const F=[];for(g=0,_=c.length;g<_;g++)F.push(c[g].loadedName);F.push(S);const U=document.createElement("div");for(U.style.visibility="hidden",U.style.width=U.style.height="10px",U.style.position="absolute",U.style.top=U.style.left="0px",g=0,_=F.length;g<_;++g){const H=document.createElement("span");H.textContent="Hi",H.style.fontFamily=F[g],U.appendChild(H)}document.body.appendChild(U),R(S,function(){document.body.removeChild(U),h.complete()})}};class l{constructor(f,{isEvalSupported:c=!0,disableFontFace:h=!1,ignoreErrors:y=!1,onUnsupportedFeature:E=null,fontRegistry:g=null}){this.compiledGlyphs=Object.create(null);for(const _ in f)this[_]=f[_];this.isEvalSupported=c!==!1,this.disableFontFace=h===!0,this.ignoreErrors=y===!0,this._onUnsupportedFeature=E,this.fontRegistry=g}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const f=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),f}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const f=(0,t.bytesToString)(new Uint8Array(this.data)),c=`url(data:${this.mimetype};base64,${btoa(f)});`,h=`@font-face {font-family:"${this.loadedName}";src:${c}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,c),h}getPathGenerator(f,c){if(this.compiledGlyphs[c]!==void 0)return this.compiledGlyphs[c];let h,y;try{h=f.get(this.loadedName+"_path_"+c)}catch(E){if(!this.ignoreErrors)throw E;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,t.warn)(`getPathGenerator - ignoring character: "${E}".`),this.compiledGlyphs[c]=function(g,_){}}if(this.isEvalSupported&&t.IsEvalSupportedCached.value){let E,g="";for(let _=0,p=h.length;_<p;_++)y=h[_],y.args!==void 0?E=y.args.join(","):E="",g+="c."+y.cmd+"("+E+`);
29
29
  `;return this.compiledGlyphs[c]=new Function("c","size",g)}return this.compiledGlyphs[c]=function(E,g){for(let _=0,p=h.length;_<p;_++)y=h[_],y.cmd==="scale"&&(y.args=[g,-g]),E[y.cmd].apply(E,y.args)}}}e.FontFaceObject=l},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.apiCompatibilityParams=void 0;var t=r(4);const n=Object.create(null);(function(){t.isNodeJS&&(n.disableFontFace=!0)})();const a=Object.freeze(n);e.apiCompatibilityParams=a},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var t=r(2),n=r(9),a=16,l=100,u=4096,f=.65,c=1e3,h=16;function y(x){x.mozCurrentTransform||(x._originalSave=x.save,x._originalRestore=x.restore,x._originalRotate=x.rotate,x._originalScale=x.scale,x._originalTranslate=x.translate,x._originalTransform=x.transform,x._originalSetTransform=x.setTransform,x._transformMatrix=x._transformMatrix||[1,0,0,1,0,0],x._transformStack=[],Object.defineProperty(x,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(x,"mozCurrentTransformInverse",{get:function(){var R=this._transformMatrix,S=R[0],A=R[1],T=R[2],P=R[3],w=R[4],O=R[5],k=S*P-A*T,D=A*T-S*P;return[P/k,A/D,T/D,S/k,(P*w-T*O)/D,(A*w-S*O)/k]}}),x.save=function(){var R=this._transformMatrix;this._transformStack.push(R),this._transformMatrix=R.slice(0,6),this._originalSave()},x.restore=function(){var R=this._transformStack.pop();R&&(this._transformMatrix=R,this._originalRestore())},x.translate=function(R,S){var A=this._transformMatrix;A[4]=A[0]*R+A[2]*S+A[4],A[5]=A[1]*R+A[3]*S+A[5],this._originalTranslate(R,S)},x.scale=function(R,S){var A=this._transformMatrix;A[0]=A[0]*R,A[1]=A[1]*R,A[2]=A[2]*S,A[3]=A[3]*S,this._originalScale(R,S)},x.transform=function(R,S,A,T,P,w){var O=this._transformMatrix;this._transformMatrix=[O[0]*R+O[2]*S,O[1]*R+O[3]*S,O[0]*A+O[2]*T,O[1]*A+O[3]*T,O[0]*P+O[2]*w+O[4],O[1]*P+O[3]*w+O[5]],x._originalTransform(R,S,A,T,P,w)},x.setTransform=function(R,S,A,T,P,w){this._transformMatrix=[R,S,A,T,P,w],x._originalSetTransform(R,S,A,T,P,w)},x.rotate=function(R){var S=Math.cos(R),A=Math.sin(R),T=this._transformMatrix;this._transformMatrix=[T[0]*S+T[2]*A,T[1]*S+T[3]*A,T[0]*-A+T[2]*S,T[1]*-A+T[3]*S,T[4],T[5]],this._originalRotate(R)})}var E=function(){function C(R){this.canvasFactory=R,this.cache=Object.create(null)}return C.prototype={getCanvas:function(S,A,T,P){var w;return this.cache[S]!==void 0?(w=this.cache[S],this.canvasFactory.reset(w,A,T),w.context.setTransform(1,0,0,1,0,0)):(w=this.canvasFactory.create(A,T),this.cache[S]=w),P&&y(w.context),w},clear(){for(var R in this.cache){var S=this.cache[R];this.canvasFactory.destroy(S),delete this.cache[R]}}},C}();function g(x){var C=1e3,R=x.width,S=x.height,A,T,P,w=R+1,O=new Uint8Array(w*(S+1)),k=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),D=R+7&-8,F=x.data,U=new Uint8Array(D*S),H=0,W;for(A=0,W=F.length;A<W;A++)for(var ee=128,q=F[A];ee>0;)U[H++]=q&ee?0:255,ee>>=1;var B=0;for(H=0,U[H]!==0&&(O[0]=1,++B),T=1;T<R;T++)U[H]!==U[H+1]&&(O[T]=U[H]?2:1,++B),H++;for(U[H]!==0&&(O[T]=2,++B),A=1;A<S;A++){H=A*D,P=A*w,U[H-D]!==U[H]&&(O[P]=U[H]?1:8,++B);var G=(U[H]?4:0)+(U[H-D]?8:0);for(T=1;T<R;T++)G=(G>>2)+(U[H+1]?4:0)+(U[H-D+1]?8:0),k[G]&&(O[P+T]=k[G],++B),H++;if(U[H-D]!==U[H]&&(O[P+T]=U[H]?2:4,++B),B>C)return null}for(H=D*(S-1),P=A*w,U[H]!==0&&(O[P]=8,++B),T=1;T<R;T++)U[H]!==U[H+1]&&(O[P+T]=U[H]?4:8,++B),H++;if(U[H]!==0&&(O[P+T]=4,++B),B>C)return null;var I=new Int32Array([0,w,-1,0,-w,0,0,0,1]),$=[];for(A=0;B&&A<=S;A++){for(var V=A*w,X=V+R;V<X&&!O[V];)V++;if(V!==X){var Q=[V%w,A],J=O[V],ie=V,ne;do{var Z=I[J];do V+=Z;while(!O[V]);ne=O[V],ne!==5&&ne!==10?(J=ne,O[V]=0):(J=ne&51*J>>4,O[V]&=J>>2|J<<2),Q.push(V%w),Q.push(V/w|0),O[V]||--B}while(ie!==V);$.push(Q),--A}}var se=function(oe){oe.save(),oe.scale(1/R,-1/S),oe.translate(0,-S),oe.beginPath();for(let fe=0,ce=$.length;fe<ce;fe++){var de=$[fe];oe.moveTo(de[0],de[1]);for(let xe=2,Oe=de.length;xe<Oe;xe+=2)oe.lineTo(de[xe],de[xe+1])}oe.fill(),oe.beginPath(),oe.restore()};return se}var _=function(){function C(){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=t.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=t.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=t.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.resumeSMaskCtx=null}return C.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(S,A){this.x=S,this.y=A}},C}(),p=function(){var C=15,R=10;function S(G,I,$,V,X,Q){this.ctx=G,this.current=new _,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=I,this.objs=$,this.canvasFactory=V,this.webGLContext=X,this.imageLayer=Q,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.cachedCanvases=new E(this.canvasFactory),G&&y(G),this._cachedGetSinglePixelWidth=null}function A(G,I){if(typeof ImageData<"u"&&I instanceof ImageData){G.putImageData(I,0,0);return}var $=I.height,V=I.width,X=$%h,Q=($-X)/h,J=X===0?Q:Q+1,ie=G.createImageData(V,h),ne=0,Z,se=I.data,oe=ie.data,de,fe,ce,xe;if(I.kind===t.ImageKind.GRAYSCALE_1BPP){var Oe=se.byteLength,Te=new Uint32Array(oe.buffer,0,oe.byteLength>>2),Ve=Te.length,Ge=V+7>>3,qe=4294967295,pt=t.IsLittleEndianCached.value?4278190080:255;for(de=0;de<J;de++){for(ce=de<Q?h:X,Z=0,fe=0;fe<ce;fe++){for(var yt=Oe-ne,at=0,ht=yt>Ge?V:yt*8-7,er=ht&-8,Ot=0,_t=0;at<er;at+=8)_t=se[ne++],Te[Z++]=_t&128?qe:pt,Te[Z++]=_t&64?qe:pt,Te[Z++]=_t&32?qe:pt,Te[Z++]=_t&16?qe:pt,Te[Z++]=_t&8?qe:pt,Te[Z++]=_t&4?qe:pt,Te[Z++]=_t&2?qe:pt,Te[Z++]=_t&1?qe:pt;for(;at<ht;at++)Ot===0&&(_t=se[ne++],Ot=128),Te[Z++]=_t&Ot?qe:pt,Ot>>=1}for(;Z<Ve;)Te[Z++]=0;G.putImageData(ie,0,de*h)}}else if(I.kind===t.ImageKind.RGBA_32BPP){for(fe=0,xe=V*h*4,de=0;de<Q;de++)oe.set(se.subarray(ne,ne+xe)),ne+=xe,G.putImageData(ie,0,fe),fe+=h;de<J&&(xe=V*X*4,oe.set(se.subarray(ne,ne+xe)),G.putImageData(ie,0,fe))}else if(I.kind===t.ImageKind.RGB_24BPP)for(ce=h,xe=V*ce,de=0;de<J;de++){for(de>=Q&&(ce=X,xe=V*ce),Z=0,fe=xe;fe--;)oe[Z++]=se[ne++],oe[Z++]=se[ne++],oe[Z++]=se[ne++],oe[Z++]=255;G.putImageData(ie,0,de*h)}else throw new Error(`bad image kind: ${I.kind}`)}function T(G,I){for(var $=I.height,V=I.width,X=$%h,Q=($-X)/h,J=X===0?Q:Q+1,ie=G.createImageData(V,h),ne=0,Z=I.data,se=ie.data,oe=0;oe<J;oe++){for(var de=oe<Q?h:X,fe=3,ce=0;ce<de;ce++)for(var xe=0,Oe=0;Oe<V;Oe++){if(!xe){var Te=Z[ne++];xe=128}se[fe]=Te&xe?0:255,fe+=4,xe>>=1}G.putImageData(ie,0,oe*h)}}function P(G,I){for(var $=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],V=0,X=$.length;V<X;V++){var Q=$[V];G[Q]!==void 0&&(I[Q]=G[Q])}G.setLineDash!==void 0&&(I.setLineDash(G.getLineDash()),I.lineDashOffset=G.lineDashOffset)}function w(G){G.strokeStyle="#000000",G.fillStyle="#000000",G.fillRule="nonzero",G.globalAlpha=1,G.lineWidth=1,G.lineCap="butt",G.lineJoin="miter",G.miterLimit=10,G.globalCompositeOperation="source-over",G.font="10px sans-serif",G.setLineDash!==void 0&&(G.setLineDash([]),G.lineDashOffset=0)}function O(G,I,$,V){for(var X=G.length,Q=3;Q<X;Q+=4){var J=G[Q];if(J===0)G[Q-3]=I,G[Q-2]=$,G[Q-1]=V;else if(J<255){var ie=255-J;G[Q-3]=G[Q-3]*J+I*ie>>8,G[Q-2]=G[Q-2]*J+$*ie>>8,G[Q-1]=G[Q-1]*J+V*ie>>8}}}function k(G,I,$){for(var V=G.length,X=1/255,Q=3;Q<V;Q+=4){var J=$?$[G[Q]]:G[Q];I[Q]=I[Q]*J*X|0}}function D(G,I,$){for(var V=G.length,X=3;X<V;X+=4){var Q=G[X-3]*77+G[X-2]*152+G[X-1]*28;I[X]=$?I[X]*$[Q>>8]>>8:I[X]*Q>>16}}function F(G,I,$,V,X,Q,J){var ie=!!Q,ne=ie?Q[0]:0,Z=ie?Q[1]:0,se=ie?Q[2]:0,oe;X==="Luminosity"?oe=D:oe=k;for(var de=1048576,fe=Math.min(V,Math.ceil(de/$)),ce=0;ce<V;ce+=fe){var xe=Math.min(fe,V-ce),Oe=G.getImageData(0,ce,$,xe),Te=I.getImageData(0,ce,$,xe);ie&&O(Oe.data,ne,Z,se),oe(Oe.data,Te.data,J),G.putImageData(Te,0,ce)}}function U(G,I,$,V){var X=I.canvas,Q=I.context;G.setTransform(I.scaleX,0,0,I.scaleY,I.offsetX,I.offsetY);var J=I.backdrop||null;if(!I.transferMap&&V.isEnabled){const ie=V.composeSMask({layer:$.canvas,mask:X,properties:{subtype:I.subtype,backdrop:J}});G.setTransform(1,0,0,1,0,0),G.drawImage(ie,I.offsetX,I.offsetY);return}F(Q,$,X.width,X.height,I.subtype,J,I.transferMap),G.drawImage(X,0,0)}var H=["butt","round","square"],W=["miter","round","bevel"],ee={},q={};S.prototype={beginDrawing({transform:G,viewport:I,transparency:$=!1,background:V=null}){var X=this.ctx.canvas.width,Q=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=V||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,X,Q),this.ctx.restore(),$){var J=this.cachedCanvases.getCanvas("transparent",X,Q,!0);this.compositeCtx=this.ctx,this.transparentCanvas=J.canvas,this.ctx=J.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),w(this.ctx),G&&this.ctx.transform.apply(this.ctx,G),this.ctx.transform.apply(this.ctx,I.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(I,$,V,X){var Q=I.argsArray,J=I.fnArray,ie=$||0,ne=Q.length;if(ne===ie)return ie;for(var Z=ne-ie>R&&typeof V=="function",se=Z?Date.now()+C:0,oe=0,de=this.commonObjs,fe=this.objs,ce;;){if(X!==void 0&&ie===X.nextBreakPoint)return X.breakIt(ie,V),ie;if(ce=J[ie],ce!==t.OPS.dependency)this[ce].apply(this,Q[ie]);else for(const xe of Q[ie]){const Oe=xe.startsWith("g_")?de:fe;if(!Oe.has(xe))return Oe.get(xe,V),ie}if(ie++,ie===ne)return ie;if(Z&&++oe>R){if(Date.now()>se)return V(),ie;oe=0}}},endDrawing:function(){this.current.activeSMask!==null&&this.endSMaskGroup(),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),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(I){this.current.lineWidth=I,this.ctx.lineWidth=I},setLineCap:function(I){this.ctx.lineCap=H[I]},setLineJoin:function(I){this.ctx.lineJoin=W[I]},setMiterLimit:function(I){this.ctx.miterLimit=I},setDash:function(I,$){var V=this.ctx;V.setLineDash!==void 0&&(V.setLineDash(I),V.lineDashOffset=$)},setRenderingIntent(G){},setFlatness(G){},setGState:function(I){for(var $=0,V=I.length;$<V;$++){var X=I[$],Q=X[0],J=X[1];switch(Q){case"LW":this.setLineWidth(J);break;case"LC":this.setLineCap(J);break;case"LJ":this.setLineJoin(J);break;case"ML":this.setMiterLimit(J);break;case"D":this.setDash(J[0],J[1]);break;case"RI":this.setRenderingIntent(J);break;case"FL":this.setFlatness(J);break;case"Font":this.setFont(J[0],J[1]);break;case"CA":this.current.strokeAlpha=X[1];break;case"ca":this.current.fillAlpha=X[1],this.ctx.globalAlpha=X[1];break;case"BM":this.ctx.globalCompositeOperation=J;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=J?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break}}},beginSMaskGroup:function(){var I=this.current.activeSMask,$=I.canvas.width,V=I.canvas.height,X="smaskGroupAt"+this.groupLevel,Q=this.cachedCanvases.getCanvas(X,$,V,!0),J=this.ctx,ie=J.mozCurrentTransform;this.ctx.save();var ne=Q.context;ne.scale(1/I.scaleX,1/I.scaleY),ne.translate(-I.offsetX,-I.offsetY),ne.transform.apply(ne,ie),I.startTransformInverse=ne.mozCurrentTransformInverse,P(J,ne),this.ctx=ne,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(J),this.groupLevel++},suspendSMaskGroup:function(){var I=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),U(this.ctx,this.current.activeSMask,I,this.webGLContext),this.ctx.restore(),this.ctx.save(),P(I,this.ctx),this.current.resumeSMaskCtx=I;var $=t.Util.transform(this.current.activeSMask.startTransformInverse,I.mozCurrentTransform);this.ctx.transform.apply(this.ctx,$),I.save(),I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,I.canvas.width,I.canvas.height),I.restore()},resumeSMaskGroup:function(){var I=this.current.resumeSMaskCtx,$=this.ctx;this.ctx=I,this.groupStack.push($),this.groupLevel++},endSMaskGroup:function(){var I=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),U(this.ctx,this.current.activeSMask,I,this.webGLContext),this.ctx.restore(),P(I,this.ctx);var $=t.Util.transform(this.current.activeSMask.startTransformInverse,I.mozCurrentTransform);this.ctx.transform.apply(this.ctx,$)},save:function(){this.ctx.save();var I=this.current;this.stateStack.push(I),this.current=I.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),this.current.activeSMask!==null&&(this.stateStack.length===0||this.stateStack[this.stateStack.length-1].activeSMask!==this.current.activeSMask)&&this.endSMaskGroup(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(I,$,V,X,Q,J){this.ctx.transform(I,$,V,X,Q,J),this._cachedGetSinglePixelWidth=null},constructPath:function(I,$){for(var V=this.ctx,X=this.current,Q=X.x,J=X.y,ie=0,ne=0,Z=I.length;ie<Z;ie++)switch(I[ie]|0){case t.OPS.rectangle:Q=$[ne++],J=$[ne++];var se=$[ne++],oe=$[ne++];se===0&&(se=this.getSinglePixelWidth()),oe===0&&(oe=this.getSinglePixelWidth());var de=Q+se,fe=J+oe;this.ctx.moveTo(Q,J),this.ctx.lineTo(de,J),this.ctx.lineTo(de,fe),this.ctx.lineTo(Q,fe),this.ctx.lineTo(Q,J),this.ctx.closePath();break;case t.OPS.moveTo:Q=$[ne++],J=$[ne++],V.moveTo(Q,J);break;case t.OPS.lineTo:Q=$[ne++],J=$[ne++],V.lineTo(Q,J);break;case t.OPS.curveTo:Q=$[ne+4],J=$[ne+5],V.bezierCurveTo($[ne],$[ne+1],$[ne+2],$[ne+3],Q,J),ne+=6;break;case t.OPS.curveTo2:V.bezierCurveTo(Q,J,$[ne],$[ne+1],$[ne+2],$[ne+3]),Q=$[ne+2],J=$[ne+3],ne+=4;break;case t.OPS.curveTo3:Q=$[ne+2],J=$[ne+3],V.bezierCurveTo($[ne],$[ne+1],Q,J,Q,J),ne+=4;break;case t.OPS.closePath:V.closePath();break}X.setCurrentPoint(Q,J)},closePath:function(){this.ctx.closePath()},stroke:function(I){I=typeof I<"u"?I:!0;var $=this.ctx,V=this.current.strokeColor;if($.globalAlpha=this.current.strokeAlpha,V&&V.hasOwnProperty("type")&&V.type==="Pattern"){$.save();const X=$.mozCurrentTransform,Q=t.Util.singularValueDecompose2dScale(X)[0];$.strokeStyle=V.getPattern($,this),$.lineWidth=Math.max(this.getSinglePixelWidth()*f,this.current.lineWidth*Q),$.stroke(),$.restore()}else $.lineWidth=Math.max(this.getSinglePixelWidth()*f,this.current.lineWidth),$.stroke();I&&this.consumePath(),$.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(I){I=typeof I<"u"?I:!0;var $=this.ctx,V=this.current.fillColor,X=this.current.patternFill,Q=!1;X&&($.save(),this.baseTransform&&$.setTransform.apply($,this.baseTransform),$.fillStyle=V.getPattern($,this),Q=!0),this.pendingEOFill?($.fill("evenodd"),this.pendingEOFill=!1):$.fill(),Q&&$.restore(),I&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=ee},eoClip:function(){this.pendingClip=q},beginText:function(){this.current.textMatrix=t.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var I=this.pendingTextPaths,$=this.ctx;if(I===void 0){$.beginPath();return}$.save(),$.beginPath();for(var V=0;V<I.length;V++){var X=I[V];$.setTransform.apply($,X.transform),$.translate(X.x,X.y),X.addToPath($,X.fontSize)}$.restore(),$.clip(),$.beginPath(),delete this.pendingTextPaths},setCharSpacing:function(I){this.current.charSpacing=I},setWordSpacing:function(I){this.current.wordSpacing=I},setHScale:function(I){this.current.textHScale=I/100},setLeading:function(I){this.current.leading=-I},setFont:function(I,$){var V=this.commonObjs.get(I),X=this.current;if(!V)throw new Error(`Can't find font for ${I}`);if(X.fontMatrix=V.fontMatrix?V.fontMatrix:t.FONT_IDENTITY_MATRIX,(X.fontMatrix[0]===0||X.fontMatrix[3]===0)&&(0,t.warn)("Invalid font matrix for font "+I),$<0?($=-$,X.fontDirection=-1):X.fontDirection=1,this.current.font=V,this.current.fontSize=$,V.isType3Font)return;var Q=V.loadedName||"sans-serif";let J="normal";V.black?J="900":V.bold&&(J="bold");var ie=V.italic?"italic":"normal",ne=`"${Q}", ${V.fallbackName}`;let Z=$;$<a?Z=a:$>l&&(Z=l),this.current.fontSizeScale=$/Z,this.ctx.font=`${ie} ${J} ${Z}px ${ne}`},setTextRenderingMode:function(I){this.current.textRenderingMode=I},setTextRise:function(I){this.current.textRise=I},moveText:function(I,$){this.current.x=this.current.lineX+=I,this.current.y=this.current.lineY+=$},setLeadingMoveText:function(I,$){this.setLeading(-$),this.moveText(I,$)},setTextMatrix:function(I,$,V,X,Q,J){this.current.textMatrix=[I,$,V,X,Q,J],this.current.textMatrixScale=Math.sqrt(I*I+$*$),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(G,I,$,V){var X=this.ctx,Q=this.current,J=Q.font,ie=Q.textRenderingMode,ne=Q.fontSize/Q.fontSizeScale,Z=ie&t.TextRenderingMode.FILL_STROKE_MASK,se=!!(ie&t.TextRenderingMode.ADD_TO_PATH_FLAG);const oe=Q.patternFill&&!J.missingFile;var de;if((J.disableFontFace||se||oe)&&(de=J.getPathGenerator(this.commonObjs,G)),J.disableFontFace||oe?(X.save(),X.translate(I,$),X.beginPath(),de(X,ne),V&&X.setTransform.apply(X,V),(Z===t.TextRenderingMode.FILL||Z===t.TextRenderingMode.FILL_STROKE)&&X.fill(),(Z===t.TextRenderingMode.STROKE||Z===t.TextRenderingMode.FILL_STROKE)&&X.stroke(),X.restore()):((Z===t.TextRenderingMode.FILL||Z===t.TextRenderingMode.FILL_STROKE)&&X.fillText(G,I,$),(Z===t.TextRenderingMode.STROKE||Z===t.TextRenderingMode.FILL_STROKE)&&X.strokeText(G,I,$)),se){var fe=this.pendingTextPaths||(this.pendingTextPaths=[]);fe.push({transform:X.mozCurrentTransform,x:I,y:$,fontSize:ne,addToPath:de})}},get isFontSubpixelAAEnabled(){const{context:G}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);G.scale(1.5,1),G.fillText("I",0,10);for(var I=G.getImageData(0,0,10,10).data,$=!1,V=3;V<I.length;V+=4)if(I[V]>0&&I[V]<255){$=!0;break}return(0,t.shadow)(this,"isFontSubpixelAAEnabled",$)},showText:function(I){var $=this.current,V=$.font;if(V.isType3Font)return this.showType3Text(I);var X=$.fontSize;if(X===0)return;var Q=this.ctx,J=$.fontSizeScale,ie=$.charSpacing,ne=$.wordSpacing,Z=$.fontDirection,se=$.textHScale*Z,oe=I.length,de=V.vertical,fe=de?1:-1,ce=V.defaultVMetrics,xe=X*$.fontMatrix[0],Oe=$.textRenderingMode===t.TextRenderingMode.FILL&&!V.disableFontFace&&!$.patternFill;Q.save();let Te;if($.patternFill){Q.save();const je=$.fillColor.getPattern(Q,this);Te=Q.mozCurrentTransform,Q.restore(),Q.fillStyle=je}Q.transform.apply(Q,$.textMatrix),Q.translate($.x,$.y+$.textRise),Z>0?Q.scale(se,-1):Q.scale(se,1);var Ve=$.lineWidth,Ge=$.textMatrixScale;if(Ge===0||Ve===0){var qe=$.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;(qe===t.TextRenderingMode.STROKE||qe===t.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,Ve=this.getSinglePixelWidth()*f)}else Ve/=Ge;J!==1&&(Q.scale(J,J),Ve/=J),Q.lineWidth=Ve;var pt=0,yt;for(yt=0;yt<oe;++yt){var at=I[yt];if((0,t.isNum)(at)){pt+=fe*at*X/1e3;continue}var ht=!1,er=(at.isSpace?ne:0)+ie,Ot=at.fontChar,_t=at.accent,kt,Ft,Ke,mt,ct=at.width;if(de){var he,pe,ve;he=at.vmetric||ce,pe=at.vmetric?he[1]:ct*.5,pe=-pe*xe,ve=he[2]*xe,ct=he?-he[0]:ct,kt=pe/J,Ft=(pt+ve)/J}else kt=pt/J,Ft=0;if(V.remeasure&&ct>0){var Ce=Q.measureText(Ot).width*1e3/X*J;if(ct<Ce&&this.isFontSubpixelAAEnabled){var De=ct/Ce;ht=!0,Q.save(),Q.scale(De,1),kt/=De}else ct!==Ce&&(kt+=(ct-Ce)/2e3*X/J)}(at.isInFont||V.missingFile)&&(Oe&&!_t?Q.fillText(Ot,kt,Ft):(this.paintChar(Ot,kt,Ft,Te),_t&&(Ke=kt+_t.offset.x/J,mt=Ft-_t.offset.y/J,this.paintChar(_t.fontChar,Ke,mt,Te))));var We;de?We=ct*xe-er*Z:We=ct*xe+er*Z,pt+=We,ht&&Q.restore()}de?$.y-=pt:$.x+=pt*se,Q.restore()},showType3Text:function(I){var $=this.ctx,V=this.current,X=V.font,Q=V.fontSize,J=V.fontDirection,ie=X.vertical?1:-1,ne=V.charSpacing,Z=V.wordSpacing,se=V.textHScale*J,oe=V.fontMatrix||t.FONT_IDENTITY_MATRIX,de=I.length,fe=V.textRenderingMode===t.TextRenderingMode.INVISIBLE,ce,xe,Oe,Te;if(!(fe||Q===0)){for(this._cachedGetSinglePixelWidth=null,$.save(),$.transform.apply($,V.textMatrix),$.translate(V.x,V.y),$.scale(se,J),ce=0;ce<de;++ce){if(xe=I[ce],(0,t.isNum)(xe)){Te=ie*xe*Q/1e3,this.ctx.translate(Te,0),V.x+=Te*se;continue}var Ve=(xe.isSpace?Z:0)+ne,Ge=X.charProcOperatorList[xe.operatorListId];if(!Ge){(0,t.warn)(`Type3 character "${xe.operatorListId}" is not available.`);continue}this.processingType3=xe,this.save(),$.scale(Q,Q),$.transform.apply($,oe),this.executeOperatorList(Ge),this.restore();var qe=t.Util.applyTransform([xe.width,0],oe);Oe=qe[0]*Q+Ve,$.translate(Oe,0),V.x+=Oe*se}$.restore(),this.processingType3=null}},setCharWidth:function(I,$){},setCharWidthAndBounds:function(I,$,V,X,Q,J){this.ctx.rect(V,X,Q-V,J-X),this.clip(),this.endPath()},getColorN_Pattern:function(I){var $;if(I[0]==="TilingPattern"){var V=I[1],X=this.baseTransform||this.ctx.mozCurrentTransform.slice(),Q={createCanvasGraphics:J=>new S(J,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};$=new n.TilingPattern(I,V,this.ctx,Q,X)}else $=(0,n.getShadingPatternFromIR)(I);return $},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(I,$,V){var X=t.Util.makeCssRgb(I,$,V);this.ctx.strokeStyle=X,this.current.strokeColor=X},setFillRGBColor:function(I,$,V){var X=t.Util.makeCssRgb(I,$,V);this.ctx.fillStyle=X,this.current.fillColor=X,this.current.patternFill=!1},shadingFill:function(I){var $=this.ctx;this.save();var V=(0,n.getShadingPatternFromIR)(I);$.fillStyle=V.getPattern($,this,!0);var X=$.mozCurrentTransformInverse;if(X){var Q=$.canvas,J=Q.width,ie=Q.height,ne=t.Util.applyTransform([0,0],X),Z=t.Util.applyTransform([0,ie],X),se=t.Util.applyTransform([J,0],X),oe=t.Util.applyTransform([J,ie],X),de=Math.min(ne[0],Z[0],se[0],oe[0]),fe=Math.min(ne[1],Z[1],se[1],oe[1]),ce=Math.max(ne[0],Z[0],se[0],oe[0]),xe=Math.max(ne[1],Z[1],se[1],oe[1]);this.ctx.fillRect(de,fe,ce-de,xe-fe)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,t.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,t.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(I,$){if(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(I)&&I.length===6&&this.transform.apply(this,I),this.baseTransform=this.ctx.mozCurrentTransform,$){var V=$[2]-$[0],X=$[3]-$[1];this.ctx.rect($[0],$[1],V,X),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(I){this.save();var $=this.ctx;I.isolated||(0,t.info)("TODO: Support non-isolated groups."),I.knockout&&(0,t.warn)("Knockout groups not supported.");var V=$.mozCurrentTransform;if(I.matrix&&$.transform.apply($,I.matrix),!I.bbox)throw new Error("Bounding box is required.");var X=t.Util.getAxialAlignedBoundingBox(I.bbox,$.mozCurrentTransform),Q=[0,0,$.canvas.width,$.canvas.height];X=t.Util.intersect(X,Q)||[0,0,0,0];var J=Math.floor(X[0]),ie=Math.floor(X[1]),ne=Math.max(Math.ceil(X[2])-J,1),Z=Math.max(Math.ceil(X[3])-ie,1),se=1,oe=1;ne>u&&(se=ne/u,ne=u),Z>u&&(oe=Z/u,Z=u);var de="groupAt"+this.groupLevel;I.smask&&(de+="_smask_"+this.smaskCounter++%2);var fe=this.cachedCanvases.getCanvas(de,ne,Z,!0),ce=fe.context;ce.scale(1/se,1/oe),ce.translate(-J,-ie),ce.transform.apply(ce,V),I.smask?this.smaskStack.push({canvas:fe.canvas,context:ce,offsetX:J,offsetY:ie,scaleX:se,scaleY:oe,subtype:I.smask.subtype,backdrop:I.smask.backdrop,transferMap:I.smask.transferMap||null,startTransformInverse:null}):($.setTransform(1,0,0,1,0,0),$.translate(J,ie),$.scale(se,oe)),P($,ce),this.ctx=ce,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push($),this.groupLevel++,this.current.activeSMask=null},endGroup:function(I){this.groupLevel--;var $=this.ctx;this.ctx=this.groupStack.pop(),this.ctx.imageSmoothingEnabled!==void 0?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,I.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage($.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(I,$,V){if(this.save(),w(this.ctx),this.current=new _,Array.isArray(I)&&I.length===4){var X=I[2]-I[0],Q=I[3]-I[1];this.ctx.rect(I[0],I[1],X,Q),this.clip(),this.endPath()}this.transform.apply(this,$),this.transform.apply(this,V)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(I){var $=this.ctx,V=I.width,X=I.height,Q=this.current.fillColor,J=this.current.patternFill,ie=this.processingType3;if(ie&&ie.compiled===void 0&&(V<=c&&X<=c?ie.compiled=g({data:I.data,width:V,height:X}):ie.compiled=null),ie&&ie.compiled){ie.compiled($);return}var ne=this.cachedCanvases.getCanvas("maskCanvas",V,X),Z=ne.context;Z.save(),T(Z,I),Z.globalCompositeOperation="source-in",Z.fillStyle=J?Q.getPattern(Z,this):Q,Z.fillRect(0,0,V,X),Z.restore(),this.paintInlineImageXObject(ne.canvas)},paintImageMaskXObjectRepeat:function(I,$,V,X){var Q=I.width,J=I.height,ie=this.current.fillColor,ne=this.current.patternFill,Z=this.cachedCanvases.getCanvas("maskCanvas",Q,J),se=Z.context;se.save(),T(se,I),se.globalCompositeOperation="source-in",se.fillStyle=ne?ie.getPattern(se,this):ie,se.fillRect(0,0,Q,J),se.restore();for(var oe=this.ctx,de=0,fe=X.length;de<fe;de+=2)oe.save(),oe.transform($,0,0,V,X[de],X[de+1]),oe.scale(1,-1),oe.drawImage(Z.canvas,0,0,Q,J,0,-1,1,1),oe.restore()},paintImageMaskXObjectGroup:function(I){for(var $=this.ctx,V=this.current.fillColor,X=this.current.patternFill,Q=0,J=I.length;Q<J;Q++){var ie=I[Q],ne=ie.width,Z=ie.height,se=this.cachedCanvases.getCanvas("maskCanvas",ne,Z),oe=se.context;oe.save(),T(oe,ie),oe.globalCompositeOperation="source-in",oe.fillStyle=X?V.getPattern(oe,this):V,oe.fillRect(0,0,ne,Z),oe.restore(),$.save(),$.transform.apply($,ie.transform),$.scale(1,-1),$.drawImage(se.canvas,0,0,ne,Z,0,-1,1,1),$.restore()}},paintImageXObject:function(I){const $=I.startsWith("g_")?this.commonObjs.get(I):this.objs.get(I);if(!$){(0,t.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject($)},paintImageXObjectRepeat:function(I,$,V,X){const Q=I.startsWith("g_")?this.commonObjs.get(I):this.objs.get(I);if(!Q){(0,t.warn)("Dependent image isn't ready yet");return}for(var J=Q.width,ie=Q.height,ne=[],Z=0,se=X.length;Z<se;Z+=2)ne.push({transform:[$,0,0,V,X[Z],X[Z+1]],x:0,y:0,w:J,h:ie});this.paintInlineImageXObjectGroup(Q,ne)},paintInlineImageXObject:function(I){var $=I.width,V=I.height,X=this.ctx;this.save(),X.scale(1/$,-1/V);var Q=X.mozCurrentTransformInverse,J=Q[0],ie=Q[1],ne=Math.max(Math.sqrt(J*J+ie*ie),1),Z=Q[2],se=Q[3],oe=Math.max(Math.sqrt(Z*Z+se*se),1),de,fe;if(typeof HTMLElement=="function"&&I instanceof HTMLElement||!I.data)de=I;else{fe=this.cachedCanvases.getCanvas("inlineImage",$,V);var ce=fe.context;A(ce,I),de=fe.canvas}for(var xe=$,Oe=V,Te="prescale1";ne>2&&xe>1||oe>2&&Oe>1;){var Ve=xe,Ge=Oe;ne>2&&xe>1&&(Ve=Math.ceil(xe/2),ne/=xe/Ve),oe>2&&Oe>1&&(Ge=Math.ceil(Oe/2),oe/=Oe/Ge),fe=this.cachedCanvases.getCanvas(Te,Ve,Ge),ce=fe.context,ce.clearRect(0,0,Ve,Ge),ce.drawImage(de,0,0,xe,Oe,0,0,Ve,Ge),de=fe.canvas,xe=Ve,Oe=Ge,Te=Te==="prescale1"?"prescale2":"prescale1"}if(X.drawImage(de,0,0,xe,Oe,0,-V,$,V),this.imageLayer){var qe=this.getCanvasPosition(0,-V);this.imageLayer.appendImage({imgData:I,left:qe[0],top:qe[1],width:$/Q[0],height:V/Q[3]})}this.restore()},paintInlineImageXObjectGroup:function(I,$){var V=this.ctx,X=I.width,Q=I.height,J=this.cachedCanvases.getCanvas("inlineImage",X,Q),ie=J.context;A(ie,I);for(var ne=0,Z=$.length;ne<Z;ne++){var se=$[ne];if(V.save(),V.transform.apply(V,se.transform),V.scale(1,-1),V.drawImage(J.canvas,se.x,se.y,se.w,se.h,0,-1,1,1),this.imageLayer){var oe=this.getCanvasPosition(se.x,se.y);this.imageLayer.appendImage({imgData:I,left:oe[0],top:oe[1],width:X,height:Q})}V.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},paintXObject:function(){(0,t.warn)("Unsupported 'paintXObject' command.")},markPoint:function(I){},markPointProps:function(I,$){},beginMarkedContent:function(I){},beginMarkedContentProps:function(I,$){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var I=this.ctx;this.pendingClip&&(this.pendingClip===q?I.clip("evenodd"):I.clip(),this.pendingClip=null),I.beginPath()},getSinglePixelWidth(G){if(this._cachedGetSinglePixelWidth===null){const I=this.ctx.mozCurrentTransformInverse;this._cachedGetSinglePixelWidth=Math.sqrt(Math.max(I[0]*I[0]+I[1]*I[1],I[2]*I[2]+I[3]*I[3]))}return this._cachedGetSinglePixelWidth},getCanvasPosition:function(I,$){var V=this.ctx.mozCurrentTransform;return[V[0]*I+V[2]*$+V[4],V[1]*I+V[3]*$+V[5]]}};for(var B in t.OPS)S.prototype[t.OPS[B]]=S.prototype[B];return S}();e.CanvasGraphics=p},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.getShadingPatternFromIR=u,e.TilingPattern=void 0;var t=r(2),n={};function a(c,h){if(!h||typeof Path2D>"u")return;const y=h[2]-h[0],E=h[3]-h[1],g=new Path2D;g.rect(h[0],h[1],y,E),c.clip(g)}n.RadialAxial={fromIR:function(h){var y=h[1],E=h[2],g=h[3],_=h[4],p=h[5],x=h[6],C=h[7];return{type:"Pattern",getPattern:function(S){a(S,E);var A;y==="axial"?A=S.createLinearGradient(_[0],_[1],p[0],p[1]):y==="radial"&&(A=S.createRadialGradient(_[0],_[1],x,p[0],p[1],C));for(var T=0,P=g.length;T<P;++T){var w=g[T];A.addColorStop(w[0],w[1])}return A}}}};var l=function(){function h(g,_,p,x,C,R,S,A){var T=_.coords,P=_.colors,w=g.data,O=g.width*4,k;T[p+1]>T[x+1]&&(k=p,p=x,x=k,k=R,R=S,S=k),T[x+1]>T[C+1]&&(k=x,x=C,C=k,k=S,S=A,A=k),T[p+1]>T[x+1]&&(k=p,p=x,x=k,k=R,R=S,S=k);var D=(T[p]+_.offsetX)*_.scaleX,F=(T[p+1]+_.offsetY)*_.scaleY,U=(T[x]+_.offsetX)*_.scaleX,H=(T[x+1]+_.offsetY)*_.scaleY,W=(T[C]+_.offsetX)*_.scaleX,ee=(T[C+1]+_.offsetY)*_.scaleY;if(!(F>=ee))for(var q=P[R],B=P[R+1],G=P[R+2],I=P[S],$=P[S+1],V=P[S+2],X=P[A],Q=P[A+1],J=P[A+2],ie=Math.round(F),ne=Math.round(ee),Z,se,oe,de,fe,ce,xe,Oe,Te=ie;Te<=ne;Te++){if(Te<H){let at;Te<F?at=0:F===H?at=1:at=(F-Te)/(F-H),Z=D-(D-U)*at,se=q-(q-I)*at,oe=B-(B-$)*at,de=G-(G-V)*at}else{let at;Te>ee?at=1:H===ee?at=0:at=(H-Te)/(H-ee),Z=U-(U-W)*at,se=I-(I-X)*at,oe=$-($-Q)*at,de=V-(V-J)*at}let yt;Te<F?yt=0:Te>ee?yt=1:yt=(F-Te)/(F-ee),fe=D-(D-W)*yt,ce=q-(q-X)*yt,xe=B-(B-Q)*yt,Oe=G-(G-J)*yt;for(var Ve=Math.round(Math.min(Z,fe)),Ge=Math.round(Math.max(Z,fe)),qe=O*Te+Ve*4,pt=Ve;pt<=Ge;pt++)yt=(Z-pt)/(Z-fe),yt<0?yt=0:yt>1&&(yt=1),w[qe++]=se-(se-ce)*yt|0,w[qe++]=oe-(oe-xe)*yt|0,w[qe++]=de-(de-Oe)*yt|0,w[qe++]=255}}function y(g,_,p){var x=_.coords,C=_.colors,R,S;switch(_.type){case"lattice":var A=_.verticesPerRow,T=Math.floor(x.length/A)-1,P=A-1;for(R=0;R<T;R++)for(var w=R*A,O=0;O<P;O++,w++)h(g,p,x[w],x[w+1],x[w+A],C[w],C[w+1],C[w+A]),h(g,p,x[w+A+1],x[w+1],x[w+A],C[w+A+1],C[w+1],C[w+A]);break;case"triangles":for(R=0,S=x.length;R<S;R+=3)h(g,p,x[R],x[R+1],x[R+2],C[R],C[R+1],C[R+2]);break;default:throw new Error("illegal figure")}}function E(g,_,p,x,C,R,S,A){var T=1.1,P=3e3,w=2,O=Math.floor(g[0]),k=Math.floor(g[1]),D=Math.ceil(g[2])-O,F=Math.ceil(g[3])-k,U=Math.min(Math.ceil(Math.abs(D*_[0]*T)),P),H=Math.min(Math.ceil(Math.abs(F*_[1]*T)),P),W=D/U,ee=F/H,q={coords:p,colors:x,offsetX:-O,offsetY:-k,scaleX:1/W,scaleY:1/ee},B=U+w*2,G=H+w*2,I,$,V,X;if(A.isEnabled)I=A.drawFigures({width:U,height:H,backgroundColor:R,figures:C,context:q}),$=S.getCanvas("mesh",B,G,!1),$.context.drawImage(I,w,w),I=$.canvas;else{$=S.getCanvas("mesh",B,G,!1);var Q=$.context,J=Q.createImageData(U,H);if(R){var ie=J.data;for(V=0,X=ie.length;V<X;V+=4)ie[V]=R[0],ie[V+1]=R[1],ie[V+2]=R[2],ie[V+3]=255}for(V=0;V<C.length;V++)y(J,C[V],q);Q.putImageData(J,w,w),I=$.canvas}return{canvas:I,offsetX:O-w*W,offsetY:k-w*ee,scaleX:W,scaleY:ee}}return E}();n.Mesh={fromIR:function(h){var y=h[2],E=h[3],g=h[4],_=h[5],p=h[6],x=h[7],C=h[8];return{type:"Pattern",getPattern:function(S,A,T){a(S,x);var P;if(T)P=t.Util.singularValueDecompose2dScale(S.mozCurrentTransform);else if(P=t.Util.singularValueDecompose2dScale(A.baseTransform),p){var w=t.Util.singularValueDecompose2dScale(p);P=[P[0]*w[0],P[1]*w[1]]}var O=l(_,P,y,E,g,T?null:C,A.cachedCanvases,A.webGLContext);return T||(S.setTransform.apply(S,A.baseTransform),p&&S.transform.apply(S,p)),S.translate(O.offsetX,O.offsetY),S.scale(O.scaleX,O.scaleY),S.createPattern(O.canvas,"no-repeat")}}}},n.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};function u(c){var h=n[c[0]];if(!h)throw new Error(`Unknown IR type: ${c[0]}`);return h.fromIR(c)}var f=function(){var h={COLORED:1,UNCOLORED:2},y=3e3;function E(g,_,p,x,C){this.operatorList=g[2],this.matrix=g[3]||[1,0,0,1,0,0],this.bbox=g[4],this.xstep=g[5],this.ystep=g[6],this.paintType=g[7],this.tilingType=g[8],this.color=_,this.canvasGraphicsFactory=x,this.baseTransform=C,this.type="Pattern",this.ctx=p}return E.prototype={createPatternCanvas:function(_){var p=this.operatorList,x=this.bbox,C=this.xstep,R=this.ystep,S=this.paintType,A=this.tilingType,T=this.color,P=this.canvasGraphicsFactory;(0,t.info)("TilingType: "+A);var w=x[0],O=x[1],k=x[2],D=x[3],F=t.Util.singularValueDecompose2dScale(this.matrix),U=t.Util.singularValueDecompose2dScale(this.baseTransform),H=[F[0]*U[0],F[1]*U[1]],W=this.getSizeAndScale(C,this.ctx.canvas.width,H[0]),ee=this.getSizeAndScale(R,this.ctx.canvas.height,H[1]),q=_.cachedCanvases.getCanvas("pattern",W.size,ee.size,!0),B=q.context,G=P.createCanvasGraphics(B);return G.groupLevel=_.groupLevel,this.setFillAndStrokeStyleToContext(G,S,T),G.transform(W.scale,0,0,ee.scale,0,0),G.transform(1,0,0,1,-w,-O),this.clipBbox(G,x,w,O,k,D),G.executeOperatorList(p),this.ctx.transform(1,0,0,1,w,O),this.ctx.scale(1/W.scale,1/ee.scale),q.canvas},getSizeAndScale:function(_,p,x){_=Math.abs(_);var C=Math.max(y,p),R=Math.ceil(_*x);return R>=C?R=C:x=R/_,{scale:x,size:R}},clipBbox:function(_,p,x,C,R,S){if(Array.isArray(p)&&p.length===4){var A=R-x,T=S-C;_.ctx.rect(x,C,A,T),_.clip(),_.endPath()}},setFillAndStrokeStyleToContext:function(_,p,x){const C=_.ctx,R=_.current;switch(p){case h.COLORED:var S=this.ctx;C.fillStyle=S.fillStyle,C.strokeStyle=S.strokeStyle,R.fillColor=S.fillStyle,R.strokeColor=S.strokeStyle;break;case h.UNCOLORED:var A=t.Util.makeCssRgb(x[0],x[1],x[2]);C.fillStyle=A,C.strokeStyle=A,R.fillColor=A,R.strokeColor=A;break;default:throw new t.FormatError(`Unsupported paint type: ${p}`)}},getPattern:function(_,p){_=this.ctx,_.setTransform.apply(_,this.baseTransform),_.transform.apply(_,this.matrix);var x=this.createPatternCanvas(p);return _.createPattern(x,"repeat")}},E}();e.TilingPattern=f},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const t=Object.create(null);e.GlobalWorkerOptions=t,t.workerPort=t.workerPort===void 0?null:t.workerPort,t.workerSrc=t.workerSrc===void 0?"":t.workerSrc},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var t=r(2);const n={UNKNOWN:0,DATA:1,ERROR:2},a={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function l(f){if(typeof f!="object"||f===null)return f;switch(f.name){case"AbortException":return new t.AbortException(f.message);case"MissingPDFException":return new t.MissingPDFException(f.message);case"UnexpectedResponseException":return new t.UnexpectedResponseException(f.message,f.status);case"UnknownErrorException":return new t.UnknownErrorException(f.message,f.details);default:return new t.UnknownErrorException(f.message,f.toString())}}class u{constructor(c,h,y){this.sourceName=c,this.targetName=h,this.comObj=y,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=E=>{const g=E.data;if(g.targetName!==this.sourceName)return;if(g.stream){this._processStreamMessage(g);return}if(g.callback){const p=g.callbackId,x=this.callbackCapabilities[p];if(!x)throw new Error(`Cannot resolve callback ${p}`);if(delete this.callbackCapabilities[p],g.callback===n.DATA)x.resolve(g.data);else if(g.callback===n.ERROR)x.reject(l(g.reason));else throw new Error("Unexpected callback case");return}const _=this.actionHandler[g.action];if(!_)throw new Error(`Unknown action from worker: ${g.action}`);if(g.callbackId){const p=this.sourceName,x=g.sourceName;new Promise(function(C){C(_(g.data))}).then(function(C){y.postMessage({sourceName:p,targetName:x,callback:n.DATA,callbackId:g.callbackId,data:C})},function(C){y.postMessage({sourceName:p,targetName:x,callback:n.ERROR,callbackId:g.callbackId,reason:l(C)})});return}if(g.streamId){this._createStreamSink(g);return}_(g.data)},y.addEventListener("message",this._onComObjOnMessage)}on(c,h){const y=this.actionHandler;if(y[c])throw new Error(`There is already an actionName called "${c}"`);y[c]=h}send(c,h,y){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:c,data:h},y)}sendWithPromise(c,h,y){const E=this.callbackId++,g=(0,t.createPromiseCapability)();this.callbackCapabilities[E]=g;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:c,callbackId:E,data:h},y)}catch(_){g.reject(_)}return g.promise}sendWithStream(c,h,y,E){const g=this.streamId++,_=this.sourceName,p=this.targetName,x=this.comObj;return new ReadableStream({start:C=>{const R=(0,t.createPromiseCapability)();return this.streamControllers[g]={controller:C,startCall:R,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:_,targetName:p,action:c,streamId:g,data:h,desiredSize:C.desiredSize},E),R.promise},pull:C=>{const R=(0,t.createPromiseCapability)();return this.streamControllers[g].pullCall=R,x.postMessage({sourceName:_,targetName:p,stream:a.PULL,streamId:g,desiredSize:C.desiredSize}),R.promise},cancel:C=>{(0,t.assert)(C instanceof Error,"cancel must have a valid reason");const R=(0,t.createPromiseCapability)();return this.streamControllers[g].cancelCall=R,this.streamControllers[g].isClosed=!0,x.postMessage({sourceName:_,targetName:p,stream:a.CANCEL,streamId:g,reason:l(C)}),R.promise}},y)}_createStreamSink(c){const h=this,y=this.actionHandler[c.action],E=c.streamId,g=this.sourceName,_=c.sourceName,p=this.comObj,x={enqueue(C,R=1,S){if(this.isCancelled)return;const A=this.desiredSize;this.desiredSize-=R,A>0&&this.desiredSize<=0&&(this.sinkCapability=(0,t.createPromiseCapability)(),this.ready=this.sinkCapability.promise),h._postMessage({sourceName:g,targetName:_,stream:a.ENQUEUE,streamId:E,chunk:C},S)},close(){this.isCancelled||(this.isCancelled=!0,p.postMessage({sourceName:g,targetName:_,stream:a.CLOSE,streamId:E}),delete h.streamSinks[E])},error(C){(0,t.assert)(C instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,p.postMessage({sourceName:g,targetName:_,stream:a.ERROR,streamId:E,reason:l(C)}))},sinkCapability:(0,t.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:c.desiredSize,ready:null};x.sinkCapability.resolve(),x.ready=x.sinkCapability.promise,this.streamSinks[E]=x,new Promise(function(C){C(y(c.data,x))}).then(function(){p.postMessage({sourceName:g,targetName:_,stream:a.START_COMPLETE,streamId:E,success:!0})},function(C){p.postMessage({sourceName:g,targetName:_,stream:a.START_COMPLETE,streamId:E,reason:l(C)})})}_processStreamMessage(c){const h=c.streamId,y=this.sourceName,E=c.sourceName,g=this.comObj;switch(c.stream){case a.START_COMPLETE:c.success?this.streamControllers[h].startCall.resolve():this.streamControllers[h].startCall.reject(l(c.reason));break;case a.PULL_COMPLETE:c.success?this.streamControllers[h].pullCall.resolve():this.streamControllers[h].pullCall.reject(l(c.reason));break;case a.PULL:if(!this.streamSinks[h]){g.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,success:!0});break}this.streamSinks[h].desiredSize<=0&&c.desiredSize>0&&this.streamSinks[h].sinkCapability.resolve(),this.streamSinks[h].desiredSize=c.desiredSize;const{onPull:_}=this.streamSinks[c.streamId];new Promise(function(x){x(_&&_())}).then(function(){g.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,success:!0})},function(x){g.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,reason:l(x)})});break;case a.ENQUEUE:if((0,t.assert)(this.streamControllers[h],"enqueue should have stream controller"),this.streamControllers[h].isClosed)break;this.streamControllers[h].controller.enqueue(c.chunk);break;case a.CLOSE:if((0,t.assert)(this.streamControllers[h],"close should have stream controller"),this.streamControllers[h].isClosed)break;this.streamControllers[h].isClosed=!0,this.streamControllers[h].controller.close(),this._deleteStreamController(h);break;case a.ERROR:(0,t.assert)(this.streamControllers[h],"error should have stream controller"),this.streamControllers[h].controller.error(l(c.reason)),this._deleteStreamController(h);break;case a.CANCEL_COMPLETE:c.success?this.streamControllers[h].cancelCall.resolve():this.streamControllers[h].cancelCall.reject(l(c.reason)),this._deleteStreamController(h);break;case a.CANCEL:if(!this.streamSinks[h])break;const{onCancel:p}=this.streamSinks[c.streamId];new Promise(function(x){x(p&&p(l(c.reason)))}).then(function(){g.postMessage({sourceName:y,targetName:E,stream:a.CANCEL_COMPLETE,streamId:h,success:!0})},function(x){g.postMessage({sourceName:y,targetName:E,stream:a.CANCEL_COMPLETE,streamId:h,reason:l(x)})}),this.streamSinks[h].sinkCapability.reject(l(c.reason)),this.streamSinks[h].isCancelled=!0,delete this.streamSinks[h];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(c){await Promise.allSettled([this.streamControllers[c].startCall,this.streamControllers[c].pullCall,this.streamControllers[c].cancelCall].map(function(h){return h&&h.promise})),delete this.streamControllers[c]}_postMessage(c,h){h&&this.postMessageTransfers?this.comObj.postMessage(c,h):this.comObj.postMessage(c)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}e.MessageHandler=u},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var t=r(2),n=r(13);class a{constructor(u){(0,t.assert)(typeof u=="string","Metadata: input is not a string"),u=this._repair(u);const c=new n.SimpleXMLParser().parseFromString(u);this._metadataMap=new Map,c&&this._parse(c)}_repair(u){return u.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,function(f,c){const h=c.replace(/\\([0-3])([0-7])([0-7])/g,function(E,g,_,p){return String.fromCharCode(g*64+_*8+p*1)}).replace(/&(amp|apos|gt|lt|quot);/g,function(E,g){switch(g){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${g} isn't defined.`)});let y="";for(let E=0,g=h.length;E<g;E+=2){const _=h.charCodeAt(E)*256+h.charCodeAt(E+1);_>=32&&_<127&&_!==60&&_!==62&&_!==38?y+=String.fromCharCode(_):y+="&#x"+(65536+_).toString(16).substring(1)+";"}return">"+y})}_parse(u){let f=u.documentElement;if(f.nodeName.toLowerCase()!=="rdf:rdf")for(f=f.firstChild;f&&f.nodeName.toLowerCase()!=="rdf:rdf";)f=f.nextSibling;const c=f?f.nodeName.toLowerCase():null;if(!f||c!=="rdf:rdf"||!f.hasChildNodes())return;const h=f.childNodes;for(let y=0,E=h.length;y<E;y++){const g=h[y];if(g.nodeName.toLowerCase()==="rdf:description"){for(let _=0,p=g.childNodes.length;_<p;_++)if(g.childNodes[_].nodeName.toLowerCase()!=="#text"){const x=g.childNodes[_],C=x.nodeName.toLowerCase();this._metadataMap.set(C,x.textContent.trim())}}}}get(u){return this._metadataMap.has(u)?this._metadataMap.get(u):null}getAll(){const u=Object.create(null);for(const[f,c]of this._metadataMap)u[f]=c;return u}has(u){return this._metadataMap.has(u)}}e.Metadata=a},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleXMLParser=void 0;const t={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};function n(c,h){const y=c[h];return y===" "||y===`
30
30
  `||y==="\r"||y===" "}function a(c){for(let h=0,y=c.length;h<y;h++)if(!n(c,h))return!1;return!0}class l{_resolveEntities(h){return h.replace(/&([^;]+);/g,(y,E)=>{if(E.substring(0,2)==="#x")return String.fromCharCode(parseInt(E.substring(2),16));if(E.substring(0,1)==="#")return String.fromCharCode(parseInt(E.substring(1),10));switch(E){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(E)})}_parseContent(h,y){const E=[];let g=y;function _(){for(;g<h.length&&n(h,g);)++g}for(;g<h.length&&!n(h,g)&&h[g]!==">"&&h[g]!=="/";)++g;const p=h.substring(y,g);for(_();g<h.length&&h[g]!==">"&&h[g]!=="/"&&h[g]!=="?";){_();let x="",C="";for(;g<h.length&&!n(h,g)&&h[g]!=="=";)x+=h[g],++g;if(_(),h[g]!=="=")return null;++g,_();const R=h[g];if(R!=='"'&&R!=="'")return null;const S=h.indexOf(R,++g);if(S<0)return null;C=h.substring(g,S),E.push({name:x,value:this._resolveEntities(C)}),g=S+1,_()}return{name:p,attributes:E,parsed:g-y}}_parseProcessingInstruction(h,y){let E=y;function g(){for(;E<h.length&&n(h,E);)++E}for(;E<h.length&&!n(h,E)&&h[E]!==">"&&h[E]!=="/";)++E;const _=h.substring(y,E);g();const p=E;for(;E<h.length&&(h[E]!=="?"||h[E+1]!==">");)++E;const x=h.substring(p,E);return{name:_,value:x,parsed:E-y}}parseXml(h){let y=0;for(;y<h.length;){const E=h[y];let g=y;if(E==="<"){++g;const _=h[g];let p;switch(_){case"/":if(++g,p=h.indexOf(">",g),p<0){this.onError(t.UnterminatedElement);return}this.onEndElement(h.substring(g,p)),g=p+1;break;case"?":++g;const x=this._parseProcessingInstruction(h,g);if(h.substring(g+x.parsed,g+x.parsed+2)!=="?>"){this.onError(t.UnterminatedXmlDeclaration);return}this.onPi(x.name,x.value),g+=x.parsed+2;break;case"!":if(h.substring(g+1,g+3)==="--"){if(p=h.indexOf("-->",g+3),p<0){this.onError(t.UnterminatedComment);return}this.onComment(h.substring(g+3,p)),g=p+3}else if(h.substring(g+1,g+8)==="[CDATA["){if(p=h.indexOf("]]>",g+8),p<0){this.onError(t.UnterminatedCdat);return}this.onCdata(h.substring(g+8,p)),g=p+3}else if(h.substring(g+1,g+8)==="DOCTYPE"){const S=h.indexOf("[",g+8);let A=!1;if(p=h.indexOf(">",g+8),p<0){this.onError(t.UnterminatedDoctypeDeclaration);return}if(S>0&&p>S){if(p=h.indexOf("]>",g+8),p<0){this.onError(t.UnterminatedDoctypeDeclaration);return}A=!0}const T=h.substring(g+8,p+(A?1:0));this.onDoctype(T),g=p+(A?2:1)}else{this.onError(t.MalformedElement);return}break;default:const C=this._parseContent(h,g);if(C===null){this.onError(t.MalformedElement);return}let R=!1;if(h.substring(g+C.parsed,g+C.parsed+2)==="/>")R=!0;else if(h.substring(g+C.parsed,g+C.parsed+1)!==">"){this.onError(t.UnterminatedElement);return}this.onBeginElement(C.name,C.attributes,R),g+=C.parsed+(R?2:1);break}}else{for(;g<h.length&&h[g]!=="<";)g++;const _=h.substring(y,g);this.onText(this._resolveEntities(_))}y=g}}onResolveEntity(h){return`&${h};`}onPi(h,y){}onComment(h){}onCdata(h){}onDoctype(h){}onText(h){}onBeginElement(h,y,E){}onEndElement(h){}onError(h){}}class u{constructor(h,y){this.nodeName=h,this.nodeValue=y,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const h=this.parentNode.childNodes;if(!h)return;const y=h.indexOf(this);if(y!==-1)return h[y+1]}get textContent(){return this.childNodes?this.childNodes.map(function(h){return h.textContent}).join(""):this.nodeValue||""}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}}class f extends l{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=t.NoError}parseFromString(h){if(this._currentFragment=[],this._stack=[],this._errorCode=t.NoError,this.parseXml(h),this._errorCode!==t.NoError)return;const[y]=this._currentFragment;if(y)return{documentElement:y}}onResolveEntity(h){switch(h){case"apos":return"'"}return super.onResolveEntity(h)}onText(h){if(a(h))return;const y=new u("#text",h);this._currentFragment.push(y)}onCdata(h){const y=new u("#text",h);this._currentFragment.push(y)}onBeginElement(h,y,E){const g=new u(h);g.childNodes=[],this._currentFragment.push(g),!E&&(this._stack.push(this._currentFragment),this._currentFragment=g.childNodes)}onEndElement(h){this._currentFragment=this._stack.pop()||[];const y=this._currentFragment[this._currentFragment.length-1];if(y)for(let E=0,g=y.childNodes.length;E<g;E++)y.childNodes[E].parentNode=y}onError(h){this._errorCode=h}}e.SimpleXMLParser=f},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var t=r(2);class n{constructor(f,c){(0,t.assert)(c,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=f.progressiveDone||!1;const h=f.initialData;if(h&&h.length>0){const y=new Uint8Array(h).buffer;this._queuedChunks.push(y)}this._pdfDataRangeTransport=c,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._contentLength=f.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((y,E)=>{this._onReceiveData({begin:y,chunk:E})}),this._pdfDataRangeTransport.addProgressListener((y,E)=>{this._onProgress({loaded:y,total:E})}),this._pdfDataRangeTransport.addProgressiveReadListener(y=>{this._onReceiveData({chunk:y})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(f){const c=new Uint8Array(f.chunk).buffer;if(f.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(c):this._queuedChunks.push(c);else{const h=this._rangeReaders.some(function(y){return y._begin!==f.begin?!1:(y._enqueue(c),!0)});(0,t.assert)(h,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(f){if(f.total===void 0){const c=this._rangeReaders[0];c&&c.onProgress&&c.onProgress({loaded:f.loaded})}else{const c=this._fullRequestReader;c&&c.onProgress&&c.onProgress({loaded:f.loaded,total:f.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(f){const c=this._rangeReaders.indexOf(f);c>=0&&this._rangeReaders.splice(c,1)}getFullReader(){(0,t.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const f=this._queuedChunks;return this._queuedChunks=null,new a(this,f,this._progressiveDone)}getRangeReader(f,c){if(c<=this._progressiveDataLength)return null;const h=new l(this,f,c);return this._pdfDataRangeTransport.requestDataRange(f,c),this._rangeReaders.push(h),h}cancelAllRequests(f){this._fullRequestReader&&this._fullRequestReader.cancel(f),this._rangeReaders.slice(0).forEach(function(h){h.cancel(f)}),this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=n;class a{constructor(f,c,h=!1){this._stream=f,this._done=h||!1,this._filename=null,this._queuedChunks=c||[],this._loaded=0;for(const y of this._queuedChunks)this._loaded+=y.byteLength;this._requests=[],this._headersReady=Promise.resolve(),f._fullRequestReader=this,this.onProgress=null}_enqueue(f){this._done||(this._requests.length>0?this._requests.shift().resolve({value:f,done:!1}):this._queuedChunks.push(f),this._loaded+=f.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 f=(0,t.createPromiseCapability)();return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._requests.forEach(function(c){c.resolve({value:void 0,done:!0})}),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class l{constructor(f,c,h){this._stream=f,this._begin=c,this._end=h,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(f){this._done||(this._requests.length===0?this._queuedChunk=f:(this._requests.shift().resolve({value:f,done:!1}),this._requests.forEach(function(h){h.resolve({value:void 0,done:!0})}),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const c=this._queuedChunk;return this._queuedChunk=null,{value:c,done:!1}}if(this._done)return{value:void 0,done:!0};const f=(0,t.createPromiseCapability)();return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._requests.forEach(function(c){c.resolve({value:void 0,done:!0})}),this._requests=[],this._stream._removeRangeReader(this)}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=void 0;var t=r(2);class n{constructor({enable:u=!1}){this._enabled=u===!0}get isEnabled(){let u=this._enabled;return u&&(u=a.tryInitGL()),(0,t.shadow)(this,"isEnabled",u)}composeSMask({layer:u,mask:f,properties:c}){return a.composeSMask(u,f,c)}drawFigures({width:u,height:f,backgroundColor:c,figures:h,context:y}){return a.drawFigures(u,f,c,h,y)}clear(){a.cleanup()}}e.WebGLContext=n;var a=function(){function u(k,D,F){var U=k.createShader(F);k.shaderSource(U,D),k.compileShader(U);var H=k.getShaderParameter(U,k.COMPILE_STATUS);if(!H){var W=k.getShaderInfoLog(U);throw new Error("Error during shader compilation: "+W)}return U}function f(k,D){return u(k,D,k.VERTEX_SHADER)}function c(k,D){return u(k,D,k.FRAGMENT_SHADER)}function h(k,D){for(var F=k.createProgram(),U=0,H=D.length;U<H;++U)k.attachShader(F,D[U]);k.linkProgram(F);var W=k.getProgramParameter(F,k.LINK_STATUS);if(!W){var ee=k.getProgramInfoLog(F);throw new Error("Error during program linking: "+ee)}return F}function y(k,D,F){k.activeTexture(F);var U=k.createTexture();return k.bindTexture(k.TEXTURE_2D,U),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,D),U}var E,g;function _(){E||(g=document.createElement("canvas"),E=g.getContext("webgl",{premultipliedalpha:!1}))}var p=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",x=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",C=null;function R(){var k,D;_(),k=g,g=null,D=E,E=null;var F=f(D,p),U=c(D,x),H=h(D,[F,U]);D.useProgram(H);var W={};W.gl=D,W.canvas=k,W.resolutionLocation=D.getUniformLocation(H,"u_resolution"),W.positionLocation=D.getAttribLocation(H,"a_position"),W.backdropLocation=D.getUniformLocation(H,"u_backdrop"),W.subtypeLocation=D.getUniformLocation(H,"u_subtype");var ee=D.getAttribLocation(H,"a_texCoord"),q=D.getUniformLocation(H,"u_image"),B=D.getUniformLocation(H,"u_mask"),G=D.createBuffer();D.bindBuffer(D.ARRAY_BUFFER,G),D.bufferData(D.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),D.STATIC_DRAW),D.enableVertexAttribArray(ee),D.vertexAttribPointer(ee,2,D.FLOAT,!1,0,0),D.uniform1i(q,0),D.uniform1i(B,1),C=W}function S(k,D,F){var U=k.width,H=k.height;C||R();var W=C,ee=W.canvas,q=W.gl;ee.width=U,ee.height=H,q.viewport(0,0,q.drawingBufferWidth,q.drawingBufferHeight),q.uniform2f(W.resolutionLocation,U,H),F.backdrop?q.uniform4f(W.resolutionLocation,F.backdrop[0],F.backdrop[1],F.backdrop[2],1):q.uniform4f(W.resolutionLocation,0,0,0,0),q.uniform1i(W.subtypeLocation,F.subtype==="Luminosity"?1:0);var B=y(q,k,q.TEXTURE0),G=y(q,D,q.TEXTURE1),I=q.createBuffer();return q.bindBuffer(q.ARRAY_BUFFER,I),q.bufferData(q.ARRAY_BUFFER,new Float32Array([0,0,U,0,0,H,0,H,U,0,U,H]),q.STATIC_DRAW),q.enableVertexAttribArray(W.positionLocation),q.vertexAttribPointer(W.positionLocation,2,q.FLOAT,!1,0,0),q.clearColor(0,0,0,0),q.enable(q.BLEND),q.blendFunc(q.ONE,q.ONE_MINUS_SRC_ALPHA),q.clear(q.COLOR_BUFFER_BIT),q.drawArrays(q.TRIANGLES,0,6),q.flush(),q.deleteTexture(B),q.deleteTexture(G),q.deleteBuffer(I),ee}var A=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",T=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",P=null;function w(){var k,D;_(),k=g,g=null,D=E,E=null;var F=f(D,A),U=c(D,T),H=h(D,[F,U]);D.useProgram(H);var W={};W.gl=D,W.canvas=k,W.resolutionLocation=D.getUniformLocation(H,"u_resolution"),W.scaleLocation=D.getUniformLocation(H,"u_scale"),W.offsetLocation=D.getUniformLocation(H,"u_offset"),W.positionLocation=D.getAttribLocation(H,"a_position"),W.colorLocation=D.getAttribLocation(H,"a_color"),P=W}function O(k,D,F,U,H){P||w();var W=P,ee=W.canvas,q=W.gl;ee.width=k,ee.height=D,q.viewport(0,0,q.drawingBufferWidth,q.drawingBufferHeight),q.uniform2f(W.resolutionLocation,k,D);var B=0,G,I,$;for(G=0,I=U.length;G<I;G++)switch(U[G].type){case"lattice":$=U[G].coords.length/U[G].verticesPerRow|0,B+=($-1)*(U[G].verticesPerRow-1)*6;break;case"triangles":B+=U[G].coords.length;break}var V=new Float32Array(B*2),X=new Uint8Array(B*3),Q=H.coords,J=H.colors,ie=0,ne=0;for(G=0,I=U.length;G<I;G++){var Z=U[G],se=Z.coords,oe=Z.colors;switch(Z.type){case"lattice":var de=Z.verticesPerRow;$=se.length/de|0;for(var fe=1;fe<$;fe++)for(var ce=fe*de+1,xe=1;xe<de;xe++,ce++)V[ie]=Q[se[ce-de-1]],V[ie+1]=Q[se[ce-de-1]+1],V[ie+2]=Q[se[ce-de]],V[ie+3]=Q[se[ce-de]+1],V[ie+4]=Q[se[ce-1]],V[ie+5]=Q[se[ce-1]+1],X[ne]=J[oe[ce-de-1]],X[ne+1]=J[oe[ce-de-1]+1],X[ne+2]=J[oe[ce-de-1]+2],X[ne+3]=J[oe[ce-de]],X[ne+4]=J[oe[ce-de]+1],X[ne+5]=J[oe[ce-de]+2],X[ne+6]=J[oe[ce-1]],X[ne+7]=J[oe[ce-1]+1],X[ne+8]=J[oe[ce-1]+2],V[ie+6]=V[ie+2],V[ie+7]=V[ie+3],V[ie+8]=V[ie+4],V[ie+9]=V[ie+5],V[ie+10]=Q[se[ce]],V[ie+11]=Q[se[ce]+1],X[ne+9]=X[ne+3],X[ne+10]=X[ne+4],X[ne+11]=X[ne+5],X[ne+12]=X[ne+6],X[ne+13]=X[ne+7],X[ne+14]=X[ne+8],X[ne+15]=J[oe[ce]],X[ne+16]=J[oe[ce]+1],X[ne+17]=J[oe[ce]+2],ie+=12,ne+=18;break;case"triangles":for(var Oe=0,Te=se.length;Oe<Te;Oe++)V[ie]=Q[se[Oe]],V[ie+1]=Q[se[Oe]+1],X[ne]=J[oe[Oe]],X[ne+1]=J[oe[Oe]+1],X[ne+2]=J[oe[Oe]+2],ie+=2,ne+=3;break}}F?q.clearColor(F[0]/255,F[1]/255,F[2]/255,1):q.clearColor(0,0,0,0),q.clear(q.COLOR_BUFFER_BIT);var Ve=q.createBuffer();q.bindBuffer(q.ARRAY_BUFFER,Ve),q.bufferData(q.ARRAY_BUFFER,V,q.STATIC_DRAW),q.enableVertexAttribArray(W.positionLocation),q.vertexAttribPointer(W.positionLocation,2,q.FLOAT,!1,0,0);var Ge=q.createBuffer();return q.bindBuffer(q.ARRAY_BUFFER,Ge),q.bufferData(q.ARRAY_BUFFER,X,q.STATIC_DRAW),q.enableVertexAttribArray(W.colorLocation),q.vertexAttribPointer(W.colorLocation,3,q.UNSIGNED_BYTE,!1,0,0),q.uniform2f(W.scaleLocation,H.scaleX,H.scaleY),q.uniform2f(W.offsetLocation,H.offsetX,H.offsetY),q.drawArrays(q.TRIANGLES,0,B),q.flush(),q.deleteBuffer(Ve),q.deleteBuffer(Ge),ee}return{tryInitGL(){try{return _(),!!E}catch{}return!1},composeSMask:S,drawFigures:O,cleanup(){C&&C.canvas&&(C.canvas.width=0,C.canvas.height=0),P&&P.canvas&&(P.canvas.width=0,P.canvas.height=0),C=null,P=null}}}()},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var t=r(1),n=r(2);class a{static create(B){switch(B.data.annotationType){case n.AnnotationType.LINK:return new u(B);case n.AnnotationType.TEXT:return new f(B);case n.AnnotationType.WIDGET:switch(B.data.fieldType){case"Tx":return new h(B);case"Btn":return B.data.radioButton?new E(B):B.data.checkBox?new y(B):new g(B);case"Ch":return new _(B)}return new c(B);case n.AnnotationType.POPUP:return new p(B);case n.AnnotationType.FREETEXT:return new C(B);case n.AnnotationType.LINE:return new R(B);case n.AnnotationType.SQUARE:return new S(B);case n.AnnotationType.CIRCLE:return new A(B);case n.AnnotationType.POLYLINE:return new T(B);case n.AnnotationType.CARET:return new w(B);case n.AnnotationType.INK:return new O(B);case n.AnnotationType.POLYGON:return new P(B);case n.AnnotationType.HIGHLIGHT:return new k(B);case n.AnnotationType.UNDERLINE:return new D(B);case n.AnnotationType.SQUIGGLY:return new F(B);case n.AnnotationType.STRIKEOUT:return new U(B);case n.AnnotationType.STAMP:return new H(B);case n.AnnotationType.FILEATTACHMENT:return new W(B);default:return new l(B)}}}class l{constructor(B,G=!1,I=!1){this.isRenderable=G,this.data=B.data,this.layer=B.layer,this.page=B.page,this.viewport=B.viewport,this.linkService=B.linkService,this.downloadManager=B.downloadManager,this.imageResourcesPath=B.imageResourcesPath,this.renderInteractiveForms=B.renderInteractiveForms,this.svgFactory=B.svgFactory,G&&(this.container=this._createContainer(I))}_createContainer(B=!1){const G=this.data,I=this.page,$=this.viewport,V=document.createElement("section");let X=G.rect[2]-G.rect[0],Q=G.rect[3]-G.rect[1];V.setAttribute("data-annotation-id",G.id);const J=n.Util.normalizeRect([G.rect[0],I.view[3]-G.rect[1]+I.view[1],G.rect[2],I.view[3]-G.rect[3]+I.view[1]]);if(V.style.transform=`matrix(${$.transform.join(",")})`,V.style.transformOrigin=`-${J[0]}px -${J[1]}px`,!B&&G.borderStyle.width>0){V.style.borderWidth=`${G.borderStyle.width}px`,G.borderStyle.style!==n.AnnotationBorderStyleType.UNDERLINE&&(X=X-2*G.borderStyle.width,Q=Q-2*G.borderStyle.width);const ie=G.borderStyle.horizontalCornerRadius,ne=G.borderStyle.verticalCornerRadius;if(ie>0||ne>0){const Z=`${ie}px / ${ne}px`;V.style.borderRadius=Z}switch(G.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:V.style.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:V.style.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:V.style.borderBottomStyle="solid";break}G.color?V.style.borderColor=n.Util.makeCssRgb(G.color[0]|0,G.color[1]|0,G.color[2]|0):V.style.borderWidth=0}return V.style.left=`${J[0]}px`,V.style.top=`${J[1]}px`,V.style.width=`${X}px`,V.style.height=`${Q}px`,V}_createPopup(B,G,I){G||(G=document.createElement("div"),G.style.height=B.style.height,G.style.width=B.style.width,B.appendChild(G));const V=new x({container:B,trigger:G,color:I.color,title:I.title,modificationDate:I.modificationDate,contents:I.contents,hideWrapper:!0}).render();V.style.left=B.style.width,B.appendChild(V)}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}}class u extends l{constructor(B){const G=!!(B.data.url||B.data.dest||B.data.action);super(B,G)}render(){this.container.className="linkAnnotation";const{data:B,linkService:G}=this,I=document.createElement("a");return B.url?(0,t.addLinkAttributes)(I,{url:B.url,target:B.newWindow?t.LinkTarget.BLANK:G.externalLinkTarget,rel:G.externalLinkRel,enabled:G.externalLinkEnabled}):B.action?this._bindNamedAction(I,B.action):this._bindLink(I,B.dest),this.container.appendChild(I),this.container}_bindLink(B,G){B.href=this.linkService.getDestinationHash(G),B.onclick=()=>(G&&this.linkService.navigateTo(G),!1),G&&(B.className="internalLink")}_bindNamedAction(B,G){B.href=this.linkService.getAnchorUrl(""),B.onclick=()=>(this.linkService.executeNamedAction(G),!1),B.className="internalLink"}}class f extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G)}render(){this.container.className="textAnnotation";const B=document.createElement("img");return B.style.height=this.container.style.height,B.style.width=this.container.style.width,B.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",B.alt="[{{type}} Annotation]",B.dataset.l10nId="text_annotation_type",B.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,B,this.data),this.container.appendChild(B),this.container}}class c extends l{render(){return this.container}}class h extends c{constructor(B){const G=B.renderInteractiveForms||!B.data.hasAppearance&&!!B.data.fieldValue;super(B,G)}render(){const B=["left","center","right"];this.container.className="textWidgetAnnotation";let G=null;if(this.renderInteractiveForms){if(this.data.multiLine?(G=document.createElement("textarea"),G.textContent=this.data.fieldValue):(G=document.createElement("input"),G.type="text",G.setAttribute("value",this.data.fieldValue)),G.disabled=this.data.readOnly,G.name=this.data.fieldName,this.data.maxLen!==null&&(G.maxLength=this.data.maxLen),this.data.comb){const $=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;G.classList.add("comb"),G.style.letterSpacing=`calc(${$}px - 1ch)`}}else{G=document.createElement("div"),G.textContent=this.data.fieldValue,G.style.verticalAlign="middle",G.style.display="table-cell";let I=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(I=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(G,I)}return this.data.textAlignment!==null&&(G.style.textAlign=B[this.data.textAlignment]),this.container.appendChild(G),this.container}_setTextStyle(B,G){const I=B.style;if(I.fontSize=`${this.data.fontSize}px`,I.direction=this.data.fontDirection<0?"rtl":"ltr",!G)return;let $="normal";G.black?$="900":G.bold&&($="bold"),I.fontWeight=$,I.fontStyle=G.italic?"italic":"normal";const V=G.loadedName?`"${G.loadedName}", `:"",X=G.fallbackName||"Helvetica, sans-serif";I.fontFamily=V+X}}class y extends c{constructor(B){super(B,B.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation checkBox";const B=document.createElement("input");return B.disabled=this.data.readOnly,B.type="checkbox",B.name=this.data.fieldName,this.data.fieldValue&&this.data.fieldValue!=="Off"&&B.setAttribute("checked",!0),this.container.appendChild(B),this.container}}class E extends c{constructor(B){super(B,B.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const B=document.createElement("input");return B.disabled=this.data.readOnly,B.type="radio",B.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&B.setAttribute("checked",!0),this.container.appendChild(B),this.container}}class g extends u{render(){const B=super.render();return B.className="buttonWidgetAnnotation pushButton",B}}class _ extends c{constructor(B){super(B,B.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const B=document.createElement("select");B.disabled=this.data.readOnly,B.name=this.data.fieldName,this.data.combo||(B.size=this.data.options.length,this.data.multiSelect&&(B.multiple=!0));for(const G of this.data.options){const I=document.createElement("option");I.textContent=G.displayValue,I.value=G.exportValue,this.data.fieldValue.includes(G.displayValue)&&I.setAttribute("selected",!0),B.appendChild(I)}return this.container.appendChild(B),this.container}}class p extends l{constructor(B){const G=!!(B.data.title||B.data.contents);super(B,G)}render(){const B=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",B.includes(this.data.parentType))return this.container;const G=`[data-annotation-id="${this.data.parentId}"]`,I=this.layer.querySelector(G);if(!I)return this.container;const $=new x({container:this.container,trigger:I,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),V=parseFloat(I.style.left),X=parseFloat(I.style.width);return this.container.style.transformOrigin=`-${V+X}px -${I.style.top}`,this.container.style.left=`${V+X}px`,this.container.appendChild($.render()),this.container}}class x{constructor(B){this.container=B.container,this.trigger=B.trigger,this.color=B.color,this.title=B.title,this.modificationDate=B.modificationDate,this.contents=B.contents,this.hideWrapper=B.hideWrapper||!1,this.pinned=!1}render(){const G=document.createElement("div");G.className="popupWrapper",this.hideElement=this.hideWrapper?G:this.container,this.hideElement.setAttribute("hidden",!0);const I=document.createElement("div");I.className="popup";const $=this.color;if($){const J=.7*(255-$[0])+$[0],ie=.7*(255-$[1])+$[1],ne=.7*(255-$[2])+$[2];I.style.backgroundColor=n.Util.makeCssRgb(J|0,ie|0,ne|0)}const V=document.createElement("h1");V.textContent=this.title,I.appendChild(V);const X=t.PDFDateString.toDateObject(this.modificationDate);if(X){const J=document.createElement("span");J.textContent="{{date}}, {{time}}",J.dataset.l10nId="annotation_date_string",J.dataset.l10nArgs=JSON.stringify({date:X.toLocaleDateString(),time:X.toLocaleTimeString()}),I.appendChild(J)}const Q=this._formatContents(this.contents);return I.appendChild(Q),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),I.addEventListener("click",this._hide.bind(this,!0)),G.appendChild(I),G}_formatContents(B){const G=document.createElement("p"),I=B.split(/(?:\r\n?|\n)/);for(let $=0,V=I.length;$<V;++$){const X=I[$];G.appendChild(document.createTextNode(X)),$<V-1&&G.appendChild(document.createElement("br"))}return G}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(B=!1){B&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}_hide(B=!0){B&&(this.pinned=!1),!this.hideElement.hasAttribute("hidden")&&!this.pinned&&(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}class C extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class R extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){this.container.className="lineAnnotation";const B=this.data,G=B.rect[2]-B.rect[0],I=B.rect[3]-B.rect[1],$=this.svgFactory.create(G,I),V=this.svgFactory.createElement("svg:line");return V.setAttribute("x1",B.rect[2]-B.lineCoordinates[0]),V.setAttribute("y1",B.rect[3]-B.lineCoordinates[1]),V.setAttribute("x2",B.rect[2]-B.lineCoordinates[2]),V.setAttribute("y2",B.rect[3]-B.lineCoordinates[3]),V.setAttribute("stroke-width",B.borderStyle.width||1),V.setAttribute("stroke","transparent"),$.appendChild(V),this.container.append($),this._createPopup(this.container,V,B),this.container}}class S extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){this.container.className="squareAnnotation";const B=this.data,G=B.rect[2]-B.rect[0],I=B.rect[3]-B.rect[1],$=this.svgFactory.create(G,I),V=B.borderStyle.width,X=this.svgFactory.createElement("svg:rect");return X.setAttribute("x",V/2),X.setAttribute("y",V/2),X.setAttribute("width",G-V),X.setAttribute("height",I-V),X.setAttribute("stroke-width",V||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),$.appendChild(X),this.container.append($),this._createPopup(this.container,X,B),this.container}}class A extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){this.container.className="circleAnnotation";const B=this.data,G=B.rect[2]-B.rect[0],I=B.rect[3]-B.rect[1],$=this.svgFactory.create(G,I),V=B.borderStyle.width,X=this.svgFactory.createElement("svg:ellipse");return X.setAttribute("cx",G/2),X.setAttribute("cy",I/2),X.setAttribute("rx",G/2-V/2),X.setAttribute("ry",I/2-V/2),X.setAttribute("stroke-width",V||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),$.appendChild(X),this.container.append($),this._createPopup(this.container,X,B),this.container}}class T extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const B=this.data,G=B.rect[2]-B.rect[0],I=B.rect[3]-B.rect[1],$=this.svgFactory.create(G,I);let V=[];for(const Q of B.vertices){const J=Q.x-B.rect[0],ie=B.rect[3]-Q.y;V.push(J+","+ie)}V=V.join(" ");const X=this.svgFactory.createElement(this.svgElementName);return X.setAttribute("points",V),X.setAttribute("stroke-width",B.borderStyle.width||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),$.appendChild(X),this.container.append($),this._createPopup(this.container,X,B),this.container}}class P extends T{constructor(B){super(B),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class w extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class O extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const B=this.data,G=B.rect[2]-B.rect[0],I=B.rect[3]-B.rect[1],$=this.svgFactory.create(G,I);for(const V of B.inkLists){let X=[];for(const J of V){const ie=J.x-B.rect[0],ne=B.rect[3]-J.y;X.push(`${ie},${ne}`)}X=X.join(" ");const Q=this.svgFactory.createElement(this.svgElementName);Q.setAttribute("points",X),Q.setAttribute("stroke-width",B.borderStyle.width||1),Q.setAttribute("stroke","transparent"),Q.setAttribute("fill","none"),this._createPopup(this.container,Q,B),$.appendChild(Q)}return this.container.append($),this.container}}class k extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class D extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class F extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class U extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class H extends l{constructor(B){const G=!!(B.data.hasPopup||B.data.title||B.data.contents);super(B,G,!0)}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class W extends l{constructor(B){super(B,!0);const{filename:G,content:I}=this.data.file;this.filename=(0,t.getFilenameFromUrl)(G),this.content=I,this.linkService.eventBus&&this.linkService.eventBus.dispatch("fileattachmentannotation",{source:this,id:(0,n.stringToPDFString)(G),filename:G,content:I})}render(){this.container.className="fileAttachmentAnnotation";const B=document.createElement("div");return B.style.height=this.container.style.height,B.style.width=this.container.style.width,B.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(this.data.title||this.data.contents)&&this._createPopup(this.container,B,this.data),this.container.appendChild(B),this.container}_download(){if(!this.downloadManager){(0,n.warn)("Download cannot be started due to unavailable download manager");return}this.downloadManager.downloadData(this.content,this.filename,"")}}class ee{static render(B){const G=[],I=[];for(const $ of B.annotations)if($){if($.annotationType===n.AnnotationType.POPUP){I.push($);continue}G.push($)}I.length&&G.push(...I);for(const $ of G){const V=a.create({data:$,layer:B.div,page:B.page,viewport:B.viewport,linkService:B.linkService,downloadManager:B.downloadManager,imageResourcesPath:B.imageResourcesPath||"",renderInteractiveForms:B.renderInteractiveForms||!1,svgFactory:new t.DOMSVGFactory});V.isRenderable&&B.div.appendChild(V.render())}}static update(B){for(const G of B.annotations){const I=B.div.querySelector(`[data-annotation-id="${G.id}"]`);I&&(I.style.transform=`matrix(${B.viewport.transform.join(",")})`)}B.div.removeAttribute("hidden")}}e.AnnotationLayer=ee},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.renderTextLayer=void 0;var t=r(2),n=function(){var l=1e5,u=/\S/;function f(C){return!u.test(C)}function c(C,R,S){var A=document.createElement("span"),T={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(C._textDivs.push(A),f(R.str)){T.isWhitespace=!0,C._textDivProperties.set(A,T);return}var P=t.Util.transform(C._viewport.transform,R.transform),w=Math.atan2(P[1],P[0]),O=S[R.fontName];O.vertical&&(w+=Math.PI/2);var k=Math.sqrt(P[2]*P[2]+P[3]*P[3]),D=k;O.ascent?D=O.ascent*D:O.descent&&(D=(1+O.descent)*D);let F,U;w===0?(F=P[4],U=P[5]-D):(F=P[4]+D*Math.sin(w),U=P[5]-D*Math.cos(w)),A.style.left=`${F}px`,A.style.top=`${U}px`,A.style.fontSize=`${k}px`,A.style.fontFamily=O.fontFamily,A.textContent=R.str,C._fontInspectorEnabled&&(A.dataset.fontName=R.fontName),w!==0&&(T.angle=w*(180/Math.PI));let H=!1;if(R.str.length>1)H=!0;else if(R.transform[0]!==R.transform[3]){const $=Math.abs(R.transform[0]),V=Math.abs(R.transform[3]);$!==V&&Math.max($,V)/Math.min($,V)>1.5&&(H=!0)}if(H&&(O.vertical?T.canvasWidth=R.height*C._viewport.scale:T.canvasWidth=R.width*C._viewport.scale),C._textDivProperties.set(A,T),C._textContentStream&&C._layoutText(A),C._enhanceTextSelection){var W=1,ee=0;w!==0&&(W=Math.cos(w),ee=Math.sin(w));var q=(O.vertical?R.height:R.width)*C._viewport.scale,B=k,G,I;w!==0?(G=[W,ee,-ee,W,F,U],I=t.Util.getAxialAlignedBoundingBox([0,0,q,B],G)):I=[F,U,F+q,U+B],C._bounds.push({left:I[0],top:I[1],right:I[2],bottom:I[3],div:A,size:[q,B],m:G})}}function h(C){if(!C._canceled){var R=C._textDivs,S=C._capability,A=R.length;if(A>l){C._renderingDone=!0,S.resolve();return}if(!C._textContentStream)for(var T=0;T<A;T++)C._layoutText(R[T]);C._renderingDone=!0,S.resolve()}}function y(C,R,S){let A=0;for(let T=0;T<S;T++){const P=C[R++];P>0&&(A=A?Math.min(P,A):P)}return A}function E(C){for(var R=C._bounds,S=C._viewport,A=g(S.width,S.height,R),T=0;T<A.length;T++){var P=R[T].div,w=C._textDivProperties.get(P);if(w.angle===0){w.paddingLeft=R[T].left-A[T].left,w.paddingTop=R[T].top-A[T].top,w.paddingRight=A[T].right-R[T].right,w.paddingBottom=A[T].bottom-R[T].bottom,C._textDivProperties.set(P,w);continue}var O=A[T],k=R[T],D=k.m,F=D[0],U=D[1],H=[[0,0],[0,k.size[1]],[k.size[0],0],k.size],W=new Float64Array(64);H.forEach(function(q,B){var G=t.Util.applyTransform(q,D);W[B+0]=F&&(O.left-G[0])/F,W[B+4]=U&&(O.top-G[1])/U,W[B+8]=F&&(O.right-G[0])/F,W[B+12]=U&&(O.bottom-G[1])/U,W[B+16]=U&&(O.left-G[0])/-U,W[B+20]=F&&(O.top-G[1])/F,W[B+24]=U&&(O.right-G[0])/-U,W[B+28]=F&&(O.bottom-G[1])/F,W[B+32]=F&&(O.left-G[0])/-F,W[B+36]=U&&(O.top-G[1])/-U,W[B+40]=F&&(O.right-G[0])/-F,W[B+44]=U&&(O.bottom-G[1])/-U,W[B+48]=U&&(O.left-G[0])/U,W[B+52]=F&&(O.top-G[1])/-F,W[B+56]=U&&(O.right-G[0])/U,W[B+60]=F&&(O.bottom-G[1])/-F});var ee=1+Math.min(Math.abs(F),Math.abs(U));w.paddingLeft=y(W,32,16)/ee,w.paddingTop=y(W,48,16)/ee,w.paddingRight=y(W,0,16)/ee,w.paddingBottom=y(W,16,16)/ee,C._textDivProperties.set(P,w)}}function g(C,R,S){var A=S.map(function(P,w){return{x1:P.left,y1:P.top,x2:P.right,y2:P.bottom,index:w,x1New:void 0,x2New:void 0}});_(C,A);var T=new Array(S.length);return A.forEach(function(P){var w=P.index;T[w]={left:P.x1New,top:0,right:P.x2New,bottom:0}}),S.map(function(P,w){var O=T[w],k=A[w];k.x1=P.top,k.y1=C-O.right,k.x2=P.bottom,k.y2=C-O.left,k.index=w,k.x1New=void 0,k.x2New=void 0}),_(R,A),A.forEach(function(P){var w=P.index;T[w].top=P.x1New,T[w].bottom=P.x2New}),T}function _(C,R){R.sort(function(T,P){return T.x1-P.x1||T.index-P.index});var S={x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0},A=[{start:-1/0,end:1/0,boundary:S}];R.forEach(function(T){for(var P=0;P<A.length&&A[P].end<=T.y1;)P++;for(var w=A.length-1;w>=0&&A[w].start>=T.y2;)w--;var O,k,D,F,U=-1/0;for(D=P;D<=w;D++){O=A[D],k=O.boundary;var H;k.x2>T.x1?H=k.index>T.index?k.x1New:T.x1:k.x2New===void 0?H=(k.x2+T.x1)/2:H=k.x2New,H>U&&(U=H)}for(T.x1New=U,D=P;D<=w;D++)O=A[D],k=O.boundary,k.x2New===void 0?k.x2>T.x1?k.index>T.index&&(k.x2New=k.x2):k.x2New=U:k.x2New>U&&(k.x2New=Math.max(U,k.x2));var W=[],ee=null;for(D=P;D<=w;D++){O=A[D],k=O.boundary;var q=k.x2>T.x2?k:T;ee===q?W[W.length-1].end=O.end:(W.push({start:O.start,end:O.end,boundary:q}),ee=q)}for(A[P].start<T.y1&&(W[0].start=T.y1,W.unshift({start:A[P].start,end:T.y1,boundary:A[P].boundary})),T.y2<A[w].end&&(W[W.length-1].end=T.y2,W.push({start:T.y2,end:A[w].end,boundary:A[w].boundary})),D=P;D<=w;D++)if(O=A[D],k=O.boundary,k.x2New===void 0){var B=!1;for(F=P-1;!B&&F>=0&&A[F].start>=k.y1;F--)B=A[F].boundary===k;for(F=w+1;!B&&F<A.length&&A[F].end<=k.y2;F++)B=A[F].boundary===k;for(F=0;!B&&F<W.length;F++)B=W[F].boundary===k;B||(k.x2New=U)}Array.prototype.splice.apply(A,[P,w-P+1].concat(W))}),A.forEach(function(T){var P=T.boundary;P.x2New===void 0&&(P.x2New=Math.max(C,P.x2))})}function p({textContent:C,textContentStream:R,container:S,viewport:A,textDivs:T,textContentItemsStr:P,enhanceTextSelection:w}){this._textContent=C,this._textContentStream=R,this._container=S,this._viewport=A,this._textDivs=T||[],this._textContentItemsStr=P||[],this._enhanceTextSelection=!!w,this._fontInspectorEnabled=!!(globalThis.FontInspector&&globalThis.FontInspector.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,t.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally(()=>{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}p.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new t.AbortException("TextLayer task cancelled.")),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(C,R){for(let S=0,A=C.length;S<A;S++)this._textContentItemsStr.push(C[S].str),c(this,C[S],R)},_layoutText(C){const R=this._textDivProperties.get(C);if(R.isWhitespace)return;let S="";if(R.canvasWidth!==0){const{fontSize:A,fontFamily:T}=C.style;(A!==this._layoutTextLastFontSize||T!==this._layoutTextLastFontFamily)&&(this._layoutTextCtx.font=`${A} ${T}`,this._layoutTextLastFontSize=A,this._layoutTextLastFontFamily=T);const{width:P}=this._layoutTextCtx.measureText(C.textContent);P>0&&(R.scale=R.canvasWidth/P,S=`scaleX(${R.scale})`)}R.angle!==0&&(S=`rotate(${R.angle}deg) ${S}`),S.length>0&&(this._enhanceTextSelection&&(R.originalTransform=S),C.style.transform=S),this._textDivProperties.set(C,R),this._container.appendChild(C)},_render:function(R){const S=(0,t.createPromiseCapability)();let A=Object.create(null);const T=document.createElement("canvas");if(T.mozOpaque=!0,this._layoutTextCtx=T.getContext("2d",{alpha:!1}),this._textContent){const P=this._textContent.items,w=this._textContent.styles;this._processItems(P,w),S.resolve()}else if(this._textContentStream){const P=()=>{this._reader.read().then(({value:w,done:O})=>{if(O){S.resolve();return}Object.assign(A,w.styles),this._processItems(w.items,A),P()},S.reject)};this._reader=this._textContentStream.getReader(),P()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');S.promise.then(()=>{A=null,R?this._renderTimer=setTimeout(()=>{h(this),this._renderTimer=null},R):h(this)},this._capability.reject)},expandTextDivs:function(R){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(E(this),this._bounds=null);const S=[],A=[];for(var T=0,P=this._textDivs.length;T<P;T++){const w=this._textDivs[T],O=this._textDivProperties.get(w);O.isWhitespace||(R?(S.length=0,A.length=0,O.originalTransform&&S.push(O.originalTransform),O.paddingTop>0?(A.push(`${O.paddingTop}px`),S.push(`translateY(${-O.paddingTop}px)`)):A.push(0),O.paddingRight>0?A.push(`${O.paddingRight/O.scale}px`):A.push(0),O.paddingBottom>0?A.push(`${O.paddingBottom}px`):A.push(0),O.paddingLeft>0?(A.push(`${O.paddingLeft/O.scale}px`),S.push(`translateX(${-O.paddingLeft/O.scale}px)`)):A.push(0),w.style.padding=A.join(" "),S.length&&(w.style.transform=S.join(" "))):(w.style.padding=null,w.style.transform=O.originalTransform))}}};function x(C){var R=new p({textContent:C.textContent,textContentStream:C.textContentStream,container:C.container,viewport:C.viewport,textDivs:C.textDivs,textContentItemsStr:C.textContentItemsStr,enhanceTextSelection:C.enhanceTextSelection});return R._render(C.timeout),R}return x}();e.renderTextLayer=n},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var t=r(2),n=r(1),a=r(4);let l=function(){throw new Error("Not implemented: SVGGraphics")};e.SVGGraphics=l;{let _=function(A){let T=[];const P=[];for(const w of A){if(w.fn==="save"){T.push({fnId:92,fn:"group",items:[]}),P.push(T),T=T[T.length-1].items;continue}w.fn==="restore"?T=P.pop():T.push(w)}return T},p=function(A){if(Number.isInteger(A))return A.toString();const T=A.toFixed(10);let P=T.length-1;if(T[P]!=="0")return T;do P--;while(T[P]==="0");return T.substring(0,T[P]==="."?P:P+1)},x=function(A){if(A[4]===0&&A[5]===0){if(A[1]===0&&A[2]===0)return A[0]===1&&A[3]===1?"":`scale(${p(A[0])} ${p(A[3])})`;if(A[0]===A[3]&&A[1]===-A[2]){const T=Math.acos(A[0])*180/Math.PI;return`rotate(${p(T)})`}}else if(A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1)return`translate(${p(A[4])} ${p(A[5])})`;return`matrix(${p(A[0])} ${p(A[1])} ${p(A[2])} ${p(A[3])} ${p(A[4])} ${p(A[5])})`};const u={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},f="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",h=["butt","round","square"],y=["miter","round","bevel"],E=function(){const A=new Uint8Array([137,80,78,71,13,10,26,10]),T=12,P=new Int32Array(256);for(let H=0;H<256;H++){let W=H;for(let ee=0;ee<8;ee++)W&1?W=3988292384^W>>1&2147483647:W=W>>1&2147483647;P[H]=W}function w(H,W,ee){let q=-1;for(let B=W;B<ee;B++){const G=(q^H[B])&255,I=P[G];q=q>>>8^I}return q^-1}function O(H,W,ee,q){let B=q;const G=W.length;ee[B]=G>>24&255,ee[B+1]=G>>16&255,ee[B+2]=G>>8&255,ee[B+3]=G&255,B+=4,ee[B]=H.charCodeAt(0)&255,ee[B+1]=H.charCodeAt(1)&255,ee[B+2]=H.charCodeAt(2)&255,ee[B+3]=H.charCodeAt(3)&255,B+=4,ee.set(W,B),B+=W.length;const I=w(ee,q+4,B);ee[B]=I>>24&255,ee[B+1]=I>>16&255,ee[B+2]=I>>8&255,ee[B+3]=I&255}function k(H,W,ee){let q=1,B=0;for(let G=W;G<ee;++G)q=(q+(H[G]&255))%65521,B=(B+q)%65521;return B<<16|q}function D(H){if(!a.isNodeJS)return F(H);try{let W;parseInt(process.versions.node)>=8?W=H:W=Buffer.from(H);const ee=require$$4.deflateSync(W,{level:9});return ee instanceof Uint8Array?ee:new Uint8Array(ee)}catch(W){(0,t.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+W)}return F(H)}function F(H){let W=H.length;const ee=65535,q=Math.ceil(W/ee),B=new Uint8Array(2+W+q*5+4);let G=0;B[G++]=120,B[G++]=156;let I=0;for(;W>ee;)B[G++]=0,B[G++]=255,B[G++]=255,B[G++]=0,B[G++]=0,B.set(H.subarray(I,I+ee),G),G+=ee,I+=ee,W-=ee;B[G++]=1,B[G++]=W&255,B[G++]=W>>8&255,B[G++]=~W&65535&255,B[G++]=(~W&65535)>>8&255,B.set(H.subarray(I),G),G+=H.length-I;const $=k(H,0,H.length);return B[G++]=$>>24&255,B[G++]=$>>16&255,B[G++]=$>>8&255,B[G++]=$&255,B}function U(H,W,ee,q){const B=H.width,G=H.height;let I,$,V;const X=H.data;switch(W){case t.ImageKind.GRAYSCALE_1BPP:$=0,I=1,V=B+7>>3;break;case t.ImageKind.RGB_24BPP:$=2,I=8,V=B*3;break;case t.ImageKind.RGBA_32BPP:$=6,I=8,V=B*4;break;default:throw new Error("invalid format")}const Q=new Uint8Array((1+V)*G);let J=0,ie=0;for(let fe=0;fe<G;++fe)Q[J++]=0,Q.set(X.subarray(ie,ie+V),J),ie+=V,J+=V;if(W===t.ImageKind.GRAYSCALE_1BPP&&q){J=0;for(let fe=0;fe<G;fe++){J++;for(let ce=0;ce<V;ce++)Q[J++]^=255}}const ne=new Uint8Array([B>>24&255,B>>16&255,B>>8&255,B&255,G>>24&255,G>>16&255,G>>8&255,G&255,I,$,0,0,0]),Z=D(Q),se=A.length+T*3+ne.length+Z.length,oe=new Uint8Array(se);let de=0;return oe.set(A,de),de+=A.length,O("IHDR",ne,oe,de),de+=T+ne.length,O("IDATA",Z,oe,de),de+=T+Z.length,O("IEND",new Uint8Array(0),oe,de),(0,t.createObjectURL)(oe,"image/png",ee)}return function(W,ee,q){const B=W.kind===void 0?t.ImageKind.GRAYSCALE_1BPP:W.kind;return U(W,B,ee,q)}}();class g{constructor(){this.fontSizeScale=1,this.fontWeight=u.fontWeight,this.fontSize=0,this.textMatrix=t.IDENTITY_MATRIX,this.fontMatrix=t.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=t.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=u.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(T,P){this.x=T,this.y=P}}let C=0,R=0,S=0;e.SVGGraphics=l=class{constructor(T,P,w=!1){this.svgFactory=new n.DOMSVGFactory,this.current=new g,this.transformMatrix=t.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=T,this.objs=P,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!w,this._operatorIdMapping=[];for(const O in t.OPS)this._operatorIdMapping[t.OPS[O]]=O}save(){this.transformStack.push(this.transformMatrix);const T=this.current;this.extraStack.push(T),this.current=T.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(T){this.save(),this.executeOpTree(T),this.restore()}loadDependencies(T){const P=T.fnArray,w=T.argsArray;for(let O=0,k=P.length;O<k;O++)if(P[O]===t.OPS.dependency)for(const D of w[O]){const F=D.startsWith("g_")?this.commonObjs:this.objs,U=new Promise(H=>{F.get(D,H)});this.current.dependencies.push(U)}return Promise.all(this.current.dependencies)}transform(T,P,w,O,k,D){const F=[T,P,w,O,k,D];this.transformMatrix=t.Util.transform(this.transformMatrix,F),this.tgrp=null}getSVG(T,P){this.viewport=P;const w=this._initialize(P);return this.loadDependencies(T).then(()=>(this.transformMatrix=t.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(T)),w))}convertOpList(T){const P=this._operatorIdMapping,w=T.argsArray,O=T.fnArray,k=[];for(let D=0,F=O.length;D<F;D++){const U=O[D];k.push({fnId:U,fn:P[U],args:w[D]})}return _(k)}executeOpTree(T){for(const P of T){const w=P.fn,O=P.fnId,k=P.args;switch(O|0){case t.OPS.beginText:this.beginText();break;case t.OPS.dependency:break;case t.OPS.setLeading:this.setLeading(k);break;case t.OPS.setLeadingMoveText:this.setLeadingMoveText(k[0],k[1]);break;case t.OPS.setFont:this.setFont(k);break;case t.OPS.showText:this.showText(k[0]);break;case t.OPS.showSpacedText:this.showText(k[0]);break;case t.OPS.endText:this.endText();break;case t.OPS.moveText:this.moveText(k[0],k[1]);break;case t.OPS.setCharSpacing:this.setCharSpacing(k[0]);break;case t.OPS.setWordSpacing:this.setWordSpacing(k[0]);break;case t.OPS.setHScale:this.setHScale(k[0]);break;case t.OPS.setTextMatrix:this.setTextMatrix(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.setTextRise:this.setTextRise(k[0]);break;case t.OPS.setTextRenderingMode:this.setTextRenderingMode(k[0]);break;case t.OPS.setLineWidth:this.setLineWidth(k[0]);break;case t.OPS.setLineJoin:this.setLineJoin(k[0]);break;case t.OPS.setLineCap:this.setLineCap(k[0]);break;case t.OPS.setMiterLimit:this.setMiterLimit(k[0]);break;case t.OPS.setFillRGBColor:this.setFillRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeRGBColor:this.setStrokeRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeColorN:this.setStrokeColorN(k);break;case t.OPS.setFillColorN:this.setFillColorN(k);break;case t.OPS.shadingFill:this.shadingFill(k[0]);break;case t.OPS.setDash:this.setDash(k[0],k[1]);break;case t.OPS.setRenderingIntent:this.setRenderingIntent(k[0]);break;case t.OPS.setFlatness:this.setFlatness(k[0]);break;case t.OPS.setGState:this.setGState(k[0]);break;case t.OPS.fill:this.fill();break;case t.OPS.eoFill:this.eoFill();break;case t.OPS.stroke:this.stroke();break;case t.OPS.fillStroke:this.fillStroke();break;case t.OPS.eoFillStroke:this.eoFillStroke();break;case t.OPS.clip:this.clip("nonzero");break;case t.OPS.eoClip:this.clip("evenodd");break;case t.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case t.OPS.paintImageXObject:this.paintImageXObject(k[0]);break;case t.OPS.paintInlineImageXObject:this.paintInlineImageXObject(k[0]);break;case t.OPS.paintImageMaskXObject:this.paintImageMaskXObject(k[0]);break;case t.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(k[0],k[1]);break;case t.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case t.OPS.closePath:this.closePath();break;case t.OPS.closeStroke:this.closeStroke();break;case t.OPS.closeFillStroke:this.closeFillStroke();break;case t.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case t.OPS.nextLine:this.nextLine();break;case t.OPS.transform:this.transform(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.constructPath:this.constructPath(k[0],k[1]);break;case t.OPS.endPath:this.endPath();break;case 92:this.group(P.items);break;default:(0,t.warn)(`Unimplemented operator ${w}`);break}}}setWordSpacing(T){this.current.wordSpacing=T}setCharSpacing(T){this.current.charSpacing=T}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(T,P,w,O,k,D){const F=this.current;F.textMatrix=F.lineMatrix=[T,P,w,O,k,D],F.textMatrixScale=Math.sqrt(T*T+P*P),F.x=F.lineX=0,F.y=F.lineY=0,F.xcoords=[],F.ycoords=[],F.tspan=this.svgFactory.createElement("svg:tspan"),F.tspan.setAttributeNS(null,"font-family",F.fontFamily),F.tspan.setAttributeNS(null,"font-size",`${p(F.fontSize)}px`),F.tspan.setAttributeNS(null,"y",p(-F.y)),F.txtElement=this.svgFactory.createElement("svg:text"),F.txtElement.appendChild(F.tspan)}beginText(){const T=this.current;T.x=T.lineX=0,T.y=T.lineY=0,T.textMatrix=t.IDENTITY_MATRIX,T.lineMatrix=t.IDENTITY_MATRIX,T.textMatrixScale=1,T.tspan=this.svgFactory.createElement("svg:tspan"),T.txtElement=this.svgFactory.createElement("svg:text"),T.txtgrp=this.svgFactory.createElement("svg:g"),T.xcoords=[],T.ycoords=[]}moveText(T,P){const w=this.current;w.x=w.lineX+=T,w.y=w.lineY+=P,w.xcoords=[],w.ycoords=[],w.tspan=this.svgFactory.createElement("svg:tspan"),w.tspan.setAttributeNS(null,"font-family",w.fontFamily),w.tspan.setAttributeNS(null,"font-size",`${p(w.fontSize)}px`),w.tspan.setAttributeNS(null,"y",p(-w.y))}showText(T){const P=this.current,w=P.font,O=P.fontSize;if(O===0)return;const k=P.fontSizeScale,D=P.charSpacing,F=P.wordSpacing,U=P.fontDirection,H=P.textHScale*U,W=w.vertical,ee=W?1:-1,q=w.defaultVMetrics,B=O*P.fontMatrix[0];let G=0;for(const V of T){if(V===null){G+=U*F;continue}else if((0,t.isNum)(V)){G+=ee*V*O/1e3;continue}const X=(V.isSpace?F:0)+D,Q=V.fontChar;let J,ie,ne=V.width;if(W){let se;const oe=V.vmetric||q;se=V.vmetric?oe[1]:ne*.5,se=-se*B;const de=oe[2]*B;ne=oe?-oe[0]:ne,J=se/k,ie=(G+de)/k}else J=G/k,ie=0;(V.isInFont||w.missingFile)&&(P.xcoords.push(P.x+J),W&&P.ycoords.push(-P.y+ie),P.tspan.textContent+=Q);let Z;W?Z=ne*B-X*U:Z=ne*B+X*U,G+=Z}P.tspan.setAttributeNS(null,"x",P.xcoords.map(p).join(" ")),W?P.tspan.setAttributeNS(null,"y",P.ycoords.map(p).join(" ")):P.tspan.setAttributeNS(null,"y",p(-P.y)),W?P.y-=G:P.x+=G*H,P.tspan.setAttributeNS(null,"font-family",P.fontFamily),P.tspan.setAttributeNS(null,"font-size",`${p(P.fontSize)}px`),P.fontStyle!==u.fontStyle&&P.tspan.setAttributeNS(null,"font-style",P.fontStyle),P.fontWeight!==u.fontWeight&&P.tspan.setAttributeNS(null,"font-weight",P.fontWeight);const I=P.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;if(I===t.TextRenderingMode.FILL||I===t.TextRenderingMode.FILL_STROKE?(P.fillColor!==u.fillColor&&P.tspan.setAttributeNS(null,"fill",P.fillColor),P.fillAlpha<1&&P.tspan.setAttributeNS(null,"fill-opacity",P.fillAlpha)):P.textRenderingMode===t.TextRenderingMode.ADD_TO_PATH?P.tspan.setAttributeNS(null,"fill","transparent"):P.tspan.setAttributeNS(null,"fill","none"),I===t.TextRenderingMode.STROKE||I===t.TextRenderingMode.FILL_STROKE){const V=1/(P.textMatrixScale||1);this._setStrokeAttributes(P.tspan,V)}let $=P.textMatrix;P.textRise!==0&&($=$.slice(),$[5]+=P.textRise),P.txtElement.setAttributeNS(null,"transform",`${x($)} scale(${p(H)}, -1)`),P.txtElement.setAttributeNS(f,"xml:space","preserve"),P.txtElement.appendChild(P.tspan),P.txtgrp.appendChild(P.txtElement),this._ensureTransformGroup().appendChild(P.txtElement)}setLeadingMoveText(T,P){this.setLeading(-P),this.moveText(T,P)}addFontStyle(T){if(!T.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const P=(0,t.createObjectURL)(T.data,T.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${T.loadedName}"; src: url(${P}); }