@blackbelt-technology/pi-dashboard-team-plugin 0.8.0

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.
Files changed (102) hide show
  1. package/README.md +101 -0
  2. package/dist/app/assets/InlineTerminalCard-6GBZ9nXN.css +32 -0
  3. package/dist/app/assets/InlineTerminalCard-BRjmM13k.js +53 -0
  4. package/dist/app/assets/PdfPreview-CCfKQhLL.js +2 -0
  5. package/dist/app/assets/RichDiff-BU1YI0CM.css +19 -0
  6. package/dist/app/assets/RichDiff-zrt7rxm3.js +41 -0
  7. package/dist/app/assets/abnfDiagram-VCTEODGH-BNRJZIa7.js +1 -0
  8. package/dist/app/assets/arc-Ccw1WVCw.js +1 -0
  9. package/dist/app/assets/architectureDiagram-5GKGNRK7-CmpCS5s2.js +36 -0
  10. package/dist/app/assets/blockDiagram-I7D4REHJ-M5oRqDla.js +129 -0
  11. package/dist/app/assets/c4Diagram-7LVT6UL2-C6v6KvuZ.js +38 -0
  12. package/dist/app/assets/channel-1wFLoesq.js +1 -0
  13. package/dist/app/assets/chunk-2Q5K7J3B-BrSnR-LD.js +1 -0
  14. package/dist/app/assets/chunk-5VM5RSS4-BAqdD3be.js +15 -0
  15. package/dist/app/assets/chunk-F27PBJKO-DNLocP_Z.js +1 -0
  16. package/dist/app/assets/chunk-IMKFNOWR-DwFLWoAj.js +231 -0
  17. package/dist/app/assets/chunk-JWPE2WC7-DwOQUkPK.js +1 -0
  18. package/dist/app/assets/chunk-POPQ4Y6H-CN6vxbUi.js +1 -0
  19. package/dist/app/assets/chunk-SVP7TREG-mfOuPsxp.js +88 -0
  20. package/dist/app/assets/chunk-TICWLB2K-R4JNWs6J.js +206 -0
  21. package/dist/app/assets/chunk-XXDRQBXY-Bwj8o9dr.js +1 -0
  22. package/dist/app/assets/classDiagram-ZZMXUADV-DeqkIaZ-.js +1 -0
  23. package/dist/app/assets/classDiagram-v2-VYDZK3BY-DeqkIaZ-.js +1 -0
  24. package/dist/app/assets/cose-bilkent-JH36ORCC-qCY2WMN8.js +1 -0
  25. package/dist/app/assets/cursor-editorTextHighlight-kG3uUOwL.svg +8 -0
  26. package/dist/app/assets/cynefin-OW5HDTMX-CNttFTW2.js +178 -0
  27. package/dist/app/assets/cynefinDiagram-5FMLGOSQ-CBX-RJXy.js +62 -0
  28. package/dist/app/assets/cytoscape.esm-Bch-eiPH.js +331 -0
  29. package/dist/app/assets/dagre-GXQ25YYZ-D-VD0Tcu.js +4 -0
  30. package/dist/app/assets/defaultLocale-DX6XiGOO.js +1 -0
  31. package/dist/app/assets/diagram-S7CK7UJ4-CQReIUYr.js +30 -0
  32. package/dist/app/assets/diagram-UQ7AKVKN-DyEU0WYX.js +41 -0
  33. package/dist/app/assets/diagram-VSXAHHWV-NLLDj0k8.js +3 -0
  34. package/dist/app/assets/diagram-VX7I27RA-Daf-u6xI.js +24 -0
  35. package/dist/app/assets/diagram-Z3DM3KII-B0O71sZp.js +24 -0
  36. package/dist/app/assets/ebnfDiagram-PWID7BFC-BSRAXWwk.js +1 -0
  37. package/dist/app/assets/erDiagram-RLTQ6QDP-DKoQjGux.js +99 -0
  38. package/dist/app/assets/flowDiagram-HODETNUW-gq74Q1SF.js +168 -0
  39. package/dist/app/assets/ganttDiagram-EL5Y4UJY-BIAOolFj.js +292 -0
  40. package/dist/app/assets/gitGraphDiagram-WWUBYQGX-BvZquV67.js +106 -0
  41. package/dist/app/assets/index-BTj-g2DX.js +559 -0
  42. package/dist/app/assets/index-owClP-R3.css +1 -0
  43. package/dist/app/assets/infoDiagram-27XIBGKW-dMwJRmit.js +2 -0
  44. package/dist/app/assets/init-Gi6I4Gst.js +1 -0
  45. package/dist/app/assets/ishikawaDiagram-5VMMS53U-DArpl74K.js +70 -0
  46. package/dist/app/assets/journeyDiagram-3NMN7TZE-B2sUGe5l.js +139 -0
  47. package/dist/app/assets/kanban-definition-UXKFOSKX-Cx6oCBKM.js +89 -0
  48. package/dist/app/assets/layout-BjHuHx4m.js +1 -0
  49. package/dist/app/assets/linear-CgCYMSPy.js +1 -0
  50. package/dist/app/assets/mdi-DoP81khn.js +1 -0
  51. package/dist/app/assets/mermaid.core-DiBBwf02.js +312 -0
  52. package/dist/app/assets/mindmap-definition-YA3MSWOX-DP2Penfk.js +96 -0
  53. package/dist/app/assets/ordinal-Cboi1Yqb.js +1 -0
  54. package/dist/app/assets/pdf-CcZYcL52.js +12 -0
  55. package/dist/app/assets/pdf.worker.min-CNKzwYUy.js +1 -0
  56. package/dist/app/assets/pdf.worker.min-yatZIOMy.mjs +21 -0
  57. package/dist/app/assets/pdf_viewer-BXbC1ghE.js +346 -0
  58. package/dist/app/assets/pdf_viewer-I4ZZuHqo.css +1 -0
  59. package/dist/app/assets/pegDiagram-XKGWAZYB-DuPy_Jk1.js +1 -0
  60. package/dist/app/assets/pieDiagram-E7YTZNPT-BHJIw8Ie.js +39 -0
  61. package/dist/app/assets/quadrantDiagram-AXDQQJYC-CKJDe9v8.js +7 -0
  62. package/dist/app/assets/railroadDiagram-O6MQD6OU-CPmw2XqA.js +1 -0
  63. package/dist/app/assets/requirementDiagram-BXWQKSXE-CbgXwlu-.js +84 -0
  64. package/dist/app/assets/sankeyDiagram-P5KCCOFB-xTHr7bNV.js +40 -0
  65. package/dist/app/assets/sequenceDiagram-WJ2MYXX4-BJO_VejT.js +162 -0
  66. package/dist/app/assets/sizeCapture-INFHLROL-BOIqspBs.js +1 -0
  67. package/dist/app/assets/stateDiagram-D77RDMKH-B1M9C9C6.js +1 -0
  68. package/dist/app/assets/stateDiagram-v2-MP3YSRHH-BWPtAAkO.js +1 -0
  69. package/dist/app/assets/swimlanes-42K2YHIH-BtpfWryU.js +1 -0
  70. package/dist/app/assets/swimlanesDiagram-VR7AAH4N-CRZvPlTl.js +8 -0
  71. package/dist/app/assets/timeline-definition-24CTP7MA-BaspCbTG.js +120 -0
  72. package/dist/app/assets/vennDiagram-4TSXK5OY-Rzs4n1uC.js +34 -0
  73. package/dist/app/assets/wardleyDiagram-VM6X3IG4-7u6IS5Iz.js +78 -0
  74. package/dist/app/assets/xychartDiagram-S5SC5T6Z-D-TnlcEC.js +7 -0
  75. package/dist/app/index.html +13 -0
  76. package/package.json +82 -0
  77. package/src/client/FolderTeamSection.tsx +96 -0
  78. package/src/client/TeamProjectDialog.tsx +202 -0
  79. package/src/client/index.tsx +9 -0
  80. package/src/client/match-store.ts +107 -0
  81. package/src/client/team-open.ts +27 -0
  82. package/src/configSchema.json +104 -0
  83. package/src/extension/guard.ts +97 -0
  84. package/src/extension/index.ts +44 -0
  85. package/src/i18n.ts +64 -0
  86. package/src/server/access.ts +43 -0
  87. package/src/server/conversations.ts +799 -0
  88. package/src/server/index.ts +39 -0
  89. package/src/server/paths.ts +164 -0
  90. package/src/server/persona.ts +167 -0
  91. package/src/server/personas-service.ts +178 -0
  92. package/src/server/projects.ts +294 -0
  93. package/src/server/records.ts +130 -0
  94. package/src/server/render.ts +50 -0
  95. package/src/server/routes.ts +239 -0
  96. package/src/server/static.ts +73 -0
  97. package/src/server/store-types.ts +8 -0
  98. package/src/server/store.ts +94 -0
  99. package/src/server/team.ts +105 -0
  100. package/src/server/text-write.ts +15 -0
  101. package/src/server/types.ts +112 -0
  102. package/src/server/users.ts +47 -0
