@file-viewer/web-full 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2097 @@
1
+ (function(){var $x=Object.defineProperty,xt=(n,t)=>()=>(n&&(t=n(n=0)),t),Hx=(n,t)=>{let e={};for(var i in n)$x(e,i,{get:n[i],enumerable:!0});return t||$x(e,Symbol.toStringTag,{value:"Module"}),e},$v,Vx,zx,Gx,Ec,Hv,Xx,Ac,Vv,IC=xt((()=>{$v="vendor/pdf/pdf.worker.mjs",Vx="vendor/pdf/cmaps/",zx="vendor/pdf/wasm/",Gx="vendor/pdf/standard_fonts/",Ec="http://localhost/",Hv=(n,t,e={})=>{const i=n?String(n):t,r=e.documentBaseUrl||Ec,s=e.baseUrl?e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`:r,o=e.baseUrl?new URL(s,r).href:s,l=new URL(i,o).href;return e.trimTrailingSlash?l.replace(/\/+$/,""):l},Xx=n=>{try{const t=new URL(n||Ec,Ec);if(t.origin&&t.origin!=="null")return`${t.origin}/`}catch{}return Ec},Ac=(n,t,e={})=>n!=null&&String(n).trim()?Hv(n,t,e):Hv(void 0,t,{...e,baseUrl:Xx(e.documentBaseUrl)}),Vv=(n,t)=>({workerUrl:Ac(n?.workerUrl,$v,{documentBaseUrl:t}),cMapUrl:Ac(n?.cMapUrl,Vx,{documentBaseUrl:t}),wasmUrl:Ac(n?.wasmUrl,zx,{documentBaseUrl:t}),standardFontDataUrl:Ac(n?.standardFontDataUrl,Gx,{documentBaseUrl:t})})})),Yx=xt((()=>{IC()})),zv,Gv,Xv,Yv,vr,kC,ba=xt((()=>{zv=["zip","zipx","7z","rar","tar","gz","gzip","tgz","bz2","bzip2","tbz","tbz2","xz","txz","lzma","zst","tzst","cab","ar","cpio","iso","xar","lha","lzh","jar","war","ear","apk","cbz","cbr"],Gv=["glb","gltf","obj","stl","ply","fbx","dae","3ds","3mf","amf","usd","usda","usdc","usdz","kmz","step","stp","iges","igs","ifc","3dm","brep","pcd","wrl","vrml","xyz","vtk","vtp"],Xv=["txt","json","js","mjs","cjs","css","java","py","html","htm","jsx","ts","tsx","xml","log","vue","yaml","yml","ini","sh","bash","sql","go","rs","php","c","cpp","cc","h","hpp","cs","diff","patch","bundle","bdl","jsonc","json5","ipynb","toml","proto","hcl","tex","gv","http","react","rb","swift","kt"],Yv=["gif","jpg","jpeg","bmp","tiff","tif","png","svg","webp","avif","ico","heic","heif","jxl"],vr=[{id:"office-word-openxml",label:"Word OpenXML",category:"office",extensions:["docx","docm","dotx","dotm"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-word-binary",label:"Word Binary",category:"office",extensions:["doc","dot"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-presentation",label:"PowerPoint",category:"office",extensions:["pptx","pptm","potx","potm","ppsx","ppsm"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"open-document",label:"Open Document",category:"office",extensions:["rtf","odt","odp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"spreadsheet-openxml",label:"Spreadsheet",category:"office",extensions:["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!0}},{id:"pdf",label:"PDF",category:"document",extensions:["pdf"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:"provider"}},{id:"ofd",label:"OFD",category:"document",extensions:["ofd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"typst",label:"Typst",category:"document",extensions:["typ","typst"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"archive",label:"Archive",category:"archive",extensions:zv,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!0}},{id:"email",label:"Email",category:"email",extensions:["eml","msg","mbox"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}},{id:"eda",label:"EDA",category:"eda",extensions:["olb","dra","gds","oas","oasis"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"cad",label:"CAD",category:"cad",extensions:["dxf","dwg","dwf","dwfx","xps"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"model",label:"3D Model",category:"model",extensions:Gv,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!1}},{id:"geo",label:"Geospatial",category:"geo",extensions:["geojson","kml","gpx","shp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"drawing",label:"Drawing",category:"drawing",extensions:["excalidraw","drawio","dio","mermaid","mmd","plantuml","puml"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"mindmap",label:"Mind Map",category:"mindmap",extensions:["xmind"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"epub",label:"EPUB",category:"ebook",extensions:["epub"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:"provider"}},{id:"umd",label:"UMD",category:"ebook",extensions:["umd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"image",label:"Image",category:"image",extensions:Yv,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"markdown",label:"Markdown",category:"markdown",extensions:["md","markdown"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"code",label:"Code and Text",category:"code",extensions:Xv,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"video",label:"Video",category:"media",extensions:["mp4","webm","m3u8"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"audio",label:"Audio",category:"media",extensions:["mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba","midi","mid"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"data-asset",label:"Data Asset",category:"asset",extensions:["ttf","otf","woff","woff2","psd","ai","eps","sqlite","wasm","parquet","avro","webarchive"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}}],kC=Object.freeze(Array.from(new Set(vr.flatMap(n=>n.extensions))).sort())})),RC,OC,LC=xt((()=>{RC=["[data-viewer-anchor-id]",".pdfViewer .page",".docx-wrapper section",".docx p",".docx li",".docx table",".markdown-body h1",".markdown-body h2",".markdown-body h3",".markdown-body h4",".markdown-body h5",".markdown-body h6",".markdown-body p",".markdown-body li",".markdown-body pre",".markdown-body table","article h1","article h2","article h3","article h4","article h5","article h6","article p","article li","article pre","article table","pre code","p","li","tr","h1","h2","h3","h4","h5","h6","pre","table"].join(","),OC=[".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match"].join(",")})),Kv,Zv,Kx,Zx,Jv,Qv,DC=xt((()=>{Kv=new WeakMap,Zv=new WeakMap,Kx=(n,t)=>{Kv.set(n,t),n.__flyfishViewerSearchProvider=t},Zx=n=>{n&&(Kv.delete(n),delete n.__flyfishViewerSearchProvider)},Jv=(n,t)=>{Zv.set(n,t),n.dataset.viewerZoomProvider=n.dataset.viewerZoomProvider||"custom",n.__flyfishViewerZoomProvider=t},Qv=n=>{n&&(Zv.delete(n),delete n.dataset.viewerZoomProvider,delete n.__flyfishViewerZoomProvider)}})),Sc=xt((()=>{LC(),DC()})),FC,Jx=xt((()=>{Sc(),FC=["script","style","textarea","input","select","button",".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match",".textLayer",".annotationLayer",".xfaLayer","svg","canvas","iframe","video","audio"].join(",")})),Qx=xt((()=>{Sc(),Jx()})),qv,ty=xt((()=>{Sc(),qv=()=>{const n=new Set;return{emit(){n.forEach(t=>t())},subscribe(t){return n.add(t),()=>{n.delete(t)}}}}})),qx,ey,wa,ny,t0,NC=xt((()=>{qx=96,ey=n=>!Number.isFinite(n)||n<=0?0:Number(n.toFixed(3)),wa=n=>`${ey(n)}px`,ny=n=>`${Number((ey(n)/qx).toFixed(4))}in`,t0=({selector:n,width:t,height:e,heightMode:i="fixed"})=>{const r=wa(t),s=wa(e),o=i==="fixed"?`height:${s}!important;min-height:${s}!important;overflow:hidden!important;`:`height:auto!important;min-height:${s}!important;overflow:visible!important;`;return`
2
+ @page { size: ${ny(t)} ${ny(e)}; margin: 0; }
3
+ @media print {
4
+ html, body {
5
+ width: ${r};
6
+ min-width: ${r};
7
+ background: #ffffff !important;
8
+ }
9
+ ${n} {
10
+ width: ${r}!important;
11
+ max-width: none!important;
12
+ ${o}
13
+ margin: 0!important;
14
+ box-shadow: none!important;
15
+ border: 0!important;
16
+ break-after: page;
17
+ page-break-after: always;
18
+ }
19
+ ${n}:last-child {
20
+ break-after: auto;
21
+ page-break-after: auto;
22
+ }
23
+ }
24
+ `}})),Zn,pf=xt((()=>{Zn=n=>n.trim().replace(/^\./,"").toLowerCase()})),_C,e0,n0,iy,i0,r0,s0,gf,a0,as,o0,dl=xt((()=>{_C="zh-CN",e0={"toolbar.zoomGroup":"缩放控制","toolbar.zoomOut":"缩小预览","toolbar.zoomIn":"放大预览","toolbar.zoomReset":"还原比例","toolbar.download":"下载","toolbar.downloadTitle":"下载原始文件","toolbar.print":"打印","toolbar.printTitle":"打印完整渲染内容","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"导出当前渲染后的 HTML","state.ready.title":"预览完成","state.ready.message":"文件内容已完成渲染。","state.empty.title":"暂无文件","state.empty.message":"请选择文件或提供可访问的文件地址后开始预览。","state.unsupported.install.title":"需要装配预览能力","state.unsupported.install.message":"{extension} 格式已在支持矩阵中,但当前项目尚未装配 {rendererLabel} renderer。","state.unsupported.install.description":"推荐安装 {presetPackage},通过 options.preset / options.renderers 注入对应能力{rendererTip};Vite 项目也可以使用 @file-viewer/vite-plugin 自动发现已安装 preset。","state.unsupported.title":"暂不支持在线预览","state.unsupported.message":"不支持{extension}格式的在线预览,请下载后预览或转换为支持的格式。","state.unsupported.description":"支持 Office、PDF、OFD、Typst、压缩包、邮件、OLB/DRA、CAD、地理数据、3D 模型、Excalidraw、draw.io、EPUB、UMD、Markdown、代码/文本、图片、音视频、字体和数据资产的在线预览","state.error.title":"预览失败","preview.downloading":"正在下载文件资源...","preview.streamingPdf":"正在建立 PDF 流式预览...","preview.reading":"正在解析文件内容...","error.download":"下载失败","error.print":"打印失败","error.exportHtml":"导出 HTML 失败","error.noDownloadSource":"当前没有可下载的源文件","error.noExportContent":"当前没有可导出的预览内容","error.printUnavailable":"当前文件类型不支持完整打印,请下载原文件后在本地应用中打印","error.printWindowBlocked":"浏览器拦截了打印窗口","error.remoteDownload":"文件下载失败","error.localRead":"读取文件异常","error.load":"加载文件异常","error.stream":"加载 PDF 流式预览异常","error.beforeOperation":"操作前置校验失败","operation.download":"下载原始文件","operation.print":"打印完整渲染内容","operation.exportHtml":"导出渲染 HTML","operation.zoomIn":"放大预览","operation.zoomOut":"缩小预览","operation.zoomReset":"还原预览比例","pdf.toolbar.toggleNavigation":"切换导航窗格","pdf.toolbar.previousPage":"上一页","pdf.toolbar.nextPage":"下一页","pdf.toolbar.fitWidth":"适合宽度","pdf.toolbar.zoomOut":"缩小","pdf.toolbar.zoomIn":"放大","pdf.toolbar.rotateLeft":"向左旋转","pdf.toolbar.rotateRight":"向右旋转","pdf.nav.typeLabel":"PDF 导航类型","pdf.nav.pagesTab":"页面","pdf.nav.outlineTab":"目录","pdf.nav.pagesTitle":"页面导航","pdf.nav.outlineTitle":"目录导航","pdf.nav.pageCount":"{count} 页","pdf.nav.itemCount":"{count} 项","pdf.nav.pageLabel":"第 {page} 页","pdf.nav.outlineEmpty":"当前 PDF 没有可用目录","pdf.nav.outlineFallbackTitle":"目录 {index}","pdf.thumbnail.alt":"第 {page} 页缩略图","pdf.state.loading":"正在加载 PDF...","pdf.error.browserWindow":"PDF 预览需要浏览器窗口","pdf.error.missingSource":"PDF 缺少可读取的数据源","pdf.error.loadFailed":"PDF 加载失败","pdf.error.notLoaded":"PDF 尚未加载完成,请稍后再试","pdf.error.unloaded":"PDF 已卸载,无法继续打印","pdf.error.canvasUnavailable":"当前浏览器无法创建 PDF 打印画布","pdf.export.pageTitle":"{title} - 第 {page} 页","spreadsheet.loading.kicker":"Excel 表格","spreadsheet.loading.title":"正在解析 Excel 工作簿","spreadsheet.loading.hint":"正在准备工作表、样式和大数据视口,请稍候。","spreadsheet.loading.streaming":"正在平滑补充可视区数据","spreadsheet.tabs.ariaLabel":"工作表列表","spreadsheet.state.parsingWorkbook":"正在解析 Excel 工作簿,请耐心等待...","spreadsheet.state.preparingSheet":"正在准备工作表内容...","spreadsheet.state.preparingSheetNamed":"正在准备「{name}」...","spreadsheet.state.cachedRows":"已缓存 {cached} / {total} 行","spreadsheet.state.rows":"共 {rows} 行,按视口预取平滑加载","spreadsheet.state.rowsAndColumns":"共 {rows} 行,{cols} 列,按视口预取平滑加载","spreadsheet.error.parseFailed":"Excel 解析失败","spreadsheet.error.workerFailed":"Excel Worker 运行失败","archive.error.nestedUnsupported":"不支持 .{type} 格式的在线预览,请下载后预览或转换为支持的格式","archive.loading.readingDirectory":"正在读取压缩包目录...","archive.loading.readingDirectoryHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.search.placeholder":"筛选压缩包内文件","archive.preview.title":"压缩包内预览","archive.preview.chooseFile":"请选择一个文件","archive.preview.downloadFile":"下载文件","archive.error.title":"压缩包预览提示","archive.stats.summary":"{count} 个文件 · {size} · {previewable} 个可直接预览","archive.warning.encrypted":"检测到加密内容,当前在线预览不接收密码,建议下载后本地解压。","archive.empty.title":"选择左侧文件即可预览","archive.empty.message":"压缩包只读取目录;文件内容会在点击后按需解压,并在体积允许时缓存到 IndexedDB。","archive.loading.initializingCandidate":"正在初始化 {label}...","archive.loading.initializingCandidateHint":"如果当前服务器没有正确发布 Worker/WASM,会自动切换兼容模式。","archive.error.candidateInitTimeout":"{label} 初始化超时","archive.error.encryptedCheckTimeout":"{label} 加密检测超时","archive.loading.directoryReadyHint":"目录读取完成后,点击内部文件才会按需解压。","archive.error.candidateReadTimeout":"{label} 读取目录超时","archive.loading.workerFallback":"Worker 不可用,正在切换 ZIP/TAR 兼容模式...","archive.loading.workerFallbackHint":"兼容模式无需额外静态 Worker,适合手机 WebView 或本地临时服务器。","archive.notice.workerFallback":"当前环境的 libarchive Worker 未能启动,已自动切换到 ZIP/TAR/GZIP 兼容模式。RAR、7z 等格式仍建议发布 vendor/libarchive/worker-bundle.js 与 libarchive.wasm。","archive.error.tooLarge":"压缩包体积 {size} 超过安全上限 {limit},请下载后在本地解压。","archive.loading.initializingWorker":"正在初始化压缩包解析 Worker...","archive.loading.initializingWorkerHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.error.workerInitFailed":"压缩包 Worker 初始化失败","archive.error.entryTooLarge":"压缩包内文件 {name} 体积 {size} 超过预览上限 {limit}。","archive.loading.extracting":"正在按需解压 {name}...","archive.loading.rendering":"正在渲染 {name}...","archive.loading.exporting":"正在导出 {name}...","media.audio.title":"音频预览","media.audio.description":"使用浏览器原生播放器打开,兼容性取决于当前浏览器支持的音频编码。","media.audio.unsupported":"当前浏览器不支持音频播放。","media.video.title":"视频预览","media.video.unsupported":"当前浏览器不支持该视频格式。","media.video.hlsHint":"HLS 会优先使用原始 URL 加载分片;如果传入的是本地单文件清单,请确保分片地址可被浏览器访问。","media.midi.title":"MIDI 文件","media.midi.loading":"正在解析 MIDI 轨道...","media.midi.trackHeader":"轨道","media.midi.instrumentHeader":"乐器","media.midi.channelHeader":"通道","media.midi.noteCountHeader":"音符数","media.midi.durationHeader":"时长","media.midi.durationStat":"时长","media.midi.trackStat":"轨道","media.midi.noteStat":"音符","media.midi.parseFailed":"MIDI 解析失败","email.mbox.subject":"{filename} · 第 1 封","email.mbox.summary":"MBOX 共识别 {count} 封邮件,当前展示第 1 封。","email.error.title":"邮件预览提示","email.meta.from":"发件人","email.meta.to":"收件人","email.meta.cc":"抄送","email.meta.date":"时间","email.tabs.text":"正文","email.tabs.headers":"头信息","email.attachments.title":"附件","email.attachments.empty":"暂无附件","email.attachments.download":"下载附件","email.attachments.opening":"正在打开附件 {name}...","email.attachments.nestedUnavailable":"当前运行环境未提供附件嵌套预览入口,请下载 {name} 后查看。","email.loading.parsing":"正在解析邮件...","data.font.sample":"Flyfish Viewer 轻量预览 AaBbCc 1234567890","data.error.fontFaceUnsupported":"当前浏览器不支持 FontFace API","data.title.font":"字体文件预览","data.title.sqlite":"SQLite 数据库预览","data.title.parquet":"Parquet 列式数据预览","data.title.avro":"Avro 对象容器预览","data.title.wasm":"WebAssembly 模块预览","data.title.eps":"EPS 矢量文件摘要","data.title.ai":"Illustrator 文件摘要","data.title.webarchive":"WebArchive 摘要预览","data.title.summary":"数据资产摘要","data.label.format":"格式","data.label.size":"大小","data.label.rendering":"渲染方式","data.label.objects":"对象数","data.label.sampleTable":"示例表","data.label.rows":"行数","data.label.columns":"列数","data.label.sampleRows":"示例行","data.label.imports":"导入","data.label.exports":"导出","data.label.magic":"Magic","data.label.note":"说明","data.label.container":"容器","data.value.schemaRead":"已读取","data.value.schemaUnread":"未读取","data.note.aiSummary":"非 PDF-compatible AI 按摘要展示","data.note.postscriptSummary":"PostScript 摘要展示","data.note.webarchive":"安全提取可读片段,不执行网页脚本","data.image.alt":"资产预览","psd.title":"PSD 图层预览","psd.action.fit":"适合","psd.action.showAll":"全显","psd.action.hideAll":"全隐","psd.layers.title":"图层","psd.layers.redrawable":"{count} 可重绘","psd.layers.empty":"未发现可展示图层,使用合成图预览。","psd.layers.hidden":"隐藏","drawing.error.viewerLoadFailed":"diagrams.net viewer 加载失败","drawing.error.excalidrawEmpty":"Excalidraw 文件中没有可预览图元","drawing.error.excalidrawTimeout":"Excalidraw 官方导出超时,自动切换 rough.js 兼容渲染","drawing.error.drawioParseFailed":"Draw.io XML 解析失败:{message}","drawing.error.drawioNoModel":"当前 Draw.io 文件没有可直接渲染的 mxGraphModel。","drawing.error.drawioNoElements":"当前 Draw.io 文件没有可预览图元。","drawing.error.viewerInitFailed":"diagrams.net viewer 未正确初始化","drawing.error.drawioTimeout":"diagrams.net 官方 Viewer 加载超时,自动切换本地 SVG 预览","drawing.error.svgParseFailed":"SVG 解析失败","drawing.error.plantumlRenderFailed":"PlantUML SVG 渲染失败:{status}","drawing.title.excalidraw":"Excalidraw 官方 SVG 预览","drawing.title.mermaid":"Mermaid SVG 预览","drawing.title.plantuml":"PlantUML SVG 预览","drawing.title.drawio":"Draw.io 离线 SVG 预览","drawing.toolbar.zoomOut":"缩小","drawing.toolbar.zoomIn":"放大","drawing.toolbar.fit":"适合","drawing.toolbar.fitWidth":"适合宽度","drawing.state.loading":"正在加载绘图预览...","text.code.loadingHighlight":"正在加载高亮...","ebook.toc":"目录","ebook.reading":"阅读中","ebook.itemCount":"{count} 项","epub.title":"EPUB 电子书","epub.previousPage":"上一页","epub.nextPage":"下一页","epub.loading":"正在解析 EPUB...","epub.chapterFallback":"章节 {index}","epub.renderIncomplete":"EPUB 正文渲染未完成,请刷新后重试","umd.title":"UMD 电子书","umd.previousChapter":"上一章","umd.nextChapter":"下一章","umd.loading":"正在解析 UMD...","umd.emptyContent":"未解析到正文内容","umd.chapterFallback":"章节 {index}","umd.galleryFallback":"图集 {index}","umd.warningBodyTooShort":"UMD 正文长度小于声明长度,文件可能不完整","umd.error.unexpectedEnd":"UMD 文件结构不完整,读取时遇到意外结尾","umd.error.invalidFile":"不是有效的 UMD 电子书文件","typst.summaryRenderer":"Typst WASM 渲染器","typst.pageSummary.empty":"0 页","typst.pageSummary.ready":"{count} 页 / {width} x {height} pt","typst.status.compiling":"正在编译","typst.status.failed":"编译失败","typst.status.rendered":"已渲染","typst.loading.title":"正在解析 Typst","typst.loading.hint":"加载编译器并生成页面预览...","typst.error.title":"Typst 渲染失败","typst.error.timeout":"Typst WASM / 字体加载或编译超过 {seconds} 秒","typst.error.timeoutHint":"请检查 Typst compiler WASM、renderer WASM、字体目录的下载速度和缓存策略;弱网或跨境部署可通过 options.typst.renderTimeoutMs 调大浏览器端加载/编译超时。","typst.error.assetHint":"Typst 需要本地 compiler / renderer WASM 和字体目录。请运行 file-viewer-copy-assets,或配置 options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl,并确认服务器以 application/wasm 返回 WASM。","typst.error.svgParseFailed":"Typst SVG 解析失败","typst.error.wasmLoadFailed":"Typst WASM 加载失败","xmind.toolbar.zoomOut":"缩小","xmind.toolbar.zoomIn":"放大","xmind.toolbar.fit":"适合","xmind.toolbar.fitTitle":"适配画布","xmind.state.loading":"正在解析 XMind 脑图...","xmind.stats.nodes":"节点","xmind.stats.depth":"层级","xmind.stats.theme":"主题","xmind.stats.template":"模板","xmind.badge.paused":"暂停","xmind.badge.collapsed":"折叠","xmind.badge.floating":"浮动","xmind.badge.summary":"概要","xmind.badge.callout":"标注","xmind.imageResource":"图片资源: {name}","xmind.error.unrecognized":"无法识别 XMind 文件: ZIP 中未找到 content.json 或 content.xml","xmind.error.noCanvas":"XMind 文件中没有可预览的画布","cad.toolbar.fit":"适配","cad.toolbar.zoomOut":"缩小","cad.toolbar.zoomIn":"放大","cad.layers.title":"图层","cad.layers.count":"{count} 项","cad.inspector.title":"结构","cad.inspector.entities":"实体","cad.inspector.blocks":"块","cad.inspector.pages":"页面","cad.inspector.drawn":"绘制","cad.state.loadingViewer":"正在加载 CAD 预览器...","cad.state.parsing":"正在解析 CAD...","cad.error.parseFailed":"CAD 文件解析失败","image.alt":"图片","image.lightbox.alt":"图片预览","image.lightbox.close":"关闭图片预览","gitBundle.error.invalid":"当前文件不是标准 Git bundle。","gitBundle.error.missingPack":"Git bundle header 后未找到 PACK 数据。","gitBundle.notice.delta":"当前 bundle 包含 delta 压缩对象。预览器已在浏览器端解析常规 OFS_DELTA / REF_DELTA;若仍有缺失文件,通常是包体过大、对象过多或依赖外部 prerequisite。","gitBundle.title.history":"历史记录","gitBundle.title.fileTree":"文件树","gitBundle.file.choose":"选择文件查看内容","gitBundle.file.noTree":"当前 bundle 的 tree/blob 可能被 delta 压缩,暂未解析到可展开文件。","gitBundle.file.none":"未解析到文件","gitBundle.history.empty":"当前 bundle 未解析到 commit 对象,仅展示 refs 和 pack 摘要。","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"无法识别的 GeoJSON 数据","geo.error.xmlParseFailed":"XML 解析失败","geo.error.unsupported":"不支持 .{type} 地理格式","geo.title":"地理数据预览","geo.featureCount":"要素数","geo.bounds":"范围","geo.geometryTypes":"几何类型","geo.aria":"地理数据 SVG 预览","geo.loading":"正在解析地理数据...","model.toolbar.fit":"适配","model.toolbar.rotate":"旋转","model.toolbar.wireframe":"线框","model.toolbar.grid":"网格","model.toolbar.axes":"坐标","model.state.loadingSummary":"正在加载模型","model.state.loading":"正在解析 3D 模型...","model.state.loaded":"模型已加载","model.state.parseFailed":"模型解析失败","model.summary.meshes":"{count} 个网格","model.summary.points":"{count} 个点云","model.error.daeEmpty":"DAE 模型未解析出有效场景","model.error.unsupported":"暂不支持 .{type} 模型格式","model.error.parseFailed":"{type} 模型解析失败","model.notice.signature":"检测到文件签名: {signature}。","loading.generic.label":"文件内容","loading.generic.hint":"正在整理内容结构并生成预览。","loading.word.label":"Word 文档","loading.word.hint":"正在准备分页、文本样式和文档结构。","loading.wordWorker.hint":"正在通过 Worker 准备文档结构、文本样式和分页结果。","loading.sheet.label":"Excel 表格","loading.sheet.hint":"正在准备工作表、样式和可视区数据。","loading.csv.label":"表格数据","loading.csv.hint":"正在准备行列数据和基础样式。","loading.presentation.label":"PPT 演示文稿","loading.presentation.hint":"正在构建幻灯片布局和媒体内容。","loading.pdf.label":"PDF 文档","loading.pdf.hint":"正在载入页面位图、文本层和缩放视图。","loading.ofd.label":"OFD 版式文件","loading.ofd.hint":"正在解析国产版式文档和页面对象。","loading.archive.label":"压缩包","loading.archive.hint":"正在启动 Worker 并读取压缩包目录。","loading.email.label":"邮件文件","loading.email.hint":"正在解析邮件头、正文和附件。","loading.msg.hint":"正在解析 Outlook 邮件和附件。","loading.eda.label":"EDA 文件","loading.eda.hint":"正在读取 EDA 容器结构和可读属性。","loading.cad.label":"CAD 图纸","loading.cad.hint":"正在准备 CAD 图层、几何对象和画布视图。","loading.dwg.hint":"正在通过 Worker 加载 DWG 几何和 LibreDWG WASM。","loading.dwf.hint":"正在加载 DWF native renderer 与 W2D/W3D 图形。","loading.dwfx.hint":"正在加载 DWFx/XPS native renderer 与页面图形。","loading.xps.hint":"正在加载 XPS native renderer 与嵌入字体。","loading.drawio.label":"draw.io 图纸","loading.drawio.hint":"正在解析图元、连线和 SVG 预览。","loading.excalidraw.label":"Excalidraw 图纸","loading.excalidraw.hint":"正在解析手绘图元并生成安全 SVG。","loading.epub.label":"EPUB 电子书","loading.epub.hint":"正在解析目录、章节资源和阅读分页。","loading.umd.label":"UMD 电子书","loading.umd.hint":"正在解析移动电子书结构、目录和压缩正文。","loading.image.label":"图片文件","loading.image.hint":"正在解码像素数据并生成预览。","loading.video.label":"视频文件","loading.video.hint":"正在准备媒体资源和播放组件。","loading.audio.label":"音频文件","loading.audio.hint":"正在准备音频资源和播放控件。"},n0={"toolbar.zoomGroup":"Zoom controls","toolbar.zoomOut":"Zoom out","toolbar.zoomIn":"Zoom in","toolbar.zoomReset":"Reset zoom","toolbar.download":"Download","toolbar.downloadTitle":"Download the original file","toolbar.print":"Print","toolbar.printTitle":"Print the complete rendered document","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"Export the rendered HTML","state.ready.title":"Preview ready","state.ready.message":"The file has been rendered.","state.empty.title":"No file selected","state.empty.message":"Choose a file or provide an accessible URL to start previewing.","state.unsupported.install.title":"Preview capability required","state.unsupported.install.message":"{extension} is in the supported matrix, but {rendererLabel} renderer is not assembled in this project.","state.unsupported.install.description":"Install {presetPackage} and pass the capability through options.preset / options.renderers{rendererTip}. Vite projects can also use @file-viewer/vite-plugin to auto-discover installed presets.","state.unsupported.title":"Online preview is not supported yet","state.unsupported.message":"{extension} cannot be previewed online. Download it or convert it to a supported format.","state.unsupported.description":"Supports online preview for Office, PDF, OFD, Typst, archives, email, OLB/DRA, CAD, geospatial data, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, code/text, images, audio/video, fonts, and structured data assets.","state.error.title":"Preview failed","preview.downloading":"Downloading file resources...","preview.streamingPdf":"Preparing streaming PDF preview...","preview.reading":"Parsing file content...","error.download":"Download failed","error.print":"Print failed","error.exportHtml":"HTML export failed","error.noDownloadSource":"There is no original file source to download.","error.noExportContent":"There is no rendered preview content to export.","error.printUnavailable":"This file type does not support full-document printing. Download the original file and print it locally.","error.printWindowBlocked":"The browser blocked the print window.","error.remoteDownload":"File download failed","error.localRead":"Failed to read local file","error.load":"Failed to load file","error.stream":"Failed to load streaming PDF preview","error.beforeOperation":"Before-operation check failed","operation.download":"Download original file","operation.print":"Print complete rendered content","operation.exportHtml":"Export rendered HTML","operation.zoomIn":"Zoom in","operation.zoomOut":"Zoom out","operation.zoomReset":"Reset preview zoom","pdf.toolbar.toggleNavigation":"Toggle navigation pane","pdf.toolbar.previousPage":"Previous page","pdf.toolbar.nextPage":"Next page","pdf.toolbar.fitWidth":"Fit to width","pdf.toolbar.zoomOut":"Zoom out","pdf.toolbar.zoomIn":"Zoom in","pdf.toolbar.rotateLeft":"Rotate left","pdf.toolbar.rotateRight":"Rotate right","pdf.nav.typeLabel":"PDF navigation type","pdf.nav.pagesTab":"Pages","pdf.nav.outlineTab":"Outline","pdf.nav.pagesTitle":"Page navigation","pdf.nav.outlineTitle":"Outline navigation","pdf.nav.pageCount":"{count} pages","pdf.nav.itemCount":"{count} items","pdf.nav.pageLabel":"Page {page}","pdf.nav.outlineEmpty":"This PDF has no available outline.","pdf.nav.outlineFallbackTitle":"Outline {index}","pdf.thumbnail.alt":"Page {page} thumbnail","pdf.state.loading":"Loading PDF...","pdf.error.browserWindow":"PDF preview requires a browser window","pdf.error.missingSource":"PDF has no readable data source","pdf.error.loadFailed":"Failed to load PDF","pdf.error.notLoaded":"The PDF is not loaded yet. Please try again later.","pdf.error.unloaded":"The PDF has been unloaded and cannot continue printing.","pdf.error.canvasUnavailable":"This browser cannot create a PDF print canvas.","pdf.export.pageTitle":"{title} - Page {page}","spreadsheet.loading.kicker":"Excel workbook","spreadsheet.loading.title":"Parsing Excel workbook","spreadsheet.loading.hint":"Preparing worksheets, styles, and virtualized viewport data.","spreadsheet.loading.streaming":"Loading visible worksheet data","spreadsheet.tabs.ariaLabel":"Worksheet list","spreadsheet.state.parsingWorkbook":"Parsing the Excel workbook. Please wait...","spreadsheet.state.preparingSheet":"Preparing worksheet content...","spreadsheet.state.preparingSheetNamed":"Preparing “{name}”...","spreadsheet.state.cachedRows":"Cached {cached} / {total} rows","spreadsheet.state.rows":"{rows} rows, loading smoothly by viewport","spreadsheet.state.rowsAndColumns":"{rows} rows, {cols} columns, loading smoothly by viewport","spreadsheet.error.parseFailed":"Failed to parse Excel","spreadsheet.error.workerFailed":"Excel Worker failed","archive.error.nestedUnsupported":".{type} cannot be previewed online. Download it or convert it to a supported format.","archive.loading.readingDirectory":"Reading archive directory...","archive.loading.readingDirectoryHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.search.placeholder":"Filter files inside the archive","archive.preview.title":"Archive entry preview","archive.preview.chooseFile":"Choose a file","archive.preview.downloadFile":"Download file","archive.error.title":"Archive preview notice","archive.stats.summary":"{count} files · {size} · {previewable} directly previewable","archive.warning.encrypted":"Encrypted content was detected. Online preview does not accept passwords; download and extract it locally.","archive.empty.title":"Choose a file from the left to preview","archive.empty.message":"The archive directory is read first. File contents are extracted on demand and cached in IndexedDB when size allows.","archive.loading.initializingCandidate":"Initializing {label}...","archive.loading.initializingCandidateHint":"If the server does not publish Worker/WASM assets correctly, the viewer falls back automatically.","archive.error.candidateInitTimeout":"{label} initialization timed out","archive.error.encryptedCheckTimeout":"{label} encryption check timed out","archive.loading.directoryReadyHint":"After the directory is ready, click an entry to extract it on demand.","archive.error.candidateReadTimeout":"{label} directory read timed out","archive.loading.workerFallback":"Worker unavailable. Switching to ZIP/TAR compatibility mode...","archive.loading.workerFallbackHint":"Compatibility mode needs no static Worker and works well in mobile WebViews or temporary local servers.","archive.notice.workerFallback":"The libarchive Worker could not start in this environment, so ZIP/TAR/GZIP compatibility mode is active. RAR, 7z, and similar formats should still publish vendor/libarchive/worker-bundle.js and libarchive.wasm.","archive.error.tooLarge":"Archive size {size} exceeds the safety limit {limit}. Download and extract it locally.","archive.loading.initializingWorker":"Initializing archive parsing Worker...","archive.loading.initializingWorkerHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.error.workerInitFailed":"Archive Worker initialization failed","archive.error.entryTooLarge":"Entry {name} is {size}, exceeding the preview limit {limit}.","archive.loading.extracting":"Extracting {name} on demand...","archive.loading.rendering":"Rendering {name}...","archive.loading.exporting":"Exporting {name}...","media.audio.title":"Audio preview","media.audio.description":"Opened with the browser-native audio player. Codec support depends on the current browser.","media.audio.unsupported":"This browser does not support audio playback.","media.video.title":"Video preview","media.video.unsupported":"This browser does not support this video format.","media.video.hlsHint":"HLS prefers the original URL for segment loading. If the input is a local single-file playlist, make sure segment URLs are reachable by the browser.","media.midi.title":"MIDI file","media.midi.loading":"Parsing MIDI tracks...","media.midi.trackHeader":"Track","media.midi.instrumentHeader":"Instrument","media.midi.channelHeader":"Channel","media.midi.noteCountHeader":"Notes","media.midi.durationHeader":"Duration","media.midi.durationStat":"Duration","media.midi.trackStat":"Tracks","media.midi.noteStat":"Notes","media.midi.parseFailed":"Failed to parse MIDI","email.mbox.subject":"{filename} · message 1","email.mbox.summary":"Detected {count} messages in the MBOX archive. Showing message 1.","email.error.title":"Email preview notice","email.meta.from":"From","email.meta.to":"To","email.meta.cc":"Cc","email.meta.date":"Date","email.tabs.text":"Body","email.tabs.headers":"Headers","email.attachments.title":"Attachments","email.attachments.empty":"No attachments","email.attachments.download":"Download attachment","email.attachments.opening":"Opening attachment {name}...","email.attachments.nestedUnavailable":"Nested attachment preview is not available in this environment. Download {name} to inspect it.","email.loading.parsing":"Parsing email...","data.font.sample":"Flyfish Viewer preview AaBbCc 1234567890","data.error.fontFaceUnsupported":"This browser does not support the FontFace API","data.title.font":"Font file preview","data.title.sqlite":"SQLite database preview","data.title.parquet":"Parquet columnar data preview","data.title.avro":"Avro object container preview","data.title.wasm":"WebAssembly module preview","data.title.eps":"EPS vector file summary","data.title.ai":"Illustrator file summary","data.title.webarchive":"WebArchive summary preview","data.title.summary":"Data asset summary","data.label.format":"Format","data.label.size":"Size","data.label.rendering":"Renderer","data.label.objects":"Objects","data.label.sampleTable":"Sample table","data.label.rows":"Rows","data.label.columns":"Columns","data.label.sampleRows":"Sample rows","data.label.imports":"Imports","data.label.exports":"Exports","data.label.magic":"Magic","data.label.note":"Note","data.label.container":"Container","data.value.schemaRead":"Read","data.value.schemaUnread":"Not read","data.note.aiSummary":"Non PDF-compatible AI is shown as a safe summary.","data.note.postscriptSummary":"PostScript summary preview","data.note.webarchive":"Readable fragments are extracted safely. Web scripts are not executed.","data.image.alt":"Asset preview","psd.title":"PSD layer preview","psd.action.fit":"Fit","psd.action.showAll":"Show all","psd.action.hideAll":"Hide all","psd.layers.title":"Layers","psd.layers.redrawable":"{count} redrawable","psd.layers.empty":"No displayable layers were found. Showing the composite image.","psd.layers.hidden":"hidden","drawing.error.viewerLoadFailed":"Failed to load the diagrams.net viewer","drawing.error.excalidrawEmpty":"This Excalidraw file has no previewable elements","drawing.error.excalidrawTimeout":"Official Excalidraw export timed out. Falling back to the rough.js renderer.","drawing.error.drawioParseFailed":"Failed to parse Draw.io XML: {message}","drawing.error.drawioNoModel":"This Draw.io file has no directly renderable mxGraphModel.","drawing.error.drawioNoElements":"This Draw.io file has no previewable elements.","drawing.error.viewerInitFailed":"The diagrams.net viewer was not initialized correctly","drawing.error.drawioTimeout":"Official diagrams.net Viewer timed out. Falling back to the local SVG preview.","drawing.error.svgParseFailed":"Failed to parse SVG","drawing.error.plantumlRenderFailed":"Failed to render PlantUML SVG: {status}","drawing.title.excalidraw":"Official Excalidraw SVG preview","drawing.title.mermaid":"Mermaid SVG preview","drawing.title.plantuml":"PlantUML SVG preview","drawing.title.drawio":"Draw.io offline SVG preview","drawing.toolbar.zoomOut":"Zoom out","drawing.toolbar.zoomIn":"Zoom in","drawing.toolbar.fit":"Fit","drawing.toolbar.fitWidth":"Fit width","drawing.state.loading":"Loading drawing preview...","text.code.loadingHighlight":"Loading syntax highlighting...","ebook.toc":"Table of contents","ebook.reading":"Reading","ebook.itemCount":"{count} items","epub.title":"EPUB ebook","epub.previousPage":"Previous","epub.nextPage":"Next","epub.loading":"Parsing EPUB...","epub.chapterFallback":"Chapter {index}","epub.renderIncomplete":"EPUB content did not finish rendering. Refresh and try again.","umd.title":"UMD ebook","umd.previousChapter":"Previous chapter","umd.nextChapter":"Next chapter","umd.loading":"Parsing UMD...","umd.emptyContent":"No readable body content was parsed.","umd.chapterFallback":"Chapter {index}","umd.galleryFallback":"Gallery {index}","umd.warningBodyTooShort":"The UMD body is shorter than declared and may be incomplete.","umd.error.unexpectedEnd":"The UMD structure is incomplete and ended unexpectedly.","umd.error.invalidFile":"This is not a valid UMD ebook file.","typst.summaryRenderer":"Typst WASM renderer","typst.pageSummary.empty":"0 pages","typst.pageSummary.ready":"{count} pages / {width} x {height} pt","typst.status.compiling":"Compiling","typst.status.failed":"Compilation failed","typst.status.rendered":"Rendered","typst.loading.title":"Parsing Typst","typst.loading.hint":"Loading the compiler and generating page previews...","typst.error.title":"Typst render failed","typst.error.timeout":"Typst WASM / font loading or compilation exceeded {seconds} seconds","typst.error.timeoutHint":"Check the download speed and cache strategy for the Typst compiler WASM, renderer WASM, and font directory. On weak networks or cross-region deployments, increase options.typst.renderTimeoutMs.","typst.error.assetHint":"Typst requires local compiler / renderer WASM files and a font directory. Run file-viewer-copy-assets, or configure options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl, and make sure the server returns WASM with application/wasm.","typst.error.svgParseFailed":"Failed to parse Typst SVG","typst.error.wasmLoadFailed":"Failed to load Typst WASM","xmind.toolbar.zoomOut":"Zoom out","xmind.toolbar.zoomIn":"Zoom in","xmind.toolbar.fit":"Fit","xmind.toolbar.fitTitle":"Fit canvas","xmind.state.loading":"Parsing XMind mind map...","xmind.stats.nodes":"Nodes","xmind.stats.depth":"Depth","xmind.stats.theme":"Theme","xmind.stats.template":"Template","xmind.badge.paused":"Paused","xmind.badge.collapsed":"Collapsed","xmind.badge.floating":"Floating","xmind.badge.summary":"Summary","xmind.badge.callout":"Callout","xmind.imageResource":"Image resource: {name}","xmind.error.unrecognized":"Unrecognized XMind file: content.json or content.xml was not found in the ZIP package.","xmind.error.noCanvas":"This XMind file has no previewable canvas.","cad.toolbar.fit":"Fit","cad.toolbar.zoomOut":"Zoom out","cad.toolbar.zoomIn":"Zoom in","cad.layers.title":"Layers","cad.layers.count":"{count} items","cad.inspector.title":"Structure","cad.inspector.entities":"Entities","cad.inspector.blocks":"Blocks","cad.inspector.pages":"Pages","cad.inspector.drawn":"Drawn","cad.state.loadingViewer":"Loading CAD viewer...","cad.state.parsing":"Parsing CAD...","cad.error.parseFailed":"Failed to parse CAD file","image.alt":"Image","image.lightbox.alt":"Image preview","image.lightbox.close":"Close image preview","gitBundle.error.invalid":"This file is not a valid Git bundle.","gitBundle.error.missingPack":"No PACK data was found after the Git bundle header.","gitBundle.notice.delta":"This bundle contains delta-compressed objects. The viewer resolves common OFS_DELTA / REF_DELTA objects in the browser. Missing files usually indicate a very large bundle, too many objects, or an external prerequisite.","gitBundle.title.history":"History","gitBundle.title.fileTree":"File tree","gitBundle.file.choose":"Select a file to inspect","gitBundle.file.noTree":"The tree/blob objects in this bundle may be delta-compressed, and no expandable files were parsed.","gitBundle.file.none":"No files parsed","gitBundle.history.empty":"No commit objects were parsed. Showing refs and pack summary only.","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"Unrecognized GeoJSON data","geo.error.xmlParseFailed":"Failed to parse XML","geo.error.unsupported":".{type} geospatial format is not supported","geo.title":"Geospatial preview","geo.featureCount":"Features","geo.bounds":"Bounds","geo.geometryTypes":"Geometry types","geo.aria":"Geospatial SVG preview","geo.loading":"Parsing geospatial data...","model.toolbar.fit":"Fit","model.toolbar.rotate":"Rotate","model.toolbar.wireframe":"Wireframe","model.toolbar.grid":"Grid","model.toolbar.axes":"Axes","model.state.loadingSummary":"Loading model","model.state.loading":"Parsing 3D model...","model.state.loaded":"Model loaded","model.state.parseFailed":"Failed to parse model","model.summary.meshes":"{count} meshes","model.summary.points":"{count} point clouds","model.error.daeEmpty":"The DAE model did not contain a valid scene.","model.error.unsupported":".{type} model format is not supported yet","model.error.parseFailed":"Failed to parse {type} model","model.notice.signature":"Detected file signature: {signature}.","loading.generic.label":"File content","loading.generic.hint":"Preparing content structure and preview.","loading.word.label":"Word document","loading.word.hint":"Preparing document structure, text styles, and layout.","loading.wordWorker.hint":"Preparing document structure, text styles, and layout in a Worker.","loading.sheet.label":"Excel workbook","loading.sheet.hint":"Preparing worksheets, styles, and viewport data.","loading.csv.label":"Tabular data","loading.csv.hint":"Preparing rows, columns, and basic styling.","loading.presentation.label":"PowerPoint deck","loading.presentation.hint":"Building slide layout and media content.","loading.pdf.label":"PDF document","loading.pdf.hint":"Loading page bitmaps, text layers, and zoom view.","loading.ofd.label":"OFD layout document","loading.ofd.hint":"Parsing OFD pages and layout objects.","loading.archive.label":"Archive","loading.archive.hint":"Starting Worker and reading archive entries.","loading.email.label":"Email file","loading.email.hint":"Parsing message headers, body, and attachments.","loading.msg.hint":"Parsing Outlook message and attachments.","loading.eda.label":"EDA file","loading.eda.hint":"Reading EDA container structure and properties.","loading.cad.label":"CAD drawing","loading.cad.hint":"Preparing CAD layers, geometry, and canvas view.","loading.dwg.hint":"Loading DWG geometry and LibreDWG WASM in a Worker.","loading.dwf.hint":"Loading native DWF renderer and W2D/W3D graphics.","loading.dwfx.hint":"Loading native DWFx/XPS renderer and page graphics.","loading.xps.hint":"Loading native XPS renderer and embedded fonts.","loading.drawio.label":"draw.io diagram","loading.drawio.hint":"Parsing shapes, connectors, and SVG preview.","loading.excalidraw.label":"Excalidraw scene","loading.excalidraw.hint":"Parsing hand-drawn elements and generating safe SVG.","loading.epub.label":"EPUB ebook","loading.epub.hint":"Parsing table of contents, chapter resources, and reading pages.","loading.umd.label":"UMD ebook","loading.umd.hint":"Parsing mobile ebook metadata, table of contents, and compressed chapters.","loading.image.label":"Image file","loading.image.hint":"Decoding pixels and generating preview.","loading.video.label":"Video file","loading.video.hint":"Preparing media resource and player.","loading.audio.label":"Audio file","loading.audio.hint":"Preparing audio resource and playback controls."},iy=Object.freeze({"zh-CN":e0,"en-US":n0}),i0=()=>{var n;if(!(typeof navigator>"u"))return((n=navigator.languages)===null||n===void 0?void 0:n[0])||navigator.language},r0=n=>{const t=!n||n==="auto"?i0():n;return String(t||"zh-CN").toLowerCase().startsWith("zh")?"zh-CN":"en-US"},s0=n=>{var t;return((t=n?.i18n)===null||t===void 0?void 0:t.messages)||n?.messages},gf=n=>{var t;return r0(((t=n?.i18n)===null||t===void 0?void 0:t.locale)||n?.locale)},a0=(n,t={})=>n.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(e,i)=>{const r=t[i];return r==null?"":String(r)}),as=(n,t,e={})=>{const i=gf(n),r=s0(n);return a0((typeof r=="function"?r(t,e,i):r?.[t])||iy[i][t]||iy["zh-CN"][t],e)},o0=n=>(t,e)=>as(n,t,e)})),ry=xt((()=>{dl()})),l0,mf,vf=xt((()=>{ba(),pf(),l0=n=>({...n,extensions:n.extensions.map(Zn)}),mf=(n=vr)=>{const t=new Map,e=new Map,i=r=>{const s=l0(r),o=t.get(s.id);o&&o.extensions.forEach(l=>{var h;((h=e.get(l))===null||h===void 0?void 0:h.id)===o.id&&e.delete(l)}),t.set(s.id,s),s.extensions.forEach(l=>{const h=e.get(l);if(h&&h.id!==s.id)throw new Error(`File extension "${l}" is already registered by renderer "${h.id}".`);e.set(l,s)})};return n.forEach(i),{register:i,unregister(r){const s=t.get(r);return s?(s.extensions.forEach(o=>{var l;((l=e.get(o))===null||l===void 0?void 0:l.id)===r&&e.delete(o)}),t.delete(r),!0):!1},getById(r){return t.get(r)},getByExtension(r){return e.get(Zn(r))},hasExtension(r){return e.has(Zn(r))},list(){return Array.from(t.values())},listExtensions(){return Array.from(e.keys()).sort()}}}})),sy,ay=xt((()=>{ba(),vf(),pf(),sy=({registry:n=mf(vr),handlers:t,fallbackHandler:e,fallbackKey:i="error"})=>{const r=Array.from(t).reduce((h,c)=>(h.set(c.rendererId,c.handler),h),new Map),s=new Map,o=[];n.list().forEach(h=>{const c=r.get(h.id);if(!c){o.push(h.id);return}h.extensions.forEach(d=>{s.set(Zn(d),c)})}),e&&i&&s.set(Zn(i),e);const l=h=>s.get(Zn(h));return{handlersByRendererId:r,handlersByExtension:s,missingRendererIds:o,get:l,resolve(h){return l(h)||(i?l(i):void 0)},has(h){return s.has(Zn(h))},listExtensions(){return Array.from(s.keys()).sort()}}}})),BC,WC,jC,oy=xt((()=>{ba(),BC=Object.freeze({download:!1,print:!1,exportHtml:!1,zoom:!1,zoomIn:!1,zoomOut:!1,zoomReset:!1}),WC=["pptx","pptm","potx","potm","ppsx","ppsm","ofd","dxf","dwg","dwf","dwfx","xps","excalidraw","drawio","dio","mermaid","mmd","plantuml","puml","umd","md","markdown","olb","dra",...Xv,...Yv],jC=["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers",...zv,"eml","msg","epub","mp4","mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba",...Gv]})),Tc=xt((()=>{oy(),dl(),ry()})),UC,ly,h0,c0,d0,u0,f0,p0,g0,hy,m0,yf=xt((()=>{pf(),ba(),dl(),UC=Object.freeze({downloading:"正在下载文件资源...",streamingPdf:"正在建立 PDF 流式预览...",reading:"正在解析文件内容..."}),ly=Object.freeze({accent:"#5f6f82",soft:"rgba(95, 111, 130, 0.12)",badge:"DOC",label:"文件内容",hint:"正在整理内容结构并生成预览。"}),h0=n=>{const t=Zn(n);return t?`.${t}`:"当前"},c0={"office-word-openxml":"@file-viewer/renderer-word","office-word-binary":"@file-viewer/renderer-word","office-presentation":"@file-viewer/renderer-presentation","open-document":"@file-viewer/renderer-word","spreadsheet-openxml":"@file-viewer/renderer-spreadsheet",pdf:"@file-viewer/renderer-pdf",ofd:"@file-viewer/renderer-ofd",typst:"@file-viewer/renderer-typst",archive:"@file-viewer/renderer-archive",email:"@file-viewer/renderer-email",eda:"@file-viewer/renderer-eda",cad:"@file-viewer/renderer-cad",model:"@file-viewer/renderer-3d",geo:"@file-viewer/renderer-geo",drawing:"@file-viewer/renderer-drawing",mindmap:"@file-viewer/renderer-mindmap",epub:"@file-viewer/renderer-epub",umd:"@file-viewer/renderer-epub",image:"@file-viewer/renderer-image",markdown:"@file-viewer/renderer-text",code:"@file-viewer/renderer-text",video:"@file-viewer/renderer-media",audio:"@file-viewer/renderer-media","data-asset":"@file-viewer/renderer-data"},d0=new Set(["office-word-openxml","office-word-binary","office-presentation","open-document","spreadsheet-openxml","pdf","ofd"]),u0=new Set(["image","markdown","code","video","audio"]),f0=new Set(["typst","archive","eda","cad","model","geo","drawing","mindmap","data-asset"]),p0=n=>d0.has(n.id)?{packageName:"@file-viewer/preset-office",vitePreset:"office",label:"Office preset"}:f0.has(n.id)?{packageName:"@file-viewer/preset-engineering",vitePreset:"engineering",label:"Engineering preset"}:u0.has(n.id)?{packageName:"@file-viewer/preset-lite",vitePreset:"lite",label:"Lite preset"}:{packageName:"@file-viewer/preset-all",vitePreset:"all",label:"Full preset"},g0=(n="")=>{const t=Zn(n),e=vr.find(r=>r.extensions.map(Zn).includes(t));if(!e)return null;const i=p0(e);return{extension:t,rendererId:e.id,rendererLabel:e.label,rendererCategory:e.category,rendererPackage:c0[e.id],presetPackage:i.packageName,vitePreset:i.vitePreset,presetLabel:i.label}},hy=({state:n,extension:t="",title:e,message:i,description:r,theme:s=ly,recoverable:o})=>({state:n,extension:Zn(t),title:e,message:i,description:r,theme:s,recoverable:o}),m0=(n="",t=ly,e)=>{const i=h0(n),r=g0(n);if(r){const s=gf(e),o=r.rendererPackage?s==="zh-CN"?`;如果需要极致裁剪,也可以只安装 ${r.rendererPackage}`:`; for a strict custom cut, install only ${r.rendererPackage}`:"";return hy({state:"unsupported",extension:n,title:as(e,"state.unsupported.install.title"),message:as(e,"state.unsupported.install.message",{extension:i,rendererLabel:r.rendererLabel}),description:as(e,"state.unsupported.install.description",{extension:i,rendererLabel:r.rendererLabel,presetPackage:r.presetPackage,vitePreset:r.vitePreset,rendererTip:o}),theme:t,recoverable:!0})}return hy({state:"unsupported",extension:n,title:as(e,"state.unsupported.title"),message:as(e,"state.unsupported.message",{extension:i}),description:as(e,"state.unsupported.description"),theme:t,recoverable:!0})}})),$C,bf=xt((()=>{Tc(),yf(),dl(),$C=64*1024})),v0,cy,y0,b0,w0,dy=xt((()=>{ba(),ay(),vf(),bf(),v0=(n,t)=>({rendered:n,destroy:()=>t?t():cy(n)}),cy=n=>{if(!n||typeof n!="object")return;const t=n;if(typeof t.unmount=="function")return t.unmount();if(typeof t.$destroy=="function")return t.$destroy();if(typeof t.destroy=="function")return t.destroy()},y0=({source:n,options:t,registerExportAdapter:e,renderContext:i})=>({filename:n.filename,url:n.url,streamUrl:n.url,options:t,registerExportAdapter:e,...i}),b0=({handler:n,getTarget:t=r=>r.surface.container,createContext:e=y0,destroy:i})=>async r=>{const{source:s}=r;if(!s.buffer)throw new Error("FileRenderHandler renderer requires an ArrayBuffer source.");const o=t(r),l=await n(s.buffer,o,s.extension,e(r));return v0(l,()=>i?i(l,r):cy(l))},w0=({definitions:n=vr,handlers:t,getTarget:e,createContext:i,destroy:r})=>{const s=mf(n),o=sy({registry:s,handlers:t});return{registry:mf(s.list().map(l=>{const h=o.handlersByRendererId.get(l.id);return h?{...l,load:b0({handler:h,getTarget:e,createContext:i,destroy:r})}:l})),dispatcher:o,missingRendererIds:o.missingRendererIds}}})),HC=Hx({default:()=>VC});async function VC(n,t,e){const i=await P0(n,e);let r=1,s=0;const o=qv(),l=document.createElement("div");l.className="image-viewer",l.dataset.viewerZoomProvider="image";const h=document.createElement("div");h.className="image-stage";const c=document.createElement("img");c.alt="图片",c.src=i,h.append(c),l.append(h);const d=M0(i),u=()=>d.open();c.addEventListener("click",u),document.body.append(d.element);const f=()=>{s=l.clientHeight||0,uy(c,s,r),o.emit()},g=new ResizeObserver(f);g.observe(l);const m=()=>({scale:r,label:`${Math.round(r*100)}%`,canZoomIn:r<5,canZoomOut:r>.1,canReset:r!==1,minScale:.1,maxScale:5}),y=b=>(r=C0(b),uy(c,s,r),o.emit(),m());return Jv(l,{zoomIn:()=>y(r+.15),zoomOut:()=>y(r-.15),resetZoom:()=>y(1),setZoom:y,getState:m,subscribe:o.subscribe}),t.replaceChildren(A0(),l),f(),{$el:t,unmount(){Qv(l),g.disconnect(),c.removeEventListener("click",u),d.destroy(),t.replaceChildren()}}}var x0,E0,A0,S0,T0,P0,C0,uy,M0,zC=xt((()=>{Sc(),ty(),x0={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jxl:"image/jxl",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"},E0=`
25
+ .image-viewer{position:relative;width:100%;height:100%;overflow:auto;background:#eef1f4;box-sizing:border-box}
26
+ .image-stage{min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
27
+ .image-stage img{display:block;width:auto;max-width:none;margin:0 auto;border:0;box-shadow:0 18px 48px rgba(15,23,42,.16);background:#fff;cursor:zoom-in}
28
+ .image-lightbox{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:40px;background:rgba(15,23,42,.88);box-sizing:border-box}
29
+ .image-lightbox[hidden]{display:none}
30
+ .image-lightbox img{display:block;max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.4);cursor:zoom-out}
31
+ .image-lightbox button{position:absolute;top:20px;right:20px;width:40px;height:40px;border:0;border-radius:999px;background:rgba(255,255,255,.92);color:#172033;font-size:24px;line-height:40px;cursor:pointer;box-shadow:0 12px 28px rgba(0,0,0,.18)}
32
+ .file-viewer[data-viewer-theme='dark'] .image-viewer{background:#101820}
33
+ @media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .image-viewer{background:#101820}}
34
+ @media (max-width:767px){.image-stage{padding:12px}.image-lightbox{padding:16px}.image-lightbox button{top:12px;right:12px}}
35
+ `,A0=()=>{const n=document.createElement("style");return n.textContent=E0,n},S0=n=>x0[(n||"").trim().toLowerCase()]||"image/*",T0=async n=>await new Promise((t,e)=>{const i=new FileReader;i.onload=r=>{var s;const o=(s=r.target)===null||s===void 0?void 0:s.result;if(typeof o=="string"){t(o);return}e(new Error("Unable to read image data URL."))},i.onerror=()=>e(i.error||new Error("Unable to read image data URL.")),i.readAsDataURL(n)}),P0=async(n,t)=>{const e=(t||"").trim().toLowerCase();if(e==="heic"||e==="heif")throw new Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");return T0(new Blob([n],{type:S0(e)}))},C0=n=>Math.min(5,Math.max(.1,Number(n.toFixed(2)))),uy=(n,t,e)=>{if(t>0){n.style.height=`${Math.max(1,Math.round(t*e))}px`;return}n.style.height=`${e*100}%`},M0=n=>{const t=document.createElement("div");t.className="image-lightbox",t.hidden=!0,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true");const e=document.createElement("img");e.alt="Preview image",e.src=n;const i=document.createElement("button");i.type="button",i.setAttribute("aria-label","Close image preview"),i.textContent="x";const r=()=>{t.hidden=!0};return i.addEventListener("click",r),e.addEventListener("click",r),t.addEventListener("click",s=>{s.target===t&&r()}),t.append(e,i),{element:t,open(){t.hidden=!1},destroy(){i.removeEventListener("click",r),e.removeEventListener("click",r),t.remove()}}}})),I0,wf,fy,k0,R0,O0,L0,D0,F0,xf,GC,XC,YC,N0=xt((()=>{ba(),dy(),ay(),yf(),I0=n=>({$el:n,unmount(){}}),wf=[{rendererId:"image",handler:async(n,t,e)=>{const{default:i}=await Promise.resolve().then(()=>(zC(),HC));return i(n,t,e)}}],fy=["image"],k0=wf.filter(n=>fy.includes(n.rendererId)),R0=vr.filter(n=>fy.includes(n.id)),O0=n=>n==="none"?[]:n==="lite"?R0:vr,L0=n=>n==="none"?[]:n==="lite"?k0:wf,D0=async(n,t,e)=>{const i=m0(e),r=document.createElement("div");r.style.textAlign="center",r.style.marginTop="80px";const s=document.createElement("div");if(s.textContent=i.message,r.appendChild(s),i.description){const o=document.createElement("div");o.textContent=i.description,r.appendChild(o)}return t.replaceChildren(r),I0(t)},F0=(n={})=>{const t=n.builtinRenderers||"all",e=w0({definitions:O0(t),handlers:L0(t)});return{...e,dispatcher:sy({registry:e.registry,handlers:wf,fallbackHandler:D0})}},xf=F0(),GC=xf.registry,XC=xf.dispatcher,YC=xf.missingRendererIds})),KC=xt((()=>{dl()})),ZC=xt((()=>{Tc(),bf()})),JC=xt((()=>{Tc()})),QC=xt((()=>{Qx(),ty(),ry(),oy(),Tc(),vf(),dy(),N0(),bf(),yf()})),_0=xt((()=>{Yx(),ba(),Jx(),Qx(),ty(),Sc(),NC(),ry(),dl(),vf(),N0(),oy(),Tc(),KC(),ZC(),JC(),ay(),dy(),pf(),yf(),bf(),QC()}));function v(n,t,e){if(typeof n=="function"?n===t:n.has(t))return arguments.length<3?t:e;throw new TypeError("Private element is not present on this object")}var Ef=xt((()=>{}));function Pc(n){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(n)}var B0=xt((()=>{}));function qC(n,t){if(Pc(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Pc(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}var tM=xt((()=>{B0()}));function eM(n){var t=qC(n,"string");return Pc(t)=="symbol"?t:t+""}var nM=xt((()=>{B0(),tM()}));function D(n,t,e){return(t=eM(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var W0=xt((()=>{nM()}));function j0(n,t){if(t.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}var U0=xt((()=>{}));function w(n,t,e){j0(n,t),t.set(n,e)}var $0=xt((()=>{U0()}));function a(n,t){return n.get(v(n,t))}var H0=xt((()=>{Ef()}));function ot(n,t){j0(n,t),t.add(n)}var V0=xt((()=>{U0()}));function p(n,t,e){return n.set(v(n,t),e),e}var z0=xt((()=>{Ef()}));function Af(n,t,e){t||(t=[]);var i=t.length++;return Object.defineProperty({},"_",{set:function(s){t[i]=s,n.apply(e,t)}})}var iM=xt((()=>{}));function ut(n){var t=rb[n];if(t!==void 0)return t.exports;var e=rb[n]={exports:{}};return LA[n].call(e.exports,e,e.exports,ut),e.exports}function rM(n){Number.isInteger(n)&&(_c=n)}function sM(){return _c}function Sf(n){_c>=Nc.INFOS&&console.info(`Info: ${n}`)}function ft(n){_c>=Nc.WARNINGS&&console.warn(`Warning: ${n}`)}function Dt(n){throw new Error(n)}function te(n,t){n||Dt(t)}function aM(n){switch(n?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function G0(n,t=null,e=null){if(!n)return null;if(e&&typeof n=="string"&&(e.addDefaultProtocol&&n.startsWith("www.")&&n.match(/\./g)?.length>=2&&(n=`http://${n}`),e.tryConvertEncoding))try{n=lM(n)}catch{}const i=t?URL.parse(n,t):URL.parse(n);return aM(i)?i:null}function X0(n,t,e=!1){const i=URL.parse(n);return i?(i.hash=t,i.href):e&&G0(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function py(n){return n.substring(n.lastIndexOf("/")+1)}function mt(n,t,e,i=!1){return Object.defineProperty(n,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}function oM(n){(typeof n!="object"||n?.length===void 0)&&Dt("Invalid argument for bytesToString");const t=n.length,e=8192;if(t<e)return String.fromCharCode.apply(null,n);const i=[];for(let r=0;r<t;r+=e){const s=Math.min(r+e,t),o=n.subarray(r,s);i.push(String.fromCharCode.apply(null,o))}return i.join("")}function Tf(n){typeof n!="string"&&Dt("Invalid argument for stringToBytes");const t=n.length,e=new Uint8Array(t);for(let i=0;i<t;++i)e[i]=n.charCodeAt(i)&255;return e}function gy(n,t,e,i,r,s,o,l,h,c){if(h<=0||h>=1)return;const d=1-h,u=h*h,f=u*h,g=d*(d*(d*n+3*h*t)+3*u*e)+f*i,m=d*(d*(d*r+3*h*s)+3*u*o)+f*l;c[0]=Math.min(c[0],g),c[1]=Math.min(c[1],m),c[2]=Math.max(c[2],g),c[3]=Math.max(c[3],m)}function Y0(n,t,e,i,r,s,o,l,h,c,d,u){if(Math.abs(h)<1e-12){Math.abs(c)>=1e-12&&v(rp,this,gy).call(this,n,t,e,i,r,s,o,l,-d/c,u);return}const f=c**2-4*d*h;if(f<0)return;const g=Math.sqrt(f),m=2*h;v(rp,this,gy).call(this,n,t,e,i,r,s,o,l,(-c+g)/m,u),v(rp,this,gy).call(this,n,t,e,i,r,s,o,l,(-c-g)/m,u)}function lM(n){return decodeURIComponent(escape(n))}function hM(n){return hp||(hp=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,ab=new Map([["ſt","ſt"]])),n.replaceAll(hp,(t,e,i)=>e?e.normalize("NFKC"):ab.get(i))}function K0(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),oM(n)}function cM(n,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[i,r,...s]=e;if(!n(i)&&!Number.isInteger(i)||!t(r))return!1;const o=s.length;let l=!0;switch(r.name){case"XYZ":if(o<2||o>3)return!1;break;case"Fit":case"FitB":return o===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(o>1)return!1;break;case"FitR":if(o!==4)return!1;l=!1;break;default:return!1}for(const h of s)if(!(typeof h=="number"||l&&h===null))return!1;return!0}function Zt(n,t,e){return Math.min(Math.max(n,t),e)}async function my(n,t="text"){if(Cc(n,document.baseURI)){const e=await fetch(n);if(!e.ok)throw new Error(e.statusText);switch(t){case"blob":return e.blob();case"bytes":return e.bytes();case"json":return e.json()}return e.text()}return new Promise((e,i)=>{const r=new XMLHttpRequest;r.open("GET",n,!0),r.responseType=t==="bytes"?"arraybuffer":t,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){switch(t){case"bytes":e(new Uint8Array(r.response));return;case"blob":case"json":e(r.response);return}e(r.responseText);return}i(new Error(r.statusText))}},r.send(null)})}function Pf(n){const t=n.length;let e=0;for(;e<t&&n[e].trim()==="";)e++;return n.substring(e,e+5).toLowerCase()==="data:"}function vy(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function dM(n){return[n]=n.split(/[#?]/,1),py(n)}function uM(n,t="document.pdf"){if(typeof n!="string")return t;if(Pf(n))return ft('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=(l=>{try{return new URL(l)}catch{}try{return new URL(decodeURIComponent(l))}catch{}try{return new URL(l,"https://foo.bar")}catch{}try{return new URL(decodeURIComponent(l),"https://foo.bar")}catch{}return null})(n);if(!i)return t;const r=l=>{try{let h=decodeURIComponent(l);return h.includes("/")&&(h=py(h),h.length===4&&s.test(h))?l:h}catch{return l}},s=/\.pdf$/i,o=py(i.pathname);if(s.test(o))return r(o);if(i.searchParams.size>0){const l=c=>[...c].findLast(d=>s.test(d)),h=l(i.searchParams.values())??l(i.searchParams.keys());if(h)return r(h)}if(i.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(l)return r(l[0])}return t}function Cc(n,t){const e=t?URL.parse(n,t):URL.parse(n);return/https?:/.test(e?.protocol??"")}function Jn(n){n.preventDefault()}function ee(n){n.preventDefault(),n.stopPropagation()}function Mc(n){if(n.startsWith("#")){const e=n.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(n.startsWith("rgb(")){const[e,i,r]=n.slice(4,-1).split(",").map(s=>parseInt(s,10));return[e,i,r,1]}if(n.startsWith("rgba(")){const e=n.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const t=n.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!=="none"?parseFloat(t[4]):1]:null}function Ic(n){const t=Mc(n);return t?t.slice(0,3):(ft(`Not a valid color format: "${n}"`),[0,0,0])}function fM(n){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of n.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;n.set(e,Ic(i))}t.remove()}function Gt(n){const{a:t,b:e,c:i,d:r,e:s,f:o}=n.getTransform();return[t,e,i,r,s,o]}function Hi(n){const{a:t,b:e,c:i,d:r,e:s,f:o}=n.getTransform().invertSelf();return[t,e,i,r,s,o]}function xa(n,t,e=!1,i=!0){if(t instanceof fp){const{pageWidth:r,pageHeight:s}=t.rawDims,{style:o}=n,l=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,h=`round(down, var(--total-scale-factor) * ${s}px, var(--scale-round-y))`;!e||t.rotation%180===0?(o.width=l,o.height=h):(o.width=h,o.height=l)}i&&n.setAttribute("data-main-rotation",t.rotation)}function pM(n,t){t=Zt(t??1,0,1);const e=255*(1-t);return n.map(i=>Math.round(i*t+e))}function Z0(n,t){const e=n[0]/255,i=n[1]/255,r=n[2]/255,s=Math.max(e,i,r),o=Math.min(e,i,r),l=(s+o)/2;if(s===o)t[0]=t[1]=0;else{const h=s-o;switch(t[1]=l<.5?h/(s+o):h/(2-s-o),s){case e:t[0]=((i-r)/h+(i<r?6:0))*60;break;case i:t[0]=((r-e)/h+2)*60;break;case r:t[0]=((e-i)/h+4)*60;break}}t[2]=l}function yy(n,t){const e=n[0],i=n[1],r=n[2],s=(1-Math.abs(2*r-1))*i,o=s*(1-Math.abs(e/60%2-1)),l=r-s/2;switch(Math.floor(e/60)){case 0:t[0]=s+l,t[1]=o+l,t[2]=l;break;case 1:t[0]=o+l,t[1]=s+l,t[2]=l;break;case 2:t[0]=l,t[1]=s+l,t[2]=o+l;break;case 3:t[0]=l,t[1]=o+l,t[2]=s+l;break;case 4:t[0]=o+l,t[1]=l,t[2]=s+l;break;case 5:case 6:t[0]=s+l,t[1]=l,t[2]=o+l;break}}function J0(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function Q0(n,t,e){yy(n,e),e.map(J0);const i=.2126*e[0]+.7152*e[1]+.0722*e[2];yy(t,e),e.map(J0);const r=.2126*e[0]+.7152*e[1]+.0722*e[2];return i>r?(i+.05)/(r+.05):(r+.05)/(i+.05)}function gM(n,t){const e=n[0]+n[1]*256+n[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776;let i=hb.get(e);if(i)return i;const r=new Float32Array(9),s=r.subarray(0,3),o=r.subarray(3,6);Z0(n,o);const l=r.subarray(6,9);Z0(t,l);const h=l[2]<.5,c=h?12:4.5;if(o[2]=h?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),Q0(o,l,s)<c){let d,u;h?(d=o[2],u=1):(d=0,u=o[2]);const f=.005;for(;u-d>f;){const g=o[2]=(d+u)/2;h===Q0(o,l,s)<c?d=g:u=g}o[2]=h?u:d}return yy(o,s),i=Z.makeHexColor(Math.round(s[0]*255),Math.round(s[1]*255),Math.round(s[2]*255)),hb.set(e,i),i}function q0({html:n,dir:t,className:e},i){const r=document.createDocumentFragment();if(typeof n=="string"){const s=document.createElement("p");s.dir=t||"auto";const o=n.split(/\r\n?|\n/);for(let l=0,h=o.length;l<h;++l){const c=o[l];s.append(document.createTextNode(c)),l<h-1&&s.append(document.createElement("br"))}r.append(s)}else ob.render({xfaHtml:n,div:r,intent:"richText"});r.firstElementChild.classList.add("richText",e),i.append(r)}function tE(n){const t=new Path2D;if(!n)return t;for(let e=0,i=n.length;e<i;)switch(n[e++]){case yl.moveTo:t.moveTo(n[e++],n[e++]);break;case yl.lineTo:t.lineTo(n[e++],n[e++]);break;case yl.curveTo:t.bezierCurveTo(n[e++],n[e++],n[e++],n[e++],n[e++],n[e++]);break;case yl.quadraticCurveTo:t.quadraticCurveTo(n[e++],n[e++],n[e++],n[e++]);break;case yl.closePath:t.closePath();break;default:ft(`Unrecognized drawing path operator: ${n[e-1]}`);break}return t}function mM(n){n.stopPropagation()}function vM(n){a(bi,this)._focusEventsAllowed=!1,ee(n)}function yM(n){a(bi,this)._focusEventsAllowed=!0,ee(n)}function kc(n){const t=a(bi,this)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(n.addEventListener("focusin",v(On,this,vM).bind(this),{capture:!0,signal:t}),n.addEventListener("focusout",v(On,this,yM).bind(this),{capture:!0,signal:t}),n.addEventListener("contextmenu",Jn,{signal:t}),!0)}function Cf(){const n=document.createElement("div");return n.className="divider",n}function bM(){const n=p(Oa,this,document.createElement("div"));n.className="editToolbar",n.setAttribute("role","toolbar");const t=a(us,this)._signal;t instanceof AbortSignal&&!t.aborted&&n.addEventListener("contextmenu",Jn,{signal:t});const e=p(xp,this,document.createElement("div"));return e.className="buttons",n.append(e),a(us,this).hasCommentManager()&&v(bl,this,eE).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{a(us,this).commentSelection("floating_button")}),v(bl,this,eE).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{a(us,this).highlightSelection("floating_button")}),n}function wM(n,t){let e=0,i=0;for(const r of n){const s=r.y+r.height;if(s<e)continue;const o=r.x+(t?r.width:0);if(s>e){i=o,e=s;continue}t?o>i&&(i=o):o<i&&(i=o)}return[t?1-i:i,e]}function eE(n,t,e,i){const r=document.createElement("button");r.classList.add("basic",n),r.tabIndex=0,r.setAttribute("data-l10n-id",t);const s=document.createElement("span");r.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",e);const o=a(us,this)._signal;o instanceof AbortSignal&&!o.aborted&&(r.addEventListener("contextmenu",Jn,{signal:o}),r.addEventListener("click",i,{signal:o})),a(xp,this).append(r)}function nE(n,t,e){for(const i of e)t.addEventListener(i,n[i].bind(n))}async function by(n,t){a(Se,this)||p(Se,this,new Map);let e=a(Se,this).get(n);if(e===null)return null;if(e?.bitmap)return e.refCounter+=1,e;try{var i,r;e||(e={bitmap:null,id:`image_${a(Uc,this)}_${p(Al,this,(i=a(Al,this),r=i++,i)),r}`,refCounter:0,isSvg:!1});let s;if(typeof t=="string"?(e.url=t,s=await my(t,"blob")):t instanceof File?s=e.file=t:t instanceof Blob&&(s=t),s.type==="image/svg+xml"){const o=SA._isSVGFittingCanvas,l=new FileReader,h=new Image,c=new Promise((d,u)=>{h.onload=()=>{e.bitmap=h,e.isSvg=!0,d()},l.onload=async()=>{const f=e.svgUrl=l.result;h.src=await o?`${f}#svgView(preserveAspectRatio(none))`:f},h.onerror=l.onerror=u});l.readAsDataURL(s),await c}else e.bitmap=await createImageBitmap(s);e.refCounter=1}catch(s){ft(s),e=null}return a(Se,this).set(n,e),e&&a(Se,this).set(e.id,e),e}function xM(n){n.altKey&&this.buffer.push("alt"),n.ctrlKey&&this.buffer.push("ctrl"),n.metaKey&&this.buffer.push("meta"),n.shiftKey&&this.buffer.push("shift"),this.buffer.push(n.key);const t=this.buffer.join("+");return this.buffer.length=0,t}function wy({anchorNode:n}){return n.nodeType===Node.TEXT_NODE?n.parentElement:n}function iE(n){const{currentLayer:t}=this;if(t.hasTextLayer(n))return t;for(const e of a(se,this).values())if(e.hasTextLayer(n))return e;return null}function EM(n){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}function AM(){const n=document.getSelection();if(!n||n.isCollapsed)return;const t=v(ht,this,wy).call(this,n).closest(".textLayer"),e=this.getSelectionBoxes(t);e&&(a(Yi,this)||p(Yi,this,new jA(this)),a(Yi,this).show(t,e,this.direction==="ltr"))}function SM(){const n=document.getSelection();if(!n||n.isCollapsed){a(gs,this)&&(a(Yi,this)?.hide(),p(gs,this,null),v(ht,this,mn).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=n;if(t===a(gs,this))return;const e=v(ht,this,wy).call(this,n).closest(".textLayer");if(!e){a(gs,this)&&(a(Yi,this)?.hide(),p(gs,this,null),v(ht,this,mn).call(this,{hasSelectedText:!1}));return}if(a(Yi,this)?.hide(),p(gs,this,t),v(ht,this,mn).call(this,{hasSelectedText:!0}),!(a(Te,this)!==pt.HIGHLIGHT&&a(Te,this)!==pt.NONE)&&(a(Te,this)===pt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),p(Wa,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const i=a(Te,this)===pt.HIGHLIGHT?v(ht,this,iE).call(this,e):null;if(i?.toggleDrawing(),a(Yc,this)){const r=new AbortController,s=this.combinedSignal(r),o=l=>{l.type==="pointerup"&&l.button!==0||(r.abort(),i?.toggleDrawing(!0),l.type==="pointerup"&&v(ht,this,Mf).call(this,"main_toolbar"))};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}else i?.toggleDrawing(!0),v(ht,this,Mf).call(this,"main_toolbar")}}function Mf(n=""){a(Te,this)===pt.HIGHLIGHT?this.highlightSelection(n):a(Tp,this)&&v(ht,this,AM).call(this)}function TM(){document.addEventListener("selectionchange",v(ht,this,SM).bind(this),{signal:this._signal})}function PM(){if(a(Ba,this))return;p(Ba,this,new AbortController);const n=this.combinedSignal(a(Ba,this));window.addEventListener("focus",this.focus.bind(this),{signal:n}),window.addEventListener("blur",this.blur.bind(this),{signal:n})}function CM(){a(Ba,this)?.abort(),p(Ba,this,null)}function rE(){if(a(ja,this))return;p(ja,this,new AbortController);const n=this.combinedSignal(a(ja,this));window.addEventListener("keydown",this.keydown.bind(this),{signal:n}),window.addEventListener("keyup",this.keyup.bind(this),{signal:n})}function MM(){a(ja,this)?.abort(),p(ja,this,null)}function IM(){if(a(Da,this))return;p(Da,this,new AbortController);const n=this.combinedSignal(a(Da,this));document.addEventListener("copy",this.copy.bind(this),{signal:n}),document.addEventListener("cut",this.cut.bind(this),{signal:n}),document.addEventListener("paste",this.paste.bind(this),{signal:n})}function kM(){a(Da,this)?.abort(),p(Da,this,null)}function RM(){const n=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:n}),document.addEventListener("drop",this.drop.bind(this),{signal:n})}function mn(n){Object.entries(n).some(([t,e])=>a(kp,this)[t]!==e)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(a(kp,this),n)}),a(Te,this)===pt.HIGHLIGHT&&n.hasSelectedEditor===!1&&v(ht,this,os).call(this,[[wt.HIGHLIGHT_FREE,!0]]))}function os(n){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:n})}async function OM(){if(!a(fs,this)){p(fs,this,!0);const n=[];for(const t of a(se,this).values())n.push(t.enable());await Promise.all(n);for(const t of a(de,this).values())t.enable()}}function LM(){if(this.unselectAll(),a(fs,this)){p(fs,this,!1);for(const n of a(se,this).values())n.disable();for(const n of a(de,this).values())n.disable()}}function sE(n){const t=a(se,this).get(n.pageIndex);t?t.addOrRebuild(n):(this.addEditor(n),this.addToAnnotationStorage(n))}function DM(){let n=null;for(n of a(Bt,this));return n}function If(){if(a(de,this).size===0)return!0;if(a(de,this).size===1)for(const n of a(de,this).values())return n.isEmpty();return!1}function aE(n){for(const t of a(Bt,this))t.unselect();a(Bt,this).clear();for(const t of n)t.isEmpty()||(a(Bt,this).add(t),t.select());v(ht,this,mn).call(this,{hasSelectedEditor:this.hasSelection})}function kf(){return a(We,this)&&"added"||a(We,this)===null&&this.guessedText&&"review"||"missing"}async function xy(){const n=a(Ki,this);if(!n)return;if(a(Cr,this)){if(n.classList.toggle("done",!!a(We,this)),n.setAttribute("data-l10n-id",Va._[kf.call(v(Mr,this))]),a(Qc,this)?.setAttribute("data-l10n-id",Va._[`${kf.call(v(Mr,this))}-label`]),!a(We,this)){a(Tr,this)?.remove();return}}else{if(!a(We,this)&&!a(Sr,this)){n.classList.remove("done"),a(Tr,this)?.remove();return}n.classList.add("done"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=a(Tr,this);if(!t){p(Tr,this,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${a(Ln,this).id}`;const e=100,i=a(Ln,this)._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(a(qn,this)),p(qn,this,null)},{once:!0}),n.addEventListener("mouseenter",()=>{p(qn,this,setTimeout(()=>{p(qn,this,null),a(Tr,this).classList.add("show"),a(Ln,this)._reportTelemetry({action:"alt_text_tooltip"})},e))},{signal:i}),n.addEventListener("mouseleave",()=>{a(qn,this)&&(clearTimeout(a(qn,this)),p(qn,this,null)),a(Tr,this)?.classList.remove("show")},{signal:i})}a(Sr,this)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=a(We,this)),t.parentNode||n.append(t),a(Ln,this).getElementForAltText()?.setAttribute("aria-describedby",t.id)}function oE(n,t){if(!a(Xt,this)._uiManager.hasCommentManager())return null;n.tabIndex="0",n.ariaHasPopup="dialog",t?(n.ariaControls="commentPopup",n.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(n.ariaControlsElements=[a(Xt,this)._uiManager.getCommentDialogElement()],n.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const e=a(Xt,this)._uiManager._signal;if(!(e instanceof AbortSignal)||e.aborted)return n;n.addEventListener("contextmenu",Jn,{signal:e}),t&&(n.addEventListener("focusin",r=>{a(Xt,this)._focusEventsAllowed=!1,ee(r)},{capture:!0,signal:e}),n.addEventListener("focusout",r=>{a(Xt,this)._focusEventsAllowed=!0,ee(r)},{capture:!0,signal:e})),n.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:e});const i=r=>{r.preventDefault(),n===a(Si,this)?this.edit():a(Xt,this).toggleComment(!0)};return n.addEventListener("click",i,{capture:!0,signal:e}),n.addEventListener("keydown",r=>{r.target===n&&r.key==="Enter"&&(p(kl,this,!0),i(r))},{signal:e}),n.addEventListener("pointerenter",()=>{a(Xt,this).toggleComment(!1,!0)},{signal:e}),n.addEventListener("pointerleave",()=>{a(Xt,this).toggleComment(!1,!1)},{signal:e}),n}function FM(n){if(a(_p,this)?.call(this))return;if(n.touches.length===1){if(a(bs,this))return;const i=p(bs,this,new AbortController),r=AbortSignal.any([a(Ll,this),i.signal]),s=a(ed,this),o={capture:!0,signal:r,passive:!1},l=h=>{h.pointerType==="touch"&&(a(bs,this)?.abort(),p(bs,this,null))};s.addEventListener("pointerdown",h=>{h.pointerType==="touch"&&(ee(h),l(h))},o),s.addEventListener("pointerup",l,o),s.addEventListener("pointercancel",l,o);return}if(!a(xs,this)){p(xs,this,new AbortController);const i=AbortSignal.any([a(Ll,this),a(xs,this).signal]),r=a(ed,this),s={signal:i,capture:!1,passive:!1};r.addEventListener("touchmove",v(nd,this,NM).bind(this),s);const o=v(nd,this,_M).bind(this);r.addEventListener("touchend",o,s),r.addEventListener("touchcancel",o,s),s.capture=!0,r.addEventListener("pointerdown",ee,s),r.addEventListener("pointermove",ee,s),r.addEventListener("pointercancel",ee,s),r.addEventListener("pointerup",ee,s),a(Bp,this)?.call(this)}if(ee(n),n.touches.length!==2||a(Np,this)?.call(this)){p(ws,this,null);return}let[t,e]=n.touches;t.identifier>e.identifier&&([t,e]=[e,t]),p(ws,this,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:e.screenX,touch1Y:e.screenY})}function NM(n){if(!a(ws,this)||n.touches.length!==2)return;ee(n);let[t,e]=n.touches;t.identifier>e.identifier&&([t,e]=[e,t]);const{screenX:i,screenY:r}=t,{screenX:s,screenY:o}=e,l=a(ws,this),{touch0X:h,touch0Y:c,touch1X:d,touch1Y:u}=l,f=d-h,g=u-c,m=s-i,y=o-r,b=Math.hypot(m,y)||1,x=Math.hypot(f,g)||1;if(!a(Ol,this)&&Math.abs(x-b)<=TA.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=r,l.touch1X=s,l.touch1Y=o,!a(Ol,this)){p(Ol,this,!0);return}const E=[(i+s)/2,(r+o)/2];a(Wp,this)?.call(this,E,x,b)}function _M(n){n.touches.length>=2||(a(xs,this)&&(a(xs,this).abort(),p(xs,this,null),a(jp,this)?.call(this)),a(ws,this)&&(ee(n),p(ws,this,null),p(Ol,this,!1)))}function lE([n,t],e,i){[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}function hE(n,t,e){switch(e){case 90:return[t,-n];case 180:return[-n,-t];case 270:return[-t,n];default:return[n,t]}}function Ey(n){switch(n){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}function BM(){if(a(Je,this))return;p(Je,this,document.createElement("div")),a(Je,this).classList.add("resizers");const n=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const e of n){const i=document.createElement("div");a(Je,this).append(i),i.classList.add("resizer",e),i.setAttribute("data-resizer-name",e),i.addEventListener("pointerdown",v(It,this,WM).bind(this,e),{signal:t}),i.addEventListener("contextmenu",Jn,{signal:t}),i.tabIndex=-1}this.div.prepend(a(Je,this))}function WM(n,t){t.preventDefault();const{isMac:e}=Ut.platform;if(t.button!==0||t.ctrlKey&&e)return;a(ne,this)?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,p(Nl,this,[t.screenX,t.screenY]);const r=new AbortController,s=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",v(It,this,dE).bind(this,n),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",ee,{passive:!1,signal:s}),window.addEventListener("contextmenu",Jn,{signal:s}),p(As,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const h=()=>{r.abort(),this.parent.togglePointerEvents(!0),a(ne,this)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,v(It,this,Ay).call(this)};window.addEventListener("pointerup",h,{signal:s}),window.addEventListener("blur",h,{signal:s})}function cE(n,t,e,i){this.width=e,this.height=i,this.x=n,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}function Ay(){if(!a(As,this))return;const{savedX:n,savedY:t,savedWidth:e,savedHeight:i}=a(As,this);p(As,this,null);const r=this.x,s=this.y,o=this.width,l=this.height;r===n&&s===t&&o===e&&l===i||this.addCommands({cmd:v(It,this,cE).bind(this,r,s,o,l),undo:v(It,this,cE).bind(this,n,t,e,i),mustExec:!0})}function dE(n,t){const[e,i]=this.parentDimensions,r=this.x,s=this.y,o=this.width,l=this.height,h=yn.MIN_SIZE/e,c=yn.MIN_SIZE/i,d=v(It,this,Ey).call(this,this.rotation),u=(j,U)=>[d[0]*j+d[2]*U,d[1]*j+d[3]*U],f=v(It,this,Ey).call(this,360-this.rotation),g=(j,U)=>[f[0]*j+f[2]*U,f[1]*j+f[3]*U];let m,y,b=!1,x=!1;switch(n){case"topLeft":b=!0,m=(j,U)=>[0,0],y=(j,U)=>[j,U];break;case"topMiddle":m=(j,U)=>[j/2,0],y=(j,U)=>[j/2,U];break;case"topRight":b=!0,m=(j,U)=>[j,0],y=(j,U)=>[0,U];break;case"middleRight":x=!0,m=(j,U)=>[j,U/2],y=(j,U)=>[0,U/2];break;case"bottomRight":b=!0,m=(j,U)=>[j,U],y=(j,U)=>[0,0];break;case"bottomMiddle":m=(j,U)=>[j/2,U],y=(j,U)=>[j/2,0];break;case"bottomLeft":b=!0,m=(j,U)=>[0,U],y=(j,U)=>[j,0];break;case"middleLeft":x=!0,m=(j,U)=>[0,U/2],y=(j,U)=>[j,U/2];break}const E=m(o,l),S=y(o,l);let T=u(...S);const A=yn._round(r+T[0]),P=yn._round(s+T[1]);let C=1,M=1,I,k;if(t.fromKeyboard)({deltaX:I,deltaY:k}=t);else{const{screenX:j,screenY:U}=t,[G,it]=a(Nl,this);[I,k]=this.screenToPageTranslation(j-G,U-it),a(Nl,this)[0]=j,a(Nl,this)[1]=U}if([I,k]=g(I/e,k/i),b){const j=Math.hypot(o,l);C=M=Math.max(Math.min(Math.hypot(S[0]-E[0]-I,S[1]-E[1]-k)/j,1/o,1/l),h/o,c/l)}else x?C=Zt(Math.abs(S[0]-E[0]-I),h,1)/o:M=Zt(Math.abs(S[1]-E[1]-k),c,1)/l;const O=yn._round(o*C),B=yn._round(l*M);T=u(...y(O,B));const L=A-T[0],$=P-T[1];a(Qe,this)||p(Qe,this,[this.x,this.y,this.width,this.height]),this.width=O,this.height=B,this.x=L,this.y=$,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function jM(){p(As,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),a(ne,this)?.toggle(!1),this.parent.togglePointerEvents(!1)}function UM(n,t,e){let r=.7*(e/t)+1-.7;if(r===1)return;const s=v(It,this,Ey).call(this,this.rotation),o=(A,P)=>[s[0]*A+s[2]*P,s[1]*A+s[3]*P],[l,h]=this.parentDimensions,c=this.x,d=this.y,u=this.width,f=this.height,g=yn.MIN_SIZE/l,m=yn.MIN_SIZE/h;r=Math.max(Math.min(r,1/u,1/f),g/u,m/f);const y=yn._round(u*r),b=yn._round(f*r);if(y===u&&b===f)return;a(Qe,this)||p(Qe,this,[c,d,u,f]);const x=o(u/2,f/2),E=yn._round(c+x[0]),S=yn._round(d+x[1]),T=o(y/2,b/2);this.x=E-T[0],this.y=S-T[1],this.width=y,this.height=b,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function $M(){a(ne,this)?.toggle(!0),this.parent.togglePointerEvents(!0),v(It,this,Ay).call(this)}function uE(n){const{isMac:t}=Ut.platform;n.ctrlKey&&!t||n.shiftKey||n.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}function HM(n){const{isSelected:t}=this;this._uiManager.setUpDragSession();let e=!1;const i=new AbortController,r=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:r},o=h=>{i.abort(),p(Ya,this,null),p(_l,this,!1),this._uiManager.endDragSession()||v(It,this,uE).call(this,h),e&&this._onStopDragging()};t&&(p(rd,this,n.clientX),p(sd,this,n.clientY),p(Ya,this,n.pointerId),p($p,this,n.pointerType),window.addEventListener("pointermove",h=>{e||(e=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=h;if(u!==a(Ya,this)){ee(h);return}const[f,g]=this.screenToPageTranslation(c-a(rd,this),d-a(sd,this));p(rd,this,c),p(sd,this,d),this._uiManager.dragSelectedEditors(f,g)},s),window.addEventListener("touchmove",ee,s),window.addEventListener("pointerdown",h=>{h.pointerType===a($p,this)&&(a(Za,this)||h.isPrimary)&&o(h),ee(h)},s));const l=h=>{if(!a(Ya,this)||a(Ya,this)===h.pointerId){o(h);return}ee(h)};window.addEventListener("pointerup",l,{signal:r}),window.addEventListener("blur",l,{signal:r})}function fE(){if(a(Ka,this)||!this.div)return;p(Ka,this,new AbortController);const n=this._uiManager.combinedSignal(a(Ka,this));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:n}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:n})}function VM(n){yn._resizerKeyboardManager.exec(this,n)}function zM(n){a(Ss,this)&&n.relatedTarget?.parentNode!==a(Je,this)&&v(It,this,Rf).call(this)}function GM(n){p(Hp,this,a(Ss,this)?n:"")}function pE(n){if(a(Zi,this))for(const t of a(Zi,this))t.tabIndex=n}function Rf(){p(Ss,this,!1),v(It,this,pE).call(this,-1),v(It,this,Ay).call(this)}function XM(){a(jl,this)||(p(jl,this,!0),this.onSetModified?.())}function gE(n,t,e,i,r,s){n[t*4+0]=Math.min(n[t*4+0],e),n[t*4+1]=Math.min(n[t*4+1],i),n[t*4+2]=Math.max(n[t*4+2],r),n[t*4+3]=Math.max(n[t*4+3],s)}function YM(n,t,e,i,r){let s;n?(n<0&&(s=r[0],r[0]=r[2],r[2]=s),r[0]*=n,r[2]*=n,t<0&&(s=r[1],r[1]=r[3],r[3]=s),r[1]*=t,r[3]*=t):r.fill(0),r[0]+=e,r[1]+=i,r[2]+=e,r[3]+=i}function mE(n,t){const e=new ArrayBuffer(n*4);p(Vl,this,new Uint8ClampedArray(e)),p(dn,this,new Uint32Array(e)),t&&t.length>0?(a(dn,this).set(t),a(dn,this).fill(Kp,t.length)):a(dn,this).fill(Kp)}function Sy(n){te(n<Eb.strings.length,"Invalid string index");let t=0;for(let i=0;i<n;i++)t+=a(hd,this).getUint32(t)+4;const e=a(hd,this).getUint32(t);return a(Sb,this).decode(new Uint8Array(a(Qp,this),t+4,e))}function Of(n){te(n<Ab.strings.length,"Invalid string index");let t=5;for(let i=0;i<n;i++)t+=a(Or,this).getUint32(t)+4;const e=a(Or,this).getUint32(t);return a(dd,this).decode(new Uint8Array(a(Kl,this),t+4,e))}function Vi(n){te(n<fe.bools.length,"Invalid boolean index");const t=Math.floor(n/4),e=n*2%8,i=a(xe,this).getUint8(t)>>e&3;return i===0?void 0:i===2}function Ty(n){return te(n<fe.numbers.length,"Invalid number index"),a(xe,this).getFloat64(fe.OFFSET_NUMBERS+n*8)}function Py(n,t,e,i){const r=a(xe,this).getUint8(n);if(r===0)return;te(r===t,"Invalid array length."),n+=1;const s=new Array(r);for(let o=0;o<r;o++)s[o]=a(xe,this)[e](n,!0),n+=i;return s}function Lf(n){te(n<fe.strings.length,"Invalid string index");let t=fe.OFFSET_STRINGS+4;for(let i=0;i<n;i++)t+=a(xe,this).getUint32(t)+4;const e=a(xe,this).getUint32(t);return a(Tb,this).decode(new Uint8Array(a(qi,this),t+4,e))}function vE(){let n=fe.OFFSET_STRINGS;const t=a(xe,this).getUint32(n);n+=4+t;const e=a(xe,this).getUint32(n);n+=4+e;const i=a(xe,this).getUint32(n);n+=4+i;const r=a(xe,this).getUint32(n);return{offset:n,length:r}}function KM(n){if(n instanceof URL)return n;if(typeof n=="string"){if(bn){if(/^[a-z][a-z0-9\-+.]+:/i.test(n))return new URL(n);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(n))}const t=URL.parse(n,window.location);if(t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function ZM(n){if(bn&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return Tf(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n?.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Df(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}function yE(){}function vn(n){if(n instanceof wr||n instanceof lp||n instanceof sb||n instanceof Bc||n instanceof op)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||Dt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new wr(n.message);case"InvalidPDFException":return new lp(n.message);case"PasswordException":return new sb(n.message,n.code);case"ResponseException":return new Bc(n.message,n.status,n.missing);case"UnknownErrorException":return new op(n.message,n.details)}return new op(n.message,n.toString())}function JM({data:n}){if(n.targetName!==this.sourceName)return;if(n.stream){v(Cs,this,qM).call(this,n);return}if(n.callback){const e=n.callbackId,i=this.callbackCapabilities[e];if(!i)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],n.callback===fd.DATA)i.resolve(n.data);else if(n.callback===fd.ERROR)i.reject(vn(n.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[n.action];if(!t)throw new Error(`Unknown action from worker: ${n.action}`);if(n.callbackId){const e=this.sourceName,i=n.sourceName,r=this.comObj;Promise.try(t,n.data).then(function(s){r.postMessage({sourceName:e,targetName:i,callback:fd.DATA,callbackId:n.callbackId,data:s})},function(s){r.postMessage({sourceName:e,targetName:i,callback:fd.ERROR,callbackId:n.callbackId,reason:vn(s)})});return}if(n.streamId){v(Cs,this,QM).call(this,n);return}t(n.data)}function QM(n){const t=n.streamId,e=this.sourceName,i=n.sourceName,r=this.comObj,s=this,o=this.actionHandler[n.action],l={enqueue(h,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:e,targetName:i,stream:pe.ENQUEUE,streamId:t,chunk:h},d)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:e,targetName:i,stream:pe.CLOSE,streamId:t}),delete s.streamSinks[t])},error(h){te(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:e,targetName:i,stream:pe.ERROR,streamId:t,reason:vn(h)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:n.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,Promise.try(o,n.data,l).then(function(){r.postMessage({sourceName:e,targetName:i,stream:pe.START_COMPLETE,streamId:t,success:!0})},function(h){r.postMessage({sourceName:e,targetName:i,stream:pe.START_COMPLETE,streamId:t,reason:vn(h)})})}function qM(n){const t=n.streamId,e=this.sourceName,i=n.sourceName,r=this.comObj,s=this.streamControllers[t],o=this.streamSinks[t];switch(n.stream){case pe.START_COMPLETE:n.success?s.startCall.resolve():s.startCall.reject(vn(n.reason));break;case pe.PULL_COMPLETE:n.success?s.pullCall.resolve():s.pullCall.reject(vn(n.reason));break;case pe.PULL:if(!o){r.postMessage({sourceName:e,targetName:i,stream:pe.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&n.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=n.desiredSize,Promise.try(o.onPull||yE).then(function(){r.postMessage({sourceName:e,targetName:i,stream:pe.PULL_COMPLETE,streamId:t,success:!0})},function(h){r.postMessage({sourceName:e,targetName:i,stream:pe.PULL_COMPLETE,streamId:t,reason:vn(h)})});break;case pe.ENQUEUE:if(te(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(n.chunk);break;case pe.CLOSE:if(te(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),v(Cs,this,Cy).call(this,s,t);break;case pe.ERROR:te(s,"error should have stream controller"),s.controller.error(vn(n.reason)),v(Cs,this,Cy).call(this,s,t);break;case pe.CANCEL_COMPLETE:n.success?s.cancelCall.resolve():s.cancelCall.reject(vn(n.reason)),v(Cs,this,Cy).call(this,s,t);break;case pe.CANCEL:if(!o)break;const l=vn(n.reason);Promise.try(o.onCancel||yE,l).then(function(){r.postMessage({sourceName:e,targetName:i,stream:pe.CANCEL_COMPLETE,streamId:t,success:!0})},function(h){r.postMessage({sourceName:e,targetName:i,stream:pe.CANCEL_COMPLETE,streamId:t,reason:vn(h)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async function Cy(n,t){await Promise.allSettled([n.startCall?.promise,n.pullCall?.promise,n.cancelCall?.promise]),delete this.streamControllers[t]}function Fe(){return a(ql,this)||p(ql,this,new Map)}function Ff(){return a(so,this)||p(so,this,new Map)}function Ea(){if(!a(Ms,this)){const n=a(je,this).createElement("div"),{style:t}=n;t.colorScheme="only light",t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const e=a(je,this).createElementNS(wn,"svg");e.setAttribute("width",0),e.setAttribute("height",0),p(Ms,this,a(je,this).createElementNS(wn,"defs")),n.append(e),e.append(a(Ms,this)),a(je,this).body.append(n)}return a(Ms,this)}function My(n){if(n.length===1){const l=n[0],h=new Array(256);for(let d=0;d<256;d++)h[d]=l[d]/255;const c=h.join(",");return[c,c,c]}const[t,e,i]=n,r=new Array(256),s=new Array(256),o=new Array(256);for(let l=0;l<256;l++)r[l]=t[l]/255,s[l]=e[l]/255,o[l]=i[l]/255;return[r.join(","),s.join(","),o.join(",")]}function ul(n){if(a(Ql,this)===void 0){p(Ql,this,"");const t=a(je,this).URL;t!==a(je,this).baseURI&&(Pf(t)?ft('#createUrl: ignore "data:"-URL for performance reasons.'):p(Ql,this,X0(t,"")))}return`url(${a(Ql,this)}#${n})`}function tI(n){const t=a(je,this).createElementNS(wn,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),n.append(t)}function bE(n){const t=a(je,this).createElementNS(wn,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),n.append(t)}function fl(n){const t=a(je,this).createElementNS(wn,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",n),Ea.call(v(rt,this)).append(t),t}function Nf(n,t,e){const i=a(je,this).createElementNS(wn,t);i.setAttribute("type","discrete"),i.setAttribute("tableValues",e),n.append(i)}function _f(n,t,e,i){const r=a(je,this).createElementNS(wn,"feComponentTransfer");i.append(r),v(rt,this,Nf).call(this,r,"feFuncR",n),v(rt,this,Nf).call(this,r,"feFuncG",t),v(rt,this,Nf).call(this,r,"feFuncB",e)}function wE(n,t){const e=a(je,this).createElementNS(wn,"feComponentTransfer");t.append(e),v(rt,this,Nf).call(this,e,"feFuncA",n)}function Bf(n){return Ea.call(v(rt,this)).style.color=n,Ic(getComputedStyle(Ea.call(v(rt,this))).getPropertyValue("color"))}function eI(n){return Ea.call(v(rt,this)).style.color=n,Mc(getComputedStyle(Ea.call(v(rt,this))).getPropertyValue("color"))}function nI(n){const[t,e,i,r]=v(rt,this,eI).call(this,n);if(r===1)return[t,e,i];const[s,o,l]=v(rt,this,Bf).call(this,"Canvas");return[Iy(t,s,r),Iy(e,o,r),Iy(i,l,r)]}function Iy(n,t,e){return Math.round(e*n+(1-e)*t)}async function iI(n){const t=await process.getBuiltinModule("fs/promises").readFile(n);return new Uint8Array(t)}async function rI(){if(!globalThis.navigator?.gpu)return!1;try{const n=await navigator.gpu.requestAdapter();return n?(p(gd,this,navigator.gpu.getPreferredCanvasFormat()),p(Is,this,await n.requestDevice()),!0):!1}catch{return!1}}function sI(){return md.init()}function aI(){return md.isReady}function oI(){md.loadMeshShader()}function lI(n,t,e,i,r,s,o,l){return md.draw(n,t,e,i,r,s,o,l)}function Wf(n,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],e,i),n.clip(r)}function hI(n,t,e,i,r,s,o,l){const h=t.coords,c=t.colors,d=n.data,u=n.width*4;let f;h[e*2+1]>h[i*2+1]&&(f=e,e=i,i=f,f=s,s=o,o=f),h[i*2+1]>h[r*2+1]&&(f=i,i=r,r=f,f=o,o=l,l=f),h[e*2+1]>h[i*2+1]&&(f=e,e=i,i=f,f=s,s=o,o=f);const g=(h[e*2]+t.offsetX)*t.scaleX,m=(h[e*2+1]+t.offsetY)*t.scaleY,y=(h[i*2]+t.offsetX)*t.scaleX,b=(h[i*2+1]+t.offsetY)*t.scaleY,x=(h[r*2]+t.offsetX)*t.scaleX,E=(h[r*2+1]+t.offsetY)*t.scaleY;if(m>=E)return;const S=c[s*4],T=c[s*4+1],A=c[s*4+2],P=c[o*4],C=c[o*4+1],M=c[o*4+2],I=c[l*4],k=c[l*4+1],O=c[l*4+2],B=Math.round(m),L=Math.round(E);let $,j,U,G,it,X,ct,Y;for(let q=B;q<=L;q++){if(q<b){const R=q<m?0:(m-q)/(m-b);$=g-(g-y)*R,j=S-(S-P)*R,U=T-(T-C)*R,G=A-(A-M)*R}else{let R;q>E?R=1:b===E?R=0:R=(b-q)/(b-E),$=y-(y-x)*R,j=P-(P-I)*R,U=C-(C-k)*R,G=M-(M-O)*R}let J;q<m?J=0:q>E?J=1:J=(m-q)/(m-E),it=g-(g-x)*J,X=S-(S-I)*J,ct=T-(T-k)*J,Y=A-(A-O)*J;const dt=Math.round(Math.min($,it)),gt=Math.round(Math.max($,it));let N=u*q+dt*4;for(let R=dt;R<=gt;R++)J=($-R)/($-it),J<0?J=0:J>1&&(J=1),d[N++]=j-(j-X)*J|0,d[N++]=U-(U-ct)*J|0,d[N++]=G-(G-Y)*J|0,d[N++]=255}}function cI(n){switch(n[0]){case"RadialAxial":return new uS(n);case"Mesh":return new fS(n);case"Dummy":return new pS}throw new Error(`Unknown IR type: ${n[0]}`)}function dI({src:n,srcPos:t=0,dest:e,width:i,height:r,nonBlackColor:s=4294967295,inverseDecode:o=!1}){const l=Ut.isLittleEndian?4278190080:255,[h,c]=o?[s,l]:[l,s],d=i>>3,u=i&7,f=h^c,g=n.length;e=new Uint32Array(e.buffer);let m=0;for(let y=0;y<r;++y){for(const x=t+d;t<x;++t,m+=8){const E=n[t];e[m]=h^-(E>>7&1)&f,e[m+1]=h^-(E>>6&1)&f,e[m+2]=h^-(E>>5&1)&f,e[m+3]=h^-(E>>4&1)&f,e[m+4]=h^-(E>>3&1)&f,e[m+5]=h^-(E>>2&1)&f,e[m+6]=h^-(E>>1&1)&f,e[m+7]=h^-(E&1)&f}if(u===0)continue;const b=t<g?n[t++]:255;for(let x=0;x<u;++x,++m)e[m]=h^-(b>>7-x&1)&f}return{srcPos:t,destPos:m}}function xE(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");const e=new Map;for(const i of["save","restore","rotate","scale","translate","transform","setTransform","resetTransform","clip","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","arc","arcTo","ellipse","rect","roundRect","closePath","beginPath"]){const r=n[i];typeof r!="function"||typeof t[i]!="function"||(e.set(i,r),n[i]=function(...s){return t[i](...s),r.apply(this,s)})}n._removeMirroring=()=>{for(const[i,r]of e)n[i]=r;delete n._removeMirroring}}function jf(n,t,e,i,r,s,o,l,h,c){const[d,u,f,g,m,y]=Gt(n);if(u===0&&f===0){const E=o*d+m,S=Math.round(E),T=l*g+y,A=Math.round(T),P=(o+h)*d+m,C=Math.abs(Math.round(P)-S)||1,M=(l+c)*g+y,I=Math.abs(Math.round(M)-A)||1;return n.setTransform(Math.sign(d),0,0,Math.sign(g),S,A),n.drawImage(t,e,i,r,s,0,0,C,I),n.setTransform(d,u,f,g,m,y),[C,I]}if(d===0&&g===0){const E=l*f+m,S=Math.round(E),T=o*u+y,A=Math.round(T),P=(l+c)*f+m,C=Math.abs(Math.round(P)-S)||1,M=(o+h)*u+y,I=Math.abs(Math.round(M)-A)||1;return n.setTransform(0,Math.sign(u),Math.sign(f),0,S,A),n.drawImage(t,e,i,r,s,0,0,I,C),n.setTransform(d,u,f,g,m,y),[I,C]}n.drawImage(t,e,i,r,s,o,l,h,c);const b=Math.hypot(d,u),x=Math.hypot(f,g);return[b*h,x*c]}function EE(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}const e=t.height,i=t.width,r=e%un,s=(e-r)/un,o=r===0?s:s+1,l=n.createImageData(i,un);let h=0,c;const d=t.data,u=l.data;let f,g,m,y;if(t.kind===Fc.GRAYSCALE_1BPP){const b=d.byteLength,x=new Uint32Array(u.buffer,0,u.byteLength>>2),E=x.length,S=i+7>>3,T=4294967295,A=Ut.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<s?un:r,c=0,g=0;g<m;g++){const P=b-h;let C=0;const M=P>S?i:P*8-7,I=M&-8;let k=0,O=0;for(;C<I;C+=8)O=d[h++],x[c++]=O&128?T:A,x[c++]=O&64?T:A,x[c++]=O&32?T:A,x[c++]=O&16?T:A,x[c++]=O&8?T:A,x[c++]=O&4?T:A,x[c++]=O&2?T:A,x[c++]=O&1?T:A;for(;C<M;C++)k===0&&(O=d[h++],k=128),x[c++]=O&k?T:A,k>>=1}for(;c<E;)x[c++]=0;n.putImageData(l,0,f*un)}}else if(t.kind===Fc.RGBA_32BPP){for(g=0,y=i*un*4,f=0;f<s;f++)u.set(d.subarray(h,h+y)),h+=y,n.putImageData(l,0,g),g+=un;f<o&&(y=i*r*4,u.set(d.subarray(h,h+y)),n.putImageData(l,0,g))}else if(t.kind===Fc.RGB_24BPP)for(m=un,y=i*m,f=0;f<o;f++){for(f>=s&&(m=r,y=i*m),c=0,g=y;g--;)u[c++]=d[h++],u[c++]=d[h++],u[c++]=d[h++],u[c++]=255;n.putImageData(l,0,f*un)}else throw new Error(`bad image kind: ${t.kind}`)}function AE(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,r=e%un,s=(e-r)/un,o=r===0?s:s+1,l=n.createImageData(i,un);let h=0;const c=t.data,d=l.data;for(let u=0;u<o;u++){const f=u<s?un:r;({srcPos:h}=dI({src:c,srcPos:h,dest:d,width:i,height:f,nonBlackColor:0})),n.putImageData(l,0,u*un)}}function Aa(n,t){for(const e of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])n[e]!==void 0&&(t[e]=n[e]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function Uf(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);const{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function SE(n,t){if(t)return!0;Z.singularValueDecompose2dScale(n,An);const e=Math.fround(ds.pixelRatio*_e.PDF_TO_CSS_UNITS);return An[0]<=e&&An[1]<=e}function TE(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}function PE(){if(this.pageColors){const n=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(n!=="none"){const t=this.ctx.filter;this.ctx.filter=n,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}function CE(n,t=null,e=1){const{width:i,height:r}=n,s=t??this.canvasFactory.create(i,r),o=s.context;e=Math.round(e*255)/255;const l=e<1;l&&a(ao,this)===void 0&&p(ao,this,Ut.isCanvasFilterSupported?new Map:"none");let h="none";if(l&&a(ao,this)instanceof Map&&(h=a(ao,this).get(e),h||(h=this.filterFactory.addKnockoutFilter(e),a(ao,this).set(e,h))),!l||h!=="none")return t&&(o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,i,r),o.restore()),o.filter=h,o.drawImage(n,0,0),o.filter="none",s;const c=n.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i,r),d=o.createImageData(i,r),u=c.data,f=d.data,g=e>0?1/e:1e6;for(let m=3,y=u.length;m<y;m+=4)f[m]=Math.min(Math.round(u[m]*g),255);return o.putImageData(d,0,0),s}function ME(n,t,e,i){let r=n?.[t]??null;if(r&&(r.canvas.width!==e||r.canvas.height!==i)&&(this.canvasFactory.destroy(r),r=null),!r)return r=this.canvasFactory.create(e,i),n&&(n[t]=r),r;const s=r.context;return s.save(),s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,e,i),s.restore(),r}function IE(n,t,e={}){const{backdropCanvas:i=null,destTransform:r=[1,0,0,1,0,0],backdropOffset:s=[0,0],reuseMaskEntry:o=null,poolMeta:l=null,sourceAlpha:h=1,sourceFilter:c="none",knockoutAlpha:d=1}=e,{width:u,height:f}=t,g=v(vt,this,CE).call(this,t,o,d),m=n.globalCompositeOperation;if(n.save(),n.setTransform(...r),n.globalAlpha=1,Ut.isCanvasFilterSupported&&(n.filter="none"),n.globalCompositeOperation="destination-out",n.drawImage(g.canvas,0,0),i){const[y,b]=s,x=v(vt,this,ME).call(this,l,"knockoutBackdropEntry",u,f),E=x.context;E.drawImage(i,y,b,u,f,0,0,u,f),E.globalCompositeOperation="destination-in",E.drawImage(g.canvas,0,0),E.globalCompositeOperation="source-over",n.globalCompositeOperation="destination-over",n.drawImage(x.canvas,0,0),l||this.canvasFactory.destroy(x)}n.globalCompositeOperation=m,n.globalAlpha=h,Ut.isCanvasFilterSupported&&(n.filter=c??"none"),n.drawImage(t,0,0),n.restore(),o||this.canvasFactory.destroy(g)}function Rn(n=1){var t;if(a(Bn,this)===0||a(Dr,this)>0||!this.contentVisible)return!1;p(Dr,this,(t=a(Dr,this),t++,t)),p(sh,this,n);const e=a(Fr,this).at(-1),{canvas:i}=this.ctx,r=v(vt,this,ME).call(this,e,"knockoutTempEntry",i.width,i.height);p(eh,this,r);const s=r.context;return s.save(),s.setTransform(this.ctx.getTransform()),Aa(this.ctx,s),p(rh,this,s.globalCompositeOperation),s.globalCompositeOperation="source-over",xE(s,this.ctx),p(ah,this,e),p(nh,this,this.ctx),p(ih,this,this.suspendedCtx),this.ctx=s,this.inSMaskMode&&(this.suspendedCtx=s),!0}function ln(n){if(!n)return;const t=a(eh,this),e=a(nh,this),i=a(ih,this),r=t.context;p(eh,this,null),p(nh,this,null),p(ih,this,null),this.inSMaskMode&&this.suspendedCtx===r&&this.ctx!==r&&this.endSMaskMode(),this.inSMaskMode&&(this.suspendedCtx=i),this.ctx._removeMirroring(),this.ctx.globalCompositeOperation=a(rh,this),p(rh,this,null),Aa(this.ctx,e),this.ctx=e;const s=a(ah,this);p(ah,this,null);const o=a(sh,this);p(sh,this,1);try{v(vt,this,IE).call(this,i??e,t.canvas,{backdropCanvas:s?.backdropCtx?.canvas??null,backdropOffset:s?.backdropCtx?[s.offsetX,s.offsetY]:[0,0],reuseMaskEntry:s?.knockoutMaskEntry??null,poolMeta:s,knockoutAlpha:o})}finally{var l;r.restore(),p(Dr,this,(l=a(Dr,this),l--,l)),s||this.canvasFactory.destroy(t)}}function kE(n,t,e){const i=new Path2D;return i.addPath(n,new DOMMatrix(e).invertSelf().multiplySelf(t)),i}function ky(n){n&&(n.knockoutMaskEntry&&(this.canvasFactory.destroy(n.knockoutMaskEntry),n.knockoutMaskEntry=null),n.knockoutTempEntry&&(this.canvasFactory.destroy(n.knockoutTempEntry),n.knockoutTempEntry=null),n.knockoutBackdropEntry&&(this.canvasFactory.destroy(n.knockoutBackdropEntry),n.knockoutBackdropEntry=null))}function uI(n){let t=!0,e=i("filename\\*","i").exec(n);if(e){e=e[1];let d=l(e);return d=unescape(d),d=h(d),d=c(d),s(d)}if(e=o(n),e)return s(c(e));if(e=i("filename","i").exec(n),e){e=e[1];let d=l(e);return d=c(d),s(d)}function i(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function r(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const f=new TextDecoder(d,{fatal:!0}),g=Tf(u);u=f.decode(g),t=!1}catch{}}return u}function s(d){return t&&/[\x80-\xff]/.test(d)&&(d=r("utf-8",d),t&&(d=r("iso-8859-1",d))),d}function o(d){const u=[];let f;const g=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=g.exec(d))!==null;){let[,y,b,x]=f;if(y=parseInt(y,10),y in u){if(y===0)break;continue}u[y]=[b,x]}const m=[];for(let y=0;y<u.length&&y in u;++y){let[b,x]=u[y];x=l(x),b&&(x=unescape(x),y===0&&(x=h(x))),m.push(x)}return m.join("")}function l(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let f=0;f<u.length;++f){const g=u[f].indexOf('"');g!==-1&&(u[f]=u[f].slice(0,g),u.length=f+1),u[f]=u[f].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function h(d){const u=d.indexOf("'");return u===-1?d:r(d.slice(0,u),d.slice(u+1).replace(/^[^']*'/,""))}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi,function(u,f,g,m){if(g==="q"||g==="Q")return m=m.replaceAll("_"," "),m=m.replaceAll(/=([0-9a-f]{2})/gi,function(y,b){return String.fromCharCode(parseInt(b,16))}),r(f,m);try{m=atob(m)}catch{}return r(f,m)})}return""}function RE(n,t){const e=new Headers;if(!n||!t||typeof t!="object")return e;for(const i in t){const r=t[i];r!==void 0&&e.append(i,r)}return e}function $f(n){return URL.parse(n)?.origin??null}function OE({responseHeaders:n,isHttp:t,rangeChunkSize:e,disableRange:i}){const r={contentLength:0,isRangeSupported:!1},s=parseInt(n.get("Content-Length"),10);return!Number.isInteger(s)||(r.contentLength=s,s<=2*e)||i||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")==="identity"&&(r.isRangeSupported=!0),r}function LE(n){const t=n.get("Content-Disposition");if(t){let e=uI(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(vy(e))return e}return null}function Hf(n,t){return new Bc(`Unexpected server response (${n}) while retrieving PDF "${t.href}".`,n,n===404||n===0&&t.protocol==="file:")}function DE(n,t){if(n!==t)throw new Error(`Expected range response-origin "${n}" to match "${t}".`)}function FE(n,t,e,i){return fetch(n,{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"})}function NE(n,t){if(n!==200&&n!==206)throw Hf(n,t)}function Vf(n){if(n instanceof Uint8Array)return n.buffer;if(n instanceof ArrayBuffer)return n;throw new Error(`getArrayBuffer - unexpected data: ${n}`)}function _E(n){return n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer}function zf(){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}function fI(n,t){const e=_E(t);if(n===void 0)this._fullReader?this._fullReader._enqueue(e):this._queuedChunks.push(e);else{const i=this._rangeReaders.keys().find(r=>r._begin===n);te(i,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),i._enqueue(e)}}function pI(n){return typeof n!="string"?n:Tf(n).buffer}function gI(n,t){a(Nr,this).get(n)?.onProgress?.(t)}function mI(n,t){const e=a(Nr,this).get(n);if(!e||(n.readyState>=2&&e.onHeadersReceived&&(e.onHeadersReceived(),delete e.onHeadersReceived),n.readyState!==4)||!a(Nr,this).has(n))return;if(a(Nr,this).delete(n),n.status===0&&this.isHttp){e.onError(n.status);return}const i=n.status||lg;if(!e.validateStatus(i)){e.onError(n.status);return}const r=pI(n.response);if(i===jb){const s=n.getResponseHeader("Content-Range");/bytes \d+-\d+\/\d+/.test(s)?e.onDone(r):(ft('Missing or invalid "Content-Range" header.'),e.onError(0))}else r?e.onDone(r):e.onError(n.status)}function vI(){const n=this._stream,{disableRange:t,rangeChunkSize:e}=n._source,i=this._fullRequestXhr;n._responseOrigin=$f(i.responseURL);const r=i.getAllResponseHeaders(),s=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(h=>{const[c,...d]=h.split(": ");return[c,d.join(": ")]}):[]),{contentLength:o,isRangeSupported:l}=OE({responseHeaders:s,isHttp:n.isHttp,rangeChunkSize:e,disableRange:t});this._contentLength=o,this._isRangeSupported=l,this._filename=LE(s),this._isRangeSupported&&n._abortRequest(i),this._headersCapability.resolve()}function yI(n){this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._cachedChunks.push(n),this._done=!0,this._cachedChunks.length===0&&a(cg,this).call(this)}function bI(n){this._storedError=Hf(n,this._stream.url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}function wI(n){this.onProgress?.({loaded:n.loaded,total:n.lengthComputable?n.total:this._contentLength})}function xI(){const n=$f(this._requestXhr?.responseURL);try{DE(n,this._stream._responseOrigin)}catch(t){this._storedError=t,v(lh,this,BE).call(this,0)}}function EI(n){this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0,a(dg,this).call(this),this.onClosed?.()}function BE(n){this._storedError??(this._storedError=Hf(n,this._stream.url));for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}function WE(n,t=null){const e=process.getBuiltinModule("fs"),{Readable:i}=process.getBuiltinModule("stream"),r=e.createReadStream(n,t);return i.toWeb(r)}function AI(n){return Cc(n)?bS:bn?MS:TS}function jE(n){const t=n.length;if(t<2)return!0;const e=n[0];for(let i=1;i<t;i++){const r=n[i];let s;if(Array.isArray(r))s=v(mg,this,jE).call(this,r);else if(a(zt,this).has(r))s=a(zt,this).get(r).visible;else return ft(`Optional content group not found: ${r}`),!0;switch(e){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return e==="And"}function Gf(){if(a(Ee,this))return;const n=a(en,this),t=p(Ee,this,new Uint32Array(n));for(let e=0;e<n;e++)t[e]=e+1;p(tr,this,new Int32Array(t))}function Xf(){const n=new Map,t=a(Ee,this);for(let e=0,i=a(en,this);e<i;e++){const r=t[e],s=n.get(r);s?s.push(e+1):n.set(r,[e+1])}return n}function Ry(n,t=null,e=-1,i=null){const r=a(tr,this),s=a(Ee,this),o=e+(i?.length??0),l=new Map;for(let h=0,c=a(en,this);h<c;h++){if(h>=e&&h<o){r[h]=-i[h-e];continue}const d=s[h],u=n.get(d);let f=l.get(d)||0;if(t&&u)for(;f<u.length&&t.has(u[f]);)f++;r[h]=u?.[f],l.set(d,f+1)}}function SI(n){var t;if(a(vg,this))return;(t=a(Rs,this)).ctx??(t.ctx=Oy.call(hn,a(uo,this)));const e=a(dh,this),i=a(Eg,this);for(const r of n){if(e.length>FS){ft("Ignoring additional textDivs for performance reasons."),p(vg,this,!0);return}if(r.str===void 0){if(r.type==="beginMarkedContentProps"||r.type==="beginMarkedContent"){const s=a(Sn,this);p(Sn,this,document.createElement("span")),a(Sn,this).classList.add("markedContent"),r.id&&a(Sn,this).setAttribute("id",`${r.id}`),r.tag==="Artifact"&&(a(Sn,this).ariaHidden=!0),s.append(a(Sn,this))}else r.type==="endMarkedContent"&&p(Sn,this,a(Sn,this).parentNode);continue}i.push(r.str),v(uh,this,TI).call(this,r)}}function TI(n){const t=document.createElement("span"),e={angle:0,canvasWidth:0,hasText:n.str!=="",hasEOL:n.hasEOL,fontSize:0};a(dh,this).push(t);const i=Z.transform(a(Sg,this),n.transform);let r=Math.atan2(i[1],i[0]);const s=a(Md,this)[n.fontName];s.vertical&&(r+=Math.PI/2);let o=a(yg,this)&&s.fontSubstitution||s.fontFamily;o=hn.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),h=l*CI.call(hn,o,s,a(uo,this));let c,d;r===0?(c=i[4],d=i[5]-h):(c=i[4]+h*Math.sin(r),d=i[5]-h*Math.cos(r));const u=t.style;u.left=`${(100*c/a(wg,this)).toFixed(2)}%`,u.top=`${(100*d/a(bg,this)).toFixed(2)}%`,u.setProperty("--font-height",`${l.toFixed(2)}px`),u.fontFamily=o,e.fontSize=l,t.setAttribute("role","presentation"),t.textContent=n.str,t.dir=n.dir,a(yg,this)&&(t.dataset.fontName=s.fontSubstitutionLoadedName||n.fontName),r!==0&&(e.angle=r*(180/Math.PI));let f=!1;if(n.str.length>1)f=!0;else if(n.str!==" "&&n.transform[0]!==n.transform[3]){const g=Math.abs(n.transform[0]),m=Math.abs(n.transform[3]);g!==m&&Math.max(g,m)/Math.min(g,m)>1.5&&(f=!0)}if(f&&(e.canvasWidth=s.vertical?n.height:n.width),a(Ag,this).set(t,e),a(Rs,this).div=t,a(Rs,this).properties=e,v(uh,this,UE).call(this,a(Rs,this)),e.hasText&&a(Sn,this).append(t),e.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),a(Sn,this).append(g)}}function UE(n){const{div:t,properties:e,ctx:i}=n,{style:r}=t;if(e.canvasWidth!==0&&e.hasText){const{fontFamily:s}=r,{canvasWidth:o,fontSize:l}=e;$E.call(hn,i,l*a(fo,this),s);const{width:h}=i.measureText(t.textContent);h>0&&r.setProperty("--scale-x",o*a(fo,this)/h)}e.angle!==0&&r.setProperty("--rotate",`${e.angle}deg`)}function Oy(n=null){let t=v(hn,this,Rd)._.get(n||(n=""));if(!t){const e=document.createElement("canvas");e.style.cssText="position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal",e.lang=n,document.body.append(e),t=e.getContext("2d",{alpha:!1,willReadFrequently:!0}),v(hn,this,Rd)._.set(n,t),v(hn,this,Gb)._.set(t,{size:0,family:""})}return t}function $E(n,t,e){const i=v(hn,this,Gb)._.get(n);t===i.size&&e===i.family||(n.font=`${t}px ${e}`,i.size=t,i.family=e)}function PI(){if(v(hn,this,Pg)._!==null)return;const n=document.createElement("div");n.style.opacity=0,n.style.lineHeight=1,n.style.fontSize="1px",n.style.position="absolute",n.textContent="X",document.body.append(n),Pg._=v(hn,this,n.getBoundingClientRect().height),n.remove()}function CI(n,t,e){const i=v(hn,this,Tg)._.get(n);if(i)return i;const r=v(hn,this,Oy).call(this,e);r.canvas.width=r.canvas.height=zb,v(hn,this,$E).call(this,r,zb,n);const s=r.measureText(""),o=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let h=.8;return o?h=o/(o+l):(Ut.platform.isFirefox&&ft("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?h=t.ascent:t.descent&&(h=1+t.descent)),v(hn,this,Tg)._.set(n,h),h}function HE(n={}){const t=new _S,{docId:e}=t,i=n.url?KM(n.url):null,r=n.data?ZM(n.data):null,s=n.httpHeaders||null,o=n.withCredentials===!0,l=n.password??null,h=n.range instanceof Yb?n.range:null,c=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16;let d=n.worker instanceof vh?n.worker:null;const u=n.verbosity,f=typeof n.docBaseUrl=="string"&&!Pf(n.docBaseUrl)?n.docBaseUrl:null,g=Df(n.cMapUrl),m=n.cMapPacked!==!1,y=Df(n.iccUrl),b=Df(n.standardFontDataUrl),x=Df(n.wasmUrl),E=n.stopAtErrors!==!0,S=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,T=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!bn,A=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!bn,P=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,C=typeof n.disableFontFace=="boolean"?n.disableFontFace:bn,M=n.fontExtraProperties===!0,I=n.enableXfa===!0,k=n.ownerDocument||globalThis.document,O=n.disableRange===!0,B=n.disableStream===!0,L=n.disableAutoFetch===!0,$=n.pdfBug===!0,j=n.CanvasFactory||(bn?lS:sS),U=n.FilterFactory||(bn?oS:aS),G=n.BinaryDataFactory||(bn?hS:Ib),it=n.enableHWA===!0,X=n.enableWebGPU===!0?sI():Promise.resolve(!1),ct=n.useWasm!==!1,Y=n.pagesMapper||new DS,q=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!bn&&!C,J=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(G===Ib&&g&&m&&b&&x&&Cc(g,document.baseURI)&&Cc(b,document.baseURI)&&Cc(x,document.baseURI)),dt=null;rM(u);const gt={canvasFactory:new j({ownerDocument:k,enableHWA:it}),filterFactory:new U({docId:e,ownerDocument:k}),binaryDataFactory:J?null:new G({cMapUrl:g,standardFontDataUrl:b,wasmUrl:x})};d||(d=vh.create({verbosity:u,port:ks.workerPort}),t._worker=d);const N={docId:e,apiVersion:"6.0.227",data:r,password:l,disableAutoFetch:L,rangeChunkSize:c,docBaseUrl:f,enableXfa:I,evaluatorOptions:{maxImageSize:S,disableFontFace:C,ignoreErrors:E,isOffscreenCanvasSupported:T,isImageDecoderSupported:A,canvasMaxAreaInBytes:P,fontExtraProperties:M,useSystemFonts:q,useWasm:ct,useWorkerFetch:J,cMapUrl:g,cMapPacked:m,iccUrl:y,standardFontDataUrl:b,wasmUrl:x,hasGPU:!1}},R={ownerDocument:k,pdfBug:$,styleElement:dt,enableHWA:it,loadingParams:{disableAutoFetch:L,enableXfa:I}};return Promise.all([d.promise,X]).then(function([,F]){if(d.destroyed)throw new Error("Worker was destroyed");N.evaluatorOptions.hasGPU=F;const H=d.messageHandler.sendWithPromise("GetDocRequest",N,r?[r.buffer]:null);let tt;if(!r)if(h)tt=new ES({pdfDataRangeTransport:h,disableRange:O,disableStream:B});else if(i)tt=new(AI(i))({url:i,httpHeaders:s,withCredentials:o,rangeChunkSize:c,disableRange:O,disableStream:B});else throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");return H.then(V=>{if(d.destroyed)throw new Error("Worker was destroyed");const K=new Jl(e,V,d.port);if(t._transport=new jS(K,t,tt,R,gt,Y),t.destroyed)throw new Error("Loading aborted");K.send("Ready",null)})}).catch(t._capability.reject).finally(t._setupCapability.resolve),t}function Yf(){if(!a(Os,this)||this.destroyed)return!1;for(const{renderTasks:n,operatorList:t}of this._intentStates.values())if(n.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),p(Os,this,!1),!0}function Ly(){a(po,this).resolve(),a(er,this).send("configure",{verbosity:this.verbosity})}function MI(n){p(Ls,this,n),p(er,this,new Jl("main","worker",n)),a(er,this).on("ready",()=>{}),v(Ii,this,Ly).call(this)}function II(){if(Ld._||Dy.call(zi)){v(Ii,this,Kf).call(this);return}let{workerSrc:n}=zi;try{zi._isSameOrigin(window.location,n)||(n=zi._createCDNWrapper(new URL(n,window.location).href));const t=new Worker(n,{type:"module"}),e=new Jl("main","worker",t),i=()=>{r.abort(),e.destroy(),t.terminate(),this.destroyed?a(po,this).reject(new Error("Worker was destroyed")):v(Ii,this,Kf).call(this)},r=new AbortController;t.addEventListener("error",()=>{a(mh,this)||i()},{signal:r.signal}),e.on("test",o=>{if(r.abort(),this.destroyed||!o){i();return}p(er,this,e),p(Ls,this,t),p(mh,this,t),v(Ii,this,Ly).call(this)}),e.on("ready",o=>{if(r.abort(),this.destroyed){i();return}try{s()}catch{v(Ii,this,Kf).call(this)}});const s=()=>{const o=new Uint8Array;e.send("test",o,[o.buffer])};s();return}catch{Sf("The worker has been disabled.")}v(Ii,this,Kf).call(this)}function Kf(){Ld._||(ft("Setting up fake worker."),Ld._=!0),zi._setupFakeWorkerGlobal.then(n=>{var t,e;if(this.destroyed){a(po,this).reject(new Error("Worker was destroyed"));return}const i=new rS;p(Ls,this,i);const r=`fake${Kb._=(t=Kb._,e=t++,t),e}`,s=new Jl(r+"_worker",r,i);n.setup(s,i),p(er,this,new Jl(r,r+"_worker",i)),v(Ii,this,Ly).call(this)}).catch(n=>{a(po,this).reject(new Error(`Setting up fake worker failed: "${n.message}".`))})}function Dy(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}function Zf(n,t=null){return a(yh,this).getOrInsertComputed(n,()=>this.messageHandler.sendWithPromise(n,t))}function Fy({loaded:n,total:t}){this.loadingTask.onProgress?.({loaded:n,total:t,percent:t?Zt(Math.round(n/t*100),0,100):NaN})}function VE(){const n=document.createElement("div"),t=a(ir,this)._signal;n.addEventListener("contextmenu",Jn,{signal:t}),n.className="dropdown",n.role="listbox",n.ariaMultiSelectable="false",n.ariaOrientation="vertical",n.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),a(Ns,this)&&(n.id=`${a(Ns,this).id}_colorpicker_dropdown`);for(const[e,i]of a(ir,this).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",i),r.title=e,r.setAttribute("data-l10n-id",Rg._[e]);const s=document.createElement("span");r.append(s),s.className="swatch",s.style.backgroundColor=i,r.ariaSelected=i===a(_d,this),r.addEventListener("click",v(ae,this,zE).bind(this,i),{signal:t}),n.append(r)}return n.addEventListener("keydown",v(ae,this,GE).bind(this),{signal:t}),n}function zE(n,t){t.stopPropagation(),a(Ig,this).dispatch("switchannotationeditorparams",{source:this,type:wt.HIGHLIGHT_COLOR,value:n}),this.updateColor(n)}function GE(n){PA._keyboardManager.exec(this,n)}function pl(n){if(Sa.call(v(ae,this))){this.hideDropdown();return}if(p(Mg,this,n.detail===0),a(mo,this)||(p(mo,this,new AbortController),window.addEventListener("pointerdown",v(ae,this,kI).bind(this),{signal:a(ir,this).combinedSignal(a(mo,this))})),a(ni,this).ariaExpanded="true",a(ke,this)){a(ke,this).classList.remove("hidden");return}const t=p(ke,this,v(ae,this,VE).call(this));a(ni,this).append(t)}function kI(n){a(ke,this)?.contains(n.target)||this.hideDropdown()}function Sa(){return a(ke,this)&&!a(ke,this).classList.contains("hidden")}function XE(n){return Math.floor(Zt(n,0,1)*255).toString(16).padStart(2,"0")}function Rc(n){return Zt(n,0,1)*255}function YE(n){const{container:{style:t},data:{rect:e,rotation:i},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:s,pageX:o,pageY:l}}}}=this;e?.splice(0,4,...n),t.left=`${100*(n[0]-o)/r}%`,t.top=`${100*(s-n[3]+l)/s}%`,i===0?(t.width=`${100*(n[2]-n[0])/r}%`,t.height=`${100*(n[3]-n[1])/s}%`):this.setRotation(i)}function gl(){this.container.setAttribute("data-internal-link","")}function RI(n,t,e="",i=null){n.href=this.linkService.getAnchorUrl(""),t.description?n.title=t.description:e&&(n.title=e),n.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,i),!1),v(rr,this,gl).call(this)}function OI(n,t,e=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(t),!1),e&&(n.title=e),v(rr,this,gl).call(this)}function KE(){return new e1({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}function Ny(){if(a(js,this))return;p(js,this,new AbortController);const{signal:n}=a(js,this);for(const t of this.trigger)t.addEventListener("click",a($d,this),{signal:n}),t.addEventListener("pointerenter",a(tw,this),{signal:n}),t.addEventListener("pointerleave",a(qb,this),{signal:n}),t.classList.add("popupTriggerArea");for(const t of a(Eh,this))t.container?.addEventListener("keydown",a(yo,this),{signal:n})}function ZE(){const n=a(Eh,this).find(t=>t.hasCommentButton);n&&p($s,this,n._normalizePoint(n.commentButtonPosition))}function JE(){if(a(Ue,this).extraPopupElement&&!a(Ue,this).editor)return;a(me,this)||this.renderCommentButton();const[n,t]=a($s,this),{style:e}=a(me,this);e.left=`calc(${n}%)`,e.top=`calc(${t}% - var(--comment-button-dim))`}function QE(){a(Ue,this).extraPopupElement||(a(me,this)||this.renderCommentButton(),a(me,this).style.backgroundColor=this.commentButtonColor||"")}function _y(){const n=a(Hs,this),t=a(Wr,this);return n?.str&&(!t?.str||t.str===n.str)&&a(Hs,this).html||null}function qE(){return _y.call(v(Wt,this))?.attributes?.style?.fontSize||0}function LI(){return _y.call(v(Wt,this))?.attributes?.style?.color||null}function DI(n){const t=[],e={str:n,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:LI.call(v(Wt,this)),fontSize:qE.call(v(Wt,this))?`calc(${qE.call(v(Wt,this))}px * var(--total-scale-factor))`:""}};for(const r of n.split(`
36
+ `))t.push({name:"span",value:r,attributes:i});return e}function FI(n){n.altKey||n.shiftKey||n.ctrlKey||n.metaKey||(n.key==="Enter"||n.key==="Escape"&&a(jr,this))&&v(Wt,this,By).call(this)}function NI(){if(a(Us,this)!==null)return;const{page:{view:n},viewport:{rawDims:{pageWidth:t,pageHeight:e,pageX:i,pageY:r}}}=a(Vd,this);let s=!!a(zd,this),o=s?a(zd,this):a(Bg,this);for(const f of a(Eh,this))if(!o||Z.intersect(f.data.rect,o)!==null){o=f.data.rect,s=!0;break}const l=Z.normalizeRect([o[0],n[3]-o[1]+n[1],o[2],n[3]-o[3]+n[1]]),h=s?o[2]-o[0]+5:0,c=l[0]+h,d=l[1];p(Us,this,[100*(c-i)/t,100*(d-r)/e]);const{style:u}=a(ge,this);u.left=`${a(Us,this)[0]}%`,u.top=`${a(Us,this)[1]}%`}function By(){if(a(ri,this)){a(ri,this).toggleCommentPopup(this,!1);return}p(jr,this,!a(jr,this)),a(jr,this)?(v(Wt,this,Wy).call(this),a(ge,this).addEventListener("click",a($d,this)),a(ge,this).addEventListener("keydown",a(yo,this))):(v(Wt,this,tA).call(this),a(ge,this).removeEventListener("click",a($d,this)),a(ge,this).removeEventListener("keydown",a(yo,this)))}function Wy(){a(si,this)||this.render(),this.isVisible?a(jr,this)&&a(ge,this).classList.add("focused"):(v(Wt,this,NI).call(this),a(ge,this).hidden=!1,a(ge,this).style.zIndex=parseInt(a(ge,this).style.zIndex,10)+1e3)}function tA(){a(ge,this).classList.remove("focused"),!(a(jr,this)||!this.isVisible)&&(a(ge,this).hidden=!0,a(ge,this).style.zIndex=parseInt(a(ge,this).style.zIndex,10)-1e3)}function eA(n,t){switch(n){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}function nA(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}async function jy(){if(a(jn,this).length===0)return;this.div.replaceChildren();const n=[];if(!a(Kg,this)){p(Kg,this,!0);for(const{contentElement:e,data:{id:i}}of a(jn,this)){const r=e.id=`${Pa}${i}`;n.push(a(Yg,this)?.getAriaAttributes(r).then(s=>{if(s)for(const[o,l]of s)e.setAttribute(o,l)}))}}a(jn,this).sort(({data:{rect:[e,i,r,s]}},{data:{rect:[o,l,h,c]}})=>{if(e===r&&i===s)return 1;if(o===h&&l===c)return-1;const d=s,u=i,f=(i+s)/2,g=c,m=l,y=(l+c)/2;return f>=g&&y<=u?-1:y>=d&&f<=m?1:(e+r)/2-(o+h)/2});const t=document.createDocumentFragment();for(const e of a(jn,this))t.append(e.container),this._commentManager?(e.extraPopupElement?.popup||e.popup)?.renderCommentButton():e.extraPopupElement&&t.append(e.extraPopupElement.render());if(this.div.append(t),await Promise.all(n),a(Sh,this))for(const e of a(jn,this))a(Sh,this).addPointerInTextLayer(e.contentElement,!1)}function iA(){if(!a(Th,this))return;const n=this.div;for(const[t,e]of a(Th,this)){const i=n.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;e.className="annotationContent";const{firstChild:r}=i;r?r.nodeName==="CANVAS"?r.replaceWith(e):r.classList.contains("annotationContent")?r.after(e):r.before(e):i.append(e);const s=a(Ao,this).get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,i.id,e),s._hasNoCanvas=!1):s.canvas=e)}a(Th,this).clear()}function _I(n){const t=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-a(oi,this))*this.parentScale),p(oi,this,i),v(Un,this,Uy).call(this)},e=a(oi,this);this.addCommands({cmd:t.bind(this,n),undo:t.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function BI(n){const t=i=>{this.color=i,this.onUpdatedColor()},e=this.color;this.addCommands({cmd:t.bind(this,n),undo:t.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function WI(){const n=[];this.editorDiv.normalize();let t=null;for(const e of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&e.nodeName==="BR"||(n.push($y.call(CA,e)),t=e);return n.join(`
37
+ `)}function Uy(){const[n,t]=this.parentDimensions;let e;if(this.isAttachedToDOM)e=this.div.getBoundingClientRect();else{const{currentLayer:i,div:r}=this,s=r.style.display,o=r.classList.contains("hidden");r.classList.remove("hidden"),r.style.display="hidden",i.div.append(this.div),e=r.getBoundingClientRect(),r.remove(),r.style.display=s,r.classList.toggle("hidden",o)}this.rotation%180===this.parentRotation%180?(this.width=e.width/n,this.height=e.height/t):(this.width=e.height/n,this.height=e.width/t),this.fixAndSetPosition()}function $y(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(Yd,"")}function Hy(){if(this.editorDiv.replaceChildren(),!!a(ai,this))for(const n of a(ai,this).split(`
38
+ `)){const t=document.createElement("div");t.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(t)}}function jI(){return a(ai,this).replaceAll(" "," ")}function rA(n){return n.replaceAll(" "," ")}function UI(n){const{value:t,fontSize:e,color:i,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||n.value!==t||n.fontSize!==e||n.color.some((s,o)=>s!==i[o])||n.pageIndex!==r}function Jf(){const n=a(Tt,this).subarray(4,6),t=a(Tt,this).subarray(16,18),[e,i,r,s]=a(li,this);return[(a(Mh,this)+(n[0]-t[0])/2-e)/r,(a(Ih,this)+(n[1]-t[1])/2-i)/s,(a(Mh,this)+(t[0]-n[0])/2-e)/r,(a(Ih,this)+(t[1]-n[1])/2-i)/s]}function $I(){const[n,t,e,i]=a(li,this),[r,s,o,l]=v(hi,this,Jf).call(this);return`M${(a(Tt,this)[2]-n)/e} ${(a(Tt,this)[3]-t)/i} L${(a(Tt,this)[4]-n)/e} ${(a(Tt,this)[5]-t)/i} L${r} ${s} L${o} ${l} L${(a(Tt,this)[16]-n)/e} ${(a(Tt,this)[17]-t)/i} L${(a(Tt,this)[14]-n)/e} ${(a(Tt,this)[15]-t)/i} Z`}function HI(n){const t=a(sr,this);n.push(`L${t[4]} ${t[5]} Z`)}function VI(n){const[t,e,i,r]=a(li,this),s=a(Tt,this).subarray(4,6),o=a(Tt,this).subarray(16,18),[l,h,c,d]=v(hi,this,Jf).call(this);n.push(`L${(s[0]-t)/i} ${(s[1]-e)/r} L${l} ${h} L${c} ${d} L${(o[0]-t)/i} ${(o[1]-e)/r}`)}function zI(n){const t=a(Tt,this),[e,i,r,s]=a(li,this),[o,l,h,c]=v(hi,this,Jf).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-e)/r,(t[3]-i)/s,NaN,NaN,NaN,NaN,(t[4]-e)/r,(t[5]-i)/s,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,(t[16]-e)/r,(t[17]-i)/s,NaN,NaN,NaN,NaN,(t[14]-e)/r,(t[15]-i)/s],0),this.newFreeDrawOutline(d,n,a(li,this),a(Jd,this),a(Kd,this),a(Zd,this))}function GI(n,t){const e=a(sr,this);return n.set([NaN,NaN,NaN,NaN,e[4],e[5]],t),t+=6}function XI(n,t){const e=a(Tt,this).subarray(4,6),i=a(Tt,this).subarray(16,18),[r,s,o,l]=a(li,this),[h,c,d,u]=v(hi,this,Jf).call(this);return n.set([NaN,NaN,NaN,NaN,(e[0]-r)/o,(e[1]-s)/l,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,d,u,NaN,NaN,NaN,NaN,(i[0]-r)/o,(i[1]-s)/l],t),t+=24}function YI(n){const t=a(Ae,this);let e=t[4],i=t[5];const r=[e,i,e,i];let s=e,o=i,l=e,h=i;const c=n?Math.max:Math.min,d=new Float32Array(4);for(let f=6,g=t.length;f<g;f+=6){const m=t[f+4],y=t[f+5];isNaN(t[f])?(Z.pointBoundingBox(m,y,r),o>y?(s=m,o=y):o===y&&(s=c(s,m)),h<y?(l=m,h=y):h===y&&(l=c(l,m))):(d.set(Gi,0),Z.bezierBoundingBox(e,i,...t.slice(f,f+6),d),Z.rectBoundingBox(...d,r),o>d[1]?(s=d[0],o=d[1]):o===d[1]&&(s=c(s,d[0])),h<d[3]?(l=d[2],h=d[3]):h===d[3]&&(l=c(l,d[2]))),e=m,i=y}const u=a(kh,this);u[0]=r[0]-a(zs,this),u[1]=r[1]-a(zs,this),u[2]=r[2]-r[0]+2*a(zs,this),u[3]=r[3]-r[1]+2*a(zs,this),this.firstPoint=[s,o],this.lastPoint=[l,h]}function KI(n){const t=[],e=new Set;for(const s of n){const[o,l,h]=s;t.push([o,l,s],[o,h,s])}t.sort((s,o)=>s[1]-o[1]||s[0]-o[0]);for(let s=0,o=t.length;s<o;s+=2){const l=t[s][2],h=t[s+1][2];l.push(h),h.push(l),e.add(l),e.add(h)}const i=[];let r;for(;e.size>0;){const s=e.values().next().value;let[o,l,h,c,d]=s;e.delete(s);let u=o,f=l;for(r=[o,h],i.push(r);;){let g;if(e.has(c))g=c;else if(e.has(d))g=d;else break;e.delete(g),[o,l,h,c,d]=g,u!==o&&(r.push(u,f,o,f===l?l:h),u=o),f=f===l?h:l}r.push(u,f)}return new f1(i,a(em,this),a(nm,this),a(im,this))}function Vy(n){const t=a(ar,this);let e=0,i=t.length-1;for(;e<=i;){const r=e+i>>1,s=t[r][0];if(s===n)return r;s<n?e=r+1:i=r-1}return i+1}function ZI([,n,t]){const e=v(or,this,Vy).call(this,n);a(ar,this).splice(e,0,[n,t])}function JI([,n,t]){const e=v(or,this,Vy).call(this,n);for(let i=e;i<a(ar,this).length;i++){const[r,s]=a(ar,this)[i];if(r!==n)break;if(r===n&&s===t){a(ar,this).splice(i,1);return}}for(let i=e-1;i>=0;i--){const[r,s]=a(ar,this)[i];if(r!==n)break;if(r===n&&s===t){a(ar,this).splice(i,1);return}}}function sA(n){const[t,e,i]=n,r=[[t,e,i]],s=v(or,this,Vy).call(this,i);for(let o=0;o<s;o++){const[l,h]=a(ar,this)[o];for(let c=0,d=r.length;c<d;c++){const[,u,f]=r[c];if(!(h<=u||f<=l)){if(u>=l){if(f>h)r[c][1]=h;else{if(d===1)return[];r.splice(c,1),c--,d--}continue}r[c][2]=l,f>h&&r.push([t,h,f])}}}return r}function aA(){const n=new rm(a(Gs,this),.001);p(di,this,n.getOutlines()),[this.x,this.y,this.width,this.height]=a(di,this).box;const t=new rm(a(Gs,this),.0025,.001,this._uiManager.direction==="ltr");p($n,this,t.getOutlines());const{firstPoint:e}=a(di,this);p(nu,this,[(e[0]-this.x)/this.width,(e[1]-this.y)/this.height]);const{lastPoint:i}=a($n,this);p(iu,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function zy({highlightOutlines:n,highlightId:t,clipPathId:e}){if(p(di,this,n),p($n,this,n.getNewOutline(a(Ri,this)/2+1.5,.0025)),t>=0)p(ui,this,t),p(Rh,this,e),this.parent.drawLayer.finalizeDraw(t,{bbox:n.box,path:{d:n.toSVGPath()}}),p(fn,this,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:a($n,this).box,path:{d:a($n,this).toSVGPath()}},!0));else if(this.parent){const c=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(a(ui,this),{bbox:Oc.call(Dc,a(di,this).box,(c-this.rotation+360)%360),path:{d:n.toSVGPath()}}),this.parent.drawLayer.updateProperties(a(fn,this),{bbox:Oc.call(Dc,a($n,this).box,c),path:{d:a($n,this).toSVGPath()}})}const[i,r,s,o]=n.box;switch(this.rotation){case 0:this.x=i,this.y=r,this.width=s,this.height=o;break;case 90:{const[c,d]=this.parentDimensions;this.x=r,this.y=1-i,this.width=s*d/c,this.height=o*c/d;break}case 180:this.x=1-i,this.y=1-r,this.width=s,this.height=o;break;case 270:{const[c,d]=this.parentDimensions;this.x=1-r,this.y=i,this.width=s*d/c,this.height=o*c/d;break}}const{firstPoint:l}=n;p(nu,this,[(l[0]-i)/s,(l[1]-r)/o]);const{lastPoint:h}=a($n,this);p(iu,this,[(h[0]-i)/s,(h[1]-r)/o])}function QI(n){const t=(r,s)=>{this.color=r,this.opacity=s,this.onUpdatedColor()},e=this.color,i=this.opacity;this.addCommands({cmd:t.bind(this,n,Dc._defaultOpacity),undo:t.bind(this,e,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(n)},!0)}function qI(n){const t=a(Ri,this),e=i=>{p(Ri,this,i),v(jt,this,tk).call(this,i)};this.addCommands({cmd:e.bind(this,n),undo:e.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)}function tk(n){a(nn,this)&&(v(jt,this,zy).call(this,{highlightOutlines:a(di,this).getNewOutline(n/2)}),this.fixAndSetPosition(),this.setDims())}function oA(){a(ui,this)===null||!this.parent||(this.parent.drawLayer.remove(a(ui,this)),p(ui,this,null),this.parent.drawLayer.remove(a(fn,this)),p(fn,this,null))}function ml(n=this.parent){a(ui,this)===null&&({id:Af(p,[ui,this])._,clipPathId:Af(p,[Rh,this])._}=n.drawLayer.draw({bbox:a(di,this).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:a(nn,this)},path:{d:a(di,this).toSVGPath()}},!1,!0),p(fn,this,n.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:a(nn,this)},bbox:a($n,this).box,path:{d:a($n,this).toSVGPath()}},a(nn,this))),a(Oh,this)&&(a(Oh,this).style.clipPath=a(Rh,this)))}function Oc([n,t,e,i],r){switch(r){case 90:return[1-t-i,n,i,e];case 180:return[1-n-e,1-t-i,e,i];case 270:return[t,1-n-e,i,e]}return[n,t,e,i]}function ek(n){Dc._keyboardManager.exec(this,n)}function Gy(n){if(!a(eu,this))return;const t=window.getSelection();n?t.setPosition(a(eu,this),a(om,this)):t.setPosition(a(hm,this),a(cm,this))}function Xy(){return a(nn,this)?this.rotation:0}function nk(){if(a(nn,this))return null;const[n,t]=this.pageDimensions,[e,i]=this.pageTranslation,r=a(Gs,this),s=new Float32Array(r.length*8);let o=0;for(const{x:l,y:h,width:c,height:d}of r){const u=l*n+e,f=(1-h)*t+i;s[o]=s[o+4]=u,s[o+1]=s[o+3]=f,s[o+2]=s[o+6]=u+c*n,s[o+5]=s[o+7]=f-d*t,o+=8}return s}function ik(n){return a(di,this).serialize(n,v(jt,this,Xy).call(this))}function rk(n,t){this._freeHighlight.add(t)&&n.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}function sk(n,t){this._freeHighlight.isEmpty()?n.drawLayer.remove(this._freeHighlightId):n.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}function ak(n){const{color:t}=this._initialData;return this.hasEditedComment||n.color.some((e,i)=>e!==t[i])}function lA({drawOutlines:n,drawId:t,drawingOptions:e}){p(Tn,this,n),this._drawingOptions||(this._drawingOptions=e),this.annotationElementId||this._uiManager.a11yAlert(St._l10nAlert[this.editorType]),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,n.defaultProperties)):this._drawId=v(Yt,this,hA).call(this,n,this.parent),v(Yt,this,qf).call(this,n.box)}function hA(n,t){const{id:e}=t.drawLayer.draw(MA._mergeSVGProperties(this._drawingOptions.toSVGProperties(),n.defaultSVGProperties),!1,!1);return e}function cA(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}function Qf(n=this.parent){if(!(this._drawId!==null&&this.parent===n)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,n.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=v(Yt,this,hA).call(this,a(Tn,this),n)}}function ok([n,t,e,i]){const{parentDimensions:[r,s],rotation:o}=this;switch(o){case 90:return[t,1-n,e*(s/r),i*(r/s)];case 180:return[1-n,1-t,e,i];case 270:return[1-t,n,e*(s/r),i*(r/s)];default:return[n,t,e,i]}}function Yy(){const{x:n,y:t,width:e,height:i,parentDimensions:[r,s],rotation:o}=this;switch(o){case 90:return[1-t,n,e*(r/s),i*(s/r)];case 180:return[1-n,1-t,e,i];case 270:return[t,1-n,e*(r/s),i*(s/r)];default:return[n,t,e,i]}}function qf(n){[this.x,this.y,this.width,this.height]=v(Yt,this,ok).call(this,n),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}function Lc(){const{x:n,y:t,width:e,height:i,rotation:r,parentRotation:s,parentDimensions:[o,l]}=this;switch((r*4+s)/90){case 1:return[1-t-i,n,i,e];case 2:return[1-n-e,1-t-i,e,i];case 3:return[t,1-n-e,i,e];case 4:return[n,t-e*(o/l),i*(l/o),e*(o/l)];case 5:return[1-t,n,e*(o/l),i*(l/o)];case 6:return[1-n-i*(l/o),1-t,i*(l/o),e*(o/l)];case 7:return[t-e*(o/l),1-n-i*(l/o),e*(o/l),i*(l/o)];case 8:return[n-e,t-i,e,i];case 9:return[1-t,n-e,i,e];case 10:return[1-n,1-t,e,i];case 11:return[t-i,1-n,i,e];case 12:return[n-i*(l/o),t,i*(l/o),e*(o/l)];case 13:return[1-t-e*(o/l),n-i*(l/o),e*(o/l),i*(l/o)];case 14:return[1-n,1-t-e*(o/l),i*(l/o),e*(o/l)];case 15:return[t,1-n,e*(o/l),i*(l/o)];default:return[n,t,e,i]}}function Ky(n,t){return nt._normalizePoint(n,t,a(Nh,this),a(_h,this),a(Dh,this))}function ls(n=a(Bh,this)){const t=a(fm,this)+n/2*a(cu,this);return a(du,this)%180===0?[t/a(Vr,this),t/a(zr,this)]:[t/a(zr,this),t/a(Vr,this)]}function lk(){const[n,t,e,i]=a(Cn,this),[r,s]=v(Hn,this,ls).call(this,0);return[n+r,t+s,e-2*r,i-2*s]}function hk(){const n=p(Cn,this,hs.slice());for(const{line:i}of a(pi,this)){if(i.length<=12){for(let o=4,l=i.length;o<l;o+=6)Z.pointBoundingBox(i[o],i[o+1],n);continue}let r=i[4],s=i[5];for(let o=6,l=i.length;o<l;o+=6){const[h,c,d,u,f,g]=i.subarray(o,o+6);Z.bezierBoundingBox(r,s,h,c,d,u,f,g,n),r=f,s=g}}const[t,e]=v(Hn,this,ls).call(this);n[0]=Zt(n[0]-t,0,1),n[1]=Zt(n[1]-e,0,1),n[2]=Zt(n[2]+t,0,1),n[3]=Zt(n[3]+e,0,1),n[2]-=n[0],n[3]-=n[1]}function ck(n){const[t,e]=v(Hn,this,ls).call(this);p(Bh,this,n);const[i,r]=v(Hn,this,ls).call(this),[s,o]=[i-t,r-e],l=a(Cn,this);return l[0]-=s,l[1]-=o,l[2]+=2*s,l[3]+=2*o,l}function dk(n){const{color:t,thickness:e,opacity:i,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||n.color.some((s,o)=>s!==t[o])||n.thickness!==e||n.opacity!==i||n.pageIndex!==r}function dA(n,t,e,i){return e-=n,i-=t,e===0?i>0?0:4:e===1?i+6:2-i}function uk(n,t,e,i,r,s,o){const l=v(Me,this,dA).call(this,e,i,r,s);for(let h=0;h<8;h++){const c=(-h+l-o+16)%8,d=v(Me,this,Gr)._[2*c],u=v(Me,this,Gr)._[2*c+1];if(n[(e+d)*t+(i+u)]!==0)return c}return-1}function fk(n,t,e,i,r,s,o){const l=v(Me,this,dA).call(this,e,i,r,s);for(let h=0;h<8;h++){const c=(h+l+o+16)%8,d=v(Me,this,Gr)._[2*c],u=v(Me,this,Gr)._[2*c+1];if(n[(e+d)*t+(i+u)]!==0)return c}return-1}function uA(n,t,e,i){const r=n.length,s=new Int32Array(r);for(let c=0;c<r;c++)s[c]=n[c]<=i?1:0;for(let c=1;c<e-1;c++)s[c*t]=s[c*t+t-1]=0;for(let c=0;c<t;c++)s[c]=s[t*e-1-c]=0;let o=1,l;const h=[];for(let c=1;c<e-1;c++){l=1;for(let d=1;d<t-1;d++){const u=c*t+d,f=s[u];if(f===0)continue;let g=c,m=d;if(f===1&&s[u-1]===0)o+=1,m-=1;else if(f>=1&&s[u+1]===0)o+=1,m+=1,f>1&&(l=f);else{f!==1&&(l=Math.abs(f));continue}const y=[d,c],b=m===d+1,x={isHole:b,points:y,id:o,parent:0};h.push(x);let E;for(const k of h)if(k.id===l){E=k;break}E?E.isHole?x.parent=b?E.parent:l:x.parent=b?l:E.parent:x.parent=b?l:0;const S=v(Me,this,uk).call(this,s,t,c,d,g,m,0);if(S===-1){s[u]=-o,s[u]!==1&&(l=Math.abs(s[u]));continue}let T=v(Me,this,Gr)._[2*S],A=v(Me,this,Gr)._[2*S+1];const P=c+T,C=d+A;g=P,m=C;let M=c,I=d;for(;;){const k=v(Me,this,fk).call(this,s,t,M,I,g,m,1);T=v(Me,this,Gr)._[2*k],A=v(Me,this,Gr)._[2*k+1];const O=M+T,B=I+A;y.push(B,O);const L=M*t+I;if(s[L+1]===0?s[L]=-o:s[L]===1&&(s[L]=o),O===c&&B===d&&M===P&&I===C){s[u]!==1&&(l=Math.abs(s[u]));break}else g=M,m=I,M=O,I=B}}}return h}function Zy(n,t,e,i){if(e-t<=4){for(let P=t;P<e-2;P+=2)i.push(n[P],n[P+1]);return}const r=n[t],s=n[t+1],o=n[e-4]-r,l=n[e-3]-s,h=Math.hypot(o,l),c=o/h,d=l/h,u=c*s-d*r,f=l/o,g=1/h,m=Math.atan(f),y=Math.cos(m),b=Math.sin(m),x=g*(Math.abs(y)+Math.abs(b)),E=g*(1-x+x**2),S=Math.max(Math.atan(Math.abs(b+y)*E),Math.atan(Math.abs(b-y)*E));let T=0,A=t;for(let P=t+2;P<e-2;P+=2){const C=Math.abs(u-c*n[P+1]+d*n[P]);C>T&&(A=P,T=C)}T>(h*S)**2?(v(Me,this,Zy).call(this,n,t,A+2,i),v(Me,this,Zy).call(this,n,A,e,i)):i.push(r,s)}function pk(n){const t=[],e=n.length;return v(Me,this,Zy).call(this,n,0,e,t),t.push(n[e-2],n[e-1]),t.length<=4?null:t}function gk(n,t,e,i,r,s){const o=new Float32Array(s**2),l=-2*i**2,h=s>>1;for(let m=0;m<s;m++){const y=(m-h)**2;for(let b=0;b<s;b++)o[m*s+b]=Math.exp((y+(b-h)**2)/l)}const c=new Float32Array(256),d=-2*r**2;for(let m=0;m<256;m++)c[m]=Math.exp(m**2/d);const u=n.length,f=new Uint8Array(u),g=new Uint32Array(256);for(let m=0;m<e;m++)for(let y=0;y<t;y++){const b=m*t+y,x=n[b];let E=0,S=0;for(let A=0;A<s;A++){const P=m+A-h;if(!(P<0||P>=e))for(let C=0;C<s;C++){const M=y+C-h;if(M<0||M>=t)continue;const I=n[P*t+M],k=o[A*s+C]*c[Math.abs(I-x)];E+=I*k,S+=k}}const T=f[b]=Math.round(E/S);g[T]++}return[f,g]}function mk(n){const t=new Uint32Array(256);for(const e of n)t[e]++;return t}function fA(n){const t=n.length,e=new Uint8ClampedArray(t>>2);let i=-1/0,r=1/0;for(let o=0,l=e.length;o<l;o++){const h=e[o]=n[o<<2];i=Math.max(i,h),r=Math.min(r,h)}const s=255/(i-r);for(let o=0,l=e.length;o<l;o++)e[o]=(e[o]-r)*s;return e}function pA(n){let t,e=-1/0,i=-1/0;const r=n.findIndex(l=>l!==0);let s=r,o=r;for(t=r;t<256;t++){const l=n[t];l>e&&(t-s>i&&(i=t-s,o=t-1),e=l,s=t)}for(t=o-1;t>=0&&!(n[t]>n[t+1]);t--);return t}function vk(n){const t=n,{width:e,height:i}=n,{maxDim:r}=v(Me,this,pu)._;let s=e,o=i;if(e>r||i>r){let c=e,d=i,u=Math.log2(Math.max(e,i)/r);const f=Math.floor(u);u=u===f?f-1:f;for(let m=0;m<u;m++){s=Math.ceil(c/2),o=Math.ceil(d/2);const y=new OffscreenCanvas(s,o);y.getContext("2d").drawImage(n,0,0,c,d,0,0,s,o),c=s,d=o,n!==t&&n.close(),n=y.transferToImageBitmap()}const g=Math.min(r/s,r/o);s=Math.round(s*g),o=Math.round(o*g)}const l=new OffscreenCanvas(s,o).getContext("2d",{willReadFrequently:!0});l.fillStyle="white",l.fillRect(0,0,s,o),l.filter="grayscale(1)",l.drawImage(n,0,0,n.width,n.height,0,0,s,o);const h=l.getImageData(0,0,s,o).data;return[v(Me,this,fA).call(this,h),s,o]}function tp(n,t=!1){if(!n){this.remove();return}p(ie,this,n.bitmap),t||(p(ze,this,n.id),p(gi,this,n.isSvg)),n.file&&p(mu,this,n.file.name),v(Kt,this,Qy).call(this)}function ep(){if(p(ko,this,null),this._uiManager.enableWaiting(!1),!!a(Ks,this)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&a(ie,this)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&a(ie,this)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}function Jy(){if(a(ze,this)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(a(ze,this)).then(e=>v(Kt,this,tp).call(this,e,!0)).finally(()=>v(Kt,this,ep).call(this));return}if(a(Ys,this)){const e=a(Ys,this);p(Ys,this,null),this._uiManager.enableWaiting(!0),p(ko,this,this._uiManager.imageManager.getFromUrl(e).then(i=>v(Kt,this,tp).call(this,i)).finally(()=>v(Kt,this,ep).call(this)));return}if(a(Ro,this)){const e=a(Ro,this);p(Ro,this,null),this._uiManager.enableWaiting(!0),p(ko,this,this._uiManager.imageManager.getFromFile(e).then(i=>v(Kt,this,tp).call(this,i)).finally(()=>v(Kt,this,ep).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=yp.join(",");const t=this._uiManager._signal;p(ko,this,new Promise(e=>{n.addEventListener("change",async()=>{if(!n.files||n.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(n.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),v(Kt,this,tp).call(this,i)}e()},{signal:t}),n.addEventListener("cancel",()=>{this.remove(),e()},{signal:t})}).finally(()=>v(Kt,this,ep).call(this))),n.click()}function Qy(){const{div:n}=this;let{width:t,height:e}=a(ie,this);const[i,r]=this.pageDimensions,s=.75;if(this.width)t=this.width*i,e=this.height*r;else if(t>s*i||e>s*r){const l=Math.min(s*i/t,s*r/e);t*=l,e*=l}this._uiManager.enableWaiting(!1);const o=p(Ks,this,document.createElement("canvas"));o.setAttribute("role","img"),this.addContainer(o),this.width=t/i,this.height=e/r,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(n.hidden=!1),v(Kt,this,gA).call(this),a(vu,this)||(this.parent.addUndoableEditor(this),p(vu,this,!0)),this._reportTelemetry({action:"inserted_image"}),a(mu,this)&&this.div.setAttribute("aria-description",a(mu,this)),this.annotationElementId||this._uiManager.a11yAlert(St._l10nAlert.stamp)}function qy(n,t){const{width:e,height:i}=a(ie,this);let r=e,s=i,o=a(ie,this);for(;r>2*n||s>2*t;){const l=r,h=s;r>2*n&&(r=Math.ceil(r/2)),s>2*t&&(s=Math.ceil(s/2));const c=new OffscreenCanvas(r,s);c.getContext("2d").drawImage(o,0,0,l,h,0,0,r,s),o=c.transferToImageBitmap()}return o}function gA(){const[n,t]=this.parentDimensions,{width:e,height:i}=this,r=new ds,s=Math.ceil(e*n*r.sx),o=Math.ceil(i*t*r.sy),l=a(Ks,this);if(!l||l.width===s&&l.height===o)return;l.width=s,l.height=o;const h=a(gi,this)?a(ie,this):v(Kt,this,qy).call(this,s,o),c=l.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(h,0,0,h.width,h.height,0,0,s,o)}function tb(n){if(n){if(a(gi,this)){const e=this._uiManager.imageManager.getSvgUrl(a(ze,this));if(e)return e}const t=document.createElement("canvas");return{width:t.width,height:t.height}=a(ie,this),t.getContext("2d").drawImage(a(ie,this),0,0),t.toDataURL()}if(a(gi,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*_e.PDF_TO_CSS_UNITS),r=Math.round(this.height*e*_e.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,r);return s.getContext("2d").drawImage(a(ie,this),0,0,a(ie,this).width,a(ie,this).height,0,0,i,r),s.transferToImageBitmap()}return structuredClone(a(ie,this))}function yk(n){const{pageIndex:t,accessibilityData:{altText:e}}=this._initialData,i=n.pageIndex===t,r=(n.accessibilityData?.alt||"")===e;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&r,isSameAltText:r}}function mA(){return a(Vn,this).size!==0?a(Vn,this).values():a(st,this).getEditors(this.pageIndex)}function bk(n){a(st,this).unselectAll();const{target:t}=n;if(t===a(Ge,this).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent")||t.classList.contains("textLayerImages")||t.classList.contains("textLayerImagePlaceholder"))&&a(Ge,this).div.contains(t)){const{isMac:e}=Ut.platform;if(n.button!==0||n.ctrlKey&&e)return;a(st,this).showAllEditors("highlight",!0,!0),a(Ge,this).div.classList.add("free"),this.toggleDrawing(),fi.startHighlighting(this,a(st,this).direction==="ltr",{target:a(Ge,this).div,x:n.x,y:n.y}),a(Ge,this).div.addEventListener("pointerup",()=>{a(Ge,this).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:a(st,this)._signal}),n.preventDefault()}}function yr(){return Vh._.get(a(st,this).getMode())}function vA(n){const t=yr.call(v(ve,this));return t?new t.prototype.constructor(n):null}function yA(){const{x:n,y:t,width:e,height:i}=this.boundingClientRect,r=Math.max(0,n),s=Math.max(0,t),o=Math.min(window.innerWidth,n+e),l=Math.min(window.innerHeight,t+i),h=(r+o)/2-n,c=(s+l)/2-t,[d,u]=this.viewport.rotation%180===0?[h,c]:[c,h];return{offsetX:d,offsetY:u}}function eb(){for(const n of a(Vn,this).values())n.isEmpty()&&n.remove()}function wk(n,t){return n===t?0:n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function np(n){return n?n.nodeType===Node.ELEMENT_NODE?n.closest(".textLayer"):n.parentElement?.closest(".textLayer")||null:null}function xk(n,t,e,i){if(n===e)return t<=i;const r=n.compareDocumentPosition(e);return r&Node.DOCUMENT_POSITION_FOLLOWING?!0:r&Node.DOCUMENT_POSITION_PRECEDING?!1:null}function bA(n,t,e){if(n.nodeType!==Node.ELEMENT_NODE||!n.classList.contains("textLayer")||t!==n.childNodes.length)return{container:n,offset:t};let i=n.lastChild;return i?.nodeType===Node.ELEMENT_NODE&&i.classList.contains("endOfContent")&&(i=i.previousSibling),!i||!e.contains(i)?null:i.nodeType===Node.TEXT_NODE?{container:i,offset:i.textContent.length}:{container:i,offset:i.childNodes.length}}function wA(n){const t=v(Ne,this,_o)._.get(n);t?.selectionDiv&&(t.selectionDiv.remove(),v(Ne,this,Yh)._.delete(t.selectionDiv),t.selectionDiv=null,t.path=null)}function xA(){const n=document.getSelection();return!!n&&!n.isCollapsed}function Ek(){return[...v(Ne,this,Zh)._].filter(n=>n.isConnected).sort(wk)}function nb(){const n=document.getSelection();if(!n||n.isCollapsed){for(const l of v(Ne,this,Yh)._)l.remove();v(Ne,this,Yh)._.clear();return}const t=new WeakMap,e=v(Ne,this,Ek).call(this),i=[];for(let l=0,h=n.rangeCount;l<h;l++){const c=n.getRangeAt(l);if(c.collapsed)continue;let{startContainer:d,startOffset:u,endContainer:f,endOffset:g}=c,m=np(d),y=np(f);const b=m===null,x=y===null;if(v(Ne,this,Kh)._&&b!==x)return;if(n.rangeCount===1){const{anchorNode:T,anchorOffset:A,focusNode:P,focusOffset:C}=n,M=np(T),I=np(P),k=xk(T,A,P,C);M&&I&&k!==null&&(k?(d=T,u=A,m=M,f=P,g=C,y=I):(d=P,u=C,m=I,f=T,g=A,y=M))}const E=e.filter(T=>c.intersectsNode(T));if(E.length===0)continue;let S=!1;if(m||(m=E[0],d=m,u=0,S=!0),y||(y=E.at(-1),f=y,g=y.childNodes.length,S=!0),f.nodeType===Node.ELEMENT_NODE){if(f.classList.contains("endOfContent")){const T=f.previousSibling;if(!T)continue;f=T,g=T.nodeType===Node.TEXT_NODE?T.textContent.length:T.childNodes.length}else if(f.classList.contains("textLayer")&&f.childNodes.length===g){const T=bA(f,g,y);if(!T)continue;f=T.container,g=T.offset}}if(d.nodeType===Node.ELEMENT_NODE){const T=bA(d,u,m);if(!T)continue;d=T.container,u=T.offset}if(m===y&&!S&&E.includes(m)){i.push([c,m]);continue}for(const T of E){const A=T.firstChild;if(!A)continue;const P=document.createRange();if(T===m?P.setStart(d,u):P.setStartBefore(A),T===y)P.setEnd(f,g);else{const C=T.lastChild;if(!C)continue;if(C.nodeType===Node.ELEMENT_NODE&&C.classList.contains("endOfContent")){const M=C.previousSibling;if(!M)continue;P.setEndAfter(M)}else P.setEndAfter(C)}P.collapsed||i.push([P,T])}}const r=new Set(i.map(l=>l[1]));for(const l of v(Ne,this,Zh)._)r.has(l)||v(Ne,this,wA).call(this,l);for(const[l,h]of i){const c=_o._.get(h);if(!c)continue;let d=t.get(h);if(!d){const y=h.getBoundingClientRect();d=(b,x,E,S)=>({x:(b-y.x)/y.width,y:(x-y.y)/y.height,width:E/y.width,height:S/y.height}),t.set(h,d)}const u=[];for(let{x:y,y:b,width:x,height:E}of l.getClientRects())x===0||E===0||({x:y,y:b,width:x,height:E}=d(y,b,x,E),!(x===1&&E===1)&&u.push(`M${y} ${b} h${x} v${E} h-${x} Z`));if(u.length===0)continue;const f=c.drawLayer;let g=c.selectionDiv,m=c.path;if(!g){var s,o;const y=`clip_selection_${pw._=(s=pw._,o=s++,s),o}`;g=document.createElement("div"),g.className="selection",g.style.clipPath=`url(#${y})`;const b=a(mm,f)?.createSelectionStyle(a(vm,f));if(b)for(const[S,T]of Object.entries(b))g.style.setProperty(S,T);const x=Ne._svgFactory.create(1,1,!0);x.setAttribute("aria-hidden","true"),x.setAttribute("width","100%"),x.setAttribute("height","100%");const E=Ne._svgFactory.createElement("clipPath");E.setAttribute("id",y),E.setAttribute("clipPathUnits","objectBoundingBox"),m=Ne._svgFactory.createElement("path"),E.append(m),x.append(E),g.append(x),c.path=m,c.selectionDiv=g}!g.parentNode&&a(zn,f)&&(a(zn,f).append(g),v(Ne,this,Yh)._.add(g)),m.setAttribute("d",u.join(" "))}}function Ak(n,[t,e,i,r]){const{style:s}=n;s.top=`${100*e}%`,s.left=`${100*t}%`,s.width=`${100*i}%`,s.height=`${100*r}%`}function EA(){const n=Ne._svgFactory.create(1,1,!0);return a(zn,this).append(n),n.setAttribute("aria-hidden","true"),n}function Sk(n,t){const e=Ne._svgFactory.createElement("clipPath");n.append(e);const i=`clip_${t}`;e.setAttribute("id",i),e.setAttribute("clipPathUnits","objectBoundingBox");const r=Ne._svgFactory.createElement("use");return e.append(r),r.setAttribute("href",`#${t}`),r.classList.add("clip"),i}function AA(n,t){for(const[e,i]of Object.entries(t))i===null?n.removeAttribute(e):n.setAttribute(e,i)}function ip(n){return`${(n*100).toFixed(2)}%`}function Tk([n,t,e,i,r,s]){const o=Math.hypot((r-n)*a(Kr,this),(s-t)*a(Zr,this)),l=Math.hypot((e-n)*a(Kr,this),(i-t)*a(Zr,this));if(o<a(Su,this)||l<a(Su,this))return null;const h=[(r-n)*a(Kr,this)/o,(s-t)*a(Zr,this)/o,(e-n)*a(Kr,this)/l,(i-t)*a(Zr,this)/l,0,0],c=Z.inverseTransform(h),d=document.createElement("canvas");return d.className="textLayerImagePlaceholder",d.width=0,d.height=0,Object.assign(d.style,{opacity:0,position:"absolute",left:ip(n),top:ip(t),width:ip(o/a(Kr,this)),height:ip(l/a(Zr,this)),transformOrigin:"0% 0%",transform:`matrix(${h.join(",")})`}),a(ym,this).set(d,{inverseTransform:c,width:o,height:l,x1:n,y1:t}),d}var rp,ib,SA,TA,yn,Ta,hn,zi,PA,CA,Dc,MA,Me,Ne,IA,kA,RA,OA,LA,rb,bn,Gi,hs,sp,ap,wn,xn,br,Pa,vl,pt,wt,DA,be,Fc,ce,Ca,Nc,Xi,yl,FA,_c,cs,sb,op,lp,Bc,NA,wr,Ut,Z,hp,ab,cp,dp,up,fp,pp,ob,_e,gp,Ma,lb,mp,vp,ds,yp,_A,BA,hb,Ia,ka,bi,wi,bp,Ra,Wc,jc,On,WA,wp,xp,Oa,us,bl,jA,UA,cn,wl,xl,Ep,El,Ap,$A,Uc,Al,Se,$c,cb,we,La,Sp,Jt,HA,db,Sl,ub,Hc,Qn,Tl,de,se,Vc,zc,En,Pl,xi,Be,Da,Fa,Na,_a,xr,Ei,Cl,Tp,Pp,Gc,Cp,Er,Ba,Xc,Wa,Yi,fb,fs,Yc,Mp,ja,Ml,Kc,ps,Ip,Te,Bt,gs,Ua,$a,Zc,Jc,kp,Ha,Ar,ms,Rp,Op,Ai,ht,vs,We,Sr,Ki,Qc,Tr,qn,qc,Pr,Ln,ys,Il,Cr,Mr,Lp,Va,Ze,Si,kl,Xt,Dp,za,Ti,Ga,Xa,Rl,Fp,td,ed,Ol,Np,_p,Bp,Wp,jp,bs,Ll,ws,Dl,xs,nd,Up,Fl,Zi,ne,Lt,Es,id,Ya,$p,Je,Nl,As,Pi,Ka,Hp,_l,Qe,Vp,Bl,Ss,Ir,rd,sd,ti,Za,zp,pb,It,St,VA,gb,Dn,kr,Gp,Wl,jl,Ul,Rr,qe,mb,Xp,Yp,vb,Ja,yb,bb,Kp,ad,Qa,zA,wb,Ts,Nt,Qt,$l,Hl,Vl,dn,Zp,GA,Fn,Nn,zl,Ji,od,qa,to,$t,XA,Ht,ue,Qi,eo,no,Jp,_n,Gl,Xl,io,ro,Yl,YA,xb,ld,KA,Vt,ZA,Eb,Ab,fe,tn,Qp,Sb,hd,cd,JA,Kl,dd,Or,Zl,QA,qi,Tb,xe,qt,qA,tS,ud,eS,qp,nS,iS,Ps,Pb,rS,fd,pe,pd,Cs,Jl,Cb,Mb,Ib,tg,kb,sS,Rb,Ql,ql,Ms,Lr,je,so,Ci,rt,aS,oS,lS,hS,cS,eg,Is,th,gd,Ob,dS,md,Ie,ng,uS,fS,pS,Lb,vd,Db,Fb,gS,Nb,un,ig,An,_b,mS,vS,yS,Bb,Bn,Dr,eh,nh,ih,rh,sh,ao,ah,Fr,vt,yd,rg,sg,bd,wd,xd,bS,wS,xS,Wb,ES,ag,AS,og,SS,lg,jb,Nr,hg,TS,cg,oh,PS,dg,lh,CS,MS,IS,kS,ks,Ub,$b,Ed,ug,RS,oo,fg,pg,gg,Ad,OS,lo,zt,Sd,Td,mg,LS,Ee,tr,en,hh,_r,Wn,DS,ho,Hb,Mi,Vb,FS,zb,co,Sn,vg,yg,Pd,uo,Rs,bg,wg,ch,xg,Cd,fo,Md,Eg,Id,dh,Ag,Sg,uh,kd,Tg,Rd,Gb,Pg,Cg,NS,_S,Xb,Od,fh,Yb,BS,Os,ph,gh,WS,po,er,Ls,mh,Ii,vh,Kb,Ld,Dd,ei,yh,Ds,nr,bh,Fd,Fs,Br,jS,US,go,$S,Nd,HS,VS,ni,wh,_d,ke,Mg,Bd,Ns,Ig,mo,ir,ae,kg,Rg,ii,Wd,xh,_s,Zb,Og,Jb,zS,jd,GS,Bs,XS,Lg,vo,Ud,ki,Dg,oe,YS,rr,Fg,KS,Ws,ZS,JS,QS,Qb,qS,t1,Ng,_g,ri,yo,qb,tw,$d,Hd,ge,Wr,bo,Eh,Vd,zd,jr,si,js,Us,me,$s,wo,Bg,Hs,Gd,xo,Eo,Ue,Vs,Wt,e1,ew,Wg,n1,jg,i1,Ug,r1,$g,nw,s1,a1,Hg,Ah,Vg,zg,iw,o1,l1,h1,rw,Gg,Xg,c1,Sh,Th,Xd,Ao,Yg,Ph,jn,Kg,So,d1,Yd,ai,Zg,Ch,oi,Un,Ur,nt,li,sr,Kd,Zd,$r,Tt,Mh,Ih,Jg,Qg,Jd,Qd,To,hi,sw,aw,u1,qd,kh,zs,qg,ci,tm,Ae,ow,lw,em,nm,im,Po,ar,or,rm,sm,tu,f1,am,p1,eu,om,Gs,Rh,lm,$n,hm,cm,Oh,di,ui,nn,nu,iu,fn,ru,Ri,dm,jt,fi,Lh,hw,Tn,su,Yt,Co,rn,au,ou,Hr,$e,He,Dh,lu,Pn,Ve,Oi,Fh,Nh,_h,hu,g1,Cn,um,fm,pi,Vr,zr,cu,du,Bh,Hn,Wh,cw,dw,uu,pm,fu,jh,Xs,pu,Gr,m1,v1,Mo,Xr,Io,Uh,gu,ie,ze,ko,Ys,Ro,mu,Ks,$h,Yr,gi,vu,Kt,gm,Hh,yu,Oo,Lo,Zs,Vn,Do,bu,wu,lr,Js,Ge,Qs,Fo,xu,st,ve,uw,Vh,zn,Mn,Li,mm,vm,zh,Gh,No,fw,Eu,pw,Xh,Yh,Kh,Zh,_o,Au,ym,bm,Su,Kr,Zr,gw,y1,mw,Pk=xt((()=>{if(Ef(),W0(),$0(),H0(),V0(),z0(),iM(),LA={9306(n,t,e){var i=e(4901),r=e(6823),s=TypeError;n.exports=function(o){if(i(o))return o;throw new s(r(o)+" is not a function")}},3506(n,t,e){var i=e(3925),r=String,s=TypeError;n.exports=function(o){if(i(o))return o;throw new s("Can't set "+r(o)+" as a prototype")}},7080(n,t,e){var i=e(4402).has;n.exports=function(r){return i(r),r}},3463(n){var t=TypeError;n.exports=function(e){if(typeof e=="string")return e;throw new t("Argument is not a string")}},4328(n,t,e){var i=e(4995),r=new i.WeakMap,s=i.set,o=i.remove;n.exports=function(l){return s(r,l,1),o(r,l),l}},6557(n,t,e){var i=e(4995).has;n.exports=function(r){return i(r),r}},6469(n,t,e){var i=e(8227),r=e(2360),s=e(4913).f,o=i("unscopables"),l=Array.prototype;l[o]===void 0&&s(l,o,{configurable:!0,value:r(null)}),n.exports=function(h){l[o][h]=!0}},679(n,t,e){var i=e(1625),r=TypeError;n.exports=function(s,o){if(i(o,s))return s;throw new r("Incorrect invocation")}},3972(n,t,e){var i=e(34),r=String,s=TypeError;n.exports=function(o){if(o===void 0||i(o))return o;throw new s(r(o)+" is not an object or undefined")}},8551(n,t,e){var i=e(34),r=String,s=TypeError;n.exports=function(o){if(i(o))return o;throw new s(r(o)+" is not an object")}},4154(n,t,e){var i=e(6955),r=TypeError;n.exports=function(s){if(i(s)==="Uint8Array")return s;throw new r("Argument is not an Uint8Array")}},7811(n){n.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394(n,t,e){var i=e(4576),r=e(6706),s=e(2195),o=i.ArrayBuffer,l=i.TypeError;n.exports=o&&r(o.prototype,"byteLength","get")||function(h){if(s(h)!=="ArrayBuffer")throw new l("ArrayBuffer expected");return h.byteLength}},3238(n,t,e){var i=e(4576),r=e(7811),s=e(7394),o=i.DataView;n.exports=function(l){if(!r||s(l)!==0)return!1;try{return new o(l),!1}catch{return!0}}},5169(n,t,e){var i=e(3238),r=TypeError;n.exports=function(s){if(i(s))throw new r("ArrayBuffer is detached");return s}},5636(n,t,e){var i=e(4576),r=e(9504),s=e(6706),o=e(7696),l=e(5169),h=e(7394),c=e(4483),d=e(1548),u=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,m=Math.max,y=Math.min,b=f.prototype,x=g.prototype,E=r(b.slice),S=s(b,"resizable","get"),T=s(b,"maxByteLength","get"),A=r(x.getInt8),P=r(x.setInt8);n.exports=(d||c)&&function(C,M,I){var k=h(C),O=M===void 0?k:o(M),B=!S||!S(C),L;if(l(C),d&&(C=u(C,{transfer:[C]}),k===O&&(I||B)))return C;if(k>=O&&(!I||B))L=E(C,0,O);else{L=new f(O,I&&!B&&T?{maxByteLength:m(O,T(C))}:void 0);for(var $=new g(C),j=new g(L),U=y(O,k),G=0;G<U;G++)P(j,G,A($,G))}return d||c(C),L}},4644(n,t,e){var i=e(7811),r=e(3724),s=e(4576),o=e(4901),l=e(34),h=e(9297),c=e(6955),d=e(6823),u=e(6699),f=e(6840),g=e(2106),m=e(1625),y=e(2787),b=e(2967),x=e(8227),E=e(3392),S=e(1181),T=S.enforce,A=S.get,P=s.Int8Array,C=P&&P.prototype,M=s.Uint8ClampedArray,I=M&&M.prototype,k=P&&y(P),O=C&&y(C),B=Object.prototype,L=s.TypeError,$=x("toStringTag"),j=E("TYPED_ARRAY_TAG"),U="TypedArrayConstructor",G=i&&!!b&&c(s.opera)!=="Opera",it=!1,X,ct,Y,q={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},J={BigInt64Array:8,BigUint64Array:8},dt=function(K){if(!l(K))return!1;var lt=c(K);return lt==="DataView"||h(q,lt)||h(J,lt)},gt=function(V){var K=y(V);if(l(K)){var lt=A(K);return lt&&h(lt,U)?lt[U]:gt(K)}},N=function(V){if(!l(V))return!1;var K=c(V);return h(q,K)||h(J,K)},R=function(V){if(N(V))return V;throw new L("Target is not a typed array")},F=function(V){if(o(V)&&(!b||m(k,V)))return V;throw new L(d(V)+" is not a typed array constructor")},H=function(V,K,lt,Ct){if(r){if(lt)for(var Et in q){var bt=s[Et];if(bt&&h(bt.prototype,V))try{delete bt.prototype[V]}catch{try{bt.prototype[V]=K}catch{}}}(!O[V]||lt)&&f(O,V,lt?K:G&&C[V]||K,Ct)}},tt=function(V,K,lt){var Ct,Et;if(r){if(b){if(lt){for(Ct in q)if(Et=s[Ct],Et&&h(Et,V))try{delete Et[V]}catch{}}if(!k[V]||lt)try{return f(k,V,lt?K:G&&k[V]||K)}catch{}else return}for(Ct in q)Et=s[Ct],Et&&(!Et[V]||lt)&&f(Et,V,K)}};for(X in q)ct=s[X],Y=ct&&ct.prototype,Y?T(Y)[U]=ct:G=!1;for(X in J)ct=s[X],Y=ct&&ct.prototype,Y&&(T(Y)[U]=ct);if((!G||!o(k)||k===Function.prototype)&&(k=function(){throw new L("Incorrect invocation")},G))for(X in q)s[X]&&b(s[X],k);if((!G||!O||O===B)&&(O=k.prototype,G))for(X in q)s[X]&&b(s[X].prototype,O);if(G&&y(I)!==O&&b(I,O),r&&!h(O,$)){it=!0,g(O,$,{configurable:!0,get:function(){return l(this)?this[j]:void 0}});for(X in q)s[X]&&u(s[X].prototype,j,X)}n.exports={NATIVE_ARRAY_BUFFER_VIEWS:G,TYPED_ARRAY_TAG:it&&j,aTypedArray:R,aTypedArrayConstructor:F,exportTypedArrayMethod:H,exportTypedArrayStaticMethod:tt,getTypedArrayConstructor:gt,isView:dt,isTypedArray:N,TypedArray:k,TypedArrayPrototype:O}},5370(n,t,e){var i=e(6198);n.exports=function(r,s,o){for(var l=0,h=arguments.length>2?o:i(s),c=new r(h);h>l;)c[l]=s[l++];return c}},9617(n,t,e){var i=e(5397),r=e(5610),s=e(6198),o=function(l){return function(h,c,d){var u=i(h),f=s(u);if(f===0)return!l&&-1;var g=r(d,f),m;if(l&&c!==c){for(;f>g;)if(m=u[g++],m!==m)return!0}else for(;f>g;g++)if((l||g in u)&&u[g]===c)return l||g||0;return!l&&-1}};n.exports={includes:o(!0),indexOf:o(!1)}},4527(n,t,e){var i=e(3724),r=e(4376),s=TypeError,o=Object.getOwnPropertyDescriptor;n.exports=i&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(l){return l instanceof TypeError}})()?function(l,h){if(r(l)&&!o(l,"length").writable)throw new s("Cannot set read only .length");return l.length=h}:function(l,h){return l.length=h}},7680(n,t,e){n.exports=e(9504)([].slice)},2804(n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=t+"+/",i=t+"-_",r=function(s){for(var o={},l=0;l<64;l++)o[s.charAt(l)]=l;return o};n.exports={i2c:e,c2i:r(e),i2cUrl:i,c2iUrl:r(i)}},6319(n,t,e){var i=e(8551),r=e(9539);n.exports=function(s,o,l,h){try{return h?o(i(l)[0],l[1]):o(l)}catch(c){r(s,"throw",c)}}},2195(n,t,e){var i=e(9504),r=i({}.toString),s=i("".slice);n.exports=function(o){return s(r(o),8,-1)}},6955(n,t,e){var i=e(2140),r=e(4901),s=e(2195),o=e(8227)("toStringTag"),l=Object,h=s((function(){return arguments})())==="Arguments",c=function(d,u){try{return d[u]}catch{}};n.exports=i?s:function(d){var u,f,g;return d===void 0?"Undefined":d===null?"Null":typeof(f=c(u=l(d),o))=="string"?f:h?s(u):(g=s(u))==="Object"&&r(u.callee)?"Arguments":g}},7740(n,t,e){var i=e(9297),r=e(5031),s=e(7347),o=e(4913);n.exports=function(l,h,c){for(var d=r(h),u=o.f,f=s.f,g=0;g<d.length;g++){var m=d[g];!i(l,m)&&!(c&&i(c,m))&&u(l,m,f(h,m))}}},2211(n,t,e){n.exports=!e(9039)(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})},2529(n){n.exports=function(t,e){return{value:t,done:e}}},6699(n,t,e){var i=e(3724),r=e(4913),s=e(6980);n.exports=i?function(o,l,h){return r.f(o,l,s(1,h))}:function(o,l,h){return o[l]=h,o}},6980(n){n.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}},4659(n,t,e){var i=e(3724),r=e(4913),s=e(6980);n.exports=function(o,l,h){i?r.f(o,l,s(0,h)):o[l]=h}},2106(n,t,e){var i=e(283),r=e(4913);n.exports=function(s,o,l){return l.get&&i(l.get,o,{getter:!0}),l.set&&i(l.set,o,{setter:!0}),r.f(s,o,l)}},6840(n,t,e){var i=e(4901),r=e(4913),s=e(283),o=e(9433);n.exports=function(l,h,c,d){d||(d={});var u=d.enumerable,f=d.name!==void 0?d.name:h;if(i(c)&&s(c,f,d),d.global)u?l[h]=c:o(h,c);else{try{d.unsafe?l[h]&&(u=!0):delete l[h]}catch{}u?l[h]=c:r.f(l,h,{value:c,enumerable:!1,configurable:!d.nonConfigurable,writable:!d.nonWritable})}return l}},6279(n,t,e){var i=e(6840);n.exports=function(r,s,o){for(var l in s)i(r,l,s[l],o);return r}},9433(n,t,e){var i=e(4576),r=Object.defineProperty;n.exports=function(s,o){try{r(i,s,{value:o,configurable:!0,writable:!0})}catch{i[s]=o}return o}},3724(n,t,e){n.exports=!e(9039)(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483(n,t,e){var i=e(4576),r=e(9429),s=e(1548),o=i.structuredClone,l=i.ArrayBuffer,h=i.MessageChannel,c=!1,d,u,f,g;if(s)c=function(m){o(m,{transfer:[m]})};else if(l)try{h||(d=r("worker_threads"),d&&(h=d.MessageChannel)),h&&(u=new h,f=new l(2),g=function(m){u.port1.postMessage(null,[m])},f.byteLength===2&&(g(f),f.byteLength===0&&(c=g)))}catch{}n.exports=c},4055(n,t,e){var i=e(4576),r=e(34),s=i.document,o=r(s)&&r(s.createElement);n.exports=function(l){return o?s.createElement(l):{}}},6837(n){var t=TypeError,e=9007199254740991;n.exports=function(i){if(i>e)throw new t("Maximum allowed index exceeded");return i}},5002(n){n.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727(n){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(n,t,e){n.exports=e(4215)==="NODE"},2839(n,t,e){var i=e(4576).navigator,r=i&&i.userAgent;n.exports=r?String(r):""},9519(n,t,e){var i=e(4576),r=e(2839),s=i.process,o=i.Deno,l=s&&s.versions||o&&o.version,h=l&&l.v8,c,d;h&&(c=h.split("."),d=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!d&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(d=+c[1]))),n.exports=d},4215(n,t,e){var i=e(4576),r=e(2839),s=e(2195),o=function(l){return r.slice(0,l.length)===l};n.exports=(function(){return o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":i.Bun&&typeof Bun.version=="string"?"BUN":i.Deno&&typeof Deno.version=="object"?"DENO":s(i.process)==="process"?"NODE":i.window&&i.document?"BROWSER":"REST"})()},8574(n,t,e){var i=e(9504),r=Error,s=i("".replace),o=(function(c){return String(new r(c).stack)})("zxcasd"),l=/\n\s*at [^:]*:[^\n]*/,h=l.test(o);n.exports=function(c,d){if(h&&typeof c=="string"&&!r.prepareStackTrace)for(;d--;)c=s(c,l,"");return c}},6518(n,t,e){var i=e(4576),r=e(7347).f,s=e(6699),o=e(6840),l=e(9433),h=e(7740),c=e(2796);n.exports=function(d,u){var f=d.target,g=d.global,m=d.stat,y,b,x,E,S,T;if(g?b=i:m?b=i[f]||l(f,{}):b=i[f]&&i[f].prototype,b)for(x in u){if(S=u[x],d.dontCallGetSet?(T=r(b,x),E=T&&T.value):E=b[x],y=c(g?x:f+(m?".":"#")+x,d.forced),!y&&E!==void 0){if(typeof S==typeof E)continue;h(S,E)}(d.sham||E&&E.sham)&&s(S,"sham",!0),o(b,x,S,d)}}},9039(n){n.exports=function(t){try{return!!t()}catch{return!0}}},8745(n,t,e){var i=e(616),r=Function.prototype,s=r.apply,o=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},6080(n,t,e){var i=e(7476),r=e(9306),s=e(616),o=i(i.bind);n.exports=function(l,h){return r(l),h===void 0?l:s?o(l,h):function(){return l.apply(h,arguments)}}},616(n,t,e){n.exports=!e(9039)(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")})},9565(n,t,e){var i=e(616),r=Function.prototype.call;n.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},350(n,t,e){var i=e(3724),r=e(9297),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,l=r(s,"name");n.exports={EXISTS:l,PROPER:l&&function(){}.name==="something",CONFIGURABLE:l&&(!i||i&&o(s,"name").configurable)}},6706(n,t,e){var i=e(9504),r=e(9306);n.exports=function(s,o,l){try{return i(r(Object.getOwnPropertyDescriptor(s,o)[l]))}catch{}}},7476(n,t,e){var i=e(2195),r=e(9504);n.exports=function(s){if(i(s)==="Function")return r(s)}},9504(n,t,e){var i=e(616),r=Function.prototype,s=r.call,o=i&&r.bind.bind(s,s);n.exports=i?o:function(l){return function(){return s.apply(l,arguments)}}},944(n){var t=TypeError;n.exports=function(e){var i=e&&e.alphabet;if(i===void 0||i==="base64"||i==="base64url")return i||"base64";throw new t("Incorrect `alphabet` option")}},9429(n,t,e){var i=e(4576),r=e(6193);n.exports=function(s){if(r){try{return i.process.getBuiltinModule(s)}catch{}try{return Function('return require("'+s+'")')()}catch{}}}},7751(n,t,e){var i=e(4576),r=e(4901),s=function(o){return r(o)?o:void 0};n.exports=function(o,l){return arguments.length<2?s(i[o]):i[o]&&i[o][l]}},1767(n){n.exports=function(t){return{iterator:t,next:t.next,done:!1}}},8646(n,t,e){var i=e(9565),r=e(8551),s=e(1767),o=e(851);n.exports=function(l,h){(!h||typeof l!="string")&&r(l);var c=o(l);return s(r(c!==void 0?i(c,l):l))}},851(n,t,e){var i=e(6955),r=e(5966),s=e(4117),o=e(6269),l=e(8227)("iterator");n.exports=function(h){if(!s(h))return r(h,l)||r(h,"@@iterator")||o[i(h)]}},81(n,t,e){var i=e(9565),r=e(9306),s=e(8551),o=e(6823),l=e(851),h=TypeError;n.exports=function(c,d){var u=arguments.length<2?l(c):d;if(r(u))return s(i(u,c));throw new h(o(c)+" is not iterable")}},5966(n,t,e){var i=e(9306),r=e(4117);n.exports=function(s,o){var l=s[o];return r(l)?void 0:i(l)}},3789(n,t,e){var i=e(9306),r=e(8551),s=e(9565),o=e(1291),l=e(1767),h="Invalid size",c=RangeError,d=TypeError,u=Math.max,f=function(g,m){this.set=g,this.size=u(m,0),this.has=i(g.has),this.keys=i(g.keys)};f.prototype={getIterator:function(){return l(r(s(this.keys,this.set)))},includes:function(g){return s(this.has,this.set,g)}},n.exports=function(g){r(g);var m=+g.size;if(m!==m)throw new d(h);var y=o(m);if(y<0)throw new c(h);return new f(g,y)}},4576(n){var t=function(e){return e&&e.Math===Math&&e};n.exports=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof global=="object"&&global)||t(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()},9297(n,t,e){var i=e(9504),r=e(8981),s=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,h){return s(r(l),h)}},421(n){n.exports={}},397(n,t,e){n.exports=e(7751)("document","documentElement")},5917(n,t,e){var i=e(3724),r=e(9039),s=e(4055);n.exports=!i&&!r(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!==7})},7055(n,t,e){var i=e(9504),r=e(9039),s=e(2195),o=Object,l=i("".split);n.exports=r(function(){return!o("z").propertyIsEnumerable(0)})?function(h){return s(h)==="String"?l(h,""):o(h)}:o},3167(n,t,e){var i=e(4901),r=e(34),s=e(2967);n.exports=function(o,l,h){var c,d;return s&&i(c=l.constructor)&&c!==h&&r(d=c.prototype)&&d!==h.prototype&&s(o,d),o}},3706(n,t,e){var i=e(9504),r=e(4901),s=e(7629),o=i(Function.toString);r(s.inspectSource)||(s.inspectSource=function(l){return o(l)}),n.exports=s.inspectSource},1181(n,t,e){var i=e(8622),r=e(4576),s=e(34),o=e(6699),l=e(9297),h=e(7629),c=e(6119),d=e(421),u="Object already initialized",f=r.TypeError,g=r.WeakMap,m,y,b,x=function(A){return b(A)?y(A):m(A,{})},E=function(A){return function(P){var C;if(!s(P)||(C=y(P)).type!==A)throw new f("Incompatible receiver, "+A+" required");return C}};if(i||h.state){var S=h.state||(h.state=new g);S.get=S.get,S.has=S.has,S.set=S.set,m=function(A,P){if(S.has(A))throw new f(u);return P.facade=A,S.set(A,P),P},y=function(A){return S.get(A)||{}},b=function(A){return S.has(A)}}else{var T=c("state");d[T]=!0,m=function(A,P){if(l(A,T))throw new f(u);return P.facade=A,o(A,T,P),P},y=function(A){return l(A,T)?A[T]:{}},b=function(A){return l(A,T)}}n.exports={set:m,get:y,has:b,enforce:x,getterFor:E}},4209(n,t,e){var i=e(8227),r=e(6269),s=i("iterator"),o=Array.prototype;n.exports=function(l){return l!==void 0&&(r.Array===l||o[s]===l)}},4376(n,t,e){var i=e(2195);n.exports=Array.isArray||function(s){return i(s)==="Array"}},1108(n,t,e){var i=e(6955);n.exports=function(r){var s=i(r);return s==="BigInt64Array"||s==="BigUint64Array"}},4901(n){var t=typeof document=="object"&&document.all;n.exports=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"}},2796(n,t,e){var i=e(9039),r=e(4901),s=/#|\.prototype\./,o=function(u,f){var g=h[l(u)];return g===d?!0:g===c?!1:r(f)?i(f):!!f},l=o.normalize=function(u){return String(u).replace(s,".").toLowerCase()},h=o.data={},c=o.NATIVE="N",d=o.POLYFILL="P";n.exports=o},4117(n){n.exports=function(t){return t==null}},34(n,t,e){var i=e(4901);n.exports=function(r){return typeof r=="object"?r!==null:i(r)}},3925(n,t,e){var i=e(34);n.exports=function(r){return i(r)||r===null}},6395(n){n.exports=!1},5810(n,t,e){var i=e(34),r=e(1181).get;n.exports=function(o){if(!i(o))return!1;var l=r(o);return!!l&&l.type==="RawJSON"}},757(n,t,e){var i=e(7751),r=e(4901),s=e(1625),o=e(7040),l=Object;n.exports=o?function(h){return typeof h=="symbol"}:function(h){var c=i("Symbol");return r(c)&&s(c.prototype,l(h))}},507(n,t,e){var i=e(9565);n.exports=function(r,s,o){for(var l=o?r:r.iterator,h=r.next,c,d;!(c=i(h,l)).done;)if(d=s(c.value),d!==void 0)return d}},2652(n,t,e){var i=e(6080),r=e(9565),s=e(8551),o=e(6823),l=e(4209),h=e(6198),c=e(1625),d=e(81),u=e(851),f=e(9539),g=TypeError,m=function(b,x){this.stopped=b,this.result=x},y=m.prototype;n.exports=function(b,x,E){var S=E&&E.that,T=!!(E&&E.AS_ENTRIES),A=!!(E&&E.IS_RECORD),P=!!(E&&E.IS_ITERATOR),C=!!(E&&E.INTERRUPTED),M=i(x,S),I,k,O,B,L,$,j,U=function(X){var ct=I;return I=void 0,ct&&f(ct,"normal"),new m(!0,X)},G=function(X){return T?(s(X),C?M(X[0],X[1],U):M(X[0],X[1])):C?M(X,U):M(X)};if(A)I=b.iterator;else if(P)I=b;else{if(k=u(b),!k)throw new g(o(b)+" is not iterable");if(l(k)){for(O=0,B=h(b);B>O;O++)if(L=G(b[O]),L&&c(y,L))return L;return new m(!1)}I=d(b,k)}for($=A?b.next:I.next;!(j=r($,I)).done;){var it=j.value;try{L=G(it)}catch(X){if(I)f(I,"throw",X);else throw X}if(typeof L=="object"&&L&&c(y,L))return L}return new m(!1)}},1385(n,t,e){var i=e(9539);n.exports=function(r,s,o){for(var l=r.length-1;l>=0;l--)if(r[l]!==void 0)try{o=i(r[l].iterator,s,o)}catch(h){s="throw",o=h}if(s==="throw")throw o;return o}},9539(n,t,e){var i=e(9565),r=e(8551),s=e(5966);n.exports=function(o,l,h){var c,d;r(o);try{if(c=s(o,"return"),!c){if(l==="throw")throw h;return h}c=i(c,o)}catch(u){d=!0,c=u}if(l==="throw")throw h;if(d)throw c;return r(c),h}},9462(n,t,e){var i=e(9565),r=e(2360),s=e(6699),o=e(6279),l=e(8227),h=e(1181),c=e(5966),d=e(7657).IteratorPrototype,u=e(2529),f=e(9539),g=e(1385),m=l("toStringTag"),y="IteratorHelper",b="WrapForValidIterator",x="normal",E="throw",S=h.set,T=function(C){var M=h.getterFor(C?b:y);return o(r(d),{next:function(){var k=M(this);if(C)return k.nextHandler();if(k.done)return u(void 0,!0);try{var O=k.nextHandler();return k.returnHandlerResult?O:u(O,k.done)}catch(B){throw k.done=!0,B}},return:function(){var I=M(this),k=I.iterator,O=I.done;if(I.done=!0,C){var B=c(k,"return");return B?i(B,k):u(void 0,!0)}if(O)return u(void 0,!0);if(I.inner)try{f(I.inner.iterator,x)}catch(L){return f(k,E,L)}if(I.openIters)try{g(I.openIters,x)}catch(L){if(k)return f(k,E,L);throw L}return k&&f(k,x),u(void 0,!0)}})},A=T(!0),P=T(!1);s(P,m,"Iterator Helper"),n.exports=function(C,M,I){var k=function(B,L){L?(L.iterator=B.iterator,L.next=B.next):L=B,L.type=M?b:y,L.returnHandlerResult=!!I,L.nextHandler=C,L.counter=0,L.done=!1,S(this,L)};return k.prototype=M?A:P,k}},684(n){n.exports=function(t,e){var i=typeof Iterator=="function"&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch{return!0}}},4549(n,t,e){var i=e(4576);n.exports=function(r,s){var o=i.Iterator,l=o&&o.prototype,h=l&&l[r],c=!1;if(h)try{h.call({next:function(){return{done:!0}},return:function(){c=!0}},-1)}catch(d){d instanceof s||(c=!1)}if(!c)return h}},7657(n,t,e){var i=e(9039),r=e(4901),s=e(34),o=e(2360),l=e(2787),h=e(6840),c=e(8227),d=e(6395),u=c("iterator"),f=!1,g,m,y;[].keys&&(y=[].keys(),"next"in y?(m=l(l(y)),m!==Object.prototype&&(g=m)):f=!0),!s(g)||i(function(){var b={};return g[u].call(b)!==b})?g={}:d&&(g=o(g)),r(g[u])||h(g,u,function(){return this}),n.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:f}},6269(n){n.exports={}},6198(n,t,e){var i=e(8014);n.exports=function(r){return i(r.length)}},283(n,t,e){var i=e(9504),r=e(9039),s=e(4901),o=e(9297),l=e(3724),h=e(350).CONFIGURABLE,c=e(3706),d=e(1181),u=d.enforce,f=d.get,g=String,m=Object.defineProperty,y=i("".slice),b=i("".replace),x=i([].join),E=l&&!r(function(){return m(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),T=n.exports=function(A,P,C){y(g(P),0,7)==="Symbol("&&(P="["+b(g(P),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),C&&C.getter&&(P="get "+P),C&&C.setter&&(P="set "+P),(!o(A,"name")||h&&A.name!==P)&&(l?m(A,"name",{value:P,configurable:!0}):A.name=P),E&&C&&o(C,"arity")&&A.length!==C.arity&&m(A,"length",{value:C.arity});try{C&&o(C,"constructor")&&C.constructor?l&&m(A,"prototype",{writable:!1}):A.prototype&&(A.prototype=void 0)}catch{}var M=u(A);return o(M,"source")||(M.source=x(S,typeof P=="string"?P:"")),A};Function.prototype.toString=T(function(){return s(this)&&f(this).source||c(this)},"toString")},2248(n,t,e){var i=e(9504),r=Map.prototype;n.exports={Map,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete),proto:r}},741(n){var t=Math.ceil,e=Math.floor;n.exports=Math.trunc||function(r){var s=+r;return(s>0?e:t)(s)}},7819(n,t,e){n.exports=!e(9039)(function(){var i="9007199254740993",r=JSON.rawJSON(i);return!JSON.isRawJSON(r)||JSON.stringify(r)!==i})},6043(n,t,e){var i=e(9306),r=TypeError,s=function(o){var l,h;this.promise=new o(function(c,d){if(l!==void 0||h!==void 0)throw new r("Bad Promise constructor");l=c,h=d}),this.resolve=i(l),this.reject=i(h)};n.exports.f=function(o){return new s(o)}},2603(n,t,e){var i=e(655);n.exports=function(r,s){return r===void 0?arguments.length<2?"":s:i(r)}},4149(n){var t=RangeError;n.exports=function(e){if(e===e)return e;throw new t("NaN is not allowed")}},2360(n,t,e){var i=e(8551),r=e(6801),s=e(8727),o=e(421),l=e(397),h=e(4055),c=e(6119),d=">",u="<",f="prototype",g="script",m=c("IE_PROTO"),y=function(){},b=function(A){return u+g+d+A+u+"/"+g+d},x=function(A){A.write(b("")),A.close();var P=A.parentWindow.Object;return A=null,P},E=function(){var A=h("iframe"),P="java"+g+":",C;return A.style.display="none",l.appendChild(A),A.src=String(P),C=A.contentWindow.document,C.open(),C.write(b("document.F=Object")),C.close(),C.F},S,T=function(){try{S=new ActiveXObject("htmlfile")}catch{}T=typeof document<"u"?document.domain&&S?x(S):E():x(S);for(var A=s.length;A--;)delete T[f][s[A]];return T()};o[m]=!0,n.exports=Object.create||function(P,C){var M;return P!==null?(y[f]=i(P),M=new y,y[f]=null,M[m]=P):M=T(),C===void 0?M:r.f(M,C)}},6801(n,t,e){var i=e(3724),r=e(8686),s=e(4913),o=e(8551),l=e(5397),h=e(1072);t.f=i&&!r?Object.defineProperties:function(d,u){o(d);for(var f=l(u),g=h(u),m=g.length,y=0,b;m>y;)s.f(d,b=g[y++],f[b]);return d}},4913(n,t,e){var i=e(3724),r=e(5917),s=e(8686),o=e(8551),l=e(6969),h=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u="enumerable",f="configurable",g="writable";t.f=i?s?function(y,b,x){if(o(y),b=l(b),o(x),typeof y=="function"&&b==="prototype"&&"value"in x&&g in x&&!x[g]){var E=d(y,b);E&&E[g]&&(y[b]=x.value,x={configurable:f in x?x[f]:E[f],enumerable:u in x?x[u]:E[u],writable:!1})}return c(y,b,x)}:c:function(y,b,x){if(o(y),b=l(b),o(x),r)try{return c(y,b,x)}catch{}if("get"in x||"set"in x)throw new h("Accessors not supported");return"value"in x&&(y[b]=x.value),y}},7347(n,t,e){var i=e(3724),r=e(9565),s=e(8773),o=e(6980),l=e(5397),h=e(6969),c=e(9297),d=e(5917),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(g,m){if(g=l(g),m=h(m),d)try{return u(g,m)}catch{}if(c(g,m))return o(!r(s.f,g,m),g[m])}},8480(n,t,e){var i=e(1828),r=e(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(o){return i(o,r)}},3717(n,t){t.f=Object.getOwnPropertySymbols},2787(n,t,e){var i=e(9297),r=e(4901),s=e(8981),o=e(6119),l=e(2211),h=o("IE_PROTO"),c=Object,d=c.prototype;n.exports=l?c.getPrototypeOf:function(u){var f=s(u);if(i(f,h))return f[h];var g=f.constructor;return r(g)&&f instanceof g?g.prototype:f instanceof c?d:null}},1625(n,t,e){n.exports=e(9504)({}.isPrototypeOf)},1828(n,t,e){var i=e(9504),r=e(9297),s=e(5397),o=e(9617).indexOf,l=e(421),h=i([].push);n.exports=function(c,d){var u=s(c),f=0,g=[],m;for(m in u)!r(l,m)&&r(u,m)&&h(g,m);for(;d.length>f;)r(u,m=d[f++])&&(~o(g,m)||h(g,m));return g}},1072(n,t,e){var i=e(1828),r=e(8727);n.exports=Object.keys||function(o){return i(o,r)}},8773(n,t){var e={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor;t.f=i&&!e.call({1:2},1)?function(s){var o=i(this,s);return!!o&&o.enumerable}:e},2967(n,t,e){var i=e(6706),r=e(34),s=e(7750),o=e(3506);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l=!1,h={},c;try{c=i(Object.prototype,"__proto__","set"),c(h,[]),l=h instanceof Array}catch{}return function(u,f){return s(u),o(f),r(u)&&(l?c(u,f):u.__proto__=f),u}})():void 0)},4270(n,t,e){var i=e(9565),r=e(4901),s=e(34),o=TypeError;n.exports=function(l,h){var c,d;if(h==="string"&&r(c=l.toString)&&!s(d=i(c,l))||r(c=l.valueOf)&&!s(d=i(c,l))||h!=="string"&&r(c=l.toString)&&!s(d=i(c,l)))return d;throw new o("Can't convert object to primitive value")}},5031(n,t,e){var i=e(7751),r=e(9504),s=e(8480),o=e(3717),l=e(8551),h=r([].concat);n.exports=i("Reflect","ownKeys")||function(d){var u=s.f(l(d)),f=o.f;return f?h(u,f(d)):u}},8235(n,t,e){var i=e(9504),r=e(9297),s=SyntaxError,o=parseInt,l=String.fromCharCode,h=i("".charAt),c=i("".slice),d=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
39
+ `,"\\r":"\r","\\t":" "},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;n.exports=function(m,y){for(var b=!0,x="";y<m.length;){var E=h(m,y);if(E==="\\"){var S=c(m,y,y+2);if(r(u,S))x+=u[S],y+=2;else if(S==="\\u"){y+=2;var T=c(m,y,y+4);if(!d(f,T))throw new s("Bad Unicode escape at: "+y);x+=l(o(T,16)),y+=4}else throw new s('Unknown escape sequence: "'+S+'"')}else if(E==='"'){b=!1,y++;break}else{if(d(g,E))throw new s("Bad control character in string literal at: "+y);x+=E,y++}}if(b)throw new s("Unterminated string at: "+y);return{value:x,end:y}}},1103(n){n.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},7750(n,t,e){var i=e(4117),r=TypeError;n.exports=function(s){if(i(s))throw new r("Can't call method on "+s);return s}},9286(n,t,e){var i=e(4402),r=e(8469),s=i.Set,o=i.add;n.exports=function(l){var h=new s;return r(l,function(c){o(h,c)}),h}},3440(n,t,e){var i=e(7080),r=e(4402),s=e(9286),o=e(5170),l=e(3789),h=e(8469),c=e(507),d=r.has,u=r.remove;n.exports=function(g){var m=i(this),y=l(g),b=s(m);return o(b)<=y.size?h(b,function(x){y.includes(x)&&u(b,x)}):c(y.getIterator(),function(x){d(b,x)&&u(b,x)}),b}},4402(n,t,e){var i=e(9504),r=Set.prototype;n.exports={Set,add:i(r.add),has:i(r.has),remove:i(r.delete),proto:r}},8750(n,t,e){var i=e(7080),r=e(4402),s=e(5170),o=e(3789),l=e(8469),h=e(507),c=r.Set,d=r.add,u=r.has;n.exports=function(g){var m=i(this),y=o(g),b=new c;return s(m)>y.size?h(y.getIterator(),function(x){u(m,x)&&d(b,x)}):l(m,function(x){y.includes(x)&&d(b,x)}),b}},4449(n,t,e){var i=e(7080),r=e(4402).has,s=e(5170),o=e(3789),l=e(8469),h=e(507),c=e(9539);n.exports=function(u){var f=i(this),g=o(u);if(s(f)<=g.size)return l(f,function(y){if(g.includes(y))return!1},!0)!==!1;var m=g.getIterator();return h(m,function(y){if(r(f,y))return c(m.iterator,"normal",!1)})!==!1}},3838(n,t,e){var i=e(7080),r=e(5170),s=e(8469),o=e(3789);n.exports=function(h){var c=i(this),d=o(h);return r(c)>d.size?!1:s(c,function(u){if(!d.includes(u))return!1},!0)!==!1}},8527(n,t,e){var i=e(7080),r=e(4402).has,s=e(5170),o=e(3789),l=e(507),h=e(9539);n.exports=function(d){var u=i(this),f=o(d);if(s(u)<f.size)return!1;var g=f.getIterator();return l(g,function(m){if(!r(u,m))return h(g.iterator,"normal",!1)})!==!1}},8469(n,t,e){var i=e(9504),r=e(507),s=e(4402),o=s.Set,l=s.proto,h=i(l.forEach),c=i(l.keys),d=c(new o).next;n.exports=function(u,f,g){return g?r({iterator:c(u),next:d},f):h(u,f)}},4916(n,t,e){var i=e(7751),r=function(o){return{size:o,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(o){return{size:o,has:function(){return!0},keys:function(){throw new Error("e")}}};n.exports=function(o,l){var h=i("Set");try{new h()[o](r(0));try{return new h()[o](r(-1)),!1}catch{if(!l)return!0;try{return new h()[o](s(-1/0)),!1}catch{return l(new h([1,2])[o](s(1/0)))}}}catch{return!1}}},9835(n){n.exports=function(t){try{var e=new Set,i=e[t]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}});return i.size===1&&i.values().next().value===4}catch{return!1}}},5170(n,t,e){n.exports=e(6706)(e(4402).proto,"size","get")||function(i){return i.size}},3650(n,t,e){var i=e(7080),r=e(4402),s=e(9286),o=e(3789),l=e(507),h=r.add,c=r.has,d=r.remove;n.exports=function(f){var g=i(this),m=o(f).getIterator(),y=s(g);return l(m,function(b){c(g,b)?d(y,b):h(y,b)}),y}},4204(n,t,e){var i=e(7080),r=e(4402).add,s=e(9286),o=e(3789),l=e(507);n.exports=function(c){var d=i(this),u=o(c).getIterator(),f=s(d);return l(u,function(g){r(f,g)}),f}},6119(n,t,e){var i=e(5745),r=e(3392),s=i("keys");n.exports=function(o){return s[o]||(s[o]=r(o))}},7629(n,t,e){var i=e(6395),r=e(4576),s=e(9433),o="__core-js_shared__",l=n.exports=r[o]||s(o,{});(l.versions||(l.versions=[])).push({version:"3.49.0",mode:i?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(n,t,e){var i=e(7629);n.exports=function(r,s){return i[r]||(i[r]=s||{})}},1548(n,t,e){var i=e(4576),r=e(9039),s=e(9519),o=e(4215),l=i.structuredClone;n.exports=!!l&&!r(function(){if(o==="DENO"&&s>92||o==="NODE"&&s>94||o==="BROWSER"&&s>97)return!1;var h=new ArrayBuffer(8),c=l(h,{transfer:[h]});return h.byteLength!==0||c.byteLength!==8})},4495(n,t,e){var i=e(9519),r=e(9039),s=e(4576).String;n.exports=!!Object.getOwnPropertySymbols&&!r(function(){var o=Symbol("symbol detection");return!s(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&i&&i<41})},5610(n,t,e){var i=e(1291),r=Math.max,s=Math.min;n.exports=function(o,l){var h=i(o);return h<0?r(h+l,0):s(h,l)}},5854(n,t,e){var i=e(2777),r=TypeError;n.exports=function(s){var o=i(s,"number");if(typeof o=="number")throw new r("Can't convert number to bigint");return BigInt(o)}},7696(n,t,e){var i=e(1291),r=e(8014),s=RangeError;n.exports=function(o){if(o===void 0)return 0;var l=i(o),h=r(l);if(l!==h)throw new s("Wrong length or index");return h}},5397(n,t,e){var i=e(7055),r=e(7750);n.exports=function(s){return i(r(s))}},1291(n,t,e){var i=e(741);n.exports=function(r){var s=+r;return s!==s||s===0?0:i(s)}},8014(n,t,e){var i=e(1291),r=Math.min;n.exports=function(s){var o=i(s);return o>0?r(o,9007199254740991):0}},8981(n,t,e){var i=e(7750),r=Object;n.exports=function(s){return r(i(s))}},9590(n,t,e){var i=e(1291),r=RangeError;n.exports=function(s){var o=i(s);if(o<0)throw new r("The argument can't be less than 0");return o}},2777(n,t,e){var i=e(9565),r=e(34),s=e(757),o=e(5966),l=e(4270),h=e(8227),c=TypeError,d=h("toPrimitive");n.exports=function(u,f){if(!r(u)||s(u))return u;var g=o(u,d),m;if(g){if(f===void 0&&(f="default"),m=i(g,u,f),!r(m)||s(m))return m;throw new c("Can't convert object to primitive value")}return f===void 0&&(f="number"),l(u,f)}},6969(n,t,e){var i=e(2777),r=e(757);n.exports=function(s){var o=i(s,"string");return r(o)?o:o+""}},2140(n,t,e){var i=e(8227)("toStringTag"),r={};r[i]="z",n.exports=String(r)==="[object z]"},655(n,t,e){var i=e(6955),r=String;n.exports=function(s){if(i(s)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(s)}},6823(n){var t=String;n.exports=function(e){try{return t(e)}catch{return"Object"}}},3392(n,t,e){var i=e(9504),r=0,s=Math.random(),o=i(1.1.toString);n.exports=function(l){return"Symbol("+(l===void 0?"":l)+")_"+o(++r+s,36)}},9143(n,t,e){var i=e(4576),r=e(9504),s=e(3972),o=e(3463),l=e(9297),h=e(2804),c=e(944),d=e(5169),u=h.c2i,f=h.c2iUrl,g=i.SyntaxError,m=i.TypeError,y=r("".charAt),b=function(S,T){for(var A=S.length;T<A;T++){var P=y(S,T);if(P!==" "&&P!==" "&&P!==`
40
+ `&&P!=="\f"&&P!=="\r")break}return T},x=function(S,T,A){var P=S.length;P<4&&(S+=P===2?"AA":"A");var C=(T[y(S,0)]<<18)+(T[y(S,1)]<<12)+(T[y(S,2)]<<6)+T[y(S,3)],M=[C>>16&255,C>>8&255,C&255];if(P===2){if(A&&M[1]!==0)throw new g("Extra bits");return[M[0]]}if(P===3){if(A&&M[2]!==0)throw new g("Extra bits");return[M[0],M[1]]}return M},E=function(S,T,A){for(var P=T.length,C=0;C<P;C++)S[A+C]=T[C];return A+P};n.exports=function(S,T,A,P){o(S),s(T);var C=c(T)==="base64"?u:f,M=T?T.lastChunkHandling:void 0;if(M===void 0&&(M="loose"),M!=="loose"&&M!=="strict"&&M!=="stop-before-partial")throw new m("Incorrect `lastChunkHandling` option");A&&d(A.buffer);var I=S.length,k=A||[],O=0,B=0,L="",$=0;if(P)for(;;){if($=b(S,$),$===I){if(L.length>0){if(M==="stop-before-partial")break;if(M==="loose"){if(L.length===1)throw new g("Malformed padding: exactly one additional character");O=E(k,x(L,C,!1),O)}else throw new g("Missing padding")}B=I;break}var j=y(S,$);if(++$,j==="="){if(L.length<2)throw new g("Padding is too early");if($=b(S,$),L.length===2){if($===I){if(M==="stop-before-partial")break;throw new g("Malformed padding: only one =")}y(S,$)==="="&&(++$,$=b(S,$))}if($<I)throw new g("Unexpected character after padding");O=E(k,x(L,C,M==="strict"),O),B=I;break}if(!l(C,j))throw new g("Unexpected character");var U=P-O;if(U===1&&L.length===2||U===2&&L.length===3||(L+=j,L.length===4&&(O=E(k,x(L,C,!1),O),L="",B=$,O===P)))break}return{bytes:k,read:B,written:O}}},2303(n,t,e){var i=e(4576),r=e(9504),s=i.Uint8Array,o=i.SyntaxError,l=Math.min,h=r("".match);n.exports=function(c,d){var u=c.length;if(u%2!==0)throw new o("String should be an even number of characters");for(var f=d?l(d.length,u/2):u/2,g=d||new s(f),m=h(c,/.{2}/g),y=0;y<f;y++){var b=+("0x"+m[y]+"0");if(b!==b)throw new o("String should only contain hex characters");g[y]=b>>4}return{bytes:g,read:y<<1}}},7416(n,t,e){var i=e(9039),r=e(8227),s=e(3724),o=e(6395),l=r("iterator");n.exports=!i(function(){var h=new URL("b?a=1&b=2&c=3","https://a"),c=h.searchParams,d=new URLSearchParams("a=1&a=2&b=3"),u="";return h.pathname="c%20d",c.forEach(function(f,g){c.delete("b"),u+=g+f}),d.delete("a",2),d.delete("b",void 0),o&&(!h.toJSON||!d.has("a",1)||d.has("a",2)||!d.has("a",void 0)||d.has("b"))||!c.size&&(o||!s)||!c.sort||h.href!=="https://a/c%20d?a=1&c=3"||c.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!c[l]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"})},7040(n,t,e){n.exports=e(4495)&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686(n,t,e){var i=e(3724),r=e(9039);n.exports=i&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812(n){var t=TypeError;n.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},8622(n,t,e){var i=e(4576),r=e(4901),s=i.WeakMap;n.exports=r(s)&&/native code/.test(String(s))},4995(n,t,e){var i=e(9504),r=WeakMap.prototype;n.exports={WeakMap,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete)}},8227(n,t,e){var i=e(4576),r=e(5745),s=e(9297),o=e(3392),l=e(4495),h=e(7040),c=i.Symbol,d=r("wks"),u=h?c.for||c:c&&c.withoutSetter||o;n.exports=function(f){return s(d,f)||(d[f]=l&&s(c,f)?c[f]:u("Symbol."+f)),d[f]}},6573(n,t,e){var i=e(3724),r=e(2106),s=e(3238),o=ArrayBuffer.prototype;i&&!("detached"in o)&&r(o,"detached",{configurable:!0,get:function(){return s(this)}})},7936(n,t,e){var i=e(6518),r=e(5636);r&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},8100(n,t,e){var i=e(6518),r=e(5636);r&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},4423(n,t,e){var i=e(6518),r=e(9617).includes,s=e(9039),o=e(6469),l=s(function(){return!Array(1).includes()}),h=s(function(){return[,1].includes(void 0,1)});i({target:"Array",proto:!0,forced:l||h},{includes:function(d){return r(this,d,arguments.length>1?arguments[1]:void 0)}}),o("includes")},4114(n,t,e){var i=e(6518),r=e(8981),s=e(6198),o=e(4527),l=e(6837),h=e(9039)(function(){return[].push.call({length:4294967296},1)!==4294967297}),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(d){return d instanceof TypeError}};i({target:"Array",proto:!0,arity:1,forced:h||!c()},{push:function(u){var f=r(this),g=s(f),m=arguments.length;l(g+m);for(var y=0;y<m;y++)f[g]=arguments[y],g++;return o(f,g),g}})},8111(n,t,e){var i=e(6518),r=e(4576),s=e(679),o=e(8551),l=e(4901),h=e(2787),c=e(2106),d=e(4659),u=e(9039),f=e(9297),g=e(8227),m=e(7657).IteratorPrototype,y=e(3724),b=e(6395),x="constructor",E="Iterator",S=g("toStringTag"),T=TypeError,A=r[E],P=b||!l(A)||A.prototype!==m||!u(function(){A({})}),C=function(){if(s(this,m),h(this)===m)throw new T("Abstract class Iterator not directly constructable")},M=function(I,k){y?c(m,I,{configurable:!0,get:function(){return k},set:function(O){if(o(this),this===m)throw new T("You can't redefine this property");f(this,I)?this[I]=O:d(this,I,O)}}):m[I]=k};f(m,S)||M(S,E),(P||!f(m,x)||m[x]===Object)&&M(x,C),C.prototype=m,i({global:!0,constructor:!0,forced:P},{Iterator:C})},9314(n,t,e){var i=e(6518),r=e(9565),s=e(8551),o=e(1767),l=e(4149),h=e(9590),c=e(9539),d=e(9462),u=e(684),f=e(4549),g=e(6395),m=!g&&!u("drop",0),y=!g&&!m&&f("drop",RangeError),b=g||m||y,x=d(function(){for(var E=this.iterator,S=this.next,T,A;this.remaining;)if(this.remaining--,T=s(r(S,E)),A=this.done=!!T.done,A)return;if(T=s(r(S,E)),A=this.done=!!T.done,!A)return T.value});i({target:"Iterator",proto:!0,real:!0,forced:b},{drop:function(S){s(this);var T;try{T=h(l(+S))}catch(A){c(this,"throw",A)}return y?r(y,this,T):new x(o(this),{remaining:T})}})},1148(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("every",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;return!s(g,function(y,b){if(!f(y,m++))return b()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(n,t,e){var i=e(6518),r=e(9565),s=e(9306),o=e(8551),l=e(1767),h=e(9462),c=e(6319),d=e(6395),u=e(9539),f=e(684),g=e(4549),m=!d&&!f("filter",function(){}),y=!d&&!m&&g("filter",TypeError),b=d||m||y,x=h(function(){for(var E=this.iterator,S=this.predicate,T=this.next,A,P,C;;){if(A=o(r(T,E)),P=this.done=!!A.done,P)return;if(C=A.value,c(E,S,[C,this.counter++],!0))return C}});i({target:"Iterator",proto:!0,real:!0,forced:b},{filter:function(S){o(this);try{s(S)}catch(T){u(this,"throw",T)}return y?r(y,this,S):new x(l(this),{predicate:S})}})},116(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("find",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{find:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;return s(g,function(y,b){if(f(y,m++))return b(y)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},531(n,t,e){var i=e(6518),r=e(9565),s=e(9306),o=e(8551),l=e(1767),h=e(8646),c=e(9462),d=e(9539),u=e(6395),f=e(684),g=e(4549);function m(){try{var S=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(T){return T});S.next(),S.return()}catch{return!0}}var y=!u&&!f("flatMap",function(){}),b=!u&&!y&&g("flatMap",TypeError),x=u||y||b||m(),E=c(function(){for(var S=this.iterator,T=this.mapper,A,P;;){if(P=this.inner)try{if(A=o(r(P.next,P.iterator)),!A.done)return A.value;this.inner=null}catch(C){d(S,"throw",C)}if(A=o(r(this.next,S)),this.done=!!A.done)return;try{this.inner=h(T(A.value,this.counter++),!1)}catch(C){d(S,"throw",C)}}});i({target:"Iterator",proto:!0,real:!0,forced:x},{flatMap:function(T){o(this);try{s(T)}catch(A){d(this,"throw",A)}return b?r(b,this,T):new E(l(this),{mapper:T,inner:null})}})},7588(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("forEach",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;s(g,function(y){f(y,m++)},{IS_RECORD:!0})}})},1701(n,t,e){var i=e(6518),r=e(9565),s=e(9306),o=e(8551),l=e(1767),h=e(9462),c=e(6319),d=e(9539),u=e(684),f=e(4549),g=e(6395),m=!g&&!u("map",function(){}),y=!g&&!m&&f("map",TypeError),b=g||m||y,x=h(function(){var E=this.iterator,S=o(r(this.next,E));if(!(this.done=!!S.done))return c(E,this.mapper,[S.value,this.counter++],!0)});i({target:"Iterator",proto:!0,real:!0,forced:b},{map:function(S){o(this);try{s(S)}catch(T){d(this,"throw",T)}return y?r(y,this,S):new x(l(this),{mapper:S})}})},3579(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("some",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;return s(g,function(y,b){if(f(y,m++))return b()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},4972(n,t,e){var i=e(6518),r=e(9565),s=e(8551),o=e(1767),l=e(4149),h=e(9590),c=e(9462),d=e(9539),u=e(684),f=e(4549),g=e(6395),m=!g&&!u("take",1),y=!g&&!m&&f("take",RangeError),b=g||m||y,x=c(function(){var E=this.iterator;if(!this.remaining--)return this.done=!0,d(E,"normal",void 0);var S=s(r(this.next,E));if(!(this.done=!!S.done))return S.value});i({target:"Iterator",proto:!0,real:!0,forced:b},{take:function(S){s(this);var T;try{T=h(l(+S))}catch(A){d(this,"throw",A)}return y?r(y,this,T):new x(o(this),{remaining:T})}})},9112(n,t,e){var i=e(6518),r=e(3724),s=e(4576),o=e(7751),l=e(9504),h=e(9565),c=e(4901),d=e(34),u=e(4376),f=e(9297),g=e(655),m=e(6198),y=e(4659),b=e(9039),x=e(8235),E=e(4495),S=s.JSON,T=s.Number,A=s.SyntaxError,P=S&&S.parse,C=o("Object","keys"),M=Object.getOwnPropertyDescriptor,I=l("".charAt),k=l("".slice),O=l(/./.exec),B=l([].push),L=/^\d$/,$=/^[1-9]$/,j=/^[\d-]$/,U=/^[\t\n\r ]$/,G=0,it=1,X=function(N,R){N=g(N);var F=new J(N,0,""),H=F.parse(),tt=H.value,V=F.skip(U,H.end);if(V<N.length)throw new A('Unexpected extra character: "'+I(N,V)+'" after the parsed data at: '+V);return c(R)?ct({"":tt},"",R,H):tt},ct=function(N,R,F,H){var tt=N[R],V=H&&tt===H.value,K=V&&typeof H.source=="string"?{source:H.source}:{},lt,Ct,Et,bt,le;if(d(tt)){var Le=u(tt),Yn=V?H.nodes:Le?[]:{};if(Le)for(lt=Yn.length,Et=m(tt),bt=0;bt<Et;bt++)Y(tt,bt,ct(tt,""+bt,F,bt<lt?Yn[bt]:void 0));else for(Ct=C(tt),Et=m(Ct),bt=0;bt<Et;bt++)le=Ct[bt],Y(tt,le,ct(tt,le,F,f(Yn,le)?Yn[le]:void 0))}return h(F,N,R,tt,K)},Y=function(N,R,F){if(r){var H=M(N,R);if(H&&!H.configurable)return}F===void 0?delete N[R]:y(N,R,F)},q=function(N,R,F,H){this.value=N,this.end=R,this.source=F,this.nodes=H},J=function(N,R){this.source=N,this.index=R};J.prototype={fork:function(N){return new J(this.source,N)},parse:function(){var N=this.source,R=this.skip(U,this.index),F=this.fork(R),H=I(N,R);if(O(j,H))return F.number();switch(H){case"{":return F.object();case"[":return F.array();case'"':return F.string();case"t":return F.keyword(!0);case"f":return F.keyword(!1);case"n":return F.keyword(null)}throw new A('Unexpected character: "'+H+'" at: '+R)},node:function(N,R,F,H,tt){return new q(R,H,N?null:k(this.source,F,H),tt)},object:function(){for(var N=this.source,R=this.index+1,F=!1,H={},tt={},V=!1;R<N.length;){if(R=this.until(['"',"}"],R),I(N,R)==="}"&&!F){R++,V=!0;break}var K=this.fork(R).string(),lt=K.value;R=K.end,R=this.until([":"],R)+1,R=this.skip(U,R),K=this.fork(R).parse(),y(tt,lt,K),y(H,lt,K.value),R=this.until([",","}"],K.end);var Ct=I(N,R);if(Ct===",")F=!0,R++;else if(Ct==="}"){R++,V=!0;break}}if(!V)throw new A("Unterminated object at: "+R);return this.node(it,H,this.index,R,tt)},array:function(){for(var N=this.source,R=this.index+1,F=!1,H=[],tt=[],V=!1;R<N.length;){if(R=this.skip(U,R),I(N,R)==="]"&&!F){R++,V=!0;break}var K=this.fork(R).parse();if(B(tt,K),B(H,K.value),R=this.until([",","]"],K.end),I(N,R)===",")F=!0,R++;else if(I(N,R)==="]"){R++,V=!0;break}}if(!V)throw new A("Unterminated array at: "+R);return this.node(it,H,this.index,R,tt)},string:function(){var N=this.index,R=x(this.source,this.index+1);return this.node(G,R.value,N,R.end)},number:function(){var N=this.source,R=this.index,F=R;if(I(N,F)==="-"&&F++,I(N,F)==="0")F++;else if(O($,I(N,F)))F=this.skip(L,F+1);else throw new A("Failed to parse number at: "+F);if(I(N,F)==="."){var H=F+1;if(F=this.skip(L,H),H===F)throw new A("Failed to parse number's fraction at: "+F)}if(I(N,F)==="e"||I(N,F)==="E"){F++,(I(N,F)==="+"||I(N,F)==="-")&&F++;var tt=F;if(F=this.skip(L,F),tt===F)throw new A("Failed to parse number's exponent value at: "+F)}return this.node(G,T(k(N,R,F)),R,F)},keyword:function(N){var R=""+N,F=this.index,H=F+R.length;if(k(this.source,F,H)!==R)throw new A("Failed to parse value at: "+F);return this.node(G,N,F,H)},skip:function(N,R){for(var F=this.source;R<F.length&&O(N,I(F,R));R++);return R},until:function(N,R){R=this.skip(U,R);for(var F=I(this.source,R),H=0;H<N.length;H++)if(N[H]===F)return R;throw new A('Unexpected character: "'+F+'" at: '+R)}};var dt=b(function(){var N="9007199254740993",R;return P(N,function(F,H,tt){R=tt.source}),R!==N}),gt=E&&!b(function(){return 1/P("-0 ")!==-1/0});i({target:"JSON",stat:!0,forced:dt},{parse:function(R,F){return gt&&!c(F)?P(R):X(R,F)}})},3110(n,t,e){var i=e(6518),r=e(7751),s=e(8745),o=e(9565),l=e(9504),h=e(9039),c=e(4376),d=e(4901),u=e(5810),f=e(757),g=e(2195),m=e(655),y=e(7680),b=e(8235),x=e(3392),E=e(4495),S=e(7819),T=String,A=r("JSON","stringify"),P=l(/./.exec),C=l("".charAt),M=l("".charCodeAt),I=l("".replace),k=l("".slice),O=l([].push),B=l(1.1.toString),L=/[\uD800-\uDFFF]/g,$=/^[\uD800-\uDBFF]$/,j=/^[\uDC00-\uDFFF]$/,U=x(),G=U.length,it=!E||h(function(){var J=r("Symbol")("stringify detection");return A([J])!=="[null]"||A({a:J})!=="{}"||A(Object(J))!=="{}"}),X=h(function(){return A("\uDF06\uD834")!=='"\\udf06\\ud834"'||A("\uDEAD")!=='"\\udead"'}),ct=it?function(J,dt){var gt=y(arguments),N=q(dt);if(!(!d(N)&&(J===void 0||f(J))))return gt[1]=function(R,F){if(d(N)&&(F=o(N,this,T(R),F)),!f(F))return F},s(A,null,gt)}:A,Y=function(J,dt,gt){var N=C(gt,dt-1),R=C(gt,dt+1);return P($,J)&&!P(j,R)||P(j,J)&&!P($,N)?"\\u"+B(M(J,0),16):J},q=function(J){if(d(J))return J;if(c(J)){for(var dt=J.length,gt=[],N=0;N<dt;N++){var R=J[N];typeof R=="string"?O(gt,R):(typeof R=="number"||g(R)==="Number"||g(R)==="String")&&O(gt,m(R))}var F=gt.length,H=!0;return function(tt,V){if(H)return H=!1,V;if(c(this))return V;for(var K=0;K<F;K++)if(gt[K]===tt)return V}}};A&&i({target:"JSON",stat:!0,arity:3,forced:it||X||!S},{stringify:function(dt,gt,N){var R=q(gt),F=[],H=ct(dt,function(bt,le){var Le=d(R)?o(R,this,T(bt),le):le;return!S&&u(Le)?U+(O(F,Le.rawJSON)-1):Le},N);if(typeof H!="string"||(X&&(H=I(H,L,Y)),S))return H;for(var tt="",V=H.length,K=0;K<V;K++){var lt=C(H,K);if(lt==='"'){var Ct=b(H,++K).end-1,Et=k(H,K,Ct);tt+=k(Et,0,G)===U?F[k(Et,G)]:'"'+Et+'"',K=Ct}else tt+=lt}return tt}})},2731(n,t,e){var i=e(6518),r=e(9306),s=e(2248),o=e(6395),l=s.get,h=s.has,c=s.set;i({target:"Map",proto:!0,real:!0,forced:o},{getOrInsertComputed:function(u,f){var g=h(this,u);if(r(f),g)return l(this,u);u===0&&1/u===-1/0&&(u=0);var m=f(u);return c(this,u,m),m}})},5367(n,t,e){var i=e(6518),r=e(2248),s=e(6395),o=r.get,l=r.has,h=r.set;i({target:"Map",proto:!0,real:!0,forced:s},{getOrInsert:function(d,u){return l(this,d)?o(this,d):(h(this,d,u),u)}})},3068(n,t,e){var i=e(6518),r=e(9504),s=e(2652),o=RangeError,l=TypeError,h=1/0,c=NaN,d=Math.abs,u=Math.pow,f=r([].push),g=u(2,1023),m=u(2,53)-1,y=Number.MAX_VALUE,b=u(2,971),x={},E={},S={},T={},A={},P=function(C,M){var I=C+M;return{hi:I,lo:M-(I-C)}};i({target:"Math",stat:!0},{sumPrecise:function(M){var I=[],k=0,O=T;switch(s(M,function(N){if(++k>m)throw new o("Maximum allowed index exceeded");if(typeof N!="number")throw new l("Value is not a number");O!==x&&(N!==N?O=x:N===h?O=O===E?x:S:N===-h?O=O===S?x:E:(N!==0||1/N===h)&&(O===T||O===A)&&(O=A,f(I,N)))}),O){case x:return c;case E:return-h;case S:return h;case T:return-0}for(var B=[],L=0,$,j,U,G,it,X,ct=0;ct<I.length;ct++){$=I[ct];for(var Y=0,q=0;q<B.length;q++){if(j=B[q],d($)<d(j)&&(X=$,$=j,j=X),U=P($,j),G=U.hi,it=U.lo,d(G)===h){var J=G===h?1:-1;L+=J,$=$-J*g-J*g,d($)<d(j)&&(X=$,$=j,j=X),U=P($,j),G=U.hi,it=U.lo}it!==0&&(B[Y++]=it),$=G}B.length=Y,$!==0&&f(B,$)}var dt=B.length-1;if(G=0,it=0,L!==0){var gt=dt>=0?B[dt]:0;if(dt--,d(L)>1||L>0&&gt>0||L<0&&gt<0)return L>0?h:-h;if(U=P(L*g,gt/2),G=U.hi,it=U.lo,it*=2,d(2*G)===h)return G>0?G===g&&it===-(b/2)&&dt>=0&&B[dt]<0?y:h:G===-g&&it===b/2&&dt>=0&&B[dt]>0?-y:-h;it!==0&&(B[++dt]=it,it=0),G*=2}for(;dt>=0&&(U=P(G,B[dt--]),G=U.hi,it=U.lo,it===0););return dt>=0&&(it<0&&B[dt]<0||it>0&&B[dt]>0)&&(j=it*2,$=G+j,j===$-G&&(G=$)),G}})},1689(n,t,e){var i=e(6518),r=e(4576),s=e(8745),o=e(7680),l=e(6043),h=e(9306),c=e(1103),d=r.Promise,u=!1;i({target:"Promise",stat:!0,forced:!d||!d.try||c(function(){d.try(function(f){u=f===8},8)}).error||!u},{try:function(f){var g=arguments.length>1?o(arguments,1):[],m=l.f(this),y=c(function(){return s(h(f),void 0,g)});return(y.error?m.reject:m.resolve)(y.value),m.promise}})},4628(n,t,e){var i=e(6518),r=e(6043);i({target:"Promise",stat:!0},{withResolvers:function(){var o=r.f(this);return{promise:o.promise,resolve:o.resolve,reject:o.reject}}})},7642(n,t,e){var i=e(6518),r=e(3440),s=e(9039);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("difference",function(o){return o.size===0})||s(function(){var o={size:1,has:function(){return!0},keys:function(){var h=0;return{next:function(){var c=h++>1;return l.has(1)&&l.clear(),{done:c,value:2}}}}},l=new Set([1,2,3,4]);return l.difference(o).size!==3})},{difference:r})},8004(n,t,e){var i=e(6518),r=e(9039),s=e(8750);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||r(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"})},{intersection:s})},3853(n,t,e){var i=e(6518),r=e(4449);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isDisjointFrom",function(s){return!s})},{isDisjointFrom:r})},5876(n,t,e){var i=e(6518),r=e(3838);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSubsetOf",function(s){return s})},{isSubsetOf:r})},2475(n,t,e){var i=e(6518),r=e(8527);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSupersetOf",function(s){return!s})},{isSupersetOf:r})},5024(n,t,e){var i=e(6518),r=e(3650),s=e(9835);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:r})},1698(n,t,e){var i=e(6518),r=e(4204),s=e(9835);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("union")||!s("union")},{union:r})},9577(n,t,e){var i=e(4644),r=e(1108),s=e(6198),o=e(1291),l=e(5854),h=i.aTypedArray,c=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,u=RangeError,f=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(m){return m===8}})(),g=f&&(function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}})();d("with",function(m,y){var b=h(this),x=s(b),E=o(m),S=E<0?x+E:E,T=r(b)?l(y):+y;if(S>=x||S<0)throw new u("Incorrect index");for(var A=new(c(b))(x),P=0;P<x;P++)A[P]=P===S?T:b[P];return A},!f||g)},5213(n,t,e){var i=e(6518),r=e(4576),s=e(5370),o=e(9143),l=r.Uint8Array,h=!l||!l.fromBase64||!(function(){try{l.fromBase64("a");return}catch{}try{l.fromBase64("",null)}catch{return!0}})();l&&i({target:"Uint8Array",stat:!0,forced:h},{fromBase64:function(d){return s(l,o(d,arguments.length>1?arguments[1]:void 0,null,9007199254740991).bytes)}})},6632(n,t,e){var i=e(6518),r=e(4576),s=e(9143),o=e(4154),l=r.Uint8Array,h=!l||!l.prototype.setFromBase64||!(function(){var c=new l([255,255,255,255,255]);try{c.setFromBase64("",null);return}catch{}try{c.setFromBase64("a");return}catch{}try{c.setFromBase64("MjYyZg===")}catch{return c[0]===50&&c[1]===54&&c[2]===50&&c[3]===255&&c[4]===255}})();l&&i({target:"Uint8Array",proto:!0,forced:h},{setFromBase64:function(d){o(this);var u=s(d,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:u.read,written:u.written}}})},4226(n,t,e){var i=e(6518),r=e(4576),s=e(3463),o=e(4154),l=e(5169),h=e(2303);function c(){try{new Uint8Array(new ArrayBuffer(16,{maxByteLength:1024})).setFromHex("cafed00d")}catch{return!0}}r.Uint8Array&&i({target:"Uint8Array",proto:!0,forced:c()},{setFromHex:function(u){o(this),s(u),l(this.buffer);var f=h(u,this).read;return{read:f,written:f/2}}})},9486(n,t,e){var i=e(6518),r=e(4576),s=e(9504),o=e(3972),l=e(4154),h=e(5169),c=e(2804),d=e(944),u=c.i2c,f=c.i2cUrl,g=s("".charAt),m=r.Uint8Array,y=!m||!m.prototype.toBase64||!(function(){try{new m().toBase64(null)}catch{return!0}})();m&&i({target:"Uint8Array",proto:!0,forced:y},{toBase64:function(){var x=l(this),E=arguments.length?o(arguments[0]):void 0,S=d(E)==="base64"?u:f,T=!!E&&!!E.omitPadding;h(this.buffer);for(var A="",P=0,C=x.length,M,I=function(k){return g(S,M>>6*k&63)};P+2<C;P+=3)M=(x[P]<<16)+(x[P+1]<<8)+x[P+2],A+=I(3)+I(2)+I(1)+I(0);return P+2===C?(M=(x[P]<<16)+(x[P+1]<<8),A+=I(3)+I(2)+I(1)+(T?"":"=")):P+1===C&&(M=x[P]<<16,A+=I(3)+I(2)+(T?"":"==")),A}})},456(n,t,e){var i=e(6518),r=e(4576),s=e(9504),o=e(4154),l=e(5169),h=s(1.1.toString),c=s([].join),d=Array,u=r.Uint8Array,f=!u||!u.prototype.toHex||!(function(){try{return new u([255,255,255,255,255,255,255,255]).toHex()==="ffffffffffffffff"}catch{return!1}})();u&&i({target:"Uint8Array",proto:!0,forced:f},{toHex:function(){o(this),l(this.buffer);for(var m=d(this.length),y=0,b=this.length;y<b;y++){var x=h(this[y],16);m[y]=x.length===1?"0"+x:x}return c(m,"")}})},9452(n,t,e){var i=e(6518),r=e(9306),s=e(6557),o=e(4328),l=e(4995),h=e(6395),c=l.get,d=l.has,u=l.set;i({target:"WeakMap",proto:!0,real:!0,forced:h||!(function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(f){return f instanceof TypeError}})()},{getOrInsertComputed:function(g,m){if(h||s(this),o(g),r(m),d(this,g))return c(this,g);var y=m(g);return u(this,g,y),y}})},8454(n,t,e){var i=e(6518),r=e(4995),s=e(6395),o=r.get,l=r.has,h=r.set;i({target:"WeakMap",proto:!0,real:!0,forced:s},{getOrInsert:function(d,u){return l(this,d)?o(this,d):(h(this,d,u),u)}})},4979(n,t,e){var i=e(6518),r=e(4576),s=e(7751),o=e(6980),l=e(4913).f,h=e(9297),c=e(679),d=e(3167),u=e(2603),f=e(5002),g=e(8574),m=e(3724),y=e(6395),b="DOMException",x=s("Error"),E=s(b),S=function(){c(this,T);var U=arguments.length,G=u(U<1?void 0:arguments[0]),it=new E(G,u(U<2?void 0:arguments[1],"Error")),X=new x(G);return X.name=b,l(it,"stack",o(1,g(X.stack,1))),d(it,this,S),it},T=S.prototype=E.prototype,A="stack"in new x(b),P="stack"in new E(1,2),C=E&&m&&Object.getOwnPropertyDescriptor(r,b),M=!!C&&!(C.writable&&C.configurable),I=A&&!M&&!P;i({global:!0,constructor:!0,forced:y||I},{DOMException:I?S:E});var k=s(b),O=k.prototype;if(O.constructor!==k){y||l(O,"constructor",o(1,k));for(var B in f)if(h(f,B)){var L=f[B],$=L.s;h(k,$)||l(k,$,o(6,L.c))}}},4603(n,t,e){var i=e(6840),r=e(9504),s=e(655),o=e(2812),l=URLSearchParams,h=l.prototype,c=r(h.append),d=r(h.delete),u=r(h.forEach),f=r([].push),g=new l("a=1&a=2&b=3");g.delete("a",1),g.delete("b",void 0),g+""!="a=2"&&i(h,"delete",function(m){var y=arguments.length,b=y<2?void 0:arguments[1];if(y&&b===void 0)return d(this,m);var x=[];u(this,function(C,M){f(x,{key:M,value:C})}),o(y,1);for(var E=s(m),S=s(b),T=0,A=x.length,P;T<A;)P=x[T],d(this,P.key),T++;for(T=0;T<A;)P=x[T++],P.key===E&&P.value===S||c(this,P.key,P.value)},{enumerable:!0,unsafe:!0})},7566(n,t,e){var i=e(6840),r=e(9504),s=e(655),o=e(2812),l=URLSearchParams,h=l.prototype,c=r(h.getAll),d=r(h.has),u=new l("a=1");(u.has("a",2)||!u.has("a",void 0))&&i(h,"has",function(g){var m=arguments.length,y=m<2?void 0:arguments[1];if(m&&y===void 0)return d(this,g);var b=c(this,g);o(m,1);for(var x=s(y),E=0;E<b.length;)if(b[E++]===x)return!0;return!1},{enumerable:!0,unsafe:!0})},8721(n,t,e){var i=e(3724),r=e(9504),s=e(2106),o=URLSearchParams.prototype,l=r(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var c=0;return l(this,function(){c++}),c},configurable:!0,enumerable:!0})},5781(n,t,e){var i=e(6518),r=e(7751),s=e(2812),o=e(655),l=e(7416),h=r("URL");i({target:"URL",stat:!0,forced:!l},{parse:function(d){var u=s(arguments.length,1),f=o(d),g=u<2||arguments[1]===void 0?void 0:o(arguments[1]);try{return new h(f,g)}catch{return null}}})}},rb={},ut.d=(n,t)=>{for(var e in t)ut.o(t,e)&&!ut.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},ut.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),ut(4423),ut(4114),ut(6573),ut(8100),ut(7936),ut(8111),ut(2489),ut(5367),ut(2731),ut(9577),ut(6632),ut(4226),ut(9486),ut(456),ut(5781),bn=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Gi=[1/0,1/0,-1/0,-1/0],hs=new Float32Array(Gi),sp=[.001,0,0,.001,0,0],ap=1.35,wn="http://www.w3.org/2000/svg",xn={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},br={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Pa="pdfjs_internal_id_",vl="pdfjs_internal_editor_",pt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},wt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},DA={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},be={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Fc={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ce={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Ca={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Nc={ERRORS:0,WARNINGS:1,INFOS:5},Xi={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},yl={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},FA={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},_c=Nc.WARNINGS,cs=(function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t})(),sb=class extends cs{constructor(n,t){super(n,"PasswordException"),this.code=t}},op=class extends cs{constructor(n,t){super(n,"UnknownErrorException"),this.details=t}},lp=class extends cs{constructor(n){super(n,"InvalidPDFException")}},Bc=class extends cs{constructor(n,t,e){super(n,"ResponseException"),this.status=t,this.missing=e}},NA=class extends cs{constructor(n){super(n,"FormatError")}},wr=class extends cs{constructor(n){super(n,"AbortException")}},Ut=class{static get isLittleEndian(){const n=new Uint8Array(4);n[0]=1;const t=new Uint32Array(n.buffer,0,1);return mt(this,"isLittleEndian",t[0]===1)}static get isOffscreenCanvasSupported(){return mt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return mt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return mt(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return mt(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:n,userAgent:t}=navigator;return mt(this,"platform",{isAndroid:t.includes("Android"),isLinux:n.includes("Linux"),isMac:n.includes("Mac"),isWindows:n.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCanvasFilterSupported(){let n;return this.isOffscreenCanvasSupported?n=new OffscreenCanvas(1,1).getContext("2d"):typeof document<"u"&&(n=document.createElement("canvas").getContext("2d")),mt(this,"isCanvasFilterSupported",n?.filter!==void 0)}static get isAlphaColorInputSupported(){if(typeof document>"u")return mt(this,"isAlphaColorInputSupported",!1);const n=document.createElement("input");return n.type="color",n.setAttribute("alpha",""),n.value="#ff000080",mt(this,"isAlphaColorInputSupported",n.value!=="#ff0000")}},Z=class Dx{static get hexNums(){return mt(this,"hexNums",Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0")))}static makeHexColor(t,e,i){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[i]}`}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){const r=t[i],s=t[i+1];t[i]=r*e[0]+s*e[2]+e[4],t[i+1]=r*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const r=e[0],s=e[1],o=e[2],l=e[3],h=e[4],c=e[5];for(let d=0;d<6;d+=2){const u=t[i+d],f=t[i+d+1];t[i+d]=u*r+f*o+h,t[i+d+1]=u*s+f*l+c}}static applyInverseTransform(t,e){const i=t[0],r=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-r*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-i*e[1]+r*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,i){const r=e[0],s=e[1],o=e[2],l=e[3],h=e[4],c=e[5],d=t[0],u=t[1],f=t[2],g=t[3];let m=r*d+h,y=m,b=r*f+h,x=b,E=l*u+c,S=E,T=l*g+c,A=T;if(s!==0||o!==0){const P=s*d,C=s*f,M=o*u,I=o*g;m+=M,x+=M,b+=I,y+=I,E+=P,A+=P,T+=C,S+=C}i[0]=Math.min(i[0],m,b,y,x),i[1]=Math.min(i[1],E,T,S,A),i[2]=Math.max(i[2],m,b,y,x),i[3]=Math.max(i[3],E,T,S,A)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],r=t[1],s=t[2],o=t[3],l=i**2+r**2,h=i*s+r*o,c=s**2+o**2,d=(l+c)/2,u=Math.sqrt(d**2-(l*c-h**2));e[0]=Math.sqrt(d+u||1),e[1]=Math.sqrt(d-u||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>o?null:[i,s,r,o]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,r,s){s[0]=Math.min(s[0],t,i),s[1]=Math.min(s[1],e,r),s[2]=Math.max(s[2],t,i),s[3]=Math.max(s[3],e,r)}static bezierBoundingBox(t,e,i,r,s,o,l,h,c){c[0]=Math.min(c[0],t,l),c[1]=Math.min(c[1],e,h),c[2]=Math.max(c[2],t,l),c[3]=Math.max(c[3],e,h),v(Dx,this,Y0).call(this,t,i,s,l,e,r,o,h,3*(-t+3*(i-s)+l),6*(t-2*i+s),3*(i-t),c),v(Dx,this,Y0).call(this,t,i,s,l,e,r,o,h,3*(-e+3*(r-o)+h),6*(e-2*r+o),3*(r-e),c)}},rp=Z,hp=null,ab=null,cp=()=>[],dp=()=>new Map,up=()=>Object.create(null),typeof Blob.prototype.bytes!="function"&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),typeof Response.prototype.bytes!="function"&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),ut(1701),ut(4603),ut(7566),ut(8721),fp=class fC{constructor({viewBox:t,userUnit:e,scale:i,rotation:r,offsetX:s=0,offsetY:o=0,dontFlip:l=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=r,this.offsetX=s,this.offsetY=o,i*=e;const h=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let d,u,f,g;switch(r%=360,r<0&&(r+=360),r){case 180:d=-1,u=0,f=0,g=1;break;case 90:d=0,u=1,f=1,g=0;break;case 270:d=0,u=-1,f=-1,g=0;break;case 0:d=1,u=0,f=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}l&&(f=-f,g=-g);let m,y,b,x;d===0?(m=Math.abs(c-t[1])*i+s,y=Math.abs(h-t[0])*i+o,b=(t[3]-t[1])*i,x=(t[2]-t[0])*i):(m=Math.abs(h-t[0])*i+s,y=Math.abs(c-t[1])*i+o,b=(t[2]-t[0])*i,x=(t[3]-t[1])*i),this.transform=[d*i,u*i,f*i,g*i,m-d*i*h-f*i*c,y-u*i*h-g*i*c],this.width=b,this.height=x}get rawDims(){const t=this.viewBox;return mt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}={}){return new fC({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(t,e){const i=[t,e];return Z.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];Z.applyTransform(e,this.transform);const i=[t[2],t[3]];return Z.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return Z.applyInverseTransform(i,this.transform),i}},pp=class pC{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function r(s){if(!s)return;let o=null;const l=s.name;if(l==="#text")o=s.value;else if(pC.shouldBuildText(l))s?.attributes?.textContent?o=s.attributes.textContent:s.value&&(o=s.value);else return;if(o!==null&&e.push({str:o}),!!s.children)for(const h of s.children)r(h)}return r(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}},ob=class{static setupStorage(n,t,e,i,r){const s=i.getValue(t,{value:null});switch(e.name){case"textarea":if(s.value!==null&&(n.textContent=s.value),r==="print")break;n.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})});break;case"input":if(e.attributes.type==="radio"||e.attributes.type==="checkbox"){if(s.value===e.attributes.xfaOn?n.setAttribute("checked",!0):s.value===e.attributes.xfaOff&&n.removeAttribute("checked"),r==="print")break;n.addEventListener("change",o=>{i.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&n.setAttribute("value",s.value),r==="print")break;n.addEventListener("input",o=>{i.setValue(t,{value:o.target.value})})}break;case"select":if(s.value!==null){n.setAttribute("value",s.value);for(const o of e.children)o.attributes.value===s.value?o.attributes.selected=!0:Object.hasOwn(o.attributes,"selected")&&delete o.attributes.selected}n.addEventListener("input",o=>{const l=o.target.options,h=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(t,{value:h})});break}}static setAttributes({html:n,element:t,storage:e=null,intent:i,linkService:r}){const{attributes:s}=t,o=n instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${i}`);for(const[l,h]of Object.entries(s))if(h!=null)switch(l){case"class":h.length&&n.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":n.setAttribute("data-element-id",h);break;case"style":Object.assign(n.style,h);break;case"textContent":n.textContent=h;break;default:(!o||l!=="href"&&l!=="newWindow")&&n.setAttribute(l,h)}o&&r.addLinkAttributes(n,s.href,s.newWindow),e&&s.dataId&&this.setupStorage(n,s.dataId,t,e)}static render(n){const t=n.annotationStorage,e=n.linkService,i=n.xfaHtml,r=n.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:r,linkService:e});const o=r!=="richText",l=n.div;if(l.append(s),n.viewport){const d=`matrix(${n.viewport.transform.join(",")})`;l.style.transform=d}o&&l.setAttribute("class","xfaLayer xfaFont");const h=[];if(i.children.length===0){if(i.value){const d=document.createTextNode(i.value);s.append(d),o&&pp.shouldBuildText(i.name)&&h.push(d)}return{textDivs:h}}const c=[[i,-1,s]];for(;c.length>0;){const[d,u,f]=c.at(-1);if(u+1===d.children.length){c.pop();continue}const g=d.children[++c.at(-1)[1]];if(g===null)continue;const{name:m}=g;if(m==="#text"){const b=document.createTextNode(g.value);h.push(b),f.append(b);continue}const y=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,m):document.createElement(m);if(f.append(y),g.attributes&&this.setAttributes({html:y,element:g,storage:t,intent:r,linkService:e}),g.children?.length>0)c.push([g,-1,y]);else if(g.value){const b=document.createTextNode(g.value);o&&pp.shouldBuildText(m)&&h.push(b),y.append(b)}}for(const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:h}}static update(n){const t=`matrix(${n.viewport.transform.join(",")})`;n.div.style.transform=t,n.div.hidden=!1}static getPageViewport(n,{scale:t=1,rotation:e=0}){const{width:i,height:r}=n.attributes.style;return new fp({viewBox:[0,0,parseInt(i,10),parseInt(r,10)],userUnit:1,scale:t,rotation:e})}},_e=class{},ib=_e,D(_e,"CSS",96),D(_e,"PDF",72),D(_e,"PDF_TO_CSS_UNITS",ib.CSS/ib.PDF),gp=class extends cs{constructor(n,t=0){super(n,"RenderingCancelledException"),this.extraDelay=t}},Ma=new WeakMap,lb=class{constructor(){w(this,Ma,new Map),D(this,"times",[])}time(n){a(Ma,this).has(n)&&ft(`Timer is already running for ${n}`),a(Ma,this).set(n,Date.now())}timeEnd(n){a(Ma,this).has(n)||ft(`Timer has not been started for ${n}`),this.times.push({name:n,start:a(Ma,this).get(n),end:Date.now()}),a(Ma,this).delete(n)}toString(){const n=Math.max(...this.times.map(t=>t.name.length));return this.times.map(t=>`${t.name.padEnd(n)} ${t.end-t.start}ms
41
+ `).join("")}},mp=class Wv{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;v(Wv,this,vp)._||(vp._=v(Wv,this,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?")));const e=v(Wv,this,vp)._.exec(t);if(!e)return null;const i=parseInt(e[1],10);let r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let o=parseInt(e[4],10);o=o>=0&&o<=23?o:0;let l=parseInt(e[5],10);l=l>=0&&l<=59?l:0;let h=parseInt(e[6],10);h=h>=0&&h<=59?h:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(e[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(o+=d,l+=u):c==="+"&&(o-=d,l-=u),new Date(Date.UTC(i,r,s,o,l,h))}},vp={_:void 0},ds=class Fx{constructor(){const{pixelRatio:t}=Fx;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,r,s=-1){let o=1/0,l=1/0,h=1/0;i=Fx.capPixels(i,s),i>0&&(o=Math.sqrt(i/(t*e))),r!==-1&&(l=r/t,h=r/e);const c=Math.min(o,l,h);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}},yp=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],_A=class{static get isDarkMode(){return mt(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},BA=class{static get commentForegroundColor(){const n=document.createElement("span");n.classList.add("comment","sidebar");const{style:t}=n;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(n);const{color:e}=window.getComputedStyle(n);return n.remove(),mt(this,"commentForegroundColor",Ic(e))}},hb=new Map,ut(4972),ut(4628),ut(7642),ut(8004),ut(3853),ut(5876),ut(2475),ut(5024),ut(1698),ut(8454),ut(9452),ut(4979),ut(3579),ut(3110),ut(9314),ut(1148),ut(9112),Ia=new WeakMap,ka=new WeakMap,bi=new WeakMap,wi=new WeakMap,bp=new WeakMap,Ra=new WeakMap,Wc=new WeakMap,jc=new WeakMap,On=new WeakSet,WA=class{constructor(n){ot(this,On),w(this,Ia,null),w(this,ka,null),w(this,bi,void 0),w(this,wi,null),w(this,bp,null),w(this,Ra,null),w(this,Wc,null),w(this,jc,null),p(bi,this,n),wp._||(wp._=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const n=p(Ia,this,document.createElement("div"));n.classList.add("editToolbar","hidden"),n.setAttribute("role","toolbar");const t=a(bi,this)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(n.addEventListener("contextmenu",Jn,{signal:t}),n.addEventListener("pointerdown",mM,{signal:t}));const e=p(wi,this,document.createElement("div"));e.className="buttons",n.append(e);const i=a(bi,this).toolbarPosition;if(i){const{style:r}=n;r.insetInlineEnd=`${100*(a(bi,this)._uiManager.direction==="ltr"?1-i[0]:i[0])}%`,r.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return n}get div(){return a(Ia,this)}hide(){a(Ia,this).classList.add("hidden"),a(ka,this)?.hideDropdown()}show(){a(Ia,this).classList.remove("hidden"),a(bp,this)?.shown(),a(Ra,this)?.shown()}addDeleteButton(){const{editorType:n,_uiManager:t}=a(bi,this),e=document.createElement("button");e.classList.add("basic","deleteButton"),e.tabIndex=0,e.setAttribute("data-l10n-id",wp._[n]),v(On,this,kc).call(this,e)&&e.addEventListener("click",i=>{t.delete()},{signal:t._signal}),a(wi,this).append(e)}async addAltText(n){const t=await n.render();v(On,this,kc).call(this,t),a(wi,this).append(t,Cf.call(v(On,this))),p(bp,this,n)}addComment(n,t=null){if(a(Ra,this))return;const e=n.renderForToolbar();if(!e)return;v(On,this,kc).call(this,e);const i=p(Wc,this,Cf.call(v(On,this)));t?(a(wi,this).insertBefore(e,t),a(wi,this).insertBefore(i,t)):a(wi,this).append(e,i),p(Ra,this,n),n.toolbar=this}addColorPicker(n){if(a(ka,this))return;p(ka,this,n);const t=n.renderButton();v(On,this,kc).call(this,t),a(wi,this).append(t,Cf.call(v(On,this)))}async addEditSignatureButton(n){const t=p(jc,this,await n.renderEditButton(a(bi,this)));v(On,this,kc).call(this,t),a(wi,this).append(t,Cf.call(v(On,this)))}removeButton(n){n==="comment"&&(a(Ra,this)?.removeToolbarCommentButton(),p(Ra,this,null),a(Wc,this)?.remove(),p(Wc,this,null))}async addButton(n,t){switch(n){case"colorPicker":t&&this.addColorPicker(t);break;case"altText":t&&await this.addAltText(t);break;case"editSignature":t&&await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":t&&this.addComment(t);break}}async addButtonBefore(n,t,e){if(!t&&n==="comment")return;const i=a(wi,this).querySelector(e);i&&n==="comment"&&this.addComment(t,i)}updateEditSignatureButton(n){a(jc,this)&&(a(jc,this).title=n)}remove(){a(Ia,this).remove(),a(ka,this)?.destroy(),p(ka,this,null)}},wp={_:null},xp=new WeakMap,Oa=new WeakMap,us=new WeakMap,bl=new WeakSet,jA=class{constructor(n){ot(this,bl),w(this,xp,null),w(this,Oa,null),w(this,us,void 0),p(us,this,n)}show(n,t,e){const[i,r]=v(bl,this,wM).call(this,t,e),{style:s}=a(Oa,this)||p(Oa,this,v(bl,this,bM).call(this));n.append(a(Oa,this)),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){a(Oa,this).remove()}},UA=Object.freeze({internal:"9556e50a-f4f8-4f57-9831-f9ddff0176eb"}),cn=class gC{static initializeAndAddPointerId(t){(xl._||(xl._=new Set)).add(t)}static setPointer(t,e){wl._||(wl._=e),El._??(El._=t)}static setTimeStamp(t){Ep._=t}static isSamePointerId(t){return wl._===t}static isSamePointerIdOrRemove(t){return wl._===t?!0:(xl._?.delete(t),!1)}static isSamePointerType(t){return El._===t}static isInitializedAndDifferentPointerType(t){return El._!==null&&!gC.isSamePointerType(t)}static isSameTimeStamp(t){return Ep._===t}static isUsingMultiplePointers(){return xl._?.size>=1}static clearPointerType(){El._=null}static clearPointerIds(){wl._=NaN,xl._=null}static clearTimeStamp(){Ep._=NaN}},wl={_:NaN},xl={_:null},Ep={_:NaN},El={_:null},Ap=new WeakMap,$A=class{constructor(){w(this,Ap,0)}get id(){var n,t;return`${vl}${p(Ap,this,(n=a(Ap,this),t=n++,n)),t}`}},Uc=new WeakMap,Al=new WeakMap,Se=new WeakMap,$c=new WeakSet,cb=class{constructor(){ot(this,$c),w(this,Uc,K0()),w(this,Al,0),w(this,Se,null)}static get _isSVGFittingCanvas(){const n=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${wn}"><rect width="1" height="1" style="fill:red;"/></svg>`,t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src=n;const i=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return mt(this,"_isSVGFittingCanvas",i)}async getFromFile(n){const{lastModified:t,name:e,size:i,type:r}=n;return v($c,this,by).call(this,`${t}_${e}_${i}_${r}`,n)}async getFromUrl(n){return v($c,this,by).call(this,n,n)}async getFromBlob(n,t){const e=await t;return v($c,this,by).call(this,n,e)}async getFromId(n){a(Se,this)||p(Se,this,new Map);const t=a(Se,this).get(n);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(n,t){var e,i;a(Se,this)||p(Se,this,new Map);let r=a(Se,this).get(n);if(r?.bitmap)return r.refCounter+=1,r;const s=new OffscreenCanvas(t.width,t.height);return s.getContext("2d").drawImage(t,0,0),r={bitmap:s.transferToImageBitmap(),id:`image_${a(Uc,this)}_${p(Al,this,(e=a(Al,this),i=e++,e)),i}`,refCounter:1,isSvg:!1},a(Se,this).set(n,r),a(Se,this).set(r.id,r),r}getSvgUrl(n){const t=a(Se,this).get(n);return t?.isSvg?t.svgUrl:null}deleteId(n){a(Se,this)||p(Se,this,new Map);const t=a(Se,this).get(n);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:e}=t;if(!t.url&&!t.file){const i=new OffscreenCanvas(e.width,e.height);i.getContext("bitmaprenderer").transferFromImageBitmap(e),t.blobPromise=i.convertToBlob()}e.close?.(),t.bitmap=null}isValidId(n){return n.startsWith(`image_${a(Uc,this)}_`)}},SA=cb,we=new WeakMap,La=new WeakMap,Sp=new WeakMap,Jt=new WeakMap,HA=class{constructor(n=128){w(this,we,[]),w(this,La,!1),w(this,Sp,void 0),w(this,Jt,-1),p(Sp,this,n)}add({cmd:n,undo:t,post:e,mustExec:i,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(i&&n(),a(La,this))return;const l={cmd:n,undo:t,post:e,type:r};if(a(Jt,this)===-1){a(we,this).length>0&&(a(we,this).length=0),p(Jt,this,0),a(we,this).push(l);return}if(s&&a(we,this)[a(Jt,this)].type===r){o&&(l.undo=a(we,this)[a(Jt,this)].undo),a(we,this)[a(Jt,this)]=l;return}const h=a(Jt,this)+1;h===a(Sp,this)?a(we,this).splice(0,1):(p(Jt,this,h),h<a(we,this).length&&a(we,this).splice(h)),a(we,this).push(l)}undo(){if(a(Jt,this)===-1)return;p(La,this,!0);const{undo:n,post:t}=a(we,this)[a(Jt,this)];n(),t?.(),p(La,this,!1),p(Jt,this,a(Jt,this)-1)}redo(){if(a(Jt,this)<a(we,this).length-1){p(Jt,this,a(Jt,this)+1),p(La,this,!0);const{cmd:n,post:t}=a(we,this)[a(Jt,this)];n(),t?.(),p(La,this,!1)}}hasSomethingToUndo(){return a(Jt,this)!==-1}hasSomethingToRedo(){return a(Jt,this)<a(we,this).length-1}cleanType(n){if(a(Jt,this)!==-1){for(let t=a(Jt,this);t>=0;t--)if(a(we,this)[t].type!==n){a(we,this).splice(t+1,a(Jt,this)-t),p(Jt,this,t);return}a(we,this).length=0,p(Jt,this,-1)}}destroy(){p(we,this,null)}},db=new WeakSet,Sl=class{constructor(n){ot(this,db),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=Ut.platform;for(const[e,i,r={}]of n)for(const s of e){const o=s.startsWith("mac+");t&&o?(this.callbacks.set(s.slice(4),{callback:i,options:r}),this.allKeys.add(s.split("+").at(-1))):!t&&!o&&(this.callbacks.set(s,{callback:i,options:r}),this.allKeys.add(s.split("+").at(-1)))}}exec(n,t){if(!this.allKeys.has(t.key))return;const e=this.callbacks.get(v(db,this,xM).call(this,t));if(!e)return;const{callback:i,options:{bubbles:r=!1,args:s=[],checker:o=null}}=e;o&&!o(n,t)||(i.bind(n,...s,t)(),r||ee(t))}},ub=class mC{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return fM(t),mt(this,"_colors",t)}convert(t){const e=Ic(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,r]of this._colors)if(r.every((s,o)=>s===e[o]))return mC._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?Z.makeHexColor(...e):t}},D(ub,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),Hc=new WeakMap,Qn=new WeakMap,Tl=new WeakMap,de=new WeakMap,se=new WeakMap,Vc=new WeakMap,zc=new WeakMap,En=new WeakMap,Pl=new WeakMap,xi=new WeakMap,Be=new WeakMap,Da=new WeakMap,Fa=new WeakMap,Na=new WeakMap,_a=new WeakMap,xr=new WeakMap,Ei=new WeakMap,Cl=new WeakMap,Tp=new WeakMap,Pp=new WeakMap,Gc=new WeakMap,Cp=new WeakMap,Er=new WeakMap,Ba=new WeakMap,Xc=new WeakMap,Wa=new WeakMap,Yi=new WeakMap,fb=new WeakMap,fs=new WeakMap,Yc=new WeakMap,Mp=new WeakMap,ja=new WeakMap,Ml=new WeakMap,Kc=new WeakMap,ps=new WeakMap,Ip=new WeakMap,Te=new WeakMap,Bt=new WeakMap,gs=new WeakMap,Ua=new WeakMap,$a=new WeakMap,Zc=new WeakMap,Jc=new WeakMap,kp=new WeakMap,Ha=new WeakMap,Ar=new WeakMap,ms=new WeakMap,Rp=new WeakMap,Op=new WeakMap,Ai=new WeakMap,ht=new WeakSet,vs=class Nx{static get _keyboardManager(){const t=Nx.prototype,e=o=>a(ms,o).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&o.hasSomethingToControl(),i=(o,{target:l})=>{if(l instanceof HTMLInputElement){const{type:h}=l;return h!=="text"&&h!=="number"}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return mt(this,"_keyboardManager",new Sl([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(o,{target:l})=>!(l instanceof HTMLButtonElement)&&a(ms,o).contains(l)&&!o.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(o,{target:l})=>!(l instanceof HTMLButtonElement)&&a(ms,o).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,r,s,o,l,h,c,d,u,f,g,m,y,b){ot(this,ht),w(this,Hc,new AbortController),w(this,Qn,null),w(this,Tl,null),w(this,de,new Map),w(this,se,new Map),w(this,Vc,null),w(this,zc,null),w(this,En,null),w(this,Pl,null),w(this,xi,new HA),w(this,Be,null),w(this,Da,null),w(this,Fa,null),w(this,Na,0),w(this,_a,new Set),w(this,xr,null),w(this,Ei,null),w(this,Cl,new Set),D(this,"_editorUndoBar",null),w(this,Tp,!1),w(this,Pp,!1),w(this,Gc,!1),w(this,Cp,null),w(this,Er,null),w(this,Ba,null),w(this,Xc,null),w(this,Wa,!1),w(this,Yi,null),w(this,fb,new $A),w(this,fs,!1),w(this,Yc,!1),w(this,Mp,!1),w(this,ja,null),w(this,Ml,null),w(this,Kc,null),w(this,ps,null),w(this,Ip,null),w(this,Te,pt.NONE),w(this,Bt,new Set),w(this,gs,null),w(this,Ua,null),w(this,$a,null),w(this,Zc,null),w(this,Jc,null),w(this,kp,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),w(this,Ha,[0,0]),w(this,Ar,null),w(this,ms,null),w(this,Rp,null),w(this,Op,null),w(this,Ai,null);const x=this._signal=a(Hc,this).signal;p(ms,this,t),p(Rp,this,e),p(Op,this,i),p(zc,this,r),p(Be,this,s),p(Ua,this,o),p(Jc,this,h),this._eventBus=l;const E={signal:x,...UA};l.on("editingaction",this.onEditingAction.bind(this),E),l.on("pagechanging",this.onPageChanging.bind(this),E),l.on("scalechanging",this.onScaleChanging.bind(this),E),l.on("rotationchanging",this.onRotationChanging.bind(this),E),l.on("setpreference",this.onSetPreference.bind(this),E),l.on("switchannotationeditorparams",S=>this.updateParams(S.type,S.value),E),window.addEventListener("pointerdown",()=>{p(Yc,this,!0)},{capture:!0,signal:x}),window.addEventListener("pointerup",()=>{p(Yc,this,!1)},{capture:!0,signal:x}),window.addEventListener("beforeunload",v(ht,this,EM).bind(this),{capture:!0,signal:x}),v(ht,this,TM).call(this),v(ht,this,RM).call(this),v(ht,this,rE).call(this),p(En,this,h.annotationStorage),p(Cp,this,h.filterFactory),p($a,this,c),p(Xc,this,d||null),p(Tp,this,u),p(Pp,this,f),p(Gc,this,g),p(Ip,this,m||null),this.viewParameters={realScale:_e.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=b!==!1,s?.setSidebarUiManager(this)}destroy(){a(Ai,this)?.resolve(),p(Ai,this,null),a(Hc,this)?.abort(),p(Hc,this,null),this._signal=null;for(const t of a(se,this).values())t.destroy();a(se,this).clear(),a(de,this).clear(),a(Cl,this).clear(),a(ps,this)?.clear(),p(Qn,this,null),a(Bt,this).clear(),a(xi,this).destroy(),a(zc,this)?.destroy(),a(Be,this)?.destroy(),a(Ua,this)?.destroy(),a(Yi,this)?.hide(),p(Yi,this,null),a(Kc,this)?.destroy(),p(Kc,this,null),p(Tl,this,null),a(Er,this)&&(clearTimeout(a(Er,this)),p(Er,this,null)),a(Ar,this)&&(clearTimeout(a(Ar,this)),p(Ar,this,null)),this._editorUndoBar?.destroy(),p(Jc,this,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return a(Ip,this)}get useNewAltTextFlow(){return a(Pp,this)}get useNewAltTextWhenAddingImage(){return a(Gc,this)}get hcmFilter(){return mt(this,"hcmFilter",a($a,this)?a(Cp,this).addHCMFilter(a($a,this).foreground,a($a,this).background):"none")}get direction(){return mt(this,"direction",getComputedStyle(a(ms,this)).direction)}get _highlightColors(){return mt(this,"_highlightColors",a(Xc,this)?new Map(a(Xc,this).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return mt(this,"highlightColors",null);const e=new Map,i=!!a($a,this);for(const[r,s]of t){const o=r.endsWith("_HCM");if(i&&o){e.set(r.replace("_HCM",""),s);continue}!i&&!o&&e.set(r,s)}return mt(this,"highlightColors",e)}get highlightColorNames(){return mt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),p(Fa,this,t)}setMainHighlightColorPicker(t){p(Kc,this,t)}editAltText(t,e=!1){a(zc,this)?.editAltText(this,t,e)}hasCommentManager(){return!!a(Be,this)}editComment(t,e,i,r){a(Be,this)?.showDialog(this,t,e,i,r)}selectComment(t,e){a(se,this).get(t)?.getEditorByUID(e)?.toggleComment(!0,!0)}updateComment(t){a(Be,this)?.updateComment(t.getData())}updatePopupColor(t){a(Be,this)?.updatePopupColor(t)}removeComment(t){a(Be,this)?.removeComments([t.uid])}deleteComment(t,e){const i=()=>{t.comment=e},r=()=>{this._editorUndoBar?.show(i,"comment"),this.toggleComment(null),t.comment=null};this.addCommands({cmd:r,undo:i,mustExec:!0})}toggleComment(t,e,i=void 0){a(Be,this)?.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){return t&&a(Be,this)?.makeCommentColor(t,e)||null}getCommentDialogElement(){return a(Be,this)?.dialogElement||null}async waitForEditorsRendered(t){if(a(se,this).has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),r=s=>{s.pageNumber===t&&(this._eventBus.off("editorsrendered",r),e())};this._eventBus.on("editorsrendered",r),await i}getSignature(t){a(Ua,this)?.getSignature({uiManager:this,editor:t})}get signatureManager(){return a(Ua,this)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){t==="enableNewAltTextWhenAddingImage"&&p(Gc,this,e)}onPageChanging({pageNumber:t}){p(Na,this,t-1)}deletePage(t){for(const e of this.getEditors(t))e.remove();a(se,this).delete(t),a(Na,this)===t&&p(Na,this,0)}focusMainContainer(){a(ms,this).focus()}findParent(t,e){for(const i of a(se,this).values()){const{x:r,y:s,width:o,height:l}=i.div.getBoundingClientRect();if(t>=r&&t<=r+o&&e>=s&&e<=s+l)return i}return null}disableUserSelect(t=!1){a(Rp,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){a(Cl,this).add(t)}removeShouldRescale(t){a(Cl,this).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*_e.PDF_TO_CSS_UNITS;for(const e of a(Cl,this))e.onScaleChanging();a(Fa,this)?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:l}=i,h=i.toString(),c=v(ht,this,wy).call(this,i).closest(".textLayer"),d=this.getSelectionBoxes(c);if(!d)return;i.empty();const u=v(ht,this,iE).call(this,c),f=a(Te,this)===pt.NONE,g=()=>{const m=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:l,text:h});f&&this.showAllEditors("highlight",!0,!0),e&&m?.editComment()};if(f){this.switchToMode(pt.HIGHLIGHT,g);return}g()}commentSelection(t=""){this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!a(En,this))return null;const e=`${vl}${t}`,i=a(En,this).getRawValue(e);return i&&a(En,this).remove(e),i}addToAnnotationStorage(t){!t.isEmpty()&&a(En,this)&&!a(En,this).has(t.id)&&a(En,this).setValue(t.id,t)}a11yAlert(t,e=null){const i=a(Op,this);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,a(Wa,this)&&(p(Wa,this,!1),v(ht,this,Mf).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of a(Bt,this))if(e.div.contains(t)){p(Ml,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!a(Ml,this))return;const[t,e]=a(Ml,this);p(Ml,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){v(ht,this,rE).call(this),this.setEditingState(!0)}removeEditListeners(){v(ht,this,MM).call(this),this.setEditingState(!1)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of a(Ei,this))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of a(Ei,this))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),a(Qn,this)?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of a(Bt,this)){const r=i.serialize(!0);r&&e.push(r)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const s of e.items)for(const o of a(Ei,this))if(o.isHandlingMimeForPasting(s.type)){o.paste(s,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){ft(`paste: "${s.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const r=this.currentLayer;try{const s=[];for(const h of i){const c=await r.deserialize(h);if(!c)return;s.push(c)}const o=()=>{for(const h of s)v(ht,this,sE).call(this,h);v(ht,this,aE).call(this,s)},l=()=>{for(const h of s)h.remove()};this.addCommands({cmd:o,undo:l,mustExec:!0})}catch(s){ft(`paste: "${s.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),a(Te,this)!==pt.NONE&&!this.isEditorHandlingKeyboard&&Nx._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,a(Wa,this)&&(p(Wa,this,!1),v(ht,this,Mf).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}updatePageIndex(t,e){for(const r of this.getEditors(t))r.pageIndex=e;const i=a(Vc,this).get(t);i&&(i.pageIndex=e,a(se,this).set(e,i),a(fs,this)?i.enable():i.disable())}startUpdatePages(){p(Vc,this,new Map(a(se,this))),a(se,this).clear()}endUpdatePages(){p(Vc,this,null)}clonePage(t,e){for(const i of this.getEditors(t)){const r=i.serialize(i.mode!==pt.HIGHLIGHT);r&&(r.pageIndex=e,r.id=this.getId(),r.isClone=!0,delete r.popupRef,a(En,this).setValue(r.id,r))}}findClonesForPage(t){const e=[],{pageIndex:i}=t;for(const[r,s]of a(En,this))s.pageIndex===i&&s.isClone&&(a(En,this).remove(r),e.push(t.deserialize(s).then(o=>{o&&(o.isClone=!0,t.addOrRebuild(o))})));return Promise.all(e)}setEditingState(t){t?(v(ht,this,PM).call(this),v(ht,this,IM).call(this),v(ht,this,mn).call(this,{isEditing:a(Te,this)!==pt.NONE,isEmpty:v(ht,this,If).call(this),hasSomethingToUndo:a(xi,this).hasSomethingToUndo(),hasSomethingToRedo:a(xi,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(v(ht,this,CM).call(this),v(ht,this,kM).call(this),v(ht,this,mn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!a(Ei,this)){p(Ei,this,t);for(const e of a(Ei,this))v(ht,this,os).call(this,e.defaultPropertiesToUpdate)}}getId(){return a(fb,this).id}get currentLayer(){return a(se,this).get(a(Na,this))}getLayer(t){return a(se,this).get(t)}get currentPageIndex(){return a(Na,this)}addLayer(t){a(se,this).set(t.pageIndex,t),a(fs,this)?t.enable():t.disable()}removeLayer(t){a(se,this).delete(t.pageIndex)}async updateMode(t,e=null,i=!1,r=!1,s=!1,o=!1){if(a(Te,this)!==t&&!(a(Ai,this)&&(await a(Ai,this).promise,!a(Ai,this)))){if(p(Ai,this,Promise.withResolvers()),a(Fa,this)?.commitOrRemove(),a(Te,this)===pt.POPUP&&a(Be,this)?.hideSidebar(),a(Be,this)?.destroyPopup(),p(Te,this,t),t===pt.NONE){this.setEditingState(!1),v(ht,this,LM).call(this);for(const l of a(de,this).values())l.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),a(Ai,this).resolve();return}for(const l of a(de,this).values())l.addStandaloneCommentButton();t===pt.SIGNATURE&&await a(Ua,this)?.loadSignatures(),i&&cn.clearPointerType(),this.setEditingState(!0),await v(ht,this,OM).call(this),this.unselectAll();for(const l of a(se,this).values())l.updateMode(t);if(t===pt.POPUP){a(Tl,this)||p(Tl,this,await a(Jc,this).getAnnotationsByType(new Set(a(Ei,this).map(c=>c._editorType))));const l=new Set,h=[];for(const c of a(de,this).values()){const{annotationElementId:d,hasComment:u,deleted:f}=c;d&&l.add(d),u&&!f&&h.push(c.getData())}for(const c of a(Tl,this)){const{id:d,popupRef:u,contentsObj:f}=c;u&&f?.str&&!l.has(d)&&!a(_a,this).has(d)&&h.push(c)}a(Be,this)?.showSidebar(h)}if(!e){r&&this.addNewEditorFromKeyboard(),a(Ai,this).resolve();return}for(const l of a(de,this).values())l.uid===e?(this.setSelected(l),o?l.editComment():s?l.enterInEditMode():l.focus()):l.unselect();a(Ai,this).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==a(Te,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(a(Ei,this)){switch(t){case wt.CREATE:this.currentLayer.addNewEditor(e);return;case wt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(a(Zc,this)||p(Zc,this,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const i of a(Bt,this))i.updateParams(t,e);else for(const i of a(Ei,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(const r of a(de,this).values())r.editorType===t&&r.show(e);(a(Zc,this)?.get(wt.HIGHLIGHT_SHOW_ALL)??!0)!==e&&v(ht,this,os).call(this,[[wt.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(a(Mp,this)!==t){p(Mp,this,t);for(const e of a(se,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of a(de,this).values())e.pageIndex===t&&(yield e)}getEditor(t){return a(de,this).get(t)}addEditor(t){a(de,this).set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(a(Er,this)&&clearTimeout(a(Er,this)),p(Er,this,setTimeout(()=>{this.focusMainContainer(),p(Er,this,null)},0))),a(de,this).delete(t.id),t.annotationElementId&&a(ps,this)?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!a(_a,this).has(t.annotationElementId))&&a(En,this)?.remove(t.id)}addDeletedAnnotationElement(t){a(_a,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return a(_a,this).has(t)}removeDeletedAnnotationElement(t){a(_a,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){a(Qn,this)!==t&&(p(Qn,this,t),t&&v(ht,this,os).call(this,t.propertiesToUpdate))}updateUI(t){DM.call(v(ht,this))===t&&v(ht,this,os).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){v(ht,this,os).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(a(Bt,this).has(t)){a(Bt,this).delete(t),t.unselect(),v(ht,this,mn).call(this,{hasSelectedEditor:this.hasSelection});return}a(Bt,this).add(t),t.select(),v(ht,this,os).call(this,t.propertiesToUpdate),v(ht,this,mn).call(this,{hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),a(Fa,this)?.commitOrRemove();for(const e of a(Bt,this))e!==t&&e.unselect();a(Be,this)?.destroyPopup(),a(Bt,this).clear(),a(Bt,this).add(t),t.select(),v(ht,this,os).call(this,t.propertiesToUpdate),v(ht,this,mn).call(this,{hasSelectedEditor:!0})}isSelected(t){return a(Bt,this).has(t)}get firstSelectedEditor(){return a(Bt,this).values().next().value}unselect(t){t.unselect(),a(Bt,this).delete(t),v(ht,this,mn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return a(Bt,this).size!==0}get isEnterHandled(){return a(Bt,this).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){a(xi,this).undo(),v(ht,this,mn).call(this,{hasSomethingToUndo:a(xi,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:v(ht,this,If).call(this)}),this._editorUndoBar?.hide()}redo(){a(xi,this).redo(),v(ht,this,mn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:a(xi,this).hasSomethingToRedo(),isEmpty:v(ht,this,If).call(this)})}addCommands(t){a(xi,this).add(t),v(ht,this,mn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:v(ht,this,If).call(this)})}cleanUndoStack(t){a(xi,this).cleanType(t)}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...a(Bt,this)],i=()=>{this._editorUndoBar?.show(r,e.length===1?e[0].editorType:e.length);for(const s of e)s.remove()},r=()=>{for(const s of e)v(ht,this,sE).call(this,s)};this.addCommands({cmd:i,undo:r,mustExec:!0})}commitOrRemove(){a(Qn,this)?.commitOrRemove()}hasSomethingToControl(){return a(Qn,this)||this.hasSelection}selectAll(){for(const t of a(Bt,this))t.commit();v(ht,this,aE).call(this,a(de,this).values())}unselectAll(){if(!(a(Qn,this)&&(a(Qn,this).commitOrRemove(),a(Te,this)!==pt.NONE))&&!a(Fa,this)?.commitOrRemove()&&(a(Be,this)?.destroyPopup(),!!this.hasSelection)){for(const t of a(Bt,this))t.unselect();a(Bt,this).clear(),v(ht,this,mn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;a(Ha,this)[0]+=t,a(Ha,this)[1]+=e;const[r,s]=a(Ha,this),o=[...a(Bt,this)],l=1e3;a(Ar,this)&&clearTimeout(a(Ar,this)),p(Ar,this,setTimeout(()=>{p(Ar,this,null),a(Ha,this)[0]=a(Ha,this)[1]=0,this.addCommands({cmd:()=>{for(const h of o)a(de,this).has(h.id)&&(h.translateInPage(r,s),h.translationDone())},undo:()=>{for(const h of o)a(de,this).has(h.id)&&(h.translateInPage(-r,-s),h.translationDone())},mustExec:!1})},l));for(const h of o)h.translateInPage(t,e),h.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),p(xr,this,new Map);for(const t of a(Bt,this))a(xr,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!a(xr,this))return!1;this.disableUserSelect(!1);const t=a(xr,this);p(xr,this,null);let e=!1;for(const[{x:r,y:s,pageIndex:o},l]of t)l.newX=r,l.newY=s,l.newPageIndex=o,e||(e=r!==l.savedX||s!==l.savedY||o!==l.savedPageIndex);if(!e)return!1;const i=(r,s,o,l)=>{if(a(de,this).has(r.id)){const h=a(se,this).get(l);h?r._setParentAndPosition(h,s,o):(r.pageIndex=l,r.x=s,r.y=o)}};return this.addCommands({cmd:()=>{for(const[r,{newX:s,newY:o,newPageIndex:l}]of t)i(r,s,o,l)},undo:()=>{for(const[r,{savedX:s,savedY:o,savedPageIndex:l}]of t)i(r,s,o,l)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(a(xr,this))for(const i of a(xr,this).keys())i.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||a(Bt,this).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return a(Qn,this)===t}getActive(){return a(Qn,this)}getMode(){return a(Te,this)}isEditingMode(){return a(Te,this)!==pt.NONE}get imageManager(){return mt(this,"imageManager",new cb)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let c=0,d=e.rangeCount;c<d;c++)if(!t.contains(e.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:r,width:s,height:o}=t.getBoundingClientRect();let l;switch(t.getAttribute("data-main-rotation")){case"90":l=(c,d,u,f)=>({x:(d-r)/o,y:1-(c+u-i)/s,width:f/o,height:u/s});break;case"180":l=(c,d,u,f)=>({x:1-(c+u-i)/s,y:1-(d+f-r)/o,width:u/s,height:f/o});break;case"270":l=(c,d,u,f)=>({x:1-(d+f-r)/o,y:(c-i)/s,width:f/o,height:u/s});break;default:l=(c,d,u,f)=>({x:(c-i)/s,y:(d-r)/o,width:u/s,height:f/o});break}const h=[];for(let c=0,d=e.rangeCount;c<d;c++){const u=e.getRangeAt(c);if(!u.collapsed)for(const{x:f,y:g,width:m,height:y}of u.getClientRects())m===0||y===0||h.push(l(f,g,m,y))}return h.length===0?null:h}addChangedExistingAnnotation({annotationElementId:t,id:e}){(a(Pl,this)||p(Pl,this,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){a(Pl,this)?.delete(t)}renderAnnotationElement(t){const e=a(Pl,this)?.get(t.data.id);if(!e)return;const i=a(En,this).getRawValue(e);i&&(a(Te,this)===pt.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,e,i){const r=a(ps,this)?.get(t);r&&(r.setCanvas(e,i),a(ps,this).delete(t))}addMissingCanvas(t,e){(a(ps,this)||p(ps,this,new Map)).set(t,e)}},D(vs,"TRANSLATE_SMALL",1),D(vs,"TRANSLATE_BIG",10),We=new WeakMap,Sr=new WeakMap,Ki=new WeakMap,Qc=new WeakMap,Tr=new WeakMap,qn=new WeakMap,qc=new WeakMap,Pr=new WeakMap,Ln=new WeakMap,ys=new WeakMap,Il=new WeakMap,Cr=new WeakMap,Mr=new WeakSet,Lp=class jv{constructor(t){ot(this,Mr),w(this,We,null),w(this,Sr,!1),w(this,Ki,null),w(this,Qc,null),w(this,Tr,null),w(this,qn,null),w(this,qc,!1),w(this,Pr,null),w(this,Ln,null),w(this,ys,null),w(this,Il,null),w(this,Cr,!1),p(Ln,this,t),p(Cr,this,t._uiManager.useNewAltTextFlow),Va._||(Va._=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){jv._l10n??(jv._l10n=t)}async render(){const t=p(Ki,this,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=p(Qc,this,document.createElement("span"));t.append(e),a(Cr,this)?(t.classList.add("new"),t.setAttribute("data-l10n-id",Va._.missing),e.setAttribute("data-l10n-id",Va._["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=a(Ln,this)._uiManager._signal;t.addEventListener("contextmenu",Jn,{signal:i}),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:i});const r=s=>{s.preventDefault(),a(Ln,this)._uiManager.editAltText(a(Ln,this)),a(Cr,this)&&a(Ln,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:kf.call(v(Mr,this))}})};return t.addEventListener("click",r,{capture:!0,signal:i}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(p(qc,this,!0),r(s))},{signal:i}),await v(Mr,this,xy).call(this),t}finish(){a(Ki,this)&&(a(Ki,this).focus({focusVisible:a(qc,this)}),p(qc,this,!1))}isEmpty(){return a(Cr,this)?a(We,this)===null:!a(We,this)&&!a(Sr,this)}hasData(){return a(Cr,this)?a(We,this)!==null||!!a(ys,this):this.isEmpty()}get guessedText(){return a(ys,this)}async setGuessedText(t){a(We,this)===null&&(p(ys,this,t),p(Il,this,await jv._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),v(Mr,this,xy).call(this))}toggleAltTextBadge(t=!1){if(!a(Cr,this)||a(We,this)){a(Pr,this)?.remove(),p(Pr,this,null);return}if(!a(Pr,this)){const e=p(Pr,this,document.createElement("div"));e.className="noAltTextBadge",a(Ln,this).div.append(e)}a(Pr,this).classList.toggle("hidden",!t)}serialize(t){let e=a(We,this);return!t&&a(ys,this)===e&&(e=a(Il,this)),{altText:e,decorative:a(Sr,this),guessedText:a(ys,this),textWithDisclaimer:a(Il,this)}}get data(){return{altText:a(We,this),decorative:a(Sr,this)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:r,cancel:s=!1}){i&&(p(ys,this,i),p(Il,this,r)),!(a(We,this)===t&&a(Sr,this)===e)&&(s||(p(We,this,t),p(Sr,this,e)),v(Mr,this,xy).call(this))}toggle(t=!1){a(Ki,this)&&(!t&&a(qn,this)&&(clearTimeout(a(qn,this)),p(qn,this,null)),a(Ki,this).disabled=!t)}shown(){a(Ln,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:kf.call(v(Mr,this))}})}destroy(){a(Ki,this)?.remove(),p(Ki,this,null),p(Qc,this,null),p(Tr,this,null),a(Pr,this)?.remove(),p(Pr,this,null)}},Va={_:null},D(Lp,"_l10n",null),Ze=new WeakMap,Si=new WeakMap,kl=new WeakMap,Xt=new WeakMap,Dp=new WeakMap,za=new WeakMap,Ti=new WeakMap,Ga=new WeakMap,Xa=new WeakMap,Rl=new WeakMap,Fp=new WeakSet,td=class{constructor(n){ot(this,Fp),w(this,Ze,null),w(this,Si,null),w(this,kl,!1),w(this,Xt,null),w(this,Dp,null),w(this,za,null),w(this,Ti,null),w(this,Ga,null),w(this,Xa,!1),w(this,Rl,null),p(Xt,this,n)}renderForToolbar(){const n=p(Si,this,document.createElement("button"));return n.className="comment",v(Fp,this,oE).call(this,n,!1)}renderForStandalone(){const n=p(Ze,this,document.createElement("button"));n.className="annotationCommentButton";const t=a(Xt,this).commentButtonPosition;if(t){const{style:e}=n;e.insetInlineEnd=`calc(${100*(a(Xt,this)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,e.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const i=a(Xt,this).commentButtonColor;i&&(e.backgroundColor=i)}return v(Fp,this,oE).call(this,n,!0)}focusButton(){setTimeout(()=>{(a(Ze,this)??a(Si,this))?.focus()},0)}onUpdatedColor(){if(!a(Ze,this))return;const n=a(Xt,this).commentButtonColor;n&&(a(Ze,this).style.backgroundColor=n),a(Xt,this)._uiManager.updatePopupColor(a(Xt,this))}get commentButtonWidth(){return(a(Ze,this)?.getBoundingClientRect().width??0)/a(Xt,this).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(a(Rl,this))return a(Rl,this);if(!a(Ze,this))return null;const{x:n,y:t,height:e}=a(Ze,this).getBoundingClientRect(),{x:i,y:r,width:s,height:o}=a(Xt,this).parent.boundingClientRect;return[(n-i)/s,(t+e-r)/o]}set commentPopupPositionInLayer(n){p(Rl,this,n)}hasDefaultPopupPosition(){return a(Rl,this)===null}removeStandaloneCommentButton(){a(Ze,this)?.remove(),p(Ze,this,null)}removeToolbarCommentButton(){a(Si,this)?.remove(),p(Si,this,null)}setCommentButtonStates({selected:n,hasPopup:t}){a(Ze,this)&&(a(Ze,this).classList.toggle("selected",n),a(Ze,this).ariaExpanded=t)}edit(n){const t=this.commentPopupPositionInLayer;let e,i;if(t)[e,i]=t;else{[e,i]=a(Xt,this).commentButtonPosition;const{width:c,height:d,x:u,y:f}=a(Xt,this);e=u+e*c,i=f+i*d}const r=a(Xt,this).parent.boundingClientRect,{x:s,y:o,width:l,height:h}=r;a(Xt,this)._uiManager.editComment(a(Xt,this),s+e*l,o+i*h,{...n,parentDimensions:r})}finish(){a(Si,this)&&(a(Si,this).focus({focusVisible:a(kl,this)}),p(kl,this,!1))}isDeleted(){return a(Xa,this)||a(Ti,this)===""}isEmpty(){return a(Ti,this)===null}hasBeenEdited(){return this.isDeleted()||a(Ti,this)!==a(Dp,this)}serialize(){return this.data}get data(){return{text:a(Ti,this),richText:a(za,this),date:a(Ga,this),deleted:this.isDeleted()}}set data(n){if(n!==a(Ti,this)&&p(za,this,null),n===null){p(Ti,this,""),p(Xa,this,!0);return}p(Ti,this,n),p(Ga,this,new Date),p(Xa,this,!1)}restoreData({text:n,richText:t,date:e}){p(Ti,this,n),p(za,this,t),p(Ga,this,e),p(Xa,this,!1)}setInitialText(n,t=null){p(Dp,this,n),this.data=n,p(Ga,this,null),p(za,this,t)}shown(){}destroy(){a(Si,this)?.remove(),p(Si,this,null),a(Ze,this)?.remove(),p(Ze,this,null),p(Ti,this,""),p(za,this,null),p(Ga,this,null),p(Xt,this,null),p(kl,this,!1),p(Xa,this,!1)}},ed=new WeakMap,Ol=new WeakMap,Np=new WeakMap,_p=new WeakMap,Bp=new WeakMap,Wp=new WeakMap,jp=new WeakMap,bs=new WeakMap,Ll=new WeakMap,ws=new WeakMap,Dl=new WeakMap,xs=new WeakMap,nd=new WeakSet,Up=class{constructor({container:n,isPinchingDisabled:t=null,isPinchingStopped:e=null,onPinchStart:i=null,onPinching:r=null,onPinchEnd:s=null,signal:o}){ot(this,nd),w(this,ed,void 0),w(this,Ol,!1),w(this,Np,null),w(this,_p,void 0),w(this,Bp,void 0),w(this,Wp,void 0),w(this,jp,void 0),w(this,bs,null),w(this,Ll,void 0),w(this,ws,null),w(this,Dl,void 0),w(this,xs,null),p(ed,this,n),p(Np,this,e),p(_p,this,t),p(Bp,this,i),p(Wp,this,r),p(jp,this,s),p(Dl,this,new AbortController),p(Ll,this,AbortSignal.any([o,a(Dl,this).signal])),n.addEventListener("touchstart",v(nd,this,FM).bind(this),{passive:!1,signal:a(Ll,this)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ds.pixelRatio}destroy(){a(Dl,this)?.abort(),p(Dl,this,null),a(bs,this)?.abort(),p(bs,this,null)}},TA=Up,Fl=new WeakMap,Zi=new WeakMap,ne=new WeakMap,Lt=new WeakMap,Es=new WeakMap,id=new WeakMap,Ya=new WeakMap,$p=new WeakMap,Je=new WeakMap,Nl=new WeakMap,As=new WeakMap,Pi=new WeakMap,Ka=new WeakMap,Hp=new WeakMap,_l=new WeakMap,Qe=new WeakMap,Vp=new WeakMap,Bl=new WeakMap,Ss=new WeakMap,Ir=new WeakMap,rd=new WeakMap,sd=new WeakMap,ti=new WeakMap,Za=new WeakMap,zp=new WeakMap,pb=new WeakMap,It=new WeakSet,St=class he{static get _resizerKeyboardManager(){const t=he.prototype._resizeWithKeyboard,e=vs.TRANSLATE_SMALL,i=vs.TRANSLATE_BIG;return mt(this,"_resizerKeyboardManager",new Sl([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],he.prototype._stopResizingWithKeyboard]]))}constructor(t){ot(this,It),w(this,Fl,null),w(this,Zi,null),w(this,ne,null),w(this,Lt,null),w(this,Es,null),w(this,id,!1),w(this,Ya,null),w(this,$p,""),w(this,Je,null),w(this,Nl,null),w(this,As,null),w(this,Pi,null),w(this,Ka,null),w(this,Hp,""),w(this,_l,!1),w(this,Qe,null),w(this,Vp,!1),w(this,Bl,!1),w(this,Ss,!1),w(this,Ir,null),w(this,rd,0),w(this,sd,0),w(this,ti,null),w(this,Za,null),D(this,"isSelected",!1),D(this,"_isCopy",!1),D(this,"_editToolbar",null),D(this,"_initialOptions",Object.create(null)),D(this,"_initialData",null),D(this,"_isVisible",!0),D(this,"_uiManager",null),D(this,"_focusEventsAllowed",!0),w(this,zp,!1),w(this,pb,he._zIndex++),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:o}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,o];const[l,h]=this.parentDimensions;this.x=t.x/l,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return mt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new VA({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(he._l10n??(he._l10n=t),he._l10nAlert??(he._l10nAlert=Object.freeze({highlight:"pdfjs-editor-highlight-added-alert",freetext:"pdfjs-editor-freetext-added-alert",ink:"pdfjs-editor-ink-added-alert",stamp:"pdfjs-editor-stamp-added-alert",signature:"pdfjs-editor-signature-added-alert"})),he._l10nResizer??(he._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),he._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);he._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Dt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return a(zp,this)}set _isDraggable(t){p(zp,this,t),this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=a(pb,this)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(v(It,this,Rf).call(this),a(Pi,this)?.remove(),p(Pi,this,null)),this.parent=t}focusin(t){this._focusEventsAllowed&&(a(_l,this)?p(_l,this,!1):this.parent.setSelected(this))}focusout(t){this._focusEventsAllowed&&this.isAttachedToDOM&&(t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,r){const[s,o]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(t+i)/s,this.y=(e+r)/o,this.fixAndSetPosition()}_moveAfterPaste(t,e){if(this.isClone){delete this.isClone;return}const[i,r]=this.parentDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r),this._onTranslated()}translate(t,e){v(It,this,lE).call(this,this.parentDimensions,t,e)}translateInPage(t,e){a(Qe,this)||p(Qe,this,[this.x,this.y,this.width,this.height]),v(It,this,lE).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){a(Qe,this)||p(Qe,this,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[r,s]}=this;if(this.x+=t/r,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:l}=this;const[h,c]=this.getBaseTranslation();o+=h,l+=c;const{style:d}=i;d.left=`${(100*o).toFixed(2)}%`,d.top=`${(100*l).toFixed(2)}%`,this._onTranslating(o,l),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!a(Qe,this)&&(a(Qe,this)[0]!==this.x||a(Qe,this)[1]!==this.y)}get _hasBeenResized(){return!!a(Qe,this)&&(a(Qe,this)[2]!==this.width||a(Qe,this)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=he,r=i/t,s=i/e;switch(this.rotation){case 90:return[-r,s];case 180:return[r,s];case 270:return[r,-s];default:return[-r,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,r]}=this;let{x:s,y:o,width:l,height:h}=this;if(l*=i,h*=r,s*=i,o*=r,this._mustFixPosition)switch(t){case 0:s=Zt(s,0,i-l),o=Zt(o,0,r-h);break;case 90:s=Zt(s,0,i-h),o=Zt(o,l,r);break;case 180:s=Zt(s,l,i),o=Zt(o,h,r);break;case 270:s=Zt(s,h,i),o=Zt(o,0,r-l);break}this.x=s/=i,this.y=o/=r;const[c,d]=this.getBaseTranslation();s+=c,o+=d,e.left=`${(100*s).toFixed(2)}%`,e.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){return hE.call(he,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return hE.call(he,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){a(ne,this)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||a(Bl,this))return this._editToolbar;this._editToolbar=new WA(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,a(ne,this)?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return a(ne,this)||(Lp.initialize(he._l10n),p(ne,this,new Lp(this)),a(Fl,this)&&(a(ne,this).data=a(Fl,this),p(Fl,this,null))),a(ne,this)}get altTextData(){return a(ne,this)?.data}set altTextData(t){a(ne,this)&&(a(ne,this).data=t)}get guessedAltText(){return a(ne,this)?.guessedText}async setGuessedAltText(t){await a(ne,this)?.setGuessedText(t)}serializeAltText(t){return a(ne,this)?.serialize(t)}hasAltText(){return!!a(ne,this)&&!a(ne,this).isEmpty()}hasAltTextData(){return a(ne,this)?.hasData()??!1}focusCommentButton(){a(Lt,this)?.focusButton()}addCommentButton(){return this.canAddComment?a(Lt,this)||p(Lt,this,new td(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(a(Es,this)){this._uiManager.isEditingMode()&&a(Es,this).classList.remove("hidden");return}this.hasComment&&(p(Es,this,a(Lt,this).renderForStandalone()),this.div.append(a(Es,this)))}}removeStandaloneCommentButton(){a(Lt,this).removeStandaloneCommentButton(),p(Es,this,null)}hideStandaloneCommentButton(){a(Es,this)?.classList.add("hidden")}get comment(){if(!a(Lt,this))return null;const{data:{richText:t,text:e,date:i,deleted:r}}=a(Lt,this);return{text:e,richText:t,date:i,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){a(Lt,this)||p(Lt,this,new td(this)),typeof t=="object"&&t!==null?a(Lt,this).restoreData(t):a(Lt,this).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:i}){if(!e||(a(Lt,this)||p(Lt,this,new td(this)),a(Lt,this).setInitialText(t,i),!this.annotationElementId))return;const r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return a(Lt,this)?.hasBeenEdited()}get hasDeletedComment(){return a(Lt,this)?.isDeleted()}get hasComment(){return!!a(Lt,this)&&!a(Lt,this).isEmpty()&&!a(Lt,this).isDeleted()}async editComment(t){a(Lt,this)||p(Lt,this,new td(this)),a(Lt,this).edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){a(Lt,this).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,r]=t.rect,[s]=this.pageDimensions,[o]=this.pageTranslation,l=o+s+1,h=r-100,c=l+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[l,h,c,r]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){a(Lt,this).data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=a(id,this)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),v(It,this,fE).call(this);const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*i/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[r,s]=this.getInitialTranslation();return this.translate(r,s),nE(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(a(Za,this)||p(Za,this,new Up({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:v(It,this,jM).bind(this),onPinching:v(It,this,UM).bind(this),onPinchEnd:v(It,this,$M).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}pointerdown(t){const{isMac:e}=Ut.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(p(_l,this,!0),this._isDraggable){v(It,this,HM).call(this,t);return}v(It,this,uE).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){a(Ir,this)&&clearTimeout(a(Ir,this)),p(Ir,this,setTimeout(()=>{p(Ir,this,null),this.parent?.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const r=this.parentScale,[s,o]=this.pageDimensions,[l,h]=this.pageTranslation,c=t/r,d=e/r,u=this.x*s,f=this.y*o,g=this.width*s,m=this.height*o;switch(i){case 0:return[u+c+l,o-f-d-m+h,u+c+g+l,o-f-d+h];case 90:return[u+d+l,o-f+c+h,u+d+m+l,o-f+c+g+h];case 180:return[u-c-g+l,o-f+d+h,u-c+l,o-f+d+m+h];case 270:return[u-d-m+l,o-f-c-g+h,u-d+l,o-f-c+h];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,r,s,o]=t,l=s-i,h=o-r;switch(this.rotation){case 0:return[i,e-o,l,h];case 90:return[i,e-r,h,l];case 180:return[s,e-r,l,h];case 270:return[s,e-o,h,l];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&he._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){a(Lt,this)?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:r,deleted:s,richText:o},uid:l,pageIndex:h,creationDate:c,modificationDate:d}=this;return{id:l,pageIndex:h,rect:this.getPDFRect(),richText:o,contentsObj:{str:t},creationDate:c,modificationDate:i||d,popupRef:!s,color:e,opacity:r}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),p(Bl,this,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),p(Bl,this,!1),!0):!1}isInEditMode(){return a(Bl,this)}shouldGetKeyboardEvents(){return a(Ss,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:r}=this.getClientDimensions(),{innerHeight:s,innerWidth:o}=window;return e<o&&r>0&&t<s&&i>0}rebuild(){v(It,this,fE).call(this)}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,i){const r=new this.prototype.constructor({parent:e,id:i.getId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});r.rotation=t.rotation,p(Fl,r,t.accessibilityData),r._isCopy=t.isCopy||!1;const[s,o]=r.pageDimensions,[l,h,c,d]=r.getRectInCurrentCoords(t.rect,o);return r.x=l/s,r.y=h/o,r.width=c/s,r.height=d/o,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(a(Ka,this)?.abort(),p(Ka,this,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),a(Ir,this)&&(clearTimeout(a(Ir,this)),p(Ir,this,null)),v(It,this,Rf).call(this),this.removeEditToolbar(),a(ti,this)){for(const t of a(ti,this).values())clearTimeout(t);p(ti,this,null)}this.parent=null,a(Za,this)?.destroy(),p(Za,this,null),a(Pi,this)?.remove(),p(Pi,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(v(It,this,BM).call(this),a(Je,this).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,r,s,o]=this.getPDFRect();return[he._round(i+(s-i)*t),he._round(r+(o-r)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return a(Lt,this).commentPopupPositionInLayer}set commentPopupPosition(t){a(Lt,this).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return a(Lt,this).hasDefaultPopupPosition()}get commentButtonWidth(){return a(Lt,this).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){a(Lt,this)?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),p(As,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=a(Je,this).children;if(!a(Zi,this)){p(Zi,this,Array.from(e));const o=v(It,this,VM).bind(this),l=v(It,this,zM).bind(this),h=this._uiManager._signal;for(const c of a(Zi,this)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",o,{signal:h}),c.addEventListener("blur",l,{signal:h}),c.addEventListener("focus",v(It,this,GM).bind(this,d),{signal:h}),c.setAttribute("data-l10n-id",he._l10nResizer[d])}}const i=a(Zi,this)[0];let r=0;for(const o of e){if(o===i)break;r++}const s=(360-this.rotation+this.parentRotation)%360/90*(a(Zi,this).length/4);if(s!==r){if(s<r)for(let l=0;l<r-s;l++)a(Je,this).append(a(Je,this).firstElementChild);else if(s>r)for(let l=0;l<s-r;l++)a(Je,this).firstElementChild.before(a(Je,this).lastElementChild);let o=0;for(const l of e){const h=a(Zi,this)[o++].getAttribute("data-resizer-name");l.setAttribute("data-l10n-id",he._l10nResizer[h])}}v(It,this,pE).call(this,0),p(Ss,this,!0),a(Je,this).firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){a(Ss,this)&&v(It,this,dE).call(this,a(Hp,this),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){v(It,this,Rf).call(this),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),a(ne,this)?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,a(Je,this)?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),a(ne,this)?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return a(Vp,this)}set isEditing(t){p(Vp,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){a(ti,this)||p(ti,this,new Map);const{action:i}=t;let r=a(ti,this).get(i);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),a(ti,this).delete(i),a(ti,this).size===0&&p(ti,this,null)},he._telemetryTimeout),a(ti,this).set(i,r);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),p(id,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),p(id,this,!0)}updateFakeAnnotationElement(t){if(!a(Pi,this)&&!this.deleted){p(Pi,this,t.addFakeAnnotation(this));return}if(this.deleted){a(Pi,this).remove(),p(Pi,this,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&a(Pi,this).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}return e}resetAnnotationElement(t){const{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}},yn=St,D(St,"_l10n",null),D(St,"_l10nAlert",null),D(St,"_l10nResizer",null),D(St,"_borderLineWidth",-1),D(St,"_colorManager",new ub),D(St,"_zIndex",1),D(St,"_telemetryTimeout",1e3),VA=class extends St{constructor(n){super(n),this.annotationElementId=n.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},gb=3285377520,Dn=4294901760,kr=65535,Gp=class{constructor(n){this.h1=n?n&4294967295:gb,this.h2=n?n&4294967295:gb}update(n){let t,e;if(typeof n=="string"){t=new Uint8Array(n.length*2),e=0;for(let m=0,y=n.length;m<y;m++){const b=n.charCodeAt(m);b<=255?t[e++]=b:(t[e++]=b>>>8,t[e++]=b&255)}}else if(ArrayBuffer.isView(n))t=n.slice(),e=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=e>>2,r=e-i*4,s=new Uint32Array(t.buffer,0,i);let o=0,l=0,h=this.h1,c=this.h2;const d=3432918353,u=461845907,f=11601,g=13715;for(let m=0;m<i;m++)m&1?(o=s[m],o=o*d&Dn|o*f&kr,o=o<<15|o>>>17,o=o*u&Dn|o*g&kr,h^=o,h=h<<13|h>>>19,h=h*5+3864292196):(l=s[m],l=l*d&Dn|l*f&kr,l=l<<15|l>>>17,l=l*u&Dn|l*g&kr,c^=l,c=c<<13|c>>>19,c=c*5+3864292196);switch(o=0,r){case 3:o^=t[i*4+2]<<16;case 2:o^=t[i*4+1]<<8;case 1:o^=t[i*4],o=o*d&Dn|o*f&kr,o=o<<15|o>>>17,o=o*u&Dn|o*g&kr,i&1?h^=o:c^=o}this.h1=h,this.h2=c}hexdigest(){let n=this.h1,t=this.h2;return n^=t>>>1,n=n*3981806797&Dn|n*36045&kr,t=t*4283543511&Dn|((t<<16|n>>>16)*2950163797&Dn)>>>16,n^=t>>>1,n=n*444984403&Dn|n*60499&kr,t=t*3301882366&Dn|((t<<16|n>>>16)*3120437893&Dn)>>>16,n^=t>>>1,(n>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},Wl=Object.freeze({map:null,hash:"",transfer:void 0}),jl=new WeakMap,Ul=new WeakMap,Rr=new WeakMap,qe=new WeakMap,mb=new WeakSet,IA=Symbol.iterator,Xp=class{constructor(){ot(this,mb),w(this,jl,!1),w(this,Ul,null),w(this,Rr,null),w(this,qe,new Map),D(this,"onSetModified",null),D(this,"onResetModified",null),D(this,"onAnnotationEditor",null)}getValue(n,t){const e=a(qe,this).get(n);return e===void 0?t:Object.assign(t,e)}getRawValue(n){return a(qe,this).get(n)}remove(n){const t=a(qe,this).get(n);t!==void 0&&(t instanceof St&&a(Rr,this).delete(t.annotationElementId),a(qe,this).delete(n),a(qe,this).size===0&&this.resetModified(),!a(qe,this).values().some(e=>e instanceof St)&&this.onAnnotationEditor?.(null))}setValue(n,t){const e=a(qe,this).get(n);let i=!1;if(e!==void 0)for(const[r,s]of Object.entries(t))e[r]!==s&&(i=!0,e[r]=s);else i=!0,a(qe,this).set(n,t);i&&v(mb,this,XM).call(this),t instanceof St&&((a(Rr,this)||p(Rr,this,new Map)).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(n){return a(qe,this).has(n)}get size(){return a(qe,this).size}resetModified(){a(jl,this)&&(p(jl,this,!1),this.onResetModified?.())}get print(){return new vb(this)}get serializable(){if(a(qe,this).size===0)return Wl;const n=new Map,t=new Gp,e=[],i=Object.create(null);let r=!1;for(const[s,o]of a(qe,this)){const l=o instanceof St?o.serialize(!1,i):o;o.page&&(o.pageIndex=o.page._pageIndex,delete o.page),l&&(n.set(s,l),t.update(`${s}:${JSON.stringify(l)}`),r||(r=!!l.bitmap))}if(r)for(const s of n.values())s.bitmap&&e.push(s.bitmap);return n.size>0?{map:n,hash:t.hexdigest(),transfer:e}:Wl}get editorStats(){let n=null;const t=new Map;let e=0,i=0;for(const s of a(qe,this).values()){var r;if(!(s instanceof St)){s.popup&&(s.popup.deleted?i+=1:e+=1);continue}s.isCommentDeleted?i+=1:s.hasEditedComment&&(e+=1);const o=s.telemetryFinalData;if(!o)continue;const{type:l}=o;t.has(l)||t.set(l,Object.getPrototypeOf(s).constructor),n||(n=Object.create(null));const h=(r=n)[l]||(r[l]=new Map);for(const[c,d]of Object.entries(o)){if(c==="type")continue;const u=h.getOrInsertComputed(c,dp);u.set(d,(u.get(d)??0)+1)}}if((i>0||e>0)&&(n||(n=Object.create(null)),n.comments={deleted:i,edited:e}),!n)return null;for(const[s,o]of t)n[s]=o.computeTelemetryFinalData(n[s]);return n}resetModifiedIds(){p(Ul,this,null)}updateEditor(n,t){const e=a(Rr,this)?.get(n);return e?(e.updateFromAnnotationLayer(t),!0):!1}getEditor(n){return a(Rr,this)?.get(n)||null}get modifiedIds(){if(a(Ul,this))return a(Ul,this);const n=[];if(a(Rr,this))for(const e of a(Rr,this).values())e.serialize()&&n.push(e.annotationElementId);let t="";if(n.length){const e=new Gp;e.update(n.join(",")),t=e.hexdigest()}return p(Ul,this,{ids:new Set(n),hash:t})}[IA](){return a(qe,this).entries()}},Yp=new WeakMap,vb=class extends Xp{constructor(n){super(),w(this,Yp,Wl);const{serializable:t}=n;if(t===Wl)return;const{map:e,hash:i,transfer:r}=t,s=structuredClone(e,r?{transfer:r}:null);p(Yp,this,{map:s,hash:i,transfer:[]})}get print(){Dt("Should not call PrintAnnotationStorage.print")}get serializable(){return a(Yp,this)}get modifiedIds(){return mt(this,"modifiedIds",{ids:new Set,hash:""})}},ut(7588),Ja="__forcedDependency",{floor:yb,ceil:bb}=Math,Kp=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],ad=new WeakMap,Qa=new WeakMap,zA=class{constructor(n,t){w(this,ad,void 0),w(this,Qa,void 0),p(ad,this,n),p(Qa,this,t)}get length(){return a(ad,this).length}isEmpty(n){return a(ad,this)[n]===Kp}minX(n){return a(Qa,this)[n*4+0]/256}minY(n){return a(Qa,this)[n*4+1]/256}maxX(n){return(a(Qa,this)[n*4+2]+1)/256}maxY(n){return(a(Qa,this)[n*4+3]+1)/256}},wb=(n,t)=>n?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),Ts=new WeakMap,Nt=new WeakMap,Qt=new WeakMap,$l=new WeakMap,Hl=new WeakMap,Vl=new WeakMap,dn=new WeakMap,Zp=new WeakSet,GA=class{constructor(n,t){ot(this,Zp),w(this,Ts,[[1,0,0,1,0,0]]),w(this,Nt,[-1/0,-1/0,1/0,1/0]),w(this,Qt,new Float64Array(Gi)),D(this,"_pendingBBoxIdx",-1),w(this,$l,void 0),w(this,Hl,void 0),w(this,Vl,void 0),w(this,dn,void 0),D(this,"_savesStack",[]),D(this,"_markedContentStack",[]),p($l,this,n.width),p(Hl,this,n.height),v(Zp,this,mE).call(this,t)}growOperationsCount(n){n>=a(dn,this).length&&v(Zp,this,mE).call(this,n,a(dn,this))}get clipBox(){return a(Nt,this)}save(n){return p(Nt,this,{__proto__:a(Nt,this)}),this._savesStack.push(n),this}restore(n,t){const e=Object.getPrototypeOf(a(Nt,this));if(e===null)return this;p(Nt,this,e);const i=this._savesStack.pop();return i!==void 0&&(t?.(i,n),a(dn,this)[n]=a(dn,this)[i]),this}recordOpenMarker(n){return this._savesStack.push(n),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(n,t){const e=this._savesStack.pop();return e!==void 0&&(t?.(e,n),a(dn,this)[n]=a(dn,this)[e]),this}beginMarkedContent(n){return this._markedContentStack.push(n),this}endMarkedContent(n,t){const e=this._markedContentStack.pop();return e!==void 0&&(t?.(e,n),a(dn,this)[n]=a(dn,this)[e]),this}pushBaseTransform(n){return a(Ts,this).push(Z.multiplyByDOMMatrix(a(Ts,this).at(-1),n.getTransform())),this}popBaseTransform(){return a(Ts,this).length>1&&a(Ts,this).pop(),this}resetBBox(n){return this._pendingBBoxIdx!==n&&(this._pendingBBoxIdx=n,a(Qt,this).set(Gi,0)),this}recordClipBox(n,t,e,i,r,s){const o=Z.multiplyByDOMMatrix(a(Ts,this).at(-1),t.getTransform()),l=Gi.slice();Z.axialAlignedBoundingBox([e,r,i,s],o,l);const h=Z.intersect(a(Nt,this),l);return h?(a(Nt,this)[0]=h[0],a(Nt,this)[1]=h[1],a(Nt,this)[2]=h[2],a(Nt,this)[3]=h[3]):(a(Nt,this)[0]=a(Nt,this)[1]=1/0,a(Nt,this)[2]=a(Nt,this)[3]=-1/0),this}recordBBox(n,t,e,i,r,s){const o=a(Nt,this);if(o[0]===1/0)return this;const l=Z.multiplyByDOMMatrix(a(Ts,this).at(-1),t.getTransform());if(o[0]===-1/0)return Z.axialAlignedBoundingBox([e,r,i,s],l,a(Qt,this)),this;const h=Gi.slice();return Z.axialAlignedBoundingBox([e,r,i,s],l,h),a(Qt,this)[0]=Zt(h[0],o[0],a(Qt,this)[0]),a(Qt,this)[1]=Zt(h[1],o[1],a(Qt,this)[1]),a(Qt,this)[2]=Zt(h[2],a(Qt,this)[2],o[2]),a(Qt,this)[3]=Zt(h[3],a(Qt,this)[3],o[3]),this}recordFullPageBBox(n){return a(Qt,this)[0]=Math.max(0,a(Nt,this)[0]),a(Qt,this)[1]=Math.max(0,a(Nt,this)[1]),a(Qt,this)[2]=Math.min(a($l,this),a(Nt,this)[2]),a(Qt,this)[3]=Math.min(a(Hl,this),a(Nt,this)[3]),this}recordOperation(n,t=!1,e){if(this._pendingBBoxIdx!==n)return this;const i=yb(a(Qt,this)[0]*256/a($l,this)),r=yb(a(Qt,this)[1]*256/a(Hl,this)),s=bb(a(Qt,this)[2]*256/a($l,this)),o=bb(a(Qt,this)[3]*256/a(Hl,this));if(gE(a(Vl,this),n,i,r,s,o),e)for(const l of e)for(const h of l)h!==n&&gE(a(Vl,this),h,i,r,s,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(n){return this._pendingBBoxIdx===n&&(this._pendingBBoxIdx=-1,a(Nt,this)[0]=Math.max(a(Nt,this)[0],a(Qt,this)[0]),a(Nt,this)[1]=Math.max(a(Nt,this)[1],a(Qt,this)[1]),a(Nt,this)[2]=Math.min(a(Nt,this)[2],a(Qt,this)[2]),a(Nt,this)[3]=Math.min(a(Nt,this)[3],a(Qt,this)[3])),this}take(){return new zA(a(dn,this),a(Vl,this))}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(n,t){return this}recordIncrementalData(n,t){return this}resetIncrementalData(n,t){return this}recordNamedData(n,t){return this}recordSimpleDataFromNamed(n,t,e){return this}recordFutureForcedDependency(n,t){return this}inheritSimpleDataAsFutureForcedDependencies(n){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(n,t,e,i=1,r=0,s=0,o){return this}getSimpleIndex(n){}recordDependencies(n,t){return this}recordNamedDependency(n,t){return this}recordShowTextOperation(n,t=!1){return this}},Fn=new WeakMap,Nn=new WeakMap,zl=new WeakMap,Ji=new WeakMap,od=new WeakMap,qa=new WeakMap,to=new WeakMap,$t=new WeakMap,XA=class{constructor(n,t=!1){w(this,Fn,{__proto__:null}),w(this,Nn,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Ja]:[]}),w(this,zl,new Map),w(this,Ji,new Set),w(this,od,new Map),w(this,qa,void 0),w(this,to,void 0),w(this,$t,void 0),p($t,this,n),t&&(p(qa,this,new Map),p(to,this,(e,i)=>{wb(a(qa,this),i).dependencies.add(e)}))}get clipBox(){return a($t,this).clipBox}growOperationsCount(n){a($t,this).growOperationsCount(n)}save(n){return p(Fn,this,{__proto__:a(Fn,this)}),p(Nn,this,{__proto__:a(Nn,this),transform:{__proto__:a(Nn,this).transform},moveText:{__proto__:a(Nn,this).moveText},sameLineText:{__proto__:a(Nn,this).sameLineText},[Ja]:{__proto__:a(Nn,this)[Ja]}}),a($t,this).save(n),this}restore(n){a($t,this).restore(n,a(to,this));const t=Object.getPrototypeOf(a(Fn,this));return t===null?this:(p(Fn,this,t),p(Nn,this,Object.getPrototypeOf(a(Nn,this))),this)}recordOpenMarker(n){return a($t,this).recordOpenMarker(n,a(to,this)),this}getOpenMarker(){return a($t,this).getOpenMarker()}recordCloseMarker(n){return a($t,this).recordCloseMarker(n,a(to,this)),this}beginMarkedContent(n){return a($t,this).beginMarkedContent(n),this}endMarkedContent(n){return a($t,this).endMarkedContent(n,a(to,this)),this}pushBaseTransform(n){return a($t,this).pushBaseTransform(n),this}popBaseTransform(){return a($t,this).popBaseTransform(),this}recordSimpleData(n,t){return a(Fn,this)[n]=t,this}recordIncrementalData(n,t){return a(Nn,this)[n].push(t),this}resetIncrementalData(n,t){return a(Nn,this)[n].length=0,this}recordNamedData(n,t){return a(zl,this).set(n,t),this}recordSimpleDataFromNamed(n,t,e){a(Fn,this)[n]=a(zl,this).get(t)??e}recordFutureForcedDependency(n,t){return this.recordIncrementalData(Ja,t),this}inheritSimpleDataAsFutureForcedDependencies(n){for(const t of n)t in a(Fn,this)&&this.recordFutureForcedDependency(t,a(Fn,this)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const n of a(Ji,this))this.recordFutureForcedDependency(Ja,n);return this}resetBBox(n){return a($t,this).resetBBox(n),this}recordClipBox(n,t,e,i,r,s){return a($t,this).recordClipBox(n,t,e,i,r,s),this}recordBBox(n,t,e,i,r,s){return a($t,this).recordBBox(n,t,e,i,r,s),this}recordCharacterBBox(n,t,e,i=1,r=0,s=0,o){const l=e.bbox;let h,c;if(l&&(h=l[2]!==l[0]&&l[3]!==l[1]&&a(od,this).get(e),h!==!1&&(c=[0,0,0,0],Z.axialAlignedBoundingBox(l,e.fontMatrix,c),(i!==1||r!==0||s!==0)&&YM(i,-i,r,s,c),h)))return this.recordBBox(n,t,c[0],c[2],c[1],c[3]);if(!o)return this.recordFullPageBBox(n);const d=o();return l&&c&&h===void 0&&(h=c[0]<=r-d.actualBoundingBoxLeft&&c[2]>=r+d.actualBoundingBoxRight&&c[1]<=s-d.actualBoundingBoxAscent&&c[3]>=s+d.actualBoundingBoxDescent,a(od,this).set(e,h),h)?this.recordBBox(n,t,c[0],c[2],c[1],c[3]):this.recordBBox(n,t,r-d.actualBoundingBoxLeft,r+d.actualBoundingBoxRight,s-d.actualBoundingBoxAscent,s+d.actualBoundingBoxDescent)}recordFullPageBBox(n){return a($t,this).recordFullPageBBox(n),this}getSimpleIndex(n){return a(Fn,this)[n]}recordDependencies(n,t){const e=a(Ji,this),i=a(Fn,this),r=a(Nn,this);for(const s of t)s in a(Fn,this)?e.add(i[s]):s in r&&r[s].forEach(e.add,e);return this}recordNamedDependency(n,t){return a(zl,this).has(t)&&a(Ji,this).add(a(zl,this).get(t)),this}recordOperation(n,t=!1){if(this.recordDependencies(n,[Ja]),a(qa,this)){const i=wb(a(qa,this),n),{dependencies:r}=i;a(Ji,this).forEach(r.add,r),a($t,this)._savesStack.forEach(r.add,r),a($t,this)._markedContentStack.forEach(r.add,r),r.delete(n),i.isRenderingOperation=!0}const e=!t&&n===a($t,this)._pendingBBoxIdx;return a($t,this).recordOperation(n,t,[a(Ji,this),a($t,this)._savesStack,a($t,this)._markedContentStack]),e&&a(Ji,this).clear(),this}recordShowTextOperation(n,t=!1){const e=Array.from(a(Ji,this));this.recordOperation(n,t),this.recordIncrementalData("sameLineText",n);for(const i of e)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(n,t=!1){const e=!t&&n===a($t,this)._pendingBBoxIdx;return a($t,this).bboxToClipBoxDropOperation(n),e&&a(Ji,this).clear(),this}take(){return a(od,this).clear(),a($t,this).take()}takeDebugMetadata(){return a(qa,this)}},Ht=new WeakMap,ue=new WeakMap,Qi=new WeakMap,eo=new WeakMap,no=new WeakMap,Jp=class vC{constructor(t,e,i){if(w(this,Ht,void 0),w(this,ue,void 0),w(this,Qi,void 0),w(this,eo,0),w(this,no,0),t instanceof vC&&a(Qi,t)===!!i)return t;p(Ht,this,t),p(ue,this,e),p(Qi,this,!!i)}get clipBox(){return a(Ht,this).clipBox}growOperationsCount(){throw new Error("Unreachable")}save(t){var e;return p(no,this,(e=a(no,this),e++,e)),a(Ht,this).save(a(ue,this)),this}restore(t){if(a(no,this)>0){var e;a(Ht,this).restore(a(ue,this)),p(no,this,(e=a(no,this),e--,e))}return this}recordOpenMarker(t){var e;return p(eo,this,(e=a(eo,this),e++,e)),this}getOpenMarker(){return a(eo,this)>0?a(ue,this):a(Ht,this).getOpenMarker()}recordCloseMarker(t){var e;return p(eo,this,(e=a(eo,this),e--,e)),this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return a(Ht,this).pushBaseTransform(t),this}popBaseTransform(){return a(Ht,this).popBaseTransform(),this}recordSimpleData(t,e){return a(Ht,this).recordSimpleData(t,a(ue,this)),this}recordIncrementalData(t,e){return a(Ht,this).recordIncrementalData(t,a(ue,this)),this}resetIncrementalData(t,e){return a(Ht,this).resetIncrementalData(t,a(ue,this)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return a(Ht,this).recordSimpleDataFromNamed(t,e,a(ue,this)),this}recordFutureForcedDependency(t,e){return a(Ht,this).recordFutureForcedDependency(t,a(ue,this)),this}inheritSimpleDataAsFutureForcedDependencies(t){return a(Ht,this).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return a(Ht,this).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return a(Qi,this)||a(Ht,this).resetBBox(a(ue,this)),this}recordClipBox(t,e,i,r,s,o){return a(Qi,this)||a(Ht,this).recordClipBox(a(ue,this),e,i,r,s,o),this}recordBBox(t,e,i,r,s,o){return a(Qi,this)||a(Ht,this).recordBBox(a(ue,this),e,i,r,s,o),this}recordCharacterBBox(t,e,i,r,s,o,l){return a(Qi,this)||a(Ht,this).recordCharacterBBox(a(ue,this),e,i,r,s,o,l),this}recordFullPageBBox(t){return a(Qi,this)||a(Ht,this).recordFullPageBBox(a(ue,this)),this}getSimpleIndex(t){return a(Ht,this).getSimpleIndex(t)}recordDependencies(t,e){return a(Ht,this).recordDependencies(a(ue,this),e),this}recordNamedDependency(t,e){return a(Ht,this).recordNamedDependency(a(ue,this),e),this}recordOperation(t){return a(Ht,this).recordOperation(a(ue,this),!0),this}recordShowTextOperation(t){return a(Ht,this).recordShowTextOperation(a(ue,this),!0),this}bboxToClipBoxDropOperation(t){return a(Qi,this)||a(Ht,this).bboxToClipBoxDropOperation(a(ue,this),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}},_n={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Gl=new WeakMap,Xl=new WeakMap,io=new WeakMap,ro=new WeakMap,Yl=new WeakMap,YA=class{constructor(n){w(this,Gl,void 0),w(this,Xl,void 0),w(this,io,4),w(this,ro,0),w(this,Yl,new xb._(a(io,this)*6)),p(Gl,this,n.width),p(Xl,this,n.height)}record(n,t,e,i){var r;if(a(ro,this)===a(io,this)){p(io,this,a(io,this)*2);const l=new xb._(a(io,this)*6);l.set(a(Yl,this)),p(Yl,this,l)}const s=Gt(n);let o;if(i[0]!==1/0){const l=Gi.slice();Z.axialAlignedBoundingBox([0,-e,t,0],s,l);const h=Z.intersect(i,l);if(!h)return;const[c,d,u,f]=h;if(c!==l[0]||d!==l[1]||u!==l[2]||f!==l[3]){const g=Math.atan2(s[1],s[0]),m=Math.abs(Math.sin(g)),y=Math.abs(Math.cos(g));if(m<1e-6||y<1e-6||Math.abs(m-y)<1e-6)o=[c,d,c,f,u,d];else{const b=u-c,x=f-d,E=m*m,S=y*y,T=y*m,A=S-E,P=(x*S-b*T)/A;o=[c+(x*T-b*E)/A,d,c,d+P,u,f-P]}}}o||(o=[0,-e,0,0,t,-e],Z.applyTransform(o,s,0),Z.applyTransform(o,s,2),Z.applyTransform(o,s,4)),o[0]/=a(Gl,this),o[1]/=a(Xl,this),o[2]/=a(Gl,this),o[3]/=a(Xl,this),o[4]/=a(Gl,this),o[5]/=a(Xl,this),a(Yl,this).set(o,a(ro,this)*6),p(ro,this,(r=a(ro,this),r++,r))}take(){return a(Yl,this).subarray(0,a(ro,this)*6)}},xb={_:Ut.isFloat16ArraySupported?Float16Array:Float32Array},ld=new WeakMap,KA=class{constructor({ownerDocument:n=globalThis.document,styleElement:t=null}){w(this,ld,new Set),this._document=n,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(n){this.nativeFontFaces.add(n),this._document.fonts.add(n)}removeNativeFontFace(n){this.nativeFontFaces.delete(n),this._document.fonts.delete(n)}insertRule(n){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(n,t.cssRules.length)}clear(){for(const n of this.nativeFontFaces)this._document.fonts.delete(n);this.nativeFontFaces.clear(),a(ld,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:n,disableFontFace:t,_inspectFont:e}){if(!(!n||a(ld,this).has(n.loadedName))){if(te(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:r,style:s}=n,o=new FontFace(i,r,s);this.addNativeFontFace(o);try{await o.load(),a(ld,this).add(i),e?.(n)}catch{ft(`Cannot load system font: ${n.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Dt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(n){if(n.attached||n.missingFile&&!n.systemFontInfo)return;if(n.attached=!0,n.systemFontInfo){await this.loadSystemFont(n);return}if(this.isFontLoadingAPISupported){const e=n.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw ft(`Failed to load font '${e.family}': '${i}'.`),n.disableFontFace=!0,i}}return}const t=n.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(n,i)})}}get isFontLoadingAPISupported(){const n=!!this._document?.fonts;return mt(this,"isFontLoadingAPISupported",n)}get isSyncFontLoadingSupported(){return mt(this,"isSyncFontLoadingSupported",bn||Ut.platform.isFirefox)}_queueLoadingCallback(n){function t(){for(te(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const r=e.shift();setTimeout(r.callback,0)}}const{loadingRequests:e}=this,i={done:!1,complete:t,callback:n};return e.push(i),i}get _loadTestFont(){const n=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return mt(this,"_loadTestFont",n)}_prepareFontLoadEvent(n,t){function e(E,S){return E.charCodeAt(S)<<24|E.charCodeAt(S+1)<<16|E.charCodeAt(S+2)<<8|E.charCodeAt(S+3)&255}function i(E){return String.fromCharCode(E>>24&255,E>>16&255,E>>8&255,E&255)}function r(E,S,T,A){const P=E.substring(0,S),C=E.substring(S+T);return P+A+C}let s,o;const l=this._document.createElement("canvas");l.width=1,l.height=1;const h=l.getContext("2d");let c=0;function d(E,S){if(++c>30){ft("Load test font never loaded."),S();return}if(h.font="30px "+E,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(d.bind(null,E,S))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=r(f,976,u.length,u);const g=16,m=1482184792;let y=e(f,g);for(s=0,o=u.length-3;s<o;s+=4)y=y-m+e(u,s)|0;s<u.length&&(y=y-m+e(u+"XXX",s)|0),f=r(f,g,4,i(y));const b=`@font-face {font-family:"${u}";src:${`url(data:font/opentype;base64,${btoa(f)});`}}`;this.insertRule(b);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const E of[n.loadedName,u]){const S=this._document.createElement("span");S.textContent="Hi",S.style.fontFamily=E,x.append(S)}this._document.body.append(x),d(u,()=>{x.remove(),t.complete()})}},Vt=new WeakMap,ZA=class{constructor(n,t=null,e,i){D(this,"compiledGlyphs",Object.create(null)),w(this,Vt,void 0),p(Vt,this,n),this._inspectFont=t,e&&(this.charProcOperatorList=e),i&&Object.assign(this,i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let n;if(!this.cssFontInfo)n=new FontFace(this.loadedName,this.data,{});else{const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),n=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),n}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const n=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${n}}`;else{let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${n}}`}return this._inspectFont?.(this,n),t}getPathGenerator(n,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const e=this.loadedName+"_path_"+t;let i;try{i=n.get(e)}catch(s){ft(`getPathGenerator - ignoring character: "${s}".`)}const r=tE(i?.path);return this.fontExtraProperties||n.delete(e),this.compiledGlyphs[t]=r}get black(){return a(Vt,this).black}get bold(){return a(Vt,this).bold}get disableFontFace(){return a(Vt,this).disableFontFace}set disableFontFace(n){mt(this,"disableFontFace",!!n)}get fontExtraProperties(){return a(Vt,this).fontExtraProperties}get isInvalidPDFjsFont(){return a(Vt,this).isInvalidPDFjsFont}get isType3Font(){return a(Vt,this).isType3Font}get italic(){return a(Vt,this).italic}get missingFile(){return a(Vt,this).missingFile}get remeasure(){return a(Vt,this).remeasure}get vertical(){return a(Vt,this).vertical}get ascent(){return a(Vt,this).ascent}get defaultWidth(){return a(Vt,this).defaultWidth}get descent(){return a(Vt,this).descent}get bbox(){return a(Vt,this).bbox}get fontMatrix(){return a(Vt,this).fontMatrix}get fallbackName(){return a(Vt,this).fallbackName}get loadedName(){return a(Vt,this).loadedName}get mimetype(){return a(Vt,this).mimetype}get name(){return a(Vt,this).name}get data(){return a(Vt,this).data}clearData(){a(Vt,this).clearData()}get cssFontInfo(){return a(Vt,this).cssFontInfo}get systemFontInfo(){return a(Vt,this).systemFontInfo}get defaultVMetrics(){return a(Vt,this).defaultVMetrics}},Eb=class{},D(Eb,"strings",["fontFamily","fontWeight","italicAngle"]),Ab=class{},D(Ab,"strings",["css","loadedName","baseFontName","src"]),fe=class{},Ta=fe,D(fe,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),D(fe,"numbers",["ascent","defaultWidth","descent"]),D(fe,"strings",["fallbackName","loadedName","mimetype","name"]),D(fe,"OFFSET_NUMBERS",Math.ceil(Ta.bools.length*2/8)),D(fe,"OFFSET_BBOX",Ta.OFFSET_NUMBERS+Ta.numbers.length*8),D(fe,"OFFSET_FONT_MATRIX",Ta.OFFSET_BBOX+1+8),D(fe,"OFFSET_DEFAULT_VMETRICS",Ta.OFFSET_FONT_MATRIX+1+48),D(fe,"OFFSET_STRINGS",Ta.OFFSET_DEFAULT_VMETRICS+1+6),tn=class{},D(tn,"KIND",0),D(tn,"HAS_BBOX",1),D(tn,"HAS_BACKGROUND",2),D(tn,"SHADING_TYPE",3),D(tn,"N_COORD",4),D(tn,"N_COLOR",8),D(tn,"N_STOP",12),D(tn,"N_FIGURES",16),Qp=new WeakMap,Sb=new WeakMap,hd=new WeakMap,cd=new WeakSet,JA=class{constructor(n){ot(this,cd),w(this,Qp,void 0),w(this,Sb,new TextDecoder),w(this,hd,void 0),p(Qp,this,n),p(hd,this,new DataView(n))}get fontFamily(){return v(cd,this,Sy).call(this,0)}get fontWeight(){return v(cd,this,Sy).call(this,1)}get italicAngle(){return v(cd,this,Sy).call(this,2)}},Kl=new WeakMap,dd=new WeakMap,Or=new WeakMap,Zl=new WeakSet,QA=class{constructor(n){ot(this,Zl),w(this,Kl,void 0),w(this,dd,new TextDecoder),w(this,Or,void 0),p(Kl,this,n),p(Or,this,new DataView(n))}get guessFallback(){return a(Or,this).getUint8(0)!==0}get css(){return v(Zl,this,Of).call(this,0)}get loadedName(){return v(Zl,this,Of).call(this,1)}get baseFontName(){return v(Zl,this,Of).call(this,2)}get src(){return v(Zl,this,Of).call(this,3)}get style(){let n=1;n+=4+a(Or,this).getUint32(n);const t=a(Or,this).getUint32(n),e=a(dd,this).decode(new Uint8Array(a(Kl,this),n+4,t));n+=4+t;const i=a(Or,this).getUint32(n);return{style:e,weight:a(dd,this).decode(new Uint8Array(a(Kl,this),n+4,i))}}},qi=new WeakMap,Tb=new WeakMap,xe=new WeakMap,qt=new WeakSet,qA=class{constructor({buffer:n,extra:t}){ot(this,qt),w(this,qi,void 0),w(this,Tb,new TextDecoder),w(this,xe,void 0),p(qi,this,n),p(xe,this,new DataView(n)),t&&Object.assign(this,t)}get black(){return v(qt,this,Vi).call(this,0)}get bold(){return v(qt,this,Vi).call(this,1)}get disableFontFace(){return v(qt,this,Vi).call(this,2)}get fontExtraProperties(){return v(qt,this,Vi).call(this,3)}get isInvalidPDFjsFont(){return v(qt,this,Vi).call(this,4)}get isType3Font(){return v(qt,this,Vi).call(this,5)}get italic(){return v(qt,this,Vi).call(this,6)}get missingFile(){return v(qt,this,Vi).call(this,7)}get remeasure(){return v(qt,this,Vi).call(this,8)}get vertical(){return v(qt,this,Vi).call(this,9)}get ascent(){return v(qt,this,Ty).call(this,0)}get defaultWidth(){return v(qt,this,Ty).call(this,1)}get descent(){return v(qt,this,Ty).call(this,2)}get bbox(){return v(qt,this,Py).call(this,fe.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return v(qt,this,Py).call(this,fe.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return v(qt,this,Py).call(this,fe.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}get fallbackName(){return v(qt,this,Lf).call(this,0)}get loadedName(){return v(qt,this,Lf).call(this,1)}get mimetype(){return v(qt,this,Lf).call(this,2)}get name(){return v(qt,this,Lf).call(this,3)}get data(){const{offset:n,length:t}=v(qt,this,vE).call(this);return t===0?void 0:new Uint8Array(a(qi,this),n+4,t)}clearData(){const{offset:n,length:t}=v(qt,this,vE).call(this);t!==0&&(a(xe,this).setUint32(n,0),p(qi,this,new Uint8Array(a(qi,this),0,n+4).slice().buffer),p(xe,this,new DataView(a(qi,this))))}get cssFontInfo(){let n=fe.OFFSET_STRINGS;const t=a(xe,this).getUint32(n);n+=4+t;const e=a(xe,this).getUint32(n);n+=4+e;const i=a(xe,this).getUint32(n);if(i===0)return null;const r=new Uint8Array(i);return r.set(new Uint8Array(a(qi,this),n+4,i)),new JA(r.buffer)}get systemFontInfo(){let n=fe.OFFSET_STRINGS;const t=a(xe,this).getUint32(n);n+=4+t;const e=a(xe,this).getUint32(n);if(e===0)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(a(qi,this),n+4,e)),new QA(i.buffer)}},tS=class{constructor(n){this.buffer=n,this.view=new DataView(n),this.data=new Uint8Array(n)}getIR(){const n=this.view,t=this.data[tn.KIND],e=!!this.data[tn.HAS_BBOX],i=!!this.data[tn.HAS_BACKGROUND],r=n.getUint32(tn.N_COORD,!0),s=n.getUint32(tn.N_COLOR,!0),o=n.getUint32(tn.N_STOP,!0);let l=20;const h=new Float32Array(this.buffer,l,r*2);l+=r*8;const c=new Uint8Array(this.buffer,l,s*4);l+=s*4;const d=[];for(let g=0;g<o;++g){const m=n.getFloat32(l,!0);l+=4;const y=n.getUint32(l,!0);l+=4,d.push([m,`#${y.toString(16).padStart(6,"0")}`])}let u=null;if(e){u=[];for(let g=0;g<4;++g)u.push(n.getFloat32(l,!0)),l+=4}let f=null;if(i&&(f=new Uint8Array(this.buffer,l,3),l+=3),t===1)return["RadialAxial","axial",u,d,Array.from(h.slice(0,2)),Array.from(h.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",u,d,[h[0],h[1]],[h[3],h[4]],h[2],h[5]];if(t===3){const g=this.data[tn.SHADING_TYPE];let m=null;if(h.length>0){m=Gi.slice();for(let y=0,b=h.length;y<b;y+=2)Z.pointBoundingBox(h[y],h[y+1],m)}return["Mesh",g,h,c,r,m,u,f]}throw new Error(`Unsupported pattern kind: ${t}`)}},ud=new WeakMap,eS=class{constructor(n){w(this,ud,void 0),p(ud,this,n)}get path(){return Ut.isFloat16ArraySupported?new Float16Array(a(ud,this)):new Float32Array(a(ud,this))}},qp=n=>typeof n=="object"&&Number.isInteger(n?.num)&&n.num>=0&&Number.isInteger(n?.gen)&&n.gen>=0,nS=n=>typeof n=="object"&&typeof n?.name=="string",iS=cM.bind(null,qp,nS),Ps=new WeakMap,Pb=new WeakMap,rS=class{constructor(){w(this,Ps,new Map),w(this,Pb,Promise.resolve())}postMessage(n,t){const e={data:structuredClone(n,t?{transfer:t}:null)};a(Pb,this).then(()=>{for(const[i]of a(Ps,this))i.call(this,e)})}addEventListener(n,t,e=null){let i=null;if(e?.signal instanceof AbortSignal){const{signal:r}=e;if(r.aborted){ft("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(n,t);i=()=>r.removeEventListener("abort",s),r.addEventListener("abort",s)}a(Ps,this).set(t,i)}removeEventListener(n,t){a(Ps,this).get(t)?.(),a(Ps,this).delete(t)}terminate(){for(const[,n]of a(Ps,this))n?.();a(Ps,this).clear()}},ut(1689),fd={DATA:1,ERROR:2},pe={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8},pd=new WeakMap,Cs=new WeakSet,Jl=class{constructor(n,t,e){ot(this,Cs),w(this,pd,new AbortController),this.sourceName=n,this.targetName=t,this.comObj=e,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),e.addEventListener("message",v(Cs,this,JM).bind(this),{signal:a(pd,this).signal})}on(n,t){const e=this.actionHandler;if(e[n])throw new Error(`There is already an actionName called "${n}"`);e[n]=t}send(n,t,e){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:n,data:t},e)}sendWithPromise(n,t,e){const i=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[i]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:n,callbackId:i,data:t},e)}catch(s){r.reject(s)}return r.promise}sendWithStream(n,t,e,i){const r=this.streamId++,s=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[r]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:s,targetName:o,action:n,streamId:r,data:t,desiredSize:h.desiredSize},i),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[r].pullCall=c,l.postMessage({sourceName:s,targetName:o,stream:pe.PULL,streamId:r,desiredSize:h.desiredSize}),c.promise},cancel:h=>{te(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[r].cancelCall=c,this.streamControllers[r].isClosed=!0,l.postMessage({sourceName:s,targetName:o,stream:pe.CANCEL,streamId:r,reason:vn(h)}),c.promise}},e)}destroy(){a(pd,this)?.abort(),p(pd,this,null)}},Cb=new WeakMap,Mb=class{constructor({cMapUrl:n=null,standardFontDataUrl:t=null,wasmUrl:e=null}){w(this,Cb,Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"})),this.cMapUrl=n,this.standardFontDataUrl=t,this.wasmUrl=e}async fetch({kind:n,filename:t}){switch(n){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:Dt(`Not implemented: ${n}`)}const e=this[n];if(!e)throw new Error(`Ensure that the \`${n}\` API parameter is provided.`);const i=`${e}${t}`;return this._fetch(i,n).catch(r=>{throw new Error(`Unable to load ${a(Cb,this)[n]} data at: ${i}`)})}async _fetch(n,t){Dt("Abstract method `_fetch` called.")}},Ib=class extends Mb{async _fetch(n,t){const e=await my(n,t==="cMapUrl"&&!n.endsWith(".bcmap")?"text":"bytes");return e instanceof Uint8Array?e:Tf(e)}},tg=new WeakMap,kb=class{constructor({enableHWA:n=!1}){w(this,tg,!1),p(tg,this,n)}create(n,t){if(n<=0||t<=0)throw new Error("Invalid canvas size");const e=this._createCanvas(n,t);return{canvas:e,context:e.getContext("2d",{willReadFrequently:!a(tg,this)})}}reset({canvas:n},t,e){if(!n)throw new Error("Canvas is not specified");if(t<=0||e<=0)throw new Error("Invalid canvas size");n.width=t,n.height=e}destroy(n){const{canvas:t}=n;if(!t)throw new Error("Canvas is not specified");t.width=t.height=0,n.canvas=null,n.context=null}_createCanvas(n,t){Dt("Abstract method `_createCanvas` called.")}},sS=class extends kb{constructor({ownerDocument:n=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=n}_createCanvas(n,t){const e=this._document.createElement("canvas");return e.width=n,e.height=t,e}},Rb=class{addFilter(n){return"none"}addHCMFilter(n,t){return"none"}addAlphaFilter(n){return"none"}addLuminosityFilter(n){return"none"}addKnockoutFilter(n=0){return"none"}addHighlightHCMFilter(n,t,e,i,r){return"none"}addSelectionHCMFilter(n,t){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(n=null){return null}destroy(n=!1){}},Ql=new WeakMap,ql=new WeakMap,Ms=new WeakMap,Lr=new WeakMap,je=new WeakMap,so=new WeakMap,Ci=new WeakMap,rt=new WeakSet,aS=class extends Rb{constructor({docId:n,ownerDocument:t=globalThis.document}){super(),ot(this,rt),w(this,Ql,void 0),w(this,ql,void 0),w(this,Ms,void 0),w(this,Lr,void 0),w(this,je,void 0),w(this,so,void 0),w(this,Ci,0),p(Lr,this,n),p(je,this,t)}addFilter(n){var t,e;if(!n)return"none";let i=Fe.call(v(rt,this)).get(n);if(i)return i;const[r,s,o]=v(rt,this,My).call(this,n),l=n.length===1?r:`${r}${s}${o}`;if(i=Fe.call(v(rt,this)).get(l),i)return Fe.call(v(rt,this)).set(n,i),i;const h=`g_${a(Lr,this)}_transfer_map_${p(Ci,this,(t=a(Ci,this),e=t++,t)),e}`,c=v(rt,this,ul).call(this,h);Fe.call(v(rt,this)).set(n,c),Fe.call(v(rt,this)).set(l,c);const d=v(rt,this,fl).call(this,h);return v(rt,this,_f).call(this,r,s,o,d),c}addHCMFilter(n,t){const e=`${n}-${t}`,i="base";let r=Ff.call(v(rt,this)).get(i);if(r?.key===e||(r?(r.filter?.remove(),r.key=e,r.url="none",r.filter=null):(r={key:e,url:"none",filter:null},Ff.call(v(rt,this)).set(i,r)),!n||!t))return r.url;const s=v(rt,this,Bf).call(this,n);n=Z.makeHexColor(...s);const o=v(rt,this,Bf).call(this,t);if(t=Z.makeHexColor(...o),Ea.call(v(rt,this)).style.color="",n==="#000000"&&t==="#ffffff"||n===t)return r.url;const l=new Array(256);for(let f=0;f<=255;f++){const g=f/255;l[f]=g<=.03928?g/12.92:((g+.055)/1.055)**2.4}const h=l.join(","),c=`g_${a(Lr,this)}_hcm_filter`,d=r.filter=v(rt,this,fl).call(this,c);v(rt,this,_f).call(this,h,h,h,d),v(rt,this,bE).call(this,d);const u=(f,g)=>{const m=s[f]/255,y=o[f]/255,b=new Array(g+1);for(let x=0;x<=g;x++)b[x]=m+x/g*(y-m);return b.join(",")};return v(rt,this,_f).call(this,u(0,5),u(1,5),u(2,5),d),r.url=v(rt,this,ul).call(this,c),r.url}addSelectionHCMFilter(n,t){return this.addHighlightHCMFilter("selection",n,t,"HighlightText","Highlight")}addSelectionFilter(){return this.addHighlightHCMFilter("selection_default","black","white","HighlightText","Highlight")}createSelectionStyle(n=null){const t=n?this.addSelectionHCMFilter(n.foreground,n.background):this.addSelectionFilter();return t==="none"||!Ut.platform.isFirefox?null:{"backdrop-filter":t,"background-color":"transparent"}}addAlphaFilter(n){var t,e;let i=Fe.call(v(rt,this)).get(n);if(i)return i;const[r]=v(rt,this,My).call(this,[n]),s=`alpha_${r}`;if(i=Fe.call(v(rt,this)).get(s),i)return Fe.call(v(rt,this)).set(n,i),i;const o=`g_${a(Lr,this)}_alpha_map_${p(Ci,this,(t=a(Ci,this),e=t++,t)),e}`,l=v(rt,this,ul).call(this,o);Fe.call(v(rt,this)).set(n,l),Fe.call(v(rt,this)).set(s,l);const h=v(rt,this,fl).call(this,o);return v(rt,this,wE).call(this,r,h),l}addLuminosityFilter(n){var t,e;let i=Fe.call(v(rt,this)).get(n||"luminosity");if(i)return i;let r,s;if(n?([r]=v(rt,this,My).call(this,[n]),s=`luminosity_${r}`):s="luminosity",i=Fe.call(v(rt,this)).get(s),i)return Fe.call(v(rt,this)).set(n,i),i;const o=`g_${a(Lr,this)}_luminosity_map_${p(Ci,this,(t=a(Ci,this),e=t++,t)),e}`,l=v(rt,this,ul).call(this,o);Fe.call(v(rt,this)).set(n,l),Fe.call(v(rt,this)).set(s,l);const h=v(rt,this,fl).call(this,o);return v(rt,this,tI).call(this,h),n&&v(rt,this,wE).call(this,r,h),l}addKnockoutFilter(n=0){var t,e;const i=n>0?Math.min(1/n,1e6):1e6,r=`knockout_${i}`,s=Fe.call(v(rt,this)).get(r);if(s)return s;const o=`g_${a(Lr,this)}_knockout_filter_${p(Ci,this,(t=a(Ci,this),e=t++,t)),e}`,l=v(rt,this,ul).call(this,o);Fe.call(v(rt,this)).set(r,l);const h=v(rt,this,fl).call(this,o),c=a(je,this).createElementNS(wn,"feComponentTransfer");h.append(c);const d=a(je,this).createElementNS(wn,"feFuncA");return d.setAttribute("type","linear"),d.setAttribute("slope",`${i}`),d.setAttribute("intercept","0"),c.append(d),l}addHighlightHCMFilter(n,t,e,i,r){const s=`${t}-${e}-${i}-${r}`;let o=Ff.call(v(rt,this)).get(n);if(o?.key===s||(o?(o.filter?.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},Ff.call(v(rt,this)).set(n,o)),!t||!e))return o.url;const[l,h]=[t,e].map(v(rt,this,Bf).bind(this));let c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[u,f]=[i,r].map(v(rt,this,nI).bind(this));d<c&&([c,d,u,f]=[d,c,f,u]),Ea.call(v(rt,this)).style.color="";const g=(b,x,E)=>{const S=new Array(256),T=(d-c)/E,A=b/255,P=(x-b)/(255*E);let C=0;for(let M=0;M<=E;M++){const I=Math.round(c+M*T),k=A+M*P;for(let O=C;O<=I;O++)S[O]=k;C=I+1}for(let M=C;M<256;M++)S[M]=S[C-1];return S.join(",")},m=`g_${a(Lr,this)}_hcm_${n}_filter`,y=o.filter=v(rt,this,fl).call(this,m);return v(rt,this,bE).call(this,y),v(rt,this,_f).call(this,g(u[0],f[0],5),g(u[1],f[1],5),g(u[2],f[2],5),y),o.url=v(rt,this,ul).call(this,m),o.url}destroy(n=!1){n&&a(so,this)?.size||(a(Ms,this)?.parentNode.parentNode.remove(),p(Ms,this,null),a(ql,this)?.clear(),p(ql,this,null),a(so,this)?.clear(),p(so,this,null),p(Ci,this,0))}},bn){let n;try{const t=process.getBuiltinModule("module").createRequire(document.currentScript?.src||location.href);try{n=t("@napi-rs/canvas")}catch(e){ft(`Cannot load "@napi-rs/canvas" package: "${e}".`)}}catch(t){ft(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(n?.DOMMatrix?globalThis.DOMMatrix=n.DOMMatrix:ft("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(n?.ImageData?globalThis.ImageData=n.ImageData:ft("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(n?.Path2D?globalThis.Path2D=n.Path2D:ft("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}oS=class extends Rb{},lS=class extends kb{_createCanvas(n,t){return process.getBuiltinModule("module").createRequire(document.currentScript?.src||location.href)("@napi-rs/canvas").createCanvas(n,t)}},hS=class extends Mb{async _fetch(n,t){return iI(n)}},cS=`
42
+ struct Uniforms {
43
+ offsetX : f32,
44
+ offsetY : f32,
45
+ scaleX : f32,
46
+ scaleY : f32,
47
+ paddedWidth : f32,
48
+ paddedHeight : f32,
49
+ borderSize : f32,
50
+ _pad : f32,
51
+ };
52
+
53
+ @group(0) @binding(0) var<uniform> u : Uniforms;
54
+
55
+ struct VertexInput {
56
+ @location(0) position : vec2<f32>,
57
+ @location(1) color : vec4<f32>,
58
+ };
59
+
60
+ struct VertexOutput {
61
+ @builtin(position) position : vec4<f32>,
62
+ @location(0) color : vec3<f32>,
63
+ };
64
+
65
+ @vertex
66
+ fn vs_main(in : VertexInput) -> VertexOutput {
67
+ var out : VertexOutput;
68
+ let cx = (in.position.x + u.offsetX) * u.scaleX;
69
+ let cy = (in.position.y + u.offsetY) * u.scaleY;
70
+ out.position = vec4<f32>(
71
+ ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
72
+ 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
73
+ 0.0,
74
+ 1.0
75
+ );
76
+ out.color = in.color.rgb;
77
+ return out;
78
+ }
79
+
80
+ @fragment
81
+ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
82
+ return vec4<f32>(in.color, 1.0);
83
+ }
84
+ `,eg=new WeakMap,Is=new WeakMap,th=new WeakMap,gd=new WeakMap,Ob=new WeakSet,dS=class{constructor(){ot(this,Ob),w(this,eg,null),w(this,Is,null),w(this,th,null),w(this,gd,null)}init(){return a(eg,this)||p(eg,this,v(Ob,this,rI).call(this))}get isReady(){return a(Is,this)!==null}loadMeshShader(){if(!a(Is,this)||a(th,this))return;const n=a(Is,this).createShaderModule({code:cS});p(th,this,a(Is,this).createRenderPipeline({layout:"auto",vertex:{module:n,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:n,entryPoint:"fs_main",targets:[{format:a(gd,this)}]},primitive:{topology:"triangle-list"}}))}draw(n,t,e,i,r,s,o,l){this.loadMeshShader();const h=a(Is,this),{offsetX:c,offsetY:d,scaleX:u,scaleY:f}=i,g=h.createBuffer({size:Math.max(n.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});n.byteLength>0&&h.queue.writeBuffer(g,0,n);const m=h.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&h.queue.writeBuffer(m,0,t);const y=h.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});h.queue.writeBuffer(y,0,new Float32Array([c,d,u,f,s,o,l,0]));const b=h.createBindGroup({layout:a(th,this).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:y}}]}),x=new OffscreenCanvas(s,o),E=x.getContext("webgpu");E.configure({device:h,format:a(gd,this),alphaMode:r?"opaque":"premultiplied"});const S=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},T=h.createCommandEncoder(),A=T.beginRenderPass({colorAttachments:[{view:E.getCurrentTexture().createView(),clearValue:S,loadOp:"clear",storeOp:"store"}]});return e>0&&(A.setPipeline(a(th,this)),A.setBindGroup(0,b),A.setVertexBuffer(0,g),A.setVertexBuffer(1,m),A.draw(e)),A.end(),h.queue.submit([T.finish()]),g.destroy(),m.destroy(),y.destroy(),x.transferToImageBitmap()}},md=new dS,Ie={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"},ng=class{isModifyingCurrentTransform(){return!1}getPattern(){Dt("Abstract method `getPattern` called.")}},uS=class extends ng{constructor(n){super(),this._type=n[1],this._bbox=n[2],this._colorStops=n[3],this._p0=n[4],this._p1=n[5],this._r0=n[6],this._r1=n[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}areConic(){if(!this.isRadial())return!1;const n=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return n+this._r1>this._r0&&n+this._r0>this._r1}_createGradient(n,t=null){let e,i=this._p0,r=this._p1;if(t&&(i=i.slice(),r=r.slice(),Z.applyTransform(i,t),Z.applyTransform(r,t)),this._type==="axial")e=n.createLinearGradient(i[0],i[1],r[0],r[1]);else if(this._type==="radial"){let s=this._r0,o=this._r1;if(t){const l=new Float32Array(2);Z.singularValueDecompose2dScale(t,l),s*=l[0],o*=l[0]}e=n.createRadialGradient(i[0],i[1],s,r[0],r[1],o)}for(const s of this._colorStops)e.addColorStop(s[0],s[1]);return e}_createReversedGradient(n,t=null){let e=this._p1,i=this._p0;t&&(e=e.slice(),i=i.slice(),Z.applyTransform(e,t),Z.applyTransform(i,t));let r=this._r1,s=this._r0;if(t){const h=new Float32Array(2);Z.singularValueDecompose2dScale(t,h),r*=h[0],s*=h[0]}const o=n.createRadialGradient(e[0],e[1],r,i[0],i[1],s),l=this._colorStops.map(([h,c])=>[1-h,c]).reverse();for(const[h,c]of l)o.addColorStop(h,c);return o}getPattern(n,t,e,i){let r;if(i===Ie.STROKE||i===Ie.FILL){if(this.isOriginBased()){let u=Z.transform(e,t.baseTransform);this.matrix&&(u=Z.transform(u,this.matrix));const f=.001,g=Math.hypot(u[0],u[1]),m=Math.hypot(u[2],u[3]),y=(u[0]*u[2]+u[1]*u[3])/(g*m);if(Math.abs(y)<f)if(this.isRadial()){if(Math.abs(g-m)<f)return this._createGradient(n,u)}else return this._createGradient(n,u)}const s=t.current.getClippedPathBoundingBox(i,Gt(n))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,h=t.canvasFactory.create(o,l),c=h.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-s[0],-s[1]),e=Z.transform(e,[1,0,0,1,s[0],s[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),Wf(c,this._bbox),this.areConic()&&(c.fillStyle=this._createReversedGradient(c),c.fill()),c.fillStyle=this._createGradient(c),c.fill(),r=n.createPattern(h.canvas,"no-repeat"),t.canvasFactory.destroy(h);const d=new DOMMatrix(e);r.setTransform(d)}else this.areConic()&&(n.save(),Wf(n,this._bbox),n.fillStyle=this._createReversedGradient(n),n.fillRect(-1e10,-1e10,2e10,2e10),n.restore()),Wf(n,this._bbox),r=this._createGradient(n);return r}},fS=class extends ng{constructor(n){super(),this._posData=n[2],this._colData=n[3],this._vertexCount=n[4],this._bounds=n[5],this._bbox=n[6],this._background=n[7],this.matrix=null,oI()}_createMeshCanvas(n,t,e){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),h=Math.ceil(this._bounds[2])-o,c=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(h*n[0]*1.1)),3e3)||1,u=Math.min(Math.ceil(Math.abs(c*n[1]*1.1)),3e3)||1,f=h?h/d:1,g=c?c/u:1,m={coords:this._posData,colors:this._colData,offsetX:-o,offsetY:-l,scaleX:1/f,scaleY:1/g},y=d+4,b=u+4,x=e.create(y,b);if(aI()&&this._vertexCount>48)x.context.drawImage(lI(this._posData,this._colData,this._vertexCount,m,t,y,b,2),0,0);else{const E=x.context.createImageData(d,u);if(t){const S=E.data;for(let T=0,A=S.length;T<A;T+=4)S[T]=t[0],S[T+1]=t[1],S[T+2]=t[2],S[T+3]=255}for(let S=0,T=this._vertexCount;S<T;S+=3)hI(E,m,S,S+1,S+2,S,S+1,S+2);x.context.putImageData(E,2,2)}return{canvas:x.canvas,offsetX:o-2*f,offsetY:l-2*g,scaleX:f,scaleY:g}}isModifyingCurrentTransform(){return!0}getPattern(n,t,e,i){Wf(n,this._bbox);const r=new Float32Array(2);if(i===Ie.SHADING)Z.singularValueDecompose2dScale(Gt(n),r);else if(this.matrix){Z.singularValueDecompose2dScale(this.matrix,r);const[l,h]=r;Z.singularValueDecompose2dScale(t.baseTransform,r),r[0]*=l,r[1]*=h}else Z.singularValueDecompose2dScale(t.baseTransform,r);const s=this._createMeshCanvas(r,i===Ie.SHADING?null:this._background,t.canvasFactory);i!==Ie.SHADING&&(n.setTransform(...t.baseTransform),this.matrix&&n.transform(...this.matrix)),n.translate(s.offsetX,s.offsetY),n.scale(s.scaleX,s.scaleY);const o=n.createPattern(s.canvas,"no-repeat");return t.canvasFactory.destroy(s),o}},pS=class extends ng{getPattern(){return"hotpink"}},Lb={COLORED:1,UNCOLORED:2},vd=class yC{constructor(t,e,i,r){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.needsIsolation=t[9]??!0,this.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=r,this.patternBaseMatrix=this.matrix?Z.transform(r,this.matrix):r}canSkipPatternCanvas([t,e,i,r]){const[s,o,l,h]=this.bbox,c=Math.abs(this.xstep),d=Math.abs(this.ystep);if(t>c+1e-6||e>d+1e-6)return null;const u=Math.floor((i-l)/c)+1,f=Math.ceil((i+t-s)/c)-1,g=Math.floor((r-h)/d)+1,m=Math.ceil((r+e-o)/d)-1;return f<=u&&m<=g?[u,g]:null}updatePatternDims(t,e){const i=Z.inverseTransform(this.patternBaseMatrix),r=[t[0],t[1]],s=[t[2],t[3]];Z.applyTransform(r,i),Z.applyTransform(s,i),e[0]=Math.abs(s[0]-r[0]),e[1]=Math.abs(s[1]-r[1]),e[2]=Math.min(r[0],s[0]),e[3]=Math.min(r[1],s[1])}_renderTileCanvas(t,e,i,r){const[s,o,l,h]=this.bbox,c=t.canvasFactory.create(i.size,r.size),d=c.context,u=this.canvasGraphicsFactory.createCanvasGraphics(d,e);return u.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(u,this.paintType,this.color),d.translate(-i.scale*s,-r.scale*o),u.transform(0,i.scale,0,0,r.scale,0,0),d.save(),u.dependencyTracker?.save(),this.clipBbox(u,s,o,l,h),u.baseTransform=Gt(u.ctx),u.executeOperatorList(this.operatorList),u.endDrawing(),u.dependencyTracker?.restore(),d.restore(),c}_getCombinedScales(){const t=new Float32Array(2);Z.singularValueDecompose2dScale(this.matrix,t);const[e,i]=t;return Z.singularValueDecompose2dScale(this.baseTransform,t),[e*t[0],i*t[1]]}drawPattern(t,e,i=!1,[r,s],o){const[l,h,c,d]=this.bbox,u=t.dependencyTracker;if(u&&(t.dependencyTracker=new Jp(u,o)),t.save(),i?t.ctx.clip(e,"evenodd"):t.ctx.clip(e),t.ctx.setTransform(...this.patternBaseMatrix),t.ctx.translate(r*this.xstep,s*this.ystep),this.needsIsolation||t.ctx.globalAlpha!==1||t.ctx.globalCompositeOperation!=="source-over"||t.inSMaskMode){const f=c-l,g=d-h,[m,y]=this._getCombinedScales(),b=this.getSizeAndScale(f,this.ctx.canvas.width,m),x=this.getSizeAndScale(g,this.ctx.canvas.height,y),E=this._renderTileCanvas(t,o,b,x);t.ctx.drawImage(E.canvas,l,h,f,g),t.canvasFactory.destroy(E)}else this.setFillAndStrokeStyleToContext(t,this.paintType,this.color),this.clipBbox(t,l,h,c,d),t.baseTransformStack.push(t.baseTransform),t.baseTransform=Gt(t.ctx),t.executeOperatorList(this.operatorList),t.baseTransform=t.baseTransformStack.pop();t.restore(),u&&(t.dependencyTracker=u)}createPatternCanvas(t,e){const[i,r,s,o]=this.bbox,l=s-i,h=o-r;let{xstep:c,ystep:d}=this;c=Math.abs(c),d=Math.abs(d),Sf("TilingType: "+this.tilingType);const[u,f]=this._getCombinedScales();let g=l,m=h,y=!1,b=!1;Math.ceil(c*u)>=Math.ceil(l*u)?g=c:y=!0,Math.ceil(d*f)>=Math.ceil(h*f)?m=d:b=!0;const x=this.getSizeAndScale(g,this.ctx.canvas.width,u),E=this.getSizeAndScale(m,this.ctx.canvas.height,f),S=this._renderTileCanvas(t,e,x,E);if(y||b){const T=S.canvas;y&&(g=c),b&&(m=d);const A=this.getSizeAndScale(g,this.ctx.canvas.width,u),P=this.getSizeAndScale(m,this.ctx.canvas.height,f),C=A.size,M=P.size,I=t.canvasFactory.create(C,M),k=I.context,O=y?Math.floor(l/c):0,B=b?Math.floor(h/d):0;for(let L=0;L<=O;L++)for(let $=0;$<=B;$++)k.drawImage(T,C*L,M*$,C,M,0,0,C,M);return t.canvasFactory.destroy(S),{canvas:I.canvas,canvasEntry:I,scaleX:A.scale,scaleY:P.scale,offsetX:i,offsetY:r}}return{canvas:S.canvas,canvasEntry:S,scaleX:x.scale,scaleY:E.scale,offsetX:i,offsetY:r}}getSizeAndScale(t,e,i){const r=Math.max(yC.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=r?s=r:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,r,s){const o=r-e,l=s-i,h=new Path2D;h.rect(e,i,o,l),Z.axialAlignedBoundingBox([e,i,r,s],Gt(t.ctx),t.current.minMax),t.ctx.clip(h),t.current.updateClipFromPath()}setFillAndStrokeStyleToContext(t,e,i){const r=t.ctx,s=t.current;switch(s.patternFill=s.patternStroke=!1,e){case Lb.COLORED:const{fillStyle:o,strokeStyle:l}=this.ctx;r.fillStyle=s.fillColor=o,r.strokeStyle=s.strokeColor=l;break;case Lb.UNCOLORED:r.fillStyle=r.strokeStyle=i,s.fillColor=s.strokeColor=i;break;default:throw new NA(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,r,s){const o=r!==Ie.SHADING?Z.transform(i,this.patternBaseMatrix):i,l=this.createPatternCanvas(e,s);let h=new DOMMatrix(o);h=h.translate(l.offsetX,l.offsetY),h=h.scale(1/l.scaleX,1/l.scaleY);const c=t.createPattern(l.canvas,"repeat");return e.canvasFactory.destroy(l.canvasEntry),c.setTransform(h),c}},D(vd,"MAX_PATTERN_SIZE",3e3),Db=16,Fb=100,gS=15,Nb=10,un=16,ig=new DOMMatrix,An=new Float32Array(2),_b=class{constructor(n,t){D(this,"alphaIsShape",!1),D(this,"fontSize",0),D(this,"fontSizeScale",1),D(this,"textMatrix",null),D(this,"textMatrixScale",1),D(this,"fontMatrix",sp),D(this,"leading",0),D(this,"x",0),D(this,"y",0),D(this,"lineX",0),D(this,"lineY",0),D(this,"charSpacing",0),D(this,"wordSpacing",0),D(this,"textHScale",1),D(this,"textRenderingMode",be.FILL),D(this,"textRise",0),D(this,"fillColor","#000000"),D(this,"strokeColor","#000000"),D(this,"tilingPatternDims",null),D(this,"patternFill",!1),D(this,"patternStroke",!1),D(this,"fillAlpha",1),D(this,"strokeAlpha",1),D(this,"lineWidth",1),D(this,"activeSMask",null),D(this,"transferMaps","none"),D(this,"minMax",hs.slice()),this.clipBox=new Float32Array([0,0,n,t])}clone(){const n=Object.create(this);return n.clipBox=this.clipBox.slice(),n.minMax=this.minMax.slice(),n.tilingPatternDims=this.tilingPatternDims?.slice(),n}getPathBoundingBox(n=Ie.FILL,t=null){const e=this.minMax.slice();if(n===Ie.STROKE){t||Dt("Stroke bounding box must include transform."),Z.singularValueDecompose2dScale(t,An);const i=An[0]*this.lineWidth/2,r=An[1]*this.lineWidth/2;e[0]-=i,e[1]-=r,e[2]+=i,e[3]+=r}return e}updateClipFromPath(){const n=Z.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(n||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(n){this.clipBox.set(n,0),this.minMax.set(hs,0)}getClippedPathBoundingBox(n=Ie.FILL,t=null){return Z.intersect(this.clipBox,this.getPathBoundingBox(n,t))}},mS=["butt","round","square"],vS=["miter","round","bevel"],yS={},Bb={},Bn=new WeakMap,Dr=new WeakMap,eh=new WeakMap,nh=new WeakMap,ih=new WeakMap,rh=new WeakMap,sh=new WeakMap,ao=new WeakMap,ah=new WeakMap,Fr=new WeakMap,vt=new WeakSet,yd=class bC{constructor(t,e,i,r,s,{optionalContentConfig:o,markedContentStack:l=null},h,c,d,u){ot(this,vt),w(this,Bn,0),w(this,Dr,0),w(this,eh,null),w(this,nh,null),w(this,ih,null),w(this,rh,null),w(this,sh,1),w(this,ao,void 0),w(this,ah,null),w(this,Fr,[]),this.ctx=t,this.current=new _b(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=e,this.objs=i,this.canvasFactory=r,this.filterFactory=s,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=l||[],this.optionalContentConfig=o,this.cachedPatterns=new Map,this.annotationCanvasMap=h,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=d??null,this.imagesTracker=u??null}getObject(t,e,i=null){return typeof e=="string"?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:r=null}){const s=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,s,o),this.ctx.fillStyle=l,i){const h=this.transparentCanvasEntry=this.canvasFactory.create(s,o);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=h,this.ctx.save(),this.ctx.transform(...Gt(this.compositeCtx))}this.ctx.save(),Uf(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[3]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Gt(this.ctx)}executeOperatorList(t,e,i,r,s){const o=t.argsArray,l=t.fnArray;let h=e||0;const c=o.length;if(c===h)return h;const d=c-h>Nb&&typeof i=="function",u=d?Date.now()+gS:0;let f=0;const g=this.commonObjs,m=this.objs;let y,b;for(;;){if(r!==void 0){if(h===r.nextBreakPoint)return r.breakIt(h,i),h;if(r.shouldSkip(h)){if(++h===c)return h;continue}}if(!s||s(h))if(y=l[h],b=o[h]??null,y!==Xi.dependency)b===null?this[y](h):this[y](h,...b);else for(const x of b){this.dependencyTracker?.recordNamedData(x,h);const E=x.startsWith("g_")?g:m;if(!E.has(x))return E.get(x,i),h}if(h++,h===c)return h;if(d&&++f>Nb){if(Date.now()>u)return i(),h;f=0}}}endDrawing(){v(vt,this,TE).call(this);for(const t of this.smaskGroupCanvases)this.canvasFactory.destroy(t);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0;for(const t of a(Fr,this))v(vt,this,ky).call(this,t);a(Fr,this).length=0,p(eh,this,null),p(nh,this,null),p(ih,this,null),p(rh,this,null),p(sh,this,1),p(ah,this,null),p(Dr,this,0),p(Bn,this,0),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),v(vt,this,PE).call(this)}_scaleImage(t,e){const i=t.width??t.displayWidth,r=t.height??t.displayHeight,s=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=[];let h=s,c=o,d=i,u=r;for(;h>2&&d>1||c>2&&u>1;){let x=d,E=u;h>2&&d>1&&(x=Math.ceil(d/2),h/=d/x),c>2&&u>1&&(E=Math.ceil(u/2),c/=u/E),l.push({newWidth:x,newHeight:E}),d=x,u=E}if(l.length===0)return{img:t,paintWidth:i,paintHeight:r,tmpCanvas:null};if(l.length===1){const{newWidth:x,newHeight:E}=l[0],S=this.canvasFactory.create(x,E);return S.context.drawImage(t,0,0,i,r,0,0,x,E),{img:S.canvas,paintWidth:x,paintHeight:E,tmpCanvas:S}}let f=this.canvasFactory.create(1,1),g=this.canvasFactory.create(1,1),m=i,y=r,b=t;for(const{newWidth:x,newHeight:E}of l)this.canvasFactory.reset(g,x,E),g.context.drawImage(b,0,0,m,y,0,0,x,E),[f,g]=[g,f],b=f.canvas,m=x,y=E;return this.canvasFactory.destroy(g),{img:f.canvas,paintWidth:m,paintHeight:y,tmpCanvas:f}}_createMaskCanvas(t,e){const i=this.ctx,{width:r,height:s}=e,o=this.current.fillColor,l=this.current.patternFill,h=Gt(i);let c,d,u,f;if((e.bitmap||e.data)&&e.count>1){const O=e.bitmap||e.data.buffer;d=JSON.stringify(l?h:[h.slice(0,4),o]),c=this._cachedBitmapsMap.getOrInsertComputed(O,dp);const B=c.get(d);if(B&&!l){const L=Math.round(Math.min(h[0],h[2])+h[4]),$=Math.round(Math.min(h[1],h[3])+h[5]);return this.dependencyTracker?.recordDependencies(t,_n.transformAndFill),{canvas:B,offsetX:L,offsetY:$}}u=B}u||(f=this.canvasFactory.create(r,s),AE(f.context,e));let g=Z.transform(h,[1/r,0,0,-1/s,0,0]);g=Z.transform(g,[1,0,0,1,0,-s]);const m=hs.slice();Z.axialAlignedBoundingBox([0,0,r,s],g,m);const[y,b,x,E]=m,S=Math.round(x-y)||1,T=Math.round(E-b)||1,A=this.canvasFactory.create(S,T),P=A.context,C=y,M=b;P.translate(-C,-M),P.transform(...g);let I=null;if(!u){const O=this._scaleImage(f.canvas,Hi(P));u=O.img,I=O.tmpCanvas,u!==f.canvas&&(this.canvasFactory.destroy(f),f=null),c&&l&&(c.set(d,u),I=null,f=null)}P.imageSmoothingEnabled=SE(Gt(P),e.interpolate),jf(P,u,0,0,u.width,u.height,0,0,r,s),I&&this.canvasFactory.destroy(I),f&&this.canvasFactory.destroy(f),P.globalCompositeOperation="source-in";const k=Z.transform(Hi(P),[1,0,0,1,-C,-M]);return P.fillStyle=l?o.getPattern(i,this,k,Ie.FILL,t):o,P.fillRect(0,0,r,s),c&&!l&&c.set(d,A.canvas),this.dependencyTracker?.recordDependencies(t,_n.transformAndFill),{canvas:A.canvas,canvasEntry:c&&!l?null:A,offsetX:Math.round(C),offsetY:Math.round(M)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=mS[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=vS[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){this.dependencyTracker?.recordSimpleData("dash",t);const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[i,r]of e)switch(i){case"LW":this.setLineWidth(t,r);break;case"LC":this.setLineCap(t,r);break;case"LJ":this.setLineJoin(t,r);break;case"ML":this.setMiterLimit(t,r);break;case"D":this.setDash(t,r[0],r[1]);break;case"RI":this.setRenderingIntent(t,r);break;case"FL":this.setFlatness(t,r);break;case"Font":this.setFont(t,r[0],r[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=r;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=r;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=r;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(t);break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&(this.canvasFactory.destroy(this.smaskPreparedEntry),this.smaskPreparedEntry=null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(t){t!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(t))}checkSMaskState(t){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode(t):!this.current.activeSMask&&e?this.endSMaskMode():this.current.activeSMask&&e&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(t){const{canvas:e,subtype:i,backdrop:r,transferMap:s}=t,o=i==="Luminosity"||i==="Alpha"&&s;if(!o&&!(i==="Luminosity"&&r)){this.smaskPreparedFor=t;return}let l;if(i==="Luminosity"&&r){const[E,S,T]=Mc(r),A=Math.round(.3*E+.59*S+.11*T);l=s?.[A]??A}else l=s?.[0]??0;const h=4,{width:c,height:d}=this.ctx.canvas,u=e.width*e.height,f=c*d<h*u,g=o?{url:i==="Alpha"?this.filterFactory.addAlphaFilter(s):this.filterFactory.addLuminosityFilter(s),subtype:i,transferMap:s}:null,m=i==="Luminosity"?r:null;let y,b,x;f?(y=this._bakeSMaskCanvas(e,t.offsetX,t.offsetY,c,d,m,g),b=0,x=0):(y=this._bakeSMaskCanvas(e,0,0,e.width,e.height,m,g),b=t.offsetX,x=t.offsetY),this.smaskPreparedEntry=y,this.smaskPreparedFor=t,this.smaskPreparedOffsetX=b,this.smaskPreparedOffsetY=x,this.smaskPreparedOOBAlpha=!f&&l!==0?l:null}_bakeSMaskCanvas(t,e,i,r,s,o,l){!o&&!l&&Dt("_bakeSMaskCanvas with neither backdrop nor filter");const h=this.canvasFactory.create(r,s),c=h.context;if(c.drawImage(t,e,i),o&&(c.globalCompositeOperation="destination-atop",c.fillStyle=o,c.fillRect(0,0,r,s)),!l)return h;const d=this.canvasFactory.create(r,s),u=d.context;u.filter=l.url;const f=Ut.isCanvasFilterSupported&&u.filter!=="none"&&u.filter!=="";if(u.drawImage(h.canvas,0,0),Ut.isCanvasFilterSupported&&(u.filter="none"),!f){const g=u.getImageData(0,0,r,s),{data:m}=g,{transferMap:y}=l;if(l.subtype==="Luminosity")for(let b=0,x=m.length;b<x;b+=4){const E=.3*m[b]+.59*m[b+1]+.11*m[b+2]+.5|0;m[b]=m[b+1]=m[b+2]=0,m[b+3]=y?.[E]??E}else for(let b=3,x=m.length;b<x;b+=4)m[b]=y[m[b]];u.putImageData(g,0,0)}return this.canvasFactory.destroy(h),d}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const{width:e,height:i}=this.ctx.canvas,r=this.canvasFactory.create(e,i);this.smaskScratchCanvas=r,this.suspendedCtx=this.ctx;const s=this.ctx=r.context;s.setTransform(this.suspendedCtx.getTransform()),Aa(this.suspendedCtx,s),xE(s,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Aa(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}compose(t){if(!this.current.activeSMask)return;t=t?[Math.floor(t[0]),Math.floor(t[1]),Math.ceil(t[2]),Math.ceil(t[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx,r=a(Dr,this)>0&&i===this.ctx;this.composeSMask(r?null:i,e,this.ctx,t),!r&&(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())}composeSMask(t,e,i,r){const s=r[0],o=r[1],l=r[2]-s,h=r[3]-o;if(l===0||h===0)return;const c=this.smaskPreparedEntry;if(c){let d=s,u=o,f=l,g=h;const m=this.smaskPreparedOOBAlpha,y=m!==null;if(y){d=Math.max(s,e.offsetX),u=Math.max(o,e.offsetY);const b=Math.min(s+l,e.offsetX+e.canvas.width),x=Math.min(o+h,e.offsetY+e.canvas.height);f=b-d,g=x-u}if(f>0&&g>0){const b=d-this.smaskPreparedOffsetX,x=u-this.smaskPreparedOffsetY;i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0);const E=new Path2D;E.rect(d,u,f,g),i.clip(E),i.globalCompositeOperation="destination-in",i.drawImage(c.canvas,b,x,f,g,d,u,f,g),i.restore()}y&&m<255&&this._applySMaskOOBAlpha(i,s,o,l,h,d,u,d+f,u+g,m)}else this.genericComposeSMask(e,i,l,h,s,o);t&&(t.save(),t.globalAlpha=1,t.globalCompositeOperation=e.blendMode||"source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,s,o,l,h,s,o,l,h),t.restore())}_applySMaskOOBAlpha(t,e,i,r,s,o,l,h,c,d){const u=o<h&&l<c;if(u&&o===e&&l===i&&h===e+r&&c===i+s)return;const f=new Path2D;f.rect(e,i,r,s),u&&f.rect(o,l,h-o,c-l),t.save(),t.globalAlpha=d/255,t.setTransform(1,0,0,1,0,0),t.clip(f,"evenodd"),t.globalCompositeOperation="destination-in",t.fillStyle="#000000",t.fillRect(e,i,r,s),t.restore()}genericComposeSMask(t,e,i,r,s,o){const{context:l,offsetX:h,offsetY:c}=t;e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const d=new Path2D;d.rect(s,o,i,r),e.clip(d),e.globalCompositeOperation="destination-in",e.drawImage(l.canvas,s-h,o-c,i,r,s,o,i,r),e.restore()}save(t){this.inSMaskMode&&Aa(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){if(this.dependencyTracker?.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(Aa(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(t),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,i,r,s,o,l){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,i,r,s,o,l),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,r){let[s]=i;if(!r){s||(s=i[0]=new Path2D),e!==Xi.stroke&&e!==Xi.closeStroke&&(this.current.tilingPatternDims=null),this[e](t,s);return}if(this.dependencyTracker!==null){const l=e===Xi.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,r[0]-l,r[2]+l,r[1]-l,r[3]+l).recordDependencies(t,["transform"])}s instanceof Path2D||(s=i[0]=tE(s)),Z.axialAlignedBoundingBox(r,Gt(this.ctx),this.current.minMax);const o=this.current.tilingPatternDims;if(o&&e!==Xi.stroke&&e!==Xi.closeStroke&&this.current.fillColor instanceof vd){const l=Z.intersect(this.current.clipBox,this.current.minMax);l?this.current.fillColor.updatePatternDims(l,o):this.current.tilingPatternDims=null}this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,i=!0){const r=i&&v(vt,this,Rn).call(this,this.current.strokeAlpha),s=this.ctx,o=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof o=="object"&&o?.getPattern){const l=o.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=o.getPattern(s,this,Hi(s),Ie.STROKE,t),l){const h=new Path2D;h.addPath(e,s.getTransform().invertSelf().multiplySelf(l)),e=h}this.rescaleAndStroke(e,!1),s.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,_n.stroke),i&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Ie.STROKE,Gt(this.ctx))),s.globalAlpha=this.current.fillAlpha,v(vt,this,ln).call(this,r)}closeStroke(t,e){this.stroke(t,e)}fill(t,e,i=!0){const r=i&&v(vt,this,Rn).call(this,this.current.fillAlpha),s=this.ctx,o=this.current.fillColor,l=this.current.patternFill;let h=!1;const c=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(t,_n.fill),l){const d=this.current.tilingPatternDims,u=d&&o.canSkipPatternCanvas(d);if(u){o.drawPattern(this,e,this.pendingEOFill,u,t),this.pendingEOFill=!1,i&&this.consumePath(t,e,c),this.current.tilingPatternDims=null,v(vt,this,ln).call(this,r);return}const f=o.isModifyingCurrentTransform()?s.getTransform():null;if(this.dependencyTracker?.save(t),s.save(),s.fillStyle=o.getPattern(s,this,Hi(s),Ie.FILL,t),f){const g=new Path2D;g.addPath(e,s.getTransform().invertSelf().multiplySelf(f)),e=g}h=!0}this.contentVisible&&c!==null&&(this.pendingEOFill?(s.fill(e,"evenodd"),this.pendingEOFill=!1):s.fill(e)),h&&(s.restore(),this.dependencyTracker?.restore(t)),i&&this.consumePath(t,e,c),v(vt,this,ln).call(this,r)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){const i=v(vt,this,Rn).call(this,Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e),v(vt,this,ln).call(this,i)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){const i=v(vt,this,Rn).call(this,this.current.fillAlpha);this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,_n.rawFillPath).recordOperation(t),v(vt,this,ln).call(this,i)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=yS}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Bb}beginText(t){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:r}=this;e!==void 0&&r.recordFutureForcedDependency("textClip",r.getOpenMarker()).recordFutureForcedDependency("textClip",t),r.recordCloseMarker(t)}if(e!==void 0){const r=new Path2D,s=i.getTransform().invertSelf();for(const{transform:o,x:l,y:h,fontSize:c,path:d}of e)d&&r.addPath(d,new DOMMatrix(o).preMultiplySelf(s).translate(l,h).scale(c,-c));i.clip(r)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const r=this.commonObjs.get(e),s=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=r.fontMatrix||sp,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&ft("Invalid font matrix for font "+e),i<0?(i=-i,s.fontDirection=-1):s.fontDirection=1,this.current.font=r,this.current.fontSize=i,r.isType3Font)return;const o=r.loadedName||"sans-serif",l=r.systemFontInfo?.css||`"${o}", ${r.fallbackName}`;let h="normal";r.black?h="900":r.bold&&(h="bold");const c=r.italic?"italic":"normal";let d=i;i<Db?d=Db:i>Fb&&(d=Fb),this.current.fontSizeScale=i/d,this.ctx.font=`${c} ${h} ${d}px ${l}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",t);const{current:i}=this;i.textMatrix=e,i.textMatrixScale=Math.hypot(e[0],e[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,i,r,s,o){const l=this.ctx,h=this.current,c=h.font,d=h.textRenderingMode,u=h.fontSize/h.fontSizeScale,f=d&be.FILL_STROKE_MASK,g=!!(d&be.ADD_TO_PATH_FLAG),m=h.patternFill&&!c.missingFile,y=h.patternStroke&&!c.missingFile;let b;if((c.disableFontFace||g||m||y)&&!c.missingFile&&(b=c.getPathGenerator(this.commonObjs,e)),b&&(c.disableFontFace||m||y)){l.save(),l.translate(i,r),l.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(t,l,c);let x;if(f===be.FILL||f===be.FILL_STROKE)if(s){x=l.getTransform(),l.setTransform(...s);const E=v(vt,this,kE).call(this,b,x,s);l.fill(E)}else l.fill(b);if(f===be.STROKE||f===be.FILL_STROKE)if(o){x||(x=l.getTransform()),l.setTransform(...o);const{a:E,b:S,c:T,d:A}=x,P=Z.inverseTransform(o),C=Z.transform([E,S,T,A,0,0],P);Z.singularValueDecompose2dScale(C,An),l.lineWidth*=Math.max(An[0],An[1])/u,l.stroke(v(vt,this,kE).call(this,b,x,o))}else l.lineWidth/=u,l.stroke(b);l.restore()}else(f===be.FILL||f===be.FILL_STROKE)&&(l.fillText(e,i,r),this.dependencyTracker?.recordCharacterBBox(t,l,c,u,i,r,()=>l.measureText(e))),(f===be.STROKE||f===be.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,l,c,u,i,r,()=>l.measureText(e)).recordDependencies(t,_n.stroke),l.strokeText(e,i,r));g&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Gt(l),x:i,y:r,fontSize:u,path:b}),this.dependencyTracker?.recordCharacterBBox(t,l,c,u,i,r))}get isFontSubpixelAAEnabled(){const t=this.canvasFactory.create(10,10),e=t.context;e.scale(1.5,1),e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;this.canvasFactory.destroy(t);let r=!1;for(let s=3;s<i.length;s+=4)if(i[s]>0&&i[s]<255){r=!0;break}return mt(this,"isFontSubpixelAAEnabled",r)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,_n.showText).resetBBox(t),this.current.textRenderingMode&be.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,r=i.font;if(r.isType3Font){const B=v(vt,this,Rn).call(this,i.fillAlpha);this.showType3Text(t,e),this.dependencyTracker?.recordShowTextOperation(t),v(vt,this,ln).call(this,B);return}const s=i.fontSize;if(s===0){this.dependencyTracker?.recordOperation(t);return}const o=v(vt,this,Rn).call(this,i.fillAlpha),l=this.ctx,h=i.fontSizeScale,c=i.charSpacing,d=i.wordSpacing,u=i.fontDirection,f=i.textHScale*u,g=e.length,m=r.vertical,y=m?1:-1,b=r.defaultVMetrics,x=s*i.fontMatrix[0],E=i.textRenderingMode===be.FILL&&!r.disableFontFace&&!i.patternFill;l.save(),i.textMatrix&&l.transform(...i.textMatrix),l.translate(i.x,i.y+i.textRise),u>0?l.scale(f,-1):l.scale(f,1);let S,T;const A=i.textRenderingMode&be.FILL_STROKE_MASK,P=A===be.FILL||A===be.FILL_STROKE,C=A===be.STROKE||A===be.FILL_STROKE;let M=i.lineWidth;const I=i.textMatrixScale;if(I===0||M===0?C&&(M=this.getSinglePixelWidth()):M/=I,h!==1&&(l.scale(h,h),M/=h),l.lineWidth=M,P&&i.patternFill){l.save();const B=i.fillColor.getPattern(l,this,Hi(l),Ie.FILL,t);S=Gt(l),l.restore(),l.fillStyle=B}if(C&&i.patternStroke){l.save();const B=i.strokeColor.getPattern(l,this,Hi(l),Ie.STROKE,t);T=Gt(l),l.restore(),l.strokeStyle=B}if(r.isInvalidPDFjsFont){const B=[];let L=0;for(const j of e)B.push(j.unicode),L+=j.width;const $=B.join("");if(l.fillText($,0,0),this.dependencyTracker!==null){const j=l.measureText($);this.dependencyTracker.recordBBox(t,this.ctx,-j.actualBoundingBoxLeft,j.actualBoundingBoxRight,-j.actualBoundingBoxAscent,j.actualBoundingBoxDescent).recordShowTextOperation(t)}i.x+=L*x*f,l.restore(),this.compose(),v(vt,this,ln).call(this,o);return}let k=0,O;for(O=0;O<g;++O){const B=e[O];if(typeof B=="number"){k+=y*B*s/1e3;continue}let L=!1;const $=(B.isSpace?d:0)+c,j=B.fontChar,U=B.accent;let G,it,X=B.width;if(m){const q=B.vmetric||b,J=-(B.vmetric?q[1]:X*.5)*x,dt=q[2]*x;X=q?-q[0]:X,G=J/h,it=(k+dt)/h}else G=k/h,it=0;let ct;if(r.remeasure&&X>0){ct=l.measureText(j);const q=ct.width*1e3/s*h;if(X<q&&this.isFontSubpixelAAEnabled){const J=X/q;L=!0,l.save(),l.scale(J,1),G/=J}else X!==q&&(G+=(X-q)/2e3*s/h)}if(this.contentVisible&&(B.isInFont||r.missingFile)){if(E&&!U)l.fillText(j,G,it),this.dependencyTracker?.recordCharacterBBox(t,l,ct?{bbox:null}:r,s/h,G,it,()=>ct??l.measureText(j));else if(this.paintChar(t,j,G,it,S,T),U){const q=G+s*U.offset.x/h,J=it-s*U.offset.y/h;this.paintChar(t,U.fontChar,q,J,S,T)}}const Y=m?X*x-$*u:X*x+$*u;k+=Y,L&&l.restore()}m?i.y-=k:i.x+=k*f,l.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t),v(vt,this,ln).call(this,o)}showType3Text(t,e){const i=this.ctx,r=this.current,s=r.font,o=r.fontSize,l=r.fontDirection,h=s.vertical?1:-1,c=r.charSpacing,d=r.wordSpacing,u=r.textHScale*l,f=r.fontMatrix||sp,g=e.length,m=r.textRenderingMode===be.INVISIBLE;let y,b,x,E;if(m||o===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),r.textMatrix&&i.transform(...r.textMatrix),i.translate(r.x,r.y+r.textRise),i.scale(u,l);const S=this.dependencyTracker;for(this.dependencyTracker=S?new Jp(S,t):null,y=0;y<g;++y){if(b=e[y],typeof b=="number"){E=h*b*o/1e3,this.ctx.translate(E,0),r.x+=E*u;continue}const T=(b.isSpace?d:0)+c,A=s.charProcOperatorList[b.operatorListId];A?this.contentVisible&&(this.save(),i.scale(o,o),i.transform(...f),this.executeOperatorList(A),this.restore()):ft(`Type3 character "${b.operatorListId}" is not available.`);const P=[b.width,0];Z.applyTransform(P,f),x=P[0]*o+T,i.translate(x,0),r.x+=x*u}i.restore(),S&&(this.dependencyTracker=S)}setCharWidth(t,e,i){}setCharWidthAndBounds(t,e,i,r,s,o,l){const h=new Path2D;h.rect(r,s,o-r,l-s),this.ctx.clip(h),this.dependencyTracker?.recordBBox(t,this.ctx,r,o,s,l).recordClipBox(t,this.ctx,r,o,s,l),this.endPath(t)}getColorN_Pattern(t,e){let i;if(e[0]==="TilingPattern"){const r=this.baseTransform||Gt(this.ctx);i=new vd(e,this.ctx,{createCanvasGraphics:(s,o)=>new bC(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Jp(this.dependencyTracker,o,!0):null)},r)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t);const i=this.current.fillColor=this.getColorN_Pattern(t,e);this.current.patternFill=!0,this.current.tilingPatternDims=i instanceof vd?[0,0,0,0]:null}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(t,e,i=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=cI(this.getObject(t,e)),this.cachedPatterns.set(e,r)),i&&(r.matrix=i),r}shadingFill(t,e){if(!this.contentVisible)return;const i=v(vt,this,Rn).call(this,this.current.fillAlpha),r=this.ctx;this.save(t),r.fillStyle=this._getPattern(t,e).getPattern(r,this,Hi(r),Ie.SHADING,t);const s=Hi(r);if(s){const{width:o,height:l}=r.canvas,h=hs.slice();Z.axialAlignedBoundingBox([0,0,o,l],s,h);const[c,d,u,f]=h;this.ctx.fillRect(c,d,u-c,f-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,_n.transform).recordDependencies(t,_n.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t),v(vt,this,ln).call(this,i)}beginInlineImage(){Dt("Should not call beginInlineImage")}beginImageData(){Dt("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=Gt(this.ctx),i)){Z.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[r,s,o,l]=i,h=new Path2D;h.rect(r,s,o-r,l-s),this.ctx.clip(h),this.dependencyTracker?.recordClipBox(t,this.ctx,r,o,s,l),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t);const{inSMaskMode:i}=this;i&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;if(!e.isolated&&!e.knockout&&a(Bn,this)===0&&Sf("TODO: Fully support non-isolated non-knockout groups."),!e.needsIsolation&&!e.knockout&&a(Bn,this)===0&&r.globalAlpha===1&&r.globalCompositeOperation==="source-over"&&!i){if(e.bbox){let S=new Path2D;const[T,A,P,C]=e.bbox;if(S.rect(T,A,P-T,C-A),e.matrix){const M=new Path2D;M.addPath(S,new DOMMatrix(e.matrix)),S=M}r.clip(S)}this.groupStack.push(null),a(Fr,this).push(null),this.groupLevel++;return}const s=Gt(r);e.matrix&&r.transform(...e.matrix);const o=[0,0,r.canvas.width,r.canvas.height];let l;e.bbox?(l=hs.slice(),Z.axialAlignedBoundingBox(e.bbox,Gt(r),l),l=Z.intersect(l,o)||[0,0,0,0]):l=o;const h=Math.floor(l[0]),c=Math.floor(l[1]),d=Math.max(Math.ceil(l[2])-h,1),u=Math.max(Math.ceil(l[3])-c,1);this.current.startNewPathAndClipBox([0,0,d,u]);const f=this.canvasFactory.create(d,u);e.smask&&this.smaskGroupCanvases.push(f);const g=f.context,m=e.knockout&&!e.isolated?r:null,y=!e.isolated&&!e.knockout&&!e.smask&&e.needsIsolation&&a(Bn,this)>0,b=e.knockout?this.canvasFactory.create(d,u):null,x=a(Bn,this);if(e.knockout){var E;p(Bn,this,(E=a(Bn,this),E++,E))}else p(Bn,this,0);if(g.translate(-h,-c),g.transform(...s),!e.isolated&&!e.smask&&i&&e.needsIsolation&&(g.save(),g.setTransform(1,0,0,1,0,0),g.drawImage(r.canvas,-h,-c),g.restore()),e.bbox){let S=new Path2D;const[T,A,P,C]=e.bbox;if(S.rect(T,A,P-T,C-A),e.matrix){const M=new Path2D;M.addPath(S,new DOMMatrix(e.matrix)),S=M}g.clip(S)}e.smask&&this.smaskStack.push({canvas:f.canvas,context:g,offsetX:h,offsetY:c,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null}),(!e.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(h,c),r.save()),Aa(r,g),this.ctx=g,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(r),a(Fr,this).push({backdropCtx:m,savedKnockoutLevel:x,offsetX:h,offsetY:c,hasInnerBackdrop:y,knockoutMaskEntry:b,knockoutTempEntry:null,knockoutBackdropEntry:null}),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,r=this.groupStack.pop(),s=a(Fr,this).pop();if(s&&p(Bn,this,s.savedKnockoutLevel),r===null){this.restore(t);return}if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())),v(vt,this,ky).call(this,s);else{this.ctx.restore();const o=Gt(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...o);const l=hs.slice();Z.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],o,l);const h=a(Fr,this).at(-1);if(a(Bn,this)>0)if(s.hasInnerBackdrop){const{width:c,height:d}=i.canvas,u=this.canvasFactory.create(c,d),f=u.context;f.drawImage(r.canvas,s.offsetX,s.offsetY,c,d,0,0,c,d),f.globalCompositeOperation="source-over",f.drawImage(i.canvas,0,0);const g=v(vt,this,CE).call(this,i.canvas);f.globalCompositeOperation="destination-in",f.drawImage(g.canvas,0,0);const m=this.ctx.globalCompositeOperation,y=this.ctx.globalAlpha,b=this.ctx.filter;this.ctx.save(),this.ctx.setTransform(...o),this.ctx.globalAlpha=1,Ut.isCanvasFilterSupported&&(this.ctx.filter="none"),this.ctx.globalCompositeOperation="destination-out",this.ctx.drawImage(g.canvas,0,0),this.ctx.globalCompositeOperation=m,this.ctx.globalAlpha=y,Ut.isCanvasFilterSupported&&(this.ctx.filter=b??"none"),this.ctx.drawImage(u.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(g),this.canvasFactory.destroy(u)}else{const c=h?.backdropCtx??null;v(vt,this,IE).call(this,this.ctx,i.canvas,{backdropCanvas:c?.canvas??null,destTransform:o,backdropOffset:c?[h.offsetX+s.offsetX,h.offsetY+s.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else this.ctx.drawImage(i.canvas,0,0);this.ctx.restore(),this.canvasFactory.destroy({canvas:i.canvas,context:i}),v(vt,this,ky).call(this,s),this.compose(l)}}beginAnnotation(t,e,i,r,s,o){if(v(vt,this,TE).call(this),Uf(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const l=i[2]-i[0],h=i[3]-i[1];if(o&&this.annotationCanvasMap){r=r.slice(),r[4]-=i[0],r[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=l,i[3]=h,Z.singularValueDecompose2dScale(Gt(this.ctx),An);const{viewportScale:c}=this,d=Math.ceil(l*this.outputScaleX*c),u=Math.ceil(h*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,u);const{canvas:f,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(An[0],0,0,-An[1],0,h*An[1]),Uf(this.ctx)}else{Uf(this.ctx),this.endPath(t);const c=new Path2D;c.rect(i[0],i[1],l,h),this.ctx.clip(c)}}this.current=new _b(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(t,...r),this.transform(t,...s),this.baseTransform=Gt(this.ctx)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),v(vt,this,PE).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const i=e.count;e=this.getObject(t,e.data,e),e.count=i;const r=v(vt,this,Rn).call(this,this.current.fillAlpha),s=this.ctx,o=this._createMaskCanvas(t,e),l=o.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(l,o.offsetX,o.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,o.offsetX,o.offsetX+l.width,o.offsetY,o.offsetY+l.height).recordOperation(t),s.restore(),o.canvasEntry&&this.canvasFactory.destroy(o.canvasEntry),this.compose(),v(vt,this,ln).call(this,r)}paintImageMaskXObjectRepeat(t,e,i,r=0,s=0,o,l){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const h=v(vt,this,Rn).call(this,this.current.fillAlpha),c=this.ctx;c.save();const d=Gt(c);c.transform(i,r,s,o,0,0);const u=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,u.offsetX-d[4],u.offsetY-d[5]),this.dependencyTracker?.resetBBox(t);for(let f=0,g=l.length;f<g;f+=2){const m=Z.transform(d,[i,r,s,o,l[f],l[f+1]]);c.drawImage(u.canvas,m[4],m[5]),this.dependencyTracker?.recordBBox(t,this.ctx,m[4],m[4]+u.canvas.width,m[5],m[5]+u.canvas.height)}c.restore(),u.canvasEntry&&this.canvasFactory.destroy(u.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(t),v(vt,this,ln).call(this,h)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;const i=v(vt,this,Rn).call(this,this.current.fillAlpha),r=this.ctx,s=this.current.fillColor,o=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,_n.transformAndFill);for(const l of e){const{data:h,width:c,height:d,transform:u}=l,f=this.canvasFactory.create(c,d),g=f.context;g.save(),AE(g,this.getObject(t,h,l)),g.globalCompositeOperation="source-in",g.fillStyle=o?s.getPattern(g,this,Hi(r),Ie.FILL,t):s,g.fillRect(0,0,c,d),g.restore(),r.save(),r.transform(...u),r.scale(1,-1),jf(r,f.canvas,0,0,c,d,0,-1,1,1),this.canvasFactory.destroy(f),this.dependencyTracker?.recordBBox(t,r,0,c,0,d),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(t),v(vt,this,ln).call(this,i)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);if(!i){ft("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,i)}paintImageXObjectRepeat(t,e,i,r,s){if(!this.contentVisible)return;const o=this.getObject(t,e);if(!o){ft("Dependent image isn't ready yet");return}const l=o.width,h=o.height,c=[];for(let d=0,u=s.length;d<u;d+=2)c.push({transform:[i,0,0,r,s[d],s[d+1]],x:0,y:0,w:l,h});this.paintInlineImageXObjectGroup(t,o,c)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return{img:t.bitmap,canvasEntry:null};const{bitmap:e,width:i,height:r}=t,s=this.canvasFactory.create(i,r),o=s.context;return o.filter=this.current.transferMaps,o.drawImage(e,0,0),o.filter="none",{img:s.canvas,canvasEntry:s}}paintInlineImageXObject(t,e){if(!this.contentVisible)return;const i=e.width,r=e.height,s=v(vt,this,Rn).call(this,this.current.fillAlpha),o=this.ctx;this.save(t);const{filter:l}=o;l!=="none"&&l!==""&&(o.filter="none"),o.scale(1/i,-1/r);let h,c=null;if(e.bitmap){const u=this.applyTransferMapsToBitmap(e);h=u.img,c=u.canvasEntry}else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)h=e;else{const u=this.canvasFactory.create(i,r);EE(u.context,e),h=this.applyTransferMapsToCanvas(u.context),c=u}const d=this._scaleImage(h,Hi(o));o.imageSmoothingEnabled=SE(Gt(o),e.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(t).recordBBox(t,o,0,i,-r,0).recordDependencies(t,_n.imageXObject).recordOperation(t),this.imagesTracker?.record(o,i,r,this.dependencyTracker.clipBox)),jf(o,d.img,0,0,d.paintWidth,d.paintHeight,0,-r,i,r),d.tmpCanvas&&this.canvasFactory.destroy(d.tmpCanvas),c&&this.canvasFactory.destroy(c),this.compose(),this.restore(t),v(vt,this,ln).call(this,s)}paintInlineImageXObjectGroup(t,e,i){if(!this.contentVisible)return;const r=v(vt,this,Rn).call(this,this.current.fillAlpha),s=this.ctx;let o,l=null;if(e.bitmap)o=e.bitmap;else{const h=e.width,c=e.height,d=this.canvasFactory.create(h,c);EE(d.context,e),o=this.applyTransferMapsToCanvas(d.context),l=d}this.dependencyTracker?.resetBBox(t);for(const h of i)s.save(),s.transform(...h.transform),s.scale(1,-1),jf(s,o,h.x,h.y,h.w,h.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,s,0,1,-1,0),s.restore();l&&this.canvasFactory.destroy(l),this.dependencyTracker?.recordOperation(t),this.compose(),v(vt,this,ln).call(this,r)}paintSolidColorImageMask(t){if(!this.contentVisible)return;const e=v(vt,this,Rn).call(this,this.current.fillAlpha);this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,_n.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose(),v(vt,this,ln).call(this,e)}markPoint(t,e){}markPointProps(t,e,i){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){this.dependencyTracker?.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;this.pendingClip?(r||(this.pendingClip===Bb?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Gt(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:i,c:r,d:s}=this.ctx.getTransform();let o,l;if(i===0&&r===0){const h=Math.abs(e),c=Math.abs(s);if(h===c)if(t===0)o=l=1/h;else{const d=h*t;o=l=d<1?1/d:1}else if(t===0)o=1/h,l=1/c;else{const d=h*t,u=c*t;o=d<1?1/d:1,l=u<1?1/u:1}}else{const h=Math.abs(e*s-i*r),c=Math.hypot(e,i),d=Math.hypot(r,s);if(t===0)o=d/h,l=c/h;else{const u=t*h;o=d>u?d/u:1,l=c>u?c/u:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=l}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:r}}=this,[s,o]=this.getScaleForStroking();if(s===o){i.lineWidth=(r||1)*s,i.stroke(t);return}const l=i.getLineDash();e&&i.save(),i.scale(s,o),ig.a=1/s,ig.d=1/o;const h=new Path2D;if(h.addPath(t,ig),l.length>0){const c=Math.max(s,o);i.setLineDash(l.map(d=>d/c)),i.lineDashOffset/=c}i.lineWidth=r||1,i.stroke(h),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};for(const n in Xi)yd.prototype[n]!==void 0&&(yd.prototype[Xi[n]]=yd.prototype[n]);rg=new WeakMap,sg=new WeakMap,bd=class{constructor(n,t,e){w(this,rg,null),w(this,sg,null),D(this,"_fullReader",null),D(this,"_rangeReaders",new Set),D(this,"_source",null),this._source=n,p(rg,this,t),p(sg,this,e)}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return te(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(a(rg,this))(this)}getRangeReader(n,t){if(t<=this._progressiveDataLength)return null;const e=new(a(sg,this))(this,n,t);return this._rangeReaders.add(e),e}cancelAllRequests(n){this._fullReader?.cancel(n);for(const t of new Set(this._rangeReaders))t.cancel(n)}},wd=class{constructor(n){D(this,"onProgress",null),D(this,"_contentLength",0),D(this,"_filename",null),D(this,"_headersCapability",Promise.withResolvers()),D(this,"_isRangeSupported",!1),D(this,"_isStreamingSupported",!1),D(this,"_loaded",0),D(this,"_stream",null),this._stream=n}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}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(){Dt("Abstract method `read` called")}cancel(n){Dt("Abstract method `cancel` called")}},xd=class{constructor(n,t,e){D(this,"_stream",null),this._stream=n}async read(){Dt("Abstract method `read` called")}cancel(n){Dt("Abstract method `cancel` called")}},bS=class extends bd{constructor(n){super(n,wS,xS),D(this,"_responseOrigin",null);const{httpHeaders:t,url:e}=n;te(/https?:/.test(e.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=RE(!0,t)}},wS=class extends wd{constructor(n){super(n),D(this,"_abortController",new AbortController),D(this,"_reader",null);const{disableRange:t,disableStream:e,rangeChunkSize:i,url:r,withCredentials:s}=n._source;this._isStreamingSupported=!e,FE(r,new Headers(n.headers),s,this._abortController).then(o=>{n._responseOrigin=$f(o.url),NE(o.status,r),this._reader=o.body.getReader();const l=o.headers,{contentLength:h,isRangeSupported:c}=OE({responseHeaders:l,isHttp:!0,rangeChunkSize:i,disableRange:t});this._contentLength=h,this._isRangeSupported=c,this._filename=LE(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new wr("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:n,done:t}=await this._reader.read();return t?{value:n,done:t}:(this._loaded+=n.byteLength,this._callOnProgress(),{value:Vf(n),done:!1})}cancel(n){this._reader?.cancel(n),this._abortController.abort()}},xS=class extends xd{constructor(n,t,e){super(n,t,e),D(this,"_abortController",new AbortController),D(this,"_readCapability",Promise.withResolvers()),D(this,"_reader",null);const{url:i,withCredentials:r}=n._source,s=new Headers(n.headers);s.append("Range",`bytes=${t}-${e-1}`),FE(i,s,r,this._abortController).then(o=>{DE($f(o.url),n._responseOrigin),NE(o.status,i),this._reader=o.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:n,done:t}=await this._reader.read();return t?{value:n,done:t}:{value:Vf(n),done:!1}}cancel(n){this._reader?.cancel(n),this._abortController.abort()}},ut(116),Wb=new WeakSet,ES=class extends bd{constructor(n){super(n,AS,SS),ot(this,Wb),D(this,"_progressiveDone",!1),D(this,"_queuedChunks",[]);const{pdfDataRangeTransport:t}=n,{initialData:e,progressiveDone:i}=t;if(e?.length>0){const s=_E(e);this._queuedChunks.push(s)}this._progressiveDone=i;const r=s=>{switch(s.type){case"range":case"progressiveRead":v(Wb,this,fI).call(this,s.begin,s.chunk);break;case"progressiveDone":this._fullReader?.progressiveDone(),this._progressiveDone=!0;break}};t.transportReady(r)}getFullReader(){const n=super.getFullReader();return this._queuedChunks=null,n}getRangeReader(n,t){const e=super.getRangeReader(n,t);return e&&(e.onDone=()=>this._rangeReaders.delete(e),this._source.pdfDataRangeTransport.requestDataRange(n,t)),e}cancelAllRequests(n){super.cancelAllRequests(n),this._source.pdfDataRangeTransport.abort()}},ag=new WeakMap,AS=class extends wd{constructor(n){super(n),w(this,ag,zf.bind(this)),D(this,"_done",!1),D(this,"_queuedChunks",null),D(this,"_requests",[]);const{pdfDataRangeTransport:t,disableRange:e,disableStream:i}=n._source,{length:r,contentDispositionFilename:s}=t;this._queuedChunks=n._queuedChunks||[];for(const l of this._queuedChunks)this._loaded+=l.byteLength;this._done=n._progressiveDone,this._contentLength=r,this._isStreamingSupported=!i,this._isRangeSupported=!e,vy(s)&&(this._filename=s),this._headersCapability.resolve();const o=this._loaded;Promise.resolve().then(()=>{o>0&&this._loaded===o&&this._callOnProgress()})}_enqueue(n){this._done||(this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunks.push(n),this._loaded+=n.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,a(ag,this).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&a(ag,this).call(this)}},og=new WeakMap,SS=class extends xd{constructor(n,t,e){super(n,t,e),w(this,og,zf.bind(this)),D(this,"onDone",null),D(this,"_begin",-1),D(this,"_done",!1),D(this,"_queuedChunk",null),D(this,"_requests",[]),this._begin=t}_enqueue(n){this._done||(this._requests.length===0?this._queuedChunk=n:(this._requests.shift().resolve({value:n,done:!1}),a(og,this).call(this)),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,a(og,this).call(this),this.onDone?.()}},lg=200,jb=206,Nr=new WeakMap,hg=new WeakSet,TS=class extends bd{constructor(n){super(n,PS,CS),ot(this,hg),w(this,Nr,new WeakMap),D(this,"_responseOrigin",null);const{httpHeaders:t,url:e}=n;this.url=e,this.isHttp=/https?:/.test(e.protocol),this.headers=RE(this.isHttp,t)}_request(n){const t=new XMLHttpRequest,e={validateStatus:null,onHeadersReceived:n.onHeadersReceived,onDone:n.onDone,onError:n.onError,onProgress:n.onProgress};a(Nr,this).set(t,e),t.open("GET",this.url),t.withCredentials=this._source.withCredentials;for(const[i,r]of this.headers)t.setRequestHeader(i,r);return this.isHttp&&"begin"in n&&"end"in n?(t.setRequestHeader("Range",`bytes=${n.begin}-${n.end-1}`),e.validateStatus=i=>i===jb||i===lg):e.validateStatus=i=>i===lg,t.responseType="arraybuffer",te(n.onError,"Expected `onError` callback to be provided."),t.onerror=()=>n.onError(t.status),t.onreadystatechange=v(hg,this,mI).bind(this,t),t.onprogress=v(hg,this,gI).bind(this,t),t.send(null),t}_abortRequest(n){a(Nr,this).has(n)&&(a(Nr,this).delete(n),n.abort())}getRangeReader(n,t){const e=super.getRangeReader(n,t);return e&&(e.onClosed=()=>this._rangeReaders.delete(e)),e}},cg=new WeakMap,oh=new WeakSet,PS=class extends wd{constructor(n){super(n),ot(this,oh),w(this,cg,zf.bind(this)),D(this,"_cachedChunks",[]),D(this,"_done",!1),D(this,"_requests",[]),D(this,"_storedError",null),this._fullRequestXhr=n._request({onHeadersReceived:v(oh,this,vI).bind(this),onDone:v(oh,this,yI).bind(this),onError:v(oh,this,bI).bind(this),onProgress:v(oh,this,wI).bind(this)})}async read(){if(await this._headersCapability.promise,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 n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,this._headersCapability.reject(n),a(cg,this).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}},dg=new WeakMap,lh=new WeakSet,CS=class extends xd{constructor(n,t,e){super(n,t,e),ot(this,lh),w(this,dg,zf.bind(this)),D(this,"onClosed",null),D(this,"_done",!1),D(this,"_queuedChunk",null),D(this,"_requests",[]),D(this,"_storedError",null),this._requestXhr=n._request({begin:t,end:e,onHeadersReceived:v(lh,this,xI).bind(this),onDone:v(lh,this,EI).bind(this),onError:v(lh,this,BE).bind(this),onProgress:null})}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,a(dg,this).call(this),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}},MS=class extends bd{constructor(n){super(n,IS,kS);const{url:t}=n;te(t.protocol==="file:","PDFNodeStream only supports file:// URLs.")}},IS=class extends wd{constructor(n){super(n),D(this,"_reader",null);const{disableRange:t,disableStream:e,rangeChunkSize:i,url:r}=n._source;this._isStreamingSupported=!e,process.getBuiltinModule("fs/promises").lstat(r).then(s=>{const o=WE(r);this._reader=o.getReader();const{size:l}=s;this._contentLength=l,this._isRangeSupported=!t&&l>2*i,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new wr("Streaming is disabled.")),this._headersCapability.resolve()}).catch(s=>{s.code==="ENOENT"&&(s=Hf(0,r)),this._headersCapability.reject(s)})}async read(){await this._headersCapability.promise;const{value:n,done:t}=await this._reader.read();return t?{value:n,done:t}:(this._loaded+=n.byteLength,this._callOnProgress(),{value:Vf(n),done:!1})}cancel(n){this._reader?.cancel(n)}},kS=class extends xd{constructor(n,t,e){super(n,t,e),D(this,"_readCapability",Promise.withResolvers()),D(this,"_reader",null);const{url:i}=n._source;try{const r=WE(i,{start:t,end:e-1});this._reader=r.getReader(),this._readCapability.resolve()}catch(r){this._readCapability.reject(r)}}async read(){await this._readCapability.promise;const{value:n,done:t}=await this._reader.read();return t?{value:n,done:t}:{value:Vf(n),done:!1}}cancel(n){this._reader?.cancel(n)}},ks=class df{static get workerPort(){return v(df,this,Ub)._}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");Ub._=v(df,this,t)}static get workerSrc(){return v(df,this,$b)._}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");$b._=v(df,this,t)}},Ub={_:null},$b={_:""},Ed=new WeakMap,ug=new WeakMap,kA=Symbol.iterator,RS=class{constructor({parsedData:n,rawData:t}){w(this,Ed,void 0),w(this,ug,void 0),p(Ed,this,n),p(ug,this,t)}getRaw(){return a(ug,this)}get(n){return a(Ed,this).get(n)??null}[kA](){return a(Ed,this).entries()}},oo=Symbol("INTERNAL"),fg=new WeakMap,pg=new WeakMap,gg=new WeakMap,Ad=new WeakMap,OS=class{constructor(n,{name:t,intent:e,usage:i,rbGroups:r}){w(this,fg,!1),w(this,pg,!1),w(this,gg,!1),w(this,Ad,!0),p(fg,this,!!(n&xn.DISPLAY)),p(pg,this,!!(n&xn.PRINT)),this.name=t,this.intent=e,this.usage=i,this.rbGroups=r}get visible(){if(a(gg,this))return a(Ad,this);if(!a(Ad,this))return!1;const{print:n,view:t}=this.usage;return a(fg,this)?t?.viewState!=="OFF":a(pg,this)?n?.printState!=="OFF":!0}_setVisible(n,t,e=!1){n!==oo&&Dt("Internal method `_setVisible` called."),p(gg,this,e),p(Ad,this,t)}},lo=new WeakMap,zt=new WeakMap,Sd=new WeakMap,Td=new WeakMap,mg=new WeakSet,RA=Symbol.iterator,LS=class{constructor(n,t=xn.DISPLAY){if(ot(this,mg),w(this,lo,null),w(this,zt,new Map),w(this,Sd,null),w(this,Td,null),this.renderingIntent=t,this.name=null,this.creator=null,n!==null){this.name=n.name,this.creator=n.creator,p(Td,this,n.order);for(const e of n.groups)a(zt,this).set(e.id,new OS(t,e));if(n.baseState==="OFF")for(const e of a(zt,this).values())e._setVisible(oo,!1);for(const e of n.on)a(zt,this).get(e)._setVisible(oo,!0);for(const e of n.off)a(zt,this).get(e)._setVisible(oo,!1);p(Sd,this,this.getHash())}}isVisible(n){if(a(zt,this).size===0)return!0;if(!n)return Sf("Optional content group not defined."),!0;if(n.type==="OCG")return a(zt,this).has(n.id)?a(zt,this).get(n.id).visible:(ft(`Optional content group not found: ${n.id}`),!0);if(n.type==="OCMD"){if(n.expression)return v(mg,this,jE).call(this,n.expression);if(!n.policy||n.policy==="AnyOn"){for(const t of n.ids){if(!a(zt,this).has(t))return ft(`Optional content group not found: ${t}`),!0;if(a(zt,this).get(t).visible)return!0}return!1}else if(n.policy==="AllOn"){for(const t of n.ids){if(!a(zt,this).has(t))return ft(`Optional content group not found: ${t}`),!0;if(!a(zt,this).get(t).visible)return!1}return!0}else if(n.policy==="AnyOff"){for(const t of n.ids){if(!a(zt,this).has(t))return ft(`Optional content group not found: ${t}`),!0;if(!a(zt,this).get(t).visible)return!0}return!1}else if(n.policy==="AllOff"){for(const t of n.ids){if(!a(zt,this).has(t))return ft(`Optional content group not found: ${t}`),!0;if(a(zt,this).get(t).visible)return!1}return!0}return ft(`Unknown optional content policy ${n.policy}.`),!0}return ft(`Unknown group type ${n.type}.`),!0}setVisibility(n,t=!0,e=!0){const i=a(zt,this).get(n);if(!i){ft(`Optional content group not found: ${n}`);return}if(e&&t&&i.rbGroups.length)for(const r of i.rbGroups)for(const s of r)s!==n&&a(zt,this).get(s)?._setVisible(oo,!1,!0);i._setVisible(oo,!!t,!0),p(lo,this,null)}setOCGState({state:n,preserveRB:t}){let e;for(const i of n){switch(i){case"ON":case"OFF":case"Toggle":e=i;continue}const r=a(zt,this).get(i);if(r)switch(e){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!r.visible,t);break}}p(lo,this,null)}get hasInitialVisibility(){return a(Sd,this)===null||this.getHash()===a(Sd,this)}getOrder(){return a(zt,this).size?a(Td,this)?a(Td,this).slice():[...a(zt,this).keys()]:null}getGroup(n){return a(zt,this).get(n)||null}getHash(){if(a(lo,this)!==null)return a(lo,this);const n=new Gp;for(const[t,e]of a(zt,this))n.update(`${t}:${e.visible}`);return p(lo,this,n.hexdigest())}[RA](){return a(zt,this).entries()}},Ee=new WeakMap,tr=new WeakMap,en=new WeakMap,hh=new WeakMap,_r=new WeakMap,Wn=new WeakSet,DS=class{constructor(){ot(this,Wn),w(this,Ee,null),w(this,tr,null),w(this,en,0),w(this,hh,null),w(this,_r,null)}get pagesNumber(){return a(en,this)}set pagesNumber(n){a(en,this)!==n&&(p(en,this,n),p(Ee,this,null),p(tr,this,null))}movePages(n,t,e){v(Wn,this,Gf).call(this);const i=a(Ee,this),r=v(Wn,this,Xf).call(this),s=t.length,o=new Uint32Array(s);let l=0;for(let u=0;u<s;u++){const f=t[u]-1;o[u]=i[f],f<e&&l++}const h=a(en,this),c=h-s,d=Zt(e-l,0,c);for(let u=0,f=0;u<h;u++)n.has(u+1)||(i[f++]=i[u]);i.copyWithin(d+s,d,c),i.set(o,d),v(Wn,this,Ry).call(this,r),i.every((u,f)=>u===f+1)&&p(Ee,this,null)}deletePages(n){v(Wn,this,Gf).call(this);const t=a(Ee,this),e=v(Wn,this,Xf).call(this);p(_r,this,{pageNumberToId:t.slice(),pagesNumber:a(en,this),prevPageNumbers:a(tr,this).slice()});const i=a(en,this)-n.length;p(en,this,i);const r=p(Ee,this,new Uint32Array(i));p(tr,this,new Int32Array(i));let s=0,o=0;for(const l of n){const h=l-1;h!==s&&(r.set(t.subarray(s,h),o),o+=h-s),s=h+1}s<t.length&&r.set(t.subarray(s),o),v(Wn,this,Ry).call(this,e,new Set(n))}cancelDelete(){a(_r,this)&&(p(Ee,this,a(_r,this).pageNumberToId),p(en,this,a(_r,this).pagesNumber),p(tr,this,a(_r,this).prevPageNumbers),p(_r,this,null))}cleanSavedData(){p(_r,this,null)}copyPages(n){v(Wn,this,Gf).call(this),p(hh,this,{pageNumbers:n,pageIds:n.map(t=>a(Ee,this)[t-1])})}cancelCopy(){p(hh,this,null)}pastePages(n){v(Wn,this,Gf).call(this);const t=a(Ee,this),e=v(Wn,this,Xf).call(this),{pageNumbers:i,pageIds:r}=a(hh,this),s=a(en,this)+i.length;p(en,this,s);const o=p(Ee,this,new Uint32Array(s));p(tr,this,new Int32Array(s)),o.set(t.subarray(0,n),0),o.set(r,n),o.set(t.subarray(n),n+i.length),v(Wn,this,Ry).call(this,e,null,n,i),p(hh,this,null)}hasBeenAltered(){return a(Ee,this)!==null}getPageMappingForSaving(n=null){n??(n=v(Wn,this,Xf).call(this));let t=0;for(const i of n.values())t=Math.max(t,i.length);const e=new Array(t);for(let i=0;i<t;i++)e[i]={document:null,pageIndices:[],includePages:[]};for(const[i,r]of n)for(let s=0,o=r.length;s<o;s++)e[s].includePages.push([i-1,r[s]-1]);for(const{includePages:i,pageIndices:r}of e){i.sort((s,o)=>s[0]-o[0]);for(let s=0,o=i.length;s<o;s++)r.push(i[s][1]),i[s]=i[s][0]}return e}extractPages(n){n=Array.from(n).sort((e,i)=>e-i);const t=new Map;for(let e=0,i=n.length;e<i;e++){const r=this.getPageId(n[e]);t.getOrInsertComputed(r,cp).push(e+1)}return this.getPageMappingForSaving(t)}getPrevPageNumber(n){return a(tr,this)?.[n-1]??0}getPageNumber(n){if(!a(Ee,this))return n;const t=a(Ee,this);for(let e=0,i=a(en,this);e<i;e++)if(t[e]===n)return e+1;return 0}getPageId(n){return a(Ee,this)?.[n-1]??n}getMapping(){return a(Ee,this)?.subarray(0,this.pagesNumber)}},ho=Symbol("INITIAL_DATA"),Hb=()=>({...Promise.withResolvers(),data:ho}),Mi=new WeakMap,OA=Symbol.iterator,Vb=class{constructor(){w(this,Mi,new Map)}get(n,t=null){if(t){const i=a(Mi,this).getOrInsertComputed(n,Hb);return i.promise.then(()=>t(i.data)),null}const e=a(Mi,this).get(n);if(!e||e.data===ho)throw new Error(`Requesting object that isn't resolved yet ${n}.`);return e.data}has(n){const t=a(Mi,this).get(n);return!!t&&t.data!==ho}delete(n){const t=a(Mi,this).get(n);return!t||t.data===ho?!1:(a(Mi,this).delete(n),!0)}resolve(n,t=null){const e=a(Mi,this).getOrInsertComputed(n,Hb);if(e.data!==ho)throw new Error(`Object already resolved ${n}.`);e.data=t,e.resolve()}clear(){for(const{data:n}of a(Mi,this).values())n?.bitmap?.close();a(Mi,this).clear()}*[OA](){for(const[n,{data:t}]of a(Mi,this))t!==ho&&(yield[n,t])}},FS=1e5,zb=30,co=new WeakMap,Sn=new WeakMap,vg=new WeakMap,yg=new WeakMap,Pd=new WeakMap,uo=new WeakMap,Rs=new WeakMap,bg=new WeakMap,wg=new WeakMap,ch=new WeakMap,xg=new WeakMap,Cd=new WeakMap,fo=new WeakMap,Md=new WeakMap,Eg=new WeakMap,Id=new WeakMap,dh=new WeakMap,Ag=new WeakMap,Sg=new WeakMap,uh=new WeakSet,kd=class hl{constructor({textContentSource:t,images:e,container:i,viewport:r}){if(ot(this,uh),w(this,co,Promise.withResolvers()),w(this,Sn,null),w(this,vg,!1),w(this,yg,!!globalThis.FontInspector?.enabled),w(this,Pd,null),w(this,uo,null),w(this,Rs,null),w(this,bg,0),w(this,wg,0),w(this,ch,null),w(this,xg,null),w(this,Cd,0),w(this,fo,0),w(this,Md,Object.create(null)),w(this,Eg,[]),w(this,Id,null),w(this,dh,[]),w(this,Ag,new WeakMap),w(this,Sg,null),t instanceof ReadableStream)p(Id,this,t);else if(typeof t=="object")p(Id,this,new ReadableStream({start(c){c.enqueue(t),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');p(Sn,this,p(xg,this,i)),p(Pd,this,e),p(fo,this,r.scale*ds.pixelRatio),p(Cd,this,r.rotation),p(Rs,this,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:o,pageX:l,pageY:h}=r.rawDims;p(Sg,this,[1,0,0,-1,-l,h+o]),p(wg,this,s),p(bg,this,o),PI.call(hl),i.style.setProperty("--min-font-size",Pg._),xa(i,r),a(co,this).promise.finally(()=>{Cg._.delete(this),p(Rs,this,null),p(Md,this,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Ut.platform;return mt(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){a(Pd,this)&&a(Sn,this).append(a(Pd,this).render());const t=()=>{a(ch,this).read().then(({value:e,done:i})=>{if(i){a(co,this).resolve();return}a(uo,this)??p(uo,this,e.lang),Object.assign(a(Md,this),e.styles),v(uh,this,SI).call(this,e.items),t()},a(co,this).reject)};return p(ch,this,a(Id,this).getReader()),Cg._.add(this),t(),a(co,this).promise}update({viewport:t,onBefore:e=null}){const i=t.scale*ds.pixelRatio,r=t.rotation;if(r!==a(Cd,this)&&(e?.(),p(Cd,this,r),xa(a(xg,this),{rotation:r})),i!==a(fo,this)){e?.(),p(fo,this,i);const s={div:null,properties:null,ctx:Oy.call(hl,a(uo,this))};for(const o of a(dh,this))s.properties=a(Ag,this).get(o),s.div=o,v(uh,this,UE).call(this,s)}}cancel(){const t=new wr("TextLayer task cancelled.");a(ch,this)?.cancel(t).catch(()=>{}),p(ch,this,null),a(co,this).reject(t)}get textDivs(){return a(dh,this)}get textContentItemsStr(){return a(Eg,this)}static cleanup(){if(!(v(hl,this,Cg)._.size>0)){v(hl,this,Tg)._.clear();for(const{canvas:t}of v(hl,this,Rd)._.values())t.remove();v(hl,this,Rd)._.clear()}}},hn=kd,Tg={_:new Map},Rd={_:new Map},Gb={_:new WeakMap},Pg={_:null},Cg={_:new Set},NS=100,_S=class{constructor(){var n,t;D(this,"_capability",Promise.withResolvers()),D(this,"_setupCapability",Promise.withResolvers()),D(this,"_transport",null),D(this,"_worker",null),D(this,"docId",`d${Xb._=(n=Xb._,t=n++,n),t}`),D(this,"destroyed",!1),D(this,"onPassword",null),D(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._setupCapability.promise,await this._transport?.destroy()}catch(n){throw this._worker?.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},Xb={_:0},Od=new WeakMap,fh=new WeakMap,Yb=class{constructor(n,t,e=!1,i=null){w(this,Od,Promise.withResolvers()),w(this,fh,null),this.length=n,this.initialData=t,this.progressiveDone=e,this.contentDispositionFilename=i}onDataRange(n,t){a(fh,this).call(this,{type:"range",begin:n,chunk:t})}onDataProgressiveRead(n){a(Od,this).promise.then(()=>{a(fh,this).call(this,{type:"progressiveRead",chunk:n})})}onDataProgressiveDone(){a(Od,this).promise.then(()=>{a(fh,this).call(this,{type:"progressiveDone"})})}transportReady(n){p(fh,this,n),a(Od,this).resolve()}requestDataRange(n,t){Dt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},BS=class{constructor(n,t){this._pdfInfo=n,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return mt(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()}getAnnotationsByType(n,t){return this._transport.getAnnotationsByType(n,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:n="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(n);return this._transport.getOptionalContentConfig(t)}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()}extractPages(n){return this._transport.extractPages(n)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getRawData(n){return this._transport.getRawData(n)}cleanup(n=!1){return this._transport.startCleanup(n||this.isPureXfa)}cachedPageNumber(n){return this._transport.cachedPageNumber(n)}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()}},Os=new WeakMap,ph=new WeakMap,gh=new WeakSet,WS=class wC{constructor(t,e,i,r,s=!1){ot(this,gh),w(this,Os,!1),w(this,ph,null),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new lb:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new Vb,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,p(ph,this,r),this.imageCoordinates=null}clone(t){const e=new wC(t,this._pageInfo,this._transport,a(ph,this),this._pdfBug);return e.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(e),e}get pageNumber(){return this._pageIndex+1}set pageNumber(t){this._pageIndex=t-1,this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}={}){return new fp({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:i,intent:r="display",annotationMode:s=br.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:h=null,annotationCanvasMap:c=null,pageColors:d=null,printAnnotationStorage:u=null,isEditing:f=!1,recordImages:g=!1,recordOperations:m=!1,operationsFilter:y=null}){this._stats?.time("Overall");const b=this._transport.getRenderingIntent(r,s,u,f),{renderingIntent:x,cacheKey:E}=b;p(Os,this,!1),h||(h=this._transport.getOptionalContentConfig(x));const S=this._intentStates.getOrInsertComputed(E,up);S.streamReaderCancelTimeout&&(clearTimeout(S.streamReaderCancelTimeout),S.streamReaderCancelTimeout=null);const T=!!(x&xn.PRINT);S.displayReadyCapability||(S.displayReadyCapability=Promise.withResolvers(),S.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(b));const A=!!(this._pdfBug&&globalThis.StepperManager?.enabled),P=!!e&&!this.recordedBBoxes&&(m||A),C=!!e&&!this.imageCoordinates&&g,M=L=>{if(S.renderTasks.delete(O),P){const $=O.gfx?.dependencyTracker.take();$&&(O.stepper?.setOperatorBBoxes($,O.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=$))}C&&!L&&(this.imageCoordinates=O.gfx?.imagesTracker.take()),T&&p(Os,this,!0),v(gh,this,Yf).call(this),L?(O.capability.reject(L),this._abortOperatorList({intentState:S,reason:L instanceof Error?L:new Error(L)})):O.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))};let I=null,k=null;(P||C)&&(k=new GA(e,S.operatorList.length)),P&&(I=new XA(k,A));const O=new $S({callback:M,params:{canvas:e,canvasContext:t,dependencyTracker:I??k,imagesTracker:C?new YA(e):null,viewport:i,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:S.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!T,pdfBug:this._pdfBug,pageColors:d,enableHWA:this._transport.enableHWA,operationsFilter:y});(S.renderTasks||(S.renderTasks=new Set)).add(O);const B=O.task;return Promise.all([S.displayReadyCapability.promise,h]).then(([L,$])=>{if(this.destroyed){M();return}if(this._stats?.time("Rendering"),!($.renderingIntent&x))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");O.initializeGraphics({transparency:L,optionalContentConfig:$}),O.operatorListChanged()}).catch(M),B}getOperatorList({intent:t="display",annotationMode:e=br.ENABLE,printAnnotationStorage:i=null,isEditing:r=!1}={}){function s(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(h))}const o=this._transport.getRenderingIntent(t,e,i,r,!0),l=this._intentStates.getOrInsertComputed(o.cacheKey,up);let h;return l.opListReadCapability||(h=Object.create(null),h.operatorListChanged=s,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||(l.renderTasks=new Set)).add(h),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(o)),l.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:a(ph,this).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}async getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>pp.textContent(r));const e=this.streamTextContent(t),i={items:[],styles:Object.create(null),lang:null};for await(const r of e)i.lang??(i.lang=r.lang),Object.assign(i.styles,r.styles),i.items.push(...r.items);return i}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),p(Os,this,!1),Promise.all(t)}cleanup(t=!1){p(Os,this,!0);const e=v(gh,this,Yf).call(this);return t&&e&&this._stats&&(this._stats=new lb),e}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,r=t.length;i<r;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&v(gh,this,Yf).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:r}){const{map:s,transfer:o}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:a(ph,this).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s,modifiedIds:r},void 0,o).getReader(),h=this._intentStates.get(e);h.streamReader=l;const c=()=>{l.read().then(({value:d,done:u})=>{if(u){h.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,h),c())},d=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const u of h.renderTasks)u.operatorListChanged();v(gh,this,Yf).call(this)}if(h.displayReadyCapability)h.displayReadyCapability.reject(d);else if(h.opListReadCapability)h.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof gp){let r=NS;e.extraDelay>0&&e.extraDelay<1e3&&(r+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},r);return}}if(t.streamReader.cancel(new wr(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[r,s]of this._intentStates)if(s===t){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}},po=new WeakMap,er=new WeakMap,Ls=new WeakMap,mh=new WeakMap,Ii=new WeakSet,vh=class uf{constructor({name:t=null,port:e=null,verbosity:i=sM()}={}){if(ot(this,Ii),w(this,po,Promise.withResolvers()),w(this,er,null),w(this,Ls,null),w(this,mh,null),this.name=t,this.destroyed=!1,this.verbosity=i,e){if(Dd._.has(e))throw new Error("Cannot use more than one PDFWorker per port.");Dd._.set(e,this),v(Ii,this,MI).call(this,e)}else v(Ii,this,II).call(this)}get promise(){return a(po,this).promise}get port(){return a(Ls,this)}get messageHandler(){return a(er,this)}destroy(){this.destroyed=!0,a(mh,this)?.terminate(),p(mh,this,null),Dd._.delete(a(Ls,this)),p(Ls,this,null),a(er,this)?.destroy(),p(er,this,null)}static create(t){const e=v(uf,this,Dd)._.get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new uf(t)}static get workerSrc(){if(ks.workerSrc)return ks.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return mt(this,"_setupFakeWorkerGlobal",(async()=>Dy.call(v(uf,this))?Dy.call(v(uf,this)):(await import(this.workerSrc)).WorkerMessageHandler)())}},zi=vh,Kb={_:0},Ld={_:!1},Dd={_:new WeakMap},bn&&(Ld._=v(zi,zi,!0),ks.workerSrc||(ks.workerSrc="./pdf.worker.mjs")),zi._isSameOrigin=(n,t)=>{const e=URL.parse(n);if(!e?.origin||e.origin==="null")return!1;const i=new URL(t,e);return e.origin===i.origin},zi._createCDNWrapper=n=>{const t=`await import("${n}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},ei=new WeakMap,yh=new WeakMap,Ds=new WeakMap,nr=new WeakMap,bh=new WeakMap,Fd=new WeakMap,Fs=new WeakMap,Br=new WeakSet,jS=class{constructor(n,t,e,i,r,s){ot(this,Br),D(this,"downloadInfoCapability",Promise.withResolvers()),w(this,ei,null),w(this,yh,new Map),w(this,Ds,null),w(this,nr,new Map),w(this,bh,new Map),w(this,Fd,new Map),w(this,Fs,null),this.messageHandler=n,this.loadingTask=t,p(Ds,this,e),this.commonObjs=new Vb,this.fontLoader=new KA({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.enableHWA=i.enableHWA,this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.binaryDataFactory=r.binaryDataFactory,this.pagesMapper=s,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(n){const{_pageIndex:t}=n;a(nr,this).set(t,n),a(bh,this).set(t,Promise.resolve(n))}get annotationStorage(){return mt(this,"annotationStorage",new Xp)}getRenderingIntent(n,t=br.ENABLE,e=null,i=!1,r=!1){let s=xn.DISPLAY,o=Wl;switch(n){case"any":s=xn.ANY;break;case"display":break;case"print":s=xn.PRINT;break;default:ft(`getRenderingIntent - invalid intent: ${n}`)}const l=s&xn.PRINT&&e instanceof vb?e:this.annotationStorage;switch(t){case br.DISABLE:s+=xn.ANNOTATIONS_DISABLE;break;case br.ENABLE:break;case br.ENABLE_FORMS:s+=xn.ANNOTATIONS_FORMS;break;case br.ENABLE_STORAGE:s+=xn.ANNOTATIONS_STORAGE,o=l.serializable;break;default:ft(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(s+=xn.IS_EDITING),r&&(s+=xn.OPLIST);const{ids:h,hash:c}=l.modifiedIds,d=[s,o.hash,c];return{renderingIntent:s,cacheKey:d.join("_"),annotationStorageSerializable:o,modifiedIds:h}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),a(Fs,this)?.reject(new Error("Worker was destroyed during onPassword callback"));const n=[];for(const e of a(nr,this).values())n.push(e._destroy());a(nr,this).clear(),a(bh,this).clear(),a(Fd,this).clear(),Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return n.push(t),Promise.all(n).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),a(yh,this).clear(),this.filterFactory.destroy(),kd.cleanup(),a(Ds,this)?.cancelAllRequests(new wr("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:n,loadingTask:t}=this;n.on("GetReader",(e,i)=>{te(a(Ds,this),"GetReader - no `BasePDFStream` instance available."),p(ei,this,a(Ds,this).getFullReader()),a(ei,this).onProgress=r=>v(Br,this,Fy).call(this,r),i.onPull=()=>{a(ei,this).read().then(function({value:r,done:s}){if(s){i.close();return}te(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{i.error(r)})},i.onCancel=r=>{a(ei,this).cancel(r),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),n.on("ReaderHeadersReady",async e=>{await a(ei,this).headersReady;const{isStreamingSupported:i,isRangeSupported:r,contentLength:s}=a(ei,this);return i&&r&&(a(ei,this).onProgress=null),{isStreamingSupported:i,isRangeSupported:r,contentLength:s}}),n.on("GetRangeReader",(e,i)=>{te(a(Ds,this),"GetRangeReader - no `BasePDFStream` instance available.");const r=a(Ds,this).getRangeReader(e.begin,e.end);if(!r){i.close();return}i.onPull=()=>{r.read().then(function({value:s,done:o}){if(o){i.close();return}te(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{r.cancel(s),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),n.on("GetDoc",({pdfInfo:e})=>{this.pagesMapper.pagesNumber=e.numPages,this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new BS(e,this))}),n.on("DocException",e=>{t._capability.reject(vn(e))}),n.on("PasswordRequest",e=>{p(Fs,this,Promise.withResolvers());try{if(!t.onPassword)throw vn(e);const i=r=>{r instanceof Error?a(Fs,this).reject(r):a(Fs,this).resolve({password:r})};t.onPassword(i,e.code)}catch(i){a(Fs,this).reject(i)}return a(Fs,this).promise}),n.on("DataLoaded",e=>{v(Br,this,Fy).call(this,{loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),n.on("StartRenderPage",e=>{this.destroyed||a(nr,this).get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),n.on("commonobj",([e,i,r])=>{if(this.destroyed||this.commonObjs.has(e))return null;switch(i){case"Font":if("error"in r){const h=r.error;ft(`Error during font loading: ${h}`),this.commonObjs.resolve(e,h);break}const s=new ZA(new qA(r),this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,c)=>globalThis.FontInspector.fontAdded(h,c):null,r.charProcOperatorList,r.extra);this.fontLoader.bind(s).catch(()=>n.sendWithPromise("FontFallback",{id:e})).finally(()=>{s.fontExtraProperties||s.clearData(),this.commonObjs.resolve(e,s)});break;case"CopyLocalImage":const{imageRef:o}=r;te(o,"The imageRef must be defined.");for(const h of a(nr,this).values())for(const[,c]of h.objs){if(c?.ref!==o)continue;if(!c.dataLen)return null;const d=structuredClone(c);return this.commonObjs.resolve(e,d),c.dataLen}break;case"FontPath":this.commonObjs.resolve(e,new eS(r));break;case"Image":this.commonObjs.resolve(e,r);break;case"Pattern":const l=new tS(r);this.commonObjs.resolve(e,l.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),n.on("obj",([e,i,r,s])=>{if(this.destroyed)return;const o=a(nr,this).get(i);if(!o.objs.has(e)){if(o._intentStates.size===0){s?.bitmap?.close();return}switch(r){case"Image":case"Pattern":o.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${r}`)}}}),n.on("DocProgress",e=>{this.destroyed||v(Br,this,Fy).call(this,e)}),n.on("FetchBinaryData",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.binaryDataFactory)throw new Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&ft("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:n,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:n,filename:a(ei,this)?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(n){const t={pageInfos:n};let e;const i=globalThis.ImageBitmap;if(typeof i=="function"){const r=Array.isArray(n)?n:[n];for(const s of r)s?.image instanceof i&&(e||(e=[])).push(s.image)}if(this.annotationStorage.size>0){const r=this.annotationStorage.serializable;let{map:s}=r;r.transfer?.length&&(e?e.push(...r.transfer):e=r.transfer);const o=this.pagesMapper.getMapping();if(o){const l=new Map;for(const[h,c]of s){if(c?.pageIndex!==void 0&&c.pageIndex>=0&&c.pageIndex<o.length){const d=o[c.pageIndex]-1;if(d!==c.pageIndex){l.set(h,{...c,pageIndex:d});continue}}l.set(h,c)}s=l}t.annotationStorage=s}return this.messageHandler.sendWithPromise("ExtractPages",t,e).finally(()=>{this.annotationStorage.resetModified()})}getPage(n){if(!Number.isInteger(n)||n<=0||n>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const t=n-1,e=this.pagesMapper.getPageId(n)-1,i=a(bh,this).get(t);if(i)return i;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&a(Fd,this).set(s.refStr,e);const o=new WS(t,s,this,this.pagesMapper,this._params.pdfBug);return a(nr,this).set(t,o),o});return a(bh,this).set(t,r),r}async getPageIndex(n){if(!qp(n))throw new Error("Invalid pageIndex request.");const t=await this.messageHandler.sendWithPromise("GetPageIndex",{num:n.num,gen:n.gen}),e=this.pagesMapper.getPageNumber(t+1);if(e===0)throw new Error("GetPageIndex: page has been removed.");return e-1}getAnnotations(n,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(n+1)-1,intent:t})}getFieldObjects(){return v(Br,this,Zf).call(this,"GetFieldObjects")}hasJSActions(){return v(Br,this,Zf).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)}getAnnotationsByType(n,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:n,pageIndexesToSkip:t})}getDocJSActions(){return v(Br,this,Zf).call(this,"GetDocJSActions")}getPageJSActions(n){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(n+1)-1})}getStructTree(n){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(n+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(n){return v(Br,this,Zf).call(this,"GetOptionalContentConfig").then(t=>new LS(t,n))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const n="GetMetadata";return a(yh,this).getOrInsertComputed(n,()=>this.messageHandler.sendWithPromise(n,null).then(t=>({info:t[0],metadata:t[1]?new RS(t[1]):null,contentDispositionFilename:a(ei,this)?.filename??null,contentLength:a(ei,this)?.contentLength??null,hasStructTree:t[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}getRawData(n){return this.messageHandler.sendWithPromise("GetRawData",n)}async startCleanup(n=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of a(nr,this).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),n||this.fontLoader.clear(),a(yh,this).clear(),this.filterFactory.destroy(!0),kd.cleanup()}}cachedPageNumber(n){if(!qp(n))return null;const t=n.gen===0?`${n.num}R`:`${n.num}R${n.gen}`,e=a(Fd,this).get(t);if(e>=0){const i=this.pagesMapper.getPageNumber(e+1);if(i!==0)return i}return null}},US=class{constructor(n){D(this,"_internalRenderTask",null),D(this,"onContinue",null),D(this,"onError",null),this._internalRenderTask=n}get promise(){return this._internalRenderTask.capability.promise}cancel(n=0){this._internalRenderTask.cancel(null,n)}get separateAnnots(){const{separateAnnots:n}=this._internalRenderTask.operatorList;if(!n)return!1;const{annotationCanvasMap:t}=this._internalRenderTask;return n.form||n.canvas&&t?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}},go=new WeakMap,$S=class{constructor({callback:n,params:t,objs:e,commonObjs:i,annotationCanvasMap:r,operatorList:s,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:f=!1,operationsFilter:g=null}){w(this,go,null),this.callback=n,this.params=t,this.objs=e,this.commonObjs=i,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=c===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new US(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:n=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(Nd._.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.");Nd._.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:e,transform:i,background:r,dependencyTracker:s,imagesTracker:o}=this.params,l=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new yd(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,s,o),this.gfx.beginDrawing({transform:i,viewport:e,transparency:n,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(n=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),a(go,this)&&(window.cancelAnimationFrame(a(go,this)),p(go,this,null)),Nd._.delete(this._canvas),n||(n=new gp(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(n),this.task.onError?.(n)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?p(go,this,window.requestAnimationFrame(()=>{p(go,this,null),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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Nd._.delete(this._canvas),this.callback())))}},Nd={_:new WeakSet},HS="6.0.227",VS="241dbabbf",ut(3068),ni=new WeakMap,wh=new WeakMap,_d=new WeakMap,ke=new WeakMap,Mg=new WeakMap,Bd=new WeakMap,Ns=new WeakMap,Ig=new WeakMap,mo=new WeakMap,ir=new WeakMap,ae=new WeakSet,kg=class cl{static get _keyboardManager(){return mt(this,"_keyboardManager",new Sl([[["Escape","mac+Escape"],cl.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],cl.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],cl.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],cl.prototype._moveToPrevious],[["Home","mac+Home"],cl.prototype._moveToBeginning],[["End","mac+End"],cl.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){ot(this,ae),w(this,ni,null),w(this,wh,null),w(this,_d,void 0),w(this,ke,null),w(this,Mg,!1),w(this,Bd,!1),w(this,Ns,null),w(this,Ig,void 0),w(this,mo,null),w(this,ir,null),t?(p(Bd,this,!1),p(Ns,this,t)):p(Bd,this,!0),p(ir,this,t?._uiManager||e),p(Ig,this,a(ir,this)._eventBus),p(_d,this,t?.color?.toUpperCase()||a(ir,this)?.highlightColors.values().next().value||"#FFFF98"),Rg._||(Rg._=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}renderButton(){const t=p(ni,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",a(Ns,this)&&(t.ariaControls=`${a(Ns,this).id}_colorpicker_dropdown`);const e=a(ir,this)._signal;t.addEventListener("click",v(ae,this,pl).bind(this),{signal:e}),t.addEventListener("keydown",v(ae,this,GE).bind(this),{signal:e});const i=p(wh,this,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=a(_d,this),t.append(i),t}renderMainDropdown(){const t=p(ke,this,v(ae,this,VE).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===a(ni,this)){v(ae,this,pl).call(this,t);return}const e=t.target.getAttribute("data-color");e&&v(ae,this,zE).call(this,e,t)}_moveToNext(t){if(!Sa.call(v(ae,this))){v(ae,this,pl).call(this,t);return}if(t.target===a(ni,this)){a(ke,this).firstElementChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===a(ke,this)?.firstElementChild||t.target===a(ni,this)){Sa.call(v(ae,this))&&this._hideDropdownFromKeyboard();return}Sa.call(v(ae,this))||v(ae,this,pl).call(this,t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!Sa.call(v(ae,this))){v(ae,this,pl).call(this,t);return}a(ke,this).firstElementChild?.focus()}_moveToEnd(t){if(!Sa.call(v(ae,this))){v(ae,this,pl).call(this,t);return}a(ke,this).lastElementChild?.focus()}hideDropdown(){a(ke,this)?.classList.add("hidden"),a(ni,this).ariaExpanded="false",a(mo,this)?.abort(),p(mo,this,null)}_hideDropdownFromKeyboard(){if(!a(Bd,this)){if(!Sa.call(v(ae,this))){a(Ns,this)?.unselect();return}this.hideDropdown(),a(ni,this).focus({preventScroll:!0,focusVisible:a(Mg,this)})}}updateColor(t){if(a(wh,this)&&(a(wh,this).style.backgroundColor=t),!a(ke,this))return;const e=a(ir,this).highlightColors.values();for(const i of a(ke,this).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){a(ni,this)?.remove(),p(ni,this,null),p(wh,this,null),a(ke,this)?.remove(),p(ke,this,null)}},PA=kg,Rg={_:null},ii=new WeakMap,Wd=new WeakMap,xh=new WeakMap,_s=new WeakMap,Zb=class{constructor(n){w(this,ii,null),w(this,Wd,!1),w(this,xh,null),w(this,_s,null),p(xh,this,n),p(_s,this,n._uiManager),Og._||(Og._=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(a(ii,this))return a(ii,this);const{editorType:n,colorType:t,colorAndOpacityType:e,opacityType:i,color:r,opacity:s}=a(xh,this),o=p(Wd,this,Ut.isAlphaColorInputSupported&&i!==void 0),l=p(ii,this,document.createElement("input"));if(l.type="color",o){l.setAttribute("alpha","");const h=Z.hexNums[Math.round((s??1)*255)];l.value=(r||"#000000")+h}else l.value=r||"#000000";return l.className="basicColorPicker",l.tabIndex=0,l.setAttribute("data-l10n-id",Og._[n]),l.addEventListener("input",()=>{if(o){const h=Mc(l.value);if(!h)return;const[c,d,u,f]=h,g=Z.makeHexColor(c,d,u);e!==void 0?a(_s,this).updateParams(e,{color:g,opacity:f}):(a(_s,this).updateParams(t,g),a(_s,this).updateParams(i,f))}else a(_s,this).updateParams(t,l.value)},{signal:a(_s,this)._signal}),l}update(n){if(a(ii,this))if(a(Wd,this)){const t=Z.hexNums[Math.round(a(xh,this).opacity*255)];a(ii,this).value=n+t}else a(ii,this).value=n}updateOpacity(n){if(!a(ii,this)||!a(Wd,this))return;const t=Z.hexNums[Math.round(n*255)];a(ii,this).value=a(xh,this).color+t}destroy(){a(ii,this)?.remove(),p(ii,this,null)}hideDropdown(){}},Og={_:null},ut(531),Jb=class{static CMYK_G([n,t,e,i]){return["G",1-Math.min(1,.3*n+.59*e+.11*t+i)]}static G_CMYK([n]){return["CMYK",0,0,0,1-n]}static G_RGB([n]){return["RGB",n,n,n]}static G_rgb([n]){return n=Rc(n),[n,n,n]}static G_HTML([n]){const t=XE(n);return`#${t}${t}${t}`}static RGB_G([n,t,e]){return["G",.3*n+.59*t+.11*e]}static RGB_rgb(n){return n.map(Rc)}static RGB_HTML(n){return`#${n.map(XE).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([n,t,e,i]){return["RGB",1-Math.min(1,n+i),1-Math.min(1,e+i),1-Math.min(1,t+i)]}static CMYK_rgb([n,t,e,i]){return[Rc(1-Math.min(1,n+i)),Rc(1-Math.min(1,e+i)),Rc(1-Math.min(1,t+i))]}static CMYK_HTML(n){const t=this.CMYK_RGB(n).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([n,t,e]){const i=1-n,r=1-t,s=1-e;return["CMYK",i,r,s,Math.min(i,r,s)]}},zS=class{create(n,t,e=!1){if(n<=0||t<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),e||(i.setAttribute("width",`${n}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${n} ${t}`),i}createElement(n){if(typeof n!="string")throw new Error("Invalid SVG element type");return this._createSVG(n)}_createSVG(n){Dt("Abstract method `_createSVG` called.")}},jd=class extends zS{_createSVG(n){return document.createElementNS(wn,n)}},GS=9,Bs=new WeakSet,XS=new Date().getTimezoneOffset()*60*1e3,Lg=class{static create(n){switch(n.data.annotationType){case ce.LINK:return new Fg(n);case ce.TEXT:return new KS(n);case ce.WIDGET:switch(n.data.fieldType){case"Tx":return new ZS(n);case"Btn":return n.data.radioButton?new Qb(n):n.data.checkBox?new QS(n):new qS(n);case"Ch":return new t1(n);case"Sig":return new JS(n)}return new Ws(n);case ce.POPUP:return new _g(n);case ce.FREETEXT:return new ew(n);case ce.LINE:return new n1(n);case ce.SQUARE:return new i1(n);case ce.CIRCLE:return new r1(n);case ce.POLYLINE:return new nw(n);case ce.CARET:return new a1(n);case ce.INK:return new zg(n);case ce.POLYGON:return new s1(n);case ce.HIGHLIGHT:return new iw(n);case ce.UNDERLINE:return new o1(n);case ce.SQUIGGLY:return new l1(n);case ce.STRIKEOUT:return new h1(n);case ce.STAMP:return new rw(n);case ce.FILEATTACHMENT:return new c1(n);default:return new oe(n)}}},vo=new WeakMap,Ud=new WeakMap,ki=new WeakMap,Dg=new WeakSet,oe=class xC{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}={}){ot(this,Dg),w(this,vo,null),w(this,Ud,!1),w(this,ki,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,this.hasOwnCommentButton=!1,e&&(this.contentElement=this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return xC._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:i,rect:r}=this.data;let s=-1/0,o=-1/0;if(e?.length>=8){for(let l=0;l<e.length;l+=8)e[l+1]>o?(o=e[l+1],s=e[l+2]):e[l+1]===o&&(s=Math.max(s,e[l+2]));return[s,o]}if(i?.length>=1){for(const l of i)for(let h=0,c=l.length;h<c;h+=2)l[h+1]>o?(o=l[h+1],s=l[h]):l[h+1]===o&&(s=Math.max(s,l[h]));if(s!==1/0)return[s,o]}return r?[r[2],r[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:o}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/i,t[1]=100*(t[1]-o)/r,t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${vl}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue(`${vl}${e.id}`,{id:e.id,annotationType:e.annotationType,page:this.parent.page,popup:i,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(a(ki,this)?.popup||this.popup)?.remove(),p(ki,this,this.popup=null)}updateEdited(t){if(!this.container)return;t.rect&&(a(vo,this)||p(vo,this,{rect:this.data.rect.slice(0)}));const{rect:e,popup:i}=t;e&&v(Dg,this,YE).call(this,e);let r=a(ki,this)?.popup||this.popup;!r&&i?.text&&(this._createPopup(i),r=a(ki,this).popup),r&&(r.updateEdited(t),i?.deleted&&(r.remove(),p(ki,this,null),this.popup=null))}resetEdited(){a(vo,this)&&(v(Dg,this,YE).call(this,a(vo,this).rect),a(ki,this)?.popup.resetEdited(),p(vo,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),!(this instanceof Ws)&&!(this instanceof Fg)&&(s.tabIndex=0);const{style:o}=s;if(o.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof _g){const{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,s),s}const{width:l,height:h}=this;if(!t&&e.borderStyle.width>0){o.borderWidth=`${e.borderStyle.width}px`;const y=e.borderStyle.horizontalCornerRadius,b=e.borderStyle.verticalCornerRadius;switch(y>0||b>0?o.borderRadius=`calc(${y}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`:this instanceof Qb&&(o.borderRadius=`calc(${l}px * var(--total-scale-factor)) / calc(${h}px * var(--total-scale-factor))`),e.borderStyle.style){case Ca.SOLID:o.borderStyle="solid";break;case Ca.DASHED:o.borderStyle="dashed";break;case Ca.BEVELED:ft("Unimplemented border style: beveled");break;case Ca.INSET:ft("Unimplemented border style: inset");break;case Ca.UNDERLINE:o.borderBottomStyle="solid";break;default:break}const x=e.borderColor||null;x?(p(Ud,this,!0),o.borderColor=Z.makeHexColor(...x)):o.borderWidth=0}const c=Z.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:d,pageHeight:u,pageX:f,pageY:g}=r.rawDims;o.left=`${100*(c[0]-f)/d}%`,o.top=`${100*(c[1]-g)/u}%`;const{rotation:m}=e;return e.hasOwnCanvas||m===0?(o.width=`${100*l/d}%`,o.height=`${100*h/u}%`):this.setRotation(m,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:r}=this.parent.viewport.rawDims;let{width:s,height:o}=this;t%180!==0&&([s,o]=[o,s]),e.style.width=`${100*s/i}%`,e.style.height=`${100*o/r}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,r)=>{const s=r.detail[e],o=s[0],l=s.slice(1);r.target.style[i]=Jb[`${o}_HTML`](l),this.annotationStorage.setValue(this.data.id,{[i]:Jb[`${o}_rgb`](l)})};return mt(this,"_commonActions",{display:e=>{const{display:i}=e.detail,r=i%2===1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:i===1||i===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const r of Object.keys(e.detail))(t[r]||i[r])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[r,s]of Object.entries(e)){const o=i[r];o&&(o({detail:{[r]:s},target:t}),delete e[r])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,r,s]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){const[y,b,x,E]=t.subarray(2,6);if(r===y&&s===b&&e===x&&i===E)return}const{style:o}=this.container;let l;if(a(Ud,this)){const{borderColor:y,borderWidth:b}=o;o.borderWidth=0,l=["url('data:image/svg+xml;utf8,",`<svg xmlns="${wn}" preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${y}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const h=r-e,c=s-i,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const f=d.createElement("defs");u.append(f);const g=d.createElement("clipPath"),m=`clippath_${this.data.id}`;g.setAttribute("id",m),g.setAttribute("clipPathUnits","objectBoundingBox"),f.append(g);for(let y=2,b=t.length;y<b;y+=8){const x=t[y],E=t[y+1],S=t[y+2],T=t[y+3],A=d.createElement("rect"),P=(S-e)/h,C=(s-E)/c,M=(x-S)/h,I=(E-T)/c;A.setAttribute("x",P),A.setAttribute("y",C),A.setAttribute("width",M),A.setAttribute("height",I),g.append(A),l?.push(`<rect vector-effect="non-scaling-stroke" x="${P}" y="${C}" width="${M}" height="${I}"/>`)}a(Ud,this)&&(l.push("</g></svg>')"),o.backgroundImage=l.join("")),this.container.append(u),this.container.style.clipPath=`url(#${m})`}_createPopup(t=null){const{data:e}=this;let i,r;t?(i={str:t.text},r=t.date):(i=e.contentsObj,r=e.modificationDate),p(ki,this,new _g({data:{color:e.color,titleObj:e.titleObj,modificationDate:r,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(a(ki,this)||this.popup||this.data.popupRef)}get extraPopupElement(){return a(ki,this)}render(){Dt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const r=this._fieldObjects[t];if(r)for(const{page:s,id:o,exportValues:l}of r){if(s===-1||o===e)continue;const h=typeof l=="string"?l:null,c=document.querySelector(`[data-element-id="${o}"]`);if(c&&!Bs.has(c)){ft(`_getElementsByName - element not allowed: ${o}`);continue}i.push({id:o,exportValue:h,domElement:c})}return i}for(const r of document.getElementsByName(t)){const{exportValue:s}=r,o=r.getAttribute("data-element-id");o!==e&&Bs.has(r)&&i.push({id:o,exportValue:s,domElement:r})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}updateOC(t){!this.data.oc||!t||(t.isVisible(this.data.oc)?this.show():this.hide())}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},YS=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),this.editor=n.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:n}=this;n.hasComment&&this._createPopup(n.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(n){this.editor.comment=n,n||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},rr=new WeakSet,Fg=class extends oe{constructor(n,t=null){super(n,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),ot(this,rr),this.isTooltipOnly=n.data.isTooltipOnly}render(){const{data:n,linkService:t}=this,e=document.createElement("a");e.setAttribute("data-element-id",n.id);let i=!1;return n.url?(t.addLinkAttributes(e,n.url,n.newWindow),i=!0):n.action?(this._bindNamedAction(e,n.action,n.overlaidText),i=!0):n.attachment?(v(rr,this,RI).call(this,e,n.attachment,n.overlaidText,n.attachmentDest),i=!0):n.setOCGState?(v(rr,this,OI).call(this,e,n.setOCGState,n.overlaidText),i=!0):n.dest?(this._bindLink(e,n.dest,n.overlaidText),i=!0):(n.actions&&(n.actions.Action||n.actions["Mouse Up"]||n.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(e,n),i=!0),n.resetForm?(this._bindResetFormAction(e,n.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(e,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(this.contentElement=e,this.container.append(e)),this.container}_bindLink(n,t,e=""){n.href=this.linkService.getDestinationHash(t),n.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t==="")&&v(rr,this,gl).call(this),e&&(n.title=e)}_bindNamedAction(n,t,e=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(t),!1),e&&(n.title=e),v(rr,this,gl).call(this)}_bindJSAction(n,t){n.href=this.linkService.getAnchorUrl("");const e=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(t.actions)){const r=e.get(i);r&&(n[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:i}}),!1))}t.overlaidText&&(n.title=t.overlaidText),n.onclick||(n.onclick=()=>!1),v(rr,this,gl).call(this)}_bindResetFormAction(n,t){const e=n.onclick;if(e||(n.href=this.linkService.getAnchorUrl("")),v(rr,this,gl).call(this),!this._fieldObjects){ft('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),e||(n.onclick=()=>!1);return}n.onclick=()=>{e?.();const{fields:i,refs:r,include:s}=t,o=[];if(i.length!==0||r.length!==0){const c=new Set(r);for(const d of i){const u=this._fieldObjects[d]||[];for(const{id:f}of u)c.add(f)}for(const d of Object.values(this._fieldObjects))for(const u of d)c.has(u.id)===s&&o.push(u)}else for(const c of Object.values(this._fieldObjects))o.push(...c);const l=this.annotationStorage,h=[];for(const c of o){const{id:d}=c;switch(h.push(d),c.type){case"text":{const f=c.defaultValue||"";l.setValue(d,{value:f});break}case"checkbox":case"radiobutton":{const f=c.defaultValue===c.exportValues;l.setValue(d,{value:f});break}case"combobox":case"listbox":{const f=c.defaultValue||"";l.setValue(d,{value:f});break}default:continue}const u=document.querySelector(`[data-element-id="${d}"]`);if(u){if(!Bs.has(u)){ft(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;u.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}},KS=class extends oe{constructor(n){super(n,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const n=document.createElement("img");return n.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",n.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),n.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(n),this.container}},Ws=class extends oe{render(){return this.container}showElementAndHideCanvas(n){this.data.hasOwnCanvas&&(n.previousSibling?.nodeName==="CANVAS"&&(n.previousSibling.hidden=!0),n.hidden=!1)}_getKeyModifier(n){return Ut.platform.isMac?n.metaKey:n.ctrlKey}_setEventListener(n,t,e,i,r){e.includes("mouse")?n.addEventListener(e,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):n.addEventListener(e,s=>{if(e==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(e==="focus"){if(t.focused)return;t.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(s)}})})}_setEventListeners(n,t,e,i){for(const[r,s]of e)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(t||(t={focused:!1})),this._setEventListener(n,t,r,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(n,t,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(n,t,"focus","Focus",null))}_setBackgroundColor(n){const t=this.data.backgroundColor||null;n.style.backgroundColor=t===null?"transparent":Z.makeHexColor(...t)}_setTextStyle(n){const t=["left","center","right"],{fontColor:e}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||GS,r=n.style;let s;const o=2,l=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o),c=h/(Math.round(h/(ap*i))||1);s=Math.min(i,l(c/ap))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o);s=Math.min(i,l(h/ap))}r.fontSize=`calc(${s}px * var(--total-scale-factor))`,r.color=Z.makeHexColor(...e),this.data.textAlignment!==null&&(r.textAlign=t[this.data.textAlignment])}_setRequired(n,t){t?n.setAttribute("required",!0):n.removeAttribute("required"),n.setAttribute("aria-required",t)}},ZS=class extends Ws{constructor(n){const t=n.renderForms||n.data.hasOwnCanvas||!n.data.hasAppearance&&!!n.data.fieldValue;super(n,{isRenderable:t})}setPropertyOnSiblings(n,t,e,i){const r=this.annotationStorage;for(const s of this._getElementsByName(n.name,n.id))s.domElement&&(s.domElement[t]=e),r.setValue(s.id,{[i]:e})}render(){const n=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let e=null;if(this.renderForms){const i=n.getValue(t,{value:this.data.fieldValue});let r=i.value||"";const s=n.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let o=i.formattedValue||this.data.textContent?.join(`
85
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:r,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(e=document.createElement("textarea"),e.textContent=o??r,this.data.doNotScroll&&(e.style.overflowY="hidden")):(e=document.createElement("input"),e.type=this.data.password?"password":"text",e.setAttribute("value",o??r),this.data.doNotScroll&&(e.style.overflowX="hidden")),this.data.hasOwnCanvas&&(e.hidden=!0),Bs.add(e),this.contentElement=e,e.setAttribute("data-element-id",t),e.disabled=this.data.readOnly,e.name=this.data.fieldName,e.tabIndex=0;const{datetimeFormat:h,datetimeType:c,timeStep:d}=this.data,u=!!c&&this.enableScripting;h&&(e.title=h),this._setRequired(e,this.data.required),s&&(e.maxLength=s),e.addEventListener("input",g=>{n.setValue(t,{value:g.target.value}),this.setPropertyOnSiblings(e,"value",g.target.value,"value"),l.formattedValue=null}),e.addEventListener("resetform",g=>{const m=this.data.defaultFieldValue??"";e.value=l.userValue=m,l.formattedValue=null});let f=g=>{const{formattedValue:m}=l;m!=null&&(g.target.value=m),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){e.addEventListener("focus",m=>{if(l.focused)return;const{target:y}=m;if(u&&(y.type=c,d&&(y.step=d)),l.userValue){const b=l.userValue;if(u)if(c==="time"){const x=new Date(b);y.value=[x.getHours(),x.getMinutes(),x.getSeconds()].map(E=>E.toString().padStart(2,"0")).join(":")}else y.value=new Date(b-XS).toISOString().split(c==="date"?"T":".",1)[0];else y.value=b}l.lastCommittedValue=y.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),e.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target),this._dispatchEventFromSandbox({value(y){l.userValue=y.detail.value??"",u||n.setValue(t,{value:l.userValue.toString()}),y.target.value=l.userValue},formattedValue(y){const{formattedValue:b}=y.detail;l.formattedValue=b,b!=null&&y.target!==document.activeElement&&(y.target.value=b);const x={formattedValue:b};u&&(x.value=b),n.setValue(t,x)},selRange(y){y.target.setSelectionRange(...y.detail.selRange)},charLimit:y=>{const{charLimit:b}=y.detail,{target:x}=y;if(b===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",b);let E=l.userValue;!E||E.length<=b||(E=E.slice(0,b),x.value=l.userValue=E,n.setValue(t,{value:E}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}},m)}),e.addEventListener("keydown",m=>{l.commitKey=1;let y=-1;if(m.key==="Escape"?y=0:m.key==="Enter"&&!this.data.multiLine?y=2:m.key==="Tab"&&(l.commitKey=3),y===-1)return;const{value:b}=m.target;l.lastCommittedValue!==b&&(l.lastCommittedValue=b,l.userValue=b,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:y,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const g=f;f=null,e.addEventListener("blur",m=>{if(!l.focused||!m.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:y}=m;let{value:b}=y;if(u){if(b&&c==="time"){const x=b.split(":").map(E=>parseInt(E,10));b=new Date(2e3,0,1,x[0],x[1],x[2]||0).valueOf(),y.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();y.type="text"}l.userValue=b,l.lastCommittedValue!==b&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:l.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),g(m)}),this.data.actions?.Keystroke&&e.addEventListener("beforeinput",m=>{l.lastCommittedValue=null;const{data:y,target:b}=m,{value:x,selectionStart:E,selectionEnd:S}=b;let T=E,A=S;switch(m.inputType){case"deleteWordBackward":{const P=x.substring(0,E).match(/\w*\W*$/);P&&(T-=P[0].length);break}case"deleteWordForward":{const P=x.substring(E).match(/^\W*\w*/);P&&(A+=P[0].length);break}case"deleteContentBackward":E===S&&(T-=1);break;case"deleteContentForward":E===S&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:x,change:y||"",willCommit:!1,selStart:T,selEnd:A}})}),this._setEventListeners(e,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(f&&e.addEventListener("blur",f),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;e.classList.add("comb"),e.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell",this.data.hasOwnCanvas&&(e.hidden=!0);return this._setTextStyle(e),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}},JS=class extends Ws{constructor(n){super(n,{isRenderable:!!n.data.hasOwnCanvas})}},QS=class extends Ws{constructor(n){super(n,{isRenderable:n.renderForms})}render(){const n=this.annotationStorage,t=this.data,e=t.id;let i=n.getValue(e,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",n.setValue(e,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return Bs.add(r),r.setAttribute("data-element-id",e),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.fieldName,i&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=0,r.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const h of this._getElementsByName(o,e)){const c=l&&h.exportValue===t.exportValue;h.domElement&&(h.domElement.checked=c),n.setValue(h.id,{value:c})}n.setValue(e,{value:l})}),r.addEventListener("resetform",s=>{const o=t.defaultFieldValue||"Off";s.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({value(o){o.target.checked=o.detail.value!=="Off",n.setValue(e,{value:o.target.checked})}},s)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},Qb=class extends Ws{constructor(n){super(n,{isRenderable:n.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const n=this.annotationStorage,t=this.data,e=t.id;let i=n.getValue(e,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,n.setValue(e,{value:i})),i)for(const s of this._getElementsByName(t.fieldName,e))n.setValue(s.id,{value:!1});const r=document.createElement("input");if(Bs.add(r),r.setAttribute("data-element-id",e),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.fieldName,i&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",s=>{const{name:o,checked:l}=s.target;for(const h of this._getElementsByName(o,e))n.setValue(h.id,{value:!1});n.setValue(e,{value:l})}),r.addEventListener("resetform",s=>{const o=t.defaultFieldValue;s.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const s=t.buttonValue;r.addEventListener("updatefromsandbox",o=>{this._dispatchEventFromSandbox({value:l=>{const h=s===l.detail.value;for(const c of this._getElementsByName(l.target.name)){const d=h&&c.id===e;c.domElement&&(c.domElement.checked=d),n.setValue(c.id,{value:d})}}},o)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},qS=class extends Fg{constructor(n){super(n,{ignoreBorder:n.data.hasAppearance})}render(){const n=super.render();n.classList.add("buttonWidgetAnnotation","pushButton");const t=n.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),n}},t1=class extends Ws{constructor(n){super(n,{isRenderable:n.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const n=this.annotationStorage,t=this.data.id,e=n.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");Bs.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const f of i.options)f.selected=f.value===u});const s=(d,u)=>{const f=u.replaceAll(" "," ");d.textContent=f,f!==u&&d.setAttribute("display-value",u)};for(const d of this.data.options){const u=document.createElement("option");s(u,d.displayValue),u.value=d.exportValue,e.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),r=!1),i.append(u)}let o=null;if(r){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),i.prepend(d),o=()=>{d.remove(),i.removeEventListener("input",o),o=null},i.addEventListener("input",o)}const l=d=>{const u=d?"value":"textContent",{options:f,multiple:g}=i;return g?Array.prototype.filter.call(f,m=>m.selected).map(m=>m[u]):f.selectedIndex===-1?null:f[f.selectedIndex][u]};let h=l(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,f=>({displayValue:f.getAttribute("display-value")||f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",d=>{this._dispatchEventFromSandbox({value(u){o?.();const f=u.detail.value,g=new Set(Array.isArray(f)?f:[f]);for(const m of i.options)m.selected=g.has(m.value);n.setValue(t,{value:l(!0)}),h=l(!1)},multipleSelection(u){i.multiple=!0},remove(u){const f=i.options,g=u.detail.remove;f[g].selected=!1,i.remove(g),f.length>0&&Array.prototype.findIndex.call(f,m=>m.selected)===-1&&(f[0].selected=!0),n.setValue(t,{value:l(!0),items:c(u)}),h=l(!1)},clear(u){for(;i.length!==0;)i.remove(0);n.setValue(t,{value:null,items:[]}),h=l(!1)},insert(u){const{index:f,displayValue:g,exportValue:m}=u.detail.insert,y=i.children[f],b=document.createElement("option");s(b,g),b.value=m,y?y.before(b):i.append(b),n.setValue(t,{value:l(!0),items:c(u)}),h=l(!1)},items(u){const{items:f}=u.detail;for(;i.length!==0;)i.remove(0);for(const g of f){const{displayValue:m,exportValue:y}=g,b=document.createElement("option");s(b,m),b.value=y,i.append(b)}i.options.length>0&&(i.options[0].selected=!0),n.setValue(t,{value:l(!0),items:c(u)}),h=l(!1)},indices(u){const f=new Set(u.detail.indices);for(const g of u.target.options)g.selected=f.has(g.index);n.setValue(t,{value:l(!0)}),h=l(!1)},editable(u){u.target.disabled=!u.detail.editable}},d)}),i.addEventListener("input",d=>{const u=l(!0),f=l(!1);n.setValue(t,{value:u}),d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:h,change:f,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):i.addEventListener("input",function(d){n.setValue(t,{value:l(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Ng=new WeakSet,_g=class extends oe{constructor(n){const{data:t,elements:e,parent:i}=n,r=!!i._commentManager;if(super(n,{isRenderable:!r&&oe._hasPopupData(t)}),ot(this,Ng),this.elements=e,r&&oe._hasPopupData(t)){const s=this.popup=v(Ng,this,KE).call(this);for(const o of e)o.popup=s}else this.popup=null}render(){const{container:n}=this;n.classList.add("popupAnnotation"),n.role="comment";const t=this.popup=v(Ng,this,KE).call(this),e=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(i=>`${Pa}${i}`).join(",")),this.container}},ri=new WeakMap,yo=new WeakMap,qb=new WeakMap,tw=new WeakMap,$d=new WeakMap,Hd=new WeakMap,ge=new WeakMap,Wr=new WeakMap,bo=new WeakMap,Eh=new WeakMap,Vd=new WeakMap,zd=new WeakMap,jr=new WeakMap,si=new WeakMap,js=new WeakMap,Us=new WeakMap,me=new WeakMap,$s=new WeakMap,wo=new WeakMap,Bg=new WeakMap,Hs=new WeakMap,Gd=new WeakMap,xo=new WeakMap,Eo=new WeakMap,Ue=new WeakMap,Vs=new WeakMap,Wt=new WeakSet,e1=class{constructor({container:n,color:t,elements:e,titleObj:i,modificationDate:r,contentsObj:s,richText:o,parent:l,rect:h,parentRect:c,open:d,commentManager:u=null}){ot(this,Wt),w(this,ri,null),w(this,yo,v(Wt,this,FI).bind(this)),w(this,qb,v(Wt,this,tA).bind(this)),w(this,tw,v(Wt,this,Wy).bind(this)),w(this,$d,v(Wt,this,By).bind(this)),w(this,Hd,null),w(this,ge,null),w(this,Wr,null),w(this,bo,null),w(this,Eh,null),w(this,Vd,null),w(this,zd,null),w(this,jr,!1),w(this,si,null),w(this,js,null),w(this,Us,null),w(this,me,null),w(this,$s,null),w(this,wo,null),w(this,Bg,null),w(this,Hs,null),w(this,Gd,null),w(this,xo,null),w(this,Eo,!1),w(this,Ue,null),w(this,Vs,null),p(ge,this,n),p(Gd,this,i),p(Wr,this,s),p(Hs,this,o),p(Vd,this,l),p(Hd,this,t),p(Bg,this,h),p(zd,this,c),p(Eh,this,e),p(ri,this,u),p(Ue,this,e[0]),p(bo,this,mp.toDateObject(r)),this.trigger=e.flatMap(f=>f.getElementsToTriggerPopup()),u||(v(Wt,this,Ny).call(this),a(ge,this).hidden=!0,d&&v(Wt,this,By).call(this))}renderCommentButton(){if(a(me,this)){a(me,this).parentNode||a(Ue,this).container.after(a(me,this));return}if(a($s,this)||v(Wt,this,ZE).call(this),!a($s,this))return;const{signal:n}=p(js,this,new AbortController),t=a(Ue,this).hasOwnCommentButton,e=()=>{a(ri,this).toggleCommentPopup(this,!0,void 0,!t)},i=()=>{a(ri,this).toggleCommentPopup(this,!1,!0,!t)},r=()=>{a(ri,this).toggleCommentPopup(this,!1,!1)};if(t){p(me,this,a(Ue,this).container);for(const s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",a(yo,this),{signal:n}),s.addEventListener("click",e,{signal:n}),s.addEventListener("pointerenter",i,{signal:n}),s.addEventListener("pointerleave",r,{signal:n}),s.classList.add("popupTriggerArea")}else{const s=p(me,this,document.createElement("button"));s.className="annotationCommentButton";const o=a(Ue,this).container;s.style.zIndex=parseInt(o.style.zIndex,10)+1,s.tabIndex=0,s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.setAttribute("data-l10n-id","pdfjs-show-comment-button"),v(Wt,this,QE).call(this),v(Wt,this,JE).call(this),s.addEventListener("keydown",a(yo,this),{signal:n}),s.addEventListener("click",e,{signal:n}),s.addEventListener("pointerenter",i,{signal:n}),s.addEventListener("pointerleave",r,{signal:n}),o.after(s)}}get commentButtonColor(){const{color:n,opacity:t}=a(Ue,this).commentData;return n?a(Vd,this)._commentManager.makeCommentColor(n,t):null}focusCommentButton(){setTimeout(()=>{a(me,this)?.focus()},0)}getData(){const{richText:n,color:t,opacity:e,creationDate:i,modificationDate:r}=a(Ue,this).commentData;return{contentsObj:{str:this.comment},richText:n,color:t,opacity:e,creationDate:i,modificationDate:r}}get elementBeforePopup(){return a(me,this)}get comment(){return a(Vs,this)||p(Vs,this,a(Ue,this).commentText),a(Vs,this)}set comment(n){n!==this.comment&&(a(Ue,this).commentText=p(Vs,this,n))}focus(){a(Ue,this).container?.focus()}get parentBoundingClientRect(){return a(Ue,this).layer.getBoundingClientRect()}setCommentButtonStates({selected:n,hasPopup:t}){a(me,this)&&(a(me,this).classList.toggle("selected",n),a(me,this).ariaExpanded=t)}setSelectedCommentButton(n){a(me,this).classList.toggle("selected",n)}get commentPopupPosition(){if(a(wo,this))return a(wo,this);const{x:n,y:t,height:e}=a(me,this).getBoundingClientRect(),{x:i,y:r,width:s,height:o}=a(Ue,this).layer.getBoundingClientRect();return[(n-i)/s,(t+e-r)/o]}set commentPopupPosition(n){p(wo,this,n)}hasDefaultPopupPosition(){return a(wo,this)===null}get commentButtonPosition(){return a($s,this)}get commentButtonWidth(){return a(me,this).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(n){const[t,e]=a(wo,this)||this.commentButtonPosition.map(h=>h/100),i=this.parentBoundingClientRect,{x:r,y:s,width:o,height:l}=i;a(ri,this).showDialog(null,this,r+t*o,s+e*l,{...n,parentDimensions:i})}render(){if(a(si,this))return;const n=p(si,this,document.createElement("div"));if(n.className="popup",a(Hd,this)){const e=n.style.outlineColor=Z.makeHexColor(...a(Hd,this));n.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`}const t=document.createElement("span");if(t.className="header",a(Gd,this)?.str){const e=document.createElement("span");e.className="title",t.append(e),{dir:e.dir,str:e.textContent}=a(Gd,this)}if(n.append(t),a(bo,this)){const e=document.createElement("time");e.className="popupDate",e.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),e.setAttribute("data-l10n-args",JSON.stringify({dateObj:a(bo,this).valueOf()})),e.dateTime=a(bo,this).toISOString(),t.append(e)}q0({html:_y.call(v(Wt,this))||a(Wr,this).str,dir:a(Wr,this)?.dir,className:"popupContent"},n),a(ge,this).append(n)}updateEdited({rect:n,popup:t,deleted:e}){if(a(ri,this)){e?(this.remove(),p(Vs,this,null)):t&&(t.deleted?this.remove():(v(Wt,this,QE).call(this),p(Vs,this,t.text))),n&&(p($s,this,null),v(Wt,this,ZE).call(this),v(Wt,this,JE).call(this));return}if(e||t?.deleted){this.remove();return}v(Wt,this,Ny).call(this),a(xo,this)||p(xo,this,{contentsObj:a(Wr,this),richText:a(Hs,this)}),n&&p(Us,this,null),t&&t.text&&(p(Hs,this,v(Wt,this,DI).call(this,t.text)),p(bo,this,mp.toDateObject(t.date)),p(Wr,this,null)),a(si,this)?.remove(),p(si,this,null)}resetEdited(){a(xo,this)&&({contentsObj:Af(p,[Wr,this])._,richText:Af(p,[Hs,this])._}=a(xo,this),p(xo,this,null),a(si,this)?.remove(),p(si,this,null),p(Us,this,null))}remove(){if(a(js,this)?.abort(),p(js,this,null),a(si,this)?.remove(),p(si,this,null),p(Eo,this,!1),p(jr,this,!1),a(me,this)?.remove(),p(me,this,null),this.trigger)for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){p(Eo,this,this.isVisible),a(Eo,this)&&(a(ge,this).hidden=!0)}maybeShow(){a(ri,this)||(v(Wt,this,Ny).call(this),a(Eo,this)&&(a(si,this)||v(Wt,this,Wy).call(this),p(Eo,this,!1),a(ge,this).hidden=!1))}get isVisible(){return a(ri,this)?!1:a(ge,this).hidden===!1}},ew=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),this.textContent=n.data.textContent,this.textPosition=n.data.textPosition,this.annotationEditorType=pt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const n=this.contentElement=document.createElement("div");n.classList.add("annotationTextContent"),n.setAttribute("role","comment");for(const t of this.textContent){const e=document.createElement("span");e.textContent=t,n.append(e)}this.container.append(n)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},Wg=new WeakMap,n1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),w(this,Wg,null)}render(){this.container.classList.add("lineAnnotation");const{data:n,width:t,height:e}=this,i=this.svgFactory.create(t,e,!0),r=p(Wg,this,this.svgFactory.createElement("svg:line"));return r.setAttribute("x1",n.rect[2]-n.lineCoordinates[0]),r.setAttribute("y1",n.rect[3]-n.lineCoordinates[1]),r.setAttribute("x2",n.rect[2]-n.lineCoordinates[2]),r.setAttribute("y2",n.rect[3]-n.lineCoordinates[3]),r.setAttribute("stroke-width",n.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),i.append(r),this.container.append(i),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return a(Wg,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},jg=new WeakMap,i1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),w(this,jg,null)}render(){this.container.classList.add("squareAnnotation");const{data:n,width:t,height:e}=this,i=this.svgFactory.create(t,e,!0),r=n.borderStyle.width,s=p(jg,this,this.svgFactory.createElement("svg:rect"));return s.setAttribute("x",r/2),s.setAttribute("y",r/2),s.setAttribute("width",t-r),s.setAttribute("height",e-r),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return a(jg,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},Ug=new WeakMap,r1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),w(this,Ug,null)}render(){this.container.classList.add("circleAnnotation");const{data:n,width:t,height:e}=this,i=this.svgFactory.create(t,e,!0),r=n.borderStyle.width,s=p(Ug,this,this.svgFactory.createElement("svg:ellipse"));return s.setAttribute("cx",t/2),s.setAttribute("cy",e/2),s.setAttribute("rx",t/2-r/2),s.setAttribute("ry",e/2-r/2),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return a(Ug,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},$g=new WeakMap,nw=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),w(this,$g,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,vertices:t,borderStyle:e,popupRef:i},width:r,height:s}=this;if(!t)return this.container;const o=this.svgFactory.create(r,s,!0);let l=[];for(let c=0,d=t.length;c<d;c+=2){const u=t[c]-n[0],f=n[3]-t[c+1];l.push(`${u},${f}`)}l=l.join(" ");const h=p($g,this,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",l),h.setAttribute("stroke-width",e.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),o.append(h),this.container.append(o),!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return a($g,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},s1=class extends nw{constructor(n){super(n),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},a1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},Hg=new WeakMap,Ah=new WeakMap,Vg=new WeakSet,zg=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),ot(this,Vg),w(this,Hg,null),w(this,Ah,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?pt.HIGHLIGHT:pt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,rotation:t,inkLists:e,borderStyle:i,popupRef:r}}=this,{transform:s,width:o,height:l}=v(Vg,this,eA).call(this,t,n),h=this.svgFactory.create(o,l,!0),c=p(Hg,this,this.svgFactory.createElement("svg:g"));h.append(c),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",s);for(let d=0,u=e.length;d<u;d++){const f=this.svgFactory.createElement(this.svgElementName);a(Ah,this).push(f),f.setAttribute("points",e[d].join(",")),c.append(f)}return!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(n){super.updateEdited(n);const{thickness:t,points:e,rect:i}=n,r=a(Hg,this);if(t>=0&&r.setAttribute("stroke-width",t||1),e)for(let s=0,o=a(Ah,this).length;s<o;s++)a(Ah,this)[s].setAttribute("points",e[s].join(","));if(i){const{transform:s,width:o,height:l}=v(Vg,this,eA).call(this,this.data.rotation,i);r.parentElement.setAttribute("viewBox",`0 0 ${o} ${l}`),r.setAttribute("transform",s)}}getElementsToTriggerPopup(){return a(Ah,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},iw=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=pt.HIGHLIGHT}render(){const{data:{overlaidText:n,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),n){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=n,this.container.append(e)}return this.container}},o1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:n,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),n){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=n,this.container.append(e)}return this.container}},l1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:n,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),n){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=n,this.container.append(e)}return this.container}},h1=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:n,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),n){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=n,this.container.append(e)}return this.container}},rw=class extends oe{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=pt.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},Gg=new WeakMap,Xg=new WeakSet,c1=class extends oe{constructor(n){super(n,{isRenderable:!0}),ot(this,Xg),w(this,Gg,null);const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:n,data:t}=this;let e;t.hasAppearance||t.fillAlpha===0?e=document.createElement("div"):(e=document.createElement("img"),e.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(e.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),e.addEventListener("dblclick",v(Xg,this,nA).bind(this)),p(Gg,this,e);const{isMac:i}=Ut.platform;return n.addEventListener("keydown",r=>{r.key==="Enter"&&(i?r.metaKey:r.ctrlKey)&&v(Xg,this,nA).call(this)}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):e.classList.add("popupTriggerArea"),n.append(e),n}getElementsToTriggerPopup(){return a(Gg,this)}addHighlightArea(){this.container.classList.add("highlightArea")}},Sh=new WeakMap,Th=new WeakMap,Xd=new WeakMap,Ao=new WeakMap,Yg=new WeakMap,Ph=new WeakMap,jn=new WeakMap,Kg=new WeakMap,So=new WeakSet,d1=class EC{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:r,page:s,viewport:o,structTreeLayer:l,commentManager:h,linkService:c,annotationStorage:d}){ot(this,So),w(this,Sh,null),w(this,Th,null),w(this,Xd,null),w(this,Ao,new Map),w(this,Yg,null),w(this,Ph,null),w(this,jn,[]),w(this,Kg,!1),D(this,"zIndex",0),this.div=t,p(Sh,this,e),p(Th,this,i),p(Yg,this,l||null),p(Ph,this,c||null),p(Xd,this,d||new Xp),this.page=s,this.viewport=o,this._annotationEditorUIManager=r,this._commentManager=h||null}hasEditableAnnotations(){return a(Ao,this).size>0}async render(t){const{annotations:e,optionalContentConfig:i}=t,r=this.div;xa(r,this.viewport);const s=new Map,o=[],l={data:null,layer:r,linkService:a(Ph,this),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new jd,annotationStorage:a(Xd,this),enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const h of e){if(h.noHTML)continue;const c=h.annotationType===ce.POPUP;if(c){const f=s.get(h.id);if(!f)continue;if(!this._commentManager){o.push(h);continue}l.elements=f}else if(h.rect[2]===h.rect[0]||h.rect[3]===h.rect[1])continue;l.data=h;const d=Lg.create(l);if(!d.isRenderable)continue;c||(a(jn,this).push(d),h.popupRef&&s.getOrInsertComputed(h.popupRef,cp).push(d));const u=d.render();h.hidden&&(u.style.visibility="hidden"),d.updateOC(i),d._isEditable&&(a(Ao,this).set(d.data.id,d),this._annotationEditorUIManager?.renderAnnotationElement(d))}await v(So,this,jy).call(this);for(const h of o){const c=l.elements=s.get(h.id);l.data=h;const d=Lg.create(l);if(!d.isRenderable)continue;const u=d.render();d.contentElement.id=`${Pa}${h.id}`,h.hidden&&(u.style.visibility="hidden"),c.at(-1).container.after(u)}v(So,this,iA).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:a(Ph,this),svgFactory:new jd,parent:this};for(const i of t){i.borderStyle||(i.borderStyle=EC._defaultBorderStyle),e.data=i;const r=Lg.create(e);r.isRenderable&&(r.render(),r.contentElement.id=`${Pa}${i.id}`,a(jn,this).push(r))}await v(So,this,jy).call(this)}update({viewport:t,optionalContentConfig:e}){const i=this.div;this.viewport=t,xa(i,{rotation:t.rotation});for(const r of a(jn,this))r.updateOC(e);v(So,this,iA).call(this),i.hidden=!1}getEditableAnnotations(){return a(Ao,this).values()}getEditableAnnotation(t){return a(Ao,this).get(t)}addFakeAnnotation(t){const{div:e}=this,{id:i,rotation:r}=t,s=new YS({data:{id:i,rect:t.getPDFRect(),rotation:r},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:a(Ph,this),annotationStorage:a(Xd,this)});return s.render(),s.contentElement.id=`${Pa}${i}`,s.createOrUpdatePopup(),a(jn,this).push(s),s}removeAnnotation(t){const e=a(jn,this).findIndex(r=>r.data.id===t);if(e<0)return;const[i]=a(jn,this).splice(e,1);a(Sh,this)?.removePointerInTextLayer(i.contentElement)}updateFakeAnnotations(t){if(t.length!==0){for(const e of t)e.updateFakeAnnotationElement(this);v(So,this,jy).call(this)}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return mt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Ca.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},Yd=/\r\n?|\n/g,ai=new WeakMap,Zg=new WeakMap,Ch=new WeakMap,oi=new WeakMap,Un=new WeakSet,Ur=class on extends St{static get _keyboardManager(){const t=on.prototype,e=s=>s.isEmpty(),i=vs.TRANSLATE_SMALL,r=vs.TRANSLATE_BIG;return mt(this,"_keyboardManager",new Sl([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,r],checker:e}]]))}constructor(t){super({...t,name:"freeTextEditor"}),ot(this,Un),w(this,ai,""),w(this,Zg,`${this.id}-editor`),w(this,Ch,null),w(this,oi,void 0),D(this,"_colorPicker",null),this.color=t.color||on._defaultColor||St._defaultLineColor,p(oi,this,t.fontSize||on._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert(St._l10nAlert.freetext),this.canAddComment=!1}static initialize(t,e){St.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case wt.FREETEXT_SIZE:on._defaultFontSize=e;break;case wt.FREETEXT_COLOR:on._defaultColor=e;break}}updateParams(t,e){switch(t){case wt.FREETEXT_SIZE:v(Un,this,_I).call(this,e);break;case wt.FREETEXT_COLOR:v(Un,this,BI).call(this,e);break}}static get defaultPropertiesToUpdate(){return[[wt.FREETEXT_SIZE,on._defaultFontSize],[wt.FREETEXT_COLOR,on._defaultColor||St._defaultLineColor]]}get propertiesToUpdate(){return[[wt.FREETEXT_SIZE,a(oi,this)],[wt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Zb(this)),[["colorPicker",this._colorPicker]]}get colorType(){return wt.FREETEXT_COLOR}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-on._internalPadding*t,-(on._internalPadding+a(oi,this))*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),p(Ch,this,new AbortController);const t=this._uiManager.combinedSignal(a(Ch,this));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",a(Zg,this)),this._isDraggable=!0,a(Ch,this)?.abort(),p(Ch,this,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=a(ai,this),e=p(ai,this,v(Un,this,WI).call(this).trimEnd());if(t===e)return;const i=r=>{if(p(ai,this,r),!r){this.remove();return}v(Un,this,Hy).call(this),this._uiManager.rebuild(this),v(Un,this,Uy).call(this)};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),v(Un,this,Uy).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){on._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",a(Zg,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${a(oi,this)}px * var(--total-scale-factor))`,i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[r,s]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,h]=this.getInitialTranslation();[l,h]=this.pageTranslationToScreen(l,h);const[c,d]=this.pageDimensions,[u,f]=this.pageTranslation;let g,m;switch(this.rotation){case 0:g=t+(o[0]-u)/c,m=e+this.height-(o[1]-f)/d;break;case 90:g=t+(o[0]-u)/c,m=e-(o[1]-f)/d,[l,h]=[h,-l];break;case 180:g=t-this.width+(o[0]-u)/c,m=e-(o[1]-f)/d,[l,h]=[-l,-h];break;case 270:g=t+(o[0]-u-this.height*d)/c,m=e+(o[1]-f-this.width*c)/d,[l,h]=[-h,l];break}this.setAt(g*r,m*s,l,h)}else this._moveAfterPaste(t,e);v(Un,this,Hy).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();const r=rA.call(on,e.getData("text")||"").replaceAll(Yd,`
86
+ `);if(!r)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const o=s.getRangeAt(0);if(!r.includes(`
87
+ `)){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),s.collapseToStart();return}const{startContainer:l,startOffset:h}=o,c=[],d=[];if(l.nodeType===Node.TEXT_NODE){const g=l.parentElement;if(d.push(l.nodeValue.slice(h).replaceAll(Yd,"")),g!==this.editorDiv){let m=c;for(const y of this.editorDiv.childNodes){if(y===g){m=d;continue}m.push($y.call(on,y))}}c.push(l.nodeValue.slice(0,h).replaceAll(Yd,""))}else if(l===this.editorDiv){let g=c,m=0;for(const y of this.editorDiv.childNodes)m++===h&&(g=d),g.push($y.call(on,y))}p(ai,this,`${c.join(`
88
+ `)}${r}${d.join(`
89
+ `)}`),v(Un,this,Hy).call(this);const u=new Range;let f=Math.sumPrecise(c.map(g=>g.length));for(const{firstChild:g}of this.editorDiv.childNodes)if(g.nodeType===Node.TEXT_NODE){const m=g.nodeValue.length;if(f<=m){u.setStart(g,f),u.setEnd(g,f);break}f-=m}s.removeAllRanges(),s.addRange(u)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=on._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let r=null;if(t instanceof ew){const{data:{defaultAppearanceData:{fontSize:o,fontColor:l},rect:h,rotation:c,id:d,popupRef:u,richText:f,contentsObj:g,creationDate:m,modificationDate:y},textContent:b,textPosition:x,parent:{page:{pageNumber:E}}}=t;if(!b||b.length===0)return null;r=t={annotationType:pt.FREETEXT,color:Array.from(l),fontSize:o,value:b.join(`
90
+ `),position:x,pageIndex:E-1,rect:h.slice(0),rotation:c,annotationElementId:d,id:d,deleted:!1,popupRef:u,comment:g?.str||null,richText:f,creationDate:m,modificationDate:y}}const s=await super.deserialize(t,e,i);return p(oi,s,t.fontSize),s.color=Z.makeHexColor(...t.color),p(ai,s,rA.call(on,t.value)),s._initialData=r,t.comment&&s.setCommentData(t),s}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=St._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:a(oi,this),value:v(Un,this,jI).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!v(Un,this,UI).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize=`calc(${a(oi,this)}px * var(--total-scale-factor))`,i.color=this.color,e.replaceChildren();for(const r of a(ai,this).split(`
91
+ `)){const s=document.createElement("div");s.append(r?document.createTextNode(r):document.createElement("br")),e.append(s)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:a(ai,this)}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}},CA=Ur,D(Ur,"_freeTextDefaultContent",""),D(Ur,"_internalPadding",0),D(Ur,"_defaultColor",null),D(Ur,"_defaultFontSize",10),D(Ur,"_type","freetext"),D(Ur,"_editorType",pt.FREETEXT),nt=class{toSVGPath(){Dt("Abstract method `toSVGPath` must be implemented.")}get box(){Dt("Abstract getter `box` must be implemented.")}serialize(n,t){Dt("Abstract method `serialize` must be implemented.")}static _rescale(n,t,e,i,r,s){s||(s=new Float32Array(n.length));for(let o=0,l=n.length;o<l;o+=2)s[o]=t+n[o]*i,s[o+1]=e+n[o+1]*r;return s}static _rescaleAndSwap(n,t,e,i,r,s){s||(s=new Float32Array(n.length));for(let o=0,l=n.length;o<l;o+=2)s[o]=t+n[o+1]*i,s[o+1]=e+n[o]*r;return s}static _translate(n,t,e,i){i||(i=new Float32Array(n.length));for(let r=0,s=n.length;r<s;r+=2)i[r]=t+n[r],i[r+1]=e+n[r+1];return i}static svgRound(n){return Math.round(n*1e4)}static _normalizePoint(n,t,e,i,r){switch(r){case 90:return[1-t/e,n/i];case 180:return[1-n/e,1-t/i];case 270:return[t/e,1-n/i];default:return[n/e,t/i]}}static createBezierPoints(n,t,e,i,r,s){return[(n+5*e)/6,(t+5*i)/6,(5*e+r)/6,(5*i+s)/6,(e+r)/2,(i+s)/2]}},D(nt,"PRECISION",1e-4),li=new WeakMap,sr=new WeakMap,Kd=new WeakMap,Zd=new WeakMap,$r=new WeakMap,Tt=new WeakMap,Mh=new WeakMap,Ih=new WeakMap,Jg=new WeakMap,Qg=new WeakMap,Jd=new WeakMap,Qd=new WeakMap,To=new WeakMap,hi=new WeakSet,sw=class{constructor({x:n,y:t},e,i,r,s,o=0){ot(this,hi),w(this,li,void 0),w(this,sr,[]),w(this,Kd,void 0),w(this,Zd,void 0),w(this,$r,[]),w(this,Tt,new Float32Array(18)),w(this,Mh,void 0),w(this,Ih,void 0),w(this,Jg,void 0),w(this,Qg,void 0),w(this,Jd,void 0),w(this,Qd,void 0),w(this,To,[]),p(li,this,e),p(Qd,this,r*i),p(Zd,this,s),a(Tt,this).set([NaN,NaN,NaN,NaN,n,t],6),p(Kd,this,o),p(Qg,this,aw._*i),p(Jg,this,u1._*i),p(Jd,this,i),a(To,this).push(n,t)}isEmpty(){return isNaN(a(Tt,this)[8])}add({x:n,y:t}){p(Mh,this,n),p(Ih,this,t);const[e,i,r,s]=a(li,this);let[o,l,h,c]=a(Tt,this).subarray(8,12);const d=n-h,u=t-c,f=Math.hypot(d,u);if(f<a(Jg,this))return!1;const g=f-a(Qg,this),m=g/f,y=m*d,b=m*u;let x=o,E=l;o=h,l=c,h+=y,c+=b,a(To,this)?.push(n,t);const S=-b/g,T=y/g,A=S*a(Qd,this),P=T*a(Qd,this);return a(Tt,this).set(a(Tt,this).subarray(2,8),0),a(Tt,this).set([h+A,c+P],4),a(Tt,this).set(a(Tt,this).subarray(14,18),12),a(Tt,this).set([h-A,c-P],16),isNaN(a(Tt,this)[6])?(a($r,this).length===0&&(a(Tt,this).set([o+A,l+P],2),a($r,this).push(NaN,NaN,NaN,NaN,(o+A-e)/r,(l+P-i)/s),a(Tt,this).set([o-A,l-P],14),a(sr,this).push(NaN,NaN,NaN,NaN,(o-A-e)/r,(l-P-i)/s)),a(Tt,this).set([x,E,o,l,h,c],6),!this.isEmpty()):(a(Tt,this).set([x,E,o,l,h,c],6),Math.abs(Math.atan2(E-l,x-o)-Math.atan2(b,y))<Math.PI/2?([o,l,h,c]=a(Tt,this).subarray(2,6),a($r,this).push(NaN,NaN,NaN,NaN,((o+h)/2-e)/r,((l+c)/2-i)/s),[o,l,x,E]=a(Tt,this).subarray(14,18),a(sr,this).push(NaN,NaN,NaN,NaN,((x+o)/2-e)/r,((E+l)/2-i)/s),!0):([x,E,o,l,h,c]=a(Tt,this).subarray(0,6),a($r,this).push(((x+5*o)/6-e)/r,((E+5*l)/6-i)/s,((5*o+h)/6-e)/r,((5*l+c)/6-i)/s,((o+h)/2-e)/r,((l+c)/2-i)/s),[h,c,o,l,x,E]=a(Tt,this).subarray(12,18),a(sr,this).push(((x+5*o)/6-e)/r,((E+5*l)/6-i)/s,((5*o+h)/6-e)/r,((5*l+c)/6-i)/s,((o+h)/2-e)/r,((l+c)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const n=a($r,this),t=a(sr,this);if(isNaN(a(Tt,this)[6])&&!this.isEmpty())return v(hi,this,$I).call(this);const e=[];e.push(`M${n[4]} ${n[5]}`);for(let i=6;i<n.length;i+=6)isNaN(n[i])?e.push(`L${n[i+4]} ${n[i+5]}`):e.push(`C${n[i]} ${n[i+1]} ${n[i+2]} ${n[i+3]} ${n[i+4]} ${n[i+5]}`);v(hi,this,VI).call(this,e);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?e.push(`L${t[i+4]} ${t[i+5]}`):e.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return v(hi,this,HI).call(this,e),e.join(" ")}newFreeDrawOutline(n,t,e,i,r,s){return new lw(n,t,e,i,r,s)}getOutlines(){const n=a($r,this),t=a(sr,this),e=a(Tt,this),[i,r,s,o]=a(li,this),l=new Float32Array((a(To,this)?.length??0)+2);for(let d=0,u=l.length-2;d<u;d+=2)l[d]=(a(To,this)[d]-i)/s,l[d+1]=(a(To,this)[d+1]-r)/o;if(l[l.length-2]=(a(Mh,this)-i)/s,l[l.length-1]=(a(Ih,this)-r)/o,isNaN(e[6])&&!this.isEmpty())return v(hi,this,zI).call(this,l);const h=new Float32Array(a($r,this).length+24+a(sr,this).length);let c=n.length;for(let d=0;d<c;d+=2){if(isNaN(n[d])){h[d]=h[d+1]=NaN;continue}h[d]=n[d],h[d+1]=n[d+1]}c=v(hi,this,XI).call(this,h,c);for(let d=t.length-6;d>=6;d-=6)for(let u=0;u<6;u+=2){if(isNaN(t[d+u])){h[c]=h[c+1]=NaN,c+=2;continue}h[c]=t[d+u],h[c+1]=t[d+u+1],c+=2}return v(hi,this,GI).call(this,h,c),this.newFreeDrawOutline(h,l,a(li,this),a(Jd,this),a(Kd,this),a(Zd,this))}},aw={_:8},u1={_:aw._+2},qd=new WeakMap,kh=new WeakMap,zs=new WeakMap,qg=new WeakMap,ci=new WeakMap,tm=new WeakMap,Ae=new WeakMap,ow=new WeakSet,lw=class extends nt{constructor(n,t,e,i,r,s){super(),ot(this,ow),w(this,qd,void 0),w(this,kh,new Float32Array(4)),w(this,zs,void 0),w(this,qg,void 0),w(this,ci,void 0),w(this,tm,void 0),w(this,Ae,void 0),p(Ae,this,n),p(ci,this,t),p(qd,this,e),p(tm,this,i),p(zs,this,r),p(qg,this,s),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],v(ow,this,YI).call(this,s);const[o,l,h,c]=a(kh,this);for(let d=0,u=n.length;d<u;d+=2)n[d]=(n[d]-o)/h,n[d+1]=(n[d+1]-l)/c;for(let d=0,u=t.length;d<u;d+=2)t[d]=(t[d]-o)/h,t[d+1]=(t[d+1]-l)/c}toSVGPath(){const n=[`M${a(Ae,this)[4]} ${a(Ae,this)[5]}`];for(let t=6,e=a(Ae,this).length;t<e;t+=6){if(isNaN(a(Ae,this)[t])){n.push(`L${a(Ae,this)[t+4]} ${a(Ae,this)[t+5]}`);continue}n.push(`C${a(Ae,this)[t]} ${a(Ae,this)[t+1]} ${a(Ae,this)[t+2]} ${a(Ae,this)[t+3]} ${a(Ae,this)[t+4]} ${a(Ae,this)[t+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,t,e,i],r){const s=e-n,o=i-t;let l,h;switch(r){case 0:l=nt._rescale(a(Ae,this),n,i,s,-o),h=nt._rescale(a(ci,this),n,i,s,-o);break;case 90:l=nt._rescaleAndSwap(a(Ae,this),n,t,s,o),h=nt._rescaleAndSwap(a(ci,this),n,t,s,o);break;case 180:l=nt._rescale(a(Ae,this),e,t,-s,o),h=nt._rescale(a(ci,this),e,t,-s,o);break;case 270:l=nt._rescaleAndSwap(a(Ae,this),e,i,-s,-o),h=nt._rescaleAndSwap(a(ci,this),e,i,-s,-o);break}return{outline:Array.from(l),points:[Array.from(h)]}}get box(){return a(kh,this)}newOutliner(n,t,e,i,r,s=0){return new sw(n,t,e,i,r,s)}getNewOutline(n,t){const[e,i,r,s]=a(kh,this),[o,l,h,c]=a(qd,this),d=r*h,u=s*c,f=e*h+o,g=i*c+l,m=this.newOutliner({x:a(ci,this)[0]*d+f,y:a(ci,this)[1]*u+g},a(qd,this),a(tm,this),n,a(qg,this),t??a(zs,this));for(let y=2;y<a(ci,this).length;y+=2)m.add({x:a(ci,this)[y]*d+f,y:a(ci,this)[y+1]*u+g});return m.getOutlines()}},em=new WeakMap,nm=new WeakMap,im=new WeakMap,Po=new WeakMap,ar=new WeakMap,or=new WeakSet,rm=class{constructor(n,t=0,e=0,i=!0){ot(this,or),w(this,em,void 0),w(this,nm,void 0),w(this,im,void 0),w(this,Po,[]),w(this,ar,[]);const r=Gi.slice(),s=10**-4;for(const{x:m,y,width:b,height:x}of n){const E=Math.floor((m-t)/s)*s,S=Math.ceil((m+b+t)/s)*s,T=Math.floor((y-t)/s)*s,A=Math.ceil((y+x+t)/s)*s,P=[E,T,A,!0],C=[S,T,A,!1];a(Po,this).push(P,C),Z.rectBoundingBox(E,T,S,A,r)}const o=r[2]-r[0]+2*e,l=r[3]-r[1]+2*e,h=r[0]-e,c=r[1]-e;let d=i?-1/0:1/0,u=1/0;const f=a(Po,this).at(i?-1:-2),g=[f[0],f[2]];for(const m of a(Po,this)){const[y,b,x,E]=m;!E&&i?b<u?(u=b,d=y):b===u&&(d=Math.max(d,y)):E&&!i&&(b<u?(u=b,d=y):b===u&&(d=Math.min(d,y))),m[0]=(y-h)/o,m[1]=(b-c)/l,m[2]=(x-c)/l}p(em,this,new Float32Array([h,c,o,l])),p(nm,this,[d,u]),p(im,this,g)}getOutlines(){a(Po,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const n=[];for(const t of a(Po,this))t[3]?(n.push(...v(or,this,sA).call(this,t)),v(or,this,ZI).call(this,t)):(v(or,this,JI).call(this,t),n.push(...v(or,this,sA).call(this,t)));return v(or,this,KI).call(this,n)}},sm=new WeakMap,tu=new WeakMap,f1=class extends nt{constructor(n,t,e,i){super(),w(this,sm,void 0),w(this,tu,void 0),p(tu,this,n),p(sm,this,t),this.firstPoint=e,this.lastPoint=i}toSVGPath(){const n=[];for(const t of a(tu,this)){let[e,i]=t;n.push(`M${e} ${i}`);for(let r=2;r<t.length;r+=2){const s=t[r],o=t[r+1];s===e?(n.push(`V${o}`),i=o):o===i&&(n.push(`H${s}`),e=s)}n.push("Z")}return n.join(" ")}serialize([n,t,e,i],r){const s=[],o=e-n,l=i-t;for(const h of a(tu,this)){const c=new Array(h.length);for(let d=0;d<h.length;d+=2)c[d]=n+h[d]*o,c[d+1]=i-h[d+1]*l;s.push(c)}return s}get box(){return a(sm,this)}get classNamesForOutlining(){return["highlightOutline"]}},am=class extends sw{newFreeDrawOutline(n,t,e,i,r,s){return new p1(n,t,e,i,r,s)}},p1=class extends lw{newOutliner(n,t,e,i,r,s=0){return new am(n,t,e,i,r,s)}},eu=new WeakMap,om=new WeakMap,Gs=new WeakMap,Rh=new WeakMap,lm=new WeakMap,$n=new WeakMap,hm=new WeakMap,cm=new WeakMap,Oh=new WeakMap,di=new WeakMap,ui=new WeakMap,nn=new WeakMap,nu=new WeakMap,iu=new WeakMap,fn=new WeakMap,ru=new WeakMap,Ri=new WeakMap,dm=new WeakMap,jt=new WeakSet,fi=class De extends St{static get _keyboardManager(){const t=De.prototype;return mt(this,"_keyboardManager",new Sl([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),ot(this,jt),w(this,eu,null),w(this,om,0),w(this,Gs,void 0),w(this,Rh,null),w(this,lm,null),w(this,$n,null),w(this,hm,null),w(this,cm,0),w(this,Oh,null),w(this,di,null),w(this,ui,null),w(this,nn,!1),w(this,nu,null),w(this,iu,null),w(this,fn,null),w(this,ru,""),w(this,Ri,void 0),w(this,dm,""),this.color=t.color||De._defaultColor,p(Ri,this,t.thickness||De._defaultThickness),this.opacity=t.opacity||De._defaultOpacity,p(Gs,this,t.boxes||null),p(dm,this,t.methodOfCreation||""),p(ru,this,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(p(nn,this,!0),v(jt,this,zy).call(this,t),v(jt,this,ml).call(this)):a(Gs,this)&&(p(eu,this,t.anchorNode),p(om,this,t.anchorOffset),p(hm,this,t.focusNode),p(cm,this,t.focusOffset),v(jt,this,aA).call(this),v(jt,this,ml).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(St._l10nAlert.highlight)}get telemetryInitialData(){return{action:"added",type:a(nn,this)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:a(Ri,this),methodOfCreation:a(dm,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){St.initialize(t,e),De._defaultColor||(De._defaultColor=e.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(t,e){switch(t){case wt.HIGHLIGHT_COLOR:De._defaultColor=e;break;case wt.HIGHLIGHT_THICKNESS:De._defaultThickness=e;break}}translateInPage(t,e){}get toolbarPosition(){return a(iu,this)}get commentButtonPosition(){return a(nu,this)}updateParams(t,e){switch(t){case wt.HIGHLIGHT_COLOR:v(jt,this,QI).call(this,e);break;case wt.HIGHLIGHT_THICKNESS:v(jt,this,qI).call(this,e);break}}static get defaultPropertiesToUpdate(){return[[wt.HIGHLIGHT_COLOR,De._defaultColor],[wt.HIGHLIGHT_THICKNESS,De._defaultThickness]]}get propertiesToUpdate(){return[[wt.HIGHLIGHT_COLOR,this.color||De._defaultColor],[wt.HIGHLIGHT_THICKNESS,a(Ri,this)||De._defaultThickness],[wt.HIGHLIGHT_FREE,a(nn,this)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(a(ui,this),{root:{fill:this.color,"fill-opacity":this.opacity}}),a(lm,this)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",p(lm,this,new kg({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(v(jt,this,Xy).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,v(jt,this,Xy).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){v(jt,this,oA).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(v(jt,this,ml).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?v(jt,this,oA).call(this):t&&(v(jt,this,ml).call(this,t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;a(nn,this)?(t=(t-this.rotation+360)%360,i=Oc.call(De,a(di,this).box,t)):i=Oc.call(De,[this.x,this.y,this.width,this.height],t),e.updateProperties(a(ui,this),{bbox:i,root:{"data-main-rotation":t}}),e.updateProperties(a(fn,this),{bbox:Oc.call(De,a($n,this).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();a(ru,this)&&(t.setAttribute("aria-label",a(ru,this)),t.setAttribute("role","mark")),a(nn,this)?t.classList.add("free"):this.div.addEventListener("keydown",v(jt,this,ek).bind(this),{signal:this._uiManager._signal});const e=p(Oh,this,document.createElement("div"));return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=a(Rh,this),this.setDims(),nE(this,a(Oh,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(a(fn,this),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(a(fn,this),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:v(jt,this,Gy).call(this,!0);break;case 1:case 3:v(jt,this,Gy).call(this,!1);break}}select(){super.select(),a(fn,this)&&this.parent?.drawLayer.updateProperties(a(fn,this),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),a(fn,this)&&(this.parent?.drawLayer.updateProperties(a(fn,this),{rootClass:{selected:!1}}),a(nn,this)||v(jt,this,Gy).call(this,!1))}get _mustFixPosition(){return!a(nn,this)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(a(ui,this),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(a(fn,this),{rootClass:{hidden:!t}}))}static startHighlighting(t,e,{target:i,x:r,y:s}){const{x:o,y:l,width:h,height:c}=i.getBoundingClientRect(),d=new AbortController,u=t.combinedSignal(d),f=g=>{d.abort(),v(De,this,sk).call(this,t,g)};window.addEventListener("blur",f,{signal:u}),window.addEventListener("pointerup",f,{signal:u}),window.addEventListener("pointerdown",ee,{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",Jn,{signal:u}),i.addEventListener("pointermove",v(De,this,rk).bind(this,t),{signal:u}),this._freeHighlight=new am({x:r,y:s},[o,l,h,c],t.scale,this._defaultThickness/2,e,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(t,e,i){let r=null;if(t instanceof iw){const{data:{quadPoints:y,rect:b,rotation:x,id:E,color:S,opacity:T,popupRef:A,richText:P,contentsObj:C,creationDate:M,modificationDate:I},parent:{page:{pageNumber:k}}}=t;r=t={annotationType:pt.HIGHLIGHT,color:Array.from(S),opacity:T,quadPoints:y,boxes:null,pageIndex:k-1,rect:b.slice(0),rotation:x,annotationElementId:E,id:E,deleted:!1,popupRef:A,richText:P,comment:C?.str||null,creationDate:M,modificationDate:I}}else if(t instanceof zg){const{data:{inkLists:y,rect:b,rotation:x,id:E,color:S,borderStyle:{rawWidth:T},popupRef:A,richText:P,contentsObj:C,creationDate:M,modificationDate:I},parent:{page:{pageNumber:k}}}=t;r=t={annotationType:pt.HIGHLIGHT,color:Array.from(S),thickness:T,inkLists:y,boxes:null,pageIndex:k-1,rect:b.slice(0),rotation:x,annotationElementId:E,id:E,deleted:!1,popupRef:A,richText:P,comment:C?.str||null,creationDate:M,modificationDate:I}}const{color:s,quadPoints:o,inkLists:l,outlines:h,opacity:c}=t,d=await super.deserialize(t,e,i);d.color=Z.makeHexColor(...s),d.opacity=c||1,l&&p(Ri,d,t.thickness),d._initialData=r,t.comment&&d.setCommentData(t);const[u,f]=d.pageDimensions,[g,m]=d.pageTranslation;if(o){const y=p(Gs,d,[]);for(let b=0;b<o.length;b+=8)y.push({x:(o[b]-g)/u,y:1-(o[b+1]-m)/f,width:(o[b+2]-o[b])/u,height:(o[b+1]-o[b+5])/f});v(jt,d,aA).call(d),v(jt,d,ml).call(d),d.rotate(d.rotation)}else if(l||h){p(nn,d,!0);const y=(l||h.points)[0],b={x:y[0]-g,y:f-(y[1]-m)},x=new am(b,[0,0,u,f],1,a(Ri,d)/2,!0,.001);for(let T=0,A=y.length;T<A;T+=2)b.x=y[T]-g,b.y=f-(y[T+1]-m),x.add(b);const{id:E,clipPathId:S}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:x.toSVGPath()}},!0,!0);v(jt,d,zy).call(d,{highlightOutlines:x.getOutlines(),highlightId:E,clipPathId:S}),v(jt,d,ml).call(d),d.rotate(d.parentRotation)}return d}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=St._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:e,opacity:this.opacity,thickness:a(Ri,this),quadPoints:v(jt,this,nk).call(this),outlines:v(jt,this,ik).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!v(jt,this,ak).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}},Dc=fi,D(fi,"_defaultColor",null),D(fi,"_defaultOpacity",1),D(fi,"_defaultThickness",12),D(fi,"_type","highlight"),D(fi,"_editorType",pt.HIGHLIGHT),D(fi,"_freeHighlightId",-1),D(fi,"_freeHighlight",null),D(fi,"_freeHighlightClipId",""),Lh=new WeakMap,hw=class{constructor(){w(this,Lh,Object.create(null))}updateProperty(n,t){this[n]=t,this.updateSVGProperty(n,t)}updateProperties(n){if(n)for(const[t,e]of Object.entries(n))t.startsWith("_")||this.updateProperty(t,e)}updateSVGProperty(n,t){a(Lh,this)[n]=t}toSVGProperties(){const n=a(Lh,this);return p(Lh,this,Object.create(null)),{root:n}}reset(){p(Lh,this,Object.create(null))}updateAll(n=this){this.updateProperties(n)}clone(){Dt("Not implemented")}},Tn=new WeakMap,su=new WeakMap,Yt=new WeakSet,Co=class ff extends St{constructor(t){super(t),ot(this,Yt),w(this,Tn,null),w(this,su,void 0),D(this,"_colorPicker",null),D(this,"_drawId",null),p(su,this,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(t){t.drawOutlines&&(v(Yt,this,lA).call(this,t),v(Yt,this,Qf).call(this))}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[r,s]of Object.entries(e))i.has(r)?Object.assign(t[r],s):t[r]=s;return t}static getDefaultDrawingOptions(t){Dt("Not implemented")}static get typesMap(){Dt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e),this._currentParent&&(rn._.updateProperty(i,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,r]of this.typesMap)t.push([i,e[r]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,r]of this.constructor.typesMap)t.push([i,e[r]]);return t}_updateProperty(t,e,i){const r=this._drawingOptions,s=r[e],o=l=>{r.updateProperty(e,l);const h=a(Tn,this).updateProperty(e,l);h&&v(Yt,this,qf).call(this,h),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:o.bind(this,i),undo:o.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,e){const i=this.constructor.typesMap.get(this.colorType),r=this.constructor.typesMap.get(this.opacityType),s=this._drawingOptions,o=s[i],l=s[r],h=(c,d)=>{s.updateProperty(i,c),s.updateProperty(r,d),a(Tn,this).updateProperty(i,c),a(Tn,this).updateProperty(r,d),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:h.bind(this,t,e),undo:h.bind(this,o,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:wt.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,ff._mergeSVGProperties(a(Tn,this).getPathResizingSVGProperties(v(Yt,this,Yy).call(this)),{bbox:v(Yt,this,Lc).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,ff._mergeSVGProperties(a(Tn,this).getPathResizedSVGProperties(v(Yt,this,Yy).call(this)),{bbox:v(Yt,this,Lc).call(this)}))}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:v(Yt,this,Lc).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,ff._mergeSVGProperties(a(Tn,this).getPathTranslatedSVGProperties(v(Yt,this,Yy).call(this),this.parentDimensions),{bbox:v(Yt,this,Lc).call(this)}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,a(su,this)&&(p(su,this,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){v(Yt,this,cA).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(v(Yt,this,Qf).call(this),v(Yt,this,qf).call(this,a(Tn,this).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),v(Yt,this,cA).call(this)):t&&(this._uiManager.addShouldRescale(this),v(Yt,this,Qf).call(this,t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),e&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,ff._mergeSVGProperties({bbox:v(Yt,this,Lc).call(this)},a(Tn,this).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&v(Yt,this,qf).call(this,a(Tn,this).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const i=super.render();i.classList.add("draw");const r=document.createElement("div");return i.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),i}static createDrawerInstance(t,e,i,r,s){Dt("Not implemented")}static startDrawing(t,e,i,r){const{target:s,offsetX:o,offsetY:l,pointerId:h,pointerType:c}=r;if(cn.isInitializedAndDifferentPointerType(c))return;const{viewport:{rotation:d}}=t,{width:u,height:f}=s.getBoundingClientRect(),g=au._=new AbortController,m=t.combinedSignal(g);if(cn.setPointer(c,h),window.addEventListener("pointerup",y=>{cn.isSamePointerIdOrRemove(y.pointerId)&&this._endDraw(y)},{signal:m}),window.addEventListener("pointercancel",y=>{cn.isSamePointerIdOrRemove(y.pointerId)&&this._currentParent.endDrawingSession()},{signal:m}),window.addEventListener("pointerdown",y=>{cn.isSamePointerType(y.pointerType)&&(cn.initializeAndAddPointerId(y.pointerId),rn._.isCancellable()&&(rn._.removeLastElement(),rn._.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener("contextmenu",Jn,{signal:m}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:m}),s.addEventListener("touchmove",y=>{cn.isSameTimeStamp(y.timeStamp)&&ee(y)},{signal:m}),t.toggleDrawing(),e._editorUndoBar?.hide(),rn._){t.drawLayer.updateProperties(this._currentDrawId,rn._.startNew(o,l,u,f,d));return}e.updateUIForDefaultProperties(this),rn._=this.createDrawerInstance(o,l,u,f,d),ou._=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(ou._.toSVGProperties(),rn._.defaultSVGProperties),!0,!1)}static _drawMove(t){if(cn.isSameTimeStamp(t.timeStamp),!rn._)return;const{offsetX:e,offsetY:i,pointerId:r}=t;if(cn.isSamePointerId(r)){if(cn.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,rn._.add(e,i)),cn.setTimeStamp(t.timeStamp),ee(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,rn._=null,ou._=null,cn.clearTimeStamp()),au._&&(au._.abort(),au._=null,cn.clearPointerIds())}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),t?.target===e.div&&e.drawLayer.updateProperties(this._currentDrawId,rn._.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const i=rn._,r=this._currentDrawId,s=i.getLastElement();e.addCommands({cmd:()=>{e.drawLayer.updateProperties(r,i.setLastElement(s))},undo:()=>{e.drawLayer.updateProperties(r,i.removeLastElement())},mustExec:!1,type:wt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(wt.DRAW_STEP),!rn._.isEmpty()){const{pageDimensions:[i,r],scale:s}=e,o=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:rn._.getOutlines(i*s,r*s,s,this._INNER_MARGIN),drawingOptions:ou._,mustBeCommitted:!t});return this._cleanup(!0),o}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,i,r,s,o){Dt("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:r,pageHeight:s,pageX:o,pageY:l}}=e.viewport,h=this.deserializeDraw(o,l,r,s,this._INNER_MARGIN,t),c=await super.deserialize(t,e,i);return c.createDrawingOptions(t),v(Yt,c,lA).call(c,{drawOutlines:h}),v(Yt,c,Qf).call(c),c.onScaleChanging(),c.rotate(),c}serializeDraw(t){const[e,i]=this.pageTranslation,[r,s]=this.pageDimensions;return a(Tn,this).serialize([e,i,r,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},MA=Co,D(Co,"_currentDrawId",-1),D(Co,"_currentParent",null),rn={_:null},au={_:null},ou={_:null},D(Co,"_INNER_MARGIN",3),Hr=new WeakMap,$e=new WeakMap,He=new WeakMap,Dh=new WeakMap,lu=new WeakMap,Pn=new WeakMap,Ve=new WeakMap,Oi=new WeakMap,Fh=new WeakMap,Nh=new WeakMap,_h=new WeakMap,hu=new WeakSet,g1=class{constructor(n,t,e,i,r,s){ot(this,hu),w(this,Hr,new Float64Array(6)),w(this,$e,void 0),w(this,He,void 0),w(this,Dh,void 0),w(this,lu,void 0),w(this,Pn,void 0),w(this,Ve,""),w(this,Oi,0),w(this,Fh,new Wh),w(this,Nh,void 0),w(this,_h,void 0),p(Nh,this,e),p(_h,this,i),p(Dh,this,r),p(lu,this,s),[n,t]=v(hu,this,Ky).call(this,n,t);const o=p($e,this,[NaN,NaN,NaN,NaN,n,t]);p(Pn,this,[n,t]),p(He,this,[{line:o,points:a(Pn,this)}]),a(Hr,this).set(o,0)}updateProperty(n,t){n==="stroke-width"&&p(lu,this,t)}isEmpty(){return!a(He,this)||a(He,this).length===0}isCancellable(){return a(Pn,this).length<=10}add(n,t){[n,t]=v(hu,this,Ky).call(this,n,t);const[e,i,r,s]=a(Hr,this).subarray(2,6),o=n-r,l=t-s;return Math.hypot(a(Nh,this)*o,a(_h,this)*l)<=2?null:(a(Pn,this).push(n,t),isNaN(e)?(a(Hr,this).set([r,s,n,t],2),a($e,this).push(NaN,NaN,NaN,NaN,n,t),{path:{d:this.toSVGPath()}}):(isNaN(a(Hr,this)[0])&&a($e,this).splice(6,6),a(Hr,this).set([e,i,r,s,n,t],0),a($e,this).push(...nt.createBezierPoints(e,i,r,s,n,t)),{path:{d:this.toSVGPath()}}))}end(n,t){const e=this.add(n,t);return e||(a(Pn,this).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(n,t,e,i,r){p(Nh,this,e),p(_h,this,i),p(Dh,this,r),[n,t]=v(hu,this,Ky).call(this,n,t);const s=p($e,this,[NaN,NaN,NaN,NaN,n,t]);p(Pn,this,[n,t]);const o=a(He,this).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),a(He,this).push({line:s,points:a(Pn,this)}),a(Hr,this).set(s,0),p(Oi,this,0),this.toSVGPath(),null}getLastElement(){return a(He,this).at(-1)}setLastElement(n){return a(He,this)?(a(He,this).push(n),p($e,this,n.line),p(Pn,this,n.points),p(Oi,this,0),{path:{d:this.toSVGPath()}}):a(Fh,this).setLastElement(n)}removeLastElement(){if(!a(He,this))return a(Fh,this).removeLastElement();a(He,this).pop(),p(Ve,this,"");for(let n=0,t=a(He,this).length;n<t;n++){const{line:e,points:i}=a(He,this)[n];p($e,this,e),p(Pn,this,i),p(Oi,this,0),this.toSVGPath()}return{path:{d:a(Ve,this)}}}toSVGPath(){const n=nt.svgRound(a($e,this)[4]),t=nt.svgRound(a($e,this)[5]);if(a(Pn,this).length===2)return p(Ve,this,`${a(Ve,this)} M ${n} ${t} Z`),a(Ve,this);if(a(Pn,this).length<=6){const i=a(Ve,this).lastIndexOf("M");p(Ve,this,`${a(Ve,this).slice(0,i)} M ${n} ${t}`),p(Oi,this,6)}if(a(Pn,this).length===4){const i=nt.svgRound(a($e,this)[10]),r=nt.svgRound(a($e,this)[11]);return p(Ve,this,`${a(Ve,this)} L ${i} ${r}`),p(Oi,this,12),a(Ve,this)}const e=[];a(Oi,this)===0&&(e.push(`M ${n} ${t}`),p(Oi,this,6));for(let i=a(Oi,this),r=a($e,this).length;i<r;i+=6){const[s,o,l,h,c,d]=a($e,this).slice(i,i+6).map(nt.svgRound);e.push(`C${s} ${o} ${l} ${h} ${c} ${d}`)}return p(Ve,this,a(Ve,this)+e.join(" ")),p(Oi,this,a($e,this).length),a(Ve,this)}getOutlines(n,t,e,i){const r=a(He,this).at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),a(Fh,this).build(a(He,this),n,t,e,a(Dh,this),a(lu,this),i),p(Hr,this,null),p($e,this,null),p(He,this,null),p(Ve,this,null),a(Fh,this)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}},Cn=new WeakMap,um=new WeakMap,fm=new WeakMap,pi=new WeakMap,Vr=new WeakMap,zr=new WeakMap,cu=new WeakMap,du=new WeakMap,Bh=new WeakMap,Hn=new WeakSet,Wh=class extends nt{constructor(...n){super(...n),ot(this,Hn),w(this,Cn,void 0),w(this,um,0),w(this,fm,void 0),w(this,pi,void 0),w(this,Vr,void 0),w(this,zr,void 0),w(this,cu,void 0),w(this,du,void 0),w(this,Bh,void 0)}build(n,t,e,i,r,s,o){p(Vr,this,t),p(zr,this,e),p(cu,this,i),p(du,this,r),p(Bh,this,s),p(fm,this,o??0),p(pi,this,n),v(Hn,this,hk).call(this)}get thickness(){return a(Bh,this)}setLastElement(n){return a(pi,this).push(n),{path:{d:this.toSVGPath()}}}removeLastElement(){return a(pi,this).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const n=[];for(const{line:t}of a(pi,this)){if(n.push(`M${nt.svgRound(t[4])} ${nt.svgRound(t[5])}`),t.length===6){n.push("Z");continue}if(t.length===12&&isNaN(t[6])){n.push(`L${nt.svgRound(t[10])} ${nt.svgRound(t[11])}`);continue}for(let e=6,i=t.length;e<i;e+=6){const[r,s,o,l,h,c]=t.subarray(e,e+6).map(nt.svgRound);n.push(`C${r} ${s} ${o} ${l} ${h} ${c}`)}}return n.join("")}serialize([n,t,e,i],r){const s=[],o=[],[l,h,c,d]=v(Hn,this,lk).call(this);let u,f,g,m,y,b,x,E,S;switch(a(du,this)){case 0:S=nt._rescale,u=n,f=t+i,g=e,m=-i,y=n+l*e,b=t+(1-h-d)*i,x=n+(l+c)*e,E=t+(1-h)*i;break;case 90:S=nt._rescaleAndSwap,u=n,f=t,g=e,m=i,y=n+h*e,b=t+l*i,x=n+(h+d)*e,E=t+(l+c)*i;break;case 180:S=nt._rescale,u=n+e,f=t,g=-e,m=i,y=n+(1-l-c)*e,b=t+h*i,x=n+(1-l)*e,E=t+(h+d)*i;break;case 270:S=nt._rescaleAndSwap,u=n+e,f=t+i,g=-e,m=-i,y=n+(1-h-d)*e,b=t+(1-l-c)*i,x=n+(1-h)*e,E=t+(1-l)*i;break}for(const{line:T,points:A}of a(pi,this))s.push(S(T,u,f,g,m,r?new Array(T.length):null)),o.push(S(A,u,f,g,m,r?new Array(A.length):null));return{lines:s,points:o,rect:[y,b,x,E]}}static deserialize(n,t,e,i,r,{paths:{lines:s,points:o},rotation:l,thickness:h}){const c=[];let d,u,f,g,m;switch(l){case 0:m=nt._rescale,d=-n/e,u=t/i+1,f=1/e,g=-1/i;break;case 90:m=nt._rescaleAndSwap,d=-t/i,u=-n/e,f=1/i,g=1/e;break;case 180:m=nt._rescale,d=n/e+1,u=-t/i,f=-1/e,g=1/i;break;case 270:m=nt._rescaleAndSwap,d=t/i+1,u=n/e+1,f=-1/i,g=-1/e;break}if(!s){s=[];for(const b of o){const x=b.length;if(x===2){s.push(new Float32Array([NaN,NaN,NaN,NaN,b[0],b[1]]));continue}if(x===4){s.push(new Float32Array([NaN,NaN,NaN,NaN,b[0],b[1],NaN,NaN,NaN,NaN,b[2],b[3]]));continue}const E=new Float32Array(3*(x-2));s.push(E);let[S,T,A,P]=b.subarray(0,4);E.set([NaN,NaN,NaN,NaN,S,T],0);for(let C=4;C<x;C+=2){const M=b[C],I=b[C+1];E.set(nt.createBezierPoints(S,T,A,P,M,I),(C-2)*3),[S,T,A,P]=[A,P,M,I]}}}for(let b=0,x=s.length;b<x;b++)c.push({line:m(s[b].map(E=>E??NaN),d,u,f,g),points:m(o[b].map(E=>E??NaN),d,u,f,g)});const y=new this.prototype.constructor;return y.build(c,e,i,1,l,h,r),y}get box(){return a(Cn,this)}updateProperty(n,t){return n==="stroke-width"?v(Hn,this,ck).call(this,t):null}updateParentDimensions([n,t],e){const[i,r]=v(Hn,this,ls).call(this);p(Vr,this,n),p(zr,this,t),p(cu,this,e);const[s,o]=v(Hn,this,ls).call(this),l=s-i,h=o-r,c=a(Cn,this);return c[0]-=l,c[1]-=h,c[2]+=2*l,c[3]+=2*h,c}updateRotation(n){return p(um,this,n),{path:{transform:this.rotationTransform}}}get viewBox(){return a(Cn,this).map(nt.svgRound).join(" ")}get defaultProperties(){const[n,t]=a(Cn,this);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nt.svgRound(n)} ${nt.svgRound(t)}`}}}get rotationTransform(){const[,,n,t]=a(Cn,this);let e=0,i=0,r=0,s=0,o=0,l=0;switch(a(um,this)){case 90:i=t/n,r=-n/t,o=n;break;case 180:e=-1,s=-1,o=n,l=t;break;case 270:i=-t/n,r=n/t,l=t;break;default:return""}return`matrix(${e} ${i} ${r} ${s} ${nt.svgRound(o)} ${nt.svgRound(l)})`}getPathResizingSVGProperties([n,t,e,i]){const[r,s]=v(Hn,this,ls).call(this),[o,l,h,c]=a(Cn,this);if(Math.abs(h-r)<=nt.PRECISION||Math.abs(c-s)<=nt.PRECISION){const m=n+e/2-(o+h/2),y=t+i/2-(l+c/2);return{path:{"transform-origin":`${nt.svgRound(n)} ${nt.svgRound(t)}`,transform:`${this.rotationTransform} translate(${m} ${y})`}}}const d=(e-2*r)/(h-2*r),u=(i-2*s)/(c-2*s),f=h/e,g=c/i;return{path:{"transform-origin":`${nt.svgRound(o)} ${nt.svgRound(l)}`,transform:`${this.rotationTransform} scale(${f} ${g}) translate(${nt.svgRound(r)} ${nt.svgRound(s)}) scale(${d} ${u}) translate(${nt.svgRound(-r)} ${nt.svgRound(-s)})`}}}getPathResizedSVGProperties([n,t,e,i]){const[r,s]=v(Hn,this,ls).call(this),o=a(Cn,this),[l,h,c,d]=o;if(o[0]=n,o[1]=t,o[2]=e,o[3]=i,Math.abs(c-r)<=nt.PRECISION||Math.abs(d-s)<=nt.PRECISION){const y=n+e/2-(l+c/2),b=t+i/2-(h+d/2);for(const{line:x,points:E}of a(pi,this))nt._translate(x,y,b,x),nt._translate(E,y,b,E);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nt.svgRound(n)} ${nt.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(e-2*r)/(c-2*r),f=(i-2*s)/(d-2*s),g=-u*(l+r)+n+r,m=-f*(h+s)+t+s;if(u!==1||f!==1||g!==0||m!==0)for(const{line:y,points:b}of a(pi,this))nt._rescale(y,g,m,u,f,y),nt._rescale(b,g,m,u,f,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nt.svgRound(n)} ${nt.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([n,t],e){const[i,r]=e,s=a(Cn,this),o=n-s[0],l=t-s[1];if(a(Vr,this)===i&&a(zr,this)===r)for(const{line:h,points:c}of a(pi,this))nt._translate(h,o,l,h),nt._translate(c,o,l,c);else{const h=a(Vr,this)/i,c=a(zr,this)/r;p(Vr,this,i),p(zr,this,r);for(const{line:d,points:u}of a(pi,this))nt._rescale(d,o,l,h,c,d),nt._rescale(u,o,l,h,c,u);s[2]*=h,s[3]*=c}return s[0]=n,s[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${nt.svgRound(n)} ${nt.svgRound(t)}`}}}get defaultSVGProperties(){const n=a(Cn,this);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${nt.svgRound(n[0])} ${nt.svgRound(n[1])}`,transform:this.rotationTransform||null},bbox:n}}},cw=class AC extends hw{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:St._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new AC(this._viewParameters);return t.updateAll(this),t}},dw=new WeakSet,uu=class SC extends Co{constructor(t){super({...t,name:"inkEditor"}),ot(this,dw),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){St.initialize(t,e),this._defaultDrawingOptions=new cw(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return mt(this,"typesMap",new Map([[wt.INK_THICKNESS,"stroke-width"],[wt.INK_COLOR,"stroke"],[wt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,i,r,s){return new g1(t,e,i,r,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,i,r,s,o){return Wh.deserialize(t,e,i,r,s,o)}static async deserialize(t,e,i){let r=null;if(t instanceof zg){const{data:{inkLists:o,rect:l,rotation:h,id:c,color:d,opacity:u,borderStyle:{rawWidth:f},popupRef:g,richText:m,contentsObj:y,creationDate:b,modificationDate:x},parent:{page:{pageNumber:E}}}=t;r=t={annotationType:pt.INK,color:Array.from(d),thickness:f,opacity:u,paths:{points:o},boxes:null,pageIndex:E-1,rect:l.slice(0),rotation:h,annotationElementId:c,id:c,deleted:!1,popupRef:g,richText:m,comment:y?.str||null,creationDate:b,modificationDate:x}}const s=await super.deserialize(t,e,i);return s._initialData=r,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Zb(this)),[["colorPicker",this._colorPicker]]}get colorType(){return wt.INK_COLOR}get colorAndOpacityType(){return wt.INK_COLOR_AND_OPACITY}get opacityType(){return wt.INK_OPACITY}updateParams(t,e){if(t===wt.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(e.color,e.opacity);return}super.updateParams(t,e)}static updateDefaultParams(t,e){if(t===wt.INK_COLOR_AND_OPACITY){super.updateDefaultParams(wt.INK_COLOR,e.color),super.updateDefaultParams(wt.INK_OPACITY,e.opacity);return}super.updateDefaultParams(t,e)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:i}=this;e.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:e,opacity:i}){this._drawingOptions=SC.getDefaultDrawingOptions({stroke:Z.makeHexColor(...t),"stroke-width":e,"stroke-opacity":i})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:r,"stroke-opacity":s,"stroke-width":o}}=this,l=Object.assign(super.serialize(t),{color:St._colorManager.convert(r),opacity:s,thickness:o,paths:{lines:e,points:i}});return this.addComment(l),t?(l.isCopy=!0,l):this.annotationElementId&&!v(dw,this,dk).call(this,l)?null:(l.id=this.annotationElementId,l)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}},D(uu,"_type","ink"),D(uu,"_editorType",pt.INK),D(uu,"_defaultDrawingOptions",null),pm=class extends Wh{toSVGPath(){let n=super.toSVGPath();return n.endsWith("Z")||(n+="Z"),n}},ut(5213),fu=8,jh=3,Xs=class Kn{static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:r},s,o,l,h){let c=new OffscreenCanvas(1,1),d=c.getContext("2d",{alpha:!1});const u=200,f=d.font=`${i} ${r} ${u}px ${e}`,{actualBoundingBoxLeft:g,actualBoundingBoxRight:m,actualBoundingBoxAscent:y,actualBoundingBoxDescent:b,fontBoundingBoxAscent:x,fontBoundingBoxDescent:E,width:S}=d.measureText(t),T=1.5,A=Math.ceil(Math.max(Math.abs(g)+Math.abs(m)||0,S)*T),P=Math.ceil(Math.max(Math.abs(y)+Math.abs(b)||u,Math.abs(x)+Math.abs(E)||u)*T);c=new OffscreenCanvas(A,P),d=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=f,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,A,P),d.fillStyle="black",d.fillText(t,A*(T-1)/2,P*(3-T)/2);const C=v(Kn,this,fA).call(this,d.getImageData(0,0,A,P).data),M=v(Kn,this,mk).call(this,C),I=v(Kn,this,pA).call(this,M),k=v(Kn,this,uA).call(this,C,A,P,I);return this.processDrawnLines({lines:{curves:k,width:A,height:P},pageWidth:s,pageHeight:o,rotation:l,innerMargin:h,mustSmooth:!0,areContours:!0})}static process(t,e,i,r,s){const[o,l,h]=v(Kn,this,vk).call(this,t),[c,d]=v(Kn,this,gk).call(this,o,l,h,Math.hypot(l,h)*v(Kn,this,pu)._.sigmaSFactor,v(Kn,this,pu)._.sigmaR,v(Kn,this,pu)._.kernelSize),u=v(Kn,this,pA).call(this,d),f=v(Kn,this,uA).call(this,c,l,h,u);return this.processDrawnLines({lines:{curves:f,width:l,height:h},pageWidth:e,pageHeight:i,rotation:r,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:r,innerMargin:s,mustSmooth:o,areContours:l}){r%180!==0&&([e,i]=[i,e]);const{curves:h,width:c,height:d}=t,u=t.thickness??0,f=[],g=Math.min(e/c,i/d),m=g/e,y=g/i,b=[];for(const{points:E}of h){const S=o?v(Kn,this,pk).call(this,E):E;if(!S)continue;b.push(S);const T=S.length,A=new Float32Array(T),P=new Float32Array(3*(T===2?2:T-2));if(f.push({line:P,points:A}),T===2){A[0]=S[0]*m,A[1]=S[1]*y,P.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[C,M,I,k]=S;C*=m,M*=y,I*=m,k*=y,A.set([C,M,I,k],0),P.set([NaN,NaN,NaN,NaN,C,M],0);for(let O=4;O<T;O+=2){const B=A[O]=S[O]*m,L=A[O+1]=S[O+1]*y;P.set(nt.createBezierPoints(C,M,I,k,B,L),(O-2)*3),[C,M,I,k]=[I,k,B,L]}}if(f.length===0)return null;const x=l?new pm:new Wh;return x.build(f,e,i,1,r,l?0:u,s),{outline:x,newCurves:b,areContours:l,thickness:u,width:c,height:d}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:r,height:s}){let o=1/0,l=-1/0,h=0;for(const x of t){h+=x.length;for(let E=2,S=x.length;E<S;E++){const T=x[E]-x[E-2];o=Math.min(o,T),l=Math.max(l,T)}}let c;o>=-128&&l<=127?c=Int8Array:o>=-32768&&l<=32767?c=Int16Array:c=Int32Array;const d=t.length,u=fu+jh*d,f=new Uint32Array(u);let g=0;f[g++]=u*Uint32Array.BYTES_PER_ELEMENT+(h-2*d)*c.BYTES_PER_ELEMENT,f[g++]=0,f[g++]=r,f[g++]=s,f[g++]=e?0:1,f[g++]=Math.max(0,Math.floor(i??0)),f[g++]=d,f[g++]=c.BYTES_PER_ELEMENT;for(const x of t)f[g++]=x.length-2,f[g++]=x[0],f[g++]=x[1];const m=new CompressionStream("deflate-raw"),y=m.writable.getWriter();await y.ready,y.write(f);const b=c.prototype.constructor;for(const x of t){const E=new b(x.length-2);for(let S=2,T=x.length;S<T;S++)E[S-2]=x[S]-x[S-2];y.write(E)}return y.close(),(await new Response(m.readable).bytes()).toBase64()}static async decompressSignature(t){try{const e=Uint8Array.fromBase64(t),{readable:i,writable:r}=new DecompressionStream("deflate-raw"),s=r.getWriter();await s.ready,s.write(e).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let o=null,l=0;for await(const S of i)o||(o=new Uint8Array(new Uint32Array(S.buffer,0,4)[0])),o.set(S,l),l+=S.length;const h=new Uint32Array(o.buffer,0,o.length>>2),c=h[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const d=h[2],u=h[3],f=h[4]===0,g=h[5],m=h[6],y=h[7],b=[],x=(fu+jh*m)*Uint32Array.BYTES_PER_ELEMENT;let E;switch(y){case Int8Array.BYTES_PER_ELEMENT:E=new Int8Array(o.buffer,x);break;case Int16Array.BYTES_PER_ELEMENT:E=new Int16Array(o.buffer,x);break;case Int32Array.BYTES_PER_ELEMENT:E=new Int32Array(o.buffer,x);break}l=0;for(let S=0;S<m;S++){const T=h[jh*S+fu],A=new Float32Array(T+2);b.push(A);for(let P=0;P<jh-1;P++)A[P]=h[jh*S+fu+P+1];for(let P=0;P<T;P++)A[P+2]=A[P]+E[l++]}return{areContours:f,thickness:g,outlines:b,width:d,height:u}}catch(e){return ft(`decompressSignature: ${e}`),null}}},Me=Xs,pu={_:{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}},Gr={_:new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])},m1=class TC extends hw{constructor(){super(),super.updateProperties({fill:St._defaultLineColor,"stroke-width":0})}clone(){const t=new TC;return t.updateAll(this),t}},v1=class PC extends cw{constructor(t){super(t),super.updateProperties({stroke:St._defaultLineColor,"stroke-width":1})}clone(){const t=new PC(this._viewParameters);return t.updateAll(this),t}},Mo=new WeakMap,Xr=new WeakMap,Io=new WeakMap,Uh=new WeakMap,gu=class rs extends Co{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),w(this,Mo,!1),w(this,Xr,null),w(this,Io,null),w(this,Uh,null),this._willKeepAspectRatio=!0,p(Io,this,t.signatureData||null),p(Xr,this,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){St.initialize(t,e),this._defaultDrawingOptions=new m1,this._defaultDrawnSignatureOptions=new v1(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return mt(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!a(Xr,this)}}static computeTelemetryFinalData(t){const e=t.get("hasDescription");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),this._drawId===null)if(a(Io,this)){const{lines:r,mustSmooth:s,areContours:o,description:l,uuid:h,heightInPage:c}=a(Io,this),{rawDims:{pageWidth:d,pageHeight:u},rotation:f}=this.parent.viewport,g=Xs.processDrawnLines({lines:r,pageWidth:d,pageHeight:u,rotation:f,innerMargin:rs._INNER_MARGIN,mustSmooth:s,areContours:o});this.addSignature(g,c,l,h)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:a(Xr,this)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){p(Uh,this,t),this.addEditToolbar()}getUuid(){return a(Uh,this)}get description(){return a(Xr,this)}set description(t){p(Xr,this,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{e?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:r,height:s}=a(Io,this),o=Math.max(r,s);return{areContours:e,outline:Xs.processDrawnLines({lines:{curves:t.map(l=>({points:l})),thickness:i,width:r,height:s},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,r){const{x:s,y:o}=this,{outline:l}=p(Io,this,t);p(Mo,this,l instanceof pm),this.description=i;let h;a(Mo,this)?h=rs.getDefaultDrawingOptions():(h=rs._defaultDrawnSignatureOptions.clone(),h.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:h});const[,c]=this.pageDimensions;let d=e/c;d=d>=1?.5:d,this.width*=d/this.height,this.width>=1&&(d*=.9/this.width,this.width=.9),this.height=d,this.setDims(),this.x=s,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(r),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!r,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:r}=this.parent.viewport;return Xs.process(t,e,i,r,rs._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:r},rotation:s}=this.parent.viewport;return Xs.extractContoursFromText(t,e,i,r,s,rs._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:r}=this.parent.viewport;return Xs.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:r,innerMargin:rs._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){t?this._drawingOptions=rs.getDefaultDrawingOptions():(this._drawingOptions=rs._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":e}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":r}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:a(Mo,this),color:[0,0,0],thickness:a(Mo,this)?0:r});return this.addComment(s),t?(s.paths={lines:e,points:i},s.uuid=a(Uh,this),s.isCopy=!0):s.lines=e,a(Xr,this)&&(s.accessibilityData={type:"Figure",alt:a(Xr,this)}),s}static deserializeDraw(t,e,i,r,s,o){return o.areContours?pm.deserialize(t,e,i,r,s,o):Wh.deserialize(t,e,i,r,s,o)}static async deserialize(t,e,i){const r=await super.deserialize(t,e,i);return p(Mo,r,t.areContours),r.description=t.accessibilityData?.alt||"",p(Uh,r,t.uuid),r}},D(gu,"_type","signature"),D(gu,"_editorType",pt.SIGNATURE),D(gu,"_defaultDrawingOptions",null),ie=new WeakMap,ze=new WeakMap,ko=new WeakMap,Ys=new WeakMap,Ro=new WeakMap,mu=new WeakMap,Ks=new WeakMap,$h=new WeakMap,Yr=new WeakMap,gi=new WeakMap,vu=new WeakMap,Kt=new WeakSet,gm=class extends St{constructor(n){super({...n,name:"stampEditor"}),ot(this,Kt),w(this,ie,null),w(this,ze,null),w(this,ko,null),w(this,Ys,null),w(this,Ro,null),w(this,mu,""),w(this,Ks,null),w(this,$h,!1),w(this,Yr,null),w(this,gi,!1),w(this,vu,!1),p(Ys,this,n.bitmapUrl),p(Ro,this,n.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(n,t){St.initialize(n,t)}static isHandlingMimeForPasting(n){return yp.includes(n)}static paste(n,t){t.pasteEditor({mode:pt.STAMP},{bitmapFile:n.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(n){const t=n.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}async mlGuessAltText(n=null,t=!0){if(this.hasAltTextData())return null;const{mlManager:e}=this._uiManager;if(!e)throw new Error("No ML.");if(!await e.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:r,height:s}=n||this.copyCanvas(null,null,!0).imageData,o=await e.guess({name:"altText",request:{data:i,width:r,height:s,channels:i.length/(r*s)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const l=o.output;return await this.setGuessedAltText(l),t&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}remove(){a(ze,this)&&(p(ie,this,null),this._uiManager.imageManager.deleteId(a(ze,this)),a(Ks,this)?.remove(),p(Ks,this,null),a(Yr,this)&&(clearTimeout(a(Yr,this)),p(Yr,this,null))),super.remove()}rebuild(){if(!this.parent){a(ze,this)&&v(Kt,this,Jy).call(this);return}super.rebuild(),this.div!==null&&(a(ze,this)&&a(Ks,this)===null&&v(Kt,this,Jy).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(n){this._isDraggable=!0,n&&this.div.focus()}isEmpty(){return!(a(ko,this)||a(ie,this)||a(Ys,this)||a(Ro,this)||a(ze,this)||a($h,this))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let n,t;return this._isCopy&&(n=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),a($h,this)||(a(ie,this)?v(Kt,this,Qy).call(this):v(Kt,this,Jy).call(this)),this._isCopy&&this._moveAfterPaste(n,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(n,t){const{id:e,bitmap:i}=this._uiManager.imageManager.getFromCanvas(n,t);t.remove(),e&&this._uiManager.imageManager.isValidId(e)&&(p(ze,this,e),i&&p(ie,this,i),p($h,this,!1),v(Kt,this,Qy).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(a(Yr,this)!==null&&clearTimeout(a(Yr,this)),p(Yr,this,setTimeout(()=>{p(Yr,this,null),v(Kt,this,gA).call(this)},200)))}copyCanvas(n,t,e=!1){n||(n=224);const{width:i,height:r}=a(ie,this),s=new ds;let o=a(ie,this),l=i,h=r,c=null;if(t){if(i>t||r>t){const A=Math.min(t/i,t/r);l=Math.floor(i*A),h=Math.floor(r*A)}c=document.createElement("canvas");const u=c.width=Math.ceil(l*s.sx),f=c.height=Math.ceil(h*s.sy);a(gi,this)||(o=v(Kt,this,qy).call(this,u,f));const g=c.getContext("2d");g.filter=this._uiManager.hcmFilter;let m="white",y="#cfcfd8";this._uiManager.hcmFilter!=="none"?y="black":_A.isDarkMode&&(m="#8f8f9d",y="#42414d");const b=15,x=b*s.sx,E=b*s.sy,S=new OffscreenCanvas(x*2,E*2),T=S.getContext("2d");T.fillStyle=m,T.fillRect(0,0,x*2,E*2),T.fillStyle=y,T.fillRect(0,0,x,E),T.fillRect(x,E,x,E),g.fillStyle=g.createPattern(S,"repeat"),g.fillRect(0,0,u,f),g.drawImage(o,0,0,o.width,o.height,0,0,u,f)}let d=null;if(e){let u,f;if(s.symmetric&&o.width<n&&o.height<n)u=o.width,f=o.height;else if(o=a(ie,this),i>n||r>n){const m=Math.min(n/i,n/r);u=Math.floor(i*m),f=Math.floor(r*m),a(gi,this)||(o=v(Kt,this,qy).call(this,u,f))}const g=new OffscreenCanvas(u,f).getContext("2d",{willReadFrequently:!0});g.drawImage(o,0,0,o.width,o.height,0,0,u,f),d={width:u,height:f,data:g.getImageData(0,0,u,f).data}}return{canvas:c,width:l,height:h,imageData:d}}static async deserialize(n,t,e){let i=null,r=!1;if(n instanceof rw){const{data:{rect:m,rotation:y,id:b,structParent:x,popupRef:E,richText:S,contentsObj:T,creationDate:A,modificationDate:P},container:C,parent:{page:{pageNumber:M}},canvas:I}=n;let k,O;I?(delete n.canvas,{id:k,bitmap:O}=e.imageManager.getFromCanvas(C.id,I),I.remove()):(r=!0,n._hasNoCanvas=!0);const B=(await t._structTree.getAriaAttributes(`${Pa}${b}`))?.get("aria-label")||"";i=n={annotationType:pt.STAMP,bitmapId:k,bitmap:O,pageIndex:M-1,rect:m.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,accessibilityData:{decorative:!1,altText:B},isSvg:!1,structParent:x,popupRef:E,richText:S,comment:T?.str||null,creationDate:A,modificationDate:P}}const s=await super.deserialize(n,t,e),{rect:o,bitmap:l,bitmapUrl:h,bitmapId:c,isSvg:d,accessibilityData:u}=n;r?(e.addMissingCanvas(n.id,s),p($h,s,!0)):c&&e.imageManager.isValidId(c)?(p(ze,s,c),l&&p(ie,s,l)):p(Ys,s,h),p(gi,s,d);const[f,g]=s.pageDimensions;return s.width=(o[2]-o[0])/f,s.height=(o[3]-o[1])/g,u&&(s.altTextData=u),s._initialData=i,n.comment&&s.setCommentData(n),p(vu,s,!!i),s}serialize(n=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Object.assign(super.serialize(n),{bitmapId:a(ze,this),isSvg:a(gi,this)});if(this.addComment(e),n)return e.bitmapUrl=v(Kt,this,tb).call(this,!0),e.accessibilityData=this.serializeAltText(!0),e.isCopy=!0,e;const{decorative:i,altText:r}=this.serializeAltText(!1);if(!i&&r&&(e.accessibilityData={type:"Figure",alt:r}),this.annotationElementId){const o=v(Kt,this,yk).call(this,e);return o.isSame?null:(o.isSameAltText?delete e.accessibilityData:e.accessibilityData.structParent=this._initialData.structParent??-1,e.id=this.annotationElementId,delete e.bitmapId,e)}if(t===null)return e;t.stamps||(t.stamps=new Map);const s=a(gi,this)?(e.rect[2]-e.rect[0])*(e.rect[3]-e.rect[1]):null;if(!t.stamps.has(a(ze,this)))t.stamps.set(a(ze,this),{area:s,serialized:e}),e.bitmap=v(Kt,this,tb).call(this,!1);else if(a(gi,this)){const o=t.stamps.get(a(ze,this));s>o.area&&(o.area=s,o.serialized.bitmap.close(),o.serialized.bitmap=v(Kt,this,tb).call(this,!1))}return e}renderAnnotationElement(n){return this.deleted?(n.hide(),null):(n.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},D(gm,"_type","stamp"),D(gm,"_editorType",pt.STAMP),Hh=new WeakMap,yu=new WeakMap,Oo=new WeakMap,Lo=new WeakMap,Zs=new WeakMap,Vn=new WeakMap,Do=new WeakMap,bu=new WeakMap,wu=new WeakMap,lr=new WeakMap,Js=new WeakMap,Ge=new WeakMap,Qs=new WeakMap,Fo=new WeakMap,xu=new WeakMap,st=new WeakMap,ve=new WeakSet,uw=class _x{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:r,accessibilityManager:s,annotationLayer:o,drawLayer:l,textLayer:h,viewport:c,l10n:d}){ot(this,ve),w(this,Hh,void 0),w(this,yu,!1),w(this,Oo,null),w(this,Lo,null),w(this,Zs,null),w(this,Vn,new Map),w(this,Do,!1),w(this,bu,!1),w(this,wu,!1),w(this,lr,null),w(this,Js,null),w(this,Ge,null),w(this,Qs,null),w(this,Fo,null),w(this,xu,-1),w(this,st,void 0);const u=[...Vh._.values()];if(!_x._initialized){_x._initialized=!0;for(const f of u)f.initialize(d,t)}t.registerEditorTypes(u),p(st,this,t),this.pageIndex=e,this.div=i,p(Hh,this,s),p(Oo,this,o),this.viewport=c,p(Ge,this,h),this.drawLayer=l,this._structTree=r,a(st,this).addLayer(this)}get isEmpty(){return a(Vn,this).size===0}get isInvisible(){return this.isEmpty&&a(st,this).getMode()===pt.NONE}updateToolbar(t){a(st,this).updateToolbar(t)}updateMode(t=a(st,this).getMode()){switch(v(ve,this,eb).call(this),t){case pt.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case pt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case pt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===pt.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of Vh._.values())e.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===a(Ge,this)?.div}setEditingState(t){a(st,this).setEditingState(t)}addCommands(t){a(st,this).addCommands(t)}cleanUndoStack(t){a(st,this).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){a(Oo,this)?.togglePointerEvents(t)}async enable(){p(wu,this,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),a(Fo,this)?.abort(),p(Fo,this,null);const t=new Set;for(const i of mA.call(v(ve,this)))i.enableEditing(),i.show(!0),i.annotationElementId&&(a(st,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));const e=a(Oo,this);if(e)for(const i of e.getEditableAnnotations()){if(i.hide(),a(st,this).isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const r=await this.deserialize(i);r&&(this.addOrRebuild(r),r.enableEditing())}p(wu,this,!1),a(st,this)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(p(bu,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),a(Ge,this)&&!a(Fo,this)){p(Fo,this,new AbortController);const r=a(st,this).combinedSignal(a(Fo,this));a(Ge,this).div.addEventListener("pointerdown",s=>{const{clientX:l,clientY:h,timeStamp:c}=s;if(c-a(xu,this)>500){p(xu,this,c);return}p(xu,this,-1);const{classList:d}=this.div;d.toggle("getElements",!0);const u=document.elementsFromPoint(l,h);if(d.toggle("getElements",!1),!this.div.contains(u[0]))return;let f;const g=new RegExp(`^${vl}[0-9]+$`);for(const y of u)if(g.test(y.id)){f=y.id;break}if(!f)return;const m=a(Vn,this).get(f);m?.annotationElementId===null&&(ee(s),m.dblclick(s))},{signal:r,capture:!0})}const t=a(Oo,this),e=[];if(t){const r=new Map,s=new Map;for(const o of mA.call(v(ve,this))){if(o.disableEditing(),!o.annotationElementId){e.push(o);continue}if(o.serialize()!==null){r.set(o.annotationElementId,o);continue}else s.set(o.annotationElementId,o);this.getEditableAnnotation(o.annotationElementId)?.show(),o.remove()}for(const o of t.getEditableAnnotations()){const{id:l}=o.data;if(a(st,this).isDeletedAnnotationElement(l)){o.updateEdited({deleted:!0});continue}let h=s.get(l);if(h){h.resetAnnotationElement(o),h.show(!1),o.show();continue}h=r.get(l),h&&(a(st,this).addChangedExistingAnnotation(h),h.renderAnnotationElement(o)&&h.show(!1)),o.show()}}v(ve,this,eb).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const r of Vh._.values())i.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(e),p(bu,this,!1)}getEditableAnnotation(t){return a(Oo,this)?.getEditableAnnotation(t)||null}setActiveEditor(t){a(st,this).getActive()!==t&&a(st,this).setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,a(Ge,this)?.div&&!a(Qs,this)){p(Qs,this,new AbortController);const t=a(st,this).combinedSignal(a(Qs,this));a(Ge,this).div.addEventListener("pointerdown",v(ve,this,bk).bind(this),{signal:t}),a(Ge,this).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,a(Ge,this)?.div&&a(Qs,this)&&(a(Qs,this).abort(),p(Qs,this,null),a(Ge,this).div.classList.remove("highlighting"))}enableClick(){if(a(Lo,this))return;p(Lo,this,new AbortController);const t=a(st,this).combinedSignal(a(Lo,this));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){a(Lo,this)?.abort(),p(Lo,this,null)}attach(t){a(Vn,this).set(t.id,t);const{annotationElementId:e}=t;e&&a(st,this).isDeletedAnnotationElement(e)&&a(st,this).removeDeletedAnnotationElement(t)}detach(t){a(Vn,this).delete(t.id),a(Hh,this)?.removePointerInTextLayer(t.contentDiv),!a(bu,this)&&t.annotationElementId&&a(st,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),a(st,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(a(st,this).addDeletedAnnotationElement(t),St.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),a(st,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!a(wu,this)),a(st,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!a(Zs,this)&&(t._focusEventsAllowed=!1,p(Zs,this,setTimeout(()=>{p(Zs,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:a(st,this)._signal}),e.focus())},0))),t._structTreeParentId=a(Hh,this)?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getEditorByUID(t){for(const e of a(Vn,this).values())if(e.uid===t)return e;return null}combinedSignal(t){return a(st,this).combinedSignal(t)}canCreateNewEmptyEditor(){return yr.call(v(ve,this))?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await a(st,this).updateMode(t.mode);const{offsetX:i,offsetY:r}=v(ve,this,yA).call(this),s=a(st,this).getId(),o=v(ve,this,vA).call(this,{parent:this,id:s,x:i,y:r,uiManager:a(st,this),isCentered:!0,...e});o&&this.add(o)}async deserialize(t){return await Vh._.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,a(st,this))||null}createAndAddNewEditor(t,e,i={}){const r=a(st,this).getId(),s=v(ve,this,vA).call(this,{parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:a(st,this),isCentered:e,...i});return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(t={}){this.createAndAddNewEditor(v(ve,this,yA).call(this),!0,t)}setSelected(t){a(st,this).setSelected(t)}toggleSelected(t){a(st,this).toggleSelected(t)}unselect(t){a(st,this).unselect(t)}pointerup(t){const{isMac:e}=Ut.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!a(Do,this)||(p(Do,this,!1),yr.call(v(ve,this))?.isDrawer&&yr.call(v(ve,this)).supportMultipleDrawings))return;if(!a(yu,this)){p(yu,this,!0);return}const i=a(st,this).getMode();if(i===pt.STAMP||i===pt.POPUP||i===pt.SIGNATURE){a(st,this).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(a(st,this).getMode()===pt.HIGHLIGHT&&this.enableTextSelection(),a(Do,this)){p(Do,this,!1);return}const{isMac:e}=Ut.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(p(Do,this,!0),yr.call(v(ve,this))?.isDrawer){this.startDrawingSession(t);return}const i=a(st,this).getActive();p(yu,this,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),a(lr,this)){yr.call(v(ve,this)).startDrawing(this,a(st,this),!1,t);return}a(st,this).setCurrentDrawingSession(this),p(lr,this,new AbortController);const e=a(st,this).combinedSignal(a(lr,this));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(p(Js,this,null),this.commitOrRemove())},{signal:e}),yr.call(v(ve,this)).startDrawing(this,a(st,this),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&p(Js,this,e);return}a(Js,this)&&setTimeout(()=>{a(Js,this)?.focus(),p(Js,this,null)},0)}endDrawingSession(t=!1){return a(lr,this)?(a(st,this).setCurrentDrawingSession(null),a(lr,this).abort(),p(lr,this,null),p(Js,this,null),yr.call(v(ve,this)).endDrawing(t)):null}findNewParent(t,e,i){const r=a(st,this).findParent(e,i);return r===null||r===this?!1:(r.changeParent(t),!0)}commitOrRemove(){return a(lr,this)?(this.endDrawingSession(),!0):!1}onScaleChanging(){a(lr,this)&&yr.call(v(ve,this)).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),a(st,this).getActive()?.parent===this&&(a(st,this).commitOrRemove(),a(st,this).setActiveEditor(null)),a(Zs,this)&&(clearTimeout(a(Zs,this)),p(Zs,this,null));for(const t of a(Vn,this).values())a(Hh,this)?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,a(Vn,this).clear(),a(st,this).removeLayer(this)}async render({viewport:t}){this.viewport=t,xa(this.div,t);for(const e of a(st,this).getEditors(this.pageIndex))this.add(e),e.rebuild();await a(st,this).findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:t}){a(st,this).commitOrRemove(),v(ve,this,eb).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,xa(this.div,{rotation:i}),e!==i)for(const r of a(Vn,this).values())r.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return a(st,this).viewParameters.realScale}},D(uw,"_initialized",!1),Vh={_:new Map([Ur,uu,gm,fi,gu].map(n=>[n._editorType,n]))},zn=new WeakMap,Mn=new WeakMap,Li=new WeakMap,mm=new WeakMap,vm=new WeakMap,zh=new WeakMap,Gh=new WeakMap,No=new WeakSet,fw=class Ke{constructor({filterFactory:t=null,pageColors:e=null,pageIndex:i,textLayer:r=null}){if(ot(this,No),w(this,zn,null),w(this,Mn,new Map),w(this,Li,null),w(this,mm,null),w(this,vm,null),w(this,zh,null),w(this,Gh,new Map),this.pageIndex=i,p(mm,this,t),p(vm,this,e),r){const s=_o._.get(r);if(s?.selectionDiv&&(s.selectionDiv.remove(),Yh._.delete(s.selectionDiv)),_o._.set(r,{drawLayer:this}),Zh._.add(r),p(Li,this,r),p(zh,this,new MutationObserver(o=>{if(!(!a(zn,this)||!a(Li,this)?.isConnected||!xA.call(Ke))){for(const{addedNodes:l}of o)for(const h of l)if(h.nodeType===Node.ELEMENT_NODE&&h.classList.contains("endOfContent")){nb.call(Ke);return}}})),a(zh,this).observe(r,{childList:!0}),Xh._===null){Xh._=new AbortController;const{signal:o}=Xh._;document.addEventListener("selectionchange",nb.bind(Ke),{signal:o}),document.addEventListener("pointerdown",()=>{Kh._=!0},{signal:o}),document.addEventListener("pointerup",()=>{Kh._=!1},{signal:o}),window.addEventListener("blur",()=>{Kh._=!1},{signal:o})}}}setParent(t){if(!a(zn,this)){p(zn,this,t),a(Li,this)?.isConnected&&xA.call(Ke)&&nb.call(Ke);return}if(a(zn,this)!==t){if(a(Mn,this).size>0)for(const e of a(Mn,this).values())e.remove(),t.append(e);p(zn,this,t)}}static get _svgFactory(){return mt(this,"_svgFactory",new jd)}draw(t,e=!1,i=!1){var r,s;const o=(Eu._=(r=Eu._,s=r++,r),s),l=v(No,this,EA).call(this),h=Ke._svgFactory.createElement("defs");l.append(h);const c=Ke._svgFactory.createElement("path");h.append(c);const d=`path_${o}`;c.setAttribute("id",d),c.setAttribute("vector-effect","non-scaling-stroke"),e&&a(Gh,this).set(o,c);const u=i?v(No,this,Sk).call(this,h,d):null,f=Ke._svgFactory.createElement("use");return l.append(f),f.setAttribute("href",`#${d}`),this.updateProperties(l,t),a(Mn,this).set(o,l),{id:o,clipPathId:`url(#${u})`}}drawOutline(t,e){var i,r;const s=(Eu._=(i=Eu._,r=i++,i),r),o=v(No,this,EA).call(this),l=Ke._svgFactory.createElement("defs");o.append(l);const h=Ke._svgFactory.createElement("path");l.append(h);const c=`path_${s}`;h.setAttribute("id",c),h.setAttribute("vector-effect","non-scaling-stroke");let d;if(e){const g=Ke._svgFactory.createElement("mask");l.append(g),d=`mask_${s}`,g.setAttribute("id",d),g.setAttribute("maskUnits","objectBoundingBox");const m=Ke._svgFactory.createElement("rect");g.append(m),m.setAttribute("width","1"),m.setAttribute("height","1"),m.setAttribute("fill","white");const y=Ke._svgFactory.createElement("use");g.append(y),y.setAttribute("href",`#${c}`),y.setAttribute("stroke","none"),y.setAttribute("fill","black"),y.setAttribute("fill-rule","nonzero"),y.classList.add("mask")}const u=Ke._svgFactory.createElement("use");o.append(u),u.setAttribute("href",`#${c}`),d&&u.setAttribute("mask",`url(#${d})`);const f=u.cloneNode();return o.append(f),u.classList.add("mainOutline"),f.classList.add("secondaryOutline"),this.updateProperties(o,t),a(Mn,this).set(s,o),s}finalizeDraw(t,e){a(Gh,this).delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:r,rootClass:s,path:o}=e,l=typeof t=="number"?a(Mn,this).get(t):t;if(l){if(i&&v(No,this,AA).call(this,l,i),r&&Ak.call(Ke,l,r),s){const{classList:h}=l;for(const[c,d]of Object.entries(s))h.toggle(c,d)}if(o){const h=l.firstElementChild.firstElementChild;v(No,this,AA).call(this,h,o)}}}updateParent(t,e){if(e===this)return;const i=a(Mn,this).get(t);i&&(a(zn,e).append(i),a(Mn,this).delete(t),a(Mn,e).set(t,i))}remove(t){a(Gh,this).delete(t),a(zn,this)!==null&&(a(Mn,this).get(t).remove(),a(Mn,this).delete(t))}destroy(){p(zn,this,null);for(const t of a(Mn,this).values())t.remove();a(Mn,this).clear(),a(Gh,this).clear(),a(zh,this)?.disconnect(),p(zh,this,null),a(Li,this)&&(_o._.get(a(Li,this))?.drawLayer===this&&(wA.call(Ke,a(Li,this)),_o._.delete(a(Li,this)),Zh._.delete(a(Li,this)),Zh._.size===0&&(Xh._?.abort(),Xh._=null,Kh._=!1)),p(Li,this,null))}},Ne=fw,Eu={_:0},pw={_:0},Xh={_:null},Yh={_:new Set},Kh={_:!1},Zh={_:new Set},_o={_:new WeakMap},Au=new WeakMap,ym=new WeakMap,bm=new WeakMap,Su=new WeakMap,Kr=new WeakMap,Zr=new WeakMap,gw=new WeakSet,y1=class{constructor(n,t,e,i){ot(this,gw),w(this,Au,[]),w(this,ym,new Map),w(this,bm,null),w(this,Su,0),w(this,Kr,0),w(this,Zr,0),p(Su,this,n),p(Au,this,t),p(Kr,this,e.rawDims.pageWidth),p(Zr,this,e.rawDims.pageHeight),p(bm,this,i)}render(){const n=document.createElement("div");n.className="textLayerImages";for(let t=0;t<a(Au,this).length;t+=6){const e=v(gw,this,Tk).call(this,a(Au,this).subarray(t,t+6));e&&n.append(e)}return n.addEventListener("contextmenu",t=>{if(!(t.target instanceof HTMLCanvasElement))return;const e=t.target,i=a(ym,this).get(e);if(!i)return;const r=mw._?.deref();if(r===e)return;r&&(r.width=0,r.height=0),mw._=new WeakRef(e);const{inverseTransform:s,x1:o,y1:l,width:h,height:c}=i,d=a(bm,this).call(this),u=Math.ceil(o*d.width),f=Math.ceil(l*d.height),g=Math.floor((o+h/a(Kr,this))*d.width),m=Math.floor((l+c/a(Zr,this))*d.height);e.width=g-u,e.height=m-f;const y=e.getContext("2d");y.setTransform(...s),y.translate(-u,-f),y.drawImage(d,0,0)}),n}},mw={_:null},globalThis._pdfjsTestingUtils={HighlightOutliner:rm},globalThis.pdfjsLib={AbortException:wr,AnnotationEditorLayer:uw,AnnotationEditorParamsType:wt,AnnotationEditorType:pt,AnnotationEditorUIManager:vs,AnnotationLayer:d1,AnnotationMode:br,AnnotationType:ce,applyOpacity:pM,build:VS,ColorPicker:kg,createValidAbsoluteUrl:G0,CSSConstants:BA,DOMSVGFactory:jd,DrawLayer:fw,FeatureTest:Ut,fetchData:my,findContrastColor:gM,getDocument:HE,getFilenameFromUrl:dM,getPdfFilenameFromUrl:uM,getRGB:Ic,getRGBA:Mc,getUuid:K0,GlobalWorkerOptions:ks,ImageKind:Fc,InvalidPDFException:lp,isDataScheme:Pf,isPdfFile:vy,isValidExplicitDest:iS,makeArr:cp,makeMap:dp,makeObj:up,MathClamp:Zt,noContextMenu:Jn,normalizeUnicode:hM,OPS:Xi,OutputScale:ds,PasswordResponses:FA,PDFDataRangeTransport:Yb,PDFDateString:mp,PDFWorker:vh,PermissionFlag:DA,PixelsPerInch:_e,RenderingCancelledException:gp,renderRichText:q0,ResponseException:Bc,setLayerDimensions:xa,shadow:mt,SignatureExtractor:Xs,stopEvent:ee,SupportedImageMimeTypes:yp,TextLayer:kd,TextLayerImages:y1,TouchManager:Up,updateUrlHash:X0,Util:Z,VerbosityLevel:Nc,version:HS,XfaLayer:ob}}));function Mt(n){var t=Rw[n];if(t!==void 0)return t.exports;var e=Rw[n]={exports:{}};return hT[n].call(e.exports,e,e.exports,Mt),e.exports}function Ck(n){return n<11904}function Mk(n){return(n&65408)===0}function Ik(n){return n>=97&&n<=122||n>=65&&n<=90}function kk(n){return n>=48&&n<=57}function Rk(n){return n===32||n===9||n===13||n===10}function Ok(n){return n>=13312&&n<=40959||n>=63744&&n<=64255}function Lk(n){return n>=12448&&n<=12543}function Dk(n){return n>=12352&&n<=12447}function Fk(n){return n>=65376&&n<=65439}function Nk(n){return(n&65408)===3584}function wm(n){return Ck(n)?Mk(n)?Rk(n)?mi.SPACE:Ik(n)||kk(n)||n===95?mi.ALPHA_LETTER:mi.PUNCT:Nk(n)?mi.THAI_LETTER:n===160?mi.SPACE:mi.ALPHA_LETTER:Ok(n)?mi.HAN_LETTER:Lk(n)?mi.KATAKANA_LETTER:Dk(n)?mi.HIRAGANA_LETTER:Fk(n)?mi.HALFWIDTH_KATAKANA_LETTER:mi.ALPHA_LETTER}function _k(){if(!jo){const n=[],t=[],e=/^\p{M}$/u;for(let r=0;r<65536;r++){if(r>=55296&&r<=57343)continue;const s=String.fromCharCode(r);if(s.normalize("NFKC")!==s&&!e.test(s)){if(t.length!==2){t[0]=t[1]=r;continue}t[1]+1!==r?(t[0]===t[1]?n.push(String.fromCharCode(t[0])):n.push(`${String.fromCharCode(t[0])}-${String.fromCharCode(t[1])}`),t[0]=t[1]=r):t[1]=r}}const i=n.join("");if(!jo)jo=i;else if(i!==jo){for(let r=1;r<i.length;r++)if(i[r]!==jo[r]){console.log(`Difference at index ${r}: U+${i.charCodeAt(r).toString(16).toUpperCase().padStart(4,"0")}!== U+${jo.charCodeAt(r).toString(16).toUpperCase().padStart(4,"0")}`);break}throw new Error("getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.")}}return jo}function Bk(n,t){let e=n.offsetParent;if(!e){console.error("offsetParent is not set -- cannot scroll");return}let i=n.offsetTop+n.clientTop,r=n.offsetLeft+n.clientLeft;for(;e.clientHeight===e.scrollHeight&&e.clientWidth===e.scrollWidth;)if(i+=e.offsetTop,r+=e.offsetLeft,e=e.offsetParent,!e)return;t&&(t.top!==void 0&&(i+=t.top),t.left!==void 0&&(r+=t.left,e.scrollLeft=r)),e.scrollTop=i}function Wk(n,t,e=void 0){const i=function(o){s||(s=window.requestAnimationFrame(function(){s=null;const h=n.scrollLeft,c=r.lastX;h!==c&&(r.right=h>c),r.lastX=h;const d=n.scrollTop,u=r.lastY;d!==u&&(r.down=d>u),r.lastY=d,t(r)}))},r={right:!0,down:!0,lastX:n.scrollLeft,lastY:n.scrollTop,_eventHandler:i};let s=null;return n.addEventListener("scroll",i,{useCapture:!0,signal:e}),e?.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),r}function xm(n){const t=new Map;for(const[e,i]of new URLSearchParams(n))t.set(e.toLowerCase(),i);return t}function Tu(n,t=!1){return Hw.test(n)?t?n.replaceAll(Hw,e=>e==="\0"?"":" "):n.replaceAll("\0",""):n}function Pu(n,t,e=0){let i=e,r=n.length-1;if(r<0||!t(n[r]))return n.length;if(t(n[i]))return i;for(;i<r;){const s=i+r>>1,o=n[s];t(o)?r=s:i=s+1}return i}function b1(n){if(Math.floor(n)===n)return[n,1];const t=1/n,e=8;if(t>e)return[1,e];if(Math.floor(t)===t)return[1,t];const i=n>1?t:n;let r=0,s=1,o=1,l=1;for(;;){const h=r+o,c=s+l;if(c>e)break;i<=h/c?(o=h,l=c):(r=h,s=c)}return i-r/s<o/l-i?i===n?[r,s]:[s,r]:i===n?[o,l]:[l,o]}function Em(n,t){return n-n%t}function jk(n,t,e){if(n<2)return n;let i=t[n].div,r=i.offsetTop+i.clientTop;r>=e&&(i=t[n-1].div,r=i.offsetTop+i.clientTop);for(let s=n-2;s>=0&&(i=t[s].div,!(i.offsetTop+i.clientTop+i.clientHeight<=r));--s)n=s;return n}function Uk({scrollEl:n,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:r=!1}){const s=n.scrollTop,o=s+n.clientHeight,l=n.scrollLeft,h=l+n.clientWidth;function c(E){const S=E.div;return S.offsetTop+S.clientTop+S.clientHeight>s}function d(E){const S=E.div,T=S.offsetLeft+S.clientLeft,A=T+S.clientWidth;return r?T<h:A>l}const u=[],f=new Set,g=t.length;let m=Pu(t,i?d:c);m>0&&m<g&&!i&&(m=jk(m,t,s));let y=i?h:-1;for(let E=m;E<g;E++){const S=t[E],T=S.div,A=T.offsetLeft+T.clientLeft,P=T.offsetTop+T.clientTop,C=T.clientWidth,M=T.clientHeight,I=A+C,k=P+M;if(y===-1)k>=o&&(y=k);else if((i?A:P)>y)break;if(k<=s||P>=o||I<=l||A>=h)continue;const O=Math.max(0,s-P),B=Math.max(0,l-A),L=O+Math.max(0,k-o),$=B+Math.max(0,I-h),j=(M-L)/M,U=(C-$)/C,G=j*U*100|0;u.push({id:S.id,x:A,y:P,visibleArea:G===100?null:{minX:B,minY:O,maxX:Math.min(I,h)-A,maxY:Math.min(k,o)-P},view:S,percent:G,widthPercent:U*100|0}),f.add(S.id)}const b=u[0],x=u.at(-1);return e&&u.sort(function(E,S){const T=E.percent-S.percent;return Math.abs(T)>.001?-T:E.id-S.id}),{first:b,last:x,views:u,ids:f}}function w1(n){return Number.isInteger(n)&&n%90===0}function $k(n){return Number.isInteger(n)&&Object.values(Pt).includes(n)&&n!==Pt.UNKNOWN}function Hk(n){return Number.isInteger(n)&&Object.values(Xe).includes(n)&&n!==Xe.UNKNOWN}function x1(n){return n.width<=n.height}function Vk(n){let t=Pt.VERTICAL,e=Xe.NONE;switch(n){case"SinglePage":t=Pt.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=Pt.PAGE;case"TwoColumnLeft":e=Xe.ODD;break;case"TwoPageRight":t=Pt.PAGE;case"TwoColumnRight":e=Xe.EVEN;break}return{scrollMode:t,spreadMode:e}}function Am(n,t={}){const e=[];let i;for(;(i=FT.exec(n))!==null;){let{index:E}=i;for(const S of i[0]){let T=Yw.get(S);T||(T=S.normalize("NFD").length,Yw.set(S,T)),e.push([T,E++])}}const r=e.length>0,s=t.ignoreDashEOL??!1;let o;if(!r&&Dm)o=Dm;else if(r&&Fm)o=Fm;else{const E=Object.keys(zw).join(""),S=_k(),T=[`[${E}]`,`[${S}]`,"(?:゙|゚)\\n","\\p{M}+(?:-\\n)?","\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})","\\S-\\n","(?:\\p{Ideographic}|[぀-ヿ])\\n","\\n",r?NT:"\\u0000"];o=new RegExp(T.map(A=>`(${A})`).join("|"),"gmu"),r?Fm=o:Dm=o}const l=[];for(;(i=RT.exec(n))!==null;)l.push([i[0].length,i.index]);let h=n.normalize("NFD");const c=[0,0];let d=0,u=0,f=0,g=0,m=0,y=!1;h=h.replace(o,(E,S,T,A,P,C,M,I,k,O,B)=>{if(B-=g,S){const L=zw[S],$=L.length;for(let j=1;j<$;j++)c.push(B-f+j,f-j);return f-=$-1,L}if(T){let L=Kw.get(T);L||(L=T.normalize("NFKC"),Kw.set(T,L));const $=L.length;for(let j=1;j<$;j++)c.push(B-f+j,f-j);return f-=$-1,L}if(A)return y=!0,B+m===l[d]?.[1]?++d:(c.push(B-1-f+1,f-1),f-=1,g+=1),c.push(B-f+1,f),g+=1,m+=1,A.charAt(0);if(P){const L=P.endsWith(`
92
+ `),$=L?P.length-2:P.length;y=!0;let j=$;B+m===l[d]?.[1]&&(j-=l[d][0],++d);for(let U=1;U<=j;U++)c.push(B-1-f+U,f-U);return f-=j,g+=j,L?(B+=$-1,c.push(B-f+1,1+f),f+=1,g+=1,m+=1,P.slice(0,$)):P}if(C){if(s)return g+=1,m+=1,C.slice(0,-1);const L=C.length-2;return c.push(B-f+L,1+f),f+=1,g+=1,m+=1,C.slice(0,-2)}if(M)return g+=1,m+=1,M.slice(0,-1);if(I){const L=I.length-1;return c.push(B-f+L,f),g+=1,m+=1,I.slice(0,-1)}if(k)return c.push(B-f+1,f-1),f-=1,g+=1,m+=1," ";if(B+m===e[u]?.[1]){const L=e[u][0]-1;++u;for(let $=1;$<=L;$++)c.push(B-(f-$),f-$);f-=L,g+=L}return O}),c.push(h.length,f);const b=new Uint32Array(c.length>>1),x=new Int32Array(c.length>>1);for(let E=0,S=c.length;E<S;E+=2)b[E>>1]=c[E],x[E>>1]=c[E+1];return[h,[b,x],y]}function E1(n,t,e){if(!n)return[t,e];const[i,r]=n,s=t,o=t+e-1;let l=Pu(i,d=>d>=s);i[l]>s&&--l;let h=Pu(i,d=>d>=o,l);i[h]>o&&--h;const c=s+r[l];return[c,o+r[h]+1-c]}function zk(n){if(!n)return;const t=this._pdfDocument,{type:e}=n;(a(Pe,this)===null||v(yt,this,Gk).call(this,n))&&(this._dirtyMatch=!0),p(Pe,this,n),e!=="highlightallchange"&&v(yt,this,Tm).call(this,Qr.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;v(yt,this,Kk).call(this);const i=!this._highlightMatches,r=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),e?this._dirtyMatch?v(yt,this,Jh).call(this):e==="again"?(v(yt,this,Jh).call(this),i&&a(Pe,this).highlightAll&&v(yt,this,Sm).call(this)):e==="highlightallchange"?(r?v(yt,this,Jh).call(this):this._highlightMatches=!0,v(yt,this,Sm).call(this)):v(yt,this,Jh).call(this):this._findTimeout=setTimeout(()=>{v(yt,this,Jh).call(this),this._findTimeout=null},a(Nm,this))})}function A1(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],p(Vo,this,0),p(Pe,this,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,p(qr,this,null),this._firstPageCapability=Promise.withResolvers()}function S1(){const{query:n}=a(Pe,this);return typeof n=="string"?(n!==this._rawQuery&&(this._rawQuery=n,[this._normalizedQuery]=Am(n)),this._normalizedQuery):(n||[]).filter(t=>!!t).map(t=>Am(t)[0])}function Gk(n){const t=n.query,e=a(Pe,this).query,i=typeof t;if(i!==typeof e)return!0;if(i==="string"){if(t!==e)return!0}else if(JSON.stringify(t)!==JSON.stringify(e))return!0;switch(n.type){case"again":const r=this._selected.pageIdx+1,s=this._linkService;return r>=1&&r<=s.pagesCount&&r!==s.page&&!(this.onIsPageVisible?.(r)??!0);case"highlightallchange":return!1}return!0}function Xk(n,t,e){let i=n.slice(0,t).match(LT);if(i){const r=n.charCodeAt(t),s=i[1].charCodeAt(0);if(wm(r)===wm(s))return!1}if(i=n.slice(t+e).match(DT),i){const r=n.charCodeAt(t+e-1),s=i[1].charCodeAt(0);if(wm(r)===wm(s))return!1}return!0}function T1(n,t){const{matchDiacritics:e}=a(Pe,this);let i=!1;const r=(s,o)=>s===n?o:n.startsWith(s)?`${o}[ ]*`:n.endsWith(s)?`[ ]*${o}`:`[ ]*${o}[ ]*`;return n=n.replaceAll(OT,(s,o,l,h,c,d)=>o?r(o,RegExp.escape(o)):l?r(l,RegExp.escape(l)):h?"[ ]+":e?c||d:c?Gw.has(c.charCodeAt(0))?c:"":t?(i=!0,`${d}\\p{M}*`):d),n.endsWith("[ ]*")&&(n=n.slice(0,n.length-4)),e&&t&&(Xw||(Xw=String.fromCharCode(...Gw)),i=!0,n=`${n}(?=[${Xw}]|[^\\p{M}]|$)`),[i,n]}function Yk(n){var t;if(!a(Pe,this))return;const e=S1.call(v(yt,this));if(e.length===0)return;const i=this._pageContents[n],r=this.match(e,i,n),s=this._pageMatches[n]=[],o=this._pageMatchesLength[n]=[],l=this._pageDiffs[n];r?.forEach(({index:c,length:d})=>{const[u,f]=E1(l,c,d);f&&(s.push(u),o.push(f))}),a(Pe,this).highlightAll&&v(yt,this,vw).call(this,n),this._resumePageIdx===n&&(this._resumePageIdx=null,v(yt,this,P1).call(this));const h=s.length;this._matchesCountTotal+=h,a(Lu,this)?h>0&&v(yt,this,I1).call(this):p(Vo,this,(t=a(Vo,this),++t))===this._linkService.pagesCount&&v(yt,this,I1).call(this)}function Kk(){if(this._extractTextPromises.length>0)return;let n=Promise.resolve();const t={disableNormalization:!0},e=this._pdfDocument;for(let i=0,r=this._linkService.pagesCount;i<r;i++){const{promise:s,resolve:o}=Promise.withResolvers();this._extractTextPromises[i]=s,n=n.then(async()=>{if(e!==this._pdfDocument){o();return}try{const l=await(await e.getPage(i+1)).getTextContent(t);if(e!==this._pdfDocument){o();return}const h=[];for(const c of l.items)h.push(c.str),c.hasEOL&&h.push(`
93
+ `);[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=Am(h.join(""))}catch(l){if(e!==this._pdfDocument){o();return}console.error(`Unable to get text content for page ${i+1}`,l),[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=["",null,!1]}o()})}}function vw(n){this._scrollMatches&&this._selected.pageIdx===n&&(this._linkService.page=n+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:n})}function Sm(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}function Jh(){const n=a(Pe,this).findPrevious,t=this._linkService.page-1,e=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,p(Vo,this,0),this._matchesCountTotal=0,v(yt,this,Sm).call(this);for(let r=0;r<e;r++)this._pendingFindMatches.has(r)||(this._pendingFindMatches.add(r),this._extractTextPromises[r].then(()=>{this._pendingFindMatches.delete(r),v(yt,this,Yk).call(this,r)}))}if(S1.call(v(yt,this)).length===0){v(yt,this,Tm).call(this,Qr.FOUND);return}if(this._resumePageIdx)return;const i=this._offset;if(this._pagesToSearch=e,i.matchIdx!==null){const r=this._pageMatches[i.pageIdx].length;if(!n&&i.matchIdx+1<r||n&&i.matchIdx>0){i.matchIdx=n?i.matchIdx-1:i.matchIdx+1,v(yt,this,yw).call(this,!0);return}v(yt,this,C1).call(this,n)}v(yt,this,P1).call(this)}function Zk(n){const t=this._offset,e=n.length,i=a(Pe,this).findPrevious;return e?(t.matchIdx=i?e-1:0,v(yt,this,yw).call(this,!0),!0):(v(yt,this,C1).call(this,i),t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0)?(v(yt,this,yw).call(this,!1),!0):!1)}function P1(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let n=null;do{const t=this._offset.pageIdx;if(n=this._pageMatches[t],!n){this._resumePageIdx=t;break}}while(!v(yt,this,Zk).call(this,n))}function C1(n){const t=this._offset,e=this._linkService.pagesCount;t.pageIdx=n?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=e||t.pageIdx<0)&&(t.pageIdx=n?e-1:0,t.wrapped=!0)}function yw(n=!1){let t=Qr.NOT_FOUND;const e=this._offset.wrapped;if(this._offset.wrapped=!1,n){const i=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=e?Qr.WRAPPED:Qr.FOUND,i!==-1&&i!==this._selected.pageIdx&&v(yt,this,vw).call(this,i)}v(yt,this,Tm).call(this,t,a(Pe,this).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,v(yt,this,vw).call(this,this._selected.pageIdx))}function Jk({pagesMapper:n,type:t,pageNumbers:e}){if(this._extractTextPromises.length===0)return;if(t==="copy"){const u=new Map,f=new Map,g=new Map,m=new Map;for(const y of e)u.set(y,this._extractTextPromises[y-1]),f.set(y,this._pageContents[y-1]),g.set(y,this._pageDiffs[y-1]),m.set(y,this._hasDiacritics[y-1]);p(qr,this,{promises:u,contents:f,diffs:g,diacritics:m});return}if(t==="cancelCopy"){p(qr,this,null);return}if(t==="delete"&&p(ta,this,{promises:this._extractTextPromises,contents:this._pageContents,diffs:this._pageDiffs,diacritics:this._hasDiacritics}),t==="cancelDelete"){this._extractTextPromises=a(ta,this).promises,this._pageContents=a(ta,this).contents,this._pageDiffs=a(ta,this).diffs,this._hasDiacritics=a(ta,this).diacritics;return}if(t==="cleanSavedData"){p(ta,this,null);return}this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx=null,this._dirtyMatch=!0;const i=this._extractTextPromises,r=this._pageContents,s=this._pageDiffs,o=this._hasDiacritics,l=this._extractTextPromises=[],h=this._pageContents=[],c=this._pageDiffs=[],d=this._hasDiacritics=[];for(let u=1,f=n.pagesNumber;u<=f;u++){const g=n.getPrevPageNumber(u);if(g<0){const m=-g;l.push(a(qr,this)?.promises.get(m)||Promise.resolve()),h.push(a(qr,this)?.contents.get(m)??""),c.push(a(qr,this)?.diffs.get(m)??null),d.push(a(qr,this)?.diacritics.get(m)??!1);continue}l.push(i[g-1]||Promise.resolve()),h.push(r[g-1]??""),c.push(s[g-1]??null),d.push(o[g-1]??!1)}a(Pe,this)&&v(yt,this,Jh).call(this)}function Qk(n){const t=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),v(yt,this,Tm).call(this,Qr.FOUND),this._highlightMatches=!1,v(yt,this,Sm).call(this))})}function M1(){const{pageIdx:n,matchIdx:t}=this._selected;let e=0,i=this._matchesCountTotal;if(t!==-1){for(let r=0;r<n;r++)e+=this._pageMatches[r]?.length||0;e+=t+1}return(e<1||e>i)&&(e=i=0),{current:e,total:i}}function I1(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:v(yt,this,M1).call(this)})}function Tm(n,t=!1){!a(Lu,this)&&(a(Vo,this)!==this._linkService.pagesCount||n===Qr.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:n,previous:t,entireWord:a(Pe,this)?.entireWord??null,matchesCount:v(yt,this,M1).call(this),rawQuery:a(Pe,this)?.query??null})}function qk(n,t){this.annotationLayer=new fT({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,annotationStorage:this.annotationStorage,page:this.pdfPage,viewport:n.clone({dontFlip:!0}),structTreeLayer:t,commentManager:a(Wm,this),linkService:this.linkService})}function k1(n){if(!this.div)return;let t=!1;switch(n){case Uo.FULLSCREEN:t=!0;break;case Uo.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}function tR(n){function t(r){if(!r.quadPoints)return[r.rect];const s=[];for(let o=2,l=r.quadPoints.length;o<l;o+=8){const h=r.quadPoints[o],c=r.quadPoints[o+1],d=r.quadPoints[o+2],u=r.quadPoints[o+3];s.push([d,u,h,c])}return s}function e(r,s){const o=[],l=t(r),h=t(s);for(const c of l)for(const d of h){const u=Om.intersect(c,d);u&&o.push(u)}return o}function i(r){let s=0;for(const o of r)s+=Math.abs((o[2]-o[0])*(o[3]-o[1]));return s}return n.filter(r=>{let s;for(const o of a(zo,this)){if(o.annotationType!==Ow.LINK||!o.url)continue;const l=e(o,r);if(l.length!==0&&(s??(s=i(t(r))),i(l)/s>.5))return!1}return!0})}async function eR({target:n,name:t,delay:e=0}){if(typeof n!="object"||!(t&&typeof t=="string")||!(Number.isInteger(e)&&e>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:i,resolve:r}=Promise.withResolvers(),s=new AbortController;function o(d){s.abort(),clearTimeout(c),r(d)}const l=n instanceof Fu?"on":"addEventListener",h=n instanceof Fu?{signal:s.signal,...sn}:{signal:s.signal};n[l](t,o.bind(null,Qw.EVENT),h);const c=setTimeout(o.bind(null,Qw.TIMEOUT),e);return i}function nR(n,t,e){return e===t||e instanceof cr&&t instanceof cr&&e.value===t.value||t instanceof cr&&typeof e=="string"&&e===n.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value)}function R1(n,t,e){return t[e]?Qh(n,t[e].value):(n.reportError(new RangeError("No default")),new ye)}function bw(n,t){const e=[],i=Object.create(null);for(const r of t)r.type==="narg"?i[r.name]=Cu(n,r.value):e.push(Cu(n,r));return{positional:e,named:i}}function Cu(n,t){switch(t.type){case"str":return t.value;case"num":return new cr(t.value,{minimumFractionDigits:t.precision});case"var":return iR(n,t);case"mesg":return rR(n,t);case"term":return sR(n,t);case"func":return aR(n,t);case"select":return oR(n,t);default:return new ye}}function iR(n,{name:t}){let e;if(n.params)if(Object.prototype.hasOwnProperty.call(n.params,t))e=n.params[t];else return new ye(`$${t}`);else if(n.args&&Object.prototype.hasOwnProperty.call(n.args,t))e=n.args[t];else return n.reportError(new ReferenceError(`Unknown variable: $${t}`)),new ye(`$${t}`);if(e instanceof Xo)return e;switch(typeof e){case"string":return e;case"number":return new cr(e);case"object":if(ic.supportsValue(e))return new ic(e);default:return n.reportError(new TypeError(`Variable type not supported: $${t}, ${typeof e}`)),new ye(`$${t}`)}}function rR(n,{name:t,attr:e}){const i=n.bundle._messages.get(t);if(!i)return n.reportError(new ReferenceError(`Unknown message: ${t}`)),new ye(t);if(e){const r=i.attributes[e];return r?Qh(n,r):(n.reportError(new ReferenceError(`Unknown attribute: ${e}`)),new ye(`${t}.${e}`))}return i.value?Qh(n,i.value):(n.reportError(new ReferenceError(`No value: ${t}`)),new ye(t))}function sR(n,{name:t,attr:e,args:i}){const r=`-${t}`,s=n.bundle._terms.get(r);if(!s)return n.reportError(new ReferenceError(`Unknown term: ${r}`)),new ye(r);if(e){const l=s.attributes[e];if(l){n.params=bw(n,i).named;const h=Qh(n,l);return n.params=null,h}return n.reportError(new ReferenceError(`Unknown attribute: ${e}`)),new ye(`${r}.${e}`)}n.params=bw(n,i).named;const o=Qh(n,s.value);return n.params=null,o}function aR(n,{name:t,args:e}){let i=n.bundle._functions[t];if(!i)return n.reportError(new ReferenceError(`Unknown function: ${t}()`)),new ye(`${t}()`);if(typeof i!="function")return n.reportError(new TypeError(`Function ${t}() is not callable`)),new ye(`${t}()`);try{let r=bw(n,e);return i(r.positional,r.named)}catch(r){return n.reportError(r),new ye(`${t}()`)}}function oR(n,{selector:t,variants:e,star:i}){let r=Cu(n,t);if(r instanceof ye)return R1(n,e,i);for(const s of e)if(nR(n,r,Cu(n,s.key)))return Qh(n,s.value);return R1(n,e,i)}function O1(n,t){if(n.dirty.has(t))return n.reportError(new RangeError("Cyclic reference")),new ye;n.dirty.add(t);const e=[],i=n.bundle._useIsolating&&t.length>1;for(const r of t){if(typeof r=="string"){e.push(n.bundle._transform(r));continue}if(n.placeables++,n.placeables>qw)throw n.dirty.delete(t),new RangeError(`Too many placeables expanded: ${n.placeables}, max allowed is ${qw}`);i&&e.push(jT),e.push(Cu(n,r).toString(n)),i&&e.push(UT)}return n.dirty.delete(t),e.join("")}function Qh(n,t){return typeof t=="string"?n.bundle._transform(t):O1(n,t)}function ww(n,t){const e=Object.create(null);for(const[i,r]of Object.entries(n))t.includes(i)&&(e[i]=r.valueOf());return e}function lR(n,t){let e=n[0];if(e instanceof ye)return new ye(`NUMBER(${e.valueOf()})`);if(e instanceof cr)return new cr(e.valueOf(),{...e.opts,...ww(t,tx)});if(e instanceof ic)return new cr(e.toNumber(),{...ww(t,tx)});throw new TypeError("Invalid argument to NUMBER")}function hR(n,t){let e=n[0];if(e instanceof ye)return new ye(`DATETIME(${e.valueOf()})`);if(e instanceof ic||e instanceof cr)return new ic(e,ww(t,HT));throw new TypeError("Invalid argument to DATETIME")}function cR(n){const t=Array.isArray(n)?n.join(" "):n;let e=ex.get(t);return e===void 0&&(e=new Map,ex.set(t,e)),e}function dR(n,t){const{value:e}=t;if(typeof e=="string")if(n.localName==="title"&&n.namespaceURI==="http://www.w3.org/1999/xhtml")n.textContent=e;else if(!oP.test(e))n.textContent=e;else{const i=n.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=e,uR(i.content,n)}L1(t,n)}function uR(n,t){for(const e of n.childNodes)if(e.nodeType!==e.TEXT_NODE){if(e.hasAttribute("data-l10n-name")){const i=pR(t,e);n.replaceChild(i,e);continue}if(mR(e)){const i=gR(e);n.replaceChild(i,e);continue}console.warn(`An element of forbidden type "${e.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),n.replaceChild(xw(e),e)}t.textContent="",t.appendChild(n)}function fR(n,t){if(!n)return!1;for(let e of n)if(e.name===t)return!0;return!1}function L1(n,t){const e=t.hasAttribute("data-l10n-attrs")?t.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(const i of Array.from(t.attributes))D1(i.name,t,e)&&!fR(n.attributes,i.name)&&t.removeAttribute(i.name);if(n.attributes)for(const i of Array.from(n.attributes))D1(i.name,t,e)&&t.getAttribute(i.name)!==i.value&&t.setAttribute(i.name,i.value)}function pR(n,t){const e=t.getAttribute("data-l10n-name"),i=n.querySelector(`[data-l10n-name="${e}"]`);return i?i.localName!==t.localName?(console.warn(`An element named "${e}" was found in the translation but its type ${t.localName} didn't match the element found in the source (${i.localName}).`),xw(t)):(n.removeChild(i),F1(t,i.cloneNode(!1))):(console.warn(`An element named "${e}" wasn't found in the source.`),xw(t))}function gR(n){return F1(n,n.ownerDocument.createElement(n.localName))}function xw(n){return n.ownerDocument.createTextNode(n.textContent)}function mR(n){const t=lP[n.namespaceURI];return t&&t.includes(n.localName)}function D1(n,t,e=null){if(e&&e.includes(n))return!0;const i=hP[t.namespaceURI];if(!i)return!1;const r=n.toLowerCase(),s=t.localName;if(i.global.includes(r))return!0;if(!i[s])return!1;if(i[s].includes(r))return!0;if(t.namespaceURI==="http://www.w3.org/1999/xhtml"&&s==="input"&&r==="value"){const o=t.type.toLowerCase();if(o==="submit"||o==="button"||o==="reset")return!0}return!1}function F1(n,t){return t.textContent=n.textContent,L1(n,t),t}function vR(n,t,e,i){return e.value?n.formatPattern(e.value,i,t):null}function yR(n,t,e,i){const r={value:null,attributes:null};e.value&&(r.value=n.formatPattern(e.value,i,t));let s=Object.keys(e.attributes);if(s.length>0){r.attributes=new Array(s.length);for(let[o,l]of s.entries()){let h=n.formatPattern(e.attributes[l],i,t);r.attributes[o]={name:l,value:h}}}return r}function bR(n,t,e,i){const r=[],s=new Set;return e.forEach(({id:o,args:l},h)=>{if(i[h]!==void 0)return;let c=t.getMessage(o);if(c){if(r.length=0,i[h]=n(t,r,c,l),r.length>0&&typeof console<"u"){const d=t.locales[0],u=r.join(", ");console.warn(`[fluent][resolver] errors in ${d}/${o}: ${u}.`)}}else s.add(o)}),s}function wR(n){return n=n?.toLowerCase()||"en-us",{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"}[n]||n}function xR(n){const t=n.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(t)}function ER(){const{isAndroid:n,isLinux:t,isMac:e,isWindows:i}=Dw.platform;return t?"linux":i?"windows":e?"macos":n?"android":"other"}function N1(n,t){const e=new aP(t),i=new VT(n,{functions:{PLATFORM:ER}}),r=i.addResource(e);return r.length&&console.error("L10n errors",r),i}async function*AR(n,t){const{baseURL:e,paths:i}=await v(Iu,this,TR).call(this),r=[t];if(n!==t){const o=t.split("-",1)[0];o!==t&&r.push(o),r.push(n)}const s=r.map(o=>[o,v(Iu,this,SR).call(this,o,e,i)]);for(const[o,l]of s){const h=await l;h?yield h:o==="en-us"&&(yield v(Iu,this,_1).call(this,o))}}async function SR(n,t,e){const i=e[n];return i?N1(n,await Fw(new URL(i,t),"text")):null}async function TR(){try{const{href:n}=document.querySelector('link[type="application/l10n"]'),t=await Fw(n,"json");return{baseURL:n.substring(0,n.lastIndexOf("/")+1)||"./",paths:t}}catch{}return{baseURL:"./",paths:Object.create(null)}}async function*PR(n){yield v(Iu,this,_1).call(this,n)}async function _1(n){return N1(n,`pdfjs-previous-button =
94
+ .title = Previous Page
95
+ pdfjs-previous-button-label = Previous
96
+ pdfjs-next-button =
97
+ .title = Next Page
98
+ pdfjs-next-button-label = Next
99
+ pdfjs-page-input =
100
+ .title = Page
101
+ pdfjs-of-pages = of { $pagesCount }
102
+ pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })
103
+ pdfjs-zoom-out-button =
104
+ .title = Zoom Out
105
+ pdfjs-zoom-out-button-label = Zoom Out
106
+ pdfjs-zoom-in-button =
107
+ .title = Zoom In
108
+ pdfjs-zoom-in-button-label = Zoom In
109
+ pdfjs-zoom-select =
110
+ .title = Zoom
111
+ pdfjs-presentation-mode-button =
112
+ .title = Switch to Presentation Mode
113
+ pdfjs-presentation-mode-button-label = Presentation Mode
114
+ pdfjs-open-file-button =
115
+ .title = Open File
116
+ pdfjs-open-file-button-label = Open
117
+ pdfjs-print-button =
118
+ .title = Print
119
+ pdfjs-print-button-label = Print
120
+ pdfjs-save-button =
121
+ .title = Save
122
+ pdfjs-save-button-label = Save
123
+ pdfjs-download-button =
124
+ .title = Download
125
+ pdfjs-download-button-label = Download
126
+ pdfjs-bookmark-button =
127
+ .title = Current Page (View URL from Current Page)
128
+ pdfjs-bookmark-button-label = Current Page
129
+ pdfjs-tools-button =
130
+ .title = Tools
131
+ pdfjs-tools-button-label = Tools
132
+ pdfjs-first-page-button =
133
+ .title = Go to First Page
134
+ pdfjs-first-page-button-label = Go to First Page
135
+ pdfjs-last-page-button =
136
+ .title = Go to Last Page
137
+ pdfjs-last-page-button-label = Go to Last Page
138
+ pdfjs-page-rotate-cw-button =
139
+ .title = Rotate Clockwise
140
+ pdfjs-page-rotate-cw-button-label = Rotate Clockwise
141
+ pdfjs-page-rotate-ccw-button =
142
+ .title = Rotate Counterclockwise
143
+ pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise
144
+ pdfjs-cursor-text-select-tool-button =
145
+ .title = Enable Text Selection Tool
146
+ pdfjs-cursor-text-select-tool-button-label = Text Selection Tool
147
+ pdfjs-cursor-hand-tool-button =
148
+ .title = Enable Hand Tool
149
+ pdfjs-cursor-hand-tool-button-label = Hand Tool
150
+ pdfjs-scroll-page-button =
151
+ .title = Use Page Scrolling
152
+ pdfjs-scroll-page-button-label = Page Scrolling
153
+ pdfjs-scroll-vertical-button =
154
+ .title = Use Vertical Scrolling
155
+ pdfjs-scroll-vertical-button-label = Vertical Scrolling
156
+ pdfjs-scroll-horizontal-button =
157
+ .title = Use Horizontal Scrolling
158
+ pdfjs-scroll-horizontal-button-label = Horizontal Scrolling
159
+ pdfjs-scroll-wrapped-button =
160
+ .title = Use Wrapped Scrolling
161
+ pdfjs-scroll-wrapped-button-label = Wrapped Scrolling
162
+ pdfjs-spread-none-button =
163
+ .title = Do not join page spreads
164
+ pdfjs-spread-none-button-label = No Spreads
165
+ pdfjs-spread-odd-button =
166
+ .title = Join page spreads starting with odd-numbered pages
167
+ pdfjs-spread-odd-button-label = Odd Spreads
168
+ pdfjs-spread-even-button =
169
+ .title = Join page spreads starting with even-numbered pages
170
+ pdfjs-spread-even-button-label = Even Spreads
171
+ pdfjs-document-properties-button =
172
+ .title = Document Properties…
173
+ pdfjs-document-properties-button-label = Document Properties…
174
+ pdfjs-document-properties-file-name = File name:
175
+ pdfjs-document-properties-file-size = File size:
176
+ pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)
177
+ pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)
178
+ pdfjs-document-properties-title = Title:
179
+ pdfjs-document-properties-author = Author:
180
+ pdfjs-document-properties-subject = Subject:
181
+ pdfjs-document-properties-keywords = Keywords:
182
+ pdfjs-document-properties-creation-date = Creation Date:
183
+ pdfjs-document-properties-modification-date = Modification Date:
184
+ pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
185
+ pdfjs-document-properties-creator = Creator:
186
+ pdfjs-document-properties-producer = PDF Producer:
187
+ pdfjs-document-properties-version = PDF Version:
188
+ pdfjs-document-properties-page-count = Page Count:
189
+ pdfjs-document-properties-page-size = Page Size:
190
+ pdfjs-document-properties-page-size-unit-inches = in
191
+ pdfjs-document-properties-page-size-unit-millimeters = mm
192
+ pdfjs-document-properties-page-size-orientation-portrait = portrait
193
+ pdfjs-document-properties-page-size-orientation-landscape = landscape
194
+ pdfjs-document-properties-page-size-name-a-three = A3
195
+ pdfjs-document-properties-page-size-name-a-four = A4
196
+ pdfjs-document-properties-page-size-name-letter = Letter
197
+ pdfjs-document-properties-page-size-name-legal = Legal
198
+ pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })
199
+ pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })
200
+ pdfjs-document-properties-linearized = Fast Web View:
201
+ pdfjs-document-properties-linearized-yes = Yes
202
+ pdfjs-document-properties-linearized-no = No
203
+ pdfjs-document-properties-close-button = Close
204
+ pdfjs-print-progress-message = Preparing document for printing…
205
+ pdfjs-print-progress-percent = { $progress }%
206
+ pdfjs-print-progress-close-button = Cancel
207
+ pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.
208
+ pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.
209
+ pdfjs-current-outline-item-button =
210
+ .title = Find Current Outline Item
211
+ pdfjs-current-outline-item-button-label = Current Outline Item
212
+ pdfjs-findbar-button =
213
+ .title = Find in Document
214
+ pdfjs-findbar-button-label = Find
215
+ pdfjs-additional-layers = Additional Layers
216
+ pdfjs-thumb-page-title1 =
217
+ .title = Page { $page } of { $total }
218
+ pdfjs-thumb-page-canvas =
219
+ .aria-label = Thumbnail of Page { $page }
220
+ pdfjs-thumb-page-checkbox1 =
221
+ .title = Select page { $page }
222
+ pdfjs-find-input =
223
+ .title = Find
224
+ .placeholder = Find in document…
225
+ pdfjs-find-previous-button =
226
+ .title = Find the previous occurrence of the phrase
227
+ pdfjs-find-previous-button-label = Previous
228
+ pdfjs-find-next-button =
229
+ .title = Find the next occurrence of the phrase
230
+ pdfjs-find-next-button-label = Next
231
+ pdfjs-find-highlight-checkbox = Highlight All
232
+ pdfjs-find-match-case-checkbox-label = Match Case
233
+ pdfjs-find-match-diacritics-checkbox-label = Match Diacritics
234
+ pdfjs-find-entire-word-checkbox-label = Whole Words
235
+ pdfjs-find-reached-top = Reached top of document, continued from bottom
236
+ pdfjs-find-reached-bottom = Reached end of document, continued from top
237
+ pdfjs-find-match-count =
238
+ { $total ->
239
+ [one] { $current } of { $total } match
240
+ *[other] { $current } of { $total } matches
241
+ }
242
+ pdfjs-find-match-count-limit =
243
+ { $limit ->
244
+ [one] More than { $limit } match
245
+ *[other] More than { $limit } matches
246
+ }
247
+ pdfjs-find-not-found = Phrase not found
248
+ pdfjs-page-scale-width = Page Width
249
+ pdfjs-page-scale-fit = Page Fit
250
+ pdfjs-page-scale-auto = Automatic Zoom
251
+ pdfjs-page-scale-actual = Actual Size
252
+ pdfjs-page-scale-percent = { $scale }%
253
+ pdfjs-page-landmark =
254
+ .aria-label = Page { $page }
255
+ pdfjs-loading-error = An error occurred while loading the PDF.
256
+ pdfjs-invalid-file-error = Invalid or corrupted PDF file.
257
+ pdfjs-missing-file-error = Missing PDF file.
258
+ pdfjs-unexpected-response-error = Unexpected server response.
259
+ pdfjs-rendering-error = An error occurred while rendering the page.
260
+ pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
261
+ pdfjs-text-annotation-type =
262
+ .alt = [{ $type } Annotation]
263
+ pdfjs-password-label = Enter the password to open this PDF file.
264
+ pdfjs-password-invalid = Invalid password. Please try again.
265
+ pdfjs-password-ok-button = OK
266
+ pdfjs-password-cancel-button = Cancel
267
+ pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.
268
+ pdfjs-editor-free-text-button =
269
+ .title = Text
270
+ pdfjs-editor-color-picker-free-text-input =
271
+ .title = Change text color
272
+ pdfjs-editor-free-text-button-label = Text
273
+ pdfjs-editor-ink-button =
274
+ .title = Draw
275
+ pdfjs-editor-color-picker-ink-input =
276
+ .title = Change drawing color
277
+ pdfjs-editor-ink-button-label = Draw
278
+ pdfjs-editor-stamp-button =
279
+ .title = Add or edit images
280
+ pdfjs-editor-stamp-button-label = Add or edit images
281
+ pdfjs-editor-highlight-button =
282
+ .title = Highlight
283
+ pdfjs-editor-highlight-button-label = Highlight
284
+ pdfjs-highlight-floating-button1 =
285
+ .title = Highlight
286
+ .aria-label = Highlight
287
+ pdfjs-highlight-floating-button-label = Highlight
288
+ pdfjs-comment-floating-button =
289
+ .title = Comment
290
+ .aria-label = Comment
291
+ pdfjs-comment-floating-button-label = Comment
292
+ pdfjs-editor-comment-button =
293
+ .title = Comment
294
+ .aria-label = Comment
295
+ pdfjs-editor-comment-button-label = Comment
296
+ pdfjs-editor-signature-button =
297
+ .title = Add signature
298
+ pdfjs-editor-signature-button-label = Add signature
299
+ pdfjs-editor-highlight-editor =
300
+ .aria-label = Highlight editor
301
+ pdfjs-editor-ink-editor =
302
+ .aria-label = Drawing editor
303
+ pdfjs-editor-signature-editor1 =
304
+ .aria-description = Signature editor: { $description }
305
+ pdfjs-editor-stamp-editor =
306
+ .aria-label = Image editor
307
+ pdfjs-editor-remove-ink-button =
308
+ .title = Remove drawing
309
+ pdfjs-editor-remove-freetext-button =
310
+ .title = Remove text
311
+ pdfjs-editor-remove-stamp-button =
312
+ .title = Remove image
313
+ pdfjs-editor-remove-highlight-button =
314
+ .title = Remove highlight
315
+ pdfjs-editor-remove-signature-button =
316
+ .title = Remove signature
317
+ pdfjs-editor-free-text-color-input = Color
318
+ pdfjs-editor-free-text-size-input = Size
319
+ pdfjs-editor-ink-color-input = Color
320
+ pdfjs-editor-ink-thickness-input = Thickness
321
+ pdfjs-editor-ink-opacity-input = Opacity
322
+ pdfjs-editor-stamp-add-image-button =
323
+ .title = Add image
324
+ pdfjs-editor-stamp-add-image-button-label = Add image
325
+ pdfjs-editor-free-highlight-thickness-input = Thickness
326
+ pdfjs-editor-free-highlight-thickness-title =
327
+ .title = Change thickness when highlighting items other than text
328
+ pdfjs-editor-add-signature-container =
329
+ .aria-label = Signature controls and saved signatures
330
+ pdfjs-editor-signature-add-signature-button =
331
+ .title = Add new signature
332
+ pdfjs-editor-signature-add-signature-button-label = Add new signature
333
+ pdfjs-editor-add-saved-signature-button =
334
+ .title = Saved signature: { $description }
335
+ pdfjs-free-text2 =
336
+ .aria-label = Text Editor
337
+ .default-content = Start typing…
338
+ pdfjs-editor-comments-sidebar-title =
339
+ { $count ->
340
+ [one] Comment
341
+ *[other] Comments
342
+ }
343
+ pdfjs-editor-comments-sidebar-close-button =
344
+ .title = Close the sidebar
345
+ .aria-label = Close the sidebar
346
+ pdfjs-editor-comments-sidebar-close-button-label = Close the sidebar
347
+ pdfjs-editor-comments-sidebar-no-comments1 = See something noteworthy? Highlight it and leave a comment.
348
+ pdfjs-editor-comments-sidebar-no-comments-link = Learn more
349
+ pdfjs-editor-alt-text-button =
350
+ .aria-label = Alt text
351
+ pdfjs-editor-alt-text-button-label = Alt text
352
+ pdfjs-editor-alt-text-edit-button =
353
+ .aria-label = Edit alt text
354
+ pdfjs-editor-alt-text-dialog-label = Choose an option
355
+ pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load.
356
+ pdfjs-editor-alt-text-add-description-label = Add a description
357
+ pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.
358
+ pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative
359
+ pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.
360
+ pdfjs-editor-alt-text-cancel-button = Cancel
361
+ pdfjs-editor-alt-text-save-button = Save
362
+ pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative
363
+ pdfjs-editor-alt-text-textarea =
364
+ .placeholder = For example, “A young man sits down at a table to eat a meal”
365
+ pdfjs-editor-resizer-top-left =
366
+ .aria-label = Top left corner — resize
367
+ pdfjs-editor-resizer-top-middle =
368
+ .aria-label = Top middle — resize
369
+ pdfjs-editor-resizer-top-right =
370
+ .aria-label = Top right corner — resize
371
+ pdfjs-editor-resizer-middle-right =
372
+ .aria-label = Middle right — resize
373
+ pdfjs-editor-resizer-bottom-right =
374
+ .aria-label = Bottom right corner — resize
375
+ pdfjs-editor-resizer-bottom-middle =
376
+ .aria-label = Bottom middle — resize
377
+ pdfjs-editor-resizer-bottom-left =
378
+ .aria-label = Bottom left corner — resize
379
+ pdfjs-editor-resizer-middle-left =
380
+ .aria-label = Middle left — resize
381
+ pdfjs-editor-highlight-colorpicker-label = Highlight color
382
+ pdfjs-editor-colorpicker-button =
383
+ .title = Change color
384
+ pdfjs-editor-colorpicker-dropdown =
385
+ .aria-label = Color choices
386
+ pdfjs-editor-colorpicker-yellow =
387
+ .title = Yellow
388
+ pdfjs-editor-colorpicker-green =
389
+ .title = Green
390
+ pdfjs-editor-colorpicker-blue =
391
+ .title = Blue
392
+ pdfjs-editor-colorpicker-pink =
393
+ .title = Pink
394
+ pdfjs-editor-colorpicker-red =
395
+ .title = Red
396
+ pdfjs-editor-highlight-show-all-button-label = Show all
397
+ pdfjs-editor-highlight-show-all-button =
398
+ .title = Show all
399
+ pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)
400
+ pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)
401
+ pdfjs-editor-new-alt-text-textarea =
402
+ .placeholder = Write your description here…
403
+ pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load.
404
+ pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.
405
+ pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more
406
+ pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically
407
+ pdfjs-editor-new-alt-text-not-now-button = Not now
408
+ pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically
409
+ pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.
410
+ pdfjs-editor-new-alt-text-error-close-button = Close
411
+ pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
412
+ .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
413
+ pdfjs-editor-new-alt-text-added-button =
414
+ .aria-label = Alt text added
415
+ pdfjs-editor-new-alt-text-added-button-label = Alt text added
416
+ pdfjs-editor-new-alt-text-missing-button =
417
+ .aria-label = Missing alt text
418
+ pdfjs-editor-new-alt-text-missing-button-label = Missing alt text
419
+ pdfjs-editor-new-alt-text-to-review-button =
420
+ .aria-label = Review alt text
421
+ pdfjs-editor-new-alt-text-to-review-button-label = Review alt text
422
+ pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }
423
+ pdfjs-image-alt-text-settings-button =
424
+ .title = Image alt text settings
425
+ pdfjs-image-alt-text-settings-button-label = Image alt text settings
426
+ pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings
427
+ pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text
428
+ pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically
429
+ pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load.
430
+ pdfjs-editor-alt-text-settings-editor-title = Alt text editor
431
+ pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image
432
+ pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.
433
+ pdfjs-editor-alt-text-settings-close-button = Close
434
+ pdfjs-editor-highlight-added-alert = Highlight added
435
+ pdfjs-editor-freetext-added-alert = Text added
436
+ pdfjs-editor-ink-added-alert = Drawing added
437
+ pdfjs-editor-stamp-added-alert = Image added
438
+ pdfjs-editor-signature-added-alert = Signature added
439
+ pdfjs-editor-undo-bar-message-highlight = Highlight removed
440
+ pdfjs-editor-undo-bar-message-freetext = Text removed
441
+ pdfjs-editor-undo-bar-message-ink = Drawing removed
442
+ pdfjs-editor-undo-bar-message-stamp = Image removed
443
+ pdfjs-editor-undo-bar-message-signature = Signature removed
444
+ pdfjs-editor-undo-bar-message-comment = Comment removed
445
+ pdfjs-editor-undo-bar-message-multiple =
446
+ { $count ->
447
+ [one] { $count } annotation removed
448
+ *[other] { $count } annotations removed
449
+ }
450
+ pdfjs-editor-undo-bar-undo-button =
451
+ .title = Undo
452
+ pdfjs-editor-undo-bar-undo-button-label = Undo
453
+ pdfjs-editor-undo-bar-close-button =
454
+ .title = Close
455
+ pdfjs-editor-undo-bar-close-button-label = Close
456
+ pdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.
457
+ pdfjs-editor-add-signature-dialog-title = Add a signature
458
+ pdfjs-editor-add-signature-type-button = Type
459
+ .title = Type
460
+ pdfjs-editor-add-signature-draw-button = Draw
461
+ .title = Draw
462
+ pdfjs-editor-add-signature-image-button = Image
463
+ .title = Image
464
+ pdfjs-editor-add-signature-type-input =
465
+ .aria-label = Type your signature
466
+ .placeholder = Type your signature
467
+ pdfjs-editor-add-signature-draw-placeholder = Draw your signature
468
+ pdfjs-editor-add-signature-draw-thickness-range-label = Thickness
469
+ pdfjs-editor-add-signature-draw-thickness-range =
470
+ .title = Drawing thickness: { $thickness }
471
+ pdfjs-editor-add-signature-image-placeholder = Drag a file here to upload
472
+ pdfjs-editor-add-signature-image-browse-link =
473
+ { PLATFORM() ->
474
+ [macos] Or choose image files
475
+ *[other] Or browse image files
476
+ }
477
+ pdfjs-editor-add-signature-description-label = Description (alt text)
478
+ pdfjs-editor-add-signature-description-input =
479
+ .title = Description (alt text)
480
+ pdfjs-editor-add-signature-description-default-when-drawing = Signature
481
+ pdfjs-editor-add-signature-clear-button-label = Clear signature
482
+ pdfjs-editor-add-signature-clear-button =
483
+ .title = Clear signature
484
+ pdfjs-editor-add-signature-save-checkbox = Save signature
485
+ pdfjs-editor-add-signature-save-warning-message = You’ve reached the limit of 5 saved signatures. Remove one to save more.
486
+ pdfjs-editor-add-signature-image-upload-error-title = Couldn’t upload image
487
+ pdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.
488
+ pdfjs-editor-add-signature-image-no-data-error-title = Can’t convert this image into a signature
489
+ pdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.
490
+ pdfjs-editor-add-signature-error-close-button = Close
491
+ pdfjs-editor-add-signature-cancel-button = Cancel
492
+ pdfjs-editor-add-signature-add-button = Add
493
+ pdfjs-editor-delete-signature-button1 =
494
+ .title = Remove saved signature
495
+ pdfjs-editor-delete-signature-button-label1 = Remove saved signature
496
+ pdfjs-editor-add-signature-edit-button-label = Edit description
497
+ pdfjs-editor-edit-signature-dialog-title = Edit description
498
+ pdfjs-editor-edit-signature-update-button = Update
499
+ pdfjs-show-comment-button =
500
+ .title = Show comment
501
+ pdfjs-editor-edit-comment-popup-button-label = Edit comment
502
+ pdfjs-editor-edit-comment-popup-button =
503
+ .title = Edit comment
504
+ pdfjs-editor-delete-comment-popup-button-label = Remove comment
505
+ pdfjs-editor-delete-comment-popup-button =
506
+ .title = Remove comment
507
+ pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment
508
+ pdfjs-editor-edit-comment-dialog-save-button-when-editing = Update
509
+ pdfjs-editor-edit-comment-dialog-title-when-adding = Add comment
510
+ pdfjs-editor-edit-comment-dialog-save-button-when-adding = Add
511
+ pdfjs-editor-edit-comment-dialog-text-input =
512
+ .placeholder = Start typing…
513
+ pdfjs-editor-edit-comment-dialog-cancel-button = Cancel
514
+ pdfjs-editor-add-comment-button =
515
+ .title = Add comment
516
+ pdfjs-toggle-views-manager-button1 =
517
+ .title = Manage pages
518
+ pdfjs-toggle-views-manager-notification-button =
519
+ .title = Toggle Sidebar (document contains thumbnails/outline/attachments/layers)
520
+ pdfjs-toggle-views-manager-button1-label = Manage pages
521
+ pdfjs-views-manager-sidebar =
522
+ .aria-label = Sidebar
523
+ pdfjs-views-manager-sidebar-resizer =
524
+ .aria-label = Sidebar resizer
525
+ pdfjs-views-manager-view-selector-button =
526
+ .title = Views
527
+ pdfjs-views-manager-view-selector-button-label = Views
528
+ pdfjs-views-manager-pages-title = Pages
529
+ pdfjs-views-manager-outlines-title1 = Document outline
530
+ .title = Document outline (double-click to expand/collapse all items)
531
+ pdfjs-views-manager-attachments-title = Attachments
532
+ pdfjs-views-manager-layers-title1 = Layers
533
+ .title = Layers (double-click to reset all layers to the default state)
534
+ pdfjs-views-manager-pages-option-label = Pages
535
+ pdfjs-views-manager-outlines-option-label = Document outline
536
+ pdfjs-views-manager-attachments-option-label = Attachments
537
+ pdfjs-views-manager-layers-option-label = Layers
538
+ pdfjs-views-manager-add-file-button =
539
+ .title = Add file
540
+ pdfjs-views-manager-add-file-button-label = Add file
541
+ pdfjs-views-manager-pages-status-action-label =
542
+ { $count ->
543
+ [one] { $count } selected
544
+ *[other] { $count } selected
545
+ }
546
+ pdfjs-views-manager-pages-status-none-action-label = Select pages
547
+ pdfjs-views-manager-pages-status-action-button-label = Manage
548
+ pdfjs-views-manager-pages-status-copy-button-label = Copy
549
+ pdfjs-views-manager-pages-status-cut-button-label = Cut
550
+ pdfjs-views-manager-pages-status-delete-button-label = Delete
551
+ pdfjs-views-manager-pages-status-export-selected-button-label = Export selected…
552
+ pdfjs-views-manager-status-undo-cut-label =
553
+ { $count ->
554
+ [one] 1 page cut
555
+ *[other] { $count } pages cut
556
+ }
557
+ pdfjs-views-manager-pages-status-undo-copy-label =
558
+ { $count ->
559
+ [one] 1 page copied
560
+ *[other] { $count } pages copied
561
+ }
562
+ pdfjs-views-manager-pages-status-undo-delete-label =
563
+ { $count ->
564
+ [one] 1 page deleted
565
+ *[other] { $count } pages deleted
566
+ }
567
+ pdfjs-views-manager-pages-status-waiting-ready-label = Getting your file ready…
568
+ pdfjs-views-manager-pages-status-waiting-uploading-label = Uploading file…
569
+ pdfjs-views-manager-status-warning-cut-label = Couldn’t cut. Refresh page and try again.
570
+ pdfjs-views-manager-status-warning-copy-label = Couldn’t copy. Refresh page and try again.
571
+ pdfjs-views-manager-status-warning-delete-label = Couldn’t delete. Refresh page and try again.
572
+ pdfjs-views-manager-status-warning-save-label = Couldn’t save. Refresh page and try again.
573
+ pdfjs-views-manager-status-undo-button-label = Undo
574
+ pdfjs-views-manager-status-done-button-label = Done
575
+ pdfjs-views-manager-status-close-button =
576
+ .title = Close
577
+ pdfjs-views-manager-status-close-button-label = Close
578
+ pdfjs-views-manager-paste-button-label = Paste
579
+ pdfjs-views-manager-paste-button-before =
580
+ .title = Paste before the first page
581
+ pdfjs-views-manager-paste-button-after =
582
+ .title = Paste after page { $page }
583
+ pdfjs-new-badge-content = NEW
584
+ pdfjs-views-manager-waiting-for-file = Uploading file…`)}function Ew(){return document.location.hash}function qs(n,t=!1){const e=t||!this._destination,i={fingerprint:this._fingerprint,uid:e?this._uid:this._uid+1,destination:n};v(Ft,this,Tw).call(this,n,i.uid);let r;if(this._updateUrl&&n?.hash){const{href:s,protocol:o}=document.location;o!=="file:"&&(r=ST(s,n.hash))}e?window.history.replaceState(i,"",r):window.history.pushState(i,"",r)}function Aw(n=!1){if(!this._position)return;let t=this._position;if(n&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination){v(Ft,this,qs).call(this,t);return}if(this._destination.temporary){v(Ft,this,qs).call(this,t,!0);return}if(this._destination.hash===t.hash||!this._destination.page&&this._numPositionUpdates<=vP)return;let e=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest!==void 0||!this._destination.first)return;e=!0}v(Ft,this,qs).call(this,t,e)}function Sw(n){return Number.isInteger(n)&&n>0&&n<=this.linkService.pagesCount}function Pm(n,t=!1){if(!n)return!1;if(n.fingerprint!==this._fingerprint)if(t){if(typeof n.fingerprint!="string"||n.fingerprint.length!==this._fingerprint.length)return!1;const[e]=performance.getEntriesByType("navigation");if(e?.type!=="reload")return!1}else return!1;return!(!Number.isInteger(n.uid)||n.uid<0||n.destination===null||typeof n.destination!="object")}function Tw(n,t,e=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),e&&n?.temporary&&delete n.temporary,this._destination=n,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}function B1(n=!1){const t=unescape(Ew()).substring(1),e=xm(t),i=e.get("nameddest")||"";let r=e.get("page")|0;return(!v(Ft,this,Sw).call(this,r)||n&&i.length>0)&&(r=null),{hash:t,page:r,rotation:this.linkService.rotation}}function CR({location:n}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:n.pdfOpenParams.substring(1),page:this.linkService.page,first:n.pageNumber,rotation:n.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||v(Ft,this,Aw).call(this,!0),this._updateViewareaTimeout=null},yP))}function MR({state:n}){const t=Ew(),e=this._currentHash!==t;if(this._currentHash=t,!n){this._uid++;const{hash:r,page:s,rotation:o}=v(Ft,this,B1).call(this);v(Ft,this,qs).call(this,{hash:r,page:s,rotation:o},!0);return}if(!v(Ft,this,Pm).call(this,n))return;this._popStateInProgress=!0,e&&(this._blockHashChange++,eR({target:window,name:"hashchange",delay:mP}).then(()=>{this._blockHashChange--}));const i=n.destination;v(Ft,this,Tw).call(this,i,n.uid,!0),w1(i.rotation)&&(this.linkService.rotation=i.rotation),i.dest?this.linkService.goToDestination(i.dest):i.hash?this.linkService.setHash(i.hash):i.page&&(this.linkService.page=i.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}function W1(){(!this._destination||this._destination.temporary)&&v(Ft,this,Aw).call(this)}function IR(){if(a(Ko,this))return;p(Ko,this,new AbortController);const{signal:n}=a(Ko,this);this.eventBus.on("updateviewarea",v(Ft,this,CR).bind(this),{signal:n,...sn}),window.addEventListener("popstate",v(Ft,this,MR).bind(this),{signal:n}),window.addEventListener("pagehide",v(Ft,this,W1).bind(this),{signal:n})}function kR(){a(Ko,this)?.abort(),p(Ko,this,null)}function RR(n,t){return typeof n!="string"||typeof t!="string"?!1:n===t||xm(n).get("nameddest")===t}function OR(n,t){function e(i,r){if(typeof i!=typeof r||Array.isArray(i)||Array.isArray(r))return!1;if(i!==null&&typeof i=="object"&&r!==null){if(Object.keys(i).length!==Object.keys(r).length)return!1;for(const s in i)if(!e(i[s],r[s]))return!1;return!0}return i===r||Number.isNaN(i)&&Number.isNaN(r)}if(!(Array.isArray(n)&&Array.isArray(t))||n.length!==t.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!e(n[i],t[i]))return!1;return!0}function j1({width:n,height:t,left:e,top:i},r){if(n===0||t===0)return null;const s=r.textLayer.div.getBoundingClientRect(),o=r.getPagePoint(e-s.left,i-s.top),l=r.getPagePoint(e-s.left+n,i-s.top+t);return Om.normalizeRect([o[0],o[1],l[0],l[1]])}function LR(n,t){const e=n.getClientRects();if(e.length===1)return{rect:j1(e[0],t)};const i=[1/0,1/0,-1/0,-1/0],r=[];let s=0;for(const o of e){const l=j1(o,t);l!==null&&(r[s]=r[s+4]=l[0],r[s+1]=r[s+3]=l[3],r[s+2]=r[s+6]=l[2],r[s+5]=r[s+7]=l[1],Om.rectBoundingBox(...l,i),s+=8)}return{quadPoints:r,rect:i}}function U1(n,t){let e=n;do{if(e.nodeType===Node.TEXT_NODE){const i=e.textContent.length;if(t<=i)return[e,t];t-=i}else if(e.firstChild){e=e.firstChild;continue}for(;!e.nextSibling&&e!==n;)e=e.parentNode;e!==n&&(e=e.nextSibling)}while(e!==n);throw new Error("Offset is bigger than container's contents length.")}function DR({url:n,index:t,length:e},i,r){const s=i._textHighlighter,[{begin:o,end:l}]=s._convertMatches([t],[e]),h=new Range;return h.setStart(...U1(s.textDivs[o.divIdx],o.offset)),h.setEnd(...U1(s.textDivs[l.divIdx],l.offset)),{id:`inferred_link_${r}`,unsafeUrl:n,url:n,annotationType:Ow.LINK,rotation:0,...LR(h,i),borderStyle:null}}function $1(){a(sa,this)&&(a(sa,this).width=a(sa,this).height=0,p(sa,this,null))}function FR(n){if(!a(Ni,this))return!0;const t=a(Ni,this).minX,e=a(Ni,this).minY,i=a(Ni,this).width+t,r=a(Ni,this).height+e;if(n.minX<t||n.minY<e||n.maxX>i||n.maxY>r)return!0;const{width:s,height:o,scale:l}=this.pageView.viewport;if(a(Ni,this).scale!==l)return!0;const h=n.minX-t,c=i-n.maxX,d=n.minY-e,u=r-n.maxY,f=1.5/.5;return t>0&&c/h>f||i<s&&h/c>f||e>0&&u/d>f||r<o&&d/u>f}function H1(n,t){const{alt:e,id:i,lang:r}=n;if(e!==void 0){let s=!1;const o=Tu(e);for(const l of n.children)l.type==="annotation"&&(a(iv,this).getOrInsertComputed(l.id,bT).set("aria-label",o),s=!0);s||t.setAttribute("aria-label",o)}i!==void 0&&t.setAttribute("aria-owns",i),r!==void 0&&t.setAttribute("lang",Tu(r,!0))}function NR(n,t){const{alt:e,bbox:i,children:r}=n,s=r?.[0];if(!a(Vu,this)||!e||!i||s?.type!=="content")return!1;const{id:o}=s;if(!o)return!1;t.setAttribute("aria-owns",o);const l=document.createElement("span");(a(aa,this)||p(aa,this,new Map)).set(o,l),l.setAttribute("role","img"),l.setAttribute("aria-label",Tu(e));const{pageHeight:h,pageX:c,pageY:d}=a(Vu,this),u="calc(var(--total-scale-factor) *",{style:f}=l;return f.width=`${u}${i[2]-i[0]}px)`,f.height=`${u}${i[3]-i[1]}px)`,f.left=`${u}${i[0]-c}px)`,f.top=`${u}${h-i[3]+d}px)`,!0}function V1(n,t){if(n){"id"in n&&t.push(n.id);for(const e of n.children||[])v(es,this,V1).call(this,e,t)}}function z1(n,t=[]){if(!n)return null;let e,i=!0;if("role"in n){const{role:r}=n;if(px.has(r)){e=document.createElementNS(Uu,r);const o=[];(a(fr,this)||p(fr,this,[])).push(e,o);for(const{type:l,id:h}of n.children||[])l==="content"&&h&&o.push(h)}else e=document.createElement("span");const s=r.match(TP);if(s?(e.setAttribute("role","heading"),e.setAttribute("aria-level",s[1])):fx[r]&&e.setAttribute("role",r==="TH"&&t.at(-1)?.role==="TR"&&t.at(-2)?.role==="TBody"?"rowheader":fx[r]),r==="Figure"&&v(es,this,NR).call(this,n,e))return e;r==="Formula"&&(n.mathML&&gx.sanitizer&&(i=!1,e.setHTML(n.mathML,{sanitizer:gx.sanitizer}),v(es,this,V1).call(this,n,a(oa,this)||p(oa,this,[])),delete n.alt),!n.mathML&&n.children.length===1&&n.children[0].role!=="math"&&(e=document.createElementNS(Uu,"math"),delete n.alt))}if(e||(e=document.createElement("span")),v(es,this,H1).call(this,n,e),n.children){if(n.children.length===1&&"id"in n.children[0])v(es,this,H1).call(this,n.children[0],e);else if(i){t.push(n);for(const r of n.children)e.append(v(es,this,z1).call(this,r,t));t.pop()}}return e}function Pw(n,t){const e=n.getBoundingClientRect(),i=t.getBoundingClientRect();if(e.width===0&&e.height===0)return 1;if(i.width===0&&i.height===0)return-1;const r=e.y,s=e.y+e.height,o=e.y+e.height/2,l=i.y,h=i.y+i.height,c=i.y+i.height/2;return o<=l&&c>=s?-1:c<=r&&o>=h?1:e.x+e.width/2-(i.x+i.width/2)}function G1(n,t){const e=t.getAttribute("aria-owns");e?.includes(n)||t.setAttribute("aria-owns",e?`${e} ${n}`:n),t.removeAttribute("role")}function _R(n){const{div:t}=this,e=a(sv,this),i=e?{signal:e}:null;t.addEventListener("mousedown",()=>{t.classList.add("selecting")},i),t.addEventListener("copy",r=>{if(!a(av,this)){const s=document.getSelection();r.clipboardData.setData("text/plain",Tu(xT(s.toString())))}Rm(r)},i),vi._.set(t,n),WR.call(Re,e)}function BR(n){v(Re,this,vi)._.delete(n),v(Re,this,vi)._.size===0&&(v(Re,this,el)._?.abort(),el._=v(Re,this,null))}function WR(n){if(v(Re,this,el)._)return;el._=v(Re,this,new AbortController);const t=n?AbortSignal.any([v(Re,this,el)._.signal,n]):v(Re,this,el)._.signal,e=(o,l)=>{l.append(o),o.style.width="",o.style.height="",l.classList.remove("selecting")};let i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,v(Re,this,vi)._.forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,v(Re,this,vi)._.forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||v(Re,this,vi)._.forEach(e)},{signal:t});var r,s;document.addEventListener("selectionchange",()=>{const o=document.getSelection();if(o.rangeCount===0){v(Re,this,vi)._.forEach(e);return}const l=new Set;for(let g=0;g<o.rangeCount;g++){const m=o.getRangeAt(g);for(const y of v(Re,this,vi)._.keys())!l.has(y)&&m.intersectsNode(y)&&l.add(y)}for(const[g,m]of v(Re,this,vi)._)l.has(g)?g.classList.add("selecting"):e(m,g);if(r??(r=getComputedStyle(v(Re,this,vi)._.values().next().value).getPropertyValue("-moz-user-select")==="none"),r)return;const h=o.getRangeAt(0),c=s&&(h.compareBoundaryPoints(Range.END_TO_END,s)===0||h.compareBoundaryPoints(Range.START_TO_END,s)===0);let d=c?h.startContainer:h.endContainer;if(d.nodeType===Node.TEXT_NODE&&(d=d.parentNode),d.classList?.contains("highlight")&&(d=d.parentNode),!c&&h.endOffset===0)do{for(;!d.previousSibling;)d=d.parentNode;d=d.previousSibling}while(!d.childNodes.length);const u=d.parentElement?.closest(".textLayer"),f=v(Re,this,vi)._.get(u);f&&(f.style.width=u.style.width,f.style.height=u.style.height,f.style.userSelect="text",d.parentElement.insertBefore(f,c?d:d.nextSibling)),s=h.cloneRange()},{signal:t})}function Mu(n,t){const e=IP.get(t),i=a(il,this)[e];if(a(il,this)[e]=n,i){i.replaceWith(n);return}for(let r=e-1;r>=0;r--){const s=a(il,this)[r];if(s){s.after(n);return}}this.div.prepend(n)}function Cw(){const{div:n,viewport:t}=this;if(t.userUnit!==a(pv,this)&&(t.userUnit!==1?n.style.setProperty("--user-unit",t.userUnit):n.style.removeProperty("--user-unit"),p(pv,this,t.userUnit)),this.pdfPage){if(a(dv,this)===t.rotation)return;p(dv,this,t.rotation)}Nw(n,t,!0,!1)}function Cm(n,t){this.eventBus.dispatch(n,{source:this,pageNumber:this.id,error:t})}async function X1(){let n=null;try{await this.annotationLayer.render({viewport:this.viewport,intent:"display",structTreeLayer:this.structTreeLayer,optionalContentConfigPromise:this._optionalContentConfigPromise})}catch(t){console.error("#renderAnnotationLayer:",t),n=t}finally{v(_t,this,Cm).call(this,"annotationlayerrendered",n)}}async function Y1(){let n=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:"display"})}catch(t){console.error("#renderAnnotationEditorLayer:",t),n=t}finally{v(_t,this,Cm).call(this,"annotationeditorlayerrendered",n)}}async function K1(){try{await this.drawLayer.render({intent:"display"})}catch(n){console.error("#renderDrawLayer:",n)}}async function Z1(){let n=null;try{const t=await this.xfaLayer.render({viewport:this.viewport,intent:"display"});t?.textDivs&&this._textHighlighter&&v(_t,this,UR).call(this,t.textDivs)}catch(t){console.error("#renderXfaLayer:",t),n=t}finally{this.xfaLayer?.div&&(this.l10n.pause(),v(_t,this,Mu).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),v(_t,this,Cm).call(this,"xfalayerrendered",n)}}async function J1(){if(!this.textLayer)return;let n=null;try{await this.textLayer.render({viewport:this.viewport,images:this.imageCoordinates?new AT(this.imagesRightClickMinSize,this.imageCoordinates,this.viewport,()=>this.canvas):null})}catch(t){if(t instanceof cT)return;console.error("#renderTextLayer:",t),n=t}v(_t,this,Cm).call(this,"textlayerrendered",n),v(_t,this,jR).call(this)}async function jR(){if(!this.textLayer)return;const n=await this.structTreeLayer?.render();n&&(this.l10n.pause(),this.structTreeLayer?.updateTextLayer(),this.canvas&&n.parentNode!==this.canvas&&this.canvas.append(n),this.l10n.resume()),this.structTreeLayer?.show()}async function UR(n){const t=await this.pdfPage.getTextContent(),e=[];for(const i of t.items)e.push(i.str);this._textHighlighter.setTextMapping(n,e),this._textHighlighter.enable()}async function $R(n){try{if(await n,!this.annotationLayer)return;await this.annotationLayer.injectLinkAnnotations(xP.processLinks(this))}catch(t){console.error("#injectLinkAnnotations:",t)}}function Q1(){const{width:n,height:t}=this.viewport,e=this.outputScale=new ku;if(this.maxCanvasPixels===0){const i=1/this.scale;e.sx*=i,e.sy*=i,p(da,this,!0)}else if(p(da,this,e.limitCanvas(n,t,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor)),a(da,this)&&this.enableDetailCanvas){const i=this.enableOptimizedPartialRendering?4:2;e.sx/=i,e.sy/=i}}async function HR(n){const{info:i,metadata:r,contentDispositionFilename:s,contentLength:o}=await n.getMetadata();return{...i,baseURL:"",filesize:o||(await n.getDownloadInfo()).length,filename:s||gT(""),metadata:r?.getRaw(),authors:r?.get("dc:creator"),numPages:n.numPages,URL:""}}async function VR(n){const t=a(fa,this),e=t.isInPresentationMode||t.isChangingPresentationMode,{id:i,siblings:r,command:s,value:o}=n;if(!i){switch(s){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":e||(t.spreadMode=Vk(o).spreadMode);break;case"page-num":t.currentPageNumber=o+1;break;case"print":await t.pagesPromise,a(cc,this).dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":e||(t.currentScaleValue=o);break;case"SaveAs":a(cc,this).dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":e||t.increaseScale();break;case"ZoomViewOut":e||t.decreaseScale();break;case"WillPrintFinished":a(Bi,this)?.resolve(),p(Bi,this,null);break}return}if(e&&n.focus)return;delete n.id,delete n.siblings;const l=r?[i,...r]:[i];for(const h of l){const c=document.querySelector(`[data-element-id="${h}"]`);c?c.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:n})):a(In,this)?.annotationStorage.setValue(h,n)}}async function Mw(n,t=!1){const e=a(In,this),i=this._visitedPages;if(t&&p(is,this,Promise.withResolvers()),!a(is,this))return;const r=a(fa,this).getPageView(n-1);if(r?.renderingState!==kt.FINISHED){this._pageOpenPending.add(n);return}this._pageOpenPending.delete(n);const s=(async()=>{const o=await(i.has(n)?null:r.pdfPage?.getJSActions());e===a(In,this)&&await a(Oe,this)?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:n,actions:o})})();i.set(n,s)}async function q1(n){const t=a(In,this),e=this._visitedPages;if(!a(is,this)||this._pageOpenPending.has(n))return;const i=e.get(n);i&&(e.set(n,null),await i,t===a(In,this)&&await a(Oe,this)?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:n}))}function zR(){if(p(lc,this,Promise.withResolvers()),a(Oe,this))throw new Error("#initScripting: Scripting already exists.");return a(mv,this).createScripting()}async function Mm(){if(!a(Oe,this)){p(In,this,null),a(lc,this)?.resolve();return}a(is,this)&&(await Promise.race([a(is,this).promise,new Promise(n=>{setTimeout(n,1e3)})]).catch(()=>{}),p(is,this,null)),p(In,this,null);try{await a(Oe,this).destroySandbox()}catch{}a(Bi,this)?.reject(new Error("Scripting destroyed.")),p(Bi,this,null),a(hc,this)?.abort(),p(hc,this,null),this._pageOpenPending.clear(),this._visitedPages.clear(),p(Oe,this,null),p(Zu,this,!1),a(lc,this)?.resolve()}function tT(n){return Object.values(pn).includes(n)&&n!==pn.DISABLE}function eT(){const n=a(pa,this).keys().next().value;n?.destroy(),a(pa,this).delete(n)}function GR(n){const t={annotationEditorMode:a(Wi,this),annotationMode:a(pc,this),textLayerMode:a(sf,this)};return n?(p(ma,this,n.includes(Wo.PRINT_HIGH_QUALITY)||n.includes(Wo.PRINT)),this.eventBus.dispatch("printingallowed",{source:this,isAllowed:a(ma,this)}),!n.includes(Wo.COPY)&&a(sf,this)===Fi.ENABLE&&(t.textLayerMode=Fi.ENABLE_PERMISSIONS),n.includes(Wo.MODIFY_CONTENTS)||(t.annotationEditorMode=pn.DISABLE),!n.includes(Wo.MODIFY_ANNOTATIONS)&&!n.includes(Wo.FILL_INTERACTIVE_FORMS)&&a(pc,this)===Di.ENABLE_FORMS&&(t.annotationMode=Di.ENABLE),t):(p(ma,this,!0),this.eventBus.dispatch("printingallowed",{source:this,isAllowed:a(ma,this)}),t)}async function XR(n){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const t=Promise.withResolvers(),e=new AbortController;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&t.resolve()},{signal:AbortSignal.any([n,e.signal])}),await Promise.race([this._onePageRenderedCapability.promise,t.promise]),e.abort()}function YR(n,t){const e=document.getSelection(),{focusNode:i,anchorNode:r}=e;if(r&&i&&e.containsNode(a(sl,this))){if(a(ef,this)||n===Fi.ENABLE_PERMISSIONS){Rm(t);return}p(ef,this,!0);const{classList:s}=this.viewer;s.add("copyAll");const o=new AbortController,l=new AbortController;window.addEventListener("keydown",h=>{h.key==="Escape"&&l.abort()},{signal:o.signal}),this.getAllText(l.signal).then(async h=>{h!==null&&await navigator.clipboard.writeText(h)}).catch(h=>{console.warn(`Something goes wrong when extracting the text: ${h.message}`)}).finally(()=>{p(ef,this,!1),o.abort(),s.remove("copyAll")}),Rm(t)}}function Im(){if(this._scrollMode!==Pt.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const n=this._currentPageNumber,t=a(yc,this),e=this.viewer;if(e.textContent="",t.pages.length=0,this._spreadMode===Xe.NONE&&!this.isInPresentationMode){const i=this._pages[n-1];e.append(i.div),t.pages.push(i)}else{const i=new Set,r=this._spreadMode-1;r===-1?i.add(n-1):n%2!==r?(i.add(n-1),i.add(n)):(i.add(n-2),i.add(n-1));const s=document.createElement("div");if(s.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",s.append(o)}for(const o of i){const l=this._pages[o];l&&(s.append(l.div),t.pages.push(l))}e.append(s)}t.scrollDown=n>=t.previousPageNumber,t.previousPageNumber=n}function Iw(n,t=null){const{div:e,id:i}=n;if(this._currentPageNumber!==i&&this._setCurrentPageNumber(i),this._scrollMode===Pt.PAGE&&(v(At,this,Im).call(this),this.update()),!t&&!this.isInPresentationMode){const r=e.offsetLeft+e.clientLeft,s=r+e.clientWidth,{scrollLeft:o,clientWidth:l}=this.container;(this._scrollMode===Pt.HORIZONTAL||r<o||s>o+l)&&(t={left:0,top:0})}Bk(e,t),!this._currentScaleValue&&this._location&&(this._location=null)}function KR(n){return n===this._currentScale||Math.abs(n-this._currentScale)<1e-15}function nT(n,t,{noScroll:e=!1,preset:i=!1,drawingDelay:r=-1,origin:s=null}){if(this.clearSelection(),this._currentScaleValue=t.toString(),v(At,this,KR).call(this,n)){i&&this.eventBus.dispatch("scalechanging",{source:this,scale:n,presetValue:t});return}this.viewer.style.setProperty("--scale-factor",n*hr.PDF_TO_CSS_UNITS);const o=r>=0&&r<1e3;this.refresh(!0,{scale:n,drawingDelay:o?r:-1}),o&&p(va,this,setTimeout(()=>{p(va,this,null),this.refresh()},r));const l=this._currentScale;if(this._currentScale=n,!e){let h=this._currentPageNumber,c;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(h=this._location.pageNumber,c=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:h,destArray:c,allowNegativeOffset:!0}),Array.isArray(s)){const d=n/l-1,[u,f]=this.containerTopLeft;this.container.scrollLeft+=(s[0]-f)*d,this.container.scrollTop+=(s[1]-u)*d}}this.eventBus.dispatch("scalechanging",{source:this,scale:n,presetValue:i?t:void 0}),this.defaultRenderingQueue&&this.update()}function ZR(){return this._spreadMode!==Xe.NONE&&this._scrollMode!==Pt.HORIZONTAL?2:1}function Bo(n,t){let e=parseFloat(n);if(e>0)t.preset=!1,v(At,this,nT).call(this,e,n,t);else{const i=this._pages[this._currentPageNumber-1];if(!i)return;let r=Uw,s=$w;this.isInPresentationMode?(r=s=4,this._spreadMode!==Xe.NONE&&(r*=2)):this.removePageBorders?r=s=0:this._scrollMode===Pt.HORIZONTAL&&([r,s]=[s,r]);const o=(this.container.clientWidth-r)/i.width*i.scale/ZR.call(v(At,this)),l=(this.container.clientHeight-s)/i.height*i.scale;switch(n){case"page-actual":e=1;break;case"page-width":e=o;break;case"page-height":e=l;break;case"page-fit":e=Math.min(o,l);break;case"auto":const h=x1(i)?o:Math.min(l,o);e=Math.min(MT,h);break;default:console.error(`#setScale: "${n}" is an unknown zoom value.`);return}t.preset=!0,v(At,this,nT).call(this,e,n,t)}}function iT(){const n=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&v(At,this,Bo).call(this,this._currentScaleValue,{noScroll:!0}),v(At,this,Iw).call(this,n)}function JR(){const n=this._getVisiblePages(),t=[],{ids:e,views:i}=n;for(const r of i){const{view:s}=r;if(!s.hasEditableAnnotations()){e.delete(s.id);continue}t.push(r)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:e}),e)}async function QR(n){if(n.pdfPage)return n.pdfPage;try{const t=await this.pdfDocument.getPage(n.id);return n.pdfPage||n.setPdfPage(t),t}catch(t){return console.error("Unable to get page for page view",t),null}}function qR(n){if(n.first?.id===1)return!0;if(n.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case Pt.PAGE:return a(yc,this).scrollDown;case Pt.HORIZONTAL:return this.scroll.right}return this.scroll.down}function rT(n,t=!1){switch(this._scrollMode){case Pt.WRAPPED:{const{views:e}=this._getVisiblePages(),i=new Map;for(const{id:r,y:s,percent:o,widthPercent:l}of e)o===0||l<100||i.getOrInsertComputed(s,yT).push(r);for(const r of i.values()){const s=r.indexOf(n);if(s===-1)continue;const o=r.length;if(o===1)break;if(t)for(let l=s-1,h=0;l>=h;l--){const c=r[l],d=r[l+1]-1;if(c<d)return n-d}else for(let l=s+1,h=o;l<h;l++){const c=r[l],d=r[l-1]+1;if(c>d)return d-n}if(t){const l=r[0];if(l<n)return n-l+1}else{const l=r[o-1];if(l>n)return l-n+1}break}break}case Pt.HORIZONTAL:break;case Pt.PAGE:case Pt.VERTICAL:{if(this._spreadMode===Xe.NONE)break;const e=this._spreadMode-1;if(t&&n%2!==e)break;if(!t&&n%2===e)break;const{views:i}=this._getVisiblePages(),r=t?n-1:n+1;for(const{id:s,percent:o,widthPercent:l}of i)if(s===r){if(o>0&&l===100)return 2;break}break}}return 1}function sT(n=this.container.clientHeight){n!==a(Iv,this)&&(p(Iv,this,n),IT.setProperty("--viewer-container-height",`${n}px`))}function tO(n){for(const t of n)if(t.target===this.container){v(At,this,sT).call(this,Math.floor(t.borderBoxSize[0].blockSize)),p(qu,this,null);break}}function aT(){a(va,this)!==null&&(clearTimeout(a(va,this)),p(va,this,null)),a(gr,this)!==null&&(clearTimeout(a(gr,this)),p(gr,this,null))}function kw(){a(mc,this)?.abort(),p(mc,this,null),a(vc,this)!==null&&(clearTimeout(a(vc,this)),p(vc,this,null))}function oT(n){switch(n){case pn.STAMP:a(tf,this)?.loadModel("altText");break;case pn.SIGNATURE:a(rf,this)?.loadSignatures();break}}var Iu,Jr,Re,lT,hT,Rw,cT,dT,eO,pn,uT,fT,Di,Ow,nO,iO,rO,Lw,sO,aO,pT,Dw,Fw,oO,lO,hO,gT,cO,dO,uO,fO,pO,gO,mO,mT,vT,yT,bT,vO,wT,yO,xT,bO,ku,wO,xO,EO,AO,Wo,hr,km,SO,TO,Nw,qh,PO,Rm,CO,ET,AT,MO,ST,Om,IO,_w,Bw,mi,jo,TT,Ww,jw,PT,CT,Lm,MT,Uw,$w,Uo,Fi,Pt,Xe,Hw,IT,$o,tc,Ho,Ru,ec,kT,Ou,Vw,sn,Qr,zw,Gw,Xw,RT,OT,LT,DT,FT,Yw,NT,Kw,Dm,Fm,Pe,Lu,Nm,Vo,qr,ta,yt,Zw,_T,ea,_m,Bm,zo,Wm,jm,Um,Go,$m,nc,Jw,Hm,BT,WT,Qw,Du,Fu,Xo,ye,cr,ic,qw,jT,UT,$T,tx,HT,ex,VT,Vm,nx,zT,zm,GT,ix,XT,Nu,YT,rx,sx,KT,ax,ZT,JT,QT,ox,qT,tP,eP,nP,iP,rP,sP,aP,lx,oP,lP,hP,cP,dP,uP,na,rc,fP,pP,Gm,ia,_u,Gn,gP,Yo,mP,vP,yP,Ko,Ft,bP,Xm,Ym,Km,Zm,Jm,Bu,wP,Qm,_,qm,dr,sc,ac,xP,hx,tv,ev,kt,EP,Zo,Wu,ju,ra,Jo,sa,cx,nv,dx,ts,AP,Ni,ux,SP,fx,px,Uu,gx,TP,$u,ur,Hu,iv,Vu,aa,oa,fr,es,mx,la,_i,ha,Qo,rv,PP,qo,CP,sv,av,ov,tl,ns,vx,lv,vi,el,hv,yx,MP,IP,zu,ca,nl,Gu,Xu,Yu,cv,pr,da,Ku,dv,uv,fv,oc,pv,ua,il,_t,bx,kP,is,lc,gv,hc,cc,mv,In,fa,Zu,Oe,Bi,Xn,RP,OP,LP,dc,uc,vv,Ju,DP,wx,Qu,pa,fc,yv,FP,ga,bv,wv,Wi,Ye,pc,gc,qu,xv,Ev,Av,Sv,Tv,Pv,Cv,rl,Mv,tf,ma,gr,mc,vc,ef,sl,Iv,nf,yc,va,rf,kv,sf,Rv,al,ji,ol,At,Ov,NP,kO=xt((()=>{$0(),z0(),H0(),V0(),Ef(),W0(),hT={9306(n,t,e){var i=e(4901),r=e(6823),s=TypeError;n.exports=function(o){if(i(o))return o;throw new s(r(o)+" is not a function")}},3506(n,t,e){var i=e(3925),r=String,s=TypeError;n.exports=function(o){if(i(o))return o;throw new s("Can't set "+r(o)+" as a prototype")}},7080(n,t,e){var i=e(4402).has;n.exports=function(r){return i(r),r}},3463(n){var t=TypeError;n.exports=function(e){if(typeof e=="string")return e;throw new t("Argument is not a string")}},4328(n,t,e){var i=e(4995),r=new i.WeakMap,s=i.set,o=i.remove;n.exports=function(l){return s(r,l,1),o(r,l),l}},6557(n,t,e){var i=e(4995).has;n.exports=function(r){return i(r),r}},6469(n,t,e){var i=e(8227),r=e(2360),s=e(4913).f,o=i("unscopables"),l=Array.prototype;l[o]===void 0&&s(l,o,{configurable:!0,value:r(null)}),n.exports=function(h){l[o][h]=!0}},679(n,t,e){var i=e(1625),r=TypeError;n.exports=function(s,o){if(i(o,s))return s;throw new r("Incorrect invocation")}},8551(n,t,e){var i=e(34),r=String,s=TypeError;n.exports=function(o){if(i(o))return o;throw new s(r(o)+" is not an object")}},7811(n){n.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394(n,t,e){var i=e(4576),r=e(6706),s=e(2195),o=i.ArrayBuffer,l=i.TypeError;n.exports=o&&r(o.prototype,"byteLength","get")||function(h){if(s(h)!=="ArrayBuffer")throw new l("ArrayBuffer expected");return h.byteLength}},3238(n,t,e){var i=e(4576),r=e(7811),s=e(7394),o=i.DataView;n.exports=function(l){if(!r||s(l)!==0)return!1;try{return new o(l),!1}catch{return!0}}},5169(n,t,e){var i=e(3238),r=TypeError;n.exports=function(s){if(i(s))throw new r("ArrayBuffer is detached");return s}},5636(n,t,e){var i=e(4576),r=e(9504),s=e(6706),o=e(7696),l=e(5169),h=e(7394),c=e(4483),d=e(1548),u=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,m=Math.max,y=Math.min,b=f.prototype,x=g.prototype,E=r(b.slice),S=s(b,"resizable","get"),T=s(b,"maxByteLength","get"),A=r(x.getInt8),P=r(x.setInt8);n.exports=(d||c)&&function(C,M,I){var k=h(C),O=M===void 0?k:o(M),B=!S||!S(C),L;if(l(C),d&&(C=u(C,{transfer:[C]}),k===O&&(I||B)))return C;if(k>=O&&(!I||B))L=E(C,0,O);else{L=new f(O,I&&!B&&T?{maxByteLength:m(O,T(C))}:void 0);for(var $=new g(C),j=new g(L),U=y(O,k),G=0;G<U;G++)P(j,G,A($,G))}return d||c(C),L}},4644(n,t,e){var i=e(7811),r=e(3724),s=e(4576),o=e(4901),l=e(34),h=e(9297),c=e(6955),d=e(6823),u=e(6699),f=e(6840),g=e(2106),m=e(1625),y=e(2787),b=e(2967),x=e(8227),E=e(3392),S=e(1181),T=S.enforce,A=S.get,P=s.Int8Array,C=P&&P.prototype,M=s.Uint8ClampedArray,I=M&&M.prototype,k=P&&y(P),O=C&&y(C),B=Object.prototype,L=s.TypeError,$=x("toStringTag"),j=E("TYPED_ARRAY_TAG"),U="TypedArrayConstructor",G=i&&!!b&&c(s.opera)!=="Opera",it=!1,X,ct,Y,q={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},J={BigInt64Array:8,BigUint64Array:8},dt=function(K){if(!l(K))return!1;var lt=c(K);return lt==="DataView"||h(q,lt)||h(J,lt)},gt=function(V){var K=y(V);if(l(K)){var lt=A(K);return lt&&h(lt,U)?lt[U]:gt(K)}},N=function(V){if(!l(V))return!1;var K=c(V);return h(q,K)||h(J,K)},R=function(V){if(N(V))return V;throw new L("Target is not a typed array")},F=function(V){if(o(V)&&(!b||m(k,V)))return V;throw new L(d(V)+" is not a typed array constructor")},H=function(V,K,lt,Ct){if(r){if(lt)for(var Et in q){var bt=s[Et];if(bt&&h(bt.prototype,V))try{delete bt.prototype[V]}catch{try{bt.prototype[V]=K}catch{}}}(!O[V]||lt)&&f(O,V,lt?K:G&&C[V]||K,Ct)}},tt=function(V,K,lt){var Ct,Et;if(r){if(b){if(lt){for(Ct in q)if(Et=s[Ct],Et&&h(Et,V))try{delete Et[V]}catch{}}if(!k[V]||lt)try{return f(k,V,lt?K:G&&k[V]||K)}catch{}else return}for(Ct in q)Et=s[Ct],Et&&(!Et[V]||lt)&&f(Et,V,K)}};for(X in q)ct=s[X],Y=ct&&ct.prototype,Y?T(Y)[U]=ct:G=!1;for(X in J)ct=s[X],Y=ct&&ct.prototype,Y&&(T(Y)[U]=ct);if((!G||!o(k)||k===Function.prototype)&&(k=function(){throw new L("Incorrect invocation")},G))for(X in q)s[X]&&b(s[X],k);if((!G||!O||O===B)&&(O=k.prototype,G))for(X in q)s[X]&&b(s[X].prototype,O);if(G&&y(I)!==O&&b(I,O),r&&!h(O,$)){it=!0,g(O,$,{configurable:!0,get:function(){return l(this)?this[j]:void 0}});for(X in q)s[X]&&u(s[X].prototype,j,X)}n.exports={NATIVE_ARRAY_BUFFER_VIEWS:G,TYPED_ARRAY_TAG:it&&j,aTypedArray:R,aTypedArrayConstructor:F,exportTypedArrayMethod:H,exportTypedArrayStaticMethod:tt,getTypedArrayConstructor:gt,isView:dt,isTypedArray:N,TypedArray:k,TypedArrayPrototype:O}},9617(n,t,e){var i=e(5397),r=e(5610),s=e(6198),o=function(l){return function(h,c,d){var u=i(h),f=s(u);if(f===0)return!l&&-1;var g=r(d,f),m;if(l&&c!==c){for(;f>g;)if(m=u[g++],m!==m)return!0}else for(;f>g;g++)if((l||g in u)&&u[g]===c)return l||g||0;return!l&&-1}};n.exports={includes:o(!0),indexOf:o(!1)}},4527(n,t,e){var i=e(3724),r=e(4376),s=TypeError,o=Object.getOwnPropertyDescriptor;n.exports=i&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(l){return l instanceof TypeError}})()?function(l,h){if(r(l)&&!o(l,"length").writable)throw new s("Cannot set read only .length");return l.length=h}:function(l,h){return l.length=h}},7680(n,t,e){n.exports=e(9504)([].slice)},6319(n,t,e){var i=e(8551),r=e(9539);n.exports=function(s,o,l,h){try{return h?o(i(l)[0],l[1]):o(l)}catch(c){r(s,"throw",c)}}},2195(n,t,e){var i=e(9504),r=i({}.toString),s=i("".slice);n.exports=function(o){return s(r(o),8,-1)}},6955(n,t,e){var i=e(2140),r=e(4901),s=e(2195),o=e(8227)("toStringTag"),l=Object,h=s((function(){return arguments})())==="Arguments",c=function(d,u){try{return d[u]}catch{}};n.exports=i?s:function(d){var u,f,g;return d===void 0?"Undefined":d===null?"Null":typeof(f=c(u=l(d),o))=="string"?f:h?s(u):(g=s(u))==="Object"&&r(u.callee)?"Arguments":g}},7740(n,t,e){var i=e(9297),r=e(5031),s=e(7347),o=e(4913);n.exports=function(l,h,c){for(var d=r(h),u=o.f,f=s.f,g=0;g<d.length;g++){var m=d[g];!i(l,m)&&!(c&&i(c,m))&&u(l,m,f(h,m))}}},2211(n,t,e){n.exports=!e(9039)(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})},2529(n){n.exports=function(t,e){return{value:t,done:e}}},6699(n,t,e){var i=e(3724),r=e(4913),s=e(6980);n.exports=i?function(o,l,h){return r.f(o,l,s(1,h))}:function(o,l,h){return o[l]=h,o}},6980(n){n.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}},4659(n,t,e){var i=e(3724),r=e(4913),s=e(6980);n.exports=function(o,l,h){i?r.f(o,l,s(0,h)):o[l]=h}},2106(n,t,e){var i=e(283),r=e(4913);n.exports=function(s,o,l){return l.get&&i(l.get,o,{getter:!0}),l.set&&i(l.set,o,{setter:!0}),r.f(s,o,l)}},6840(n,t,e){var i=e(4901),r=e(4913),s=e(283),o=e(9433);n.exports=function(l,h,c,d){d||(d={});var u=d.enumerable,f=d.name!==void 0?d.name:h;if(i(c)&&s(c,f,d),d.global)u?l[h]=c:o(h,c);else{try{d.unsafe?l[h]&&(u=!0):delete l[h]}catch{}u?l[h]=c:r.f(l,h,{value:c,enumerable:!1,configurable:!d.nonConfigurable,writable:!d.nonWritable})}return l}},6279(n,t,e){var i=e(6840);n.exports=function(r,s,o){for(var l in s)i(r,l,s[l],o);return r}},9433(n,t,e){var i=e(4576),r=Object.defineProperty;n.exports=function(s,o){try{r(i,s,{value:o,configurable:!0,writable:!0})}catch{i[s]=o}return o}},3724(n,t,e){n.exports=!e(9039)(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483(n,t,e){var i=e(4576),r=e(9429),s=e(1548),o=i.structuredClone,l=i.ArrayBuffer,h=i.MessageChannel,c=!1,d,u,f,g;if(s)c=function(m){o(m,{transfer:[m]})};else if(l)try{h||(d=r("worker_threads"),d&&(h=d.MessageChannel)),h&&(u=new h,f=new l(2),g=function(m){u.port1.postMessage(null,[m])},f.byteLength===2&&(g(f),f.byteLength===0&&(c=g)))}catch{}n.exports=c},4055(n,t,e){var i=e(4576),r=e(34),s=i.document,o=r(s)&&r(s.createElement);n.exports=function(l){return o?s.createElement(l):{}}},6837(n){var t=TypeError,e=9007199254740991;n.exports=function(i){if(i>e)throw new t("Maximum allowed index exceeded");return i}},8727(n){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(n,t,e){n.exports=e(4215)==="NODE"},2839(n,t,e){var i=e(4576).navigator,r=i&&i.userAgent;n.exports=r?String(r):""},9519(n,t,e){var i=e(4576),r=e(2839),s=i.process,o=i.Deno,l=s&&s.versions||o&&o.version,h=l&&l.v8,c,d;h&&(c=h.split("."),d=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!d&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(d=+c[1]))),n.exports=d},4215(n,t,e){var i=e(4576),r=e(2839),s=e(2195),o=function(l){return r.slice(0,l.length)===l};n.exports=(function(){return o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":i.Bun&&typeof Bun.version=="string"?"BUN":i.Deno&&typeof Deno.version=="object"?"DENO":s(i.process)==="process"?"NODE":i.window&&i.document?"BROWSER":"REST"})()},6518(n,t,e){var i=e(4576),r=e(7347).f,s=e(6699),o=e(6840),l=e(9433),h=e(7740),c=e(2796);n.exports=function(d,u){var f=d.target,g=d.global,m=d.stat,y,b,x,E,S,T;if(g?b=i:m?b=i[f]||l(f,{}):b=i[f]&&i[f].prototype,b)for(x in u){if(S=u[x],d.dontCallGetSet?(T=r(b,x),E=T&&T.value):E=b[x],y=c(g?x:f+(m?".":"#")+x,d.forced),!y&&E!==void 0){if(typeof S==typeof E)continue;h(S,E)}(d.sham||E&&E.sham)&&s(S,"sham",!0),o(b,x,S,d)}}},9039(n){n.exports=function(t){try{return!!t()}catch{return!0}}},8745(n,t,e){var i=e(616),r=Function.prototype,s=r.apply,o=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},6080(n,t,e){var i=e(7476),r=e(9306),s=e(616),o=i(i.bind);n.exports=function(l,h){return r(l),h===void 0?l:s?o(l,h):function(){return l.apply(h,arguments)}}},616(n,t,e){n.exports=!e(9039)(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")})},9565(n,t,e){var i=e(616),r=Function.prototype.call;n.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},350(n,t,e){var i=e(3724),r=e(9297),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,l=r(s,"name");n.exports={EXISTS:l,PROPER:l&&function(){}.name==="something",CONFIGURABLE:l&&(!i||i&&o(s,"name").configurable)}},6706(n,t,e){var i=e(9504),r=e(9306);n.exports=function(s,o,l){try{return i(r(Object.getOwnPropertyDescriptor(s,o)[l]))}catch{}}},7476(n,t,e){var i=e(2195),r=e(9504);n.exports=function(s){if(i(s)==="Function")return r(s)}},9504(n,t,e){var i=e(616),r=Function.prototype,s=r.call,o=i&&r.bind.bind(s,s);n.exports=i?o:function(l){return function(){return s.apply(l,arguments)}}},9429(n,t,e){var i=e(4576),r=e(6193);n.exports=function(s){if(r){try{return i.process.getBuiltinModule(s)}catch{}try{return Function('return require("'+s+'")')()}catch{}}}},7751(n,t,e){var i=e(4576),r=e(4901),s=function(o){return r(o)?o:void 0};n.exports=function(o,l){return arguments.length<2?s(i[o]):i[o]&&i[o][l]}},1767(n){n.exports=function(t){return{iterator:t,next:t.next,done:!1}}},851(n,t,e){var i=e(6955),r=e(5966),s=e(4117),o=e(6269),l=e(8227)("iterator");n.exports=function(h){if(!s(h))return r(h,l)||r(h,"@@iterator")||o[i(h)]}},81(n,t,e){var i=e(9565),r=e(9306),s=e(8551),o=e(6823),l=e(851),h=TypeError;n.exports=function(c,d){var u=arguments.length<2?l(c):d;if(r(u))return s(i(u,c));throw new h(o(c)+" is not iterable")}},5966(n,t,e){var i=e(9306),r=e(4117);n.exports=function(s,o){var l=s[o];return r(l)?void 0:i(l)}},3789(n,t,e){var i=e(9306),r=e(8551),s=e(9565),o=e(1291),l=e(1767),h="Invalid size",c=RangeError,d=TypeError,u=Math.max,f=function(g,m){this.set=g,this.size=u(m,0),this.has=i(g.has),this.keys=i(g.keys)};f.prototype={getIterator:function(){return l(r(s(this.keys,this.set)))},includes:function(g){return s(this.has,this.set,g)}},n.exports=function(g){r(g);var m=+g.size;if(m!==m)throw new d(h);var y=o(m);if(y<0)throw new c(h);return new f(g,y)}},4576(n){var t=function(e){return e&&e.Math===Math&&e};n.exports=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof global=="object"&&global)||t(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()},9297(n,t,e){var i=e(9504),r=e(8981),s=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,h){return s(r(l),h)}},421(n){n.exports={}},397(n,t,e){n.exports=e(7751)("document","documentElement")},5917(n,t,e){var i=e(3724),r=e(9039),s=e(4055);n.exports=!i&&!r(function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!==7})},7055(n,t,e){var i=e(9504),r=e(9039),s=e(2195),o=Object,l=i("".split);n.exports=r(function(){return!o("z").propertyIsEnumerable(0)})?function(h){return s(h)==="String"?l(h,""):o(h)}:o},3706(n,t,e){var i=e(9504),r=e(4901),s=e(7629),o=i(Function.toString);r(s.inspectSource)||(s.inspectSource=function(l){return o(l)}),n.exports=s.inspectSource},1181(n,t,e){var i=e(8622),r=e(4576),s=e(34),o=e(6699),l=e(9297),h=e(7629),c=e(6119),d=e(421),u="Object already initialized",f=r.TypeError,g=r.WeakMap,m,y,b,x=function(A){return b(A)?y(A):m(A,{})},E=function(A){return function(P){var C;if(!s(P)||(C=y(P)).type!==A)throw new f("Incompatible receiver, "+A+" required");return C}};if(i||h.state){var S=h.state||(h.state=new g);S.get=S.get,S.has=S.has,S.set=S.set,m=function(A,P){if(S.has(A))throw new f(u);return P.facade=A,S.set(A,P),P},y=function(A){return S.get(A)||{}},b=function(A){return S.has(A)}}else{var T=c("state");d[T]=!0,m=function(A,P){if(l(A,T))throw new f(u);return P.facade=A,o(A,T,P),P},y=function(A){return l(A,T)?A[T]:{}},b=function(A){return l(A,T)}}n.exports={set:m,get:y,has:b,enforce:x,getterFor:E}},4209(n,t,e){var i=e(8227),r=e(6269),s=i("iterator"),o=Array.prototype;n.exports=function(l){return l!==void 0&&(r.Array===l||o[s]===l)}},4376(n,t,e){var i=e(2195);n.exports=Array.isArray||function(s){return i(s)==="Array"}},1108(n,t,e){var i=e(6955);n.exports=function(r){var s=i(r);return s==="BigInt64Array"||s==="BigUint64Array"}},4901(n){var t=typeof document=="object"&&document.all;n.exports=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"}},2796(n,t,e){var i=e(9039),r=e(4901),s=/#|\.prototype\./,o=function(u,f){var g=h[l(u)];return g===d?!0:g===c?!1:r(f)?i(f):!!f},l=o.normalize=function(u){return String(u).replace(s,".").toLowerCase()},h=o.data={},c=o.NATIVE="N",d=o.POLYFILL="P";n.exports=o},4117(n){n.exports=function(t){return t==null}},34(n,t,e){var i=e(4901);n.exports=function(r){return typeof r=="object"?r!==null:i(r)}},3925(n,t,e){var i=e(34);n.exports=function(r){return i(r)||r===null}},6395(n){n.exports=!1},5810(n,t,e){var i=e(34),r=e(1181).get;n.exports=function(o){if(!i(o))return!1;var l=r(o);return!!l&&l.type==="RawJSON"}},757(n,t,e){var i=e(7751),r=e(4901),s=e(1625),o=e(7040),l=Object;n.exports=o?function(h){return typeof h=="symbol"}:function(h){var c=i("Symbol");return r(c)&&s(c.prototype,l(h))}},507(n,t,e){var i=e(9565);n.exports=function(r,s,o){for(var l=o?r:r.iterator,h=r.next,c,d;!(c=i(h,l)).done;)if(d=s(c.value),d!==void 0)return d}},2652(n,t,e){var i=e(6080),r=e(9565),s=e(8551),o=e(6823),l=e(4209),h=e(6198),c=e(1625),d=e(81),u=e(851),f=e(9539),g=TypeError,m=function(b,x){this.stopped=b,this.result=x},y=m.prototype;n.exports=function(b,x,E){var S=E&&E.that,T=!!(E&&E.AS_ENTRIES),A=!!(E&&E.IS_RECORD),P=!!(E&&E.IS_ITERATOR),C=!!(E&&E.INTERRUPTED),M=i(x,S),I,k,O,B,L,$,j,U=function(X){var ct=I;return I=void 0,ct&&f(ct,"normal"),new m(!0,X)},G=function(X){return T?(s(X),C?M(X[0],X[1],U):M(X[0],X[1])):C?M(X,U):M(X)};if(A)I=b.iterator;else if(P)I=b;else{if(k=u(b),!k)throw new g(o(b)+" is not iterable");if(l(k)){for(O=0,B=h(b);B>O;O++)if(L=G(b[O]),L&&c(y,L))return L;return new m(!1)}I=d(b,k)}for($=A?b.next:I.next;!(j=r($,I)).done;){var it=j.value;try{L=G(it)}catch(X){if(I)f(I,"throw",X);else throw X}if(typeof L=="object"&&L&&c(y,L))return L}return new m(!1)}},1385(n,t,e){var i=e(9539);n.exports=function(r,s,o){for(var l=r.length-1;l>=0;l--)if(r[l]!==void 0)try{o=i(r[l].iterator,s,o)}catch(h){s="throw",o=h}if(s==="throw")throw o;return o}},9539(n,t,e){var i=e(9565),r=e(8551),s=e(5966);n.exports=function(o,l,h){var c,d;r(o);try{if(c=s(o,"return"),!c){if(l==="throw")throw h;return h}c=i(c,o)}catch(u){d=!0,c=u}if(l==="throw")throw h;if(d)throw c;return r(c),h}},9462(n,t,e){var i=e(9565),r=e(2360),s=e(6699),o=e(6279),l=e(8227),h=e(1181),c=e(5966),d=e(7657).IteratorPrototype,u=e(2529),f=e(9539),g=e(1385),m=l("toStringTag"),y="IteratorHelper",b="WrapForValidIterator",x="normal",E="throw",S=h.set,T=function(C){var M=h.getterFor(C?b:y);return o(r(d),{next:function(){var k=M(this);if(C)return k.nextHandler();if(k.done)return u(void 0,!0);try{var O=k.nextHandler();return k.returnHandlerResult?O:u(O,k.done)}catch(B){throw k.done=!0,B}},return:function(){var I=M(this),k=I.iterator,O=I.done;if(I.done=!0,C){var B=c(k,"return");return B?i(B,k):u(void 0,!0)}if(O)return u(void 0,!0);if(I.inner)try{f(I.inner.iterator,x)}catch(L){return f(k,E,L)}if(I.openIters)try{g(I.openIters,x)}catch(L){if(k)return f(k,E,L);throw L}return k&&f(k,x),u(void 0,!0)}})},A=T(!0),P=T(!1);s(P,m,"Iterator Helper"),n.exports=function(C,M,I){var k=function(B,L){L?(L.iterator=B.iterator,L.next=B.next):L=B,L.type=M?b:y,L.returnHandlerResult=!!I,L.nextHandler=C,L.counter=0,L.done=!1,S(this,L)};return k.prototype=M?A:P,k}},684(n){n.exports=function(t,e){var i=typeof Iterator=="function"&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch{return!0}}},4549(n,t,e){var i=e(4576);n.exports=function(r,s){var o=i.Iterator,l=o&&o.prototype,h=l&&l[r],c=!1;if(h)try{h.call({next:function(){return{done:!0}},return:function(){c=!0}},-1)}catch(d){d instanceof s||(c=!1)}if(!c)return h}},7657(n,t,e){var i=e(9039),r=e(4901),s=e(34),o=e(2360),l=e(2787),h=e(6840),c=e(8227),d=e(6395),u=c("iterator"),f=!1,g,m,y;[].keys&&(y=[].keys(),"next"in y?(m=l(l(y)),m!==Object.prototype&&(g=m)):f=!0),!s(g)||i(function(){var b={};return g[u].call(b)!==b})?g={}:d&&(g=o(g)),r(g[u])||h(g,u,function(){return this}),n.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:f}},6269(n){n.exports={}},6198(n,t,e){var i=e(8014);n.exports=function(r){return i(r.length)}},283(n,t,e){var i=e(9504),r=e(9039),s=e(4901),o=e(9297),l=e(3724),h=e(350).CONFIGURABLE,c=e(3706),d=e(1181),u=d.enforce,f=d.get,g=String,m=Object.defineProperty,y=i("".slice),b=i("".replace),x=i([].join),E=l&&!r(function(){return m(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),T=n.exports=function(A,P,C){y(g(P),0,7)==="Symbol("&&(P="["+b(g(P),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),C&&C.getter&&(P="get "+P),C&&C.setter&&(P="set "+P),(!o(A,"name")||h&&A.name!==P)&&(l?m(A,"name",{value:P,configurable:!0}):A.name=P),E&&C&&o(C,"arity")&&A.length!==C.arity&&m(A,"length",{value:C.arity});try{C&&o(C,"constructor")&&C.constructor?l&&m(A,"prototype",{writable:!1}):A.prototype&&(A.prototype=void 0)}catch{}var M=u(A);return o(M,"source")||(M.source=x(S,typeof P=="string"?P:"")),A};Function.prototype.toString=T(function(){return s(this)&&f(this).source||c(this)},"toString")},2248(n,t,e){var i=e(9504),r=Map.prototype;n.exports={Map,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete),proto:r}},741(n){var t=Math.ceil,e=Math.floor;n.exports=Math.trunc||function(r){var s=+r;return(s>0?e:t)(s)}},7819(n,t,e){n.exports=!e(9039)(function(){var i="9007199254740993",r=JSON.rawJSON(i);return!JSON.isRawJSON(r)||JSON.stringify(r)!==i})},6043(n,t,e){var i=e(9306),r=TypeError,s=function(o){var l,h;this.promise=new o(function(c,d){if(l!==void 0||h!==void 0)throw new r("Bad Promise constructor");l=c,h=d}),this.resolve=i(l),this.reject=i(h)};n.exports.f=function(o){return new s(o)}},2360(n,t,e){var i=e(8551),r=e(6801),s=e(8727),o=e(421),l=e(397),h=e(4055),c=e(6119),d=">",u="<",f="prototype",g="script",m=c("IE_PROTO"),y=function(){},b=function(A){return u+g+d+A+u+"/"+g+d},x=function(A){A.write(b("")),A.close();var P=A.parentWindow.Object;return A=null,P},E=function(){var A=h("iframe"),P="java"+g+":",C;return A.style.display="none",l.appendChild(A),A.src=String(P),C=A.contentWindow.document,C.open(),C.write(b("document.F=Object")),C.close(),C.F},S,T=function(){try{S=new ActiveXObject("htmlfile")}catch{}T=typeof document<"u"?document.domain&&S?x(S):E():x(S);for(var A=s.length;A--;)delete T[f][s[A]];return T()};o[m]=!0,n.exports=Object.create||function(P,C){var M;return P!==null?(y[f]=i(P),M=new y,y[f]=null,M[m]=P):M=T(),C===void 0?M:r.f(M,C)}},6801(n,t,e){var i=e(3724),r=e(8686),s=e(4913),o=e(8551),l=e(5397),h=e(1072);t.f=i&&!r?Object.defineProperties:function(d,u){o(d);for(var f=l(u),g=h(u),m=g.length,y=0,b;m>y;)s.f(d,b=g[y++],f[b]);return d}},4913(n,t,e){var i=e(3724),r=e(5917),s=e(8686),o=e(8551),l=e(6969),h=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u="enumerable",f="configurable",g="writable";t.f=i?s?function(y,b,x){if(o(y),b=l(b),o(x),typeof y=="function"&&b==="prototype"&&"value"in x&&g in x&&!x[g]){var E=d(y,b);E&&E[g]&&(y[b]=x.value,x={configurable:f in x?x[f]:E[f],enumerable:u in x?x[u]:E[u],writable:!1})}return c(y,b,x)}:c:function(y,b,x){if(o(y),b=l(b),o(x),r)try{return c(y,b,x)}catch{}if("get"in x||"set"in x)throw new h("Accessors not supported");return"value"in x&&(y[b]=x.value),y}},7347(n,t,e){var i=e(3724),r=e(9565),s=e(8773),o=e(6980),l=e(5397),h=e(6969),c=e(9297),d=e(5917),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(g,m){if(g=l(g),m=h(m),d)try{return u(g,m)}catch{}if(c(g,m))return o(!r(s.f,g,m),g[m])}},8480(n,t,e){var i=e(1828),r=e(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(o){return i(o,r)}},3717(n,t){t.f=Object.getOwnPropertySymbols},2787(n,t,e){var i=e(9297),r=e(4901),s=e(8981),o=e(6119),l=e(2211),h=o("IE_PROTO"),c=Object,d=c.prototype;n.exports=l?c.getPrototypeOf:function(u){var f=s(u);if(i(f,h))return f[h];var g=f.constructor;return r(g)&&f instanceof g?g.prototype:f instanceof c?d:null}},1625(n,t,e){n.exports=e(9504)({}.isPrototypeOf)},1828(n,t,e){var i=e(9504),r=e(9297),s=e(5397),o=e(9617).indexOf,l=e(421),h=i([].push);n.exports=function(c,d){var u=s(c),f=0,g=[],m;for(m in u)!r(l,m)&&r(u,m)&&h(g,m);for(;d.length>f;)r(u,m=d[f++])&&(~o(g,m)||h(g,m));return g}},1072(n,t,e){var i=e(1828),r=e(8727);n.exports=Object.keys||function(o){return i(o,r)}},8773(n,t){var e={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor;t.f=i&&!e.call({1:2},1)?function(s){var o=i(this,s);return!!o&&o.enumerable}:e},2967(n,t,e){var i=e(6706),r=e(34),s=e(7750),o=e(3506);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l=!1,h={},c;try{c=i(Object.prototype,"__proto__","set"),c(h,[]),l=h instanceof Array}catch{}return function(u,f){return s(u),o(f),r(u)&&(l?c(u,f):u.__proto__=f),u}})():void 0)},4270(n,t,e){var i=e(9565),r=e(4901),s=e(34),o=TypeError;n.exports=function(l,h){var c,d;if(h==="string"&&r(c=l.toString)&&!s(d=i(c,l))||r(c=l.valueOf)&&!s(d=i(c,l))||h!=="string"&&r(c=l.toString)&&!s(d=i(c,l)))return d;throw new o("Can't convert object to primitive value")}},5031(n,t,e){var i=e(7751),r=e(9504),s=e(8480),o=e(3717),l=e(8551),h=r([].concat);n.exports=i("Reflect","ownKeys")||function(d){var u=s.f(l(d)),f=o.f;return f?h(u,f(d)):u}},8235(n,t,e){var i=e(9504),r=e(9297),s=SyntaxError,o=parseInt,l=String.fromCharCode,h=i("".charAt),c=i("".slice),d=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
585
+ `,"\\r":"\r","\\t":" "},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;n.exports=function(m,y){for(var b=!0,x="";y<m.length;){var E=h(m,y);if(E==="\\"){var S=c(m,y,y+2);if(r(u,S))x+=u[S],y+=2;else if(S==="\\u"){y+=2;var T=c(m,y,y+4);if(!d(f,T))throw new s("Bad Unicode escape at: "+y);x+=l(o(T,16)),y+=4}else throw new s('Unknown escape sequence: "'+S+'"')}else if(E==='"'){b=!1,y++;break}else{if(d(g,E))throw new s("Bad control character in string literal at: "+y);x+=E,y++}}if(b)throw new s("Unterminated string at: "+y);return{value:x,end:y}}},7750(n,t,e){var i=e(4117),r=TypeError;n.exports=function(s){if(i(s))throw new r("Can't call method on "+s);return s}},9286(n,t,e){var i=e(4402),r=e(8469),s=i.Set,o=i.add;n.exports=function(l){var h=new s;return r(l,function(c){o(h,c)}),h}},3440(n,t,e){var i=e(7080),r=e(4402),s=e(9286),o=e(5170),l=e(3789),h=e(8469),c=e(507),d=r.has,u=r.remove;n.exports=function(g){var m=i(this),y=l(g),b=s(m);return o(b)<=y.size?h(b,function(x){y.includes(x)&&u(b,x)}):c(y.getIterator(),function(x){d(b,x)&&u(b,x)}),b}},4402(n,t,e){var i=e(9504),r=Set.prototype;n.exports={Set,add:i(r.add),has:i(r.has),remove:i(r.delete),proto:r}},8750(n,t,e){var i=e(7080),r=e(4402),s=e(5170),o=e(3789),l=e(8469),h=e(507),c=r.Set,d=r.add,u=r.has;n.exports=function(g){var m=i(this),y=o(g),b=new c;return s(m)>y.size?h(y.getIterator(),function(x){u(m,x)&&d(b,x)}):l(m,function(x){y.includes(x)&&d(b,x)}),b}},4449(n,t,e){var i=e(7080),r=e(4402).has,s=e(5170),o=e(3789),l=e(8469),h=e(507),c=e(9539);n.exports=function(u){var f=i(this),g=o(u);if(s(f)<=g.size)return l(f,function(y){if(g.includes(y))return!1},!0)!==!1;var m=g.getIterator();return h(m,function(y){if(r(f,y))return c(m.iterator,"normal",!1)})!==!1}},3838(n,t,e){var i=e(7080),r=e(5170),s=e(8469),o=e(3789);n.exports=function(h){var c=i(this),d=o(h);return r(c)>d.size?!1:s(c,function(u){if(!d.includes(u))return!1},!0)!==!1}},8527(n,t,e){var i=e(7080),r=e(4402).has,s=e(5170),o=e(3789),l=e(507),h=e(9539);n.exports=function(d){var u=i(this),f=o(d);if(s(u)<f.size)return!1;var g=f.getIterator();return l(g,function(m){if(!r(u,m))return h(g.iterator,"normal",!1)})!==!1}},8469(n,t,e){var i=e(9504),r=e(507),s=e(4402),o=s.Set,l=s.proto,h=i(l.forEach),c=i(l.keys),d=c(new o).next;n.exports=function(u,f,g){return g?r({iterator:c(u),next:d},f):h(u,f)}},4916(n,t,e){var i=e(7751),r=function(o){return{size:o,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(o){return{size:o,has:function(){return!0},keys:function(){throw new Error("e")}}};n.exports=function(o,l){var h=i("Set");try{new h()[o](r(0));try{return new h()[o](r(-1)),!1}catch{if(!l)return!0;try{return new h()[o](s(-1/0)),!1}catch{return l(new h([1,2])[o](s(1/0)))}}}catch{return!1}}},9835(n){n.exports=function(t){try{var e=new Set,i=e[t]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}});return i.size===1&&i.values().next().value===4}catch{return!1}}},5170(n,t,e){n.exports=e(6706)(e(4402).proto,"size","get")||function(i){return i.size}},3650(n,t,e){var i=e(7080),r=e(4402),s=e(9286),o=e(3789),l=e(507),h=r.add,c=r.has,d=r.remove;n.exports=function(f){var g=i(this),m=o(f).getIterator(),y=s(g);return l(m,function(b){c(g,b)?d(y,b):h(y,b)}),y}},4204(n,t,e){var i=e(7080),r=e(4402).add,s=e(9286),o=e(3789),l=e(507);n.exports=function(c){var d=i(this),u=o(c).getIterator(),f=s(d);return l(u,function(g){r(f,g)}),f}},6119(n,t,e){var i=e(5745),r=e(3392),s=i("keys");n.exports=function(o){return s[o]||(s[o]=r(o))}},7629(n,t,e){var i=e(6395),r=e(4576),s=e(9433),o="__core-js_shared__",l=n.exports=r[o]||s(o,{});(l.versions||(l.versions=[])).push({version:"3.49.0",mode:i?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(n,t,e){var i=e(7629);n.exports=function(r,s){return i[r]||(i[r]=s||{})}},533(n,t,e){var i=e(9504),r=e(8014),s=e(655),o=e(2333),l=e(7750),h=i(o),c=i("".slice),d=Math.ceil,u=function(f){return function(g,m,y){var b=s(l(g)),x=r(m),E=b.length;if(x<=E)return b;var S=y===void 0?" ":s(y),T,A;return S===""?b:(T=x-E,A=h(S,d(T/S.length)),A.length>T&&(A=c(A,0,T)),f?b+A:A+b)}};n.exports={start:u(!1),end:u(!0)}},2333(n,t,e){var i=e(1291),r=e(655),s=e(7750),o=RangeError,l=Math.floor;n.exports=function(c){var d=r(s(this)),u="",f=i(c);if(f<0||f===1/0)throw new o("Wrong number of repetitions");for(;f>0;(f=l(f/2))&&(d+=d))f%2&&(u+=d);return u}},1548(n,t,e){var i=e(4576),r=e(9039),s=e(9519),o=e(4215),l=i.structuredClone;n.exports=!!l&&!r(function(){if(o==="DENO"&&s>92||o==="NODE"&&s>94||o==="BROWSER"&&s>97)return!1;var h=new ArrayBuffer(8),c=l(h,{transfer:[h]});return h.byteLength!==0||c.byteLength!==8})},4495(n,t,e){var i=e(9519),r=e(9039),s=e(4576).String;n.exports=!!Object.getOwnPropertySymbols&&!r(function(){var o=Symbol("symbol detection");return!s(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&i&&i<41})},5610(n,t,e){var i=e(1291),r=Math.max,s=Math.min;n.exports=function(o,l){var h=i(o);return h<0?r(h+l,0):s(h,l)}},5854(n,t,e){var i=e(2777),r=TypeError;n.exports=function(s){var o=i(s,"number");if(typeof o=="number")throw new r("Can't convert number to bigint");return BigInt(o)}},7696(n,t,e){var i=e(1291),r=e(8014),s=RangeError;n.exports=function(o){if(o===void 0)return 0;var l=i(o),h=r(l);if(l!==h)throw new s("Wrong length or index");return h}},5397(n,t,e){var i=e(7055),r=e(7750);n.exports=function(s){return i(r(s))}},1291(n,t,e){var i=e(741);n.exports=function(r){var s=+r;return s!==s||s===0?0:i(s)}},8014(n,t,e){var i=e(1291),r=Math.min;n.exports=function(s){var o=i(s);return o>0?r(o,9007199254740991):0}},8981(n,t,e){var i=e(7750),r=Object;n.exports=function(s){return r(i(s))}},2777(n,t,e){var i=e(9565),r=e(34),s=e(757),o=e(5966),l=e(4270),h=e(8227),c=TypeError,d=h("toPrimitive");n.exports=function(u,f){if(!r(u)||s(u))return u;var g=o(u,d),m;if(g){if(f===void 0&&(f="default"),m=i(g,u,f),!r(m)||s(m))return m;throw new c("Can't convert object to primitive value")}return f===void 0&&(f="number"),l(u,f)}},6969(n,t,e){var i=e(2777),r=e(757);n.exports=function(s){var o=i(s,"string");return r(o)?o:o+""}},2140(n,t,e){var i=e(8227)("toStringTag"),r={};r[i]="z",n.exports=String(r)==="[object z]"},655(n,t,e){var i=e(6955),r=String;n.exports=function(s){if(i(s)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(s)}},6823(n){var t=String;n.exports=function(e){try{return t(e)}catch{return"Object"}}},3392(n,t,e){var i=e(9504),r=0,s=Math.random(),o=i(1.1.toString);n.exports=function(l){return"Symbol("+(l===void 0?"":l)+")_"+o(++r+s,36)}},7416(n,t,e){var i=e(9039),r=e(8227),s=e(3724),o=e(6395),l=r("iterator");n.exports=!i(function(){var h=new URL("b?a=1&b=2&c=3","https://a"),c=h.searchParams,d=new URLSearchParams("a=1&a=2&b=3"),u="";return h.pathname="c%20d",c.forEach(function(f,g){c.delete("b"),u+=g+f}),d.delete("a",2),d.delete("b",void 0),o&&(!h.toJSON||!d.has("a",1)||d.has("a",2)||!d.has("a",void 0)||d.has("b"))||!c.size&&(o||!s)||!c.sort||h.href!=="https://a/c%20d?a=1&c=3"||c.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!c[l]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"})},7040(n,t,e){n.exports=e(4495)&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686(n,t,e){var i=e(3724),r=e(9039);n.exports=i&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812(n){var t=TypeError;n.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},8622(n,t,e){var i=e(4576),r=e(4901),s=i.WeakMap;n.exports=r(s)&&/native code/.test(String(s))},4995(n,t,e){var i=e(9504),r=WeakMap.prototype;n.exports={WeakMap,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete)}},8227(n,t,e){var i=e(4576),r=e(5745),s=e(9297),o=e(3392),l=e(4495),h=e(7040),c=i.Symbol,d=r("wks"),u=h?c.for||c:c&&c.withoutSetter||o;n.exports=function(f){return s(d,f)||(d[f]=l&&s(c,f)?c[f]:u("Symbol."+f)),d[f]}},7452(n){n.exports=`
586
+ \v\f\r                 \u2028\u2029\uFEFF`},6573(n,t,e){var i=e(3724),r=e(2106),s=e(3238),o=ArrayBuffer.prototype;i&&!("detached"in o)&&r(o,"detached",{configurable:!0,get:function(){return s(this)}})},7936(n,t,e){var i=e(6518),r=e(5636);r&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},8100(n,t,e){var i=e(6518),r=e(5636);r&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},4423(n,t,e){var i=e(6518),r=e(9617).includes,s=e(9039),o=e(6469),l=s(function(){return!Array(1).includes()}),h=s(function(){return[,1].includes(void 0,1)});i({target:"Array",proto:!0,forced:l||h},{includes:function(d){return r(this,d,arguments.length>1?arguments[1]:void 0)}}),o("includes")},4114(n,t,e){var i=e(6518),r=e(8981),s=e(6198),o=e(4527),l=e(6837),h=e(9039)(function(){return[].push.call({length:4294967296},1)!==4294967297}),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(d){return d instanceof TypeError}};i({target:"Array",proto:!0,arity:1,forced:h||!c()},{push:function(u){var f=r(this),g=s(f),m=arguments.length;l(g+m);for(var y=0;y<m;y++)f[g]=arguments[y],g++;return o(f,g),g}})},8111(n,t,e){var i=e(6518),r=e(4576),s=e(679),o=e(8551),l=e(4901),h=e(2787),c=e(2106),d=e(4659),u=e(9039),f=e(9297),g=e(8227),m=e(7657).IteratorPrototype,y=e(3724),b=e(6395),x="constructor",E="Iterator",S=g("toStringTag"),T=TypeError,A=r[E],P=b||!l(A)||A.prototype!==m||!u(function(){A({})}),C=function(){if(s(this,m),h(this)===m)throw new T("Abstract class Iterator not directly constructable")},M=function(I,k){y?c(m,I,{configurable:!0,get:function(){return k},set:function(O){if(o(this),this===m)throw new T("You can't redefine this property");f(this,I)?this[I]=O:d(this,I,O)}}):m[I]=k};f(m,S)||M(S,E),(P||!f(m,x)||m[x]===Object)&&M(x,C),C.prototype=m,i({global:!0,constructor:!0,forced:P},{Iterator:C})},1148(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("every",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;return!s(g,function(y,b){if(!f(y,m++))return b()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(n,t,e){var i=e(6518),r=e(9565),s=e(9306),o=e(8551),l=e(1767),h=e(9462),c=e(6319),d=e(6395),u=e(9539),f=e(684),g=e(4549),m=!d&&!f("filter",function(){}),y=!d&&!m&&g("filter",TypeError),b=d||m||y,x=h(function(){for(var E=this.iterator,S=this.predicate,T=this.next,A,P,C;;){if(A=o(r(T,E)),P=this.done=!!A.done,P)return;if(C=A.value,c(E,S,[C,this.counter++],!0))return C}});i({target:"Iterator",proto:!0,real:!0,forced:b},{filter:function(S){o(this);try{s(S)}catch(T){u(this,"throw",T)}return y?r(y,this,S):new x(l(this),{predicate:S})}})},7588(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("forEach",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;s(g,function(y){f(y,m++)},{IS_RECORD:!0})}})},1701(n,t,e){var i=e(6518),r=e(9565),s=e(9306),o=e(8551),l=e(1767),h=e(9462),c=e(6319),d=e(9539),u=e(684),f=e(4549),g=e(6395),m=!g&&!u("map",function(){}),y=!g&&!m&&f("map",TypeError),b=g||m||y,x=h(function(){var E=this.iterator,S=o(r(this.next,E));if(!(this.done=!!S.done))return c(E,this.mapper,[S.value,this.counter++],!0)});i({target:"Iterator",proto:!0,real:!0,forced:b},{map:function(S){o(this);try{s(S)}catch(T){d(this,"throw",T)}return y?r(y,this,S):new x(l(this),{mapper:S})}})},3579(n,t,e){var i=e(6518),r=e(9565),s=e(2652),o=e(9306),l=e(8551),h=e(1767),c=e(9539),d=e(4549)("some",TypeError);i({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(f){l(this);try{o(f)}catch(y){c(this,"throw",y)}if(d)return r(d,this,f);var g=h(this),m=0;return s(g,function(y,b){if(f(y,m++))return b()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},9112(n,t,e){var i=e(6518),r=e(3724),s=e(4576),o=e(7751),l=e(9504),h=e(9565),c=e(4901),d=e(34),u=e(4376),f=e(9297),g=e(655),m=e(6198),y=e(4659),b=e(9039),x=e(8235),E=e(4495),S=s.JSON,T=s.Number,A=s.SyntaxError,P=S&&S.parse,C=o("Object","keys"),M=Object.getOwnPropertyDescriptor,I=l("".charAt),k=l("".slice),O=l(/./.exec),B=l([].push),L=/^\d$/,$=/^[1-9]$/,j=/^[\d-]$/,U=/^[\t\n\r ]$/,G=0,it=1,X=function(N,R){N=g(N);var F=new J(N,0,""),H=F.parse(),tt=H.value,V=F.skip(U,H.end);if(V<N.length)throw new A('Unexpected extra character: "'+I(N,V)+'" after the parsed data at: '+V);return c(R)?ct({"":tt},"",R,H):tt},ct=function(N,R,F,H){var tt=N[R],V=H&&tt===H.value,K=V&&typeof H.source=="string"?{source:H.source}:{},lt,Ct,Et,bt,le;if(d(tt)){var Le=u(tt),Yn=V?H.nodes:Le?[]:{};if(Le)for(lt=Yn.length,Et=m(tt),bt=0;bt<Et;bt++)Y(tt,bt,ct(tt,""+bt,F,bt<lt?Yn[bt]:void 0));else for(Ct=C(tt),Et=m(Ct),bt=0;bt<Et;bt++)le=Ct[bt],Y(tt,le,ct(tt,le,F,f(Yn,le)?Yn[le]:void 0))}return h(F,N,R,tt,K)},Y=function(N,R,F){if(r){var H=M(N,R);if(H&&!H.configurable)return}F===void 0?delete N[R]:y(N,R,F)},q=function(N,R,F,H){this.value=N,this.end=R,this.source=F,this.nodes=H},J=function(N,R){this.source=N,this.index=R};J.prototype={fork:function(N){return new J(this.source,N)},parse:function(){var N=this.source,R=this.skip(U,this.index),F=this.fork(R),H=I(N,R);if(O(j,H))return F.number();switch(H){case"{":return F.object();case"[":return F.array();case'"':return F.string();case"t":return F.keyword(!0);case"f":return F.keyword(!1);case"n":return F.keyword(null)}throw new A('Unexpected character: "'+H+'" at: '+R)},node:function(N,R,F,H,tt){return new q(R,H,N?null:k(this.source,F,H),tt)},object:function(){for(var N=this.source,R=this.index+1,F=!1,H={},tt={},V=!1;R<N.length;){if(R=this.until(['"',"}"],R),I(N,R)==="}"&&!F){R++,V=!0;break}var K=this.fork(R).string(),lt=K.value;R=K.end,R=this.until([":"],R)+1,R=this.skip(U,R),K=this.fork(R).parse(),y(tt,lt,K),y(H,lt,K.value),R=this.until([",","}"],K.end);var Ct=I(N,R);if(Ct===",")F=!0,R++;else if(Ct==="}"){R++,V=!0;break}}if(!V)throw new A("Unterminated object at: "+R);return this.node(it,H,this.index,R,tt)},array:function(){for(var N=this.source,R=this.index+1,F=!1,H=[],tt=[],V=!1;R<N.length;){if(R=this.skip(U,R),I(N,R)==="]"&&!F){R++,V=!0;break}var K=this.fork(R).parse();if(B(tt,K),B(H,K.value),R=this.until([",","]"],K.end),I(N,R)===",")F=!0,R++;else if(I(N,R)==="]"){R++,V=!0;break}}if(!V)throw new A("Unterminated array at: "+R);return this.node(it,H,this.index,R,tt)},string:function(){var N=this.index,R=x(this.source,this.index+1);return this.node(G,R.value,N,R.end)},number:function(){var N=this.source,R=this.index,F=R;if(I(N,F)==="-"&&F++,I(N,F)==="0")F++;else if(O($,I(N,F)))F=this.skip(L,F+1);else throw new A("Failed to parse number at: "+F);if(I(N,F)==="."){var H=F+1;if(F=this.skip(L,H),H===F)throw new A("Failed to parse number's fraction at: "+F)}if(I(N,F)==="e"||I(N,F)==="E"){F++,(I(N,F)==="+"||I(N,F)==="-")&&F++;var tt=F;if(F=this.skip(L,F),tt===F)throw new A("Failed to parse number's exponent value at: "+F)}return this.node(G,T(k(N,R,F)),R,F)},keyword:function(N){var R=""+N,F=this.index,H=F+R.length;if(k(this.source,F,H)!==R)throw new A("Failed to parse value at: "+F);return this.node(G,N,F,H)},skip:function(N,R){for(var F=this.source;R<F.length&&O(N,I(F,R));R++);return R},until:function(N,R){R=this.skip(U,R);for(var F=I(this.source,R),H=0;H<N.length;H++)if(N[H]===F)return R;throw new A('Unexpected character: "'+F+'" at: '+R)}};var dt=b(function(){var N="9007199254740993",R;return P(N,function(F,H,tt){R=tt.source}),R!==N}),gt=E&&!b(function(){return 1/P("-0 ")!==-1/0});i({target:"JSON",stat:!0,forced:dt},{parse:function(R,F){return gt&&!c(F)?P(R):X(R,F)}})},3110(n,t,e){var i=e(6518),r=e(7751),s=e(8745),o=e(9565),l=e(9504),h=e(9039),c=e(4376),d=e(4901),u=e(5810),f=e(757),g=e(2195),m=e(655),y=e(7680),b=e(8235),x=e(3392),E=e(4495),S=e(7819),T=String,A=r("JSON","stringify"),P=l(/./.exec),C=l("".charAt),M=l("".charCodeAt),I=l("".replace),k=l("".slice),O=l([].push),B=l(1.1.toString),L=/[\uD800-\uDFFF]/g,$=/^[\uD800-\uDBFF]$/,j=/^[\uDC00-\uDFFF]$/,U=x(),G=U.length,it=!E||h(function(){var J=r("Symbol")("stringify detection");return A([J])!=="[null]"||A({a:J})!=="{}"||A(Object(J))!=="{}"}),X=h(function(){return A("\uDF06\uD834")!=='"\\udf06\\ud834"'||A("\uDEAD")!=='"\\udead"'}),ct=it?function(J,dt){var gt=y(arguments),N=q(dt);if(!(!d(N)&&(J===void 0||f(J))))return gt[1]=function(R,F){if(d(N)&&(F=o(N,this,T(R),F)),!f(F))return F},s(A,null,gt)}:A,Y=function(J,dt,gt){var N=C(gt,dt-1),R=C(gt,dt+1);return P($,J)&&!P(j,R)||P(j,J)&&!P($,N)?"\\u"+B(M(J,0),16):J},q=function(J){if(d(J))return J;if(c(J)){for(var dt=J.length,gt=[],N=0;N<dt;N++){var R=J[N];typeof R=="string"?O(gt,R):(typeof R=="number"||g(R)==="Number"||g(R)==="String")&&O(gt,m(R))}var F=gt.length,H=!0;return function(tt,V){if(H)return H=!1,V;if(c(this))return V;for(var K=0;K<F;K++)if(gt[K]===tt)return V}}};A&&i({target:"JSON",stat:!0,arity:3,forced:it||X||!S},{stringify:function(dt,gt,N){var R=q(gt),F=[],H=ct(dt,function(bt,le){var Le=d(R)?o(R,this,T(bt),le):le;return!S&&u(Le)?U+(O(F,Le.rawJSON)-1):Le},N);if(typeof H!="string"||(X&&(H=I(H,L,Y)),S))return H;for(var tt="",V=H.length,K=0;K<V;K++){var lt=C(H,K);if(lt==='"'){var Ct=b(H,++K).end-1,Et=k(H,K,Ct);tt+=k(Et,0,G)===U?F[k(Et,G)]:'"'+Et+'"',K=Ct}else tt+=lt}return tt}})},2731(n,t,e){var i=e(6518),r=e(9306),s=e(2248),o=e(6395),l=s.get,h=s.has,c=s.set;i({target:"Map",proto:!0,real:!0,forced:o},{getOrInsertComputed:function(u,f){var g=h(this,u);if(r(f),g)return l(this,u);u===0&&1/u===-1/0&&(u=0);var m=f(u);return c(this,u,m),m}})},5367(n,t,e){var i=e(6518),r=e(2248),s=e(6395),o=r.get,l=r.has,h=r.set;i({target:"Map",proto:!0,real:!0,forced:s},{getOrInsert:function(d,u){return l(this,d)?o(this,d):(h(this,d,u),u)}})},4628(n,t,e){var i=e(6518),r=e(6043);i({target:"Promise",stat:!0},{withResolvers:function(){var o=r.f(this);return{promise:o.promise,resolve:o.resolve,reject:o.reject}}})},6069(n,t,e){var i=e(6518),r=e(9504),s=e(3463),o=e(9297),l=e(533).start,h=e(7452),c=Array,d=RegExp.escape,u=r("".charAt),f=r("".charCodeAt),g=r(1.1.toString),m=r([].join),y=/^[0-9a-z]/i,b=/^[$()*+./?[\\\]^{|}]/,x=RegExp("^[!\"#%&',\\-:;<=>@`~"+h+"]"),E=r(y.exec),S={" ":"t","\n":"n","\v":"v","\f":"f","\r":"r"},T=function(A){var P=g(f(A,0),16);return P.length<3?"\\x"+l(P,2,"0"):"\\u"+l(P,4,"0")};i({target:"RegExp",stat:!0,forced:!d||d("ab")!=="\\x61b"},{escape:function(P){s(P);for(var C=P.length,M=c(C),I=0;I<C;I++){var k=u(P,I);if(I===0&&E(y,k))M[I]=T(k);else if(o(S,k))M[I]="\\"+S[k];else if(E(b,k))M[I]="\\"+k;else if(E(x,k))M[I]=T(k);else{var O=f(k,0);(O&63488)!==55296?M[I]=k:O>=56320||I+1>=C||(f(P,I+1)&64512)!==56320?M[I]=T(k):(M[I]=k,M[++I]=u(P,I))}}return m(M,"")}})},7642(n,t,e){var i=e(6518),r=e(3440),s=e(9039);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("difference",function(o){return o.size===0})||s(function(){var o={size:1,has:function(){return!0},keys:function(){var h=0;return{next:function(){var c=h++>1;return l.has(1)&&l.clear(),{done:c,value:2}}}}},l=new Set([1,2,3,4]);return l.difference(o).size!==3})},{difference:r})},8004(n,t,e){var i=e(6518),r=e(9039),s=e(8750);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||r(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"})},{intersection:s})},3853(n,t,e){var i=e(6518),r=e(4449);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isDisjointFrom",function(s){return!s})},{isDisjointFrom:r})},5876(n,t,e){var i=e(6518),r=e(3838);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSubsetOf",function(s){return s})},{isSubsetOf:r})},2475(n,t,e){var i=e(6518),r=e(8527);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("isSupersetOf",function(s){return!s})},{isSupersetOf:r})},5024(n,t,e){var i=e(6518),r=e(3650),s=e(9835);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:r})},1698(n,t,e){var i=e(6518),r=e(4204),s=e(9835);i({target:"Set",proto:!0,real:!0,forced:!e(4916)("union")||!s("union")},{union:r})},9577(n,t,e){var i=e(4644),r=e(1108),s=e(6198),o=e(1291),l=e(5854),h=i.aTypedArray,c=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,u=RangeError,f=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(m){return m===8}})(),g=f&&(function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}})();d("with",function(m,y){var b=h(this),x=s(b),E=o(m),S=E<0?x+E:E,T=r(b)?l(y):+y;if(S>=x||S<0)throw new u("Incorrect index");for(var A=new(c(b))(x),P=0;P<x;P++)A[P]=P===S?T:b[P];return A},!f||g)},9452(n,t,e){var i=e(6518),r=e(9306),s=e(6557),o=e(4328),l=e(4995),h=e(6395),c=l.get,d=l.has,u=l.set;i({target:"WeakMap",proto:!0,real:!0,forced:h||!(function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(f){return f instanceof TypeError}})()},{getOrInsertComputed:function(g,m){if(h||s(this),o(g),r(m),d(this,g))return c(this,g);var y=m(g);return u(this,g,y),y}})},8454(n,t,e){var i=e(6518),r=e(4995),s=e(6395),o=r.get,l=r.has,h=r.set;i({target:"WeakMap",proto:!0,real:!0,forced:s},{getOrInsert:function(d,u){return l(this,d)?o(this,d):(h(this,d,u),u)}})},4603(n,t,e){var i=e(6840),r=e(9504),s=e(655),o=e(2812),l=URLSearchParams,h=l.prototype,c=r(h.append),d=r(h.delete),u=r(h.forEach),f=r([].push),g=new l("a=1&a=2&b=3");g.delete("a",1),g.delete("b",void 0),g+""!="a=2"&&i(h,"delete",function(m){var y=arguments.length,b=y<2?void 0:arguments[1];if(y&&b===void 0)return d(this,m);var x=[];u(this,function(C,M){f(x,{key:M,value:C})}),o(y,1);for(var E=s(m),S=s(b),T=0,A=x.length,P;T<A;)P=x[T],d(this,P.key),T++;for(T=0;T<A;)P=x[T++],P.key===E&&P.value===S||c(this,P.key,P.value)},{enumerable:!0,unsafe:!0})},7566(n,t,e){var i=e(6840),r=e(9504),s=e(655),o=e(2812),l=URLSearchParams,h=l.prototype,c=r(h.getAll),d=r(h.has),u=new l("a=1");(u.has("a",2)||!u.has("a",void 0))&&i(h,"has",function(g){var m=arguments.length,y=m<2?void 0:arguments[1];if(m&&y===void 0)return d(this,g);var b=c(this,g);o(m,1);for(var x=s(y),E=0;E<b.length;)if(b[E++]===x)return!0;return!1},{enumerable:!0,unsafe:!0})},8721(n,t,e){var i=e(3724),r=e(9504),s=e(2106),o=URLSearchParams.prototype,l=r(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var c=0;return l(this,function(){c++}),c},configurable:!0,enumerable:!0})},5781(n,t,e){var i=e(6518),r=e(7751),s=e(2812),o=e(655),l=e(7416),h=r("URL");i({target:"URL",stat:!0,forced:!l},{parse:function(d){var u=s(arguments.length,1),f=o(d),g=u<2||arguments[1]===void 0?void 0:o(arguments[1]);try{return new h(f,g)}catch{return null}}})}},Rw={},Mt.d=(n,t)=>{for(var e in t)Mt.o(t,e)&&!Mt.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},Mt.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),Mt(4114),Mt(6573),Mt(8100),Mt(7936),Mt(8111),Mt(2489),Mt(7588),Mt(1701),Mt(3110),Mt(5367),Mt(2731),Mt(4628),Mt(6069),Mt(7642),Mt(8004),Mt(3853),Mt(5876),Mt(2475),Mt(5024),Mt(1698),Mt(9577),{AbortException:cT,AnnotationEditorLayer:dT,AnnotationEditorParamsType:eO,AnnotationEditorType:pn,AnnotationEditorUIManager:uT,AnnotationLayer:fT,AnnotationMode:Di,AnnotationType:Ow,applyOpacity:nO,build:iO,ColorPicker:rO,createValidAbsoluteUrl:Lw,CSSConstants:sO,DOMSVGFactory:aO,DrawLayer:pT,FeatureTest:Dw,fetchData:Fw,findContrastColor:oO,getDocument:lO,getFilenameFromUrl:hO,getPdfFilenameFromUrl:gT,getRGB:cO,getRGBA:dO,getUuid:uO,GlobalWorkerOptions:fO,ImageKind:pO,InvalidPDFException:gO,isDataScheme:mO,isPdfFile:mT,isValidExplicitDest:vT,makeArr:yT,makeMap:bT,makeObj:vO,MathClamp:wT,noContextMenu:yO,normalizeUnicode:xT,OPS:bO,OutputScale:ku,PasswordResponses:wO,PDFDataRangeTransport:xO,PDFDateString:EO,PDFWorker:AO,PermissionFlag:Wo,PixelsPerInch:hr,RenderingCancelledException:km,renderRichText:SO,ResponseException:TO,setLayerDimensions:Nw,shadow:qh,SignatureExtractor:PO,stopEvent:Rm,SupportedImageMimeTypes:CO,TextLayer:ET,TextLayerImages:AT,TouchManager:MO,updateUrlHash:ST,Util:Om,VerbosityLevel:IO,version:_w,XfaLayer:Bw}=globalThis.pdfjsLib,mi={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7},Mt(4423),Mt(4603),Mt(7566),Mt(8721),TT="auto",Ww=1,jw=1.1,PT=.1,CT=25,Lm=0,MT=1.25,Uw=40,$w=5,Uo={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Fi={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},Pt={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Xe={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},Hw=/[\x00-\x1F]/g,new Promise(function(n){window.requestAnimationFrame(n)}),IT=document.documentElement.style,$o=new WeakMap,tc=new WeakMap,Ho=new WeakMap,Ru=new WeakMap,ec=new WeakMap,kT=class{constructor(n){w(this,$o,null),w(this,tc,null),w(this,Ho,0),w(this,Ru,null),w(this,ec,!0),p($o,this,n.classList),p(Ru,this,n.style)}get percent(){return a(Ho,this)}set percent(n){if(p(Ho,this,n),isNaN(n)){a($o,this).add("indeterminate");return}a($o,this).remove("indeterminate"),a(Ru,this).setProperty("--progressBar-percent",`${a(Ho,this)}%`)}setWidth(n){if(!n)return;const t=n.parentNode.offsetWidth-n.offsetWidth;t>0&&a(Ru,this).setProperty("--progressBar-end-offset",`${t}px`)}setDisableAutoFetch(n=5e3){a(Ho,this)===100||isNaN(a(Ho,this))||(a(tc,this)&&clearTimeout(a(tc,this)),this.show(),p(tc,this,setTimeout(()=>{p(tc,this,null),this.hide()},n)))}hide(){a(ec,this)&&(p(ec,this,!1),a($o,this).add("hidden"))}show(){a(ec,this)||(p(ec,this,!0),a($o,this).remove("hidden"))}},Ou=(function(){const n=document.createElement("div");return n.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",n.style.width==="calc(1320px)"?Math.fround:t=>t})(),Vw="9556e50a-f4f8-4f57-9831-f9ddff0176eb",sn=Object.freeze({internal:Vw}),Qr={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},zw={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},Gw=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]),RT=/\p{M}+/gu,OT=/([+^$|])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu,LT=/(\P{M})\p{M}*$/u,DT=/^\p{M}*(\P{M})/u,FT=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Yw=new Map,NT="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",Kw=new Map,Dm=null,Fm=null,Pe=new WeakMap,Lu=new WeakMap,Nm=new WeakMap,Vo=new WeakMap,qr=new WeakMap,ta=new WeakMap,yt=new WeakSet,Zw=class{constructor({linkService:n,eventBus:t,delay:e=250,updateMatchesCountOnProgress:i=!0}){ot(this,yt),w(this,Pe,null),w(this,Lu,!0),w(this,Nm,0),w(this,Vo,0),w(this,qr,null),w(this,ta,null),this._linkService=n,this._eventBus=t,p(Lu,this,i),p(Nm,this,e),this.onIsPageVisible=null,v(yt,this,A1).call(this),t.on("find",v(yt,this,zk).bind(this),sn),t.on("findbarclose",v(yt,this,Qk).bind(this),sn),t.on("pagesedited",v(yt,this,Jk).bind(this),sn)}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return a(Pe,this)}setDocument(n){this._pdfDocument&&v(yt,this,A1).call(this),n&&(this._pdfDocument=n,this._firstPageCapability.resolve())}scrollMatchIntoView({element:n=null,pageIndex:t=-1,matchIndex:e=-1}){if(!(!this._scrollMatches||!n)){{if(e===-1||e!==this._selected.matchIdx)return;if(t===-1||t!==this._selected.pageIdx)return}this._scrollMatches=!1,n.scrollIntoView({block:"start",inline:"center"})}}match(n,t,e){const i=this._hasDiacritics[e];let r=!1;if(typeof n=="string"?[r,n]=v(yt,this,T1).call(this,n,i):n=n.sort().reverse().map(c=>{const[d,u]=v(yt,this,T1).call(this,c,i);return r||(r=d),`(${u})`}).join("|"),!n)return;const{caseSensitive:s,entireWord:o}=a(Pe,this);n=new RegExp(n,`g${r?"u":""}${s?"":"i"}`);const l=[];let h;for(;(h=n.exec(t))!==null;)o&&!v(yt,this,Xk).call(this,t,h.index,h[0].length)||l.push({index:h.index,length:h[0].length});return l}},Mt(9112),Mt(5781),_T="noopener noreferrer nofollow",ea={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},_m=class{constructor({eventBus:n,externalLinkTarget:t=null,externalLinkRel:e=null,ignoreDestinationZoom:i=!1}={}){D(this,"externalLinkEnabled",!0),this.eventBus=n,this.externalLinkTarget=t,this.externalLinkRel=e,this._ignoreDestinationZoom=i,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(n,t=null){this.baseUrl=t,this.pdfDocument=n}setViewer(n){this.pdfViewer=n}setHistory(n){this.pdfHistory=n}get pagesCount(){return this.pdfDocument?.pagesMapper.pagesNumber||0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(n){this.pdfDocument&&(this.pdfViewer.currentPageNumber=n)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(n){this.pdfDocument&&(this.pdfViewer.pagesRotation=n)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(n){if(!this.pdfDocument)return;let t,e,i;if(typeof n=="string"?(t=n,e=await this.pdfDocument.getDestination(n)):(t=null,e=await n),!Array.isArray(e)){console.error(`goToDestination: "${e}" is not a valid destination array, for dest="${n}".`);return}const[r]=e;if(r&&typeof r=="object"){if(i=this.pdfDocument.cachedPageNumber(r),!i)try{i=await this.pdfDocument.getPageIndex(r)+1}catch{console.error(`goToDestination: "${r}" is not a valid page reference, for dest="${n}".`);return}}else Number.isInteger(r)&&(i=r+1);if(!i||i<1||i>this.pagesCount){console.error(`goToDestination: "${i}" is not a valid page number, for dest="${n}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:e,pageNumber:i})),this.pdfViewer.scrollPageIntoView({pageNumber:i,destArray:e,ignoreDestinationZoom:this._ignoreDestinationZoom});const s=new AbortController;this.eventBus.on("textlayerrendered",o=>{o.pageNumber===i&&(o.source.textLayer.div.focus(),s.abort())},{signal:s.signal,...sn})}goToPage(n){if(!this.pdfDocument)return;const t=typeof n=="string"&&this.pdfViewer.pageLabelToPageNumber(n)||n|0;if(!(Number.isInteger(t)&&t>0&&t<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${n}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})}goToXY(n,t,e,i={}){this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:[null,{name:"XYZ"},t,e],ignoreDestinationZoom:!0,...i})}addLinkAttributes(n,t,e=!1){if(!t||typeof t!="string")throw new Error('A valid "url" parameter must provided.');const i=e?ea.BLANK:this.externalLinkTarget,r=this.externalLinkRel;let s=t;const o=URL.parse(t);(o?.username||o?.password)&&(o.username=o.password="",s=o.href),this.externalLinkEnabled?(n.href=t,n.title=s):(n.href="",n.title=`Disabled: ${s}`,n.onclick=()=>!1);let l="";switch(i){case ea.NONE:break;case ea.SELF:l="_self";break;case ea.BLANK:l="_blank";break;case ea.PARENT:l="_parent";break;case ea.TOP:l="_top";break}n.target=l,n.rel=typeof r=="string"?r:_T}getDestinationHash(n){if(typeof n=="string"){if(n.length>0)return this.getAnchorUrl("#"+escape(n))}else if(Array.isArray(n)){const t=JSON.stringify(n);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(n){return this.baseUrl?this.baseUrl+n:n}setHash(n){if(!this.pdfDocument)return;let t,e;if(n.includes("=")){const i=xm(n);if(i.has("search")){const r=i.get("search").replaceAll('"',""),s=i.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:s?r:r.match(/\S+/g)})}if(i.has("page")&&(t=i.get("page")|0||1),i.has("zoom")){const r=i.get("zoom").split(","),s=r[0],o=parseFloat(s);s.includes("Fit")?s==="Fit"||s==="FitB"?e=[null,{name:s}]:s==="FitH"||s==="FitBH"||s==="FitV"||s==="FitBV"?e=[null,{name:s},r.length>1?r[1]|0:null]:s==="FitR"?r.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):e=[null,{name:s},r[1]|0,r[2]|0,r[3]|0,r[4]|0]:console.error(`PDFLinkService.setHash: "${s}" is not a valid zoom value.`):e=[null,{name:"XYZ"},r.length>1?r[1]|0:null,r.length>2?r[2]|0:null,o?o/100:s]}e?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:e,allowNegativeOffset:!0}):t&&(this.page=t),i.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:i.get("pagemode")}),i.has("nameddest")&&this.goToDestination(i.get("nameddest"));return}e=unescape(n);try{e=JSON.parse(e),Array.isArray(e)||(e=e.toString())}catch{}if(typeof e=="string"||vT(e)){this.goToDestination(e);return}console.error(`PDFLinkService.setHash: "${unescape(n)}" is not a valid destination.`)}executeNamedAction(n){if(this.pdfDocument){switch(n){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.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;default:break}this.eventBus.dispatch("namedaction",{source:this,action:n})}}async executeSetOCGState(n){if(!this.pdfDocument)return;const t=this.pdfDocument,e=await this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(e.setOCGState(n),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(e))}},Bm=class extends _m{setDocument(n,t=null){}},zo=new WeakMap,Wm=new WeakMap,jm=new WeakMap,Um=new WeakMap,Go=new WeakMap,$m=new WeakMap,nc=new WeakSet,Jw=class{constructor({pdfPage:n,linkService:t,downloadManager:e,annotationStorage:i=null,imageResourcesPath:r="",renderForms:s=!0,enableComment:o=!1,commentManager:l=null,enableScripting:h=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:d=null,annotationCanvasMap:u=null,accessibilityManager:f=null,annotationEditorUIManager:g=null,onAppend:m=null}){ot(this,nc),w(this,zo,null),w(this,Wm,null),w(this,jm,!1),w(this,Um,null),w(this,Go,null),w(this,$m,!1),this.pdfPage=n,this.linkService=t,this.downloadManager=e,this.imageResourcesPath=r,this.renderForms=s,this.annotationStorage=i,this.enableComment=o,p(Wm,this,l),this.enableScripting=h,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=d||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=f,this._annotationEditorUIManager=g,p(Um,this,m),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}async render({viewport:n,intent:t="display",structTreeLayer:e=null,optionalContentConfigPromise:i=null}){if(this.div){const c=await i;if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:n.clone({dontFlip:!0}),optionalContentConfig:c});return}const[r,s,o,l]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise,i]);if(this._cancelled)return;const h=this.div=document.createElement("div");if(h.className="annotationLayer",a(Um,this)?.call(this,h),v(nc,this,qk).call(this,n,e),r.length===0){p(zo,this,r),Nw(this.div,n);return}await this.annotationLayer.render({annotations:r,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,downloadManager:this.downloadManager,enableComment:this.enableComment,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:o,optionalContentConfig:l}),p(zo,this,r),this.linkService.isInPresentationMode&&v(nc,this,k1).call(this,Uo.FULLSCREEN),a(Go,this)||(p(Go,this,new AbortController),this._eventBus?.on("presentationmodechanged",c=>{v(nc,this,k1).call(this,c.state)},{signal:a(Go,this).signal,...sn}))}cancel(){this._cancelled=!0,a(Go,this)?.abort(),p(Go,this,null)}hide(n=!1){p(jm,this,!n),this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}async injectLinkAnnotations(n){if(a(zo,this)===null)throw new Error("`render` method must be called before `injectLinkAnnotations`.");if(this._cancelled||a($m,this))return;p($m,this,!0);const t=a(zo,this).length?v(nc,this,tR).call(this,n):n;t.length&&(await this.annotationLayer.addLinkAnnotations(t),a(jm,this)||(this.div.hidden=!1))}},Mt(8454),Mt(9452),Hm=new WeakMap,BT=class{constructor(){w(this,Hm,new WeakMap)}_triggerDownload(n,t,e,i=!1){throw new Error("Not implemented: _triggerDownload")}_getOpenDataUrl(n,t,e=null){throw new Error("Not implemented: _getOpenDataUrl")}downloadData(n,t,e){const i=URL.createObjectURL(new Blob([n],{type:e}));this._triggerDownload(i,i,t,!0)}openOrDownloadData(n,t,e=null){const i=mT(t),r=i?"application/pdf":"";if(i){const s=a(Hm,this).getOrInsertComputed(n,()=>URL.createObjectURL(new Blob([n],{type:r})));try{const o=this._getOpenDataUrl(s,t,e);return window.open(o),!0}catch(o){console.error("openOrDownloadData:",o),URL.revokeObjectURL(s),a(Hm,this).delete(n)}}return this.downloadData(n,t,r),!1}download(n,t,e){const i=n?URL.createObjectURL(new Blob([n],{type:"application/pdf"})):null;this._triggerDownload(i,t,e)}},WT=class extends BT{_triggerDownload(n,t,e,i=!1){if(!n&&!i){if(!Lw(t,"http://example.com"))throw new Error(`_triggerDownload - not a valid URL: ${t}`);n=t+"#pdfjs.action=download"}const r=document.createElement("a");r.href=n,r.target="_parent","download"in r&&(r.download=e),(document.body||document.documentElement).append(r),r.click(),r.remove()}_getOpenDataUrl(n,t,e=null){throw new Error("Opening data is not supported in `COMPONENTS` builds.")}},Qw={EVENT:"event",TIMEOUT:"timeout"},Du=new WeakMap,Fu=class{constructor(){w(this,Du,Object.create(null)),Object.seal(this)}on(n,t,e=null){var i;let r=null;if(e?.signal instanceof AbortSignal){const{signal:s}=e;if(s.aborted){console.error("Cannot use an `aborted` signal.");return}const o=()=>this.off(n,t);r=()=>s.removeEventListener("abort",o),s.addEventListener("abort",o)}((i=a(Du,this))[n]??(i[n]=[])).push({listener:t,internal:e?.internal===Vw,once:e?.once===!0,rmAbort:r})}off(n,t,e=null){const i=a(Du,this)[n];if(i)for(let r=0,s=i.length;r<s;r++){const o=i[r];if(o.listener===t){o.rmAbort?.(),i.splice(r,1);return}}}dispatch(n,t){const e=a(Du,this)[n];if(!e?.length)return;let i;for(const{listener:r,internal:s,once:o}of e.slice(0)){if(o&&this.off(n,r),!s){(i??(i=[])).push(r);continue}r(t)}if(i)for(const r of i)r(t)}},Xo=class{constructor(n){this.value=n}valueOf(){return this.value}},ye=class extends Xo{constructor(n="???"){super(n)}toString(n){return`{${this.value}}`}},cr=class extends Xo{constructor(n,t={}){super(n),this.opts=t}toString(n){if(n)try{return n.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){n.reportError(t)}return this.value.toString(10)}},ic=class Bx extends Xo{static supportsValue(t){if(typeof t=="number"||t instanceof Date)return!0;if(t instanceof Xo)return Bx.supportsValue(t.valueOf());if("Temporal"in globalThis){const e=globalThis.Temporal;if(t instanceof e.Instant||t instanceof e.PlainDateTime||t instanceof e.PlainDate||t instanceof e.PlainMonthDay||t instanceof e.PlainTime||t instanceof e.PlainYearMonth)return!0}return!1}constructor(t,e={}){t instanceof Bx?(e={...t.opts,...e},t=t.value):t instanceof Xo&&(t=t.valueOf()),typeof t=="object"&&"calendarId"in t&&e.calendar===void 0&&(e={...e,calendar:t.calendarId}),super(t),this.opts=e}[Symbol.toPrimitive](t){return t==="string"?this.toString():this.toNumber()}toNumber(){const t=this.value;if(typeof t=="number")return t;if(t instanceof Date)return t.getTime();if("epochMilliseconds"in t)return t.epochMilliseconds;if("toZonedDateTime"in t)return t.toZonedDateTime("UTC").epochMilliseconds;throw new TypeError("Unwrapping a non-number value as a number")}toString(t){if(t)try{return t.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return typeof this.value=="number"||this.value instanceof Date?new Date(this.value).toISOString():this.value.toString()}},qw=100,jT="⁨",UT="⁩",$T=class{constructor(n,t,e){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=n,this.errors=t,this.args=e}reportError(n){if(!this.errors||!(n instanceof Error))throw n;this.errors.push(n)}memoizeIntlObject(n,t){let e=this.bundle._intls.get(n);e||(e={},this.bundle._intls.set(n,e));let i=JSON.stringify(t);return e[i]||(e[i]=new n(this.bundle.locales,t)),e[i]}},tx=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"],HT=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"],ex=new Map,VT=class{constructor(n,{functions:t,useIsolating:e=!0,transform:i=r=>r}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(n)?n:[n],this._functions={NUMBER:lR,DATETIME:hR,...t},this._useIsolating=e,this._transform=i,this._intls=cR(n)}hasMessage(n){return this._messages.has(n)}getMessage(n){return this._messages.get(n)}addResource(n,{allowOverrides:t=!1}={}){const e=[];for(let i=0;i<n.body.length;i++){let r=n.body[i];if(r.id.startsWith("-")){if(t===!1&&this._terms.has(r.id)){e.push(new Error(`Attempt to override an existing term: "${r.id}"`));continue}this._terms.set(r.id,r)}else{if(t===!1&&this._messages.has(r.id)){e.push(new Error(`Attempt to override an existing message: "${r.id}"`));continue}this._messages.set(r.id,r)}}return e}formatPattern(n,t=null,e=null){if(typeof n=="string")return this._transform(n);let i=new $T(this,e,t);try{return O1(i,n).toString(i)}catch(r){if(i.errors&&r instanceof Error)return i.errors.push(r),new ye().toString(i);throw r}}},Vm=/^(-?[a-zA-Z][\w-]*) *= */gm,nx=/\.([a-zA-Z][\w-]*) *= */y,zT=/\*?\[/y,zm=/(-?[0-9]+(?:\.([0-9]+))?)/y,GT=/([a-zA-Z][\w-]*)/y,ix=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,XT=/^[A-Z][A-Z0-9_-]*$/,Nu=/([^{}\n\r]+)/y,YT=/([^\\"\n\r]*)/y,rx=/\\([\\"])/y,sx=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,KT=/^\n+/,ax=/ +$/,ZT=/ *\r?\n/g,JT=/( *)$/,QT=/{\s*/y,ox=/\s*}/y,qT=/\[\s*/y,tP=/\s*] */y,eP=/\s*\(\s*/y,nP=/\s*->\s*/y,iP=/\s*:\s*/y,rP=/\s*,?\s*/y,sP=/\s+/y,aP=class{constructor(n){this.body=[],Vm.lastIndex=0;let t=0;for(;;){let M=Vm.exec(n);if(M===null)break;t=Vm.lastIndex;try{this.body.push(l(M[1]))}catch(I){if(I instanceof SyntaxError)continue;throw I}}function e(M){return M.lastIndex=t,M.test(n)}function i(M,I){if(n[t]===M)return t++,!0;if(I)throw new I(`Expected ${M}`);return!1}function r(M,I){if(e(M))return t=M.lastIndex,!0;if(I)throw new I(`Expected ${M.toString()}`);return!1}function s(M){M.lastIndex=t;let I=M.exec(n);if(I===null)throw new SyntaxError(`Expected ${M.toString()}`);return t=M.lastIndex,I}function o(M){return s(M)[1]}function l(M){let I=c(),k=h();if(I===null&&Object.keys(k).length===0)throw new SyntaxError("Expected message value or attributes");return{id:M,value:I,attributes:k}}function h(){let M=Object.create(null);for(;e(nx);){let I=o(nx),k=c();if(k===null)throw new SyntaxError("Expected attribute value");M[I]=k}return M}function c(){let M;if(e(Nu)&&(M=o(Nu)),n[t]==="{"||n[t]==="}")return d(M?[M]:[],1/0);let I=A();return I?M?d([M,I],I.length):(I.value=P(I.value,KT),d([I],I.length)):M?P(M,ax):null}function d(M=[],I){for(;;){if(e(Nu)){M.push(o(Nu));continue}if(n[t]==="{"){M.push(u());continue}if(n[t]==="}")throw new SyntaxError("Unbalanced closing brace");let L=A();if(L){M.push(L),I=Math.min(I,L.length);continue}break}let k=M.length-1,O=M[k];typeof O=="string"&&(M[k]=P(O,ax));let B=[];for(let L of M)L instanceof lx&&(L=L.value.slice(0,L.value.length-I)),L&&B.push(L);return B}function u(){r(QT,SyntaxError);let M=f();if(r(ox))return M;if(r(nP)){let I=y();return r(ox,SyntaxError),{type:"select",selector:M,...I}}throw new SyntaxError("Unclosed placeable")}function f(){if(n[t]==="{")return u();if(e(ix)){let[,M,I,k=null]=s(ix);if(M==="$")return{type:"var",name:I};if(r(eP)){let O=g();if(M==="-")return{type:"term",name:I,attr:k,args:O};if(XT.test(I))return{type:"func",name:I,args:O};throw new SyntaxError("Function names must be all upper-case")}return M==="-"?{type:"term",name:I,attr:k,args:[]}:{type:"mesg",name:I,attr:k}}return x()}function g(){let M=[];for(;;){switch(n[t]){case")":return t++,M;case void 0:throw new SyntaxError("Unclosed argument list")}M.push(m()),r(rP)}}function m(){let M=f();return M.type!=="mesg"?M:r(iP)?{type:"narg",name:M.name,value:x()}:M}function y(){let M=[],I=0,k;for(;e(zT);){i("*")&&(k=I);let O=b(),B=c();if(B===null)throw new SyntaxError("Expected variant value");M[I++]={key:O,value:B}}if(I===0)return null;if(k===void 0)throw new SyntaxError("Expected default variant");return{variants:M,star:k}}function b(){r(qT,SyntaxError);let M;return e(zm)?M=E():M={type:"str",value:o(GT)},r(tP,SyntaxError),M}function x(){if(e(zm))return E();if(n[t]==='"')return S();throw new SyntaxError("Invalid expression")}function E(){let[,M,I=""]=s(zm),k=I.length;return{type:"num",value:parseFloat(M),precision:k}}function S(){i('"',SyntaxError);let M="";for(;;){if(M+=o(YT),n[t]==="\\"){M+=T();continue}if(i('"'))return{type:"str",value:M};throw new SyntaxError("Unclosed string literal")}}function T(){if(e(rx))return o(rx);if(e(sx)){let[,M,I]=s(sx),k=parseInt(M||I,16);return k<=55295||57344<=k?String.fromCodePoint(k):"�"}throw new SyntaxError("Unknown escape sequence")}function A(){let M=t;switch(r(sP),n[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return C(n.slice(M,t))}return n[t-1]===" "?C(n.slice(M,t)):!1}function P(M,I){return M.replace(I,"")}function C(M){let I=M.replace(ZT,`
587
+ `),k=JT.exec(M)[1].length;return new lx(I,k)}}},lx=class{constructor(n,t){this.value=n,this.length=t}},oP=/<|&#?\w+;/,lP={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},hP={"http://www.w3.org/1999/xhtml":{global:["title","aria-description","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}},cP=class extends Array{static from(n){return n instanceof this?n:new this(n)}},dP=class extends cP{constructor(n){if(super(),Symbol.asyncIterator in Object(n))this.iterator=n[Symbol.asyncIterator]();else if(Symbol.iterator in Object(n))this.iterator=n[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const n=this;let t=0;return{async next(){return n.length<=t&&n.push(n.iterator.next()),n[t++]}}}async touchNext(n=1){let t=0;for(;t++<n;){const e=this[this.length-1];if(e&&(await e).done)break;this.push(this.iterator.next())}return this[this.length-1]}},uP=class{constructor(n=[],t){this.resourceIds=n,this.generateBundles=t,this.onChange(!0)}addResourceIds(n,t=!1){return this.resourceIds.push(...n),this.onChange(t),this.resourceIds.length}removeResourceIds(n){return this.resourceIds=this.resourceIds.filter(t=>!n.includes(t)),this.onChange(),this.resourceIds.length}async formatWithFallback(n,t){const e=[];let i=!1;for await(const r of this.bundles){i=!0;const s=bR(t,r,n,e);if(s.size===0)break;if(typeof console<"u"){const o=r.locales[0],l=Array.from(s).join(", ");console.warn(`[fluent] Missing translations in ${o}: ${l}`)}}return!i&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
588
+ keys: ${JSON.stringify(n)}.
589
+ resourceIds: ${JSON.stringify(this.resourceIds)}.`),e}formatMessages(n){return this.formatWithFallback(n,yR)}formatValues(n){return this.formatWithFallback(n,vR)}async formatValue(n,t){const[e]=await this.formatValues([{id:n,args:t}]);return e}handleEvent(){this.onChange()}onChange(n=!1){this.bundles=dP.from(this.generateBundles(this.resourceIds)),n&&this.bundles.touchNext(2)}},na="data-l10n-id",rc="data-l10n-args",fP=`[${na}]`,pP=class extends uP{constructor(n,t){super(n,t),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[na,rc]}}onChange(n=!1){super.onChange(n),this.roots&&this.translateRoots()}setAttributes(n,t,e){return n.setAttribute(na,t),e?n.setAttribute(rc,JSON.stringify(e)):n.removeAttribute(rc),n}getAttributes(n){return{id:n.getAttribute(na),args:JSON.parse(n.getAttribute(rc)||null)}}connectRoot(n){for(const t of this.roots)if(t===n||t.contains(n)||n.contains(t))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==n.ownerDocument.defaultView)throw new Error(`Cannot connect a root:
590
+ DOMLocalization already has a root from a different window.`)}else this.windowElement=n.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(t=>this.translateMutations(t));this.roots.add(n),this.mutationObserver.observe(n,this.observerConfig)}disconnectRoot(n){return this.roots.delete(n),this.pauseObserving(),this.roots.size===0?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){const n=Array.from(this.roots);return Promise.all(n.map(t=>this.translateFragment(t)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const n of this.roots)this.mutationObserver.observe(n,this.observerConfig)}translateMutations(n){for(const t of n)switch(t.type){case"attributes":t.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(t.target);break;case"childList":for(const e of t.addedNodes)if(e.nodeType===e.ELEMENT_NODE)if(e.childElementCount)for(const i of this.getTranslatables(e))this.pendingElements.add(i);else e.hasAttribute(na)&&this.pendingElements.add(e);break}this.pendingElements.size>0&&this.pendingrAF===null&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(n){return this.translateElements(this.getTranslatables(n))}async translateElements(n){if(!n.length)return;const t=n.map(this.getKeysForElement),e=await this.formatMessages(t);return this.applyTranslations(n,e)}applyTranslations(n,t){this.pauseObserving();for(let e=0;e<n.length;e++)t[e]!==void 0&&dR(n[e],t[e]);this.resumeObserving()}getTranslatables(n){const t=Array.from(n.querySelectorAll(fP));return typeof n.hasAttribute=="function"&&n.hasAttribute(na)&&t.push(n),t}getKeysForElement(n){return{id:n.getAttribute(na),args:JSON.parse(n.getAttribute(rc)||null)}}},Gm=new WeakMap,ia=new WeakMap,_u=new WeakMap,Gn=new WeakMap,gP=class Wx{constructor({lang:t,isRTL:e},i=null){w(this,Gm,void 0),w(this,ia,void 0),w(this,_u,void 0),w(this,Gn,void 0),p(_u,this,wR.call(Wx,t)),p(Gn,this,i),p(Gm,this,e??xR.call(Wx,a(_u,this))?"rtl":"ltr")}_setL10n(t){p(Gn,this,t)}getLanguage(){return a(_u,this)}getDirection(){return a(Gm,this)}async get(t,e=null,i){return Array.isArray(t)?(t=t.map(r=>({id:r})),(await a(Gn,this).formatMessages(t)).map(r=>r.value)):(await a(Gn,this).formatMessages([{id:t,args:e}]))[0]?.value||i}async translate(t){(a(ia,this)||p(ia,this,new Set)).add(t);try{a(Gn,this).connectRoot(t),await a(Gn,this).translateRoots()}catch{}}async translateOnce(t){try{await a(Gn,this).translateElements([t])}catch(e){console.error("translateOnce:",e)}}async destroy(){if(a(ia,this)){for(const t of a(ia,this))a(Gn,this).disconnectRoot(t);a(ia,this).clear(),p(ia,this,null)}a(Gn,this).pauseObserving()}pause(){a(Gn,this).pauseObserving()}resume(){a(Gn,this).resumeObserving()}},Yo=class jx extends gP{constructor(t){super({lang:t});const e=t?AR.bind(jx,"en-us",this.getLanguage()):PR.bind(jx,this.getLanguage());this._setL10n(new pP([],e))}},Iu=Yo,mP=1e3,vP=50,yP=1e3,Ko=new WeakMap,Ft=new WeakSet,bP=class{constructor({linkService:n,eventBus:t}){ot(this,Ft),w(this,Ko,null),this.linkService=n,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus.on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus.on("pagesloaded",e=>{this._isPagesLoaded=!!e.pagesCount},{once:!0,...sn})},sn)}initialize({fingerprint:n,resetHistory:t=!1,updateUrl:e=!1}){if(!n||typeof n!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const i=this._fingerprint!==""&&this._fingerprint!==n;this._fingerprint=n,this._updateUrl=e===!0,this._initialized=!0,v(Ft,this,IR).call(this);const r=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=Ew(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!v(Ft,this,Pm).call(this,r,!0)||t){const{hash:o,page:l,rotation:h}=v(Ft,this,B1).call(this,!0);if(!o||i||t){v(Ft,this,qs).call(this,null,!0);return}v(Ft,this,qs).call(this,{hash:o,page:l,rotation:h},!0);return}const s=r.destination;v(Ft,this,Tw).call(this,s,r.uid,!0),s.rotation!==void 0&&(this._initialRotation=s.rotation),s.dest?(this._initialBookmark=JSON.stringify(s.dest),this._destination.page=null):s.hash?this._initialBookmark=s.hash:s.page&&(this._initialBookmark=`page=${s.page}`)}reset(){this._initialized&&(v(Ft,this,W1).call(this),this._initialized=!1,v(Ft,this,kR).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:n=null,explicitDest:t,pageNumber:e}){if(!this._initialized)return;if(n&&typeof n!="string"){console.error(`PDFHistory.push: "${n}" is not a valid namedDest parameter.`);return}else if(Array.isArray(t)){if(!v(Ft,this,Sw).call(this,e)&&(e!==null||this._destination)){console.error(`PDFHistory.push: "${e}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);return}const i=n||JSON.stringify(t);if(!i)return;let r=!1;if(this._destination&&(RR(this._destination.hash,i)||OR(this._destination.dest,t))){if(this._destination.page)return;r=!0}this._popStateInProgress&&!r||(v(Ft,this,qs).call(this,{dest:t,hash:i,page:e,rotation:this.linkService.rotation},r),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(n){if(this._initialized){if(!v(Ft,this,Sw).call(this,n)){console.error(`PDFHistory.pushPage: "${n}" is not a valid page number.`);return}this._destination?.page!==n&&(this._popStateInProgress||(v(Ft,this,qs).call(this,{dest:null,hash:`page=${n}`,page:n,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||v(Ft,this,Aw).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const n=window.history.state;v(Ft,this,Pm).call(this,n)&&n.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const n=window.history.state;v(Ft,this,Pm).call(this,n)&&n.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}},Xm=new WeakMap,Ym=new WeakMap,Km=new WeakMap,Zm=new WeakMap,Jm=new WeakMap,Bu=new WeakMap,wP=class{constructor(n){w(this,Xm,null),w(this,Ym,null),w(this,Km,null),w(this,Zm,null),w(this,Jm,null),w(this,Bu,void 0),this.pageIndex=n.pageIndex,this.accessibilityManager=n.accessibilityManager,this.l10n=n.l10n,this.l10n||(this.l10n=new Yo),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,p(Bu,this,n.uiManager),p(Xm,this,n.annotationLayer||null),p(Jm,this,n.textLayer||null),p(Ym,this,n.drawLayer||null),p(Km,this,n.onAppend||null),p(Zm,this,n.structTreeLayer||null)}updatePageIndex(n){this.pageIndex=n,this.annotationEditorLayer?.updatePageIndex(n)}async render({viewport:n,intent:t="display"}){if(t!=="display"||this._cancelled)return;const e=n.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:e}),this.show();return}const i=this.div=document.createElement("div");i.className="annotationEditorLayer",i.hidden=!0,i.dir=a(Bu,this).direction,a(Km,this)?.call(this,i),this.annotationEditorLayer=new dT({uiManager:a(Bu,this),div:i,structTreeLayer:a(Zm,this),accessibilityManager:this.accessibilityManager,pageIndex:this.pageIndex,l10n:this.l10n,viewport:e,annotationLayer:a(Xm,this),textLayer:a(Jm,this),drawLayer:a(Ym,this)});const r={viewport:e,div:i,annotations:null,intent:t};await this.annotationEditorLayer.render(r),this.show()}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.annotationEditorLayer.pause(!0),this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isInvisible||(this.div.hidden=!1,this.annotationEditorLayer.pause(!1))}};{Qm=new Map;const{maxTouchPoints:n,platform:t,userAgent:e}=navigator,i=/Android/.test(e);(/\b(?:iPad|iPhone|iPod)(?=;)/.test(e)||t==="MacIntel"&&n>1||i)&&Qm.set("maxCanvasPixels",5242880),i&&Qm.set("useSystemFonts",!1)}_={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},qm={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},dr={allowedGlobalEvents:{value:null,kind:_.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:_.BROWSER+_.API},isInAutomation:{value:!1,kind:_.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:_.BROWSER},maxCanvasDim:{value:32767,kind:_.BROWSER+_.VIEWER},nimbusDataStr:{value:"",kind:_.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:_.BROWSER},supportsDocumentFonts:{value:!0,kind:_.BROWSER},supportsIntegratedFind:{value:!1,kind:_.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:_.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:_.BROWSER},supportsPinchToZoom:{value:!0,kind:_.BROWSER},supportsPrinting:{value:!0,kind:_.BROWSER},toolbarDensity:{value:0,kind:_.BROWSER+_.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:_.VIEWER+_.PREFERENCE},annotationEditorMode:{value:0,kind:_.VIEWER+_.PREFERENCE},annotationMode:{value:2,kind:_.VIEWER+_.PREFERENCE},capCanvasAreaFactor:{value:200,kind:_.VIEWER+_.PREFERENCE},commentLearnMoreUrl:{value:"",kind:_.VIEWER+_.PREFERENCE},cursorToolOnLoad:{value:0,kind:_.VIEWER+_.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:_.VIEWER},defaultZoomDelay:{value:400,kind:_.VIEWER+_.PREFERENCE},defaultZoomValue:{value:"",kind:_.VIEWER+_.PREFERENCE},disableHistory:{value:!1,kind:_.VIEWER},disablePageLabels:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableAltText:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:_.VIEWER+_.PREFERENCE+_.EVENT_DISPATCH},enableAutoLinking:{value:!0,kind:_.VIEWER+_.PREFERENCE},enableComment:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableDetailCanvas:{value:!0,kind:_.VIEWER},enableGuessAltText:{value:!0,kind:_.VIEWER+_.PREFERENCE+_.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableMerge:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:_.VIEWER+_.PREFERENCE},enableNewBadge:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableOptimizedPartialRendering:{value:!1,kind:_.VIEWER+_.PREFERENCE},enablePermissions:{value:!1,kind:_.VIEWER+_.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:_.VIEWER+_.PREFERENCE},enableScripting:{value:!0,kind:_.VIEWER+_.PREFERENCE},enableSignatureEditor:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableSplitMerge:{value:!1,kind:_.VIEWER+_.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:_.VIEWER+_.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:_.VIEWER},externalLinkTarget:{value:0,kind:_.VIEWER+_.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043",kind:_.VIEWER+_.PREFERENCE},historyUpdateUrl:{value:!1,kind:_.VIEWER+_.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:_.VIEWER+_.PREFERENCE},imageResourcesPath:{value:"./images/",kind:_.VIEWER},enableSelectionRendering:{value:!0,kind:_.VIEWER+_.PREFERENCE},imagesRightClickMinSize:{value:-1,kind:_.VIEWER+_.PREFERENCE},maxCanvasPixels:{value:2**25,kind:_.VIEWER},minDurationToUpdateCanvas:{value:500,kind:_.VIEWER},forcePageColors:{value:!1,kind:_.VIEWER+_.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:_.VIEWER+_.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:_.VIEWER+_.PREFERENCE},pdfBugEnabled:{value:!1,kind:_.VIEWER+_.PREFERENCE},postMessageAfterPrintCallback:{value:!1,kind:_.VIEWER+_.PREFERENCE},printResolution:{value:150,kind:_.VIEWER},sidebarViewOnLoad:{value:-1,kind:_.VIEWER+_.PREFERENCE},scrollModeOnLoad:{value:-1,kind:_.VIEWER+_.PREFERENCE},spreadModeOnLoad:{value:-1,kind:_.VIEWER+_.PREFERENCE},textLayerMode:{value:1,kind:_.VIEWER+_.PREFERENCE},viewerCssTheme:{value:0,kind:_.VIEWER+_.PREFERENCE},viewOnLoad:{value:0,kind:_.VIEWER+_.PREFERENCE},cMapPacked:{value:!0,kind:_.API},cMapUrl:{value:"../web/cmaps/",kind:_.API},disableAutoFetch:{value:!1,kind:_.API+_.PREFERENCE},disableFontFace:{value:!1,kind:_.API+_.PREFERENCE},disableRange:{value:!1,kind:_.API+_.PREFERENCE},disableStream:{value:!1,kind:_.API+_.PREFERENCE},docBaseUrl:{value:"",kind:_.API},enableHWA:{value:!0,kind:_.API+_.PREFERENCE},enableWebGPU:{value:!0,kind:_.API+_.PREFERENCE},enableXfa:{value:!0,kind:_.API+_.PREFERENCE},fontExtraProperties:{value:!1,kind:_.API},iccUrl:{value:"../web/iccs/",kind:_.API},isOffscreenCanvasSupported:{value:!0,kind:_.API},maxImageSize:{value:-1,kind:_.API},pdfBug:{value:!1,kind:_.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:_.API},useSystemFonts:{value:void 0,kind:_.API,type:qm.BOOLEAN+qm.UNDEFINED},verbosity:{value:1,kind:_.API},wasmUrl:{value:"../web/wasm/",kind:_.API},workerPort:{value:null,kind:_.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:_.WORKER}},dr.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:_.VIEWER},dr.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:_.VIEWER},dr.enableFakeMLManager={value:!0,kind:_.VIEWER},dr.disablePreferences={value:!1,kind:_.VIEWER},sc=class Uv{static get(t){return v(Uv,this,ac)._.get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const r in dr){const s=dr[r];t&&!(t&s.kind)||(i[r]=e?s.value:v(Uv,this,ac)._.get(r))}return i}static set(t,e){this.setAll({[t]:e})}static setAll(t,e=!1){this._hasInvokedSet||(this._hasInvokedSet=!0);let i;for(const r in t){const s=dr[r],o=t[r];if(!s||!(typeof o==typeof s.value||qm[(typeof o).toUpperCase()]&s.type))continue;const{kind:l}=s;e&&!(l&_.BROWSER||l&_.PREFERENCE)||(this.eventBus&&l&_.EVENT_DISPATCH&&(i||(i=new Map)).set(r,o),v(Uv,this,ac)._.set(r,o))}if(i)for(const[r,s]of i)this.eventBus.dispatch(r.toLowerCase(),{source:this,value:s})}},Jr=sc,D(sc,"eventBus",void 0),ac={_:new Map},(()=>{for(const n in dr)v(Jr,Jr,ac)._.set(n,dr[n].value);for(const[n,t]of Qm)v(Jr,Jr,ac)._.set(n,t);Jr._hasInvokedSet=!1,Jr._checkDisablePreferences=()=>Jr.get("disablePreferences")?!0:(Jr._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)})(),xP=class ss{static findLinks(t){v(ss,this,tv)._??(tv._=v(ss,this,new RegExp("\\b(?:https?:\\/\\/|mailto:|www\\.)(?:[\\S--[\\p{P}<>]]|\\/|[\\S--[\\[\\]]]+[\\S--[\\p{P}<>]])+|(?=\\p{L})[\\S--[@\\p{Ps}\\p{Pe}<>]]+@([\\S--[[\\p{P}--\\-]<>]]+(?:\\.[\\S--[[\\p{P}--\\-]<>]]+)+)","gv")));const[e,i]=Am(t,{ignoreDashEOL:!0}),r=e.matchAll(v(ss,this,tv)._),s=[];for(const o of r){const[l,h]=o;let c;if(l.startsWith("www.")||l.startsWith("http://")||l.startsWith("https://"))c=l;else if(h){const u=URL.parse(`http://${h}`)?.hostname;if(!u||(v(ss,this,ev)._??(ev._=v(ss,this,/\.\d+$/)),v(ss,this,ev)._.test(u)))continue}c??(c=l.startsWith("mailto:")?l:`mailto:${l}`);const d=Lw(c,null,{addDefaultProtocol:!0});if(d){const[u,f]=E1(i,o.index,l.length);s.push({url:d.href,index:u,length:f})}}return s}static processLinks(t){return this.findLinks(t._textHighlighter.textContentItemsStr.join(`
591
+ `)).map(e=>{var i,r;return DR(e,t,(hx._=v(ss,this,(i=v(ss,this,hx)._,r=i++,i)),r))})}},hx={_:0},tv={_:void 0},ev={_:void 0},kt={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},EP=class{constructor(){D(this,"renderingId",""),D(this,"renderTask",null),D(this,"resume",null)}get renderingState(){throw new Error("Abstract getter `renderingState` accessed")}set renderingState(n){throw new Error("Abstract setter `renderingState` accessed")}async draw(){throw new Error("Not implemented: draw")}},Zo=new WeakMap,Wu=new WeakMap,ju=new WeakMap,ra=new WeakMap,Jo=new WeakMap,sa=new WeakMap,cx=new WeakMap,nv=new WeakSet,dx=class extends EP{constructor(n){super(),ot(this,nv),w(this,Zo,null),w(this,Wu,null),w(this,ju,kt.INITIAL),w(this,ra,null),w(this,Jo,0),w(this,sa,null),D(this,"canvas",null),D(this,"div",null),D(this,"enableOptimizedPartialRendering",!1),D(this,"enableSelectionRendering",!0),D(this,"imagesRightClickMinSize",-1),D(this,"eventBus",null),D(this,"id",null),D(this,"imageCoordinates",null),D(this,"pageColors",null),D(this,"recordedBBoxes",null),D(this,"renderingQueue",null),w(this,cx,t=>{if(a(ra,this)?.call(this,!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=kt.PAUSED,this.resume=()=>{this.renderingState=kt.RUNNING,t()};return}t()}),this.eventBus=n.eventBus,this.id=n.id,this.pageColors=n.pageColors||null,this.renderingQueue=n.renderingQueue,this.enableOptimizedPartialRendering=n.enableOptimizedPartialRendering??!1,this.enableSelectionRendering=n.enableSelectionRendering!==!1,this.imagesRightClickMinSize=n.imagesRightClickMinSize??-1,this.minDurationToUpdateCanvas=n.minDurationToUpdateCanvas??500}get renderingState(){return a(ju,this)}set renderingState(n){if(n!==a(ju,this))switch(p(ju,this,n),a(Zo,this)&&(clearTimeout(a(Zo,this)),p(Zo,this,null)),n){case kt.PAUSED:this.div.classList.remove("loading"),p(Jo,this,0),a(ra,this)?.call(this,!1);break;case kt.RUNNING:this.div.classList.add("loadingIcon"),p(Zo,this,setTimeout(()=>{this.div.classList.add("loading"),p(Zo,this,null)},0)),p(Jo,this,Date.now());break;case kt.INITIAL:case kt.FINISHED:this.div.classList.remove("loadingIcon","loading"),p(Jo,this,0);break}}_createCanvas(n,t=!1){const{pageColors:e}=this,i=!!(e?.background&&e?.foreground),r=this.canvas,s=!r&&!i&&!t;let o=this.canvas=document.createElement("canvas");return p(ra,this,l=>{if(s){let h=a(sa,this);if(!l&&this.minDurationToUpdateCanvas>0){if(Date.now()-a(Jo,this)<this.minDurationToUpdateCanvas)return;h||(h=p(sa,this,o),o=this.canvas=o.cloneNode(!1),n(o))}if(h){o.getContext("2d",{alpha:!1}).drawImage(h,0,0),l?v(nv,this,$1).call(this):p(Jo,this,Date.now());return}n(o),p(ra,this,null);return}l&&(r?(r.replaceWith(o),r.width=r.height=0):n(o))}),{canvas:o,prevCanvas:r}}_resetCanvas(){const{canvas:n}=this;n&&(n.remove(),n.width=n.height=0,this.canvas=null,v(nv,this,$1).call(this))}async _drawCanvas(n,t,e){const i=this.renderTask=this.pdfPage.render(n);i.onContinue=a(cx,this),i.onError=s=>{s instanceof km&&(t(),p(Wu,this,null))};let r=null;try{await i.promise,a(ra,this)?.call(this,!0)}catch(s){if(s instanceof km)return;r=s,a(ra,this)?.call(this,!0)}finally{p(Wu,this,r),i===this.renderTask&&(this.renderTask=null,this.enableOptimizedPartialRendering&&(this.recordedBBoxes??(this.recordedBBoxes=i.recordedBBoxes)),this.imagesRightClickMinSize!==-1&&(this.imageCoordinates??(this.imageCoordinates=this.pdfPage.imageCoordinates)))}if(this.renderingState=kt.FINISHED,e(i),r)throw r}cancelRendering({cancelExtraDelay:n=0}={}){this.renderTask&&(this.renderTask.cancel(n),this.renderTask=null),this.resume=null}dispatchPageRender(){this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id})}dispatchPageRendered(n,t){this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:n,isDetailView:t,timestamp:performance.now(),error:a(Wu,this)})}},ts=new WeakMap,AP=class{constructor(n){w(this,ts,null),this.pageIndex=n.pageIndex,this.textLayer=n.textLayer||null,this.filterFactory=n.filterFactory||null,this.pageColors=n.pageColors||null}async render({intent:n="display"}){n!=="display"||a(ts,this)||this._cancelled||p(ts,this,new pT({pageIndex:this.pageIndex,textLayer:this.textLayer,filterFactory:this.filterFactory,pageColors:this.pageColors}))}cancel(){this._cancelled=!0,a(ts,this)&&(a(ts,this).destroy(),p(ts,this,null))}setParent(n){a(ts,this)?.setParent(n)}getDrawLayer(){return a(ts,this)}},Ni=new WeakMap,ux=new WeakSet,SP=class extends dx{constructor({pageView:n}){super(n),ot(this,ux),w(this,Ni,null),D(this,"renderingCancelled",!1),this.pageView=n,this.renderingId="detail"+this.id,this.div=n.div}setPdfPage(n){this.pageView.setPdfPage(n)}get pdfPage(){return this.pageView.pdfPage}get renderingState(){return super.renderingState}set renderingState(n){this.renderingCancelled=!1,super.renderingState=n}reset({keepCanvas:n=!1}={}){const t=this.renderingCancelled||this.renderingState===kt.RUNNING||this.renderingState===kt.PAUSED;this.cancelRendering(),this.renderingState=kt.INITIAL,this.renderingCancelled=t,n||this._resetCanvas()}update({visibleArea:n=null,underlyingViewUpdated:t=!1}={}){if(t){this.cancelRendering(),this.renderingState=kt.INITIAL;return}if(!v(ux,this,FR).call(this,n))return;const{viewport:e,maxCanvasPixels:i,capCanvasAreaFactor:r}=this.pageView,s=n.maxX-n.minX,o=n.maxY-n.minY,l=s*o*ku.pixelRatio**2,h=(Math.sqrt(ku.capPixels(i,r)/l)-1)/2;let c=Math.min(1,h);c<0&&(c=0);const d=s*c,u=o*c,f=Math.max(0,n.minX-d),g=Math.min(e.width,n.maxX+d),m=Math.max(0,n.minY-u),y=Math.min(e.height,n.maxY+u),b=g-f,x=y-m;p(Ni,this,{minX:f,minY:m,width:b,height:x,scale:e.scale}),this.reset({keepCanvas:!0})}_getRenderingContext(n,t){const e=this.pageView._getRenderingContext(n,t,!1),i=this.pdfPage.recordedBBoxes;if(!i||!this.enableOptimizedPartialRendering)return e;const{viewport:{width:r,height:s}}=this.pageView,{width:o,height:l,minX:h,minY:c}=a(Ni,this),d=h/r,u=c/s,f=(h+o)/r,g=(c+l)/s;return{...e,operationsFilter(m){return i.isEmpty(m)?!1:i.minX(m)<=f&&i.maxX(m)>=d&&i.minY(m)<=g&&i.maxY(m)>=u}}}async draw(){if(this.pageView.detailView!==this)return;const n=this.pageView.renderingState===kt.FINISHED||this.renderingState===kt.FINISHED;this.renderingState!==kt.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:t,pdfPage:e,viewport:i}=this.pageView;if(!e)throw this.renderingState=kt.FINISHED,new Error("pdfPage is not loaded");this.renderingState=kt.RUNNING;const r=this.pageView._ensureCanvasWrapper(),{canvas:s,prevCanvas:o}=this._createCanvas(m=>{r.firstElementChild?.tagName==="CANVAS"?r.firstElementChild.after(m):r.prepend(m)},n);s.ariaHidden=!0,this.enableOptimizedPartialRendering&&(s.className="detailView");const{width:l,height:h}=i,c=a(Ni,this),{pixelRatio:d}=ku,u=[d,0,0,d,-c.minX*d,-c.minY*d];s.width=c.width*d,s.height=c.height*d;const{style:f}=s;f.width=`${c.width*100/l}%`,f.height=`${c.height*100/h}%`,f.top=`${c.minY*100/h}%`,f.left=`${c.minX*100/l}%`;const g=this._drawCanvas(this._getRenderingContext(s,u),()=>{this.canvas?.remove(),this.canvas=o},()=>{this.dispatchPageRendered(!1,!0)});return t.setAttribute("data-loaded",!0),this.dispatchPageRender(),g}},fx={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:"rowgroup",TBody:"rowgroup",TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},px=new Set(["math","merror","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"]),Uu="http://www.w3.org/1998/Math/MathML",gx=class{static get sanitizer(){return qh(this,"sanitizer",Dw.isSanitizerSupported?new Sanitizer({elements:[...px].map(n=>({name:n,namespace:Uu})),replaceWithChildrenElements:[{name:"maction",namespace:Uu}],attributes:["dir","displaystyle","mathbackground","mathcolor","mathsize","scriptlevel","encoding","display","linethickness","intent","arg","form","fence","separator","lspace","rspace","stretchy","symmetric","maxsize","minsize","largeop","movablelimits","width","height","depth","voffset","accent","accentunder","columnspan","rowspan"],comments:!1}):null)}},TP=/^H(\d+)$/,$u=new WeakMap,ur=new WeakMap,Hu=new WeakMap,iv=new WeakMap,Vu=new WeakMap,aa=new WeakMap,oa=new WeakMap,fr=new WeakMap,es=new WeakSet,mx=class{constructor(n,t){ot(this,es),w(this,$u,void 0),w(this,ur,null),w(this,Hu,void 0),w(this,iv,new Map),w(this,Vu,void 0),w(this,aa,null),w(this,oa,null),w(this,fr,null),p($u,this,n.getStructTree()),p(Vu,this,t)}async render(){if(a(Hu,this))return a(Hu,this);const{promise:n,resolve:t,reject:e}=Promise.withResolvers();p(Hu,this,n);try{p(ur,this,v(es,this,z1).call(this,await a($u,this)))}catch(i){e(i)}return p($u,this,null),a(ur,this)?.classList.add("structTree"),t(a(ur,this)),n}async getAriaAttributes(n){try{return await this.render(),a(iv,this).get(n)}catch{}return null}hide(){a(ur,this)&&!a(ur,this).hidden&&(a(ur,this).hidden=!0)}show(){a(ur,this)?.hidden&&(a(ur,this).hidden=!1)}updateTextLayer(){if(a(aa,this)){for(const[n,t]of a(aa,this))document.getElementById(n)?.append(t);a(aa,this).clear(),p(aa,this,null)}if(a(oa,this)){for(const n of a(oa,this)){const t=document.getElementById(n);t&&(t.ariaHidden=!0)}a(oa,this).length=0,p(oa,this,null)}if(a(fr,this)){for(let n=0,t=a(fr,this).length;n<t;n+=2){const e=a(fr,this)[n],i=a(fr,this)[n+1];let r="";for(const s of i){const o=document.getElementById(s);o&&(r+=o.textContent.trim()||"",o.ariaHidden="true")}r&&(e.textContent=r)}a(fr,this).length=0,p(fr,this,null)}}},la=new WeakMap,_i=new WeakMap,ha=new WeakMap,Qo=new WeakMap,rv=new WeakSet,PP=class Ux{constructor(){ot(this,rv),w(this,la,!1),w(this,_i,null),w(this,ha,new Map),w(this,Qo,new Map)}setTextMapping(t){p(_i,this,t)}enable(){if(a(la,this))throw new Error("TextAccessibilityManager is already enabled.");if(!a(_i,this))throw new Error("Text divs and strings have not been set.");if(p(la,this,!0),p(_i,this,a(_i,this).slice()),a(_i,this).sort(Pw),a(ha,this).size>0){const t=a(_i,this);for(const[e,i]of a(ha,this)){if(!document.getElementById(e)){a(ha,this).delete(e);continue}v(rv,this,G1).call(this,e,t[i])}}for(const[t,e]of a(Qo,this))this.addPointerInTextLayer(t,e);a(Qo,this).clear()}disable(){a(la,this)&&(a(Qo,this).clear(),p(_i,this,null),p(la,this,!1))}removePointerInTextLayer(t){if(!a(la,this)){a(Qo,this).delete(t);return}const e=a(_i,this);if(!e||e.length===0)return;const{id:i}=t,r=a(ha,this).get(i);if(r===void 0)return;const s=e[r];a(ha,this).delete(i);let o=s.getAttribute("aria-owns");o?.includes(i)&&(o=o.split(" ").filter(l=>l!==i).join(" "),o?s.setAttribute("aria-owns",o):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!a(la,this))return a(Qo,this).set(t,e),null;e&&this.removePointerInTextLayer(t);const r=a(_i,this);if(!r||r.length===0)return null;const s=Pu(r,c=>Pw.call(Ux,t,c)<0),o=Math.max(0,s-1),l=r[o];v(rv,this,G1).call(this,i,l),a(ha,this).set(i,o);const h=l.parentNode;return h?.classList.contains("markedContent")?h.id:null}moveElementInDOM(t,e,i,r){const s=this.addPointerInTextLayer(i,r);if(!t.hasChildNodes())return t.append(e),s;const o=Array.from(t.childNodes).filter(h=>h!==e);if(o.length===0)return s;const l=Pu(o,h=>Pw.call(Ux,e,h)<0);return l===0?o[0].before(e):o[l-1].after(e),s}},qo=new WeakMap,CP=class{constructor({findController:n,eventBus:t,pageIndex:e}){w(this,qo,null),this.findController=n,this.matches=[],this.eventBus=t,this.pageIdx=e,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(n,t){this.textDivs=n,this.textContentItemsStr=t}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,a(qo,this)||(p(qo,this,new AbortController),this.eventBus.on("updatetextlayermatches",n=>{(n.pageIndex===this.pageIdx||n.pageIndex===-1)&&this._updateMatches()},{signal:a(qo,this).signal,...sn})),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,a(qo,this)?.abort(),p(qo,this,null),this._updateMatches(!0))}_convertMatches(n,t){if(!n)return[];const{textContentItemsStr:e}=this;let i=0,r=0;const s=e.length-1,o=[];for(let l=0,h=n.length;l<h;l++){let c=n[l];for(;i!==s&&c>=r+e[i].length;)r+=e[i].length,i++;i===e.length&&console.error("Could not find a matching mapping");const d={begin:{divIdx:i,offset:c-r}};for(c+=t[l];i!==s&&c>r+e[i].length;)r+=e[i].length,i++;d.end={divIdx:i,offset:c-r},o.push(d)}return o}_renderMatches(n){if(n.length===0)return;const{findController:t,pageIdx:e}=this,{textContentItemsStr:i,textDivs:r}=this,s=e===t.selected.pageIdx,o=t.selected.matchIdx,l=t.state.highlightAll;let h=null;const c={divIdx:-1,offset:void 0};function d(b,x){const E=b.divIdx;return r[E].textContent="",u(E,0,b.offset,x)}function u(b,x,E,S){let T=r[b];if(T.nodeType===Node.TEXT_NODE){const C=document.createElement("span");T.before(C),C.append(T),r[b]=C,T=C}const A=i[b].substring(x,E),P=document.createTextNode(A);if(S){const C=document.createElement("span");return C.className=`${S} appended`,C.append(P),T.append(C),S.includes("selected")?C:null}return T.append(P),0}let f=o,g=f+1;if(l)f=0,g=n.length;else if(!s)return;let m=-1,y=-1;for(let b=f;b<g;b++){const x=n[b],E=x.begin;if(E.divIdx===m&&E.offset===y)continue;m=E.divIdx,y=E.offset;const S=x.end,T=s&&b===o,A=T?" selected":"";let P=null;if(!h||E.divIdx!==h.divIdx?(h!==null&&u(h.divIdx,h.offset,c.offset),d(E)):u(h.divIdx,h.offset,E.offset),E.divIdx===S.divIdx)P=u(E.divIdx,E.offset,S.offset,"highlight"+A);else{P=u(E.divIdx,E.offset,c.offset,"highlight begin"+A);for(let C=E.divIdx+1,M=S.divIdx;C<M;C++)r[C].className="highlight middle"+A;d(S,"highlight end"+A)}h=S,T&&t.scrollMatchIntoView({element:P,pageIndex:e,matchIndex:o})}h&&u(h.divIdx,h.offset,c.offset)}_updateMatches(n=!1){if(!this.enabled&&!n)return;const{findController:t,matches:e,pageIdx:i}=this,{textContentItemsStr:r,textDivs:s}=this;let o=-1;for(const c of e){const d=Math.max(o,c.begin.divIdx);for(let u=d,f=c.end.divIdx;u<=f;u++){const g=s[u];g.textContent=r[u],g.className=""}o=c.end.divIdx+1}if(!t?.highlightMatches||n)return;const l=t.pageMatches[i]||null,h=t.pageMatchesLength[i]||null;this.matches=this._convertMatches(l,h),this._renderMatches(this.matches)}},sv=new WeakMap,av=new WeakMap,ov=new WeakMap,tl=new WeakMap,ns=new WeakMap,vx=new WeakSet,lv=class CC{constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:r=!1,onAppend:s=null,abortSignal:o=null}){ot(this,vx),w(this,sv,null),w(this,av,!1),w(this,ov,null),w(this,tl,!1),w(this,ns,null),this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,p(av,this,r===!0),p(ov,this,s),p(sv,this,o),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render({viewport:t,images:e,textContentParams:i=null}){if(a(tl,this)&&a(ns,this)){a(ns,this).update({viewport:t,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),p(ns,this,new ET({textContentSource:this.pdfPage.streamTextContent(i||{includeMarkedContent:!0,disableNormalization:!0}),images:e,container:this.div,viewport:t}));const{textDivs:r,textContentItemsStr:s}=a(ns,this);this.highlighter?.setTextMapping(r,s),this.accessibilityManager?.setTextMapping(r),await a(ns,this).render(),p(tl,this,!0);const o=document.createElement("div");o.className="endOfContent",this.div.append(o),v(vx,this,_R).call(this,o),a(ov,this)?.call(this,this.div),this.highlighter?.enable(),this.accessibilityManager?.enable()}hide(){!this.div.hidden&&a(tl,this)&&(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&a(tl,this)&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){a(ns,this)?.cancel(),p(ns,this,null),p(tl,this,!1),this.div.replaceChildren(),this.highlighter?.disable(),this.accessibilityManager?.disable(),BR.call(CC,this.div)}},Re=lv,vi={_:new Map},el={_:null},hv=new WeakMap,yx=class{constructor({pdfPage:n,annotationStorage:t=null,linkService:e,xfaHtml:i=null}){w(this,hv,!1),D(this,"div",null),this.pdfPage=n,this.annotationStorage=t,this.linkService=e,this.xfaHtml=i}async render({viewport:n,intent:t="display"}){let e;if(t==="print")e=this.xfaHtml;else if(e=await this.pdfPage.getXfa(),a(hv,this)||!e)return{textDivs:[]};const i=!!this.div,r={viewport:n.clone({dontFlip:!0}),div:this.div??(this.div=document.createElement("div")),xfaHtml:e,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return i?Bw.update(r):Bw.render(r)}cancel(){p(hv,this,!0)}hide(){this.div&&(this.div.hidden=!0)}},MP={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new Bm}},IP=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]),zu=new WeakMap,ca=new WeakMap,nl=new WeakMap,Gu=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,cv=new WeakMap,pr=new WeakMap,da=new WeakMap,Ku=new WeakMap,dv=new WeakMap,uv=new WeakMap,fv=new WeakMap,oc=new WeakMap,pv=new WeakMap,ua=new WeakMap,il=new WeakMap,_t=new WeakSet,bx=class MC extends dx{constructor(t){super(t),ot(this,_t),w(this,zu,null),w(this,ca,Di.ENABLE_FORMS),w(this,nl,null),w(this,Gu,null),w(this,Xu,!0),w(this,Yu,!1),w(this,cv,!1),w(this,pr,null),w(this,da,!1),w(this,Ku,null),w(this,dv,null),w(this,uv,1),w(this,fv,1),w(this,oc,Fi.ENABLE),w(this,pv,1),w(this,ua,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0}),w(this,il,[null,null,null,null]);const{container:e,defaultViewport:i}=t;this.renderingId="page"+this.id,p(pr,this,t.layerProperties||MP),p(zu,this,t.abortSignal||null),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=t.scale||Ww,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=t.optionalContentConfigPromise||null,p(oc,this,t.textLayerMode??Fi.ENABLE),p(ca,this,t.annotationMode??Di.ENABLE_FORMS),this.imageResourcesPath=t.imageResourcesPath||"",this.enableDetailCanvas=t.enableDetailCanvas??!0,this.maxCanvasPixels=t.maxCanvasPixels??sc.get("maxCanvasPixels"),this.maxCanvasDim=t.maxCanvasDim||sc.get("maxCanvasDim"),this.capCanvasAreaFactor=t.capCanvasAreaFactor??sc.get("capCanvasAreaFactor"),p(Xu,this,t.enableAutoLinking!==!1),p(Gu,this,t.commentManager||null),this.l10n=t.l10n,this.l10n||(this.l10n=new Yo),this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=e,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null,this.detailView=null;const r=document.createElement("div");if(r.className="page",r.setAttribute("data-page-number",this.id),r.setAttribute("role","region"),r.setAttribute("data-l10n-id","pdfjs-page-landmark"),r.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=r,v(_t,this,Cw).call(this),e?.append(r),this._isStandalone){e?.style.setProperty("--scale-factor",this.scale*hr.PDF_TO_CSS_UNITS),this.pageColors?.background&&e?.style.setProperty("--page-bg-color",this.pageColors.background);const{optionalContentConfigPromise:s}=t;s&&s.then(o=>{s===this._optionalContentConfigPromise&&(a(ua,this).initialOptionalContent=o.hasInitialVisibility)}),t.l10n||this.l10n.translate(this.div)}}clone(t){const e=new MC({container:null,eventBus:this.eventBus,pagesColors:this.pageColors,renderingQueue:this.renderingQueue,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,minDurationToUpdateCanvas:this.minDurationToUpdateCanvas,defaultViewport:this.viewport,id:t,layerProperties:a(pr,this),abortSignal:a(zu,this),scale:this.scale,optionalContentConfigPromise:this._optionalContentConfigPromise,textLayerMode:a(oc,this),annotationMode:a(ca,this),imageResourcesPath:this.imageResourcesPath,enableDetailCanvas:this.enableDetailCanvas,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableAutoLinking:a(Xu,this),commentManager:a(Gu,this),l10n:this.l10n});return e.setPdfPage(this.pdfPage.clone(t-1)),e}updatePageNumber(t){if(this.id===t)return;const e=this.id;this.id=t,this.renderingId=`page${t}`,this.pdfPage&&(this.pdfPage.pageNumber=t),this.setPageLabel(this.pageLabel);const{div:i}=this;i.setAttribute("data-page-number",t),i.setAttribute("data-l10n-args",JSON.stringify({page:t})),this._textHighlighter.pageIdx=t-1,a(pr,this).annotationEditorUIManager?.updatePageIndex(e-1,t-1)}setPdfPage(t){this._isStandalone&&(this.pageColors?.foreground==="CanvasText"||this.pageColors?.background==="Canvas")&&(this._container?.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),this._container?.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=t,this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:this.scale*hr.PDF_TO_CSS_UNITS,rotation:e}),v(_t,this,Cw).call(this),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}deleteMe(t){if(t){this.div.remove();return}this.destroy(),a(pr,this).annotationEditorUIManager?.deletePage(this.id)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}get _textHighlighter(){return qh(this,"_textHighlighter",new CP({pageIndex:this.id-1,eventBus:this.eventBus,findController:a(pr,this).findController}))}_resetCanvas(){super._resetCanvas(),p(Ku,this,null)}reset({keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:e=!1,keepXfaLayer:i=!1,keepTextLayer:r=!1,keepCanvasWrapper:s=!1,preserveDetailViewState:o=!1}={}){const l=this.pdfPage?._pdfBug??!1;this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:e,keepXfaLayer:i,keepTextLayer:r}),this.renderingState=kt.INITIAL;const h=this.div,c=h.childNodes,d=t&&this.annotationLayer?.div||null,u=e&&this.annotationEditorLayer?.div||null,f=i&&this.xfaLayer?.div||null,g=r&&this.textLayer?.div||null,m=s&&a(nl,this)||null;for(let y=c.length-1;y>=0;y--){const b=c[y];switch(b){case d:case u:case f:case g:case m:continue}if(l&&b.classList.contains("pdfBugGroupsLayer"))continue;b.remove();const x=a(il,this).indexOf(b);x>=0&&(a(il,this)[x]=null)}h.removeAttribute("data-loaded"),d&&this.annotationLayer.hide(),u&&this.annotationEditorLayer.hide(),f&&this.xfaLayer.hide(),g&&this.textLayer.hide(),this.structTreeLayer?.hide(),!s&&a(nl,this)&&(p(nl,this,null),this._resetCanvas()),o||(this.detailView?.reset({keepCanvas:s}),s||(this.detailView=null))}toggleEditingMode(t){p(cv,this,t),this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(t){this.enableDetailCanvas&&(a(da,this)&&this.maxCanvasPixels>0&&t?(this.detailView??(this.detailView=new SP({pageView:this,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,imagesRightClickMinSize:-1})),this.detailView.update({visibleArea:t})):this.detailView&&(this.detailView.reset(),this.detailView=null))}update({scale:t=0,rotation:e=null,optionalContentConfigPromise:i=null,drawingDelay:r=-1}){this.scale=t||this.scale,typeof e=="number"&&(this.rotation=e),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(o=>{i===this._optionalContentConfigPromise&&(a(ua,this).initialOptionalContent=o.hasInitialVisibility)})),a(ua,this).directDrawing=!0;const s=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*hr.PDF_TO_CSS_UNITS,rotation:s}),v(_t,this,Cw).call(this),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),v(_t,this,Q1).call(this),this.canvas){const o=a(Yu,this)&&a(da,this),l=r>=0&&r<1e3;if(l||o){l&&!o&&this.renderingState!==kt.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=kt.FINISHED,a(ua,this).directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!l,hideTextLayer:l}),l||(this.detailView?.update({underlyingViewUpdated:!0}),this.dispatchPageRendered(!0,!1));return}}this.cssTransform({}),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0,preserveDetailViewState:!0}),this.detailView?.update({underlyingViewUpdated:!0})}cancelRendering({keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:e=!1,keepXfaLayer:i=!1,keepTextLayer:r=!1,cancelExtraDelay:s=0}={}){super.cancelRendering({cancelExtraDelay:s}),this.textLayer&&(!r||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!t||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!e||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!i||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:e=!1,redrawXfaLayer:i=!1,redrawTextLayer:r=!1,hideTextLayer:s=!1}){const{canvas:o}=this;if(!o)return;const l=a(Ku,this);if(this.viewport!==l){const h=(360+this.viewport.rotation-l.rotation)%360;if(h===90||h===270){const{width:c,height:d}=this.viewport,u=d/c,f=c/d;o.style.transform=`rotate(${h}deg) scale(${u},${f})`}else o.style.transform=h===0?"":`rotate(${h}deg)`}t&&this.annotationLayer&&v(_t,this,X1).call(this),e&&this.annotationEditorLayer&&(this.drawLayer&&v(_t,this,K1).call(this),v(_t,this,Y1).call(this)),i&&this.xfaLayer&&v(_t,this,Z1).call(this),this.textLayer&&(s?(this.textLayer.hide(),this.structTreeLayer?.hide()):r&&v(_t,this,J1).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(t,e){return this.viewport.convertToPdfPoint(t,e)}_ensureCanvasWrapper(){let t=a(nl,this);return t||(t=p(nl,this,document.createElement("div")),t.classList.add("canvasWrapper"),v(_t,this,Mu).call(this,t,"canvasWrapper")),t}_getRenderingContext(t,e,i,r){return{canvas:t,transform:e,viewport:this.viewport,annotationMode:a(ca,this),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:a(cv,this),recordOperations:i,recordImages:r}}async draw(){this.renderingState!==kt.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:t,l10n:e,pdfPage:i,viewport:r}=this;if(!i)throw this.renderingState=kt.FINISHED,new Error("pdfPage is not loaded");this.renderingState=kt.RUNNING;const s=this._ensureCanvasWrapper();if(!this.textLayer&&a(oc,this)!==Fi.DISABLE&&!i.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new PP),this.textLayer=new lv({pdfPage:i,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:a(oc,this)===Fi.ENABLE_PERMISSIONS,onAppend:A=>{this.l10n.pause(),v(_t,this,Mu).call(this,A,"textLayer"),this.l10n.resume()},abortSignal:a(zu,this)})),!this.annotationLayer&&a(ca,this)!==Di.DISABLE){const{annotationStorage:A,annotationEditorUIManager:P,downloadManager:C,enableComment:M,enableScripting:I,fieldObjectsPromise:k,hasJSActionsPromise:O,linkService:B}=a(pr,this);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new Jw({pdfPage:i,annotationStorage:A,imageResourcesPath:this.imageResourcesPath,renderForms:a(ca,this)===Di.ENABLE_FORMS,linkService:B,downloadManager:C,enableComment:M,enableScripting:I,hasJSActionsPromise:O,fieldObjectsPromise:k,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:P,commentManager:a(Gu,this),onAppend:L=>{v(_t,this,Mu).call(this,L,"annotationLayer")}})}const{width:o,height:l}=r;p(Ku,this,r);const{canvas:h,prevCanvas:c}=this._createCanvas(A=>{s.prepend(A)});h.setAttribute("role","presentation"),this.outputScale||v(_t,this,Q1).call(this);const{outputScale:d}=this;p(Yu,this,a(da,this));const u=b1(d.sx),f=b1(d.sy),g=h.width=Em(Ou(o*d.sx),u[0]),m=h.height=Em(Ou(l*d.sy),f[0]),y=Em(Ou(o),u[1]),b=Em(Ou(l),f[1]);d.sx=g/y,d.sy=m/b,a(uv,this)!==u[1]&&(t.style.setProperty("--scale-round-x",`${u[1]}px`),p(uv,this,u[1])),a(fv,this)!==f[1]&&(t.style.setProperty("--scale-round-y",`${f[1]}px`),p(fv,this,f[1]));const x=this.enableOptimizedPartialRendering&&a(Yu,this)&&!this.recordedBBoxes,E=this.imagesRightClickMinSize!==-1&&!this.imageCoordinates,S=d.scaled?[d.sx,0,0,d.sy,0,0]:null,T=this._drawCanvas(this._getRenderingContext(h,S,x,E),()=>{c?.remove(),this._resetCanvas()},A=>{a(ua,this).regularAnnotations=!A.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{if(this.renderingState!==kt.FINISHED)return;this.structTreeLayer||(this.structTreeLayer=new mx(i,r.rawDims));const A=v(_t,this,J1).call(this);this.annotationLayer&&(await v(_t,this,X1).call(this),a(Xu,this)&&this.annotationLayer&&this.textLayer&&await v(_t,this,$R).call(this,A)),this.drawLayer||(this.drawLayer=new AP({pageIndex:this.id,textLayer:this.enableSelectionRendering?this.textLayer?.div:null,filterFactory:this.pdfPage?.filterFactory,pageColors:this.pageColors})),await v(_t,this,K1).call(this),this.drawLayer.setParent(s);const{annotationEditorUIManager:P}=a(pr,this);P&&(this.annotationLayer||a(ca,this)===Di.DISABLE)&&(this.annotationEditorLayer||(this.annotationEditorLayer=new wP({uiManager:P,pageIndex:this.id-1,l10n:e,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:C=>{v(_t,this,Mu).call(this,C,"annotationEditorLayer")}})),v(_t,this,Y1).call(this))});if(i.isPureXfa){if(!this.xfaLayer){const{annotationStorage:A,linkService:P}=a(pr,this);this.xfaLayer=new yx({pdfPage:i,annotationStorage:A,linkService:P})}v(_t,this,Z1).call(this)}return t.setAttribute("data-loaded",!0),this.dispatchPageRender(),T}setPageLabel(t){this.pageLabel=typeof t=="string"?t:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:t,initialOptionalContent:e,regularAnnotations:i}=a(ua,this);return t&&e&&i?this.canvas:null}},kP=class{constructor(n,t){this._ready=new Promise((e,i)=>{import(n).then(r=>{e(r.QuickJSSandbox(new URL(t,location.href).href))}).catch(i)})}async createSandbox(n){(await this._ready).create(n)}async dispatchEventInSandbox(n){const t=await this._ready;setTimeout(()=>t.dispatchEvent(n),0)}async destroySandbox(){(await this._ready).nukeSandbox()}},is=new WeakMap,lc=new WeakMap,gv=new WeakMap,hc=new WeakMap,cc=new WeakMap,mv=new WeakMap,In=new WeakMap,fa=new WeakMap,Zu=new WeakMap,Oe=new WeakMap,Bi=new WeakMap,Xn=new WeakSet,RP=class{constructor({eventBus:n,externalServices:t=null,docProperties:e=null}){ot(this,Xn),w(this,is,null),w(this,lc,null),w(this,gv,null),w(this,hc,null),w(this,cc,null),w(this,mv,null),w(this,In,null),w(this,fa,null),w(this,Zu,!1),w(this,Oe,null),w(this,Bi,null),p(cc,this,n),p(mv,this,t),p(gv,this,e)}setViewer(n){p(fa,this,n)}async setDocument(n){if(a(In,this)&&await v(Xn,this,Mm).call(this),p(In,this,n),!n)return;const[t,e,i]=await Promise.all([n.getFieldObjects(),n.getCalculationOrderIds(),n.getJSActions()]);if(!t&&!i){await v(Xn,this,Mm).call(this);return}if(n!==a(In,this))return;try{p(Oe,this,v(Xn,this,zR).call(this))}catch(o){console.error("setDocument:",o),await v(Xn,this,Mm).call(this);return}const r=a(cc,this);p(hc,this,new AbortController);const s={signal:a(hc,this).signal,...sn};r.on("updatefromsandbox",o=>{o?.source===window&&v(Xn,this,VR).call(this,o.detail)},s),r.on("dispatcheventinsandbox",o=>{a(Oe,this)?.dispatchEventInSandbox(o.detail)},s),r.on("pagechanging",({pageNumber:o,previous:l})=>{o!==l&&(v(Xn,this,q1).call(this,l),v(Xn,this,Mw).call(this,o))},s),r.on("pagerendered",({pageNumber:o})=>{this._pageOpenPending.has(o)&&o===a(fa,this).currentPageNumber&&v(Xn,this,Mw).call(this,o)},s),r.on("pagesdestroy",async()=>{await v(Xn,this,q1).call(this,a(fa,this).currentPageNumber),await a(Oe,this)?.dispatchEventInSandbox({id:"doc",name:"WillClose"}),a(is,this)?.resolve()},s);try{const o=await a(gv,this).call(this,n);if(n!==a(In,this))return;await a(Oe,this).createSandbox({objects:t,calculationOrder:e,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...o,actions:i}}),r.dispatch("sandboxcreated",{source:this})}catch(o){console.error("setDocument:",o),await v(Xn,this,Mm).call(this);return}await a(Oe,this)?.dispatchEventInSandbox({id:"doc",name:"Open"}),await v(Xn,this,Mw).call(this,a(fa,this).currentPageNumber,!0),Promise.resolve().then(()=>{n===a(In,this)&&p(Zu,this,!0)})}async dispatchWillSave(){return a(Oe,this)?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){return a(Oe,this)?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){if(a(Oe,this)){await a(Bi,this)?.promise,p(Bi,this,Promise.withResolvers());try{await a(Oe,this).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(n){throw a(Bi,this).resolve(),p(Bi,this,null),n}await a(Bi,this).promise}}async dispatchDidPrint(){return a(Oe,this)?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){return a(lc,this)?.promise||null}get ready(){return a(Zu,this)}get _pageOpenPending(){return qh(this,"_pageOpenPending",new Set)}get _visitedPages(){return qh(this,"_visitedPages",new Map)}},OP=class extends RP{constructor(n){n.externalServices||window.addEventListener("updatefromsandbox",t=>{n.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})}),n.externalServices||(n.externalServices={createScripting:()=>new kP(n.sandboxBundleSrc,n.wasmUrl)}),n.docProperties||(n.docProperties=t=>HR(t)),super(n)}},Mt(1148),Mt(3579),LP=3e4,dc=new WeakMap,uc=new WeakMap,vv=new WeakMap,Ju=new WeakMap,DP=class{constructor(){w(this,dc,null),w(this,uc,null),w(this,vv,null),w(this,Ju,null),D(this,"isThumbnailViewEnabled",!1),D(this,"onIdle",null),D(this,"printing",!1),Object.defineProperty(this,"hasViewer",{value:()=>!!a(Ju,this)})}setViewer(n){p(Ju,this,n)}setThumbnailViewer(n){p(vv,this,n)}isHighestPriority(n){return a(dc,this)===n.renderingId}renderHighestPriority(n){a(uc,this)&&(clearTimeout(a(uc,this)),p(uc,this,null)),!a(Ju,this).forceRendering(n)&&(this.isThumbnailViewEnabled&&a(vv,this)?.forceRendering()||this.printing||this.onIdle&&p(uc,this,setTimeout(this.onIdle.bind(this),LP)))}getHighestPriority(n,t,e,i=!1,r=!1){const s=n.views,o=s.length;if(o===0)return null;for(let u=0;u<o;u++){const f=s[u].view;if(!this.isViewFinished(f))return f}if(!r)for(let u=0;u<o;u++){const{detailView:f}=s[u].view;if(f&&!this.isViewFinished(f))return f}const l=n.first.id,h=n.last.id;if(h-l+1>o){const u=n.ids;for(let f=1,g=h-l;f<g;f++){const m=e?l+f:h-f;if(u.has(m))continue;const y=t[m-1];if(!this.isViewFinished(y))return y}}let c=e?h:l-2,d=t[c];return d&&!this.isViewFinished(d)||i&&(c+=e?1:-1,d=t[c],d&&!this.isViewFinished(d))?d:null}isViewFinished(n){return n.renderingState===kt.FINISHED}renderView(n){switch(n.renderingState){case kt.FINISHED:return!1;case kt.PAUSED:p(dc,this,n.renderingId),n.resume();break;case kt.RUNNING:p(dc,this,n.renderingId);break;case kt.INITIAL:p(dc,this,n.renderingId),n.draw().finally(()=>{this.renderHighestPriority()}).catch(t=>{t instanceof km||console.error("renderView:",t)});break}return!0}},wx=10,Qu={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250},pa=new WeakMap,fc=new WeakMap,yv=new WeakSet,lT=Symbol.iterator,FP=class{constructor(n){ot(this,yv),w(this,pa,new Set),w(this,fc,0),p(fc,this,n)}push(n){const t=a(pa,this);t.has(n)&&t.delete(n),t.add(n),t.size>a(fc,this)&&v(yv,this,eT).call(this)}resize(n,t=null){p(fc,this,n);const e=a(pa,this);if(t){const i=e.size;let r=1;for(const s of e)if(t.has(s.id)&&(e.delete(s),e.add(s)),++r>i)break}for(;e.size>a(fc,this);)v(yv,this,eT).call(this)}has(n){return a(pa,this).has(n)}[lT](){return a(pa,this).keys()}},ga=new WeakMap,bv=new WeakMap,wv=new WeakMap,Wi=new WeakMap,Ye=new WeakMap,pc=new WeakMap,gc=new WeakMap,qu=new WeakMap,xv=new WeakMap,Ev=new WeakMap,Av=new WeakMap,Sv=new WeakMap,Tv=new WeakMap,Pv=new WeakMap,Cv=new WeakMap,rl=new WeakMap,Mv=new WeakMap,tf=new WeakMap,ma=new WeakMap,gr=new WeakMap,mc=new WeakMap,vc=new WeakMap,ef=new WeakMap,sl=new WeakMap,Iv=new WeakMap,nf=new WeakMap,yc=new WeakMap,va=new WeakMap,rf=new WeakMap,kv=new WeakMap,sf=new WeakMap,Rv=new WeakMap,al=new WeakMap,ji=new WeakMap,ol=new WeakMap,At=new WeakSet,Ov=class{constructor(n){ot(this,At),w(this,ga,null),w(this,bv,null),w(this,wv,null),w(this,Wi,pn.NONE),w(this,Ye,null),w(this,pc,Di.ENABLE_FORMS),w(this,gc,null),w(this,qu,null),w(this,xv,null),w(this,Ev,!1),w(this,Av,!1),w(this,Sv,!1),w(this,Tv,!1),w(this,Pv,!0),w(this,Cv,null),w(this,rl,null),w(this,Mv,0),w(this,tf,null),w(this,ma,!0),w(this,gr,null),w(this,mc,null),w(this,vc,null),w(this,ef,!1),w(this,sl,null),w(this,Iv,0),w(this,nf,new ResizeObserver(v(At,this,tO).bind(this))),w(this,yc,null),w(this,va,null),w(this,rf,null),w(this,kv,!0),w(this,sf,Fi.ENABLE),w(this,Rv,null),w(this,al,null),w(this,ji,null),w(this,ol,null);const t="6.0.227";if(_w!==t)throw new Error(`The API version "${_w}" does not match the Viewer version "${t}".`);if(this.container=n.container,this.viewer=n.viewer||n.container.firstElementChild,p(Rv,this,n.viewerAlert||null),this.container?.tagName!=="DIV"||this.viewer?.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.");a(nf,this).observe(this.container),this.eventBus=n.eventBus,this.linkService=n.linkService||new Bm,this.downloadManager=n.downloadManager||null,this.findController=n.findController||null,p(bv,this,n.altTextManager||null),p(gc,this,n.commentManager||null),p(rf,this,n.signatureManager||null),p(xv,this,n.editorUndoBar||null),this.findController&&(this.findController.onIsPageVisible=i=>this._getVisiblePages().ids.has(i)),this._scriptingManager=n.scriptingManager||null,p(sf,this,n.textLayerMode??Fi.ENABLE),p(pc,this,n.annotationMode??Di.ENABLE_FORMS),p(Wi,this,n.annotationEditorMode??pn.NONE),p(wv,this,n.annotationEditorHighlightColors||null),p(Ev,this,n.enableHighlightFloatingButton===!0),p(Sv,this,n.enableUpdatedAddImage===!0),p(Tv,this,n.enableNewAltTextWhenAddingImage===!0),this.imageResourcesPath=n.imageResourcesPath||"",this.enablePrintAutoRotate=n.enablePrintAutoRotate||!1,this.removePageBorders=n.removePageBorders||!1,this.maxCanvasPixels=n.maxCanvasPixels,this.maxCanvasDim=n.maxCanvasDim,this.capCanvasAreaFactor=n.capCanvasAreaFactor,this.enableDetailCanvas=n.enableDetailCanvas??!0,this.enableOptimizedPartialRendering=n.enableOptimizedPartialRendering??!1,this.enableSelectionRendering=n.enableSelectionRendering!==!1,this.imagesRightClickMinSize=n.imagesRightClickMinSize??-1,this.l10n=n.l10n,this.l10n||(this.l10n=new Yo),p(Av,this,n.enablePermissions||!1),this.pageColors=n.pageColors||null,p(tf,this,n.mlManager||null),p(kv,this,n.supportsPinchToZoom!==!1),p(Pv,this,n.enableAutoLinking!==!1),p(Mv,this,n.minDurationToUpdateCanvas??500),this.defaultRenderingQueue=!n.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new DP,this.renderingQueue.setViewer(this)):this.renderingQueue=n.renderingQueue;const{abortSignal:e}=n;p(Cv,this,e||null),e?.addEventListener("abort",()=>{a(nf,this).disconnect(),p(nf,this,null)},{once:!0}),this.scroll=Wk(this.container,this._scrollUpdate.bind(this),e),this.presentationModeState=Uo.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),v(At,this,sT).call(this),this.eventBus.on("thumbnailrendered",({pageNumber:i,pdfPage:r})=>{const s=this._pages[i-1];a(ga,this).has(s)||r?.cleanup()},sn),n.l10n||this.l10n.translate(this.container)}get printingAllowed(){return a(ma,this)}get pagesCount(){return this._pages.length}getPageView(n){return this._pages[n]}getCachedPageViews(){return new Set(a(ga,this))}get pageViewsReady(){return this._pages.every(n=>n?.pdfPage)}clearSelection(){const n=document.getSelection();if(!(!n||n.isCollapsed)){for(let t=0,e=n.rangeCount;t<e;t++)if(n.getRangeAt(t).intersectsNode(this.viewer)){n.removeAllRanges?.(),n.empty?.();return}}}get renderForms(){return a(pc,this)===Di.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(n){if(!Number.isInteger(n))throw new Error("Invalid page number.");this.pdfDocument&&(this._currentPageNumber!==n&&this.clearSelection(),this._setCurrentPageNumber(n,!0)||console.error(`currentPageNumber: "${n}" is not a valid page.`))}_setCurrentPageNumber(n,t=!1){if(this._currentPageNumber===n)return t&&v(At,this,iT).call(this),!0;if(!(0<n&&n<=this.pagesCount))return!1;const e=this._currentPageNumber;return this._currentPageNumber=n,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:n,pageLabel:this._pageLabels?.[n-1]??null,previous:e}),t&&v(At,this,iT).call(this),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(n){if(!this.pdfDocument)return;let t=n|0;if(this._pageLabels){const e=this._pageLabels.indexOf(n);e>=0&&(t=e+1)}this._currentPageNumber!==t&&this.clearSelection(),this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${n}" is not a valid page.`)}get currentScale(){return this._currentScale!==Lm?this._currentScale:Ww}set currentScale(n){if(isNaN(n))throw new Error("Invalid numeric scale.");this.pdfDocument&&v(At,this,Bo).call(this,n,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(n){this.pdfDocument&&v(At,this,Bo).call(this,n,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(n){if(!w1(n))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(n%=360,n<0&&(n+=360),this._pagesRotation===n))return;this.clearSelection(),this._pagesRotation=n;const t=this._currentPageNumber;this.refresh(!0,{rotation:n}),this._currentScaleValue&&v(At,this,Bo).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:n,pageNumber:t}),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}get _layerProperties(){const n=this;return qh(this,"_layerProperties",{get annotationEditorUIManager(){return a(Ye,n)},get annotationStorage(){return n.pdfDocument?.annotationStorage},get downloadManager(){return n.downloadManager},get enableComment(){return!!a(gc,n)},get enableScripting(){return!!n._scriptingManager},get fieldObjectsPromise(){return n.pdfDocument?.getFieldObjects()},get findController(){return n.findController},get hasJSActionsPromise(){return n.pdfDocument?.hasJSActions()},get linkService(){return n.linkService}})}async getAllText(n=null){const t=[],e=[];for(let i=1,r=this.pdfDocument.numPages;i<=r;++i){if(n?.aborted)return null;e.length=0;const{items:s}=await(await this.pdfDocument.getPage(i)).getTextContent();for(const o of s)o.str&&e.push(o.str),o.hasEOL&&e.push(`
592
+ `);t.push(Tu(e.join("")))}return t.join(`
593
+ `)}setDocument(n){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),a(Ye,this)?.destroy(),p(Ye,this,null),p(Wi,this,pn.NONE),p(ma,this,!0)),this.pdfDocument=n,!n)return;const t=n.numPages,e=n.getPage(1),i=n.getOptionalContentConfig({intent:"display"}),r=a(Av,this)?n.getPermissions():Promise.resolve(),{eventBus:s,pageColors:o,viewer:l}=this;p(rl,this,new AbortController);const{signal:h}=a(rl,this),c={signal:h,...sn};if(t>Qu.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const f=this._scrollMode=Pt.PAGE;s.dispatch("scrollmodechanged",{source:this,mode:f})}this._pagesCapability.promise.then(()=>{s.dispatch("pagesloaded",{source:this,pagesCount:t})},()=>{});const d=f=>{const g=this._pages[f.pageNumber-1];g&&a(ga,this).push(g)};s.on("pagerender",d,c);const u=f=>{f.cssTransform||f.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:f.timestamp}),s.off("pagerendered",u))};s.on("pagerendered",u,c),Promise.all([e,r]).then(([f,g])=>{if(n!==this.pdfDocument)return;this._firstPageCapability.resolve(f),this._optionalContentConfigPromise=i;const{annotationEditorMode:m,annotationMode:y,textLayerMode:b}=v(At,this,GR).call(this,g);if(b!==Fi.DISABLE){const T=p(sl,this,document.createElement("div"));T.id="hiddenCopyElement",T.style.cssText="position:absolute;top:0;left:0;width:0;height:0;display:none",l.before(T)}if(m!==pn.DISABLE){const T=m;n.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):tT(T)?(p(Ye,this,new uT(this.container,l,a(Rv,this),a(bv,this),a(gc,this),a(rf,this),s,n,o,a(wv,this),a(Ev,this),a(Sv,this),a(Tv,this),a(tf,this),a(xv,this),a(kv,this))),s.dispatch("annotationeditoruimanager",{source:this,uiManager:a(Ye,this)}),T!==pn.NONE&&(v(At,this,oT).call(this,T),a(Ye,this).updateMode(T))):console.error(`Invalid AnnotationEditor mode: ${T}`)}const x=this._scrollMode===Pt.PAGE?null:l,E=this.currentScale,S=f.getViewport({scale:E*hr.PDF_TO_CSS_UNITS});l.style.setProperty("--scale-factor",S.scale),o?.background&&l.style.setProperty("--page-bg-color",o.background),(o?.foreground==="CanvasText"||o?.background==="Canvas")&&(l.style.setProperty("--hcm-highlight-filter",n.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),l.style.setProperty("--hcm-highlight-selected-filter",n.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let T=1;T<=t;++T){const A=new bx({container:x,eventBus:s,id:T,scale:E,defaultViewport:S.clone(),optionalContentConfigPromise:i,renderingQueue:this.renderingQueue,textLayerMode:b,annotationMode:y,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,enableSelectionRendering:this.enableSelectionRendering,imagesRightClickMinSize:this.imagesRightClickMinSize,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableAutoLinking:a(Pv,this),minDurationToUpdateCanvas:a(Mv,this),commentManager:a(gc,this),abortSignal:a(Cv,this)});this._pages.push(A)}this._pages[0]?.setPdfPage(f),this._scrollMode===Pt.PAGE?v(At,this,Im).call(this):this._spreadMode!==Xe.NONE&&this._updateSpreadMode(),s.on("annotationeditorlayerrendered",T=>{a(Ye,this)&&s.dispatch("annotationeditormodechanged",{source:this,mode:a(Wi,this)})},{once:!0,signal:h,...sn}),v(At,this,XR).call(this,h).then(async()=>{if(n!==this.pdfDocument)return;if(this.findController?.setDocument(n),this._scriptingManager?.setDocument(n),a(sl,this)&&document.addEventListener("copy",v(At,this,YR).bind(this,b),{signal:h}),n.loadingParams.disableAutoFetch||t>Qu.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let T=t-1;if(T<=0){this._pagesCapability.resolve();return}for(let A=2;A<=t;++A){const P=n.getPage(A).then(C=>{const M=this._pages[A-1];M.pdfPage||M.setPdfPage(C),--T===0&&this._pagesCapability.resolve()},C=>{console.error(`Unable to get page ${A} to initialize viewer`,C),--T===0&&this._pagesCapability.resolve()});A%Qu.PAUSE_EAGER_PAGE_INIT===0&&await P}}),s.dispatch("pagesinit",{source:this}),n.getMetadata().then(({info:T})=>{n===this.pdfDocument&&T.Language&&(l.lang=T.Language)}),this.defaultRenderingQueue&&this.update()}).catch(f=>{console.error("Unable to initialize viewer",f),this._pagesCapability.reject(f)})}onPagesEdited({pagesMapper:n,type:t,hasBeenCut:e,pageNumbers:i}){if(t==="copy"){p(al,this,new Map);for(const l of i)a(al,this).set(l,this._pages[l-1]);return}if(t==="cancelCopy"){p(al,this,null);return}if((t==="cut"||t==="delete")&&(p(ji,this,this._pages),p(ol,this,i)),t==="cancelDelete"){if(p(ol,this,null),!a(ji,this))return;const l=this._scrollMode===Pt.PAGE?null:this.viewer;if(l){a(Ye,this)?.startUpdatePages();const h=document.createDocumentFragment();for(let c=0,d=a(ji,this).length;c<d;c++){const u=a(ji,this)[c];u.updatePageNumber(c+1),h.append(u.div)}l.replaceChildren(h),a(Ye,this)?.endUpdatePages()}this._pages=a(ji,this),p(ji,this,null);return}if(t==="cleanSavedData"){if(a(ol,this)){if(a(ji,this)){for(const l of a(ol,this))a(ji,this)[l-1].deleteMe();p(ji,this,null)}p(ol,this,null)}return}this._currentPageNumber=0;const r=this._pages,s=this._pages=[];a(Ye,this)?.startUpdatePages();for(let l=1,h=n.pagesNumber;l<=h;l++){const c=n.getPrevPageNumber(l);if(c<0){let u=a(al,this).get(-c);e?u.updatePageNumber(l):(a(Ye,this)?.clonePage(-c-1,l-1),u=u.clone(l)),s.push(u);continue}const d=r[c-1];s.push(d),d.updatePageNumber(l)}a(Ye,this)?.endUpdatePages(),t==="paste"&&p(al,this,null);const o=this._scrollMode===Pt.PAGE?null:this.viewer;if(o){const l=document.createDocumentFragment();for(const{div:h}of s)l.append(h);o.replaceChildren(l)}setTimeout(()=>{this.forceRendering()})}setPageLabels(n){if(this.pdfDocument){n?Array.isArray(n)&&this.pdfDocument.numPages===n.length?this._pageLabels=n:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let t=0,e=this._pages.length;t<e;t++)this._pages[t].setPageLabel(this._pageLabels?.[t]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=Lm,this._currentScaleValue=null,this._pageLabels=null,p(ga,this,new FP(wx)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=Pt.VERTICAL,this._previousScrollMode=Pt.UNKNOWN,this._spreadMode=Xe.NONE,p(yc,this,{previousPageNumber:1,scrollDown:!0,pages:[]}),a(rl,this)?.abort(),p(rl,this,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),a(sl,this)?.remove(),p(sl,this,null),v(At,this,aT).call(this),v(At,this,kw).call(this)}_scrollUpdate(){this.pagesCount!==0&&(a(gr,this)&&clearTimeout(a(gr,this)),p(gr,this,setTimeout(()=>{p(gr,this,null),this.update()},100)),this.update())}pageLabelToPageNumber(n){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(n);return t<0?null:t+1}scrollPageIntoView({pageNumber:n,destArray:t=null,allowNegativeOffset:e=!1,ignoreDestinationZoom:i=!1,center:r=null}){if(!this.pdfDocument)return;const s=Number.isInteger(n)&&this._pages[n-1];if(!s){console.error(`scrollPageIntoView: "${n}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!t){this._setCurrentPageNumber(n,!0);return}let o=0,l=0,h=0,c=0,d,u;const f=s.rotation%180!==0,g=(f?s.height:s.width)/s.scale/hr.PDF_TO_CSS_UNITS,m=(f?s.width:s.height)/s.scale/hr.PDF_TO_CSS_UNITS;let y=0;switch(t[1].name){case"XYZ":o=t[2],l=t[3],y=t[4],o=o!==null?o:0,l=l!==null?l:m;break;case"Fit":case"FitB":y="page-fit";break;case"FitH":case"FitBH":l=t[2],y="page-width",l===null&&this._location?(o=this._location.left,l=this._location.top):(typeof l!="number"||l<0)&&(l=m);break;case"FitV":case"FitBV":o=t[2],h=g,c=m,y="page-height";break;case"FitR":o=t[2],l=t[3],h=t[4]-o,c=t[5]-l;let S=Uw,T=$w;this.removePageBorders&&(S=T=0),d=(this.container.clientWidth-S)/h/hr.PDF_TO_CSS_UNITS,u=(this.container.clientHeight-T)/c/hr.PDF_TO_CSS_UNITS,y=Math.min(Math.abs(d),Math.abs(u));break;default:console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`);return}if(i||(y&&y!==this._currentScale?this.currentScaleValue=y:this._currentScale===Lm&&(this.currentScaleValue=TT)),y==="page-fit"&&!t[4]){v(At,this,Iw).call(this,s);return}const b=[s.viewport.convertToViewportPoint(o,l),s.viewport.convertToViewportPoint(o+h,l+c)];let x=Math.min(b[0][0],b[1][0]),E=Math.min(b[0][1],b[1][1]);r?((r==="both"||r==="vertical")&&(E-=(this.container.clientHeight-Math.abs(b[1][1]-b[0][1]))/2),(r==="both"||r==="horizontal")&&(x-=(this.container.clientWidth-Math.abs(b[1][0]-b[0][0]))/2)):e||(x=Math.max(x,0),E=Math.max(E,0)),v(At,this,Iw).call(this,s,{left:x,top:E})}_updateLocation(n){const t=this._currentScale,e=this._currentScaleValue,i=parseFloat(e)===t?Math.round(t*1e4)/100:e,r=n.id,s=this._pages[r-1],o=this.container,l=s.getPagePoint(o.scrollLeft-n.x,o.scrollTop-n.y),h=Math.round(l[0]),c=Math.round(l[1]);let d=`#page=${r}`;this.isInPresentationMode||(d+=`&zoom=${i},${h},${c}`),this._location={pageNumber:r,scale:i,top:c,left:h,rotation:this._pagesRotation,pdfOpenParams:d}}update(){const n=this._getVisiblePages(),t=n.views,e=t.length;if(e===0)return;const i=Math.max(wx,2*e+1);a(ga,this).resize(i,n.ids);for(const{view:l,visibleArea:h}of t)l.updateVisibleArea(h);for(const l of a(ga,this))n.ids.has(l.id)||l.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(n);const r=this._spreadMode===Xe.NONE&&(this._scrollMode===Pt.PAGE||this._scrollMode===Pt.VERTICAL),s=this._currentPageNumber;let o=!1;for(const l of t){if(l.percent<100)break;if(l.id===s&&r){o=!0;break}}this._setCurrentPageNumber(o?this._currentPageNumber:t[0].id),this._updateLocation(n.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(n){return this.container.contains(n)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===Uo.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===Uo.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 n=this._scrollMode===Pt.PAGE?a(yc,this).pages:this._pages,t=this._scrollMode===Pt.HORIZONTAL,e=t&&this._isContainerRtl;return Uk({scrollEl:this.container,views:n,sortByVisibility:!0,horizontal:t,rtl:e})}cleanup(){for(const n of this._pages)n.renderingState!==kt.FINISHED&&n.reset()}_cancelRendering(){for(const n of this._pages)n.cancelRendering()}forceRendering(n){const t=n||this._getVisiblePages(),e=v(At,this,qR).call(this,t),i=this._spreadMode!==Xe.NONE&&this._scrollMode!==Pt.HORIZONTAL,r=a(va,this)!==null||a(gr,this)!==null&&t.views.some(o=>o.detailView?.renderingCancelled),s=this.renderingQueue.getHighestPriority(t,this._pages,e,i,r);return s?(v(At,this,QR).call(this,s).then(()=>{this.renderingQueue.renderView(s)}),!0):!1}get hasEqualPageSizes(){const n=this._pages[0];for(let t=1,e=this._pages.length;t<e;++t){const i=this._pages[t];if(i.width!==n.width||i.height!==n.height)return!1}return!0}getPagesOverview(){let n;return this._pages.map(t=>{const e=t.pdfPage.getViewport({scale:1}),i=x1(e);if(n===void 0)n=i;else if(this.enablePrintAutoRotate&&i!==n)return{width:e.height,height:e.width,rotation:(e.rotation-90)%360};return{width:e.width,height:e.height,rotation:e.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(n){if(!(n instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${n}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=n,this.refresh(!1,{optionalContentConfigPromise:n}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:n}))}get scrollMode(){return this._scrollMode}set scrollMode(n){if(this._scrollMode!==n){if(!$k(n))throw new Error(`Invalid scroll mode: ${n}`);this.pagesCount>Qu.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this.clearSelection(),this._scrollMode=n,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:n}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(n=null){const t=this._scrollMode,e=this.viewer;e.classList.toggle("scrollHorizontal",t===Pt.HORIZONTAL),e.classList.toggle("scrollWrapped",t===Pt.WRAPPED),!(!this.pdfDocument||!n)&&(t===Pt.PAGE?v(At,this,Im).call(this):this._previousScrollMode===Pt.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&v(At,this,Bo).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(n,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(n){if(this._spreadMode!==n){if(!Hk(n))throw new Error(`Invalid spread mode: ${n}`);this.clearSelection(),this._spreadMode=n,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:n}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(n=null){if(!this.pdfDocument)return;const t=this.viewer,e=this._pages;if(this._scrollMode===Pt.PAGE)v(At,this,Im).call(this);else if(t.textContent="",this._spreadMode===Xe.NONE)for(const i of this._pages)t.append(i.div);else{const i=this._spreadMode-1;let r=null;for(let s=0,o=e.length;s<o;++s)r===null?(r=document.createElement("div"),r.className="spread",t.append(r)):s%2===i&&(r=r.cloneNode(!1),t.append(r)),r.append(e[s].div)}n&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&v(At,this,Bo).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(n,!0),this.update())}nextPage(){const n=this._currentPageNumber,t=this.pagesCount;if(n>=t)return!1;const e=v(At,this,rT).call(this,n,!1)||1;return this.currentPageNumber=Math.min(n+e,t),!0}previousPage(){const n=this._currentPageNumber;if(n<=1)return!1;const t=v(At,this,rT).call(this,n,!0)||1;return this.currentPageNumber=Math.max(n-t,1),!0}updateScale({drawingDelay:n,scaleFactor:t=null,steps:e=null,origin:i}){if(e===null&&t===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let r=this._currentScale;if(t>0&&t!==1)r=Math.round(r*t*100)/100;else if(e){const s=e>0?jw:1/jw,o=e>0?Math.ceil:Math.floor;e=Math.abs(e);do r=o((r*s).toFixed(2)*10)/10;while(--e>0)}r=wT(r,PT,CT),v(At,this,Bo).call(this,r,{noScroll:!1,drawingDelay:n,origin:i})}increaseScale(n={}){this.updateScale({...n,steps:n.steps??1})}decreaseScale(n={}){this.updateScale({...n,steps:-(n.steps??1)})}get containerTopLeft(){return a(qu,this)||p(qu,this,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return a(Ye,this)?a(Wi,this):pn.DISABLE}set annotationEditorMode({mode:n,editId:t=null,isFromKeyboard:e=!1,mustEnterInEditMode:i=!1,editComment:r=!1}){if(!a(Ye,this))throw new Error("The AnnotationEditor is not enabled.");if(a(Wi,this)===n)return;if(!tT(n))throw new Error(`Invalid AnnotationEditor mode: ${n}`);if(!this.pdfDocument)return;v(At,this,oT).call(this,n);const{eventBus:s,pdfDocument:o}=this,l=async()=>{v(At,this,kw).call(this),p(Wi,this,n),await a(Ye,this).updateMode(n,t,!0,e,i,r),!(n!==a(Wi,this)||o!==this.pdfDocument)&&s.dispatch("annotationeditormodechanged",{source:this,mode:n})};if(n===pn.NONE||a(Wi,this)===pn.NONE){const h=n!==pn.NONE;h||this.pdfDocument.annotationStorage.resetModifiedIds(),this.cleanup();for(const d of this._pages)d.toggleEditingMode(h);const c=v(At,this,JR).call(this);if(h&&c){v(At,this,kw).call(this),p(mc,this,new AbortController);const d=AbortSignal.any([a(rl,this).signal,a(mc,this).signal]);s.on("pagerendered",({pageNumber:u})=>{c.delete(u),c.size===0&&p(vc,this,setTimeout(l,0))},{signal:d,...sn});return}}l()}refresh(n=!1,t=Object.create(null)){if(this.pdfDocument){for(const e of this._pages)e.update(t);v(At,this,aT).call(this),n||this.update()}}},NP=class extends Ov{_resetView(){super._resetView(),this._scrollMode=Pt.PAGE,this._spreadMode=Xe.NONE}set scrollMode(n){}_updateScrollMode(){}set spreadMode(n){}_updateSpreadMode(){}},globalThis.pdfjsViewer={AnnotationLayerBuilder:Jw,DownloadManager:WT,EventBus:Fu,FindState:Qr,GenericL10n:Yo,LinkTarget:ea,parseQueryString:xm,PDFFindController:Zw,PDFHistory:bP,PDFLinkService:_m,PDFPageView:bx,PDFScriptingManager:OP,PDFSinglePageViewer:NP,PDFViewer:Ov,ProgressBar:kT,RenderingStates:kt,ScrollMode:Pt,SimpleLinkService:Bm,SpreadMode:Xe,StructTreeLayerBuilder:mx,TextLayerBuilder:lv,XfaLayerBuilder:yx}})),_P,RO=xt((()=>{_P=`/* Copyright 2014 Mozilla Foundation
594
+ *
595
+ * Licensed under the Apache License, Version 2.0 (the "License");
596
+ * you may not use this file except in compliance with the License.
597
+ * You may obtain a copy of the License at
598
+ *
599
+ * http://www.apache.org/licenses/LICENSE-2.0
600
+ *
601
+ * Unless required by applicable law or agreed to in writing, software
602
+ * distributed under the License is distributed on an "AS IS" BASIS,
603
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
604
+ * See the License for the specific language governing permissions and
605
+ * limitations under the License.
606
+ */
607
+
608
+ .textLayer {
609
+ color-scheme: only light;
610
+ position: absolute;
611
+ text-align: initial;
612
+ inset: 0;
613
+ overflow: clip;
614
+ opacity: 1;
615
+ line-height: 1;
616
+ letter-spacing: normal;
617
+ word-spacing: normal;
618
+ -webkit-text-size-adjust: none;
619
+ -moz-text-size-adjust: none;
620
+ text-size-adjust: none;
621
+ forced-color-adjust: none;
622
+ transform-origin: 0 0;
623
+ caret-color: CanvasText;
624
+ z-index: 0;
625
+ --min-font-size: 1;
626
+ --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
627
+ --min-font-size-inv: calc(1 / var(--min-font-size));
628
+ }
629
+
630
+ .textLayer.highlighting {
631
+ touch-action: none;
632
+ }
633
+
634
+ .textLayer :is(span, br) {
635
+ color: transparent;
636
+ position: absolute;
637
+ white-space: pre;
638
+ cursor: text;
639
+ transform-origin: 0% 0%;
640
+ -webkit-user-select: text;
641
+ -moz-user-select: text;
642
+ user-select: text;
643
+ }
644
+
645
+ .textLayer > :not(.markedContent),
646
+ .textLayer .markedContent span:not(.markedContent) {
647
+ z-index: 1;
648
+ --font-height: 0;
649
+ font-size: calc(var(--text-scale-factor) * var(--font-height));
650
+ --scale-x: 1;
651
+ --rotate: 0deg;
652
+ transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
653
+ }
654
+
655
+ .textLayer .markedContent {
656
+ display: contents;
657
+ }
658
+
659
+ .textLayer .markedContent.highlight {
660
+ background: transparent;
661
+ backdrop-filter: none;
662
+ margin: 0;
663
+ padding: 0;
664
+ }
665
+
666
+ .textLayer span[role='img'] {
667
+ -webkit-user-select: none;
668
+ -moz-user-select: none;
669
+ user-select: none;
670
+ cursor: default;
671
+ }
672
+
673
+ .textLayer .highlight {
674
+ --highlight-bg-color: rgb(180 0 170 / 0.25);
675
+ --highlight-selected-bg-color: rgb(0 100 0 / 0.25);
676
+ --highlight-backdrop-filter: none;
677
+ --highlight-selected-backdrop-filter: none;
678
+ margin: -1px;
679
+ padding: 1px;
680
+ background-color: var(--highlight-bg-color);
681
+ backdrop-filter: var(--highlight-backdrop-filter);
682
+ border-radius: 4px;
683
+ }
684
+
685
+ .textLayer .highlight.appended {
686
+ position: initial;
687
+ }
688
+
689
+ .textLayer .highlight.begin {
690
+ border-radius: 4px 0 0 4px;
691
+ }
692
+
693
+ .textLayer .highlight.end {
694
+ border-radius: 0 4px 4px 0;
695
+ }
696
+
697
+ .textLayer .highlight.middle {
698
+ border-radius: 0;
699
+ }
700
+
701
+ .textLayer .highlight.selected {
702
+ background-color: var(--highlight-selected-bg-color);
703
+ backdrop-filter: var(--highlight-selected-backdrop-filter);
704
+ scroll-margin-top: 50px;
705
+ }
706
+
707
+ .textLayer ::-moz-selection {
708
+ background: transparent;
709
+ }
710
+
711
+ .textLayer ::selection {
712
+ background: transparent;
713
+ }
714
+
715
+ .textLayer br::-moz-selection {
716
+ background: transparent;
717
+ }
718
+
719
+ .textLayer br::selection {
720
+ background: transparent;
721
+ }
722
+
723
+ .textLayer .endOfContent {
724
+ display: block;
725
+ position: absolute;
726
+ inset: 100% 0 0;
727
+ z-index: 0;
728
+ cursor: default;
729
+ -webkit-user-select: none;
730
+ -moz-user-select: none;
731
+ user-select: none;
732
+ }
733
+
734
+ .textLayer.selecting .endOfContent {
735
+ top: 0;
736
+ }
737
+
738
+ .textLayerImages {
739
+ position: absolute;
740
+ inset: 0;
741
+ -webkit-user-select: none;
742
+ -moz-user-select: none;
743
+ user-select: none;
744
+ }
745
+
746
+ .textLayerImages canvas {
747
+ position: absolute;
748
+ transform-origin: 0% 0%;
749
+ }
750
+
751
+ @media screen and (forced-colors: active) {
752
+ .textLayer .highlight {
753
+ --highlight-bg-color: transparent;
754
+ --highlight-selected-bg-color: transparent;
755
+ --highlight-backdrop-filter: var(--hcm-highlight-filter);
756
+ --highlight-selected-backdrop-filter: var(--hcm-highlight-selected-filter);
757
+ }
758
+ }
759
+
760
+
761
+ :root {
762
+ --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
763
+ }
764
+
765
+ @media (forced-colors: active) {
766
+ .annotationLayer .textWidgetAnnotation input:required,
767
+ .annotationLayer .textWidgetAnnotation textarea:required,
768
+ .annotationLayer .choiceWidgetAnnotation select:required,
769
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:required,
770
+ .annotationLayer .buttonWidgetAnnotation.radioButton input:required {
771
+ outline: 1.5px solid selectedItem;
772
+ }
773
+ }
774
+
775
+ .annotationLayer {
776
+ position: absolute;
777
+ top: 0;
778
+ left: 0;
779
+ pointer-events: none;
780
+ transform-origin: 0 0;
781
+ }
782
+
783
+ .annotationLayer section {
784
+ position: absolute;
785
+ text-align: initial;
786
+ pointer-events: auto;
787
+ box-sizing: border-box;
788
+ transform-origin: 0 0;
789
+ }
790
+
791
+ .annotationLayer .linkAnnotation > a,
792
+ .annotationLayer .buttonWidgetAnnotation.pushButton > a {
793
+ position: absolute;
794
+ font-size: 1em;
795
+ top: 0;
796
+ left: 0;
797
+ width: 100%;
798
+ height: 100%;
799
+ }
800
+
801
+ .annotationLayer .buttonWidgetAnnotation.pushButton > canvas {
802
+ width: 100%;
803
+ height: 100%;
804
+ }
805
+
806
+ .annotationLayer .linkAnnotation > a:hover,
807
+ .annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
808
+ opacity: 0.2;
809
+ background: rgba(255, 255, 0, 1);
810
+ box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
811
+ }
812
+
813
+ .annotationLayer .textAnnotation img {
814
+ position: absolute;
815
+ cursor: pointer;
816
+ width: 100%;
817
+ height: 100%;
818
+ }
819
+
820
+ .annotationLayer .textWidgetAnnotation input,
821
+ .annotationLayer .textWidgetAnnotation textarea,
822
+ .annotationLayer .choiceWidgetAnnotation select,
823
+ .annotationLayer .buttonWidgetAnnotation.checkBox input,
824
+ .annotationLayer .buttonWidgetAnnotation.radioButton input {
825
+ background-image: var(--annotation-unfocused-field-background);
826
+ border: 1px solid transparent;
827
+ box-sizing: border-box;
828
+ font: calc(9px * var(--scale-factor)) sans-serif;
829
+ height: 100%;
830
+ margin: 0;
831
+ vertical-align: top;
832
+ width: 100%;
833
+ }
834
+
835
+ .annotationLayer .textWidgetAnnotation input:required,
836
+ .annotationLayer .textWidgetAnnotation textarea:required,
837
+ .annotationLayer .choiceWidgetAnnotation select:required,
838
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:required,
839
+ .annotationLayer .buttonWidgetAnnotation.radioButton input:required {
840
+ outline: 1.5px solid red;
841
+ }
842
+
843
+ .annotationLayer .choiceWidgetAnnotation select option {
844
+ padding: 0;
845
+ }
846
+
847
+ .annotationLayer .buttonWidgetAnnotation.radioButton input {
848
+ border-radius: 50%;
849
+ }
850
+
851
+ .annotationLayer .textWidgetAnnotation textarea {
852
+ resize: none;
853
+ }
854
+
855
+ .annotationLayer .textWidgetAnnotation input[disabled],
856
+ .annotationLayer .textWidgetAnnotation textarea[disabled],
857
+ .annotationLayer .choiceWidgetAnnotation select[disabled],
858
+ .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
859
+ .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
860
+ background: none;
861
+ border: 1px solid transparent;
862
+ cursor: not-allowed;
863
+ }
864
+
865
+ .annotationLayer .textWidgetAnnotation input:hover,
866
+ .annotationLayer .textWidgetAnnotation textarea:hover,
867
+ .annotationLayer .choiceWidgetAnnotation select:hover,
868
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
869
+ .annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
870
+ border: 1px solid rgba(0, 0, 0, 1);
871
+ }
872
+
873
+ .annotationLayer .textWidgetAnnotation input:focus,
874
+ .annotationLayer .textWidgetAnnotation textarea:focus,
875
+ .annotationLayer .choiceWidgetAnnotation select:focus {
876
+ background: none;
877
+ border: 1px solid transparent;
878
+ }
879
+
880
+ .annotationLayer .textWidgetAnnotation input :focus,
881
+ .annotationLayer .textWidgetAnnotation textarea :focus,
882
+ .annotationLayer .choiceWidgetAnnotation select :focus,
883
+ .annotationLayer .buttonWidgetAnnotation.checkBox :focus,
884
+ .annotationLayer .buttonWidgetAnnotation.radioButton :focus {
885
+ background-image: none;
886
+ background-color: transparent;
887
+ outline: auto;
888
+ }
889
+
890
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
891
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
892
+ .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
893
+ background-color: CanvasText;
894
+ content: "";
895
+ display: block;
896
+ position: absolute;
897
+ }
898
+
899
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
900
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
901
+ height: 80%;
902
+ left: 45%;
903
+ width: 1px;
904
+ }
905
+
906
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
907
+ transform: rotate(45deg);
908
+ }
909
+
910
+ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
911
+ transform: rotate(-45deg);
912
+ }
913
+
914
+ .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
915
+ border-radius: 50%;
916
+ height: 50%;
917
+ left: 30%;
918
+ top: 20%;
919
+ width: 50%;
920
+ }
921
+
922
+ .annotationLayer .textWidgetAnnotation input.comb {
923
+ font-family: monospace;
924
+ padding-left: 2px;
925
+ padding-right: 0;
926
+ }
927
+
928
+ .annotationLayer .textWidgetAnnotation input.comb:focus {
929
+ /*
930
+ * Letter spacing is placed on the right side of each character. Hence, the
931
+ * letter spacing of the last character may be placed outside the visible
932
+ * area, causing horizontal scrolling. We avoid this by extending the width
933
+ * when the element has focus and revert this when it loses focus.
934
+ */
935
+ width: 103%;
936
+ }
937
+
938
+ .annotationLayer .buttonWidgetAnnotation.checkBox input,
939
+ .annotationLayer .buttonWidgetAnnotation.radioButton input {
940
+ -webkit-appearance: none;
941
+ -moz-appearance: none;
942
+ appearance: none;
943
+ }
944
+
945
+ .annotationLayer .popupTriggerArea {
946
+ height: 100%;
947
+ width: 100%;
948
+ }
949
+
950
+ .annotationLayer .popupWrapper {
951
+ position: absolute;
952
+ font-size: calc(9px * var(--scale-factor));
953
+ width: 100%;
954
+ min-width: calc(180px * var(--scale-factor));
955
+ pointer-events: none;
956
+ }
957
+
958
+ .annotationLayer .popup {
959
+ position: absolute;
960
+ z-index: 200;
961
+ max-width: calc(180px * var(--scale-factor));
962
+ background-color: rgba(255, 255, 153, 1);
963
+ box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor))
964
+ rgba(136, 136, 136, 1);
965
+ border-radius: calc(2px * var(--scale-factor));
966
+ padding: calc(6px * var(--scale-factor));
967
+ margin-left: calc(5px * var(--scale-factor));
968
+ cursor: pointer;
969
+ font: message-box;
970
+ white-space: normal;
971
+ word-wrap: break-word;
972
+ pointer-events: auto;
973
+ }
974
+
975
+ .annotationLayer .popup > * {
976
+ font-size: calc(9px * var(--scale-factor));
977
+ }
978
+
979
+ .annotationLayer .popup h1 {
980
+ display: inline-block;
981
+ }
982
+
983
+ .annotationLayer .popupDate {
984
+ display: inline-block;
985
+ margin-left: calc(5px * var(--scale-factor));
986
+ }
987
+
988
+ .annotationLayer .popupContent {
989
+ border-top: 1px solid rgba(51, 51, 51, 1);
990
+ margin-top: calc(2px * var(--scale-factor));
991
+ padding-top: calc(2px * var(--scale-factor));
992
+ }
993
+
994
+ .annotationLayer .richText > * {
995
+ white-space: pre-wrap;
996
+ font-size: calc(9px * var(--scale-factor));
997
+ }
998
+
999
+ .annotationLayer .highlightAnnotation,
1000
+ .annotationLayer .underlineAnnotation,
1001
+ .annotationLayer .squigglyAnnotation,
1002
+ .annotationLayer .strikeoutAnnotation,
1003
+ .annotationLayer .freeTextAnnotation,
1004
+ .annotationLayer .lineAnnotation svg line,
1005
+ .annotationLayer .squareAnnotation svg rect,
1006
+ .annotationLayer .circleAnnotation svg ellipse,
1007
+ .annotationLayer .polylineAnnotation svg polyline,
1008
+ .annotationLayer .polygonAnnotation svg polygon,
1009
+ .annotationLayer .caretAnnotation,
1010
+ .annotationLayer .inkAnnotation svg polyline,
1011
+ .annotationLayer .stampAnnotation,
1012
+ .annotationLayer .fileAttachmentAnnotation {
1013
+ cursor: pointer;
1014
+ }
1015
+
1016
+ .annotationLayer section svg {
1017
+ position: absolute;
1018
+ width: 100%;
1019
+ height: 100%;
1020
+ }
1021
+
1022
+
1023
+ :root {
1024
+ --xfa-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
1025
+ }
1026
+
1027
+ @media (forced-colors: active) {
1028
+ .xfaLayer *:required {
1029
+ outline: 1.5px solid selectedItem;
1030
+ }
1031
+ }
1032
+
1033
+ .xfaLayer .highlight {
1034
+ margin: -1px;
1035
+ padding: 1px;
1036
+ background-color: rgba(239, 203, 237, 1);
1037
+ border-radius: 4px;
1038
+ }
1039
+
1040
+ .xfaLayer .highlight.appended {
1041
+ position: initial;
1042
+ }
1043
+
1044
+ .xfaLayer .highlight.begin {
1045
+ border-radius: 4px 0 0 4px;
1046
+ }
1047
+
1048
+ .xfaLayer .highlight.end {
1049
+ border-radius: 0 4px 4px 0;
1050
+ }
1051
+
1052
+ .xfaLayer .highlight.middle {
1053
+ border-radius: 0;
1054
+ }
1055
+
1056
+ .xfaLayer .highlight.selected {
1057
+ background-color: rgba(203, 223, 203, 1);
1058
+ }
1059
+
1060
+ .xfaLayer ::-moz-selection {
1061
+ background: rgba(0, 0, 255, 1);
1062
+ }
1063
+
1064
+ .xfaLayer ::selection {
1065
+ background: rgba(0, 0, 255, 1);
1066
+ }
1067
+
1068
+ .xfaPage {
1069
+ overflow: hidden;
1070
+ position: relative;
1071
+ }
1072
+
1073
+ .xfaContentarea {
1074
+ position: absolute;
1075
+ }
1076
+
1077
+ .xfaPrintOnly {
1078
+ display: none;
1079
+ }
1080
+
1081
+ .xfaLayer {
1082
+ position: absolute;
1083
+ text-align: initial;
1084
+ top: 0;
1085
+ left: 0;
1086
+ transform-origin: 0 0;
1087
+ line-height: 1.2;
1088
+ }
1089
+
1090
+ .xfaLayer * {
1091
+ color: inherit;
1092
+ font: inherit;
1093
+ font-style: inherit;
1094
+ font-weight: inherit;
1095
+ font-kerning: inherit;
1096
+ letter-spacing: -0.01px;
1097
+ text-align: inherit;
1098
+ text-decoration: inherit;
1099
+ box-sizing: border-box;
1100
+ background-color: transparent;
1101
+ padding: 0;
1102
+ margin: 0;
1103
+ pointer-events: auto;
1104
+ line-height: inherit;
1105
+ }
1106
+
1107
+ .xfaLayer *:required {
1108
+ outline: 1.5px solid red;
1109
+ }
1110
+
1111
+ .xfaLayer div {
1112
+ pointer-events: none;
1113
+ }
1114
+
1115
+ .xfaLayer svg {
1116
+ pointer-events: none;
1117
+ }
1118
+
1119
+ .xfaLayer svg * {
1120
+ pointer-events: none;
1121
+ }
1122
+
1123
+ .xfaLayer a {
1124
+ color: blue;
1125
+ }
1126
+
1127
+ .xfaRich li {
1128
+ margin-left: 3em;
1129
+ }
1130
+
1131
+ .xfaFont {
1132
+ color: black;
1133
+ font-weight: normal;
1134
+ font-kerning: none;
1135
+ font-size: 10px;
1136
+ font-style: normal;
1137
+ letter-spacing: 0;
1138
+ text-decoration: none;
1139
+ vertical-align: 0;
1140
+ }
1141
+
1142
+ .xfaCaption {
1143
+ overflow: hidden;
1144
+ flex: 0 0 auto;
1145
+ }
1146
+
1147
+ .xfaCaptionForCheckButton {
1148
+ overflow: hidden;
1149
+ flex: 1 1 auto;
1150
+ }
1151
+
1152
+ .xfaLabel {
1153
+ height: 100%;
1154
+ width: 100%;
1155
+ }
1156
+
1157
+ .xfaLeft {
1158
+ display: flex;
1159
+ flex-direction: row;
1160
+ align-items: center;
1161
+ }
1162
+
1163
+ .xfaRight {
1164
+ display: flex;
1165
+ flex-direction: row-reverse;
1166
+ align-items: center;
1167
+ }
1168
+
1169
+ .xfaLeft > .xfaCaption,
1170
+ .xfaLeft > .xfaCaptionForCheckButton,
1171
+ .xfaRight > .xfaCaption,
1172
+ .xfaRight > .xfaCaptionForCheckButton {
1173
+ max-height: 100%;
1174
+ }
1175
+
1176
+ .xfaTop {
1177
+ display: flex;
1178
+ flex-direction: column;
1179
+ align-items: flex-start;
1180
+ }
1181
+
1182
+ .xfaBottom {
1183
+ display: flex;
1184
+ flex-direction: column-reverse;
1185
+ align-items: flex-start;
1186
+ }
1187
+
1188
+ .xfaTop > .xfaCaption,
1189
+ .xfaTop > .xfaCaptionForCheckButton,
1190
+ .xfaBottom > .xfaCaption,
1191
+ .xfaBottom > .xfaCaptionForCheckButton {
1192
+ width: 100%;
1193
+ }
1194
+
1195
+ .xfaBorder {
1196
+ background-color: transparent;
1197
+ position: absolute;
1198
+ pointer-events: none;
1199
+ }
1200
+
1201
+ .xfaWrapped {
1202
+ width: 100%;
1203
+ height: 100%;
1204
+ }
1205
+
1206
+ .xfaTextfield:focus,
1207
+ .xfaSelect:focus {
1208
+ background-image: none;
1209
+ background-color: transparent;
1210
+ outline: auto;
1211
+ outline-offset: -1px;
1212
+ }
1213
+
1214
+ .xfaCheckbox:focus,
1215
+ .xfaRadio:focus {
1216
+ outline: auto;
1217
+ }
1218
+
1219
+ .xfaTextfield,
1220
+ .xfaSelect {
1221
+ height: 100%;
1222
+ width: 100%;
1223
+ flex: 1 1 auto;
1224
+ border: none;
1225
+ resize: none;
1226
+ background-image: var(--xfa-unfocused-field-background);
1227
+ }
1228
+
1229
+ .xfaTop > .xfaTextfield,
1230
+ .xfaTop > .xfaSelect,
1231
+ .xfaBottom > .xfaTextfield,
1232
+ .xfaBottom > .xfaSelect {
1233
+ flex: 0 1 auto;
1234
+ }
1235
+
1236
+ .xfaButton {
1237
+ cursor: pointer;
1238
+ width: 100%;
1239
+ height: 100%;
1240
+ border: none;
1241
+ text-align: center;
1242
+ }
1243
+
1244
+ .xfaLink {
1245
+ width: 100%;
1246
+ height: 100%;
1247
+ position: absolute;
1248
+ top: 0;
1249
+ left: 0;
1250
+ }
1251
+
1252
+ .xfaCheckbox,
1253
+ .xfaRadio {
1254
+ width: 100%;
1255
+ height: 100%;
1256
+ flex: 0 0 auto;
1257
+ border: none;
1258
+ }
1259
+
1260
+ .xfaRich {
1261
+ white-space: pre-wrap;
1262
+ width: 100%;
1263
+ height: 100%;
1264
+ }
1265
+
1266
+ .xfaImage {
1267
+ -o-object-position: left top;
1268
+ object-position: left top;
1269
+ -o-object-fit: contain;
1270
+ object-fit: contain;
1271
+ width: 100%;
1272
+ height: 100%;
1273
+ }
1274
+
1275
+ .xfaLrTb,
1276
+ .xfaRlTb,
1277
+ .xfaTb {
1278
+ display: flex;
1279
+ flex-direction: column;
1280
+ align-items: stretch;
1281
+ }
1282
+
1283
+ .xfaLr {
1284
+ display: flex;
1285
+ flex-direction: row;
1286
+ align-items: stretch;
1287
+ }
1288
+
1289
+ .xfaRl {
1290
+ display: flex;
1291
+ flex-direction: row-reverse;
1292
+ align-items: stretch;
1293
+ }
1294
+
1295
+ .xfaTb > div {
1296
+ justify-content: left;
1297
+ }
1298
+
1299
+ .xfaPosition {
1300
+ position: relative;
1301
+ }
1302
+
1303
+ .xfaArea {
1304
+ position: relative;
1305
+ }
1306
+
1307
+ .xfaValignMiddle {
1308
+ display: flex;
1309
+ align-items: center;
1310
+ }
1311
+
1312
+ .xfaTable {
1313
+ display: flex;
1314
+ flex-direction: column;
1315
+ align-items: stretch;
1316
+ }
1317
+
1318
+ .xfaTable .xfaRow {
1319
+ display: flex;
1320
+ flex-direction: row;
1321
+ align-items: stretch;
1322
+ }
1323
+
1324
+ .xfaTable .xfaRlRow {
1325
+ display: flex;
1326
+ flex-direction: row-reverse;
1327
+ align-items: stretch;
1328
+ flex: 1;
1329
+ }
1330
+
1331
+ .xfaTable .xfaRlRow > div {
1332
+ flex: 1;
1333
+ }
1334
+
1335
+ .xfaNonInteractive input,
1336
+ .xfaNonInteractive textarea,
1337
+ .xfaDisabled input,
1338
+ .xfaDisabled textarea,
1339
+ .xfaReadOnly input,
1340
+ .xfaReadOnly textarea {
1341
+ background: initial;
1342
+ }
1343
+
1344
+ @media print {
1345
+ .xfaTextfield,
1346
+ .xfaSelect {
1347
+ background: transparent;
1348
+ }
1349
+
1350
+ .xfaSelect {
1351
+ -webkit-appearance: none;
1352
+ -moz-appearance: none;
1353
+ appearance: none;
1354
+ text-indent: 1px;
1355
+ text-overflow: "";
1356
+ }
1357
+ }
1358
+
1359
+
1360
+ :root {
1361
+ --focus-outline: solid 2px red;
1362
+ --hover-outline: dashed 2px blue;
1363
+ --freetext-line-height: 1.35;
1364
+ --freetext-padding: 2px;
1365
+ }
1366
+
1367
+ @media (forced-colors: active) {
1368
+ :root {
1369
+ --focus-outline: solid 3px ButtonText;
1370
+ --hover-outline: dashed 3px ButtonText;
1371
+ }
1372
+ }
1373
+
1374
+ [data-editor-rotation="90"] {
1375
+ transform: rotate(90deg);
1376
+ }
1377
+ [data-editor-rotation="180"] {
1378
+ transform: rotate(180deg);
1379
+ }
1380
+ [data-editor-rotation="270"] {
1381
+ transform: rotate(270deg);
1382
+ }
1383
+
1384
+ .annotationEditorLayer {
1385
+ background: transparent;
1386
+ position: absolute;
1387
+ top: 0;
1388
+ left: 0;
1389
+ font-size: calc(100px * var(--scale-factor));
1390
+ transform-origin: 0 0;
1391
+ }
1392
+
1393
+ .annotationEditorLayer .selectedEditor {
1394
+ outline: var(--focus-outline);
1395
+ resize: none;
1396
+ }
1397
+
1398
+ .annotationEditorLayer .freeTextEditor {
1399
+ position: absolute;
1400
+ background: transparent;
1401
+ border-radius: 3px;
1402
+ padding: calc(var(--freetext-padding) * var(--scale-factor));
1403
+ resize: none;
1404
+ width: auto;
1405
+ height: auto;
1406
+ z-index: 1;
1407
+ transform-origin: 0 0;
1408
+ touch-action: none;
1409
+ }
1410
+
1411
+ .annotationEditorLayer .freeTextEditor .internal {
1412
+ background: transparent;
1413
+ border: none;
1414
+ top: 0;
1415
+ left: 0;
1416
+ overflow: visible;
1417
+ white-space: nowrap;
1418
+ resize: none;
1419
+ font: 10px sans-serif;
1420
+ line-height: var(--freetext-line-height);
1421
+ }
1422
+
1423
+ .annotationEditorLayer .freeTextEditor .overlay {
1424
+ position: absolute;
1425
+ display: none;
1426
+ background: transparent;
1427
+ top: 0;
1428
+ left: 0;
1429
+ width: 100%;
1430
+ height: 100%;
1431
+ }
1432
+
1433
+ .annotationEditorLayer .freeTextEditor .overlay.enabled {
1434
+ display: block;
1435
+ }
1436
+
1437
+ .annotationEditorLayer .freeTextEditor .internal:empty::before {
1438
+ content: attr(default-content);
1439
+ color: gray;
1440
+ }
1441
+
1442
+ .annotationEditorLayer .freeTextEditor .internal:focus {
1443
+ outline: none;
1444
+ }
1445
+
1446
+ .annotationEditorLayer .inkEditor.disabled {
1447
+ resize: none;
1448
+ }
1449
+
1450
+ .annotationEditorLayer .inkEditor.disabled.selectedEditor {
1451
+ resize: horizontal;
1452
+ }
1453
+
1454
+ .annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor),
1455
+ .annotationEditorLayer .inkEditor:hover:not(.selectedEditor) {
1456
+ outline: var(--hover-outline);
1457
+ }
1458
+
1459
+ .annotationEditorLayer .inkEditor {
1460
+ position: absolute;
1461
+ background: transparent;
1462
+ border-radius: 3px;
1463
+ overflow: auto;
1464
+ width: 100%;
1465
+ height: 100%;
1466
+ z-index: 1;
1467
+ transform-origin: 0 0;
1468
+ cursor: auto;
1469
+ }
1470
+
1471
+ .annotationEditorLayer .inkEditor.editing {
1472
+ resize: none;
1473
+ cursor: var(--editorInk-editing-cursor), pointer;
1474
+ }
1475
+
1476
+ .annotationEditorLayer .inkEditor .inkEditorCanvas {
1477
+ position: absolute;
1478
+ top: 0;
1479
+ left: 0;
1480
+ width: 100%;
1481
+ height: 100%;
1482
+ touch-action: none;
1483
+ }
1484
+
1485
+ :root {
1486
+ --viewer-container-height: 0;
1487
+ --pdfViewer-padding-bottom: 0;
1488
+ --page-margin: 1px auto -8px;
1489
+ --page-border: 9px solid transparent;
1490
+ --page-border-image: url(images/shadow.png) 9 9 repeat;
1491
+ --spreadHorizontalWrapped-margin-LR: -3.5px;
1492
+ --scale-factor: 1;
1493
+ }
1494
+
1495
+ @media screen and (forced-colors: active) {
1496
+ :root {
1497
+ --pdfViewer-padding-bottom: 9px;
1498
+ --page-margin: 8px auto -1px;
1499
+ --page-border: 1px solid CanvasText;
1500
+ --page-border-image: none;
1501
+ --spreadHorizontalWrapped-margin-LR: 3.5px;
1502
+ }
1503
+ }
1504
+
1505
+ .pdfViewer,
1506
+ .pdfViewer *,
1507
+ .pdfViewer *::before,
1508
+ .pdfViewer *::after {
1509
+ box-sizing: content-box;
1510
+ }
1511
+
1512
+ [data-main-rotation="90"] {
1513
+ transform: rotate(90deg) translateY(-100%);
1514
+ }
1515
+ [data-main-rotation="180"] {
1516
+ transform: rotate(180deg) translate(-100%, -100%);
1517
+ }
1518
+ [data-main-rotation="270"] {
1519
+ transform: rotate(270deg) translateX(-100%);
1520
+ }
1521
+
1522
+ .pdfViewer {
1523
+ padding-bottom: var(--pdfViewer-padding-bottom);
1524
+ }
1525
+
1526
+ .pdfViewer .canvasWrapper {
1527
+ overflow: hidden;
1528
+ width: 100%;
1529
+ height: 100%;
1530
+ }
1531
+
1532
+ .pdfViewer .page {
1533
+ --user-unit: 1;
1534
+ --total-scale-factor: calc(var(--scale-factor) * var(--user-unit));
1535
+ --scale-round-x: 1px;
1536
+ --scale-round-y: 1px;
1537
+ direction: ltr;
1538
+ width: 816px;
1539
+ height: 1056px;
1540
+ margin: var(--page-margin);
1541
+ position: relative;
1542
+ overflow: visible;
1543
+ border: var(--page-border);
1544
+ -o-border-image: var(--page-border-image);
1545
+ border-image: var(--page-border-image);
1546
+ background-clip: content-box;
1547
+ background-color: rgba(255, 255, 255, 1);
1548
+ }
1549
+
1550
+ .pdfViewer .dummyPage {
1551
+ position: relative;
1552
+ width: 0;
1553
+ height: var(--viewer-container-height);
1554
+ }
1555
+
1556
+ .pdfViewer.removePageBorders .page {
1557
+ margin: 0 auto 10px;
1558
+ border: none;
1559
+ }
1560
+
1561
+ .pdfViewer.singlePageView {
1562
+ display: inline-block;
1563
+ }
1564
+
1565
+ .pdfViewer.singlePageView .page {
1566
+ margin: 0;
1567
+ border: none;
1568
+ }
1569
+
1570
+ .pdfViewer.scrollHorizontal,
1571
+ .pdfViewer.scrollWrapped,
1572
+ .spread {
1573
+ margin-left: 3.5px;
1574
+ margin-right: 3.5px;
1575
+ text-align: center;
1576
+ }
1577
+
1578
+ .pdfViewer.scrollHorizontal,
1579
+ .spread {
1580
+ white-space: nowrap;
1581
+ }
1582
+
1583
+ .pdfViewer.removePageBorders,
1584
+ .pdfViewer.scrollHorizontal .spread,
1585
+ .pdfViewer.scrollWrapped .spread {
1586
+ margin-left: 0;
1587
+ margin-right: 0;
1588
+ }
1589
+
1590
+ .spread .page,
1591
+ .spread .dummyPage,
1592
+ .pdfViewer.scrollHorizontal .page,
1593
+ .pdfViewer.scrollWrapped .page,
1594
+ .pdfViewer.scrollHorizontal .spread,
1595
+ .pdfViewer.scrollWrapped .spread {
1596
+ display: inline-block;
1597
+ vertical-align: middle;
1598
+ }
1599
+
1600
+ .spread .page,
1601
+ .pdfViewer.scrollHorizontal .page,
1602
+ .pdfViewer.scrollWrapped .page {
1603
+ margin-left: var(--spreadHorizontalWrapped-margin-LR);
1604
+ margin-right: var(--spreadHorizontalWrapped-margin-LR);
1605
+ }
1606
+
1607
+ .pdfViewer.removePageBorders .spread .page,
1608
+ .pdfViewer.removePageBorders.scrollHorizontal .page,
1609
+ .pdfViewer.removePageBorders.scrollWrapped .page {
1610
+ margin-left: 5px;
1611
+ margin-right: 5px;
1612
+ }
1613
+
1614
+ .pdfViewer .page canvas {
1615
+ position: absolute;
1616
+ top: 0;
1617
+ left: 0;
1618
+ margin: 0;
1619
+ display: block;
1620
+ width: 100%;
1621
+ height: 100%;
1622
+ contain: content;
1623
+ }
1624
+
1625
+ .pdfViewer .page canvas[hidden] {
1626
+ display: none;
1627
+ }
1628
+
1629
+ .pdfViewer .page .loadingIcon {
1630
+ position: absolute;
1631
+ display: block;
1632
+ left: 0;
1633
+ top: 0;
1634
+ right: 0;
1635
+ bottom: 0;
1636
+ background: url("./images/loading-icon.gif") center no-repeat;
1637
+ }
1638
+ .pdfViewer .page .loadingIcon.notVisible {
1639
+ background: none;
1640
+ }
1641
+
1642
+ .pdfViewer.enablePermissions .textLayer span {
1643
+ -webkit-user-select: none !important;
1644
+ -moz-user-select: none !important;
1645
+ user-select: none !important;
1646
+ cursor: not-allowed;
1647
+ }
1648
+
1649
+ .pdfPresentationMode .pdfViewer {
1650
+ padding-bottom: 0;
1651
+ }
1652
+
1653
+ .pdfPresentationMode .spread {
1654
+ margin: 0;
1655
+ }
1656
+
1657
+ .pdfPresentationMode .pdfViewer .page {
1658
+ margin: 0 auto;
1659
+ border: 2px solid transparent;
1660
+ }
1661
+
1662
+
1663
+ .pdf-shell {
1664
+ position: relative;
1665
+ display: flex;
1666
+ flex-direction: column;
1667
+ width: 100%;
1668
+ height: 100%;
1669
+ min-height: 0;
1670
+ color: #1f2937;
1671
+ background: #edf2f7;
1672
+ }
1673
+
1674
+ .pdf-toolbar {
1675
+ z-index: 2;
1676
+ display: flex;
1677
+ align-items: center;
1678
+ gap: 10px;
1679
+ min-height: 48px;
1680
+ padding: 6px 12px;
1681
+ border-bottom: 1px solid #d7dee8;
1682
+ background: #ffffff;
1683
+ box-shadow: 0 1px 4px rgb(15 23 42 / 8%);
1684
+ }
1685
+
1686
+ .pdf-toolbar-group {
1687
+ display: inline-flex;
1688
+ align-items: center;
1689
+ gap: 6px;
1690
+ height: 36px;
1691
+ padding: 0 6px;
1692
+ border: 1px solid #dde5ef;
1693
+ border-radius: 8px;
1694
+ background: #f8fafc;
1695
+ }
1696
+
1697
+ .pdf-toolbar-group--zoom {
1698
+ margin-left: auto;
1699
+ }
1700
+
1701
+ .pdf-toolbar-group--rotate {
1702
+ flex-shrink: 0;
1703
+ }
1704
+
1705
+ .pdf-icon-button,
1706
+ .pdf-scale-button {
1707
+ display: inline-flex;
1708
+ align-items: center;
1709
+ justify-content: center;
1710
+ height: 30px;
1711
+ border: 1px solid transparent;
1712
+ border-radius: 6px;
1713
+ color: #334155;
1714
+ background: transparent;
1715
+ font: inherit;
1716
+ line-height: 1;
1717
+ cursor: pointer;
1718
+ transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
1719
+ }
1720
+
1721
+ .pdf-icon-button {
1722
+ width: 30px;
1723
+ font-size: 18px;
1724
+ }
1725
+
1726
+ .pdf-scale-button {
1727
+ width: 64px;
1728
+ font-size: 13px;
1729
+ font-weight: 600;
1730
+ }
1731
+
1732
+ .pdf-icon-button:hover:not(:disabled),
1733
+ .pdf-scale-button:hover {
1734
+ border-color: #b9c8d8;
1735
+ color: #1769d8;
1736
+ background: #edf5ff;
1737
+ }
1738
+
1739
+ .pdf-icon-button:disabled {
1740
+ color: #a8b3c0;
1741
+ cursor: not-allowed;
1742
+ }
1743
+
1744
+ .pdf-icon-button--active {
1745
+ border-color: #9ac2ff;
1746
+ color: #1769d8;
1747
+ background: #e7f1ff;
1748
+ }
1749
+
1750
+ .pdf-panel-icon {
1751
+ position: relative;
1752
+ display: block;
1753
+ width: 16px;
1754
+ height: 14px;
1755
+ border: 2px solid currentColor;
1756
+ border-radius: 3px;
1757
+ }
1758
+
1759
+ .pdf-panel-icon::before {
1760
+ position: absolute;
1761
+ top: -2px;
1762
+ bottom: -2px;
1763
+ left: 4px;
1764
+ width: 2px;
1765
+ background: currentColor;
1766
+ content: '';
1767
+ }
1768
+
1769
+ .pdf-page-meter {
1770
+ display: inline-flex;
1771
+ align-items: baseline;
1772
+ justify-content: center;
1773
+ min-width: 72px;
1774
+ gap: 3px;
1775
+ font-size: 13px;
1776
+ color: #64748b;
1777
+ white-space: nowrap;
1778
+ }
1779
+
1780
+ .pdf-page-meter strong {
1781
+ color: #1e293b;
1782
+ font-size: 14px;
1783
+ }
1784
+
1785
+ .pdf-rotation-meter {
1786
+ display: inline-flex;
1787
+ align-items: center;
1788
+ justify-content: center;
1789
+ min-width: 42px;
1790
+ color: #64748b;
1791
+ font-size: 13px;
1792
+ font-weight: 700;
1793
+ white-space: nowrap;
1794
+ }
1795
+
1796
+ .pdf-content {
1797
+ position: relative;
1798
+ display: grid;
1799
+ grid-template-columns: clamp(148px, 22%, 220px) minmax(0, 1fr);
1800
+ flex: 1;
1801
+ min-height: 0;
1802
+ }
1803
+
1804
+ .pdf-shell--nav-hidden .pdf-content {
1805
+ grid-template-columns: minmax(0, 1fr);
1806
+ }
1807
+
1808
+ .pdf-nav-pane {
1809
+ display: flex;
1810
+ flex-direction: column;
1811
+ min-width: 0;
1812
+ min-height: 0;
1813
+ overflow: hidden;
1814
+ border-right: 1px solid #d7dee8;
1815
+ background: #f8fafc;
1816
+ }
1817
+
1818
+ .pdf-nav-head {
1819
+ display: flex;
1820
+ align-items: center;
1821
+ justify-content: space-between;
1822
+ height: 44px;
1823
+ padding: 0 12px;
1824
+ border-bottom: 1px solid #e3e9f1;
1825
+ color: #475569;
1826
+ font-size: 13px;
1827
+ }
1828
+
1829
+ .pdf-nav-head strong {
1830
+ color: #1e293b;
1831
+ font-size: 12px;
1832
+ }
1833
+
1834
+ .pdf-nav-tabs {
1835
+ display: grid;
1836
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1837
+ gap: 4px;
1838
+ padding: 8px;
1839
+ border-bottom: 1px solid #e3e9f1;
1840
+ background: #f8fafc;
1841
+ }
1842
+
1843
+ .pdf-nav-tabs button {
1844
+ min-width: 0;
1845
+ height: 30px;
1846
+ border: 1px solid transparent;
1847
+ border-radius: 6px;
1848
+ color: #64748b;
1849
+ background: transparent;
1850
+ font: inherit;
1851
+ font-size: 12px;
1852
+ font-weight: 700;
1853
+ cursor: pointer;
1854
+ }
1855
+
1856
+ .pdf-nav-tabs button:hover,
1857
+ .pdf-nav-tabs button.active {
1858
+ border-color: #b9d4f6;
1859
+ color: #1769d8;
1860
+ background: #edf5ff;
1861
+ }
1862
+
1863
+ .pdf-page-list {
1864
+ flex: 1;
1865
+ min-height: 0;
1866
+ display: grid;
1867
+ align-content: start;
1868
+ gap: 8px;
1869
+ padding: 10px;
1870
+ overflow-y: auto;
1871
+ }
1872
+
1873
+ .pdf-page-button {
1874
+ display: grid;
1875
+ grid-template-columns: 42px minmax(0, 1fr);
1876
+ align-items: center;
1877
+ gap: 10px;
1878
+ width: 100%;
1879
+ min-height: 54px;
1880
+ padding: 6px 8px;
1881
+ border: 1px solid #dce4ee;
1882
+ border-radius: 8px;
1883
+ color: #334155;
1884
+ background: #ffffff;
1885
+ cursor: pointer;
1886
+ text-align: left;
1887
+ transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
1888
+ }
1889
+
1890
+ .pdf-page-button:hover {
1891
+ border-color: #a9c5ea;
1892
+ background: #f3f8ff;
1893
+ }
1894
+
1895
+ .pdf-page-button--active {
1896
+ border-color: #408fff;
1897
+ background: #eaf3ff;
1898
+ box-shadow: inset 3px 0 0 #408fff;
1899
+ }
1900
+
1901
+ .pdf-page-thumb {
1902
+ display: inline-flex;
1903
+ align-items: center;
1904
+ justify-content: center;
1905
+ width: 34px;
1906
+ height: 42px;
1907
+ border: 1px solid #d6e1ee;
1908
+ border-radius: 4px;
1909
+ color: #1769d8;
1910
+ background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
1911
+ font-size: 12px;
1912
+ font-weight: 700;
1913
+ }
1914
+
1915
+ .pdf-page-label {
1916
+ min-width: 0;
1917
+ overflow: hidden;
1918
+ font-size: 13px;
1919
+ text-overflow: ellipsis;
1920
+ white-space: nowrap;
1921
+ }
1922
+
1923
+ .pdf-outline-list {
1924
+ flex: 1;
1925
+ min-height: 0;
1926
+ display: grid;
1927
+ align-content: start;
1928
+ gap: 4px;
1929
+ padding: 8px;
1930
+ overflow-y: auto;
1931
+ }
1932
+
1933
+ .pdf-outline-button {
1934
+ --outline-depth: 0;
1935
+ display: grid;
1936
+ grid-template-columns: 16px minmax(0, 1fr);
1937
+ align-items: center;
1938
+ gap: 6px;
1939
+ width: 100%;
1940
+ min-height: 32px;
1941
+ padding: 5px 7px 5px calc(7px + var(--outline-depth) * 14px);
1942
+ border: 1px solid transparent;
1943
+ border-radius: 6px;
1944
+ color: #334155;
1945
+ background: transparent;
1946
+ font: inherit;
1947
+ text-align: left;
1948
+ cursor: pointer;
1949
+ }
1950
+
1951
+ .pdf-outline-button:hover {
1952
+ border-color: #c7d7eb;
1953
+ background: #ffffff;
1954
+ }
1955
+
1956
+ .pdf-outline-toggle {
1957
+ position: relative;
1958
+ width: 14px;
1959
+ height: 14px;
1960
+ border-radius: 4px;
1961
+ color: #64748b;
1962
+ }
1963
+
1964
+ .pdf-outline-toggle::before {
1965
+ position: absolute;
1966
+ top: 3px;
1967
+ left: 4px;
1968
+ width: 6px;
1969
+ height: 6px;
1970
+ border-right: 2px solid currentColor;
1971
+ border-bottom: 2px solid currentColor;
1972
+ content: '';
1973
+ transform: rotate(-45deg);
1974
+ transition: transform 0.16s ease;
1975
+ }
1976
+
1977
+ .pdf-outline-toggle--open::before {
1978
+ transform: rotate(45deg);
1979
+ }
1980
+
1981
+ .pdf-outline-toggle--empty::before {
1982
+ display: none;
1983
+ }
1984
+
1985
+ .pdf-outline-title {
1986
+ min-width: 0;
1987
+ overflow: hidden;
1988
+ font-size: 12px;
1989
+ line-height: 1.35;
1990
+ text-overflow: ellipsis;
1991
+ white-space: nowrap;
1992
+ }
1993
+
1994
+ .pdf-outline-empty {
1995
+ margin: 24px 8px;
1996
+ padding: 14px 10px;
1997
+ border: 1px dashed #cbd5e1;
1998
+ border-radius: 8px;
1999
+ color: #64748b;
2000
+ background: #ffffff;
2001
+ font-size: 12px;
2002
+ text-align: center;
2003
+ }
2004
+
2005
+ .pdfViewer {
2006
+ margin: 0 auto;
2007
+ padding: 18px 14px 28px;
2008
+ }
2009
+
2010
+ .pdf-viewport {
2011
+ position: relative;
2012
+ width: 100%;
2013
+ height: 100%;
2014
+ min-width: 0;
2015
+ min-height: 0;
2016
+ }
2017
+
2018
+ .pdf-wrapper {
2019
+ position: absolute;
2020
+ inset: 0;
2021
+ width: 100%;
2022
+ height: 100%;
2023
+ overflow: auto;
2024
+ background: #e8edf4;
2025
+ }
2026
+
2027
+ .pdf-state {
2028
+ position: absolute;
2029
+ top: 50%;
2030
+ left: 50%;
2031
+ display: inline-flex;
2032
+ align-items: center;
2033
+ justify-content: center;
2034
+ min-width: 168px;
2035
+ min-height: 42px;
2036
+ padding: 0 16px;
2037
+ border: 1px solid #d7dee8;
2038
+ border-radius: 8px;
2039
+ color: #475569;
2040
+ background: #ffffff;
2041
+ box-shadow: 0 10px 30px rgb(15 23 42 / 12%);
2042
+ transform: translate(-50%, -50%);
2043
+ }
2044
+
2045
+ .pdf-state--error {
2046
+ max-width: min(460px, calc(100% - 32px));
2047
+ color: #b42318;
2048
+ text-align: center;
2049
+ }
2050
+
2051
+ @media (max-width: 720px) {
2052
+ .pdf-toolbar {
2053
+ flex-wrap: wrap;
2054
+ min-height: 88px;
2055
+ align-content: center;
2056
+ }
2057
+
2058
+ .pdf-toolbar-group--zoom {
2059
+ margin-left: 0;
2060
+ }
2061
+
2062
+ .pdf-content,
2063
+ .pdf-shell--nav-hidden .pdf-content {
2064
+ grid-template-columns: minmax(0, 1fr);
2065
+ }
2066
+
2067
+ .pdf-nav-pane {
2068
+ position: absolute;
2069
+ z-index: 3;
2070
+ top: 0;
2071
+ bottom: 0;
2072
+ left: 0;
2073
+ width: min(78vw, 240px);
2074
+ box-shadow: 10px 0 24px rgb(15 23 42 / 14%);
2075
+ }
2076
+ }
2077
+ `})),OO=Hx({DEFAULT_FILE_VIEWER_PDF_WORKER_URL:()=>BP,default:()=>LO});async function LO(n,t,e){var i,r;const s=t.ownerDocument||document,o=s.defaultView||(typeof window<"u"?window:null),l=o0(e?.options),h=gf(e?.options);if(!o)throw new Error(l("pdf.error.browserWindow"));const c=(i=e?.options)===null||i===void 0?void 0:i.pdf,d=c?.navigation!==!1,u=c?.toolbar!==!1,f=c?.thumbnails===!0,g=qv(),m=()=>{const W=t.clientWidth||o.innerWidth||0;return W>0&&W<=720};let y=c?.navigation===!1?!1:typeof c?.defaultNavigationVisible=="boolean"?c.defaultNavigationVisible:!m(),b="pages",x="loading",E="",S=1,T=0,A=1,P=!0,C=Ex((r=c?.rotation)!==null&&r!==void 0?r:0),M=[],I=null,k=null,O=0,B=0,L=!1,$=0,j=VP(),U={current:0,total:0},G,it=[];const X=new Map,ct=new Set,Y={viewer:null,linkService:null,eventBus:null,findController:null,resource:null,document:null,search:""},q=Rt(s,"div","pdf-shell");q.dataset.viewerSearchProvider="pdf",q.dataset.viewerZoomProvider="pdf";const J=Rt(s,"div","pdf-toolbar"),dt=mr(s,"pdf-icon-button",l("pdf.toolbar.toggleNavigation"));dt.setAttribute("aria-pressed",String(y)),dt.append(Rt(s,"span","pdf-panel-icon"));const gt=Rt(s,"div","pdf-toolbar-group"),N=mr(s,"pdf-icon-button",l("pdf.toolbar.previousPage"),"‹"),R=Rt(s,"span","pdf-page-meter"),F=Rt(s,"strong",void 0,"1"),H=Rt(s,"span",void 0,"/ -");R.append(F,H);const tt=mr(s,"pdf-icon-button",l("pdf.toolbar.nextPage"),"›");gt.append(N,R,tt);const V=Rt(s,"div","pdf-toolbar-group pdf-toolbar-group--zoom"),K=mr(s,"pdf-icon-button",l("pdf.toolbar.zoomOut"),"−"),lt=Rt(s,"button","pdf-scale-button","100%");lt.type="button",lt.title=l("pdf.toolbar.fitWidth"),lt.setAttribute("aria-label",l("pdf.toolbar.fitWidth"));const Ct=mr(s,"pdf-icon-button",l("pdf.toolbar.zoomIn"),"+");V.append(K,lt,Ct);const Et=Rt(s,"div","pdf-toolbar-group pdf-toolbar-group--rotate"),bt=mr(s,"pdf-icon-button",l("pdf.toolbar.rotateLeft"),"↺"),le=Rt(s,"span","pdf-rotation-meter",`${C}°`),Le=mr(s,"pdf-icon-button",l("pdf.toolbar.rotateRight"),"↻");Et.append(bt,le,Le),d&&J.append(dt),J.append(gt,V,Et);const Yn=Rt(s,"div","pdf-content"),Px=Rt(s,"aside","pdf-nav-pane"),ZP=Rt(s,"div","pdf-nav-head"),JP=Rt(s,"span",void 0,l("pdf.nav.pagesTitle")),QP=Rt(s,"strong",void 0,l("pdf.nav.pageCount",{count:0}));ZP.append(JP,QP);const Nv=Rt(s,"div","pdf-nav-tabs");Nv.setAttribute("role","tablist"),Nv.setAttribute("aria-label",l("pdf.nav.typeLabel"));const bc=mr(s,"",l("pdf.nav.pagesTab")),wc=mr(s,"",l("pdf.nav.outlineTab"));bc.textContent=l("pdf.nav.pagesTab"),wc.textContent=l("pdf.nav.outlineTab"),bc.setAttribute("role","tab"),wc.setAttribute("role","tab"),Nv.append(bc,wc);const ya=Rt(s,"div");Px.append(ZP,Nv,ya);const qP=Rt(s,"div","pdf-viewport"),Ui=Rt(s,"div","pdf-wrapper");Ui.dataset.viewerScrollContainer="true";const tC=Rt(s,"div","pdfViewer"),_v=Rt(s,"div","pdf-state",l("pdf.state.loading"));Ui.append(tC,_v),qP.append(Ui),Yn.append(Px,qP),q.append(Yn),u&&q.insertBefore(J,Yn),t.replaceChildren(HP(s),q);const eC=()=>`${Math.round(A*100)}%`,NO=()=>`${C}°`,_O=()=>S>1,BO=()=>S<T,nC=()=>A>Lv,iC=()=>A<Dv,WO=()=>{const W=z=>z.reduce((Q,et)=>Q+1+W(et.items),0);return W(M)},jO=()=>{const W=[],z=(Q,et)=>{Q.forEach(at=>{W.push({item:at,depth:et}),at.expanded&&at.items.length&&z(at.items,et+1)})};return z(M,0),W},UO=()=>{if(ya.replaceChildren(),ya.className=b==="pages"?"pdf-page-list":"pdf-outline-list",b==="pages"){k?.disconnect();for(let z=1;z<=T;z+=1){const Q=Rt(s,"button","pdf-page-button");Q.type="button",Q.classList.toggle("pdf-page-button--active",z===S),Q.classList.toggle("pdf-page-button--with-thumbnail",f);const et=Rt(s,"span","pdf-page-thumb");f?(et.classList.add("pdf-page-thumb--thumbnail"),HO(z,et)):et.textContent=String(z),Q.append(et,Rt(s,"span","pdf-page-label",l("pdf.nav.pageLabel",{page:z}))),Q.addEventListener("click",()=>Ox(z)),ya.append(Q)}return}const W=jO();W.forEach(z=>{const Q=Rt(s,"button","pdf-outline-button");Q.type="button",Q.style.setProperty("--outline-depth",String(z.depth));const et=Rt(s,"span","pdf-outline-toggle");et.classList.toggle("pdf-outline-toggle--open",z.item.expanded),et.classList.toggle("pdf-outline-toggle--empty",!z.item.items.length),et.setAttribute("aria-hidden","true"),et.addEventListener("click",at=>{at.stopPropagation(),tL(z.item)}),Q.append(et,Rt(s,"span","pdf-outline-title",z.item.title)),Q.addEventListener("click",()=>eL(z.item)),ya.append(Q)}),W.length||ya.append(Rt(s,"div","pdf-outline-empty",l("pdf.nav.outlineEmpty")))},rC=(W,z)=>{const Q=X.get(W);if(z.dataset.pdfThumbnailPage=String(W),!Q)return z.replaceChildren(Rt(s,"span",void 0,String(W))),!1;const et=s.createElement("img");return et.src=Q,et.alt=l("pdf.thumbnail.alt",{page:W}),et.loading="lazy",z.replaceChildren(et),!0},sC=async W=>{var z,Q;const et=Y.document;if(!(!et||X.has(W)||ct.has(W))){ct.add(W);try{const at=await et.getPage(W);if(L||Y.document!==et)return;const Ot=at.getViewport({scale:_e.PDF_TO_CSS_UNITS,rotation:C}),re=Math.min(2,Math.max(1,o.devicePixelRatio||1)),Ce=Math.min(1,46/Math.max(Ot.width,1)),yi=at.getViewport({scale:_e.PDF_TO_CSS_UNITS*Ce*re,rotation:C}),kn=s.createElement("canvas"),ll=kn.getContext("2d");if(!ll||(kn.width=Math.max(1,Math.ceil(yi.width)),kn.height=Math.max(1,Math.ceil(yi.height)),await at.render({canvas:kn,canvasContext:ll,viewport:yi}).promise,L||Y.document!==et))return;X.set(W,kn.toDataURL("image/png")),kn.width=0,kn.height=0,(Q=(z=at).cleanup)===null||Q===void 0||Q.call(z),ya.querySelectorAll(`.pdf-page-thumb--thumbnail[data-pdf-thumbnail-page="${W}"]`).forEach($i=>rC(W,$i))}catch(at){console.warn("[file-viewer] PDF 缩略图渲染失败。",at)}finally{ct.delete(W)}}},$O=()=>{!f||k||typeof o.IntersectionObserver!="function"||(k=new o.IntersectionObserver(W=>{W.forEach(z=>{if(!z.isIntersecting)return;const Q=z.target,et=Number(Q.dataset.pdfThumbnailPage||"0");k?.unobserve(Q),et>0&&sC(et)})},{root:ya,rootMargin:"96px 0px"}))},HO=(W,z)=>{if(!rC(W,z)){if($O(),k){k.observe(z);return}sC(W)}},an=()=>{q.classList.toggle("pdf-shell--compact",m()),q.classList.toggle("pdf-shell--nav-hidden",!d||!y),q.classList.toggle("pdf-shell--toolbar-hidden",!u),dt.classList.toggle("pdf-icon-button--active",y),dt.setAttribute("aria-pressed",String(y)),Px.hidden=!d||!y,bc.classList.toggle("active",b==="pages"),wc.classList.toggle("active",b==="outline"),bc.setAttribute("aria-selected",b==="pages"?"true":"false"),wc.setAttribute("aria-selected",b==="outline"?"true":"false"),JP.textContent=l(b==="pages"?"pdf.nav.pagesTitle":"pdf.nav.outlineTitle"),QP.textContent=b==="pages"?l("pdf.nav.pageCount",{count:T}):l("pdf.nav.itemCount",{count:WO()}),F.textContent=String(S),H.textContent=`/ ${T||"-"}`,lt.textContent=eC(),le.textContent=NO(),N.disabled=!_O(),tt.disabled=!BO(),K.disabled=!nC(),Ct.disabled=!iC(),_v.hidden=x==="ready",_v.classList.toggle("pdf-state--error",x==="error"),_v.textContent=x==="error"?E:l("pdf.state.loading"),UO()},aC=()=>{var W,z;const Q=Y.viewer;if(!Q)return;const et=T||Q.pagesCount||0;for(let at=0;at<et;at+=1){const Ot=Q.getPageView(at),re=Ot?.div||tC.querySelector(`.page[data-page-number="${at+1}"]`),Ce=(W=Ot?.viewport)===null||W===void 0?void 0:W.width,yi=(z=Ot?.viewport)===null||z===void 0?void 0:z.height;!re||!Number.isFinite(Ce)||!Number.isFinite(yi)||(re.style.setProperty("width",`${Math.max(1,Math.round(Ce||0))}px`,"important"),re.style.setProperty("height",`${Math.max(1,Math.round(yi||0))}px`,"important"))}},of=()=>{o.cancelAnimationFrame(B),B=o.requestAnimationFrame(()=>{aC(),o.requestAnimationFrame(aC)})},VO=()=>{if(!o?.Worker)return null;ks.workerSrc=zP(c,s.URL||void 0);try{return vh.create({name:"file-viewer-pdf-worker"})}catch(W){return console.warn("[file-viewer] PDF Worker 无法创建,回退到 PDF.js 默认加载策略。",W),null}},zO=W=>{const z=it;it=[],z.forEach(Q=>{o.clearTimeout(Q.timer),Q.resolve(W)})},Cx=()=>{var W;const z=Y.findController;if(!z)return{current:0,total:0};const Q=z.pageMatches||[],et=z.selected,at=Q.reduce((re,Ce)=>re+(Ce?.length||0),0);let Ot=0;if(et&&et.pageIdx>=0&&et.matchIdx>=0&&at>0){for(let re=0;re<et.pageIdx;re+=1)Ot+=((W=Q[re])===null||W===void 0?void 0:W.length)||0;Ot+=et.matchIdx+1}return{current:Ot,total:at}},lf=(W=Cx(),z=Y.search,Q=!1)=>{var et;U=W;const at=Math.max(0,W.current||0),Ot=Math.max(0,W.total||0),re=(et=Y.findController)===null||et===void 0?void 0:et.selected,Ce=re&&re.pageIdx>=0?re.pageIdx+1:void 0;return j={query:z,total:Ot,currentIndex:at>0?at-1:-1,current:at>0?{id:`pdf-search-match-${at}`,index:at-1,text:z,anchor:null,page:Ce}:null,matches:[]},Q&&zO(j),j},GO=W=>new Promise(z=>{const Q=o.setTimeout(()=>{const et=it.findIndex(at=>at.resolve===z);et>=0&&it.splice(et,1),z(lf(Cx(),W))},1200);it.push({resolve:z,timer:Q})}),XO=W=>{W.matchesCount&&lf(W.matchesCount,Y.search)},YO=W=>{var z;const Q=typeof W.rawQuery=="string"?W.rawQuery:Y.search;Y.search=Q;const et=!((z=W.matchesCount)===null||z===void 0)&&z.total?W.matchesCount:Cx();lf(et,Q,W.state!==3&&(et.total>0||W.state===1))},Mx=W=>{const z=Math.max(0,Ui.scrollWidth-Ui.clientWidth);return Math.min(Math.max(0,W),z)},hf=W=>{Ui.scrollLeft=Mx(W)},Ix=W=>{hf(W),af(o).then(()=>hf(W)),o.requestAnimationFrame(()=>{hf(W),o.requestAnimationFrame(()=>hf(W))}),o.setTimeout(()=>hf(W),120)},kx=async(W,z,Q,et=!1)=>{if(!Y.eventBus)return lf({current:0,total:0},W);Y.search=W,G=z||G;const at=z||G,Ot=Mx(Ui.scrollLeft||0);Y.eventBus.dispatch("find",{source:q,type:Q,query:W,phraseSearch:!0,caseSensitive:!!at?.caseSensitive,entireWord:!!at?.wholeWord,highlightAll:!0,findPrevious:et,matchDiacritics:!1});try{return await GO(W)}finally{Ix(Ot)}},KO=()=>{var W;return Y.search="",G=void 0,U={current:0,total:0},(W=Y.eventBus)===null||W===void 0||W.dispatch("findbarclose",{source:q}),lf(U,"",!0)},cf=()=>({scale:A,label:eC(),canZoomIn:!!Y.viewer&&iC(),canZoomOut:!!Y.viewer&&nC(),canReset:!!Y.viewer,minScale:Lv,maxScale:Dv}),Bv=W=>{if(!Y.viewer)return;const z=Fv(W);Y.viewer.currentScale=z,A=z,of(),g.emit(),an()},ZO=W=>{var z;const Q=W.getPageView(0),et=Q?.pdfPage;if(et)return et.getViewport({scale:_e.PDF_TO_CSS_UNITS,rotation:C}).width;const at=(z=Q?.viewport)===null||z===void 0?void 0:z.width;return at&&A?at/A:0},JO=W=>{const z=ZO(W),Q=Ui.clientWidth||o.innerWidth,et=Math.max(Q-WP-jP,96);return z?Fv(et/z):1},xc=()=>{Y.viewer&&(P=!0,Bv(JO(Y.viewer)),af(o).then(()=>{var W;(W=Y.viewer)===null||W===void 0||W.update()}))},QO=()=>{!P||!Y.viewer||(o.cancelAnimationFrame(O),O=o.requestAnimationFrame(()=>xc()))},oC=()=>{P=!1,Bv(A+xx)},lC=()=>{P=!1,Bv(A-xx)},Rx=W=>{const z=Ex(W);if(C=z,X.clear(),ct.clear(),!Y.viewer){an();return}Y.viewer.pagesRotation=z,af(o).then(()=>{var Q;if(P){xc();return}(Q=Y.viewer)===null||Q===void 0||Q.update(),of(),an()})},hC=W=>{const z=Mx(Ui.scrollLeft||0),Q=W();Ix(z),Q&&typeof Q.then=="function"&&Promise.resolve(Q).finally(()=>Ix(z))};function Ox(W){if(!Y.viewer||!T)return;const z=Math.min(T,Math.max(1,W));hC(()=>{Y.viewer.currentPageNumber=z,S=z,an()})}const qO=()=>{d&&(y=!y,an(),af(o).then(()=>{var W;if(P){xc();return}(W=Y.viewer)===null||W===void 0||W.update()}))},cC=W=>{b=W,an()},tL=W=>{W.items.length&&(W.expanded=!W.expanded,an())},eL=W=>{!W.dest||!Y.linkService||hC(()=>Y.linkService.goToDestination(W.dest))},Lx=async W=>{var z;if(W)try{await W.loadingTask.destroy()}catch(Q){console.warn("PDF 加载任务销毁失败",Q)}finally{(z=W.worker)===null||z===void 0||z.destroy()}},nL=async W=>{try{const z=await W.getOutline();if(L||Y.document!==W)return;M=Array.isArray(z)?Sx(z,"outline",Q=>l("pdf.nav.outlineFallbackTitle",{index:Q+1})):[],an()}catch(z){console.warn("PDF 大纲读取失败",z),M=[],an()}},iL=(W,z,Q)=>{const et=Q==="print"?1.75:1.5,at=Math.sqrt(UP/Math.max(W*z,1));return Math.max(.75,Math.min(et,at))},rL=async(W=1)=>{var z,Q;const et=Y.document;if(!et)throw new Error(l("pdf.error.notLoaded"));const at=await et.getPage(Math.min(Math.max(W,1),et.numPages)),Ot=at.getViewport({scale:_e.PDF_TO_CSS_UNITS,rotation:C});return(Q=(z=at).cleanup)===null||Q===void 0||Q.call(z),{width:Math.ceil(Ot.width),height:Math.ceil(Ot.height)}},sL=async()=>{const W=await rL();return t0({selector:".viewer-export-content .pdf-export-page",width:W.width,height:W.height})},aL=async W=>{var z,Q;const et=Y.document;if(!et)throw new Error(l("pdf.error.notLoaded"));const at=[];for(let Ot=1;Ot<=et.numPages;Ot+=1){if(L)throw new Error(l("pdf.error.unloaded"));const re=await et.getPage(Ot),Ce=re.getViewport({scale:_e.PDF_TO_CSS_UNITS,rotation:C}),yi=Math.ceil(Ce.width),kn=Math.ceil(Ce.height),ll=iL(Ce.width,Ce.height,W.mode),$i=re.getViewport({scale:_e.PDF_TO_CSS_UNITS*ll,rotation:C}),gn=s.createElement("canvas"),dC=gn.getContext("2d");if(!dC)throw new Error(l("pdf.error.canvasUnavailable"));gn.width=Math.ceil($i.width),gn.height=Math.ceil($i.height),await re.render({canvas:gn,canvasContext:dC,viewport:$i}).promise;const uC=l("pdf.export.pageTitle",{title:W.title,page:Ot}),lL=[`--viewer-print-page-width:${wa(yi)}`,`--viewer-print-page-height:${wa(kn)}`,`width:${wa(yi)}`,`height:${wa(kn)}`].join(";");at.push(`<section class="pdf-export-page viewer-print-page" style="${lL}" aria-label="${Ax(uC)}"><img src="${gn.toDataURL("image/png")}" alt="${Ax(uC)}" /></section>`),gn.width=0,gn.height=0,(Q=(z=re).cleanup)===null||Q===void 0||Q.call(z)}return`<div class="pdf-export-document">${at.join("")}</div>`},oL=async()=>{var W,z;const Q=++$;x="loading",E="",Y.document=null,M=[],X.clear(),ct.clear(),k?.disconnect(),(W=e?.registerExportAdapter)===null||W===void 0||W.call(e,null),an();let et=null;try{if(L||Q!==$)return;const at=new Fu,Ot=new _m({eventBus:at}),re=new Zw({eventBus:at,linkService:Ot,updateMatchesCountOnProgress:!0}),Ce=new Ov({container:Ui,eventBus:at,linkService:Ot,findController:re,l10n:new Yo(h),enableAutoLinking:!1});if(Y.viewer=Ce,Y.linkService=Ot,Y.eventBus=at,Y.findController=re,Ot.setViewer(Ce),at.on("updatefindmatchescount",XO),at.on("updatefindcontrolstate",YO),at.on("pagesinit",()=>{var gn;Rx(C),xc(),of(),x="ready",an(),(gn=e?.onProgressiveRender)===null||gn===void 0||gn.call(e),Y.search&&at.dispatch("find",{type:"",query:Y.search})}),at.on("pagechanging",({pageNumber:gn})=>{S=gn,an()}),at.on("scalechanging",({scale:gn})=>{A=Fv(gn),of(),g.emit(),an()}),at.on("pagerendered",of),!e?.streamUrl&&!n.byteLength)throw new Error(l("pdf.error.missingSource"));const yi=VO(),kn=Vv(c,s.URL||s.baseURI),ll=HE({...e?.streamUrl?{url:e.streamUrl,rangeChunkSize:c?.rangeChunkSize||65536,withCredentials:c?.withCredentials===!0}:{data:n},worker:yi||void 0,cMapUrl:kn.cMapUrl,wasmUrl:kn.wasmUrl,standardFontDataUrl:kn.standardFontDataUrl,useWorkerFetch:!0,cMapPacked:!0,enableXfa:!0});et={loadingTask:ll,worker:yi},Y.resource=et;const $i=await ll.promise;if(L||Q!==$||Y.resource!==et){Y.resource===et&&(Y.resource=null,await Lx(et));return}T=$i.numPages,S=1,Y.document=$i,(z=e?.registerExportAdapter)===null||z===void 0||z.call(e,{includeDocumentStyles:!1,printStyle:sL,toHtml:aL}),nL($i),Ce.setDocument($i),Ot.setDocument($i,null),an()}catch(at){if(Y.resource===et&&(Y.resource=null,Lx(et)),L||Q!==$)return;x="error",E=at instanceof Error?at.message:l("pdf.error.loadFailed"),an()}};return Kx(q,{search:(W,z)=>kx(W,z,"",!1),next:()=>Y.search?kx(Y.search,void 0,"again",!1):j,previous:()=>Y.search?kx(Y.search,void 0,"again",!0):j,clear:KO,getState:()=>j}),Jv(q,{zoomIn:()=>(oC(),cf()),zoomOut:()=>(lC(),cf()),resetZoom:()=>(xc(),cf()),setZoom:W=>(P=!1,Bv(W),cf()),getState:cf,subscribe:g.subscribe}),dt.addEventListener("click",qO),N.addEventListener("click",()=>Ox(S-1)),tt.addEventListener("click",()=>Ox(S+1)),K.addEventListener("click",lC),Ct.addEventListener("click",oC),lt.addEventListener("click",xc),bt.addEventListener("click",()=>Rx(C-90)),Le.addEventListener("click",()=>Rx(C+90)),bc.addEventListener("click",()=>cC("pages")),wc.addEventListener("click",()=>cC("outline")),o.ResizeObserver&&(I=new o.ResizeObserver(()=>QO()),I.observe(Ui)),an(),oL(),{$el:q,unmount(){var W;L=!0,$+=1,o.cancelAnimationFrame(O),o.cancelAnimationFrame(B),k?.disconnect(),k=null,I?.disconnect(),I=null,Zx(q),Qv(q),M=[],(W=e?.registerExportAdapter)===null||W===void 0||W.call(e,null);const z=Y.resource;Y.viewer=null,Y.linkService=null,Y.eventBus=null,Y.findController=null,Y.document=null,Y.resource=null,it.forEach(Q=>o.clearTimeout(Q.timer)),it=[],Lx(z),t.replaceChildren()}}}var BP,Lv,Dv,xx,WP,jP,UP,$P,HP,Rt,mr,Ex,Fv,VP,Ax,af,zP,Sx,DO=xt((()=>{Pk(),kO(),_0(),Yx(),RO(),BP=$v,Lv=.2,Dv=3,xx=.1,WP=28,jP=18,UP=8e6,$P=_P.replace(/--page-border-image:\s*url\(images\/shadow\.png\)\s*9 9 repeat;/g,"--page-border-image:none;").replace(/background:\s*url\("\.\/images\/loading-icon\.gif"\)\s*center no-repeat;/g,"background:none;"),HP=n=>{const t=n.createElement("style");return t.textContent=`${$P}
2078
+ .pdf-state[hidden],.pdf-nav-pane[hidden]{display:none!important}
2079
+ .pdf-page-button--with-thumbnail{grid-template-columns:52px minmax(0,1fr);min-height:74px}
2080
+ .pdf-page-thumb--thumbnail{width:46px;height:60px;overflow:hidden;background:#fff}
2081
+ .pdf-page-thumb--thumbnail img{display:block;width:100%;height:100%;object-fit:contain}
2082
+ .pdf-page-thumb--thumbnail span{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%}
2083
+ @media (max-width:720px){
2084
+ .pdf-toolbar{flex-wrap:nowrap;gap:6px;min-height:44px;padding:5px 6px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
2085
+ .pdf-toolbar::-webkit-scrollbar{display:none}
2086
+ .pdf-toolbar-group{flex:0 0 auto;height:32px;gap:4px;padding:0 4px;border-radius:7px}
2087
+ .pdf-toolbar-group--zoom{margin-left:0}
2088
+ .pdf-icon-button,.pdf-scale-button{height:26px;border-radius:5px}
2089
+ .pdf-icon-button{width:26px;font-size:16px}
2090
+ .pdf-scale-button{width:54px;font-size:12px}
2091
+ .pdf-page-meter{min-width:52px;font-size:12px}
2092
+ .pdf-page-meter strong{font-size:13px}
2093
+ .pdf-rotation-meter{min-width:30px;font-size:12px}
2094
+ .pdf-nav-pane{width:min(82vw,280px);max-width:calc(100% - 52px)}
2095
+ .pdfViewer{padding:12px 8px 22px}
2096
+ }
2097
+ `,t},Rt=(n,t,e,i)=>{const r=n.createElement(t);return e&&(r.className=e),i!==void 0&&(r.textContent=i),r},mr=(n,t,e,i)=>{const r=Rt(n,"button",t);if(r.type="button",r.title=e,r.setAttribute("aria-label",e),i!==void 0){const s=Rt(n,"span",void 0,i);s.setAttribute("aria-hidden","true"),r.append(s)}return r},Ex=n=>{const t=(Math.round(n/90)*90%360+360)%360;return t===90||t===180||t===270?t:0},Fv=n=>Number(Math.min(Dv,Math.max(Lv,n)).toFixed(2)),VP=(n="")=>({query:n,total:0,currentIndex:-1,current:null,matches:[]}),Ax=n=>n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),af=n=>new Promise(t=>{if(n?.requestAnimationFrame){n.requestAnimationFrame(()=>t());return}globalThis.setTimeout(t,0)}),zP=(n,t)=>Vv(n,t).workerUrl,Sx=(n,t="outline",e=i=>`Outline ${i+1}`)=>n.map((i,r)=>{const s=`${t}-${r}`,o=Array.isArray(i.items)?Sx(i.items,s,e):[];return{id:s,title:i.title||e(r),dest:i.dest||null,items:o,expanded:r<4}})}));_0();var GP=vr.find(n=>n.id==="pdf");if(!GP)throw new Error("@file-viewer/renderer-pdf could not locate the core PDF renderer definition.");var XP=GP,FO=(n,t,e,i)=>Promise.resolve().then(()=>(DO(),OO)).then(({default:r})=>r(n,t,i)),Tx={id:"file-viewer-renderer-pdf",label:"Flyfish File Viewer PDF renderer",definitions:[XP],handlers:[{rendererId:XP.id,handler:FO}]},YP=globalThis,KP=YP.FlyfishFileViewerWebFullRenderers||(YP.FlyfishFileViewerWebFullRenderers={});KP.pdf=Tx,KP[Tx.id]=Tx})();