1&&!a(arguments[1])?o(arguments[1]):void 0,ce=Ae?Ae.transfer:void 0,Ee;return ce!==void 0&&(Ee=new fe,Fe(ce,Ee)),Pe(Me,Ee)}})},(W,E,l)=>{var p=l(17),v=l(10),I=l(24),k=l(82),m=l(27),R=l(54),t=function(){},n=[],h=m("Reflect","construct"),a=/^\s*(?:class|function)\b/,d=p(a.exec),r=!a.exec(t),i=function(b){if(!I(b))return!1;try{return h(t,n,b),!0}catch{return!1}},o=function(b){if(!I(b))return!1;switch(k(b)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return r||!!d(a,R(b))}catch{return!0}};o.sham=!0,W.exports=!h||v(function(){var c;return i(i.call)||!i(Object)||!i(function(){c=!0})||c})?o:i},W=>{var E=TypeError;W.exports=function(l,p){if(l{var p=l(11),v=l(42),I=l(28),k=l(127),m=RegExp.prototype;W.exports=function(R){var t=R.flags;return t===void 0&&!("flags"in m)&&!v(R,"flags")&&I(m,R)?p(k,R):t}},(W,E,l)=>{var p=l(50);W.exports=function(){var v=p(this),I="";return v.hasIndices&&(I+="d"),v.global&&(I+="g"),v.ignoreCase&&(I+="i"),v.multiline&&(I+="m"),v.dotAll&&(I+="s"),v.unicode&&(I+="u"),v.unicodeSets&&(I+="v"),v.sticky&&(I+="y"),I}},(W,E,l)=>{var p=l(17),v=Map.prototype;W.exports={Map,set:p(v.set),get:p(v.get),has:p(v.has),remove:p(v.delete),proto:v}},(W,E,l)=>{var p=l(17),v=Set.prototype;W.exports={Set,add:p(v.add),has:p(v.has),remove:p(v.delete),proto:v,$has:v.has,$keys:v.keys}},(W,E,l)=>{var p=l(10),v=l(14);W.exports=!p(function(){var I=Error("a");return"stack"in I?(Object.defineProperty(I,"stack",v(1,7)),I.stack!==7):!0})},(W,E,l)=>{var p=l(132),v=l(133);W.exports=!p&&!v&&typeof window=="object"&&typeof document=="object"},W=>{W.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(W,E,l)=>{var p=l(18);W.exports=typeof process<"u"&&p(process)=="process"},(W,E,l)=>{var p=l(7);W.exports=p},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var W,E,p,v,I,k,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(136),_display_utils=__w_pdfjs_require__(139),_font_loader=__w_pdfjs_require__(142),_canvas=__w_pdfjs_require__(143),_worker_options=__w_pdfjs_require__(146),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(147),_metadata=__w_pdfjs_require__(148),_optional_content_config=__w_pdfjs_require__(149),_transport_stream=__w_pdfjs_require__(150),_xfa_text=__w_pdfjs_require__(151);function _classPrivateFieldSet(t,n,h){var a=_classExtractFieldDescriptor(t,n,"set");return _classApplyDescriptorSet(t,a,h),h}function _classApplyDescriptorSet(t,n,h){if(n.set)n.set.call(t,h);else{if(!n.writable)throw new TypeError("attempted to set read only private field");n.value=h}}function _classPrivateMethodInitSpec(t,n){_checkPrivateRedeclaration(t,n),n.add(t)}function _classPrivateFieldInitSpec(t,n,h){_checkPrivateRedeclaration(t,n),n.set(t,h)}function _checkPrivateRedeclaration(t,n){if(n.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,n,h){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return h}function _classPrivateFieldGet(t,n){var h=_classExtractFieldDescriptor(t,n,"get");return _classApplyDescriptorGet(t,h)}function _classExtractFieldDescriptor(t,n,h){if(!n.has(t))throw new TypeError("attempted to "+h+" private field on non-instance");return n.get(t)}function _classApplyDescriptorGet(t,n){return n.get?n.get.call(t):n.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:n,NodeStandardFontDataFactory:h}=__w_pdfjs_require__(152);exports.DefaultCanvasFactory=DefaultCanvasFactory=t,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=n,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=h}let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(153);createPDFNetworkStream=n=>new t(n)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(156),{PDFFetchStream:n}=__w_pdfjs_require__(157);createPDFNetworkStream=h=>(0,_display_utils.isValidFetchUrl)(h.url)?new n(h):new t(h)}function getDocument(t){if(typeof t=="string"||t instanceof URL)t={url:t};else if((0,_util.isArrayBuffer)(t))t={data:t};else if(t instanceof PDFDataRangeTransport)(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead."),t={range:t};else if(typeof t!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const n=new PDFDocumentLoadingTask,h=t.url?getUrlProp(t.url):null,a=t.data?getDataProp(t.data):null,d=t.httpHeaders||null,r=t.withCredentials===!0,i=t.password??null,o=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let b=t.worker instanceof PDFWorker?t.worker:null;const y=t.verbosity,f=typeof t.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(t.docBaseUrl)?t.docBaseUrl:null,s=typeof t.cMapUrl=="string"?t.cMapUrl:null,g=t.cMapPacked!==!1,S=t.CMapReaderFactory||DefaultCMapReaderFactory,D=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,w=t.StandardFontDataFactory||DefaultStandardFontDataFactory,x=t.stopAtErrors!==!0,F=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,X=t.isEvalSupported!==!1,G=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,j=typeof t.disableFontFace=="boolean"?t.disableFontFace:_is_node.isNodeJS,N=t.fontExtraProperties===!0,Q=t.enableXfa===!0,Y=t.ownerDocument||globalThis.document,B=t.disableRange===!0,ie=t.disableStream===!0,q=t.disableAutoFetch===!0,_=t.pdfBug===!0,H=o?o.length:t.length??NaN,$=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!_is_node.isNodeJS&&!j,C=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:S===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(s,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(D,document.baseURI),P=null;(0,_util.setVerbosityLevel)(y);const z=C?null:{cMapReaderFactory:new S({baseUrl:s,isCompressed:g}),standardFontDataFactory:new w({baseUrl:D})};if(!b){const ue={verbosity:y,port:_worker_options.GlobalWorkerOptions.workerPort};b=ue.port?PDFWorker.fromPort(ue):new PDFWorker(ue),n._worker=b}const ee=n.docId,te={docId:ee,apiVersion:"3.4.120",data:a,password:i,disableAutoFetch:q,rangeChunkSize:c,length:H,docBaseUrl:f,enableXfa:Q,evaluatorOptions:{maxImageSize:F,disableFontFace:j,ignoreErrors:x,isEvalSupported:X,isOffscreenCanvasSupported:G,fontExtraProperties:N,useSystemFonts:$,cMapUrl:C?s:null,standardFontDataUrl:C?D:null}},K={ignoreErrors:x,isEvalSupported:X,disableFontFace:j,fontExtraProperties:N,enableXfa:Q,ownerDocument:Y,disableAutoFetch:q,pdfBug:_,styleElement:P};return b.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");const ue=_fetchDocument(b,te),fe=new Promise(function(ye){let me;o?me=new _transport_stream.PDFDataTransportStream({length:H,initialData:o.initialData,progressiveDone:o.progressiveDone,contentDispositionFilename:o.contentDispositionFilename,disableRange:B,disableStream:ie},o):a||(me=createPDFNetworkStream({url:h,length:H,httpHeaders:d,withCredentials:r,rangeChunkSize:c,disableRange:B,disableStream:ie})),ye(me)});return Promise.all([ue,fe]).then(function(ye){let[me,we]=ye;if(n.destroyed)throw new Error("Loading aborted");const ge=new _message_handler.MessageHandler(ee,me,b.port),A=new WorkerTransport(ge,n,we,K,z);n._transport=A,ge.send("Ready",null)})}).catch(n._capability.reject),n}async function _fetchDocument(t,n){if(t.destroyed)throw new Error("Worker was destroyed");const h=await t.messageHandler.sendWithPromise("GetDocRequest",n,n.data?[n.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return h}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_is_node.isNodeJS&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&typeof Buffer<"u"&&t instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(t);if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return(0,_util.stringToBytes)(t);if(typeof t=="object"&&!isNaN(t==null?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const l=class{constructor(){nt(this,E,null);this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId=`d${Kn(l,W)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get onUnsupportedFeature(){return Ue(this,E)}set onUnsupportedFeature(n){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future."),rt(this,E,n)}get promise(){return this._capability.promise}async destroy(){var n;this.destroyed=!0,await((n=this._transport)===null||n===void 0?void 0:n.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let PDFDocumentLoadingTask=l;W=new WeakMap,E=new WeakMap,nt(PDFDocumentLoadingTask,W,0),exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(n,h){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=n,this.initialData=h,this.progressiveDone=a,this.contentDispositionFilename=d,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(n){this._rangeListeners.push(n)}addProgressListener(n){this._progressListeners.push(n)}addProgressiveReadListener(n){this._progressiveReadListeners.push(n)}addProgressiveDoneListener(n){this._progressiveDoneListeners.push(n)}onDataRange(n,h){for(const a of this._rangeListeners)a(n,h)}onDataProgress(n,h){this._readyCapability.promise.then(()=>{for(const a of this._progressListeners)a(n,h)})}onDataProgressiveRead(n){this._readyCapability.promise.then(()=>{for(const h of this._progressiveReadListeners)h(n)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const n of this._progressiveDoneListeners)n()})}transportReady(){this._readyCapability.resolve()}requestDataRange(n,h){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(n,h){this._pdfInfo=n,this._transport=h}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(n){return this._transport.getPage(n)}getPageIndex(n){return this._transport.getPageIndex(n)}getDestinations(){return this._transport.getDestinations()}getDestination(n){return this._transport.getDestination(n)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(n||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(n,h,a,d){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;this._pageIndex=n,this._pageInfo=h,this._ownerDocument=d,this._transport=a,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=a.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:n,rotation:h=this.rotate,offsetX:a=0,offsetY:d=0,dontFlip:r=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:n,rotation:h,offsetX:a,offsetY:d,dontFlip:r})}getAnnotations(){let{intent:n="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=this._transport.getRenderingIntent(n);return this._transport.getAnnotations(this._pageIndex,h.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var n;return((n=this._transport._htmlForXfa)===null||n===void 0?void 0:n.children[this._pageIndex])||null}render(n){var h,a;let{canvasContext:d,viewport:r,intent:i="display",annotationMode:o=_util.AnnotationMode.ENABLE,transform:c=null,canvasFactory:b=null,background:y=null,optionalContentConfigPromise:f=null,annotationCanvasMap:s=null,pageColors:g=null,printAnnotationStorage:S=null}=n;(h=this._stats)===null||h===void 0||h.time("Overall");const D=this._transport.getRenderingIntent(i,o,S);this.pendingCleanup=!1,f||(f=this._transport.getOptionalContentConfig());let w=this._intentStates.get(D.cacheKey);w||(w=Object.create(null),this._intentStates.set(D.cacheKey,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const x=b||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),F=!!(D.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!w.displayReadyCapability){var X;w.displayReadyCapability=(0,_util.createPromiseCapability)(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)===null||X===void 0||X.time("Page Request"),this._pumpOperatorList(D)}const G=Q=>{var Y,B;w.renderTasks.delete(j),(this.cleanupAfterRender||F)&&(this.pendingCleanup=!0),this._tryCleanup(),Q?(j.capability.reject(Q),this._abortOperatorList({intentState:w,reason:Q instanceof Error?Q:new Error(Q)})):j.capability.resolve(),(Y=this._stats)===null||Y===void 0||Y.timeEnd("Rendering"),(B=this._stats)===null||B===void 0||B.timeEnd("Overall")},j=new InternalRenderTask({callback:G,params:{canvasContext:d,viewport:r,transform:c,background:y},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:s,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:x,useRequestAnimationFrame:!F,pdfBug:this._pdfBug,pageColors:g});((a=w).renderTasks||(a.renderTasks=new Set)).add(j);const N=j.task;return Promise.all([w.displayReadyCapability.promise,f]).then(Q=>{var Y;let[B,ie]=Q;if(this.pendingCleanup){G();return}(Y=this._stats)===null||Y===void 0||Y.time("Rendering"),j.initializeGraphics({transparency:B,optionalContentConfig:ie}),j.operatorListChanged()}).catch(G),N}getOperatorList(){let{intent:n="display",annotationMode:h=_util.AnnotationMode.ENABLE,printAnnotationStorage:a=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function d(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(o))}const r=this._transport.getRenderingIntent(n,h,a,!0);let i=this._intentStates.get(r.cacheKey);i||(i=Object.create(null),this._intentStates.set(r.cacheKey,i));let o;if(!i.opListReadCapability){var c,b;o=Object.create(null),o.operatorListChanged=d,i.opListReadCapability=(0,_util.createPromiseCapability)(),((c=i).renderTasks||(c.renderTasks=new Set)).add(o),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(b=this._stats)===null||b===void 0||b.time("Page Request"),this._pumpOperatorList(r)}return i.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:n=!1,includeMarkedContent:h=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const a=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:n!==!0,includeMarkedContent:h===!0},{highWaterMark:a,size(d){return d.items.length}})}getTextContent(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(a=>_xfa_text.XfaText.textContent(a));const h=this.streamTextContent(n);return new Promise(function(a,d){function r(){i.read().then(function(c){let{value:b,done:y}=c;if(y){a(o);return}Object.assign(o.styles,b.styles),o.items.push(...b.items),r()},d)}const i=h.getReader(),o={items:[],styles:Object.create(null)};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const n=[];for(const h of this._intentStates.values())if(this._abortOperatorList({intentState:h,reason:new Error("Page was destroyed."),force:!0}),!h.opListReadCapability)for(const a of h.renderTasks)n.push(a.completed),a.cancel();return this.objs.clear(),this.pendingCleanup=!1,Promise.all(n)}cleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.pendingCleanup=!0,this._tryCleanup(n)}_tryCleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.pendingCleanup)return!1;for(const{renderTasks:h,operatorList:a}of this._intentStates.values())if(h.size>0||!a.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),n&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(n,h){var a,d;const r=this._intentStates.get(h);r&&((a=this._stats)===null||a===void 0||a.timeEnd("Page Request"),(d=r.displayReadyCapability)===null||d===void 0||d.resolve(n))}_renderPageChunk(n,h){for(let a=0,d=n.length;a{i.read().then(b=>{let{value:y,done:f}=b;if(f){o.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(y,o),c())},b=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const y of o.renderTasks)y.operatorListChanged();this._tryCleanup()}if(o.displayReadyCapability)o.displayReadyCapability.reject(b);else if(o.opListReadCapability)o.opListReadCapability.reject(b);else throw b}})};c()}_abortOperatorList(n){let{intentState:h,reason:a,force:d=!1}=n;if(h.streamReader){if(h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null),!d){if(h.renderTasks.size>0)return;if(a instanceof _display_utils.RenderingCancelledException){let r=RENDERING_CANCELLED_TIMEOUT;a.extraDelay>0&&a.extraDelay<1e3&&(r+=a.extraDelay),h.streamReaderCancelTimeout=setTimeout(()=>{h.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:h,reason:a,force:!0})},r);return}}if(h.streamReader.cancel(new _util.AbortException(a.message)).catch(()=>{}),h.streamReader=null,!this._transport.destroyed){for(const[r,i]of this._intentStates)if(i===h){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){nt(this,p,new Set);nt(this,v,Promise.resolve())}postMessage(n,h){const a={data:structuredClone(n,h)};Ue(this,v).then(()=>{for(const d of Ue(this,p))d.call(this,a)})}addEventListener(n,h){Ue(this,p).add(h)}removeEventListener(n,h){Ue(this,p).delete(h)}terminate(){Ue(this,p).clear()}}p=new WeakMap,v=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){var _document,_document$currentScri;const t=(_document=document)===null||_document===void 0||(_document$currentScri=_document.currentScript)===null||_document$currentScri===void 0?void 0:_document$currentScri.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,n){let h;try{if(h=new URL(t),!h.origin||h.origin==="null")return!1}catch{return!1}const a=new URL(n,h);return h.origin===a.origin},PDFWorkerUtil.createCDNWrapper=function(t){const n=`importScripts("${t}");`;return URL.createObjectURL(new Blob([n]))}}const _PDFWorker=class{constructor(){let{name:t=null,port:n=null,verbosity:h=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(n&&Ue(_PDFWorker,I).has(n))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=h,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,n){Ue(_PDFWorker,I).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const n=new Worker(t),h=new _message_handler.MessageHandler("main","worker",n),a=()=>{n.removeEventListener("error",d),h.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},d=()=>{this._webWorker||a()};n.addEventListener("error",d),h.on("test",i=>{if(n.removeEventListener("error",d),this.destroyed){a();return}i?(this._messageHandler=h,this._port=n,this._webWorker=n,this._readyCapability.resolve(),h.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),h.destroy(),n.terminate())}),h.on("ready",i=>{if(n.removeEventListener("error",d),this.destroyed){a();return}try{r()}catch{this._setupFakeWorker()}});const r=()=>{const i=new Uint8Array;h.send("test",i,[i.buffer])};r();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new LoopbackPort;this._port=n;const h=`fake${PDFWorkerUtil.fakeWorkerId++}`,a=new _message_handler.MessageHandler(h+"_worker",h,n);t.setup(a,n);const d=new _message_handler.MessageHandler(h,h+"_worker",n);this._messageHandler=d,this._readyCapability.resolve(),d.send("configure",{verbosity:this.verbosity})}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Ue(_PDFWorker,I).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ue(this,I).has(t.port)?Ue(this,I).get(t.port):new _PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return((t=globalThis.pdfjsWorker)===null||t===void 0?void 0:t.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};let PDFWorker=_PDFWorker;I=new WeakMap,nt(PDFWorker,I,new WeakMap),exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_cacheSimpleMethod=new WeakSet;class WorkerTransport{constructor(n,h,a,d,r){_classPrivateMethodInitSpec(this,_cacheSimpleMethod),_classPrivateFieldInitSpec(this,_methodPromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map}),this.messageHandler=n,this.loadingTask=h,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:d.ownerDocument,styleElement:d.styleElement}),this._params=d,this.cMapReaderFactory=r==null?void 0:r.cMapReaderFactory,this.standardFontDataFactory=r==null?void 0:r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=a,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=_util.RenderingIntentFlag.DISPLAY,i=null;switch(n){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${n}`)}switch(h){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,i=(r&_util.RenderingIntentFlag.PRINT&&a instanceof _annotation_storage.PrintAnnotationStorage?a:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${h}`)}return d&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:`${r}_${_annotation_storage.AnnotationStorage.getHash(i)}`,annotationStorageMap:i}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const n=[];for(const a of _classPrivateFieldGet(this,_pageCache).values())n.push(a._destroy());_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const h=this.messageHandler.sendWithPromise("Terminate",null);return n.push(h),Promise.all(n).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(this,_methodPromises).clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:n,loadingTask:h}=this;n.on("GetReader",(a,d)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},d.onPull=()=>{this._fullReader.read().then(function(r){let{value:i,done:o}=r;if(o){d.close();return}(0,_util.assert)(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),d.enqueue(new Uint8Array(i),1,[i])}).catch(r=>{d.error(r)})},d.onCancel=r=>{this._fullReader.cancel(r),d.ready.catch(i=>{if(!this.destroyed)throw i})}}),n.on("ReaderHeadersReady",a=>{const d=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{if(!r.isStreamingSupported||!r.isRangeSupported){if(this._lastProgress){var i;(i=h.onProgress)===null||i===void 0||i.call(h,this._lastProgress)}r.onProgress=o=>{var c;(c=h.onProgress)===null||c===void 0||c.call(h,{loaded:o.loaded,total:o.total})}}d.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},d.reject),d.promise}),n.on("GetRangeReader",(a,d)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(a.begin,a.end);if(!r){d.close();return}d.onPull=()=>{r.read().then(function(i){let{value:o,done:c}=i;if(c){d.close();return}(0,_util.assert)(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),d.enqueue(new Uint8Array(o),1,[o])}).catch(i=>{d.error(i)})},d.onCancel=i=>{r.cancel(i),d.ready.catch(o=>{if(!this.destroyed)throw o})}}),n.on("GetDoc",a=>{let{pdfInfo:d}=a;this._numPages=d.numPages,this._htmlForXfa=d.htmlForXfa,delete d.htmlForXfa,h._capability.resolve(new PDFDocumentProxy(d,this))}),n.on("DocException",function(a){let d;switch(a.name){case"PasswordException":d=new _util.PasswordException(a.message,a.code);break;case"InvalidPDFException":d=new _util.InvalidPDFException(a.message);break;case"MissingPDFException":d=new _util.MissingPDFException(a.message);break;case"UnexpectedResponseException":d=new _util.UnexpectedResponseException(a.message,a.status);break;case"UnknownErrorException":d=new _util.UnknownErrorException(a.message,a.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}h._capability.reject(d)}),n.on("PasswordRequest",a=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),h.onPassword){const d=r=>{r instanceof Error?this._passwordCapability.reject(r):this._passwordCapability.resolve({password:r})};try{h.onPassword(d,a.code)}catch(r){this._passwordCapability.reject(r)}}else this._passwordCapability.reject(new _util.PasswordException(a.message,a.code));return this._passwordCapability.promise}),n.on("DataLoaded",a=>{var d;(d=h.onProgress)===null||d===void 0||d.call(h,{loaded:a.length,total:a.length}),this.downloadInfoCapability.resolve(a)}),n.on("StartRenderPage",a=>{if(this.destroyed)return;_classPrivateFieldGet(this,_pageCache).get(a.pageIndex)._startRenderPage(a.transparency,a.cacheKey)}),n.on("commonobj",a=>{var d;let[r,i,o]=a;if(!this.destroyed&&!this.commonObjs.has(r))switch(i){case"Font":const c=this._params;if("error"in o){const f=o.error;(0,_util.warn)(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}let b=null;c.pdfBug&&(d=globalThis.FontInspector)!==null&&d!==void 0&&d.enabled&&(b={registerFont(f,s){globalThis.FontInspector.fontAdded(f,s)}});const y=new _font_loader.FontFaceObject(o,{isEvalSupported:c.isEvalSupported,disableFontFace:c.disableFontFace,ignoreErrors:c.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:b});this.fontLoader.bind(y).catch(f=>n.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c.fontExtraProperties&&y.data&&(y.data=null),this.commonObjs.resolve(r,y)});break;case"FontPath":case"Image":this.commonObjs.resolve(r,o);break;default:throw new Error(`Got unknown common object type ${i}`)}}),n.on("obj",a=>{let[d,r,i,o]=a;if(this.destroyed)return;const c=_classPrivateFieldGet(this,_pageCache).get(r);if(!c.objs.has(d))switch(i){case"Image":c.objs.resolve(d,o);const y=8e6;if(o){let f;if(o.bitmap){const{width:s,height:g}=o;f=s*g*4}else{var b;f=((b=o.data)===null||b===void 0?void 0:b.length)||0}f>y&&(c.cleanupAfterRender=!0)}break;case"Pattern":c.objs.resolve(d,o);break;default:throw new Error(`Got unknown object type ${i}`)}}),n.on("DocProgress",a=>{var d;this.destroyed||(d=h.onProgress)===null||d===void 0||d.call(h,{loaded:a.loaded,total:a.total})}),n.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),n.on("FetchBuiltInCMap",a=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(a):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),n.on("FetchStandardFontData",a=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(a):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature(n){var h,a;let{featureId:d}=n;this.destroyed||(h=(a=this.loadingTask).onUnsupportedFeature)===null||h===void 0||h.call(a,d)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var n;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:((n=this._fullReader)===null||n===void 0?void 0:n.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(n){if(!Number.isInteger(n)||n<=0||n>this._numPages)return Promise.reject(new Error("Invalid page request."));const h=n-1,a=_classPrivateFieldGet(this,_pagePromises).get(h);if(a)return a;const d=this.messageHandler.sendWithPromise("GetPage",{pageIndex:h}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(h,r,this,this._params.ownerDocument,this._params.pdfBug);return _classPrivateFieldGet(this,_pageCache).set(h,i),i});return _classPrivateFieldGet(this,_pagePromises).set(h,d),d}getPageIndex(n){return typeof n!="object"||n===null||!Number.isInteger(n.num)||n.num<0||!Number.isInteger(n.gen)||n.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:n.num,gen:n.gen})}getAnnotations(n,h){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:n,intent:h})}getFieldObjects(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetFieldObjects")}hasJSActions(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(n){return typeof n!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:n})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(n){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:n})}getStructTree(n){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:n})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(n=>new _optional_content_config.OptionalContentConfig(n))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const n="GetMetadata",h=_classPrivateFieldGet(this,_methodPromises).get(n);if(h)return h;const a=this.messageHandler.sendWithPromise(n,null).then(d=>{var r,i;return{info:d[0],metadata:d[1]?new _metadata.Metadata(d[1]):null,contentDispositionFilename:((r=this._fullReader)===null||r===void 0?void 0:r.filename)??null,contentLength:((i=this._fullReader)===null||i===void 0?void 0:i.contentLength)??null}});return _classPrivateFieldGet(this,_methodPromises).set(n,a),a}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const h of _classPrivateFieldGet(this,_pageCache).values())if(!h.cleanup())throw new Error(`startCleanup: Page ${h.pageNumber} is currently rendering.`);this.commonObjs.clear(),n||this.fontLoader.clear(),_classPrivateFieldGet(this,_methodPromises).clear()}}get loadingParams(){const{disableAutoFetch:n,enableXfa:h}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:n,enableXfa:h})}}function _cacheSimpleMethod2(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const h=_classPrivateFieldGet(this,_methodPromises).get(t);if(h)return h;const a=this.messageHandler.sendWithPromise(t,n);return _classPrivateFieldGet(this,_methodPromises).set(t,a),a}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj),_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h){const d=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,n);return d.capability.promise.then(()=>h(d.data)),null}const a=_classPrivateFieldGet(this,_objs)[n];if(!(a!=null&&a.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${n}.`);return a.data}has(n){const h=_classPrivateFieldGet(this,_objs)[n];return(h==null?void 0:h.capability.settled)||!1}resolve(n){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const a=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,n);a.data=h,a.capability.resolve()}clear(){for(const h in _classPrivateFieldGet(this,_objs)){var n;const{data:a}=_classPrivateFieldGet(this,_objs)[h];a==null||(n=a.bitmap)===null||n===void 0||n.close()}_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){const n=_classPrivateFieldGet(this,_objs)[t];return n||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}class RenderTask{constructor(n){nt(this,k,null);rt(this,k,n),this.onContinue=null}get promise(){return Ue(this,k).capability.promise}cancel(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;Ue(this,k).cancel(null,n)}get separateAnnots(){const{separateAnnots:n}=Ue(this,k).operatorList;if(!n)return!1;const{annotationCanvasMap:h}=Ue(this,k);return n.form||n.canvas&&(h==null?void 0:h.size)>0}}k=new WeakMap,exports.RenderTask=RenderTask;const R=class{constructor(n){let{callback:h,params:a,objs:d,commonObjs:r,annotationCanvasMap:i,operatorList:o,pageIndex:c,canvasFactory:b,useRequestAnimationFrame:y=!1,pdfBug:f=!1,pageColors:s=null}=n;this.callback=h,this.params=a,this.objs=d,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=c,this.canvasFactory=b,this._pdfBug=f,this.pageColors=s,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=y===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=a.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(n){var h,a;let{transparency:d=!1,optionalContentConfig:r}=n;if(this.cancelled)return;if(this._canvas){if(Ue(R,m).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Ue(R,m).add(this._canvas)}this._pdfBug&&(h=globalThis.StepperManager)!==null&&h!==void 0&&h.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:o,transform:c,background:b}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:c,viewport:o,transparency:d,background:b}),this.operatorListIdx=0,this.graphicsReady=!0,(a=this.graphicsReadyCallback)===null||a===void 0||a.call(this)}cancel(){var n;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(n=this.gfx)===null||n===void 0||n.endDrawing(),this._canvas&&Ue(R,m).delete(this._canvas),this.callback(h||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",a))}operatorListChanged(){var n;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(n=this.stepper)===null||n===void 0||n.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&Ue(R,m).delete(this._canvas),this.callback())))}};let InternalRenderTask=R;m=new WeakMap,nt(InternalRenderTask,m,new WeakSet);const version="3.4.120";exports.version=version;const build="af6414988";exports.build=build},(W,E,l)=>{var s;Object.defineProperty(E,"__esModule",{value:!0}),E.PrintAnnotationStorage=E.AnnotationStorage=void 0;var p=l(1),v=l(137),I=l(141);function k(g,S){R(g,S),S.add(g)}function m(g,S,D){R(g,S),S.set(g,D)}function R(g,S){if(S.has(g))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t(g,S,D){var w=d(g,S,"set");return n(g,w,D),D}function n(g,S,D){if(S.set)S.set.call(g,D);else{if(!S.writable)throw new TypeError("attempted to set read only private field");S.value=D}}function h(g,S,D){if(!S.has(g))throw new TypeError("attempted to get private field on non-instance");return D}function a(g,S){var D=d(g,S,"get");return r(g,D)}function d(g,S,D){if(!S.has(g))throw new TypeError("attempted to "+D+" private field on non-instance");return S.get(g)}function r(g,S){return S.get?S.get.call(g):S.value}var i=new WeakMap,o=new WeakMap,c=new WeakSet;class b{constructor(){k(this,c),m(this,i,{writable:!0,value:!1}),m(this,o,{writable:!0,value:new Map}),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(S,D){const w=a(this,o).get(S);return w===void 0?D:Object.assign(D,w)}getRawValue(S){return a(this,o).get(S)}remove(S){if(a(this,o).delete(S),a(this,o).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const D of a(this,o).values())if(D instanceof v.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(S,D){const w=a(this,o).get(S);let x=!1;if(w!==void 0)for(const[F,X]of Object.entries(D))w[F]!==X&&(x=!0,w[F]=X);else x=!0,a(this,o).set(S,D);x&&h(this,c,y).call(this),D instanceof v.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(D.constructor._type)}has(S){return a(this,o).has(S)}getAll(){return a(this,o).size>0?(0,p.objectFromMap)(a(this,o)):null}setAll(S){for(const[D,w]of Object.entries(S))this.setValue(D,w)}get size(){return a(this,o).size}resetModified(){a(this,i)&&(t(this,i,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new f(this)}get serializable(){if(a(this,o).size===0)return null;const S=new Map;for(const[D,w]of a(this,o)){const x=w instanceof v.AnnotationEditor?w.serialize():w;x&&S.set(D,x)}return S}static getHash(S){if(!S)return"";const D=new I.MurmurHash3_64;for(const[w,x]of S)D.update(`${w}:${JSON.stringify(x)}`);return D.hexdigest()}}E.AnnotationStorage=b;function y(){a(this,i)||(t(this,i,!0),typeof this.onSetModified=="function"&&this.onSetModified())}class f extends b{constructor(D){super();nt(this,s,null);rt(this,s,structuredClone(D.serializable))}get print(){(0,p.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Ue(this,s)}}s=new WeakMap,E.PrintAnnotationStorage=f},(W,E,l)=>{var k,m,R,t,n,h;Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationEditor=void 0;var p=l(138),v=l(1);const a=class{constructor(r){nt(this,k,this.focusin.bind(this));nt(this,m,this.focusout.bind(this));nt(this,R,!1);nt(this,t,!1);nt(this,n,!1);Et(this,"_uiManager",null);nt(this,h,a._zIndex++);this.constructor===a&&(0,v.unreachable)("Cannot initialize AnnotationEditor."),this.parent=r.parent,this.id=r.id,this.width=this.height=null,this.pageIndex=r.parent.pageIndex,this.name=r.name,this.div=null,this._uiManager=r.uiManager;const{rotation:i,rawDims:{pageWidth:o,pageHeight:c,pageX:b,pageY:y}}=this.parent.viewport;this.rotation=i,this.pageDimensions=[o,c],this.pageTranslation=[b,y];const[f,s]=this.parentDimensions;this.x=r.x/f,this.y=r.y/s,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,v.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(r){this._uiManager.addCommands(r)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Ue(this,h)}setParent(r){r!==null&&(this.pageIndex=r.pageIndex,this.pageDimensions=r.pageDimensions),this.parent=r}focusin(r){Ue(this,R)?rt(this,R,!1):this.parent.setSelected(this)}focusout(r){var i;if(!this.isAttachedToDOM)return;const o=r.relatedTarget;o!=null&&o.closest(`#${this.id}`)||(r.preventDefault(),(i=this.parent)!==null&&i!==void 0&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(r){const i=this.parent.div.getBoundingClientRect();this.startX=r.clientX-i.x,this.startY=r.clientY-i.y,r.dataTransfer.setData("text/plain",this.id),r.dataTransfer.effectAllowed="move"}setAt(r,i,o,c){const[b,y]=this.parentDimensions;[o,c]=this.screenToPageTranslation(o,c),this.x=(r+o)/b,this.y=(i+c)/y,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(r,i){const[o,c]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x+=r/o,this.y+=i/c,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(r,i){switch(this.parentRotation){case 90:return[i,-r];case 180:return[-r,-i];case 270:return[-i,r];default:return[r,i]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:r}=this._uiManager.viewParameters,[i,o]=this.pageDimensions;return[i*r,o*r]}setDims(r,i){const[o,c]=this.parentDimensions;this.div.style.width=`${100*r/o}%`,this.div.style.height=`${100*i/c}%`}fixDims(){const{style:r}=this.div,{height:i,width:o}=r,c=o.endsWith("%"),b=i.endsWith("%");if(c&&b)return;const[y,f]=this.parentDimensions;c||(r.width=`${100*parseFloat(o)/y}%`),b||(r.height=`${100*parseFloat(i)/f}%`)}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Ue(this,k)),this.div.addEventListener("focusout",Ue(this,m));const[r,i]=this.getInitialTranslation();return this.translate(r,i),(0,p.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(r){const{isMac:i}=v.FeatureTest.platform;if(r.button!==0||r.ctrlKey&&i){r.preventDefault();return}r.ctrlKey&&!i||r.shiftKey||r.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this),rt(this,R,!0)}getRect(r,i){const o=this.parentScale,[c,b]=this.pageDimensions,[y,f]=this.pageTranslation,s=r/o,g=i/o,S=this.x*c,D=this.y*b,w=this.width*c,x=this.height*b;switch(this.rotation){case 0:return[S+s+y,b-D-g-x+f,S+s+w+y,b-D-g+f];case 90:return[S+g+y,b-D+s+f,S+g+x+y,b-D+s+w+f];case 180:return[S-s-w+y,b-D+g+f,S-s+y,b-D+g+x+f];case 270:return[S-g-x+y,b-D-s-w+f,S-g+y,b-D-s+f];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(r,i){const[o,c,b,y]=r,f=b-o,s=y-c;switch(this.rotation){case 0:return[o,i-y,f,s];case 90:return[o,i-c,s,f];case 180:return[b,i-c,f,s];case 270:return[b,i-y,s,f];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){rt(this,n,!0)}disableEditMode(){rt(this,n,!1)}isInEditMode(){return Ue(this,n)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var r;(r=this.div)===null||r===void 0||r.addEventListener("focusin",Ue(this,k))}serialize(){(0,v.unreachable)("An editor must be serializable")}static deserialize(r,i,o){const c=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:o});c.rotation=r.rotation;const[b,y]=c.pageDimensions,[f,s,g,S]=c.getRectInCurrentCoords(r.rect,y);return c.x=f/b,c.y=s/y,c.width=g/b,c.height=S/y,c}remove(){this.div.removeEventListener("focusin",Ue(this,k)),this.div.removeEventListener("focusout",Ue(this,m)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var r;(r=this.div)===null||r===void 0||r.classList.add("selectedEditor")}unselect(){var r;(r=this.div)===null||r===void 0||r.classList.remove("selectedEditor")}updateParams(r,i){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return Ue(this,t)}set isEditing(r){rt(this,t,r),r?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};let I=a;k=new WeakMap,m=new WeakMap,R=new WeakMap,t=new WeakMap,n=new WeakMap,h=new WeakMap,Et(I,"_colorManager",new p.ColorManager),Et(I,"_zIndex",1),E.AnnotationEditor=I},(W,E,l)=>{var de,Pe,De,Fe,_e;Object.defineProperty(E,"__esModule",{value:!0}),E.KeyboardManager=E.CommandManager=E.ColorManager=E.AnnotationEditorUIManager=void 0,E.bindEvents=c,E.opacityToHex=b;var p=l(1),v=l(139);function I(Ae,ce,Ee){return ce=k(ce),ce in Ae?Object.defineProperty(Ae,ce,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Ae[ce]=Ee,Ae}function k(Ae){var ce=m(Ae,"string");return typeof ce=="symbol"?ce:String(ce)}function m(Ae,ce){if(typeof Ae!="object"||Ae===null)return Ae;var Ee=Ae[Symbol.toPrimitive];if(Ee!==void 0){var We=Ee.call(Ae,ce||"default");if(typeof We!="object")return We;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ce==="string"?String:Number)(Ae)}function R(Ae,ce,Ee){i(Ae,ce),ce.set(Ae,Ee)}function t(Ae,ce){var Ee=a(Ae,ce,"get");return n(Ae,Ee)}function n(Ae,ce){return ce.get?ce.get.call(Ae):ce.value}function h(Ae,ce,Ee){var We=a(Ae,ce,"set");return d(Ae,We,Ee),Ee}function a(Ae,ce,Ee){if(!ce.has(Ae))throw new TypeError("attempted to "+Ee+" private field on non-instance");return ce.get(Ae)}function d(Ae,ce,Ee){if(ce.set)ce.set.call(Ae,Ee);else{if(!ce.writable)throw new TypeError("attempted to set read only private field");ce.value=Ee}}function r(Ae,ce){i(Ae,ce),ce.add(Ae)}function i(Ae,ce){if(ce.has(Ae))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(Ae,ce,Ee){if(!ce.has(Ae))throw new TypeError("attempted to get private field on non-instance");return Ee}function c(Ae,ce,Ee){for(const We of Ee)ce.addEventListener(We,Ae[We].bind(Ae))}function b(Ae){return Math.round(Math.min(255,Math.max(1,255*Ae))).toString(16).padStart(2,"0")}class y{constructor(){nt(this,de,0)}getId(){return`${p.AnnotationEditorPrefix}${Kn(this,de)._++}`}}de=new WeakMap;class f{constructor(){nt(this,Pe,[]);nt(this,De,!1);nt(this,Fe,void 0);nt(this,_e,-1);let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;rt(this,Fe,ce)}add(ce){let{cmd:Ee,undo:We,mustExec:Oe,type:$e=NaN,overwriteIfSameType:oe=!1,keepUndo:J=!1}=ce;if(Oe&&Ee(),Ue(this,De))return;const pe={cmd:Ee,undo:We,type:$e};if(Ue(this,_e)===-1){Ue(this,Pe).length>0&&(Ue(this,Pe).length=0),rt(this,_e,0),Ue(this,Pe).push(pe);return}if(oe&&Ue(this,Pe)[Ue(this,_e)].type===$e){J&&(pe.undo=Ue(this,Pe)[Ue(this,_e)].undo),Ue(this,Pe)[Ue(this,_e)]=pe;return}const ke=Ue(this,_e)+1;ke===Ue(this,Fe)?Ue(this,Pe).splice(0,1):(rt(this,_e,ke),ke$e===Ee[oe]))return Me._colorsMapping.get(We);return Ee}getHexCode(ce){const Ee=this._colors.get(ce);return Ee?p.Util.makeHexColor(...Ee):ce}};let D=Me;Et(D,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),E.ColorManager=D;var w=new WeakMap,x=new WeakMap,F=new WeakMap,X=new WeakMap,G=new WeakMap,j=new WeakMap,N=new WeakMap,Q=new WeakMap,Y=new WeakMap,B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,C=new WeakMap,P=new WeakMap,z=new WeakMap,ee=new WeakMap,te=new WeakMap,K=new WeakMap,ue=new WeakMap,fe=new WeakMap,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet,Z=new WeakSet,se=new WeakSet,ne=new WeakSet;class re{constructor(ce,Ee,We){r(this,ne),r(this,se),r(this,Z),r(this,U),r(this,M),r(this,O),r(this,A),r(this,ge),r(this,we),r(this,me),r(this,ye),R(this,w,{writable:!0,value:null}),R(this,x,{writable:!0,value:new Map}),R(this,F,{writable:!0,value:new Map}),R(this,X,{writable:!0,value:null}),R(this,G,{writable:!0,value:new f}),R(this,j,{writable:!0,value:0}),R(this,N,{writable:!0,value:null}),R(this,Q,{writable:!0,value:new Set}),R(this,Y,{writable:!0,value:null}),R(this,B,{writable:!0,value:new y}),R(this,ie,{writable:!0,value:!1}),R(this,q,{writable:!0,value:p.AnnotationEditorType.NONE}),R(this,_,{writable:!0,value:new Set}),R(this,H,{writable:!0,value:this.copy.bind(this)}),R(this,$,{writable:!0,value:this.cut.bind(this)}),R(this,C,{writable:!0,value:this.paste.bind(this)}),R(this,P,{writable:!0,value:this.keydown.bind(this)}),R(this,z,{writable:!0,value:this.onEditingAction.bind(this)}),R(this,ee,{writable:!0,value:this.onPageChanging.bind(this)}),R(this,te,{writable:!0,value:this.onScaleChanging.bind(this)}),R(this,K,{writable:!0,value:this.onRotationChanging.bind(this)}),R(this,ue,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}}),R(this,fe,{writable:!0,value:null}),h(this,fe,ce),h(this,Y,Ee),t(this,Y)._on("editingaction",t(this,z)),t(this,Y)._on("pagechanging",t(this,ee)),t(this,Y)._on("scalechanging",t(this,te)),t(this,Y)._on("rotationchanging",t(this,K)),h(this,X,We),this.viewParameters={realScale:v.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){o(this,me,he).call(this),t(this,Y)._off("editingaction",t(this,z)),t(this,Y)._off("pagechanging",t(this,ee)),t(this,Y)._off("scalechanging",t(this,te)),t(this,Y)._off("rotationchanging",t(this,K));for(const ce of t(this,F).values())ce.destroy();t(this,F).clear(),t(this,x).clear(),t(this,Q).clear(),h(this,w,null),t(this,_).clear(),t(this,G).destroy()}onPageChanging(ce){let{pageNumber:Ee}=ce;h(this,j,Ee-1)}focusMainContainer(){t(this,fe).focus()}addShouldRescale(ce){t(this,Q).add(ce)}removeShouldRescale(ce){t(this,Q).delete(ce)}onScaleChanging(ce){let{scale:Ee}=ce;this.commitOrRemove(),this.viewParameters.realScale=Ee*v.PixelsPerInch.PDF_TO_CSS_UNITS;for(const We of t(this,Q))We.onScaleChanging()}onRotationChanging(ce){let{pagesRotation:Ee}=ce;this.commitOrRemove(),this.viewParameters.rotation=Ee}addToAnnotationStorage(ce){!ce.isEmpty()&&t(this,X)&&!t(this,X).has(ce.id)&&t(this,X).setValue(ce.id,ce)}copy(ce){if(ce.preventDefault(),t(this,w)&&t(this,w).commitOrRemove(),!this.hasSelection)return;const Ee=[];for(const We of t(this,_))We.isEmpty()||Ee.push(We.serialize());Ee.length!==0&&ce.clipboardData.setData("application/pdfjs",JSON.stringify(Ee))}cut(ce){this.copy(ce),this.delete()}paste(ce){ce.preventDefault();let Ee=ce.clipboardData.getData("application/pdfjs");if(!Ee)return;try{Ee=JSON.parse(Ee)}catch(Oe){(0,p.warn)(`paste: "${Oe.message}".`);return}if(!Array.isArray(Ee))return;this.unselectAll();const We=t(this,F).get(t(this,j));try{const Oe=[];for(const J of Ee){const pe=We.deserialize(J);if(!pe)return;Oe.push(pe)}const $e=()=>{for(const J of Oe)o(this,Z,ae).call(this,J);o(this,ne,V).call(this,Oe)},oe=()=>{for(const J of Oe)J.remove()};this.addCommands({cmd:$e,undo:oe,mustExec:!0})}catch(Oe){(0,p.warn)(`paste: "${Oe.message}".`)}}keydown(ce){var Ee;(Ee=this.getActive())!==null&&Ee!==void 0&&Ee.shouldGetKeyboardEvents()||re._keyboardManager.exec(this,ce)}onEditingAction(ce){["undo","redo","delete","selectAll"].includes(ce.name)&&this[ce.name]()}setEditingState(ce){ce?(o(this,ye,ve).call(this),o(this,we,be).call(this),o(this,A,Te).call(this,{isEditing:t(this,q)!==p.AnnotationEditorType.NONE,isEmpty:o(this,se,T).call(this),hasSomethingToUndo:t(this,G).hasSomethingToUndo(),hasSomethingToRedo:t(this,G).hasSomethingToRedo(),hasSelectedEditor:!1})):(o(this,me,he).call(this),o(this,ge,Ce).call(this),o(this,A,Te).call(this,{isEditing:!1}))}registerEditorTypes(ce){if(!t(this,N)){h(this,N,ce);for(const Ee of t(this,N))o(this,O,Ie).call(this,Ee.defaultPropertiesToUpdate)}}getId(){return t(this,B).getId()}get currentLayer(){return t(this,F).get(t(this,j))}get currentPageIndex(){return t(this,j)}addLayer(ce){t(this,F).set(ce.pageIndex,ce),t(this,ie)?ce.enable():ce.disable()}removeLayer(ce){t(this,F).delete(ce.pageIndex)}updateMode(ce){if(h(this,q,ce),ce===p.AnnotationEditorType.NONE)this.setEditingState(!1),o(this,U,Ve).call(this);else{this.setEditingState(!0),o(this,M,He).call(this);for(const Ee of t(this,F).values())Ee.updateMode(ce)}}updateToolbar(ce){ce!==t(this,q)&&t(this,Y).dispatch("switchannotationeditormode",{source:this,mode:ce})}updateParams(ce,Ee){if(t(this,N)){for(const We of t(this,_))We.updateParams(ce,Ee);for(const We of t(this,N))We.updateDefaultParams(ce,Ee)}}getEditors(ce){const Ee=[];for(const We of t(this,x).values())We.pageIndex===ce&&Ee.push(We);return Ee}getEditor(ce){return t(this,x).get(ce)}addEditor(ce){t(this,x).set(ce.id,ce)}removeEditor(ce){var Ee;t(this,x).delete(ce.id),this.unselect(ce),(Ee=t(this,X))===null||Ee===void 0||Ee.remove(ce.id)}setActiveEditor(ce){t(this,w)!==ce&&(h(this,w,ce),ce&&o(this,O,Ie).call(this,ce.propertiesToUpdate))}toggleSelected(ce){if(t(this,_).has(ce)){t(this,_).delete(ce),ce.unselect(),o(this,A,Te).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,_).add(ce),ce.select(),o(this,O,Ie).call(this,ce.propertiesToUpdate),o(this,A,Te).call(this,{hasSelectedEditor:!0})}setSelected(ce){for(const Ee of t(this,_))Ee!==ce&&Ee.unselect();t(this,_).clear(),t(this,_).add(ce),ce.select(),o(this,O,Ie).call(this,ce.propertiesToUpdate),o(this,A,Te).call(this,{hasSelectedEditor:!0})}isSelected(ce){return t(this,_).has(ce)}unselect(ce){ce.unselect(),t(this,_).delete(ce),o(this,A,Te).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,_).size!==0}undo(){t(this,G).undo(),o(this,A,Te).call(this,{hasSomethingToUndo:t(this,G).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:o(this,se,T).call(this)})}redo(){t(this,G).redo(),o(this,A,Te).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,G).hasSomethingToRedo(),isEmpty:o(this,se,T).call(this)})}addCommands(ce){t(this,G).add(ce),o(this,A,Te).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:o(this,se,T).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const ce=[...t(this,_)],Ee=()=>{for(const Oe of ce)Oe.remove()},We=()=>{for(const Oe of ce)o(this,Z,ae).call(this,Oe)};this.addCommands({cmd:Ee,undo:We,mustExec:!0})}commitOrRemove(){var ce;(ce=t(this,w))===null||ce===void 0||ce.commitOrRemove()}selectAll(){for(const ce of t(this,_))ce.commit();o(this,ne,V).call(this,t(this,x).values())}unselectAll(){if(t(this,w)){t(this,w).commitOrRemove();return}if(t(this,_).size!==0){for(const ce of t(this,_))ce.unselect();t(this,_).clear(),o(this,A,Te).call(this,{hasSelectedEditor:!1})}}isActive(ce){return t(this,w)===ce}getActive(){return t(this,w)}getMode(){return t(this,q)}}E.AnnotationEditorUIManager=re;function ve(){t(this,fe).addEventListener("keydown",t(this,P))}function he(){t(this,fe).removeEventListener("keydown",t(this,P))}function be(){document.addEventListener("copy",t(this,H)),document.addEventListener("cut",t(this,$)),document.addEventListener("paste",t(this,C))}function Ce(){document.removeEventListener("copy",t(this,H)),document.removeEventListener("cut",t(this,$)),document.removeEventListener("paste",t(this,C))}function Te(Ae){Object.entries(Ae).some(Ee=>{let[We,Oe]=Ee;return t(this,ue)[We]!==Oe})&&t(this,Y).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,ue),Ae)})}function Ie(Ae){t(this,Y).dispatch("annotationeditorparamschanged",{source:this,details:Ae})}function He(){if(!t(this,ie)){h(this,ie,!0);for(const Ae of t(this,F).values())Ae.enable()}}function Ve(){if(this.unselectAll(),t(this,ie)){h(this,ie,!1);for(const Ae of t(this,F).values())Ae.disable()}}function ae(Ae){const ce=t(this,F).get(Ae.pageIndex);ce?ce.addOrRebuild(Ae):this.addEditor(Ae)}function T(){if(t(this,x).size===0)return!0;if(t(this,x).size===1)for(const Ae of t(this,x).values())return Ae.isEmpty();return!1}function V(Ae){t(this,_).clear();for(const ce of Ae)ce.isEmpty()||(t(this,_).add(ce),ce.select());o(this,A,Te).call(this,{hasSelectedEditor:!0})}I(re,"_keyboardManager",new g([[["ctrl+a","mac+meta+a"],re.prototype.selectAll],[["ctrl+z","mac+meta+z"],re.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],re.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],re.prototype.delete],[["Escape","mac+Escape"],re.prototype.unselectAll]]))},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.StatTimer=E.RenderingCancelledException=E.PixelsPerInch=E.PageViewport=E.PDFDateString=E.DOMStandardFontDataFactory=E.DOMSVGFactory=E.DOMCanvasFactory=E.DOMCMapReaderFactory=E.AnnotationPrefix=void 0,E.deprecated=g,E.getColorValues=F,E.getCurrentTransform=X,E.getCurrentTransformInverse=G,E.getFilenameFromUrl=c,E.getPdfFilenameFromUrl=b,E.getRGB=x,E.getXfaPageViewport=w,E.isDataScheme=i,E.isPdfFile=o,E.isValidFetchUrl=f,E.loadScript=s,E.setLayerDimensions=j;var p=l(140),v=l(1);const I="http://www.w3.org/2000/svg",k="pdfjs_internal_id_";E.AnnotationPrefix=k;const N=class{};let m=N;Et(m,"CSS",96),Et(m,"PDF",72),Et(m,"PDF_TO_CSS_UNITS",N.CSS/N.PDF),E.PixelsPerInch=m;class R extends p.BaseCanvasFactory{constructor(){let{ownerDocument:Y=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=Y}_createCanvas(Y,B){const ie=this._document.createElement("canvas");return ie.width=Y,ie.height=B,ie}}E.DOMCanvasFactory=R;async function t(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(f(Q,document.baseURI)){const B=await fetch(Q);if(!B.ok)throw new Error(B.statusText);return Y?new Uint8Array(await B.arrayBuffer()):(0,v.stringToBytes)(await B.text())}return new Promise((B,ie)=>{const q=new XMLHttpRequest;q.open("GET",Q,!0),Y&&(q.responseType="arraybuffer"),q.onreadystatechange=()=>{if(q.readyState===XMLHttpRequest.DONE){if(q.status===200||q.status===0){let _;if(Y&&q.response?_=new Uint8Array(q.response):!Y&&q.responseText&&(_=(0,v.stringToBytes)(q.responseText)),_){B(_);return}}ie(new Error(q.statusText))}},q.send(null)})}class n extends p.BaseCMapReaderFactory{_fetchData(Y,B){return t(Y,this.isCompressed).then(ie=>({cMapData:ie,compressionType:B}))}}E.DOMCMapReaderFactory=n;class h extends p.BaseStandardFontDataFactory{_fetchData(Y){return t(Y,!0)}}E.DOMStandardFontDataFactory=h;class a extends p.BaseSVGFactory{_createSVG(Y){return document.createElementNS(I,Y)}}E.DOMSVGFactory=a;class d{constructor(Y){let{viewBox:B,scale:ie,rotation:q,offsetX:_=0,offsetY:H=0,dontFlip:$=!1}=Y;this.viewBox=B,this.scale=ie,this.rotation=q,this.offsetX=_,this.offsetY=H;const C=(B[2]+B[0])/2,P=(B[3]+B[1])/2;let z,ee,te,K;switch(q%=360,q<0&&(q+=360),q){case 180:z=-1,ee=0,te=0,K=1;break;case 90:z=0,ee=1,te=1,K=0;break;case 270:z=0,ee=-1,te=-1,K=0;break;case 0:z=1,ee=0,te=0,K=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}$&&(te=-te,K=-K);let ue,fe,ye,me;z===0?(ue=Math.abs(P-B[1])*ie+_,fe=Math.abs(C-B[0])*ie+H,ye=(B[3]-B[1])*ie,me=(B[2]-B[0])*ie):(ue=Math.abs(C-B[0])*ie+_,fe=Math.abs(P-B[1])*ie+H,ye=(B[2]-B[0])*ie,me=(B[3]-B[1])*ie),this.transform=[z*ie,ee*ie,te*ie,K*ie,ue-z*ie*C-te*ie*P,fe-ee*ie*C-K*ie*P],this.width=ye,this.height=me}get rawDims(){const{viewBox:Y}=this;return(0,v.shadow)(this,"rawDims",{pageWidth:Y[2]-Y[0],pageHeight:Y[3]-Y[1],pageX:Y[0],pageY:Y[1]})}clone(){let{scale:Y=this.scale,rotation:B=this.rotation,offsetX:ie=this.offsetX,offsetY:q=this.offsetY,dontFlip:_=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new d({viewBox:this.viewBox.slice(),scale:Y,rotation:B,offsetX:ie,offsetY:q,dontFlip:_})}convertToViewportPoint(Y,B){return v.Util.applyTransform([Y,B],this.transform)}convertToViewportRectangle(Y){const B=v.Util.applyTransform([Y[0],Y[1]],this.transform),ie=v.Util.applyTransform([Y[2],Y[3]],this.transform);return[B[0],B[1],ie[0],ie[1]]}convertToPdfPoint(Y,B){return v.Util.applyInverseTransform([Y,B],this.transform)}}E.PageViewport=d;class r extends v.BaseException{constructor(Y,B){let ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;super(Y,"RenderingCancelledException"),this.type=B,this.extraDelay=ie}}E.RenderingCancelledException=r;function i(Q){const Y=Q.length;let B=0;for(;B1&&arguments[1]!==void 0?arguments[1]:!1)||([Q]=Q.split(/[#?]/,1)),Q.substring(Q.lastIndexOf("/")+1)}function b(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof Q!="string")return Y;if(i(Q))return(0,v.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),Y;const B=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ie=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,q=B.exec(Q);let _=ie.exec(q[1])||ie.exec(q[2])||ie.exec(q[3]);if(_&&(_=_[0],_.includes("%")))try{_=ie.exec(decodeURIComponent(_))[0]}catch{}return _||Y}class y{constructor(){Et(this,"started",Object.create(null));Et(this,"times",[])}time(Y){Y in this.started&&(0,v.warn)(`Timer is already running for ${Y}`),this.started[Y]=Date.now()}timeEnd(Y){Y in this.started||(0,v.warn)(`Timer has not been started for ${Y}`),this.times.push({name:Y,start:this.started[Y],end:Date.now()}),delete this.started[Y]}toString(){const Y=[];let B=0;for(const{name:ie}of this.times)B=Math.max(ie.length,B);for(const{name:ie,start:q,end:_}of this.times)Y.push(`${ie.padEnd(B)} ${_-q}ms
+`);return Y.join("")}}E.StatTimer=y;function f(Q,Y){try{const{protocol:B}=Y?new URL(Q,Y):new URL(Q);return B==="http:"||B==="https:"}catch{return!1}}function s(Q){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((B,ie)=>{const q=document.createElement("script");q.src=Q,q.onload=function(_){Y&&q.remove(),B(_)},q.onerror=function(){ie(new Error(`Cannot load script at: ${q.src}`))},(document.head||document.documentElement).append(q)})}function g(Q){console.log("Deprecated API usage: "+Q)}let S;class D{static toDateObject(Y){if(!Y||typeof Y!="string")return null;S||(S=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const B=S.exec(Y);if(!B)return null;const ie=parseInt(B[1],10);let q=parseInt(B[2],10);q=q>=1&&q<=12?q-1:0;let _=parseInt(B[3],10);_=_>=1&&_<=31?_:1;let H=parseInt(B[4],10);H=H>=0&&H<=23?H:0;let $=parseInt(B[5],10);$=$>=0&&$<=59?$:0;let C=parseInt(B[6],10);C=C>=0&&C<=59?C:0;const P=B[7]||"Z";let z=parseInt(B[8],10);z=z>=0&&z<=23?z:0;let ee=parseInt(B[9],10)||0;return ee=ee>=0&&ee<=59?ee:0,P==="-"?(H+=z,$+=ee):P==="+"&&(H-=z,$-=ee),new Date(Date.UTC(ie,q,_,H,$,C))}}E.PDFDateString=D;function w(Q,Y){let{scale:B=1,rotation:ie=0}=Y;const{width:q,height:_}=Q.attributes.style,H=[0,0,parseInt(q),parseInt(_)];return new d({viewBox:H,scale:B,rotation:ie})}function x(Q){if(Q.startsWith("#")){const Y=parseInt(Q.slice(1),16);return[(Y&16711680)>>16,(Y&65280)>>8,Y&255]}return Q.startsWith("rgb(")?Q.slice(4,-1).split(",").map(Y=>parseInt(Y)):Q.startsWith("rgba(")?Q.slice(5,-1).split(",").map(Y=>parseInt(Y)).slice(0,3):((0,v.warn)(`Not a valid color format: "${Q}"`),[0,0,0])}function F(Q){const Y=document.createElement("span");Y.style.visibility="hidden",document.body.append(Y);for(const B of Q.keys()){Y.style.color=B;const ie=window.getComputedStyle(Y).color;Q.set(B,x(ie))}Y.remove()}function X(Q){const{a:Y,b:B,c:ie,d:q,e:_,f:H}=Q.getTransform();return[Y,B,ie,q,_,H]}function G(Q){const{a:Y,b:B,c:ie,d:q,e:_,f:H}=Q.getTransform().invertSelf();return[Y,B,ie,q,_,H]}function j(Q,Y){let B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(Y instanceof d){const{pageWidth:q,pageHeight:_}=Y.rawDims,{style:H}=Q,$=`calc(var(--scale-factor) * ${q}px)`,C=`calc(var(--scale-factor) * ${_}px)`;!B||Y.rotation%180===0?(H.width=$,H.height=C):(H.width=C,H.height=$)}ie&&Q.setAttribute("data-main-rotation",Y.rotation)}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.BaseStandardFontDataFactory=E.BaseSVGFactory=E.BaseCanvasFactory=E.BaseCMapReaderFactory=void 0;var p=l(1);class v{constructor(){this.constructor===v&&(0,p.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,n){if(t<=0||n<=0)throw new Error("Invalid canvas size");const h=this._createCanvas(t,n);return{canvas:h,context:h.getContext("2d")}}reset(t,n,h){if(!t.canvas)throw new Error("Canvas is not specified");if(n<=0||h<=0)throw new Error("Invalid canvas size");t.canvas.width=n,t.canvas.height=h}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,n){(0,p.unreachable)("Abstract method `_createCanvas` called.")}}E.BaseCanvasFactory=v;class I{constructor(t){let{baseUrl:n=null,isCompressed:h=!0}=t;this.constructor===I&&(0,p.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=n,this.isCompressed=h}async fetch(t){let{name:n}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!n)throw new Error("CMap name must be specified.");const h=this.baseUrl+n+(this.isCompressed?".bcmap":""),a=this.isCompressed?p.CMapCompressionType.BINARY:p.CMapCompressionType.NONE;return this._fetchData(h,a).catch(d=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${h}`)})}_fetchData(t,n){(0,p.unreachable)("Abstract method `_fetchData` called.")}}E.BaseCMapReaderFactory=I;class k{constructor(t){let{baseUrl:n=null}=t;this.constructor===k&&(0,p.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=n}async fetch(t){let{filename:n}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!n)throw new Error("Font filename must be specified.");const h=`${this.baseUrl}${n}`;return this._fetchData(h).catch(a=>{throw new Error(`Unable to load font data at: ${h}`)})}_fetchData(t){(0,p.unreachable)("Abstract method `_fetchData` called.")}}E.BaseStandardFontDataFactory=k;class m{constructor(){this.constructor===m&&(0,p.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,n){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t<=0||n<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),h||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${n}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${n}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,p.unreachable)("Abstract method `_createSVG` called.")}}E.BaseSVGFactory=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.MurmurHash3_64=void 0;var p=l(1);const v=3285377520,I=4294901760,k=65535;class m{constructor(t){this.h1=t?t&4294967295:v,this.h2=t?t&4294967295:v}update(t){let n,h;if(typeof t=="string"){n=new Uint8Array(t.length*2),h=0;for(let S=0,D=t.length;S>>8,n[h++]=w&255)}}else if((0,p.isArrayBuffer)(t))n=t.slice(),h=n.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const a=h>>2,d=h-a*4,r=new Uint32Array(n.buffer,0,a);let i=0,o=0,c=this.h1,b=this.h2;const y=3432918353,f=461845907,s=y&k,g=f&k;for(let S=0;S>>17,i=i*f&I|i*g&k,c^=i,c=c<<13|c>>>19,c=c*5+3864292196):(o=r[S],o=o*y&I|o*s&k,o=o<<15|o>>>17,o=o*f&I|o*g&k,b^=o,b=b<<13|b>>>19,b=b*5+3864292196);switch(i=0,d){case 3:i^=n[a*4+2]<<16;case 2:i^=n[a*4+1]<<8;case 1:i^=n[a*4],i=i*y&I|i*s&k,i=i<<15|i>>>17,i=i*f&I|i*g&k,a&1?c^=i:b^=i}this.h1=c,this.h2=b}hexdigest(){let t=this.h1,n=this.h2;return t^=n>>>1,t=t*3981806797&I|t*36045&k,n=n*4283543511&I|((n<<16|t>>>16)*2950163797&I)>>>16,t^=n>>>1,t=t*444984403&I|t*60499&k,n=n*3301882366&I|((n<<16|t>>>16)*3120437893&I)>>>16,t^=n>>>1,(t>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}E.MurmurHash3_64=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.FontLoader=E.FontFaceObject=void 0;var p=l(1),v=l(3);class I{constructor(R){let{onUnsupportedFeature:t,ownerDocument:n=globalThis.document,styleElement:h=null}=R;this._onUnsupportedFeature=t,this._document=n,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(R){this.nativeFontFaces.push(R),this._document.fonts.add(R)}insertRule(R){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(R,t.cssRules.length)}clear(){for(const R of this.nativeFontFaces)this._document.fonts.delete(R);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(R){if(R.attached||R.missingFile)return;if(R.attached=!0,this.isFontLoadingAPISupported){const n=R.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(h){throw this._onUnsupportedFeature({featureId:p.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,p.warn)(`Failed to load font '${n.family}': '${h}'.`),R.disableFontFace=!0,h}}return}const t=R.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const h=this._queueLoadingCallback(n);this._prepareFontLoadEvent(R,h)})}}get isFontLoadingAPISupported(){var R;const t=!!((R=this._document)!==null&&R!==void 0&&R.fonts);return(0,p.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let R=!1;return(v.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(R=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",R)}_queueLoadingCallback(R){function t(){for((0,p.assert)(!h.done,"completeRequest() cannot be called twice."),h.done=!0;n.length>0&&n[0].done;){const a=n.shift();setTimeout(a.callback,0)}}const{loadingRequests:n}=this,h={done:!1,complete:t,callback:R};return n.push(h),h}get _loadTestFont(){const R=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",R)}_prepareFontLoadEvent(R,t){function n(F,X){return F.charCodeAt(X)<<24|F.charCodeAt(X+1)<<16|F.charCodeAt(X+2)<<8|F.charCodeAt(X+3)&255}function h(F,X,G,j){const N=F.substring(0,X),Q=F.substring(X+G);return N+j+Q}let a,d;const r=this._document.createElement("canvas");r.width=1,r.height=1;const i=r.getContext("2d");let o=0;function c(F,X){if(++o>30){(0,p.warn)("Load test font never loaded."),X();return}if(i.font="30px "+F,i.fillText(".",0,20),i.getImageData(0,0,1,1).data[3]>0){X();return}setTimeout(c.bind(null,F,X))}const b=`lt${Date.now()}${this.loadTestFontId++}`;let y=this._loadTestFont;y=h(y,976,b.length,b);const s=16,g=1482184792;let S=n(y,s);for(a=0,d=b.length-3;a{x.remove(),t.complete()})}}E.FontLoader=I;class k{constructor(R,t){let{isEvalSupported:n=!0,disableFontFace:h=!1,ignoreErrors:a=!1,onUnsupportedFeature:d,fontRegistry:r=null}=t;this.compiledGlyphs=Object.create(null);for(const i in R)this[i]=R[i];this.isEvalSupported=n!==!1,this.disableFontFace=h===!0,this.ignoreErrors=a===!0,this._onUnsupportedFeature=d,this.fontRegistry=r}createNativeFontFace(){var R;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return(R=this.fontRegistry)===null||R===void 0||R.registerFont(this),t}createFontFaceRule(){var R;if(!this.data||this.disableFontFace)return null;const t=(0,p.bytesToString)(this.data),n=`url(data:${this.mimetype};base64,${btoa(t)});`;let h;if(!this.cssFontInfo)h=`@font-face {font-family:"${this.loadedName}";src:${n}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),h=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${n}}`}return(R=this.fontRegistry)===null||R===void 0||R.registerFont(this,n),h}getPathGenerator(R,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n;try{n=R.get(this.loadedName+"_path_"+t)}catch(h){if(!this.ignoreErrors)throw h;return this._onUnsupportedFeature({featureId:p.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,p.warn)(`getPathGenerator - ignoring character: "${h}".`),this.compiledGlyphs[t]=function(a,d){}}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const h=[];for(const a of n){const d=a.args!==void 0?a.args.join(","):"";h.push("c.",a.cmd,"(",d,`);
+`)}return this.compiledGlyphs[t]=new Function("c","size",h.join(""))}return this.compiledGlyphs[t]=function(h,a){for(const d of n)d.cmd==="scale"&&(d.args=[a,-a]),h[d.cmd].apply(h,d.args)}}}E.FontFaceObject=k},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.CanvasGraphics=void 0;var p=l(1),v=l(139),I=l(144),k=l(145);function m($,C){R($,C),C.add($)}function R($,C){if(C.has($))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t($,C,P){if(!C.has($))throw new TypeError("attempted to get private field on non-instance");return P}const n=16,h=100,a=4096,d=15,r=10,i=1e3,o=16;function c($,C){if($._removeMirroring)throw new Error("Context is already forwarding operations.");$.__originalSave=$.save,$.__originalRestore=$.restore,$.__originalRotate=$.rotate,$.__originalScale=$.scale,$.__originalTranslate=$.translate,$.__originalTransform=$.transform,$.__originalSetTransform=$.setTransform,$.__originalResetTransform=$.resetTransform,$.__originalClip=$.clip,$.__originalMoveTo=$.moveTo,$.__originalLineTo=$.lineTo,$.__originalBezierCurveTo=$.bezierCurveTo,$.__originalRect=$.rect,$.__originalClosePath=$.closePath,$.__originalBeginPath=$.beginPath,$._removeMirroring=()=>{$.save=$.__originalSave,$.restore=$.__originalRestore,$.rotate=$.__originalRotate,$.scale=$.__originalScale,$.translate=$.__originalTranslate,$.transform=$.__originalTransform,$.setTransform=$.__originalSetTransform,$.resetTransform=$.__originalResetTransform,$.clip=$.__originalClip,$.moveTo=$.__originalMoveTo,$.lineTo=$.__originalLineTo,$.bezierCurveTo=$.__originalBezierCurveTo,$.rect=$.__originalRect,$.closePath=$.__originalClosePath,$.beginPath=$.__originalBeginPath,delete $._removeMirroring},$.save=function(){C.save(),this.__originalSave()},$.restore=function(){C.restore(),this.__originalRestore()},$.translate=function(z,ee){C.translate(z,ee),this.__originalTranslate(z,ee)},$.scale=function(z,ee){C.scale(z,ee),this.__originalScale(z,ee)},$.transform=function(z,ee,te,K,ue,fe){C.transform(z,ee,te,K,ue,fe),this.__originalTransform(z,ee,te,K,ue,fe)},$.setTransform=function(z,ee,te,K,ue,fe){C.setTransform(z,ee,te,K,ue,fe),this.__originalSetTransform(z,ee,te,K,ue,fe)},$.resetTransform=function(){C.resetTransform(),this.__originalResetTransform()},$.rotate=function(z){C.rotate(z),this.__originalRotate(z)},$.clip=function(z){C.clip(z),this.__originalClip(z)},$.moveTo=function(P,z){C.moveTo(P,z),this.__originalMoveTo(P,z)},$.lineTo=function(P,z){C.lineTo(P,z),this.__originalLineTo(P,z)},$.bezierCurveTo=function(P,z,ee,te,K,ue){C.bezierCurveTo(P,z,ee,te,K,ue),this.__originalBezierCurveTo(P,z,ee,te,K,ue)},$.rect=function(P,z,ee,te){C.rect(P,z,ee,te),this.__originalRect(P,z,ee,te)},$.closePath=function(){C.closePath(),this.__originalClosePath()},$.beginPath=function(){C.beginPath(),this.__originalBeginPath()}}class b{constructor(C){this.canvasFactory=C,this.cache=Object.create(null)}getCanvas(C,P,z){let ee;return this.cache[C]!==void 0?(ee=this.cache[C],this.canvasFactory.reset(ee,P,z)):(ee=this.canvasFactory.create(P,z),this.cache[C]=ee),ee}delete(C){delete this.cache[C]}clear(){for(const C in this.cache){const P=this.cache[C];this.canvasFactory.destroy(P),delete this.cache[C]}}}function y($,C,P,z,ee,te,K,ue,fe,ye){const[me,we,ge,A,O,M]=(0,v.getCurrentTransform)($);if(we===0&&ge===0){const se=K*me+O,ne=Math.round(se),re=ue*A+M,ve=Math.round(re),he=(K+fe)*me+O,be=Math.abs(Math.round(he)-ne)||1,Ce=(ue+ye)*A+M,Te=Math.abs(Math.round(Ce)-ve)||1;return $.setTransform(Math.sign(me),0,0,Math.sign(A),ne,ve),$.drawImage(C,P,z,ee,te,0,0,be,Te),$.setTransform(me,we,ge,A,O,M),[be,Te]}if(me===0&&A===0){const se=ue*ge+O,ne=Math.round(se),re=K*we+M,ve=Math.round(re),he=(ue+ye)*ge+O,be=Math.abs(Math.round(he)-ne)||1,Ce=(K+fe)*we+M,Te=Math.abs(Math.round(Ce)-ve)||1;return $.setTransform(0,Math.sign(we),Math.sign(ge),0,ne,ve),$.drawImage(C,P,z,ee,te,0,0,Te,be),$.setTransform(me,we,ge,A,O,M),[Te,be]}$.drawImage(C,P,z,ee,te,K,ue,fe,ye);const U=Math.hypot(me,we),Z=Math.hypot(ge,A);return[U*fe,Z*ye]}function f($){const{width:C,height:P}=$;if(C>i||P>i)return null;const z=1e3,ee=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),te=C+1;let K=new Uint8Array(te*(P+1)),ue,fe,ye;const me=C+7&-8;let we=new Uint8Array(me*P),ge=0;for(const Z of $.data){let se=128;for(;se>0;)we[ge++]=Z&se?0:255,se>>=1}let A=0;for(ge=0,we[ge]!==0&&(K[0]=1,++A),fe=1;fe>2)+(we[ge+1]?4:0)+(we[ge-me+1]?8:0),ee[Z]&&(K[ye+fe]=ee[Z],++A),ge++;if(we[ge-me]!==we[ge]&&(K[ye+fe]=we[ge]?2:4,++A),A>z)return null}for(ge=me*(P-1),ye=ue*te,we[ge]!==0&&(K[ye]=8,++A),fe=1;fez)return null;const O=new Int32Array([0,te,-1,0,-te,0,0,0,1]),M=new Path2D;for(ue=0;A&&ue<=P;ue++){let Z=ue*te;const se=Z+C;for(;Z>4,K[Z]&=re>>2|re<<2),M.lineTo(Z%te,Z/te|0),K[Z]||--A}while(ne!==Z);--ue}return we=null,K=null,function(Z){Z.save(),Z.scale(1/C,-1/P),Z.translate(0,-P),Z.fill(M),Z.beginPath(),Z.restore()}}class s{constructor(C,P){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=p.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=p.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,C,P])}clone(){const C=Object.create(this);return C.clipBox=this.clipBox.slice(),C}setCurrentPoint(C,P){this.x=C,this.y=P}updatePathMinMax(C,P,z){[P,z]=p.Util.applyTransform([P,z],C),this.minX=Math.min(this.minX,P),this.minY=Math.min(this.minY,z),this.maxX=Math.max(this.maxX,P),this.maxY=Math.max(this.maxY,z)}updateRectMinMax(C,P){const z=p.Util.applyTransform(P,C),ee=p.Util.applyTransform(P.slice(2),C);this.minX=Math.min(this.minX,z[0],ee[0]),this.minY=Math.min(this.minY,z[1],ee[1]),this.maxX=Math.max(this.maxX,z[0],ee[0]),this.maxY=Math.max(this.maxY,z[1],ee[1])}updateScalingPathMinMax(C,P){p.Util.scaleMinMax(C,P),this.minX=Math.min(this.minX,P[0]),this.maxX=Math.max(this.maxX,P[1]),this.minY=Math.min(this.minY,P[2]),this.maxY=Math.max(this.maxY,P[3])}updateCurvePathMinMax(C,P,z,ee,te,K,ue,fe,ye,me){const we=p.Util.bezierBoundingBox(P,z,ee,te,K,ue,fe,ye);if(me){me[0]=Math.min(me[0],we[0],we[2]),me[1]=Math.max(me[1],we[0],we[2]),me[2]=Math.min(me[2],we[1],we[3]),me[3]=Math.max(me[3],we[1],we[3]);return}this.updateRectMinMax(C,we)}getPathBoundingBox(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const z=[this.minX,this.minY,this.maxX,this.maxY];if(C===I.PathType.STROKE){P||(0,p.unreachable)("Stroke bounding box must include transform.");const ee=p.Util.singularValueDecompose2dScale(P),te=ee[0]*this.lineWidth/2,K=ee[1]*this.lineWidth/2;z[0]-=te,z[1]-=K,z[2]+=te,z[3]+=K}return z}updateClipFromPath(){const C=p.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(C||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(C){this.clipBox=C,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return p.Util.intersect(this.clipBox,this.getPathBoundingBox(C,P))}}function g($,C){let P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(typeof ImageData<"u"&&C instanceof ImageData){$.putImageData(C,0,0);return}const z=C.height,ee=C.width,te=z%o,K=(z-te)/o,ue=te===0?K:K+1,fe=$.createImageData(ee,o);let ye=0,me;const we=C.data,ge=fe.data;let A,O,M,U,Z,se,ne,re;if(P)switch(P.length){case 1:Z=P[0],se=P[0],ne=P[0],re=P[0];break;case 4:Z=P[0],se=P[1],ne=P[2],re=P[3];break}if(C.kind===p.ImageKind.GRAYSCALE_1BPP){const ve=we.byteLength,he=new Uint32Array(ge.buffer,0,ge.byteLength>>2),be=he.length,Ce=ee+7>>3;let Te=4294967295,Ie=p.FeatureTest.isLittleEndian?4278190080:255;for(re&&re[0]===255&&re[255]===0&&([Te,Ie]=[Ie,Te]),A=0;ACe?ee:He*8-7,T=ae&-8;let V=0,de=0;for(;Ve>=1}for(;me=K&&(M=te,U=ee*M),me=0,O=U;O--;)ge[me++]=we[ye++],ge[me++]=we[ye++],ge[me++]=we[ye++],ge[me++]=255;if(ve)for(let he=0;he>8,$[te-2]=$[te-2]*K+P*ue>>8,$[te-1]=$[te-1]*K+z*ue>>8}}}function F($,C,P){const z=$.length,ee=1/255;for(let te=3;te>8]>>8:C[ee]*te>>16}}function G($,C,P,z,ee,te,K,ue,fe,ye,me){const we=!!te,ge=we?te[0]:0,A=we?te[1]:0,O=we?te[2]:0;let M;ee==="Luminosity"?M=X:M=F;const Z=Math.min(z,Math.ceil(1048576/P));for(let se=0;se1&&arguments[1]!==void 0?arguments[1]:null;return typeof C=="string"?C.startsWith("g_")?this.commonObjs.get(C):this.objs.get(C):P}beginDrawing(C){let{transform:P,viewport:z,transparency:ee=!1,background:te=null}=C;const K=this.ctx.canvas.width,ue=this.ctx.canvas.height,fe=te||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const ye=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const me=this.backgroundColor=this.ctx.fillStyle;let we=!0,ge=fe;if(this.ctx.fillStyle=fe,ge=this.ctx.fillStyle,we=typeof ge=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ge),ye==="#000000"&&me==="#ffffff"||ye===me||!we)this.foregroundColor=this.backgroundColor=null;else{const[A,O,M]=(0,v.getRGB)(ge),U=se=>(se/=255,se<=.03928?se/12.92:((se+.055)/1.055)**2.4),Z=Math.round(.2126*U(A)+.7152*U(O)+.0722*U(M));this.selectColor=(se,ne,re)=>{const ve=.2126*U(se)+.7152*U(ne)+.0722*U(re);return Math.round(ve)===Z?me:ye}}}if(this.ctx.fillStyle=this.backgroundColor||fe,this.ctx.fillRect(0,0,K,ue),this.ctx.restore(),ee){const ye=this.cachedCanvases.getCanvas("transparent",K,ue);this.compositeCtx=this.ctx,this.transparentCanvas=ye.canvas,this.ctx=ye.context,this.ctx.save(),this.ctx.transform(...(0,v.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),w(this.ctx,this.foregroundColor),P&&(this.ctx.transform(...P),this.outputScaleX=P[0],this.outputScaleY=P[0]),this.ctx.transform(...z.transform),this.viewportScale=z.scale,this.baseTransform=(0,v.getCurrentTransform)(this.ctx)}executeOperatorList(C,P,z,ee){const te=C.argsArray,K=C.fnArray;let ue=P||0;const fe=te.length;if(fe===ue)return ue;const ye=fe-ue>r&&typeof z=="function",me=ye?Date.now()+d:0;let we=0;const ge=this.commonObjs,A=this.objs;let O;for(;;){if(ee!==void 0&&ue===ee.nextBreakPoint)return ee.breakIt(ue,z),ue;if(O=K[ue],O!==p.OPS.dependency)this[O].apply(this,te[ue]);else for(const M of te[ue]){const U=M.startsWith("g_")?ge:A;if(!U.has(M))return U.get(M,z),ue}if(ue++,ue===fe)return ue;if(ye&&++we>r){if(Date.now()>me)return z(),ue;we=0}}}endDrawing(){t(this,q,H).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const C of this._cachedBitmapsMap.values()){for(const P of C.values())typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement&&(P.width=P.height=0);C.clear()}this._cachedBitmapsMap.clear()}_scaleImage(C,P){const z=C.width,ee=C.height;let te=Math.max(Math.hypot(P[0],P[1]),1),K=Math.max(Math.hypot(P[2],P[3]),1),ue=z,fe=ee,ye="prescale1",me,we;for(;te>2&&ue>1||K>2&&fe>1;){let ge=ue,A=fe;te>2&&ue>1&&(ge=Math.ceil(ue/2),te/=ue/ge),K>2&&fe>1&&(A=Math.ceil(fe/2),K/=fe/A),me=this.cachedCanvases.getCanvas(ye,ge,A),we=me.context,we.clearRect(0,0,ge,A),we.drawImage(C,0,0,ue,fe,0,0,ge,A),C=me.canvas,ue=ge,fe=A,ye=ye==="prescale1"?"prescale2":"prescale1"}return{img:C,paintWidth:ue,paintHeight:fe}}_createMaskCanvas(C){const P=this.ctx,{width:z,height:ee}=C,te=this.current.fillColor,K=this.current.patternFill,ue=(0,v.getCurrentTransform)(P);let fe,ye,me,we;if((C.bitmap||C.data)&&C.count>1){const be=C.bitmap||C.data.buffer;ye=JSON.stringify(K?ue:[ue.slice(0,4),te]),fe=this._cachedBitmapsMap.get(be),fe||(fe=new Map,this._cachedBitmapsMap.set(be,fe));const Ce=fe.get(ye);if(Ce&&!K){const Te=Math.round(Math.min(ue[0],ue[2])+ue[4]),Ie=Math.round(Math.min(ue[1],ue[3])+ue[5]);return{canvas:Ce,offsetX:Te,offsetY:Ie}}me=Ce}me||(we=this.cachedCanvases.getCanvas("maskCanvas",z,ee),S(we.context,C));let ge=p.Util.transform(ue,[1/z,0,0,-1/ee,0,0]);ge=p.Util.transform(ge,[1,0,0,1,0,-ee]);const A=p.Util.applyTransform([0,0],ge),O=p.Util.applyTransform([z,ee],ge),M=p.Util.normalizeRect([A[0],A[1],O[0],O[1]]),U=Math.round(M[2]-M[0])||1,Z=Math.round(M[3]-M[1])||1,se=this.cachedCanvases.getCanvas("fillCanvas",U,Z),ne=se.context,re=Math.min(A[0],O[0]),ve=Math.min(A[1],O[1]);ne.translate(-re,-ve),ne.transform(...ge),me||(me=this._scaleImage(we.canvas,(0,v.getCurrentTransformInverse)(ne)),me=me.img,fe&&K&&fe.set(ye,me)),ne.imageSmoothingEnabled=N((0,v.getCurrentTransform)(ne),C.interpolate),y(ne,me,0,0,me.width,me.height,0,0,z,ee),ne.globalCompositeOperation="source-in";const he=p.Util.transform((0,v.getCurrentTransformInverse)(ne),[1,0,0,1,-re,-ve]);return ne.fillStyle=K?te.getPattern(P,this,he,I.PathType.FILL):te,ne.fillRect(0,0,z,ee),fe&&!K&&(this.cachedCanvases.delete("fillCanvas"),fe.set(ye,se.canvas)),{canvas:se.canvas,offsetX:Math.round(re),offsetY:Math.round(ve)}}setLineWidth(C){C!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=C,this.ctx.lineWidth=C}setLineCap(C){this.ctx.lineCap=Q[C]}setLineJoin(C){this.ctx.lineJoin=Y[C]}setMiterLimit(C){this.ctx.miterLimit=C}setDash(C,P){const z=this.ctx;z.setLineDash!==void 0&&(z.setLineDash(C),z.lineDashOffset=P)}setRenderingIntent(C){}setFlatness(C){}setGState(C){for(const[P,z]of C)switch(P){case"LW":this.setLineWidth(z);break;case"LC":this.setLineCap(z);break;case"LJ":this.setLineJoin(z);break;case"ML":this.setMiterLimit(z);break;case"D":this.setDash(z[0],z[1]);break;case"RI":this.setRenderingIntent(z);break;case"FL":this.setFlatness(z);break;case"Font":this.setFont(z[0],z[1]);break;case"CA":this.current.strokeAlpha=z;break;case"ca":this.current.fillAlpha=z,this.ctx.globalAlpha=z;break;case"BM":this.ctx.globalCompositeOperation=z;break;case"SMask":this.current.activeSMask=z?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=z}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const C=this.inSMaskMode;this.current.activeSMask&&!C?this.beginSMaskMode():!this.current.activeSMask&&C&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const C=this.ctx.canvas.width,P=this.ctx.canvas.height,z="smaskGroupAt"+this.groupLevel,ee=this.cachedCanvases.getCanvas(z,C,P);this.suspendedCtx=this.ctx,this.ctx=ee.context;const te=this.ctx;te.setTransform(...(0,v.getCurrentTransform)(this.suspendedCtx)),D(this.suspendedCtx,te),c(te,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),D(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(C){if(!this.current.activeSMask)return;C?(C[0]=Math.floor(C[0]),C[1]=Math.floor(C[1]),C[2]=Math.ceil(C[2]),C[3]=Math.ceil(C[3])):C=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const P=this.current.activeSMask,z=this.suspendedCtx;j(z,P,this.ctx,C),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(D(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const C=this.current;this.stateStack.push(C),this.current=C.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),D(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(C,P,z,ee,te,K){this.ctx.transform(C,P,z,ee,te,K),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(C,P,z){const ee=this.ctx,te=this.current;let K=te.x,ue=te.y,fe,ye;const me=(0,v.getCurrentTransform)(ee),we=me[0]===0&&me[3]===0||me[1]===0&&me[2]===0,ge=we?z.slice(0):null;for(let A=0,O=0,M=C.length;A0&&arguments[0]!==void 0?arguments[0]:!0;const P=this.ctx,z=this.current.strokeColor;P.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof z=="object"&&z!==null&&z!==void 0&&z.getPattern?(P.save(),P.strokeStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.STROKE),this.rescaleAndStroke(!1),P.restore()):this.rescaleAndStroke(!0)),C&&this.consumePath(this.current.getClippedPathBoundingBox()),P.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const P=this.ctx,z=this.current.fillColor,ee=this.current.patternFill;let te=!1;ee&&(P.save(),P.fillStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.FILL),te=!0);const K=this.current.getClippedPathBoundingBox();this.contentVisible&&K!==null&&(this.pendingEOFill?(P.fill("evenodd"),this.pendingEOFill=!1):P.fill()),te&&P.restore(),C&&this.consumePath(K)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=B}eoClip(){this.pendingClip=ie}beginText(){this.current.textMatrix=p.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const C=this.pendingTextPaths,P=this.ctx;if(C===void 0){P.beginPath();return}P.save(),P.beginPath();for(const z of C)P.setTransform(...z.transform),P.translate(z.x,z.y),z.addToPath(P,z.fontSize);P.restore(),P.clip(),P.beginPath(),delete this.pendingTextPaths}setCharSpacing(C){this.current.charSpacing=C}setWordSpacing(C){this.current.wordSpacing=C}setHScale(C){this.current.textHScale=C/100}setLeading(C){this.current.leading=-C}setFont(C,P){const z=this.commonObjs.get(C),ee=this.current;if(!z)throw new Error(`Can't find font for ${C}`);if(ee.fontMatrix=z.fontMatrix||p.FONT_IDENTITY_MATRIX,(ee.fontMatrix[0]===0||ee.fontMatrix[3]===0)&&(0,p.warn)("Invalid font matrix for font "+C),P<0?(P=-P,ee.fontDirection=-1):ee.fontDirection=1,this.current.font=z,this.current.fontSize=P,z.isType3Font)return;const te=z.loadedName||"sans-serif";let K="normal";z.black?K="900":z.bold&&(K="bold");const ue=z.italic?"italic":"normal",fe=`"${te}", ${z.fallbackName}`;let ye=P;Ph&&(ye=h),this.current.fontSizeScale=P/ye,this.ctx.font=`${ue} ${K} ${ye}px ${fe}`}setTextRenderingMode(C){this.current.textRenderingMode=C}setTextRise(C){this.current.textRise=C}moveText(C,P){this.current.x=this.current.lineX+=C,this.current.y=this.current.lineY+=P}setLeadingMoveText(C,P){this.setLeading(-P),this.moveText(C,P)}setTextMatrix(C,P,z,ee,te,K){this.current.textMatrix=[C,P,z,ee,te,K],this.current.textMatrixScale=Math.hypot(C,P),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(C,P,z,ee){const te=this.ctx,K=this.current,ue=K.font,fe=K.textRenderingMode,ye=K.fontSize/K.fontSizeScale,me=fe&p.TextRenderingMode.FILL_STROKE_MASK,we=!!(fe&p.TextRenderingMode.ADD_TO_PATH_FLAG),ge=K.patternFill&&!ue.missingFile;let A;(ue.disableFontFace||we||ge)&&(A=ue.getPathGenerator(this.commonObjs,C)),ue.disableFontFace||ge?(te.save(),te.translate(P,z),te.beginPath(),A(te,ye),ee&&te.setTransform(...ee),(me===p.TextRenderingMode.FILL||me===p.TextRenderingMode.FILL_STROKE)&&te.fill(),(me===p.TextRenderingMode.STROKE||me===p.TextRenderingMode.FILL_STROKE)&&te.stroke(),te.restore()):((me===p.TextRenderingMode.FILL||me===p.TextRenderingMode.FILL_STROKE)&&te.fillText(C,P,z),(me===p.TextRenderingMode.STROKE||me===p.TextRenderingMode.FILL_STROKE)&&te.strokeText(C,P,z)),we&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,v.getCurrentTransform)(te),x:P,y:z,fontSize:ye,addToPath:A})}get isFontSubpixelAAEnabled(){const{context:C}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);C.scale(1.5,1),C.fillText("I",0,10);const P=C.getImageData(0,0,10,10).data;let z=!1;for(let ee=3;ee0&&P[ee]<255){z=!0;break}return(0,p.shadow)(this,"isFontSubpixelAAEnabled",z)}showText(C){const P=this.current,z=P.font;if(z.isType3Font)return this.showType3Text(C);const ee=P.fontSize;if(ee===0)return;const te=this.ctx,K=P.fontSizeScale,ue=P.charSpacing,fe=P.wordSpacing,ye=P.fontDirection,me=P.textHScale*ye,we=C.length,ge=z.vertical,A=ge?1:-1,O=z.defaultVMetrics,M=ee*P.fontMatrix[0],U=P.textRenderingMode===p.TextRenderingMode.FILL&&!z.disableFontFace&&!P.patternFill;te.save(),te.transform(...P.textMatrix),te.translate(P.x,P.y+P.textRise),ye>0?te.scale(me,-1):te.scale(me,1);let Z;if(P.patternFill){te.save();const he=P.fillColor.getPattern(te,this,(0,v.getCurrentTransformInverse)(te),I.PathType.FILL);Z=(0,v.getCurrentTransform)(te),te.restore(),te.fillStyle=he}let se=P.lineWidth;const ne=P.textMatrixScale;if(ne===0||se===0){const he=P.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;(he===p.TextRenderingMode.STROKE||he===p.TextRenderingMode.FILL_STROKE)&&(se=this.getSinglePixelWidth())}else se/=ne;if(K!==1&&(te.scale(K,K),se/=K),te.lineWidth=se,z.isInvalidPDFjsFont){const he=[];let be=0;for(const Ce of C)he.push(Ce.unicode),be+=Ce.width;te.fillText(he.join(""),0,0),P.x+=be*M*me,te.restore(),this.compose();return}let re=0,ve;for(ve=0;ve0){const V=te.measureText(Te).width*1e3/ee*K;if(aenew _(K,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};P=new I.TilingPattern(C,z,this.ctx,te,ee)}else P=this._getPattern(C[1],C[2]);return P}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(C,P,z){var ee;const te=((ee=this.selectColor)===null||ee===void 0?void 0:ee.call(this,C,P,z))||p.Util.makeHexColor(C,P,z);this.ctx.strokeStyle=te,this.current.strokeColor=te}setFillRGBColor(C,P,z){var ee;const te=((ee=this.selectColor)===null||ee===void 0?void 0:ee.call(this,C,P,z))||p.Util.makeHexColor(C,P,z);this.ctx.fillStyle=te,this.current.fillColor=te,this.current.patternFill=!1}_getPattern(C){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,z;return this.cachedPatterns.has(C)?z=this.cachedPatterns.get(C):(z=(0,I.getShadingPattern)(this.objs.get(C)),this.cachedPatterns.set(C,z)),P&&(z.matrix=P),z}shadingFill(C){if(!this.contentVisible)return;const P=this.ctx;this.save();const z=this._getPattern(C);P.fillStyle=z.getPattern(P,this,(0,v.getCurrentTransformInverse)(P),I.PathType.SHADING);const ee=(0,v.getCurrentTransformInverse)(P);if(ee){const te=P.canvas,K=te.width,ue=te.height,fe=p.Util.applyTransform([0,0],ee),ye=p.Util.applyTransform([0,ue],ee),me=p.Util.applyTransform([K,0],ee),we=p.Util.applyTransform([K,ue],ee),ge=Math.min(fe[0],ye[0],me[0],we[0]),A=Math.min(fe[1],ye[1],me[1],we[1]),O=Math.max(fe[0],ye[0],me[0],we[0]),M=Math.max(fe[1],ye[1],me[1],we[1]);this.ctx.fillRect(ge,A,O-ge,M-A)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,p.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,p.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(C,P){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(C)&&C.length===6&&this.transform(...C),this.baseTransform=(0,v.getCurrentTransform)(this.ctx),P)){const z=P[2]-P[0],ee=P[3]-P[1];this.ctx.rect(P[0],P[1],z,ee),this.current.updateRectMinMax((0,v.getCurrentTransform)(this.ctx),P),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(C){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const P=this.ctx;C.isolated||(0,p.info)("TODO: Support non-isolated groups."),C.knockout&&(0,p.warn)("Knockout groups not supported.");const z=(0,v.getCurrentTransform)(P);if(C.matrix&&P.transform(...C.matrix),!C.bbox)throw new Error("Bounding box is required.");let ee=p.Util.getAxialAlignedBoundingBox(C.bbox,(0,v.getCurrentTransform)(P));const te=[0,0,P.canvas.width,P.canvas.height];ee=p.Util.intersect(ee,te)||[0,0,0,0];const K=Math.floor(ee[0]),ue=Math.floor(ee[1]);let fe=Math.max(Math.ceil(ee[2])-K,1),ye=Math.max(Math.ceil(ee[3])-ue,1),me=1,we=1;fe>a&&(me=fe/a,fe=a),ye>a&&(we=ye/a,ye=a),this.current.startNewPathAndClipBox([0,0,fe,ye]);let ge="groupAt"+this.groupLevel;C.smask&&(ge+="_smask_"+this.smaskCounter++%2);const A=this.cachedCanvases.getCanvas(ge,fe,ye),O=A.context;O.scale(1/me,1/we),O.translate(-K,-ue),O.transform(...z),C.smask?this.smaskStack.push({canvas:A.canvas,context:O,offsetX:K,offsetY:ue,scaleX:me,scaleY:we,subtype:C.smask.subtype,backdrop:C.smask.backdrop,transferMap:C.smask.transferMap||null,startTransformInverse:null}):(P.setTransform(1,0,0,1,0,0),P.translate(K,ue),P.scale(me,we),P.save()),D(P,O),this.ctx=O,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(P),this.groupLevel++}endGroup(C){if(!this.contentVisible)return;this.groupLevel--;const P=this.ctx,z=this.groupStack.pop();if(this.ctx=z,this.ctx.imageSmoothingEnabled=!1,C.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const ee=(0,v.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...ee);const te=p.Util.getAxialAlignedBoundingBox([0,0,P.canvas.width,P.canvas.height],ee);this.ctx.drawImage(P.canvas,0,0),this.ctx.restore(),this.compose(te)}}beginAnnotation(C,P,z,ee,te){if(t(this,q,H).call(this),w(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(P)&&P.length===4){const K=P[2]-P[0],ue=P[3]-P[1];if(te&&this.annotationCanvasMap){z=z.slice(),z[4]-=P[0],z[5]-=P[1],P=P.slice(),P[0]=P[1]=0,P[2]=K,P[3]=ue;const[fe,ye]=p.Util.singularValueDecompose2dScale((0,v.getCurrentTransform)(this.ctx)),{viewportScale:me}=this,we=Math.ceil(K*this.outputScaleX*me),ge=Math.ceil(ue*this.outputScaleY*me);this.annotationCanvas=this.canvasFactory.create(we,ge);const{canvas:A,context:O}=this.annotationCanvas;this.annotationCanvasMap.set(C,A),this.annotationCanvas.savedCtx=this.ctx,this.ctx=O,this.ctx.setTransform(fe,0,0,-ye,0,ue*ye),w(this.ctx,this.foregroundColor)}else w(this.ctx,this.foregroundColor),this.ctx.rect(P[0],P[1],K,ue),this.ctx.clip(),this.endPath()}this.current=new s(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...z),this.transform(...ee)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(C){if(!this.contentVisible)return;const P=C.count;C=this.getObject(C.data,C),C.count=P;const z=this.ctx,ee=this.processingType3;if(ee&&(ee.compiled===void 0&&(ee.compiled=f(C)),ee.compiled)){ee.compiled(z);return}const te=this._createMaskCanvas(C),K=te.canvas;z.save(),z.setTransform(1,0,0,1,0,0),z.drawImage(K,te.offsetX,te.offsetY),z.restore(),this.compose()}paintImageMaskXObjectRepeat(C,P){let z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,te=arguments.length>4?arguments[4]:void 0,K=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;C=this.getObject(C.data,C);const ue=this.ctx;ue.save();const fe=(0,v.getCurrentTransform)(ue);ue.transform(P,z,ee,te,0,0);const ye=this._createMaskCanvas(C);ue.setTransform(1,0,0,1,ye.offsetX-fe[4],ye.offsetY-fe[5]);for(let me=0,we=K.length;mefe?ue/fe:1,ee=K>fe?K/fe:1}}this._cachedScaleForStroking=[z,ee]}return this._cachedScaleForStroking}rescaleAndStroke(C){const{ctx:P}=this,{lineWidth:z}=this.current,[ee,te]=this.getScaleForStroking();if(P.lineWidth=z||1,ee===1&&te===1){P.stroke();return}let K,ue,fe;C&&(K=(0,v.getCurrentTransform)(P),ue=P.getLineDash().slice(),fe=P.lineDashOffset),P.scale(ee,te);const ye=Math.max(ee,te);P.setLineDash(P.getLineDash().map(me=>me/ye)),P.lineDashOffset/=ye,P.stroke(),C&&(P.setTransform(...K),P.setLineDash(ue),P.lineDashOffset=fe)}isContentVisible(){for(let C=this.markedContentStack.length-1;C>=0;C--)if(!this.markedContentStack[C].visible)return!1;return!0}}E.CanvasGraphics=_;function H(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}for(const $ in p.OPS)_.prototype[$]!==void 0&&(_.prototype[p.OPS[$]]=_.prototype[$])},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.TilingPattern=E.PathType=void 0,E.getShadingPattern=d;var p=l(1),v=l(139);const I={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};E.PathType=I;function k(o,c){if(!c)return;const b=c[2]-c[0],y=c[3]-c[1],f=new Path2D;f.rect(c[0],c[1],b,y),o.clip(f)}class m{constructor(){this.constructor===m&&(0,p.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,p.unreachable)("Abstract method `getPattern` called.")}}class R extends m{constructor(c){super(),this._type=c[1],this._bbox=c[2],this._colorStops=c[3],this._p0=c[4],this._p1=c[5],this._r0=c[6],this._r1=c[7],this.matrix=null}_createGradient(c){let b;this._type==="axial"?b=c.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(b=c.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const y of this._colorStops)b.addColorStop(y[0],y[1]);return b}getPattern(c,b,y,f){let s;if(f===I.STROKE||f===I.FILL){const g=b.current.getClippedPathBoundingBox(f,(0,v.getCurrentTransform)(c))||[0,0,0,0],S=Math.ceil(g[2]-g[0])||1,D=Math.ceil(g[3]-g[1])||1,w=b.cachedCanvases.getCanvas("pattern",S,D,!0),x=w.context;x.clearRect(0,0,x.canvas.width,x.canvas.height),x.beginPath(),x.rect(0,0,x.canvas.width,x.canvas.height),x.translate(-g[0],-g[1]),y=p.Util.transform(y,[1,0,0,1,g[0],g[1]]),x.transform(...b.baseTransform),this.matrix&&x.transform(...this.matrix),k(x,this._bbox),x.fillStyle=this._createGradient(x),x.fill(),s=c.createPattern(w.canvas,"no-repeat");const F=new DOMMatrix(y);s.setTransform(F)}else k(c,this._bbox),s=this._createGradient(c);return s}}function t(o,c,b,y,f,s,g,S){const D=c.coords,w=c.colors,x=o.data,F=o.width*4;let X;D[b+1]>D[y+1]&&(X=b,b=y,y=X,X=s,s=g,g=X),D[y+1]>D[f+1]&&(X=y,y=f,f=X,X=g,g=S,S=X),D[b+1]>D[y+1]&&(X=b,b=y,y=X,X=s,s=g,g=X);const G=(D[b]+c.offsetX)*c.scaleX,j=(D[b+1]+c.offsetY)*c.scaleY,N=(D[y]+c.offsetX)*c.scaleX,Q=(D[y+1]+c.offsetY)*c.scaleY,Y=(D[f]+c.offsetX)*c.scaleX,B=(D[f+1]+c.offsetY)*c.scaleY;if(j>=B)return;const ie=w[s],q=w[s+1],_=w[s+2],H=w[g],$=w[g+1],C=w[g+2],P=w[S],z=w[S+1],ee=w[S+2],te=Math.round(j),K=Math.round(B);let ue,fe,ye,me,we,ge,A,O;for(let M=te;M<=K;M++){if(MB?re=1:Q===B?re=0:re=(Q-M)/(Q-B),ue=N-(N-Y)*re,fe=H-(H-P)*re,ye=$-($-z)*re,me=C-(C-ee)*re}let U;MB?U=1:U=(j-M)/(j-B),we=G-(G-Y)*U,ge=ie-(ie-P)*U,A=q-(q-z)*U,O=_-(_-ee)*U;const Z=Math.round(Math.min(ue,we)),se=Math.round(Math.max(ue,we));let ne=F*M+Z*4;for(let re=Z;re<=se;re++)U=(ue-re)/(ue-we),U<0?U=0:U>1&&(U=1),x[ne++]=fe-(fe-ge)*U|0,x[ne++]=ye-(ye-A)*U|0,x[ne++]=me-(me-O)*U|0,x[ne++]=255}}function n(o,c,b){const y=c.coords,f=c.colors;let s,g;switch(c.type){case"lattice":const S=c.verticesPerRow,D=Math.floor(y.length/S)-1,w=S-1;for(s=0;s=f?s=f:y=s/c,{scale:y,size:s}}clipBbox(c,b,y,f,s){const g=f-b,S=s-y;c.ctx.rect(b,y,g,S),c.current.updateRectMinMax((0,v.getCurrentTransform)(c.ctx),[b,y,f,s]),c.clip(),c.endPath()}setFillAndStrokeStyleToContext(c,b,y){const f=c.ctx,s=c.current;switch(b){case r.COLORED:const g=this.ctx;f.fillStyle=g.fillStyle,f.strokeStyle=g.strokeStyle,s.fillColor=g.fillStyle,s.strokeColor=g.strokeStyle;break;case r.UNCOLORED:const S=p.Util.makeHexColor(y[0],y[1],y[2]);f.fillStyle=S,f.strokeStyle=S,s.fillColor=S,s.strokeColor=S;break;default:throw new p.FormatError(`Unsupported paint type: ${b}`)}}getPattern(c,b,y,f){let s=y;f!==I.SHADING&&(s=p.Util.transform(s,b.baseTransform),this.matrix&&(s=p.Util.transform(s,this.matrix)));const g=this.createPatternCanvas(b);let S=new DOMMatrix(s);S=S.translate(g.offsetX,g.offsetY),S=S.scale(1/g.scaleX,1/g.scaleY);const D=c.createPattern(g.canvas,"repeat");return D.setTransform(S),D}}E.TilingPattern=i},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.applyMaskImageData=v;var p=l(1);function v(I){let{src:k,srcPos:m=0,dest:R,destPos:t=0,width:n,height:h,inverseDecode:a=!1}=I;const d=p.FeatureTest.isLittleEndian?4278190080:255,[r,i]=a?[0,d]:[d,0],o=n>>3,c=n&7,b=k.length;R=new Uint32Array(R.buffer);for(let y=0;y{Object.defineProperty(E,"__esModule",{value:!0}),E.GlobalWorkerOptions=void 0;const l=Object.create(null);E.GlobalWorkerOptions=l,l.workerPort=null,l.workerSrc=""},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.MessageHandler=void 0;var p=l(1);const v={UNKNOWN:0,DATA:1,ERROR:2},I={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function k(R){switch(R instanceof Error||typeof R=="object"&&R!==null||(0,p.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),R.name){case"AbortException":return new p.AbortException(R.message);case"MissingPDFException":return new p.MissingPDFException(R.message);case"PasswordException":return new p.PasswordException(R.message,R.code);case"UnexpectedResponseException":return new p.UnexpectedResponseException(R.message,R.status);case"UnknownErrorException":return new p.UnknownErrorException(R.message,R.details);default:return new p.UnknownErrorException(R.message,R.toString())}}class m{constructor(t,n,h){this.sourceName=t,this.targetName=n,this.comObj=h,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const d=a.data;if(d.targetName!==this.sourceName)return;if(d.stream){this._processStreamMessage(d);return}if(d.callback){const i=d.callbackId,o=this.callbackCapabilities[i];if(!o)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],d.callback===v.DATA)o.resolve(d.data);else if(d.callback===v.ERROR)o.reject(k(d.reason));else throw new Error("Unexpected callback case");return}const r=this.actionHandler[d.action];if(!r)throw new Error(`Unknown action from worker: ${d.action}`);if(d.callbackId){const i=this.sourceName,o=d.sourceName;new Promise(function(c){c(r(d.data))}).then(function(c){h.postMessage({sourceName:i,targetName:o,callback:v.DATA,callbackId:d.callbackId,data:c})},function(c){h.postMessage({sourceName:i,targetName:o,callback:v.ERROR,callbackId:d.callbackId,reason:k(c)})});return}if(d.streamId){this._createStreamSink(d);return}r(d.data)},h.addEventListener("message",this._onComObjOnMessage)}on(t,n){const h=this.actionHandler;if(h[t])throw new Error(`There is already an actionName called "${t}"`);h[t]=n}send(t,n,h){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:n},h)}sendWithPromise(t,n,h){const a=this.callbackId++,d=(0,p.createPromiseCapability)();this.callbackCapabilities[a]=d;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:n},h)}catch(r){d.reject(r)}return d.promise}sendWithStream(t,n,h,a){const d=this.streamId++,r=this.sourceName,i=this.targetName,o=this.comObj;return new ReadableStream({start:c=>{const b=(0,p.createPromiseCapability)();return this.streamControllers[d]={controller:c,startCall:b,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:i,action:t,streamId:d,data:n,desiredSize:c.desiredSize},a),b.promise},pull:c=>{const b=(0,p.createPromiseCapability)();return this.streamControllers[d].pullCall=b,o.postMessage({sourceName:r,targetName:i,stream:I.PULL,streamId:d,desiredSize:c.desiredSize}),b.promise},cancel:c=>{(0,p.assert)(c instanceof Error,"cancel must have a valid reason");const b=(0,p.createPromiseCapability)();return this.streamControllers[d].cancelCall=b,this.streamControllers[d].isClosed=!0,o.postMessage({sourceName:r,targetName:i,stream:I.CANCEL,streamId:d,reason:k(c)}),b.promise}},h)}_createStreamSink(t){const n=t.streamId,h=this.sourceName,a=t.sourceName,d=this.comObj,r=this,i=this.actionHandler[t.action],o={enqueue(c){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,y=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=b,f>0&&this.desiredSize<=0&&(this.sinkCapability=(0,p.createPromiseCapability)(),this.ready=this.sinkCapability.promise),d.postMessage({sourceName:h,targetName:a,stream:I.ENQUEUE,streamId:n,chunk:c},y)},close(){this.isCancelled||(this.isCancelled=!0,d.postMessage({sourceName:h,targetName:a,stream:I.CLOSE,streamId:n}),delete r.streamSinks[n])},error(c){(0,p.assert)(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,d.postMessage({sourceName:h,targetName:a,stream:I.ERROR,streamId:n,reason:k(c)}))},sinkCapability:(0,p.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[n]=o,new Promise(function(c){c(i(t.data,o))}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.START_COMPLETE,streamId:n,success:!0})},function(c){d.postMessage({sourceName:h,targetName:a,stream:I.START_COMPLETE,streamId:n,reason:k(c)})})}_processStreamMessage(t){const n=t.streamId,h=this.sourceName,a=t.sourceName,d=this.comObj,r=this.streamControllers[n],i=this.streamSinks[n];switch(t.stream){case I.START_COMPLETE:t.success?r.startCall.resolve():r.startCall.reject(k(t.reason));break;case I.PULL_COMPLETE:t.success?r.pullCall.resolve():r.pullCall.reject(k(t.reason));break;case I.PULL:if(!i){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,success:!0});break}i.desiredSize<=0&&t.desiredSize>0&&i.sinkCapability.resolve(),i.desiredSize=t.desiredSize,new Promise(function(o){o(i.onPull&&i.onPull())}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,success:!0})},function(o){d.postMessage({sourceName:h,targetName:a,stream:I.PULL_COMPLETE,streamId:n,reason:k(o)})});break;case I.ENQUEUE:if((0,p.assert)(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case I.CLOSE:if((0,p.assert)(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this._deleteStreamController(r,n);break;case I.ERROR:(0,p.assert)(r,"error should have stream controller"),r.controller.error(k(t.reason)),this._deleteStreamController(r,n);break;case I.CANCEL_COMPLETE:t.success?r.cancelCall.resolve():r.cancelCall.reject(k(t.reason)),this._deleteStreamController(r,n);break;case I.CANCEL:if(!i)break;new Promise(function(o){o(i.onCancel&&i.onCancel(k(t.reason)))}).then(function(){d.postMessage({sourceName:h,targetName:a,stream:I.CANCEL_COMPLETE,streamId:n,success:!0})},function(o){d.postMessage({sourceName:h,targetName:a,stream:I.CANCEL_COMPLETE,streamId:n,reason:k(o)})}),i.sinkCapability.reject(k(t.reason)),i.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,n){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]),delete this.streamControllers[n]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}E.MessageHandler=m},(W,E,l)=>{var I,k;Object.defineProperty(E,"__esModule",{value:!0}),E.Metadata=void 0;var p=l(1);class v{constructor(R){nt(this,I,void 0);nt(this,k,void 0);let{parsedData:t,rawData:n}=R;rt(this,I,t),rt(this,k,n)}getRaw(){return Ue(this,k)}get(R){return Ue(this,I).get(R)??null}getAll(){return(0,p.objectFromMap)(Ue(this,I))}has(R){return Ue(this,I).has(R)}}I=new WeakMap,k=new WeakMap,E.Metadata=v},(W,E,l)=>{var S;Object.defineProperty(E,"__esModule",{value:!0}),E.OptionalContentConfig=void 0;var p=l(1),v=l(141);function I(D,w){m(D,w),w.add(D)}function k(D,w,x){m(D,w),w.set(D,x)}function m(D,w){if(w.has(D))throw new TypeError("Cannot initialize the same private elements twice on an object")}function R(D,w,x){if(!w.has(D))throw new TypeError("attempted to get private field on non-instance");return x}function t(D,w){var x=a(D,w,"get");return n(D,x)}function n(D,w){return w.get?w.get.call(D):w.value}function h(D,w,x){var F=a(D,w,"set");return d(D,F,x),x}function a(D,w,x){if(!w.has(D))throw new TypeError("attempted to "+x+" private field on non-instance");return w.get(D)}function d(D,w,x){if(w.set)w.set.call(D,x);else{if(!w.writable)throw new TypeError("attempted to set read only private field");w.value=x}}const r=Symbol("INTERNAL");class i{constructor(w,x){nt(this,S,!0);this.name=w,this.intent=x}get visible(){return Ue(this,S)}_setVisible(w,x){w!==r&&(0,p.unreachable)("Internal method `_setVisible` called."),rt(this,S,x)}}S=new WeakMap;var o=new WeakMap,c=new WeakMap,b=new WeakMap,y=new WeakMap,f=new WeakSet;class s{constructor(w){if(I(this,f),k(this,o,{writable:!0,value:null}),k(this,c,{writable:!0,value:new Map}),k(this,b,{writable:!0,value:null}),k(this,y,{writable:!0,value:null}),this.name=null,this.creator=null,w!==null){this.name=w.name,this.creator=w.creator,h(this,y,w.order);for(const x of w.groups)t(this,c).set(x.id,new i(x.name,x.intent));if(w.baseState==="OFF")for(const x of t(this,c).values())x._setVisible(r,!1);for(const x of w.on)t(this,c).get(x)._setVisible(r,!0);for(const x of w.off)t(this,c).get(x)._setVisible(r,!1);h(this,b,this.getHash())}}isVisible(w){if(t(this,c).size===0)return!0;if(!w)return(0,p.warn)("Optional content group not defined."),!0;if(w.type==="OCG")return t(this,c).has(w.id)?t(this,c).get(w.id).visible:((0,p.warn)(`Optional content group not found: ${w.id}`),!0);if(w.type==="OCMD"){if(w.expression)return R(this,f,g).call(this,w.expression);if(!w.policy||w.policy==="AnyOn"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(t(this,c).get(x).visible)return!0}return!1}else if(w.policy==="AllOn"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(!t(this,c).get(x).visible)return!1}return!0}else if(w.policy==="AnyOff"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(!t(this,c).get(x).visible)return!0}return!1}else if(w.policy==="AllOff"){for(const x of w.ids){if(!t(this,c).has(x))return(0,p.warn)(`Optional content group not found: ${x}`),!0;if(t(this,c).get(x).visible)return!1}return!0}return(0,p.warn)(`Unknown optional content policy ${w.policy}.`),!0}return(0,p.warn)(`Unknown group type ${w.type}.`),!0}setVisibility(w){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!t(this,c).has(w)){(0,p.warn)(`Optional content group not found: ${w}`);return}t(this,c).get(w)._setVisible(r,!!x),h(this,o,null)}get hasInitialVisibility(){return this.getHash()===t(this,b)}getOrder(){return t(this,c).size?t(this,y)?t(this,y).slice():[...t(this,c).keys()]:null}getGroups(){return t(this,c).size>0?(0,p.objectFromMap)(t(this,c)):null}getGroup(w){return t(this,c).get(w)||null}getHash(){if(t(this,o)!==null)return t(this,o);const w=new v.MurmurHash3_64;for(const[x,F]of t(this,c))w.update(`${x}:${F.visible}`);return h(this,o,w.hexdigest())}}E.OptionalContentConfig=s;function g(D){const w=D.length;if(w<2)return!0;const x=D[0];for(let F=1;F{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFDataTransportStream=void 0;var p=l(1),v=l(139);class I{constructor(t,n){let{length:h,initialData:a,progressiveDone:d=!1,contentDispositionFilename:r=null,disableRange:i=!1,disableStream:o=!1}=t;if((0,p.assert)(n,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=d,this._contentDispositionFilename=r,(a==null?void 0:a.length)>0){const c=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=n,this._isStreamingSupported=!o,this._isRangeSupported=!i,this._contentLength=h,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((c,b)=>{this._onReceiveData({begin:c,chunk:b})}),this._pdfDataRangeTransport.addProgressListener((c,b)=>{this._onProgress({loaded:c,total:b})}),this._pdfDataRangeTransport.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:n,chunk:h}=t;const a=h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer;if(n===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{const d=this._rangeReaders.some(function(r){return r._begin!==n?!1:(r._enqueue(a),!0)});(0,p.assert)(d,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)===null||t===void 0?void 0:t._loaded)??0}_onProgress(t){if(t.total===void 0){var n,h;(n=this._rangeReaders[0])===null||n===void 0||(h=n.onProgress)===null||h===void 0||h.call(n,{loaded:t.loaded})}else{var a,d;(a=this._fullRequestReader)===null||a===void 0||(d=a.onProgress)===null||d===void 0||d.call(a,{loaded:t.loaded,total:t.total})}}_onProgressiveDone(){var t;(t=this._fullRequestReader)===null||t===void 0||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const n=this._rangeReaders.indexOf(t);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){(0,p.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new k(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,n){if(n<=this._progressiveDataLength)return null;const h=new m(this,t,n);return this._pdfDataRangeTransport.requestDataRange(t,n),this._rangeReaders.push(h),h}cancelAllRequests(t){var n;(n=this._fullRequestReader)===null||n===void 0||n.cancel(t);for(const h of this._rangeReaders.slice(0))h.cancel(t);this._pdfDataRangeTransport.abort()}}E.PDFDataTransportStream=I;class k{constructor(t,n){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=t,this._done=h||!1,this._filename=(0,v.isPdfFile)(a)?a:null,this._queuedChunks=n||[],this._loaded=0;for(const d of this._queuedChunks)this._loaded+=d.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=(0,p.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class m{constructor(t,n,h){this._stream=t,this._begin=n,this._end=h,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,p.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.XfaText=void 0;class l{static textContent(v){const I=[],k={items:I,styles:Object.create(null)};function m(R){var t;if(!R)return;let n=null;const h=R.name;if(h==="#text")n=R.value;else if(l.shouldBuildText(h))R!=null&&(t=R.attributes)!==null&&t!==void 0&&t.textContent?n=R.attributes.textContent:R.value&&(n=R.value);else return;if(n!==null&&I.push({str:n}),!!R.children)for(const a of R.children)m(a)}return m(v),k}static shouldBuildText(v){return!(v==="textarea"||v==="input"||v==="option"||v==="select")}}E.XfaText=l},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.NodeStandardFontDataFactory=E.NodeCanvasFactory=E.NodeCMapReaderFactory=void 0;var p=l(140);const v=function(R){return new Promise((t,n)=>{require$$7.readFile(R,(a,d)=>{if(a||!d){n(new Error(a));return}t(new Uint8Array(d))})})};class I extends p.BaseCanvasFactory{_createCanvas(t,n){return require$$7.createCanvas(t,n)}}E.NodeCanvasFactory=I;class k extends p.BaseCMapReaderFactory{_fetchData(t,n){return v(t).then(h=>({cMapData:h,compressionType:n}))}}E.NodeCMapReaderFactory=k;class m extends p.BaseStandardFontDataFactory{_fetchData(t){return v(t)}}E.NodeStandardFontDataFactory=m},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFNodeStream=void 0;var p=l(1),v=l(154);const I=require$$7,k=require$$7,m=require$$7,R=require$$7,t=/^file:\/\/\/[a-zA-Z]:\//;function n(y){const f=R.parse(y);return f.protocol==="file:"||f.host?f:/^[a-z]:[/\\]/i.test(y)?R.parse(`file:///${y}`):(f.host||(f.protocol="file:"),f)}class h{constructor(f){this.source=f,this.url=n(f.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&f.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var f;return((f=this._fullRequestReader)===null||f===void 0?void 0:f._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new c(this):new i(this),this._fullRequestReader}getRangeReader(f,s){if(s<=this._progressiveDataLength)return null;const g=this.isFsUrl?new b(this,f,s):new o(this,f,s);return this._rangeRequestReaders.push(g),g}cancelAllRequests(f){var s;(s=this._fullRequestReader)===null||s===void 0||s.cancel(f);for(const g of this._rangeRequestReaders.slice(0))g.cancel(f)}}E.PDFNodeStream=h;class a{constructor(f){this._url=f.url,this._done=!1,this._storedError=null,this.onProgress=null;const s=f.source;this._contentLength=s.length,this._loaded=0,this._filename=null,this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange,this._readableStream=null,this._readCapability=(0,p.createPromiseCapability)(),this._headersCapability=(0,p.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var f;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const s=this._readableStream.read();return s===null?(this._readCapability=(0,p.createPromiseCapability)(),this.read()):(this._loaded+=s.length,(f=this.onProgress)===null||f===void 0||f.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(s).buffer,done:!1})}cancel(f){if(!this._readableStream){this._error(f);return}this._readableStream.destroy(f)}_error(f){this._storedError=f,this._readCapability.resolve()}_setReadableStream(f){this._readableStream=f,f.on("readable",()=>{this._readCapability.resolve()}),f.on("end",()=>{f.destroy(),this._done=!0,this._readCapability.resolve()}),f.on("error",s=>{this._error(s)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(f){this._url=f.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,p.createPromiseCapability)();const s=f.source;this._isStreamingSupported=!s.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var f;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const s=this._readableStream.read();return s===null?(this._readCapability=(0,p.createPromiseCapability)(),this.read()):(this._loaded+=s.length,(f=this.onProgress)===null||f===void 0||f.call(this,{loaded:this._loaded}),{value:new Uint8Array(s).buffer,done:!1})}cancel(f){if(!this._readableStream){this._error(f);return}this._readableStream.destroy(f)}_error(f){this._storedError=f,this._readCapability.resolve()}_setReadableStream(f){this._readableStream=f,f.on("readable",()=>{this._readCapability.resolve()}),f.on("end",()=>{f.destroy(),this._done=!0,this._readCapability.resolve()}),f.on("error",s=>{this._error(s)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function r(y,f){return{protocol:y.protocol,auth:y.auth,host:y.hostname,port:y.port,path:y.path,method:"GET",headers:f}}class i extends a{constructor(f){super(f);const s=g=>{if(g.statusCode===404){const x=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=x,this._headersCapability.reject(x);return}this._headersCapability.resolve(),this._setReadableStream(g);const S=x=>this._readableStream.headers[x.toLowerCase()],{allowRangeRequests:D,suggestedLength:w}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:S,isHttp:f.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=D,this._contentLength=w||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(S)};this._request=null,this._url.protocol==="http:"?this._request=k.request(r(this._url,f.httpHeaders),s):this._request=m.request(r(this._url,f.httpHeaders),s),this._request.on("error",g=>{this._storedError=g,this._headersCapability.reject(g)}),this._request.end()}}class o extends d{constructor(f,s,g){super(f),this._httpHeaders={};for(const D in f.httpHeaders){const w=f.httpHeaders[D];w!==void 0&&(this._httpHeaders[D]=w)}this._httpHeaders.Range=`bytes=${s}-${g-1}`;const S=D=>{if(D.statusCode===404){const w=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=w;return}this._setReadableStream(D)};this._request=null,this._url.protocol==="http:"?this._request=k.request(r(this._url,this._httpHeaders),S):this._request=m.request(r(this._url,this._httpHeaders),S),this._request.on("error",D=>{this._storedError=D}),this._request.end()}}class c extends a{constructor(f){super(f);let s=decodeURIComponent(this._url.path);t.test(this._url.href)&&(s=s.replace(/^\//,"")),I.lstat(s,(g,S)=>{if(g){g.code==="ENOENT"&&(g=new p.MissingPDFException(`Missing PDF "${s}".`)),this._storedError=g,this._headersCapability.reject(g);return}this._contentLength=S.size,this._setReadableStream(I.createReadStream(s)),this._headersCapability.resolve()})}}class b extends d{constructor(f,s,g){super(f);let S=decodeURIComponent(this._url.path);t.test(this._url.href)&&(S=S.replace(/^\//,"")),this._setReadableStream(I.createReadStream(S,{start:s,end:g-1}))}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.createResponseStatusError=R,E.extractFilenameFromHeader=m,E.validateRangeRequestCapabilities=k,E.validateResponseStatus=t;var p=l(1),v=l(155),I=l(139);function k(n){let{getResponseHeader:h,isHttp:a,rangeChunkSize:d,disableRange:r}=n;const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(h("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*d)||r||!a||h("Accept-Ranges")!=="bytes"||(h("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function m(n){const h=n("Content-Disposition");if(h){let a=(0,v.getFilenameFromContentDispositionHeader)(h);if(a.includes("%"))try{a=decodeURIComponent(a)}catch{}if((0,I.isPdfFile)(a))return a}return null}function R(n,h){return n===404||n===0&&h.startsWith("file:")?new p.MissingPDFException('Missing PDF "'+h+'".'):new p.UnexpectedResponseException(`Unexpected server response (${n}) while retrieving PDF "${h}".`,n)}function t(n){return n===200||n===206}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.getFilenameFromContentDispositionHeader=v;var p=l(1);function v(I){let k=!0,m=R("filename\\*","i").exec(I);if(m){m=m[1];let i=a(m);return i=unescape(i),i=d(i),i=r(i),n(i)}if(m=h(I),m){const i=r(m);return n(i)}if(m=R("filename","i").exec(I),m){m=m[1];let i=a(m);return i=r(i),n(i)}function R(i,o){return new RegExp("(?:^|;)\\s*"+i+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',o)}function t(i,o){if(i){if(!/^[\x00-\xFF]+$/.test(o))return o;try{const c=new TextDecoder(i,{fatal:!0}),b=(0,p.stringToBytes)(o);o=c.decode(b),k=!1}catch{}}return o}function n(i){return k&&/[\x80-\xff]/.test(i)&&(i=t("utf-8",i),k&&(i=t("iso-8859-1",i))),i}function h(i){const o=[];let c;const b=R("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(c=b.exec(i))!==null;){let[,f,s,g]=c;if(f=parseInt(f,10),f in o){if(f===0)break;continue}o[f]=[s,g]}const y=[];for(let f=0;f{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFNetworkStream=void 0;var p=l(1),v=l(154);const I=200,k=206;function m(a){const d=a.response;return typeof d!="string"?d:(0,p.stringToBytes)(d).buffer}class R{constructor(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=d,this.isHttp=/^https?:/i.test(d),this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null),this.withCredentials=r.withCredentials||!1,this.getXhr=r.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(d,r,i){const o={begin:d,end:r};for(const c in i)o[c]=i[c];return this.request(o)}requestFull(d){return this.request(d)}request(d){const r=this.getXhr(),i=this.currXhrId++,o=this.pendingRequests[i]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const c in this.httpHeaders){const b=this.httpHeaders[c];b!==void 0&&r.setRequestHeader(c,b)}return this.isHttp&&"begin"in d&&"end"in d?(r.setRequestHeader("Range",`bytes=${d.begin}-${d.end-1}`),o.expectedStatus=k):o.expectedStatus=I,r.responseType="arraybuffer",d.onError&&(r.onerror=function(c){d.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,i),r.onprogress=this.onProgress.bind(this,i),o.onHeadersReceived=d.onHeadersReceived,o.onDone=d.onDone,o.onError=d.onError,o.onProgress=d.onProgress,r.send(null),i}onProgress(d,r){var i;const o=this.pendingRequests[d];o&&((i=o.onProgress)===null||i===void 0||i.call(o,r))}onStateChange(d,r){const i=this.pendingRequests[d];if(!i)return;const o=i.xhr;if(o.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),o.readyState!==4||!(d in this.pendingRequests))return;if(delete this.pendingRequests[d],o.status===0&&this.isHttp){var c;(c=i.onError)===null||c===void 0||c.call(i,o.status);return}const b=o.status||I;if(!(b===I&&i.expectedStatus===k)&&b!==i.expectedStatus){var f;(f=i.onError)===null||f===void 0||f.call(i,o.status);return}const s=m(o);if(b===k){const S=o.getResponseHeader("Content-Range"),D=/bytes (\d+)-(\d+)\/(\d+)/.exec(S);i.onDone({begin:parseInt(D[1],10),chunk:s})}else if(s)i.onDone({begin:0,chunk:s});else{var g;(g=i.onError)===null||g===void 0||g.call(i,o.status)}}getRequestXhr(d){return this.pendingRequests[d].xhr}isPendingRequest(d){return d in this.pendingRequests}abortRequest(d){const r=this.pendingRequests[d].xhr;delete this.pendingRequests[d],r.abort()}}class t{constructor(d){this._source=d,this._manager=new R(d.url,{httpHeaders:d.httpHeaders,withCredentials:d.withCredentials}),this._rangeChunkSize=d.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(d){const r=this._rangeRequestReaders.indexOf(d);r>=0&&this._rangeRequestReaders.splice(r,1)}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new n(this._manager,this._source),this._fullRequestReader}getRangeReader(d,r){const i=new h(this._manager,d,r);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(d){var r;(r=this._fullRequestReader)===null||r===void 0||r.cancel(d);for(const i of this._rangeRequestReaders.slice(0))i.cancel(d)}}E.PDFNetworkStream=t;class n{constructor(d,r){this._manager=d;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=d.requestFull(i),this._headersReceivedCapability=(0,p.createPromiseCapability)(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const d=this._fullRequestId,r=this._manager.getRequestXhr(d),i=b=>r.getResponseHeader(b),{allowRangeRequests:o,suggestedLength:c}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});o&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest(d),this._headersReceivedCapability.resolve()}_onDone(d){if(d&&(this._requests.length>0?this._requests.shift().resolve({value:d.chunk,done:!1}):this._cachedChunks.push(d.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(d){this._storedError=(0,v.createResponseStatusError)(d,this._url),this._headersReceivedCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(d){var r;(r=this.onProgress)===null||r===void 0||r.call(this,{loaded:d.loaded,total:d.lengthComputable?d.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const d=(0,p.createPromiseCapability)();return this._requests.push(d),d.promise}cancel(d){this._done=!0,this._headersReceivedCapability.reject(d);for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class h{constructor(d,r,i){this._manager=d;const o={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=d.url,this._requestId=d.requestRange(r,i,o),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var d;(d=this.onClosed)===null||d===void 0||d.call(this,this)}_onDone(d){const r=d.chunk;this._requests.length>0?this._requests.shift().resolve({value:r,done:!1}):this._queuedChunk=r,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(d){this._storedError=(0,v.createResponseStatusError)(d,this._url);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(d){if(!this.isStreamingSupported){var r;(r=this.onProgress)===null||r===void 0||r.call(this,{loaded:d.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const d=(0,p.createPromiseCapability)();return this._requests.push(d),d.promise}cancel(d){this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.PDFFetchStream=void 0;var p=l(1),v=l(154);function I(h,a,d){return{method:"GET",headers:h,signal:d.signal,mode:"cors",credentials:a?"include":"same-origin",redirect:"follow"}}function k(h){const a=new Headers;for(const d in h){const r=h[d];r!==void 0&&a.append(d,r)}return a}function m(h){return h instanceof Uint8Array?h.buffer:h instanceof ArrayBuffer?h:((0,p.warn)(`getArrayBuffer - unexpected data format: ${h}`),new Uint8Array(h).buffer)}class R{constructor(a){this.source=a,this.isHttp=/^https?:/i.test(a.url),this.httpHeaders=this.isHttp&&a.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var a;return((a=this._fullRequestReader)===null||a===void 0?void 0:a._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new t(this),this._fullRequestReader}getRangeReader(a,d){if(d<=this._progressiveDataLength)return null;const r=new n(this,a,d);return this._rangeRequestReaders.push(r),r}cancelAllRequests(a){var d;(d=this._fullRequestReader)===null||d===void 0||d.cancel(a);for(const r of this._rangeRequestReaders.slice(0))r.cancel(a)}}E.PDFFetchStream=R;class t{constructor(a){this._stream=a,this._reader=null,this._loaded=0,this._filename=null;const d=a.source;this._withCredentials=d.withCredentials||!1,this._contentLength=d.length,this._headersCapability=(0,p.createPromiseCapability)(),this._disableRange=d.disableRange||!1,this._rangeChunkSize=d.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!d.disableStream,this._isRangeSupported=!d.disableRange,this._headers=k(this._stream.httpHeaders);const r=d.url;fetch(r,I(this._headers,this._withCredentials,this._abortController)).then(i=>{if(!(0,v.validateResponseStatus)(i.status))throw(0,v.createResponseStatusError)(i.status,r);this._reader=i.body.getReader(),this._headersCapability.resolve();const o=y=>i.headers.get(y),{allowRangeRequests:c,suggestedLength:b}=(0,v.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=b||this._contentLength,this._filename=(0,v.extractFilenameFromHeader)(o),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var a;await this._headersCapability.promise;const{value:d,done:r}=await this._reader.read();return r?{value:d,done:r}:(this._loaded+=d.byteLength,(a=this.onProgress)===null||a===void 0||a.call(this,{loaded:this._loaded,total:this._contentLength}),{value:m(d),done:!1})}cancel(a){var d;(d=this._reader)===null||d===void 0||d.cancel(a),this._abortController.abort()}}class n{constructor(a,d,r){this._stream=a,this._reader=null,this._loaded=0;const i=a.source;this._withCredentials=i.withCredentials||!1,this._readCapability=(0,p.createPromiseCapability)(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController,this._headers=k(this._stream.httpHeaders),this._headers.append("Range",`bytes=${d}-${r-1}`);const o=i.url;fetch(o,I(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!(0,v.validateResponseStatus)(c.status))throw(0,v.createResponseStatusError)(c.status,o);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var a;await this._readCapability.promise;const{value:d,done:r}=await this._reader.read();return r?{value:d,done:r}:(this._loaded+=d.byteLength,(a=this.onProgress)===null||a===void 0||a.call(this,{loaded:this._loaded}),{value:m(d),done:!1})}cancel(a){var d;(d=this._reader)===null||d===void 0||d.cancel(a),this._abortController.abort()}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.TextLayerRenderTask=void 0,E.renderTextLayer=i,E.updateTextLayer=o;var p=l(1),v=l(139);const I=1e5,k=30,m=.8,R=new Map;function t(c,b){let y;if(b&&p.FeatureTest.isOffscreenCanvasSupported)y=new OffscreenCanvas(c,c).getContext("2d",{alpha:!1});else{const f=document.createElement("canvas");f.width=f.height=c,y=f.getContext("2d",{alpha:!1})}return y}function n(c,b){const y=R.get(c);if(y)return y;const f=t(k,b);f.font=`${k}px ${c}`;const s=f.measureText("");let g=s.fontBoundingBoxAscent,S=Math.abs(s.fontBoundingBoxDescent);if(g){const w=g/(g+S);return R.set(c,w),f.canvas.width=f.canvas.height=0,w}f.strokeStyle="red",f.clearRect(0,0,k,k),f.strokeText("g",0,0);let D=f.getImageData(0,0,k,k).data;S=0;for(let w=D.length-1-3;w>=0;w-=4)if(D[w]>0){S=Math.ceil(w/4/k);break}f.clearRect(0,0,k,k),f.strokeText("A",0,k),D=f.getImageData(0,0,k,k).data,g=0;for(let w=0,x=D.length;w0){g=k-Math.floor(w/4/k);break}if(f.canvas.width=f.canvas.height=0,g){const w=g/(g+S);return R.set(c,w),w}return R.set(c,m),m}function h(c,b,y){const f=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:b.str!=="",hasEOL:b.hasEOL,fontSize:0};c._textDivs.push(f);const g=p.Util.transform(c._transform,b.transform);let S=Math.atan2(g[1],g[0]);const D=y[b.fontName];D.vertical&&(S+=Math.PI/2);const w=Math.hypot(g[2],g[3]),x=w*n(D.fontFamily,c._isOffscreenCanvasSupported);let F,X;S===0?(F=g[4],X=g[5]-x):(F=g[4]+x*Math.sin(S),X=g[5]-x*Math.cos(S));const G="calc(var(--scale-factor)*",j=f.style;c._container===c._rootContainer?(j.left=`${(100*F/c._pageWidth).toFixed(2)}%`,j.top=`${(100*X/c._pageHeight).toFixed(2)}%`):(j.left=`${G}${F.toFixed(2)}px)`,j.top=`${G}${X.toFixed(2)}px)`),j.fontSize=`${G}${w.toFixed(2)}px)`,j.fontFamily=D.fontFamily,s.fontSize=w,f.setAttribute("role","presentation"),f.textContent=b.str,f.dir=b.dir,c._fontInspectorEnabled&&(f.dataset.fontName=b.fontName),S!==0&&(s.angle=S*(180/Math.PI));let N=!1;if(b.str.length>1)N=!0;else if(b.str!==" "&&b.transform[0]!==b.transform[3]){const Q=Math.abs(b.transform[0]),Y=Math.abs(b.transform[3]);Q!==Y&&Math.max(Q,Y)/Math.min(Q,Y)>1.5&&(N=!0)}N&&(s.canvasWidth=D.vertical?b.height:b.width),c._textDivProperties.set(f,s),c._isReadableStream&&c._layoutText(f)}function a(c){const{div:b,scale:y,properties:f,ctx:s,prevFontSize:g,prevFontFamily:S}=c,{style:D}=b;let w="";if(f.canvasWidth!==0&&f.hasText){const{fontFamily:x}=D,{canvasWidth:F,fontSize:X}=f;(g!==X||S!==x)&&(s.font=`${X*y}px ${x}`,c.prevFontSize=X,c.prevFontFamily=x);const{width:G}=s.measureText(b.textContent);G>0&&(w=`scaleX(${F*y/G})`)}f.angle!==0&&(w=`rotate(${f.angle}deg) ${w}`),w.length>0&&(D.transform=w)}function d(c){if(c._canceled)return;const b=c._textDivs,y=c._capability;if(b.length>I){y.resolve();return}if(!c._isReadableStream)for(const s of b)c._layoutText(s);y.resolve()}class r{constructor(b){var y;let{textContentSource:f,container:s,viewport:g,textDivs:S,textDivProperties:D,textContentItemsStr:w,isOffscreenCanvasSupported:x}=b;this._textContentSource=f,this._isReadableStream=f instanceof ReadableStream,this._container=this._rootContainer=s,this._textDivs=S||[],this._textContentItemsStr=w||[],this._isOffscreenCanvasSupported=x,this._fontInspectorEnabled=!!((y=globalThis.FontInspector)!==null&&y!==void 0&&y.enabled),this._reader=null,this._textDivProperties=D||new WeakMap,this._canceled=!1,this._capability=(0,p.createPromiseCapability)(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:g.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t(0,x)};const{pageWidth:F,pageHeight:X,pageX:G,pageY:j}=g.rawDims;this._transform=[1,0,0,-1,-G,j+X],this._pageWidth=F,this._pageHeight=X,(0,v.setLayerDimensions)(s,g),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new p.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new p.AbortException("TextLayer task cancelled."))}_processItems(b,y){for(const f of b){if(f.str===void 0){if(f.type==="beginMarkedContentProps"||f.type==="beginMarkedContent"){const s=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),f.id!==null&&this._container.setAttribute("id",`${f.id}`),s.append(this._container)}else f.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(f.str),h(this,f,y)}}_layoutText(b){const y=this._layoutTextParams.properties=this._textDivProperties.get(b);if(this._layoutTextParams.div=b,a(this._layoutTextParams),y.hasText&&this._container.append(b),y.hasEOL){const f=document.createElement("br");f.setAttribute("role","presentation"),this._container.append(f)}}_render(){const b=(0,p.createPromiseCapability)();let y=Object.create(null);if(this._isReadableStream){const f=()=>{this._reader.read().then(s=>{let{value:g,done:S}=s;if(S){b.resolve();return}Object.assign(y,g.styles),this._processItems(g.items,y),f()},b.reject)};this._reader=this._textContentSource.getReader(),f()}else if(this._textContentSource){const{items:f,styles:s}=this._textContentSource;this._processItems(f,s),b.resolve()}else throw new Error('No "textContentSource" parameter specified.');b.promise.then(()=>{y=null,d(this)},this._capability.reject)}}E.TextLayerRenderTask=r;function i(c){!c.textContentSource&&(c.textContent||c.textContentStream)&&((0,v.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),c.textContentSource=c.textContent||c.textContentStream);const b=new r(c);return b._render(),b}function o(c){let{container:b,viewport:y,textDivs:f,textDivProperties:s,isOffscreenCanvasSupported:g,mustRotate:S=!0,mustRescale:D=!0}=c;if(S&&(0,v.setLayerDimensions)(b,{rotation:y.rotation}),D){const w=t(0,g),F={prevFontSize:null,prevFontFamily:null,div:null,scale:y.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:w};for(const X of f)F.properties=s.get(X),F.div=X,a(F)}}},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationEditorLayer=void 0;var p=l(1),v=l(138),I=l(160),k=l(161),m=l(139);function R(_,H){d(_,H),H.add(_)}function t(_,H,$){return H=n(H),H in _?Object.defineProperty(_,H,{value:$,enumerable:!0,configurable:!0,writable:!0}):_[H]=$,_}function n(_){var H=h(_,"string");return typeof H=="symbol"?H:String(H)}function h(_,H){if(typeof _!="object"||_===null)return _;var $=_[Symbol.toPrimitive];if($!==void 0){var C=$.call(_,H||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(_)}function a(_,H,$){d(_,H),H.set(_,$)}function d(_,H){if(H.has(_))throw new TypeError("Cannot initialize the same private elements twice on an object")}function r(_,H,$){if(!H.has(_))throw new TypeError("attempted to get private field on non-instance");return $}function i(_,H){var $=b(_,H,"get");return o(_,$)}function o(_,H){return H.get?H.get.call(_):H.value}function c(_,H,$){var C=b(_,H,"set");return y(_,C,$),$}function b(_,H,$){if(!H.has(_))throw new TypeError("attempted to "+$+" private field on non-instance");return H.get(_)}function y(_,H,$){if(H.set)H.set.call(_,$);else{if(!H.writable)throw new TypeError("attempted to set read only private field");H.value=$}}var f=new WeakMap,s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakMap,X=new WeakSet,G=new WeakSet,j=new WeakSet,N=new WeakSet;class Q{constructor(H){R(this,N),R(this,j),R(this,G),R(this,X),a(this,f,{writable:!0,value:void 0}),a(this,s,{writable:!0,value:!1}),a(this,g,{writable:!0,value:this.pointerup.bind(this)}),a(this,S,{writable:!0,value:this.pointerdown.bind(this)}),a(this,D,{writable:!0,value:new Map}),a(this,w,{writable:!0,value:!1}),a(this,x,{writable:!0,value:!1}),a(this,F,{writable:!0,value:void 0}),Q._initialized||(Q._initialized=!0,I.FreeTextEditor.initialize(H.l10n),k.InkEditor.initialize(H.l10n)),H.uiManager.registerEditorTypes([I.FreeTextEditor,k.InkEditor]),c(this,F,H.uiManager),this.pageIndex=H.pageIndex,this.div=H.div,c(this,f,H.accessibilityManager),i(this,F).addLayer(this)}get isEmpty(){return i(this,D).size===0}updateToolbar(H){i(this,F).updateToolbar(H)}updateMode(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i(this,F).getMode();r(this,N,q).call(this),H===p.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),i(this,F).unselectAll(),H!==p.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",H===p.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",H===p.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(H){if(!H&&i(this,F).getMode()!==p.AnnotationEditorType.INK)return;if(!H){for(const C of i(this,D).values())if(C.isEmpty()){C.setInBackground();return}}r(this,j,ie).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(H){i(this,F).setEditingState(H)}addCommands(H){i(this,F).addCommands(H)}enable(){this.div.style.pointerEvents="auto";for(const H of i(this,D).values())H.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const H of i(this,D).values())H.disableEditing();r(this,N,q).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(H){i(this,F).getActive()!==H&&i(this,F).setActiveEditor(H)}enableClick(){this.div.addEventListener("pointerdown",i(this,S)),this.div.addEventListener("pointerup",i(this,g))}disableClick(){this.div.removeEventListener("pointerdown",i(this,S)),this.div.removeEventListener("pointerup",i(this,g))}attach(H){i(this,D).set(H.id,H)}detach(H){var $;i(this,D).delete(H.id),($=i(this,f))===null||$===void 0||$.removePointerInTextLayer(H.contentDiv)}remove(H){i(this,F).removeEditor(H),this.detach(H),H.div.style.display="none",setTimeout(()=>{H.div.style.display="",H.div.remove(),H.isAttachedToDOM=!1,document.activeElement===document.body&&i(this,F).focusMainContainer()},0),i(this,x)||this.addInkEditorIfNeeded(!1)}add(H){if(r(this,X,Y).call(this,H),i(this,F).addEditor(H),this.attach(H),!H.isAttachedToDOM){const $=H.render();this.div.append($),H.isAttachedToDOM=!0}this.moveEditorInDOM(H),H.onceAdded(),i(this,F).addToAnnotationStorage(H)}moveEditorInDOM(H){var $;($=i(this,f))===null||$===void 0||$.moveElementInDOM(this.div,H.div,H.contentDiv,!0)}addOrRebuild(H){H.needsToBeRebuilt()?H.rebuild():this.add(H)}addANewEditor(H){const $=()=>{this.addOrRebuild(H)},C=()=>{H.remove()};this.addCommands({cmd:$,undo:C,mustExec:!0})}addUndoableEditor(H){const $=()=>{this.addOrRebuild(H)},C=()=>{H.remove()};this.addCommands({cmd:$,undo:C,mustExec:!1})}getNextId(){return i(this,F).getId()}deserialize(H){switch(H.annotationType){case p.AnnotationEditorType.FREETEXT:return I.FreeTextEditor.deserialize(H,this,i(this,F));case p.AnnotationEditorType.INK:return k.InkEditor.deserialize(H,this,i(this,F))}return null}setSelected(H){i(this,F).setSelected(H)}toggleSelected(H){i(this,F).toggleSelected(H)}isSelected(H){return i(this,F).isSelected(H)}unselect(H){i(this,F).unselect(H)}pointerup(H){const{isMac:$}=p.FeatureTest.platform;if(!(H.button!==0||H.ctrlKey&&$)&&H.target===this.div&&i(this,w)){if(c(this,w,!1),!i(this,s)){c(this,s,!0);return}r(this,j,ie).call(this,H)}}pointerdown(H){const{isMac:$}=p.FeatureTest.platform;if(H.button!==0||H.ctrlKey&&$||H.target!==this.div)return;c(this,w,!0);const C=i(this,F).getActive();c(this,s,!C||C.isEmpty())}drop(H){const $=H.dataTransfer.getData("text/plain"),C=i(this,F).getEditor($);if(!C)return;H.preventDefault(),H.dataTransfer.dropEffect="move",r(this,X,Y).call(this,C);const P=this.div.getBoundingClientRect(),z=H.clientX-P.x,ee=H.clientY-P.y;C.translate(z-C.startX,ee-C.startY),this.moveEditorInDOM(C),C.div.focus()}dragover(H){H.preventDefault()}destroy(){var H;((H=i(this,F).getActive())===null||H===void 0?void 0:H.parent)===this&&i(this,F).setActiveEditor(null);for(const C of i(this,D).values()){var $;($=i(this,f))===null||$===void 0||$.removePointerInTextLayer(C.contentDiv),C.setParent(null),C.isAttachedToDOM=!1,C.div.remove()}this.div=null,i(this,D).clear(),i(this,F).removeLayer(this)}render(H){let{viewport:$}=H;this.viewport=$,(0,m.setLayerDimensions)(this.div,$),(0,v.bindEvents)(this,this.div,["dragover","drop"]);for(const C of i(this,F).getEditors(this.pageIndex))this.add(C);this.updateMode()}update(H){let{viewport:$}=H;i(this,F).commitOrRemove(),this.viewport=$,(0,m.setLayerDimensions)(this.div,{rotation:$.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:H,pageHeight:$}=this.viewport.rawDims;return[H,$]}}E.AnnotationEditorLayer=Q;function Y(_){var H;_.parent!==this&&(this.attach(_),(H=_.parent)===null||H===void 0||H.detach(_),_.setParent(this),_.div&&_.isAttachedToDOM&&(_.div.remove(),this.div.append(_.div)))}function B(_){switch(i(this,F).getMode()){case p.AnnotationEditorType.FREETEXT:return new I.FreeTextEditor(_);case p.AnnotationEditorType.INK:return new k.InkEditor(_)}return null}function ie(_){const H=this.getNextId(),$=r(this,G,B).call(this,{parent:this,id:H,x:_.offsetX,y:_.offsetY,uiManager:i(this,F)});return $&&this.add($),$}function q(){c(this,x,!0);for(const _ of i(this,D).values())_.isEmpty()&&_.remove();c(this,x,!1)}t(Q,"_initialized",!1)},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.FreeTextEditor=void 0;var p=l(1),v=l(138),I=l(137);function k(q,_){h(q,_),_.add(q)}function m(q,_,H){return _=R(_),_ in q?Object.defineProperty(q,_,{value:H,enumerable:!0,configurable:!0,writable:!0}):q[_]=H,q}function R(q){var _=t(q,"string");return typeof _=="symbol"?_:String(_)}function t(q,_){if(typeof q!="object"||q===null)return q;var H=q[Symbol.toPrimitive];if(H!==void 0){var $=H.call(q,_||"default");if(typeof $!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(q)}function n(q,_,H){h(q,_),_.set(q,H)}function h(q,_){if(_.has(q))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(q,_){var H=o(q,_,"get");return d(q,H)}function d(q,_){return _.get?_.get.call(q):_.value}function r(q,_,H){if(!_.has(q))throw new TypeError("attempted to get private field on non-instance");return H}function i(q,_,H){var $=o(q,_,"set");return c(q,$,H),H}function o(q,_,H){if(!_.has(q))throw new TypeError("attempted to "+H+" private field on non-instance");return _.get(q)}function c(q,_,H){if(_.set)_.set.call(q,H);else{if(!_.writable)throw new TypeError("attempted to set read only private field");_.value=H}}var b=new WeakMap,y=new WeakMap,f=new WeakMap,s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakSet,X=new WeakSet,G=new WeakSet,j=new WeakSet;class N extends I.AnnotationEditor{constructor(_){super({..._,name:"freeTextEditor"}),k(this,j),k(this,G),k(this,X),k(this,F),n(this,b,{writable:!0,value:this.editorDivBlur.bind(this)}),n(this,y,{writable:!0,value:this.editorDivFocus.bind(this)}),n(this,f,{writable:!0,value:this.editorDivInput.bind(this)}),n(this,s,{writable:!0,value:this.editorDivKeydown.bind(this)}),n(this,g,{writable:!0,value:void 0}),n(this,S,{writable:!0,value:""}),n(this,D,{writable:!0,value:`${this.id}-editor`}),n(this,w,{writable:!0,value:!1}),n(this,x,{writable:!0,value:void 0}),i(this,g,_.color||N._defaultColor||I.AnnotationEditor._defaultLineColor),i(this,x,_.fontSize||N._defaultFontSize)}static initialize(_){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map($=>[$,_.get($)]));const H=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(H.getPropertyValue("--freetext-padding"))}static updateDefaultParams(_,H){switch(_){case p.AnnotationEditorParamsType.FREETEXT_SIZE:N._defaultFontSize=H;break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:N._defaultColor=H;break}}updateParams(_,H){switch(_){case p.AnnotationEditorParamsType.FREETEXT_SIZE:r(this,F,Q).call(this,H);break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:r(this,X,Y).call(this,H);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,N._defaultFontSize],[p.AnnotationEditorParamsType.FREETEXT_COLOR,N._defaultColor||I.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,a(this,x)],[p.AnnotationEditorParamsType.FREETEXT_COLOR,a(this,g)]]}getInitialTranslation(){const _=this.parentScale;return[-N._internalPadding*_,-(N._internalPadding+a(this,x))*_]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(p.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",a(this,s)),this.editorDiv.addEventListener("focus",a(this,y)),this.editorDiv.addEventListener("blur",a(this,b)),this.editorDiv.addEventListener("input",a(this,f)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",a(this,D)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",a(this,s)),this.editorDiv.removeEventListener("focus",a(this,y)),this.editorDiv.removeEventListener("blur",a(this,b)),this.editorDiv.removeEventListener("input",a(this,f)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(_){super.focusin(_),_.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),a(this,w)||(i(this,w,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),i(this,S,r(this,G,B).call(this).trimEnd()),r(this,j,ie).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(_){this.enableEditMode(),this.editorDiv.focus()}keydown(_){_.target===this.div&&_.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(_){N._keyboardManager.exec(this,_)}editorDivFocus(_){this.isEditing=!0}editorDivBlur(_){this.isEditing=!1}editorDivInput(_){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let _,H;this.width&&(_=this.x,H=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",a(this,D)),this.enableEditing(),N._l10nPromise.get("editor_free_text2_aria_label").then(C=>{var P;return(P=this.editorDiv)===null||P===void 0?void 0:P.setAttribute("aria-label",C)}),N._l10nPromise.get("free_text2_default_content").then(C=>{var P;return(P=this.editorDiv)===null||P===void 0?void 0:P.setAttribute("default-content",C)}),this.editorDiv.contentEditable=!0;const{style:$}=this.editorDiv;if($.fontSize=`calc(${a(this,x)}px * var(--scale-factor))`,$.color=a(this,g),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,v.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[C,P]=this.parentDimensions;this.setAt(_*C,H*P,this.width*C,this.height*P);for(const z of a(this,S).split(`
+`)){const ee=document.createElement("div");ee.append(z?document.createTextNode(z):document.createElement("br")),this.editorDiv.append(ee)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(_,H,$){const C=super.deserialize(_,H,$);return i(C,x,_.fontSize),i(C,g,p.Util.makeHexColor(..._.color)),i(C,S,_.value),C}serialize(){if(this.isEmpty())return null;const _=N._internalPadding*this.parentScale,H=this.getRect(_,_),$=I.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:a(this,g));return{annotationType:p.AnnotationEditorType.FREETEXT,color:$,fontSize:a(this,x),value:a(this,S),pageIndex:this.pageIndex,rect:H,rotation:this.rotation}}}E.FreeTextEditor=N;function Q(q){const _=$=>{this.editorDiv.style.fontSize=`calc(${$}px * var(--scale-factor))`,this.translate(0,-($-a(this,x))*this.parentScale),i(this,x,$),r(this,j,ie).call(this)},H=a(this,x);this.addCommands({cmd:()=>{_(q)},undo:()=>{_(H)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function Y(q){const _=a(this,g);this.addCommands({cmd:()=>{i(this,g,this.editorDiv.style.color=q)},undo:()=>{i(this,g,this.editorDiv.style.color=_)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function B(){const q=this.editorDiv.getElementsByTagName("div");if(q.length===0)return this.editorDiv.innerText;const _=[];for(const H of q)_.push(H.innerText.replace(/\r\n?|\n/,""));return _.join(`
+`)}function ie(){const[q,_]=this.parentDimensions;let H;if(this.isAttachedToDOM)H=this.div.getBoundingClientRect();else{const{currentLayer:$,div:C}=this,P=C.style.display;C.style.display="hidden",$.div.append(this.div),H=C.getBoundingClientRect(),C.remove(),C.style.display=P}this.width=H.width/q,this.height=H.height/_}m(N,"_freeTextDefaultContent",""),m(N,"_l10nPromise",void 0),m(N,"_internalPadding",0),m(N,"_defaultColor",null),m(N,"_defaultFontSize",10),m(N,"_keyboardManager",new v.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],N.prototype.commitOrRemove]])),m(N,"_type","freetext")},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.InkEditor=void 0,Object.defineProperty(E,"fitCurve",{enumerable:!0,get:function(){return I.fitCurve}});var p=l(1),v=l(137),I=l(162),k=l(138);function m(oe,J){a(oe,J),J.add(oe)}function R(oe,J,pe){return J=t(J),J in oe?Object.defineProperty(oe,J,{value:pe,enumerable:!0,configurable:!0,writable:!0}):oe[J]=pe,oe}function t(oe){var J=n(oe,"string");return typeof J=="symbol"?J:String(J)}function n(oe,J){if(typeof oe!="object"||oe===null)return oe;var pe=oe[Symbol.toPrimitive];if(pe!==void 0){var ke=pe.call(oe,J||"default");if(typeof ke!="object")return ke;throw new TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(oe)}function h(oe,J,pe){a(oe,J),J.set(oe,pe)}function a(oe,J){if(J.has(oe))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(oe,J,pe){return r(oe,J),pe}function r(oe,J){if(oe!==J)throw new TypeError("Private static access of wrong provenance")}function i(oe,J,pe){var ke=b(oe,J,"set");return o(oe,ke,pe),pe}function o(oe,J,pe){if(J.set)J.set.call(oe,pe);else{if(!J.writable)throw new TypeError("attempted to set read only private field");J.value=pe}}function c(oe,J){var pe=b(oe,J,"get");return y(oe,pe)}function b(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to "+pe+" private field on non-instance");return J.get(oe)}function y(oe,J){return J.get?J.get.call(oe):J.value}function f(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to get private field on non-instance");return pe}const s=16,g=100;var S=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,F=new WeakMap,X=new WeakMap,G=new WeakMap,j=new WeakMap,N=new WeakMap,Q=new WeakMap,Y=new WeakMap,B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakSet,H=new WeakSet,$=new WeakSet,C=new WeakSet,P=new WeakSet,z=new WeakSet,ee=new WeakSet,te=new WeakSet,K=new WeakSet,ue=new WeakSet,fe=new WeakSet,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet,Z=new WeakSet,se=new WeakSet,ne=new WeakSet;class re extends v.AnnotationEditor{constructor(J){super({...J,name:"inkEditor"}),m(this,ne),m(this,se),m(this,Z),m(this,U),m(this,M),m(this,O),m(this,A),m(this,ge),m(this,we),m(this,me),m(this,ye),m(this,fe),m(this,ue),m(this,K),m(this,te),m(this,ee),m(this,z),m(this,P),m(this,C),m(this,$),m(this,H),m(this,_),h(this,S,{writable:!0,value:0}),h(this,D,{writable:!0,value:0}),h(this,w,{writable:!0,value:0}),h(this,x,{writable:!0,value:this.canvasPointermove.bind(this)}),h(this,F,{writable:!0,value:this.canvasPointerleave.bind(this)}),h(this,X,{writable:!0,value:this.canvasPointerup.bind(this)}),h(this,G,{writable:!0,value:this.canvasPointerdown.bind(this)}),h(this,j,{writable:!0,value:!1}),h(this,N,{writable:!0,value:!1}),h(this,Q,{writable:!0,value:null}),h(this,Y,{writable:!0,value:null}),h(this,B,{writable:!0,value:0}),h(this,ie,{writable:!0,value:0}),h(this,q,{writable:!0,value:null}),this.color=J.color||null,this.thickness=J.thickness||null,this.opacity=J.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(J){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(pe=>[pe,J.get(pe)]))}static updateDefaultParams(J,pe){switch(J){case p.AnnotationEditorParamsType.INK_THICKNESS:re._defaultThickness=pe;break;case p.AnnotationEditorParamsType.INK_COLOR:re._defaultColor=pe;break;case p.AnnotationEditorParamsType.INK_OPACITY:re._defaultOpacity=pe/100;break}}updateParams(J,pe){switch(J){case p.AnnotationEditorParamsType.INK_THICKNESS:f(this,_,ve).call(this,pe);break;case p.AnnotationEditorParamsType.INK_COLOR:f(this,H,he).call(this,pe);break;case p.AnnotationEditorParamsType.INK_OPACITY:f(this,$,be).call(this,pe);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,re._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,re._defaultColor||v.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(re._defaultOpacity*100)]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||re._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,this.color||re._defaultColor||v.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??re._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(f(this,fe,V).call(this),f(this,ye,de).call(this)),this.isAttachedToDOM||(this.parent.add(this),f(this,me,Pe).call(this)),f(this,se,Oe).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,c(this,Y).disconnect(),i(this,Y,null),super.remove())}setParent(J){!this.parent&&J?this._uiManager.removeShouldRescale(this):this.parent&&J===null&&this._uiManager.addShouldRescale(this),super.setParent(J)}onScaleChanging(){const[J,pe]=this.parentDimensions,ke=this.width*J,Re=this.height*pe;this.setDimensions(ke,Re)}enableEditMode(){c(this,j)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",c(this,G)),this.canvas.addEventListener("pointerup",c(this,X)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",c(this,G)),this.canvas.removeEventListener("pointerup",c(this,X)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){c(this,j)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),i(this,j,!0),this.div.classList.add("disabled"),f(this,se,Oe).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(J){super.focusin(J),this.enableEditMode()}canvasPointerdown(J){J.button!==0||!this.isInEditMode()||c(this,j)||(this.setInForeground(),J.type!=="mouse"&&this.div.focus(),J.stopPropagation(),this.canvas.addEventListener("pointerleave",c(this,F)),this.canvas.addEventListener("pointermove",c(this,x)),f(this,z,Ie).call(this,J.offsetX,J.offsetY))}canvasPointermove(J){J.stopPropagation(),f(this,ee,He).call(this,J.offsetX,J.offsetY)}canvasPointerup(J){J.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(J.stopPropagation(),f(this,ue,T).call(this,J),this.setInBackground())}canvasPointerleave(J){f(this,ue,T).call(this,J),this.setInBackground()}render(){if(this.div)return this.div;let J,pe;this.width&&(J=this.x,pe=this.y),super.render(),re._l10nPromise.get("editor_ink2_aria_label").then(Ge=>{var Xe;return(Xe=this.div)===null||Xe===void 0?void 0:Xe.setAttribute("aria-label",Ge)});const[ke,Re,Be,Ne]=f(this,C,Ce).call(this);if(this.setAt(ke,Re,0,0),this.setDims(Be,Ne),f(this,fe,V).call(this),this.width){const[Ge,Xe]=this.parentDimensions;this.setAt(J*Ge,pe*Xe,this.width*Ge,this.height*Xe),i(this,N,!0),f(this,me,Pe).call(this),this.setDims(this.width*Ge,this.height*Xe),f(this,K,ae).call(this),f(this,ne,$e).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return f(this,ye,de).call(this),this.div}setDimensions(J,pe){const ke=Math.round(J),Re=Math.round(pe);if(c(this,B)===ke&&c(this,ie)===Re)return;i(this,B,ke),i(this,ie,Re),this.canvas.style.visibility="hidden",c(this,S)&&Math.abs(c(this,S)-J/pe)>.01&&(pe=Math.ceil(J/c(this,S)),this.setDims(J,pe));const[Be,Ne]=this.parentDimensions;this.width=J/Be,this.height=pe/Ne,c(this,j)&&f(this,we,De).call(this,J,pe),f(this,me,Pe).call(this),f(this,K,ae).call(this),this.canvas.style.visibility="visible"}static deserialize(J,pe,ke){const Re=super.deserialize(J,pe,ke);Re.thickness=J.thickness,Re.color=p.Util.makeHexColor(...J.color),Re.opacity=J.opacity;const[Be,Ne]=Re.pageDimensions,Ge=Re.width*Be,Xe=Re.height*Ne,ze=Re.parentScale,Ke=J.thickness/2;i(Re,S,Ge/Xe),i(Re,j,!0),i(Re,B,Math.round(Ge)),i(Re,ie,Math.round(Xe));for(const{bezier:Je}of J.paths){const dt=[];Re.paths.push(dt);let ot=ze*(Je[0]-Ke),lt=ze*(Xe-Je[1]-Ke);for(let at=2,yt=Je.length;at{this.thickness=oe,f(this,se,Oe).call(this)},undo:()=>{this.thickness=J,f(this,se,Oe).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function he(oe){const J=this.color;this.addCommands({cmd:()=>{this.color=oe,f(this,K,ae).call(this)},undo:()=>{this.color=J,f(this,K,ae).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function be(oe){oe/=100;const J=this.opacity;this.addCommands({cmd:()=>{this.opacity=oe,f(this,K,ae).call(this)},undo:()=>{this.opacity=J,f(this,K,ae).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Ce(){const{parentRotation:oe,parentDimensions:[J,pe]}=this;switch(oe){case 90:return[0,pe,pe,J];case 180:return[J,pe,J,pe];case 270:return[J,0,pe,J];default:return[0,0,J,pe]}}function Te(){const{ctx:oe,color:J,opacity:pe,thickness:ke,parentScale:Re,scaleFactor:Be}=this;oe.lineWidth=ke*Re/Be,oe.lineCap="round",oe.lineJoin="round",oe.miterLimit=10,oe.strokeStyle=`${J}${(0,k.opacityToHex)(pe)}`}function Ie(oe,J){this.isEditing=!0,c(this,N)||(i(this,N,!0),f(this,me,Pe).call(this),this.thickness||(this.thickness=re._defaultThickness),this.color||(this.color=re._defaultColor||v.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=re._defaultOpacity)),this.currentPath.push([oe,J]),i(this,Q,null),f(this,P,Te).call(this),this.ctx.beginPath(),this.ctx.moveTo(oe,J),i(this,q,()=>{c(this,q)&&(c(this,Q)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):f(this,K,ae).call(this),this.ctx.lineTo(...c(this,Q)),i(this,Q,null),this.ctx.stroke()),window.requestAnimationFrame(c(this,q)))}),window.requestAnimationFrame(c(this,q))}function He(oe,J){const[pe,ke]=this.currentPath.at(-1);oe===pe&&J===ke||(this.currentPath.push([oe,J]),i(this,Q,[oe,J]))}function Ve(oe,J){this.ctx.closePath(),i(this,q,null),oe=Math.min(Math.max(oe,0),this.canvas.width),J=Math.min(Math.max(J,0),this.canvas.height);const[pe,ke]=this.currentPath.at(-1);(oe!==pe||J!==ke)&&this.currentPath.push([oe,J]);let Re;if(this.currentPath.length!==1)Re=(0,I.fitCurve)(this.currentPath,30,null);else{const Xe=[oe,J];Re=[[Xe,Xe.slice(),Xe.slice(),Xe]]}const Be=d(re,re,_e).call(re,Re);this.currentPath.length=0;const Ne=()=>{this.paths.push(Re),this.bezierPath2D.push(Be),this.rebuild()},Ge=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(f(this,fe,V).call(this),f(this,ye,de).call(this)),f(this,se,Oe).call(this))};this.addCommands({cmd:Ne,undo:Ge,mustExec:!0})}function ae(){if(this.isEmpty()){f(this,ge,Fe).call(this);return}f(this,P,Te).call(this);const{canvas:oe,ctx:J}=this;J.setTransform(1,0,0,1,0,0),J.clearRect(0,0,oe.width,oe.height),f(this,ge,Fe).call(this);for(const pe of this.bezierPath2D)J.stroke(pe)}function T(oe){f(this,te,Ve).call(this,oe.offsetX,oe.offsetY),this.canvas.removeEventListener("pointerleave",c(this,F)),this.canvas.removeEventListener("pointermove",c(this,x)),this.addToAnnotationStorage()}function V(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",re._l10nPromise.get("editor_ink_canvas_aria_label").then(oe=>{var J;return(J=this.canvas)===null||J===void 0?void 0:J.setAttribute("aria-label",oe)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function de(){let oe=null;i(this,Y,new ResizeObserver(J=>{const pe=J[0].contentRect;pe.width&&pe.height&&(oe!==null&&clearTimeout(oe),oe=setTimeout(()=>{this.fixDims(),oe=null},g),this.setDimensions(pe.width,pe.height))})),c(this,Y).observe(this.div)}function Pe(){if(!c(this,N))return;const[oe,J]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*oe),this.canvas.height=Math.ceil(this.height*J),f(this,ge,Fe).call(this)}function De(oe,J){const pe=f(this,Z,We).call(this),ke=(oe-pe)/c(this,w),Re=(J-pe)/c(this,D);this.scaleFactor=Math.min(ke,Re)}function Fe(){const oe=f(this,Z,We).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+oe,this.translationY*this.scaleFactor+oe)}function _e(oe){const J=new Path2D;for(let pe=0,ke=oe.length;pe0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!c(this,j)){f(this,K,ae).call(this);return}const J=f(this,U,Ee).call(this),pe=f(this,Z,We).call(this);i(this,w,Math.max(s,J[2]-J[0])),i(this,D,Math.max(s,J[3]-J[1]));const ke=Math.ceil(pe+c(this,w)*this.scaleFactor),Re=Math.ceil(pe+c(this,D)*this.scaleFactor),[Be,Ne]=this.parentDimensions;this.width=ke/Be,this.height=Re/Ne,i(this,S,ke/Re),f(this,ne,$e).call(this);const Ge=this.translationX,Xe=this.translationY;this.translationX=-J[0],this.translationY=-J[1],f(this,me,Pe).call(this),f(this,K,ae).call(this),i(this,B,ke),i(this,ie,Re),this.setDims(ke,Re);const ze=oe?pe/this.scaleFactor/2:0;this.translate(Ge-this.translationX-ze,Xe-this.translationY-ze)}function $e(){const{style:oe}=this.div;c(this,S)>=1?(oe.minHeight=`${s}px`,oe.minWidth=`${Math.round(c(this,S)*s)}px`):(oe.minWidth=`${s}px`,oe.minHeight=`${Math.round(s/c(this,S))}px`)}R(re,"_defaultColor",null),R(re,"_defaultOpacity",1),R(re,"_defaultThickness",1),R(re,"_l10nPromise",void 0),R(re,"_type","ink")},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.fitCurve=void 0;const p=l(163);E.fitCurve=p},W=>{function E(r,i,o){if(!Array.isArray(r))throw new TypeError("First argument should be an array");if(r.forEach(f=>{if(!Array.isArray(f)||f.some(s=>typeof s!="number")||f.length!==r[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),r=r.filter((f,s)=>s===0||!f.every((g,S)=>g===r[s-1][S])),r.length<2)return[];const c=r.length,b=h(r[1],r[0]),y=h(r[c-2],r[c-1]);return l(r,b,y,i,o)}function l(r,i,o,c,b){var f,s,g,S,D,w,x,F,X,G,j,N,Q;if(r.length===2)return N=a.vectorLen(a.subtract(r[0],r[1]))/3,f=[r[0],a.addArrays(r[0],a.mulItems(i,N)),a.addArrays(r[1],a.mulItems(o,N)),r[1]],[f];if(s=m(r),[f,S,w]=p(r,s,s,i,o,b),S===0||S.9999&&Y<1.0001)break}D=S,x=w}return j=[],F=a.subtract(r[w-1],r[w+1]),F.every(Y=>Y===0)&&(F=a.subtract(r[w-1],r[w]),[F[0],F[1]]=[-F[1],F[0]]),X=a.normalize(F),G=a.mulItems(X,-1),j=j.concat(l(r.slice(0,w+1),i,X,c,b)),j=j.concat(l(r.slice(w),G,o,c,b)),j}function p(r,i,o,c,b,y){var f,s,g;return f=v(r,o,c,b),[s,g]=R(r,f,i),y&&y({bez:f,points:r,params:i,maxErr:s,maxPoint:g}),[f,s,g]}function v(r,i,o,c){var b,y,f,s,g,S,D,w,x,F,X,G,j,N,Q,Y,B,ie=r[0],q=r[r.length-1];for(b=[ie,null,null,q],y=a.zeros_Xx2x2(i.length),j=0,N=i.length;jk(r,i[b],c))}function k(r,i,o){var c=a.subtract(d.q(r,o),i),b=d.qprime(r,o),y=a.mulMatrix(c,b),f=a.sum(a.squareItems(b))+2*a.mulMatrix(c,d.qprimeprime(r,o));return f===0?o:o-y/f}function m(r){var i=[],o,c,b;return r.forEach((y,f)=>{o=f?c+a.vectorLen(a.subtract(y,b)):0,i.push(o),c=o,b=y}),i=i.map(y=>y/c),i}function R(r,i,o){var c,b,y,f,s,g,S,D;b=0,y=Math.floor(r.length/2);const w=t(i,10);for(s=0,g=r.length;sb&&(b=c,y=s);return[b,y]}var t=function(r,i){for(var o,c=[0],b=r[0],y=0,f=1;f<=i;f++)o=d.q(r,f/i),y+=a.vectorLen(a.subtract(o,b)),c.push(y),b=o;return c=c.map(s=>s/y),c};function n(r,i,o,c){if(i<0)return 0;if(i>1)return 1;for(var b,y,f,s,g,S=1;S<=c;S++)if(i<=o[S]){s=(S-1)/c,f=S/c,y=o[S-1],b=o[S],g=(i-y)/(b-y)*(f-s)+s;break}return g}function h(r,i){return a.normalize(a.subtract(r,i))}class a{static zeros_Xx2x2(i){for(var o=[];i--;)o.push([0,0]);return o}static mulItems(i,o){return i.map(c=>c*o)}static mulMatrix(i,o){return i.reduce((c,b,y)=>c+b*o[y],0)}static subtract(i,o){return i.map((c,b)=>c-o[b])}static addArrays(i,o){return i.map((c,b)=>c+o[b])}static addItems(i,o){return i.map(c=>c+o)}static sum(i){return i.reduce((o,c)=>o+c)}static dot(i,o){return a.mulMatrix(i,o)}static vectorLen(i){return Math.hypot(...i)}static divItems(i,o){return i.map(c=>c/o)}static squareItems(i){return i.map(o=>o*o)}static normalize(i){return this.divItems(i,this.vectorLen(i))}}class d{static q(i,o){var c=1-o,b=a.mulItems(i[0],c*c*c),y=a.mulItems(i[1],3*c*c*o),f=a.mulItems(i[2],3*c*o*o),s=a.mulItems(i[3],o*o*o);return a.addArrays(a.addArrays(b,y),a.addArrays(f,s))}static qprime(i,o){var c=1-o,b=a.mulItems(a.subtract(i[1],i[0]),3*c*c),y=a.mulItems(a.subtract(i[2],i[1]),6*c*o),f=a.mulItems(a.subtract(i[3],i[2]),3*o*o);return a.addArrays(a.addArrays(b,y),f)}static qprimeprime(i,o){return a.addArrays(a.mulItems(a.addArrays(a.subtract(i[2],a.mulItems(i[1],2)),i[0]),6*(1-o)),a.mulItems(a.addArrays(a.subtract(i[3],a.mulItems(i[2],2)),i[1]),6*o))}}W.exports=E,W.exports.fitCubic=l,W.exports.createTangent=h},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.AnnotationLayer=void 0;var p=l(1),v=l(139),I=l(136),k=l(165),m=l(166);function R(ge,A,O){return t(ge,A),O}function t(ge,A){if(ge!==A)throw new TypeError("Private static access of wrong provenance")}function n(ge,A){h(ge,A),A.add(ge)}function h(ge,A){if(A.has(ge))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(ge,A,O){if(!A.has(ge))throw new TypeError("attempted to get private field on non-instance");return O}const d=1e3,r=9,i=new WeakSet;function o(ge){return{width:ge[2]-ge[0],height:ge[3]-ge[1]}}class c{static create(A){switch(A.data.annotationType){case p.AnnotationType.LINK:return new s(A);case p.AnnotationType.TEXT:return new D(A);case p.AnnotationType.WIDGET:switch(A.data.fieldType){case"Tx":return new x(A);case"Btn":return A.data.radioButton?new X(A):A.data.checkBox?new F(A):new G(A);case"Ch":return new j(A)}return new w(A);case p.AnnotationType.POPUP:return new N(A);case p.AnnotationType.FREETEXT:return new Y(A);case p.AnnotationType.LINE:return new B(A);case p.AnnotationType.SQUARE:return new ie(A);case p.AnnotationType.CIRCLE:return new q(A);case p.AnnotationType.POLYLINE:return new _(A);case p.AnnotationType.CARET:return new $(A);case p.AnnotationType.INK:return new C(A);case p.AnnotationType.POLYGON:return new H(A);case p.AnnotationType.HIGHLIGHT:return new P(A);case p.AnnotationType.UNDERLINE:return new z(A);case p.AnnotationType.SQUIGGLY:return new ee(A);case p.AnnotationType.STRIKEOUT:return new te(A);case p.AnnotationType.STAMP:return new K(A);case p.AnnotationType.FILEATTACHMENT:return new ue(A);default:return new b(A)}}}class b{constructor(A){let{isRenderable:O=!1,ignoreBorder:M=!1,createQuadrilaterals:U=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=O,this.data=A.data,this.layer=A.layer,this.page=A.page,this.viewport=A.viewport,this.linkService=A.linkService,this.downloadManager=A.downloadManager,this.imageResourcesPath=A.imageResourcesPath,this.renderForms=A.renderForms,this.svgFactory=A.svgFactory,this.annotationStorage=A.annotationStorage,this.enableScripting=A.enableScripting,this.hasJSActions=A.hasJSActions,this._fieldObjects=A.fieldObjects,O&&(this.container=this._createContainer(M)),U&&(this.quadrilaterals=this._createQuadrilaterals(M))}_createContainer(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{data:O,page:M,viewport:U}=this,Z=document.createElement("section");Z.setAttribute("data-annotation-id",O.id);const{pageWidth:se,pageHeight:ne,pageX:re,pageY:ve}=U.rawDims,{width:he,height:be}=o(O.rect),Ce=p.Util.normalizeRect([O.rect[0],M.view[3]-O.rect[1]+M.view[1],O.rect[2],M.view[3]-O.rect[3]+M.view[1]]);if(!A&&O.borderStyle.width>0){Z.style.borderWidth=`${O.borderStyle.width}px`;const Ie=O.borderStyle.horizontalCornerRadius,He=O.borderStyle.verticalCornerRadius;if(Ie>0||He>0){const ae=`calc(${Ie}px * var(--scale-factor)) / calc(${He}px * var(--scale-factor))`;Z.style.borderRadius=ae}else if(this instanceof X){const ae=`calc(${he}px * var(--scale-factor)) / calc(${be}px * var(--scale-factor))`;Z.style.borderRadius=ae}switch(O.borderStyle.style){case p.AnnotationBorderStyleType.SOLID:Z.style.borderStyle="solid";break;case p.AnnotationBorderStyleType.DASHED:Z.style.borderStyle="dashed";break;case p.AnnotationBorderStyleType.BEVELED:(0,p.warn)("Unimplemented border style: beveled");break;case p.AnnotationBorderStyleType.INSET:(0,p.warn)("Unimplemented border style: inset");break;case p.AnnotationBorderStyleType.UNDERLINE:Z.style.borderBottomStyle="solid";break}const Ve=O.borderColor||null;Ve?Z.style.borderColor=p.Util.makeHexColor(Ve[0]|0,Ve[1]|0,Ve[2]|0):Z.style.borderWidth=0}Z.style.left=`${100*(Ce[0]-re)/se}%`,Z.style.top=`${100*(Ce[1]-ve)/ne}%`;const{rotation:Te}=O;return O.hasOwnCanvas||Te===0?(Z.style.width=`${100*he/se}%`,Z.style.height=`${100*be/ne}%`):this.setRotation(Te,Z),Z}setRotation(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.container;const{pageWidth:M,pageHeight:U}=this.viewport.rawDims,{width:Z,height:se}=o(this.data.rect);let ne,re;A%180===0?(ne=100*Z/M,re=100*se/U):(ne=100*se/M,re=100*Z/U),O.style.width=`${ne}%`,O.style.height=`${re}%`,O.setAttribute("data-main-rotation",(360-A)%360)}get _commonActions(){const A=(O,M,U)=>{const Z=U.detail[O];U.target.style[M]=k.ColorConverters[`${Z[0]}_HTML`](Z.slice(1))};return(0,p.shadow)(this,"_commonActions",{display:O=>{const M=O.detail.display%2===1;this.container.style.visibility=M?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:M,print:O.detail.display===0||O.detail.display===3})},print:O=>{this.annotationStorage.setValue(this.data.id,{print:O.detail.print})},hidden:O=>{this.container.style.visibility=O.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:O.detail.hidden})},focus:O=>{setTimeout(()=>O.target.focus({preventScroll:!1}),0)},userName:O=>{O.target.title=O.detail.userName},readonly:O=>{O.detail.readonly?O.target.setAttribute("readonly",""):O.target.removeAttribute("readonly")},required:O=>{this._setRequired(O.target,O.detail.required)},bgColor:O=>{A("bgColor","backgroundColor",O)},fillColor:O=>{A("fillColor","backgroundColor",O)},fgColor:O=>{A("fgColor","color",O)},textColor:O=>{A("textColor","color",O)},borderColor:O=>{A("borderColor","borderColor",O)},strokeColor:O=>{A("strokeColor","borderColor",O)},rotation:O=>{const M=O.detail.rotation;this.setRotation(M),this.annotationStorage.setValue(this.data.id,{rotation:M})}})}_dispatchEventFromSandbox(A,O){const M=this._commonActions;for(const U of Object.keys(O.detail)){const Z=A[U]||M[U];Z==null||Z(O)}}_setDefaultPropertiesFromJS(A){if(!this.enableScripting)return;const O=this.annotationStorage.getRawValue(this.data.id);if(!O)return;const M=this._commonActions;for(const[U,Z]of Object.entries(O)){const se=M[U];if(se){const ne={detail:{[U]:Z},target:A};se(ne),delete O[U]}}}_createQuadrilaterals(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.data.quadPoints)return null;const O=[],M=this.data.rect;for(const U of this.data.quadPoints)this.data.rect=[U[2].x,U[2].y,U[1].x,U[1].y],O.push(this._createContainer(A));return this.data.rect=M,O}_createPopup(A,O){let M=this.container;this.quadrilaterals&&(A=A||this.quadrilaterals,M=this.quadrilaterals[0]),A||(A=document.createElement("div"),A.className="popupTriggerArea",M.append(A));const Z=new Q({container:M,trigger:A,color:O.color,titleObj:O.titleObj,modificationDate:O.modificationDate,contentsObj:O.contentsObj,richText:O.richText,hideWrapper:!0}).render();Z.style.left="100%",M.append(Z)}_renderQuadrilaterals(A){for(const O of this.quadrilaterals)O.className=A;return this.quadrilaterals}render(){(0,p.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const M=[];if(this._fieldObjects){const U=this._fieldObjects[A];if(U)for(const{page:Z,id:se,exportValues:ne}of U){if(Z===-1||se===O)continue;const re=typeof ne=="string"?ne:null,ve=document.querySelector(`[data-element-id="${se}"]`);if(ve&&!i.has(ve)){(0,p.warn)(`_getElementsByName - element not allowed: ${se}`);continue}M.push({id:se,exportValue:re,domElement:ve})}return M}for(const U of document.getElementsByName(A)){const{exportValue:Z}=U,se=U.getAttribute("data-element-id");se!==O&&i.has(U)&&M.push({id:se,exportValue:Z,domElement:U})}return M}}var y=new WeakSet,f=new WeakSet;class s extends b{constructor(A){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(A,{isRenderable:!0,ignoreBorder:!!(O!=null&&O.ignoreBorder),createQuadrilaterals:!0}),n(this,f),n(this,y),this.isTooltipOnly=A.data.isTooltipOnly}render(){const{data:A,linkService:O}=this,M=document.createElement("a");M.setAttribute("data-element-id",A.id);let U=!1;return A.url?(O.addLinkAttributes(M,A.url,A.newWindow),U=!0):A.action?(this._bindNamedAction(M,A.action),U=!0):A.attachment?(this._bindAttachment(M,A.attachment),U=!0):A.setOCGState?(a(this,f,S).call(this,M,A.setOCGState),U=!0):A.dest?(this._bindLink(M,A.dest),U=!0):(A.actions&&(A.actions.Action||A.actions["Mouse Up"]||A.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(M,A),U=!0),A.resetForm?(this._bindResetFormAction(M,A.resetForm),U=!0):this.isTooltipOnly&&!U&&(this._bindLink(M,""),U=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((Z,se)=>{const ne=se===0?M:M.cloneNode();return Z.append(ne),Z}):(this.container.className="linkAnnotation",U&&this.container.append(M),this.container)}_bindLink(A,O){A.href=this.linkService.getDestinationHash(O),A.onclick=()=>(O&&this.linkService.goToDestination(O),!1),(O||O==="")&&a(this,y,g).call(this)}_bindNamedAction(A,O){A.href=this.linkService.getAnchorUrl(""),A.onclick=()=>(this.linkService.executeNamedAction(O),!1),a(this,y,g).call(this)}_bindAttachment(A,O){A.href=this.linkService.getAnchorUrl(""),A.onclick=()=>{var M;return(M=this.downloadManager)===null||M===void 0||M.openOrDownloadData(this.container,O.content,O.filename),!1},a(this,y,g).call(this)}_bindJSAction(A,O){A.href=this.linkService.getAnchorUrl("");const M=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const U of Object.keys(O.actions)){const Z=M.get(U);Z&&(A[Z]=()=>{var se;return(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O.id,name:U}}),!1})}A.onclick||(A.onclick=()=>!1),a(this,y,g).call(this)}_bindResetFormAction(A,O){const M=A.onclick;if(M||(A.href=this.linkService.getAnchorUrl("")),a(this,y,g).call(this),!this._fieldObjects){(0,p.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),M||(A.onclick=()=>!1);return}A.onclick=()=>{M==null||M();const{fields:U,refs:Z,include:se}=O,ne=[];if(U.length!==0||Z.length!==0){const be=new Set(Z);for(const Ce of U){const Te=this._fieldObjects[Ce]||[];for(const{id:Ie}of Te)be.add(Ie)}for(const Ce of Object.values(this._fieldObjects))for(const Te of Ce)be.has(Te.id)===se&&ne.push(Te)}else for(const be of Object.values(this._fieldObjects))ne.push(...be);const re=this.annotationStorage,ve=[];for(const be of ne){const{id:Ce}=be;switch(ve.push(Ce),be.type){case"text":{const Ie=be.defaultValue||"";re.setValue(Ce,{value:Ie});break}case"checkbox":case"radiobutton":{const Ie=be.defaultValue===be.exportValues;re.setValue(Ce,{value:Ie});break}case"combobox":case"listbox":{const Ie=be.defaultValue||"";re.setValue(Ce,{value:Ie});break}default:continue}const Te=document.querySelector(`[data-element-id="${Ce}"]`);if(Te){if(!i.has(Te)){(0,p.warn)(`_bindResetFormAction - element not allowed: ${Ce}`);continue}}else continue;Te.dispatchEvent(new Event("resetform"))}if(this.enableScripting){var he;(he=this.linkService.eventBus)===null||he===void 0||he.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:ve,name:"ResetForm"}})}return!1}}}function g(){this.container.setAttribute("data-internal-link","")}function S(ge,A){ge.href=this.linkService.getAnchorUrl(""),ge.onclick=()=>(this.linkService.executeSetOCGState(A),!1),a(this,y,g).call(this)}class D extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z})}render(){this.container.className="textAnnotation";const A=document.createElement("img");return A.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",A.alt="[{{type}} Annotation]",A.dataset.l10nId="text_annotation_type",A.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(A,this.data),this.container.append(A),this.container}}class w extends b{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(A){const{isWin:O,isMac:M}=p.FeatureTest.platform;return O&&A.ctrlKey||M&&A.metaKey}_setEventListener(A,O,M,U){O.includes("mouse")?A.addEventListener(O,Z=>{var se;(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:U(Z),shift:Z.shiftKey,modifier:this._getKeyModifier(Z)}})}):A.addEventListener(O,Z=>{var se;(se=this.linkService.eventBus)===null||se===void 0||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:U(Z)}})})}_setEventListeners(A,O,M){for(const[Z,se]of O){var U;(se==="Action"||(U=this.data.actions)!==null&&U!==void 0&&U[se])&&this._setEventListener(A,Z,se,M)}}_setBackgroundColor(A){const O=this.data.backgroundColor||null;A.style.backgroundColor=O===null?"transparent":p.Util.makeHexColor(O[0],O[1],O[2])}_setTextStyle(A){const O=["left","center","right"],{fontColor:M}=this.data.defaultAppearanceData,U=this.data.defaultAppearanceData.fontSize||r,Z=A.style;let se;const ne=2,re=ve=>Math.round(10*ve)/10;if(this.data.multiLine){const ve=Math.abs(this.data.rect[3]-this.data.rect[1]-ne),he=Math.round(ve/(p.LINE_FACTOR*U))||1,be=ve/he;se=Math.min(U,re(be/p.LINE_FACTOR))}else{const ve=Math.abs(this.data.rect[3]-this.data.rect[1]-ne);se=Math.min(U,re(ve/p.LINE_FACTOR))}Z.fontSize=`calc(${se}px * var(--scale-factor))`,Z.color=p.Util.makeHexColor(M[0],M[1],M[2]),this.data.textAlignment!==null&&(Z.textAlign=O[this.data.textAlignment])}_setRequired(A,O){O?A.setAttribute("required",!0):A.removeAttribute("required"),A.setAttribute("aria-required",O)}}class x extends w{constructor(A){const O=A.renderForms||!A.data.hasAppearance&&!!A.data.fieldValue;super(A,{isRenderable:O})}setPropertyOnSiblings(A,O,M,U){const Z=this.annotationStorage;for(const se of this._getElementsByName(A.name,A.id))se.domElement&&(se.domElement[O]=M),Z.setValue(se.id,{[U]:M})}render(){const A=this.annotationStorage,O=this.data.id;this.container.className="textWidgetAnnotation";let M=null;if(this.renderForms){const Z=A.getValue(O,{value:this.data.fieldValue});let se=Z.formattedValue||Z.value||"";const ne=A.getValue(O,{charLimit:this.data.maxLen}).charLimit;ne&&se.length>ne&&(se=se.slice(0,ne));const re={userValue:se,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(M=document.createElement("textarea"),M.textContent=se,this.data.doNotScroll&&(M.style.overflowY="hidden")):(M=document.createElement("input"),M.type="text",M.setAttribute("value",se),this.data.doNotScroll&&(M.style.overflowX="hidden")),i.add(M),M.setAttribute("data-element-id",O),M.disabled=this.data.readOnly,M.name=this.data.fieldName,M.tabIndex=d,this._setRequired(M,this.data.required),ne&&(M.maxLength=ne),M.addEventListener("input",he=>{A.setValue(O,{value:he.target.value}),this.setPropertyOnSiblings(M,"value",he.target.value,"value")}),M.addEventListener("resetform",he=>{const be=this.data.defaultFieldValue??"";M.value=re.userValue=be,re.formattedValue=null});let ve=he=>{const{formattedValue:be}=re;be!=null&&(he.target.value=be),he.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var U;M.addEventListener("focus",be=>{const{target:Ce}=be;re.userValue&&(Ce.value=re.userValue),re.lastCommittedValue=Ce.value,re.commitKey=1}),M.addEventListener("updatefromsandbox",be=>{const Ce={value(Te){re.userValue=Te.detail.value??"",A.setValue(O,{value:re.userValue.toString()}),Te.target.value=re.userValue},formattedValue(Te){const{formattedValue:Ie}=Te.detail;re.formattedValue=Ie,Ie!=null&&Te.target!==document.activeElement&&(Te.target.value=Ie),A.setValue(O,{formattedValue:Ie})},selRange(Te){Te.target.setSelectionRange(...Te.detail.selRange)},charLimit:Te=>{var Ie;const{charLimit:He}=Te.detail,{target:Ve}=Te;if(He===0){Ve.removeAttribute("maxLength");return}Ve.setAttribute("maxLength",He);let ae=re.userValue;!ae||ae.length<=He||(ae=ae.slice(0,He),Ve.value=re.userValue=ae,A.setValue(O,{value:ae}),(Ie=this.linkService.eventBus)===null||Ie===void 0||Ie.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:ae,willCommit:!0,commitKey:1,selStart:Ve.selectionStart,selEnd:Ve.selectionEnd}}))}};this._dispatchEventFromSandbox(Ce,be)}),M.addEventListener("keydown",be=>{var Ce;re.commitKey=1;let Te=-1;if(be.key==="Escape"?Te=0:be.key==="Enter"&&!this.data.multiLine?Te=2:be.key==="Tab"&&(re.commitKey=3),Te===-1)return;const{value:Ie}=be.target;re.lastCommittedValue!==Ie&&(re.lastCommittedValue=Ie,re.userValue=Ie,(Ce=this.linkService.eventBus)===null||Ce===void 0||Ce.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:Ie,willCommit:!0,commitKey:Te,selStart:be.target.selectionStart,selEnd:be.target.selectionEnd}}))});const he=ve;ve=null,M.addEventListener("blur",be=>{if(!be.relatedTarget)return;const{value:Ce}=be.target;if(re.userValue=Ce,re.lastCommittedValue!==Ce){var Te;(Te=this.linkService.eventBus)===null||Te===void 0||Te.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:Ce,willCommit:!0,commitKey:re.commitKey,selStart:be.target.selectionStart,selEnd:be.target.selectionEnd}})}he(be)}),(U=this.data.actions)!==null&&U!==void 0&&U.Keystroke&&M.addEventListener("beforeinput",be=>{var Ce;re.lastCommittedValue=null;const{data:Te,target:Ie}=be,{value:He,selectionStart:Ve,selectionEnd:ae}=Ie;let T=Ve,V=ae;switch(be.inputType){case"deleteWordBackward":{const de=He.substring(0,Ve).match(/\w*[^\w]*$/);de&&(T-=de[0].length);break}case"deleteWordForward":{const de=He.substring(Ve).match(/^[^\w]*\w*/);de&&(V+=de[0].length);break}case"deleteContentBackward":Ve===ae&&(T-=1);break;case"deleteContentForward":Ve===ae&&(V+=1);break}be.preventDefault(),(Ce=this.linkService.eventBus)===null||Ce===void 0||Ce.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:He,change:Te||"",willCommit:!1,selStart:T,selEnd:V}})}),this._setEventListeners(M,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],be=>be.target.value)}if(ve&&M.addEventListener("blur",ve),this.data.comb){const be=(this.data.rect[2]-this.data.rect[0])/ne;M.classList.add("comb"),M.style.letterSpacing=`calc(${be}px * var(--scale-factor) - 1ch)`}}else M=document.createElement("div"),M.textContent=this.data.fieldValue,M.style.verticalAlign="middle",M.style.display="table-cell";return this._setTextStyle(M),this._setBackgroundColor(M),this._setDefaultPropertiesFromJS(M),this.container.append(M),this.container}}class F extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){const A=this.annotationStorage,O=this.data,M=O.id;let U=A.getValue(M,{value:O.exportValue===O.fieldValue}).value;typeof U=="string"&&(U=U!=="Off",A.setValue(M,{value:U})),this.container.className="buttonWidgetAnnotation checkBox";const Z=document.createElement("input");return i.add(Z),Z.setAttribute("data-element-id",M),Z.disabled=O.readOnly,this._setRequired(Z,this.data.required),Z.type="checkbox",Z.name=O.fieldName,U&&Z.setAttribute("checked",!0),Z.setAttribute("exportValue",O.exportValue),Z.tabIndex=d,Z.addEventListener("change",se=>{const{name:ne,checked:re}=se.target;for(const ve of this._getElementsByName(ne,M)){const he=re&&ve.exportValue===O.exportValue;ve.domElement&&(ve.domElement.checked=he),A.setValue(ve.id,{value:he})}A.setValue(M,{value:re})}),Z.addEventListener("resetform",se=>{const ne=O.defaultFieldValue||"Off";se.target.checked=ne===O.exportValue}),this.enableScripting&&this.hasJSActions&&(Z.addEventListener("updatefromsandbox",se=>{const ne={value(re){re.target.checked=re.detail.value!=="Off",A.setValue(M,{value:re.target.checked})}};this._dispatchEventFromSandbox(ne,se)}),this._setEventListeners(Z,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],se=>se.target.checked)),this._setBackgroundColor(Z),this._setDefaultPropertiesFromJS(Z),this.container.append(Z),this.container}}class X extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const A=this.annotationStorage,O=this.data,M=O.id;let U=A.getValue(M,{value:O.fieldValue===O.buttonValue}).value;typeof U=="string"&&(U=U!==O.buttonValue,A.setValue(M,{value:U}));const Z=document.createElement("input");if(i.add(Z),Z.setAttribute("data-element-id",M),Z.disabled=O.readOnly,this._setRequired(Z,this.data.required),Z.type="radio",Z.name=O.fieldName,U&&Z.setAttribute("checked",!0),Z.tabIndex=d,Z.addEventListener("change",se=>{const{name:ne,checked:re}=se.target;for(const ve of this._getElementsByName(ne,M))A.setValue(ve.id,{value:!1});A.setValue(M,{value:re})}),Z.addEventListener("resetform",se=>{const ne=O.defaultFieldValue;se.target.checked=ne!=null&&ne===O.buttonValue}),this.enableScripting&&this.hasJSActions){const se=O.buttonValue;Z.addEventListener("updatefromsandbox",ne=>{const re={value:ve=>{const he=se===ve.detail.value;for(const be of this._getElementsByName(ve.target.name)){const Ce=he&&be.id===M;be.domElement&&(be.domElement.checked=Ce),A.setValue(be.id,{value:Ce})}}};this._dispatchEventFromSandbox(re,ne)}),this._setEventListeners(Z,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ne=>ne.target.checked)}return this._setBackgroundColor(Z),this._setDefaultPropertiesFromJS(Z),this.container.append(Z),this.container}}class G extends s{constructor(A){super(A,{ignoreBorder:A.data.hasAppearance})}render(){const A=super.render();A.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(A.title=this.data.alternativeText);const O=A.lastChild;return this.enableScripting&&this.hasJSActions&&O&&(this._setDefaultPropertiesFromJS(O),O.addEventListener("updatefromsandbox",M=>{this._dispatchEventFromSandbox({},M)})),A}}class j extends w{constructor(A){super(A,{isRenderable:A.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const A=this.annotationStorage,O=this.data.id,M=A.getValue(O,{value:this.data.fieldValue}),U=document.createElement("select");i.add(U),U.setAttribute("data-element-id",O),U.disabled=this.data.readOnly,this._setRequired(U,this.data.required),U.name=this.data.fieldName,U.tabIndex=d;let Z=this.data.combo&&this.data.options.length>0;this.data.combo||(U.size=this.data.options.length,this.data.multiSelect&&(U.multiple=!0)),U.addEventListener("resetform",he=>{const be=this.data.defaultFieldValue;for(const Ce of U.options)Ce.selected=Ce.value===be});for(const he of this.data.options){const be=document.createElement("option");be.textContent=he.displayValue,be.value=he.exportValue,M.value.includes(he.exportValue)&&(be.setAttribute("selected",!0),Z=!1),U.append(be)}let se=null;if(Z){const he=document.createElement("option");he.value=" ",he.setAttribute("hidden",!0),he.setAttribute("selected",!0),U.prepend(he),se=()=>{he.remove(),U.removeEventListener("input",se),se=null},U.addEventListener("input",se)}const ne=he=>{const be=he?"value":"textContent",{options:Ce,multiple:Te}=U;return Te?Array.prototype.filter.call(Ce,Ie=>Ie.selected).map(Ie=>Ie[be]):Ce.selectedIndex===-1?null:Ce[Ce.selectedIndex][be]};let re=ne(!1);const ve=he=>{const be=he.target.options;return Array.prototype.map.call(be,Ce=>({displayValue:Ce.textContent,exportValue:Ce.value}))};return this.enableScripting&&this.hasJSActions?(U.addEventListener("updatefromsandbox",he=>{const be={value(Ce){var Te;(Te=se)===null||Te===void 0||Te();const Ie=Ce.detail.value,He=new Set(Array.isArray(Ie)?Ie:[Ie]);for(const Ve of U.options)Ve.selected=He.has(Ve.value);A.setValue(O,{value:ne(!0)}),re=ne(!1)},multipleSelection(Ce){U.multiple=!0},remove(Ce){const Te=U.options,Ie=Ce.detail.remove;Te[Ie].selected=!1,U.remove(Ie),Te.length>0&&Array.prototype.findIndex.call(Te,Ve=>Ve.selected)===-1&&(Te[0].selected=!0),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},clear(Ce){for(;U.length!==0;)U.remove(0);A.setValue(O,{value:null,items:[]}),re=ne(!1)},insert(Ce){const{index:Te,displayValue:Ie,exportValue:He}=Ce.detail.insert,Ve=U.children[Te],ae=document.createElement("option");ae.textContent=Ie,ae.value=He,Ve?Ve.before(ae):U.append(ae),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},items(Ce){const{items:Te}=Ce.detail;for(;U.length!==0;)U.remove(0);for(const Ie of Te){const{displayValue:He,exportValue:Ve}=Ie,ae=document.createElement("option");ae.textContent=He,ae.value=Ve,U.append(ae)}U.options.length>0&&(U.options[0].selected=!0),A.setValue(O,{value:ne(!0),items:ve(Ce)}),re=ne(!1)},indices(Ce){const Te=new Set(Ce.detail.indices);for(const Ie of Ce.target.options)Ie.selected=Te.has(Ie.index);A.setValue(O,{value:ne(!0)}),re=ne(!1)},editable(Ce){Ce.target.disabled=!Ce.detail.editable}};this._dispatchEventFromSandbox(be,he)}),U.addEventListener("input",he=>{var be;const Ce=ne(!0);A.setValue(O,{value:Ce}),he.preventDefault(),(be=this.linkService.eventBus)===null||be===void 0||be.dispatch("dispatcheventinsandbox",{source:this,detail:{id:O,name:"Keystroke",value:re,changeEx:Ce,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(U,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],he=>he.target.value)):U.addEventListener("input",function(he){A.setValue(O,{value:ne(!0)})}),this.data.combo&&this._setTextStyle(U),this._setBackgroundColor(U),this._setDefaultPropertiesFromJS(U),this.container.append(U),this.container}}const we=class extends b{constructor(A){var O,M,U;const{data:Z}=A,se=!we.IGNORE_TYPES.has(Z.parentType)&&!!((O=Z.titleObj)!==null&&O!==void 0&&O.str||(M=Z.contentsObj)!==null&&M!==void 0&&M.str||(U=Z.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:se})}render(){this.container.className="popupAnnotation";const A=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(A.length===0)return this.container;const O=new Q({container:this.container,trigger:Array.from(A),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),M=this.page,U=p.Util.normalizeRect([this.data.parentRect[0],M.view[3]-this.data.parentRect[1]+M.view[1],this.data.parentRect[2],M.view[3]-this.data.parentRect[3]+M.view[1]]),Z=U[0]+this.data.parentRect[2]-this.data.parentRect[0],se=U[1],{pageWidth:ne,pageHeight:re,pageX:ve,pageY:he}=this.viewport.rawDims;return this.container.style.left=`${100*(Z-ve)/ne}%`,this.container.style.top=`${100*(se-he)/re}%`,this.container.append(O.render()),this.container}};let N=we;Et(N,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));class Q{constructor(A){this.container=A.container,this.trigger=A.trigger,this.color=A.color,this.titleObj=A.titleObj,this.modificationDate=A.modificationDate,this.contentsObj=A.contentsObj,this.richText=A.richText,this.hideWrapper=A.hideWrapper||!1,this.pinned=!1}render(){var A,O;const U=document.createElement("div");U.className="popupWrapper",this.hideElement=this.hideWrapper?U:this.container,this.hideElement.hidden=!0;const Z=document.createElement("div");Z.className="popup";const se=this.color;if(se){const ve=.7*(255-se[0])+se[0],he=.7*(255-se[1])+se[1],be=.7*(255-se[2])+se[2];Z.style.backgroundColor=p.Util.makeHexColor(ve|0,he|0,be|0)}const ne=document.createElement("h1");ne.dir=this.titleObj.dir,ne.textContent=this.titleObj.str,Z.append(ne);const re=v.PDFDateString.toDateObject(this.modificationDate);if(re){const ve=document.createElement("span");ve.className="popupDate",ve.textContent="{{date}}, {{time}}",ve.dataset.l10nId="annotation_date_string",ve.dataset.l10nArgs=JSON.stringify({date:re.toLocaleDateString(),time:re.toLocaleTimeString()}),Z.append(ve)}if((A=this.richText)!==null&&A!==void 0&&A.str&&(!((O=this.contentsObj)!==null&&O!==void 0&&O.str)||this.contentsObj.str===this.richText.str))m.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:Z}),Z.lastChild.className="richText popupContent";else{const ve=this._formatContents(this.contentsObj);Z.append(ve)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const ve of this.trigger)ve.addEventListener("click",this._toggle.bind(this)),ve.addEventListener("mouseover",this._show.bind(this,!1)),ve.addEventListener("mouseout",this._hide.bind(this,!1));return Z.addEventListener("click",this._hide.bind(this,!0)),U.append(Z),U}_formatContents(A){let{str:O,dir:M}=A;const U=document.createElement("p");U.className="popupContent",U.dir=M;const Z=O.split(/(?:\r\n?|\n)/);for(let se=0,ne=Z.length;se0&&arguments[0]!==void 0?arguments[0]:!1)&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class Y extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.textContent=A.data.textContent}render(){if(this.container.className="freeTextAnnotation",this.textContent){const A=document.createElement("div");A.className="annotationTextContent",A.setAttribute("role","comment");for(const O of this.textContent){const M=document.createElement("span");M.textContent=O,A.append(M)}this.container.append(A)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class B extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=this.svgFactory.createElement("svg:line");return Z.setAttribute("x1",A.rect[2]-A.lineCoordinates[0]),Z.setAttribute("y1",A.rect[3]-A.lineCoordinates[1]),Z.setAttribute("x2",A.rect[2]-A.lineCoordinates[2]),Z.setAttribute("y2",A.rect[3]-A.lineCoordinates[3]),Z.setAttribute("stroke-width",A.borderStyle.width||1),Z.setAttribute("stroke","transparent"),Z.setAttribute("fill","transparent"),U.append(Z),this.container.append(U),this._createPopup(Z,A),this.container}}class ie extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=A.borderStyle.width,se=this.svgFactory.createElement("svg:rect");return se.setAttribute("x",Z/2),se.setAttribute("y",Z/2),se.setAttribute("width",O-Z),se.setAttribute("height",M-Z),se.setAttribute("stroke-width",Z||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class q extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0),Z=A.borderStyle.width,se=this.svgFactory.createElement("svg:ellipse");return se.setAttribute("cx",O/2),se.setAttribute("cy",M/2),se.setAttribute("rx",O/2-Z/2),se.setAttribute("ry",M/2-Z/2),se.setAttribute("stroke-width",Z||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class _ extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0);let Z=[];for(const ne of A.vertices){const re=ne.x-A.rect[0],ve=A.rect[3]-ne.y;Z.push(re+","+ve)}Z=Z.join(" ");const se=this.svgFactory.createElement(this.svgElementName);return se.setAttribute("points",Z),se.setAttribute("stroke-width",A.borderStyle.width||1),se.setAttribute("stroke","transparent"),se.setAttribute("fill","transparent"),U.append(se),this.container.append(U),this._createPopup(se,A),this.container}}class H extends _{constructor(A){super(A),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class $ extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class C extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const A=this.data,{width:O,height:M}=o(A.rect),U=this.svgFactory.create(O,M,!0);for(const Z of A.inkLists){let se=[];for(const re of Z){const ve=re.x-A.rect[0],he=A.rect[3]-re.y;se.push(`${ve},${he}`)}se=se.join(" ");const ne=this.svgFactory.createElement(this.svgElementName);ne.setAttribute("points",se),ne.setAttribute("stroke-width",A.borderStyle.width||1),ne.setAttribute("stroke","transparent"),ne.setAttribute("fill","transparent"),this._createPopup(ne,A),U.append(ne)}return this.container.append(U),this.container}}class P extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class z extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class ee extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class te extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class K extends b{constructor(A){var O,M,U;const Z=!!(A.data.hasPopup||(O=A.data.titleObj)!==null&&O!==void 0&&O.str||(M=A.data.contentsObj)!==null&&M!==void 0&&M.str||(U=A.data.richText)!==null&&U!==void 0&&U.str);super(A,{isRenderable:Z,ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class ue extends b{constructor(A){var O;super(A,{isRenderable:!0});const{filename:M,content:U}=this.data.file;this.filename=(0,v.getFilenameFromUrl)(M,!0),this.content=U,(O=this.linkService.eventBus)===null||O===void 0||O.dispatch("fileattachmentannotation",{source:this,filename:M,content:U})}render(){var A,O;this.container.className="fileAttachmentAnnotation";let M;return this.data.hasAppearance?M=document.createElement("div"):(M=document.createElement("img"),M.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),M.className="popupTriggerArea",M.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((A=this.data.titleObj)!==null&&A!==void 0&&A.str||(O=this.data.contentsObj)!==null&&O!==void 0&&O.str||this.data.richText)&&this._createPopup(M,this.data),this.container.append(M),this.container}_download(){var A;(A=this.downloadManager)===null||A===void 0||A.openOrDownloadData(this.container,this.content,this.filename)}}class fe{static render(A){const{annotations:O,div:M,viewport:U,accessibilityManager:Z}=A;(0,v.setLayerDimensions)(M,U);const se={data:null,layer:M,page:A.page,viewport:U,linkService:A.linkService,downloadManager:A.downloadManager,imageResourcesPath:A.imageResourcesPath||"",renderForms:A.renderForms!==!1,svgFactory:new v.DOMSVGFactory,annotationStorage:A.annotationStorage||new I.AnnotationStorage,enableScripting:A.enableScripting===!0,hasJSActions:A.hasJSActions,fieldObjects:A.fieldObjects};let ne=0;for(const re of O){if(re.annotationType!==p.AnnotationType.POPUP){const{width:be,height:Ce}=o(re.rect);if(be<=0||Ce<=0)continue}se.data=re;const ve=c.create(se);if(!ve.isRenderable)continue;const he=ve.render();if(re.hidden&&(he.style.visibility="hidden"),Array.isArray(he))for(const be of he)be.style.zIndex=ne++,R(fe,fe,ye).call(fe,be,re.id,M,Z);else he.style.zIndex=ne++,ve instanceof N?M.prepend(he):R(fe,fe,ye).call(fe,he,re.id,M,Z)}R(this,fe,me).call(this,M,A.annotationCanvasMap)}static update(A){const{annotationCanvasMap:O,div:M,viewport:U}=A;(0,v.setLayerDimensions)(M,{rotation:U.rotation}),R(this,fe,me).call(this,M,O),M.hidden=!1}}E.AnnotationLayer=fe;function ye(ge,A,O,M){const U=ge.firstChild||ge;U.id=`${v.AnnotationPrefix}${A}`,O.append(ge),M==null||M.moveElementInDOM(O,ge,U,!1)}function me(ge,A){if(A){for(const[O,M]of A){const U=ge.querySelector(`[data-annotation-id="${O}"]`);if(!U)continue;const{firstChild:Z}=U;Z?Z.nodeName==="CANVAS"?Z.replaceWith(M):Z.before(M):U.append(M)}A.clear()}}},(W,E)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.ColorConverters=void 0;function l(v){return Math.floor(Math.max(0,Math.min(1,v))*255).toString(16).padStart(2,"0")}class p{static CMYK_G(I){let[k,m,R,t]=I;return["G",1-Math.min(1,.3*k+.59*R+.11*m+t)]}static G_CMYK(I){let[k]=I;return["CMYK",0,0,0,1-k]}static G_RGB(I){let[k]=I;return["RGB",k,k,k]}static G_HTML(I){let[k]=I;const m=l(k);return`#${m}${m}${m}`}static RGB_G(I){let[k,m,R]=I;return["G",.3*k+.59*m+.11*R]}static RGB_HTML(I){let[k,m,R]=I;const t=l(k),n=l(m),h=l(R);return`#${t}${n}${h}`}static T_HTML(){return"#00000000"}static CMYK_RGB(I){let[k,m,R,t]=I;return["RGB",1-Math.min(1,k+t),1-Math.min(1,R+t),1-Math.min(1,m+t)]}static CMYK_HTML(I){const k=this.CMYK_RGB(I).slice(1);return this.RGB_HTML(k)}static RGB_CMYK(I){let[k,m,R]=I;const t=1-k,n=1-m,h=1-R,a=Math.min(t,n,h);return["CMYK",t,n,h,a]}}E.ColorConverters=p},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.XfaLayer=void 0;var p=l(151);class v{static setupStorage(k,m,R,t,n){const h=t.getValue(m,{value:null});switch(R.name){case"textarea":if(h.value!==null&&(k.textContent=h.value),n==="print")break;k.addEventListener("input",a=>{t.setValue(m,{value:a.target.value})});break;case"input":if(R.attributes.type==="radio"||R.attributes.type==="checkbox"){if(h.value===R.attributes.xfaOn?k.setAttribute("checked",!0):h.value===R.attributes.xfaOff&&k.removeAttribute("checked"),n==="print")break;k.addEventListener("change",a=>{t.setValue(m,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(h.value!==null&&k.setAttribute("value",h.value),n==="print")break;k.addEventListener("input",a=>{t.setValue(m,{value:a.target.value})})}break;case"select":if(h.value!==null)for(const a of R.children)a.attributes.value===h.value&&(a.attributes.selected=!0);k.addEventListener("input",a=>{const d=a.target.options,r=d.selectedIndex===-1?"":d[d.selectedIndex].value;t.setValue(m,{value:r})});break}}static setAttributes(k){let{html:m,element:R,storage:t=null,intent:n,linkService:h}=k;const{attributes:a}=R,d=m instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${n}`);for(const[r,i]of Object.entries(a))if(i!=null)switch(r){case"class":i.length&&m.setAttribute(r,i.join(" "));break;case"dataId":break;case"id":m.setAttribute("data-element-id",i);break;case"style":Object.assign(m.style,i);break;case"textContent":m.textContent=i;break;default:(!d||r!=="href"&&r!=="newWindow")&&m.setAttribute(r,i)}d&&h.addLinkAttributes(m,a.href,a.newWindow),t&&a.dataId&&this.setupStorage(m,a.dataId,R,t)}static render(k){const m=k.annotationStorage,R=k.linkService,t=k.xfaHtml,n=k.intent||"display",h=document.createElement(t.name);t.attributes&&this.setAttributes({html:h,element:t,intent:n,linkService:R});const a=[[t,-1,h]],d=k.div;if(d.append(h),k.viewport){const o=`matrix(${k.viewport.transform.join(",")})`;d.style.transform=o}n!=="richText"&&d.setAttribute("class","xfaLayer xfaFont");const r=[];for(;a.length>0;){var i;const[o,c,b]=a.at(-1);if(c+1===o.children.length){a.pop();continue}const y=o.children[++a.at(-1)[1]];if(y===null)continue;const{name:f}=y;if(f==="#text"){const g=document.createTextNode(y.value);r.push(g),b.append(g);continue}let s;if(y!=null&&(i=y.attributes)!==null&&i!==void 0&&i.xmlns?s=document.createElementNS(y.attributes.xmlns,f):s=document.createElement(f),b.append(s),y.attributes&&this.setAttributes({html:s,element:y,storage:m,intent:n,linkService:R}),y.children&&y.children.length>0)a.push([y,-1,s]);else if(y.value){const g=document.createTextNode(y.value);p.XfaText.shouldBuildText(f)&&r.push(g),s.append(g)}}for(const o of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))o.setAttribute("readOnly",!0);return{textDivs:r}}static update(k){const m=`matrix(${k.viewport.transform.join(",")})`;k.div.style.transform=m,k.div.hidden=!1}}E.XfaLayer=v},(W,E,l)=>{Object.defineProperty(E,"__esModule",{value:!0}),E.SVGGraphics=void 0;var p=l(139),v=l(1),I=l(3);let k=class{constructor(){(0,v.unreachable)("Not implemented: SVGGraphics")}};E.SVGGraphics=k;{let i=function(s){let g=[];const S=[];for(const D of s){if(D.fn==="save"){g.push({fnId:92,fn:"group",items:[]}),S.push(g),g=g.at(-1).items;continue}D.fn==="restore"?g=S.pop():g.push(D)}return g},o=function(s){if(Number.isInteger(s))return s.toString();const g=s.toFixed(10);let S=g.length-1;if(g[S]!=="0")return g;do S--;while(g[S]==="0");return g.substring(0,g[S]==="."?S:S+1)},c=function(s){if(s[4]===0&&s[5]===0){if(s[1]===0&&s[2]===0)return s[0]===1&&s[3]===1?"":`scale(${o(s[0])} ${o(s[3])})`;if(s[0]===s[3]&&s[1]===-s[2]){const g=Math.acos(s[0])*180/Math.PI;return`rotate(${o(g)})`}}else if(s[0]===1&&s[1]===0&&s[2]===0&&s[3]===1)return`translate(${o(s[4])} ${o(s[5])})`;return`matrix(${o(s[0])} ${o(s[1])} ${o(s[2])} ${o(s[3])} ${o(s[4])} ${o(s[5])})`};const m={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},R="http://www.w3.org/XML/1998/namespace",t="http://www.w3.org/1999/xlink",n=["butt","round","square"],h=["miter","round","bevel"],a=function(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!S)return URL.createObjectURL(new Blob([s],{type:g}));const D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let w=`data:${g};base64,`;for(let x=0,F=s.length;x>2,Q=(X&3)<<4|G>>4,Y=x+1>6:64,B=x+2>1&2147483647:N=N>>1&2147483647;S[j]=N}function D(j,N,Q){let Y=-1;for(let B=N;B>>8^q}return Y^-1}function w(j,N,Q,Y){let B=Y;const ie=N.length;Q[B]=ie>>24&255,Q[B+1]=ie>>16&255,Q[B+2]=ie>>8&255,Q[B+3]=ie&255,B+=4,Q[B]=j.charCodeAt(0)&255,Q[B+1]=j.charCodeAt(1)&255,Q[B+2]=j.charCodeAt(2)&255,Q[B+3]=j.charCodeAt(3)&255,B+=4,Q.set(N,B),B+=N.length;const q=D(Q,Y+4,B);Q[B]=q>>24&255,Q[B+1]=q>>16&255,Q[B+2]=q>>8&255,Q[B+3]=q&255}function x(j,N,Q){let Y=1,B=0;for(let ie=N;ie=8?N=j:N=Buffer.from(j);const Q=require$$7.deflateSync(N,{level:9});return Q instanceof Uint8Array?Q:new Uint8Array(Q)}catch(N){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+N)}return X(j)}function X(j){let N=j.length;const Q=65535,Y=Math.ceil(N/Q),B=new Uint8Array(2+N+Y*5+4);let ie=0;B[ie++]=120,B[ie++]=156;let q=0;for(;N>Q;)B[ie++]=0,B[ie++]=255,B[ie++]=255,B[ie++]=0,B[ie++]=0,B.set(j.subarray(q,q+Q),ie),ie+=Q,q+=Q,N-=Q;B[ie++]=1,B[ie++]=N&255,B[ie++]=N>>8&255,B[ie++]=~N&65535&255,B[ie++]=(~N&65535)>>8&255,B.set(j.subarray(q),ie),ie+=j.length-q;const _=x(j,0,j.length);return B[ie++]=_>>24&255,B[ie++]=_>>16&255,B[ie++]=_>>8&255,B[ie++]=_&255,B}function G(j,N,Q,Y){const B=j.width,ie=j.height;let q,_,H;const $=j.data;switch(N){case v.ImageKind.GRAYSCALE_1BPP:_=0,q=1,H=B+7>>3;break;case v.ImageKind.RGB_24BPP:_=2,q=8,H=B*3;break;case v.ImageKind.RGBA_32BPP:_=6,q=8,H=B*4;break;default:throw new Error("invalid format")}const C=new Uint8Array((1+H)*ie);let P=0,z=0;for(let ye=0;ye>24&255,B>>16&255,B>>8&255,B&255,ie>>24&255,ie>>16&255,ie>>8&255,ie&255,q,_,0,0,0]),te=F(C),K=s.length+g*3+ee.length+te.length,ue=new Uint8Array(K);let fe=0;return ue.set(s,fe),fe+=s.length,w("IHDR",ee,ue,fe),fe+=g+ee.length,w("IDATA",te,ue,fe),fe+=g+te.length,w("IEND",new Uint8Array(0),ue,fe),a(ue,"image/png",Q)}return function(N,Q,Y){const B=N.kind===void 0?v.ImageKind.GRAYSCALE_1BPP:N.kind;return G(N,B,Q,Y)}}();class r{constructor(){this.fontSizeScale=1,this.fontWeight=m.fontWeight,this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=m.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(g,S){this.x=g,this.y=S}}let b=0,y=0,f=0;E.SVGGraphics=k=class{constructor(s,g){let S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,p.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new p.DOMSVGFactory,this.current=new r,this.transformMatrix=v.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=s,this.objs=g,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!S,this._operatorIdMapping=[];for(const D in v.OPS)this._operatorIdMapping[v.OPS[D]]=D}getObject(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof s=="string"?s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s):g}save(){this.transformStack.push(this.transformMatrix);const s=this.current;this.extraStack.push(s),this.current=s.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(s){this.save(),this.executeOpTree(s),this.restore()}loadDependencies(s){const g=s.fnArray,S=s.argsArray;for(let D=0,w=g.length;D{F.get(x,G)});this.current.dependencies.push(X)}return Promise.all(this.current.dependencies)}transform(s,g,S,D,w,x){const F=[s,g,S,D,w,x];this.transformMatrix=v.Util.transform(this.transformMatrix,F),this.tgrp=null}getSVG(s,g){this.viewport=g;const S=this._initialize(g);return this.loadDependencies(s).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(s)),S))}convertOpList(s){const g=this._operatorIdMapping,S=s.argsArray,D=s.fnArray,w=[];for(let x=0,F=D.length;x0&&(this.current.lineWidth=s)}setLineCap(s){this.current.lineCap=n[s]}setLineJoin(s){this.current.lineJoin=h[s]}setMiterLimit(s){this.current.miterLimit=s}setStrokeAlpha(s){this.current.strokeAlpha=s}setStrokeRGBColor(s,g,S){this.current.strokeColor=v.Util.makeHexColor(s,g,S)}setFillAlpha(s){this.current.fillAlpha=s}setFillRGBColor(s,g,S){this.current.fillColor=v.Util.makeHexColor(s,g,S),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(s){this.current.strokeColor=this._makeColorN_Pattern(s)}setFillColorN(s){this.current.fillColor=this._makeColorN_Pattern(s)}shadingFill(s){const g=this.viewport.width,S=this.viewport.height,D=v.Util.inverseTransform(this.transformMatrix),w=v.Util.applyTransform([0,0],D),x=v.Util.applyTransform([0,S],D),F=v.Util.applyTransform([g,0],D),X=v.Util.applyTransform([g,S],D),G=Math.min(w[0],x[0],F[0],X[0]),j=Math.min(w[1],x[1],F[1],X[1]),N=Math.max(w[0],x[0],F[0],X[0]),Q=Math.max(w[1],x[1],F[1],X[1]),Y=this.svgFactory.createElement("svg:rect");Y.setAttributeNS(null,"x",G),Y.setAttributeNS(null,"y",j),Y.setAttributeNS(null,"width",N-G),Y.setAttributeNS(null,"height",Q-j),Y.setAttributeNS(null,"fill",this._makeShadingPattern(s)),this.current.fillAlpha<1&&Y.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(Y)}_makeColorN_Pattern(s){return s[0]==="TilingPattern"?this._makeTilingPattern(s):this._makeShadingPattern(s)}_makeTilingPattern(s){const g=s[1],S=s[2],D=s[3]||v.IDENTITY_MATRIX,[w,x,F,X]=s[4],G=s[5],j=s[6],N=s[7],Q=`shading${f++}`,[Y,B,ie,q]=v.Util.normalizeRect([...v.Util.applyTransform([w,x],D),...v.Util.applyTransform([F,X],D)]),[_,H]=v.Util.singularValueDecompose2dScale(D),$=G*_,C=j*H,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",Q),P.setAttributeNS(null,"patternUnits","userSpaceOnUse"),P.setAttributeNS(null,"width",$),P.setAttributeNS(null,"height",C),P.setAttributeNS(null,"x",`${Y}`),P.setAttributeNS(null,"y",`${B}`);const z=this.svg,ee=this.transformMatrix,te=this.current.fillColor,K=this.current.strokeColor,ue=this.svgFactory.create(ie-Y,q-B);if(this.svg=ue,this.transformMatrix=D,N===2){const fe=v.Util.makeHexColor(...g);this.current.fillColor=fe,this.current.strokeColor=fe}return this.executeOpTree(this.convertOpList(S)),this.svg=z,this.transformMatrix=ee,this.current.fillColor=te,this.current.strokeColor=K,P.append(ue.childNodes[0]),this.defs.append(P),`url(#${Q})`}_makeShadingPattern(s){switch(typeof s=="string"&&(s=this.objs.get(s)),s[0]){case"RadialAxial":const g=`shading${f++}`,S=s[3];let D;switch(s[1]){case"axial":const w=s[4],x=s[5];D=this.svgFactory.createElement("svg:linearGradient"),D.setAttributeNS(null,"id",g),D.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),D.setAttributeNS(null,"x1",w[0]),D.setAttributeNS(null,"y1",w[1]),D.setAttributeNS(null,"x2",x[0]),D.setAttributeNS(null,"y2",x[1]);break;case"radial":const F=s[4],X=s[5],G=s[6],j=s[7];D=this.svgFactory.createElement("svg:radialGradient"),D.setAttributeNS(null,"id",g),D.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),D.setAttributeNS(null,"cx",X[0]),D.setAttributeNS(null,"cy",X[1]),D.setAttributeNS(null,"r",j),D.setAttributeNS(null,"fx",F[0]),D.setAttributeNS(null,"fy",F[1]),D.setAttributeNS(null,"fr",G);break;default:throw new Error(`Unknown RadialAxial type: ${s[1]}`)}for(const w of S){const x=this.svgFactory.createElement("svg:stop");x.setAttributeNS(null,"offset",w[0]),x.setAttributeNS(null,"stop-color",w[1]),D.append(x)}return this.defs.append(D),`url(#${g})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${s[0]}`)}}setDash(s,g){this.current.dashArray=s,this.current.dashPhase=g}constructPath(s,g){const S=this.current;let D=S.x,w=S.y,x=[],F=0;for(const X of s)switch(X|0){case v.OPS.rectangle:D=g[F++],w=g[F++];const G=g[F++],j=g[F++],N=D+G,Q=w+j;x.push("M",o(D),o(w),"L",o(N),o(w),"L",o(N),o(Q),"L",o(D),o(Q),"Z");break;case v.OPS.moveTo:D=g[F++],w=g[F++],x.push("M",o(D),o(w));break;case v.OPS.lineTo:D=g[F++],w=g[F++],x.push("L",o(D),o(w));break;case v.OPS.curveTo:D=g[F+4],w=g[F+5],x.push("C",o(g[F]),o(g[F+1]),o(g[F+2]),o(g[F+3]),o(D),o(w)),F+=6;break;case v.OPS.curveTo2:x.push("C",o(D),o(w),o(g[F]),o(g[F+1]),o(g[F+2]),o(g[F+3])),D=g[F+2],w=g[F+3],F+=4;break;case v.OPS.curveTo3:D=g[F+2],w=g[F+3],x.push("C",o(g[F]),o(g[F+1]),o(D),o(w),o(D),o(w)),F+=4;break;case v.OPS.closePath:x.push("Z");break}x=x.join(" "),S.path&&s.length>0&&s[0]!==v.OPS.rectangle&&s[0]!==v.OPS.moveTo?x=S.path.getAttributeNS(null,"d")+x:(S.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(S.path)),S.path.setAttributeNS(null,"d",x),S.path.setAttributeNS(null,"fill","none"),S.element=S.path,S.setCurrentPoint(D,w)}endPath(){const s=this.current;if(s.path=null,!this.pendingClip)return;if(!s.element){this.pendingClip=null;return}const g=`clippath${b++}`,S=this.svgFactory.createElement("svg:clipPath");S.setAttributeNS(null,"id",g),S.setAttributeNS(null,"transform",c(this.transformMatrix));const D=s.element.cloneNode(!0);if(this.pendingClip==="evenodd"?D.setAttributeNS(null,"clip-rule","evenodd"):D.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,S.append(D),this.defs.append(S),s.activeClipUrl){s.clipGroup=null;for(const w of this.extraStack)w.clipGroup=null;S.setAttributeNS(null,"clip-path",s.activeClipUrl)}s.activeClipUrl=`url(#${g})`,this.tgrp=null}clip(s){this.pendingClip=s}closePath(){const s=this.current;if(s.path){const g=`${s.path.getAttributeNS(null,"d")}Z`;s.path.setAttributeNS(null,"d",g)}}setLeading(s){this.current.leading=-s}setTextRise(s){this.current.textRise=s}setTextRenderingMode(s){this.current.textRenderingMode=s}setHScale(s){this.current.textHScale=s/100}setRenderingIntent(s){}setFlatness(s){}setGState(s){for(const[g,S]of s)switch(g){case"LW":this.setLineWidth(S);break;case"LC":this.setLineCap(S);break;case"LJ":this.setLineJoin(S);break;case"ML":this.setMiterLimit(S);break;case"D":this.setDash(S[0],S[1]);break;case"RI":this.setRenderingIntent(S);break;case"FL":this.setFlatness(S);break;case"Font":this.setFont(S);break;case"CA":this.setStrokeAlpha(S);break;case"ca":this.setFillAlpha(S);break;default:(0,v.warn)(`Unimplemented graphic state operator ${g}`);break}}fill(){const s=this.current;s.element&&(s.element.setAttributeNS(null,"fill",s.fillColor),s.element.setAttributeNS(null,"fill-opacity",s.fillAlpha),this.endPath())}stroke(){const s=this.current;s.element&&(this._setStrokeAttributes(s.element),s.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(s){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const S=this.current;let D=S.dashArray;g!==1&&D.length>0&&(D=D.map(function(w){return g*w})),s.setAttributeNS(null,"stroke",S.strokeColor),s.setAttributeNS(null,"stroke-opacity",S.strokeAlpha),s.setAttributeNS(null,"stroke-miterlimit",o(S.miterLimit)),s.setAttributeNS(null,"stroke-linecap",S.lineCap),s.setAttributeNS(null,"stroke-linejoin",S.lineJoin),s.setAttributeNS(null,"stroke-width",o(g*S.lineWidth)+"px"),s.setAttributeNS(null,"stroke-dasharray",D.map(o).join(" ")),s.setAttributeNS(null,"stroke-dashoffset",o(g*S.dashPhase)+"px")}eoFill(){var s;(s=this.current.element)===null||s===void 0||s.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var s;(s=this.current.element)===null||s===void 0||s.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width","1px"),s.setAttributeNS(null,"height","1px"),s.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(s)}paintImageXObject(s){const g=this.getObject(s);if(!g){(0,v.warn)(`Dependent image with object ID ${s} is not ready yet`);return}this.paintInlineImageXObject(g)}paintInlineImageXObject(s,g){const S=s.width,D=s.height,w=d(s,this.forceDataSchema,!!g),x=this.svgFactory.createElement("svg:rect");x.setAttributeNS(null,"x","0"),x.setAttributeNS(null,"y","0"),x.setAttributeNS(null,"width",o(S)),x.setAttributeNS(null,"height",o(D)),this.current.element=x,this.clip("nonzero");const F=this.svgFactory.createElement("svg:image");F.setAttributeNS(t,"xlink:href",w),F.setAttributeNS(null,"x","0"),F.setAttributeNS(null,"y",o(-D)),F.setAttributeNS(null,"width",o(S)+"px"),F.setAttributeNS(null,"height",o(D)+"px"),F.setAttributeNS(null,"transform",`scale(${o(1/S)} ${o(-1/D)})`),g?g.append(F):this._ensureTransformGroup().append(F)}paintImageMaskXObject(s){const g=this.getObject(s.data,s);if(g.bitmap){(0,v.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const S=this.current,D=g.width,w=g.height,x=S.fillColor;S.maskId=`mask${y++}`;const F=this.svgFactory.createElement("svg:mask");F.setAttributeNS(null,"id",S.maskId);const X=this.svgFactory.createElement("svg:rect");X.setAttributeNS(null,"x","0"),X.setAttributeNS(null,"y","0"),X.setAttributeNS(null,"width",o(D)),X.setAttributeNS(null,"height",o(w)),X.setAttributeNS(null,"fill",x),X.setAttributeNS(null,"mask",`url(#${S.maskId})`),this.defs.append(F),this._ensureTransformGroup().append(X),this.paintInlineImageXObject(g,F)}paintFormXObjectBegin(s,g){if(Array.isArray(s)&&s.length===6&&this.transform(s[0],s[1],s[2],s[3],s[4],s[5]),g){const S=g[2]-g[0],D=g[3]-g[1],w=this.svgFactory.createElement("svg:rect");w.setAttributeNS(null,"x",g[0]),w.setAttributeNS(null,"y",g[1]),w.setAttributeNS(null,"width",o(S)),w.setAttributeNS(null,"height",o(D)),this.current.element=w,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(s){const g=this.svgFactory.create(s.width,s.height),S=this.svgFactory.createElement("svg:defs");g.append(S),this.defs=S;const D=this.svgFactory.createElement("svg:g");return D.setAttributeNS(null,"transform",c(s.transform)),g.append(D),this.svg=D,g}_ensureClipGroup(){if(!this.current.clipGroup){const s=this.svgFactory.createElement("svg:g");s.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(s),this.current.clipGroup=s}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",c(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(W){var E=__webpack_module_cache__[W];if(E!==void 0)return E.exports;var l=__webpack_module_cache__[W]={exports:{}};return __webpack_modules__[W](l,l.exports,__w_pdfjs_require__),l.exports}var __webpack_exports__={};return(()=>{var W=__webpack_exports__;Object.defineProperty(W,"__esModule",{value:!0}),Object.defineProperty(W,"AbortException",{enumerable:!0,get:function(){return E.AbortException}}),Object.defineProperty(W,"AnnotationEditorLayer",{enumerable:!0,get:function(){return I.AnnotationEditorLayer}}),Object.defineProperty(W,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return E.AnnotationEditorParamsType}}),Object.defineProperty(W,"AnnotationEditorType",{enumerable:!0,get:function(){return E.AnnotationEditorType}}),Object.defineProperty(W,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return k.AnnotationEditorUIManager}}),Object.defineProperty(W,"AnnotationLayer",{enumerable:!0,get:function(){return m.AnnotationLayer}}),Object.defineProperty(W,"AnnotationMode",{enumerable:!0,get:function(){return E.AnnotationMode}}),Object.defineProperty(W,"CMapCompressionType",{enumerable:!0,get:function(){return E.CMapCompressionType}}),Object.defineProperty(W,"FeatureTest",{enumerable:!0,get:function(){return E.FeatureTest}}),Object.defineProperty(W,"GlobalWorkerOptions",{enumerable:!0,get:function(){return R.GlobalWorkerOptions}}),Object.defineProperty(W,"InvalidPDFException",{enumerable:!0,get:function(){return E.InvalidPDFException}}),Object.defineProperty(W,"MissingPDFException",{enumerable:!0,get:function(){return E.MissingPDFException}}),Object.defineProperty(W,"OPS",{enumerable:!0,get:function(){return E.OPS}}),Object.defineProperty(W,"PDFDataRangeTransport",{enumerable:!0,get:function(){return l.PDFDataRangeTransport}}),Object.defineProperty(W,"PDFDateString",{enumerable:!0,get:function(){return p.PDFDateString}}),Object.defineProperty(W,"PDFWorker",{enumerable:!0,get:function(){return l.PDFWorker}}),Object.defineProperty(W,"PasswordResponses",{enumerable:!0,get:function(){return E.PasswordResponses}}),Object.defineProperty(W,"PermissionFlag",{enumerable:!0,get:function(){return E.PermissionFlag}}),Object.defineProperty(W,"PixelsPerInch",{enumerable:!0,get:function(){return p.PixelsPerInch}}),Object.defineProperty(W,"RenderingCancelledException",{enumerable:!0,get:function(){return p.RenderingCancelledException}}),Object.defineProperty(W,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(W,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return E.UNSUPPORTED_FEATURES}}),Object.defineProperty(W,"UnexpectedResponseException",{enumerable:!0,get:function(){return E.UnexpectedResponseException}}),Object.defineProperty(W,"Util",{enumerable:!0,get:function(){return E.Util}}),Object.defineProperty(W,"VerbosityLevel",{enumerable:!0,get:function(){return E.VerbosityLevel}}),Object.defineProperty(W,"XfaLayer",{enumerable:!0,get:function(){return n.XfaLayer}}),Object.defineProperty(W,"build",{enumerable:!0,get:function(){return l.build}}),Object.defineProperty(W,"createPromiseCapability",{enumerable:!0,get:function(){return E.createPromiseCapability}}),Object.defineProperty(W,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return E.createValidAbsoluteUrl}}),Object.defineProperty(W,"getDocument",{enumerable:!0,get:function(){return l.getDocument}}),Object.defineProperty(W,"getFilenameFromUrl",{enumerable:!0,get:function(){return p.getFilenameFromUrl}}),Object.defineProperty(W,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return p.getPdfFilenameFromUrl}}),Object.defineProperty(W,"getXfaPageViewport",{enumerable:!0,get:function(){return p.getXfaPageViewport}}),Object.defineProperty(W,"isDataScheme",{enumerable:!0,get:function(){return p.isDataScheme}}),Object.defineProperty(W,"isPdfFile",{enumerable:!0,get:function(){return p.isPdfFile}}),Object.defineProperty(W,"loadScript",{enumerable:!0,get:function(){return p.loadScript}}),Object.defineProperty(W,"renderTextLayer",{enumerable:!0,get:function(){return v.renderTextLayer}}),Object.defineProperty(W,"setLayerDimensions",{enumerable:!0,get:function(){return p.setLayerDimensions}}),Object.defineProperty(W,"shadow",{enumerable:!0,get:function(){return E.shadow}}),Object.defineProperty(W,"updateTextLayer",{enumerable:!0,get:function(){return v.updateTextLayer}}),Object.defineProperty(W,"version",{enumerable:!0,get:function(){return l.version}});var E=__w_pdfjs_require__(1),l=__w_pdfjs_require__(135),p=__w_pdfjs_require__(139),v=__w_pdfjs_require__(158),I=__w_pdfjs_require__(159),k=__w_pdfjs_require__(138),m=__w_pdfjs_require__(164),R=__w_pdfjs_require__(146),t=__w_pdfjs_require__(167),n=__w_pdfjs_require__(166)})(),__webpack_exports__})())}(pdf$1)),pdfExports$1}var pdfExports=requirePdf(),pdf_viewerExports={},pdf_viewer={get exports(){return pdf_viewerExports},set exports(W){pdf_viewerExports=W}};(function(W,E){(function(p,v){W.exports=v()})(globalThis,()=>(()=>{var l=[,(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.SimpleLinkService=m.PDFLinkService=m.LinkTarget=void 0;var t=R(2);function n(X,G){a(X,G),G.add(X)}function h(X,G,j){a(X,G),G.set(X,j)}function a(X,G){if(G.has(X))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(X,G,j){return r(X,G),j}function r(X,G){if(X!==G)throw new TypeError("Private static access of wrong provenance")}function i(X,G,j){if(!G.has(X))throw new TypeError("attempted to get private field on non-instance");return j}function o(X,G){var j=c(X,G,"get");return b(X,j)}function c(X,G,j){if(!G.has(X))throw new TypeError("attempted to "+j+" private field on non-instance");return G.get(X)}function b(X,G){return G.get?G.get.call(X):G.value}const y="noopener noreferrer nofollow",f={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};m.LinkTarget=f;function s(X){let{url:G,target:j,rel:N,enabled:Q=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!G||typeof G!="string")throw new Error('A valid "url" parameter must provided.');const Y=(0,t.removeNullCharacters)(G);Q?X.href=X.title=Y:(X.href="",X.title=`Disabled: ${Y}`,X.onclick=()=>!1);let B="";switch(j){case f.NONE:break;case f.SELF:B="_self";break;case f.BLANK:B="_blank";break;case f.PARENT:B="_parent";break;case f.TOP:B="_top";break}X.target=B,X.rel=typeof N=="string"?N:y}var g=new WeakMap,S=new WeakSet;class D{constructor(){let{eventBus:G,externalLinkTarget:j=null,externalLinkRel:N=null,ignoreDestinationZoom:Q=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(this,S),h(this,g,{writable:!0,value:new Map}),this.eventBus=G,this.externalLinkTarget=j,this.externalLinkRel=N,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=Q,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(G){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.baseUrl=j,this.pdfDocument=G,o(this,g).clear()}setViewer(G){this.pdfViewer=G}setHistory(G){this.pdfHistory=G}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(G){this.pdfViewer.currentPageNumber=G}get rotation(){return this.pdfViewer.pagesRotation}set rotation(G){this.pdfViewer.pagesRotation=G}get isInPresentationMode(){return this.pdfViewer.isInPresentationMode}async goToDestination(G){if(!this.pdfDocument)return;let j,N;if(typeof G=="string"?(j=G,N=await this.pdfDocument.getDestination(G)):(j=null,N=await G),!Array.isArray(N)){console.error(`PDFLinkService.goToDestination: "${N}" is not a valid destination array, for dest="${G}".`);return}i(this,S,w).call(this,G,j,N)}goToPage(G){if(!this.pdfDocument)return;const j=typeof G=="string"&&this.pdfViewer.pageLabelToPageNumber(G)||G|0;if(!(Number.isInteger(j)&&j>0&&j<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${G}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(j)),this.pdfViewer.scrollPageIntoView({pageNumber:j})}addLinkAttributes(G,j){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(G,{url:j,target:N?f.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(G){if(typeof G=="string"){if(G.length>0)return this.getAnchorUrl("#"+escape(G))}else if(Array.isArray(G)){const j=JSON.stringify(G);if(j.length>0)return this.getAnchorUrl("#"+escape(j))}return this.getAnchorUrl("")}getAnchorUrl(G){return(this.baseUrl||"")+G}setHash(G){if(!this.pdfDocument)return;let j,N;if(G.includes("=")){const Q=(0,t.parseQueryString)(G);if(Q.has("search")&&this.eventBus.dispatch("findfromurlhash",{source:this,query:Q.get("search").replace(/"/g,""),phraseSearch:Q.get("phrase")==="true"}),Q.has("page")&&(j=Q.get("page")|0||1),Q.has("zoom")){const Y=Q.get("zoom").split(","),B=Y[0],ie=parseFloat(B);B.includes("Fit")?B==="Fit"||B==="FitB"?N=[null,{name:B}]:B==="FitH"||B==="FitBH"||B==="FitV"||B==="FitBV"?N=[null,{name:B},Y.length>1?Y[1]|0:null]:B==="FitR"?Y.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):N=[null,{name:B},Y[1]|0,Y[2]|0,Y[3]|0,Y[4]|0]:console.error(`PDFLinkService.setHash: "${B}" is not a valid zoom value.`):N=[null,{name:"XYZ"},Y.length>1?Y[1]|0:null,Y.length>2?Y[2]|0:null,ie?ie/100:B]}N?this.pdfViewer.scrollPageIntoView({pageNumber:j||this.page,destArray:N,allowNegativeOffset:!0}):j&&(this.page=j),Q.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:Q.get("pagemode")}),Q.has("nameddest")&&this.goToDestination(Q.get("nameddest"))}else{N=unescape(G);try{N=JSON.parse(N),Array.isArray(N)||(N=N.toString())}catch{}if(typeof N=="string"||d(D,D,x).call(D,N)){this.goToDestination(N);return}console.error(`PDFLinkService.setHash: "${unescape(G)}" is not a valid destination.`)}}executeNamedAction(G){var j,N;switch(G){case"GoBack":(j=this.pdfHistory)===null||j===void 0||j.back();break;case"GoForward":(N=this.pdfHistory)===null||N===void 0||N.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:G})}async executeSetOCGState(G){const j=this.pdfDocument,N=await this.pdfViewer.optionalContentConfigPromise;if(j!==this.pdfDocument)return;let Q;for(const Y of G.state){switch(Y){case"ON":case"OFF":case"Toggle":Q=Y;continue}switch(Q){case"ON":N.setVisibility(Y,!0);break;case"OFF":N.setVisibility(Y,!1);break;case"Toggle":const B=N.getGroup(Y);B&&N.setVisibility(Y,!B.visible);break}}this.pdfViewer.optionalContentConfigPromise=Promise.resolve(N)}cachePageRef(G,j){if(!j)return;const N=j.gen===0?`${j.num}R`:`${j.num}R${j.gen}`;o(this,g).set(N,G)}_cachedPageNumber(G){if(!G)return null;const j=G.gen===0?`${G.num}R`:`${G.num}R${G.gen}`;return o(this,g).get(j)||null}isPageVisible(G){return this.pdfViewer.isPageVisible(G)}isPageCached(G){return this.pdfViewer.isPageCached(G)}}m.PDFLinkService=D;function w(X){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,j=arguments.length>2?arguments[2]:void 0;const N=j[0];let Q;if(typeof N=="object"&&N!==null){if(Q=this._cachedPageNumber(N),!Q){this.pdfDocument.getPageIndex(N).then(Y=>{this.cachePageRef(Y+1,N),i(this,S,w).call(this,X,G,j)}).catch(()=>{console.error(`PDFLinkService.#goToDestinationHelper: "${N}" is not a valid page reference, for dest="${X}".`)});return}}else if(Number.isInteger(N))Q=N+1;else{console.error(`PDFLinkService.#goToDestinationHelper: "${N}" is not a valid destination reference, for dest="${X}".`);return}if(!Q||Q<1||Q>this.pagesCount){console.error(`PDFLinkService.#goToDestinationHelper: "${Q}" is not a valid page number, for dest="${X}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:G,explicitDest:j,pageNumber:Q})),this.pdfViewer.scrollPageIntoView({pageNumber:Q,destArray:j,ignoreDestinationZoom:this._ignoreDestinationZoom})}function x(X){if(!Array.isArray(X))return!1;const G=X.length;if(G<2)return!1;const j=X[0];if(!(typeof j=="object"&&Number.isInteger(j.num)&&Number.isInteger(j.gen))&&!(Number.isInteger(j)&&j>=0))return!1;const N=X[1];if(!(typeof N=="object"&&typeof N.name=="string"))return!1;let Q=!0;switch(N.name){case"XYZ":if(G!==5)return!1;break;case"Fit":case"FitB":return G===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(G!==3)return!1;break;case"FitR":if(G!==6)return!1;Q=!1;break;default:return!1}for(let Y=2;Y{var O,M,U,Z,se;Object.defineProperty(m,"__esModule",{value:!0}),m.animationStarted=m.VERTICAL_PADDING=m.UNKNOWN_SCALE=m.TextLayerMode=m.SpreadMode=m.SidebarView=m.ScrollMode=m.SCROLLBAR_PADDING=m.RenderingStates=m.RendererType=m.ProgressBar=m.PresentationModeState=m.OutputScale=m.MIN_SCALE=m.MAX_SCALE=m.MAX_AUTO_SCALE=m.DEFAULT_SCALE_VALUE=m.DEFAULT_SCALE_DELTA=m.DEFAULT_SCALE=m.CursorTool=m.AutoPrintRegExp=void 0,m.apiPageLayoutToViewerModes=ge,m.apiPageModeToSidebarView=A,m.approximateFraction=B,m.backtrackBeforeAllVisibleElements=_,m.binarySearchFirstItem=Y,m.docStyle=void 0,m.getActiveOrFocusedElement=we,m.getPageSizeInches=q,m.getVisibleElements=H,m.isPortraitOrientation=K,m.isValidRotation=z,m.isValidScrollMode=ee,m.isValidSpreadMode=te,m.noContextMenuHandler=$,m.normalizeWheelEventDelta=P,m.normalizeWheelEventDirection=C,m.parseQueryString=G,m.removeNullCharacters=Q,m.roundToDivide=ie,m.scrollIntoView=F,m.watchScroll=X;const R="auto";m.DEFAULT_SCALE_VALUE=R;const t=1;m.DEFAULT_SCALE=t;const n=1.1;m.DEFAULT_SCALE_DELTA=n;const h=.1;m.MIN_SCALE=h;const a=10;m.MAX_SCALE=a;const d=0;m.UNKNOWN_SCALE=d;const r=1.25;m.MAX_AUTO_SCALE=r;const i=40;m.SCROLLBAR_PADDING=i;const o=5;m.VERTICAL_PADDING=o;const c={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};m.RenderingStates=c;const b={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};m.PresentationModeState=b;const y={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};m.SidebarView=y;const f={CANVAS:"canvas",SVG:"svg"};m.RendererType=f;const s={DISABLE:0,ENABLE:1};m.TextLayerMode=s;const g={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};m.ScrollMode=g;const S={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};m.SpreadMode=S;const D={SELECT:0,HAND:1,ZOOM:2};m.CursorTool=D;const w=/\bprint\s*\(/;m.AutoPrintRegExp=w;class x{constructor(){const re=window.devicePixelRatio||1;this.sx=re,this.sy=re}get scaled(){return this.sx!==1||this.sy!==1}}m.OutputScale=x;function F(ne,re){let ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,he=ne.offsetParent;if(!he){console.error("offsetParent is not set -- cannot scroll");return}let be=ne.offsetTop+ne.clientTop,Ce=ne.offsetLeft+ne.clientLeft;for(;he.clientHeight===he.scrollHeight&&he.clientWidth===he.scrollWidth||ve&&(he.classList.contains("markedContent")||getComputedStyle(he).overflow==="hidden");)if(be+=he.offsetTop,Ce+=he.offsetLeft,he=he.offsetParent,!he)return;re&&(re.top!==void 0&&(be+=re.top),re.left!==void 0&&(Ce+=re.left,he.scrollLeft=Ce)),he.scrollTop=be}function X(ne,re){const ve=function(Ce){be||(be=window.requestAnimationFrame(function(){be=null;const Ie=ne.scrollLeft,He=he.lastX;Ie!==He&&(he.right=Ie>He),he.lastX=Ie;const Ve=ne.scrollTop,ae=he.lastY;Ve!==ae&&(he.down=Ve>ae),he.lastY=Ve,re(he)}))},he={right:!0,down:!0,lastX:ne.scrollLeft,lastY:ne.scrollTop,_eventHandler:ve};let be=null;return ne.addEventListener("scroll",ve,!0),he}function G(ne){const re=new Map;for(const[ve,he]of new URLSearchParams(ne))re.set(ve.toLowerCase(),he);return re}const j=/\x00/g,N=/[\x01-\x1F]/g;function Q(ne){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return typeof ne!="string"?(console.error("The argument must be a string."),ne):(re&&(ne=ne.replace(N," ")),ne.replace(j,""))}function Y(ne,re){let he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,be=ne.length-1;if(be<0||!re(ne[be]))return ne.length;if(re(ne[he]))return he;for(;he>1,Te=ne[Ce];re(Te)?be=Ce:he=Ce+1}return he}function B(ne){if(Math.floor(ne)===ne)return[ne,1];const re=1/ne,ve=8;if(re>ve)return[1,ve];if(Math.floor(re)===re)return[1,re];const he=ne>1?re:ne;let be=0,Ce=1,Te=1,Ie=1;for(;;){const Ve=be+Te,ae=Ce+Ie;if(ae>ve)break;he<=Ve/ae?(Te=Ve,Ie=ae):(be=Ve,Ce=ae)}let He;return he-be/Ce=ve&&(he=re[ne-1].div,be=he.offsetTop+he.clientTop);for(let Ce=ne-2;Ce>=0&&(he=re[Ce].div,!(he.offsetTop+he.clientTop+he.clientHeight<=be));--Ce)ne=Ce;return ne}function H(ne){let{scrollEl:re,views:ve,sortByVisibility:he=!1,horizontal:be=!1,rtl:Ce=!1}=ne;const Te=re.scrollTop,Ie=Te+re.clientHeight,He=re.scrollLeft,Ve=He+re.clientWidth;function ae(Ae){const ce=Ae.div;return ce.offsetTop+ce.clientTop+ce.clientHeight>Te}function T(Ae){const ce=Ae.div,Ee=ce.offsetLeft+ce.clientLeft,We=Ee+ce.clientWidth;return Ce?EeHe}const V=[],de=new Set,Pe=ve.length;let De=Y(ve,be?T:ae);De>0&&De=Ie&&(Fe=pe);else if((be?We:Oe)>Fe)break;if(pe<=Te||Oe>=Ie||J<=He||We>=Ve)continue;const ke=Math.max(0,Te-Oe)+Math.max(0,pe-Ie),Re=Math.max(0,He-We)+Math.max(0,J-Ve),Be=(oe-ke)/oe,Ne=($e-Re)/$e,Ge=Be*Ne*100|0;V.push({id:ce.id,x:We,y:Oe,view:ce,percent:Ge,widthPercent:Ne*100|0}),de.add(ce.id)}const _e=V[0],Me=V.at(-1);return he&&V.sort(function(Ae,ce){const Ee=Ae.percent-ce.percent;return Math.abs(Ee)>.001?-Ee:Ae.id-ce.id}),{first:_e,last:Me,views:V,ids:de}}function $(ne){ne.preventDefault()}function C(ne){let re=Math.hypot(ne.deltaX,ne.deltaY);const ve=Math.atan2(ne.deltaY,ne.deltaX);return-.25*Math.PI0&&Ue(this,Z).setProperty("--progressBar-end-offset",`${he}px`)}setDisableAutoFetch(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;isNaN(Ue(this,U))||(Ue(this,M)&&clearTimeout(Ue(this,M)),this.show(),rt(this,M,setTimeout(()=>{rt(this,M,null),this.hide()},re)))}hide(){Ue(this,se)&&(rt(this,se,!1),Ue(this,O).add("hidden"))}show(){Ue(this,se)||(rt(this,se,!0),Ue(this,O).remove("hidden"))}}O=new WeakMap,M=new WeakMap,U=new WeakMap,Z=new WeakMap,se=new WeakMap,m.ProgressBar=me;function we(){let ne=document,re=ne.activeElement||ne.querySelector(":focus");for(;(ve=re)!==null&&ve!==void 0&&ve.shadowRoot;){var ve;ne=re.shadowRoot,re=ne.activeElement||ne.querySelector(":focus")}return re}function ge(ne){let re=g.VERTICAL,ve=S.NONE;switch(ne){case"SinglePage":re=g.PAGE;break;case"OneColumn":break;case"TwoPageLeft":re=g.PAGE;case"TwoColumnLeft":ve=S.ODD;break;case"TwoPageRight":re=g.PAGE;case"TwoColumnRight":ve=S.EVEN;break}return{scrollMode:re,spreadMode:ve}}function A(ne){switch(ne){case"UseNone":return y.NONE;case"UseThumbs":return y.THUMBS;case"UseOutlines":return y.OUTLINE;case"UseAttachments":return y.ATTACHMENTS;case"UseOC":return y.LAYERS}return y.NONE}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.AnnotationLayerBuilder=void 0;var t=R(4),n=R(5),h=R(2);function a(x,F){r(x,F),F.add(x)}function d(x,F,X){r(x,F),F.set(x,X)}function r(x,F){if(F.has(x))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(x,F,X){if(!F.has(x))throw new TypeError("attempted to get private field on non-instance");return X}function o(x,F,X){var G=y(x,F,"set");return c(x,G,X),X}function c(x,F,X){if(F.set)F.set.call(x,X);else{if(!F.writable)throw new TypeError("attempted to set read only private field");F.value=X}}function b(x,F){var X=y(x,F,"get");return f(x,X)}function y(x,F,X){if(!F.has(x))throw new TypeError("attempted to "+X+" private field on non-instance");return F.get(x)}function f(x,F){return F.get?F.get.call(x):F.value}var s=new WeakMap,g=new WeakMap,S=new WeakSet;class D{constructor(F){let{pageDiv:X,pdfPage:G,linkService:j,downloadManager:N,annotationStorage:Q=null,imageResourcesPath:Y="",renderForms:B=!0,l10n:ie=n.NullL10n,enableScripting:q=!1,hasJSActionsPromise:_=null,fieldObjectsPromise:H=null,annotationCanvasMap:$=null,accessibilityManager:C=null}=F;a(this,S),d(this,s,{writable:!0,value:0}),d(this,g,{writable:!0,value:null}),this.pageDiv=X,this.pdfPage=G,this.linkService=j,this.downloadManager=N,this.imageResourcesPath=Y,this.renderForms=B,this.l10n=ie,this.annotationStorage=Q,this.enableScripting=q,this._hasJSActionsPromise=_||Promise.resolve(!1),this._fieldObjectsPromise=H||Promise.resolve(null),this._annotationCanvasMap=$,this._accessibilityManager=C,this.div=null,this._cancelled=!1,this._eventBus=j.eventBus}async render(F){let X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(this.div){if(this._cancelled||b(this,s)===0)return;t.AnnotationLayer.update({viewport:F.clone({dontFlip:!0}),div:this.div,annotationCanvasMap:this._annotationCanvasMap});return}const[G,j,N]=await Promise.all([this.pdfPage.getAnnotations({intent:X}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(!this._cancelled){if(o(this,s,G.length),this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.append(this.div),b(this,s)===0){this.hide();return}if(t.AnnotationLayer.render({viewport:F.clone({dontFlip:!0}),div:this.div,annotations:G,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:j,fieldObjects:N,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager}),this.l10n.translate(this.div),this.linkService.isInPresentationMode&&i(this,S,w).call(this,h.PresentationModeState.FULLSCREEN),!b(this,g)){var Q;o(this,g,Y=>{i(this,S,w).call(this,Y.state)}),(Q=this._eventBus)===null||Q===void 0||Q._on("presentationmodechanged",b(this,g))}}}cancel(){if(this._cancelled=!0,b(this,g)){var F;(F=this._eventBus)===null||F===void 0||F._off("presentationmodechanged",b(this,g)),o(this,g,null)}}hide(){this.div&&(this.div.hidden=!0)}}m.AnnotationLayerBuilder=D;function w(x){if(!this.div)return;let F=!1;switch(x){case h.PresentationModeState.FULLSCREEN:F=!0;break;case h.PresentationModeState.NORMAL:break;default:return}for(const X of this.div.childNodes)X.hasAttribute("data-internal-link")||(X.inert=F)}},k=>{let m;typeof window<"u"&&window["pdfjs-dist/build/pdf"]?m=window["pdfjs-dist/build/pdf"]:m=requirePdf(),k.exports=m},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.NullL10n=void 0,m.fixupLangCode=h,m.getL10nFallback=t;const R={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image"};R.print_progress_percent="{{progress}}%";function t(r,i){switch(r){case"find_match_count":r=`find_match_count[${i.total===1?"one":"other"}]`;break;case"find_match_count_limit":r=`find_match_count_limit[${i.limit===1?"one":"other"}]`;break}return R[r]||""}const n={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function h(r){return n[r==null?void 0:r.toLowerCase()]||r}function a(r,i){return i?r.replace(/\{\{\s*(\w+)\s*\}\}/g,(o,c)=>c in i?i[c]:"{{"+c+"}}"):r}const d={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t(r,i);return a(o,i)},async translate(r){}};m.NullL10n=d},(k,m,R)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.DownloadManager=void 0;var t=R(4);function n(d,r){const i=document.createElement("a");if(!i.click)throw new Error('DownloadManager: "a.click()" is not supported.');i.href=d,i.target="_parent","download"in i&&(i.download=r),(document.body||document.documentElement).append(i),i.click(),i.remove()}class h{constructor(){nt(this,a,new WeakMap)}downloadUrl(r,i){if(!(0,t.createValidAbsoluteUrl)(r,"http://example.com")){console.error(`downloadUrl - not a valid URL: ${r}`);return}n(r+"#pdfjs.action=download",i)}downloadData(r,i,o){const c=URL.createObjectURL(new Blob([r],{type:o}));n(c,i)}openOrDownloadData(r,i,o){const b=(0,t.isPdfFile)(o)?"application/pdf":"";return this.downloadData(i,o,b),!1}download(r,i,o){const c=URL.createObjectURL(r);n(c,o)}}a=new WeakMap,m.DownloadManager=h},(k,m)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.WaitOnType=m.EventBus=m.AutomationEventBus=void 0,m.waitOnEventOrTimeout=t;const R={EVENT:"event",TIMEOUT:"timeout"};m.WaitOnType=R;function t(d){let{target:r,name:i,delay:o=0}=d;return new Promise(function(c,b){if(typeof r!="object"||!(i&&typeof i=="string")||!(Number.isInteger(o)&&o>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function y(S){r instanceof n?r._off(i,f):r.removeEventListener(i,f),g&&clearTimeout(g),c(S)}const f=y.bind(null,R.EVENT);r instanceof n?r._on(i,f):r.addEventListener(i,f);const s=y.bind(null,R.TIMEOUT),g=setTimeout(s,o)})}class n{constructor(){nt(this,a,Object.create(null))}on(r,i){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._on(r,i,{external:!0,once:o==null?void 0:o.once})}off(r,i){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._off(r,i,{external:!0,once:o==null?void 0:o.once})}dispatch(r,i){const o=Ue(this,a)[r];if(!o||o.length===0)return;let c;for(const{listener:b,external:y,once:f}of o.slice(0)){if(f&&this._off(r,b),y){(c||(c=[])).push(b);continue}b(i)}if(c){for(const b of c)b(i);c=null}}_on(r,i){var o;let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;((o=Ue(this,a))[r]||(o[r]=[])).push({listener:i,external:(c==null?void 0:c.external)===!0,once:(c==null?void 0:c.once)===!0})}_off(r,i){const o=Ue(this,a)[r];if(o){for(let c=0,b=o.length;c{Object.defineProperty(m,"__esModule",{value:!0}),m.GenericL10n=void 0,R(9);var t=R(5);const n=document.webL10n;class h{constructor(d){this._lang=d,this._ready=new Promise((r,i)=>{n.setLanguage((0,t.fixupLangCode)(d),()=>{r(n)})})}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,t.getL10nFallback)(d,r);return(await this._ready).get(d,r,i)}async translate(d){return(await this._ready).translate(d)}}m.GenericL10n=h},()=>{document.webL10n=function(k,m,R){var t={},n="",h="textContent",a="",d={},r="loading",i=!0;function o(){return m.querySelectorAll('link[type="application/l10n"]')}function c(){var N=m.querySelector('script[type="application/l10n"]');return N?JSON.parse(N.innerHTML):null}function b(N){return N?N.querySelectorAll("*[data-l10n-id]"):[]}function y(N){if(!N)return{};var Q=N.getAttribute("data-l10n-id"),Y=N.getAttribute("data-l10n-args"),B={};if(Y)try{B=JSON.parse(Y)}catch{console.warn("could not parse arguments for #"+Q)}return{id:Q,args:B}}function f(N,Q,Y){Q=Q||function(q){},Y=Y||function(){};var B=new XMLHttpRequest;B.open("GET",N,i),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){B.readyState==4&&(B.status==200||B.status===0?Q(B.responseText):Y())},B.onerror=Y,B.ontimeout=Y;try{B.send(null)}catch{Y()}}function s(N,Q,Y,B){var ie=N.replace(/[^\/]*$/,"")||"./";function q(H){return H.lastIndexOf("\\")<0?H:H.replace(/\\\\/g,"\\").replace(/\\n/g,`
+`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function _(H,$){var C={},P=/^\s*|\s*$/,z=/^\s*#|^\s*$/,ee=/^\s*\[(.*)\]\s*$/,te=/^\s*@import\s+url\((.*)\)\s*$/i,K=/^([^=\s]*)\s*=\s*(.+)$/;function ue(ye,me,we){var ge=ye.replace(P,"").split(/[\r\n]+/),A="*",O=Q.split("-",1)[0],M=!1,U="";function Z(){for(;;){if(!ge.length){we();return}var se=ge.shift();if(!z.test(se)){if(me){if(U=ee.exec(se),U){A=U[1].toLowerCase(),M=A!=="*"&&A!==Q&&A!==O;continue}else if(M)continue;if(U=te.exec(se),U){fe(ie+U[1],Z);return}}var ne=se.match(K);ne&&ne.length==3&&(C[ne[1]]=q(ne[2]))}}}Z()}function fe(ye,me){f(ye,function(we){ue(we,!1,me)},function(){console.warn(ye+" not found."),me()})}ue(H,!0,function(){$(C)})}f(N,function(H){n+=H,_(H,function($){for(var C in $){var P,z,ee=C.lastIndexOf(".");ee>0?(P=C.substring(0,ee),z=C.substring(ee+1)):(P=C,z=h),t[P]||(t[P]={}),t[P][z]=$[C]}Y&&Y()})},B)}function g(N,Q){N&&(N=N.toLowerCase()),Q=Q||function(){},S(),a=N;var Y=o(),B=Y.length;if(B===0){var ie=c();if(ie&&ie.locales&&ie.default_locale){if(console.log("using the embedded JSON directory, early way out"),t=ie.locales[N],!t){var q=ie.default_locale.toLowerCase();for(var _ in ie.locales)if(_=_.toLowerCase(),_===N){t=ie.locales[N];break}else _===q&&(t=ie.locales[q])}Q()}else console.log("no resource to load, early way out");r="complete";return}var H=null,$=0;H=function(){$++,$>=B&&(Q(),r="complete")};function C(ee){var te=ee.href;this.load=function(K,ue){s(te,K,ue,function(){console.warn(te+" not found."),console.warn('"'+K+'" resource not found'),a="",ue()})}}for(var P=0;P0&&(ie=N.substring(B+1),N=N.substring(0,B));var q;Y&&(q={},q[ie]=Y);var _=w(N,Q,q);return _&&ie in _?_[ie]:"{{"+N+"}}"},getData:function(){return t},getText:function(){return n},getLanguage:function(){return a},setLanguage:function(N,Q){g(N,function(){Q&&Q()})},getDirection:function(){var N=["ar","he","fa","ps","ur"],Q=a.split("-",1)[0];return N.indexOf(Q)>=0?"rtl":"ltr"},translate:j,getReadyState:function(){return r},ready:function(N){if(N)r=="complete"||r=="interactive"?k.setTimeout(function(){N()}):m.addEventListener&&m.addEventListener("localized",function Q(){m.removeEventListener("localized",Q),N()});else return}}}(window,document)},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFFindController=m.FindState=void 0;var t=R(2),n=R(4),h=R(11);function a(oe,J){r(oe,J),J.add(oe)}function d(oe,J,pe){r(oe,J),J.set(oe,pe)}function r(oe,J){if(J.has(oe))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(oe,J){var pe=y(oe,J,"get");return o(oe,pe)}function o(oe,J){return J.get?J.get.call(oe):J.value}function c(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to get private field on non-instance");return pe}function b(oe,J,pe){var ke=y(oe,J,"set");return f(oe,ke,pe),pe}function y(oe,J,pe){if(!J.has(oe))throw new TypeError("attempted to "+pe+" private field on non-instance");return J.get(oe)}function f(oe,J,pe){if(J.set)J.set.call(oe,pe);else{if(!J.writable)throw new TypeError("attempted to set read only private field");J.value=pe}}const s={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};m.FindState=s;const g=250,S=-50,D=-400,w={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},x=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let F;const X=/\p{M}+/gu,G=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,j=/([^\p{M}])\p{M}*$/u,N=/^\p{M}*([^\p{M}])/u,Q=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Y=new Map,B="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",ie=new Map;let q=null,_=null;function H(oe){const J=[];let pe;for(;(pe=Q.exec(oe))!==null;){let{index:dt}=pe;for(const ot of pe[0]){let lt=Y.get(ot);lt||(lt=ot.normalize("NFD").length,Y.set(ot,lt)),J.push([lt,dt++])}}let ke;if(J.length===0&&q)ke=q;else if(J.length>0&&_)ke=_;else{const at=`([${Object.keys(w).join("")}])|([①-⑳Ⓐ-⓿㉄-㊿㋐-㋾-])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[-ヿ])\\n)|(\\n)`;J.length===0?ke=q=new RegExp(at+"|(\\u0000)","gum"):ke=_=new RegExp(at+`|(${B})`,"gum")}const Re=[];for(;(pe=X.exec(oe))!==null;)Re.push([pe[0].length,pe.index]);let Be=oe.normalize("NFD");const Ne=[[0,0]];let Ge=0,Xe=0,ze=0,Ke=0,Qe=0,Je=!1;return Be=Be.replace(ke,(dt,ot,lt,bt,at,yt,Mt,At,St,st)=>{var ht;if(st-=Ke,ot){const ft=w[ot],gt=ft.length;for(let mt=1;mtGe[0]>=ke);oe[Be][0]>ke&&--Be;let Ne=(0,t.binarySearchFirstItem)(oe,Ge=>Ge[0]>=Re,Be);return oe[Ne][0]>Re&&--Ne,[ke+oe[Be][1],pe+oe[Ne][1]-oe[Be][1]]}var C=new WeakMap,P=new WeakMap,z=new WeakSet,ee=new WeakSet,te=new WeakMap,K=new WeakSet,ue=new WeakSet,fe=new WeakSet,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet,Z=new WeakSet,se=new WeakSet,ne=new WeakSet,re=new WeakSet,ve=new WeakSet,he=new WeakSet;class be{constructor(J){let{linkService:pe,eventBus:ke,updateMatchesCountOnProgress:Re=!0}=J;a(this,he),a(this,ve),a(this,re),a(this,ne),a(this,se),a(this,Z),a(this,U),a(this,M),a(this,O),a(this,A),a(this,ge),a(this,we),a(this,me),a(this,ye),a(this,fe),a(this,ue),a(this,K),d(this,te,{get:Ie,set:void 0}),a(this,ee),a(this,z),d(this,C,{writable:!0,value:!0}),d(this,P,{writable:!0,value:0}),this._linkService=pe,this._eventBus=ke,b(this,C,Re),c(this,ee,Te).call(this),ke._on("find",c(this,z,Ce).bind(this)),ke._on("findbarclose",c(this,ne,Ee).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(J){this._pdfDocument&&c(this,ee,Te).call(this),J&&(this._pdfDocument=J,this._firstPageCapability.resolve())}scrollMatchIntoView(J){let{element:pe=null,selectedLeft:ke=0,pageIndex:Re=-1,matchIndex:Be=-1}=J;if(!this._scrollMatches||!pe)return;if(Be===-1||Be!==this._selected.matchIdx)return;if(Re===-1||Re!==this._selected.pageIdx)return;this._scrollMatches=!1;const Ne={top:S,left:ke+D};(0,t.scrollIntoView)(pe,Ne,!0)}}m.PDFFindController=be;function Ce(oe){if(!oe)return;const J=this._pdfDocument,{type:pe}=oe;(this._state===null||c(this,K,He).call(this,oe))&&(this._dirtyMatch=!0),this._state=oe,pe!=="highlightallchange"&&c(this,he,$e).call(this,s.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||J&&this._pdfDocument!==J)return;c(this,we,de).call(this);const ke=!this._highlightMatches,Re=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),pe?this._dirtyMatch?c(this,O,Fe).call(this):pe==="again"?(c(this,O,Fe).call(this),ke&&this._state.highlightAll&&c(this,A,De).call(this)):pe==="highlightallchange"?(Re?c(this,O,Fe).call(this):this._highlightMatches=!0,c(this,A,De).call(this)):c(this,O,Fe).call(this):this._findTimeout=setTimeout(()=>{c(this,O,Fe).call(this),this._findTimeout=null},g)})}function Te(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],b(this,P,0),this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,n.createPromiseCapability)()}function Ie(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,[this._normalizedQuery]=H(this._state.query)),this._normalizedQuery}function He(oe){if(oe.query!==this._state.query)return!0;switch(oe.type){case"again":const J=this._selected.pageIdx+1,pe=this._linkService;return J>=1&&J<=pe.pagesCount&&J!==pe.page&&!pe.isPageVisible(J);case"highlightallchange":return!1}return!0}function Ve(oe,J,pe){let ke=oe.slice(0,J).match(j);if(ke){const Re=oe.charCodeAt(J),Be=ke[1].charCodeAt(0);if((0,h.getCharacterType)(Re)===(0,h.getCharacterType)(Be))return!1}if(ke=oe.slice(J+pe).match(N),ke){const Re=oe.charCodeAt(J+pe-1),Be=ke[1].charCodeAt(0);if((0,h.getCharacterType)(Re)===(0,h.getCharacterType)(Be))return!1}return!0}function ae(oe,J,pe,ke){const Re=this._pageMatches[pe]=[],Be=this._pageMatchesLength[pe]=[];if(!oe)return;const Ne=this._pageDiffs[pe];let Ge;for(;(Ge=oe.exec(ke))!==null;){if(J&&!c(this,ue,Ve).call(this,ke,Ge.index,Ge[0].length))continue;const[Xe,ze]=$(Ne,Ge.index,Ge[0].length);ze&&(Re.push(Xe),Be.push(ze))}}function T(oe,J){const{matchDiacritics:pe}=this._state;let ke=!1;oe=oe.replace(G,(Be,Ne,Ge,Xe,ze,Ke)=>Ne?`[ ]*\\${Ne}[ ]*`:Ge?`[ ]*${Ge}[ ]*`:Xe?"[ ]+":pe?ze||Ke:ze?x.has(ze.charCodeAt(0))?ze:"":J?(ke=!0,`${Ke}\\p{M}*`):Ke);const Re="[ ]*";return oe.endsWith(Re)&&(oe=oe.slice(0,oe.length-Re.length)),pe&&J&&(F||(F=String.fromCharCode(...x)),ke=!0,oe=`${oe}(?=[${F}]|[^\\p{M}]|$)`),[ke,oe]}function V(oe){var J;let pe=i(this,te);if(!pe)return;const{caseSensitive:ke,entireWord:Re,phraseSearch:Be}=this._state,Ne=this._pageContents[oe],Ge=this._hasDiacritics[oe];let Xe=!1;if(Be)[Xe,pe]=c(this,ye,T).call(this,pe,Ge);else{const Qe=pe.match(/\S+/g);Qe&&(pe=Qe.sort().reverse().map(Je=>{const[dt,ot]=c(this,ye,T).call(this,Je,Ge);return Xe||(Xe=dt),`(${ot})`}).join("|"))}const ze=`g${Xe?"u":""}${ke?"":"i"}`;pe=pe?new RegExp(pe,ze):null,c(this,fe,ae).call(this,pe,Re,oe,Ne),this._state.highlightAll&&c(this,ge,Pe).call(this,oe),this._resumePageIdx===oe&&(this._resumePageIdx=null,c(this,U,Me).call(this));const Ke=this._pageMatches[oe].length;this._matchesCountTotal+=Ke,i(this,C)?Ke>0&&c(this,ve,Oe).call(this):b(this,P,(J=i(this,P),++J))===this._linkService.pagesCount&&c(this,ve,Oe).call(this)}function de(){if(this._extractTextPromises.length>0)return;let oe=Promise.resolve();for(let J=0,pe=this._linkService.pagesCount;Jthis._pdfDocument.getPage(J+1).then(Re=>Re.getTextContent()).then(Re=>{const Be=[];for(const Ne of Re.items)Be.push(Ne.str),Ne.hasEOL&&Be.push(`
+`);[this._pageContents[J],this._pageDiffs[J],this._hasDiacritics[J]]=H(Be.join("")),ke.resolve()},Re=>{console.error(`Unable to get text content for page ${J+1}`,Re),this._pageContents[J]="",this._pageDiffs[J]=null,this._hasDiacritics[J]=!1,ke.resolve()}))}}function Pe(oe){this._scrollMatches&&this._selected.pageIdx===oe&&(this._linkService.page=oe+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:oe})}function De(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}function Fe(){const oe=this._state.findPrevious,J=this._linkService.page-1,pe=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=J,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,b(this,P,0),this._matchesCountTotal=0,c(this,A,De).call(this);for(let Re=0;Re{this._pendingFindMatches.delete(Re),c(this,me,V).call(this,Re)}))}if(!i(this,te)){c(this,he,$e).call(this,s.FOUND);return}if(this._resumePageIdx)return;const ke=this._offset;if(this._pagesToSearch=pe,ke.matchIdx!==null){const Re=this._pageMatches[ke.pageIdx].length;if(!oe&&ke.matchIdx+10){ke.matchIdx=oe?ke.matchIdx-1:ke.matchIdx+1,c(this,se,ce).call(this,!0);return}c(this,Z,Ae).call(this,oe)}c(this,U,Me).call(this)}function _e(oe){const J=this._offset,pe=oe.length,ke=this._state.findPrevious;return pe?(J.matchIdx=ke?pe-1:0,c(this,se,ce).call(this,!0),!0):(c(this,Z,Ae).call(this,ke),J.wrapped&&(J.matchIdx=null,this._pagesToSearch<0)?(c(this,se,ce).call(this,!1),!0):!1)}function Me(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let oe=null;do{const J=this._offset.pageIdx;if(oe=this._pageMatches[J],!oe){this._resumePageIdx=J;break}}while(!c(this,M,_e).call(this,oe))}function Ae(oe){const J=this._offset,pe=this._linkService.pagesCount;J.pageIdx=oe?J.pageIdx-1:J.pageIdx+1,J.matchIdx=null,this._pagesToSearch--,(J.pageIdx>=pe||J.pageIdx<0)&&(J.pageIdx=oe?pe-1:0,J.wrapped=!0)}function ce(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,J=s.NOT_FOUND;const pe=this._offset.wrapped;if(this._offset.wrapped=!1,oe){const ke=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,J=pe?s.WRAPPED:s.FOUND,ke!==-1&&ke!==this._selected.pageIdx&&c(this,ge,Pe).call(this,ke)}c(this,he,$e).call(this,J,this._state.findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,c(this,ge,Pe).call(this,this._selected.pageIdx))}function Ee(oe){const J=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||J&&this._pdfDocument!==J||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),c(this,he,$e).call(this,s.FOUND),this._highlightMatches=!1,c(this,A,De).call(this))})}function We(){const{pageIdx:oe,matchIdx:J}=this._selected;let pe=0,ke=this._matchesCountTotal;if(J!==-1){for(let Be=0;Beke)&&(pe=ke=0),{current:pe,total:ke}}function Oe(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:c(this,re,We).call(this)})}function $e(oe){var J;let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;!i(this,C)&&(i(this,P)!==this._linkService.pagesCount||oe===s.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:oe,previous:pe,matchesCount:c(this,re,We).call(this),rawQuery:((J=this._state)===null||J===void 0?void 0:J.query)??null})}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CharacterType=void 0,m.getCharacterType=y;const R={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};m.CharacterType=R;function t(f){return f<11904}function n(f){return(f&65408)===0}function h(f){return f>=97&&f<=122||f>=65&&f<=90}function a(f){return f>=48&&f<=57}function d(f){return f===32||f===9||f===13||f===10}function r(f){return f>=13312&&f<=40959||f>=63744&&f<=64255}function i(f){return f>=12448&&f<=12543}function o(f){return f>=12352&&f<=12447}function c(f){return f>=65376&&f<=65439}function b(f){return(f&65408)===3584}function y(f){return t(f)?n(f)?d(f)?R.SPACE:h(f)||a(f)||f===95?R.ALPHA_LETTER:R.PUNCT:b(f)?R.THAI_LETTER:f===160?R.SPACE:R.ALPHA_LETTER:r(f)?R.HAN_LETTER:i(f)?R.KATAKANA_LETTER:o(f)?R.HIRAGANA_LETTER:c(f)?R.HALFWIDTH_KATAKANA_LETTER:R.ALPHA_LETTER}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFHistory=void 0,m.isDestArraysEqual=c,m.isDestHashesEqual=o;var t=R(2),n=R(7);const h=1e3,a=50,d=1e3;function r(){return document.location.hash}class i{constructor(y){let{linkService:f,eventBus:s}=y;this.linkService=f,this.eventBus=s,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",g=>{this._isPagesLoaded=!!g.pagesCount},{once:!0})})}initialize(y){let{fingerprint:f,resetHistory:s=!1,updateUrl:g=!1}=y;if(!f||typeof f!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const S=this._fingerprint!==""&&this._fingerprint!==f;this._fingerprint=f,this._updateUrl=g===!0,this._initialized=!0,this._bindEvents();const D=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=r(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(D,!0)||s){const{hash:x,page:F,rotation:X}=this._parseCurrentHash(!0);if(!x||S||s){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:x,page:F,rotation:X},!0);return}const w=D.destination;this._updateInternalState(w,D.uid,!0),w.rotation!==void 0&&(this._initialRotation=w.rotation),w.dest?(this._initialBookmark=JSON.stringify(w.dest),this._destination.page=null):w.hash?this._initialBookmark=w.hash:w.page&&(this._initialBookmark=`page=${w.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push(y){let{namedDest:f=null,explicitDest:s,pageNumber:g}=y;if(!this._initialized)return;if(f&&typeof f!="string"){console.error(`PDFHistory.push: "${f}" is not a valid namedDest parameter.`);return}else if(Array.isArray(s)){if(!this._isValidPage(g)&&(g!==null||this._destination)){console.error(`PDFHistory.push: "${g}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${s}" is not a valid explicitDest parameter.`);return}const S=f||JSON.stringify(s);if(!S)return;let D=!1;if(this._destination&&(o(this._destination.hash,S)||c(this._destination.dest,s))){if(this._destination.page)return;D=!0}this._popStateInProgress&&!D||(this._pushOrReplaceState({dest:s,hash:S,page:g,rotation:this.linkService.rotation},D),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(y){var f;if(this._initialized){if(!this._isValidPage(y)){console.error(`PDFHistory.pushPage: "${y}" is not a valid page number.`);return}((f=this._destination)===null||f===void 0?void 0:f.page)!==y&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${y}`,page:y,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const y=window.history.state;this._isValidState(y)&&y.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const y=window.history.state;this._isValidState(y)&&y.uid0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(y){const s=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||!this._destination,g={fingerprint:this._fingerprint,uid:s?this._uid:this._uid+1,destination:y};this._updateInternalState(y,g.uid);let S;if(this._updateUrl&&y!==null&&y!==void 0&&y.hash){const D=document.location.href.split("#")[0];D.startsWith("file://")||(S=`${D}#${y.hash}`)}s?window.history.replaceState(g,"",S):window.history.pushState(g,"",S)}_tryPushCurrentPosition(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this._position)return;let f=this._position;if(y&&(f=Object.assign(Object.create(null),this._position),f.temporary=!0),!this._destination){this._pushOrReplaceState(f);return}if(this._destination.temporary){this._pushOrReplaceState(f,!0);return}if(this._destination.hash===f.hash||!this._destination.page&&this._numPositionUpdates<=a)return;let s=!1;if(this._destination.page>=f.first&&this._destination.page<=f.page){if(this._destination.dest!==void 0||!this._destination.first)return;s=!0}this._pushOrReplaceState(f,s)}_isValidPage(y){return Number.isInteger(y)&&y>0&&y<=this.linkService.pagesCount}_isValidState(y){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!y)return!1;if(y.fingerprint!==this._fingerprint)if(f){if(typeof y.fingerprint!="string"||y.fingerprint.length!==this._fingerprint.length)return!1;const[s]=performance.getEntriesByType("navigation");if((s==null?void 0:s.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(y.uid)||y.uid<0||y.destination===null||typeof y.destination!="object")}_updateInternalState(y,f){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),s&&y!==null&&y!==void 0&&y.temporary&&delete y.temporary,this._destination=y,this._uid=f,this._maxUid=Math.max(this._maxUid,f),this._numPositionUpdates=0}_parseCurrentHash(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const f=unescape(r()).substring(1),s=(0,t.parseQueryString)(f),g=s.get("nameddest")||"";let S=s.get("page")|0;return(!this._isValidPage(S)||y&&g.length>0)&&(S=null),{hash:f,page:S,rotation:this.linkService.rotation}}_updateViewarea(y){let{location:f}=y;this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:f.pdfOpenParams.substring(1),page:this.linkService.page,first:f.pageNumber,rotation:f.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null},d))}_popState(y){let{state:f}=y;const s=r(),g=this._currentHash!==s;if(this._currentHash=s,!f){this._uid++;const{hash:D,page:w,rotation:x}=this._parseCurrentHash();this._pushOrReplaceState({hash:D,page:w,rotation:x},!0);return}if(!this._isValidState(f))return;this._popStateInProgress=!0,g&&(this._blockHashChange++,(0,n.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:h}).then(()=>{this._blockHashChange--}));const S=f.destination;this._updateInternalState(S,f.uid,!0),(0,t.isValidRotation)(S.rotation)&&(this.linkService.rotation=S.rotation),S.dest?this.linkService.goToDestination(S.dest):S.hash?this.linkService.setHash(S.hash):S.page&&(this.linkService.page=S.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}_pageHide(){(!this._destination||this._destination.temporary)&&this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}m.PDFHistory=i;function o(b,y){return typeof b!="string"||typeof y!="string"?!1:b===y||(0,t.parseQueryString)(b).get("nameddest")===y}function c(b,y){function f(s,g){if(typeof s!=typeof g||Array.isArray(s)||Array.isArray(g))return!1;if(s!==null&&typeof s=="object"&&g!==null){if(Object.keys(s).length!==Object.keys(g).length)return!1;for(const S in s)if(!f(s[S],g[S]))return!1;return!0}return s===g||Number.isNaN(s)&&Number.isNaN(g)}if(!(Array.isArray(b)&&Array.isArray(y))||b.length!==y.length)return!1;for(let s=0,g=b.length;s{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFPageView=void 0;var t=R(4),n=R(2),h=R(14),a=R(3),d=R(15),r=R(5),i=R(1),o=R(16),c=R(17),b=R(18),y=R(19),f=R(20);function s(O,M){S(O,M),M.add(O)}function g(O,M,U){S(O,M),M.set(O,U)}function S(O,M){if(M.has(O))throw new TypeError("Cannot initialize the same private elements twice on an object")}function D(O,M){var U=X(O,M,"get");return w(O,U)}function w(O,M){return M.get?M.get.call(O):M.value}function x(O,M,U){if(!M.has(O))throw new TypeError("attempted to get private field on non-instance");return U}function F(O,M,U){var Z=X(O,M,"set");return G(O,Z,U),U}function X(O,M,U){if(!M.has(O))throw new TypeError("attempted to "+U+" private field on non-instance");return M.get(O)}function G(O,M,U){if(M.set)M.set.call(O,U);else{if(!M.writable)throw new TypeError("attempted to set read only private field");M.value=U}}const j=d.compatibilityParams.maxCanvasPixels||16777216,N=()=>({annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new i.SimpleLinkService}});var Q=new WeakMap,Y=new WeakMap,B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakMap,H=new WeakSet,$=new WeakSet,C=new WeakSet,P=new WeakSet,z=new WeakSet,ee=new WeakSet,te=new WeakSet;class K{constructor(M){var U;s(this,te),s(this,ee),s(this,z),s(this,P),s(this,C),s(this,$),s(this,H),g(this,Q,{writable:!0,value:t.AnnotationMode.ENABLE_FORMS}),g(this,Y,{writable:!0,value:null}),g(this,B,{writable:!0,value:null}),g(this,ie,{writable:!0,value:null}),g(this,q,{writable:!0,value:n.RenderingStates.INITIAL}),g(this,_,{writable:!0,value:{initialOptionalContent:!0,regularAnnotations:!0}});const Z=M.container,se=M.defaultViewport;this.id=M.id,this.renderingId="page"+this.id,F(this,Y,M.layerProperties||N),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=M.scale||n.DEFAULT_SCALE,this.viewport=se,this.pdfPageRotate=se.rotation,this._optionalContentConfigPromise=M.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.textLayerMode=M.textLayerMode??n.TextLayerMode.ENABLE,F(this,Q,M.annotationMode??t.AnnotationMode.ENABLE_FORMS),this.imageResourcesPath=M.imageResourcesPath||"",this.useOnlyCssZoom=M.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=M.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=M.maxCanvasPixels||j,this.pageColors=M.pageColors||null,this.eventBus=M.eventBus,this.renderingQueue=M.renderingQueue,this.renderer=M.renderer||n.RendererType.CANVAS,this.l10n=M.l10n||r.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.resume=null,this._renderError=null,this._isStandalone=!((U=this.renderingQueue)!==null&&U!==void 0&&U.hasViewer()),this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const ne=document.createElement("div");if(ne.className="page",ne.setAttribute("data-page-number",this.id),ne.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then(re=>{ne.setAttribute("aria-label",re)}),this.div=ne,x(this,H,ue).call(this),Z==null||Z.append(ne),this._isStandalone){Z==null||Z.style.setProperty("--scale-factor",this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:re}=M;re&&re.then(ve=>{re===this._optionalContentConfigPromise&&(D(this,_).initialOptionalContent=ve.hasInitialVisibility)})}}get renderingState(){return D(this,q)}set renderingState(M){if(M!==D(this,q))switch(F(this,q,M),D(this,B)&&(clearTimeout(D(this,B)),F(this,B,null)),M){case n.RenderingStates.PAUSED:this.div.classList.remove("loading");break;case n.RenderingStates.RUNNING:this.div.classList.add("loadingIcon"),F(this,B,setTimeout(()=>{this.div.classList.add("loading"),F(this,B,null)},0));break;case n.RenderingStates.INITIAL:case n.RenderingStates.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(M){this.pdfPage=M,this.pdfPageRotate=M.rotate;const U=(this.rotation+this.pdfPageRotate)%360;this.viewport=M.getViewport({scale:this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:U}),x(this,H,ue).call(this),this.reset()}destroy(){var M;this.reset(),(M=this.pdfPage)===null||M===void 0||M.cleanup()}get _textHighlighter(){return(0,t.shadow)(this,"_textHighlighter",new b.TextHighlighter({pageIndex:this.id-1,eventBus:this.eventBus,findController:D(this,Y).call(this).findController}))}_resetZoomLayer(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.zoomLayer)return;const U=this.zoomLayer.firstChild;this.paintedViewportMap.delete(U),U.width=0,U.height=0,M&&this.zoomLayer.remove(),this.zoomLayer=null}reset(){var M,U,Z,se,ne;let{keepZoomLayer:re=!1,keepAnnotationLayer:ve=!1,keepAnnotationEditorLayer:he=!1,keepXfaLayer:be=!1,keepTextLayer:Ce=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.cancelRendering({keepAnnotationLayer:ve,keepAnnotationEditorLayer:he,keepXfaLayer:be,keepTextLayer:Ce}),this.renderingState=n.RenderingStates.INITIAL;const Te=this.div,Ie=Te.childNodes,He=re&&this.zoomLayer||null,Ve=ve&&((M=this.annotationLayer)===null||M===void 0?void 0:M.div)||null,ae=he&&((U=this.annotationEditorLayer)===null||U===void 0?void 0:U.div)||null,T=be&&((Z=this.xfaLayer)===null||Z===void 0?void 0:Z.div)||null,V=Ce&&((se=this.textLayer)===null||se===void 0?void 0:se.div)||null;for(let de=Ie.length-1;de>=0;de--){const Pe=Ie[de];switch(Pe){case He:case Ve:case ae:case T:case V:continue}Pe.remove()}Te.removeAttribute("data-loaded"),Ve&&this.annotationLayer.hide(),ae&&this.annotationEditorLayer.hide(),T&&this.xfaLayer.hide(),V&&this.textLayer.hide(),(ne=this.structTreeLayer)===null||ne===void 0||ne.hide(),He||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg)}update(M){let{scale:U=0,rotation:Z=null,optionalContentConfigPromise:se=null,drawingDelay:ne=-1}=M;this.scale=U||this.scale,typeof Z=="number"&&(this.rotation=Z),se instanceof Promise&&(this._optionalContentConfigPromise=se,se.then(Ce=>{se===this._optionalContentConfigPromise&&(D(this,_).initialOptionalContent=Ce.hasInitialVisibility)}));const re=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*t.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:re}),x(this,H,ue).call(this),this._isStandalone){var ve;(ve=this.div.parentNode)===null||ve===void 0||ve.style.setProperty("--scale-factor",this.viewport.scale)}if(this.svg){this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!0}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}let he=!1;if(this.canvas&&this.maxCanvasPixels>0){const Ce=this.outputScale;(Math.floor(this.viewport.width)*Ce.sx|0)*(Math.floor(this.viewport.height)*Ce.sy|0)>this.maxCanvasPixels&&(he=!0)}const be=ne>=0&&ne<1e3;if(this.canvas){if(be||this.useOnlyCssZoom||this.hasRestrictedScaling&&he){be&&this.renderingState!==n.RenderingStates.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:ne}),this.renderingState=n.RenderingStates.FINISHED),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!be,hideTextLayer:be}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering(){let{keepAnnotationLayer:M=!1,keepAnnotationEditorLayer:U=!1,keepXfaLayer:Z=!1,keepTextLayer:se=!1,cancelExtraDelay:ne=0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.paintTask&&(this.paintTask.cancel(ne),this.paintTask=null),this.resume=null,this.textLayer&&(!se||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationLayer&&(!M||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.annotationEditorLayer&&(!U||!this.annotationEditorLayer.div)&&(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!Z||!this.xfaLayer.div)){var re;this.xfaLayer.cancel(),this.xfaLayer=null,(re=this._textHighlighter)===null||re===void 0||re.disable()}}cssTransform(M){let{target:U,redrawAnnotationLayer:Z=!1,redrawAnnotationEditorLayer:se=!1,redrawXfaLayer:ne=!1,redrawTextLayer:re=!1,hideTextLayer:ve=!1}=M;if(U instanceof HTMLCanvasElement){if(!U.hasAttribute("zooming")){U.setAttribute("zooming",!0);const{style:Ce}=U;Ce.width=Ce.height=""}}else{const Ce=this.div,{width:Te,height:Ie}=this.viewport;U.style.width=U.parentNode.style.width=Ce.style.width=Math.floor(Te)+"px",U.style.height=U.parentNode.style.height=Ce.style.height=Math.floor(Ie)+"px"}const he=this.paintedViewportMap.get(U);if(this.viewport!==he){const Ce=this.viewport.rotation-he.rotation,Te=Math.abs(Ce);let Ie=1,He=1;if(Te===90||Te===270){const{width:Ve,height:ae}=this.viewport;Ie=ae/Ve,He=Ve/ae}Te!==0&&(U.style.transform=`rotate(${Ce}deg) scale(${Ie}, ${He})`)}if(Z&&this.annotationLayer&&x(this,$,fe).call(this),se&&this.annotationEditorLayer&&x(this,C,ye).call(this),ne&&this.xfaLayer&&x(this,P,me).call(this),this.textLayer)if(ve){var be;this.textLayer.hide(),(be=this.structTreeLayer)===null||be===void 0||be.hide()}else re&&x(this,z,we).call(this)}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(M,U){return this.viewport.convertToPdfPoint(M,U)}draw(){var M=this;this.renderingState!==n.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:U,pdfPage:Z}=this;if(!Z)return this.renderingState=n.RenderingStates.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=n.RenderingStates.RUNNING;const se=document.createElement("div");if(se.classList.add("canvasWrapper"),U.append(se),!this.textLayer&&this.textLayerMode!==n.TextLayerMode.DISABLE&&!Z.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new c.TextAccessibilityManager),this.textLayer=new y.TextLayerBuilder({highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),U.append(this.textLayer.div)),!this.annotationLayer&&D(this,Q)!==t.AnnotationMode.DISABLE){const{annotationStorage:be,downloadManager:Ce,enableScripting:Te,fieldObjectsPromise:Ie,hasJSActionsPromise:He,linkService:Ve}=D(this,Y).call(this);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new a.AnnotationLayerBuilder({pageDiv:U,pdfPage:Z,annotationStorage:be,imageResourcesPath:this.imageResourcesPath,renderForms:D(this,Q)===t.AnnotationMode.ENABLE_FORMS,linkService:Ve,downloadManager:Ce,l10n:this.l10n,enableScripting:Te,hasJSActionsPromise:He,fieldObjectsPromise:Ie,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager})}let ne=null;this.renderingQueue&&(ne=be=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=n.RenderingStates.PAUSED,this.resume=()=>{this.renderingState=n.RenderingStates.RUNNING,be()};return}be()});const re=async function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(ve===M.paintTask&&(M.paintTask=null),be instanceof t.RenderingCancelledException){M._renderError=null;return}if(M._renderError=be,M.renderingState=n.RenderingStates.FINISHED,M._resetZoomLayer(!0),D(M,_).regularAnnotations=!ve.separateAnnots,M.eventBus.dispatch("pagerendered",{source:M,pageNumber:M.id,cssTransform:!1,timestamp:performance.now(),error:M._renderError}),be)throw be},ve=this.renderer===n.RendererType.SVG?this.paintOnSvg(se):this.paintOnCanvas(se);ve.onRenderContinue=ne,this.paintTask=ve;const he=ve.promise.then(()=>re(null).then(async()=>{if(x(this,z,we).call(this),this.annotationLayer&&await x(this,$,fe).call(this),!this.annotationEditorLayer){const{annotationEditorUIManager:be}=D(this,Y).call(this);if(!be)return;this.annotationEditorLayer=new h.AnnotationEditorLayerBuilder({uiManager:be,pageDiv:U,pdfPage:Z,l10n:this.l10n,accessibilityManager:this._accessibilityManager})}x(this,C,ye).call(this)}),function(be){return re(be)});if(Z.isPureXfa){if(this.xfaLayer)this.xfaLayer.div&&U.append(this.xfaLayer.div);else{const{annotationStorage:be,linkService:Ce}=D(this,Y).call(this);this.xfaLayer=new f.XfaLayerBuilder({pageDiv:U,pdfPage:Z,annotationStorage:be,linkService:Ce})}x(this,P,me).call(this)}return U.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),he}paintOnCanvas(M){const U=(0,t.createPromiseCapability)(),Z={promise:U.promise,onRenderContinue(de){de()},cancel(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;V.cancel(de)},get separateAnnots(){return V.separateAnnots}},se=this.viewport,{width:ne,height:re}=se,ve=document.createElement("canvas");ve.setAttribute("role","presentation"),ve.hidden=!0;let he=!0;const be=function(){he&&(ve.hidden=!1,he=!1)};M.append(ve),this.canvas=ve;const Ce=ve.getContext("2d",{alpha:!1}),Te=this.outputScale=new n.OutputScale;if(this.useOnlyCssZoom){const de=se.clone({scale:t.PixelsPerInch.PDF_TO_CSS_UNITS});Te.sx*=de.width/ne,Te.sy*=de.height/re}if(this.maxCanvasPixels>0){const de=ne*re,Pe=Math.sqrt(this.maxCanvasPixels/de);Te.sx>Pe||Te.sy>Pe?(Te.sx=Pe,Te.sy=Pe,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const Ie=(0,n.approximateFraction)(Te.sx),He=(0,n.approximateFraction)(Te.sy);ve.width=(0,n.roundToDivide)(se.width*Te.sx,Ie[0]),ve.height=(0,n.roundToDivide)(se.height*Te.sy,He[0]);const{style:Ve}=ve;Ve.width=(0,n.roundToDivide)(se.width,Ie[1])+"px",Ve.height=(0,n.roundToDivide)(se.height,He[1])+"px",this.paintedViewportMap.set(ve,se);const ae=Te.scaled?[Te.sx,0,0,Te.sy,0,0]:null,T={canvasContext:Ce,transform:ae,viewport:se,annotationMode:D(this,Q),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors},V=this.pdfPage.render(T);return V.onContinue=function(de){be(),Z.onRenderContinue?Z.onRenderContinue(de):de()},V.promise.then(function(){be(),U.resolve()},function(de){de instanceof t.RenderingCancelledException||be(),U.reject(de)}),Z}paintOnSvg(M){let U=!1;const Z=()=>{if(U)throw new t.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},se=this.pdfPage,ne=this.viewport.clone({scale:t.PixelsPerInch.PDF_TO_CSS_UNITS});return{promise:se.getOperatorList({annotationMode:D(this,Q)}).then(ve=>(Z(),new t.SVGGraphics(se.commonObjs,se.objs).getSVG(ve,ne).then(be=>{Z(),this.svg=be,this.paintedViewportMap.set(be,ne),be.style.width=M.style.width,be.style.height=M.style.height,this.renderingState=n.RenderingStates.FINISHED,M.append(be)}))),onRenderContinue(ve){ve()},cancel(){U=!0},get separateAnnots(){return!1}}}setPageLabel(M){this.pageLabel=typeof M=="string"?M:null,this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{initialOptionalContent:M,regularAnnotations:U}=D(this,_);return M&&U?this.canvas:null}}m.PDFPageView=K;function ue(){const{viewport:O}=this;if(this.pdfPage){if(D(this,ie)===O.rotation)return;F(this,ie,O.rotation)}(0,t.setLayerDimensions)(this.div,O,!0,!1)}async function fe(){let O=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(M){console.error(`#renderAnnotationLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:O})}}async function ye(){let O=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(M){console.error(`#renderAnnotationEditorLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("annotationeditorlayerrendered",{source:this,pageNumber:this.id,error:O})}}async function me(){let O=null;try{const M=await this.xfaLayer.render(this.viewport,"display");M!=null&&M.textDivs&&this._textHighlighter&&x(this,te,A).call(this,M.textDivs)}catch(M){console.error(`#renderXfaLayer: "${M}".`),O=M}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:O})}}async function we(){const{pdfPage:O,textLayer:M,viewport:U}=this;if(!M)return;let Z=null;try{if(!M.renderingDone){const se=O.streamTextContent({includeMarkedContent:!0});M.setTextContentSource(se)}await M.render(U)}catch(se){if(se instanceof t.AbortException)return;console.error(`#renderTextLayer: "${se}".`),Z=se}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:M.numTextDivs,error:Z}),x(this,ee,ge).call(this)}async function ge(){var O,M;if(!this.textLayer)return;this.structTreeLayer||(this.structTreeLayer=new o.StructTreeLayerBuilder);const U=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),Z=(O=this.structTreeLayer)===null||O===void 0?void 0:O.render(U);if(Z){var se;(se=this.canvas)===null||se===void 0||se.append(Z)}(M=this.structTreeLayer)===null||M===void 0||M.show()}async function A(O){const M=await this.pdfPage.getTextContent(),U=[];for(const Z of M.items)U.push(Z.str);this._textHighlighter.setTextMapping(O,U),this._textHighlighter.enable()}},(k,m,R)=>{var a;Object.defineProperty(m,"__esModule",{value:!0}),m.AnnotationEditorLayerBuilder=void 0;var t=R(4),n=R(5);class h{constructor(r){nt(this,a,void 0);this.pageDiv=r.pageDiv,this.pdfPage=r.pdfPage,this.accessibilityManager=r.accessibilityManager,this.l10n=r.l10n||n.NullL10n,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,rt(this,a,r.uiManager)}async render(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(i!=="display"||this._cancelled)return;const o=r.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:o}),this.show();return}const c=this.div=document.createElement("div");c.className="annotationEditorLayer",c.tabIndex=0,c.hidden=!0,this.pageDiv.append(c),this.annotationEditorLayer=new t.AnnotationEditorLayer({uiManager:Ue(this,a),div:c,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:o});const b={viewport:o,div:c,annotations:null,intent:i};this.annotationEditorLayer.render(b),this.show()}cancel(){this._cancelled=!0,this.div&&(this.pageDiv=null,this.annotationEditorLayer.destroy(),this.div.remove())}hide(){this.div&&(this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isEmpty||(this.div.hidden=!1)}}a=new WeakMap,m.AnnotationEditorLayerBuilder=h},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.compatibilityParams=m.OptionKind=m.AppOptions=void 0;const R=Object.create(null);m.compatibilityParams=R;{const d=navigator.userAgent||"",r=navigator.platform||"",i=navigator.maxTouchPoints||1,o=/Android/.test(d),c=/\b(iPad|iPhone|iPod)(?=;)/.test(d)||r==="MacIntel"&&i>1;(function(){(c||o)&&(R.maxCanvasPixels=5242880)})()}const t={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};m.OptionKind=t;const n={annotationEditorMode:{value:0,kind:t.VIEWER+t.PREFERENCE},annotationMode:{value:2,kind:t.VIEWER+t.PREFERENCE},cursorToolOnLoad:{value:0,kind:t.VIEWER+t.PREFERENCE},defaultZoomDelay:{value:400,kind:t.VIEWER+t.PREFERENCE},defaultZoomValue:{value:"",kind:t.VIEWER+t.PREFERENCE},disableHistory:{value:!1,kind:t.VIEWER},disablePageLabels:{value:!1,kind:t.VIEWER+t.PREFERENCE},enablePermissions:{value:!1,kind:t.VIEWER+t.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:t.VIEWER+t.PREFERENCE},enableScripting:{value:!0,kind:t.VIEWER+t.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:t.VIEWER},externalLinkTarget:{value:0,kind:t.VIEWER+t.PREFERENCE},historyUpdateUrl:{value:!1,kind:t.VIEWER+t.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:t.VIEWER+t.PREFERENCE},imageResourcesPath:{value:"./images/",kind:t.VIEWER},maxCanvasPixels:{value:16777216,kind:t.VIEWER},forcePageColors:{value:!1,kind:t.VIEWER+t.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:t.VIEWER+t.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:t.VIEWER+t.PREFERENCE},pdfBugEnabled:{value:!1,kind:t.VIEWER+t.PREFERENCE},printResolution:{value:150,kind:t.VIEWER},sidebarViewOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},scrollModeOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},spreadModeOnLoad:{value:-1,kind:t.VIEWER+t.PREFERENCE},textLayerMode:{value:1,kind:t.VIEWER+t.PREFERENCE},useOnlyCssZoom:{value:!1,kind:t.VIEWER+t.PREFERENCE},viewerCssTheme:{value:0,kind:t.VIEWER+t.PREFERENCE},viewOnLoad:{value:0,kind:t.VIEWER+t.PREFERENCE},cMapPacked:{value:!0,kind:t.API},cMapUrl:{value:"../web/cmaps/",kind:t.API},disableAutoFetch:{value:!1,kind:t.API+t.PREFERENCE},disableFontFace:{value:!1,kind:t.API+t.PREFERENCE},disableRange:{value:!1,kind:t.API+t.PREFERENCE},disableStream:{value:!1,kind:t.API+t.PREFERENCE},docBaseUrl:{value:"",kind:t.API},enableXfa:{value:!0,kind:t.API+t.PREFERENCE},fontExtraProperties:{value:!1,kind:t.API},isEvalSupported:{value:!0,kind:t.API},isOffscreenCanvasSupported:{value:!0,kind:t.API},maxImageSize:{value:-1,kind:t.API},pdfBug:{value:!1,kind:t.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:t.API},verbosity:{value:1,kind:t.API},workerPort:{value:null,kind:t.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:t.WORKER}};n.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:t.VIEWER},n.disablePreferences={value:!1,kind:t.VIEWER},n.locale={value:navigator.language||"en-US",kind:t.VIEWER},n.renderer={value:"canvas",kind:t.VIEWER+t.PREFERENCE},n.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:t.VIEWER};const h=Object.create(null);class a{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(r){const i=h[r];if(i!==void 0)return i;const o=n[r];if(o!==void 0)return R[r]??o.value}static getAll(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const i=Object.create(null);for(const o in n){const c=n[o];if(r){if(!(r&c.kind))continue;if(r===t.PREFERENCE){const y=c.value,f=typeof y;if(f==="boolean"||f==="string"||f==="number"&&Number.isInteger(y)){i[o]=y;continue}throw new Error(`Invalid type for preference: ${o}`)}}const b=h[o];i[o]=b!==void 0?b:R[o]??c.value}return i}static set(r,i){h[r]=i}static setAll(r){for(const i in r)h[i]=r[i]}static remove(r){delete h[r]}}m.AppOptions=a,a._hasUserOptions=function(){return Object.keys(h).length>0}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.StructTreeLayerBuilder=void 0;function R(w,x){n(w,x),x.add(w)}function t(w,x,F){n(w,x),x.set(w,F)}function n(w,x){if(x.has(w))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(w,x,F){var X=i(w,x,"set");return a(w,X,F),F}function a(w,x,F){if(x.set)x.set.call(w,F);else{if(!x.writable)throw new TypeError("attempted to set read only private field");x.value=F}}function d(w,x,F){if(!x.has(w))throw new TypeError("attempted to get private field on non-instance");return F}function r(w,x){var F=i(w,x,"get");return o(w,F)}function i(w,x,F){if(!x.has(w))throw new TypeError("attempted to "+F+" private field on non-instance");return x.get(w)}function o(w,x){return x.get?x.get.call(w):x.value}const c={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},b=/^H(\d+)$/;var y=new WeakMap,f=new WeakSet,s=new WeakSet;class g{constructor(){R(this,s),R(this,f),t(this,y,{writable:!0,value:void 0})}get renderingDone(){return r(this,y)!==void 0}render(x){if(r(this,y)!==void 0)return r(this,y);const F=d(this,s,D).call(this,x);return F==null||F.classList.add("structTree"),h(this,y,F)}hide(){r(this,y)&&!r(this,y).hidden&&(r(this,y).hidden=!0)}show(){var x;(x=r(this,y))!==null&&x!==void 0&&x.hidden&&(r(this,y).hidden=!1)}}m.StructTreeLayerBuilder=g;function S(w,x){w.alt!==void 0&&x.setAttribute("aria-label",w.alt),w.id!==void 0&&x.setAttribute("aria-owns",w.id),w.lang!==void 0&&x.setAttribute("lang",w.lang)}function D(w){if(!w)return null;const x=document.createElement("span");if("role"in w){const{role:F}=w,X=F.match(b);X?(x.setAttribute("role","heading"),x.setAttribute("aria-level",X[1])):c[F]&&x.setAttribute("role",c[F])}if(d(this,f,S).call(this,w,x),w.children)if(w.children.length===1&&"id"in w.children[0])d(this,f,S).call(this,w.children[0],x);else for(const F of w.children)x.append(d(this,s,D).call(this,F));return x}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextAccessibilityManager=void 0;var t=R(2);function n(G,j){a(G,j),j.add(G)}function h(G,j,N){a(G,j),j.set(G,N)}function a(G,j){if(j.has(G))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(G,j,N){if(!j.has(G))throw new TypeError("attempted to get private field on non-instance");return N}function r(G,j,N){return i(G,j),N}function i(G,j){if(G!==j)throw new TypeError("Private static access of wrong provenance")}function o(G,j){var N=y(G,j,"get");return c(G,N)}function c(G,j){return j.get?j.get.call(G):j.value}function b(G,j,N){var Q=y(G,j,"set");return f(G,Q,N),N}function y(G,j,N){if(!j.has(G))throw new TypeError("attempted to "+N+" private field on non-instance");return j.get(G)}function f(G,j,N){if(j.set)j.set.call(G,N);else{if(!j.writable)throw new TypeError("attempted to set read only private field");j.value=N}}var s=new WeakMap,g=new WeakMap,S=new WeakMap,D=new WeakMap,w=new WeakSet;class x{constructor(){n(this,w),h(this,s,{writable:!0,value:!1}),h(this,g,{writable:!0,value:null}),h(this,S,{writable:!0,value:new Map}),h(this,D,{writable:!0,value:new Map})}setTextMapping(j){b(this,g,j)}enable(){if(o(this,s))throw new Error("TextAccessibilityManager is already enabled.");if(!o(this,g))throw new Error("Text divs and strings have not been set.");if(b(this,s,!0),b(this,g,o(this,g).slice()),o(this,g).sort(r(x,x,F)),o(this,S).size>0){const j=o(this,g);for(const[N,Q]of o(this,S)){if(!document.getElementById(N)){o(this,S).delete(N);continue}d(this,w,X).call(this,N,j[Q])}}for(const[j,N]of o(this,D))this.addPointerInTextLayer(j,N);o(this,D).clear()}disable(){o(this,s)&&(o(this,D).clear(),b(this,g,null),b(this,s,!1))}removePointerInTextLayer(j){var N;if(!o(this,s)){o(this,D).delete(j);return}const Q=o(this,g);if(!Q||Q.length===0)return;const{id:Y}=j,B=o(this,S).get(Y);if(B===void 0)return;const ie=Q[B];o(this,S).delete(Y);let q=ie.getAttribute("aria-owns");(N=q)!==null&&N!==void 0&&N.includes(Y)&&(q=q.split(" ").filter(_=>_!==Y).join(" "),q?ie.setAttribute("aria-owns",q):(ie.removeAttribute("aria-owns"),ie.setAttribute("role","presentation")))}addPointerInTextLayer(j,N){const{id:Q}=j;if(!Q)return;if(!o(this,s)){o(this,D).set(j,N);return}N&&this.removePointerInTextLayer(j);const Y=o(this,g);if(!Y||Y.length===0)return;const B=(0,t.binarySearchFirstItem)(Y,q=>r(x,x,F).call(x,j,q)<0),ie=Math.max(0,B-1);d(this,w,X).call(this,Q,Y[ie]),o(this,S).set(Q,ie)}moveElementInDOM(j,N,Q,Y){if(this.addPointerInTextLayer(Q,Y),!j.hasChildNodes()){j.append(N);return}const B=Array.from(j.childNodes).filter(_=>_!==N);if(B.length===0)return;const ie=Q||N,q=(0,t.binarySearchFirstItem)(B,_=>r(x,x,F).call(x,ie,_)<0);q===0?B[0].before(N):B[q-1].after(N)}}m.TextAccessibilityManager=x;function F(G,j){const N=G.getBoundingClientRect(),Q=j.getBoundingClientRect();if(N.width===0&&N.height===0)return 1;if(Q.width===0&&Q.height===0)return-1;const Y=N.y,B=N.y+N.height,ie=N.y+N.height/2,q=Q.y,_=Q.y+Q.height,H=Q.y+Q.height/2;if(ie<=q&&H>=B)return-1;if(H<=Y&&ie>=_)return 1;const $=N.x+N.width/2,C=Q.x+Q.width/2;return $-C}function X(G,j){const N=j.getAttribute("aria-owns");N!=null&&N.includes(G)||j.setAttribute("aria-owns",N?`${N} ${G}`:G),j.removeAttribute("role")}},(k,m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextHighlighter=void 0;class R{constructor(n){let{findController:h,eventBus:a,pageIndex:d}=n;this.findController=h,this.matches=[],this.eventBus=a,this.pageIdx=d,this._onUpdateTextLayerMatches=null,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(n,h){this.textDivs=n,this.textContentItemsStr=h}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=n=>{(n.pageIndex===this.pageIdx||n.pageIndex===-1)&&this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches)),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null),this._updateMatches(!0))}_convertMatches(n,h){if(!n)return[];const{textContentItemsStr:a}=this;let d=0,r=0;const i=a.length-1,o=[];for(let c=0,b=n.length;c=r+a[d].length;)r+=a[d].length,d++;d===a.length&&console.error("Could not find a matching mapping");const f={begin:{divIdx:d,offset:y-r}};for(y+=h[c];d!==i&&y>r+a[d].length;)r+=a[d].length,d++;f.end={divIdx:d,offset:y-r},o.push(f)}return o}_renderMatches(n){if(n.length===0)return;const{findController:h,pageIdx:a}=this,{textContentItemsStr:d,textDivs:r}=this,i=a===h.selected.pageIdx,o=h.selected.matchIdx,c=h.state.highlightAll;let b=null;const y={divIdx:-1,offset:void 0};function f(D,w){const x=D.divIdx;return r[x].textContent="",s(x,0,D.offset,w)}function s(D,w,x,F){let X=r[D];if(X.nodeType===Node.TEXT_NODE){const N=document.createElement("span");X.before(N),N.append(X),r[D]=N,X=N}const G=d[D].substring(w,x),j=document.createTextNode(G);if(F){const N=document.createElement("span");return N.className=`${F} appended`,N.append(j),X.append(N),F.includes("selected")?N.offsetLeft:0}return X.append(j),0}let g=o,S=g+1;if(c)g=0,S=n.length;else if(!i)return;for(let D=g;D0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.enabled&&!n)return;const{findController:h,matches:a,pageIdx:d}=this,{textContentItemsStr:r,textDivs:i}=this;let o=-1;for(const y of a){const f=Math.max(o,y.begin.divIdx);for(let s=f,g=y.end.divIdx;s<=g;s++){const S=i[s];S.textContent=r[s],S.className=""}o=y.end.divIdx+1}if(!(h!=null&&h.highlightMatches)||n)return;const c=h.pageMatches[d]||null,b=h.pageMatchesLength[d]||null;this.matches=this._convertMatches(c,b),this._renderMatches(this.matches)}}m.TextHighlighter=R},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.TextLayerBuilder=void 0;var t=R(4);function n(F,X){a(F,X),X.add(F)}function h(F,X,G){a(F,X),X.set(F,G)}function a(F,X){if(X.has(F))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(F,X,G){var j=o(F,X,"set");return r(F,j,G),G}function r(F,X,G){if(X.set)X.set.call(F,G);else{if(!X.writable)throw new TypeError("attempted to set read only private field");X.value=G}}function i(F,X){var G=o(F,X,"get");return c(F,G)}function o(F,X,G){if(!X.has(F))throw new TypeError("attempted to "+G+" private field on non-instance");return X.get(F)}function c(F,X){return X.get?X.get.call(F):X.value}function b(F,X,G){if(!X.has(F))throw new TypeError("attempted to get private field on non-instance");return G}var y=new WeakMap,f=new WeakMap,s=new WeakMap,g=new WeakSet,S=new WeakSet;class D{constructor(X){let{highlighter:G=null,accessibilityManager:j=null,isOffscreenCanvasSupported:N=!0}=X;n(this,S),n(this,g),h(this,y,{writable:!0,value:0}),h(this,f,{writable:!0,value:0}),h(this,s,{writable:!0,value:null}),this.textContentItemsStr=[],this.renderingDone=!1,this.textDivs=[],this.textDivProperties=new WeakMap,this.textLayerRenderTask=null,this.highlighter=G,this.accessibilityManager=j,this.isOffscreenCanvasSupported=N,this.div=document.createElement("div"),this.div.className="textLayer",this.hide()}get numTextDivs(){return this.textDivs.length}async render(X){var G,j,N;if(!i(this,s))throw new Error('No "textContentSource" parameter specified.');const Q=X.scale*(globalThis.devicePixelRatio||1),{rotation:Y}=X;if(this.renderingDone){const B=Y!==i(this,y),ie=Q!==i(this,f);(B||ie)&&(this.hide(),(0,t.updateTextLayer)({container:this.div,viewport:X,textDivs:this.textDivs,textDivProperties:this.textDivProperties,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,mustRescale:ie,mustRotate:B}),d(this,f,Q),d(this,y,Y)),this.show();return}this.cancel(),(G=this.highlighter)===null||G===void 0||G.setTextMapping(this.textDivs,this.textContentItemsStr),(j=this.accessibilityManager)===null||j===void 0||j.setTextMapping(this.textDivs),this.textLayerRenderTask=(0,t.renderTextLayer)({textContentSource:i(this,s),container:this.div,viewport:X,textDivs:this.textDivs,textDivProperties:this.textDivProperties,textContentItemsStr:this.textContentItemsStr,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported}),await this.textLayerRenderTask.promise,b(this,g,w).call(this),d(this,f,Q),d(this,y,Y),this.show(),(N=this.accessibilityManager)===null||N===void 0||N.enable()}hide(){if(!this.div.hidden){var X;(X=this.highlighter)===null||X===void 0||X.disable(),this.div.hidden=!0}}show(){if(this.div.hidden&&this.renderingDone){var X;this.div.hidden=!1,(X=this.highlighter)===null||X===void 0||X.enable()}}cancel(){var X,G;this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),(X=this.highlighter)===null||X===void 0||X.disable(),(G=this.accessibilityManager)===null||G===void 0||G.disable(),this.textContentItemsStr.length=0,this.textDivs.length=0,this.textDivProperties=new WeakMap}setTextContentSource(X){this.cancel(),d(this,s,X)}}m.TextLayerBuilder=D;function w(){this.renderingDone=!0;const F=document.createElement("div");F.className="endOfContent",this.div.append(F),b(this,S,x).call(this)}function x(){const{div:F}=this;F.addEventListener("mousedown",X=>{const G=F.querySelector(".endOfContent");if(!G)return;let j=X.target!==F;if(j&&(j=getComputedStyle(G).getPropertyValue("-moz-user-select")!=="none"),j){const N=F.getBoundingClientRect(),Q=Math.max(0,(X.pageY-N.top)/N.height);G.style.top=(Q*100).toFixed(2)+"%"}G.classList.add("active")}),F.addEventListener("mouseup",()=>{const X=F.querySelector(".endOfContent");X&&(X.style.top="",X.classList.remove("active"))})}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.XfaLayerBuilder=void 0;var t=R(4);class n{constructor(a){let{pageDiv:d,pdfPage:r,annotationStorage:i=null,linkService:o,xfaHtml:c=null}=a;this.pageDiv=d,this.pdfPage=r,this.annotationStorage=i,this.linkService=o,this.xfaHtml=c,this.div=null,this._cancelled=!1}async render(a){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(d==="print"){const o={viewport:a.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:d},c=document.createElement("div");return this.pageDiv.append(c),o.div=c,t.XfaLayer.render(o)}const r=await this.pdfPage.getXfa();if(this._cancelled||!r)return{textDivs:[]};const i={viewport:a.clone({dontFlip:!0}),div:this.div,xfaHtml:r,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:d};return this.div?t.XfaLayer.update(i):(this.div=document.createElement("div"),this.pageDiv.append(this.div),i.div=this.div,t.XfaLayer.render(i))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}m.XfaLayerBuilder=n},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFScriptingManager=void 0;var t=R(2),n=R(4);class h{constructor(d){let{eventBus:r,sandboxBundleSrc:i=null,scriptingFactory:o=null,docPropertiesLookup:c=null}=d;this._pdfDocument=null,this._pdfViewer=null,this._closeCapability=null,this._destroyCapability=null,this._scripting=null,this._ready=!1,this._eventBus=r,this._sandboxBundleSrc=i,this._scriptingFactory=o,this._docPropertiesLookup=c,this._scriptingFactory||window.addEventListener("updatefromsandbox",b=>{this._eventBus.dispatch("updatefromsandbox",{source:window,detail:b.detail})})}setViewer(d){this._pdfViewer=d}async setDocument(d){var r;if(this._pdfDocument&&await this._destroyScripting(),this._pdfDocument=d,!d)return;const[i,o,c]=await Promise.all([d.getFieldObjects(),d.getCalculationOrderIds(),d.getJSActions()]);if(!i&&!c){await this._destroyScripting();return}if(d===this._pdfDocument){try{this._scripting=this._createScripting()}catch(b){console.error(`PDFScriptingManager.setDocument: "${b==null?void 0:b.message}".`),await this._destroyScripting();return}this._internalEvents.set("updatefromsandbox",b=>{(b==null?void 0:b.source)===window&&this._updateFromSandbox(b.detail)}),this._internalEvents.set("dispatcheventinsandbox",b=>{var y;(y=this._scripting)===null||y===void 0||y.dispatchEventInSandbox(b.detail)}),this._internalEvents.set("pagechanging",b=>{let{pageNumber:y,previous:f}=b;y!==f&&(this._dispatchPageClose(f),this._dispatchPageOpen(y))}),this._internalEvents.set("pagerendered",b=>{let{pageNumber:y}=b;this._pageOpenPending.has(y)&&y===this._pdfViewer.currentPageNumber&&this._dispatchPageOpen(y)}),this._internalEvents.set("pagesdestroy",async b=>{var y,f;await this._dispatchPageClose(this._pdfViewer.currentPageNumber),await((y=this._scripting)===null||y===void 0?void 0:y.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(f=this._closeCapability)===null||f===void 0||f.resolve()});for(const[b,y]of this._internalEvents)this._eventBus._on(b,y);try{const b=await this._getDocProperties();if(d!==this._pdfDocument)return;await this._scripting.createSandbox({objects:i,calculationOrder:o,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...b,actions:c}}),this._eventBus.dispatch("sandboxcreated",{source:this})}catch(b){console.error(`PDFScriptingManager.setDocument: "${b==null?void 0:b.message}".`),await this._destroyScripting();return}await((r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"Open"})),await this._dispatchPageOpen(this._pdfViewer.currentPageNumber,!0),Promise.resolve().then(()=>{d===this._pdfDocument&&(this._ready=!0)})}}async dispatchWillSave(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(d){var r;return(r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var d;return((d=this._destroyCapability)===null||d===void 0?void 0:d.promise)||null}get ready(){return this._ready}get _internalEvents(){return(0,n.shadow)(this,"_internalEvents",new Map)}get _pageOpenPending(){return(0,n.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,n.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(d){const r=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:i,siblings:o,command:c,value:b}=d;if(!i){switch(c){case"clear":console.clear();break;case"error":console.error(b);break;case"layout":{if(r)return;const s=(0,t.apiPageLayoutToViewerModes)(b);this._pdfViewer.spreadMode=s.spreadMode;break}case"page-num":this._pdfViewer.currentPageNumber=b+1;break;case"print":await this._pdfViewer.pagesPromise,this._eventBus.dispatch("print",{source:this});break;case"println":console.log(b);break;case"zoom":if(r)return;this._pdfViewer.currentScaleValue=b;break;case"SaveAs":this._eventBus.dispatch("download",{source:this});break;case"FirstPage":this._pdfViewer.currentPageNumber=1;break;case"LastPage":this._pdfViewer.currentPageNumber=this._pdfViewer.pagesCount;break;case"NextPage":this._pdfViewer.nextPage();break;case"PrevPage":this._pdfViewer.previousPage();break;case"ZoomViewIn":if(r)return;this._pdfViewer.increaseScale();break;case"ZoomViewOut":if(r)return;this._pdfViewer.decreaseScale();break}return}if(r&&d.focus)return;delete d.id,delete d.siblings;const y=o?[i,...o]:[i];for(const s of y){const g=document.querySelector(`[data-element-id="${s}"]`);if(g)g.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:d}));else{var f;(f=this._pdfDocument)===null||f===void 0||f.annotationStorage.setValue(s,d)}}}async _dispatchPageOpen(d){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this._pdfDocument,o=this._visitedPages;if(r&&(this._closeCapability=(0,n.createPromiseCapability)()),!this._closeCapability)return;const c=this._pdfViewer.getPageView(d-1);if((c==null?void 0:c.renderingState)!==t.RenderingStates.FINISHED){this._pageOpenPending.add(d);return}this._pageOpenPending.delete(d);const b=(async()=>{var y,f;const s=await(o.has(d)?null:(y=c.pdfPage)===null||y===void 0?void 0:y.getJSActions());i===this._pdfDocument&&await((f=this._scripting)===null||f===void 0?void 0:f.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:d,actions:s}))})();o.set(d,b)}async _dispatchPageClose(d){var r;const i=this._pdfDocument,o=this._visitedPages;if(!this._closeCapability||this._pageOpenPending.has(d))return;const c=o.get(d);c&&(o.set(d,null),await c,i===this._pdfDocument&&await((r=this._scripting)===null||r===void 0?void 0:r.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:d})))}async _getDocProperties(){if(this._docPropertiesLookup)return this._docPropertiesLookup(this._pdfDocument);const{docPropertiesLookup:d}=R(22);return d(this._pdfDocument)}_createScripting(){if(this._destroyCapability=(0,n.createPromiseCapability)(),this._scripting)throw new Error("_createScripting: Scripting already exists.");if(this._scriptingFactory)return this._scriptingFactory.createScripting({sandboxBundleSrc:this._sandboxBundleSrc});const{GenericScripting:d}=R(22);return new d(this._sandboxBundleSrc)}async _destroyScripting(){var d;if(!this._scripting){var r;this._pdfDocument=null,(r=this._destroyCapability)===null||r===void 0||r.resolve();return}this._closeCapability&&(await Promise.race([this._closeCapability.promise,new Promise(i=>{setTimeout(i,1e3)})]).catch(i=>{}),this._closeCapability=null),this._pdfDocument=null;try{await this._scripting.destroySandbox()}catch{}for(const[i,o]of this._internalEvents)this._eventBus._off(i,o);this._internalEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this._scripting=null,this._ready=!1,(d=this._destroyCapability)===null||d===void 0||d.resolve()}}m.PDFScriptingManager=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.GenericScripting=void 0,m.docPropertiesLookup=n;var t=R(4);async function n(a){const d="",r=d.split("#")[0];let{info:i,metadata:o,contentDispositionFilename:c,contentLength:b}=await a.getMetadata();if(!b){const{length:y}=await a.getDownloadInfo();b=y}return{...i,baseURL:r,filesize:b,filename:c||(0,t.getPdfFilenameFromUrl)(d),metadata:o==null?void 0:o.getRaw(),authors:o==null?void 0:o.get("dc:creator"),numPages:a.numPages,URL:d}}class h{constructor(d){this._ready=(0,t.loadScript)(d,!0).then(()=>window.pdfjsSandbox.QuickJSSandbox())}async createSandbox(d){(await this._ready).create(d)}async dispatchEventInSandbox(d){const r=await this._ready;setTimeout(()=>r.dispatchEvent(d),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}m.GenericScripting=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFSinglePageViewer=void 0;var t=R(2),n=R(24);class h extends n.PDFViewer{_resetView(){super._resetView(),this._scrollMode=t.ScrollMode.PAGE,this._spreadMode=t.SpreadMode.NONE}set scrollMode(d){}_updateScrollMode(){}set spreadMode(d){}_updateSpreadMode(){}}m.PDFSinglePageViewer=h},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PagesCountLimit=m.PDFViewer=m.PDFPageViewBuffer=void 0;var t=R(4),n=R(2),h=R(5),a=R(13),d=R(25),r=R(1);let i;function o(ae,T){b(ae,T),T.add(ae)}function c(ae,T,V){b(ae,T),T.set(ae,V)}function b(ae,T){if(T.has(ae))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(ae,T,V){if(!T.has(ae))throw new TypeError("attempted to get private field on non-instance");return V}function f(ae,T){var V=S(ae,T,"get");return s(ae,V)}function s(ae,T){return T.get?T.get.call(ae):T.value}function g(ae,T,V){var de=S(ae,T,"set");return D(ae,de,V),V}function S(ae,T,V){if(!T.has(ae))throw new TypeError("attempted to "+V+" private field on non-instance");return T.get(ae)}function D(ae,T,V){if(T.set)T.set.call(ae,V);else{if(!T.writable)throw new TypeError("attempted to set read only private field");T.value=V}}const w=10,x="enablePermissions",F={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};m.PagesCountLimit=F;function X(ae){return Object.values(t.AnnotationEditorType).includes(ae)&&ae!==t.AnnotationEditorType.DISABLE}var G=new WeakMap,j=new WeakMap,N=new WeakSet;i=Symbol.iterator;class Q{constructor(T){o(this,N),c(this,G,{writable:!0,value:new Set}),c(this,j,{writable:!0,value:0}),g(this,j,T)}push(T){const V=f(this,G);V.has(T)&&V.delete(T),V.add(T),V.size>f(this,j)&&y(this,N,Y).call(this)}resize(T){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;g(this,j,T);const de=f(this,G);if(V){const Pe=de.size;let De=1;for(const Fe of de)if(V.has(Fe.id)&&(de.delete(Fe),de.add(Fe)),++De>Pe)break}for(;de.size>f(this,j);)y(this,N,Y).call(this)}has(T){return f(this,G).has(T)}[i](){return f(this,G).keys()}}m.PDFPageViewBuffer=Q;function Y(){const ae=f(this,G).keys().next().value;ae==null||ae.destroy(),f(this,G).delete(ae)}var B=new WeakMap,ie=new WeakMap,q=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,C=new WeakMap,P=new WeakMap,z=new WeakMap,ee=new WeakMap,te=new WeakMap,K=new WeakSet,ue=new WeakSet,fe=new WeakSet,ye=new WeakSet,me=new WeakSet,we=new WeakSet,ge=new WeakSet,A=new WeakSet,O=new WeakSet,M=new WeakSet,U=new WeakSet;class Z{constructor(T){var V,de;o(this,U),o(this,M),o(this,O),o(this,A),o(this,ge),o(this,we),o(this,me),o(this,ye),o(this,fe),o(this,ue),o(this,K),c(this,B,{writable:!0,value:null}),c(this,ie,{writable:!0,value:t.AnnotationEditorType.NONE}),c(this,q,{writable:!0,value:null}),c(this,_,{writable:!0,value:t.AnnotationMode.ENABLE_FORMS}),c(this,H,{writable:!0,value:null}),c(this,$,{writable:!0,value:!1}),c(this,C,{writable:!0,value:0}),c(this,P,{writable:!0,value:new ResizeObserver(y(this,U,Ve).bind(this))}),c(this,z,{writable:!0,value:null}),c(this,ee,{writable:!0,value:null}),c(this,te,{writable:!0,value:null});const Pe="3.4.120";if(t.version!==Pe)throw new Error(`The API version "${t.version}" does not match the Viewer version "${Pe}".`);if(this.container=T.container,this.viewer=T.viewer||T.container.firstElementChild,((V=this.container)===null||V===void 0?void 0:V.tagName)!=="DIV"||((de=this.viewer)===null||de===void 0?void 0:de.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");f(this,P).observe(this.container),this.eventBus=T.eventBus,this.linkService=T.linkService||new r.SimpleLinkService,this.downloadManager=T.downloadManager||null,this.findController=T.findController||null,this._scriptingManager=T.scriptingManager||null,this.textLayerMode=T.textLayerMode??n.TextLayerMode.ENABLE,g(this,_,T.annotationMode??t.AnnotationMode.ENABLE_FORMS),g(this,ie,T.annotationEditorMode??t.AnnotationEditorType.NONE),this.imageResourcesPath=T.imageResourcesPath||"",this.enablePrintAutoRotate=T.enablePrintAutoRotate||!1,this.removePageBorders=T.removePageBorders||!1,this.renderer=T.renderer||n.RendererType.CANVAS,this.useOnlyCssZoom=T.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=T.isOffscreenCanvasSupported??!0,this.maxCanvasPixels=T.maxCanvasPixels,this.l10n=T.l10n||h.NullL10n,g(this,$,T.enablePermissions||!1),this.pageColors=T.pageColors||null,this.pageColors&&!(CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground))&&((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.defaultRenderingQueue=!T.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new d.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=T.renderingQueue,this.scroll=(0,n.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=n.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),y(this,M,He).call(this)}get pagesCount(){return this._pages.length}getPageView(T){return this._pages[T]}get pageViewsReady(){return this._pagesCapability.settled?this._pages.every(function(T){return T==null?void 0:T.pdfPage}):!1}get renderForms(){return f(this,_)===t.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(T){if(!Number.isInteger(T))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(T,!0)||console.error(`currentPageNumber: "${T}" is not a valid page.`))}_setCurrentPageNumber(T){var V;let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this._currentPageNumber===T)return de&&y(this,ge,Ce).call(this),!0;if(!(0=0&&(V=de+1)}this._setCurrentPageNumber(V,!0)||console.error(`currentPageLabel: "${T}" is not a valid page.`)}get currentScale(){return this._currentScale!==n.UNKNOWN_SCALE?this._currentScale:n.DEFAULT_SCALE}set currentScale(T){if(isNaN(T))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(T,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(T){this.pdfDocument&&this._setScale(T,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(T){if(!(0,n.isValidRotation)(T))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(T%=360,T<0&&(T+=360),this._pagesRotation===T))return;this._pagesRotation=T;const V=this._currentPageNumber;this.refresh(!0,{rotation:T}),this._currentScaleValue&&this._setScale(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:T,pageNumber:V}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}setDocument(T){if(this.pdfDocument){var V,de;this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(V=this.findController)===null||V===void 0||V.setDocument(null),(de=this._scriptingManager)===null||de===void 0||de.setDocument(null),f(this,q)&&(f(this,q).destroy(),g(this,q,null))}if(this.pdfDocument=T,!T)return;const Pe=T.numPages,De=T.getPage(1),Fe=T.getOptionalContentConfig(),_e=f(this,$)?T.getPermissions():Promise.resolve();if(Pe>F.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const Me=this._scrollMode=n.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:Me})}this._pagesCapability.promise.then(()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:Pe})},()=>{}),this._onBeforeDraw=Me=>{const Ae=this._pages[Me.pageNumber-1];Ae&&f(this,B).push(Ae)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=Me=>{Me.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:Me.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,f(this,ee)&&(document.removeEventListener("visibilitychange",f(this,ee)),g(this,ee,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([De,_e]).then(Me=>{let[Ae,ce]=Me;if(T!==this.pdfDocument)return;this._firstPageCapability.resolve(Ae),this._optionalContentConfigPromise=Fe;const{annotationEditorMode:Ee,annotationMode:We,textLayerMode:Oe}=y(this,ue,ne).call(this,ce);if(Ee!==t.AnnotationEditorType.DISABLE){const Re=Ee;T.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):X(Re)?(g(this,q,new t.AnnotationEditorUIManager(this.container,this.eventBus,T==null?void 0:T.annotationStorage)),Re!==t.AnnotationEditorType.NONE&&f(this,q).updateMode(Re)):console.error(`Invalid AnnotationEditor mode: ${Re}`)}const $e=y(this,K,se).bind(this),oe=this._scrollMode===n.ScrollMode.PAGE?null:this.viewer,J=this.currentScale,pe=Ae.getViewport({scale:J*t.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",pe.scale);for(let Re=1;Re<=Pe;++Re){const Be=new a.PDFPageView({container:oe,eventBus:this.eventBus,id:Re,scale:J,defaultViewport:pe.clone(),optionalContentConfigPromise:Fe,renderingQueue:this.renderingQueue,textLayerMode:Oe,annotationMode:We,imageResourcesPath:this.imageResourcesPath,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:$e});this._pages.push(Be)}const ke=this._pages[0];ke&&(ke.setPdfPage(Ae),this.linkService.cachePageRef(1,Ae.ref)),this._scrollMode===n.ScrollMode.PAGE?y(this,ye,ve).call(this):this._spreadMode!==n.SpreadMode.NONE&&this._updateSpreadMode(),y(this,fe,re).call(this).then(async()=>{var Re,Be;if((Re=this.findController)===null||Re===void 0||Re.setDocument(T),(Be=this._scriptingManager)===null||Be===void 0||Be.setDocument(T),f(this,q)&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:f(this,ie)}),T.loadingParams.disableAutoFetch||Pe>F.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let Ne=Pe-1;if(Ne<=0){this._pagesCapability.resolve();return}for(let Ge=2;Ge<=Pe;++Ge){const Xe=T.getPage(Ge).then(ze=>{const Ke=this._pages[Ge-1];Ke.pdfPage||Ke.setPdfPage(ze),this.linkService.cachePageRef(Ge,ze.ref),--Ne===0&&this._pagesCapability.resolve()},ze=>{console.error(`Unable to get page ${Ge} to initialize viewer`,ze),--Ne===0&&this._pagesCapability.resolve()});Ge%F.PAUSE_EAGER_PAGE_INIT===0&&await Xe}}),this.eventBus.dispatch("pagesinit",{source:this}),T.getMetadata().then(Re=>{let{info:Be}=Re;T===this.pdfDocument&&Be.Language&&(this.viewer.lang=Be.Language)}),this.defaultRenderingQueue&&this.update()}).catch(Me=>{console.error("Unable to initialize viewer",Me),this._pagesCapability.reject(Me)})}setPageLabels(T){if(this.pdfDocument){T?Array.isArray(T)&&this.pdfDocument.numPages===T.length?this._pageLabels=T:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let de=0,Pe=this._pages.length;de=0&&Fe<1e3;if(this.refresh(!0,{scale:T,drawingDelay:_e?Fe:-1}),_e&&g(this,te,setTimeout(()=>{g(this,te,null),this.refresh()},Fe)),this._currentScale=T,!Pe){let Me=this._currentPageNumber,Ae;this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(Me=this._location.pageNumber,Ae=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:Me,destArray:Ae,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:T,presetValue:De?V:void 0}),this.defaultRenderingQueue&&this.update()}get _pageWidthScaleFactor(){return this._spreadMode!==n.SpreadMode.NONE&&this._scrollMode!==n.ScrollMode.HORIZONTAL?2:1}_setScale(T,V){let de=parseFloat(T);if(de>0)V.preset=!1,this._setScaleUpdatePages(de,T,V);else{const Pe=this._pages[this._currentPageNumber-1];if(!Pe)return;let De=n.SCROLLBAR_PADDING,Fe=n.VERTICAL_PADDING;this.isInPresentationMode?(De=Fe=4,this._spreadMode!==n.SpreadMode.NONE&&(De*=2)):this.removePageBorders?De=Fe=0:this._scrollMode===n.ScrollMode.HORIZONTAL&&([De,Fe]=[Fe,De]);const _e=(this.container.clientWidth-De)/Pe.width*Pe.scale/this._pageWidthScaleFactor,Me=(this.container.clientHeight-Fe)/Pe.height*Pe.scale;switch(T){case"page-actual":de=1;break;case"page-width":de=_e;break;case"page-height":de=Me;break;case"page-fit":de=Math.min(_e,Me);break;case"auto":const Ae=(0,n.isPortraitOrientation)(Pe)?_e:Math.min(Me,_e);de=Math.min(n.MAX_AUTO_SCALE,Ae);break;default:console.error(`_setScale: "${T}" is an unknown zoom value.`);return}V.preset=!0,this._setScaleUpdatePages(de,T,V)}}pageLabelToPageNumber(T){if(!this._pageLabels)return null;const V=this._pageLabels.indexOf(T);return V<0?null:V+1}scrollPageIntoView(T){let{pageNumber:V,destArray:de=null,allowNegativeOffset:Pe=!1,ignoreDestinationZoom:De=!1}=T;if(!this.pdfDocument)return;const Fe=Number.isInteger(V)&&this._pages[V-1];if(!Fe){console.error(`scrollPageIntoView: "${V}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!de){this._setCurrentPageNumber(V,!0);return}let _e=0,Me=0,Ae=0,ce=0,Ee,We;const Oe=Fe.rotation%180!==0,$e=(Oe?Fe.height:Fe.width)/Fe.scale/t.PixelsPerInch.PDF_TO_CSS_UNITS,oe=(Oe?Fe.width:Fe.height)/Fe.scale/t.PixelsPerInch.PDF_TO_CSS_UNITS;let J=0;switch(de[1].name){case"XYZ":_e=de[2],Me=de[3],J=de[4],_e=_e!==null?_e:0,Me=Me!==null?Me:oe;break;case"Fit":case"FitB":J="page-fit";break;case"FitH":case"FitBH":Me=de[2],J="page-width",Me===null&&this._location?(_e=this._location.left,Me=this._location.top):(typeof Me!="number"||Me<0)&&(Me=oe);break;case"FitV":case"FitBV":_e=de[2],Ae=$e,ce=oe,J="page-height";break;case"FitR":_e=de[2],Me=de[3],Ae=de[4]-_e,ce=de[5]-Me;let Be=n.SCROLLBAR_PADDING,Ne=n.VERTICAL_PADDING;this.removePageBorders&&(Be=Ne=0),Ee=(this.container.clientWidth-Be)/Ae/t.PixelsPerInch.PDF_TO_CSS_UNITS,We=(this.container.clientHeight-Ne)/ce/t.PixelsPerInch.PDF_TO_CSS_UNITS,J=Math.min(Math.abs(Ee),Math.abs(We));break;default:console.error(`scrollPageIntoView: "${de[1].name}" is not a valid destination type.`);return}if(De||(J&&J!==this._currentScale?this.currentScaleValue=J:this._currentScale===n.UNKNOWN_SCALE&&(this.currentScaleValue=n.DEFAULT_SCALE_VALUE)),J==="page-fit"&&!de[4]){y(this,me,he).call(this,Fe);return}const pe=[Fe.viewport.convertToViewportPoint(_e,Me),Fe.viewport.convertToViewportPoint(_e+Ae,Me+ce)];let ke=Math.min(pe[0][0],pe[1][0]),Re=Math.min(pe[0][1],pe[1][1]);Pe||(ke=Math.max(ke,0),Re=Math.max(Re,0)),y(this,me,he).call(this,Fe,{left:ke,top:Re})}_updateLocation(T){const V=this._currentScale,de=this._currentScaleValue,Pe=parseFloat(de)===V?Math.round(V*1e4)/100:de,De=T.id,Fe=this._pages[De-1],_e=this.container,Me=Fe.getPagePoint(_e.scrollLeft-T.x,_e.scrollTop-T.y),Ae=Math.round(Me[0]),ce=Math.round(Me[1]);let Ee=`#page=${De}`;this.isInPresentationMode||(Ee+=`&zoom=${Pe},${Ae},${ce}`),this._location={pageNumber:De,scale:Pe,top:ce,left:Ae,rotation:this._pagesRotation,pdfOpenParams:Ee}}update(){const T=this._getVisiblePages(),V=T.views,de=V.length;if(de===0)return;const Pe=Math.max(w,2*de+1);f(this,B).resize(Pe,T.ids),this.renderingQueue.renderHighestPriority(T);const De=this._spreadMode===n.SpreadMode.NONE&&(this._scrollMode===n.ScrollMode.PAGE||this._scrollMode===n.ScrollMode.VERTICAL),Fe=this._currentPageNumber;let _e=!1;for(const Me of V){if(Me.percent<100)break;if(Me.id===Fe&&De){_e=!0;break}}this._setCurrentPageNumber(_e?Fe:V[0].id),this._updateLocation(T.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(T){return this.container.contains(T)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===n.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===n.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const T=this._scrollMode===n.ScrollMode.PAGE?f(this,z).pages:this._pages,V=this._scrollMode===n.ScrollMode.HORIZONTAL,de=V&&this._isContainerRtl;return(0,n.getVisibleElements)({scrollEl:this.container,views:T,sortByVisibility:!0,horizontal:V,rtl:de})}isPageVisible(T){return this.pdfDocument?Number.isInteger(T)&&T>0&&T<=this.pagesCount?this._getVisiblePages().ids.has(T):(console.error(`isPageVisible: "${T}" is not a valid page.`),!1):!1}isPageCached(T){if(!this.pdfDocument)return!1;if(!(Number.isInteger(T)&&T>0&&T<=this.pagesCount))return console.error(`isPageCached: "${T}" is not a valid page.`),!1;const V=this._pages[T-1];return f(this,B).has(V)}cleanup(){for(const T of this._pages)T.renderingState!==n.RenderingStates.FINISHED&&T.reset()}_cancelRendering(){for(const T of this._pages)T.cancelRendering()}forceRendering(T){const V=T||this._getVisiblePages(),de=y(this,O,Ie).call(this,V),Pe=this._spreadMode!==n.SpreadMode.NONE&&this._scrollMode!==n.ScrollMode.HORIZONTAL,De=this.renderingQueue.getHighestPriority(V,this._pages,de,Pe);return De?(y(this,A,Te).call(this,De).then(()=>{this.renderingQueue.renderView(De)}),!0):!1}get hasEqualPageSizes(){const T=this._pages[0];for(let V=1,de=this._pages.length;V{const V=T.pdfPage.getViewport({scale:1});return!this.enablePrintAutoRotate||(0,n.isPortraitOrientation)(V)?{width:V.width,height:V.height,rotation:V.rotation}:{width:V.height,height:V.width,rotation:(V.rotation-90)%360}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)}set optionalContentConfigPromise(T){if(!(T instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${T}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=T,this.refresh(!1,{optionalContentConfigPromise:T}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:T}))}get scrollMode(){return this._scrollMode}set scrollMode(T){if(this._scrollMode!==T){if(!(0,n.isValidScrollMode)(T))throw new Error(`Invalid scroll mode: ${T}`);this.pagesCount>F.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=T,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:T}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const V=this._scrollMode,de=this.viewer;de.classList.toggle("scrollHorizontal",V===n.ScrollMode.HORIZONTAL),de.classList.toggle("scrollWrapped",V===n.ScrollMode.WRAPPED),!(!this.pdfDocument||!T)&&(V===n.ScrollMode.PAGE?y(this,ye,ve).call(this):this._previousScrollMode===n.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(T,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(T){if(this._spreadMode!==T){if(!(0,n.isValidSpreadMode)(T))throw new Error(`Invalid spread mode: ${T}`);this._spreadMode=T,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:T}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(!this.pdfDocument)return;const V=this.viewer,de=this._pages;if(this._scrollMode===n.ScrollMode.PAGE)y(this,ye,ve).call(this);else if(V.textContent="",this._spreadMode===n.SpreadMode.NONE)for(const Pe of this._pages)V.append(Pe.div);else{const Pe=this._spreadMode-1;let De=null;for(let Fe=0,_e=de.length;Fe<_e;++Fe)De===null?(De=document.createElement("div"),De.className="spread",V.append(De)):Fe%2===Pe&&(De=De.cloneNode(!1),V.append(De)),De.append(de[Fe].div)}T&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(T,!0),this.update())}_getPageAdvance(T){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;switch(this._scrollMode){case n.ScrollMode.WRAPPED:{const{views:de}=this._getVisiblePages(),Pe=new Map;for(const{id:De,y:Fe,percent:_e,widthPercent:Me}of de){if(_e===0||Me<100)continue;let Ae=Pe.get(Fe);Ae||Pe.set(Fe,Ae||(Ae=[])),Ae.push(De)}for(const De of Pe.values()){const Fe=De.indexOf(T);if(Fe===-1)continue;const _e=De.length;if(_e===1)break;if(V)for(let Me=Fe-1,Ae=0;Me>=Ae;Me--){const ce=De[Me],Ee=De[Me+1]-1;if(ceEe)return Ee-T}if(V){const Me=De[0];if(MeT)return Me-T+1}break}break}case n.ScrollMode.HORIZONTAL:break;case n.ScrollMode.PAGE:case n.ScrollMode.VERTICAL:{if(this._spreadMode===n.SpreadMode.NONE)break;const de=this._spreadMode-1;if(V&&T%2!==de)break;if(!V&&T%2===de)break;const{views:Pe}=this._getVisiblePages(),De=V?T-1:T+1;for(const{id:Fe,percent:_e,widthPercent:Me}of Pe)if(Fe===De){if(_e>0&&Me===100)return 2;break}break}}return 1}nextPage(){const T=this._currentPageNumber,V=this.pagesCount;if(T>=V)return!1;const de=this._getPageAdvance(T,!1)||1;return this.currentPageNumber=Math.min(T+de,V),!0}previousPage(){const T=this._currentPageNumber;if(T<=1)return!1;const V=this._getPageAdvance(T,!0)||1;return this.currentPageNumber=Math.max(T-V,1),!0}increaseScale(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(typeof T=="number"&&(console.error("The `increaseScale` method-signature was updated, please use an object instead."),T={steps:T}),!this.pdfDocument)return;T||(T=Object.create(null));let V=this._currentScale;if(T.scaleFactor>1)V=Math.min(n.MAX_SCALE,Math.round(V*T.scaleFactor*100)/100);else{let de=T.steps??1;do V=(V*n.DEFAULT_SCALE_DELTA).toFixed(2),V=Math.ceil(V*10)/10,V=Math.min(n.MAX_SCALE,V);while(--de>0&&V0&&arguments[0]!==void 0?arguments[0]:null;if(typeof T=="number"&&(console.error("The `decreaseScale` method-signature was updated, please use an object instead."),T={steps:T}),!this.pdfDocument)return;T||(T=Object.create(null));let V=this._currentScale;if(T.scaleFactor>0&&T.scaleFactor<1)V=Math.max(n.MIN_SCALE,Math.round(V*T.scaleFactor*100)/100);else{let de=T.steps??1;do V=(V/n.DEFAULT_SCALE_DELTA).toFixed(2),V=Math.floor(V*10)/10,V=Math.max(n.MIN_SCALE,V);while(--de>0&&V>n.MIN_SCALE)}T.noScroll=!1,this._setScale(V,T)}get containerTopLeft(){return f(this,H)||g(this,H,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return f(this,q)?f(this,ie):t.AnnotationEditorType.DISABLE}set annotationEditorMode(T){if(!f(this,q))throw new Error("The AnnotationEditor is not enabled.");if(f(this,ie)!==T){if(!X(T))throw new Error(`Invalid AnnotationEditor mode: ${T}`);this.pdfDocument&&(g(this,ie,T),this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:T}),f(this,q).updateMode(T))}}set annotationEditorParams(T){let{type:V,value:de}=T;if(!f(this,q))throw new Error("The AnnotationEditor is not enabled.");f(this,q).updateParams(V,de)}refresh(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null);if(this.pdfDocument){for(const de of this._pages)de.update(V);f(this,te)!==null&&(clearTimeout(f(this,te)),g(this,te,null)),T||this.update()}}}m.PDFViewer=Z;function se(){const ae=this;return{get annotationEditorUIManager(){return f(ae,q)},get annotationStorage(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.annotationStorage},get downloadManager(){return ae.downloadManager},get enableScripting(){return!!ae._scriptingManager},get fieldObjectsPromise(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.getFieldObjects()},get findController(){return ae.findController},get hasJSActionsPromise(){var T;return(T=ae.pdfDocument)===null||T===void 0?void 0:T.hasJSActions()},get linkService(){return ae.linkService}}}function ne(ae){const T={annotationEditorMode:f(this,ie),annotationMode:f(this,_),textLayerMode:this.textLayerMode};return ae&&(ae.includes(t.PermissionFlag.COPY)||this.viewer.classList.add(x),ae.includes(t.PermissionFlag.MODIFY_CONTENTS)||(T.annotationEditorMode=t.AnnotationEditorType.DISABLE),!ae.includes(t.PermissionFlag.MODIFY_ANNOTATIONS)&&!ae.includes(t.PermissionFlag.FILL_INTERACTIVE_FORMS)&&f(this,_)===t.AnnotationMode.ENABLE_FORMS&&(T.annotationMode=t.AnnotationMode.ENABLE)),T}function re(){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return Promise.resolve();const ae=new Promise(T=>{g(this,ee,()=>{document.visibilityState==="hidden"&&(T(),document.removeEventListener("visibilitychange",f(this,ee)),g(this,ee,null))}),document.addEventListener("visibilitychange",f(this,ee))});return Promise.race([this._onePageRenderedCapability.promise,ae])}function ve(){if(this._scrollMode!==n.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const ae=this._currentPageNumber,T=f(this,z),V=this.viewer;if(V.textContent="",T.pages.length=0,this._spreadMode===n.SpreadMode.NONE&&!this.isInPresentationMode){const de=this._pages[ae-1];V.append(de.div),T.pages.push(de)}else{const de=new Set,Pe=this._spreadMode-1;Pe===-1?de.add(ae-1):ae%2!==Pe?(de.add(ae-1),de.add(ae)):(de.add(ae-2),de.add(ae-1));const De=document.createElement("div");if(De.className="spread",this.isInPresentationMode){const Fe=document.createElement("div");Fe.className="dummyPage",De.append(Fe)}for(const Fe of de){const _e=this._pages[Fe];_e&&(De.append(_e.div),T.pages.push(_e))}V.append(De)}T.scrollDown=ae>=T.previousPageNumber,T.previousPageNumber=ae}function he(ae){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const{div:V,id:de}=ae;if(this._currentPageNumber!==de&&this._setCurrentPageNumber(de),this._scrollMode===n.ScrollMode.PAGE&&(y(this,ye,ve).call(this),this.update()),!T&&!this.isInPresentationMode){const Pe=V.offsetLeft+V.clientLeft,De=Pe+V.clientWidth,{scrollLeft:Fe,clientWidth:_e}=this.container;(this._scrollMode===n.ScrollMode.HORIZONTAL||PeFe+_e)&&(T={left:0,top:0})}(0,n.scrollIntoView)(V,T),!this._currentScaleValue&&this._location&&(this._location=null)}function be(ae){return ae===this._currentScale||Math.abs(ae-this._currentScale)<1e-15}function Ce(){const ae=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this._setScale(this._currentScaleValue,{noScroll:!0}),y(this,me,he).call(this,ae)}async function Te(ae){if(ae.pdfPage)return ae.pdfPage;try{var T,V;const de=await this.pdfDocument.getPage(ae.id);return ae.pdfPage||ae.setPdfPage(de),(T=(V=this.linkService)._cachedPageNumber)!==null&&T!==void 0&&T.call(V,de.ref)||this.linkService.cachePageRef(ae.id,de.ref),de}catch(de){return console.error("Unable to get page for page view",de),null}}function Ie(ae){var T,V;if(((T=ae.first)===null||T===void 0?void 0:T.id)===1)return!0;if(((V=ae.last)===null||V===void 0?void 0:V.id)===this.pagesCount)return!1;switch(this._scrollMode){case n.ScrollMode.PAGE:return f(this,z).scrollDown;case n.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}function He(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.container.clientHeight;ae!==f(this,C)&&(g(this,C,ae),n.docStyle.setProperty("--viewer-container-height",`${ae}px`))}function Ve(ae){for(const T of ae)if(T.target===this.container){y(this,M,He).call(this,Math.floor(T.borderBoxSize[0].blockSize)),g(this,H,null);break}}},(k,m,R)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.PDFRenderingQueue=void 0;var t=R(4),n=R(2);const h=3e4;class a{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(r){this.pdfViewer=r}setThumbnailViewer(r){this.pdfThumbnailViewer=r}isHighestPriority(r){return this.highestPriorityPage===r.renderingId}hasViewer(){return!!this.pdfViewer}renderHighestPriority(r){var i;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(r)&&(this.isThumbnailViewEnabled&&(i=this.pdfThumbnailViewer)!==null&&i!==void 0&&i.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),h)))}getHighestPriority(r,i,o){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const b=r.views,y=b.length;if(y===0)return null;for(let D=0;Dy){const D=r.ids;for(let w=1,x=s-f;w{this.renderHighestPriority()}).catch(i=>{i instanceof t.RenderingCancelledException||console.error(`renderView: "${i}"`)});break}return!0}}m.PDFRenderingQueue=a}],p={};function v(k){var m=p[k];if(m!==void 0)return m.exports;var R=p[k]={exports:{}};return l[k](R,R.exports,v),R.exports}var I={};return(()=>{var k=I;Object.defineProperty(k,"__esModule",{value:!0}),Object.defineProperty(k,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return t.AnnotationLayerBuilder}}),k.DefaultXfaLayerFactory=k.DefaultTextLayerFactory=k.DefaultStructTreeLayerFactory=k.DefaultAnnotationLayerFactory=void 0,Object.defineProperty(k,"DownloadManager",{enumerable:!0,get:function(){return n.DownloadManager}}),Object.defineProperty(k,"EventBus",{enumerable:!0,get:function(){return h.EventBus}}),Object.defineProperty(k,"GenericL10n",{enumerable:!0,get:function(){return a.GenericL10n}}),Object.defineProperty(k,"LinkTarget",{enumerable:!0,get:function(){return m.LinkTarget}}),Object.defineProperty(k,"NullL10n",{enumerable:!0,get:function(){return d.NullL10n}}),Object.defineProperty(k,"PDFFindController",{enumerable:!0,get:function(){return r.PDFFindController}}),Object.defineProperty(k,"PDFHistory",{enumerable:!0,get:function(){return i.PDFHistory}}),Object.defineProperty(k,"PDFLinkService",{enumerable:!0,get:function(){return m.PDFLinkService}}),Object.defineProperty(k,"PDFPageView",{enumerable:!0,get:function(){return o.PDFPageView}}),Object.defineProperty(k,"PDFScriptingManager",{enumerable:!0,get:function(){return c.PDFScriptingManager}}),Object.defineProperty(k,"PDFSinglePageViewer",{enumerable:!0,get:function(){return b.PDFSinglePageViewer}}),Object.defineProperty(k,"PDFViewer",{enumerable:!0,get:function(){return y.PDFViewer}}),Object.defineProperty(k,"ProgressBar",{enumerable:!0,get:function(){return R.ProgressBar}}),Object.defineProperty(k,"RenderingStates",{enumerable:!0,get:function(){return R.RenderingStates}}),Object.defineProperty(k,"ScrollMode",{enumerable:!0,get:function(){return R.ScrollMode}}),Object.defineProperty(k,"SimpleLinkService",{enumerable:!0,get:function(){return m.SimpleLinkService}}),Object.defineProperty(k,"SpreadMode",{enumerable:!0,get:function(){return R.SpreadMode}}),Object.defineProperty(k,"StructTreeLayerBuilder",{enumerable:!0,get:function(){return f.StructTreeLayerBuilder}}),Object.defineProperty(k,"TextLayerBuilder",{enumerable:!0,get:function(){return s.TextLayerBuilder}}),Object.defineProperty(k,"XfaLayerBuilder",{enumerable:!0,get:function(){return g.XfaLayerBuilder}}),Object.defineProperty(k,"parseQueryString",{enumerable:!0,get:function(){return R.parseQueryString}});var m=v(1),R=v(2),t=v(3),n=v(6),h=v(7),a=v(8),d=v(5),r=v(10),i=v(12),o=v(13),c=v(21),b=v(23),y=v(24),f=v(16),s=v(19),g=v(20);class S{constructor(){throw new Error("The `DefaultAnnotationLayerFactory` has been removed, please use the `annotationMode` option when initializing the `PDFPageView`-instance to control AnnotationLayer rendering.")}}k.DefaultAnnotationLayerFactory=S;class D{constructor(){throw new Error("The `DefaultStructTreeLayerFactory` has been removed, this functionality is automatically enabled when the TextLayer is used.")}}k.DefaultStructTreeLayerFactory=D;class w{constructor(){throw new Error("The `DefaultTextLayerFactory` has been removed, please use the `textLayerMode` option when initializing the `PDFPageView`-instance to control TextLayer rendering.")}}k.DefaultTextLayerFactory=w;class x{constructor(){throw new Error("The `DefaultXfaLayerFactory` has been removed, please use the `enableXfa` option when calling the `getDocument`-function to control XfaLayer rendering.")}}k.DefaultXfaLayerFactory=x})(),I})())})(pdf_viewer);const pdf="",PDFWorker={create(){return refWorker("pdf.worker.js").defaults(()=>new Worker(new URL(""+new URL("pdf.worker-909112bf.js",import.meta.url).href,self.location),{type:"module"}))}},_withScopeId=W=>(pushScopeId("data-v-9bad3887"),W=W(),popScopeId(),W),_hoisted_1={class:"container"},_hoisted_2={class:"pdf_down"},_hoisted_3=_withScopeId(()=>createBaseVNode("div",{id:"viewer",class:"pdfViewer"},null,-1)),_hoisted_4=[_hoisted_3],_sfc_main=defineComponent({__name:"PdfView",props:{data:null},setup(W){const E=W,l=ref(null),p={viewer:null,search:"",pdf_scale:1};!pdfExports.GlobalWorkerOptions.workerPort&&typeof window<"u"&&"Worker"in window&&(pdfExports.GlobalWorkerOptions.workerPort=PDFWorker.create()),(()=>{async function k(){if(!l.value)return;const m=new pdf_viewerExports.EventBus,R=new pdf_viewerExports.PDFLinkService({eventBus:m}),t=new pdf_viewerExports.PDFFindController({eventBus:m,linkService:R,updateMatchesCountOnProgress:!0}),n=new pdf_viewerExports.PDFViewer({container:l.value,eventBus:m,linkService:R,findController:t,l10n:new pdf_viewerExports.GenericL10n("zh-CN")});R.setViewer(n),m.on("pagesinit",()=>{var r;const d=(r=n.getPageView(0))==null?void 0:r.viewport;(d==null?void 0:d.width)>window.innerWidth?n.currentScaleValue="0.5":n.currentScaleValue="1"});const a=await pdfExports.getDocument({data:E.data,cMapUrl:`https://npm.onmicrosoft.cn/pdfjs-dist@${pdfExports.version}/cmaps/`,useWorkerFetch:!0,cMapPacked:!0,enableXfa:!0}).promise;n.setDocument(a),R.setDocument(a,null),p.viewer=n}onMounted(k)})();function v(){if(!p.viewer)return;const k=p.viewer.currentScale;let m=0;window.screen.width>1440?m=1.4:m=1.2,!(k>=m)&&(p.viewer.currentScale=k+.1)}function I(){if(!p.viewer)return;const k=p.viewer.currentScale;k<=.5||(p.viewer.currentScale=k-.1)}return(k,m)=>(openBlock(),createElementBlock("div",_hoisted_1,[createBaseVNode("div",_hoisted_2,[createBaseVNode("div",{class:"pdf_set_left",onClick:m[0]||(m[0]=R=>v())},"➕"),createBaseVNode("div",{class:"pdf_set_middle",onClick:m[1]||(m[1]=R=>I())},"➖")]),createBaseVNode("div",{ref_key:"container",ref:l,class:"pdf-wrapper"},_hoisted_4,512)]))}}),PdfView_vue_vue_type_style_index_0_scoped_9bad3887_lang="",PdfView=_export_sfc(_sfc_main,[["__scopeId","data-v-9bad3887"]]);export{PdfView as default};
diff --git a/public/file-viewer3/assets/PptxRender-3032ddac.js b/public/file-viewer3/assets/PptxRender-3032ddac.js
new file mode 100644
index 0000000..e18a999
--- /dev/null
+++ b/public/file-viewer3/assets/PptxRender-3032ddac.js
@@ -0,0 +1,51 @@
+import{c as mf,d as _f,r as bf,o as Tf,a as wf,b as $f,_ as Af}from"./index-0fd2d185.js";import{r as Cf}from"./worker-ref-fadf3283.js";var Oa={},Sf={get exports(){return Oa},set exports(t){Oa=t}};/*!
+ * jQuery JavaScript Library v3.6.4
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright OpenJS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2023-03-08T15:28Z
+ */(function(t){(function(e,n){t.exports=e.document?n(e,!0):function(i){if(!i.document)throw new Error("jQuery requires a window with a document");return n(i)}})(typeof window<"u"?window:mf,function(e,n){var i=[],r=Object.getPrototypeOf,a=i.slice,o=i.flat?function(c){return i.flat.call(c)}:function(c){return i.concat.apply([],c)},s=i.push,u=i.indexOf,l={},h=l.toString,d=l.hasOwnProperty,v=d.toString,y=v.call(Object),m={},T=function(f){return typeof f=="function"&&typeof f.nodeType!="number"&&typeof f.item!="function"},C=function(f){return f!=null&&f===f.window},A=e.document,S={type:!0,src:!0,nonce:!0,noModule:!0};function D(c,f,p){p=p||A;var x,_,b=p.createElement("script");if(b.text=c,f)for(x in S)_=f[x]||f.getAttribute&&f.getAttribute(x),_&&b.setAttribute(x,_);p.head.appendChild(b).parentNode.removeChild(b)}function L(c){return c==null?c+"":typeof c=="object"||typeof c=="function"?l[h.call(c)]||"object":typeof c}var P="3.6.4",g=function(c,f){return new g.fn.init(c,f)};g.fn=g.prototype={jquery:P,constructor:g,length:0,toArray:function(){return a.call(this)},get:function(c){return c==null?a.call(this):c<0?this[c+this.length]:this[c]},pushStack:function(c){var f=g.merge(this.constructor(),c);return f.prevObject=this,f},each:function(c){return g.each(this,c)},map:function(c){return this.pushStack(g.map(this,function(f,p){return c.call(f,p,f)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(g.grep(this,function(c,f){return(f+1)%2}))},odd:function(){return this.pushStack(g.grep(this,function(c,f){return f%2}))},eq:function(c){var f=this.length,p=+c+(c<0?f:0);return this.pushStack(p>=0&&p0&&f-1 in c}var H=function(c){var f,p,x,_,b,w,R,k,I,X,j,O,B,rt,ft,it,re,te,Ee,Nt="sizzle"+1*new Date,lt=c.document,we=0,Ct=0,jt=Qi(),vi=Qi(),Gi=Qi(),Re=Qi(),Tn=function($,E){return $===E&&(j=!0),0},wn={}.hasOwnProperty,$e=[],hn=$e.pop,Ne=$e.push,dn=$e.push,_s=$e.slice,$n=function($,E){for(var M=0,z=$.length;M+~]|"+Lt+")"+Lt+"*"),sf=new RegExp(Lt+"|>"),cf=new RegExp(ua),uf=new RegExp("^"+An+"$"),Ki={ID:new RegExp("^#("+An+")"),CLASS:new RegExp("^\\.("+An+")"),TAG:new RegExp("^("+An+"|[*])"),ATTR:new RegExp("^"+bs),PSEUDO:new RegExp("^"+ua),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Lt+"*(even|odd|(([+-]|)(\\d*)n|)"+Lt+"*(?:([+-]|)"+Lt+"*(\\d+)|))"+Lt+"*\\)|)","i"),bool:new RegExp("^(?:"+ca+")$","i"),needsContext:new RegExp("^"+Lt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Lt+"*((?:-\\d)?\\d*)"+Lt+"*\\)|)(?=[^-]|$)","i")},lf=/HTML$/i,ff=/^(?:input|select|textarea|button)$/i,hf=/^h\d$/i,xi=/^[^{]+\{\s*\[native \w/,df=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,la=/[+~]/,en=new RegExp("\\\\[\\da-fA-F]{1,6}"+Lt+"?|\\\\([^\\r\\n\\f])","g"),nn=function($,E){var M="0x"+$.slice(1)-65536;return E||(M<0?String.fromCharCode(M+65536):String.fromCharCode(M>>10|55296,M&1023|56320))},ws=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,$s=function($,E){return E?$==="\0"?"�":$.slice(0,-1)+"\\"+$.charCodeAt($.length-1).toString(16)+" ":"\\"+$},As=function(){O()},gf=tr(function($){return $.disabled===!0&&$.nodeName.toLowerCase()==="fieldset"},{dir:"parentNode",next:"legend"});try{dn.apply($e=_s.call(lt.childNodes),lt.childNodes),$e[lt.childNodes.length].nodeType}catch{dn={apply:$e.length?function(E,M){Ne.apply(E,_s.call(M))}:function(E,M){for(var z=E.length,N=0;E[z++]=M[N++];);E.length=z-1}}}function Pt($,E,M,z){var N,Y,q,Q,tt,ot,at,ct=E&&E.ownerDocument,xt=E?E.nodeType:9;if(M=M||[],typeof $!="string"||!$||xt!==1&&xt!==9&&xt!==11)return M;if(!z&&(O(E),E=E||B,ft)){if(xt!==11&&(tt=df.exec($)))if(N=tt[1]){if(xt===9)if(q=E.getElementById(N)){if(q.id===N)return M.push(q),M}else return M;else if(ct&&(q=ct.getElementById(N))&&Ee(E,q)&&q.id===N)return M.push(q),M}else{if(tt[2])return dn.apply(M,E.getElementsByTagName($)),M;if((N=tt[3])&&p.getElementsByClassName&&E.getElementsByClassName)return dn.apply(M,E.getElementsByClassName(N)),M}if(p.qsa&&!Re[$+" "]&&(!it||!it.test($))&&(xt!==1||E.nodeName.toLowerCase()!=="object")){if(at=$,ct=E,xt===1&&(sf.test($)||Ts.test($))){for(ct=la.test($)&&ha(E.parentNode)||E,(ct!==E||!p.scope)&&((Q=E.getAttribute("id"))?Q=Q.replace(ws,$s):E.setAttribute("id",Q=Nt)),ot=w($),Y=ot.length;Y--;)ot[Y]=(Q?"#"+Q:":scope")+" "+Ji(ot[Y]);at=ot.join(",")}try{return dn.apply(M,ct.querySelectorAll(at)),M}catch{Re($,!0)}finally{Q===Nt&&E.removeAttribute("id")}}}return k($.replace(Zi,"$1"),E,M,z)}function Qi(){var $=[];function E(M,z){return $.push(M+" ")>x.cacheLength&&delete E[$.shift()],E[M+" "]=z}return E}function Fe($){return $[Nt]=!0,$}function Ie($){var E=B.createElement("fieldset");try{return!!$(E)}catch{return!1}finally{E.parentNode&&E.parentNode.removeChild(E),E=null}}function fa($,E){for(var M=$.split("|"),z=M.length;z--;)x.attrHandle[M[z]]=E}function Cs($,E){var M=E&&$,z=M&&$.nodeType===1&&E.nodeType===1&&$.sourceIndex-E.sourceIndex;if(z)return z;if(M){for(;M=M.nextSibling;)if(M===E)return-1}return $?1:-1}function pf($){return function(E){var M=E.nodeName.toLowerCase();return M==="input"&&E.type===$}}function vf($){return function(E){var M=E.nodeName.toLowerCase();return(M==="input"||M==="button")&&E.type===$}}function Ss($){return function(E){return"form"in E?E.parentNode&&E.disabled===!1?"label"in E?"label"in E.parentNode?E.parentNode.disabled===$:E.disabled===$:E.isDisabled===$||E.isDisabled!==!$&&gf(E)===$:E.disabled===$:"label"in E?E.disabled===$:!1}}function Cn($){return Fe(function(E){return E=+E,Fe(function(M,z){for(var N,Y=$([],M.length,E),q=Y.length;q--;)M[N=Y[q]]&&(M[N]=!(z[N]=M[N]))})})}function ha($){return $&&typeof $.getElementsByTagName<"u"&&$}p=Pt.support={},b=Pt.isXML=function($){var E=$&&$.namespaceURI,M=$&&($.ownerDocument||$).documentElement;return!lf.test(E||M&&M.nodeName||"HTML")},O=Pt.setDocument=function($){var E,M,z=$?$.ownerDocument||$:lt;return z==B||z.nodeType!==9||!z.documentElement||(B=z,rt=B.documentElement,ft=!b(B),lt!=B&&(M=B.defaultView)&&M.top!==M&&(M.addEventListener?M.addEventListener("unload",As,!1):M.attachEvent&&M.attachEvent("onunload",As)),p.scope=Ie(function(N){return rt.appendChild(N).appendChild(B.createElement("div")),typeof N.querySelectorAll<"u"&&!N.querySelectorAll(":scope fieldset div").length}),p.cssHas=Ie(function(){try{return B.querySelector(":has(*,:jqfake)"),!1}catch{return!0}}),p.attributes=Ie(function(N){return N.className="i",!N.getAttribute("className")}),p.getElementsByTagName=Ie(function(N){return N.appendChild(B.createComment("")),!N.getElementsByTagName("*").length}),p.getElementsByClassName=xi.test(B.getElementsByClassName),p.getById=Ie(function(N){return rt.appendChild(N).id=Nt,!B.getElementsByName||!B.getElementsByName(Nt).length}),p.getById?(x.filter.ID=function(N){var Y=N.replace(en,nn);return function(q){return q.getAttribute("id")===Y}},x.find.ID=function(N,Y){if(typeof Y.getElementById<"u"&&ft){var q=Y.getElementById(N);return q?[q]:[]}}):(x.filter.ID=function(N){var Y=N.replace(en,nn);return function(q){var Q=typeof q.getAttributeNode<"u"&&q.getAttributeNode("id");return Q&&Q.value===Y}},x.find.ID=function(N,Y){if(typeof Y.getElementById<"u"&&ft){var q,Q,tt,ot=Y.getElementById(N);if(ot){if(q=ot.getAttributeNode("id"),q&&q.value===N)return[ot];for(tt=Y.getElementsByName(N),Q=0;ot=tt[Q++];)if(q=ot.getAttributeNode("id"),q&&q.value===N)return[ot]}return[]}}),x.find.TAG=p.getElementsByTagName?function(N,Y){if(typeof Y.getElementsByTagName<"u")return Y.getElementsByTagName(N);if(p.qsa)return Y.querySelectorAll(N)}:function(N,Y){var q,Q=[],tt=0,ot=Y.getElementsByTagName(N);if(N==="*"){for(;q=ot[tt++];)q.nodeType===1&&Q.push(q);return Q}return ot},x.find.CLASS=p.getElementsByClassName&&function(N,Y){if(typeof Y.getElementsByClassName<"u"&&ft)return Y.getElementsByClassName(N)},re=[],it=[],(p.qsa=xi.test(B.querySelectorAll))&&(Ie(function(N){var Y;rt.appendChild(N).innerHTML="",N.querySelectorAll("[msallowcapture^='']").length&&it.push("[*^$]="+Lt+`*(?:''|"")`),N.querySelectorAll("[selected]").length||it.push("\\["+Lt+"*(?:value|"+ca+")"),N.querySelectorAll("[id~="+Nt+"-]").length||it.push("~="),Y=B.createElement("input"),Y.setAttribute("name",""),N.appendChild(Y),N.querySelectorAll("[name='']").length||it.push("\\["+Lt+"*name"+Lt+"*="+Lt+`*(?:''|"")`),N.querySelectorAll(":checked").length||it.push(":checked"),N.querySelectorAll("a#"+Nt+"+*").length||it.push(".#.+[+~]"),N.querySelectorAll("\\\f"),it.push("[\\r\\n\\f]")}),Ie(function(N){N.innerHTML="";var Y=B.createElement("input");Y.setAttribute("type","hidden"),N.appendChild(Y).setAttribute("name","D"),N.querySelectorAll("[name=d]").length&&it.push("name"+Lt+"*[*^$|!~]?="),N.querySelectorAll(":enabled").length!==2&&it.push(":enabled",":disabled"),rt.appendChild(N).disabled=!0,N.querySelectorAll(":disabled").length!==2&&it.push(":enabled",":disabled"),N.querySelectorAll("*,:x"),it.push(",.*:")})),(p.matchesSelector=xi.test(te=rt.matches||rt.webkitMatchesSelector||rt.mozMatchesSelector||rt.oMatchesSelector||rt.msMatchesSelector))&&Ie(function(N){p.disconnectedMatch=te.call(N,"*"),te.call(N,"[s!='']:x"),re.push("!=",ua)}),p.cssHas||it.push(":has"),it=it.length&&new RegExp(it.join("|")),re=re.length&&new RegExp(re.join("|")),E=xi.test(rt.compareDocumentPosition),Ee=E||xi.test(rt.contains)?function(N,Y){var q=N.nodeType===9&&N.documentElement||N,Q=Y&&Y.parentNode;return N===Q||!!(Q&&Q.nodeType===1&&(q.contains?q.contains(Q):N.compareDocumentPosition&&N.compareDocumentPosition(Q)&16))}:function(N,Y){if(Y){for(;Y=Y.parentNode;)if(Y===N)return!0}return!1},Tn=E?function(N,Y){if(N===Y)return j=!0,0;var q=!N.compareDocumentPosition-!Y.compareDocumentPosition;return q||(q=(N.ownerDocument||N)==(Y.ownerDocument||Y)?N.compareDocumentPosition(Y):1,q&1||!p.sortDetached&&Y.compareDocumentPosition(N)===q?N==B||N.ownerDocument==lt&&Ee(lt,N)?-1:Y==B||Y.ownerDocument==lt&&Ee(lt,Y)?1:X?$n(X,N)-$n(X,Y):0:q&4?-1:1)}:function(N,Y){if(N===Y)return j=!0,0;var q,Q=0,tt=N.parentNode,ot=Y.parentNode,at=[N],ct=[Y];if(!tt||!ot)return N==B?-1:Y==B?1:tt?-1:ot?1:X?$n(X,N)-$n(X,Y):0;if(tt===ot)return Cs(N,Y);for(q=N;q=q.parentNode;)at.unshift(q);for(q=Y;q=q.parentNode;)ct.unshift(q);for(;at[Q]===ct[Q];)Q++;return Q?Cs(at[Q],ct[Q]):at[Q]==lt?-1:ct[Q]==lt?1:0}),B},Pt.matches=function($,E){return Pt($,null,null,E)},Pt.matchesSelector=function($,E){if(O($),p.matchesSelector&&ft&&!Re[E+" "]&&(!re||!re.test(E))&&(!it||!it.test(E)))try{var M=te.call($,E);if(M||p.disconnectedMatch||$.document&&$.document.nodeType!==11)return M}catch{Re(E,!0)}return Pt(E,B,null,[$]).length>0},Pt.contains=function($,E){return($.ownerDocument||$)!=B&&O($),Ee($,E)},Pt.attr=function($,E){($.ownerDocument||$)!=B&&O($);var M=x.attrHandle[E.toLowerCase()],z=M&&wn.call(x.attrHandle,E.toLowerCase())?M($,E,!ft):void 0;return z!==void 0?z:p.attributes||!ft?$.getAttribute(E):(z=$.getAttributeNode(E))&&z.specified?z.value:null},Pt.escape=function($){return($+"").replace(ws,$s)},Pt.error=function($){throw new Error("Syntax error, unrecognized expression: "+$)},Pt.uniqueSort=function($){var E,M=[],z=0,N=0;if(j=!p.detectDuplicates,X=!p.sortStable&&$.slice(0),$.sort(Tn),j){for(;E=$[N++];)E===$[N]&&(z=M.push(N));for(;z--;)$.splice(M[z],1)}return X=null,$},_=Pt.getText=function($){var E,M="",z=0,N=$.nodeType;if(N){if(N===1||N===9||N===11){if(typeof $.textContent=="string")return $.textContent;for($=$.firstChild;$;$=$.nextSibling)M+=_($)}else if(N===3||N===4)return $.nodeValue}else for(;E=$[z++];)M+=_(E);return M},x=Pt.selectors={cacheLength:50,createPseudo:Fe,match:Ki,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function($){return $[1]=$[1].replace(en,nn),$[3]=($[3]||$[4]||$[5]||"").replace(en,nn),$[2]==="~="&&($[3]=" "+$[3]+" "),$.slice(0,4)},CHILD:function($){return $[1]=$[1].toLowerCase(),$[1].slice(0,3)==="nth"?($[3]||Pt.error($[0]),$[4]=+($[4]?$[5]+($[6]||1):2*($[3]==="even"||$[3]==="odd")),$[5]=+($[7]+$[8]||$[3]==="odd")):$[3]&&Pt.error($[0]),$},PSEUDO:function($){var E,M=!$[6]&&$[2];return Ki.CHILD.test($[0])?null:($[3]?$[2]=$[4]||$[5]||"":M&&cf.test(M)&&(E=w(M,!0))&&(E=M.indexOf(")",M.length-E)-M.length)&&($[0]=$[0].slice(0,E),$[2]=M.slice(0,E)),$.slice(0,3))}},filter:{TAG:function($){var E=$.replace(en,nn).toLowerCase();return $==="*"?function(){return!0}:function(M){return M.nodeName&&M.nodeName.toLowerCase()===E}},CLASS:function($){var E=jt[$+" "];return E||(E=new RegExp("(^|"+Lt+")"+$+"("+Lt+"|$)"))&&jt($,function(M){return E.test(typeof M.className=="string"&&M.className||typeof M.getAttribute<"u"&&M.getAttribute("class")||"")})},ATTR:function($,E,M){return function(z){var N=Pt.attr(z,$);return N==null?E==="!=":E?(N+="",E==="="?N===M:E==="!="?N!==M:E==="^="?M&&N.indexOf(M)===0:E==="*="?M&&N.indexOf(M)>-1:E==="$="?M&&N.slice(-M.length)===M:E==="~="?(" "+N.replace(af," ")+" ").indexOf(M)>-1:E==="|="?N===M||N.slice(0,M.length+1)===M+"-":!1):!0}},CHILD:function($,E,M,z,N){var Y=$.slice(0,3)!=="nth",q=$.slice(-4)!=="last",Q=E==="of-type";return z===1&&N===0?function(tt){return!!tt.parentNode}:function(tt,ot,at){var ct,xt,Ot,st,ae,de,Le=Y!==q?"nextSibling":"previousSibling",Wt=tt.parentNode,yi=Q&&tt.nodeName.toLowerCase(),mi=!at&&!Q,Me=!1;if(Wt){if(Y){for(;Le;){for(st=tt;st=st[Le];)if(Q?st.nodeName.toLowerCase()===yi:st.nodeType===1)return!1;de=Le=$==="only"&&!de&&"nextSibling"}return!0}if(de=[q?Wt.firstChild:Wt.lastChild],q&&mi){for(st=Wt,Ot=st[Nt]||(st[Nt]={}),xt=Ot[st.uniqueID]||(Ot[st.uniqueID]={}),ct=xt[$]||[],ae=ct[0]===we&&ct[1],Me=ae&&ct[2],st=ae&&Wt.childNodes[ae];st=++ae&&st&&st[Le]||(Me=ae=0)||de.pop();)if(st.nodeType===1&&++Me&&st===tt){xt[$]=[we,ae,Me];break}}else if(mi&&(st=tt,Ot=st[Nt]||(st[Nt]={}),xt=Ot[st.uniqueID]||(Ot[st.uniqueID]={}),ct=xt[$]||[],ae=ct[0]===we&&ct[1],Me=ae),Me===!1)for(;(st=++ae&&st&&st[Le]||(Me=ae=0)||de.pop())&&!((Q?st.nodeName.toLowerCase()===yi:st.nodeType===1)&&++Me&&(mi&&(Ot=st[Nt]||(st[Nt]={}),xt=Ot[st.uniqueID]||(Ot[st.uniqueID]={}),xt[$]=[we,Me]),st===tt)););return Me-=N,Me===z||Me%z===0&&Me/z>=0}}},PSEUDO:function($,E){var M,z=x.pseudos[$]||x.setFilters[$.toLowerCase()]||Pt.error("unsupported pseudo: "+$);return z[Nt]?z(E):z.length>1?(M=[$,$,"",E],x.setFilters.hasOwnProperty($.toLowerCase())?Fe(function(N,Y){for(var q,Q=z(N,E),tt=Q.length;tt--;)q=$n(N,Q[tt]),N[q]=!(Y[q]=Q[tt])}):function(N){return z(N,0,M)}):z}},pseudos:{not:Fe(function($){var E=[],M=[],z=R($.replace(Zi,"$1"));return z[Nt]?Fe(function(N,Y,q,Q){for(var tt,ot=z(N,null,Q,[]),at=N.length;at--;)(tt=ot[at])&&(N[at]=!(Y[at]=tt))}):function(N,Y,q){return E[0]=N,z(E,null,q,M),E[0]=null,!M.pop()}}),has:Fe(function($){return function(E){return Pt($,E).length>0}}),contains:Fe(function($){return $=$.replace(en,nn),function(E){return(E.textContent||_(E)).indexOf($)>-1}}),lang:Fe(function($){return uf.test($||"")||Pt.error("unsupported lang: "+$),$=$.replace(en,nn).toLowerCase(),function(E){var M;do if(M=ft?E.lang:E.getAttribute("xml:lang")||E.getAttribute("lang"))return M=M.toLowerCase(),M===$||M.indexOf($+"-")===0;while((E=E.parentNode)&&E.nodeType===1);return!1}}),target:function($){var E=c.location&&c.location.hash;return E&&E.slice(1)===$.id},root:function($){return $===rt},focus:function($){return $===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!($.type||$.href||~$.tabIndex)},enabled:Ss(!1),disabled:Ss(!0),checked:function($){var E=$.nodeName.toLowerCase();return E==="input"&&!!$.checked||E==="option"&&!!$.selected},selected:function($){return $.parentNode&&$.parentNode.selectedIndex,$.selected===!0},empty:function($){for($=$.firstChild;$;$=$.nextSibling)if($.nodeType<6)return!1;return!0},parent:function($){return!x.pseudos.empty($)},header:function($){return hf.test($.nodeName)},input:function($){return ff.test($.nodeName)},button:function($){var E=$.nodeName.toLowerCase();return E==="input"&&$.type==="button"||E==="button"},text:function($){var E;return $.nodeName.toLowerCase()==="input"&&$.type==="text"&&((E=$.getAttribute("type"))==null||E.toLowerCase()==="text")},first:Cn(function(){return[0]}),last:Cn(function($,E){return[E-1]}),eq:Cn(function($,E,M){return[M<0?M+E:M]}),even:Cn(function($,E){for(var M=0;ME?E:M;--z>=0;)$.push(z);return $}),gt:Cn(function($,E,M){for(var z=M<0?M+E:M;++z1?function(E,M,z){for(var N=$.length;N--;)if(!$[N](E,M,z))return!1;return!0}:$[0]}function xf($,E,M){for(var z=0,N=E.length;z-1&&(q[at]=!(Q[at]=xt))}}else Wt=er(Wt===Q?Wt.splice(ae,Wt.length):Wt),N?N(null,Q,Wt,ot):dn.apply(Q,Wt)})}function pa($){for(var E,M,z,N=$.length,Y=x.relative[$[0].type],q=Y||x.relative[" "],Q=Y?1:0,tt=tr(function(ct){return ct===E},q,!0),ot=tr(function(ct){return $n(E,ct)>-1},q,!0),at=[function(ct,xt,Ot){var st=!Y&&(Ot||xt!==I)||((E=xt).nodeType?tt(ct,xt,Ot):ot(ct,xt,Ot));return E=null,st}];Q1&&da(at),Q>1&&Ji($.slice(0,Q-1).concat({value:$[Q-2].type===" "?"*":""})).replace(Zi,"$1"),M,Q0,z=$.length>0,N=function(Y,q,Q,tt,ot){var at,ct,xt,Ot=0,st="0",ae=Y&&[],de=[],Le=I,Wt=Y||z&&x.find.TAG("*",ot),yi=we+=Le==null?1:Math.random()||.1,mi=Wt.length;for(ot&&(I=q==B||q||ot);st!==mi&&(at=Wt[st])!=null;st++){if(z&&at){for(ct=0,!q&&at.ownerDocument!=B&&(O(at),Q=!ft);xt=$[ct++];)if(xt(at,q||B,Q)){tt.push(at);break}ot&&(we=yi)}M&&((at=!xt&&at)&&Ot--,Y&&ae.push(at))}if(Ot+=st,M&&st!==Ot){for(ct=0;xt=E[ct++];)xt(ae,de,q,Q);if(Y){if(Ot>0)for(;st--;)ae[st]||de[st]||(de[st]=hn.call(tt));de=er(de)}dn.apply(tt,de),ot&&!Y&&de.length>0&&Ot+E.length>1&&Pt.uniqueSort(tt)}return ot&&(we=yi,I=Le),ae};return M?Fe(N):N}return R=Pt.compile=function($,E){var M,z=[],N=[],Y=Gi[$+" "];if(!Y){for(E||(E=w($)),M=E.length;M--;)Y=pa(E[M]),Y[Nt]?z.push(Y):N.push(Y);Y=Gi($,yf(N,z)),Y.selector=$}return Y},k=Pt.select=function($,E,M,z){var N,Y,q,Q,tt,ot=typeof $=="function"&&$,at=!z&&w($=ot.selector||$);if(M=M||[],at.length===1){if(Y=at[0]=at[0].slice(0),Y.length>2&&(q=Y[0]).type==="ID"&&E.nodeType===9&&ft&&x.relative[Y[1].type]){if(E=(x.find.ID(q.matches[0].replace(en,nn),E)||[])[0],E)ot&&(E=E.parentNode);else return M;$=$.slice(Y.shift().value.length)}for(N=Ki.needsContext.test($)?0:Y.length;N--&&(q=Y[N],!x.relative[Q=q.type]);)if((tt=x.find[Q])&&(z=tt(q.matches[0].replace(en,nn),la.test(Y[0].type)&&ha(E.parentNode)||E))){if(Y.splice(N,1),$=z.length&&Ji(Y),!$)return dn.apply(M,z),M;break}}return(ot||R($,at))(z,E,!ft,M,!E||la.test($)&&ha(E.parentNode)||E),M},p.sortStable=Nt.split("").sort(Tn).join("")===Nt,p.detectDuplicates=!!j,O(),p.sortDetached=Ie(function($){return $.compareDocumentPosition(B.createElement("fieldset"))&1}),Ie(function($){return $.innerHTML="",$.firstChild.getAttribute("href")==="#"})||fa("type|href|height|width",function($,E,M){if(!M)return $.getAttribute(E,E.toLowerCase()==="type"?1:2)}),(!p.attributes||!Ie(function($){return $.innerHTML="",$.firstChild.setAttribute("value",""),$.firstChild.getAttribute("value")===""}))&&fa("value",function($,E,M){if(!M&&$.nodeName.toLowerCase()==="input")return $.defaultValue}),Ie(function($){return $.getAttribute("disabled")==null})||fa(ca,function($,E,M){var z;if(!M)return $[E]===!0?E.toLowerCase():(z=$.getAttributeNode(E))&&z.specified?z.value:null}),Pt}(e);g.find=H,g.expr=H.selectors,g.expr[":"]=g.expr.pseudos,g.uniqueSort=g.unique=H.uniqueSort,g.text=H.getText,g.isXMLDoc=H.isXML,g.contains=H.contains,g.escapeSelector=H.escape;var K=function(c,f,p){for(var x=[],_=p!==void 0;(c=c[f])&&c.nodeType!==9;)if(c.nodeType===1){if(_&&g(c).is(p))break;x.push(c)}return x},W=function(c,f){for(var p=[];c;c=c.nextSibling)c.nodeType===1&&c!==f&&p.push(c);return p},V=g.expr.match.needsContext;function nt(c,f){return c.nodeName&&c.nodeName.toLowerCase()===f.toLowerCase()}var U=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function G(c,f,p){return T(f)?g.grep(c,function(x,_){return!!f.call(x,_,x)!==p}):f.nodeType?g.grep(c,function(x){return x===f!==p}):typeof f!="string"?g.grep(c,function(x){return u.call(f,x)>-1!==p}):g.filter(f,c,p)}g.filter=function(c,f,p){var x=f[0];return p&&(c=":not("+c+")"),f.length===1&&x.nodeType===1?g.find.matchesSelector(x,c)?[x]:[]:g.find.matches(c,g.grep(f,function(_){return _.nodeType===1}))},g.fn.extend({find:function(c){var f,p,x=this.length,_=this;if(typeof c!="string")return this.pushStack(g(c).filter(function(){for(f=0;f1?g.uniqueSort(p):p},filter:function(c){return this.pushStack(G(this,c||[],!1))},not:function(c){return this.pushStack(G(this,c||[],!0))},is:function(c){return!!G(this,typeof c=="string"&&V.test(c)?g(c):c||[],!1).length}});var vt,mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,ut=g.fn.init=function(c,f,p){var x,_;if(!c)return this;if(p=p||vt,typeof c=="string")if(c[0]==="<"&&c[c.length-1]===">"&&c.length>=3?x=[null,c,null]:x=mt.exec(c),x&&(x[1]||!f))if(x[1]){if(f=f instanceof g?f[0]:f,g.merge(this,g.parseHTML(x[1],f&&f.nodeType?f.ownerDocument||f:A,!0)),U.test(x[1])&&g.isPlainObject(f))for(x in f)T(this[x])?this[x](f[x]):this.attr(x,f[x]);return this}else return _=A.getElementById(x[2]),_&&(this[0]=_,this.length=1),this;else return!f||f.jquery?(f||p).find(c):this.constructor(f).find(c);else{if(c.nodeType)return this[0]=c,this.length=1,this;if(T(c))return p.ready!==void 0?p.ready(c):c(g)}return g.makeArray(c,this)};ut.prototype=g.fn,vt=g(A);var Rt=/^(?:parents|prev(?:Until|All))/,gt={children:!0,contents:!0,next:!0,prev:!0};g.fn.extend({has:function(c){var f=g(c,this),p=f.length;return this.filter(function(){for(var x=0;x-1:p.nodeType===1&&g.find.matchesSelector(p,c))){b.push(p);break}}return this.pushStack(b.length>1?g.uniqueSort(b):b)},index:function(c){return c?typeof c=="string"?u.call(g(c),this[0]):u.call(this,c.jquery?c[0]:c):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(c,f){return this.pushStack(g.uniqueSort(g.merge(this.get(),g(c,f))))},addBack:function(c){return this.add(c==null?this.prevObject:this.prevObject.filter(c))}});function It(c,f){for(;(c=c[f])&&c.nodeType!==1;);return c}g.each({parent:function(c){var f=c.parentNode;return f&&f.nodeType!==11?f:null},parents:function(c){return K(c,"parentNode")},parentsUntil:function(c,f,p){return K(c,"parentNode",p)},next:function(c){return It(c,"nextSibling")},prev:function(c){return It(c,"previousSibling")},nextAll:function(c){return K(c,"nextSibling")},prevAll:function(c){return K(c,"previousSibling")},nextUntil:function(c,f,p){return K(c,"nextSibling",p)},prevUntil:function(c,f,p){return K(c,"previousSibling",p)},siblings:function(c){return W((c.parentNode||{}).firstChild,c)},children:function(c){return W(c.firstChild)},contents:function(c){return c.contentDocument!=null&&r(c.contentDocument)?c.contentDocument:(nt(c,"template")&&(c=c.content||c),g.merge([],c.childNodes))}},function(c,f){g.fn[c]=function(p,x){var _=g.map(this,f,p);return c.slice(-5)!=="Until"&&(x=p),x&&typeof x=="string"&&(_=g.filter(x,_)),this.length>1&&(gt[c]||g.uniqueSort(_),Rt.test(c)&&_.reverse()),this.pushStack(_)}});var Dt=/[^\x20\t\r\n\f]+/g;function fe(c){var f={};return g.each(c.match(Dt)||[],function(p,x){f[x]=!0}),f}g.Callbacks=function(c){c=typeof c=="string"?fe(c):g.extend({},c);var f,p,x,_,b=[],w=[],R=-1,k=function(){for(_=_||c.once,x=f=!0;w.length;R=-1)for(p=w.shift();++R-1;)b.splice(O,1),O<=R&&R--}),this},has:function(X){return X?g.inArray(X,b)>-1:b.length>0},empty:function(){return b&&(b=[]),this},disable:function(){return _=w=[],b=p="",this},disabled:function(){return!b},lock:function(){return _=w=[],!p&&!f&&(b=p=""),this},locked:function(){return!!_},fireWith:function(X,j){return _||(j=j||[],j=[X,j.slice?j.slice():j],w.push(j),f||k()),this},fire:function(){return I.fireWith(this,arguments),this},fired:function(){return!!x}};return I};function ee(c){return c}function bt(c){throw c}function Vt(c,f,p,x){var _;try{c&&T(_=c.promise)?_.call(c).done(f).fail(p):c&&T(_=c.then)?_.call(c,f,p):f.apply(void 0,[c].slice(x))}catch(b){p.apply(void 0,[b])}}g.extend({Deferred:function(c){var f=[["notify","progress",g.Callbacks("memory"),g.Callbacks("memory"),2],["resolve","done",g.Callbacks("once memory"),g.Callbacks("once memory"),0,"resolved"],["reject","fail",g.Callbacks("once memory"),g.Callbacks("once memory"),1,"rejected"]],p="pending",x={state:function(){return p},always:function(){return _.done(arguments).fail(arguments),this},catch:function(b){return x.then(null,b)},pipe:function(){var b=arguments;return g.Deferred(function(w){g.each(f,function(R,k){var I=T(b[k[4]])&&b[k[4]];_[k[1]](function(){var X=I&&I.apply(this,arguments);X&&T(X.promise)?X.promise().progress(w.notify).done(w.resolve).fail(w.reject):w[k[0]+"With"](this,I?[X]:arguments)})}),b=null}).promise()},then:function(b,w,R){var k=0;function I(X,j,O,B){return function(){var rt=this,ft=arguments,it=function(){var te,Ee;if(!(X=k&&(O!==bt&&(rt=void 0,ft=[te]),j.rejectWith(rt,ft))}};X?re():(g.Deferred.getStackHook&&(re.stackTrace=g.Deferred.getStackHook()),e.setTimeout(re))}}return g.Deferred(function(X){f[0][3].add(I(0,X,T(R)?R:ee,X.notifyWith)),f[1][3].add(I(0,X,T(b)?b:ee)),f[2][3].add(I(0,X,T(w)?w:bt))}).promise()},promise:function(b){return b!=null?g.extend(b,x):x}},_={};return g.each(f,function(b,w){var R=w[2],k=w[5];x[w[1]]=R.add,k&&R.add(function(){p=k},f[3-b][2].disable,f[3-b][3].disable,f[0][2].lock,f[0][3].lock),R.add(w[3].fire),_[w[0]]=function(){return _[w[0]+"With"](this===_?void 0:this,arguments),this},_[w[0]+"With"]=R.fireWith}),x.promise(_),c&&c.call(_,_),_},when:function(c){var f=arguments.length,p=f,x=Array(p),_=a.call(arguments),b=g.Deferred(),w=function(R){return function(k){x[R]=this,_[R]=arguments.length>1?a.call(arguments):k,--f||b.resolveWith(x,_)}};if(f<=1&&(Vt(c,b.done(w(p)).resolve,b.reject,!f),b.state()==="pending"||T(_[p]&&_[p].then)))return b.then();for(;p--;)Vt(_[p],w(p),b.reject);return b.promise()}});var he=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;g.Deferred.exceptionHook=function(c,f){e.console&&e.console.warn&&c&&he.test(c.name)&&e.console.warn("jQuery.Deferred exception: "+c.message,c.stack,f)},g.readyException=function(c){e.setTimeout(function(){throw c})};var ne=g.Deferred();g.fn.ready=function(c){return ne.then(c).catch(function(f){g.readyException(f)}),this},g.extend({isReady:!1,readyWait:1,ready:function(c){(c===!0?--g.readyWait:g.isReady)||(g.isReady=!0,!(c!==!0&&--g.readyWait>0)&&ne.resolveWith(A,[g]))}}),g.ready.then=ne.then;function ye(){A.removeEventListener("DOMContentLoaded",ye),e.removeEventListener("load",ye),g.ready()}A.readyState==="complete"||A.readyState!=="loading"&&!A.documentElement.doScroll?e.setTimeout(g.ready):(A.addEventListener("DOMContentLoaded",ye),e.addEventListener("load",ye));var J=function(c,f,p,x,_,b,w){var R=0,k=c.length,I=p==null;if(L(p)==="object"){_=!0;for(R in p)J(c,f,R,p[R],!0,b,w)}else if(x!==void 0&&(_=!0,T(x)||(w=!0),I&&(w?(f.call(c,x),f=null):(I=f,f=function(X,j,O){return I.call(g(X),O)})),f))for(;R1,null,!0)},removeData:function(c){return this.each(function(){Gt.remove(this,c)})}}),g.extend({queue:function(c,f,p){var x;if(c)return f=(f||"fx")+"queue",x=et.get(c,f),p&&(!x||Array.isArray(p)?x=et.access(c,f,g.makeArray(p)):x.push(p)),x||[]},dequeue:function(c,f){f=f||"fx";var p=g.queue(c,f),x=p.length,_=p.shift(),b=g._queueHooks(c,f),w=function(){g.dequeue(c,f)};_==="inprogress"&&(_=p.shift(),x--),_&&(f==="fx"&&p.unshift("inprogress"),delete b.stop,_.call(c,w,b)),!x&&b&&b.empty.fire()},_queueHooks:function(c,f){var p=f+"queueHooks";return et.get(c,p)||et.access(c,p,{empty:g.Callbacks("once memory").add(function(){et.remove(c,[f+"queue",p])})})}}),g.fn.extend({queue:function(c,f){var p=2;return typeof c!="string"&&(f=c,c="fx",p--),arguments.length\x20\t\r\n\f]*)/i,jo=/^$|^module$|\/(?:java|ecma)script/i;(function(){var c=A.createDocumentFragment(),f=c.appendChild(A.createElement("div")),p=A.createElement("input");p.setAttribute("type","radio"),p.setAttribute("checked","checked"),p.setAttribute("name","t"),f.appendChild(p),m.checkClone=f.cloneNode(!0).cloneNode(!0).lastChild.checked,f.innerHTML="",m.noCloneChecked=!!f.cloneNode(!0).lastChild.defaultValue,f.innerHTML="",m.option=!!f.lastChild})();var De={thead:[1,"
"],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};De.tbody=De.tfoot=De.colgroup=De.caption=De.thead,De.th=De.td,m.option||(De.optgroup=De.option=[1,""]);function be(c,f){var p;return typeof c.getElementsByTagName<"u"?p=c.getElementsByTagName(f||"*"):typeof c.querySelectorAll<"u"?p=c.querySelectorAll(f||"*"):p=[],f===void 0||f&&nt(c,f)?g.merge([c],p):p}function qr(c,f){for(var p=0,x=c.length;p-1){_&&_.push(b);continue}if(I=Bn(b),w=be(j.appendChild(b),"script"),I&&qr(w),p)for(X=0;b=w[X++];)jo.test(b.type||"")&&p.push(b)}return j}var Go=/^([^.]*)(?:\.(.+)|)/;function Hn(){return!0}function Yn(){return!1}function Tl(c,f){return c===wl()==(f==="focus")}function wl(){try{return A.activeElement}catch{}}function Gr(c,f,p,x,_,b){var w,R;if(typeof f=="object"){typeof p!="string"&&(x=x||p,p=void 0);for(R in f)Gr(c,R,p,x,f[R],b);return c}if(x==null&&_==null?(_=p,x=p=void 0):_==null&&(typeof p=="string"?(_=x,x=void 0):(_=x,x=p,p=void 0)),_===!1)_=Yn;else if(!_)return c;return b===1&&(w=_,_=function(k){return g().off(k),w.apply(this,arguments)},_.guid=w.guid||(w.guid=g.guid++)),c.each(function(){g.event.add(this,f,_,x,p)})}g.event={global:{},add:function(c,f,p,x,_){var b,w,R,k,I,X,j,O,B,rt,ft,it=et.get(c);if(kt(c))for(p.handler&&(b=p,p=b.handler,_=b.selector),_&&g.find.matchesSelector(mn,_),p.guid||(p.guid=g.guid++),(k=it.events)||(k=it.events=Object.create(null)),(w=it.handle)||(w=it.handle=function(re){return typeof g<"u"&&g.event.triggered!==re.type?g.event.dispatch.apply(c,arguments):void 0}),f=(f||"").match(Dt)||[""],I=f.length;I--;)R=Go.exec(f[I])||[],B=ft=R[1],rt=(R[2]||"").split(".").sort(),B&&(j=g.event.special[B]||{},B=(_?j.delegateType:j.bindType)||B,j=g.event.special[B]||{},X=g.extend({type:B,origType:ft,data:x,handler:p,guid:p.guid,selector:_,needsContext:_&&g.expr.match.needsContext.test(_),namespace:rt.join(".")},b),(O=k[B])||(O=k[B]=[],O.delegateCount=0,(!j.setup||j.setup.call(c,x,rt,w)===!1)&&c.addEventListener&&c.addEventListener(B,w)),j.add&&(j.add.call(c,X),X.handler.guid||(X.handler.guid=p.guid)),_?O.splice(O.delegateCount++,0,X):O.push(X),g.event.global[B]=!0)},remove:function(c,f,p,x,_){var b,w,R,k,I,X,j,O,B,rt,ft,it=et.hasData(c)&&et.get(c);if(!(!it||!(k=it.events))){for(f=(f||"").match(Dt)||[""],I=f.length;I--;){if(R=Go.exec(f[I])||[],B=ft=R[1],rt=(R[2]||"").split(".").sort(),!B){for(B in k)g.event.remove(c,B+f[I],p,x,!0);continue}for(j=g.event.special[B]||{},B=(x?j.delegateType:j.bindType)||B,O=k[B]||[],R=R[2]&&new RegExp("(^|\\.)"+rt.join("\\.(?:.*\\.|)")+"(\\.|$)"),w=b=O.length;b--;)X=O[b],(_||ft===X.origType)&&(!p||p.guid===X.guid)&&(!R||R.test(X.namespace))&&(!x||x===X.selector||x==="**"&&X.selector)&&(O.splice(b,1),X.selector&&O.delegateCount--,j.remove&&j.remove.call(c,X));w&&!O.length&&((!j.teardown||j.teardown.call(c,rt,it.handle)===!1)&&g.removeEvent(c,B,it.handle),delete k[B])}g.isEmptyObject(k)&&et.remove(c,"handle events")}},dispatch:function(c){var f,p,x,_,b,w,R=new Array(arguments.length),k=g.event.fix(c),I=(et.get(this,"events")||Object.create(null))[k.type]||[],X=g.event.special[k.type]||{};for(R[0]=k,f=1;f=1)){for(;I!==this;I=I.parentNode||this)if(I.nodeType===1&&!(c.type==="click"&&I.disabled===!0)){for(b=[],w={},p=0;p-1:g.find(_,this,null,[I]).length),w[_]&&b.push(x);b.length&&R.push({elem:I,handlers:b})}}return I=this,k\s*$/g;function Zo(c,f){return nt(c,"table")&&nt(f.nodeType!==11?f:f.firstChild,"tr")&&g(c).children("tbody")[0]||c}function Sl(c){return c.type=(c.getAttribute("type")!==null)+"/"+c.type,c}function kl(c){return(c.type||"").slice(0,5)==="true/"?c.type=c.type.slice(5):c.removeAttribute("type"),c}function Ko(c,f){var p,x,_,b,w,R,k;if(f.nodeType===1){if(et.hasData(c)&&(b=et.get(c),k=b.events,k)){et.remove(f,"handle events");for(_ in k)for(p=0,x=k[_].length;p1&&typeof B=="string"&&!m.checkClone&&Al.test(B))return c.each(function(ft){var it=c.eq(ft);rt&&(f[0]=B.call(this,ft,it.html())),Un(it,f,p,x)});if(j&&(_=qo(f,c[0].ownerDocument,!1,c,x),b=_.firstChild,_.childNodes.length===1&&(_=b),b||x)){for(w=g.map(be(_,"script"),Sl),R=w.length;X0&&qr(w,!k&&be(c,"script")),R},cleanData:function(c){for(var f,p,x,_=g.event.special,b=0;(p=c[b])!==void 0;b++)if(kt(p)){if(f=p[et.expando]){if(f.events)for(x in f.events)_[x]?g.event.remove(p,x):g.removeEvent(p,x,f.handle);p[et.expando]=void 0}p[Gt.expando]&&(p[Gt.expando]=void 0)}}}),g.fn.extend({detach:function(c){return Qo(this,c,!0)},remove:function(c){return Qo(this,c)},text:function(c){return J(this,function(f){return f===void 0?g.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=f)})},null,c,arguments.length)},append:function(){return Un(this,arguments,function(c){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var f=Zo(this,c);f.appendChild(c)}})},prepend:function(){return Un(this,arguments,function(c){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var f=Zo(this,c);f.insertBefore(c,f.firstChild)}})},before:function(){return Un(this,arguments,function(c){this.parentNode&&this.parentNode.insertBefore(c,this)})},after:function(){return Un(this,arguments,function(c){this.parentNode&&this.parentNode.insertBefore(c,this.nextSibling)})},empty:function(){for(var c,f=0;(c=this[f])!=null;f++)c.nodeType===1&&(g.cleanData(be(c,!1)),c.textContent="");return this},clone:function(c,f){return c=c??!1,f=f??c,this.map(function(){return g.clone(this,c,f)})},html:function(c){return J(this,function(f){var p=this[0]||{},x=0,_=this.length;if(f===void 0&&p.nodeType===1)return p.innerHTML;if(typeof f=="string"&&!$l.test(f)&&!De[(Wo.exec(f)||["",""])[1].toLowerCase()]){f=g.htmlPrefilter(f);try{for(;x<_;x++)p=this[x]||{},p.nodeType===1&&(g.cleanData(be(p,!1)),p.innerHTML=f);p=0}catch{}}p&&this.empty().append(f)},null,c,arguments.length)},replaceWith:function(){var c=[];return Un(this,arguments,function(f){var p=this.parentNode;g.inArray(this,c)<0&&(g.cleanData(be(this)),p&&p.replaceChild(f,this))},c)}}),g.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,f){g.fn[c]=function(p){for(var x,_=[],b=g(p),w=b.length-1,R=0;R<=w;R++)x=R===w?this:this.clone(!0),g(b[R])[f](x),s.apply(_,x.get());return this.pushStack(_)}});var Zr=new RegExp("^("+Yo+")(?!px)[a-z%]+$","i"),Kr=/^--/,Wi=function(c){var f=c.ownerDocument.defaultView;return(!f||!f.opener)&&(f=e),f.getComputedStyle(c)},Jo=function(c,f,p){var x,_,b={};for(_ in f)b[_]=c.style[_],c.style[_]=f[_];x=p.call(c);for(_ in f)c.style[_]=b[_];return x},Rl=new RegExp(tn.join("|"),"i"),ts="[\\x20\\t\\r\\n\\f]",Ll=new RegExp("^"+ts+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ts+"+$","g");(function(){function c(){if(I){k.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",I.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",mn.appendChild(k).appendChild(I);var X=e.getComputedStyle(I);p=X.top!=="1%",R=f(X.marginLeft)===12,I.style.right="60%",b=f(X.right)===36,x=f(X.width)===36,I.style.position="absolute",_=f(I.offsetWidth/3)===12,mn.removeChild(k),I=null}}function f(X){return Math.round(parseFloat(X))}var p,x,_,b,w,R,k=A.createElement("div"),I=A.createElement("div");I.style&&(I.style.backgroundClip="content-box",I.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle=I.style.backgroundClip==="content-box",g.extend(m,{boxSizingReliable:function(){return c(),x},pixelBoxStyles:function(){return c(),b},pixelPosition:function(){return c(),p},reliableMarginLeft:function(){return c(),R},scrollboxSize:function(){return c(),_},reliableTrDimensions:function(){var X,j,O,B;return w==null&&(X=A.createElement("table"),j=A.createElement("tr"),O=A.createElement("div"),X.style.cssText="position:absolute;left:-11111px;border-collapse:separate",j.style.cssText="border:1px solid",j.style.height="1px",O.style.height="9px",O.style.display="block",mn.appendChild(X).appendChild(j).appendChild(O),B=e.getComputedStyle(j),w=parseInt(B.height,10)+parseInt(B.borderTopWidth,10)+parseInt(B.borderBottomWidth,10)===j.offsetHeight,mn.removeChild(X)),w}}))})();function hi(c,f,p){var x,_,b,w,R=Kr.test(f),k=c.style;return p=p||Wi(c),p&&(w=p.getPropertyValue(f)||p[f],R&&w&&(w=w.replace(Ll,"$1")||void 0),w===""&&!Bn(c)&&(w=g.style(c,f)),!m.pixelBoxStyles()&&Zr.test(w)&&Rl.test(f)&&(x=k.width,_=k.minWidth,b=k.maxWidth,k.minWidth=k.maxWidth=k.width=w,w=p.width,k.width=x,k.minWidth=_,k.maxWidth=b)),w!==void 0?w+"":w}function es(c,f){return{get:function(){if(c()){delete this.get;return}return(this.get=f).apply(this,arguments)}}}var ns=["Webkit","Moz","ms"],is=A.createElement("div").style,rs={};function Ml(c){for(var f=c[0].toUpperCase()+c.slice(1),p=ns.length;p--;)if(c=ns[p]+f,c in is)return c}function Qr(c){var f=g.cssProps[c]||rs[c];return f||(c in is?c:rs[c]=Ml(c)||c)}var Dl=/^(none|table(?!-c[ea]).+)/,Nl={position:"absolute",visibility:"hidden",display:"block"},as={letterSpacing:"0",fontWeight:"400"};function os(c,f,p){var x=li.exec(f);return x?Math.max(0,x[2]-(p||0))+(x[3]||"px"):f}function Jr(c,f,p,x,_,b){var w=f==="width"?1:0,R=0,k=0;if(p===(x?"border":"content"))return 0;for(;w<4;w+=2)p==="margin"&&(k+=g.css(c,p+tn[w],!0,_)),x?(p==="content"&&(k-=g.css(c,"padding"+tn[w],!0,_)),p!=="margin"&&(k-=g.css(c,"border"+tn[w]+"Width",!0,_))):(k+=g.css(c,"padding"+tn[w],!0,_),p!=="padding"?k+=g.css(c,"border"+tn[w]+"Width",!0,_):R+=g.css(c,"border"+tn[w]+"Width",!0,_));return!x&&b>=0&&(k+=Math.max(0,Math.ceil(c["offset"+f[0].toUpperCase()+f.slice(1)]-b-k-R-.5))||0),k}function ss(c,f,p){var x=Wi(c),_=!m.boxSizingReliable()||p,b=_&&g.css(c,"boxSizing",!1,x)==="border-box",w=b,R=hi(c,f,x),k="offset"+f[0].toUpperCase()+f.slice(1);if(Zr.test(R)){if(!p)return R;R="auto"}return(!m.boxSizingReliable()&&b||!m.reliableTrDimensions()&&nt(c,"tr")||R==="auto"||!parseFloat(R)&&g.css(c,"display",!1,x)==="inline")&&c.getClientRects().length&&(b=g.css(c,"boxSizing",!1,x)==="border-box",w=k in c,w&&(R=c[k])),R=parseFloat(R)||0,R+Jr(c,f,p||(b?"border":"content"),w,x,R)+"px"}g.extend({cssHooks:{opacity:{get:function(c,f){if(f){var p=hi(c,"opacity");return p===""?"1":p}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(c,f,p,x){if(!(!c||c.nodeType===3||c.nodeType===8||!c.style)){var _,b,w,R=Bt(f),k=Kr.test(f),I=c.style;if(k||(f=Qr(R)),w=g.cssHooks[f]||g.cssHooks[R],p!==void 0){if(b=typeof p,b==="string"&&(_=li.exec(p))&&_[1]&&(p=Uo(c,f,_),b="number"),p==null||p!==p)return;b==="number"&&!k&&(p+=_&&_[3]||(g.cssNumber[R]?"":"px")),!m.clearCloneStyle&&p===""&&f.indexOf("background")===0&&(I[f]="inherit"),(!w||!("set"in w)||(p=w.set(c,p,x))!==void 0)&&(k?I.setProperty(f,p):I[f]=p)}else return w&&"get"in w&&(_=w.get(c,!1,x))!==void 0?_:I[f]}},css:function(c,f,p,x){var _,b,w,R=Bt(f),k=Kr.test(f);return k||(f=Qr(R)),w=g.cssHooks[f]||g.cssHooks[R],w&&"get"in w&&(_=w.get(c,!0,p)),_===void 0&&(_=hi(c,f,x)),_==="normal"&&f in as&&(_=as[f]),p===""||p?(b=parseFloat(_),p===!0||isFinite(b)?b||0:_):_}}),g.each(["height","width"],function(c,f){g.cssHooks[f]={get:function(p,x,_){if(x)return Dl.test(g.css(p,"display"))&&(!p.getClientRects().length||!p.getBoundingClientRect().width)?Jo(p,Nl,function(){return ss(p,f,_)}):ss(p,f,_)},set:function(p,x,_){var b,w=Wi(p),R=!m.scrollboxSize()&&w.position==="absolute",k=R||_,I=k&&g.css(p,"boxSizing",!1,w)==="border-box",X=_?Jr(p,f,_,I,w):0;return I&&R&&(X-=Math.ceil(p["offset"+f[0].toUpperCase()+f.slice(1)]-parseFloat(w[f])-Jr(p,f,"border",!1,w)-.5)),X&&(b=li.exec(x))&&(b[3]||"px")!=="px"&&(p.style[f]=x,x=g.css(p,f)),os(p,x,X)}}}),g.cssHooks.marginLeft=es(m.reliableMarginLeft,function(c,f){if(f)return(parseFloat(hi(c,"marginLeft"))||c.getBoundingClientRect().left-Jo(c,{marginLeft:0},function(){return c.getBoundingClientRect().left}))+"px"}),g.each({margin:"",padding:"",border:"Width"},function(c,f){g.cssHooks[c+f]={expand:function(p){for(var x=0,_={},b=typeof p=="string"?p.split(" "):[p];x<4;x++)_[c+tn[x]+f]=b[x]||b[x-2]||b[0];return _}},c!=="margin"&&(g.cssHooks[c+f].set=os)}),g.fn.extend({css:function(c,f){return J(this,function(p,x,_){var b,w,R={},k=0;if(Array.isArray(x)){for(b=Wi(p),w=x.length;k1)}});function Te(c,f,p,x,_){return new Te.prototype.init(c,f,p,x,_)}g.Tween=Te,Te.prototype={constructor:Te,init:function(c,f,p,x,_,b){this.elem=c,this.prop=p,this.easing=_||g.easing._default,this.options=f,this.start=this.now=this.cur(),this.end=x,this.unit=b||(g.cssNumber[p]?"":"px")},cur:function(){var c=Te.propHooks[this.prop];return c&&c.get?c.get(this):Te.propHooks._default.get(this)},run:function(c){var f,p=Te.propHooks[this.prop];return this.options.duration?this.pos=f=g.easing[this.easing](c,this.options.duration*c,0,1,this.options.duration):this.pos=f=c,this.now=(this.end-this.start)*f+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),p&&p.set?p.set(this):Te.propHooks._default.set(this),this}},Te.prototype.init.prototype=Te.prototype,Te.propHooks={_default:{get:function(c){var f;return c.elem.nodeType!==1||c.elem[c.prop]!=null&&c.elem.style[c.prop]==null?c.elem[c.prop]:(f=g.css(c.elem,c.prop,""),!f||f==="auto"?0:f)},set:function(c){g.fx.step[c.prop]?g.fx.step[c.prop](c):c.elem.nodeType===1&&(g.cssHooks[c.prop]||c.elem.style[Qr(c.prop)]!=null)?g.style(c.elem,c.prop,c.now+c.unit):c.elem[c.prop]=c.now}}},Te.propHooks.scrollTop=Te.propHooks.scrollLeft={set:function(c){c.elem.nodeType&&c.elem.parentNode&&(c.elem[c.prop]=c.now)}},g.easing={linear:function(c){return c},swing:function(c){return .5-Math.cos(c*Math.PI)/2},_default:"swing"},g.fx=Te.prototype.init,g.fx.step={};var Vn,ji,Il=/^(?:toggle|show|hide)$/,Pl=/queueHooks$/;function ta(){ji&&(A.hidden===!1&&e.requestAnimationFrame?e.requestAnimationFrame(ta):e.setTimeout(ta,g.fx.interval),g.fx.tick())}function cs(){return e.setTimeout(function(){Vn=void 0}),Vn=Date.now()}function qi(c,f){var p,x=0,_={height:c};for(f=f?1:0;x<4;x+=2-f)p=tn[x],_["margin"+p]=_["padding"+p]=c;return f&&(_.opacity=_.width=c),_}function us(c,f,p){for(var x,_=(Oe.tweeners[f]||[]).concat(Oe.tweeners["*"]),b=0,w=_.length;b1)},removeAttr:function(c){return this.each(function(){g.removeAttr(this,c)})}}),g.extend({attr:function(c,f,p){var x,_,b=c.nodeType;if(!(b===3||b===8||b===2)){if(typeof c.getAttribute>"u")return g.prop(c,f,p);if((b!==1||!g.isXMLDoc(c))&&(_=g.attrHooks[f.toLowerCase()]||(g.expr.match.bool.test(f)?ls:void 0)),p!==void 0){if(p===null){g.removeAttr(c,f);return}return _&&"set"in _&&(x=_.set(c,p,f))!==void 0?x:(c.setAttribute(f,p+""),p)}return _&&"get"in _&&(x=_.get(c,f))!==null?x:(x=g.find.attr(c,f),x??void 0)}},attrHooks:{type:{set:function(c,f){if(!m.radioValue&&f==="radio"&&nt(c,"input")){var p=c.value;return c.setAttribute("type",f),p&&(c.value=p),f}}}},removeAttr:function(c,f){var p,x=0,_=f&&f.match(Dt);if(_&&c.nodeType===1)for(;p=_[x++];)c.removeAttribute(p)}}),ls={set:function(c,f,p){return f===!1?g.removeAttr(c,p):c.setAttribute(p,p),p}},g.each(g.expr.match.bool.source.match(/\w+/g),function(c,f){var p=di[f]||g.find.attr;di[f]=function(x,_,b){var w,R,k=_.toLowerCase();return b||(R=di[k],di[k]=w,w=p(x,_,b)!=null?k:null,di[k]=R),w}});var Xl=/^(?:input|select|textarea|button)$/i,Bl=/^(?:a|area)$/i;g.fn.extend({prop:function(c,f){return J(this,g.prop,c,f,arguments.length>1)},removeProp:function(c){return this.each(function(){delete this[g.propFix[c]||c]})}}),g.extend({prop:function(c,f,p){var x,_,b=c.nodeType;if(!(b===3||b===8||b===2))return(b!==1||!g.isXMLDoc(c))&&(f=g.propFix[f]||f,_=g.propHooks[f]),p!==void 0?_&&"set"in _&&(x=_.set(c,p,f))!==void 0?x:c[f]=p:_&&"get"in _&&(x=_.get(c,f))!==null?x:c[f]},propHooks:{tabIndex:{get:function(c){var f=g.find.attr(c,"tabindex");return f?parseInt(f,10):Xl.test(c.nodeName)||Bl.test(c.nodeName)&&c.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(g.propHooks.selected={get:function(c){var f=c.parentNode;return f&&f.parentNode&&f.parentNode.selectedIndex,null},set:function(c){var f=c.parentNode;f&&(f.selectedIndex,f.parentNode&&f.parentNode.selectedIndex)}}),g.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){g.propFix[this.toLowerCase()]=this});function _n(c){var f=c.match(Dt)||[];return f.join(" ")}function bn(c){return c.getAttribute&&c.getAttribute("class")||""}function ea(c){return Array.isArray(c)?c:typeof c=="string"?c.match(Dt)||[]:[]}g.fn.extend({addClass:function(c){var f,p,x,_,b,w;return T(c)?this.each(function(R){g(this).addClass(c.call(this,R,bn(this)))}):(f=ea(c),f.length?this.each(function(){if(x=bn(this),p=this.nodeType===1&&" "+_n(x)+" ",p){for(b=0;b-1;)p=p.replace(" "+_+" "," ");w=_n(p),x!==w&&this.setAttribute("class",w)}}):this):this.attr("class","")},toggleClass:function(c,f){var p,x,_,b,w=typeof c,R=w==="string"||Array.isArray(c);return T(c)?this.each(function(k){g(this).toggleClass(c.call(this,k,bn(this),f),f)}):typeof f=="boolean"&&R?f?this.addClass(c):this.removeClass(c):(p=ea(c),this.each(function(){if(R)for(b=g(this),_=0;_-1)return!0;return!1}});var zl=/\r/g;g.fn.extend({val:function(c){var f,p,x,_=this[0];return arguments.length?(x=T(c),this.each(function(b){var w;this.nodeType===1&&(x?w=c.call(this,b,g(this).val()):w=c,w==null?w="":typeof w=="number"?w+="":Array.isArray(w)&&(w=g.map(w,function(R){return R==null?"":R+""})),f=g.valHooks[this.type]||g.valHooks[this.nodeName.toLowerCase()],(!f||!("set"in f)||f.set(this,w,"value")===void 0)&&(this.value=w))})):_?(f=g.valHooks[_.type]||g.valHooks[_.nodeName.toLowerCase()],f&&"get"in f&&(p=f.get(_,"value"))!==void 0?p:(p=_.value,typeof p=="string"?p.replace(zl,""):p??"")):void 0}}),g.extend({valHooks:{option:{get:function(c){var f=g.find.attr(c,"value");return f??_n(g.text(c))}},select:{get:function(c){var f,p,x,_=c.options,b=c.selectedIndex,w=c.type==="select-one",R=w?null:[],k=w?b+1:_.length;for(b<0?x=k:x=w?b:0;x-1)&&(p=!0);return p||(c.selectedIndex=-1),b}}}}),g.each(["radio","checkbox"],function(){g.valHooks[this]={set:function(c,f){if(Array.isArray(f))return c.checked=g.inArray(g(c).val(),f)>-1}},m.checkOn||(g.valHooks[this].get=function(c){return c.getAttribute("value")===null?"on":c.value})}),m.focusin="onfocusin"in e;var fs=/^(?:focusinfocus|focusoutblur)$/,hs=function(c){c.stopPropagation()};g.extend(g.event,{trigger:function(c,f,p,x){var _,b,w,R,k,I,X,j,O=[p||A],B=d.call(c,"type")?c.type:c,rt=d.call(c,"namespace")?c.namespace.split("."):[];if(b=j=w=p=p||A,!(p.nodeType===3||p.nodeType===8)&&!fs.test(B+g.event.triggered)&&(B.indexOf(".")>-1&&(rt=B.split("."),B=rt.shift(),rt.sort()),k=B.indexOf(":")<0&&"on"+B,c=c[g.expando]?c:new g.Event(B,typeof c=="object"&&c),c.isTrigger=x?2:3,c.namespace=rt.join("."),c.rnamespace=c.namespace?new RegExp("(^|\\.)"+rt.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=void 0,c.target||(c.target=p),f=f==null?[c]:g.makeArray(f,[c]),X=g.event.special[B]||{},!(!x&&X.trigger&&X.trigger.apply(p,f)===!1))){if(!x&&!X.noBubble&&!C(p)){for(R=X.delegateType||B,fs.test(R+B)||(b=b.parentNode);b;b=b.parentNode)O.push(b),w=b;w===(p.ownerDocument||A)&&O.push(w.defaultView||w.parentWindow||e)}for(_=0;(b=O[_++])&&!c.isPropagationStopped();)j=b,c.type=_>1?R:X.bindType||B,I=(et.get(b,"events")||Object.create(null))[c.type]&&et.get(b,"handle"),I&&I.apply(b,f),I=k&&b[k],I&&I.apply&&kt(b)&&(c.result=I.apply(b,f),c.result===!1&&c.preventDefault());return c.type=B,!x&&!c.isDefaultPrevented()&&(!X._default||X._default.apply(O.pop(),f)===!1)&&kt(p)&&k&&T(p[B])&&!C(p)&&(w=p[k],w&&(p[k]=null),g.event.triggered=B,c.isPropagationStopped()&&j.addEventListener(B,hs),p[B](),c.isPropagationStopped()&&j.removeEventListener(B,hs),g.event.triggered=void 0,w&&(p[k]=w)),c.result}},simulate:function(c,f,p){var x=g.extend(new g.Event,p,{type:c,isSimulated:!0});g.event.trigger(x,null,f)}}),g.fn.extend({trigger:function(c,f){return this.each(function(){g.event.trigger(c,f,this)})},triggerHandler:function(c,f){var p=this[0];if(p)return g.event.trigger(c,f,p,!0)}}),m.focusin||g.each({focus:"focusin",blur:"focusout"},function(c,f){var p=function(x){g.event.simulate(f,x.target,g.event.fix(x))};g.event.special[f]={setup:function(){var x=this.ownerDocument||this.document||this,_=et.access(x,f);_||x.addEventListener(c,p,!0),et.access(x,f,(_||0)+1)},teardown:function(){var x=this.ownerDocument||this.document||this,_=et.access(x,f)-1;_?et.access(x,f,_):(x.removeEventListener(c,p,!0),et.remove(x,f))}}});var gi=e.location,ds={guid:Date.now()},na=/\?/;g.parseXML=function(c){var f,p;if(!c||typeof c!="string")return null;try{f=new e.DOMParser().parseFromString(c,"text/xml")}catch{}return p=f&&f.getElementsByTagName("parsererror")[0],(!f||p)&&g.error("Invalid XML: "+(p?g.map(p.childNodes,function(x){return x.textContent}).join(`
+`):c)),f};var Hl=/\[\]$/,gs=/\r?\n/g,Yl=/^(?:submit|button|image|reset|file)$/i,Ul=/^(?:input|select|textarea|keygen)/i;function ia(c,f,p,x){var _;if(Array.isArray(f))g.each(f,function(b,w){p||Hl.test(c)?x(c,w):ia(c+"["+(typeof w=="object"&&w!=null?b:"")+"]",w,p,x)});else if(!p&&L(f)==="object")for(_ in f)ia(c+"["+_+"]",f[_],p,x);else x(c,f)}g.param=function(c,f){var p,x=[],_=function(b,w){var R=T(w)?w():w;x[x.length]=encodeURIComponent(b)+"="+encodeURIComponent(R??"")};if(c==null)return"";if(Array.isArray(c)||c.jquery&&!g.isPlainObject(c))g.each(c,function(){_(this.name,this.value)});else for(p in c)ia(p,c[p],f,_);return x.join("&")},g.fn.extend({serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=g.prop(this,"elements");return c?g.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!g(this).is(":disabled")&&Ul.test(this.nodeName)&&!Yl.test(c)&&(this.checked||!fi.test(c))}).map(function(c,f){var p=g(this).val();return p==null?null:Array.isArray(p)?g.map(p,function(x){return{name:f.name,value:x.replace(gs,`\r
+`)}}):{name:f.name,value:p.replace(gs,`\r
+`)}}).get()}});var Vl=/%20/g,Wl=/#.*$/,jl=/([?&])_=[^&]*/,ql=/^(.*?):[ \t]*([^\r\n]*)$/mg,Gl=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Zl=/^(?:GET|HEAD)$/,Kl=/^\/\//,ps={},ra={},vs="*/".concat("*"),aa=A.createElement("a");aa.href=gi.href;function xs(c){return function(f,p){typeof f!="string"&&(p=f,f="*");var x,_=0,b=f.toLowerCase().match(Dt)||[];if(T(p))for(;x=b[_++];)x[0]==="+"?(x=x.slice(1)||"*",(c[x]=c[x]||[]).unshift(p)):(c[x]=c[x]||[]).push(p)}}function ys(c,f,p,x){var _={},b=c===ra;function w(R){var k;return _[R]=!0,g.each(c[R]||[],function(I,X){var j=X(f,p,x);if(typeof j=="string"&&!b&&!_[j])return f.dataTypes.unshift(j),w(j),!1;if(b)return!(k=j)}),k}return w(f.dataTypes[0])||!_["*"]&&w("*")}function oa(c,f){var p,x,_=g.ajaxSettings.flatOptions||{};for(p in f)f[p]!==void 0&&((_[p]?c:x||(x={}))[p]=f[p]);return x&&g.extend(!0,c,x),c}function Ql(c,f,p){for(var x,_,b,w,R=c.contents,k=c.dataTypes;k[0]==="*";)k.shift(),x===void 0&&(x=c.mimeType||f.getResponseHeader("Content-Type"));if(x){for(_ in R)if(R[_]&&R[_].test(x)){k.unshift(_);break}}if(k[0]in p)b=k[0];else{for(_ in p){if(!k[0]||c.converters[_+" "+k[0]]){b=_;break}w||(w=_)}b=b||w}if(b)return b!==k[0]&&k.unshift(b),p[b]}function Jl(c,f,p,x){var _,b,w,R,k,I={},X=c.dataTypes.slice();if(X[1])for(w in c.converters)I[w.toLowerCase()]=c.converters[w];for(b=X.shift();b;)if(c.responseFields[b]&&(p[c.responseFields[b]]=f),!k&&x&&c.dataFilter&&(f=c.dataFilter(f,c.dataType)),k=b,b=X.shift(),b){if(b==="*")b=k;else if(k!=="*"&&k!==b){if(w=I[k+" "+b]||I["* "+b],!w){for(_ in I)if(R=_.split(" "),R[1]===b&&(w=I[k+" "+R[0]]||I["* "+R[0]],w)){w===!0?w=I[_]:I[_]!==!0&&(b=R[0],X.unshift(R[1]));break}}if(w!==!0)if(w&&c.throws)f=w(f);else try{f=w(f)}catch(j){return{state:"parsererror",error:w?j:"No conversion from "+k+" to "+b}}}}return{state:"success",data:f}}g.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gi.href,type:"GET",isLocal:Gl.test(gi.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vs,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":g.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,f){return f?oa(oa(c,g.ajaxSettings),f):oa(g.ajaxSettings,c)},ajaxPrefilter:xs(ps),ajaxTransport:xs(ra),ajax:function(c,f){typeof c=="object"&&(f=c,c=void 0),f=f||{};var p,x,_,b,w,R,k,I,X,j,O=g.ajaxSetup({},f),B=O.context||O,rt=O.context&&(B.nodeType||B.jquery)?g(B):g.event,ft=g.Deferred(),it=g.Callbacks("once memory"),re=O.statusCode||{},te={},Ee={},Nt="canceled",lt={readyState:0,getResponseHeader:function(Ct){var jt;if(k){if(!b)for(b={};jt=ql.exec(_);)b[jt[1].toLowerCase()+" "]=(b[jt[1].toLowerCase()+" "]||[]).concat(jt[2]);jt=b[Ct.toLowerCase()+" "]}return jt==null?null:jt.join(", ")},getAllResponseHeaders:function(){return k?_:null},setRequestHeader:function(Ct,jt){return k==null&&(Ct=Ee[Ct.toLowerCase()]=Ee[Ct.toLowerCase()]||Ct,te[Ct]=jt),this},overrideMimeType:function(Ct){return k==null&&(O.mimeType=Ct),this},statusCode:function(Ct){var jt;if(Ct)if(k)lt.always(Ct[lt.status]);else for(jt in Ct)re[jt]=[re[jt],Ct[jt]];return this},abort:function(Ct){var jt=Ct||Nt;return p&&p.abort(jt),we(0,jt),this}};if(ft.promise(lt),O.url=((c||O.url||gi.href)+"").replace(Kl,gi.protocol+"//"),O.type=f.method||f.type||O.method||O.type,O.dataTypes=(O.dataType||"*").toLowerCase().match(Dt)||[""],O.crossDomain==null){R=A.createElement("a");try{R.href=O.url,R.href=R.href,O.crossDomain=aa.protocol+"//"+aa.host!=R.protocol+"//"+R.host}catch{O.crossDomain=!0}}if(O.data&&O.processData&&typeof O.data!="string"&&(O.data=g.param(O.data,O.traditional)),ys(ps,O,f,lt),k)return lt;I=g.event&&O.global,I&&g.active++===0&&g.event.trigger("ajaxStart"),O.type=O.type.toUpperCase(),O.hasContent=!Zl.test(O.type),x=O.url.replace(Wl,""),O.hasContent?O.data&&O.processData&&(O.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(O.data=O.data.replace(Vl,"+")):(j=O.url.slice(x.length),O.data&&(O.processData||typeof O.data=="string")&&(x+=(na.test(x)?"&":"?")+O.data,delete O.data),O.cache===!1&&(x=x.replace(jl,"$1"),j=(na.test(x)?"&":"?")+"_="+ds.guid+++j),O.url=x+j),O.ifModified&&(g.lastModified[x]&<.setRequestHeader("If-Modified-Since",g.lastModified[x]),g.etag[x]&<.setRequestHeader("If-None-Match",g.etag[x])),(O.data&&O.hasContent&&O.contentType!==!1||f.contentType)&<.setRequestHeader("Content-Type",O.contentType),lt.setRequestHeader("Accept",O.dataTypes[0]&&O.accepts[O.dataTypes[0]]?O.accepts[O.dataTypes[0]]+(O.dataTypes[0]!=="*"?", "+vs+"; q=0.01":""):O.accepts["*"]);for(X in O.headers)lt.setRequestHeader(X,O.headers[X]);if(O.beforeSend&&(O.beforeSend.call(B,lt,O)===!1||k))return lt.abort();if(Nt="abort",it.add(O.complete),lt.done(O.success),lt.fail(O.error),p=ys(ra,O,f,lt),!p)we(-1,"No Transport");else{if(lt.readyState=1,I&&rt.trigger("ajaxSend",[lt,O]),k)return lt;O.async&&O.timeout>0&&(w=e.setTimeout(function(){lt.abort("timeout")},O.timeout));try{k=!1,p.send(te,we)}catch(Ct){if(k)throw Ct;we(-1,Ct)}}function we(Ct,jt,vi,Gi){var Re,Tn,wn,$e,hn,Ne=jt;k||(k=!0,w&&e.clearTimeout(w),p=void 0,_=Gi||"",lt.readyState=Ct>0?4:0,Re=Ct>=200&&Ct<300||Ct===304,vi&&($e=Ql(O,lt,vi)),!Re&&g.inArray("script",O.dataTypes)>-1&&g.inArray("json",O.dataTypes)<0&&(O.converters["text script"]=function(){}),$e=Jl(O,$e,lt,Re),Re?(O.ifModified&&(hn=lt.getResponseHeader("Last-Modified"),hn&&(g.lastModified[x]=hn),hn=lt.getResponseHeader("etag"),hn&&(g.etag[x]=hn)),Ct===204||O.type==="HEAD"?Ne="nocontent":Ct===304?Ne="notmodified":(Ne=$e.state,Tn=$e.data,wn=$e.error,Re=!wn)):(wn=Ne,(Ct||!Ne)&&(Ne="error",Ct<0&&(Ct=0))),lt.status=Ct,lt.statusText=(jt||Ne)+"",Re?ft.resolveWith(B,[Tn,Ne,lt]):ft.rejectWith(B,[lt,Ne,wn]),lt.statusCode(re),re=void 0,I&&rt.trigger(Re?"ajaxSuccess":"ajaxError",[lt,O,Re?Tn:wn]),it.fireWith(B,[lt,Ne]),I&&(rt.trigger("ajaxComplete",[lt,O]),--g.active||g.event.trigger("ajaxStop")))}return lt},getJSON:function(c,f,p){return g.get(c,f,p,"json")},getScript:function(c,f){return g.get(c,void 0,f,"script")}}),g.each(["get","post"],function(c,f){g[f]=function(p,x,_,b){return T(x)&&(b=b||_,_=x,x=void 0),g.ajax(g.extend({url:p,type:f,dataType:b,data:x,success:_},g.isPlainObject(p)&&p))}}),g.ajaxPrefilter(function(c){var f;for(f in c.headers)f.toLowerCase()==="content-type"&&(c.contentType=c.headers[f]||"")}),g._evalUrl=function(c,f,p){return g.ajax({url:c,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(x){g.globalEval(x,f,p)}})},g.fn.extend({wrapAll:function(c){var f;return this[0]&&(T(c)&&(c=c.call(this[0])),f=g(c,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&f.insertBefore(this[0]),f.map(function(){for(var p=this;p.firstElementChild;)p=p.firstElementChild;return p}).append(this)),this},wrapInner:function(c){return T(c)?this.each(function(f){g(this).wrapInner(c.call(this,f))}):this.each(function(){var f=g(this),p=f.contents();p.length?p.wrapAll(c):f.append(c)})},wrap:function(c){var f=T(c);return this.each(function(p){g(this).wrapAll(f?c.call(this,p):c)})},unwrap:function(c){return this.parent(c).not("body").each(function(){g(this).replaceWith(this.childNodes)}),this}}),g.expr.pseudos.hidden=function(c){return!g.expr.pseudos.visible(c)},g.expr.pseudos.visible=function(c){return!!(c.offsetWidth||c.offsetHeight||c.getClientRects().length)},g.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch{}};var tf={0:200,1223:204},pi=g.ajaxSettings.xhr();m.cors=!!pi&&"withCredentials"in pi,m.ajax=pi=!!pi,g.ajaxTransport(function(c){var f,p;if(m.cors||pi&&!c.crossDomain)return{send:function(x,_){var b,w=c.xhr();if(w.open(c.type,c.url,c.async,c.username,c.password),c.xhrFields)for(b in c.xhrFields)w[b]=c.xhrFields[b];c.mimeType&&w.overrideMimeType&&w.overrideMimeType(c.mimeType),!c.crossDomain&&!x["X-Requested-With"]&&(x["X-Requested-With"]="XMLHttpRequest");for(b in x)w.setRequestHeader(b,x[b]);f=function(R){return function(){f&&(f=p=w.onload=w.onerror=w.onabort=w.ontimeout=w.onreadystatechange=null,R==="abort"?w.abort():R==="error"?typeof w.status!="number"?_(0,"error"):_(w.status,w.statusText):_(tf[w.status]||w.status,w.statusText,(w.responseType||"text")!=="text"||typeof w.responseText!="string"?{binary:w.response}:{text:w.responseText},w.getAllResponseHeaders()))}},w.onload=f(),p=w.onerror=w.ontimeout=f("error"),w.onabort!==void 0?w.onabort=p:w.onreadystatechange=function(){w.readyState===4&&e.setTimeout(function(){f&&p()})},f=f("abort");try{w.send(c.hasContent&&c.data||null)}catch(R){if(f)throw R}},abort:function(){f&&f()}}}),g.ajaxPrefilter(function(c){c.crossDomain&&(c.contents.script=!1)}),g.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(c){return g.globalEval(c),c}}}),g.ajaxPrefilter("script",function(c){c.cache===void 0&&(c.cache=!1),c.crossDomain&&(c.type="GET")}),g.ajaxTransport("script",function(c){if(c.crossDomain||c.scriptAttrs){var f,p;return{send:function(x,_){f=g("
+
+
+
+
+
+
+