@@ -0,0 +1,346 @@
1
+ var wr=Object.defineProperty;var $n=r=>{throw TypeError(r)};var _r=(r,e,t)=>e in r?wr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Zi=(r,e,t)=>_r(r,typeof e!="symbol"?e+"":e,t),Qi=(r,e,t)=>e.has(r)||$n("Cannot "+t);var o=(r,e,t)=>(Qi(r,e,"read from private field"),t?t.call(r):e.get(r)),m=(r,e,t)=>e.has(r)?$n("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),c=(r,e,t,i)=>(Qi(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),u=(r,e,t)=>(Qi(r,e,"access private method"),t);var Wn=(r,e,t,i)=>({set _(n){c(r,e,n,t)},get _(){return o(r,e,i)}});var Ut={};Ut.d=(r,e)=>{for(var t in e)Ut.o(e,t)&&!Ut.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})};Ut.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var B=globalThis.pdfjsViewer={};Ut.d(B,{AnnotationLayerBuilder:()=>Ds,DownloadManager:()=>pa,EventBus:()=>Fs,FindState:()=>ve,GenericL10n:()=>Nt,LinkTarget:()=>$e,PDFFindController:()=>ta,PDFHistory:()=>fo,PDFLinkService:()=>Bi,PDFPageView:()=>ir,PDFScriptingManager:()=>So,PDFSinglePageViewer:()=>To,PDFViewer:()=>or,ProgressBar:()=>Nr,RenderingStates:()=>H,ScrollMode:()=>k,SimpleLinkService:()=>Un,SpreadMode:()=>X,StructTreeLayerBuilder:()=>Qs,TextLayerBuilder:()=>$i,XfaLayerBuilder:()=>tr,parseQueryString:()=>Ki});const yr="auto",xs=1,zn=1.1,vr=.1,Pr=10,Ji=0,xr=1.25,Gn=40,Kn=5,H={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},ct={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},de={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},k={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},X={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function Ss(r,e,t=!1){let i=r.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let n=r.offsetTop+r.clientTop,s=r.offsetLeft+r.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||t&&(i.classList.contains("markedContent")||getComputedStyle(i).overflow==="hidden");)if(n+=i.offsetTop,s+=i.offsetLeft,i=i.offsetParent,!i)return;e&&(e.top!==void 0&&(n+=e.top),e.left!==void 0&&(s+=e.left,i.scrollLeft=s)),i.scrollTop=n}function Sr(r,e,t=void 0){const i=function(a){s||(s=window.requestAnimationFrame(function(){s=null;const h=r.scrollLeft,d=n.lastX;h!==d&&(n.right=h>d),n.lastX=h;const f=r.scrollTop,b=n.lastY;f!==b&&(n.down=f>b),n.lastY=f,e(n)}))},n={right:!0,down:!0,lastX:r.scrollLeft,lastY:r.scrollTop,_eventHandler:i};let s=null;return r.addEventListener("scroll",i,{useCapture:!0,signal:t}),t==null||t.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),n}function Ki(r){const e=new Map;for(const[t,i]of new URLSearchParams(r))e.set(t.toLowerCase(),i);return e}const Xn=/[\x00-\x1F]/g;function $t(r,e=!1){return Xn.test(r)?e?r.replaceAll(Xn,t=>t==="\0"?"":" "):r.replaceAll("\0",""):r}function Gt(r,e,t=0){let i=t,n=r.length-1;if(n<0||!e(r[n]))return r.length;if(e(r[i]))return i;for(;i<n;){const s=i+n>>1,a=r[s];e(a)?n=s:i=s+1}return i}function Zn(r){if(Math.floor(r)===r)return[r,1];const e=1/r,t=8;if(e>t)return[1,t];if(Math.floor(e)===e)return[1,e];const i=r>1?e:r;let n=0,s=1,a=1,l=1;for(;;){const d=n+a,f=s+l;if(f>t)break;i<=d/f?(a=d,l=f):(n=d,s=f)}let h;return i-n/s<a/l-i?h=i===r?[n,s]:[s,n]:h=i===r?[a,l]:[l,a],h}function xi(r,e){return r-r%e}function Ar(r,e,t){if(r<2)return r;let i=e[r].div,n=i.offsetTop+i.clientTop;n>=t&&(i=e[r-1].div,n=i.offsetTop+i.clientTop);for(let s=r-2;s>=0&&(i=e[s].div,!(i.offsetTop+i.clientTop+i.clientHeight<=n));--s)r=s;return r}function Ir({scrollEl:r,views:e,sortByVisibility:t=!1,horizontal:i=!1,rtl:n=!1}){const s=r.scrollTop,a=s+r.clientHeight,l=r.scrollLeft,h=l+r.clientWidth;function d(N){const y=N.div;return y.offsetTop+y.clientTop+y.clientHeight>s}function f(N){const y=N.div,C=y.offsetLeft+y.clientLeft,O=C+y.clientWidth;return n?C<h:O>l}const b=[],E=new Set,I=e.length;let A=Gt(e,i?f:d);A>0&&A<I&&!i&&(A=Ar(A,e,s));let v=i?h:-1;for(let N=A;N<I;N++){const y=e[N],C=y.div,O=C.offsetLeft+C.clientLeft,V=C.offsetTop+C.clientTop,U=C.clientWidth,j=C.clientHeight,g=O+U,w=V+j;if(v===-1)w>=a&&(v=w);else if((i?O:V)>v)break;if(w<=s||V>=a||g<=l||O>=h)continue;const P=Math.max(0,s-V)+Math.max(0,w-a),F=Math.max(0,l-O)+Math.max(0,g-h),D=(j-P)/j,M=(U-F)/U,$=D*M*100|0;b.push({id:y.id,x:O,y:V,view:y,percent:$,widthPercent:M*100|0}),E.add(y.id)}const x=b[0],L=b.at(-1);return t&&b.sort(function(N,y){const C=N.percent-y.percent;return Math.abs(C)>.001?-C:N.id-y.id}),{first:x,last:L,views:b,ids:E}}function As(r){return Number.isInteger(r)&&r%90===0}function Lr(r){return Number.isInteger(r)&&Object.values(k).includes(r)&&r!==k.UNKNOWN}function Tr(r){return Number.isInteger(r)&&Object.values(X).includes(r)&&r!==X.UNKNOWN}function Qn(r){return r.width<=r.height}new Promise(function(r){window.requestAnimationFrame(r)});const Rr=document.documentElement.style;function Cr(r,e,t){return Math.min(Math.max(r,e),t)}var Se,Ge,Ae,ft,Ke;class Nr{constructor(e){m(this,Se,null);m(this,Ge,null);m(this,Ae,0);m(this,ft,null);m(this,Ke,!0);c(this,Se,e.classList),c(this,ft,e.style)}get percent(){return o(this,Ae)}set percent(e){if(c(this,Ae,Cr(e,0,100)),isNaN(e)){o(this,Se).add("indeterminate");return}o(this,Se).remove("indeterminate"),o(this,ft).setProperty("--progressBar-percent",`${o(this,Ae)}%`)}setWidth(e){if(!e)return;const i=e.parentNode.offsetWidth-e.offsetWidth;i>0&&o(this,ft).setProperty("--progressBar-end-offset",`${i}px`)}setDisableAutoFetch(e=5e3){o(this,Ae)===100||isNaN(o(this,Ae))||(o(this,Ge)&&clearTimeout(o(this,Ge)),this.show(),c(this,Ge,setTimeout(()=>{c(this,Ge,null),this.hide()},e)))}hide(){o(this,Ke)&&(c(this,Ke,!1),o(this,Se).add("hidden"))}show(){o(this,Ke)||(c(this,Ke,!0),o(this,Se).remove("hidden"))}}Se=new WeakMap,Ge=new WeakMap,Ae=new WeakMap,ft=new WeakMap,Ke=new WeakMap;function Mr(r){let e=k.VERTICAL,t=X.NONE;switch(r){case"SinglePage":e=k.PAGE;break;case"OneColumn":break;case"TwoPageLeft":e=k.PAGE;case"TwoColumnLeft":t=X.ODD;break;case"TwoPageRight":e=k.PAGE;case"TwoColumnRight":t=X.EVEN;break}return{scrollMode:e,spreadMode:t}}const Si=(function(){const r=document.createElement("div");return r.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",r.style.width==="calc(1320px)"?Math.fround:e=>e})(),ne={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function kr(r){return r<11904}function Dr(r){return(r&65408)===0}function Fr(r){return r>=97&&r<=122||r>=65&&r<=90}function Or(r){return r>=48&&r<=57}function jr(r){return r===32||r===9||r===13||r===10}function Vr(r){return r>=13312&&r<=40959||r>=63744&&r<=64255}function Br(r){return r>=12448&&r<=12543}function Hr(r){return r>=12352&&r<=12447}function Ur(r){return r>=65376&&r<=65439}function $r(r){return(r&65408)===3584}function Ai(r){return kr(r)?Dr(r)?jr(r)?ne.SPACE:Fr(r)||Or(r)||r===95?ne.ALPHA_LETTER:ne.PUNCT:$r(r)?ne.THAI_LETTER:r===160?ne.SPACE:ne.ALPHA_LETTER:Vr(r)?ne.HAN_LETTER:Br(r)?ne.KATAKANA_LETTER:Hr(r)?ne.HIRAGANA_LETTER:Ur(r)?ne.HALFWIDTH_KATAKANA_LETTER:ne.ALPHA_LETTER}let Jn;function Wr(){return Jn||(Jn=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩"),Jn}const ve={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},zr=250,Gr=-50,Kr=-400,Yn={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},qn=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let es;const Xr=new RegExp("\\p{M}+","gu"),Zr=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),Qr=new RegExp("([^\\p{M}])\\p{M}*$","u"),Jr=new RegExp("^\\p{M}*([^\\p{M}])","u"),Yr=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,ts=new Map,qr="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",is=new Map;let Yi=null,qi=null;function en(r){const e=[];let t;for(;(t=Yr.exec(r))!==null;){let{index:v}=t;for(const x of t[0]){let L=ts.get(x);L||(L=x.normalize("NFD").length,ts.set(x,L)),e.push([L,v++])}}let i;if(e.length===0&&Yi)i=Yi;else if(e.length>0&&qi)i=qi;else{const v=Object.keys(Yn).join(""),x=Wr(),C=`([${v}])|([${x}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\p{Ll}-\\n\\p{Lu})|(\\S-\\n)|((?:\\p{Ideographic}|[぀-ヿ])\\n)|(\\n)`;e.length===0?i=Yi=new RegExp(C+"|(\\u0000)","gum"):i=qi=new RegExp(C+`|(${qr})`,"gum")}const n=[];for(;(t=Xr.exec(r))!==null;)n.push([t[0].length,t.index]);let s=r.normalize("NFD");const a=[0,0];let l=0,h=0,d=0,f=0,b=0,E=!1;s=s.replace(i,(v,x,L,N,y,C,O,V,U,j,g)=>{var w,P,F;if(g-=f,x){const D=Yn[x],M=D.length;for(let $=1;$<M;$++)a.push(g-d+$,d-$);return d-=M-1,D}if(L){let D=is.get(L);D||(D=L.normalize("NFKC"),is.set(L,D));const M=D.length;for(let $=1;$<M;$++)a.push(g-d+$,d-$);return d-=M-1,D}if(N)return E=!0,g+b===((w=n[l])==null?void 0:w[1])?++l:(a.push(g-1-d+1,d-1),d-=1,f+=1),a.push(g-d+1,d),f+=1,b+=1,N.charAt(0);if(y){const D=y.endsWith(`
2
+ `),M=D?y.length-2:y.length;E=!0;let $=M;g+b===((P=n[l])==null?void 0:P[1])&&($-=n[l][0],++l);for(let lt=1;lt<=$;lt++)a.push(g-1-d+lt,d-lt);return d-=$,f+=$,D?(g+=M-1,a.push(g-d+1,1+d),d+=1,f+=1,b+=1,y.slice(0,M)):y}if(C)return f+=1,b+=1,C.replace(`
3
+ `,"");if(O){const D=O.length-2;return a.push(g-d+D,1+d),d+=1,f+=1,b+=1,O.slice(0,-2)}if(V){const D=V.length-1;return a.push(g-d+D,d),f+=1,b+=1,V.slice(0,-1)}if(U)return a.push(g-d+1,d-1),d-=1,f+=1,b+=1," ";if(g+b===((F=e[h])==null?void 0:F[1])){const D=e[h][0]-1;++h;for(let M=1;M<=D;M++)a.push(g-(d-M),d-M);d-=D,f+=D}return j}),a.push(s.length,d);const I=new Uint32Array(a.length>>1),A=new Int32Array(a.length>>1);for(let v=0,x=a.length;v<x;v+=2)I[v>>1]=a[v],A[v>>1]=a[v+1];return[s,[I,A],E]}function ea(r,e,t){if(!r)return[e,t];const[i,n]=r,s=e,a=e+t-1;let l=Gt(i,E=>E>=s);i[l]>s&&--l;let h=Gt(i,E=>E>=a,l);i[h]>a&&--h;const d=s+n[l],b=a+n[h]+1-d;return[d,b]}var G,gt,Xe,_,Is,an,on,Ls,Ts,ln,Rs,Cs,Ri,Ft,ht,Ns,hn,dn,Ci,Ms,un,cn,Ot;class ta{constructor({linkService:e,eventBus:t,updateMatchesCountOnProgress:i=!0}){m(this,_);m(this,G,null);m(this,gt,!0);m(this,Xe,0);this._linkService=e,this._eventBus=t,c(this,gt,i),this.onIsPageVisible=null,u(this,_,an).call(this),t._on("find",u(this,_,Is).bind(this)),t._on("findbarclose",u(this,_,Ms).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return o(this,G)}setDocument(e){this._pdfDocument&&u(this,_,an).call(this),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:i=-1,matchIndex:n=-1}){if(!this._scrollMatches||!e)return;if(n===-1||n!==this._selected.matchIdx)return;if(i===-1||i!==this._selected.pageIdx)return;this._scrollMatches=!1;const s={top:Gr,left:t+Kr};Ss(e,s,!0)}match(e,t,i){const n=this._hasDiacritics[i];let s=!1;if(typeof e=="string"?[s,e]=u(this,_,ln).call(this,e,n):e=e.sort().reverse().map(b=>{const[E,I]=u(this,_,ln).call(this,b,n);return s||(s=E),`(${I})`}).join("|"),!e)return;const{caseSensitive:a,entireWord:l}=o(this,G),h=`g${s?"u":""}${a?"":"i"}`;e=new RegExp(e,h);const d=[];let f;for(;(f=e.exec(t))!==null;)l&&!u(this,_,Ts).call(this,t,f.index,f[0].length)||d.push({index:f.index,length:f[0].length});return d}}G=new WeakMap,gt=new WeakMap,Xe=new WeakMap,_=new WeakSet,Is=function(e){if(!e)return;const t=this._pdfDocument,{type:i}=e;(o(this,G)===null||u(this,_,Ls).call(this,e))&&(this._dirtyMatch=!0),c(this,G,e),i!=="highlightallchange"&&u(this,_,Ot).call(this,ve.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;u(this,_,Cs).call(this);const n=!this._highlightMatches,s=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?u(this,_,ht).call(this):i==="again"?(u(this,_,ht).call(this),n&&o(this,G).highlightAll&&u(this,_,Ft).call(this)):i==="highlightallchange"?(s?u(this,_,ht).call(this):this._highlightMatches=!0,u(this,_,Ft).call(this)):u(this,_,ht).call(this):this._findTimeout=setTimeout(()=>{u(this,_,ht).call(this),this._findTimeout=null},zr)})},an=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],c(this,Xe,0),c(this,G,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()},on=function(){const{query:e}=o(this,G);return typeof e=="string"?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=en(e)),this._normalizedQuery):(e||[]).filter(t=>!!t).map(t=>en(t)[0])},Ls=function(e){var a;const t=e.query,i=o(this,G).query,n=typeof t;if(n!==typeof i)return!0;if(n==="string"){if(t!==i)return!0}else if(JSON.stringify(t)!==JSON.stringify(i))return!0;switch(e.type){case"again":const l=this._selected.pageIdx+1,h=this._linkService;return l>=1&&l<=h.pagesCount&&l!==h.page&&!(((a=this.onIsPageVisible)==null?void 0:a.call(this,l))??!0);case"highlightallchange":return!1}return!0},Ts=function(e,t,i){let n=e.slice(0,t).match(Qr);if(n){const s=e.charCodeAt(t),a=n[1].charCodeAt(0);if(Ai(s)===Ai(a))return!1}if(n=e.slice(t+i).match(Jr),n){const s=e.charCodeAt(t+i-1),a=n[1].charCodeAt(0);if(Ai(s)===Ai(a))return!1}return!0},ln=function(e,t){const{matchDiacritics:i}=o(this,G);let n=!1;e=e.replaceAll(Zr,(a,l,h,d,f,b)=>l?`[ ]*\\${l}[ ]*`:h?`[ ]*${h}[ ]*`:d?"[ ]+":i?f||b:f?qn.has(f.charCodeAt(0))?f:"":t?(n=!0,`${b}\\p{M}*`):b);const s="[ ]*";return e.endsWith(s)&&(e=e.slice(0,e.length-s.length)),i&&t&&(es||(es=String.fromCharCode(...qn)),n=!0,e=`${e}(?=[${es}]|[^\\p{M}]|$)`),[n,e]},Rs=function(e){const t=o(this,_,on);if(t.length===0)return;const i=this._pageContents[e],n=this.match(t,i,e),s=this._pageMatches[e]=[],a=this._pageMatchesLength[e]=[],l=this._pageDiffs[e];n==null||n.forEach(({index:d,length:f})=>{const[b,E]=ea(l,d,f);E&&(s.push(b),a.push(E))}),o(this,G).highlightAll&&u(this,_,Ri).call(this,e),this._resumePageIdx===e&&(this._resumePageIdx=null,u(this,_,hn).call(this));const h=s.length;this._matchesCountTotal+=h,o(this,gt)?h>0&&u(this,_,cn).call(this):++Wn(this,Xe)._===this._linkService.pagesCount&&u(this,_,cn).call(this)},Cs=function(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();const t={disableNormalization:!0};for(let i=0,n=this._linkService.pagesCount;i<n;i++){const{promise:s,resolve:a}=Promise.withResolvers();this._extractTextPromises[i]=s,e=e.then(()=>this._pdfDocument.getPage(i+1).then(l=>l.getTextContent(t)).then(l=>{const h=[];for(const d of l.items)h.push(d.str),d.hasEOL&&h.push(`
4
+ `);[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=en(h.join("")),a()},l=>{console.error(`Unable to get text content for page ${i+1}`,l),this._pageContents[i]="",this._pageDiffs[i]=null,this._hasDiacritics[i]=!1,a()}))}},Ri=function(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})},Ft=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},ht=function(){const e=o(this,G).findPrevious,t=this._linkService.page-1,i=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,c(this,Xe,0),this._matchesCountTotal=0,u(this,_,Ft).call(this);for(let a=0;a<i;a++)this._pendingFindMatches.has(a)||(this._pendingFindMatches.add(a),this._extractTextPromises[a].then(()=>{this._pendingFindMatches.delete(a),u(this,_,Rs).call(this,a)}))}if(o(this,_,on).length===0){u(this,_,Ot).call(this,ve.FOUND);return}if(this._resumePageIdx)return;const s=this._offset;if(this._pagesToSearch=i,s.matchIdx!==null){const a=this._pageMatches[s.pageIdx].length;if(!e&&s.matchIdx+1<a||e&&s.matchIdx>0){s.matchIdx=e?s.matchIdx-1:s.matchIdx+1,u(this,_,Ci).call(this,!0);return}u(this,_,dn).call(this,e)}u(this,_,hn).call(this)},Ns=function(e){const t=this._offset,i=e.length,n=o(this,G).findPrevious;return i?(t.matchIdx=n?i-1:0,u(this,_,Ci).call(this,!0),!0):(u(this,_,dn).call(this,n),t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0)?(u(this,_,Ci).call(this,!1),!0):!1)},hn=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!u(this,_,Ns).call(this,e))},dn=function(e){const t=this._offset,i=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=i||t.pageIdx<0)&&(t.pageIdx=e?i-1:0,t.wrapped=!0)},Ci=function(e=!1){let t=ve.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,e){const n=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=i?ve.WRAPPED:ve.FOUND,n!==-1&&n!==this._selected.pageIdx&&u(this,_,Ri).call(this,n)}u(this,_,Ot).call(this,t,o(this,G).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,u(this,_,Ri).call(this,this._selected.pageIdx))},Ms=function(e){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),u(this,_,Ot).call(this,ve.FOUND),this._highlightMatches=!1,u(this,_,Ft).call(this))})},un=function(){var s;const{pageIdx:e,matchIdx:t}=this._selected;let i=0,n=this._matchesCountTotal;if(t!==-1){for(let a=0;a<e;a++)i+=((s=this._pageMatches[a])==null?void 0:s.length)||0;i+=t+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}},cn=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:u(this,_,un).call(this)})},Ot=function(e,t=!1){var i,n;!o(this,gt)&&(o(this,Xe)!==this._linkService.pagesCount||e===ve.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,entireWord:((i=o(this,G))==null?void 0:i.entireWord)??null,matchesCount:u(this,_,un).call(this),rawQuery:((n=o(this,G))==null?void 0:n.query)??null})};const ia="noopener noreferrer nofollow",$e={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var Wi,ks;const zi=class zi{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}={}){Zi(this,"externalLinkEnabled",!0);this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=i,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(e){this.pdfDocument&&(this.pdfViewer.currentPageNumber=e)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(e){this.pdfDocument&&(this.pdfViewer.pagesRotation=e)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(e){if(!this.pdfDocument)return;let t,i,n;if(typeof e=="string"?(t=e,i=await this.pdfDocument.getDestination(e)):(t=null,i=await e),!Array.isArray(i)){console.error(`goToDestination: "${i}" is not a valid destination array, for dest="${e}".`);return}const[s]=i;if(s&&typeof s=="object"){if(n=this.pdfDocument.cachedPageNumber(s),!n)try{n=await this.pdfDocument.getPageIndex(s)+1}catch{console.error(`goToDestination: "${s}" is not a valid page reference, for dest="${e}".`);return}}else Number.isInteger(s)&&(n=s+1);if(!n||n<1||n>this.pagesCount){console.error(`goToDestination: "${n}" is not a valid page number, for dest="${e}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom})}goToPage(e){if(!this.pdfDocument)return;const t=typeof e=="string"&&this.pdfViewer.pageLabelToPageNumber(e)||e|0;if(!(Number.isInteger(t)&&t>0&&t<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})}addLinkAttributes(e,t,i=!1){if(!t||typeof t!="string")throw new Error('A valid "url" parameter must provided.');const n=i?$e.BLANK:this.externalLinkTarget,s=this.externalLinkRel;this.externalLinkEnabled?e.href=e.title=t:(e.href="",e.title=`Disabled: ${t}`,e.onclick=()=>!1);let a="";switch(n){case $e.NONE:break;case $e.SELF:a="_self";break;case $e.BLANK:a="_blank";break;case $e.PARENT:a="_parent";break;case $e.TOP:a="_top";break}e.target=a,e.rel=typeof s=="string"?s:ia}getDestinationHash(e){if(typeof e=="string"){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){const t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){var n;if(!this.pdfDocument)return;let t,i;if(e.includes("=")){const s=Ki(e);if(s.has("search")){const a=s.get("search").replaceAll('"',""),l=s.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:l?a:a.match(/\S+/g)})}if(s.has("page")&&(t=s.get("page")|0||1),s.has("zoom")){const a=s.get("zoom").split(","),l=a[0],h=parseFloat(l);l.includes("Fit")?l==="Fit"||l==="FitB"?i=[null,{name:l}]:l==="FitH"||l==="FitBH"||l==="FitV"||l==="FitBV"?i=[null,{name:l},a.length>1?a[1]|0:null]:l==="FitR"?a.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:l},a[1]|0,a[2]|0,a[3]|0,a[4]|0]:console.error(`PDFLinkService.setHash: "${l}" is not a valid zoom value.`):i=[null,{name:"XYZ"},a.length>1?a[1]|0:null,a.length>2?a[2]|0:null,h?h/100:l]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t),s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")}),s.has("nameddest")&&this.goToDestination(s.get("nameddest"));return}i=unescape(e);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}if(typeof i=="string"||u(n=zi,Wi,ks).call(n,i)){this.goToDestination(i);return}console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}executeNamedAction(e){var t,i;if(this.pdfDocument){switch(e){case"GoBack":(t=this.pdfHistory)==null||t.back();break;case"GoForward":(i=this.pdfHistory)==null||i.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:e})}}async executeSetOCGState(e){if(!this.pdfDocument)return;const t=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(i.setOCGState(e),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i))}};Wi=new WeakSet,ks=function(e){if(!Array.isArray(e)||e.length<2)return!1;const[t,i,...n]=e;if(!(typeof t=="object"&&Number.isInteger(t==null?void 0:t.num)&&Number.isInteger(t==null?void 0:t.gen))&&!Number.isInteger(t)||!(typeof i=="object"&&typeof(i==null?void 0:i.name)=="string"))return!1;const s=n.length;let a=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;a=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||a&&l===null))return!1;return!0},m(zi,Wi);let Bi=zi;class Un extends Bi{setDocument(e,t=null){}}const{AbortException:na,AnnotationEditorLayer:sa,AnnotationEditorParamsType:Co,AnnotationEditorType:Y,AnnotationEditorUIManager:ra,AnnotationLayer:aa,AnnotationMode:_e,build:No,ColorPicker:Mo,createValidAbsoluteUrl:oa,DOMSVGFactory:ko,DrawLayer:la,FeatureTest:Do,fetchData:ns,getDocument:Fo,getFilenameFromUrl:Oo,getPdfFilenameFromUrl:ha,getXfaPageViewport:jo,GlobalWorkerOptions:Vo,ImageKind:Bo,InvalidPDFException:Ho,isDataScheme:Uo,isPdfFile:da,MissingPDFException:$o,noContextMenu:Wo,normalizeUnicode:ua,OPS:zo,OutputScale:ca,PasswordResponses:Go,PDFDataRangeTransport:Ko,PDFDateString:Xo,PDFWorker:Zo,PermissionFlag:Ii,PixelsPerInch:ge,RenderingCancelledException:fn,setLayerDimensions:fa,shadow:Hi,stopEvent:gn,TextLayer:ga,TouchManager:Qo,UnexpectedResponseException:Jo,Util:Yo,VerbosityLevel:qo,version:ss,XfaLayer:tn}=globalThis.pdfjsLib;var Xt,Ie,Zt,pn;class Ds{constructor({pdfPage:e,linkService:t,downloadManager:i,annotationStorage:n=null,imageResourcesPath:s="",renderForms:a=!0,enableScripting:l=!1,hasJSActionsPromise:h=null,fieldObjectsPromise:d=null,annotationCanvasMap:f=null,accessibilityManager:b=null,annotationEditorUIManager:E=null,onAppend:I=null}){m(this,Zt);m(this,Xt,null);m(this,Ie,null);this.pdfPage=e,this.linkService=t,this.downloadManager=i,this.imageResourcesPath=s,this.renderForms=a,this.annotationStorage=n,this.enableScripting=l,this._hasJSActionsPromise=h||Promise.resolve(!1),this._fieldObjectsPromise=d||Promise.resolve(null),this._annotationCanvasMap=f,this._accessibilityManager=b,this._annotationEditorUIManager=E,c(this,Xt,I),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}async render(e,t,i="display"){var h,d;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:e.clone({dontFlip:!0})});return}const[n,s,a]=await Promise.all([this.pdfPage.getAnnotations({intent:i}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const l=this.div=document.createElement("div");if(l.className="annotationLayer",(h=o(this,Xt))==null||h.call(this,l),n.length===0){this.hide();return}this.annotationLayer=new aa({div:l,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:e.clone({dontFlip:!0}),structTreeLayer:(t==null?void 0:t.structTreeLayer)||null}),await this.annotationLayer.render({annotations:n,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:a}),this.linkService.isInPresentationMode&&u(this,Zt,pn).call(this,ct.FULLSCREEN),o(this,Ie)||(c(this,Ie,new AbortController),(d=this._eventBus)==null||d._on("presentationmodechanged",f=>{u(this,Zt,pn).call(this,f.state)},{signal:o(this,Ie).signal}))}cancel(){var e;this._cancelled=!0,(e=o(this,Ie))==null||e.abort(),c(this,Ie,null)}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){var e;return!!((e=this.annotationLayer)!=null&&e.hasEditableAnnotations())}}Xt=new WeakMap,Ie=new WeakMap,Zt=new WeakSet,pn=function(e){if(!this.div)return;let t=!1;switch(e){case ct.FULLSCREEN:t=!0;break;case ct.NORMAL:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=t)};function rs(r,e){const t=document.createElement("a");if(!t.click)throw new Error('DownloadManager: "a.click()" is not supported.');t.href=r,t.target="_parent","download"in t&&(t.download=e),(document.body||document.documentElement).append(t),t.click(),t.remove()}var Hn;class pa{constructor(){m(this,Hn,new WeakMap)}downloadData(e,t,i){const n=URL.createObjectURL(new Blob([e],{type:i}));rs(n,t)}openOrDownloadData(e,t,i=null){const s=da(t)?"application/pdf":"";return this.downloadData(e,t,s),!1}download(e,t,i){let n;if(e)n=URL.createObjectURL(new Blob([e],{type:"application/pdf"}));else{if(!oa(t,"http://example.com")){console.error(`download - not a valid URL: ${t}`);return}n=t+"#pdfjs.action=download"}rs(n,i)}}Hn=new WeakMap;const as={EVENT:"event",TIMEOUT:"timeout"};async function ma({target:r,name:e,delay:t=0}){if(typeof r!="object"||!(Number.isInteger(t)&&t>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:i,resolve:n}=Promise.withResolvers(),s=new AbortController;function a(d){s.abort(),clearTimeout(h),n(d)}const l=r instanceof Fs?"_on":"addEventListener";r[l](e,a.bind(null,as.EVENT),{signal:s.signal});const h=setTimeout(a.bind(null,as.TIMEOUT),t);return i}var pt;class Fs{constructor(){m(this,pt,Object.create(null))}on(e,t,i=null){this._on(e,t,{external:!0,once:i==null?void 0:i.once,signal:i==null?void 0:i.signal})}off(e,t,i=null){this._off(e,t)}dispatch(e,t){const i=o(this,pt)[e];if(!i||i.length===0)return;let n;for(const{listener:s,external:a,once:l}of i.slice(0)){if(l&&this._off(e,s),a){(n||(n=[])).push(s);continue}s(t)}if(n){for(const s of n)s(t);n=null}}_on(e,t,i=null){var a;let n=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:l}=i;if(l.aborted){console.error("Cannot use an `aborted` signal.");return}const h=()=>this._off(e,t);n=()=>l.removeEventListener("abort",h),l.addEventListener("abort",h)}((a=o(this,pt))[e]||(a[e]=[])).push({listener:t,external:(i==null?void 0:i.external)===!0,once:(i==null?void 0:i.once)===!0,rmAbort:n})}_off(e,t,i=null){var s;const n=o(this,pt)[e];if(n)for(let a=0,l=n.length;a<l;a++){const h=n[a];if(h.listener===t){(s=h.rmAbort)==null||s.call(h),n.splice(a,1);return}}}}pt=new WeakMap;class Xi{constructor(e){this.value=e}valueOf(){return this.value}}class W extends Xi{constructor(e="???"){super(e)}toString(e){return`{${this.value}}`}}class ye extends Xi{constructor(e,t={}){super(e),this.opts=t}toString(e){try{return e.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){return e.reportError(t),this.value.toString(10)}}}class Wt extends Xi{constructor(e,t={}){super(e),this.opts=t}toString(e){try{return e.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(t){return e.reportError(t),new Date(this.value).toISOString()}}}const os=100,ba="⁨",Ea="⁩";function wa(r,e,t){if(t===e||t instanceof ye&&e instanceof ye&&t.value===e.value)return!0;if(e instanceof ye&&typeof t=="string"){let i=r.memoizeIntlObject(Intl.PluralRules,e.opts).select(e.value);if(t===i)return!0}return!1}function ls(r,e,t){return e[t]?Ct(r,e[t].value):(r.reportError(new RangeError("No default")),new W)}function mn(r,e){const t=[],i=Object.create(null);for(const n of e)n.type==="narg"?i[n.name]=Kt(r,n.value):t.push(Kt(r,n));return{positional:t,named:i}}function Kt(r,e){switch(e.type){case"str":return e.value;case"num":return new ye(e.value,{minimumFractionDigits:e.precision});case"var":return _a(r,e);case"mesg":return ya(r,e);case"term":return va(r,e);case"func":return Pa(r,e);case"select":return xa(r,e);default:return new W}}function _a(r,{name:e}){let t;if(r.params)if(Object.prototype.hasOwnProperty.call(r.params,e))t=r.params[e];else return new W(`$${e}`);else if(r.args&&Object.prototype.hasOwnProperty.call(r.args,e))t=r.args[e];else return r.reportError(new ReferenceError(`Unknown variable: $${e}`)),new W(`$${e}`);if(t instanceof Xi)return t;switch(typeof t){case"string":return t;case"number":return new ye(t);case"object":if(t instanceof Date)return new Wt(t.getTime());default:return r.reportError(new TypeError(`Variable type not supported: $${e}, ${typeof t}`)),new W(`$${e}`)}}function ya(r,{name:e,attr:t}){const i=r.bundle._messages.get(e);if(!i)return r.reportError(new ReferenceError(`Unknown message: ${e}`)),new W(e);if(t){const n=i.attributes[t];return n?Ct(r,n):(r.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new W(`${e}.${t}`))}return i.value?Ct(r,i.value):(r.reportError(new ReferenceError(`No value: ${e}`)),new W(e))}function va(r,{name:e,attr:t,args:i}){const n=`-${e}`,s=r.bundle._terms.get(n);if(!s)return r.reportError(new ReferenceError(`Unknown term: ${n}`)),new W(n);if(t){const l=s.attributes[t];if(l){r.params=mn(r,i).named;const h=Ct(r,l);return r.params=null,h}return r.reportError(new ReferenceError(`Unknown attribute: ${t}`)),new W(`${n}.${t}`)}r.params=mn(r,i).named;const a=Ct(r,s.value);return r.params=null,a}function Pa(r,{name:e,args:t}){let i=r.bundle._functions[e];if(!i)return r.reportError(new ReferenceError(`Unknown function: ${e}()`)),new W(`${e}()`);if(typeof i!="function")return r.reportError(new TypeError(`Function ${e}() is not callable`)),new W(`${e}()`);try{let n=mn(r,t);return i(n.positional,n.named)}catch(n){return r.reportError(n),new W(`${e}()`)}}function xa(r,{selector:e,variants:t,star:i}){let n=Kt(r,e);if(n instanceof W)return ls(r,t,i);for(const s of t){const a=Kt(r,s.key);if(wa(r,n,a))return Ct(r,s.value)}return ls(r,t,i)}function Os(r,e){if(r.dirty.has(e))return r.reportError(new RangeError("Cyclic reference")),new W;r.dirty.add(e);const t=[],i=r.bundle._useIsolating&&e.length>1;for(const n of e){if(typeof n=="string"){t.push(r.bundle._transform(n));continue}if(r.placeables++,r.placeables>os)throw r.dirty.delete(e),new RangeError(`Too many placeables expanded: ${r.placeables}, max allowed is ${os}`);i&&t.push(ba),t.push(Kt(r,n).toString(r)),i&&t.push(Ea)}return r.dirty.delete(e),t.join("")}function Ct(r,e){return typeof e=="string"?r.bundle._transform(e):Os(r,e)}class Sa{constructor(e,t,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=e,this.errors=t,this.args=i}reportError(e){if(!this.errors||!(e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,t){let i=this.bundle._intls.get(e);i||(i={},this.bundle._intls.set(e,i));let n=JSON.stringify(t);return i[n]||(i[n]=new e(this.bundle.locales,t)),i[n]}}function Ui(r,e){const t=Object.create(null);for(const[i,n]of Object.entries(r))e.includes(i)&&(t[i]=n.valueOf());return t}const hs=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function Aa(r,e){let t=r[0];if(t instanceof W)return new W(`NUMBER(${t.valueOf()})`);if(t instanceof ye)return new ye(t.valueOf(),{...t.opts,...Ui(e,hs)});if(t instanceof Wt)return new ye(t.valueOf(),{...Ui(e,hs)});throw new TypeError("Invalid argument to NUMBER")}const ds=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function Ia(r,e){let t=r[0];if(t instanceof W)return new W(`DATETIME(${t.valueOf()})`);if(t instanceof Wt)return new Wt(t.valueOf(),{...t.opts,...Ui(e,ds)});if(t instanceof ye)return new Wt(t.valueOf(),{...Ui(e,ds)});throw new TypeError("Invalid argument to DATETIME")}const us=new Map;function La(r){const e=Array.isArray(r)?r.join(" "):r;let t=us.get(e);return t===void 0&&(t=new Map,us.set(e,t)),t}class Ta{constructor(e,{functions:t,useIsolating:i=!0,transform:n=s=>s}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(e)?e:[e],this._functions={NUMBER:Aa,DATETIME:Ia,...t},this._useIsolating=i,this._transform=n,this._intls=La(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:t=!1}={}){const i=[];for(let n=0;n<e.body.length;n++){let s=e.body[n];if(s.id.startsWith("-")){if(t===!1&&this._terms.has(s.id)){i.push(new Error(`Attempt to override an existing term: "${s.id}"`));continue}this._terms.set(s.id,s)}else{if(t===!1&&this._messages.has(s.id)){i.push(new Error(`Attempt to override an existing message: "${s.id}"`));continue}this._messages.set(s.id,s)}}return i}formatPattern(e,t=null,i=null){if(typeof e=="string")return this._transform(e);let n=new Sa(this,i,t);try{return Os(n,e).toString(n)}catch(s){if(n.errors&&s instanceof Error)return n.errors.push(s),new W().toString(n);throw s}}}const nn=/^(-?[a-zA-Z][\w-]*) *= */gm,cs=/\.([a-zA-Z][\w-]*) *= */y,Ra=/\*?\[/y,sn=/(-?[0-9]+(?:\.([0-9]+))?)/y,Ca=/([a-zA-Z][\w-]*)/y,fs=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,Na=/^[A-Z][A-Z0-9_-]*$/,Li=/([^{}\n\r]+)/y,Ma=/([^\\"\n\r]*)/y,gs=/\\([\\"])/y,ps=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,ka=/^\n+/,ms=/ +$/,Da=/ *\r?\n/g,Fa=/( *)$/,Oa=/{\s*/y,bs=/\s*}/y,ja=/\[\s*/y,Va=/\s*] */y,Ba=/\s*\(\s*/y,Ha=/\s*->\s*/y,Ua=/\s*:\s*/y,$a=/\s*,?\s*/y,Wa=/\s+/y;class za{constructor(e){this.body=[],nn.lastIndex=0;let t=0;for(;;){let g=nn.exec(e);if(g===null)break;t=nn.lastIndex;try{this.body.push(h(g[1]))}catch(w){if(w instanceof SyntaxError)continue;throw w}}function i(g){return g.lastIndex=t,g.test(e)}function n(g,w){if(e[t]===g)return t++,!0;if(w)throw new w(`Expected ${g}`);return!1}function s(g,w){if(i(g))return t=g.lastIndex,!0;if(w)throw new w(`Expected ${g.toString()}`);return!1}function a(g){g.lastIndex=t;let w=g.exec(e);if(w===null)throw new SyntaxError(`Expected ${g.toString()}`);return t=g.lastIndex,w}function l(g){return a(g)[1]}function h(g){let w=f(),P=d();if(w===null&&Object.keys(P).length===0)throw new SyntaxError("Expected message value or attributes");return{id:g,value:w,attributes:P}}function d(){let g=Object.create(null);for(;i(cs);){let w=l(cs),P=f();if(P===null)throw new SyntaxError("Expected attribute value");g[w]=P}return g}function f(){let g;if(i(Li)&&(g=l(Li)),e[t]==="{"||e[t]==="}")return b(g?[g]:[],1/0);let w=V();return w?g?b([g,w],w.length):(w.value=U(w.value,ka),b([w],w.length)):g?U(g,ms):null}function b(g=[],w){for(;;){if(i(Li)){g.push(l(Li));continue}if(e[t]==="{"){g.push(E());continue}if(e[t]==="}")throw new SyntaxError("Unbalanced closing brace");let M=V();if(M){g.push(M),w=Math.min(w,M.length);continue}break}let P=g.length-1,F=g[P];typeof F=="string"&&(g[P]=U(F,ms));let D=[];for(let M of g)M instanceof Es&&(M=M.value.slice(0,M.value.length-w)),M&&D.push(M);return D}function E(){s(Oa,SyntaxError);let g=I();if(s(bs))return g;if(s(Ha)){let w=x();return s(bs,SyntaxError),{type:"select",selector:g,...w}}throw new SyntaxError("Unclosed placeable")}function I(){if(e[t]==="{")return E();if(i(fs)){let[,g,w,P=null]=a(fs);if(g==="$")return{type:"var",name:w};if(s(Ba)){let F=A();if(g==="-")return{type:"term",name:w,attr:P,args:F};if(Na.test(w))return{type:"func",name:w,args:F};throw new SyntaxError("Function names must be all upper-case")}return g==="-"?{type:"term",name:w,attr:P,args:[]}:{type:"mesg",name:w,attr:P}}return N()}function A(){let g=[];for(;;){switch(e[t]){case")":return t++,g;case void 0:throw new SyntaxError("Unclosed argument list")}g.push(v()),s($a)}}function v(){let g=I();return g.type!=="mesg"?g:s(Ua)?{type:"narg",name:g.name,value:N()}:g}function x(){let g=[],w=0,P;for(;i(Ra);){n("*")&&(P=w);let F=L(),D=f();if(D===null)throw new SyntaxError("Expected variant value");g[w++]={key:F,value:D}}if(w===0)return null;if(P===void 0)throw new SyntaxError("Expected default variant");return{variants:g,star:P}}function L(){s(ja,SyntaxError);let g;return i(sn)?g=y():g={type:"str",value:l(Ca)},s(Va,SyntaxError),g}function N(){if(i(sn))return y();if(e[t]==='"')return C();throw new SyntaxError("Invalid expression")}function y(){let[,g,w=""]=a(sn),P=w.length;return{type:"num",value:parseFloat(g),precision:P}}function C(){n('"',SyntaxError);let g="";for(;;){if(g+=l(Ma),e[t]==="\\"){g+=O();continue}if(n('"'))return{type:"str",value:g};throw new SyntaxError("Unclosed string literal")}}function O(){if(i(gs))return l(gs);if(i(ps)){let[,g,w]=a(ps),P=parseInt(g||w,16);return P<=55295||57344<=P?String.fromCodePoint(P):"�"}throw new SyntaxError("Unknown escape sequence")}function V(){let g=t;switch(s(Wa),e[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return j(e.slice(g,t))}return e[t-1]===" "?j(e.slice(g,t)):!1}function U(g,w){return g.replace(w,"")}function j(g){let w=g.replace(Da,`
5
+ `),P=Fa.exec(g)[1].length;return new Es(w,P)}}}class Es{constructor(e,t){this.value=e,this.length=t}}const Ga=/<|&#?\w+;/,Ka={"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"]},Xa={"http://www.w3.org/1999/xhtml":{global:["title","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"]}};function Za(r,e){const{value:t}=e;if(typeof t=="string")if(r.localName==="title"&&r.namespaceURI==="http://www.w3.org/1999/xhtml")r.textContent=t;else if(!Ga.test(t))r.textContent=t;else{const i=r.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=t,Qa(i.content,r)}js(e,r)}function Qa(r,e){for(const t of r.childNodes)if(t.nodeType!==t.TEXT_NODE){if(t.hasAttribute("data-l10n-name")){const i=Ya(e,t);r.replaceChild(i,t);continue}if(eo(t)){const i=qa(t);r.replaceChild(i,t);continue}console.warn(`An element of forbidden type "${t.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),r.replaceChild(bn(t),t)}e.textContent="",e.appendChild(r)}function Ja(r,e){if(!r)return!1;for(let t of r)if(t.name===e)return!0;return!1}function js(r,e){const t=e.hasAttribute("data-l10n-attrs")?e.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(const i of Array.from(e.attributes))ws(i.name,e,t)&&!Ja(r.attributes,i.name)&&e.removeAttribute(i.name);if(r.attributes)for(const i of Array.from(r.attributes))ws(i.name,e,t)&&e.getAttribute(i.name)!==i.value&&e.setAttribute(i.name,i.value)}function Ya(r,e){const t=e.getAttribute("data-l10n-name"),i=r.querySelector(`[data-l10n-name="${t}"]`);if(!i)return console.warn(`An element named "${t}" wasn't found in the source.`),bn(e);if(i.localName!==e.localName)return console.warn(`An element named "${t}" was found in the translation but its type ${e.localName} didn't match the element found in the source (${i.localName}).`),bn(e);r.removeChild(i);const n=i.cloneNode(!1);return Vs(e,n)}function qa(r){const e=r.ownerDocument.createElement(r.localName);return Vs(r,e)}function bn(r){return r.ownerDocument.createTextNode(r.textContent)}function eo(r){const e=Ka[r.namespaceURI];return e&&e.includes(r.localName)}function ws(r,e,t=null){if(t&&t.includes(r))return!0;const i=Xa[e.namespaceURI];if(!i)return!1;const n=r.toLowerCase(),s=e.localName;if(i.global.includes(n))return!0;if(!i[s])return!1;if(i[s].includes(n))return!0;if(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&s==="input"&&n==="value"){const a=e.type.toLowerCase();if(a==="submit"||a==="button"||a==="reset")return!0}return!1}function Vs(r,e){return e.textContent=r.textContent,js(r,e),e}class to extends Array{static from(e){return e instanceof this?e:new this(e)}}class io extends to{constructor(e){if(super(),Symbol.asyncIterator in Object(e))this.iterator=e[Symbol.asyncIterator]();else if(Symbol.iterator in Object(e))this.iterator=e[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const e=this;let t=0;return{async next(){return e.length<=t&&e.push(e.iterator.next()),e[t++]}}}async touchNext(e=1){let t=0;for(;t++<e;){const i=this[this.length-1];if(i&&(await i).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class no{constructor(e=[],t){this.resourceIds=e,this.generateBundles=t,this.onChange(!0)}addResourceIds(e,t=!1){return this.resourceIds.push(...e),this.onChange(t),this.resourceIds.length}removeResourceIds(e){return this.resourceIds=this.resourceIds.filter(t=>!e.includes(t)),this.onChange(),this.resourceIds.length}async formatWithFallback(e,t){const i=[];let n=!1;for await(const s of this.bundles){n=!0;const a=ao(t,s,e,i);if(a.size===0)break;if(typeof console<"u"){const l=s.locales[0],h=Array.from(a).join(", ");console.warn(`[fluent] Missing translations in ${l}: ${h}`)}}return!n&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
6
+ keys: ${JSON.stringify(e)}.
7
+ resourceIds: ${JSON.stringify(this.resourceIds)}.`),i}formatMessages(e){return this.formatWithFallback(e,ro)}formatValues(e){return this.formatWithFallback(e,so)}async formatValue(e,t){const[i]=await this.formatValues([{id:e,args:t}]);return i}handleEvent(){this.onChange()}onChange(e=!1){this.bundles=io.from(this.generateBundles(this.resourceIds)),e&&this.bundles.touchNext(2)}}function so(r,e,t,i){return t.value?r.formatPattern(t.value,i,e):null}function ro(r,e,t,i){const n={value:null,attributes:null};t.value&&(n.value=r.formatPattern(t.value,i,e));let s=Object.keys(t.attributes);if(s.length>0){n.attributes=new Array(s.length);for(let[a,l]of s.entries()){let h=r.formatPattern(t.attributes[l],i,e);n.attributes[a]={name:l,value:h}}}return n}function ao(r,e,t,i){const n=[],s=new Set;return t.forEach(({id:a,args:l},h)=>{if(i[h]!==void 0)return;let d=e.getMessage(a);if(d){if(n.length=0,i[h]=r(e,n,d,l),n.length>0&&typeof console<"u"){const f=e.locales[0],b=n.join(", ");console.warn(`[fluent][resolver] errors in ${f}/${a}: ${b}.`)}}else s.add(a)}),s}const We="data-l10n-id",Dt="data-l10n-args",oo=`[${We}]`;class lo extends no{constructor(e,t){super(e,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:[We,Dt]}}onChange(e=!1){super.onChange(e),this.roots&&this.translateRoots()}setAttributes(e,t,i){return e.setAttribute(We,t),i?e.setAttribute(Dt,JSON.stringify(i)):e.removeAttribute(Dt),e}getAttributes(e){return{id:e.getAttribute(We),args:JSON.parse(e.getAttribute(Dt)||null)}}connectRoot(e){for(const t of this.roots)if(t===e||t.contains(e)||e.contains(t))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==e.ownerDocument.defaultView)throw new Error(`Cannot connect a root:
8
+ DOMLocalization already has a root from a different window.`)}else this.windowElement=e.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(t=>this.translateMutations(t));this.roots.add(e),this.mutationObserver.observe(e,this.observerConfig)}disconnectRoot(e){return this.roots.delete(e),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 e=Array.from(this.roots);return Promise.all(e.map(t=>this.translateFragment(t)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const e of this.roots)this.mutationObserver.observe(e,this.observerConfig)}translateMutations(e){for(const t of e)switch(t.type){case"attributes":t.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(t.target);break;case"childList":for(const i of t.addedNodes)if(i.nodeType===i.ELEMENT_NODE)if(i.childElementCount)for(const n of this.getTranslatables(i))this.pendingElements.add(n);else i.hasAttribute(We)&&this.pendingElements.add(i);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(e){return this.translateElements(this.getTranslatables(e))}async translateElements(e){if(!e.length)return;const t=e.map(this.getKeysForElement),i=await this.formatMessages(t);return this.applyTranslations(e,i)}applyTranslations(e,t){this.pauseObserving();for(let i=0;i<e.length;i++)t[i]!==void 0&&Za(e[i],t[i]);this.resumeObserving()}getTranslatables(e){const t=Array.from(e.querySelectorAll(oo));return typeof e.hasAttribute=="function"&&e.hasAttribute(We)&&t.push(e),t}getKeysForElement(e){return{id:e.getAttribute(We),args:JSON.parse(e.getAttribute(Dt)||null)}}}var Qt,Le,mt,Q,Mt,Bs,Hs;const zt=class zt{constructor({lang:e,isRTL:t},i=null){m(this,Qt);m(this,Le);m(this,mt);m(this,Q);var n,s;c(this,mt,u(n=zt,Mt,Bs).call(n,e)),c(this,Q,i),c(this,Qt,t??u(s=zt,Mt,Hs).call(s,o(this,mt))?"rtl":"ltr")}_setL10n(e){c(this,Q,e)}getLanguage(){return o(this,mt)}getDirection(){return o(this,Qt)}async get(e,t=null,i){var s;return Array.isArray(e)?(e=e.map(l=>({id:l})),(await o(this,Q).formatMessages(e)).map(l=>l.value)):((s=(await o(this,Q).formatMessages([{id:e,args:t}]))[0])==null?void 0:s.value)||i}async translate(e){(o(this,Le)||c(this,Le,new Set)).add(e);try{o(this,Q).connectRoot(e),await o(this,Q).translateRoots()}catch{}}async translateOnce(e){try{await o(this,Q).translateElements([e])}catch(t){console.error("translateOnce:",t)}}async destroy(){if(o(this,Le)){for(const e of o(this,Le))o(this,Q).disconnectRoot(e);o(this,Le).clear(),c(this,Le,null)}o(this,Q).pauseObserving()}pause(){o(this,Q).pauseObserving()}resume(){o(this,Q).resumeObserving()}};Qt=new WeakMap,Le=new WeakMap,mt=new WeakMap,Q=new WeakMap,Mt=new WeakSet,Bs=function(e){return e=(e==null?void 0:e.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"}[e]||e},Hs=function(e){const t=e.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(t)},m(zt,Mt);let En=zt;function _s(r,e){const t=new za(e),i=new Ta(r),n=i.addResource(t);return n.length&&console.error("L10n errors",n),i}var ee,Us,$s,Ws,zs,wn;const ze=class ze extends En{constructor(e){super({lang:e});const t=e?u(ze,ee,Us).bind(ze,"en-us",this.getLanguage()):u(ze,ee,zs).bind(ze,this.getLanguage());this._setL10n(new lo([],t))}};ee=new WeakSet,Us=async function*(e,t){const{baseURL:i,paths:n}=await u(this,ee,Ws).call(this),s=[t];if(e!==t){const a=t.split("-",1)[0];a!==t&&s.push(a),s.push(e)}for(const a of s){const l=await u(this,ee,$s).call(this,a,i,n);l?yield l:a==="en-us"&&(yield u(this,ee,wn).call(this,a))}},$s=async function(e,t,i){const n=i[e];if(!n)return null;const s=new URL(n,t),a=await ns(s,"text");return _s(e,a)},Ws=async function(){try{const{href:e}=document.querySelector('link[type="application/l10n"]'),t=await ns(e,"json");return{baseURL:e.replace(/[^/]*$/,"")||"./",paths:t}}catch{}return{baseURL:"./",paths:Object.create(null)}},zs=async function*(e){yield u(this,ee,wn).call(this,e)},wn=async function(e){return _s(e,`pdfjs-previous-button =
9
+ .title = Previous Page
10
+ pdfjs-previous-button-label = Previous
11
+ pdfjs-next-button =
12
+ .title = Next Page
13
+ pdfjs-next-button-label = Next
14
+ pdfjs-page-input =
15
+ .title = Page
16
+ pdfjs-of-pages = of { $pagesCount }
17
+ pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })
18
+ pdfjs-zoom-out-button =
19
+ .title = Zoom Out
20
+ pdfjs-zoom-out-button-label = Zoom Out
21
+ pdfjs-zoom-in-button =
22
+ .title = Zoom In
23
+ pdfjs-zoom-in-button-label = Zoom In
24
+ pdfjs-zoom-select =
25
+ .title = Zoom
26
+ pdfjs-presentation-mode-button =
27
+ .title = Switch to Presentation Mode
28
+ pdfjs-presentation-mode-button-label = Presentation Mode
29
+ pdfjs-open-file-button =
30
+ .title = Open File
31
+ pdfjs-open-file-button-label = Open
32
+ pdfjs-print-button =
33
+ .title = Print
34
+ pdfjs-print-button-label = Print
35
+ pdfjs-save-button =
36
+ .title = Save
37
+ pdfjs-save-button-label = Save
38
+ pdfjs-download-button =
39
+ .title = Download
40
+ pdfjs-download-button-label = Download
41
+ pdfjs-bookmark-button =
42
+ .title = Current Page (View URL from Current Page)
43
+ pdfjs-bookmark-button-label = Current Page
44
+ pdfjs-tools-button =
45
+ .title = Tools
46
+ pdfjs-tools-button-label = Tools
47
+ pdfjs-first-page-button =
48
+ .title = Go to First Page
49
+ pdfjs-first-page-button-label = Go to First Page
50
+ pdfjs-last-page-button =
51
+ .title = Go to Last Page
52
+ pdfjs-last-page-button-label = Go to Last Page
53
+ pdfjs-page-rotate-cw-button =
54
+ .title = Rotate Clockwise
55
+ pdfjs-page-rotate-cw-button-label = Rotate Clockwise
56
+ pdfjs-page-rotate-ccw-button =
57
+ .title = Rotate Counterclockwise
58
+ pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise
59
+ pdfjs-cursor-text-select-tool-button =
60
+ .title = Enable Text Selection Tool
61
+ pdfjs-cursor-text-select-tool-button-label = Text Selection Tool
62
+ pdfjs-cursor-hand-tool-button =
63
+ .title = Enable Hand Tool
64
+ pdfjs-cursor-hand-tool-button-label = Hand Tool
65
+ pdfjs-scroll-page-button =
66
+ .title = Use Page Scrolling
67
+ pdfjs-scroll-page-button-label = Page Scrolling
68
+ pdfjs-scroll-vertical-button =
69
+ .title = Use Vertical Scrolling
70
+ pdfjs-scroll-vertical-button-label = Vertical Scrolling
71
+ pdfjs-scroll-horizontal-button =
72
+ .title = Use Horizontal Scrolling
73
+ pdfjs-scroll-horizontal-button-label = Horizontal Scrolling
74
+ pdfjs-scroll-wrapped-button =
75
+ .title = Use Wrapped Scrolling
76
+ pdfjs-scroll-wrapped-button-label = Wrapped Scrolling
77
+ pdfjs-spread-none-button =
78
+ .title = Do not join page spreads
79
+ pdfjs-spread-none-button-label = No Spreads
80
+ pdfjs-spread-odd-button =
81
+ .title = Join page spreads starting with odd-numbered pages
82
+ pdfjs-spread-odd-button-label = Odd Spreads
83
+ pdfjs-spread-even-button =
84
+ .title = Join page spreads starting with even-numbered pages
85
+ pdfjs-spread-even-button-label = Even Spreads
86
+ pdfjs-document-properties-button =
87
+ .title = Document Properties…
88
+ pdfjs-document-properties-button-label = Document Properties…
89
+ pdfjs-document-properties-file-name = File name:
90
+ pdfjs-document-properties-file-size = File size:
91
+ pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)
92
+ pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)
93
+ pdfjs-document-properties-title = Title:
94
+ pdfjs-document-properties-author = Author:
95
+ pdfjs-document-properties-subject = Subject:
96
+ pdfjs-document-properties-keywords = Keywords:
97
+ pdfjs-document-properties-creation-date = Creation Date:
98
+ pdfjs-document-properties-modification-date = Modification Date:
99
+ pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
100
+ pdfjs-document-properties-creator = Creator:
101
+ pdfjs-document-properties-producer = PDF Producer:
102
+ pdfjs-document-properties-version = PDF Version:
103
+ pdfjs-document-properties-page-count = Page Count:
104
+ pdfjs-document-properties-page-size = Page Size:
105
+ pdfjs-document-properties-page-size-unit-inches = in
106
+ pdfjs-document-properties-page-size-unit-millimeters = mm
107
+ pdfjs-document-properties-page-size-orientation-portrait = portrait
108
+ pdfjs-document-properties-page-size-orientation-landscape = landscape
109
+ pdfjs-document-properties-page-size-name-a-three = A3
110
+ pdfjs-document-properties-page-size-name-a-four = A4
111
+ pdfjs-document-properties-page-size-name-letter = Letter
112
+ pdfjs-document-properties-page-size-name-legal = Legal
113
+ pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })
114
+ pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })
115
+ pdfjs-document-properties-linearized = Fast Web View:
116
+ pdfjs-document-properties-linearized-yes = Yes
117
+ pdfjs-document-properties-linearized-no = No
118
+ pdfjs-document-properties-close-button = Close
119
+ pdfjs-print-progress-message = Preparing document for printing…
120
+ pdfjs-print-progress-percent = { $progress }%
121
+ pdfjs-print-progress-close-button = Cancel
122
+ pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.
123
+ pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.
124
+ pdfjs-toggle-sidebar-button =
125
+ .title = Toggle Sidebar
126
+ pdfjs-toggle-sidebar-notification-button =
127
+ .title = Toggle Sidebar (document contains outline/attachments/layers)
128
+ pdfjs-toggle-sidebar-button-label = Toggle Sidebar
129
+ pdfjs-document-outline-button =
130
+ .title = Show Document Outline (double-click to expand/collapse all items)
131
+ pdfjs-document-outline-button-label = Document Outline
132
+ pdfjs-attachments-button =
133
+ .title = Show Attachments
134
+ pdfjs-attachments-button-label = Attachments
135
+ pdfjs-layers-button =
136
+ .title = Show Layers (double-click to reset all layers to the default state)
137
+ pdfjs-layers-button-label = Layers
138
+ pdfjs-thumbs-button =
139
+ .title = Show Thumbnails
140
+ pdfjs-thumbs-button-label = Thumbnails
141
+ pdfjs-current-outline-item-button =
142
+ .title = Find Current Outline Item
143
+ pdfjs-current-outline-item-button-label = Current Outline Item
144
+ pdfjs-findbar-button =
145
+ .title = Find in Document
146
+ pdfjs-findbar-button-label = Find
147
+ pdfjs-additional-layers = Additional Layers
148
+ pdfjs-thumb-page-title =
149
+ .title = Page { $page }
150
+ pdfjs-thumb-page-canvas =
151
+ .aria-label = Thumbnail of Page { $page }
152
+ pdfjs-find-input =
153
+ .title = Find
154
+ .placeholder = Find in document…
155
+ pdfjs-find-previous-button =
156
+ .title = Find the previous occurrence of the phrase
157
+ pdfjs-find-previous-button-label = Previous
158
+ pdfjs-find-next-button =
159
+ .title = Find the next occurrence of the phrase
160
+ pdfjs-find-next-button-label = Next
161
+ pdfjs-find-highlight-checkbox = Highlight All
162
+ pdfjs-find-match-case-checkbox-label = Match Case
163
+ pdfjs-find-match-diacritics-checkbox-label = Match Diacritics
164
+ pdfjs-find-entire-word-checkbox-label = Whole Words
165
+ pdfjs-find-reached-top = Reached top of document, continued from bottom
166
+ pdfjs-find-reached-bottom = Reached end of document, continued from top
167
+ pdfjs-find-match-count =
168
+ { $total ->
169
+ [one] { $current } of { $total } match
170
+ *[other] { $current } of { $total } matches
171
+ }
172
+ pdfjs-find-match-count-limit =
173
+ { $limit ->
174
+ [one] More than { $limit } match
175
+ *[other] More than { $limit } matches
176
+ }
177
+ pdfjs-find-not-found = Phrase not found
178
+ pdfjs-page-scale-width = Page Width
179
+ pdfjs-page-scale-fit = Page Fit
180
+ pdfjs-page-scale-auto = Automatic Zoom
181
+ pdfjs-page-scale-actual = Actual Size
182
+ pdfjs-page-scale-percent = { $scale }%
183
+ pdfjs-page-landmark =
184
+ .aria-label = Page { $page }
185
+ pdfjs-loading-error = An error occurred while loading the PDF.
186
+ pdfjs-invalid-file-error = Invalid or corrupted PDF file.
187
+ pdfjs-missing-file-error = Missing PDF file.
188
+ pdfjs-unexpected-response-error = Unexpected server response.
189
+ pdfjs-rendering-error = An error occurred while rendering the page.
190
+ pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
191
+ pdfjs-text-annotation-type =
192
+ .alt = [{ $type } Annotation]
193
+ pdfjs-password-label = Enter the password to open this PDF file.
194
+ pdfjs-password-invalid = Invalid password. Please try again.
195
+ pdfjs-password-ok-button = OK
196
+ pdfjs-password-cancel-button = Cancel
197
+ pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.
198
+ pdfjs-editor-free-text-button =
199
+ .title = Text
200
+ pdfjs-editor-free-text-button-label = Text
201
+ pdfjs-editor-ink-button =
202
+ .title = Draw
203
+ pdfjs-editor-ink-button-label = Draw
204
+ pdfjs-editor-stamp-button =
205
+ .title = Add or edit images
206
+ pdfjs-editor-stamp-button-label = Add or edit images
207
+ pdfjs-editor-highlight-button =
208
+ .title = Highlight
209
+ pdfjs-editor-highlight-button-label = Highlight
210
+ pdfjs-highlight-floating-button1 =
211
+ .title = Highlight
212
+ .aria-label = Highlight
213
+ pdfjs-highlight-floating-button-label = Highlight
214
+ pdfjs-editor-remove-ink-button =
215
+ .title = Remove drawing
216
+ pdfjs-editor-remove-freetext-button =
217
+ .title = Remove text
218
+ pdfjs-editor-remove-stamp-button =
219
+ .title = Remove image
220
+ pdfjs-editor-remove-highlight-button =
221
+ .title = Remove highlight
222
+ pdfjs-editor-free-text-color-input = Color
223
+ pdfjs-editor-free-text-size-input = Size
224
+ pdfjs-editor-ink-color-input = Color
225
+ pdfjs-editor-ink-thickness-input = Thickness
226
+ pdfjs-editor-ink-opacity-input = Opacity
227
+ pdfjs-editor-stamp-add-image-button =
228
+ .title = Add image
229
+ pdfjs-editor-stamp-add-image-button-label = Add image
230
+ pdfjs-editor-free-highlight-thickness-input = Thickness
231
+ pdfjs-editor-free-highlight-thickness-title =
232
+ .title = Change thickness when highlighting items other than text
233
+ pdfjs-free-text2 =
234
+ .aria-label = Text Editor
235
+ .default-content = Start typing…
236
+ pdfjs-ink =
237
+ .aria-label = Draw Editor
238
+ pdfjs-ink-canvas =
239
+ .aria-label = User-created image
240
+ pdfjs-editor-alt-text-button =
241
+ .aria-label = Alt text
242
+ pdfjs-editor-alt-text-button-label = Alt text
243
+ pdfjs-editor-alt-text-edit-button =
244
+ .aria-label = Edit alt text
245
+ pdfjs-editor-alt-text-dialog-label = Choose an option
246
+ pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load.
247
+ pdfjs-editor-alt-text-add-description-label = Add a description
248
+ pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.
249
+ pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative
250
+ pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.
251
+ pdfjs-editor-alt-text-cancel-button = Cancel
252
+ pdfjs-editor-alt-text-save-button = Save
253
+ pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative
254
+ pdfjs-editor-alt-text-textarea =
255
+ .placeholder = For example, “A young man sits down at a table to eat a meal”
256
+ pdfjs-editor-resizer-top-left =
257
+ .aria-label = Top left corner — resize
258
+ pdfjs-editor-resizer-top-middle =
259
+ .aria-label = Top middle — resize
260
+ pdfjs-editor-resizer-top-right =
261
+ .aria-label = Top right corner — resize
262
+ pdfjs-editor-resizer-middle-right =
263
+ .aria-label = Middle right — resize
264
+ pdfjs-editor-resizer-bottom-right =
265
+ .aria-label = Bottom right corner — resize
266
+ pdfjs-editor-resizer-bottom-middle =
267
+ .aria-label = Bottom middle — resize
268
+ pdfjs-editor-resizer-bottom-left =
269
+ .aria-label = Bottom left corner — resize
270
+ pdfjs-editor-resizer-middle-left =
271
+ .aria-label = Middle left — resize
272
+ pdfjs-editor-highlight-colorpicker-label = Highlight color
273
+ pdfjs-editor-colorpicker-button =
274
+ .title = Change color
275
+ pdfjs-editor-colorpicker-dropdown =
276
+ .aria-label = Color choices
277
+ pdfjs-editor-colorpicker-yellow =
278
+ .title = Yellow
279
+ pdfjs-editor-colorpicker-green =
280
+ .title = Green
281
+ pdfjs-editor-colorpicker-blue =
282
+ .title = Blue
283
+ pdfjs-editor-colorpicker-pink =
284
+ .title = Pink
285
+ pdfjs-editor-colorpicker-red =
286
+ .title = Red
287
+ pdfjs-editor-highlight-show-all-button-label = Show all
288
+ pdfjs-editor-highlight-show-all-button =
289
+ .title = Show all
290
+ pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)
291
+ pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)
292
+ pdfjs-editor-new-alt-text-textarea =
293
+ .placeholder = Write your description here…
294
+ pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load.
295
+ pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.
296
+ pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more
297
+ pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically
298
+ pdfjs-editor-new-alt-text-not-now-button = Not now
299
+ pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically
300
+ pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.
301
+ pdfjs-editor-new-alt-text-error-close-button = Close
302
+ pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
303
+ .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
304
+ pdfjs-editor-new-alt-text-added-button =
305
+ .aria-label = Alt text added
306
+ pdfjs-editor-new-alt-text-added-button-label = Alt text added
307
+ pdfjs-editor-new-alt-text-missing-button =
308
+ .aria-label = Missing alt text
309
+ pdfjs-editor-new-alt-text-missing-button-label = Missing alt text
310
+ pdfjs-editor-new-alt-text-to-review-button =
311
+ .aria-label = Review alt text
312
+ pdfjs-editor-new-alt-text-to-review-button-label = Review alt text
313
+ pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }
314
+ pdfjs-image-alt-text-settings-button =
315
+ .title = Image alt text settings
316
+ pdfjs-image-alt-text-settings-button-label = Image alt text settings
317
+ pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings
318
+ pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text
319
+ pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically
320
+ 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.
321
+ pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)
322
+ pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.
323
+ pdfjs-editor-alt-text-settings-delete-model-button = Delete
324
+ pdfjs-editor-alt-text-settings-download-model-button = Download
325
+ pdfjs-editor-alt-text-settings-downloading-model-button = Downloading…
326
+ pdfjs-editor-alt-text-settings-editor-title = Alt text editor
327
+ pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image
328
+ pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.
329
+ pdfjs-editor-alt-text-settings-close-button = Close
330
+ pdfjs-editor-undo-bar-message-highlight = Highlight removed
331
+ pdfjs-editor-undo-bar-message-freetext = Text removed
332
+ pdfjs-editor-undo-bar-message-ink = Drawing removed
333
+ pdfjs-editor-undo-bar-message-stamp = Image removed
334
+ pdfjs-editor-undo-bar-message-multiple =
335
+ { $count ->
336
+ [one] { $count } annotation removed
337
+ *[other] { $count } annotations removed
338
+ }
339
+ pdfjs-editor-undo-bar-undo-button =
340
+ .title = Undo
341
+ pdfjs-editor-undo-bar-undo-button-label = Undo
342
+ pdfjs-editor-undo-bar-close-button =
343
+ .title = Close
344
+ pdfjs-editor-undo-bar-close-button-label = Close`)},m(ze,ee);let Nt=ze;const ho=1e3,uo=50,co=1e3;function rn(){return document.location.hash}var Te,T,fe,Ni,Mi,jt,ki,_n,Gs,Ks,yn,Xs,Zs;class fo{constructor({linkService:e,eventBus:t}){m(this,T);m(this,Te,null);this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||typeof e!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const n=this._fingerprint!==""&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=i===!0,this._initialized=!0,u(this,T,Xs).call(this);const s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=rn(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!u(this,T,jt).call(this,s,!0)||t){const{hash:l,page:h,rotation:d}=u(this,T,_n).call(this,!0);if(!l||n||t){u(this,T,fe).call(this,null,!0);return}u(this,T,fe).call(this,{hash:l,page:h,rotation:d},!0);return}const a=s.destination;u(this,T,ki).call(this,a,s.uid,!0),a.rotation!==void 0&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(u(this,T,yn).call(this),this._initialized=!1,u(this,T,Zs).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&typeof e!="string"){console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);return}else if(Array.isArray(t)){if(!u(this,T,Mi).call(this,i)&&(i!==null||this._destination)){console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);return}const n=e||JSON.stringify(t);if(!n)return;let s=!1;if(this._destination&&(go(this._destination.hash,n)||po(this._destination.dest,t))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(u(this,T,fe).call(this,{dest:t,hash:n,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(e){var t;if(this._initialized){if(!u(this,T,Mi).call(this,e)){console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`);return}((t=this._destination)==null?void 0:t.page)!==e&&(this._popStateInProgress||(u(this,T,fe).call(this,{dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||u(this,T,Ni).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;u(this,T,jt).call(this,e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;u(this,T,jt).call(this,e)&&e.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}}Te=new WeakMap,T=new WeakSet,fe=function(e,t=!1){const i=t||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};u(this,T,ki).call(this,e,n.uid);let s;if(this._updateUrl&&(e!=null&&e.hash)){const a=document.location.href.split("#",1)[0];a.startsWith("file://")||(s=`${a}#${e.hash}`)}i?window.history.replaceState(n,"",s):window.history.pushState(n,"",s)},Ni=function(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination){u(this,T,fe).call(this,t);return}if(this._destination.temporary){u(this,T,fe).call(this,t,!0);return}if(this._destination.hash===t.hash||!this._destination.page&&this._numPositionUpdates<=uo)return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest!==void 0||!this._destination.first)return;i=!0}u(this,T,fe).call(this,t,i)},Mi=function(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount},jt=function(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint)if(t){if(typeof e.fingerprint!="string"||e.fingerprint.length!==this._fingerprint.length)return!1;const[i]=performance.getEntriesByType("navigation");if((i==null?void 0:i.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(e.uid)||e.uid<0||e.destination===null||typeof e.destination!="object")},ki=function(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&(e!=null&&e.temporary)&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0},_n=function(e=!1){const t=unescape(rn()).substring(1),i=Ki(t),n=i.get("nameddest")||"";let s=i.get("page")|0;return(!u(this,T,Mi).call(this,s)||e&&n.length>0)&&(s=null),{hash:t,page:s,rotation:this.linkService.rotation}},Gs=function({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||u(this,T,Ni).call(this,!0),this._updateViewareaTimeout=null},co))},Ks=function({state:e}){const t=rn(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:s,page:a,rotation:l}=u(this,T,_n).call(this);u(this,T,fe).call(this,{hash:s,page:a,rotation:l},!0);return}if(!u(this,T,jt).call(this,e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,ma({target:window,name:"hashchange",delay:ho}).then(()=>{this._blockHashChange--}));const n=e.destination;u(this,T,ki).call(this,n,e.uid,!0),As(n.rotation)&&(this.linkService.rotation=n.rotation),n.dest?this.linkService.goToDestination(n.dest):n.hash?this.linkService.setHash(n.hash):n.page&&(this.linkService.page=n.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})},yn=function(){(!this._destination||this._destination.temporary)&&u(this,T,Ni).call(this)},Xs=function(){if(o(this,Te))return;c(this,Te,new AbortController);const{signal:e}=o(this,Te);this.eventBus._on("updateviewarea",u(this,T,Gs).bind(this),{signal:e}),window.addEventListener("popstate",u(this,T,Ks).bind(this),{signal:e}),window.addEventListener("pagehide",u(this,T,yn).bind(this),{signal:e})},Zs=function(){var e;(e=o(this,Te))==null||e.abort(),c(this,Te,null)};function go(r,e){return typeof r!="string"||typeof e!="string"?!1:r===e||Ki(r).get("nameddest")===e}function po(r,e){function t(i,n){if(typeof i!=typeof n||Array.isArray(i)||Array.isArray(n))return!1;if(i!==null&&typeof i=="object"&&n!==null){if(Object.keys(i).length!==Object.keys(n).length)return!1;for(const s in i)if(!t(i[s],n[s]))return!1;return!0}return i===n||Number.isNaN(i)&&Number.isNaN(n)}if(!(Array.isArray(r)&&Array.isArray(e))||r.length!==e.length)return!1;for(let i=0,n=r.length;i<n;i++)if(!t(r[i],e[i]))return!1;return!0}var Jt,Yt,qt,ei,ti,bt;class mo{constructor(e){m(this,Jt,null);m(this,Yt,null);m(this,qt,null);m(this,ei,null);m(this,ti,null);m(this,bt);this.pdfPage=e.pdfPage,this.accessibilityManager=e.accessibilityManager,this.l10n=e.l10n,this.l10n||(this.l10n=new Nt),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,c(this,bt,e.uiManager),c(this,Jt,e.annotationLayer||null),c(this,ti,e.textLayer||null),c(this,Yt,e.drawLayer||null),c(this,qt,e.onAppend||null),c(this,ei,e.structTreeLayer||null)}async render(e,t="display"){var a;if(t!=="display"||this._cancelled)return;const i=e.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:i}),this.show();return}const n=this.div=document.createElement("div");n.className="annotationEditorLayer",n.hidden=!0,n.dir=o(this,bt).direction,(a=o(this,qt))==null||a.call(this,n),this.annotationEditorLayer=new sa({uiManager:o(this,bt),div:n,structTreeLayer:o(this,ei),accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:o(this,Jt),textLayer:o(this,ti),drawLayer:o(this,Yt)});const s={viewport:i,div:n,annotations:null,intent:t};this.annotationEditorLayer.render(s),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))}}Jt=new WeakMap,Yt=new WeakMap,qt=new WeakMap,ei=new WeakMap,ti=new WeakMap,bt=new WeakMap;{var vn=new Map;const r=navigator.userAgent||"",e=navigator.platform||"",t=navigator.maxTouchPoints||1,i=/Android/.test(r),n=/\b(iPad|iPhone|iPod)(?=;)/.test(r)||e==="MacIntel"&&t>1;(function(){(n||i)&&vn.set("maxCanvasPixels",5242880)})(),(function(){i&&vn.set("useSystemFonts",!1)})()}const p={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},Pn={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},ue={allowedGlobalEvents:{value:null,kind:p.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:p.BROWSER+p.API},isInAutomation:{value:!1,kind:p.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:p.BROWSER},nimbusDataStr:{value:"",kind:p.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:p.BROWSER},supportsDocumentFonts:{value:!0,kind:p.BROWSER},supportsIntegratedFind:{value:!1,kind:p.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:p.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:p.BROWSER},supportsPinchToZoom:{value:!0,kind:p.BROWSER},toolbarDensity:{value:0,kind:p.BROWSER+p.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:p.VIEWER+p.PREFERENCE},annotationEditorMode:{value:0,kind:p.VIEWER+p.PREFERENCE},annotationMode:{value:2,kind:p.VIEWER+p.PREFERENCE},cursorToolOnLoad:{value:0,kind:p.VIEWER+p.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:p.VIEWER},defaultZoomDelay:{value:400,kind:p.VIEWER+p.PREFERENCE},defaultZoomValue:{value:"",kind:p.VIEWER+p.PREFERENCE},disableHistory:{value:!1,kind:p.VIEWER},disablePageLabels:{value:!1,kind:p.VIEWER+p.PREFERENCE},enableAltText:{value:!1,kind:p.VIEWER+p.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:p.VIEWER+p.PREFERENCE+p.EVENT_DISPATCH},enableGuessAltText:{value:!0,kind:p.VIEWER+p.PREFERENCE+p.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:p.VIEWER+p.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:p.VIEWER+p.PREFERENCE},enablePermissions:{value:!1,kind:p.VIEWER+p.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:p.VIEWER+p.PREFERENCE},enableScripting:{value:!0,kind:p.VIEWER+p.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:p.VIEWER+p.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:p.VIEWER},externalLinkTarget:{value:0,kind:p.VIEWER+p.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:p.VIEWER+p.PREFERENCE},historyUpdateUrl:{value:!1,kind:p.VIEWER+p.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:p.VIEWER+p.PREFERENCE},imageResourcesPath:{value:"./images/",kind:p.VIEWER},maxCanvasPixels:{value:2**25,kind:p.VIEWER},forcePageColors:{value:!1,kind:p.VIEWER+p.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:p.VIEWER+p.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:p.VIEWER+p.PREFERENCE},pdfBugEnabled:{value:!1,kind:p.VIEWER+p.PREFERENCE},printResolution:{value:150,kind:p.VIEWER},sidebarViewOnLoad:{value:-1,kind:p.VIEWER+p.PREFERENCE},scrollModeOnLoad:{value:-1,kind:p.VIEWER+p.PREFERENCE},spreadModeOnLoad:{value:-1,kind:p.VIEWER+p.PREFERENCE},textLayerMode:{value:1,kind:p.VIEWER+p.PREFERENCE},viewOnLoad:{value:0,kind:p.VIEWER+p.PREFERENCE},cMapPacked:{value:!0,kind:p.API},cMapUrl:{value:"../web/cmaps/",kind:p.API},disableAutoFetch:{value:!1,kind:p.API+p.PREFERENCE},disableFontFace:{value:!1,kind:p.API+p.PREFERENCE},disableRange:{value:!1,kind:p.API+p.PREFERENCE},disableStream:{value:!1,kind:p.API+p.PREFERENCE},docBaseUrl:{value:"",kind:p.API},enableHWA:{value:!0,kind:p.API+p.VIEWER+p.PREFERENCE},enableXfa:{value:!0,kind:p.API+p.PREFERENCE},fontExtraProperties:{value:!1,kind:p.API},isEvalSupported:{value:!0,kind:p.API},isOffscreenCanvasSupported:{value:!0,kind:p.API},maxImageSize:{value:-1,kind:p.API},pdfBug:{value:!1,kind:p.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:p.API},useSystemFonts:{value:void 0,kind:p.API,type:Pn.BOOLEAN+Pn.UNDEFINED},verbosity:{value:1,kind:p.API},workerPort:{value:null,kind:p.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:p.WORKER}};ue.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:p.VIEWER},ue.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:p.VIEWER},ue.viewerCssTheme={value:0,kind:p.VIEWER+p.PREFERENCE},ue.enableFakeMLManager={value:!0,kind:p.VIEWER};ue.disablePreferences={value:!1,kind:p.VIEWER};var Re;const re=class re{static get(e){return o(this,Re).get(e)}static getAll(e=null,t=!1){const i=Object.create(null);for(const n in ue){const s=ue[n];e&&!(e&s.kind)||(i[n]=t?s.value:o(this,Re).get(n))}return i}static set(e,t){this.setAll({[e]:t})}static setAll(e,t=!1){this._hasInvokedSet||(this._hasInvokedSet=!0);let i;for(const n in e){const s=ue[n],a=e[n];if(!s||!(typeof a==typeof s.value||Pn[(typeof a).toUpperCase()]&s.type))continue;const{kind:l}=s;t&&!(l&p.BROWSER||l&p.PREFERENCE)||(this.eventBus&&l&p.EVENT_DISPATCH&&(i||(i=new Map)).set(n,a),o(this,Re).set(n,a))}if(i)for(const[n,s]of i)this.eventBus.dispatch(n.toLowerCase(),{source:this,value:s})}};Re=new WeakMap,Zi(re,"eventBus"),m(re,Re,new Map),(()=>{for(const e in ue)o(re,Re).set(e,ue[e].value);for(const[e,t]of vn)o(re,Re).set(e,t);re._hasInvokedSet=!1,re._checkDisablePreferences=()=>re.get("disablePreferences")?!0:(re._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)})();let xn=re;var ae;class bo{constructor(e){m(this,ae,null);this.pageIndex=e.pageIndex}async render(e="display"){e!=="display"||o(this,ae)||this._cancelled||c(this,ae,new la({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,o(this,ae)&&(o(this,ae).destroy(),c(this,ae,null))}setParent(e){var t;(t=o(this,ae))==null||t.setParent(e)}getDrawLayer(){return o(this,ae)}}ae=new WeakMap;const ys={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Eo=/^H(\d+)$/;var Et,se,wt,_t,yt,Ce,ce,Sn,Js,An;class Qs{constructor(e,t){m(this,ce);m(this,Et);m(this,se,null);m(this,wt);m(this,_t,new Map);m(this,yt);m(this,Ce,null);c(this,Et,e.getStructTree()),c(this,yt,t)}async render(){var n;if(o(this,wt))return o(this,wt);const{promise:e,resolve:t,reject:i}=Promise.withResolvers();c(this,wt,e);try{c(this,se,u(this,ce,An).call(this,await o(this,Et)))}catch(s){i(s)}return c(this,Et,null),(n=o(this,se))==null||n.classList.add("structTree"),t(o(this,se)),e}async getAriaAttributes(e){try{return await this.render(),o(this,_t).get(e)}catch{}return null}hide(){o(this,se)&&!o(this,se).hidden&&(o(this,se).hidden=!0)}show(){var e;(e=o(this,se))!=null&&e.hidden&&(o(this,se).hidden=!1)}addElementsToTextLayer(){var e;if(o(this,Ce)){for(const[t,i]of o(this,Ce))(e=document.getElementById(t))==null||e.append(i);o(this,Ce).clear(),c(this,Ce,null)}}}Et=new WeakMap,se=new WeakMap,wt=new WeakMap,_t=new WeakMap,yt=new WeakMap,Ce=new WeakMap,ce=new WeakSet,Sn=function(e,t){const{alt:i,id:n,lang:s}=e;if(i!==void 0){let a=!1;const l=$t(i);for(const h of e.children)if(h.type==="annotation"){let d=o(this,_t).get(h.id);d||(d=new Map,o(this,_t).set(h.id,d)),d.set("aria-label",l),a=!0}a||t.setAttribute("aria-label",l)}n!==void 0&&t.setAttribute("aria-owns",n),s!==void 0&&t.setAttribute("lang",$t(s,!0))},Js=function(e,t){const{alt:i,bbox:n,children:s}=e,a=s==null?void 0:s[0];if(!o(this,yt)||!i||!n||(a==null?void 0:a.type)!=="content")return!1;const{id:l}=a;if(!l)return!1;t.setAttribute("aria-owns",l);const h=document.createElement("span");(o(this,Ce)||c(this,Ce,new Map)).set(l,h),h.setAttribute("role","img"),h.setAttribute("aria-label",$t(i));const{pageHeight:d,pageX:f,pageY:b}=o(this,yt),E="calc(var(--scale-factor)*",{style:I}=h;return I.width=`${E}${n[2]-n[0]}px)`,I.height=`${E}${n[3]-n[1]}px)`,I.left=`${E}${n[0]-f}px)`,I.top=`${E}${d-n[3]+b}px)`,!0},An=function(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,n=i.match(Eo);if(n?(t.setAttribute("role","heading"),t.setAttribute("aria-level",n[1])):ys[i]&&t.setAttribute("role",ys[i]),i==="Figure"&&u(this,ce,Js).call(this,e,t))return t}if(u(this,ce,Sn).call(this,e,t),e.children)if(e.children.length===1&&"id"in e.children[0])u(this,ce,Sn).call(this,e.children[0],t);else for(const i of e.children)t.append(u(this,ce,An).call(this,i));return t};var pe,te,me,Ne,vt,Di,ii,Ln;const ut=class ut{constructor(){m(this,ii);m(this,pe,!1);m(this,te,null);m(this,me,new Map);m(this,Ne,new Map)}setTextMapping(e){c(this,te,e)}enable(){if(o(this,pe))throw new Error("TextAccessibilityManager is already enabled.");if(!o(this,te))throw new Error("Text divs and strings have not been set.");if(c(this,pe,!0),c(this,te,o(this,te).slice()),o(this,te).sort(u(ut,vt,Di)),o(this,me).size>0){const e=o(this,te);for(const[t,i]of o(this,me)){if(!document.getElementById(t)){o(this,me).delete(t);continue}u(this,ii,Ln).call(this,t,e[i])}}for(const[e,t]of o(this,Ne))this.addPointerInTextLayer(e,t);o(this,Ne).clear()}disable(){o(this,pe)&&(o(this,Ne).clear(),c(this,te,null),c(this,pe,!1))}removePointerInTextLayer(e){if(!o(this,pe)){o(this,Ne).delete(e);return}const t=o(this,te);if(!t||t.length===0)return;const{id:i}=e,n=o(this,me).get(i);if(n===void 0)return;const s=t[n];o(this,me).delete(i);let a=s.getAttribute("aria-owns");a!=null&&a.includes(i)&&(a=a.split(" ").filter(l=>l!==i).join(" "),a?s.setAttribute("aria-owns",a):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}addPointerInTextLayer(e,t){const{id:i}=e;if(!i)return null;if(!o(this,pe))return o(this,Ne).set(e,t),null;t&&this.removePointerInTextLayer(e);const n=o(this,te);if(!n||n.length===0)return null;const s=Gt(n,d=>{var f;return u(f=ut,vt,Di).call(f,e,d)<0}),a=Math.max(0,s-1),l=n[a];u(this,ii,Ln).call(this,i,l),o(this,me).set(i,a);const h=l.parentNode;return h!=null&&h.classList.contains("markedContent")?h.id:null}moveElementInDOM(e,t,i,n){const s=this.addPointerInTextLayer(i,n);if(!e.hasChildNodes())return e.append(t),s;const a=Array.from(e.childNodes).filter(d=>d!==t);if(a.length===0)return s;const l=i||t,h=Gt(a,d=>{var f;return u(f=ut,vt,Di).call(f,l,d)<0});return h===0?a[0].before(t):a[h-1].after(t),s}};pe=new WeakMap,te=new WeakMap,me=new WeakMap,Ne=new WeakMap,vt=new WeakSet,Di=function(e,t){const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(i.width===0&&i.height===0)return 1;if(n.width===0&&n.height===0)return-1;const s=i.y,a=i.y+i.height,l=i.y+i.height/2,h=n.y,d=n.y+n.height,f=n.y+n.height/2;if(l<=h&&f>=a)return-1;if(f<=s&&l>=d)return 1;const b=i.x+i.width/2,E=n.x+n.width/2;return b-E},ii=new WeakSet,Ln=function(e,t){const i=t.getAttribute("aria-owns");i!=null&&i.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e),t.removeAttribute("role")},m(ut,vt);let In=ut;var Me;class wo{constructor({findController:e,eventBus:t,pageIndex:i}){m(this,Me,null);this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,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,o(this,Me)||(c(this,Me,new AbortController),this.eventBus._on("updatetextlayermatches",e=>{(e.pageIndex===this.pageIdx||e.pageIndex===-1)&&this._updateMatches()},{signal:o(this,Me).signal})),this._updateMatches()}disable(){var e;this.enabled&&(this.enabled=!1,(e=o(this,Me))==null||e.abort(),c(this,Me,null),this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:i}=this;let n=0,s=0;const a=i.length-1,l=[];for(let h=0,d=e.length;h<d;h++){let f=e[h];for(;n!==a&&f>=s+i[n].length;)s+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const b={begin:{divIdx:n,offset:f-s}};for(f+=t[h];n!==a&&f>s+i[n].length;)s+=i[n].length,n++;b.end={divIdx:n,offset:f-s},l.push(b)}return l}_renderMatches(e){if(e.length===0)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:s}=this,a=i===t.selected.pageIdx,l=t.selected.matchIdx,h=t.state.highlightAll;let d=null;const f={offset:void 0};function b(L,N){const y=L.divIdx;return s[y].textContent="",E(y,0,L.offset,N)}function E(L,N,y,C){let O=s[L];if(O.nodeType===Node.TEXT_NODE){const j=document.createElement("span");O.before(j),j.append(O),s[L]=j,O=j}const V=n[L].substring(N,y),U=document.createTextNode(V);if(C){const j=document.createElement("span");if(j.className=`${C} appended`,j.append(U),O.append(j),C.includes("selected")){const{left:g}=j.getClientRects()[0],w=O.getBoundingClientRect().left;return g-w}return 0}return O.append(U),0}let I=l,A=I+1;if(h)I=0,A=e.length;else if(!a)return;let v=-1,x=-1;for(let L=I;L<A;L++){const N=e[L],y=N.begin;if(y.divIdx===v&&y.offset===x)continue;v=y.divIdx,x=y.offset;const C=N.end,O=a&&L===l,V=O?" selected":"";let U=0;if(!d||y.divIdx!==d.divIdx?(d!==null&&E(d.divIdx,d.offset,f.offset),b(y)):E(d.divIdx,d.offset,y.offset),y.divIdx===C.divIdx)U=E(y.divIdx,y.offset,C.offset,"highlight"+V);else{U=E(y.divIdx,y.offset,f.offset,"highlight begin"+V);for(let j=y.divIdx+1,g=C.divIdx;j<g;j++)s[j].className="highlight middle"+V;b(C,"highlight end"+V)}d=C,O&&t.scrollMatchIntoView({element:s[y.divIdx],selectedLeft:U,pageIndex:i,matchIndex:l})}d&&E(d.divIdx,d.offset,f.offset)}_updateMatches(e=!1){if(!this.enabled&&!e)return;const{findController:t,matches:i,pageIdx:n}=this,{textContentItemsStr:s,textDivs:a}=this;let l=-1;for(const f of i){const b=Math.max(l,f.begin.divIdx);for(let E=b,I=f.end.divIdx;E<=I;E++){const A=a[E];A.textContent=s[E],A.className=""}l=f.end.divIdx+1}if(!(t!=null&&t.highlightMatches)||e)return;const h=t.pageMatches[n]||null,d=t.pageMatchesLength[n]||null;this.matches=this._convertMatches(h,d),this._renderMatches(this.matches)}}Me=new WeakMap;var ni,si,Ze,oe,J,ke,Gi,Ys,kt,qs,er;const xe=class xe{constructor({pdfPage:e,highlighter:t=null,accessibilityManager:i=null,enablePermissions:n=!1,onAppend:s=null}){m(this,Gi);m(this,ni,!1);m(this,si,null);m(this,Ze,!1);m(this,oe,null);this.pdfPage=e,this.highlighter=t,this.accessibilityManager=i,c(this,ni,n===!0),c(this,si,s),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render(e,t=null){var a,l,h,d,f;if(o(this,Ze)&&o(this,oe)){o(this,oe).update({viewport:e,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),c(this,oe,new ga({textContentSource:this.pdfPage.streamTextContent(t||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:e}));const{textDivs:i,textContentItemsStr:n}=o(this,oe);(a=this.highlighter)==null||a.setTextMapping(i,n),(l=this.accessibilityManager)==null||l.setTextMapping(i),await o(this,oe).render(),c(this,Ze,!0);const s=document.createElement("div");s.className="endOfContent",this.div.append(s),u(this,Gi,Ys).call(this,s),(h=o(this,si))==null||h.call(this,this.div),(d=this.highlighter)==null||d.enable(),(f=this.accessibilityManager)==null||f.enable()}hide(){var e;!this.div.hidden&&o(this,Ze)&&((e=this.highlighter)==null||e.disable(),this.div.hidden=!0)}show(){var e;this.div.hidden&&o(this,Ze)&&(this.div.hidden=!1,(e=this.highlighter)==null||e.enable())}cancel(){var e,t,i,n;(e=o(this,oe))==null||e.cancel(),c(this,oe,null),(t=this.highlighter)==null||t.disable(),(i=this.accessibilityManager)==null||i.disable(),u(n=xe,kt,qs).call(n,this.div)}};ni=new WeakMap,si=new WeakMap,Ze=new WeakMap,oe=new WeakMap,J=new WeakMap,ke=new WeakMap,Gi=new WeakSet,Ys=function(e){var i;const{div:t}=this;t.addEventListener("mousedown",()=>{t.classList.add("selecting")}),t.addEventListener("copy",n=>{if(!o(this,ni)){const s=document.getSelection();n.clipboardData.setData("text/plain",$t(ua(s.toString())))}gn(n)}),o(xe,J).set(t,e),u(i=xe,kt,er).call(i)},kt=new WeakSet,qs=function(e){var t;o(this,J).delete(e),o(this,J).size===0&&((t=o(this,ke))==null||t.abort(),c(this,ke,null))},er=function(){if(o(this,ke))return;c(this,ke,new AbortController);const{signal:e}=o(this,ke),t=(a,l)=>{l.append(a),a.style.width="",a.style.height="",l.classList.remove("selecting")};let i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:e}),document.addEventListener("pointerup",()=>{i=!1,o(this,J).forEach(t)},{signal:e}),window.addEventListener("blur",()=>{i=!1,o(this,J).forEach(t)},{signal:e}),document.addEventListener("keyup",()=>{i||o(this,J).forEach(t)},{signal:e});var n,s;document.addEventListener("selectionchange",()=>{var I;const a=document.getSelection();if(a.rangeCount===0){o(this,J).forEach(t);return}const l=new Set;for(let A=0;A<a.rangeCount;A++){const v=a.getRangeAt(A);for(const x of o(this,J).keys())!l.has(x)&&v.intersectsNode(x)&&l.add(x)}for(const[A,v]of o(this,J))l.has(A)?A.classList.add("selecting"):t(v,A);if(n??(n=getComputedStyle(o(this,J).values().next().value).getPropertyValue("-moz-user-select")==="none"),n)return;const h=a.getRangeAt(0),d=s&&(h.compareBoundaryPoints(Range.END_TO_END,s)===0||h.compareBoundaryPoints(Range.START_TO_END,s)===0);let f=d?h.startContainer:h.endContainer;f.nodeType===Node.TEXT_NODE&&(f=f.parentNode);const b=(I=f.parentElement)==null?void 0:I.closest(".textLayer"),E=o(this,J).get(b);E&&(E.style.width=b.style.width,E.style.height=b.style.height,f.parentElement.insertBefore(E,d?f:f.nextSibling)),s=h.cloneRange()},{signal:e})},m(xe,kt),m(xe,J,new Map),m(xe,ke,null);let $i=xe;class tr{constructor({pdfPage:e,annotationStorage:t=null,linkService:i,xfaHtml:n=null}){this.pdfPage=e,this.annotationStorage=t,this.linkService=i,this.xfaHtml=n,this.div=null,this._cancelled=!1}async render(e,t="display"){if(t==="print"){const s={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return this.div=document.createElement("div"),s.div=this.div,tn.render(s)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const n={viewport:e.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return this.div?tn.update(n):(this.div=document.createElement("div"),n.div=this.div,tn.render(n))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const _o={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new Un}},yo=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);var Qe,De,ri,Je,ai,Fe,Oe,Pt,oi,li,hi,Ye,xt,St,be,je,R,dt,Fi,Vt,Tn,Rn,Cn,Nn,Mn,nr,sr,kn,Dn;class ir{constructor(e){m(this,R);m(this,Qe,_e.ENABLE_FORMS);m(this,De,null);m(this,ri,!1);m(this,Je,!1);m(this,ai,!1);m(this,Fe,null);m(this,Oe,null);m(this,Pt,null);m(this,oi,null);m(this,li,1);m(this,hi,1);m(this,Ye,null);m(this,xt,H.INITIAL);m(this,St,de.ENABLE);m(this,be,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0});m(this,je,[null,null,null,null]);var s,a;const t=e.container,i=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,c(this,Fe,e.layerProperties||_o),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||xs,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,c(this,St,e.textLayerMode??de.ENABLE),c(this,Qe,e.annotationMode??_e.ENABLE_FORMS),this.imageResourcesPath=e.imageResourcesPath||"",this.maxCanvasPixels=e.maxCanvasPixels??xn.get("maxCanvasPixels"),this.pageColors=e.pageColors||null,c(this,ri,e.enableHWA||!1),this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.l10n=e.l10n,this.l10n||(this.l10n=new Nt),this.renderTask=null,this.resume=null,this._isStandalone=!((s=this.renderingQueue)!=null&&s.hasViewer()),this._container=t,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null;const n=document.createElement("div");if(n.className="page",n.setAttribute("data-page-number",this.id),n.setAttribute("role","region"),n.setAttribute("data-l10n-id","pdfjs-page-landmark"),n.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=n,u(this,R,Fi).call(this),t==null||t.append(n),this._isStandalone){t==null||t.style.setProperty("--scale-factor",this.scale*ge.PDF_TO_CSS_UNITS),(a=this.pageColors)!=null&&a.background&&(t==null||t.style.setProperty("--page-bg-color",this.pageColors.background));const{optionalContentConfigPromise:l}=e;l&&l.then(h=>{l===this._optionalContentConfigPromise&&(o(this,be).initialOptionalContent=h.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}get renderingState(){return o(this,xt)}set renderingState(e){if(e!==o(this,xt))switch(c(this,xt,e),o(this,Oe)&&(clearTimeout(o(this,Oe)),c(this,Oe,null)),e){case H.PAUSED:this.div.classList.remove("loading");break;case H.RUNNING:this.div.classList.add("loadingIcon"),c(this,Oe,setTimeout(()=>{this.div.classList.add("loading"),c(this,Oe,null)},0));break;case H.INITIAL:case H.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(e){var i,n,s,a;this._isStandalone&&(((i=this.pageColors)==null?void 0:i.foreground)==="CanvasText"||((n=this.pageColors)==null?void 0:n.background)==="Canvas")&&((s=this._container)==null||s.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),(a=this._container)==null||a.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*ge.PDF_TO_CSS_UNITS,rotation:t}),u(this,R,Fi).call(this),this.reset()}destroy(){var e;this.reset(),(e=this.pdfPage)==null||e.cleanup()}hasEditableAnnotations(){var e;return!!((e=this.annotationLayer)!=null&&e.hasEditableAnnotations())}get _textHighlighter(){return Hi(this,"_textHighlighter",new wo({pageIndex:this.id-1,eventBus:this.eventBus,findController:o(this,Fe).findController}))}reset({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,keepCanvasWrapper:s=!1}={}){var I,A,v,x,L;this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:t,keepXfaLayer:i,keepTextLayer:n}),this.renderingState=H.INITIAL;const a=this.div,l=a.childNodes,h=e&&((I=this.annotationLayer)==null?void 0:I.div)||null,d=t&&((A=this.annotationEditorLayer)==null?void 0:A.div)||null,f=i&&((v=this.xfaLayer)==null?void 0:v.div)||null,b=n&&((x=this.textLayer)==null?void 0:x.div)||null,E=s&&o(this,De)||null;for(let N=l.length-1;N>=0;N--){const y=l[N];switch(y){case h:case d:case f:case b:case E:continue}y.remove();const C=o(this,je).indexOf(y);C>=0&&(o(this,je)[C]=null)}a.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),d&&this.annotationEditorLayer.hide(),f&&this.xfaLayer.hide(),b&&this.textLayer.hide(),(L=this.structTreeLayer)==null||L.hide(),!s&&o(this,De)&&(c(this,De,null),u(this,R,kn).call(this))}toggleEditingMode(e){this.hasEditableAnnotations()&&(c(this,ai,e),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0}))}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:i=null,drawingDelay:n=-1}){var a;this.scale=e||this.scale,typeof t=="number"&&(this.rotation=t),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(l=>{i===this._optionalContentConfigPromise&&(o(this,be).initialOptionalContent=l.hasInitialVisibility)})),o(this,be).directDrawing=!0;const s=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*ge.PDF_TO_CSS_UNITS,rotation:s}),u(this,R,Fi).call(this),this._isStandalone&&((a=this._container)==null||a.style.setProperty("--scale-factor",this.viewport.scale)),this.canvas){let l=!1;if(o(this,Je)){if(this.maxCanvasPixels===0)l=!0;else if(this.maxCanvasPixels>0){const{width:d,height:f}=this.viewport,{sx:b,sy:E}=this.outputScale;l=(Math.floor(d)*b|0)*(Math.floor(f)*E|0)>this.maxCanvasPixels}}const h=n>=0&&n<1e3;if(h||l){if(h&&!l&&this.renderingState!==H.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=H.FINISHED,o(this,be).directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!h,hideTextLayer:h}),h)return;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:o(this,Ye)});return}}this.cssTransform({}),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:s=0}={}){var a;this.renderTask&&(this.renderTask.cancel(s),this.renderTask=null),this.resume=null,this.textLayer&&(!n||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!e||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!t||!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,(a=this._textHighlighter)==null||a.disable())}cssTransform({redrawAnnotationLayer:e=!1,redrawAnnotationEditorLayer:t=!1,redrawXfaLayer:i=!1,redrawTextLayer:n=!1,hideTextLayer:s=!1}){var h;const{canvas:a}=this;if(!a)return;const l=o(this,Pt);if(this.viewport!==l){const d=(360+this.viewport.rotation-l.rotation)%360;if(d===90||d===270){const{width:f,height:b}=this.viewport,E=b/f,I=f/b;a.style.transform=`rotate(${d}deg) scale(${E},${I})`}else a.style.transform=d===0?"":`rotate(${d}deg)`}e&&this.annotationLayer&&u(this,R,Tn).call(this),t&&this.annotationEditorLayer&&(this.drawLayer&&u(this,R,Cn).call(this),u(this,R,Rn).call(this)),i&&this.xfaLayer&&u(this,R,Nn).call(this),this.textLayer&&(s?(this.textLayer.hide(),(h=this.structTreeLayer)==null||h.hide()):n&&u(this,R,Mn).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}async draw(){this.renderingState!==H.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:t,pageColors:i,pdfPage:n,viewport:s}=this;if(!n)throw this.renderingState=H.FINISHED,new Error("pdfPage is not loaded");this.renderingState=H.RUNNING;let a=o(this,De);if(a||(a=c(this,De,document.createElement("div")),a.classList.add("canvasWrapper"),u(this,R,dt).call(this,a,"canvasWrapper")),!this.textLayer&&o(this,St)!==de.DISABLE&&!n.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new In),this.textLayer=new $i({pdfPage:n,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:o(this,St)===de.ENABLE_PERMISSIONS,onAppend:P=>{this.l10n.pause(),u(this,R,dt).call(this,P,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&o(this,Qe)!==_e.DISABLE){const{annotationStorage:P,annotationEditorUIManager:F,downloadManager:D,enableScripting:M,fieldObjectsPromise:$,hasJSActionsPromise:lt,linkService:br}=o(this,Fe);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new Ds({pdfPage:n,annotationStorage:P,imageResourcesPath:this.imageResourcesPath,renderForms:o(this,Qe)===_e.ENABLE_FORMS,linkService:br,downloadManager:D,enableScripting:M,hasJSActionsPromise:lt,fieldObjectsPromise:$,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:F,onAppend:Er=>{u(this,R,dt).call(this,Er,"annotationLayer")}})}const l=P=>{if(A==null||A(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=H.PAUSED,this.resume=()=>{this.renderingState=H.RUNNING,P()};return}P()},{width:h,height:d}=s,f=document.createElement("canvas");f.setAttribute("role","presentation");const b=!!(i!=null&&i.background&&(i!=null&&i.foreground)),E=this.canvas,I=!E&&!b;this.canvas=f,c(this,Pt,s);let A=P=>{if(I){a.prepend(f),A=null;return}P&&(E?(E.replaceWith(f),E.width=E.height=0):a.prepend(f),A=null)};const v=f.getContext("2d",{alpha:!1,willReadFrequently:!o(this,ri)}),x=this.outputScale=new ca;if(this.maxCanvasPixels===0){const P=1/this.scale;x.sx*=P,x.sy*=P,c(this,Je,!0)}else if(this.maxCanvasPixels>0){const P=h*d,F=Math.sqrt(this.maxCanvasPixels/P);x.sx>F||x.sy>F?(x.sx=F,x.sy=F,c(this,Je,!0)):c(this,Je,!1)}const L=Zn(x.sx),N=Zn(x.sy),y=f.width=xi(Si(h*x.sx),L[0]),C=f.height=xi(Si(d*x.sy),N[0]),O=xi(Si(h),L[1]),V=xi(Si(d),N[1]);x.sx=y/O,x.sy=C/V,o(this,li)!==L[1]&&(e.style.setProperty("--scale-round-x",`${L[1]}px`),c(this,li,L[1])),o(this,hi)!==N[1]&&(e.style.setProperty("--scale-round-y",`${N[1]}px`),c(this,hi,N[1]));const U=x.scaled?[x.sx,0,0,x.sy,0,0]:null,j={canvasContext:v,transform:U,viewport:s,annotationMode:o(this,Qe),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:i,isEditing:o(this,ai)},g=this.renderTask=n.render(j);g.onContinue=l;const w=g.promise.then(async()=>{var F;A==null||A(!0),await u(this,R,Dn).call(this,g),this.structTreeLayer||(this.structTreeLayer=new Qs(n,s.rawDims)),u(this,R,Mn).call(this),this.annotationLayer&&await u(this,R,Tn).call(this);const{annotationEditorUIManager:P}=o(this,Fe);P&&(this.drawLayer||(this.drawLayer=new bo({pageIndex:this.id})),await u(this,R,Cn).call(this),this.drawLayer.setParent(a),this.annotationEditorLayer||(this.annotationEditorLayer=new mo({uiManager:P,pdfPage:n,l10n:t,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:(F=this.annotationLayer)==null?void 0:F.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:D=>{u(this,R,dt).call(this,D,"annotationEditorLayer")}})),u(this,R,Rn).call(this))},P=>(P instanceof fn?(E==null||E.remove(),u(this,R,kn).call(this)):A==null||A(!0),u(this,R,Dn).call(this,g,P)));if(n.isPureXfa){if(!this.xfaLayer){const{annotationStorage:P,linkService:F}=o(this,Fe);this.xfaLayer=new tr({pdfPage:n,annotationStorage:P,linkService:F})}u(this,R,Nn).call(this)}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),w}setPageLabel(e){this.pageLabel=typeof e=="string"?e: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:e,initialOptionalContent:t,regularAnnotations:i}=o(this,be);return e&&t&&i?this.canvas:null}}Qe=new WeakMap,De=new WeakMap,ri=new WeakMap,Je=new WeakMap,ai=new WeakMap,Fe=new WeakMap,Oe=new WeakMap,Pt=new WeakMap,oi=new WeakMap,li=new WeakMap,hi=new WeakMap,Ye=new WeakMap,xt=new WeakMap,St=new WeakMap,be=new WeakMap,je=new WeakMap,R=new WeakSet,dt=function(e,t){const i=yo.get(t),n=o(this,je)[i];if(o(this,je)[i]=e,n){n.replaceWith(e);return}for(let s=i-1;s>=0;s--){const a=o(this,je)[s];if(a){a.after(e);return}}this.div.prepend(e)},Fi=function(){const{viewport:e}=this;if(this.pdfPage){if(o(this,oi)===e.rotation)return;c(this,oi,e.rotation)}fa(this.div,e,!0,!1)},Vt=function(e,t){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:t})},Tn=async function(){let e=null;try{await this.annotationLayer.render(this.viewport,{structTreeLayer:this.structTreeLayer},"display")}catch(t){console.error("#renderAnnotationLayer:",t),e=t}finally{u(this,R,Vt).call(this,"annotationlayerrendered",e)}},Rn=async function(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error("#renderAnnotationEditorLayer:",t),e=t}finally{u(this,R,Vt).call(this,"annotationeditorlayerrendered",e)}},Cn=async function(){try{await this.drawLayer.render("display")}catch(e){console.error("#renderDrawLayer:",e)}},Nn=async function(){var t;let e=null;try{const i=await this.xfaLayer.render(this.viewport,"display");i!=null&&i.textDivs&&this._textHighlighter&&u(this,R,sr).call(this,i.textDivs)}catch(i){console.error("#renderXfaLayer:",i),e=i}finally{(t=this.xfaLayer)!=null&&t.div&&(this.l10n.pause(),u(this,R,dt).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),u(this,R,Vt).call(this,"xfalayerrendered",e)}},Mn=async function(){if(!this.textLayer)return;let e=null;try{await this.textLayer.render(this.viewport)}catch(t){if(t instanceof na)return;console.error("#renderTextLayer:",t),e=t}u(this,R,Vt).call(this,"textlayerrendered",e),u(this,R,nr).call(this)},nr=async function(){var t,i,n;if(!this.textLayer)return;const e=await((t=this.structTreeLayer)==null?void 0:t.render());e&&(this.l10n.pause(),(i=this.structTreeLayer)==null||i.addElementsToTextLayer(),this.canvas&&e.parentNode!==this.canvas&&this.canvas.append(e),this.l10n.resume()),(n=this.structTreeLayer)==null||n.show()},sr=async function(e){const t=await this.pdfPage.getTextContent(),i=[];for(const n of t.items)i.push(n.str);this._textHighlighter.setTextMapping(e,i),this._textHighlighter.enable()},kn=function(){const{canvas:e}=this;e&&(e.remove(),e.width=e.height=0,this.canvas=null,c(this,Pt,null))},Dn=async function(e,t=null){if(e===this.renderTask&&(this.renderTask=null),t instanceof fn){c(this,Ye,null);return}if(c(this,Ye,t),this.renderingState=H.FINISHED,o(this,be).regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:o(this,Ye)}),t)throw t};async function vo(r){const t="".split("#",1)[0];let{info:i,metadata:n,contentDispositionFilename:s,contentLength:a}=await r.getMetadata();if(!a){const{length:l}=await r.getDownloadInfo();a=l}return{...i,baseURL:t,filesize:a,filename:s||ha(""),metadata:n==null?void 0:n.getRaw(),authors:n==null?void 0:n.get("dc:creator"),numPages:r.numPages,URL:""}}class Po{constructor(e){this._ready=new Promise((t,i)=>{import(e).then(s=>{t(s.QuickJSSandbox())}).catch(i)})}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){const t=await this._ready;setTimeout(()=>t.dispatchEvent(e),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}var le,qe,di,et,tt,ui,Z,Ee,At,z,ie,K,rr,Oi,Fn,ar,Bt;class xo{constructor({eventBus:e,externalServices:t=null,docProperties:i=null}){m(this,K);m(this,le,null);m(this,qe,null);m(this,di,null);m(this,et,null);m(this,tt,null);m(this,ui,null);m(this,Z,null);m(this,Ee,null);m(this,At,!1);m(this,z,null);m(this,ie,null);c(this,tt,e),c(this,ui,t),c(this,di,i)}setViewer(e){c(this,Ee,e)}async setDocument(e){var l;if(o(this,Z)&&await u(this,K,Bt).call(this),c(this,Z,e),!e)return;const[t,i,n]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(!t&&!n){await u(this,K,Bt).call(this);return}if(e!==o(this,Z))return;try{c(this,z,u(this,K,ar).call(this))}catch(h){console.error("setDocument:",h),await u(this,K,Bt).call(this);return}const s=o(this,tt);c(this,et,new AbortController);const{signal:a}=o(this,et);s._on("updatefromsandbox",h=>{(h==null?void 0:h.source)===window&&u(this,K,rr).call(this,h.detail)},{signal:a}),s._on("dispatcheventinsandbox",h=>{var d;(d=o(this,z))==null||d.dispatchEventInSandbox(h.detail)},{signal:a}),s._on("pagechanging",({pageNumber:h,previous:d})=>{h!==d&&(u(this,K,Fn).call(this,d),u(this,K,Oi).call(this,h))},{signal:a}),s._on("pagerendered",({pageNumber:h})=>{this._pageOpenPending.has(h)&&h===o(this,Ee).currentPageNumber&&u(this,K,Oi).call(this,h)},{signal:a}),s._on("pagesdestroy",async()=>{var h,d;await u(this,K,Fn).call(this,o(this,Ee).currentPageNumber),await((h=o(this,z))==null?void 0:h.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(d=o(this,le))==null||d.resolve()},{signal:a});try{const h=await o(this,di).call(this,e);if(e!==o(this,Z))return;await o(this,z).createSandbox({objects:t,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...h,actions:n}}),s.dispatch("sandboxcreated",{source:this})}catch(h){console.error("setDocument:",h),await u(this,K,Bt).call(this);return}await((l=o(this,z))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"Open"})),await u(this,K,Oi).call(this,o(this,Ee).currentPageNumber,!0),Promise.resolve().then(()=>{e===o(this,Z)&&c(this,At,!0)})}async dispatchWillSave(){var e;return(e=o(this,z))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var e;return(e=o(this,z))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var e;if(o(this,z)){await((e=o(this,ie))==null?void 0:e.promise),c(this,ie,Promise.withResolvers());try{await o(this,z).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(t){throw o(this,ie).resolve(),c(this,ie,null),t}await o(this,ie).promise}}async dispatchDidPrint(){var e;return(e=o(this,z))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var e;return((e=o(this,qe))==null?void 0:e.promise)||null}get ready(){return o(this,At)}get _pageOpenPending(){return Hi(this,"_pageOpenPending",new Set)}get _visitedPages(){return Hi(this,"_visitedPages",new Map)}}le=new WeakMap,qe=new WeakMap,di=new WeakMap,et=new WeakMap,tt=new WeakMap,ui=new WeakMap,Z=new WeakMap,Ee=new WeakMap,At=new WeakMap,z=new WeakMap,ie=new WeakMap,K=new WeakSet,rr=async function(e){var d,f;const t=o(this,Ee),i=t.isInPresentationMode||t.isChangingPresentationMode,{id:n,siblings:s,command:a,value:l}=e;if(!n){switch(a){case"clear":console.clear();break;case"error":console.error(l);break;case"layout":if(!i){const b=Mr(l);t.spreadMode=b.spreadMode}break;case"page-num":t.currentPageNumber=l+1;break;case"print":await t.pagesPromise,o(this,tt).dispatch("print",{source:this});break;case"println":console.log(l);break;case"zoom":i||(t.currentScaleValue=l);break;case"SaveAs":o(this,tt).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":i||t.increaseScale();break;case"ZoomViewOut":i||t.decreaseScale();break;case"WillPrintFinished":(d=o(this,ie))==null||d.resolve(),c(this,ie,null);break}return}if(i&&e.focus)return;delete e.id,delete e.siblings;const h=s?[n,...s]:[n];for(const b of h){const E=document.querySelector(`[data-element-id="${b}"]`);E?E.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):(f=o(this,Z))==null||f.annotationStorage.setValue(b,e)}},Oi=async function(e,t=!1){const i=o(this,Z),n=this._visitedPages;if(t&&c(this,le,Promise.withResolvers()),!o(this,le))return;const s=o(this,Ee).getPageView(e-1);if((s==null?void 0:s.renderingState)!==H.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);const a=(async()=>{var h,d;const l=await(n.has(e)?null:(h=s.pdfPage)==null?void 0:h.getJSActions());i===o(this,Z)&&await((d=o(this,z))==null?void 0:d.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:l}))})();n.set(e,a)},Fn=async function(e){var s;const t=o(this,Z),i=this._visitedPages;if(!o(this,le)||this._pageOpenPending.has(e))return;const n=i.get(e);n&&(i.set(e,null),await n,t===o(this,Z)&&await((s=o(this,z))==null?void 0:s.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))},ar=function(){if(c(this,qe,Promise.withResolvers()),o(this,z))throw new Error("#initScripting: Scripting already exists.");return o(this,ui).createScripting()},Bt=async function(){var e,t,i,n;if(!o(this,z)){c(this,Z,null),(e=o(this,qe))==null||e.resolve();return}o(this,le)&&(await Promise.race([o(this,le).promise,new Promise(s=>{setTimeout(s,1e3)})]).catch(()=>{}),c(this,le,null)),c(this,Z,null);try{await o(this,z).destroySandbox()}catch{}(t=o(this,ie))==null||t.reject(new Error("Scripting destroyed.")),c(this,ie,null),(i=o(this,et))==null||i.abort(),c(this,et,null),this._pageOpenPending.clear(),this._visitedPages.clear(),c(this,z,null),c(this,At,!1),(n=o(this,qe))==null||n.resolve()};class So extends xo{constructor(e){e.externalServices||window.addEventListener("updatefromsandbox",t=>{e.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})}),e.externalServices||(e.externalServices={createScripting:()=>new Po(e.sandboxBundleSrc)}),e.docProperties||(e.docProperties=t=>vo(t)),super(e)}}const Ao=3e4;class Io{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){var t;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(e)&&(this.isThumbnailViewEnabled&&((t=this.pdfThumbnailViewer)!=null&&t.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),Ao)))}getHighestPriority(e,t,i,n=!1){const s=e.views,a=s.length;if(a===0)return null;for(let b=0;b<a;b++){const E=s[b].view;if(!this.isViewFinished(E))return E}const l=e.first.id,h=e.last.id;if(h-l+1>a){const b=e.ids;for(let E=1,I=h-l;E<I;E++){const A=i?l+E:h-E;if(b.has(A))continue;const v=t[A-1];if(!this.isViewFinished(v))return v}}let d=i?h:l-2,f=t[d];return f&&!this.isViewFinished(f)||n&&(d+=i?1:-1,f=t[d],f&&!this.isViewFinished(f))?f:null}isViewFinished(e){return e.renderingState===H.FINISHED}renderView(e){switch(e.renderingState){case H.FINISHED:return!1;case H.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case H.RUNNING:this.highestPriorityPage=e.renderingId;break;case H.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally(()=>{this.renderHighestPriority()}).catch(t=>{t instanceof fn||console.error("renderView:",t)});break}return!0}}const vs=10,Ti={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function Ps(r){return Object.values(Y).includes(r)&&r!==Y.DISABLE}var we,it,ci,On;class Lo{constructor(e){m(this,ci);m(this,we,new Set);m(this,it,0);c(this,it,e)}push(e){const t=o(this,we);t.has(e)&&t.delete(e),t.add(e),t.size>o(this,it)&&u(this,ci,On).call(this)}resize(e,t=null){c(this,it,e);const i=o(this,we);if(t){const n=i.size;let s=1;for(const a of i)if(t.has(a.id)&&(i.delete(a),i.add(a)),++s>n)break}for(;i.size>o(this,it);)u(this,ci,On).call(this)}has(e){return o(this,we).has(e)}[Symbol.iterator](){return o(this,we).keys()}}we=new WeakMap,it=new WeakMap,ci=new WeakSet,On=function(){const e=o(this,we).keys().next().value;e==null||e.destroy(),o(this,we).delete(e)};var Ve,fi,gi,he,q,nt,pi,mi,bi,Ei,wi,_i,yi,Be,st,rt,at,It,He,Lt,vi,Tt,ot,Ue,Pi,Rt,S,lr,hr,dr,Ht,ji,ur,jn,cr,Pe,Vn,fr,gr,pr,Bn,mr,Vi;class or{constructor(e){m(this,S);m(this,Ve,null);m(this,fi,null);m(this,gi,null);m(this,he,Y.NONE);m(this,q,null);m(this,nt,_e.ENABLE_FORMS);m(this,pi,null);m(this,mi,null);m(this,bi,!1);m(this,Ei,!1);m(this,wi,!1);m(this,_i,!1);m(this,yi,!1);m(this,Be,null);m(this,st,null);m(this,rt,null);m(this,at,null);m(this,It,!1);m(this,He,null);m(this,Lt,!1);m(this,vi,0);m(this,Tt,new ResizeObserver(u(this,S,mr).bind(this)));m(this,ot,null);m(this,Ue,null);m(this,Pi,!0);m(this,Rt,de.ENABLE);var n,s;const t="4.10.38";if(ss!==t)throw new Error(`The API version "${ss}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,((n=this.container)==null?void 0:n.tagName)!=="DIV"||((s=this.viewer)==null?void 0:s.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.");o(this,Tt).observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new Un,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,c(this,fi,e.altTextManager||null),c(this,mi,e.editorUndoBar||null),this.findController&&(this.findController.onIsPageVisible=a=>this._getVisiblePages().ids.has(a)),this._scriptingManager=e.scriptingManager||null,c(this,Rt,e.textLayerMode??de.ENABLE),c(this,nt,e.annotationMode??_e.ENABLE_FORMS),c(this,he,e.annotationEditorMode??Y.NONE),c(this,gi,e.annotationEditorHighlightColors||null),c(this,Ei,e.enableHighlightFloatingButton===!0),c(this,_i,e.enableUpdatedAddImage===!0),c(this,yi,e.enableNewAltTextWhenAddingImage===!0),this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n,this.l10n||(this.l10n=new Nt),c(this,wi,e.enablePermissions||!1),this.pageColors=e.pageColors||null,c(this,st,e.mlManager||null),c(this,bi,e.enableHWA||!1),c(this,Pi,e.supportsPinchToZoom!==!1),this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Io,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue;const{abortSignal:i}=e;i==null||i.addEventListener("abort",()=>{o(this,Tt).disconnect(),c(this,Tt,null)},{once:!0}),this.scroll=Sr(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=ct.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),u(this,S,Bn).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:a,pdfPage:l})=>{const h=this._pages[a-1];o(this,Ve).has(h)||l==null||l.cleanup()}),e.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(o(this,Ve))}get pageViewsReady(){return this._pages.every(e=>e==null?void 0:e.pdfPage)}get renderForms(){return o(this,nt)===_e.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){var n;if(this._currentPageNumber===e)return t&&u(this,S,Vn).call(this),!0;if(!(0<e&&e<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:((n=this._pageLabels)==null?void 0:n[e-1])??null,previous:i}),t&&u(this,S,Vn).call(this),!0}get currentPageLabel(){var e;return((e=this._pageLabels)==null?void 0:e[this._currentPageNumber-1])??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=e|0;if(this._pageLabels){const i=this._pageLabels.indexOf(e);i>=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==Ji?this._currentScale:xs}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&u(this,S,Pe).call(this,e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&u(this,S,Pe).call(this,e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!As(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(e%=360,e<0&&(e+=360),this._pagesRotation===e))return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&u(this,S,Pe).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,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 e=this;return Hi(this,"_layerProperties",{get annotationEditorUIManager(){return o(e,q)},get annotationStorage(){var t;return(t=e.pdfDocument)==null?void 0:t.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){var t;return(t=e.pdfDocument)==null?void 0:t.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){var t;return(t=e.pdfDocument)==null?void 0:t.hasJSActions()},get linkService(){return e.linkService}})}async getAllText(){const e=[],t=[];for(let i=1,n=this.pdfDocument.numPages;i<=n;++i){if(o(this,Lt))return null;t.length=0;const s=await this.pdfDocument.getPage(i),{items:a}=await s.getTextContent();for(const l of a)l.str&&t.push(l.str),l.hasEOL&&t.push(`
345
+ `);e.push($t(t.join("")))}return e.join(`
346
+ `)}setDocument(e){var E,I,A;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(E=this.findController)==null||E.setDocument(null),(I=this._scriptingManager)==null||I.setDocument(null),(A=o(this,q))==null||A.destroy(),c(this,q,null)),this.pdfDocument=e,!e)return;const t=e.numPages,i=e.getPage(1),n=e.getOptionalContentConfig({intent:"display"}),s=o(this,wi)?e.getPermissions():Promise.resolve(),{eventBus:a,pageColors:l,viewer:h}=this;c(this,Be,new AbortController);const{signal:d}=o(this,Be);if(t>Ti.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const v=this._scrollMode=k.PAGE;a.dispatch("scrollmodechanged",{source:this,mode:v})}this._pagesCapability.promise.then(()=>{a.dispatch("pagesloaded",{source:this,pagesCount:t})},()=>{});const f=v=>{const x=this._pages[v.pageNumber-1];x&&o(this,Ve).push(x)};a._on("pagerender",f,{signal:d});const b=v=>{v.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:v.timestamp}),a._off("pagerendered",b))};a._on("pagerendered",b,{signal:d}),Promise.all([i,s]).then(([v,x])=>{var U,j;if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(v),this._optionalContentConfigPromise=n;const{annotationEditorMode:L,annotationMode:N,textLayerMode:y}=u(this,S,lr).call(this,x);if(y!==de.DISABLE){const g=c(this,He,document.createElement("div"));g.id="hiddenCopyElement",h.before(g)}if(typeof AbortSignal.any=="function"&&L!==Y.DISABLE){const g=L;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):Ps(g)?(c(this,q,new ra(this.container,h,o(this,fi),a,e,l,o(this,gi),o(this,Ei),o(this,_i),o(this,yi),o(this,st),o(this,mi),o(this,Pi))),a.dispatch("annotationeditoruimanager",{source:this,uiManager:o(this,q)}),g!==Y.NONE&&(g===Y.STAMP&&((U=o(this,st))==null||U.loadModel("altText")),o(this,q).updateMode(g))):console.error(`Invalid AnnotationEditor mode: ${g}`)}const C=this._scrollMode===k.PAGE?null:h,O=this.currentScale,V=v.getViewport({scale:O*ge.PDF_TO_CSS_UNITS});h.style.setProperty("--scale-factor",V.scale),l!=null&&l.background&&h.style.setProperty("--page-bg-color",l.background),((l==null?void 0:l.foreground)==="CanvasText"||(l==null?void 0:l.background)==="Canvas")&&(h.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),h.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let g=1;g<=t;++g){const w=new ir({container:C,eventBus:a,id:g,scale:O,defaultViewport:V.clone(),optionalContentConfigPromise:n,renderingQueue:this.renderingQueue,textLayerMode:y,annotationMode:N,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:l,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:o(this,bi)});this._pages.push(w)}(j=this._pages[0])==null||j.setPdfPage(v),this._scrollMode===k.PAGE?u(this,S,Ht).call(this):this._spreadMode!==X.NONE&&this._updateSpreadMode(),u(this,S,hr).call(this,d).then(async()=>{var w,P;if(e!==this.pdfDocument)return;if((w=this.findController)==null||w.setDocument(e),(P=this._scriptingManager)==null||P.setDocument(e),o(this,He)&&document.addEventListener("copy",u(this,S,dr).bind(this,y),{signal:d}),o(this,q)&&a.dispatch("annotationeditormodechanged",{source:this,mode:o(this,he)}),e.loadingParams.disableAutoFetch||t>Ti.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let g=t-1;if(g<=0){this._pagesCapability.resolve();return}for(let F=2;F<=t;++F){const D=e.getPage(F).then(M=>{const $=this._pages[F-1];$.pdfPage||$.setPdfPage(M),--g===0&&this._pagesCapability.resolve()},M=>{console.error(`Unable to get page ${F} to initialize viewer`,M),--g===0&&this._pagesCapability.resolve()});F%Ti.PAUSE_EAGER_PAGE_INIT===0&&await D}}),a.dispatch("pagesinit",{source:this}),e.getMetadata().then(({info:g})=>{e===this.pdfDocument&&g.Language&&(h.lang=g.Language)}),this.defaultRenderingQueue&&this.update()}).catch(v=>{console.error("Unable to initialize viewer",v),this._pagesCapability.reject(v)})}setPageLabels(e){var t;if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let i=0,n=this._pages.length;i<n;i++)this._pages[i].setPageLabel(((t=this._pageLabels)==null?void 0:t[i])??null)}}_resetView(){var e,t;this._pages=[],this._currentPageNumber=1,this._currentScale=Ji,this._currentScaleValue=null,this._pageLabels=null,c(this,Ve,new Lo(vs)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=k.VERTICAL,this._previousScrollMode=k.UNKNOWN,this._spreadMode=X.NONE,c(this,ot,{previousPageNumber:1,scrollDown:!0,pages:[]}),(e=o(this,Be))==null||e.abort(),c(this,Be,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(t=o(this,He))==null||t.remove(),c(this,He,null),u(this,S,Vi).call(this)}_scrollUpdate(){this.pagesCount!==0&&this.update()}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:n=!1}){if(!this.pdfDocument)return;const s=Number.isInteger(e)&&this._pages[e-1];if(!s){console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!t){this._setCurrentPageNumber(e,!0);return}let a=0,l=0,h=0,d=0,f,b;const E=s.rotation%180!==0,I=(E?s.height:s.width)/s.scale/ge.PDF_TO_CSS_UNITS,A=(E?s.width:s.height)/s.scale/ge.PDF_TO_CSS_UNITS;let v=0;switch(t[1].name){case"XYZ":a=t[2],l=t[3],v=t[4],a=a!==null?a:0,l=l!==null?l:A;break;case"Fit":case"FitB":v="page-fit";break;case"FitH":case"FitBH":l=t[2],v="page-width",l===null&&this._location?(a=this._location.left,l=this._location.top):(typeof l!="number"||l<0)&&(l=A);break;case"FitV":case"FitBV":a=t[2],h=I,d=A,v="page-height";break;case"FitR":a=t[2],l=t[3],h=t[4]-a,d=t[5]-l;let y=Gn,C=Kn;this.removePageBorders&&(y=C=0),f=(this.container.clientWidth-y)/h/ge.PDF_TO_CSS_UNITS,b=(this.container.clientHeight-C)/d/ge.PDF_TO_CSS_UNITS,v=Math.min(Math.abs(f),Math.abs(b));break;default:console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`);return}if(n||(v&&v!==this._currentScale?this.currentScaleValue=v:this._currentScale===Ji&&(this.currentScaleValue=yr)),v==="page-fit"&&!t[4]){u(this,S,ji).call(this,s);return}const x=[s.viewport.convertToViewportPoint(a,l),s.viewport.convertToViewportPoint(a+h,l+d)];let L=Math.min(x[0][0],x[1][0]),N=Math.min(x[0][1],x[1][1]);i||(L=Math.max(L,0),N=Math.max(N,0)),u(this,S,ji).call(this,s,{left:L,top:N})}_updateLocation(e){const t=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===t?Math.round(t*1e4)/100:i,s=e.id,a=this._pages[s-1],l=this.container,h=a.getPagePoint(l.scrollLeft-e.x,l.scrollTop-e.y),d=Math.round(h[0]),f=Math.round(h[1]);let b=`#page=${s}`;this.isInPresentationMode||(b+=`&zoom=${n},${d},${f}`),this._location={pageNumber:s,scale:n,top:f,left:d,rotation:this._pagesRotation,pdfOpenParams:b}}update(){const e=this._getVisiblePages(),t=e.views,i=t.length;if(i===0)return;const n=Math.max(vs,2*i+1);o(this,Ve).resize(n,e.ids),this.renderingQueue.renderHighestPriority(e);const s=this._spreadMode===X.NONE&&(this._scrollMode===k.PAGE||this._scrollMode===k.VERTICAL),a=this._currentPageNumber;let l=!1;for(const h of t){if(h.percent<100)break;if(h.id===a&&s){l=!0;break}}this._setCurrentPageNumber(l?a:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===ct.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===ct.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 e=this._scrollMode===k.PAGE?o(this,ot).pages:this._pages,t=this._scrollMode===k.HORIZONTAL,i=t&&this._isContainerRtl;return Ir({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(const e of this._pages)e.renderingState!==H.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}forceRendering(e){const t=e||this._getVisiblePages(),i=u(this,S,pr).call(this,t),n=this._spreadMode!==X.NONE&&this._scrollMode!==k.HORIZONTAL,s=this.renderingQueue.getHighestPriority(t,this._pages,i,n);return s?(u(this,S,gr).call(this,s).then(()=>{this.renderingQueue.renderView(s)}),!0):!1}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,i=this._pages.length;t<i;++t){const n=this._pages[t];if(n.width!==e.width||n.height!==e.height)return!1}return!0}getPagesOverview(){let e;return this._pages.map(t=>{const i=t.pdfPage.getViewport({scale:1}),n=Qn(i);if(e===void 0)e=n;else if(this.enablePrintAutoRotate&&n!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.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(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!Lr(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>Ti.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===k.HORIZONTAL),i.classList.toggle("scrollWrapped",t===k.WRAPPED),!(!this.pdfDocument||!e)&&(t===k.PAGE?u(this,S,Ht).call(this):this._previousScrollMode===k.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&u(this,S,Pe).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!Tr(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===k.PAGE)u(this,S,Ht).call(this);else if(t.textContent="",this._spreadMode===X.NONE)for(const n of this._pages)t.append(n.div);else{const n=this._spreadMode-1;let s=null;for(let a=0,l=i.length;a<l;++a)s===null?(s=document.createElement("div"),s.className="spread",t.append(s)):a%2===n&&(s=s.cloneNode(!1),t.append(s)),s.append(i[a].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&u(this,S,Pe).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}_getPageAdvance(e,t=!1){switch(this._scrollMode){case k.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:s,y:a,percent:l,widthPercent:h}of i){if(l===0||h<100)continue;let d=n.get(a);d||n.set(a,d||(d=[])),d.push(s)}for(const s of n.values()){const a=s.indexOf(e);if(a===-1)continue;const l=s.length;if(l===1)break;if(t)for(let h=a-1,d=0;h>=d;h--){const f=s[h],b=s[h+1]-1;if(f<b)return e-b}else for(let h=a+1,d=l;h<d;h++){const f=s[h],b=s[h-1]+1;if(f>b)return b-e}if(t){const h=s[0];if(h<e)return e-h+1}else{const h=s[l-1];if(h>e)return h-e+1}break}break}case k.HORIZONTAL:break;case k.PAGE:case k.VERTICAL:{if(this._spreadMode===X.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),s=t?e-1:e+1;for(const{id:a,percent:l,widthPercent:h}of n)if(a===s){if(l>0&&h===100)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}updateScale({drawingDelay:e,scaleFactor:t=null,steps:i=null,origin:n}){if(i===null&&t===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let s=this._currentScale;if(t>0&&t!==1)s=Math.round(s*t*100)/100;else if(i){const a=i>0?zn:1/zn,l=i>0?Math.ceil:Math.floor;i=Math.abs(i);do s=l((s*a).toFixed(2)*10)/10;while(--i>0)}s=Math.max(vr,Math.min(Pr,s)),u(this,S,Pe).call(this,s,{noScroll:!1,drawingDelay:e,origin:n})}increaseScale(e={}){this.updateScale({...e,steps:e.steps??1})}decreaseScale(e={}){this.updateScale({...e,steps:-(e.steps??1)})}get containerTopLeft(){return o(this,pi)||c(this,pi,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return o(this,q)?o(this,he):Y.DISABLE}set annotationEditorMode({mode:e,editId:t=null,isFromKeyboard:i=!1}){var a;if(!o(this,q))throw new Error("The AnnotationEditor is not enabled.");if(o(this,he)===e)return;if(!Ps(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);if(!this.pdfDocument)return;e===Y.STAMP&&((a=o(this,st))==null||a.loadModel("altText"));const{eventBus:n}=this,s=()=>{u(this,S,Vi).call(this),c(this,he,e),o(this,q).updateMode(e,t,i),n.dispatch("annotationeditormodechanged",{source:this,mode:e})};if(e===Y.NONE||o(this,he)===Y.NONE){const l=e!==Y.NONE;l||this.pdfDocument.annotationStorage.resetModifiedIds();for(const d of this._pages)d.toggleEditingMode(l);const h=u(this,S,fr).call(this);if(l&&h){u(this,S,Vi).call(this),c(this,rt,new AbortController);const d=AbortSignal.any([o(this,Be).signal,o(this,rt).signal]);n._on("pagerendered",({pageNumber:f})=>{h.delete(f),h.size===0&&c(this,at,setTimeout(s,0))},{signal:d});return}}s()}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(t);o(this,Ue)!==null&&(clearTimeout(o(this,Ue)),c(this,Ue,null)),e||this.update()}}}Ve=new WeakMap,fi=new WeakMap,gi=new WeakMap,he=new WeakMap,q=new WeakMap,nt=new WeakMap,pi=new WeakMap,mi=new WeakMap,bi=new WeakMap,Ei=new WeakMap,wi=new WeakMap,_i=new WeakMap,yi=new WeakMap,Be=new WeakMap,st=new WeakMap,rt=new WeakMap,at=new WeakMap,It=new WeakMap,He=new WeakMap,Lt=new WeakMap,vi=new WeakMap,Tt=new WeakMap,ot=new WeakMap,Ue=new WeakMap,Pi=new WeakMap,Rt=new WeakMap,S=new WeakSet,lr=function(e){const t={annotationEditorMode:o(this,he),annotationMode:o(this,nt),textLayerMode:o(this,Rt)};return e&&(!e.includes(Ii.COPY)&&o(this,Rt)===de.ENABLE&&(t.textLayerMode=de.ENABLE_PERMISSIONS),e.includes(Ii.MODIFY_CONTENTS)||(t.annotationEditorMode=Y.DISABLE),!e.includes(Ii.MODIFY_ANNOTATIONS)&&!e.includes(Ii.FILL_INTERACTIVE_FORMS)&&o(this,nt)===_e.ENABLE_FORMS&&(t.annotationMode=_e.ENABLE)),t},hr=async function(e){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const t=Promise.withResolvers(),i=new AbortController;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&t.resolve()},{signal:typeof AbortSignal.any=="function"?AbortSignal.any([e,i.signal]):e}),await Promise.race([this._onePageRenderedCapability.promise,t.promise]),i.abort()},dr=function(e,t){const i=document.getSelection(),{focusNode:n,anchorNode:s}=i;if(s&&n&&i.containsNode(o(this,He))){if(o(this,It)||e===de.ENABLE_PERMISSIONS){gn(t);return}c(this,It,!0);const{classList:a}=this.viewer;a.add("copyAll");const l=new AbortController;window.addEventListener("keydown",h=>c(this,Lt,h.key==="Escape"),{signal:l.signal}),this.getAllText().then(async h=>{h!==null&&await navigator.clipboard.writeText(h)}).catch(h=>{console.warn(`Something goes wrong when extracting the text: ${h.message}`)}).finally(()=>{c(this,It,!1),c(this,Lt,!1),l.abort(),a.remove("copyAll")}),gn(t)}},Ht=function(){if(this._scrollMode!==k.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=o(this,ot),i=this.viewer;if(i.textContent="",t.pages.length=0,this._spreadMode===X.NONE&&!this.isInPresentationMode){const n=this._pages[e-1];i.append(n.div),t.pages.push(n)}else{const n=new Set,s=this._spreadMode-1;s===-1?n.add(e-1):e%2!==s?(n.add(e-1),n.add(e)):(n.add(e-2),n.add(e-1));const a=document.createElement("div");if(a.className="spread",this.isInPresentationMode){const l=document.createElement("div");l.className="dummyPage",a.append(l)}for(const l of n){const h=this._pages[l];h&&(a.append(h.div),t.pages.push(h))}i.append(a)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e},ji=function(e,t=null){const{div:i,id:n}=e;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===k.PAGE&&(u(this,S,Ht).call(this),this.update()),!t&&!this.isInPresentationMode){const s=i.offsetLeft+i.clientLeft,a=s+i.clientWidth,{scrollLeft:l,clientWidth:h}=this.container;(this._scrollMode===k.HORIZONTAL||s<l||a>l+h)&&(t={left:0,top:0})}Ss(i,t),!this._currentScaleValue&&this._location&&(this._location=null)},ur=function(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15},jn=function(e,t,{noScroll:i=!1,preset:n=!1,drawingDelay:s=-1,origin:a=null}){if(this._currentScaleValue=t.toString(),u(this,S,ur).call(this,e)){n&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});return}this.viewer.style.setProperty("--scale-factor",e*ge.PDF_TO_CSS_UNITS);const l=s>=0&&s<1e3;this.refresh(!0,{scale:e,drawingDelay:l?s:-1}),l&&c(this,Ue,setTimeout(()=>{c(this,Ue,null),this.refresh()},s));const h=this._currentScale;if(this._currentScale=e,!i){let d=this._currentPageNumber,f;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(d=this._location.pageNumber,f=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:d,destArray:f,allowNegativeOffset:!0}),Array.isArray(a)){const b=e/h-1,[E,I]=this.containerTopLeft;this.container.scrollLeft+=(a[0]-I)*b,this.container.scrollTop+=(a[1]-E)*b}}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:n?t:void 0}),this.defaultRenderingQueue&&this.update()},cr=function(){return this._spreadMode!==X.NONE&&this._scrollMode!==k.HORIZONTAL?2:1},Pe=function(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,u(this,S,jn).call(this,i,e,t);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let s=Gn,a=Kn;this.isInPresentationMode?(s=a=4,this._spreadMode!==X.NONE&&(s*=2)):this.removePageBorders?s=a=0:this._scrollMode===k.HORIZONTAL&&([s,a]=[a,s]);const l=(this.container.clientWidth-s)/n.width*n.scale/o(this,S,cr),h=(this.container.clientHeight-a)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=l;break;case"page-height":i=h;break;case"page-fit":i=Math.min(l,h);break;case"auto":const d=Qn(n)?l:Math.min(h,l);i=Math.min(xr,d);break;default:console.error(`#setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0,u(this,S,jn).call(this,i,e,t)}},Vn=function(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&u(this,S,Pe).call(this,this._currentScaleValue,{noScroll:!0}),u(this,S,ji).call(this,e)},fr=function(){const e=this._getVisiblePages(),t=[],{ids:i,views:n}=e;for(const s of n){const{view:a}=s;if(!a.hasEditableAnnotations()){i.delete(a.id);continue}t.push(s)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:i}),i)},gr=async function(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),t}catch(t){return console.error("Unable to get page for page view",t),null}},pr=function(e){var t,i;if(((t=e.first)==null?void 0:t.id)===1)return!0;if(((i=e.last)==null?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case k.PAGE:return o(this,ot).scrollDown;case k.HORIZONTAL:return this.scroll.right}return this.scroll.down},Bn=function(e=this.container.clientHeight){e!==o(this,vi)&&(c(this,vi,e),Rr.setProperty("--viewer-container-height",`${e}px`))},mr=function(e){for(const t of e)if(t.target===this.container){u(this,S,Bn).call(this,Math.floor(t.borderBoxSize[0].blockSize)),c(this,pi,null);break}},Vi=function(){var e;(e=o(this,rt))==null||e.abort(),c(this,rt,null),o(this,at)!==null&&(clearTimeout(o(this,at)),c(this,at,null))};class To extends or{_resetView(){super._resetView(),this._scrollMode=k.PAGE,this._spreadMode=X.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}var el=B.AnnotationLayerBuilder,tl=B.DownloadManager,il=B.EventBus,nl=B.FindState,sl=B.GenericL10n,rl=B.LinkTarget,al=B.PDFFindController,ol=B.PDFHistory,ll=B.PDFLinkService,hl=B.PDFPageView,dl=B.PDFScriptingManager,ul=B.PDFSinglePageViewer,cl=B.PDFViewer,fl=B.ProgressBar,gl=B.RenderingStates,pl=B.ScrollMode,ml=B.SimpleLinkService,bl=B.SpreadMode,El=B.StructTreeLayerBuilder,wl=B.TextLayerBuilder,_l=B.XfaLayerBuilder,yl=B.parseQueryString;export{el as AnnotationLayerBuilder,tl as DownloadManager,il as EventBus,nl as FindState,sl as GenericL10n,rl as LinkTarget,al as PDFFindController,ol as PDFHistory,ll as PDFLinkService,hl as PDFPageView,dl as PDFScriptingManager,ul as PDFSinglePageViewer,cl as PDFViewer,fl as ProgressBar,gl as RenderingStates,pl as ScrollMode,ml as SimpleLinkService,bl as SpreadMode,El as StructTreeLayerBuilder,wl as TextLayerBuilder,_l as XfaLayerBuilder,yl as parseQueryString};