@kne-components/react-file 0.1.29 → 0.1.30
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.
- package/build/asset-manifest.json +18 -22
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/css/344.afc46141.chunk.css +2 -0
- package/build/static/css/344.afc46141.chunk.css.map +1 -0
- package/build/static/css/963.afc46141.chunk.css +2 -0
- package/build/static/css/963.afc46141.chunk.css.map +1 -0
- package/build/static/js/258.16d1004e.chunk.js +2 -0
- package/build/static/js/258.16d1004e.chunk.js.map +1 -0
- package/build/static/js/441.45ec01c6.chunk.js +3 -0
- package/build/static/js/441.45ec01c6.chunk.js.map +1 -0
- package/build/static/js/{72.d8872dff.chunk.js → 72.7161418a.chunk.js} +2 -2
- package/build/static/js/{72.d8872dff.chunk.js.map → 72.7161418a.chunk.js.map} +1 -1
- package/build/static/js/{784.a4a26d9b.chunk.js → 784.b0e831c1.chunk.js} +2 -2
- package/build/static/js/{784.a4a26d9b.chunk.js.map → 784.b0e831c1.chunk.js.map} +1 -1
- package/build/static/js/825.bec18cd8.chunk.js +2 -0
- package/build/static/js/825.bec18cd8.chunk.js.map +1 -0
- package/build/static/js/main.0348a450.js +2 -0
- package/build/static/js/main.0348a450.js.map +1 -0
- package/package.json +1 -1
- package/build/static/css/341.4e579c73.chunk.css +0 -2
- package/build/static/css/341.4e579c73.chunk.css.map +0 -1
- package/build/static/css/722.4e579c73.chunk.css +0 -2
- package/build/static/css/722.4e579c73.chunk.css.map +0 -1
- package/build/static/js/123.2475a82a.chunk.js +0 -1
- package/build/static/js/258.83689888.chunk.js +0 -2
- package/build/static/js/258.83689888.chunk.js.map +0 -1
- package/build/static/js/395.0787097d.chunk.js +0 -1
- package/build/static/js/673.40ba14a6.chunk.js +0 -1
- package/build/static/js/688.0621b840.chunk.js +0 -1
- package/build/static/js/69.e2d06205.chunk.js +0 -3
- package/build/static/js/69.e2d06205.chunk.js.map +0 -1
- package/build/static/js/84.d488f5a1.chunk.js +0 -2
- package/build/static/js/84.d488f5a1.chunk.js.map +0 -1
- package/build/static/js/main.e76808a8.js +0 -2
- package/build/static/js/main.e76808a8.js.map +0 -1
- /package/build/static/js/{69.e2d06205.chunk.js.LICENSE.txt → 441.45ec01c6.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 441.45ec01c6.chunk.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunk_kne_components_react_file=self.webpackChunk_kne_components_react_file||[]).push([[379,441],{2153:(t,e,i)=>{"use strict";i.d(e,{A:()=>N});var n=i(53986),s=i(89379),r=i(89261),a=i(94922),o=i(47215),l=i(78805),h=i(41338);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){for(var e=0,n=i;e<n.length;e++){var s=n[e];"function"===typeof s?s(t):s&&(s.current=t)}}}var d=i(64288),u=i(98677),p=i(60591),g=i(51938),f=i(88648);function m(){return(0,a.useContext)(f.A)}const v=(0,a.createContext)(null);function w(){return(0,a.useContext)(v)}var b=i(7762),y=i(63185);function A(){const t=m(),e=w();(0,d.A)(e,"Unable to find Page context.");const i=(0,s.A)((0,s.A)({},t),e),{imageResourcesPath:n,linkService:h,onGetAnnotationsError:c,onGetAnnotationsSuccess:p,onRenderAnnotationLayerError:f,onRenderAnnotationLayerSuccess:v,page:A,pdf:_,renderForms:x,rotate:E,scale:k=1}=i;(0,d.A)(_,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,d.A)(A,"Attempted to load page annotations, but no page was specified."),(0,d.A)(h,"Attempted to load page annotations, but no linkService was specified.");const[M,S]=(0,b.A)(),{value:C,error:T}=M,P=(0,a.useRef)(null);u(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,a.useEffect)(function(){S({type:"RESET"})},[S,A]),(0,a.useEffect)(function(){if(!A)return;const t=(0,l.A)(A.getAnnotations()),e=t;return t.promise.then(t=>{S({type:"RESOLVE",value:t})}).catch(t=>{S({type:"REJECT",error:t})}),()=>{(0,y.xL)(e)}},[S,A]),(0,a.useEffect)(()=>{void 0!==C&&(!1!==C?C&&p&&p(C):T&&(u(!1,T.toString()),c&&c(T)))},[C]);const R=(0,a.useMemo)(()=>A.getViewport({scale:k,rotation:E}),[A,E,k]);return(0,a.useEffect)(function(){if(!_||!A||!h||!C)return;const{current:t}=P;if(!t)return;const e=R.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,annotationStorage:_.annotationStorage,commentManager:null,div:t,l10n:null,linkService:h,page:A,structTreeLayer:null,viewport:e},s={annotations:C,annotationStorage:_.annotationStorage,div:t,imageResourcesPath:n,linkService:h,page:A,renderForms:x,viewport:e};t.innerHTML="";try{new g.dU(i).render(s),v&&v()}catch(r){!function(t){u(!1,"".concat(t)),f&&f(t)}(r)}return()=>{}},[C,n,h,A,_,x,R]),(0,r.jsx)("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:P})}const _={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},x=/^H(\d+)$/;function E(t){return"children"in t}function k(t){return!!E(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function M(t){const e={};if(E(t)){const{role:i}=t,n=i.match(x);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in _}(i)){const t=_[i];t&&(e.role=t)}}return e}function S(t){const e={};if(E(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),k(t)){const[i]=t.children;if(i){const t=S(i);return(0,s.A)((0,s.A)({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function C(t){return t?(0,s.A)((0,s.A)({},M(t)),S(t)):null}function T(t){let{className:e,node:i}=t;const n=(0,a.useMemo)(()=>C(i),[i]),o=(0,a.useMemo)(()=>E(i)?k(i)?null:i.children.map((t,e)=>(0,r.jsx)(T,{node:t},e)):null,[i]);return(0,r.jsx)("span",(0,s.A)((0,s.A)({className:e},n),{},{children:o}))}function P(){const t=w();(0,d.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[n,s]=(0,b.A)(),{value:o,error:h}=n,{customTextRenderer:c,page:p}=t;return(0,a.useEffect)(function(){s({type:"RESET"})},[s,p]),(0,a.useEffect)(function(){if(c)return;if(!p)return;const t=(0,l.A)(p.getStructTree()),e=t;return t.promise.then(t=>{s({type:"RESOLVE",value:t})}).catch(t=>{s({type:"REJECT",error:t})}),()=>(0,y.xL)(e)},[c,p,s]),(0,a.useEffect)(()=>{void 0!==o&&(!1!==o?o&&i&&i(o):h&&(u(!1,h.toString()),e&&e(h)))},[o]),o?(0,r.jsx)(T,{className:"react-pdf__Page__structTree structTree",node:o}):null}const R=g.ng;function D(t){const e=w();(0,d.A)(e,"Unable to find Page context.");const i=(0,s.A)((0,s.A)({},e),t),{_className:n,canvasBackground:o,devicePixelRatio:l=(0,y.mZ)(),onRenderError:h,onRenderSuccess:p,page:g,renderForms:f,renderTextLayer:m,rotate:v,scale:b}=i,{canvasRef:A}=t;(0,d.A)(g,"Attempted to render page canvas, but no page was specified.");const _=(0,a.useRef)(null);function x(t){(0,y.UT)(t)||(u(!1,t.toString()),h&&h(t))}const E=(0,a.useMemo)(()=>g.getViewport({scale:b*l,rotation:v}),[l,g,v,b]),k=(0,a.useMemo)(()=>g.getViewport({scale:b,rotation:v}),[g,v,b]);(0,a.useEffect)(function(){if(!g)return;g.cleanup();const{current:t}=_;if(!t)return;t.width=E.width,t.height=E.height,t.style.width="".concat(Math.floor(k.width),"px"),t.style.height="".concat(Math.floor(k.height),"px"),t.style.visibility="hidden";const e={annotationMode:f?R.ENABLE_FORMS:R.ENABLE,canvas:t,canvasContext:t.getContext("2d",{alpha:!1}),viewport:E};o&&(e.background=o);const i=g.render(e),n=i;return i.promise.then(()=>{t.style.visibility="",g&&p&&p((0,y.vS)(g,b))}).catch(x),()=>(0,y.xL)(n)},[o,g,f,E,k]);const M=(0,a.useCallback)(()=>{const{current:t}=_;t&&(t.width=0,t.height=0)},[]);return(0,a.useEffect)(()=>M,[M]),(0,r.jsx)("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:c(A,_),style:{display:"block",userSelect:"none"},children:m?(0,r.jsx)(P,{}):null})}function L(){const t=w();(0,d.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:n,onRenderTextLayerError:h,onRenderTextLayerSuccess:c,page:p,pageIndex:f,pageNumber:m,rotate:v,scale:A}=t;(0,d.A)(p,"Attempted to load page text content, but no page was specified.");const[_,x]=(0,b.A)(),{value:E,error:k}=_,M=(0,a.useRef)(null);u(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,a.useEffect)(function(){x({type:"RESET"})},[p,x]),(0,a.useEffect)(function(){if(!p)return;const t=(0,l.A)(p.getTextContent()),e=t;return t.promise.then(t=>{x({type:"RESOLVE",value:t})}).catch(t=>{x({type:"REJECT",error:t})}),()=>(0,y.xL)(e)},[p,x]),(0,a.useEffect)(()=>{void 0!==E&&(!1!==E?E&&n&&n(E):k&&(u(!1,k.toString()),i&&i(k)))},[E]);const S=(0,a.useCallback)(()=>{c&&c()},[c]),C=(0,a.useCallback)(t=>{u(!1,t.toString()),h&&h(t)},[h]);const T=(0,a.useMemo)(()=>p.getViewport({scale:A,rotation:v}),[p,v,A]);return(0,a.useLayoutEffect)(function(){if(!p||!E)return;const{current:t}=M;if(!t)return;t.innerHTML="";const i=p.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:i,viewport:T},r=new g.D6(n),a=r;return r.render().then(()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i);const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;E.items.forEach((i,r)=>{if(!function(t){return"str"in t}(i))return;const a=n[t];if(!a)return;const o=e((0,s.A)({pageIndex:f,pageNumber:m,itemIndex:r},i));a.innerHTML=o,t+=i.str&&i.hasEOL?2:1})}S()}).catch(C),()=>(0,y.xL)(a)},[e,C,S,p,f,m,E,T]),(0,r.jsx)("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=M.current;t&&t.classList.remove("selecting")},onMouseDown:function(){const t=M.current;t&&t.classList.add("selecting")},ref:M})}const I=["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"],F=1;function N(t){const e=m(),i=(0,s.A)((0,s.A)({},e),t),{_className:g="react-pdf__Page",_enableRegisterUnregisterPage:f=!0,canvasBackground:w,canvasRef:_,children:x,className:E,customRenderer:k,customTextRenderer:M,devicePixelRatio:S,error:C="Failed to load the page.",height:T,inputRef:P,loading:R="Loading page\u2026",noData:N="No page specified.",onGetAnnotationsError:O,onGetAnnotationsSuccess:B,onGetStructTreeError:W,onGetStructTreeSuccess:z,onGetTextError:H,onGetTextSuccess:j,onLoadError:V,onLoadSuccess:U,onRenderAnnotationLayerError:G,onRenderAnnotationLayerSuccess:q,onRenderError:X,onRenderSuccess:Y,onRenderTextLayerError:K,onRenderTextLayerSuccess:J,pageIndex:Q,pageNumber:Z,pdf:$,registerPage:tt,renderAnnotationLayer:et=!0,renderForms:it=!1,renderMode:nt="canvas",renderTextLayer:st=!0,rotate:rt,scale:at=F,unregisterPage:ot,width:lt}=i,ht=(0,n.A)(i,I),[ct,dt]=(0,b.A)(),{value:ut,error:pt}=ct,gt=(0,a.useRef)(null);(0,d.A)($,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ft=(0,y.ci)(Z)?Z-1:null!==Q&&void 0!==Q?Q:null,mt=null!==Z&&void 0!==Z?Z:(0,y.ci)(Q)?Q+1:null,vt=null!==rt&&void 0!==rt?rt:ut?ut.rotate:null,wt=(0,a.useMemo)(()=>{if(!ut)return null;let t=1;const e=null!==at&&void 0!==at?at:F;if(lt||T){const e=ut.getViewport({scale:1,rotation:vt});lt?t=lt/e.width:T&&(t=T/e.height)}return e*t},[T,ut,vt,at,lt]);(0,a.useEffect)(function(){return()=>{(0,y.ci)(ft)&&f&&ot&&ot(ft)}},[f,$,ft,ot]),(0,a.useEffect)(function(){dt({type:"RESET"})},[dt,$,ft]),(0,a.useEffect)(function(){if(!$||!mt)return;const t=(0,l.A)($.getPage(mt)),e=t;return t.promise.then(t=>{dt({type:"RESOLVE",value:t})}).catch(t=>{dt({type:"REJECT",error:t})}),()=>(0,y.xL)(e)},[dt,$,mt]),(0,a.useEffect)(()=>{void 0!==ut&&(!1!==ut?function(){if(U){if(!ut||!wt)return;U((0,y.vS)(ut,wt))}if(f&&tt){if(!(0,y.ci)(ft)||!gt.current)return;tt(ft,gt.current)}}():pt&&(u(!1,pt.toString()),V&&V(pt)))},[ut,wt]);const bt=(0,a.useMemo)(()=>(0,y.ci)(ft)&&mt&&(0,y.ci)(vt)&&(0,y.ci)(wt)?{_className:g,canvasBackground:w,customTextRenderer:M,devicePixelRatio:S,onGetAnnotationsError:O,onGetAnnotationsSuccess:B,onGetStructTreeError:W,onGetStructTreeSuccess:z,onGetTextError:H,onGetTextSuccess:j,onRenderAnnotationLayerError:G,onRenderAnnotationLayerSuccess:q,onRenderError:X,onRenderSuccess:Y,onRenderTextLayerError:K,onRenderTextLayerSuccess:J,page:ut,pageIndex:ft,pageNumber:mt,renderForms:it,renderTextLayer:st,rotate:vt,scale:wt}:null,[g,w,M,S,O,B,W,z,H,j,G,q,X,Y,K,J,ut,ft,mt,it,st,vt,wt]),yt=(0,a.useMemo)(()=>(0,h.Ay)(ht,()=>ut?wt?(0,y.vS)(ut,wt):void 0:ut),[ht,ut,wt]),At="".concat(ft,"@").concat(wt,"/").concat(vt);function _t(){switch(nt){case"custom":return(0,d.A)(k,'renderMode was set to "custom", but no customRenderer was passed.'),(0,r.jsx)(k,{},"".concat(At,"_custom"));case"none":return null;default:return(0,r.jsx)(D,{canvasRef:_},"".concat(At,"_canvas"))}}return(0,r.jsx)("div",(0,s.A)((0,s.A)({className:(0,o.A)(g,E),"data-page-number":mt,ref:c(P,gt),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":"".concat(wt),"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:w||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},yt),{},{children:mt?null===$||void 0===ut||null===ut?(0,r.jsx)(p.A,{type:"loading",children:"function"===typeof R?R():R}):!1===$||!1===ut?(0,r.jsx)(p.A,{type:"error",children:"function"===typeof C?C():C}):function(){if(t=bt,!Boolean(null===t||void 0===t?void 0:t.page))throw new Error("page is undefined");var t;const e="function"===typeof x?x(bt):x;return(0,r.jsxs)(v.Provider,{value:bt,children:[_t(),st?(0,r.jsx)(L,{},"".concat(At,"_text")):null,et?(0,r.jsx)(A,{},"".concat(At,"_annotations")):null,e]})}():(0,r.jsx)(p.A,{type:"no-data",children:"function"===typeof N?N():N})}))}},2683:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},2899:(t,e,i)=>{var n=i(64579),s=i(2316),r=i(90931),a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?h(t.slice(2),i?2:8):a.test(t)?NaN:+t}},3141:(t,e,i)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,s,r,a,o=[],l=!0,h=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){h=!0,s=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(h)throw s}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}i.d(e,{A:()=>s})},7717:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(3141),s=i(94922),r=i(78678);const a=function(t,e){e=Object.assign({},{defaultValue:"defaultValue",value:"value",onChange:"onChange"},e);var i=(0,s.useRef)(e.value in t),a=(0,s.useState)(t[e.defaultValue]),o=(0,n.A)(a,2),l=o[0],h=o[1],c=i.current?t[e.value]:l;return[c,(0,r.A)(function(n){for(var s="function"===typeof n?c=n(c):n,r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(a)),i.current||h(s)})]}},7762:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(94922);function s(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function r(){return(0,n.useReducer)(s,{value:void 0,error:void 0})}},9062:()=>{},12791:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},15032:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},15747:function(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(94922),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return f}});var r=i(155);const a="printWindow";function o(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function l(t,e){if(e||!t){const t=document.getElementById(a);t&&document.body.removeChild(t)}}function h(t){return t instanceof Error?t:new Error("Unknown Error")}function c(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:a,suppressErrors:c}=e;setTimeout(()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),l(r)}if(t.contentWindow.focus(),a)a(t).then(u).catch(t=>{s?s("print",h(t)):o({messages:["An error was thrown by the specified `print` function"],suppressErrors:c})});else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",g=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=g,t.contentDocument&&(t.contentDocument.title=p))}else o({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:c});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)})?setTimeout(u,500):u()}}else o({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:c})},500)}function d(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function u(t,e,i){const n=d(t),s=d(e);if(n.length===s.length)for(let r=0;r<n.length;r++){const t=n[r],e=s[r],a=t.shadowRoot;if(null!==a){const t=e.attachShadow({mode:a.mode});t.innerHTML=a.innerHTML,u(a,t,i)}}else o({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const p='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function g(t,e,i,n){var s,r,a,l,d;const{contentNode:g,clonedContentNode:f,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:w,originalCanvasNodes:b}=i,{bodyClass:y,fonts:A,ignoreGlobalStyles:_,pageStyle:x,nonce:E,suppressErrors:k,copyShadowRoots:M}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(S){const i=S.body.appendChild(f);M&&u(g,i,!!k),A&&((null===(a=t.contentDocument)||void 0===a?void 0:a.fonts)&&(null===(l=t.contentWindow)||void 0===l?void 0:l.FontFace)?A.forEach(i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then(()=>{e(n)}).catch(t=>{e(n,["Failed loading the font:",n,"Load error:",h(t)])})}):(A.forEach(t=>{e(t)}),o({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:k})));const n=null!=x?x:p,s=S.createElement("style");E&&(s.setAttribute("nonce",E),S.head.setAttribute("nonce",E)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),y&&S.body.classList.add(...y.split(" "));const r=S.querySelectorAll("canvas");for(let t=0;t<b.length;++t){const e=b[t],i=r[t];if(void 0===i){o({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:k});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<m.length;t++){const i=m[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,r,a)=>{e(i,["Error loading <img>",i,"Error",a])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<v.length;t++){const i=v[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,r,a,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,r,a)=>{e(i,["Error loading video",i,"Error",a])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const c="select",w=g.querySelectorAll(c),C=S.querySelectorAll(c);for(let t=0;t<w.length;t++)C[t].value=w[t].value;if(!_){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let r="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(r+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){o({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(h(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),E&&e.setAttribute("nonce",E),e.appendChild(S.createTextNode(r)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))o({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(d=i.nodeValue)&&void 0!==d?d:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},E&&t.setAttribute("nonce",E),S.head.appendChild(t)}else o({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===w&&c(t,n)}function f(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:_}=t;const x=(0,r.useCallback)(t=>{function r(){const r={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:d,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:m,onPrintError:v,pageStyle:w,preserveAfterPrint:b,print:y,printIframeProps:A,suppressErrors:_},l=function(t){const e=document.createElement("iframe");return e.width="".concat(document.documentElement.clientWidth,"px"),e.height="".concat(document.documentElement.clientHeight,"px"),e.style.position="absolute",e.style.top="-".concat(document.documentElement.clientHeight+100,"px"),e.style.left="-".concat(document.documentElement.clientWidth+100,"px"),e.id=a,e.srcdoc="<!DOCTYPE html>",t&&(t.allow&&(e.allow=t.allow),void 0!==t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),void 0!==t.sandbox&&(e.sandbox=t.sandbox)),e}(A),h=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:r}=e,a=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&"function"==typeof i?(e&&o({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),i()):e?e.current:void o({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:i,optionalContent:t,suppressErrors:r});if(!a)return;const l=a.cloneNode(!0),h=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),c=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:a,clonedContentNode:l,clonedImgNodes:c,clonedVideoNodes:d,numResourcesToLoad:(s?0:h.length)+c.length+d.length+u,originalCanvasNodes:a.querySelectorAll("canvas")}}(t,r);if(!h)return void o({messages:["There is nothing to print"],suppressErrors:_});const x=function(t,e,i){const{suppressErrors:n}=t,s=[],r=[];return function(a,l){s.includes(a)?o({level:"debug",messages:["Tried to mark a resource that has already been handled",a],suppressErrors:n}):(l?(o({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),r.push(a)):s.push(a),s.length+r.length===e&&c(i,t))}}(r,h.numResourcesToLoad,l);!function(t,e,i,n){t.onload=()=>{g(t,e,i,n)},document.body.appendChild(t)}(l,x,h,r)}l(b,!0),m?m().then(()=>{r()}).catch(t=>{null==v||v("onBeforePrint",h(t))}):r()},[e,i,n,s,d,u,p,f,m,v,w,b,y,_]);return x}return s}())},17402:(t,e,i)=>{"use strict";i.d(e,{A:()=>S});var n=i(89379),s=i(53986),r=i(89261),a=i(94922),o=i(47215),l=Object.prototype.hasOwnProperty;function h(t,e,i){for(i of t.keys())if(c(i,e))return i}function c(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&c(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"===typeof s&&!(s=h(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"===typeof s&&!(s=h(e,s)))return!1;if(!c(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"===typeof t){for(i in n=0,t){if(l.call(t,i)&&++n&&!l.call(e,i))return!1;if(!(i in e)||!c(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}var d=i(78805),u=i(41338),p=i(51938),g=i(64288),f=i(98677),m=i(88648);class v{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHash(){}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,g.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,g.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}goToDestination(t){return new Promise(e=>{(0,g.A)(this.pdfDocument,"PDF document not loaded."),(0,g.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)}).then(t=>{(0,g.A)(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise(t=>{(0,g.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then(e=>{t(e)}).catch(()=>{(0,g.A)(!1,'"'.concat(e,'" is not a valid page reference.'))}):"number"===typeof e?t(e):(0,g.A)(!1,'"'.concat(e,'" is not a valid destination reference.'))}).then(e=>{const i=e+1;(0,g.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,g.A)(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})})})}goToPage(t){const e=t-1;(0,g.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,g.A)(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}goToXY(){}cachePageRef(){}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}executeNamedAction(){}executeSetOCGState(){}isPageVisible(){return!0}isPageCached(){return!0}navigateTo(t){this.goToDestination(t)}}var w=i(60591);const b={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var y=i(7762),A=i(63185);const _=["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate","scale"],x=["url"],{Tm:E}=p,k=(t,e)=>{switch(e){case b.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case b.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function M(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const S=(0,a.forwardRef)(function(t,e){let{children:i,className:l,error:h="Failed to load PDF file.",externalLinkRel:b,externalLinkTarget:S,file:C,inputRef:T,imageResourcesPath:P,loading:R="Loading PDF\u2026",noData:D="No PDF file specified.",onItemClick:L,onLoadError:I,onLoadProgress:F,onLoadSuccess:N,onPassword:O=k,onSourceError:B,onSourceSuccess:W,options:z,renderMode:H,rotate:j,scale:V}=t,U=(0,s.A)(t,_);const[G,q]=(0,y.A)(),{value:X,error:Y}=G,[K,J]=(0,y.A)(),{value:Q,error:Z}=K,$=(0,a.useRef)(new v),tt=(0,a.useRef)([]),et=(0,a.useRef)(void 0),it=(0,a.useRef)(void 0);C&&C!==et.current&&M(C)&&(f(!c(C,et.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),et.current=C),z&&z!==it.current&&(f(!c(z,it.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),it.current=z);const nt=(0,a.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(L)return void L({dest:e,pageIndex:n,pageNumber:i});const s=tt.current[n];s?s.scrollIntoView():f(!1,"An internal link leading to page ".concat(i," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}});(0,a.useImperativeHandle)(e,()=>({linkService:$,pages:tt,viewer:nt}),[]),(0,a.useEffect)(function(){q({type:"RESET"})},[C,q]);const st=(0,a.useCallback)(async()=>{if(!C)return null;if("string"===typeof C){if((0,A.zL)(C)){return{data:(0,A.jA)(C)}}return(0,A.qC)(),{url:C}}if(C instanceof E)return{range:C};if((0,A.mw)(C))return{data:C};if(A.Bd&&(0,A.qf)(C)){return{data:await(0,A.h1)(C)}}if((0,g.A)("object"===typeof C,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,g.A)(M(C),"Invalid parameter object: need either .data, .range or .url"),"url"in C&&"string"===typeof C.url){if((0,A.zL)(C.url)){const{url:t}=C,e=(0,s.A)(C,x),i=(0,A.jA)(t);return(0,n.A)({data:i},e)}(0,A.qC)()}return C},[C]);(0,a.useEffect)(()=>{const t=(0,d.A)(st());return t.promise.then(t=>{q({type:"RESOLVE",value:t})}).catch(t=>{q({type:"REJECT",error:t})}),()=>{(0,A.xL)(t)}},[st,q]),(0,a.useEffect)(()=>{"undefined"!==typeof X&&(!1!==X?W&&W():Y&&(f(!1,Y.toString()),B&&B(Y)))},[X]),(0,a.useEffect)(function(){J({type:"RESET"})},[J,X]),(0,a.useEffect)(function(){if(!X)return;const t=z?(0,n.A)((0,n.A)({},X),z):X,e=p.YE(t);F&&(e.onProgress=F),O&&(e.onPassword=O);const i=e,s=i.promise.then(t=>{J({type:"RESOLVE",value:t})}).catch(t=>{i.destroyed||J({type:"REJECT",error:t})});return()=>{s.finally(()=>i.destroy())}},[z,J,X]),(0,a.useEffect)(()=>{"undefined"!==typeof Q&&(!1!==Q?Q&&(N&&N(Q),tt.current=new Array(Q.numPages),$.current.setDocument(Q)):Z&&(f(!1,Z.toString()),I&&I(Z)))},[Q]),(0,a.useEffect)(function(){$.current.setViewer(nt.current),$.current.setExternalLinkRel(b),$.current.setExternalLinkTarget(S)},[b,S]);const rt=(0,a.useCallback)((t,e)=>{tt.current[t]=e},[]),at=(0,a.useCallback)(t=>{delete tt.current[t]},[]),ot=(0,a.useMemo)(()=>({imageResourcesPath:P,linkService:$.current,onItemClick:L,pdf:Q,registerPage:rt,renderMode:H,rotate:j,scale:V,unregisterPage:at}),[P,L,Q,rt,H,j,V,at]),lt=(0,a.useMemo)(()=>(0,u.Ay)(U,()=>Q),[U,Q]);return(0,r.jsx)("div",(0,n.A)((0,n.A)({className:(0,o.A)("react-pdf__Document",l),ref:T},lt),{},{children:C?void 0===Q||null===Q?(0,r.jsx)(w.A,{type:"loading",children:"function"===typeof R?R():R}):!1===Q?(0,r.jsx)(w.A,{type:"error",children:"function"===typeof h?h():h}):function(){if(t=ot,!Boolean(null===t||void 0===t?void 0:t.pdf))throw new Error("pdf is undefined");var t;const e="function"===typeof i?i(ot):i;return(0,r.jsx)(m.A.Provider,{value:ot,children:e})}():(0,r.jsx)(w.A,{type:"no-data",children:"function"===typeof D?D():D})}))})},19495:(t,e,i)=>{"use strict";function n(t){var e,i,n,r=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,n=Symbol.iterator);r--;){if(i&&null!=(e=t[i]))return e.call(t);if(n&&null!=(e=t[n]))return new s(e.call(t));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function s(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return s=function(t){this.s=t,this.n=t.next},s.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var i=this.s.return;return void 0===i?Promise.resolve({value:t,done:!0}):e(i.apply(this.s,arguments))},throw:function(t){var i=this.s.return;return void 0===i?Promise.reject(t):e(i.apply(this.s,arguments))}},new s(t)}i.d(e,{A:()=>n})},20816:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(82284);function s(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=(0,n.A)(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,n.A)(e)?e:e+""}},36580:(t,e,i)=>{"use strict";i.d(e,{A:()=>z});var n,s=0,r=!1,a=!1,o="[iFrameSizer]",l=null,h=window.requestAnimationFrame,c=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},u=null,p=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){y("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function g(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function f(t,e,i){t.addEventListener(e,i,!1)}function m(t,e,i){t.removeEventListener(e,i,!1)}function v(t){return o+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function w(t){return d[t]?d[t].log:r}function b(t,e){A("log",t,e,w(t))}function y(t,e){A("warn",t,e,!0)}function A(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](v(e),i)}function _(t){function e(){s("Height"),s("Width"),R(function(){P(_),S(E),g("onResized",_)},_,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(d[E]["max"+t]),i=Number(d[E]["min"+t]),n=t.toLowerCase(),s=Number(_[n]);b(E,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,b(E,"Set "+n+" to min value")),s>e&&(s=e,b(E,"Set "+n+" to max value")),_[n]=""+s}function r(t){return v.slice(v.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){D("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=_.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,N[s=e]||(N[s]=setTimeout(function(){N[s]=null,i()},n))}function h(t){var e=t.getBoundingClientRect();return M(E),{x:Math.floor(Number(e.left)+Number(l.x)),y:Math.floor(Number(e.top)+Number(l.y))}}function c(t){var e=t?h(_.iframe):{x:0,y:0},i={x:Number(_.width)+e.x,y:Number(_.height)+e.y};b(E,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(l=i,u(),b(E,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):y(E,"Unable to scroll to requested position, window.parentIFrame not found")}function u(){!1===g("onScroll",l)?C():S(E)}function p(t){var e={};if(0===Number(_.width)&&0===Number(_.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:_.width,y:_.height};g(t,{iframe:_.iframe,screenX:Number(e.x),screenY:Number(e.y),type:_.type})}function g(t,e){return x(E,t,e)}var v=t.data,_={},E=null;"[iFrameResizerChild]Ready"===v?function(){for(var t in d)D("iFrame requested init",L(t),d[t].iframe,t)}():o===(""+v).slice(0,13)&&v.slice(13).split(":")[0]in d?(_=function(){var t=v.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=d[t[0]]&&d[t[0]].iframe,r=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(r)+n(r),width:t[2],type:t[3]}}(),E=_.id,d[E]&&(d[E].loaded=!0),!function(){var t=_.type in{true:1,false:1,undefined:1};return t&&b(E,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return d[t]||(e=!1,y(_.type+" No settings for "+t+". Message was: "+v)),e}(E)&&(b(E,"Received: "+v),function(){var t=!0;return null===_.iframe&&(y(E,"IFrame ("+_.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=d[E]&&d[E].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(b(E,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=d[E]&&d[E].remoteHost;return b(E,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+_.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(d[E]&&d[E].firstRun&&d[E]&&(d[E].firstRun=!1),_.type){case"close":k(_.iframe);break;case"message":t=r(6),b(E,"onMessage passed: {iframe: "+_.iframe.id+", message: "+t+"}"),g("onMessage",{iframe:_.iframe,message:JSON.parse(t)}),b(E,"--");break;case"mouseenter":p("onMouseEnter");break;case"mouseleave":p("onMouseLeave");break;case"autoResize":d[E].autoResize=JSON.parse(r(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":a(d[E]&&d[E].iframe,E),function(){function t(t,n){function s(){d[i]?a(d[i].iframe,i):e()}["scroll","resize"].forEach(function(e){b(i,t+e+" listener for sendPageInfo"),n(window,e,s)})}function e(){t("Remove ",m)}var i=E;t("Add ",f),d[i]&&(d[i].stopPageInfo=e)}();break;case"pageInfoStop":d[E]&&d[E].stopPageInfo&&(d[E].stopPageInfo(),delete d[E].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=h(n);b(E,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),l={x:t.x,y:t.y},u(),b(E,"--")}():window.top===window.self?b(E,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):b(E,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":T(_);break;case"init":e(),g("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?y("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){A("info",t,e,w(t))}(E,"Ignored: "+v)}function x(t,e,i){var n=null,s=null;if(d[t]){if("function"!==typeof(n=d[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function E(t){var e=t.id;delete d[e]}function k(t){var e=t.id;if(!1!==x(e,"onClose",e)){b(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){y(i)}x(e,"onClosed",e),b(e,"--"),E(t),n&&(n.disconnect(),n=null)}else b(e,"Close iframe cancelled by onClose event")}function M(t){null===l&&b(t,"Get page position: "+(l={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+l.y)}function S(t){null!==l&&(window.scrollTo(l.x,l.y),b(t,"Set page position: "+l.x+","+l.y),C())}function C(){l=null}function T(t){b(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),M(t.id),R(function(){P(t),D("reset","reset",t.iframe,t.id)},t,"reset")}function P(t){function e(e){a||"0"!==t[e]||(a=!0,b(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(d[t]&&d[t].iframe.style[e])}function i(t){return null!==t.offsetParent}d[t]&&i(d[t].iframe)&&(e("height")||e("width"))&&D("Visibility change","resize",d[t].iframe,t)}Object.keys(d).forEach(function(e){t(e)})}function e(e){b("window","Mutation observed: "+e[0].target+" "+e[0].type),F(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=g();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",b(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):b("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;d[n]&&(d[n].sizeHeight&&i("height"),d[n].sizeWidth&&i("width"))}function R(t,e,i){i!==e.type&&h&&!window.jasmine?(b(e.id,"Requesting animation frame"),h(t)):t()}function D(t,e,i,n,s){var r=!1;n=n||i.id,d[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=d[n]&&d[n].targetOrigin;b(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(o+e,s)}():y(n,"["+t+"] IFrame("+n+") not found"),s&&d[n]&&d[n].warningTimeout&&(d[n].msgTimeout=setTimeout(function(){!d[n]||d[n].loaded||r||(r=!0,y(n,"IFrame has not responded within "+d[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},d[n].warningTimeout)))}function L(t){return t+":"+d[t].bodyMarginV1+":"+d[t].sizeWidth+":"+d[t].log+":"+d[t].interval+":"+d[t].enablePublicMethods+":"+d[t].autoResize+":"+d[t].bodyMargin+":"+d[t].heightCalculationMethod+":"+d[t].bodyBackground+":"+d[t].bodyPadding+":"+d[t].tolerance+":"+d[t].inPageLinks+":"+d[t].resizeFrom+":"+d[t].widthCalculationMethod+":"+d[t].mouseEvents}function I(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],y(a,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var a=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||p.id+s++;return null!==document.getElementById(t)&&(t+=s++),t}(),r=(e||{}).log,b(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);a in d&&"iFrameResizer"in t?y(a,"Ignored iFrame, already setup."):(!function(e){var n;e=e||{},d[a]=Object.create(null),d[a].iframe=t,d[a].firstRun=!0,d[a].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in p)Object.prototype.hasOwnProperty.call(p,e)&&(d[a][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:p[e])}(e),d[a]&&(d[a].targetOrigin=!0===d[a].checkOrigin?""===(n=d[a].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(e),function(){switch(b(a,"IFrame scrolling "+(d[a]&&d[a].scrolling?"enabled":"disabled")+" for "+a),t.style.overflow=!1===(d[a]&&d[a].scrolling)?"hidden":"auto",d[a]&&d[a].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=d[a]?d[a].scrolling:"no"}}(),function(){function e(e){var i=d[a][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,b(a,"Set "+e+" = "+t.style[e]))}function i(t){if(d[a]["min"+t]>d[a]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(d[a]&&d[a].bodyMargin)&&"0"!==(d[a]&&d[a].bodyMargin)||(d[a].bodyMarginV1=d[a].bodyMargin,d[a].bodyMargin=d[a].bodyMargin+"px"),function(e){var i=g();i&&(n=function(e){if(!t.parentNode)return null;var i=new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&k(t)})})});return i.observe(t.parentNode,{childList:!0}),i}(i)),f(t,"load",function(){D("iFrame.onload",e,t,void 0,!0),function(){var e=d[a]&&d[a].firstRun,i=d[a]&&d[a].heightCalculationMethod in c;!e&&i&&T({iframe:t,height:0,width:0,type:"init"})}()}),D("init",e,t,void 0,!0)}(L(a)),d[a]&&(d[a].iframe.iFrameResizer={close:k.bind(null,d[a].iframe),removeListeners:E.bind(null,d[a].iframe),resize:D.bind(null,"Window resize","resize",d[a].iframe),moveToAnchor:function(t){D("Move to anchor","moveToAnchor:"+t,d[a].iframe,a)},sendMessage:function(t){D("Send Message","message:"+(t=JSON.stringify(t)),d[a].iframe,a)}}))}function F(t,e){null===u&&(u=setTimeout(function(){u=null,t()},e))}var N={};function O(){"hidden"!==document.visibilityState&&(b("document","Trigger event: Visibility change"),F(function(){B("Tab Visible","resize")},16))}function B(t,e){Object.keys(d).forEach(function(i){(function(t){return d[t]&&"parent"===d[t].resizeFrom&&d[t].autoResize&&!d[t].firstRun})(i)&&D(t,e,d[i].iframe,i)})}function W(){f(window,"message",_),f(window,"resize",function(){var t;b("window","Trigger event: "+(t="resize")),F(function(){B("Window "+t,"resize")},16)}),f(document,"visibilitychange",O),f(document,"-webkit-visibilitychange",O)}var z=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),I(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!h;t+=1)h=window[e[t]+"RequestAnimationFrame"];h?h=h.bind(window):b("setup","RequestAnimationFrame not supported")}(),W(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&y("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}()},38930:(t,e,i)=>{"use strict";i.d(e,{ZF:()=>N,lV:()=>S});var n=i(94922),s=i.n(n),r=i(55199),a=i(78678),o=i(68102);const l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};var h=i(80036);const c=n.forwardRef(function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:l}))});const d={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};const u=n.forwardRef(function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:d}))});const p={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};const g=n.forwardRef(function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:p}))});var f=i(54159),m=i.n(f),v=i(20274),w=(i(16052),i(50805)),b=i(26938),y=i.n(b),A=i(73075),_=i.n(A);function x(){return x=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},x.apply(null,arguments)}function E(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const k=["onClick","children","loading"],M=t=>{const[e,i]=(0,n.useState)(!1),s=(0,a.A)(function(){return i(!0),Promise.resolve(t&&t(...arguments)).then(()=>{i(!1)}).catch(t=>{i(!1),console.error(t)})});return{isLoading:e,setIsLoading:i,callback:s}},S=t=>{let{onClick:e,children:i,loading:n}=t,a=E(t,k);const{isLoading:o,callback:l}=M(e);return s().createElement(r.Button,x({},a,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var C="_zIHFy",T="_R-IrF",P="_F1kMl",R="_Iee0d",D="_aGBVE",L="_0oW1K";const I={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},F=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],N=(0,v.createWithIntlProvider)("zh-CN",I,"button-group")(t=>{const{formatMessage:e}=(0,v.useIntl)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:d,cancelText:u,onCancel:p,isModal:g,okText:f,placement:w,children:b,onClick:y,getContainer:A,renderModal:_}=i,k=E(i,F),[S,I]=(0,n.useState)(!1),{isLoading:N,callback:O}=M(y),B=(0,a.A)(()=>{I(!0)}),W=s().createElement(r.Flex,{className:P,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(r.Flex,{align:"flex-start",gap:8,className:R},h&&s().createElement(c,{className:"title-icon"}),o),s().createElement(r.Flex,{align:"flex-start",gap:8,className:m()(D,{[L]:o})},!o&&h?s().createElement(c,{className:"title-icon"}):null,l||e({id:"message"}))),z=()=>"function"===typeof b?b(x({},k,{onClick:B})):s().createElement(r.Button,x({},k,{loading:N,onClick:()=>{B()}}),b);if(g){const t={open:S,onCancel:()=>{I(!1),p&&p()},wrapClassName:T,okText:f||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOk:t=>(I(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:A,children:W};return s().createElement(s().Fragment,null,"function"===typeof _?_(t):s().createElement(r.Modal,t),z())}return s().createElement(r.Popconfirm,{overlayClassName:m()(C),okButtonProps:{danger:h},title:W,open:S,getPopupContainer:A,onCancel:p,placement:w,showCancel:d,okText:f||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOpenChange:I,onConfirm:t=>{O(t)}},z())}),O=_()(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;const a=r?0:["small","middle","large"].indexOf(s.size)>-1?8*(["small","middle","large"].indexOf(s.size)+1):Number.isInteger(s.size)?s.size:8;let o=0,l=0;for(;e>=l+n[o]+o*a&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*a+(o<n.length?i+a:0)&&o>0;)l-=n[o-1],o-=1;return o},t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:r}=t;return"".concat(e).concat(i).concat(n.join(",")).concat(Object.values(s).join(",")).concat(r&&r.toString())});var B={"width-container":"_V58ju","hidden-container":"_XN3o6","hidden-inner":"_-depB","more-link-btn":"_Hh4Wb","menu-list":"_juFTd"};const W=["list","more","moreType","compact","showLength","getPopupContainer","trigger","itemClassName"],z=["className","confirm","buttonComponent","tooltipProps"];(0,v.createWithIntlProvider)("zh-CN",I,"button-group")(t=>{const{formatMessage:e}=(0,v.useIntl)(),i=Object.assign({},t),{list:o,more:l,moreType:h,compact:c,showLength:d,getPopupContainer:p,trigger:f,itemClassName:b}=i,A=E(i,W),_=(0,n.useMemo)(()=>o.filter(t=>!(null!=t&&t.hidden)),[o]),k=y()(A,["size","split","align","style"]),[M,C]=(0,n.useState)(_.length&&1),T=Number.isInteger(d)?d:M,P=(0,a.A)(()=>{const t=D.current,e=L.current,i=R.current;if(!t)return;const s=t.querySelectorAll(".button-group-item");if(!s)return;if(0===s.length)return;const r=i.clientWidth,a=e.clientWidth,o=[].map.call(s,t=>t.offsetWidth),l=O({amountWidth:r,moreBtnWidth:a,buttonWidthList:o,spaceProps:k,compact:c});(0,n.startTransition)(()=>{C(l)})}),R=(0,w.A)(P),D=(0,w.A)(P),L=(0,w.A)(P),I=_.slice(T),F=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:m()("button-group-item",B["btn-item"],b)},{isDropdown:i});const{className:n,confirm:a,buttonComponent:o,tooltipProps:l}=t,h=E(t,z),c=a||h.message,d=o||(c?N:S),u=s().createElement(d,x({danger:c&&!1!==h.isDelete},Object.assign({},h,c&&(h.isModal||i)?{isModal:!0}:{},i?{type:"default"}:{}),{key:e,className:m()("button-group-item",n,b)}));return l?s().createElement(r.Tooltip,l,u):u},H=l||("link"===h?s().createElement(r.Button,{type:"link",className:m()("button-group-item",b,B["more-link-btn"])},s().createElement(u,{style:{fontSize:"16px"}})):s().createElement(r.Button,null,e({id:"more"}),s().createElement(g,null))),j=c?r.Space.Compact:r.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:B["width-container"],ref:R}),s().createElement("div",{className:B["hidden-container"]},s().createElement("div",{className:B["hidden-inner"],ref:L},H),s().createElement("div",{className:B["hidden-inner"],ref:D},s().createElement(j,k,_.map((t,e)=>s().createElement(n.Fragment,{key:e},F(t,e,!1)))))),s().createElement(j,k,_.slice(0,T).map((t,e)=>s().createElement(n.Fragment,{key:e},F(t,e,!1))),I.length>0&&s().createElement(r.Dropdown,{getPopupContainer:p,trigger:f,rootClassName:B["menu-list"],menu:{items:I.map((t,e)=>({key:e,label:F(t,e,!0)}))}},H)))})},41338:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>s});const n=["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onInput","onInvalid","onReset","onSubmit","onLoad","onError","onKeyDown","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onChange","onToggle"];function s(t,e){const i={};for(const s of n){const n=t[s];n&&(i[s]=e?t=>n(t,e(s)):n)}return i}},45816:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},47215:(t,e,i)=>{"use strict";function n(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=n(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}i.d(e,{A:()=>s});const s=function(){for(var t,e,i=0,s="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=n(t))&&(s&&(s+=" "),s+=e);return s}},50805:(t,e,i)=>{"use strict";i.d(e,{A:()=>h});var n=i(94922),s=i(98771),r=i.n(s),a=i(95600),o=i.n(a),l=i(78678);const h=(t,e)=>{const i=(0,n.useRef)(null);i.current=Object.assign({},{time:500,isDebounce:!1},e);const s=(0,n.useRef)(null),a=(0,l.A)(t);return(0,n.useLayoutEffect)(()=>{const t=s.current,e=()=>window.requestAnimationFrame(()=>{t&&a(t)});e();const n=new ResizeObserver((i.current.isDebounce?o():r())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}},[a]),s}},51938:(t,e,i)=>{"use strict";function n(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}i.d(e,{dU:()=>lp,ng:()=>V,EA:()=>Rl,Tm:()=>hc,D6:()=>jh,YE:()=>ec});var s=i(89379);function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(t,e){r(t,e),e.add(t)}function o(t,e,i){r(t,e),e.set(t,i)}function l(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function h(t,e,i){return i(l(t,e))}function c(t,e){return t.get(l(t,e))}function d(t,e,i){return t.set(l(t,e),i),i}var u,p,g,f,m,v,w,b,y,A,_,x,E,k,M,S,C,T,P=i(64467),R=i(19495);const D="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),L=[.001,0,0,.001,0,0],I=1.35,F=1,N=2,O=4,B=16,W=32,z=64,H=128,j=256,V={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},U="pdfjs_internal_editor_",G={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},q={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},X=0,Y=1,K=2,J=3,Q=3,Z=4,$={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},tt={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},et=1,it=2,nt=3,st=4,rt=5,at={ERRORS:0,WARNINGS:1,INFOS:5},ot={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},lt=0,ht=1,ct=2,dt=3;let ut=at.WARNINGS;function pt(t){Number.isInteger(t)&&(ut=t)}function gt(){return ut}function ft(t){ut>=at.INFOS&&console.info("Info: ".concat(t))}function mt(t){ut>=at.WARNINGS&&console.warn("Warning: ".concat(t))}function vt(t){throw new Error(t)}function wt(t,e){t||vt(e)}function bt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(s){}}const n=e?URL.parse(t,e):URL.parse(t);return function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function yt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=URL.parse(t);return n?(n.hash=e,n.href):i&&bt(t,"http://example.com")?t.split("#",1)[0]+"".concat(e?"#".concat(e):""):""}function At(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const _t=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class xt extends _t{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Et extends _t{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class kt extends _t{constructor(t){super(t,"InvalidPDFException")}}class Mt extends _t{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}}class St extends _t{constructor(t){super(t,"FormatError")}}class Ct extends _t{constructor(t){super(t,"AbortException")}}function Tt(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||vt("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const r=Math.min(s+i,e),a=t.subarray(s,r);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function Pt(t){"string"!==typeof t&&vt("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}class Rt{static get isLittleEndian(){return At(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return At(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return At(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get isImageDecoderSupported(){return At(this,"isImageDecoderSupported","undefined"!==typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return At(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return At(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Dt=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class Lt{static makeHexColor(t,e,i){return"#".concat(Dt[t]).concat(Dt[e]).concat(Dt[i])}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=t[i],s=t[i+1];t[i]=n*e[0]+s*e[2]+e[4],t[i+1]=n*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5];for(let h=0;h<6;h+=2){const e=t[i+h],c=t[i+h+1];t[i+h]=e*n+c*r+o,t[i+h+1]=e*s+c*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=t[0],c=t[1],d=t[2],u=t[3];let p=n*h+o,g=p,f=n*d+o,m=f,v=a*c+l,w=v,b=a*u+l,y=b;if(0!==s||0!==r){const t=s*h,e=s*d,i=r*c,n=r*u;p+=i,m+=i,f+=n,g+=n,v+=t,y+=t,b+=e,w+=e}i[0]=Math.min(i[0],p,f,g,m),i[1]=Math.min(i[1],v,b,w,y),i[2]=Math.max(i[2],p,f,g,m),i[3]=Math.max(i[3],v,b,w,y)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],n=t[1],s=t[2],r=t[3],a=i**2+n**2,o=i*s+n*r,l=s**2+r**2,h=(a+l)/2,c=Math.sqrt(h**2-(a*l-o**2));e[0]=Math.sqrt(h+c||1),e[1]=Math.sqrt(h-c||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,s){s[0]=Math.min(s[0],t,i),s[1]=Math.min(s[1],e,n),s[2]=Math.max(s[2],t,i),s[3]=Math.max(s[3],e,n)}static bezierBoundingBox(t,e,i,n,s,r,a,o,h){h[0]=Math.min(h[0],t,a),h[1]=Math.min(h[1],e,o),h[2]=Math.max(h[2],t,a),h[3]=Math.max(h[3],e,o),l(Lt,this,Ft).call(this,t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),h),l(Lt,this,Ft).call(this,t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),h)}}function It(t,e,i,n,s,r,a,o,l,h){if(l<=0||l>=1)return;const c=1-l,d=l*l,u=d*l,p=c*(c*(c*t+3*l*e)+3*d*i)+u*n,g=c*(c*(c*s+3*l*r)+3*d*a)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],g),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],g)}function Ft(t,e,i,n,s,r,a,o,h,c,d,p){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&l(u,this,It).call(this,t,e,i,n,s,r,a,o,-d/c,p));const g=c**2-4*d*h;if(g<0)return;const f=Math.sqrt(g),m=2*h;l(u,this,It).call(this,t,e,i,n,s,r,a,o,(-c+f)/m,p),l(u,this,It).call(this,t,e,i,n,s,r,a,o,(-c-f)/m,p)}u=Lt;let Nt=null,Ot=null;function Bt(){if("function"===typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),Tt(t)}const Wt="pdfjs_internal_id_";function zt(t,e,i){return Math.min(Math.max(t,e),i)}function Ht(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(Tt(t))}"function"!==typeof Promise.try&&(Promise.try=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new Promise(e=>{e(t(...i))})}),"function"!==typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});class jt{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const r=i.name;if("#text"===r)s=i.value;else{if(!jt.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}class Vt{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const t of i.children)t.attributes.value===r.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})})}}static setAttributes(t){let{html:e,element:i,storage:n=null,intent:s,linkService:r}=t;const{attributes:a}=i,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name="".concat(a.name,"-").concat(s));for(const[l,h]of Object.entries(a))if(null!==h&&void 0!==h)switch(l){case"class":h.length&&e.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,h)}o&&r.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,o=t.div;if(o.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);r.append(t),a&&jt.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const h=[[n,-1,r]];for(;h.length>0;){var c,d;const[t,n,r]=h.at(-1);if(n+1===t.children.length){h.pop();continue}const o=t.children[++h.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const p=null!==o&&void 0!==o&&null!==(c=o.attributes)&&void 0!==c&&c.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(r.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)h.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);a&&jt.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Ut="http://www.w3.org/2000/svg";class Gt{}async function qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(Zt(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)})}p=Gt,(0,P.A)(Gt,"CSS",96),(0,P.A)(Gt,"PDF",72),(0,P.A)(Gt,"PDF_TO_CSS_UNITS",p.CSS/p.PDF);class Xt{constructor(t){let{viewBox:e,userUnit:i,scale:n,rotation:s,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}=t;this.viewBox=e,this.userUnit=i,this.scale=n,this.rotation=s,this.offsetX=r,this.offsetY=a,n*=i;const l=(e[2]+e[0])/2,h=(e[3]+e[1])/2;let c,d,u,p,g,f,m,v;switch(s%=360,s<0&&(s+=360),s){case 180:c=-1,d=0,u=0,p=1;break;case 90:c=0,d=1,u=1,p=0;break;case 270:c=0,d=-1,u=-1,p=0;break;case 0:c=1,d=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,p=-p),0===c?(g=Math.abs(h-e[1])*n+r,f=Math.abs(l-e[0])*n+a,m=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(g=Math.abs(l-e[0])*n+r,f=Math.abs(h-e[1])*n+a,m=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[c*n,d*n,u*n,p*n,g-c*n*l-u*n*h,f-d*n*l-p*n*h],this.width=m,this.height=v}get rawDims(){const t=this.viewBox;return At(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Xt({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){const i=[t,e];return Lt.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];Lt.applyTransform(e,this.transform);const i=[t[2],t[3]];return Lt.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return Lt.applyInverseTransform(i,this.transform),i}}class Yt extends _t{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function Kt(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Jt(t){return"string"===typeof t&&/\.pdf$/i.test(t)}class Qt{constructor(){(0,P.A)(this,"started",Object.create(null)),(0,P.A)(this,"times",[])}time(t){t in this.started&&mt("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||mt("Timer has not been started for ".concat(t)),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function Zt(t,e){const i=e?URL.parse(t,e):URL.parse(t);return"http:"===(null===i||void 0===i?void 0:i.protocol)||"https:"===(null===i||void 0===i?void 0:i.protocol)}function $t(t){t.preventDefault()}function te(t){t.preventDefault(),t.stopPropagation()}class ee{static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!==typeof t)return null;l(ee,this,ie)._||(ie._=l(ee,this,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")));const e=l(ee,this,ie)._.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const h=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===h?(r+=c,a+=d):"+"===h&&(r-=c,a-=d),new Date(Date.UTC(i,n,s,r,a,o))}}var ie={_:void 0};function ne(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(mt('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function se(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function re(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform().invertSelf();return[e,i,n,s,r,a]}function ae(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof Xt){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=Rt.isCSSRoundSupported,o="var(--total-scale-factor) * ".concat(n,"px"),l="var(--total-scale-factor) * ".concat(s,"px"),h=a?"round(down, ".concat(o,", var(--scale-round-x))"):"calc(".concat(o,")"),c=a?"round(down, ".concat(l,", var(--scale-round-y))"):"calc(".concat(l,")");i&&e.rotation%180!==0?(r.width=c,r.height=h):(r.width=h,r.height=c)}n&&t.setAttribute("data-main-rotation",e.rotation)}class oe{constructor(){const{pixelRatio:t}=oe;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,r=1/0,a=1/0,o=1/0;(i=oe.capPixels(i,s))>0&&(r=Math.sqrt(i/(t*e))),-1!==n&&(a=n/t,o=n/e);const l=Math.min(r,a,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}const le=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class he{static get isDarkMode(){var t,e;return At(this,"isDarkMode",!(null===(t=window)||void 0===t||null===(e=t.matchMedia)||void 0===e||!e.call(t,"(prefers-color-scheme: dark)").matches))}}function ce(t,e){const i=t[0]/255,n=t[1]/255,s=t[2]/255,r=Math.max(i,n,s),a=Math.min(i,n,s),o=(r+a)/2;if(r===a)e[0]=e[1]=0;else{const t=r-a;switch(e[1]=o<.5?t/(r+a):t/(2-r-a),r){case i:e[0]=60*((n-s)/t+(n<s?6:0));break;case n:e[0]=60*((s-i)/t+2);break;case s:e[0]=60*((i-n)/t+4)}}e[2]=o}function de(t,e){const i=t[0],n=t[1],s=t[2],r=(1-Math.abs(2*s-1))*n,a=r*(1-Math.abs(i/60%2-1)),o=s-r/2;switch(Math.floor(i/60)){case 0:e[0]=r+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=r+o,e[2]=o;break;case 2:e[0]=o,e[1]=r+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=r+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=r+o;break;case 5:case 6:e[0]=r+o,e[1]=o,e[2]=a+o}}function ue(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function pe(t,e,i){de(t,i),i.map(ue);const n=.2126*i[0]+.7152*i[1]+.0722*i[2];de(e,i),i.map(ue);const s=.2126*i[0]+.7152*i[1]+.0722*i[2];return n>s?(n+.05)/(s+.05):(s+.05)/(n+.05)}const ge=new Map;function fe(t,e){let{html:i,dir:n,className:s}=t;const r=document.createDocumentFragment();if("string"===typeof i){const t=document.createElement("p");t.dir=n||"auto";const e=i.split(/(?:\r\n?|\n)/);for(let i=0,n=e.length;i<n;++i){const s=e[i];t.append(document.createTextNode(s)),i<n-1&&t.append(document.createElement("br"))}r.append(t)}else Vt.render({xfaHtml:i,div:r,intent:"richText"});r.firstChild.classList.add("richText",s),e.append(r)}var me=new WeakMap,ve=new WeakMap,we=new WeakMap,be=new WeakMap,ye=new WeakMap,Ae=new WeakMap,_e=new WeakMap,xe=new WeakMap,Ee=new WeakSet;class ke{constructor(t){a(this,Ee),o(this,me,null),o(this,ve,null),o(this,we,void 0),o(this,be,null),o(this,ye,null),o(this,Ae,null),o(this,_e,null),o(this,xe,null),d(we,this,t),Re._||(Re._=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=d(me,this,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=c(we,this)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",$t,{signal:e}),t.addEventListener("pointerdown",Me,{signal:e}));const i=d(be,this,document.createElement("div"));i.className="buttons",t.append(i);const n=c(we,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===c(we,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return t}get div(){return c(me,this)}hide(){var t;c(me,this).classList.add("hidden"),null===(t=c(ve,this))||void 0===t||t.hideDropdown()}show(){var t,e;c(me,this).classList.remove("hidden"),null===(t=c(ye,this))||void 0===t||t.shown(),null===(e=c(Ae,this))||void 0===e||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=c(we,this),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",Re._[t]),l(Ee,this,Te).call(this,i)&&i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),c(be,this).append(i)}async addAltText(t){const e=await t.render();l(Ee,this,Te).call(this,e),c(be,this).append(e,h(Ee,this,Pe)),d(ye,this,t)}addComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(c(Ae,this))return;const i=t.renderForToolbar();if(!i)return;l(Ee,this,Te).call(this,i);const n=d(_e,this,h(Ee,this,Pe));e?(c(be,this).insertBefore(i,e),c(be,this).insertBefore(n,e)):c(be,this).append(i,n),d(Ae,this,t),t.toolbar=this}addColorPicker(t){if(c(ve,this))return;d(ve,this,t);const e=t.renderButton();l(Ee,this,Te).call(this,e),c(be,this).append(e,h(Ee,this,Pe))}async addEditSignatureButton(t){const e=d(xe,this,await t.renderEditButton(c(we,this)));l(Ee,this,Te).call(this,e),c(be,this).append(e,h(Ee,this,Pe))}removeButton(t){var e,i;if("comment"===t)null===(e=c(Ae,this))||void 0===e||e.removeToolbarCommentButton(),d(Ae,this,null),null===(i=c(_e,this))||void 0===i||i.remove(),d(_e,this,null)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e)}}async addButtonBefore(t,e,i){const n=c(be,this).querySelector(i);n&&"comment"===t&&this.addComment(e,n)}updateEditSignatureButton(t){c(xe,this)&&(c(xe,this).title=t)}remove(){var t;c(me,this).remove(),null===(t=c(ve,this))||void 0===t||t.destroy(),d(ve,this,null)}}function Me(t){t.stopPropagation()}function Se(t){c(we,this)._focusEventsAllowed=!1,te(t)}function Ce(t){c(we,this)._focusEventsAllowed=!0,te(t)}function Te(t){const e=c(we,this)._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",l(Ee,this,Se).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",l(Ee,this,Ce).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",$t,{signal:e}),!0)}function Pe(t){const e=document.createElement("div");return e.className="divider",e}var Re={_:null},De=new WeakMap,Le=new WeakMap,Ie=new WeakMap,Fe=new WeakSet;class Ne{constructor(t){a(this,Fe),o(this,De,null),o(this,Le,null),o(this,Ie,void 0),d(Ie,this,t)}show(t,e,i){const[n,s]=l(Fe,this,Be).call(this,e,i),{style:r}=c(Le,this)||d(Le,this,l(Fe,this,Oe).call(this));t.append(c(Le,this)),r.insetInlineEnd="".concat(100*n,"%"),r.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){c(Le,this).remove()}}function Oe(){const t=d(Le,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=c(Ie,this)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",$t,{signal:e});const i=d(De,this,document.createElement("div"));return i.className="buttons",t.append(i),c(Ie,this).hasCommentManager()&&l(Fe,this,We).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{c(Ie,this).commentSelection("floating_button")}),l(Fe,this,We).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{c(Ie,this).highlightSelection("floating_button")}),t}function Be(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const r=s.x+(e?s.width:0);t>i?(n=r,i=t):e?r>n&&(n=r):r<n&&(n=r)}return[e?1-n:n,i]}function We(t,e,i,n){const s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);const r=document.createElement("span");s.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",i);const a=c(Ie,this)._signal;a instanceof AbortSignal&&!a.aborted&&(s.addEventListener("contextmenu",$t,{signal:a}),s.addEventListener("click",n,{signal:a})),c(De,this).append(s)}function ze(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var He=new WeakMap;class je{constructor(){o(this,He,0)}get id(){var t,e;return"".concat(U).concat((d(He,this,(t=c(He,this),e=t++,t)),e))}}var Ve=new WeakMap,Ue=new WeakMap,Ge=new WeakMap,qe=new WeakSet;class Xe{constructor(){a(this,qe),o(this,Ve,Bt()),o(this,Ue,0),o(this,Ge,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return At(this,"_isSVGFittingCanvas",e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return l(qe,this,Ye).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return l(qe,this,Ye).call(this,t,t)}async getFromBlob(t,e){const i=await e;return l(qe,this,Ye).call(this,t,i)}async getFromId(t){c(Ge,this)||d(Ge,this,new Map);const e=c(Ge,this).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){var i,n,s;c(Ge,this)||d(Ge,this,new Map);let r=c(Ge,this).get(t);if(null!==(s=r)&&void 0!==s&&s.bitmap)return r.refCounter+=1,r;const a=new OffscreenCanvas(e.width,e.height);return a.getContext("2d").drawImage(e,0,0),r={bitmap:a.transferToImageBitmap(),id:"image_".concat(c(Ve,this),"_").concat((d(Ue,this,(i=c(Ue,this),n=i++,i)),n)),refCounter:1,isSvg:!1},c(Ge,this).set(t,r),c(Ge,this).set(r.id,r),r}getSvgUrl(t){const e=c(Ge,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){var e;c(Ge,this)||d(Ge,this,new Map);const i=c(Ge,this).get(t);if(!i)return;if(i.refCounter-=1,0!==i.refCounter)return;const{bitmap:n}=i;if(!i.url&&!i.file){const t=new OffscreenCanvas(n.width,n.height);t.getContext("bitmaprenderer").transferFromImageBitmap(n),i.blobPromise=t.convertToBlob()}null===(e=n.close)||void 0===e||e.call(n),i.bitmap=null}isValidId(t){return t.startsWith("image_".concat(c(Ve,this),"_"))}}async function Ye(t,e){var i;c(Ge,this)||d(Ge,this,new Map);let n=c(Ge,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,r;let t;if(n||(n={bitmap:null,id:"image_".concat(c(Ve,this),"_").concat((d(Ue,this,(s=c(Ue,this),r=s++,s)),r)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await qt(e,"blob")):e instanceof File?t=n.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=g._isSVGFittingCanvas,i=new FileReader,s=new Image,r=new Promise((t,r)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=r});i.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(a){mt(a),n=null}return c(Ge,this).set(t,n),n&&c(Ge,this).set(n.id,n),n}g=Xe;var Ke=new WeakMap,Je=new WeakMap,Qe=new WeakMap,Ze=new WeakMap;class $e{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;o(this,Ke,[]),o(this,Je,!1),o(this,Qe,void 0),o(this,Ze,-1),d(Qe,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}=t;if(s&&e(),c(Je,this))return;const l={cmd:e,undo:i,post:n,type:r};if(-1===c(Ze,this))return c(Ke,this).length>0&&(c(Ke,this).length=0),d(Ze,this,0),void c(Ke,this).push(l);if(a&&c(Ke,this)[c(Ze,this)].type===r)return o&&(l.undo=c(Ke,this)[c(Ze,this)].undo),void(c(Ke,this)[c(Ze,this)]=l);const h=c(Ze,this)+1;h===c(Qe,this)?c(Ke,this).splice(0,1):(d(Ze,this,h),h<c(Ke,this).length&&c(Ke,this).splice(h)),c(Ke,this).push(l)}undo(){if(-1===c(Ze,this))return;d(Je,this,!0);const{undo:t,post:e}=c(Ke,this)[c(Ze,this)];t(),null===e||void 0===e||e(),d(Je,this,!1),d(Ze,this,c(Ze,this)-1)}redo(){if(c(Ze,this)<c(Ke,this).length-1){d(Ze,this,c(Ze,this)+1),d(Je,this,!0);const{cmd:t,post:e}=c(Ke,this)[c(Ze,this)];t(),null===e||void 0===e||e(),d(Je,this,!1)}}hasSomethingToUndo(){return-1!==c(Ze,this)}hasSomethingToRedo(){return c(Ze,this)<c(Ke,this).length-1}cleanType(t){if(-1!==c(Ze,this)){for(let e=c(Ze,this);e>=0;e--)if(c(Ke,this)[e].type!==t)return c(Ke,this).splice(e+1,c(Ze,this)-e),void d(Ze,this,e);c(Ke,this).length=0,d(Ze,this,-1)}}destroy(){d(Ke,this,null)}}var ti=new WeakSet;class ei{constructor(t){a(this,ti),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Rt.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(l(ti,this,ii).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||te(e))}}function ii(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}class ni{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ne(n))}e.remove()}(t),At(this,"_colors",t)}convert(t){const e=ne(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((t,i)=>t===e[i]))return ni._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?Lt.makeHexColor(...e):t}}(0,P.A)(ni,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var si=new WeakMap,ri=new WeakMap,ai=new WeakMap,oi=new WeakMap,li=new WeakMap,hi=new WeakMap,ci=new WeakMap,di=new WeakMap,ui=new WeakMap,pi=new WeakMap,gi=new WeakMap,fi=new WeakMap,mi=new WeakMap,vi=new WeakMap,wi=new WeakMap,bi=new WeakMap,yi=new WeakMap,Ai=new WeakMap,_i=new WeakMap,xi=new WeakMap,Ei=new WeakMap,ki=new WeakMap,Mi=new WeakMap,Si=new WeakMap,Ci=new WeakMap,Ti=new WeakMap,Pi=new WeakMap,Ri=new WeakMap,Di=new WeakMap,Li=new WeakMap,Ii=new WeakMap,Fi=new WeakMap,Ni=new WeakMap,Oi=new WeakMap,Bi=new WeakMap,Wi=new WeakMap,zi=new WeakMap,Hi=new WeakMap,ji=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Gi=new WeakMap,qi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,Ki=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,Zi=new WeakMap,$i=new WeakSet;class tn{static get _keyboardManager(){const t=tn.prototype,e=t=>c(Ki,t).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return At(this,"_keyboardManager",new ei([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&c(Ki,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&c(Ki,t).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,r,h,u,p,g,f,m,v,w,b,y){a(this,$i),o(this,si,new AbortController),o(this,ri,null),o(this,ai,null),o(this,oi,new Map),o(this,li,new Map),o(this,hi,null),o(this,ci,null),o(this,di,null),o(this,ui,new $e),o(this,pi,null),o(this,gi,null),o(this,fi,null),o(this,mi,0),o(this,vi,new Set),o(this,wi,null),o(this,bi,null),o(this,yi,new Set),(0,P.A)(this,"_editorUndoBar",null),o(this,Ai,!1),o(this,_i,!1),o(this,xi,!1),o(this,Ei,null),o(this,ki,null),o(this,Mi,null),o(this,Si,null),o(this,Ci,!1),o(this,Ti,null),o(this,Pi,new je),o(this,Ri,!1),o(this,Di,!1),o(this,Li,!1),o(this,Ii,null),o(this,Fi,null),o(this,Ni,null),o(this,Oi,null),o(this,Bi,null),o(this,Wi,G.NONE),o(this,zi,new Set),o(this,Hi,null),o(this,ji,null),o(this,Vi,null),o(this,Ui,null),o(this,Gi,null),o(this,qi,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),o(this,Xi,[0,0]),o(this,Yi,null),o(this,Ki,null),o(this,Ji,null),o(this,Qi,null),o(this,Zi,null);const A=this._signal=c(si,this).signal;d(Ki,this,t),d(Ji,this,e),d(Qi,this,i),d(hi,this,n),d(pi,this,s),d(ji,this,r),d(Gi,this,u),this._eventBus=h,h._on("editingaction",this.onEditingAction.bind(this),{signal:A}),h._on("pagechanging",this.onPageChanging.bind(this),{signal:A}),h._on("scalechanging",this.onScaleChanging.bind(this),{signal:A}),h._on("rotationchanging",this.onRotationChanging.bind(this),{signal:A}),h._on("setpreference",this.onSetPreference.bind(this),{signal:A}),h._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:A}),window.addEventListener("pointerdown",()=>{d(Di,this,!0)},{capture:!0,signal:A}),window.addEventListener("pointerup",()=>{d(Di,this,!1)},{capture:!0,signal:A}),l($i,this,on).call(this),l($i,this,gn).call(this),l($i,this,cn).call(this),d(ci,this,u.annotationStorage),d(Ei,this,u.filterFactory),d(Vi,this,p),d(Si,this,g||null),d(Ai,this,f),d(_i,this,m),d(xi,this,v),d(Bi,this,w||null),this.viewParameters={realScale:Gt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=b||null,this._supportsPinchToZoom=!1!==y,null===s||void 0===s||s.setSidebarUiManager(this)}destroy(){var t,e,i,n,s,r,a,o,l;null===(t=c(Zi,this))||void 0===t||t.resolve(),d(Zi,this,null),null===(e=c(si,this))||void 0===e||e.abort(),d(si,this,null),this._signal=null;for(const h of c(li,this).values())h.destroy();c(li,this).clear(),c(oi,this).clear(),c(yi,this).clear(),null===(i=c(Oi,this))||void 0===i||i.clear(),d(ri,this,null),c(zi,this).clear(),c(ui,this).destroy(),null===(n=c(hi,this))||void 0===n||n.destroy(),null===(s=c(pi,this))||void 0===s||s.destroy(),null===(r=c(ji,this))||void 0===r||r.destroy(),null===(a=c(Ti,this))||void 0===a||a.hide(),d(Ti,this,null),null===(o=c(Ni,this))||void 0===o||o.destroy(),d(Ni,this,null),d(ai,this,null),c(ki,this)&&(clearTimeout(c(ki,this)),d(ki,this,null)),c(Yi,this)&&(clearTimeout(c(Yi,this)),d(Yi,this,null)),null===(l=this._editorUndoBar)||void 0===l||l.destroy(),d(Gi,this,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return c(Bi,this)}get useNewAltTextFlow(){return c(_i,this)}get useNewAltTextWhenAddingImage(){return c(xi,this)}get hcmFilter(){return At(this,"hcmFilter",c(Vi,this)?c(Ei,this).addHCMFilter(c(Vi,this).foreground,c(Vi,this).background):"none")}get direction(){return At(this,"direction",getComputedStyle(c(Ki,this)).direction)}get _highlightColors(){return At(this,"_highlightColors",c(Si,this)?new Map(c(Si,this).split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return At(this,"highlightColors",null);const e=new Map,i=!!c(Vi,this);for(const[n,s]of t){const t=n.endsWith("_HCM");i&&t?e.set(n.replace("_HCM",""),s):i||t||e.set(n,s)}return At(this,"highlightColors",e)}get highlightColorNames(){return At(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),d(fi,this,t)}setMainHighlightColorPicker(t){d(Ni,this,t)}editAltText(t){var e;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(e=c(hi,this))||void 0===e||e.editAltText(this,t,i)}hasCommentManager(){return!!c(pi,this)}editComment(t,e,i,n){var s;null===(s=c(pi,this))||void 0===s||s.showDialog(this,t,e,i,n)}selectComment(t,e){const i=c(li,this).get(t),n=null===i||void 0===i?void 0:i.getEditorByUID(e);null===n||void 0===n||n.toggleComment(!0,!0)}updateComment(t){var e;null===(e=c(pi,this))||void 0===e||e.updateComment(t.getData())}updatePopupColor(t){var e;null===(e=c(pi,this))||void 0===e||e.updatePopupColor(t)}removeComment(t){var e;null===(e=c(pi,this))||void 0===e||e.removeComments([t.uid])}toggleComment(t,e){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;null===(i=c(pi,this))||void 0===i||i.toggleCommentPopup(t,e,n)}makeCommentColor(t,e){var i;return t&&(null===(i=c(pi,this))||void 0===i?void 0:i.makeCommentColor(t,e))||null}getCommentDialogElement(){var t;return(null===(t=c(pi,this))||void 0===t?void 0:t.dialogElement)||null}async waitForEditorsRendered(t){if(c(li,this).has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),n=i=>{i.pageNumber===t&&(this._eventBus._off("editorsrendered",n),e())};this._eventBus.on("editorsrendered",n),await i}getSignature(t){var e;null===(e=c(ji,this))||void 0===e||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return c(ji,this)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference(t){let{name:e,value:i}=t;if("enableNewAltTextWhenAddingImage"===e)d(xi,this,i)}onPageChanging(t){let{pageNumber:e}=t;d(mi,this,e-1)}focusMainContainer(){c(Ki,this).focus()}findParent(t,e){for(const i of c(li,this).values()){const{x:n,y:s,width:r,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+r&&e>=s&&e<=s+a)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];c(Ji,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){c(yi,this).add(t)}removeShouldRescale(t){c(yi,this).delete(t)}onScaleChanging(t){var e;let{scale:i}=t;this.commitOrRemove(),this.viewParameters.realScale=i*Gt.PDF_TO_CSS_UNITS;for(const n of c(yi,this))n.onScaleChanging();null===(e=c(fi,this))||void 0===e||e.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a}=i,o=i.toString(),h=l($i,this,en).call(this,i).closest(".textLayer"),d=this.getSelectionBoxes(h);if(!d)return;i.empty();const u=l($i,this,nn).call(this,h),p=c(Wi,this)===G.NONE,g=()=>{const i=null===u||void 0===u?void 0:u.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a,text:o});p&&this.showAllEditors("highlight",!0,!0),e&&(null===i||void 0===i||i.editComment())};p?this.switchToMode(G.HIGHLIGHT,g):g()}commentSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.highlightSelection(t,!0)}getAndRemoveDataFromAnnotationStorage(t){if(!c(ci,this))return null;const e="".concat(U).concat(t),i=c(ci,this).getRawValue(e);return i&&c(ci,this).remove(e),i}addToAnnotationStorage(t){t.isEmpty()||!c(ci,this)||c(ci,this).has(t.id)||c(ci,this).setValue(t.id,t)}a11yAlert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=c(Qi,this);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,c(Ci,this)&&(d(Ci,this,!1),l($i,this,an).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of c(zi,this))if(e.div.contains(t)){d(Fi,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!c(Fi,this))return;const[t,e]=c(Fi,this);d(Fi,this,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){l($i,this,cn).call(this),l($i,this,un).call(this)}removeEditListeners(){l($i,this,dn).call(this),l($i,this,pn).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of c(bi,this))if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of c(bi,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=c(ri,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of c(zi,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of c(bi,this))if(t.isHandlingMimeForPasting(r.type))return void t.paste(r,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void mt('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=await n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)l($i,this,bn).call(this,e);l($i,this,_n).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){mt('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),c(Wi,this)===G.NONE||this.isEditorHandlingKeyboard||tn._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,c(Ci,this)&&(d(Ci,this,!1),l($i,this,an).call(this,"main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}setEditingState(t){t?(l($i,this,ln).call(this),l($i,this,un).call(this),l($i,this,fn).call(this,{isEditing:c(Wi,this)!==G.NONE,isEmpty:l($i,this,An).call(this),hasSomethingToUndo:c(ui,this).hasSomethingToUndo(),hasSomethingToRedo:c(ui,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(l($i,this,hn).call(this),l($i,this,pn).call(this),l($i,this,fn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!c(bi,this)){d(bi,this,t);for(const t of c(bi,this))l($i,this,mn).call(this,t.defaultPropertiesToUpdate)}}getId(){return c(Pi,this).id}get currentLayer(){return c(li,this).get(c(mi,this))}getLayer(t){return c(li,this).get(t)}get currentPageIndex(){return c(mi,this)}addLayer(t){c(li,this).set(t.pageIndex,t),c(Ri,this)?t.enable():t.disable()}removeLayer(t){c(li,this).delete(t.pageIndex)}async updateMode(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(c(Wi,this)!==t&&(!c(Zi,this)||(await c(Zi,this).promise,c(Zi,this)))){var o,h;if(d(Zi,this,Promise.withResolvers()),null===(e=c(fi,this))||void 0===e||e.commitOrRemove(),c(Wi,this)===G.POPUP)null===(o=c(pi,this))||void 0===o||o.hideSidebar();if(null===(i=c(pi,this))||void 0===i||i.destroyPopup(),d(Wi,this,t),t===G.NONE){var u;this.setEditingState(!1),l($i,this,wn).call(this);for(const t of c(oi,this).values())t.hideStandaloneCommentButton();return null===(u=this._editorUndoBar)||void 0===u||u.hide(),this.toggleComment(null),void c(Zi,this).resolve()}for(const t of c(oi,this).values())t.addStandaloneCommentButton();if(t===G.SIGNATURE)await(null===(h=c(ji,this))||void 0===h?void 0:h.loadSignatures());this.setEditingState(!0),await l($i,this,vn).call(this),this.unselectAll();for(const e of c(li,this).values())e.updateMode(t);if(t===G.POPUP){var p;c(ai,this)||d(ai,this,await c(Gi,this).getAnnotationsByType(new Set(c(bi,this).map(t=>t._editorType))));const t=new Set,e=[];for(const i of c(oi,this).values()){const{annotationElementId:n,hasComment:s,deleted:r}=i;n&&t.add(n),s&&!r&&e.push(i.getData())}for(const i of c(ai,this)){const{id:n,popupRef:s,contentsObj:r}=i;s&&null!==r&&void 0!==r&&r.str&&!t.has(n)&&!c(vi,this).has(n)&&e.push(i)}null===(p=c(pi,this))||void 0===p||p.showSidebar(e)}if(!n)return s&&this.addNewEditorFromKeyboard(),void c(Zi,this).resolve();for(const t of c(oi,this).values())t.uid===n?(this.setSelected(t),a?t.editComment():r?t.enterInEditMode():t.focus()):t.unselect();c(Zi,this).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==c(Wi,this)&&this._eventBus.dispatch("switchannotationeditormode",(0,s.A)({source:this},t))}updateParams(t,e){if(c(bi,this)){switch(t){case q.CREATE:return void this.currentLayer.addNewEditor(e);case q.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(c(Ui,this)||d(Ui,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(const i of c(zi,this))i.updateParams(t,e);else for(const i of c(bi,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of c(oi,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=c(Ui,this))||void 0===n?void 0:n.get(q.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&l($i,this,mn).call(this,[[q.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(c(Li,this)!==t){d(Li,this,t);for(const e of c(li,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}*getEditors(t){for(const e of c(oi,this).values())e.pageIndex===t&&(yield e)}getEditor(t){return c(oi,this).get(t)}addEditor(t){c(oi,this).set(t.id,t)}removeEditor(t){var e,i;(t.div.contains(document.activeElement)&&(c(ki,this)&&clearTimeout(c(ki,this)),d(ki,this,setTimeout(()=>{this.focusMainContainer(),d(ki,this,null)},0))),c(oi,this).delete(t.id),t.annotationElementId)&&(null===(e=c(Oi,this))||void 0===e||e.delete(t.annotationElementId));(this.unselect(t),t.annotationElementId&&c(vi,this).has(t.annotationElementId))||(null===(i=c(ci,this))||void 0===i||i.remove(t.id))}addDeletedAnnotationElement(t){c(vi,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return c(vi,this).has(t)}removeDeletedAnnotationElement(t){c(vi,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){c(ri,this)!==t&&(d(ri,this,t),t&&l($i,this,mn).call(this,t.propertiesToUpdate))}updateUI(t){h($i,this,yn)===t&&l($i,this,mn).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){l($i,this,mn).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(c(zi,this).has(t))return c(zi,this).delete(t),t.unselect(),void l($i,this,fn).call(this,{hasSelectedEditor:this.hasSelection});c(zi,this).add(t),t.select(),l($i,this,mn).call(this,t.propertiesToUpdate),l($i,this,fn).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),null===(e=c(fi,this))||void 0===e||e.commitOrRemove();for(const i of c(zi,this))i!==t&&i.unselect();c(zi,this).clear(),c(zi,this).add(t),t.select(),l($i,this,mn).call(this,t.propertiesToUpdate),l($i,this,fn).call(this,{hasSelectedEditor:!0})}isSelected(t){return c(zi,this).has(t)}get firstSelectedEditor(){return c(zi,this).values().next().value}unselect(t){t.unselect(),c(zi,this).delete(t),l($i,this,fn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==c(zi,this).size}get isEnterHandled(){return 1===c(zi,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){var t;c(ui,this).undo(),l($i,this,fn).call(this,{hasSomethingToUndo:c(ui,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:l($i,this,An).call(this)}),null===(t=this._editorUndoBar)||void 0===t||t.hide()}redo(){c(ui,this).redo(),l($i,this,fn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:c(ui,this).hasSomethingToRedo(),isEmpty:l($i,this,An).call(this)})}addCommands(t){c(ui,this).add(t),l($i,this,fn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:l($i,this,An).call(this)})}cleanUndoStack(t){c(ui,this).cleanType(t)}delete(){var t;this.commitOrRemove();const e=null===(t=this.currentLayer)||void 0===t?void 0:t.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const i=e?[e]:[...c(zi,this)],n=()=>{for(const t of i)l($i,this,bn).call(this,t)};this.addCommands({cmd:()=>{var t;null===(t=this._editorUndoBar)||void 0===t||t.show(n,1===i.length?i[0].editorType:i.length);for(const e of i)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){var t;null===(t=c(ri,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return c(ri,this)||this.hasSelection}selectAll(){for(const t of c(zi,this))t.commit();l($i,this,_n).call(this,c(oi,this).values())}unselectAll(){var t;if((!c(ri,this)||(c(ri,this).commitOrRemove(),c(Wi,this)===G.NONE))&&(null===(t=c(fi,this))||void 0===t||!t.commitOrRemove())&&this.hasSelection){for(const t of c(zi,this))t.unselect();c(zi,this).clear(),l($i,this,fn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;c(Xi,this)[0]+=t,c(Xi,this)[1]+=e;const[i,n]=c(Xi,this),s=[...c(zi,this)];c(Yi,this)&&clearTimeout(c(Yi,this)),d(Yi,this,setTimeout(()=>{d(Yi,this,null),c(Xi,this)[0]=c(Xi,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)c(oi,this).has(t.id)&&(t.translateInPage(i,n),t.translationDone())},undo:()=>{for(const t of s)c(oi,this).has(t.id)&&(t.translateInPage(-i,-n),t.translationDone())},mustExec:!1})},1e3));for(const r of s)r.translateInPage(t,e),r.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),d(wi,this,new Map);for(const t of c(zi,this))c(wi,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!c(wi,this))return!1;this.disableUserSelect(!1);const t=c(wi,this);d(wi,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:r},a]of t)a.newX=n,a.newY=s,a.newPageIndex=r,e||(e=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if(c(oi,this).has(t.id)){const s=c(li,this).get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:r}]of t)i(e,n,s,r)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:r}]of t)i(e,n,s,r)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(c(wi,this))for(const i of c(wi,this).keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===c(zi,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return c(ri,this)===t}getActive(){return c(ri,this)}getMode(){return c(Wi,this)}isEditingMode(){return c(Wi,this)!==G.NONE}get imageManager(){return At(this,"imageManager",new Xe)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,h=e.rangeCount;l<h;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/r,y:1-(t+a-i)/s,width:o/r,height:a/s});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/s,y:1-(e+o-n)/r,width:a/s,height:o/r});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/r,y:(t-i)/s,width:o/r,height:a/s});break;default:a=(t,e,a,o)=>({x:(t-i)/s,y:(e-n)/r,width:a/s,height:o/r})}const o=[];for(let l=0,h=e.rangeCount;l<h;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(a(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(c(di,this)||d(di,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=c(di,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=c(di,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=c(ci,this).getRawValue(i);n&&(c(Wi,this)!==G.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}setMissingCanvas(t,e,i){var n;const s=null===(n=c(Oi,this))||void 0===n?void 0:n.get(t);s&&(s.setCanvas(e,i),c(Oi,this).delete(t))}addMissingCanvas(t,e){(c(Oi,this)||d(Oi,this,new Map)).set(t,e)}}function en(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function nn(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of c(li,this).values())if(i.hasTextLayer(t))return i;return null}function sn(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=l($i,this,en).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(c(Ti,this)||d(Ti,this,new Ne(this)),c(Ti,this).show(e,i,"ltr"===this.direction))}function rn(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if(c(Hi,this))null===(i=c(Ti,this))||void 0===i||i.hide(),d(Hi,this,null),l($i,this,fn).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===c(Hi,this))return;const s=l($i,this,en).call(this,e).closest(".textLayer");var r;if(s){if(null===(t=c(Ti,this))||void 0===t||t.hide(),d(Hi,this,n),l($i,this,fn).call(this,{hasSelectedText:!0}),(c(Wi,this)===G.HIGHLIGHT||c(Wi,this)===G.NONE)&&(c(Wi,this)===G.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),d(Ci,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=c(Wi,this)===G.HIGHLIGHT?l($i,this,nn).call(this,s):null;if(null===t||void 0===t||t.toggleDrawing(),c(Di,this)){const e=new AbortController,i=this.combinedSignal(e),n=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),null===t||void 0===t||t.toggleDrawing(!0),"pointerup"===i.type&&l($i,this,an).call(this,"main_toolbar"))};window.addEventListener("pointerup",n,{signal:i}),window.addEventListener("blur",n,{signal:i})}else null===t||void 0===t||t.toggleDrawing(!0),l($i,this,an).call(this,"main_toolbar")}}else c(Hi,this)&&(null===(r=c(Ti,this))||void 0===r||r.hide(),d(Hi,this,null),l($i,this,fn).call(this,{hasSelectedText:!1}))}function an(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";c(Wi,this)===G.HIGHLIGHT?this.highlightSelection(t):c(Ai,this)&&l($i,this,sn).call(this)}function on(){document.addEventListener("selectionchange",l($i,this,rn).bind(this),{signal:this._signal})}function ln(){if(c(Mi,this))return;d(Mi,this,new AbortController);const t=this.combinedSignal(c(Mi,this));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}function hn(){var t;null===(t=c(Mi,this))||void 0===t||t.abort(),d(Mi,this,null)}function cn(){if(c(Ii,this))return;d(Ii,this,new AbortController);const t=this.combinedSignal(c(Ii,this));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}function dn(){var t;null===(t=c(Ii,this))||void 0===t||t.abort(),d(Ii,this,null)}function un(){if(c(gi,this))return;d(gi,this,new AbortController);const t=this.combinedSignal(c(gi,this));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}function pn(){var t;null===(t=c(gi,this))||void 0===t||t.abort(),d(gi,this,null)}function gn(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function fn(t){Object.entries(t).some(t=>{let[e,i]=t;return c(qi,this)[e]!==i})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(c(qi,this),t)}),c(Wi,this)===G.HIGHLIGHT&&!1===t.hasSelectedEditor&&l($i,this,mn).call(this,[[q.HIGHLIGHT_FREE,!0]]))}function mn(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}async function vn(){if(!c(Ri,this)){d(Ri,this,!0);const t=[];for(const e of c(li,this).values())t.push(e.enable());await Promise.all(t);for(const e of c(oi,this).values())e.enable()}}function wn(){if(this.unselectAll(),c(Ri,this)){d(Ri,this,!1);for(const t of c(li,this).values())t.disable();for(const t of c(oi,this).values())t.disable()}}function bn(t){const e=c(li,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function yn(t){let e=null;for(e of c(zi,t));return e}function An(){if(0===c(oi,this).size)return!0;if(1===c(oi,this).size)for(const t of c(oi,this).values())return t.isEmpty();return!1}function _n(t){for(const e of c(zi,this))e.unselect();c(zi,this).clear();for(const e of t)e.isEmpty()||(c(zi,this).add(e),e.select());l($i,this,fn).call(this,{hasSelectedEditor:this.hasSelection})}(0,P.A)(tn,"TRANSLATE_SMALL",1),(0,P.A)(tn,"TRANSLATE_BIG",10);var xn=new WeakMap,En=new WeakMap,kn=new WeakMap,Mn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,Tn=new WeakMap,Pn=new WeakMap,Rn=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,In=new WeakMap,Fn=new WeakSet;class Nn{constructor(t){a(this,Fn),o(this,xn,null),o(this,En,!1),o(this,kn,null),o(this,Mn,null),o(this,Sn,null),o(this,Cn,null),o(this,Tn,!1),o(this,Pn,null),o(this,Rn,null),o(this,Dn,null),o(this,Ln,null),o(this,In,!1),d(Rn,this,t),d(In,this,t._uiManager.useNewAltTextFlow),Wn._||(Wn._=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){var e;null!==(e=Nn._l10n)&&void 0!==e||(Nn._l10n=t)}async render(){const t=d(kn,this,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=d(Mn,this,document.createElement("span"));t.append(e),c(In,this)?(t.classList.add("new"),t.setAttribute("data-l10n-id",Wn._.missing),e.setAttribute("data-l10n-id",Wn._["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=c(Rn,this)._uiManager._signal;t.addEventListener("contextmenu",$t,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),c(Rn,this)._uiManager.editAltText(c(Rn,this)),c(In,this)&&c(Rn,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:h(Fn,this,On)}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(d(Tn,this,!0),n(e))},{signal:i}),await l(Fn,this,Bn).call(this),t}finish(){c(kn,this)&&(c(kn,this).focus({focusVisible:c(Tn,this)}),d(Tn,this,!1))}isEmpty(){return c(In,this)?null===c(xn,this):!c(xn,this)&&!c(En,this)}hasData(){return c(In,this)?null!==c(xn,this)||!!c(Dn,this):this.isEmpty()}get guessedText(){return c(Dn,this)}async setGuessedText(t){null===c(xn,this)&&(d(Dn,this,t),d(Ln,this,await Nn._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),l(Fn,this,Bn).call(this))}toggleAltTextBadge(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e;if(!c(In,this)||c(xn,this))return null===(e=c(Pn,this))||void 0===e||e.remove(),void d(Pn,this,null);if(!c(Pn,this)){const t=d(Pn,this,document.createElement("div"));t.className="noAltTextBadge",c(Rn,this).div.append(t)}c(Pn,this).classList.toggle("hidden",!t)}serialize(t){let e=c(xn,this);return t||c(Dn,this)!==e||(e=c(Ln,this)),{altText:e,decorative:c(En,this),guessedText:c(Dn,this),textWithDisclaimer:c(Ln,this)}}get data(){return{altText:c(xn,this),decorative:c(En,this)}}set data(t){let{altText:e,decorative:i,guessedText:n,textWithDisclaimer:s,cancel:r=!1}=t;n&&(d(Dn,this,n),d(Ln,this,s)),c(xn,this)===e&&c(En,this)===i||(r||(d(xn,this,e),d(En,this,i)),l(Fn,this,Bn).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];c(kn,this)&&(!t&&c(Cn,this)&&(clearTimeout(c(Cn,this)),d(Cn,this,null)),c(kn,this).disabled=!t)}shown(){c(Rn,this)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:h(Fn,this,On)}})}destroy(){var t,e;null===(t=c(kn,this))||void 0===t||t.remove(),d(kn,this,null),d(Mn,this,null),d(Sn,this,null),null===(e=c(Pn,this))||void 0===e||e.remove(),d(Pn,this,null)}}function On(t){return(c(xn,t)?"added":null===c(xn,t)&&t.guessedText&&"review")||"missing"}async function Bn(){const t=c(kn,this);if(!t)return;if(c(In,this)){var e,i;if(t.classList.toggle("done",!!c(xn,this)),t.setAttribute("data-l10n-id",Wn._[h(Fn,this,On)]),null===(e=c(Mn,this))||void 0===e||e.setAttribute("data-l10n-id",Wn._["".concat(h(Fn,this,On),"-label")]),!c(xn,this))return void(null===(i=c(Sn,this))||void 0===i||i.remove())}else{var n;if(!c(xn,this)&&!c(En,this))return t.classList.remove("done"),void(null===(n=c(Sn,this))||void 0===n||n.remove());t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let s=c(Sn,this);if(!s){d(Sn,this,s=document.createElement("span")),s.className="tooltip",s.setAttribute("role","tooltip"),s.id="alt-text-tooltip-".concat(c(Rn,this).id);const e=100,i=c(Rn,this)._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(c(Cn,this)),d(Cn,this,null)},{once:!0}),t.addEventListener("mouseenter",()=>{d(Cn,this,setTimeout(()=>{d(Cn,this,null),c(Sn,this).classList.add("show"),c(Rn,this)._reportTelemetry({action:"alt_text_tooltip"})},e))},{signal:i}),t.addEventListener("mouseleave",()=>{var t;c(Cn,this)&&(clearTimeout(c(Cn,this)),d(Cn,this,null)),null===(t=c(Sn,this))||void 0===t||t.classList.remove("show")},{signal:i})}c(En,this)?s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(s.removeAttribute("data-l10n-id"),s.textContent=c(xn,this)),s.parentNode||t.append(s);const r=c(Rn,this).getElementForAltText();null===r||void 0===r||r.setAttribute("aria-describedby",s.id)}var Wn={_:null};(0,P.A)(Nn,"_l10n",null);var zn=new WeakMap,Hn=new WeakMap,jn=new WeakMap,Vn=new WeakMap,Un=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,Jn=new WeakSet;class Qn{constructor(t){a(this,Jn),o(this,zn,null),o(this,Hn,null),o(this,jn,!1),o(this,Vn,null),o(this,Un,null),o(this,Gn,null),o(this,qn,null),o(this,Xn,null),o(this,Yn,!1),o(this,Kn,null),d(Vn,this,t)}renderForToolbar(){const t=d(Hn,this,document.createElement("button"));return t.className="comment",l(Jn,this,Zn).call(this,t,!1)}renderForStandalone(){const t=d(zn,this,document.createElement("button"));t.className="annotationCommentButton";const e=c(Vn,this).commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd="calc(".concat(100*("ltr"===c(Vn,this)._uiManager.direction?1-e[0]:e[0]),"% - var(--comment-button-dim))"),i.top="calc(".concat(100*e[1],"% - var(--comment-button-dim))");const n=c(Vn,this).commentButtonColor;n&&(i.backgroundColor=n)}return l(Jn,this,Zn).call(this,t,!0)}focusButton(){setTimeout(()=>{var t,e;null===(t=null!==(e=c(zn,this))&&void 0!==e?e:c(Hn,this))||void 0===t||t.focus()},0)}onUpdatedColor(){if(!c(zn,this))return;const t=c(Vn,this).commentButtonColor;t&&(c(zn,this).style.backgroundColor=t),c(Vn,this)._uiManager.updatePopupColor(c(Vn,this))}get commentButtonWidth(){var t,e;return(null!==(t=null===(e=c(zn,this))||void 0===e?void 0:e.getBoundingClientRect().width)&&void 0!==t?t:0)/c(Vn,this).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(c(Kn,this))return c(Kn,this);if(!c(zn,this))return null;const{x:t,y:e,height:i}=c(zn,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=c(Vn,this).parent.boundingClientRect;return[(t-n)/r,(e+i-s)/a]}set commentPopupPositionInLayer(t){d(Kn,this,t)}hasDefaultPopupPosition(){return null===c(Kn,this)}removeStandaloneCommentButton(){var t;null===(t=c(zn,this))||void 0===t||t.remove(),d(zn,this,null)}removeToolbarCommentButton(){var t;null===(t=c(Hn,this))||void 0===t||t.remove(),d(Hn,this,null)}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;c(zn,this)&&(c(zn,this).classList.toggle("selected",e),c(zn,this).ariaExpanded=i)}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=c(Vn,this).commentButtonPosition;const{width:t,height:e,x:s,y:r}=c(Vn,this);i=s+i*t,n=r+n*e}const r=c(Vn,this).parent.boundingClientRect,{x:a,y:o,width:l,height:h}=r;c(Vn,this)._uiManager.editComment(c(Vn,this),a+i*l,o+n*h,(0,s.A)((0,s.A)({},t),{},{parentDimensions:r}))}finish(){c(Hn,this)&&(c(Hn,this).focus({focusVisible:c(jn,this)}),d(jn,this,!1))}isDeleted(){return c(Yn,this)||""===c(qn,this)}isEmpty(){return null===c(qn,this)}hasBeenEdited(){return this.isDeleted()||c(qn,this)!==c(Un,this)}serialize(){return this.data}get data(){return{text:c(qn,this),richText:c(Gn,this),date:c(Xn,this),deleted:this.isDeleted()}}set data(t){if(t!==c(qn,this)&&d(Gn,this,null),null===t)return d(qn,this,""),void d(Yn,this,!0);d(qn,this,t),d(Xn,this,new Date),d(Yn,this,!1)}setInitialText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;d(Un,this,t),this.data=t,d(Xn,this,null),d(Gn,this,e)}shown(){}destroy(){var t,e;null===(t=c(Hn,this))||void 0===t||t.remove(),d(Hn,this,null),null===(e=c(zn,this))||void 0===e||e.remove(),d(zn,this,null),d(qn,this,""),d(Gn,this,null),d(Xn,this,null),d(Vn,this,null),d(jn,this,!1),d(Yn,this,!1)}}function Zn(t,e){if(!c(Vn,this)._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[c(Vn,this)._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=c(Vn,this)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",$t,{signal:i}),e&&(t.addEventListener("focusin",t=>{c(Vn,this)._focusEventsAllowed=!1,te(t)},{capture:!0,signal:i}),t.addEventListener("focusout",t=>{c(Vn,this)._focusEventsAllowed=!0,te(t)},{capture:!0,signal:i})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=e=>{e.preventDefault(),t===c(Hn,this)?this.edit():c(Vn,this).toggleComment(!0)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(d(jn,this,!0),n(e))},{signal:i}),t.addEventListener("pointerenter",()=>{c(Vn,this).toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{c(Vn,this).toggleComment(!1,!1)},{signal:i}),t}var $n=new WeakMap,ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,rs=new WeakMap,as=new WeakMap,os=new WeakMap,ls=new WeakMap,hs=new WeakMap,cs=new WeakMap,ds=new WeakSet;class us{constructor(t){let{container:e,isPinchingDisabled:i=null,isPinchingStopped:n=null,onPinchStart:s=null,onPinching:r=null,onPinchEnd:h=null,signal:u}=t;a(this,ds),o(this,$n,void 0),o(this,ts,!1),o(this,es,null),o(this,is,void 0),o(this,ns,void 0),o(this,ss,void 0),o(this,rs,void 0),o(this,as,null),o(this,os,void 0),o(this,ls,null),o(this,hs,void 0),o(this,cs,null),d($n,this,e),d(es,this,n),d(is,this,i),d(ns,this,s),d(ss,this,r),d(rs,this,h),d(hs,this,new AbortController),d(os,this,AbortSignal.any([u,c(hs,this).signal])),e.addEventListener("touchstart",l(ds,this,ps).bind(this),{passive:!1,signal:c(os,this)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/oe.pixelRatio}destroy(){var t,e;null===(t=c(hs,this))||void 0===t||t.abort(),d(hs,this,null),null===(e=c(as,this))||void 0===e||e.abort(),d(as,this,null)}}function ps(t){var e,i;if(null!==(e=c(is,this))&&void 0!==e&&e.call(this))return;if(1===t.touches.length){if(c(as,this))return;const t=d(as,this,new AbortController),e=AbortSignal.any([c(os,this),t.signal]),i=c($n,this),n={capture:!0,signal:e,passive:!1},s=t=>{var e;"touch"===t.pointerType&&(null===(e=c(as,this))||void 0===e||e.abort(),d(as,this,null))};return i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(te(t),s(t))},n),i.addEventListener("pointerup",s,n),void i.addEventListener("pointercancel",s,n)}if(!c(cs,this)){var n;d(cs,this,new AbortController);const t=AbortSignal.any([c(os,this),c(cs,this).signal]),e=c($n,this),i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",l(ds,this,gs).bind(this),i);const s=l(ds,this,fs).bind(this);e.addEventListener("touchend",s,i),e.addEventListener("touchcancel",s,i),i.capture=!0,e.addEventListener("pointerdown",te,i),e.addEventListener("pointermove",te,i),e.addEventListener("pointercancel",te,i),e.addEventListener("pointerup",te,i),null===(n=c(ns,this))||void 0===n||n.call(this)}if(te(t),2!==t.touches.length||null!==(i=c(es,this))&&void 0!==i&&i.call(this))return void d(ls,this,null);let[s,r]=t.touches;s.identifier>r.identifier&&([s,r]=[r,s]),d(ls,this,{touch0X:s.screenX,touch0Y:s.screenY,touch1X:r.screenX,touch1Y:r.screenY})}function gs(t){var e;if(!c(ls,this)||2!==t.touches.length)return;te(t);let[i,n]=t.touches;i.identifier>n.identifier&&([i,n]=[n,i]);const{screenX:s,screenY:r}=i,{screenX:a,screenY:o}=n,l=c(ls,this),{touch0X:h,touch0Y:u,touch1X:p,touch1Y:g}=l,m=p-h,v=g-u,w=a-s,b=o-r,y=Math.hypot(w,b)||1,A=Math.hypot(m,v)||1;if(!c(ts,this)&&Math.abs(A-y)<=f.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=r,l.touch1X=a,l.touch1Y=o,!c(ts,this))return void d(ts,this,!0);const _=[(s+a)/2,(r+o)/2];null===(e=c(ss,this))||void 0===e||e.call(this,_,A,y)}function fs(t){if(!(t.touches.length>=2)){var e;if(c(cs,this))c(cs,this).abort(),d(cs,this,null),null===(e=c(rs,this))||void 0===e||e.call(this);c(ls,this)&&(te(t),d(ls,this,null),d(ts,this,!1))}}f=us;var ms=new WeakMap,vs=new WeakMap,ws=new WeakMap,bs=new WeakMap,ys=new WeakMap,As=new WeakMap,_s=new WeakMap,xs=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ms=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Ts=new WeakMap,Ps=new WeakMap,Rs=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,Is=new WeakMap,Fs=new WeakMap,Ns=new WeakMap,Os=new WeakMap,Bs=new WeakMap,Ws=new WeakMap,zs=new WeakMap,Hs=new WeakMap,js=new WeakSet;class Vs{static get _resizerKeyboardManager(){const t=Vs.prototype._resizeWithKeyboard,e=tn.TRANSLATE_SMALL,i=tn.TRANSLATE_BIG;return At(this,"_resizerKeyboardManager",new ei([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Vs.prototype._stopResizingWithKeyboard]]))}constructor(t){a(this,js),o(this,ms,null),o(this,vs,null),o(this,ws,null),o(this,bs,null),o(this,ys,null),o(this,As,!1),o(this,_s,null),o(this,xs,""),o(this,Es,null),o(this,ks,null),o(this,Ms,null),o(this,Ss,null),o(this,Cs,null),o(this,Ts,""),o(this,Ps,!1),o(this,Rs,null),o(this,Ds,!1),o(this,Ls,!1),o(this,Is,!1),o(this,Fs,null),o(this,Ns,0),o(this,Os,0),o(this,Bs,null),o(this,Ws,null),(0,P.A)(this,"isSelected",!1),(0,P.A)(this,"_isCopy",!1),(0,P.A)(this,"_editToolbar",null),(0,P.A)(this,"_initialOptions",Object.create(null)),(0,P.A)(this,"_initialData",null),(0,P.A)(this,"_isVisible",!0),(0,P.A)(this,"_uiManager",null),(0,P.A)(this,"_focusEventsAllowed",!0),o(this,zs,!1),o(this,Hs,Vs._zIndex++),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[l,h]=this.parentDimensions;this.x=t.x/l,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return At(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new hr({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){var i;if(null!==(i=Vs._l10n)&&void 0!==i||(Vs._l10n=t),Vs._l10nResizer||(Vs._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),-1!==Vs._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Vs._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){vt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return c(zs,this)}set _isDraggable(t){var e;d(zs,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=c(Hs,this)}setParent(t){var e;null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(l(js,this,lr).call(this),null===(e=c(Ss,this))||void 0===e||e.remove(),d(Ss,this,null));this.parent=t}focusin(t){this._focusEventsAllowed&&(c(Ps,this)?d(Ps,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n),this._onTranslated()}translate(t,e){l(js,this,Us).call(this,this.parentDimensions,t,e)}translateInPage(t,e){c(Rs,this)||d(Rs,this,[this.x,this.y,this.width,this.height]),l(js,this,Us).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){c(Rs,this)||d(Rs,this,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[n,s]}=this;if(this.x+=t/n,this.y+=e/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:a}=this;const[o,l]=this.getBaseTranslation();r+=o,a+=l;const{style:h}=i;h.left="".concat((100*r).toFixed(2),"%"),h.top="".concat((100*a).toFixed(2),"%"),this._onTranslating(r,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!c(Rs,this)&&(c(Rs,this)[0]!==this.x||c(Rs,this)[1]!==this.y)}get _hasBeenResized(){return!!c(Rs,this)&&(c(Rs,this)[2]!==this.width||c(Rs,this)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Vs,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const{div:{style:e},pageDimensions:[i,n]}=this;let{x:s,y:r,width:a,height:o}=this;if(a*=i,o*=n,s*=i,r*=n,this._mustFixPosition)switch(t){case 0:s=zt(s,0,i-a),r=zt(r,0,n-o);break;case 90:s=zt(s,0,i-o),r=zt(r,a,n);break;case 180:s=zt(s,a,i),r=zt(r,o,n);break;case 270:s=zt(s,o,i),r=zt(r,0,n-a)}this.x=s/=i,this.y=r/=n;const[l,h]=this.getBaseTranslation();s+=l,r+=h,e.left="".concat((100*s).toFixed(2),"%"),e.top="".concat((100*r).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return Gs.call(Vs,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return Gs.call(Vs,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width="".concat((100*e).toFixed(2),"%"),t.height="".concat((100*i).toFixed(2),"%")}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(1e4*t)/1e4}_onResizing(){}altTextFinish(){var t;null===(t=c(ws,this))||void 0===t||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||c(Ls,this))return this._editToolbar;this._editToolbar=new ke(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var t;null===(t=this._editToolbar)||void 0===t||t.removeButton("comment")}removeEditToolbar(){var t,e;null===(t=this._editToolbar)||void 0===t||t.remove(),this._editToolbar=null,null===(e=c(ws,this))||void 0===e||e.destroy()}addContainer(t){var e;const i=null===(e=this._editToolbar)||void 0===e?void 0:e.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return c(ws,this)||(Nn.initialize(Vs._l10n),d(ws,this,new Nn(this)),c(ms,this)&&(c(ws,this).data=c(ms,this),d(ms,this,null))),c(ws,this)}get altTextData(){var t;return null===(t=c(ws,this))||void 0===t?void 0:t.data}set altTextData(t){c(ws,this)&&(c(ws,this).data=t)}get guessedAltText(){var t;return null===(t=c(ws,this))||void 0===t?void 0:t.guessedText}async setGuessedAltText(t){var e;await(null===(e=c(ws,this))||void 0===e?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return null===(e=c(ws,this))||void 0===e?void 0:e.serialize(t)}hasAltText(){return!!c(ws,this)&&!c(ws,this).isEmpty()}hasAltTextData(){var t,e;return null!==(t=null===(e=c(ws,this))||void 0===e?void 0:e.hasData())&&void 0!==t&&t}focusCommentButton(){var t;null===(t=c(bs,this))||void 0===t||t.focusButton()}addCommentButton(){return c(bs,this)||d(bs,this,new Qn(this))}addStandaloneCommentButton(){c(ys,this)?this._uiManager.isEditingMode()&&c(ys,this).classList.remove("hidden"):this.hasComment&&(d(ys,this,c(bs,this).renderForStandalone()),this.div.append(c(ys,this)))}removeStandaloneCommentButton(){c(bs,this).removeStandaloneCommentButton(),d(ys,this,null)}hideStandaloneCommentButton(){var t;null===(t=c(ys,this))||void 0===t||t.classList.add("hidden")}get comment(){var t;const{data:{richText:e,text:i,date:n,deleted:s}}=c(bs,this);return{text:i,richText:e,date:n,deleted:s,color:this.getNonHCMColor(),opacity:null!==(t=this.opacity)&&void 0!==t?t:1}}set comment(t){c(bs,this)||d(bs,this,new Qn(this)),c(bs,this).data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData(t){let{comment:e,popupRef:i,richText:n}=t;if(!i)return;if(c(bs,this)||d(bs,this,new Qn(this)),c(bs,this).setInitialText(e,n),!this.annotationElementId)return;const s=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);s&&this.updateFromAnnotationLayer(s)}get hasEditedComment(){var t;return null===(t=c(bs,this))||void 0===t?void 0:t.hasBeenEdited()}get hasDeletedComment(){var t;return null===(t=c(bs,this))||void 0===t?void 0:t.isDeleted()}get hasComment(){return!!c(bs,this)&&!c(bs,this).isEmpty()&&!c(bs,this).isDeleted()}async editComment(t){c(bs,this)||d(bs,this,new Qn(this)),c(bs,this).edit(t)}toggleComment(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){c(bs,this).setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,i=100,[,,,n]=t.rect,[s]=this.pageDimensions,[r]=this.pageTranslation,a=r+s+1,o=n-i,l=a+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,n]}}}updateFromAnnotationLayer(t){let{popup:{contents:e,deleted:i}}=t;c(bs,this).data=i?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var t;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=c(As,this)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),l(js,this,nr).call(this);const[i,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth="".concat((100*n/i).toFixed(2),"%"),e.style.maxHeight="".concat((100*i/n).toFixed(2),"%"));const[s,r]=this.getInitialTranslation();return this.translate(s,r),ze(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(c(Ws,this)||d(Ws,this,new us({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:l(js,this,Zs).bind(this),onPinching:l(js,this,$s).bind(this),onPinchEnd:l(js,this,tr).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),null===(t=this._uiManager._editorUndoBar)||void 0===t||t.hide(),e}pointerdown(t){const{isMac:e}=Rt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(d(Ps,this,!0),this._isDraggable?l(js,this,ir).call(this,t):l(js,this,er).call(this,t))}_onStartDragging(){}_onStopDragging(){}moveInDOM(){c(Fs,this)&&clearTimeout(c(Fs,this)),d(Fs,this,setTimeout(()=>{var t;d(Fs,this,null),null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,h=e/n,c=this.x*s,d=this.y*r,u=this.width*s,p=this.height*r;switch(i){case 0:return[c+l+a,r-d-h-p+o,c+l+u+a,r-d-h+o];case 90:return[c+h+a,r-d+l+o,c+h+p+a,r-d+l+u+o];case 180:return[c-l-u+a,r-d+h+o,c-l+a,r-d+h+p+o];case 270:return[c-h-p+a,r-d-l-u+o,c-h+a,r-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,o=r-n;switch(this.rotation){case 0:return[i,e-r,a,o];case 90:return[i,e-n,o,a];case 180:return[s,e-n,a,o];case 270:return[s,e-r,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Vs._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var t;null===(t=c(bs,this))||void 0===t||t.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:s,richText:r},uid:a,pageIndex:o,creationDate:l,modificationDate:h}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:r,contentsObj:{str:t},creationDate:l,modificationDate:i||h,popupRef:!s,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),d(Ls,this,!0),!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),d(Ls,this,!1),!0)}isInEditMode(){return c(Ls,this)}shouldGetKeyboardEvents(){return c(Is,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:s,innerWidth:r}=window;return e<r&&n>0&&t<s&&i>0}rebuild(){l(js,this,nr).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}serialize(){var t;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:(null===(t=this._initialData)||void 0===t?void 0:t.popupRef)||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation,d(ms,n,t.accessibilityData),n._isCopy=t.isCopy||!1;const[s,r]=n.pageDimensions,[a,o,l,h]=n.getRectInCurrentCoords(t.rect,r);return n.x=a/s,n.y=o/r,n.width=l/s,n.height=h/r,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){var t,e;if(null===(t=c(Cs,this))||void 0===t||t.abort(),d(Cs,this,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),c(Fs,this)&&(clearTimeout(c(Fs,this)),d(Fs,this,null)),l(js,this,lr).call(this),this.removeEditToolbar(),c(Bs,this)){for(const t of c(Bs,this).values())clearTimeout(t);d(Bs,this,null)}this.parent=null,null===(e=c(Ws,this))||void 0===e||e.destroy(),d(Ws,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(l(js,this,Xs).call(this),c(Es,this).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,s,r]=this.getPDFRect();return[Vs._round(i+(s-i)*t),Vs._round(n+(r-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return c(bs,this).commentPopupPositionInLayer}set commentPopupPosition(t){c(bs,this).commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return c(bs,this).hasDefaultPopupPosition()}get commentButtonWidth(){return c(bs,this).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){c(bs,this).setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),d(Ms,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=c(Es,this).children;if(!c(vs,this)){d(vs,this,Array.from(e));const t=l(js,this,sr).bind(this),i=l(js,this,rr).bind(this),n=this._uiManager._signal;for(const e of c(vs,this)){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",l(js,this,ar).bind(this,s),{signal:n}),e.setAttribute("data-l10n-id",Vs._l10nResizer[s])}}const i=c(vs,this)[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(c(vs,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)c(Es,this).append(c(Es,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)c(Es,this).firstChild.before(c(Es,this).lastChild);let t=0;for(const i of e){const e=c(vs,this)[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",Vs._l10nResizer[e])}}l(js,this,or).call(this,0),d(Is,this,!0),c(Es,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){c(Is,this)&&l(js,this,Qs).call(this,c(Ts,this),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){l(js,this,lr).call(this),this.div.focus()}select(){var t,e,i;this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),this._editToolbar?(null===(e=this._editToolbar)||void 0===e||e.show(),null===(i=c(ws,this))||void 0===i||i.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=this._editToolbar)||void 0===e||e.show())}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var t;return null===(t=this.div)||void 0===t?void 0:t.focus({preventScroll:!0})},0)}unselect(){var t,e,i,n,s;this.isSelected&&(this.isSelected=!1,null===(t=c(Es,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=this._editToolbar)||void 0===n||n.hide(),null===(s=c(ws,this))||void 0===s||s.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return c(Ds,this)}set isEditing(t){d(Ds,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){c(Bs,this)||d(Bs,this,new Map);const{action:e}=t;let i=c(Bs,this).get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),c(Bs,this).delete(e),0===c(Bs,this).size&&d(Bs,this,null)},Vs._telemetryTimeout),void c(Bs,this).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),d(As,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),d(As,this,!0)}updateFakeAnnotationElement(t){if(c(Ss,this)||this.deleted)return this.deleted?(c(Ss,this).remove(),void d(Ss,this,null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&c(Ss,this).updateEdited({rect:this.getPDFRect(),popup:this.comment}));d(Ss,this,t.addFakeAnnotation(this))}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===(null===e||void 0===e?void 0:e.nodeName)&&e.classList.contains("annotationContent")&&e.remove()}}function Us(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}function Gs(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function qs(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}function Xs(){if(c(Es,this))return;d(Es,this,document.createElement("div")),c(Es,this).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");c(Es,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",l(js,this,Ys).bind(this,i),{signal:e}),t.addEventListener("contextmenu",$t,{signal:e}),t.tabIndex=-1}this.div.prepend(c(Es,this))}function Ys(t,e){var i;e.preventDefault();const{isMac:n}=Rt.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=c(ws,this))||void 0===i||i.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,d(ks,this,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",l(js,this,Qs).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",te,{passive:!1,signal:a}),window.addEventListener("contextmenu",$t,{signal:a}),d(Ms,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const u=()=>{var t;r.abort(),this.parent.togglePointerEvents(!0),null===(t=c(ws,this))||void 0===t||t.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=h,l(js,this,Js).call(this)};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}function Ks(t,e,i,n){this.width=i,this.height=n,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}function Js(){if(!c(Ms,this))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=c(Ms,this);d(Ms,this,null);const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:l(js,this,Ks).bind(this,s,r,a,o),undo:l(js,this,Ks).bind(this,t,e,i,n),mustExec:!0})}function Qs(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,h=m.MIN_SIZE/i,u=m.MIN_SIZE/n,p=l(js,this,qs).call(this,this.rotation),g=(t,e)=>[p[0]*t+p[2]*e,p[1]*t+p[3]*e],f=l(js,this,qs).call(this,360-this.rotation);let v,w,b=!1,y=!1;switch(t){case"topLeft":b=!0,v=(t,e)=>[0,0],w=(t,e)=>[t,e];break;case"topMiddle":v=(t,e)=>[t/2,0],w=(t,e)=>[t/2,e];break;case"topRight":b=!0,v=(t,e)=>[t,0],w=(t,e)=>[0,e];break;case"middleRight":y=!0,v=(t,e)=>[t,e/2],w=(t,e)=>[0,e/2];break;case"bottomRight":b=!0,v=(t,e)=>[t,e],w=(t,e)=>[0,0];break;case"bottomMiddle":v=(t,e)=>[t/2,e],w=(t,e)=>[t/2,0];break;case"bottomLeft":b=!0,v=(t,e)=>[0,e],w=(t,e)=>[t,0];break;case"middleLeft":y=!0,v=(t,e)=>[0,e/2],w=(t,e)=>[t,e/2]}const A=v(a,o),_=w(a,o);let x=g(..._);const E=m._round(s+x[0]),k=m._round(r+x[1]);let M,S,C=1,T=1;if(e.fromKeyboard)({deltaX:M,deltaY:S}=e);else{const{screenX:t,screenY:i}=e,[n,s]=c(ks,this);[M,S]=this.screenToPageTranslation(t-n,i-s),c(ks,this)[0]=t,c(ks,this)[1]=i}var P,R;if([M,S]=(P=M/i,R=S/n,[f[0]*P+f[2]*R,f[1]*P+f[3]*R]),b){const t=Math.hypot(a,o);C=T=Math.max(Math.min(Math.hypot(_[0]-A[0]-M,_[1]-A[1]-S)/t,1/a,1/o),h/a,u/o)}else y?C=zt(Math.abs(_[0]-A[0]-M),h,1)/a:T=zt(Math.abs(_[1]-A[1]-S),u,1)/o;const D=m._round(a*C),L=m._round(o*T);x=g(...w(D,L));const I=E-x[0],F=k-x[1];c(Rs,this)||d(Rs,this,[this.x,this.y,this.width,this.height]),this.width=D,this.height=L,this.x=I,this.y=F,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function Zs(){var t;d(Ms,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),null===(t=c(ws,this))||void 0===t||t.toggle(!1),this.parent.togglePointerEvents(!1)}function $s(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const s=l(js,this,qs).call(this,this.rotation),r=(t,e)=>[s[0]*t+s[2]*e,s[1]*t+s[3]*e],[a,o]=this.parentDimensions,h=this.x,u=this.y,p=this.width,g=this.height,f=m.MIN_SIZE/a,v=m.MIN_SIZE/o;n=Math.max(Math.min(n,1/p,1/g),f/p,v/g);const w=m._round(p*n),b=m._round(g*n);if(w===p&&b===g)return;c(Rs,this)||d(Rs,this,[h,u,p,g]);const y=r(p/2,g/2),A=m._round(h+y[0]),_=m._round(u+y[1]),x=r(w/2,b/2);this.x=A-x[0],this.y=_-x[1],this.width=w,this.height=b,this.setDims(),this.fixAndSetPosition(),this._onResizing()}function tr(){var t;null===(t=c(ws,this))||void 0===t||t.toggle(!0),this.parent.togglePointerEvents(!0),l(js,this,Js).call(this)}function er(t){const{isMac:e}=Rt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function ir(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,s=this._uiManager.combinedSignal(n),r={capture:!0,passive:!1,signal:s},a=t=>{n.abort(),d(_s,this,null),d(Ps,this,!1),this._uiManager.endDragSession()||l(js,this,er).call(this,t),i&&this._onStopDragging()};e&&(d(Ns,this,t.clientX),d(Os,this,t.clientY),d(_s,this,t.pointerId),d(xs,this,t.pointerType),window.addEventListener("pointermove",t=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:e,clientY:n,pointerId:s}=t;if(s!==c(_s,this))return void te(t);const[r,a]=this.screenToPageTranslation(e-c(Ns,this),n-c(Os,this));d(Ns,this,e),d(Os,this,n),this._uiManager.dragSelectedEditors(r,a)},r),window.addEventListener("touchmove",te,r),window.addEventListener("pointerdown",t=>{t.pointerType===c(xs,this)&&(c(Ws,this)||t.isPrimary)&&a(t),te(t)},r));const o=t=>{c(_s,this)&&c(_s,this)!==t.pointerId?te(t):a(t)};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}function nr(){if(c(Cs,this)||!this.div)return;d(Cs,this,new AbortController);const t=this._uiManager.combinedSignal(c(Cs,this));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}function sr(t){m._resizerKeyboardManager.exec(this,t)}function rr(t){var e;c(Is,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==c(Es,this)&&l(js,this,lr).call(this)}function ar(t){d(Ts,this,c(Is,this)?t:"")}function or(t){if(c(vs,this))for(const e of c(vs,this))e.tabIndex=t}function lr(){d(Is,this,!1),l(js,this,or).call(this,-1),l(js,this,Js).call(this)}m=Vs,(0,P.A)(Vs,"_l10n",null),(0,P.A)(Vs,"_l10nResizer",null),(0,P.A)(Vs,"_borderLineWidth",-1),(0,P.A)(Vs,"_colorManager",new ni),(0,P.A)(Vs,"_zIndex",1),(0,P.A)(Vs,"_telemetryTimeout",1e3);class hr extends Vs{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const cr=3285377520,dr=4294901760,ur=65535;class pr{constructor(t){this.h1=t?4294967295&t:cr,this.h2=t?4294967295&t:cr}update(t){let e,i;if("string"===typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,h=this.h2;const c=3432918353,d=461845907,u=11601,p=13715;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*c&dr|a*u&ur,a=a<<15|a>>>17,a=a*d&dr|a*p&ur,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[g],o=o*c&dr|o*u&ur,o=o<<15|o>>>17,o=o*d&dr|o*p&ur,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*c&dr|a*u&ur,a=a<<15|a>>>17,a=a*d&dr|a*p&ur,1&n?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&dr|36045*t&ur,e=4283543511*e&dr|(2950163797*(e<<16|t>>>16)&dr)>>>16,t^=e>>>1,t=444984403*t&dr|60499*t&ur,e=3301882366*e&dr|(3120437893*(e<<16|t>>>16)&dr)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const gr=Object.freeze({map:null,hash:"",transfer:void 0});var fr=new WeakMap,mr=new WeakMap,vr=new WeakMap,wr=new WeakMap,br=new WeakSet;class yr{constructor(){a(this,br),o(this,fr,!1),o(this,mr,null),o(this,vr,null),o(this,wr,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=c(wr,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return c(wr,this).get(t)}remove(t){const e=c(wr,this).get(t);if(void 0!==e&&(e instanceof Vs&&c(vr,this).delete(e.annotationElementId),c(wr,this).delete(t),0===c(wr,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor)){for(const t of c(wr,this).values())if(t instanceof Vs)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=c(wr,this).get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,c(wr,this).set(t,e);n&&l(br,this,Ar).call(this),e instanceof Vs&&((c(vr,this)||d(vr,this,new Map)).set(e.annotationElementId,e),"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type))}has(t){return c(wr,this).has(t)}get size(){return c(wr,this).size}resetModified(){c(fr,this)&&(d(fr,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new xr(this)}get serializable(){if(0===c(wr,this).size)return gr;const t=new Map,e=new pr,i=[],n=Object.create(null);let s=!1;for(const[r,a]of c(wr,this)){const i=a instanceof Vs?a.serialize(!1,n):a;i&&(t.set(r,i),e.update("".concat(r,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:gr}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const a of c(wr,this).values()){var s;if(!(a instanceof Vs)){a.popup&&(a.popup.deleted?n+=1:i+=1);continue}a.isCommentDeleted?n+=1:a.hasEditedComment&&(i+=1);const o=a.telemetryFinalData;if(!o)continue;const{type:l}=o;e.has(l)||e.set(l,Object.getPrototypeOf(a).constructor),t||(t=Object.create(null));const h=(s=t)[l]||(s[l]=new Map);for(const[t,e]of Object.entries(o)){var r;if("type"===t)continue;let i=h.get(t);i||(i=new Map,h.set(t,i));const n=null!==(r=i.get(e))&&void 0!==r?r:0;i.set(e,n+1)}}if((n>0||i>0)&&(t||(t=Object.create(null)),t.comments={deleted:n,edited:i}),!t)return null;for(const[a,o]of e)t[a]=o.computeTelemetryFinalData(t[a]);return t}resetModifiedIds(){d(mr,this,null)}updateEditor(t,e){var i;const n=null===(i=c(vr,this))||void 0===i?void 0:i.get(t);return!!n&&(n.updateFromAnnotationLayer(e),!0)}getEditor(t){var e;return(null===(e=c(vr,this))||void 0===e?void 0:e.get(t))||null}get modifiedIds(){if(c(mr,this))return c(mr,this);const t=[];if(c(vr,this))for(const e of c(vr,this).values())e.serialize()&&t.push(e.annotationElementId);return d(mr,this,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return c(wr,this).entries()}}function Ar(){c(fr,this)||(d(fr,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var _r=new WeakMap;class xr extends yr{constructor(t){super(),o(this,_r,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);d(_r,this,{map:s,hash:i,transfer:n})}get print(){vt("Should not call PrintAnnotationStorage.print")}get serializable(){return c(_r,this)}get modifiedIds(){return At(this,"modifiedIds",{ids:new Set,hash:""})}}var Er=new WeakMap;class kr{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;o(this,Er,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),c(Er,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,disableFontFace:i,_inspectFont:n}=t;if(e&&!c(Er,this).has(e.loadedName)){if(wt(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:i,style:r}=e,a=new FontFace(t,i,r);this.addNativeFontFace(a);try{await a.load(),c(Er,this).add(t),null===n||void 0===n||n(e)}catch(s){mt("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(a)}return}vt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw mt("Failed to load font '".concat(e.family,"': '").concat(i,"'.")),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){var t;return At(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){return At(this,"isSyncFontLoadingSupported",D||Rt.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(wt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return At(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const h="lt".concat(Date.now()).concat(this.loadTestFontId++);let c=this._loadTestFont;c=n(c,976,h.length,h);const d=1482184792;let u=i(c,16);for(s=0,r=h.length-3;s<r;s+=4)u=u-d+i(h,s)|0;var p;s<h.length&&(u=u-d+i(h+"XXX",s)|0),c=n(c,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const g="url(data:font/opentype;base64,".concat(btoa(c),");"),f='@font-face {font-family:"'.concat(h,'";src:').concat(g,"}");this.insertRule(f);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const v of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=v,m.append(t)}this._document.body.append(m),function t(e,i){if(++l>30)return mt("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(h,()=>{m.remove(),e.complete()})}}var Mr=new WeakMap;class Sr{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;o(this,Mr,void 0),this.compiledGlyphs=Object.create(null),d(Mr,this,t),this._inspectFont=e,i&&Object.assign(this,i),n&&(this.charProcOperatorList=n)}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e="url(data:".concat(this.mimetype,";base64,").concat(Ht(this.data),");");let i;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),i='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(e,"}")}else i='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(e,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let n;try{n=t.get(i)}catch(r){mt('getPathGenerator - ignoring character: "'.concat(r,'".'))}const s=new Path2D(n||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=s}get black(){return c(Mr,this).black}get bold(){return c(Mr,this).bold}get disableFontFace(){var t;return null!==(t=c(Mr,this).disableFontFace)&&void 0!==t&&t}get fontExtraProperties(){var t;return null!==(t=c(Mr,this).fontExtraProperties)&&void 0!==t&&t}get isInvalidPDFjsFont(){return c(Mr,this).isInvalidPDFjsFont}get isType3Font(){return c(Mr,this).isType3Font}get italic(){return c(Mr,this).italic}get missingFile(){return c(Mr,this).missingFile}get remeasure(){return c(Mr,this).remeasure}get vertical(){return c(Mr,this).vertical}get ascent(){return c(Mr,this).ascent}get defaultWidth(){return c(Mr,this).defaultWidth}get descent(){return c(Mr,this).descent}get bbox(){return c(Mr,this).bbox}get fontMatrix(){return c(Mr,this).fontMatrix}get fallbackName(){return c(Mr,this).fallbackName}get loadedName(){return c(Mr,this).loadedName}get mimetype(){return c(Mr,this).mimetype}get name(){return c(Mr,this).name}get data(){return c(Mr,this).data}clearData(){c(Mr,this).clearData()}get cssFontInfo(){return c(Mr,this).cssFontInfo}get systemFontInfo(){return c(Mr,this).systemFontInfo}get defaultVMetrics(){return c(Mr,this).defaultVMetrics}}function Cr(t){if("string"!==typeof t)return null;if(t.endsWith("/"))return t;throw new Error('Invalid factory url: "'.concat(t,'" must include trailing slash.'))}const Tr=t=>"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0,Pr=function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,s,...r]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(s))return!1;const a=r.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const l of r)if(!("number"===typeof l||o&&null===l))return!1;return!0}.bind(null,Tr,t=>"object"===typeof t&&"string"===typeof(null===t||void 0===t?void 0:t.name));var Rr=new WeakMap,Dr=new WeakMap;class Lr{constructor(){o(this,Rr,new Map),o(this,Dr,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};c(Dr,this).then(()=>{for(const[t]of c(Rr,this))t.call(this,i)})}addEventListener(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null;if((null===i||void 0===i?void 0:i.signal)instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void mt("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",r),s.addEventListener("abort",r)}c(Rr,this).set(e,n)}removeEventListener(t,e){const i=c(Rr,this).get(e);null===i||void 0===i||i(),c(Rr,this).delete(e)}terminate(){for(const[,t]of c(Rr,this))null===t||void 0===t||t();c(Rr,this).clear()}}const Ir=1,Fr=2,Nr=1,Or=2,Br=3,Wr=4,zr=5,Hr=6,jr=7,Vr=8;function Ur(){}function Gr(t){if(t instanceof Ct||t instanceof kt||t instanceof xt||t instanceof Mt||t instanceof Et)return t;switch(t instanceof Error||"object"===typeof t&&null!==t||vt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ct(t.message);case"InvalidPDFException":return new kt(t.message);case"PasswordException":return new xt(t.message,t.code);case"ResponseException":return new Mt(t.message,t.status,t.missing);case"UnknownErrorException":return new Et(t.message,t.details)}return new Et(t.message,t.toString())}var qr=new WeakMap,Xr=new WeakSet;class Yr{constructor(t,e,i){a(this,Xr),o(this,qr,new AbortController),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",l(Xr,this,Kr).bind(this),{signal:c(qr,this).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(t,'"'));i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(r){s.reject(r)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:r,targetName:a,stream:Hr,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{wt(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:Nr,streamId:s,reason:Gr(t)}),e.promise}},i)}destroy(){var t;null===(t=c(qr,this))||void 0===t||t.abort(),d(qr,this,null)}}function Kr(t){let{data:e}=t;if(e.targetName!==this.sourceName)return;if(e.stream)return void l(Xr,this,Qr).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===Ir)i.resolve(e.data);else{if(e.callback!==Fr)throw new Error("Unexpected callback case");i.reject(Gr(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,n=e.sourceName,s=this.comObj;return void Promise.try(i,e.data).then(function(i){s.postMessage({sourceName:t,targetName:n,callback:Ir,callbackId:e.callbackId,data:i})},function(i){s.postMessage({sourceName:t,targetName:n,callback:Fr,callbackId:e.callbackId,reason:Gr(i)})})}e.streamId?l(Xr,this,Jr).call(this,e):i(e.data)}function Jr(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=r,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:Wr,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Br,streamId:e}),delete r.streamSinks[e])},error(t){wt(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:zr,streamId:e,reason:Gr(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(a,t.data,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Vr,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Vr,streamId:e,reason:Gr(t)})})}function Qr(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case Vr:t.success?r.startCall.resolve():r.startCall.reject(Gr(t.reason));break;case jr:t.success?r.pullCall.resolve():r.pullCall.reject(Gr(t.reason));break;case Hr:if(!a){s.postMessage({sourceName:i,targetName:n,stream:jr,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||Ur).then(function(){s.postMessage({sourceName:i,targetName:n,stream:jr,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:jr,streamId:e,reason:Gr(t)})});break;case Wr:if(wt(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case Br:if(wt(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),l(Xr,this,Zr).call(this,r,e);break;case zr:wt(r,"error should have stream controller"),r.controller.error(Gr(t.reason)),l(Xr,this,Zr).call(this,r,e);break;case Or:t.success?r.cancelCall.resolve():r.cancelCall.reject(Gr(t.reason)),l(Xr,this,Zr).call(this,r,e);break;case Nr:if(!a)break;const o=Gr(t.reason);Promise.try(a.onCancel||Ur,o).then(function(){s.postMessage({sourceName:i,targetName:n,stream:Or,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:n,stream:Or,streamId:e,reason:Gr(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function Zr(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var $r=new WeakMap;class ta{constructor(t){let{enableHWA:e=!1}=t;o(this,$r,!1),d($r,this,e)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!c($r,this)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){vt("Abstract method `_createCanvas` called.")}}class ea extends ta{constructor(t){let{ownerDocument:e=globalThis.document,enableHWA:i=!1}=t;super({enableHWA:i}),this._document=e}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class ia{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))})}async _fetch(t){vt("Abstract method `_fetch` called.")}}class na extends ia{async _fetch(t){const e=await qt(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Pt(e)}}class sa{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}var ra=new WeakMap,aa=new WeakMap,oa=new WeakMap,la=new WeakMap,ha=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakSet;class pa extends sa{constructor(t){let{docId:e,ownerDocument:i=globalThis.document}=t;super(),a(this,ua),o(this,ra,void 0),o(this,aa,void 0),o(this,oa,void 0),o(this,la,void 0),o(this,ha,void 0),o(this,ca,void 0),o(this,da,0),d(la,this,e),d(ha,this,i)}addFilter(t){var e,i;if(!t)return"none";let n=h(ua,this,ga).get(t);if(n)return n;const[s,r,a]=l(ua,this,va).call(this,t),o=1===t.length?s:"".concat(s).concat(r).concat(a);if(n=h(ua,this,ga).get(o),n)return h(ua,this,ga).set(t,n),n;const u="g_".concat(c(la,this),"_transfer_map_").concat((d(da,this,(e=c(da,this),i=e++,e)),i)),p=l(ua,this,wa).call(this,u);h(ua,this,ga).set(t,p),h(ua,this,ga).set(o,p);const g=l(ua,this,Aa).call(this,u);return l(ua,this,xa).call(this,s,r,a,g),p}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let r=h(ua,this,fa).get(s);if((null===(i=r)||void 0===i?void 0:i.key)===n)return r.url;var a;r?(null===(a=r.filter)||void 0===a||a.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},h(ua,this,fa).set(s,r));if(!t||!e)return r.url;const o=l(ua,this,ka).call(this,t);t=Lt.makeHexColor(...o);const d=l(ua,this,ka).call(this,e);if(e=Lt.makeHexColor(...d),h(ua,this,ma).style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const u=new Array(256);for(let l=0;l<=255;l++){const t=l/255;u[l]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const p=u.join(","),g="g_".concat(c(la,this),"_hcm_filter"),f=r.filter=l(ua,this,Aa).call(this,g);l(ua,this,xa).call(this,p,p,p,f),l(ua,this,ya).call(this,f);const m=(t,e)=>{const i=o[t]/255,n=d[t]/255,s=new Array(e+1);for(let r=0;r<=e;r++)s[r]=i+r/e*(n-i);return s.join(",")};return l(ua,this,xa).call(this,m(0,5),m(1,5),m(2,5),f),r.url=l(ua,this,wa).call(this,g),r.url}addAlphaFilter(t){var e,i;let n=h(ua,this,ga).get(t);if(n)return n;const[s]=l(ua,this,va).call(this,[t]),r="alpha_".concat(s);if(n=h(ua,this,ga).get(r),n)return h(ua,this,ga).set(t,n),n;const a="g_".concat(c(la,this),"_alpha_map_").concat((d(da,this,(e=c(da,this),i=e++,e)),i)),o=l(ua,this,wa).call(this,a);h(ua,this,ga).set(t,o),h(ua,this,ga).set(r,o);const u=l(ua,this,Aa).call(this,a);return l(ua,this,Ea).call(this,s,u),o}addLuminosityFilter(t){var e,i;let n,s,r=h(ua,this,ga).get(t||"luminosity");if(r)return r;if(t?([n]=l(ua,this,va).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",r=h(ua,this,ga).get(s),r)return h(ua,this,ga).set(t,r),r;const a="g_".concat(c(la,this),"_luminosity_map_").concat((d(da,this,(e=c(da,this),i=e++,e)),i)),o=l(ua,this,wa).call(this,a);h(ua,this,ga).set(t,o),h(ua,this,ga).set(s,o);const u=l(ua,this,Aa).call(this,a);return l(ua,this,ba).call(this,u),t&&l(ua,this,Ea).call(this,n,u),o}addHighlightHCMFilter(t,e,i,n,s){var r;const a="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=h(ua,this,fa).get(t);if((null===(r=o)||void 0===r?void 0:r.key)===a)return o.url;var d;o?(null===(d=o.filter)||void 0===d||d.remove(),o.key=a,o.url="none",o.filter=null):(o={key:a,url:"none",filter:null},h(ua,this,fa).set(t,o));if(!e||!i)return o.url;const[u,p]=[e,i].map(l(ua,this,ka).bind(this));let g=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),f=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),[m,v]=[n,s].map(l(ua,this,ka).bind(this));f<g&&([g,f,m,v]=[f,g,v,m]),h(ua,this,ma).style.color="";const w=(t,e,i)=>{const n=new Array(256),s=(f-g)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(g+l*s),e=r+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},b="g_".concat(c(la,this),"_hcm_").concat(t,"_filter"),y=o.filter=l(ua,this,Aa).call(this,b);return l(ua,this,ya).call(this,y),l(ua,this,xa).call(this,w(m[0],v[0],5),w(m[1],v[1],5),w(m[2],v[2],5),y),o.url=l(ua,this,wa).call(this,b),o.url}destroy(){var t,e,i,n;arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&null!==(t=c(ca,this))&&void 0!==t&&t.size||(null===(e=c(oa,this))||void 0===e||e.parentNode.parentNode.remove(),d(oa,this,null),null===(i=c(aa,this))||void 0===i||i.clear(),d(aa,this,null),null===(n=c(ca,this))||void 0===n||n.clear(),d(ca,this,null),d(da,this,0))}}function ga(t){return c(aa,t)||d(aa,t,new Map)}function fa(t){return c(ca,t)||d(ca,t,new Map)}function ma(t){if(!c(oa,t)){const e=c(ha,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=c(ha,t).createElementNS(Ut,"svg");n.setAttribute("width",0),n.setAttribute("height",0),d(oa,t,c(ha,t).createElementNS(Ut,"defs")),e.append(n),n.append(c(oa,t)),c(ha,t).body.append(e)}return c(oa,t)}function va(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,r[o]=i[o]/255,a[o]=n[o]/255;return[s.join(","),r.join(","),a.join(",")]}function wa(t){if(void 0===c(ra,this)){d(ra,this,"");const t=c(ha,this).URL;t!==c(ha,this).baseURI&&(Kt(t)?mt('#createUrl: ignore "data:"-URL for performance reasons.'):d(ra,this,yt(t,"")))}return"url(".concat(c(ra,this),"#").concat(t,")")}function ba(t){const e=c(ha,this).createElementNS(Ut,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}function ya(t){const e=c(ha,this).createElementNS(Ut,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}function Aa(t){const e=c(ha,this).createElementNS(Ut,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),h(ua,this,ma).append(e),e}function _a(t,e,i){const n=c(ha,this).createElementNS(Ut,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function xa(t,e,i,n){const s=c(ha,this).createElementNS(Ut,"feComponentTransfer");n.append(s),l(ua,this,_a).call(this,s,"feFuncR",t),l(ua,this,_a).call(this,s,"feFuncG",e),l(ua,this,_a).call(this,s,"feFuncB",i)}function Ea(t,e){const i=c(ha,this).createElementNS(Ut,"feComponentTransfer");e.append(i),l(ua,this,_a).call(this,i,"feFuncA",t)}function ka(t){return h(ua,this,ma).style.color=t,ne(getComputedStyle(h(ua,this,ma)).getPropertyValue("color"))}class Ma{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load font data at: ".concat(i))})}async _fetch(t){vt("Abstract method `_fetch` called.")}}class Sa extends Ma{async _fetch(t){const e=await qt(t,"arraybuffer");return new Uint8Array(e)}}class Ca{constructor(t){let{baseUrl:e=null}=t;this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetch(i).catch(t=>{throw new Error("Unable to load wasm data at: ".concat(i))})}async _fetch(t){vt("Abstract method `_fetch` called.")}}class Ta extends Ca{async _fetch(t){const e=await qt(t,"arraybuffer");return new Uint8Array(e)}}async function Pa(t){const e=process.getBuiltinModule("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}D&&mt("Please use the `legacy` build in Node.js environments.");class Ra extends sa{}class Da extends ta{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("file:///home/runner/work/react-file/react-file/node_modules/pdfjs-dist/build/pdf.mjs")("@napi-rs/canvas").createCanvas(t,e)}}class La extends ia{async _fetch(t){return Pa(t)}}class Ia extends Ma{async _fetch(t){return Pa(t)}}class Fa extends Ca{async _fetch(t){return Pa(t)}}const Na="__forcedDependency",{floor:Oa,ceil:Ba}=Math;function Wa(t,e,i,n,s,r){t[4*e+0]=Math.min(t[4*e+0],i),t[4*e+1]=Math.min(t[4*e+1],n),t[4*e+2]=Math.max(t[4*e+2],s),t[4*e+3]=Math.max(t[4*e+3],r)}const za=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Ha=new WeakMap,ja=new WeakMap;class Va{constructor(t,e){o(this,Ha,void 0),o(this,ja,void 0),d(Ha,this,t),d(ja,this,e)}get length(){return c(Ha,this).length}isEmpty(t){return c(Ha,this)[t]===za}minX(t){return c(ja,this)[4*t+0]/256}minY(t){return c(ja,this)[4*t+1]/256}maxX(t){return(c(ja,this)[4*t+2]+1)/256}maxY(t){return(c(ja,this)[4*t+3]+1)/256}}const Ua=(t,e)=>{if(!t)return;let i=t.get(e);return i||(i={dependencies:new Set,isRenderingOperation:!1},t.set(e,i)),i};var Ga=new WeakMap,qa=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,Ka=new WeakMap,Ja=new WeakMap,Qa=new WeakMap,Za=new WeakMap,$a=new WeakMap,to=new WeakMap,eo=new WeakMap,io=new WeakMap,no=new WeakMap,so=new WeakMap,ro=new WeakMap,ao=new WeakMap,oo=new WeakMap,lo=new WeakSet;class ho{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,lo),o(this,Ga,{__proto__:null}),o(this,qa,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Na]:[]}),o(this,Xa,new Map),o(this,Ya,[]),o(this,Ka,[]),o(this,Ja,[[1,0,0,1,0,0]]),o(this,Qa,[-1/0,-1/0,1/0,1/0]),o(this,Za,new Float64Array([1/0,1/0,-1/0,-1/0])),o(this,$a,-1),o(this,to,new Set),o(this,eo,new Map),o(this,io,new Map),o(this,no,void 0),o(this,so,void 0),o(this,ro,void 0),o(this,ao,void 0),o(this,oo,void 0),d(no,this,t.width),d(so,this,t.height),l(lo,this,co).call(this,e),i&&d(oo,this,new Map)}growOperationsCount(t){t>=c(ao,this).length&&l(lo,this,co).call(this,t,c(ao,this))}save(t){return d(Ga,this,{__proto__:c(Ga,this)}),d(qa,this,{__proto__:c(qa,this),transform:{__proto__:c(qa,this).transform},moveText:{__proto__:c(qa,this).moveText},sameLineText:{__proto__:c(qa,this).sameLineText},[Na]:{__proto__:c(qa,this)[Na]}}),d(Qa,this,{__proto__:c(Qa,this)}),c(Ya,this).push(t),this}restore(t){const e=Object.getPrototypeOf(c(Ga,this));if(null===e)return this;d(Ga,this,e),d(qa,this,Object.getPrototypeOf(c(qa,this))),d(Qa,this,Object.getPrototypeOf(c(Qa,this)));const i=c(Ya,this).pop();var n;void 0!==i&&(null===(n=Ua(c(oo,this),t))||void 0===n||n.dependencies.add(i),c(ao,this)[t]=c(ao,this)[i]);return this}recordOpenMarker(t){return c(Ya,this).push(t),this}getOpenMarker(){return 0===c(Ya,this).length?null:c(Ya,this).at(-1)}recordCloseMarker(t){const e=c(Ya,this).pop();var i;void 0!==e&&(null===(i=Ua(c(oo,this),t))||void 0===i||i.dependencies.add(e),c(ao,this)[t]=c(ao,this)[e]);return this}beginMarkedContent(t){return c(Ka,this).push(t),this}endMarkedContent(t){const e=c(Ka,this).pop();var i;void 0!==e&&(null===(i=Ua(c(oo,this),t))||void 0===i||i.dependencies.add(e),c(ao,this)[t]=c(ao,this)[e]);return this}pushBaseTransform(t){return c(Ja,this).push(Lt.multiplyByDOMMatrix(c(Ja,this).at(-1),t.getTransform())),this}popBaseTransform(){return c(Ja,this).length>1&&c(Ja,this).pop(),this}recordSimpleData(t,e){return c(Ga,this)[t]=e,this}recordIncrementalData(t,e){return c(qa,this)[t].push(e),this}resetIncrementalData(t,e){return c(qa,this)[t].length=0,this}recordNamedData(t,e){return c(Xa,this).set(t,e),this}recordSimpleDataFromNamed(t,e,i){var n;c(Ga,this)[t]=null!==(n=c(Xa,this).get(e))&&void 0!==n?n:i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(Na,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in c(Ga,this)&&this.recordFutureForcedDependency(e,c(Ga,this)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of c(to,this))this.recordFutureForcedDependency(Na,t);return this}resetBBox(t){return c($a,this)!==t&&(d($a,this,t),c(Za,this)[0]=1/0,c(Za,this)[1]=1/0,c(Za,this)[2]=-1/0,c(Za,this)[3]=-1/0),this}recordClipBox(t,e,i,n,s,r){const a=Lt.multiplyByDOMMatrix(c(Ja,this).at(-1),e.getTransform()),o=[1/0,1/0,-1/0,-1/0];Lt.axialAlignedBoundingBox([i,s,n,r],a,o);const l=Lt.intersect(c(Qa,this),o);return l?(c(Qa,this)[0]=l[0],c(Qa,this)[1]=l[1],c(Qa,this)[2]=l[2],c(Qa,this)[3]=l[3]):(c(Qa,this)[0]=c(Qa,this)[1]=1/0,c(Qa,this)[2]=c(Qa,this)[3]=-1/0),this}recordBBox(t,e,i,n,s,r){const a=c(Qa,this);if(a[0]===1/0)return this;const o=Lt.multiplyByDOMMatrix(c(Ja,this).at(-1),e.getTransform());if(a[0]===-1/0)return Lt.axialAlignedBoundingBox([i,s,n,r],o,c(Za,this)),this;const l=[1/0,1/0,-1/0,-1/0];return Lt.axialAlignedBoundingBox([i,s,n,r],o,l),c(Za,this)[0]=Math.min(c(Za,this)[0],Math.max(l[0],a[0])),c(Za,this)[1]=Math.min(c(Za,this)[1],Math.max(l[1],a[1])),c(Za,this)[2]=Math.max(c(Za,this)[2],Math.min(l[2],a[2])),c(Za,this)[3]=Math.max(c(Za,this)[3],Math.min(l[3],a[3])),this}recordCharacterBBox(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;const o=i.bbox;let l,h;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&c(io,this).get(i),!1!==l&&(h=[0,0,0,0],Lt.axialAlignedBoundingBox(o,i.fontMatrix,h),1===n&&0===s&&0===r||Lt.scaleMinMax([n,0,0,-n,s,r],h),l)))return this.recordBBox(t,e,h[0],h[2],h[1],h[3]);if(!a)return this.recordFullPageBBox(t);const d=a();return o&&h&&void 0===l&&(l=h[0]<=s-d.actualBoundingBoxLeft&&h[2]>=s+d.actualBoundingBoxRight&&h[1]<=r-d.actualBoundingBoxAscent&&h[3]>=r+d.actualBoundingBoxDescent,c(io,this).set(i,l),l)?this.recordBBox(t,e,h[0],h[2],h[1],h[3]):this.recordBBox(t,e,s-d.actualBoundingBoxLeft,s+d.actualBoundingBoxRight,r-d.actualBoundingBoxAscent,r+d.actualBoundingBoxDescent)}recordFullPageBBox(t){return c(Za,this)[0]=Math.max(0,c(Qa,this)[0]),c(Za,this)[1]=Math.max(0,c(Qa,this)[1]),c(Za,this)[2]=Math.min(c(no,this),c(Qa,this)[2]),c(Za,this)[3]=Math.min(c(so,this),c(Qa,this)[3]),this}getSimpleIndex(t){return c(Ga,this)[t]}recordDependencies(t,e){const i=c(to,this),n=c(Ga,this),s=c(qa,this);for(const r of e)r in c(Ga,this)?i.add(n[r]):r in s&&s[r].forEach(i.add,i);return this}recordNamedDependency(t,e){return c(Xa,this).has(e)&&c(to,this).add(c(Xa,this).get(e)),this}recordOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.recordDependencies(t,[Na]),c(oo,this)){const e=Ua(c(oo,this),t),{dependencies:i}=e;c(to,this).forEach(i.add,i),c(Ya,this).forEach(i.add,i),c(Ka,this).forEach(i.add,i),i.delete(t),e.isRenderingOperation=!0}if(c($a,this)===t){const i=Oa(256*c(Za,this)[0]/c(no,this)),n=Oa(256*c(Za,this)[1]/c(so,this)),s=Ba(256*c(Za,this)[2]/c(no,this)),r=Ba(256*c(Za,this)[3]/c(so,this));Wa(c(ro,this),t,i,n,s,r);for(const e of c(to,this))e!==t&&Wa(c(ro,this),e,i,n,s,r);for(const e of c(Ya,this))e!==t&&Wa(c(ro,this),e,i,n,s,r);for(const e of c(Ka,this))e!==t&&Wa(c(ro,this),e,i,n,s,r);e||(c(to,this).clear(),d($a,this,-1))}return this}recordShowTextOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Array.from(c(to,this));this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const n of i)this.recordIncrementalData("sameLineText",n);return this}bboxToClipBoxDropOperation(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return c($a,this)===t&&(d($a,this,-1),c(Qa,this)[0]=Math.max(c(Qa,this)[0],c(Za,this)[0]),c(Qa,this)[1]=Math.max(c(Qa,this)[1],c(Za,this)[1]),c(Qa,this)[2]=Math.min(c(Qa,this)[2],c(Za,this)[2]),c(Qa,this)[3]=Math.min(c(Qa,this)[3],c(Za,this)[3]),e||c(to,this).clear()),this}_takePendingDependencies(){const t=c(to,this);return d(to,this,new Set),t}_extractOperation(t){const e=c(eo,this).get(t);return c(eo,this).delete(t),e}_pushPendingDependencies(t){for(const e of t)c(to,this).add(e)}take(){return c(io,this).clear(),new Va(c(ao,this),c(ro,this))}takeDebugMetadata(){return c(oo,this)}}function co(t,e){const i=new ArrayBuffer(4*t);d(ro,this,new Uint8ClampedArray(i)),d(ao,this,new Uint32Array(i)),e&&e.length>0?(c(ao,this).set(e),c(ao,this).fill(za,e.length)):c(ao,this).fill(za)}var uo=new WeakMap,po=new WeakMap,go=new WeakMap,fo=new WeakMap,mo=new WeakMap;class vo{constructor(t,e,i){if(o(this,uo,void 0),o(this,po,void 0),o(this,go,void 0),o(this,fo,0),o(this,mo,0),t instanceof vo&&c(go,t)===!!i)return t;d(uo,this,t),d(po,this,e),d(go,this,!!i)}growOperationsCount(){throw new Error("Unreachable")}save(t){var e;return d(mo,this,(e=c(mo,this),e++,e)),c(uo,this).save(c(po,this)),this}restore(t){var e;c(mo,this)>0&&(c(uo,this).restore(c(po,this)),d(mo,this,(e=c(mo,this),e--,e)));return this}recordOpenMarker(t){var e;return d(fo,this,(e=c(fo,this),e++,e)),this}getOpenMarker(){return c(fo,this)>0?c(po,this):c(uo,this).getOpenMarker()}recordCloseMarker(t){var e;return d(fo,this,(e=c(fo,this),e--,e)),this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return c(uo,this).pushBaseTransform(t),this}popBaseTransform(){return c(uo,this).popBaseTransform(),this}recordSimpleData(t,e){return c(uo,this).recordSimpleData(t,c(po,this)),this}recordIncrementalData(t,e){return c(uo,this).recordIncrementalData(t,c(po,this)),this}resetIncrementalData(t,e){return c(uo,this).resetIncrementalData(t,c(po,this)),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return c(uo,this).recordSimpleDataFromNamed(t,e,c(po,this)),this}recordFutureForcedDependency(t,e){return c(uo,this).recordFutureForcedDependency(t,c(po,this)),this}inheritSimpleDataAsFutureForcedDependencies(t){return c(uo,this).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return c(uo,this).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return c(go,this)||c(uo,this).resetBBox(c(po,this)),this}recordClipBox(t,e,i,n,s,r){return c(go,this)||c(uo,this).recordClipBox(c(po,this),e,i,n,s,r),this}recordBBox(t,e,i,n,s,r){return c(go,this)||c(uo,this).recordBBox(c(po,this),e,i,n,s,r),this}recordCharacterBBox(t,e,i,n,s,r,a){return c(go,this)||c(uo,this).recordCharacterBBox(c(po,this),e,i,n,s,r,a),this}recordFullPageBBox(t){return c(go,this)||c(uo,this).recordFullPageBBox(c(po,this)),this}getSimpleIndex(t){return c(uo,this).getSimpleIndex(t)}recordDependencies(t,e){return c(uo,this).recordDependencies(c(po,this),e),this}recordNamedDependency(t,e){return c(uo,this).recordNamedDependency(c(po,this),e),this}recordOperation(t){return c(uo,this).recordOperation(c(po,this),!0),this}recordShowTextOperation(t){return c(uo,this).recordShowTextOperation(c(po,this),!0),this}bboxToClipBoxDropOperation(t){return c(go,this)||c(uo,this).bboxToClipBoxDropOperation(c(po,this),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const wo=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],bo=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],yo=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Ao=["filter","fillColor","fillAlpha"],_o=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],xo=["transform"],Eo=["transform","fillColor"],ko="Fill",Mo="Stroke",So="Shading";function Co(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class To{isModifyingCurrentTransform(){return!1}getPattern(){vt("Abstract method `getPattern` called.")}}class Po extends To{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===Mo||n===ko){const r=e.current.getClippedPathBoundingBox(n,se(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o),h=l.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-r[0],-r[1]),i=Lt.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),Co(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(l.canvas,"no-repeat");const c=new DOMMatrix(i);s.setTransform(c)}else Co(t,this._bbox),s=this._createGradient(t);return s}}function Ro(t,e,i,n,s,r,a,o){const l=e.coords,h=e.colors,c=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u);const p=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,w=(l[s+1]+e.offsetY)*e.scaleY;if(g>=w)return;const b=h[r],y=h[r+1],A=h[r+2],_=h[a],x=h[a+1],E=h[a+2],k=h[o],M=h[o+1],S=h[o+2],C=Math.round(g),T=Math.round(w);let P,R,D,L,I,F,N,O;for(let B=C;B<=T;B++){if(B<m){const t=B<g?0:(g-B)/(g-m);P=p-(p-f)*t,R=b-(b-_)*t,D=y-(y-x)*t,L=A-(A-E)*t}else{let t;t=B>w?1:m===w?0:(m-B)/(m-w),P=f-(f-v)*t,R=_-(_-k)*t,D=x-(x-M)*t,L=E-(E-S)*t}let t;t=B<g?0:B>w?1:(g-B)/(g-w),I=p-(p-v)*t,F=b-(b-k)*t,N=y-(y-M)*t,O=A-(A-S)*t;const e=Math.round(Math.min(P,I)),i=Math.round(Math.max(P,I));let n=d*B+4*e;for(let s=e;s<=i;s++)t=(P-s)/(P-I),t<0?t=0:t>1&&(t=1),c[n++]=R-(R-F)*t|0,c[n++]=D-(D-N)*t|0,c[n++]=L-(L-O)*t|0,c[n++]=255}}function Do(t,e,i){const n=e.coords,s=e.colors;let r,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,h=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<h;r++,e++)Ro(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),Ro(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(r=0,a=n.length;r<a;r+=3)Ro(t,i,n[r],n[r+1],n[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class Lo extends To{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),h=r/o,c=a/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/h,scaleY:1/c},u=o+4,p=l+4,g=i.getCanvas("mesh",u,p),f=g.context,m=f.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const v of this._figures)Do(m,v,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,n){Co(t,this._bbox);const s=new Float32Array(2);if(n===So)Lt.singularValueDecompose2dScale(se(t),s);else if(this.matrix){Lt.singularValueDecompose2dScale(this.matrix,s);const[t,i]=s;Lt.singularValueDecompose2dScale(e.baseTransform,s),s[0]*=t,s[1]*=i}else Lt.singularValueDecompose2dScale(e.baseTransform,s);const r=this._createMeshCanvas(s,n===So?null:this._background,e.cachedCanvases);return n!==So&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Io extends To{getPattern(){return"hotpink"}}const Fo=1,No=2;class Oo{constructor(t,e,i,n){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t,e){var i,n;const{bbox:s,operatorList:r,paintType:a,tilingType:o,color:l,canvasGraphicsFactory:h}=this;let{xstep:c,ystep:d}=this;c=Math.abs(c),d=Math.abs(d),ft("TilingType: "+o);const u=s[0],p=s[1],g=s[2],f=s[3],m=g-u,v=f-p,w=new Float32Array(2);Lt.singularValueDecompose2dScale(this.matrix,w);const[b,y]=w;Lt.singularValueDecompose2dScale(this.baseTransform,w);const A=b*w[0],_=y*w[1];let x=m,E=v,k=!1,M=!1;const S=Math.ceil(c*A),C=Math.ceil(d*_);S>=Math.ceil(m*A)?x=c:k=!0,C>=Math.ceil(v*_)?E=d:M=!0;const T=this.getSizeAndScale(x,this.ctx.canvas.width,A),P=this.getSizeAndScale(E,this.ctx.canvas.height,_),R=t.cachedCanvases.getCanvas("pattern",T.size,P.size),D=R.context,L=h.createCanvasGraphics(D,e);if(L.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(L,a,l),D.translate(-T.scale*u,-P.scale*p),L.transform(0,T.scale,0,0,P.scale,0,0),D.save(),null===(i=L.dependencyTracker)||void 0===i||i.save(),this.clipBbox(L,u,p,g,f),L.baseTransform=se(L.ctx),L.executeOperatorList(r),L.endDrawing(),null===(n=L.dependencyTracker)||void 0===n||n.restore(),D.restore(),k||M){const e=R.canvas;k&&(x=c),M&&(E=d);const i=this.getSizeAndScale(x,this.ctx.canvas.width,A),n=this.getSizeAndScale(E,this.ctx.canvas.height,_),s=i.size,r=n.size,a=t.cachedCanvases.getCanvas("pattern-workaround",s,r),o=a.context,l=k?Math.floor(m/c):0,h=M?Math.floor(v/d):0;for(let t=0;t<=l;t++)for(let i=0;i<=h;i++)o.drawImage(e,s*t,r*i,s,r,0,0,s,r);return{canvas:a.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:u,offsetY:p}}return{canvas:R.canvas,scaleX:T.scale,scaleY:P.scale,offsetX:u,offsetY:p}}getSizeAndScale(t,e,i){const n=Math.max(Oo.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const r=n-e,a=s-i;t.ctx.rect(e,i,r,a),Lt.axialAlignedBoundingBox([e,i,n,s],se(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Fo:const{fillStyle:t,strokeStyle:r}=this.ctx;n.fillStyle=s.fillColor=t,n.strokeStyle=s.strokeColor=r;break;case No:n.fillStyle=n.strokeStyle=i,s.fillColor=s.strokeColor=i;break;default:throw new St("Unsupported paint type: ".concat(e))}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,s){let r=i;n!==So&&(r=Lt.transform(r,e.baseTransform),this.matrix&&(r=Lt.transform(r,this.matrix)));const a=this.createPatternCanvas(e,s);let o=new DOMMatrix(r);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return l.setTransform(o),l}}function Bo(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=Rt.isLittleEndian?4278190080:255,[h,c]=o?[a,l]:[l,a],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let g=0;for(let f=0;f<r;f++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[g++]=128&t?c:h,n[g++]=64&t?c:h,n[g++]=32&t?c:h,n[g++]=16&t?c:h,n[g++]=8&t?c:h,n[g++]=4&t?c:h,n[g++]=2&t?c:h,n[g++]=1&t?c:h}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[g++]=t&1<<7-e?c:h}return{srcPos:i,destPos:g}}(0,P.A)(Oo,"MAX_PATTERN_SIZE",3e3);const Wo=16,zo=new DOMMatrix,Ho=new Float32Array(2),jo=new Float32Array([1/0,1/0,-1/0,-1/0]);class Vo{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Uo(t,e,i,n,s,r,a,o,l,h){const[c,d,u,p,g,f]=se(t);if(0===d&&0===u){const m=a*c+g,v=Math.round(m),w=o*p+f,b=Math.round(w),y=(a+l)*c+g,A=Math.abs(Math.round(y)-v)||1,_=(o+h)*p+f,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,b),t.drawImage(e,i,n,s,r,0,0,A,x),t.setTransform(c,d,u,p,g,f),[A,x]}if(0===c&&0===p){const m=o*u+g,v=Math.round(m),w=a*d+f,b=Math.round(w),y=(o+h)*u+g,A=Math.abs(Math.round(y)-v)||1,_=(a+l)*d+f,x=Math.abs(Math.round(_)-b)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,b),t.drawImage(e,i,n,s,r,0,0,x,A),t.setTransform(c,d,u,p,g,f),[x,A]}t.drawImage(e,i,n,s,r,a,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class Go{constructor(t,e,i){(0,P.A)(this,"alphaIsShape",!1),(0,P.A)(this,"fontSize",0),(0,P.A)(this,"fontSizeScale",1),(0,P.A)(this,"textMatrix",null),(0,P.A)(this,"textMatrixScale",1),(0,P.A)(this,"fontMatrix",L),(0,P.A)(this,"leading",0),(0,P.A)(this,"x",0),(0,P.A)(this,"y",0),(0,P.A)(this,"lineX",0),(0,P.A)(this,"lineY",0),(0,P.A)(this,"charSpacing",0),(0,P.A)(this,"wordSpacing",0),(0,P.A)(this,"textHScale",1),(0,P.A)(this,"textRenderingMode",X),(0,P.A)(this,"textRise",0),(0,P.A)(this,"fillColor","#000000"),(0,P.A)(this,"strokeColor","#000000"),(0,P.A)(this,"patternFill",!1),(0,P.A)(this,"patternStroke",!1),(0,P.A)(this,"fillAlpha",1),(0,P.A)(this,"strokeAlpha",1),(0,P.A)(this,"lineWidth",1),(0,P.A)(this,"activeSMask",null),(0,P.A)(this,"transferMaps","none"),null===i||void 0===i||i(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=jo.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ko,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.minMax.slice();if(t===Mo){e||vt("Stroke bounding box must include transform."),Lt.singularValueDecompose2dScale(e,Ho);const t=Ho[0]*this.lineWidth/2,n=Ho[1]*this.lineWidth/2;i[0]-=t,i[1]-=n,i[2]+=t,i[3]+=n}return i}updateClipFromPath(){const t=Lt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(jo,0)}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ko,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Lt.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function qo(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Wo,r=(i-s)/Wo,a=0===s?r:r+1,o=t.createImageData(n,Wo);let l,h=0;const c=e.data,d=o.data;let u,p,g,f;if(e.kind===$.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),f=i.length,m=n+7>>3,v=4294967295,w=Rt.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(g=u<r?Wo:s,l=0,p=0;p<g;p++){const t=e-h;let s=0;const r=t>m?n:8*t-7,a=-8&r;let o=0,d=0;for(;s<a;s+=8)d=c[h++],i[l++]=128&d?v:w,i[l++]=64&d?v:w,i[l++]=32&d?v:w,i[l++]=16&d?v:w,i[l++]=8&d?v:w,i[l++]=4&d?v:w,i[l++]=2&d?v:w,i[l++]=1&d?v:w;for(;s<r;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:w,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*Wo)}}else if(e.kind===$.RGBA_32BPP){for(p=0,f=n*Wo*4,u=0;u<r;u++)d.set(c.subarray(h,h+f)),h+=f,t.putImageData(o,0,p),p+=Wo;u<a&&(f=n*s*4,d.set(c.subarray(h,h+f)),t.putImageData(o,0,p))}else{if(e.kind!==$.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(g=Wo,f=n*g,u=0;u<a;u++){for(u>=r&&(g=s,f=n*g),l=0,p=f;p--;)d[l++]=c[h++],d[l++]=c[h++],d[l++]=c[h++],d[l++]=255;t.putImageData(o,0,u*Wo)}}}function Xo(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Wo,r=(i-s)/Wo,a=0===s?r:r+1,o=t.createImageData(n,Wo);let l=0;const h=e.data,c=o.data;for(let d=0;d<a;d++){const e=d<r?Wo:s;({srcPos:l}=Bo({src:h,srcPos:l,dest:c,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Wo)}}function Yo(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Ko(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function Jo(t,e){if(e)return!0;Lt.singularValueDecompose2dScale(t,Ho);const i=Math.fround(oe.pixelRatio*Gt.PDF_TO_CSS_UNITS);return Ho[0]<=i&&Ho[1]<=i}const Qo=["butt","round","square"],Zo=["miter","round","bevel"],$o={},tl={};var el=new WeakSet;class il{constructor(t,e,i,n,s,r,o,l,h){let{optionalContentConfig:c,markedContentStack:d=null}=r;a(this,el),this.ctx=t,this.current=new Go(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=d||[],this.optionalContentConfig=c,this.cachedCanvases=new Vo(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=null!==h&&void 0!==h?h:null}getObject(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n;return"string"===typeof e?(null===(n=this.dependencyTracker)||void 0===n||n.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...se(this.compositeCtx))}this.ctx.save(),Ko(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=se(this.ctx)}executeOperatorList(t,e,i,n,s){const r=t.argsArray,a=t.fnArray;let o=e||0;const l=r.length;if(l===o)return o;const h=l-o>10&&"function"===typeof i,c=h?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g,f;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,i),o;var m;if(!s||s(o))if(g=a[o],f=null!==(m=r[o])&&void 0!==m?m:null,g!==ot.dependency)null===f?this[g](o):this[g](o,...f);else for(const t of f){var v;null===(v=this.dependencyTracker)||void 0===v||v.recordNamedData(t,o);const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,i),o}if(o++,o===l)return o;if(h&&++d>10){if(Date.now()>c)return i(),o;d=0}}}endDrawing(){l(el,this,nl).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),l(el,this,sl).call(this)}_scaleImage(t,e){var i,n;const s=null!==(i=t.width)&&void 0!==i?i:t.displayWidth,r=null!==(n=t.height)&&void 0!==n?n:t.displayHeight;let a,o,l=Math.max(Math.hypot(e[0],e[1]),1),h=Math.max(Math.hypot(e[2],e[3]),1),c=s,d=r,u="prescale1";for(;l>2&&c>1||h>2&&d>1;){let e=c,i=d;l>2&&c>1&&(e=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),l/=c/e),h>2&&d>1&&(i=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,h/=d/i),a=this.cachedCanvases.getCanvas(u,e,i),o=a.context,o.clearRect(0,0,e,i),o.drawImage(t,0,0,c,d,0,0,e,i),t=a.canvas,c=e,d=i,u="prescale1"===u?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:d}}_createMaskCanvas(t,e){var i;const n=this.ctx,{width:s,height:r}=e,a=this.current.fillColor,o=this.current.patternFill,l=se(n);let h,c,d,u;if((e.bitmap||e.data)&&e.count>1){const i=e.bitmap||e.data.buffer;c=JSON.stringify(o?l:[l.slice(0,4),a]),h=this._cachedBitmapsMap.get(i),h||(h=new Map,this._cachedBitmapsMap.set(i,h));const n=h.get(c);if(n&&!o){var p;const e=Math.round(Math.min(l[0],l[2])+l[4]),i=Math.round(Math.min(l[1],l[3])+l[5]);return null===(p=this.dependencyTracker)||void 0===p||p.recordDependencies(t,Eo),{canvas:n,offsetX:e,offsetY:i}}d=n}d||(u=this.cachedCanvases.getCanvas("maskCanvas",s,r),Xo(u.context,e));let g=Lt.transform(l,[1/s,0,0,-1/r,0,0]);g=Lt.transform(g,[1,0,0,1,0,-r]);const f=jo.slice();Lt.axialAlignedBoundingBox([0,0,s,r],g,f);const[m,v,w,b]=f,y=Math.round(w-m)||1,A=Math.round(b-v)||1,_=this.cachedCanvases.getCanvas("fillCanvas",y,A),x=_.context,E=m,k=v;x.translate(-E,-k),x.transform(...g),d||(d=this._scaleImage(u.canvas,re(x)),d=d.img,h&&o&&h.set(c,d)),x.imageSmoothingEnabled=Jo(se(x),e.interpolate),Uo(x,d,0,0,d.width,d.height,0,0,s,r),x.globalCompositeOperation="source-in";const M=Lt.transform(re(x),[1,0,0,1,-E,-k]);return x.fillStyle=o?a.getPattern(n,this,M,ko,t):a,x.fillRect(0,0,s,r),h&&!o&&(this.cachedCanvases.delete("fillCanvas"),h.set(c,_.canvas)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Eo),{canvas:_.canvas,offsetX:Math.round(E),offsetY:Math.round(k)}}setLineWidth(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineCap",t),this.ctx.lineCap=Qo[e]}setLineJoin(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("lineJoin",t),this.ctx.lineJoin=Zo[e]}setMiterLimit(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("dash",t);const s=this.ctx;void 0!==s.setLineDash&&(s.setLineDash(e),s.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var i,n,s,r,a;for(const[o,l]of e)switch(o){case"LW":this.setLineWidth(t,l);break;case"LC":this.setLineCap(t,l);break;case"LJ":this.setLineJoin(t,l);break;case"ML":this.setMiterLimit(t,l);break;case"D":this.setDash(t,l[0],l[1]);break;case"RI":this.setRenderingIntent(t,l);break;case"FL":this.setFlatness(t,l);break;case"Font":this.setFont(t,l[0],l[1]);break;case"CA":null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=l;break;case"ca":null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=l;break;case"BM":null===(s=this.dependencyTracker)||void 0===s||s.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=l;break;case"SMask":null===(r=this.dependencyTracker)||void 0===r||r.recordSimpleData("SMask",t),this.current.activeSMask=l?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":null===(a=this.dependencyTracker)||void 0===a||a.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(l)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,e,i);this.suspendedCtx=this.ctx;const r=this.ctx=s.context;r.setTransform(this.suspendedCtx.getTransform()),Yo(this.suspendedCtx,r),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,r,a){e.transform(t,i,n,s,r,a),this.__originalTransform(t,i,n,s,r,a)},t.setTransform=function(t,i,n,s,r,a){e.setTransform(t,i,n,s,r,a),this.__originalSetTransform(t,i,n,s,r,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,r,a){e.bezierCurveTo(t,i,n,s,r,a),this.__originalBezierCurveTo(t,i,n,s,r,a)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(r,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Yo(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,o=n[3]-r;0!==a&&0!==o&&(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,o,l,h,c){let d=t.canvas,u=o-h,p=l-c;if(r)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),e.globalCompositeOperation="destination-atop",e.fillStyle=r,e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over",d=t.canvas,u=p=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const g=new Path2D;g.rect(o,l,i,n),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(t){var e;this.inSMaskMode&&Yo(this.ctx,this.suspendedCtx),this.ctx.save();const i=this.current;this.stateStack.push(i),this.current=i.clone(),null===(e=this.dependencyTracker)||void 0===e||e.save(t)}restore(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.restore(t),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Yo(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,i,n,s,r,a){var o;null===(o=this.dependencyTracker)||void 0===o||o.recordIncrementalData("transform",t),this.ctx.transform(e,i,n,s,r,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,n){let[s]=i;if(!n)return s||(s=i[0]=new Path2D),void this[e](t,s);if(null!==this.dependencyTracker){const i=e===ot.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,n[0]-i,n[2]+i,n[1]-i,n[3]+i).recordDependencies(t,["transform"])}if(!(s instanceof Path2D)){const t=i[0]=new Path2D;for(let e=0,i=s.length;e<i;)switch(s[e++]){case lt:t.moveTo(s[e++],s[e++]);break;case ht:t.lineTo(s[e++],s[e++]);break;case ct:t.bezierCurveTo(s[e++],s[e++],s[e++],s[e++],s[e++],s[e++]);break;case dt:t.closePath();break;default:mt("Unrecognized drawing path operator: ".concat(s[e-1]))}s=t}Lt.axialAlignedBoundingBox(n,se(this.ctx),this.current.minMax),this[e](t,s),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"===typeof r&&null!==r&&void 0!==r&&r.getPattern){const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=r.getPattern(s,this,re(s),Mo,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}this.rescaleAndStroke(e,!1),s.restore()}else this.rescaleAndStroke(e,!0);null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,wo),n&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Mo,se(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e){var i;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const s=this.ctx,r=this.current.fillColor;let a=!1;if(this.current.patternFill){var o;const i=r.isModifyingCurrentTransform()?s.getTransform():null;if(null===(o=this.dependencyTracker)||void 0===o||o.save(t),s.save(),s.fillStyle=r.getPattern(s,this,re(s),ko,t),i){const t=new Path2D;t.addPath(e,s.getTransform().invertSelf().multiplySelf(i)),e=t}a=!0}const l=this.current.getClippedPathBoundingBox();var h;(this.contentVisible&&null!==l&&(this.pendingEOFill?(s.fill(e,"evenodd"),this.pendingEOFill=!1):s.fill(e)),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,bo),a)&&(s.restore(),null===(h=this.dependencyTracker)||void 0===h||h.restore(t));n&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){var i;this.ctx.fill(e),null===(i=this.dependencyTracker)||void 0===i||i.recordDependencies(t,Ao).recordOperation(t)}clip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=$o}eoClip(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=tl}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,null===(e=this.dependencyTracker)||void 0===e||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;void 0!==e&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(void 0!==e){const t=new Path2D,n=i.getTransform().invertSelf();for(const{transform:i,x:s,y:r,fontSize:a,path:o}of e)o&&t.addPath(o,new DOMMatrix(i).preMultiplySelf(n).translate(s,r).scale(a,-a));i.clip(t)}delete this.pendingTextPaths}setCharSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){var n,s;null===(n=this.dependencyTracker)||void 0===n||n.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const r=this.commonObjs.get(e),a=this.current;if(!r)throw new Error("Can't find font for ".concat(e));if(a.fontMatrix=r.fontMatrix||L,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||mt("Invalid font matrix for font "+e),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=r,this.current.fontSize=i,r.isType3Font)return;const o=r.loadedName||"sans-serif",l=(null===(s=r.systemFontInfo)||void 0===s?void 0:s.css)||'"'.concat(o,'", ').concat(r.fallbackName);let h="normal";r.black?h="900":r.bold&&(h="bold");const c=r.italic?"italic":"normal";let d=i;i<16?d=16:i>100&&(d=100),this.current.fontSizeScale=i/d,this.ctx.font="".concat(c," ").concat(h," ").concat(d,"px ").concat(l)}setTextRenderingMode(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("textMatrix",t);const{current:n}=this;n.textMatrix=e,n.textMatrixScale=Math.hypot(e[0],e[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(t){var e,i;this.moveText(t,0,this.current.leading),null===(e=this.dependencyTracker)||void 0===e||e.recordIncrementalData("moveText",null!==(i=this.dependencyTracker.getSimpleIndex("leading"))&&void 0!==i?i:t)}paintChar(t,e,i,n,s,r){const a=this.ctx,o=this.current,h=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=c&Q,p=!!(c&Z),g=o.patternFill&&!h.missingFile,f=o.patternStroke&&!h.missingFile;let m;if((h.disableFontFace||p||g||f)&&!h.missingFile&&(m=h.getPathGenerator(this.commonObjs,e)),m&&(h.disableFontFace||g||f)){var v;let e;if(a.save(),a.translate(i,n),a.scale(d,-d),null===(v=this.dependencyTracker)||void 0===v||v.recordCharacterBBox(t,a,h),u===X||u===K)if(s){e=a.getTransform(),a.setTransform(...s);const t=l(el,this,rl).call(this,m,e,s);a.fill(t)}else a.fill(m);if(u===Y||u===K)if(r){e||(e=a.getTransform()),a.setTransform(...r);const{a:t,b:i,c:n,d:s}=e,o=Lt.inverseTransform(r),h=Lt.transform([t,i,n,s,0,0],o);Lt.singularValueDecompose2dScale(h,Ho),a.lineWidth*=Math.max(Ho[0],Ho[1])/d,a.stroke(l(el,this,rl).call(this,m,e,r))}else a.lineWidth/=d,a.stroke(m);a.restore()}else{var w;if(u===X||u===K)a.fillText(e,i,n),null===(w=this.dependencyTracker)||void 0===w||w.recordCharacterBBox(t,a,h,d,i,n,()=>a.measureText(e));if(u===Y||u===K){var b;if(this.dependencyTracker)null===(b=this.dependencyTracker)||void 0===b||b.recordCharacterBBox(t,a,h,d,i,n,()=>a.measureText(e)).recordDependencies(t,wo);a.strokeText(e,i,n)}}if(p){var y;(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:se(a),x:i,y:n,fontSize:d,path:m}),null===(y=this.dependencyTracker)||void 0===y||y.recordCharacterBBox(t,a,h,d,i,n)}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return At(this,"isFontSubpixelAAEnabled",i)}showText(t,e){var i;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,_o).resetBBox(t),this.current.textRenderingMode&Z&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,s=n.font;var r;if(s.isType3Font)return this.showType3Text(t,e),void(null===(r=this.dependencyTracker)||void 0===r||r.recordShowTextOperation(t));const a=n.fontSize;var o;if(0===a)return void(null===(o=this.dependencyTracker)||void 0===o||o.recordOperation(t));const l=this.ctx,h=n.fontSizeScale,c=n.charSpacing,d=n.wordSpacing,u=n.fontDirection,p=n.textHScale*u,g=e.length,f=s.vertical,m=f?1:-1,v=s.defaultVMetrics,w=a*n.fontMatrix[0],b=n.textRenderingMode===X&&!s.disableFontFace&&!n.patternFill;let y,A;if(l.save(),n.textMatrix&&l.transform(...n.textMatrix),l.translate(n.x,n.y+n.textRise),u>0?l.scale(p,-1):l.scale(p,1),n.patternFill){l.save();const e=n.fillColor.getPattern(l,this,re(l),ko,t);y=se(l),l.restore(),l.fillStyle=e}if(n.patternStroke){l.save();const e=n.strokeColor.getPattern(l,this,re(l),Mo,t);A=se(l),l.restore(),l.strokeStyle=e}let _=n.lineWidth;const x=n.textMatrixScale;if(0===x||0===_){const t=n.textRenderingMode&Q;t!==Y&&t!==K||(_=this.getSinglePixelWidth())}else _/=x;if(1!==h&&(l.scale(h,h),_/=h),l.lineWidth=_,s.isInvalidPDFjsFont){const i=[];let s=0;for(const t of e)i.push(t.unicode),s+=t.width;const r=i.join("");if(l.fillText(r,0,0),null!==this.dependencyTracker){const e=l.measureText(r);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}return n.x+=s*w*p,l.restore(),void this.compose()}let E,k=0;for(E=0;E<g;++E){const i=e[E];if("number"===typeof i){k+=m*i*a/1e3;continue}let n=!1;const r=(i.isSpace?d:0)+c,o=i.fontChar,p=i.accent;let g,_,x,S=i.width;if(f){const t=i.vmetric||v,e=-(i.vmetric?t[1]:.5*S)*w,n=t[2]*w;S=t?-t[0]:S,g=e/h,_=(k+n)/h}else g=k/h,_=0;if(s.remeasure&&S>0){x=l.measureText(o);const t=1e3*x.width/a*h;if(S<t&&this.isFontSubpixelAAEnabled){const e=S/t;n=!0,l.save(),l.scale(e,1),g/=e}else S!==t&&(g+=(S-t)/2e3*a/h)}var M;if(this.contentVisible&&(i.isInFont||s.missingFile))if(b&&!p)l.fillText(o,g,_),null===(M=this.dependencyTracker)||void 0===M||M.recordCharacterBBox(t,l,x?{bbox:null}:s,a/h,g,_,()=>null!==x&&void 0!==x?x:l.measureText(o));else if(this.paintChar(t,o,g,_,y,A),p){const e=g+a*p.offset.x/h,i=_-a*p.offset.y/h;this.paintChar(t,p.fontChar,e,i,y,A)}k+=f?S*w-r*u:S*w+r*u,n&&l.restore()}f?n.y-=k:n.x+=k*p,l.restore(),this.compose(),null===(i=this.dependencyTracker)||void 0===i||i.recordShowTextOperation(t)}showType3Text(t,e){const i=this.ctx,n=this.current,s=n.font,r=n.fontSize,a=n.fontDirection,o=s.vertical?1:-1,l=n.charSpacing,h=n.wordSpacing,c=n.textHScale*a,d=n.fontMatrix||L,u=e.length;let p,g,f,m;if(n.textRenderingMode===J||0===r)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(c,a);const v=this.dependencyTracker;for(this.dependencyTracker=v?new vo(v,t):null,p=0;p<u;++p){if(g=e[p],"number"===typeof g){m=o*g*r/1e3,this.ctx.translate(m,0),n.x+=m*c;continue}const t=(g.isSpace?h:0)+l,a=s.charProcOperatorList[g.operatorListId];a?this.contentVisible&&(this.save(),i.scale(r,r),i.transform(...d),this.executeOperatorList(a),this.restore()):mt('Type3 character "'.concat(g.operatorListId,'" is not available.'));const u=[g.width,0];Lt.applyTransform(u,d),f=u[0]*r+t,i.translate(f,0),n.x+=f*c}i.restore(),v&&(this.dependencyTracker=v)}setCharWidth(t,e,i){}setCharWidthAndBounds(t,e,i,n,s,r,a){var o;const l=new Path2D;l.rect(n,s,r-n,a-s),this.ctx.clip(l),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,this.ctx,n,r,s,a).recordClipBox(t,this.ctx,n,r,s,a),this.endPath(t)}getColorN_Pattern(t,e){let i;if("TilingPattern"===e[0]){const t=this.baseTransform||se(this.ctx),n={createCanvasGraphics:(t,e)=>new il(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new vo(this.dependencyTracker,e,!0):null)};i=new Oo(e,this.ctx,n,t)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.strokeColor=this.getColorN_Pattern(t,n),this.current.patternStroke=!0}setFillColorN(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];this.current.fillColor=this.getColorN_Pattern(t,n),this.current.patternFill=!0}setStrokeRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=function(t){switch(t[0]){case"RadialAxial":return new Po(t);case"Mesh":return new Lo(t);case"Dummy":return new Io}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t,e)),this.cachedPatterns.set(e,i)),n&&(i.matrix=n),i}shadingFill(t,e){var i;if(!this.contentVisible)return;const n=this.ctx;this.save(t);const s=this._getPattern(t,e);n.fillStyle=s.getPattern(n,this,re(n),So,t);const r=re(n);if(r){const{width:t,height:e}=n.canvas,i=jo.slice();Lt.axialAlignedBoundingBox([0,0,t,e],r,i);const[s,a,o,l]=i;this.ctx.fillRect(s,a,o-s,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,xo).recordDependencies(t,bo).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){vt("Should not call beginInlineImage")}beginImageData(){vt("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=se(this.ctx),i)){var n;Lt.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[e,s,r,a]=i,o=new Path2D;o.rect(e,s,r-e,a-s),this.ctx.clip(o),null===(n=this.dependencyTracker)||void 0===n||n.recordClipBox(t,this.ctx,e,r,s,a),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var i;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||ft("TODO: Support non-isolated groups."),e.knockout&&mt("Knockout groups not supported.");const s=se(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=jo.slice();Lt.axialAlignedBoundingBox(e.bbox,se(n),r);const a=[0,0,n.canvas.width,n.canvas.height];r=Lt.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),l=Math.floor(r[1]),h=Math.max(Math.ceil(r[2])-o,1),c=Math.max(Math.ceil(r[3])-l,1);this.current.startNewPathAndClipBox([0,0,h,c]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,h,c),p=u.context;p.translate(-o,-l),p.transform(...s);let g=new Path2D;const[f,m,v,w]=e.bbox;if(g.rect(f,m,v-f,w-m),e.matrix){const t=new Path2D;t.addPath(g,new DOMMatrix(e.matrix)),g=t}p.clip(g),e.smask&&this.smaskStack.push({canvas:u.canvas,context:p,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),e.smask&&!this.dependencyTracker||(n.setTransform(1,0,0,1,0,0),n.translate(o,l),n.save()),Yo(n,p),this.ctx=p,null===(i=this.dependencyTracker)||void 0===i||i.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(t,e){var i;if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,null===(i=this.dependencyTracker)||void 0===i||i.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const e=se(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...e);const i=jo.slice();Lt.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],e,i),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s,r){if(l(el,this,nl).call(this),Ko(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(r&&this.annotationCanvasMap){(n=n.slice())[4]-=i[0],n[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=s,i[3]=a,Lt.singularValueDecompose2dScale(se(this.ctx),Ho);const{viewportScale:t}=this,r=Math.ceil(s*this.outputScaleX*t),o=Math.ceil(a*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(r,o);const{canvas:l,context:h}=this.annotationCanvas;this.annotationCanvasMap.set(e,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=h,this.ctx.save(),this.ctx.setTransform(Ho[0],0,0,-Ho[1],0,a*Ho[1]),Ko(this.ctx)}else{Ko(this.ctx),this.endPath(t);const e=new Path2D;e.rect(i[0],i[1],s,a),this.ctx.clip(e)}}this.current=new Go(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...n),this.transform(t,...s)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),l(el,this,sl).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var i;if(!this.contentVisible)return;const n=e.count;(e=this.getObject(t,e.data,e)).count=n;const s=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,r.offsetX,r.offsetY),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i){var n,s;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const h=this.ctx;h.save();const c=se(h);h.transform(i,r,a,o,0,0);const d=this._createMaskCanvas(t,e);h.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]),null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(let p=0,g=l.length;p<g;p+=2){var u;const e=Lt.transform(c,[i,r,a,o,l[p],l[p+1]]);h.drawImage(d.canvas,e[4],e[5]),null===(u=this.dependencyTracker)||void 0===u||u.recordBBox(t,this.ctx,e[4],e[4]+d.canvas.width,e[5],e[5]+d.canvas.height)}h.restore(),this.compose(),null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var i,n;if(!this.contentVisible)return;const s=this.ctx,r=this.current.fillColor,a=this.current.patternFill;null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordDependencies(t,Eo);for(const l of e){var o;const{data:e,width:i,height:n,transform:h}=l,c=this.cachedCanvases.getCanvas("maskCanvas",i,n),d=c.context;d.save();Xo(d,this.getObject(t,e,l)),d.globalCompositeOperation="source-in",d.fillStyle=a?r.getPattern(d,this,re(s),ko,t):r,d.fillRect(0,0,i,n),d.restore(),s.save(),s.transform(...h),s.scale(1,-1),Uo(s,c.canvas,0,0,i,n,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,s,0,i,0,n),s.restore()}this.compose(),null===(n=this.dependencyTracker)||void 0===n||n.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);i?this.paintInlineImageXObject(t,i):mt("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n,s){if(!this.contentVisible)return;const r=this.getObject(t,e);if(!r)return void mt("Dependent image isn't ready yet");const a=r.width,o=r.height,l=[];for(let h=0,c=s.length;h<c;h+=2)l.push({transform:[i,0,0,n,s[h],s[h+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(t,r,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t,e){var i;if(!this.contentVisible)return;const n=e.width,s=e.height,r=this.ctx;this.save(t);const{filter:a}=r;let o;if("none"!==a&&""!==a&&(r.filter="none"),r.scale(1/n,-1/s),e.bitmap)o=this.applyTransferMapsToBitmap(e);else if("function"===typeof HTMLElement&&e instanceof HTMLElement||!e.data)o=e;else{const t=this.cachedCanvases.getCanvas("inlineImage",n,s).context;qo(t,e),o=this.applyTransferMapsToCanvas(t)}const l=this._scaleImage(o,re(r));r.imageSmoothingEnabled=Jo(se(r),e.interpolate),null===(i=this.dependencyTracker)||void 0===i||i.resetBBox(t).recordBBox(t,r,0,n,-s,0).recordDependencies(t,yo).recordOperation(t),Uo(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-s,n,s),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,i){var n,s;if(!this.contentVisible)return;const r=this.ctx;let a;if(e.bitmap)a=e.bitmap;else{const t=e.width,i=e.height,n=this.cachedCanvases.getCanvas("inlineImage",t,i).context;qo(n,e),a=this.applyTransferMapsToCanvas(n)}null===(n=this.dependencyTracker)||void 0===n||n.resetBBox(t);for(const l of i){var o;r.save(),r.transform(...l.transform),r.scale(1,-1),Uo(r,a,l.x,l.y,l.w,l.h,0,-1,1,1),null===(o=this.dependencyTracker)||void 0===o||o.recordBBox(t,r,0,1,-1,0),r.restore()}null===(s=this.dependencyTracker)||void 0===s||s.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&(null===(e=this.dependencyTracker)||void 0===e||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,bo).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,i){}beginMarkedContent(t,e){var i;null===(i=this.dependencyTracker)||void 0===i||i.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){var n;null===(n=this.dependencyTracker)||void 0===n||n.beginMarkedContent(t),"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;null===(e=this.dependencyTracker)||void 0===e||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;var r,a;this.pendingClip?(n||(this.pendingClip===tl?s.clip(e,"evenodd"):s.clip(e)),this.pendingClip=null,null===(r=this.dependencyTracker)||void 0===r||r.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):null===(a=this.dependencyTracker)||void 0===a||a.recordOperation(t);this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=se(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)r=a=1/i;else{const e=i*t;r=a=e<1?1/e:1}else if(0===t)r=1/i,a=1/n;else{const e=i*t,s=n*t;r=e<1?1/e:1,a=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),h=Math.hypot(n,s);if(0===t)r=h/o,a=l/o;else{const e=t*o;r=h>e?h/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[s,r]=this.getScaleForStroking();if(s===r)return i.lineWidth=(n||1)*s,void i.stroke(t);const a=i.getLineDash();e&&i.save(),i.scale(s,r),zo.a=1/s,zo.d=1/r;const o=new Path2D;if(o.addPath(t,zo),a.length>0){const t=Math.max(s,r);i.setLineDash(a.map(e=>e/t)),i.lineDashOffset/=t}i.lineWidth=n||1,i.stroke(o),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function nl(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function sl(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}function rl(t,e,i){const n=new Path2D;return n.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),n}for(const Dv in ot)void 0!==il.prototype[Dv]&&(il.prototype[ot[Dv]]=il.prototype[Dv]);var al=new WeakMap,ol=new WeakMap,ll=new WeakMap,hl=new WeakSet;class cl{static write(t){const e=new TextEncoder,i={};let n=0;for(const l of cl.strings){const s=e.encode(t[l]);i[l]=s,n+=4+s.length}const s=new ArrayBuffer(n),r=new Uint8Array(s),a=new DataView(s);let o=0;for(const l of cl.strings){const t=i[l],e=t.length;a.setUint32(o,e),r.set(t,o+4),o+=4+e}return wt(o===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}constructor(t){a(this,hl),o(this,al,void 0),o(this,ol,void 0),o(this,ll,void 0),d(al,this,t),d(ol,this,new DataView(c(al,this))),d(ll,this,new TextDecoder)}get fontFamily(){return l(hl,this,dl).call(this,0)}get fontWeight(){return l(hl,this,dl).call(this,1)}get italicAngle(){return l(hl,this,dl).call(this,2)}}function dl(t){wt(t<v.strings.length,"Invalid string index");let e=0;for(let n=0;n<t;n++)e+=c(ol,this).getUint32(e)+4;const i=c(ol,this).getUint32(e);return c(ll,this).decode(new Uint8Array(c(al,this),e+4,i))}v=cl,(0,P.A)(cl,"strings",["fontFamily","fontWeight","italicAngle"]);var ul=new WeakMap,pl=new WeakMap,gl=new WeakMap,fl=new WeakSet;class ml{static write(t){const e=new TextEncoder,i={};let n=0;for(const d of ml.strings){const s=e.encode(t[d]);i[d]=s,n+=4+s.length}n+=4;let s,r,a=1+n;t.style&&(s=e.encode(t.style.style),r=e.encode(t.style.weight),a+=4+s.length+4+r.length);const o=new ArrayBuffer(a),l=new Uint8Array(o),h=new DataView(o);let c=0;h.setUint8(c++,t.guessFallback?1:0),h.setUint32(c,0),c+=4,n=0;for(const d of ml.strings){const t=i[d],e=t.length;n+=4+e,h.setUint32(c,e),l.set(t,c+4),c+=4+e}return h.setUint32(c-n-4,n),t.style&&(h.setUint32(c,s.length),l.set(s,c+4),c+=4+s.length,h.setUint32(c,r.length),l.set(r,c+4),c+=4+r.length),wt(c<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(c)}constructor(t){a(this,fl),o(this,ul,void 0),o(this,pl,void 0),o(this,gl,void 0),d(ul,this,t),d(pl,this,new DataView(c(ul,this))),d(gl,this,new TextDecoder)}get guessFallback(){return 0!==c(pl,this).getUint8(0)}get css(){return l(fl,this,vl).call(this,0)}get loadedName(){return l(fl,this,vl).call(this,1)}get baseFontName(){return l(fl,this,vl).call(this,2)}get src(){return l(fl,this,vl).call(this,3)}get style(){let t=1;t+=4+c(pl,this).getUint32(t);const e=c(pl,this).getUint32(t),i=c(gl,this).decode(new Uint8Array(c(ul,this),t+4,e));t+=4+e;const n=c(pl,this).getUint32(t);return{style:i,weight:c(gl,this).decode(new Uint8Array(c(ul,this),t+4,n))}}}function vl(t){wt(t<w.strings.length,"Invalid string index");let e=5;for(let n=0;n<t;n++)e+=c(pl,this).getUint32(e)+4;const i=c(pl,this).getUint32(e);return c(gl,this).decode(new Uint8Array(c(ul,this),e+4,i))}w=ml,(0,P.A)(ml,"strings",["css","loadedName","baseFontName","src"]);var wl=new WeakMap,bl=new WeakMap,yl=new WeakMap,Al=new WeakSet;class _l{constructor(t){let{data:e,extra:i}=t;a(this,Al),o(this,wl,void 0),o(this,bl,void 0),o(this,yl,void 0),d(wl,this,e),d(bl,this,new TextDecoder),d(yl,this,new DataView(c(wl,this))),i&&Object.assign(this,i)}get black(){return l(Al,this,xl).call(this,0)}get bold(){return l(Al,this,xl).call(this,1)}get disableFontFace(){return l(Al,this,xl).call(this,2)}get fontExtraProperties(){return l(Al,this,xl).call(this,3)}get isInvalidPDFjsFont(){return l(Al,this,xl).call(this,4)}get isType3Font(){return l(Al,this,xl).call(this,5)}get italic(){return l(Al,this,xl).call(this,6)}get missingFile(){return l(Al,this,xl).call(this,7)}get remeasure(){return l(Al,this,xl).call(this,8)}get vertical(){return l(Al,this,xl).call(this,9)}get ascent(){return l(Al,this,El).call(this,0)}get defaultWidth(){return l(Al,this,El).call(this,1)}get descent(){return l(Al,this,El).call(this,2)}get bbox(){let t=Sl._;if(0===c(yl,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<4;i++)e.push(c(yl,this).getInt16(t,!0)),t+=2;return e}get fontMatrix(){let t=Cl._;if(0===c(yl,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<6;i++)e.push(c(yl,this).getFloat64(t,!0)),t+=8;return e}get defaultVMetrics(){let t=Tl._;if(0===c(yl,this).getUint8(t))return;t+=1;const e=[];for(let i=0;i<3;i++)e.push(c(yl,this).getInt16(t,!0)),t+=2;return e}get fallbackName(){return l(Al,this,kl).call(this,0)}get loadedName(){return l(Al,this,kl).call(this,1)}get mimetype(){return l(Al,this,kl).call(this,2)}get name(){return l(Al,this,kl).call(this,3)}get data(){let t=Pl._;t+=4+c(yl,this).getUint32(t);t+=4+c(yl,this).getUint32(t);t+=4+c(yl,this).getUint32(t);const e=c(yl,this).getUint32(t);if(0!==e)return new Uint8Array(c(wl,this),t+4,e)}clearData(){let t=Pl._;t+=4+c(yl,this).getUint32(t);t+=4+c(yl,this).getUint32(t);t+=4+c(yl,this).getUint32(t);const e=c(yl,this).getUint32(t);new Uint8Array(c(wl,this),t+4,e).fill(0),c(yl,this).setUint32(t,0)}get cssFontInfo(){let t=Pl._;t+=4+c(yl,this).getUint32(t);t+=4+c(yl,this).getUint32(t);const e=c(yl,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(c(wl,this),t+4,e)),new cl(i.buffer)}get systemFontInfo(){let t=Pl._;t+=4+c(yl,this).getUint32(t);const e=c(yl,this).getUint32(t);if(0===e)return null;const i=new Uint8Array(e);return i.set(new Uint8Array(c(wl,this),t+4,e)),new ml(i.buffer)}static write(t){const e=t.systemFontInfo?ml.write(t.systemFontInfo):null,i=t.cssFontInfo?cl.write(t.cssFontInfo):null,n=new TextEncoder,s={};let r=0;for(const g of _l.strings)s[g]=n.encode(t[g]),r+=4+s[g].length;const a=Pl._+4+r+4+(e?e.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),o=new ArrayBuffer(a),l=new Uint8Array(o),h=new DataView(o);let c=0;const d=_l.bools.length;let u=0,p=0;for(let g=0;g<d;g++){const e=t[_l.bools[g]];u|=(void 0===e?0:e?2:1)<<p,p+=2,8!==p&&g!==d-1||(h.setUint8(c++,u),u=0,p=0)}wt(c===Ml._,"FontInfo.write: Boolean properties offset mismatch");for(const g of _l.numbers)h.setFloat64(c,t[g]),c+=8;if(wt(c===Sl._,"FontInfo.write: Number properties offset mismatch"),t.bbox){h.setUint8(c++,4);for(const e of t.bbox)h.setInt16(c,e,!0),c+=2}else h.setUint8(c++,0),c+=8;if(wt(c===Cl._,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){h.setUint8(c++,6);for(const e of t.fontMatrix)h.setFloat64(c,e,!0),c+=8}else h.setUint8(c++,0),c+=48;if(wt(c===Tl._,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){h.setUint8(c++,1);for(const e of t.defaultVMetrics)h.setInt16(c,e,!0),c+=2}else h.setUint8(c++,0),c+=6;wt(c===Pl._,"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(Pl._,0),c+=4;for(const g of _l.strings){const t=s[g],e=t.length;h.setUint32(c,e),l.set(t,c+4),c+=4+e}if(h.setUint32(Pl._,c-Pl._-4),e){const t=e.byteLength;h.setUint32(c,t),wt(c+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(e),c+4),c+=4+t}else h.setUint32(c,0),c+=4;if(i){const t=i.byteLength;h.setUint32(c,t),wt(c+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(i),c+4),c+=4+t}else h.setUint32(c,0),c+=4;return void 0===t.data?(h.setUint32(c,0),c+=4):(h.setUint32(c,t.data.length),l.set(t.data,c+4),c+=4+t.data.length),wt(c<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(c)}}function xl(t){wt(t<b.bools.length,"Invalid boolean index");const e=Math.floor(t/4),i=2*t%8,n=c(yl,this).getUint8(e)>>i&3;return 0===n?void 0:2===n}function El(t){return wt(t<b.numbers.length,"Invalid number index"),c(yl,this).getFloat64(Ml._+8*t)}function kl(t){wt(t<b.strings.length,"Invalid string index");let e=Pl._+4;for(let s=0;s<t;s++)e+=c(yl,this).getUint32(e)+4;const i=c(yl,this).getUint32(e),n=new Uint8Array(i);return n.set(new Uint8Array(c(wl,this),e+4,i)),c(bl,this).decode(n)}b=_l,(0,P.A)(_l,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),(0,P.A)(_l,"numbers",["ascent","defaultWidth","descent"]),(0,P.A)(_l,"strings",["fallbackName","loadedName","mimetype","name"]);var Ml={_:Math.ceil(2*b.bools.length/8)},Sl={_:l(b,b,Ml)._+8*b.numbers.length},Cl={_:l(b,b,Sl)._+1+8},Tl={_:l(b,b,Cl)._+1+48},Pl={_:l(b,b,Tl)._+1+6};class Rl{static get workerPort(){return l(Rl,this,Dl)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");Dl._=l(Rl,this,t)}static get workerSrc(){return l(Rl,this,Ll)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");Ll._=l(Rl,this,t)}}var Dl={_:null},Ll={_:""},Il=new WeakMap,Fl=new WeakMap;class Nl{constructor(t){let{parsedData:e,rawData:i}=t;o(this,Il,void 0),o(this,Fl,void 0),d(Il,this,e),d(Fl,this,i)}getRaw(){return c(Fl,this)}get(t){var e;return null!==(e=c(Il,this).get(t))&&void 0!==e?e:null}[Symbol.iterator](){return c(Il,this).entries()}}const Ol=Symbol("INTERNAL");var Bl=new WeakMap,Wl=new WeakMap,zl=new WeakMap,Hl=new WeakMap;class jl{constructor(t,e){let{name:i,intent:n,usage:s,rbGroups:r}=e;o(this,Bl,!1),o(this,Wl,!1),o(this,zl,!1),o(this,Hl,!0),d(Bl,this,!!(t&N)),d(Wl,this,!!(t&O)),this.name=i,this.intent=n,this.usage=s,this.rbGroups=r}get visible(){if(c(zl,this))return c(Hl,this);if(!c(Hl,this))return!1;const{print:t,view:e}=this.usage;return c(Bl,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!c(Wl,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==Ol&&vt("Internal method `_setVisible` called."),d(zl,this,i),d(Hl,this,e)}}var Vl=new WeakMap,Ul=new WeakMap,Gl=new WeakMap,ql=new WeakMap,Xl=new WeakSet;class Yl{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N;if(a(this,Xl),o(this,Vl,null),o(this,Ul,new Map),o(this,Gl,null),o(this,ql,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,d(ql,this,t.order);for(const i of t.groups)c(Ul,this).set(i.id,new jl(e,i));if("OFF"===t.baseState)for(const t of c(Ul,this).values())t._setVisible(Ol,!1);for(const e of t.on)c(Ul,this).get(e)._setVisible(Ol,!0);for(const e of t.off)c(Ul,this).get(e)._setVisible(Ol,!1);d(Gl,this,this.getHash())}}isVisible(t){if(0===c(Ul,this).size)return!0;if(!t)return ft("Optional content group not defined."),!0;if("OCG"===t.type)return c(Ul,this).has(t.id)?c(Ul,this).get(t.id).visible:(mt("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return l(Xl,this,Kl).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!c(Ul,this).has(e))return mt("Optional content group not found: ".concat(e)),!0;if(c(Ul,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!c(Ul,this).has(e))return mt("Optional content group not found: ".concat(e)),!0;if(!c(Ul,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!c(Ul,this).has(e))return mt("Optional content group not found: ".concat(e)),!0;if(!c(Ul,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!c(Ul,this).has(e))return mt("Optional content group not found: ".concat(e)),!0;if(c(Ul,this).get(e).visible)return!1}return!0}return mt("Unknown optional content policy ".concat(t.policy,".")),!0}return mt("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=c(Ul,this).get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e){var s;if(i!==t)null===(s=c(Ul,this).get(i))||void 0===s||s._setVisible(Ol,!1,!0)}n._setVisible(Ol,!!e,!0),d(Vl,this,null)}else mt("Optional content group not found: ".concat(t))}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=c(Ul,this).get(s);if(t)switch(e){case"ON":this.setVisibility(s,!0,n);break;case"OFF":this.setVisibility(s,!1,n);break;case"Toggle":this.setVisibility(s,!t.visible,n)}}d(Vl,this,null)}get hasInitialVisibility(){return null===c(Gl,this)||this.getHash()===c(Gl,this)}getOrder(){return c(Ul,this).size?c(ql,this)?c(ql,this).slice():[...c(Ul,this).keys()]:null}getGroup(t){return c(Ul,this).get(t)||null}getHash(){if(null!==c(Vl,this))return c(Vl,this);const t=new pr;for(const[e,i]of c(Ul,this))t.update("".concat(e,":").concat(i.visible));return d(Vl,this,t.hexdigest())}[Symbol.iterator](){return c(Ul,this).entries()}}function Kl(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=l(Xl,this,Kl).call(this,e);else{if(!c(Ul,this).has(e))return mt("Optional content group not found: ".concat(e)),!0;s=c(Ul,this).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}class Jl{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;wt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(null===r||void 0===r?void 0:r.length)>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{wt(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){wt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Ql(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Zl(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class Ql{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=Jt(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Zl{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function $l(t,e){const i=new Headers;if(!t||!e||"object"!==typeof e)return i;for(const n in e){const t=e[n];void 0!==t&&i.append(n,t)}return i}function th(t){var e,i;return null!==(e=null===(i=URL.parse(t))||void 0===i?void 0:i.origin)&&void 0!==e?e:null}function eh(t){let{responseHeaders:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(a))return r;if(r.suggestedLength=a,a<=2*n)return r;if(s||!i)return r;if("bytes"!==e.get("Accept-Ranges"))return r;return"identity"!==(e.get("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function ih(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),r(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const r=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),r.push(i)}return r.join("")}(t),i)return r(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=Pt(i);i=n.decode(s),e=!1}catch(n){}}return i}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{n=atob(n)}catch(r){}return s(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(Jt(t))return t}return null}function nh(t,e){return new Mt("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t,404===t||0===t&&e.startsWith("file:"))}function sh(t){return 200===t||206===t}function rh(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function ah(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(mt("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class oh{constructor(t){(0,P.A)(this,"_responseOrigin",null),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=$l(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return wt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new lh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new hh(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class lh{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),n=e.url;fetch(n,rh(i,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=th(e.url),!sh(e.status))throw nh(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:s,suggestedLength:r}=eh({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=r||this._contentLength,this._filename=ih(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ct("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:ah(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class hh{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const s=new Headers(t.headers);s.append("Range","bytes=".concat(e,"-").concat(i-1));const r=n.url;fetch(r,rh(s,this._withCredentials,this._abortController)).then(e=>{const i=th(e.url);if(i!==t._responseOrigin)throw new Error('Expected range response-origin "'.concat(i,'" to match "').concat(t._responseOrigin,'".'));if(!sh(e.status))throw nh(e.status,r);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:ah(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class ch{constructor(t){let{url:e,httpHeaders:i,withCredentials:n}=t;(0,P.A)(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=$l(this.isHttp,i),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[s,r]of this.headers)e.setRequestHeader(s,r);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",wt(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError(n.status);const s=n.status||200;if(!(200===s&&206===i.expectedStatus)&&s!==i.expectedStatus)return void i.onError(n.status);const r=function(t){const e=t.response;return"string"!==typeof e?e:Pt(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?i.onDone({begin:parseInt(e[1],10),chunk:r}):(mt('Missing or invalid "Content-Range" header.'),i.onError(0))}else r?i.onDone({begin:0,chunk:r}):i.onError(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class dh{constructor(t){this._source=t,this._manager=new ch(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return wt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new uh(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new ph(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class uh{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=th(e.responseURL);const i=e.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{allowRangeRequests:s,suggestedLength:r}=eh({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=ih(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=nh(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class ph{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var t;const e=th(null===(t=this._manager.getRequestXhr(this._requestId))||void 0===t?void 0:t.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error('Expected range response-origin "'.concat(e,'" to match "').concat(this._manager._responseOrigin,'".')),this._onError(0))}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){var e;null!==(e=this._storedError)&&void 0!==e||(this._storedError=nh(t,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded}))}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const gh=/^[a-z][a-z0-9\-+.]+:/i;class fh{constructor(t){this.source=t,this.url=function(t){if(gh.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),wt("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return wt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new mh(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new vh(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class mh{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=nh(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Ct("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class vh{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.source;this._isStreamingSupported=!n.disableStream;const s=process.getBuiltinModule("fs");this._setReadableStream(s.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const wh=Symbol("INITIAL_DATA");var bh=new WeakMap,yh=new WeakSet;class Ah{constructor(){a(this,yh),o(this,bh,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=l(yh,this,_h).call(this,t);return i.promise.then(()=>e(i.data)),null}const i=c(bh,this)[t];if(!i||i.data===wh)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=c(bh,this)[t];return!!e&&e.data!==wh}delete(t){const e=c(bh,this)[t];return!(!e||e.data===wh)&&(delete c(bh,this)[t],!0)}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=l(yh,this,_h).call(this,t);i.data=e,i.resolve()}clear(){for(const e in c(bh,this)){var t;const{data:i}=c(bh,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}d(bh,this,Object.create(null))}*[Symbol.iterator](){for(const t in c(bh,this)){const{data:e}=c(bh,this)[t];e!==wh&&(yield[t,e])}}}function _h(t){var e;return(e=c(bh,this))[t]||(e[t]=(0,s.A)((0,s.A)({},Promise.withResolvers()),{},{data:wh}))}var xh=new WeakMap,Eh=new WeakMap,kh=new WeakMap,Mh=new WeakMap,Sh=new WeakMap,Ch=new WeakMap,Th=new WeakMap,Ph=new WeakMap,Rh=new WeakMap,Dh=new WeakMap,Lh=new WeakMap,Ih=new WeakMap,Fh=new WeakMap,Nh=new WeakMap,Oh=new WeakMap,Bh=new WeakMap,Wh=new WeakMap,zh=new WeakMap,Hh=new WeakSet;class jh{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if(a(this,Hh),o(this,xh,Promise.withResolvers()),o(this,Eh,null),o(this,kh,!1),o(this,Mh,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),o(this,Sh,null),o(this,Ch,null),o(this,Th,0),o(this,Ph,0),o(this,Rh,null),o(this,Dh,null),o(this,Lh,0),o(this,Ih,0),o(this,Fh,Object.create(null)),o(this,Nh,[]),o(this,Oh,null),o(this,Bh,[]),o(this,Wh,new WeakMap),o(this,zh,null),i instanceof ReadableStream)d(Oh,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');d(Oh,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}d(Eh,this,d(Dh,this,n)),d(Ih,this,s.scale*oe.pixelRatio),d(Lh,this,s.rotation),d(Ch,this,{div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:l,pageX:h,pageY:u}=s.rawDims;d(zh,this,[1,0,0,-1,-h,u+l]),d(Ph,this,r),d(Th,this,l),Yh.call(jh),ae(n,s),c(xh,this).promise.finally(()=>{tc._.delete(this),d(Ch,this,null),d(Fh,this,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Rt.platform;return At(this,"fontFamilyMap",new Map([["sans-serif","".concat(t&&e?"Calibri, ":"","sans-serif")],["monospace","".concat(t&&e?"Lucida Console, ":"","monospace")]]))}render(){const t=()=>{c(Rh,this).read().then(e=>{var i;let{value:n,done:s}=e;s?c(xh,this).resolve():(null!==(i=c(Sh,this))&&void 0!==i||d(Sh,this,n.lang),Object.assign(c(Fh,this),n.styles),l(Hh,this,Vh).call(this,n.items),t())},c(xh,this).reject)};return d(Rh,this,c(Oh,this).getReader()),tc._.add(this),t(),c(xh,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*oe.pixelRatio,s=e.rotation;if(s!==c(Lh,this)&&(null===i||void 0===i||i(),d(Lh,this,s),ae(c(Dh,this),{rotation:s})),n!==c(Ih,this)){null===i||void 0===i||i(),d(Ih,this,n);const t={div:null,properties:null,ctx:qh.call(jh,c(Sh,this))};for(const e of c(Bh,this))t.properties=c(Wh,this).get(e),t.div=e,l(Hh,this,Gh).call(this,t)}}cancel(){var t;const e=new Ct("TextLayer task cancelled.");null===(t=c(Rh,this))||void 0===t||t.cancel(e).catch(()=>{}),d(Rh,this,null),c(xh,this).reject(e)}get textDivs(){return c(Bh,this)}get textContentItemsStr(){return c(Nh,this)}static cleanup(){if(!(l(jh,this,tc)._.size>0)){l(jh,this,Jh)._.clear();for(const{canvas:t}of l(jh,this,Qh)._.values())t.remove();l(jh,this,Qh)._.clear()}}}function Vh(t){var e,i;if(c(kh,this))return;null!==(i=(e=c(Ch,this)).ctx)&&void 0!==i||(e.ctx=qh.call(y,c(Sh,this)));const n=c(Bh,this),s=c(Nh,this);for(const r of t){if(n.length>1e5)return mt("Ignoring additional textDivs for performance reasons."),void d(kh,this,!0);if(void 0!==r.str)s.push(r.str),l(Hh,this,Uh).call(this,r);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){const t=c(Eh,this);d(Eh,this,document.createElement("span")),c(Eh,this).classList.add("markedContent"),r.id&&c(Eh,this).setAttribute("id","".concat(r.id)),t.append(c(Eh,this))}else"endMarkedContent"===r.type&&d(Eh,this,c(Eh,this).parentNode)}}function Uh(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};c(Bh,this).push(e);const n=Lt.transform(c(zh,this),t.transform);let s=Math.atan2(n[1],n[0]);const r=c(Fh,this)[t.fontName];r.vertical&&(s+=Math.PI/2);let a=c(Mh,this)&&r.fontSubstitution||r.fontFamily;a=y.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),h=o*Kh.call(y,a,r,c(Sh,this));let d,u;0===s?(d=n[4],u=n[5]-h):(d=n[4]+h*Math.sin(s),u=n[5]-h*Math.cos(s));const p="calc(var(--total-scale-factor) *",g=e.style;c(Eh,this)===c(Dh,this)?(g.left="".concat((100*d/c(Ph,this)).toFixed(2),"%"),g.top="".concat((100*u/c(Th,this)).toFixed(2),"%")):(g.left="".concat(p).concat(d.toFixed(2),"px)"),g.top="".concat(p).concat(u.toFixed(2),"px)")),g.fontSize="".concat(p).concat(($h._*o).toFixed(2),"px)"),g.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,c(Mh,this)&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(f=!0)}if(f&&(i.canvasWidth=r.vertical?t.height:t.width),c(Wh,this).set(e,i),c(Ch,this).div=e,c(Ch,this).properties=i,l(Hh,this,Gh).call(this,c(Ch,this)),i.hasText&&c(Eh,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),c(Eh,this).append(t)}}function Gh(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let r="";if($h._>1&&(r="scale(".concat(1/$h._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:t}=s,{canvasWidth:a,fontSize:o}=i;Xh.call(y,n,o*c(Ih,this),t);const{width:l}=n.measureText(e.textContent);l>0&&(r="scaleX(".concat(a*c(Ih,this)/l,") ").concat(r))}0!==i.angle&&(r="rotate(".concat(i.angle,"deg) ").concat(r)),r.length>0&&(s.transform=r)}function qh(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=l(y,this,Qh)._.get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(y,this,Qh)._.set(t,e),l(y,this,Zh)._.set(e,{size:0,family:""})}return e}function Xh(t,e,i){const n=l(y,this,Zh)._.get(t);e===n.size&&i===n.family||(t.font="".concat(e,"px ").concat(i),n.size=e,n.family=i)}function Yh(){if(null!==l(y,this,$h)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),$h._=l(y,this,t.getBoundingClientRect().height),t.remove()}function Kh(t,e,i){const n=l(y,this,Jh)._.get(t);if(n)return n;const s=l(y,this,qh).call(this,i);s.canvas.width=s.canvas.height=30,l(y,this,Xh).call(this,s,30,t);const r=s.measureText(""),a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let h=.8;return a?h=a/(a+o):(Rt.platform.isFirefox&&mt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?h=e.ascent:e.descent&&(h=1+e.descent)),l(y,this,Jh)._.set(t,h),h}y=jh;var Jh={_:new Map},Qh={_:new Map},Zh={_:new WeakMap},$h={_:null},tc={_:new Set};function ec(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new ic,{docId:s}=n,r=i.url?function(t){if(t instanceof URL)return t.href;if("string"===typeof t){if(D)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,a=i.data?function(t){if(D&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return Pt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,h=null!==(t=i.password)&&void 0!==t?t:null,c=i.range instanceof hc?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:65536;let u=i.worker instanceof yc?i.worker:null;const p=i.verbosity,g="string"!==typeof i.docBaseUrl||Kt(i.docBaseUrl)?null:i.docBaseUrl,f=Cr(i.cMapUrl),m=!1!==i.cMapPacked,v=i.CMapReaderFactory||(D?La:na),w=Cr(i.iccUrl),b=Cr(i.standardFontDataUrl),y=i.StandardFontDataFactory||(D?Ia:Sa),A=Cr(i.wasmUrl),_=i.WasmFactory||(D?Fa:Ta),x=!0!==i.stopAtErrors,E=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,k=!1!==i.isEvalSupported,M="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!D,S="boolean"===typeof i.isImageDecoderSupported?i.isImageDecoderSupported:!D&&(Rt.platform.isFirefox||!globalThis.chrome),C=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,T="boolean"===typeof i.disableFontFace?i.disableFontFace:D,P=!0===i.fontExtraProperties,R=!0===i.enableXfa,L=i.ownerDocument||globalThis.document,I=!0===i.disableRange,F=!0===i.disableStream,N=!0===i.disableAutoFetch,O=!0===i.pdfBug,B=i.CanvasFactory||(D?Da:ea),W=i.FilterFactory||(D?Ra:pa),z=!0===i.enableHWA,H=!1!==i.useWasm,j=c?c.length:null!==(e=i.length)&&void 0!==e?e:NaN,V="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!D&&!T,U="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:!!(v===na&&y===Sa&&_===Ta&&f&&b&&A&&Zt(f,document.baseURI)&&Zt(b,document.baseURI)&&Zt(A,document.baseURI));pt(p);const G={canvasFactory:new B({ownerDocument:L,enableHWA:z}),filterFactory:new W({docId:s,ownerDocument:L}),cMapReaderFactory:U?null:new v({baseUrl:f,isCompressed:m}),standardFontDataFactory:U?null:new y({baseUrl:b}),wasmFactory:U?null:new _({baseUrl:A})};u||(u=yc.create({verbosity:p,port:Rl.workerPort}),n._worker=u);const q={docId:s,apiVersion:"5.4.296",data:a,password:h,disableAutoFetch:N,rangeChunkSize:d,length:j,docBaseUrl:g,enableXfa:R,evaluatorOptions:{maxImageSize:E,disableFontFace:T,ignoreErrors:x,isEvalSupported:k,isOffscreenCanvasSupported:M,isImageDecoderSupported:S,canvasMaxAreaInBytes:C,fontExtraProperties:P,useSystemFonts:V,useWasm:H,useWorkerFetch:U,cMapUrl:f,iccUrl:w,standardFontDataUrl:b,wasmUrl:A}},X={ownerDocument:L,pdfBug:O,styleElement:null,loadingParams:{disableAutoFetch:N,enableXfa:R}};return u.promise.then(function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",q,a?[a.buffer]:null);let e;if(c)e=new Jl(c,{disableRange:I,disableStream:F});else if(!a){if(!r)throw new Error("getDocument - no `url` parameter provided.");const t=Zt(r)?oh:D?fh:dh;e=new t({url:r,length:j,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:I,disableStream:F})}return t.then(t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new Yr(s,t,u.port),r=new Fc(i,n,e,X,G,z);n._transport=r,i.send("Ready",null)})}).catch(n._capability.reject),n}class ic{constructor(){(0,P.A)(this,"_capability",Promise.withResolvers()),(0,P.A)(this,"_transport",null),(0,P.A)(this,"_worker",null),(0,P.A)(this,"docId","d".concat((nc._=(A=nc._,_=A++,A),_))),(0,P.A)(this,"destroyed",!1),(0,P.A)(this,"onPassword",null),(0,P.A)(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0;try{var e,i;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(i=this._transport)||void 0===i?void 0:i.destroy())}catch(s){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,s}this._transport=null,null===(t=this._worker)||void 0===t||t.destroy(),this._worker=null}async getData(){return this._transport.getData()}}var nc={_:0},sc=new WeakMap,rc=new WeakMap,ac=new WeakMap,oc=new WeakMap,lc=new WeakMap;class hc{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;o(this,sc,Promise.withResolvers()),o(this,rc,[]),o(this,ac,[]),o(this,oc,[]),o(this,lc,[]),this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(t){c(lc,this).push(t)}addProgressListener(t){c(oc,this).push(t)}addProgressiveReadListener(t){c(ac,this).push(t)}addProgressiveDoneListener(t){c(rc,this).push(t)}onDataRange(t,e){for(const i of c(lc,this))i(t,e)}onDataProgress(t,e){c(sc,this).promise.then(()=>{for(const i of c(oc,this))i(t,e)})}onDataProgressiveRead(t){c(sc,this).promise.then(()=>{for(const e of c(ac,this))e(t)})}onDataProgressiveDone(){c(sc,this).promise.then(()=>{for(const t of c(rc,this))t()})}transportReady(){c(sc,this).resolve()}requestDataRange(t,e){vt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class cc{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return At(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var dc=new WeakMap,uc=new WeakSet;class pc{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a(this,uc),o(this,dc,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new Qt:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Ah,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Xt({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return At(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i,n;let{canvasContext:s,canvas:r=s.canvas,viewport:a,intent:o="display",annotationMode:h=V.ENABLE,transform:c=null,background:u=null,optionalContentConfigPromise:p=null,annotationCanvasMap:g=null,pageColors:f=null,printAnnotationStorage:m=null,isEditing:v=!1,recordOperations:w=!1,operationsFilter:b=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const y=this._transport.getRenderingIntent(o,h,m,v),{renderingIntent:A,cacheKey:_}=y;d(dc,this,!1),p||(p=this._transport.getOptionalContentConfig(A));let x=this._intentStates.get(_);x||(x=Object.create(null),this._intentStates.set(_,x)),x.streamReaderCancelTimeout&&(clearTimeout(x.streamReaderCancelTimeout),x.streamReaderCancelTimeout=null);const E=!!(A&O);var k;x.displayReadyCapability||(x.displayReadyCapability=Promise.withResolvers(),x.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(k=this._stats)||void 0===k||k.time("Page Request"),this._pumpOperatorList(y));const M=Boolean(this._pdfBug&&(null===(i=globalThis.StepperManager)||void 0===i?void 0:i.enabled)),S=!this.recordedBBoxes&&(w||M),C=t=>{if(x.renderTasks.delete(T),S){var e;const t=null===(e=T.gfx)||void 0===e?void 0:e.dependencyTracker.take();t&&(T.stepper&&T.stepper.setOperatorBBoxes(t,T.gfx.dependencyTracker.takeDebugMetadata()),w&&(this.recordedBBoxes=t))}var i;(E&&d(dc,this,!0),l(uc,this,gc).call(this),t?(T.capability.reject(t),this._abortOperatorList({intentState:x,reason:t instanceof Error?t:new Error(t)})):T.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(i=globalThis.Stats)&&void 0!==i&&i.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},T=new zc({callback:C,params:{canvas:r,canvasContext:s,dependencyTracker:S?new ho(r,x.operatorList.length,M):null,viewport:a,transform:c,background:u},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:g,operatorList:x.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:f,enableHWA:this._transport.enableHWA,operationsFilter:b});((n=x).renderTasks||(n.renderTasks=new Set)).add(T);const P=T.task;return Promise.all([x.displayReadyCapability.promise,p]).then(t=>{var e;let[i,n]=t;if(this.destroyed)C();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&A))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");T.initializeGraphics({transparency:i,optionalContentConfig:n}),T.operatorListChanged()}}).catch(C),P}getOperatorList(){let{intent:t="display",annotationMode:e=V.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=this._transport.getRenderingIntent(t,e,i,n,!0);let r,a=this._intentStates.get(s.cacheKey);var o,l;(a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability)||(r=Object.create(null),r.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(r))},a.opListReadCapability=Promise.withResolvers(),((o=a).renderTasks||(o.renderTasks=new Set)).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(l=this._stats)||void 0===l||l.time("Page Request"),this._pumpOperatorList(s));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>jt.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then(function(i){var n;let{value:r,done:a}=i;a?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=r.lang),Object.assign(s.styles,r.styles),s.items.push(...r.items),e())},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),d(dc,this,!1),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d(dc,this,!0);const e=l(uc,this,gc).call(this);return t&&e&&this._stats&&(this._stats=new Qt),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&l(uc,this,gc).call(this)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n,modifiedIds:s}=t;const{map:r,transfer:a}=n,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:r,modifiedIds:s},a).getReader(),h=this._intentStates.get(i);h.streamReader=o;const c=()=>{o.read().then(t=>{let{value:e,done:i}=t;i?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,h),c())},t=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const t of h.renderTasks)t.operatorListChanged();l(uc,this,gc).call(this)}if(h.displayReadyCapability)h.displayReadyCapability.reject(t);else{if(!h.opListReadCapability)throw t;h.opListReadCapability.reject(t)}}})};c()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof Yt){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},t))}}if(e.streamReader.cancel(new Ct(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function gc(){if(!c(dc,this)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),d(dc,this,!1),!0}var fc=new WeakMap,mc=new WeakMap,vc=new WeakMap,wc=new WeakMap,bc=new WeakSet;class yc{constructor(){let{name:t=null,port:e=null,verbosity:i=gt()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,bc),o(this,fc,Promise.withResolvers()),o(this,mc,null),o(this,vc,null),o(this,wc,null),this.name=t,this.destroyed=!1,this.verbosity=i,e){if(Cc._.has(e))throw new Error("Cannot use more than one PDFWorker per port.");Cc._.set(e,this),l(bc,this,_c).call(this,e)}else l(bc,this,xc).call(this)}get promise(){return c(fc,this).promise}get port(){return c(vc,this)}get messageHandler(){return c(mc,this)}destroy(){var t,e;this.destroyed=!0,null===(t=c(wc,this))||void 0===t||t.terminate(),d(wc,this,null),Cc._.delete(c(vc,this)),d(vc,this,null),null===(e=c(mc,this))||void 0===e||e.destroy(),d(mc,this,null)}static create(t){const e=l(yc,this,Cc)._.get(null===t||void 0===t?void 0:t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new yc(t)}static get workerSrc(){if(Rl.workerSrc)return Rl.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return At(this,"_setupFakeWorkerGlobal",(async()=>{if(h(yc,this,kc))return h(yc,this,kc);return(await i(59169)(this.workerSrc)).WorkerMessageHandler})())}}function Ac(){c(fc,this).resolve(),c(mc,this).send("configure",{verbosity:this.verbosity})}function _c(t){d(vc,this,t),d(mc,this,new Yr("main","worker",t)),c(mc,this).on("ready",()=>{}),l(bc,this,Ac).call(this)}function xc(){if(Sc._||kc(x))return void l(bc,this,Ec).call(this);let{workerSrc:t}=x;try{x._isSameOrigin(window.location,t)||(t=x._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Yr("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?c(fc,this).reject(new Error("Worker was destroyed")):l(bc,this,Ec).call(this)},s=new AbortController;e.addEventListener("error",()=>{c(wc,this)||n()},{signal:s.signal}),i.on("test",t=>{s.abort(),!this.destroyed&&t?(d(mc,this,i),d(vc,this,e),d(wc,this,e),l(bc,this,Ac).call(this)):n()}),i.on("ready",t=>{if(s.abort(),this.destroyed)n();else try{r()}catch(e){l(bc,this,Ec).call(this)}});const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch(e){ft("The worker has been disabled.")}l(bc,this,Ec).call(this)}function Ec(){Sc._||(mt("Setting up fake worker."),Sc._=!0),x._setupFakeWorkerGlobal.then(t=>{var e,i;if(this.destroyed)return void c(fc,this).reject(new Error("Worker was destroyed"));const n=new Lr;d(vc,this,n);const s="fake".concat((Mc._=(e=Mc._,i=e++,e),i)),r=new Yr(s+"_worker",s,n);t.setup(r,n),d(mc,this,new Yr(s,s+"_worker",n)),l(bc,this,Ac).call(this)}).catch(t=>{c(fc,this).reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))})}function kc(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}x=yc;var Mc={_:0},Sc={_:!1},Cc={_:new WeakMap};D&&(Sc._=l(x,x,!0),Rl.workerSrc||(Rl.workerSrc="./pdf.worker.mjs")),x._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(null===i||void 0===i||!i.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin},x._createCDNWrapper=t=>{const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},x.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return x.create(t)};var Tc=new WeakMap,Pc=new WeakMap,Rc=new WeakMap,Dc=new WeakMap,Lc=new WeakMap,Ic=new WeakSet;class Fc{constructor(t,e,i,n,s,r){a(this,Ic),o(this,Tc,new Map),o(this,Pc,new Map),o(this,Rc,new Map),o(this,Dc,new Map),o(this,Lc,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Ah,this.fontLoader=new kr({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}get annotationStorage(){return At(this,"annotationStorage",new yr)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=N,a=gr;switch(t){case"any":r=F;break;case"display":break;case"print":r=O;break;default:mt("getRenderingIntent - invalid intent: ".concat(t))}const o=r&O&&i instanceof xr?i:this.annotationStorage;switch(e){case V.DISABLE:r+=z;break;case V.ENABLE:break;case V.ENABLE_FORMS:r+=B;break;case V.ENABLE_STORAGE:r+=W,a=o.serializable;break;default:mt("getRenderingIntent - invalid annotationMode: ".concat(e))}n&&(r+=H),s&&(r+=j);const{ids:l,hash:h}=o.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,h].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=c(Lc,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of c(Pc,this).values())e.push(n._destroy());c(Pc,this).clear(),c(Rc,this).clear(),c(Dc,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{var t,e;this.commonObjs.clear(),this.fontLoader.clear(),c(Tc,this).clear(),this.filterFactory.destroy(),jh.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Ct("Worker was terminated.")),null===(e=this.messageHandler)||void 0===e||e.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{wt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function(t){let{value:i,done:n}=t;n?e.close():(wt(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:s}=this._fullReader;if(!i||!n){var r;if(this._lastProgress)null===(r=e.onProgress)||void 0===r||r.call(e,this._lastProgress);this._fullReader.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}return{isStreamingSupported:i,isRangeSupported:n,contentLength:s}}),t.on("GetRangeReader",(t,e)=>{wt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function(t){let{value:i,done:n}=t;n?e.close():(wt(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}):e.close()}),t.on("GetDoc",t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new cc(i,this))}),t.on("DocException",t=>{e._capability.reject(Gr(t))}),t.on("PasswordRequest",t=>{d(Lc,this,Promise.withResolvers());try{if(!e.onPassword)throw Gr(t);const i=t=>{t instanceof Error?c(Lc,this).reject(t):c(Lc,this).resolve({password:t})};e.onPassword(i,t.code)}catch(i){c(Lc,this).reject(i)}return c(Lc,this).promise}),t.on("DataLoaded",t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;c(Pc,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var i;let[n,s,r]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":if("error"in r){const t=r.error;mt("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const e=new _l(r),a=this._params.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new Sr(e,a,r.extra,r.charProcOperatorList);this.fontLoader.bind(o).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!o.fontExtraProperties&&o.data&&o.clearData(),this.commonObjs.resolve(n,o)});break;case"CopyLocalImage":const{imageRef:l}=r;wt(l,"The imageRef must be defined.");for(const t of c(Pc,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===l)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error("Got unknown common object type ".concat(s))}return null}),t.on("obj",t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=c(Pc,this).get(i);var a;if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":case"Pattern":r.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(a=s.bitmap)||void 0===a||a.close()}),t.on("DocProgress",t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error("".concat(t.type," not initialized, see the `useWorkerFetch` parameter."));return e.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&mt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=c(Rc,this).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&c(Dc,this).set(i.refStr,t);const n=new pc(e,i,this,this._params.pdfBug);return c(Pc,this).set(e,n),n});return c(Rc,this).set(e,n),n}getPageIndex(t){return Tr(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return l(Ic,this,Nc).call(this,"GetFieldObjects")}hasJSActions(){return l(Ic,this,Nc).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return l(Ic,this,Nc).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return l(Ic,this,Nc).call(this,"GetOptionalContentConfig").then(e=>new Yl(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=c(Tc,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new Nl(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}});return c(Tc,this).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of c(Pc,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),c(Tc,this).clear(),this.filterFactory.destroy(!0),jh.cleanup()}}cachedPageNumber(t){var e;if(!Tr(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=c(Dc,this).get(i))&&void 0!==e?e:null}}function Nc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=c(Tc,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return c(Tc,this).set(t,n),n}var Oc=new WeakMap;class Bc{constructor(t){o(this,Oc,null),(0,P.A)(this,"onContinue",null),(0,P.A)(this,"onError",null),d(Oc,this,t)}get promise(){return c(Oc,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;c(Oc,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=c(Oc,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=c(Oc,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var Wc=new WeakMap;class zc{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:l,canvasFactory:h,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:p=null,enableHWA:g=!1,operationsFilter:f=null}=t;o(this,Wc,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=l,this.canvasFactory=h,this.filterFactory=c,this._pdfBug=u,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Bc(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=g,this._dependencyTracker=i.dependencyTracker,this._operationsFilter=f}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(Hc._.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Hc._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:a,background:o,dependencyTracker:l}=this.params,h=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new il(h,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors,l),this.gfx.beginDrawing({transform:a,viewport:r,transparency:n,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t,e,i;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),c(Wc,this)&&(window.cancelAnimationFrame(c(Wc,this)),d(Wc,this,null)),Hc._.delete(this._canvas),n||(n=new Yt("Rendering cancelled, page ".concat(this._pageIndex+1),s)),this.callback(n),null===(e=(i=this.task).onError)||void 0===e||e.call(i,n)}operatorListChanged(){var t,e;this.graphicsReady?(null===(t=this.gfx.dependencyTracker)||void 0===t||t.growOperationsCount(this.operatorList.fnArray.length),null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?d(Wc,this,window.requestAnimationFrame(()=>{d(Wc,this,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Hc._.delete(this._canvas),this.callback())))}}var Hc={_:new WeakSet};var jc=new WeakMap,Vc=new WeakMap,Uc=new WeakMap,Gc=new WeakMap,qc=new WeakMap,Xc=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Zc=new WeakSet;class $c{static get _keyboardManager(){return At(this,"_keyboardManager",new ei([[["Escape","mac+Escape"],$c.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],$c.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],$c.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],$c.prototype._moveToPrevious],[["Home","mac+Home"],$c.prototype._moveToBeginning],[["End","mac+End"],$c.prototype._moveToEnd]]))}constructor(t){var e,i;let{editor:n=null,uiManager:s=null}=t;a(this,Zc),o(this,jc,null),o(this,Vc,null),o(this,Uc,void 0),o(this,Gc,null),o(this,qc,!1),o(this,Xc,!1),o(this,Yc,null),o(this,Kc,void 0),o(this,Jc,null),o(this,Qc,null),n?(d(Xc,this,!1),d(Yc,this,n)):d(Xc,this,!0),d(Qc,this,(null===n||void 0===n?void 0:n._uiManager)||s),d(Kc,this,c(Qc,this)._eventBus),d(Uc,this,(null===n||void 0===n||null===(e=n.color)||void 0===e?void 0:e.toUpperCase())||(null===(i=c(Qc,this))||void 0===i?void 0:i.highlightColors.values().next().value)||"#FFFF98"),ad._||(ad._=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}renderButton(){const t=d(jc,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",c(Yc,this)&&(t.ariaControls="".concat(c(Yc,this).id,"_colorpicker_dropdown"));const e=c(Qc,this)._signal;t.addEventListener("click",l(Zc,this,nd).bind(this),{signal:e}),t.addEventListener("keydown",l(Zc,this,id).bind(this),{signal:e});const i=d(Vc,this,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=c(Uc,this),t.append(i),t}renderMainDropdown(){const t=d(Gc,this,l(Zc,this,td).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===c(jc,this))return void l(Zc,this,nd).call(this,t);const e=t.target.getAttribute("data-color");e&&l(Zc,this,ed).call(this,e,t)}_moveToNext(t){var e,i;h(Zc,this,rd)?t.target!==c(jc,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=c(Gc,this).firstChild)||void 0===i||i.focus():l(Zc,this,nd).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=c(Gc,this))||void 0===e?void 0:e.firstChild)&&t.target!==c(jc,this)?(h(Zc,this,rd)||l(Zc,this,nd).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):h(Zc,this,rd)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;h(Zc,this,rd)?null===(e=c(Gc,this).firstChild)||void 0===e||e.focus():l(Zc,this,nd).call(this,t)}_moveToEnd(t){var e;h(Zc,this,rd)?null===(e=c(Gc,this).lastChild)||void 0===e||e.focus():l(Zc,this,nd).call(this,t)}hideDropdown(){var t,e;null===(t=c(Gc,this))||void 0===t||t.classList.add("hidden"),c(jc,this).ariaExpanded="false",null===(e=c(Jc,this))||void 0===e||e.abort(),d(Jc,this,null)}_hideDropdownFromKeyboard(){var t;c(Xc,this)||(h(Zc,this,rd)?(this.hideDropdown(),c(jc,this).focus({preventScroll:!0,focusVisible:c(qc,this)})):null===(t=c(Yc,this))||void 0===t||t.unselect())}updateColor(t){if(c(Vc,this)&&(c(Vc,this).style.backgroundColor=t),!c(Gc,this))return;const e=c(Qc,this).highlightColors.values();for(const i of c(Gc,this).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;null===(t=c(jc,this))||void 0===t||t.remove(),d(jc,this,null),d(Vc,this,null),null===(e=c(Gc,this))||void 0===e||e.remove(),d(Gc,this,null)}}function td(){const t=document.createElement("div"),e=c(Qc,this)._signal;t.addEventListener("contextmenu",$t,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),c(Yc,this)&&(t.id="".concat(c(Yc,this).id,"_colorpicker_dropdown"));for(const[i,n]of c(Qc,this).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",ad._[i]);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.ariaSelected=n===c(Uc,this),s.addEventListener("click",l(Zc,this,ed).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",l(Zc,this,id).bind(this),{signal:e}),t}function ed(t,e){e.stopPropagation(),c(Kc,this).dispatch("switchannotationeditorparams",{source:this,type:q.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}function id(t){E._keyboardManager.exec(this,t)}function nd(t){if(h(Zc,this,rd))return void this.hideDropdown();if(d(qc,this,0===t.detail),c(Jc,this)||(d(Jc,this,new AbortController),window.addEventListener("pointerdown",l(Zc,this,sd).bind(this),{signal:c(Qc,this).combinedSignal(c(Jc,this))})),c(jc,this).ariaExpanded="true",c(Gc,this))return void c(Gc,this).classList.remove("hidden");const e=d(Gc,this,l(Zc,this,td).call(this));c(jc,this).append(e)}function sd(t){var e;null!==(e=c(Gc,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function rd(t){return c(Gc,t)&&!c(Gc,t).classList.contains("hidden")}E=$c;var ad={_:null},od=new WeakMap,ld=new WeakMap,hd=new WeakMap;class cd{constructor(t){o(this,od,null),o(this,ld,null),o(this,hd,null),d(ld,this,t),d(hd,this,t._uiManager),dd._||(dd._=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(c(od,this))return c(od,this);const{editorType:t,colorType:e,colorValue:i}=c(ld,this),n=d(od,this,document.createElement("input"));return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",dd._[t]),n.addEventListener("input",()=>{c(hd,this).updateParams(e,n.value)},{signal:c(hd,this)._signal}),n}update(t){c(od,this)&&(c(od,this).value=t)}destroy(){var t;null===(t=c(od,this))||void 0===t||t.remove(),d(od,this,null)}hideDropdown(){}}var dd={_:null};function ud(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function pd(t){return Math.max(0,Math.min(255,255*t))}class gd{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=pd(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=ud(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(pd)}static RGB_HTML(t){return"#".concat(t.map(ud).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[pd(1-Math.min(1,e+s)),pd(1-Math.min(1,n+s)),pd(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,r=1-i,a=1-n;return["CMYK",s,r,a,Math.min(s,r,a)]}}class fd{create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){vt("Abstract method `_createSVG` called.")}}class md extends fd{_createSVG(t){return document.createElementNS(Ut,t)}}const vd=new WeakSet,wd=60*(new Date).getTimezoneOffset()*1e3;class bd{static create(t){switch(t.data.annotationType){case tt.LINK:return new Cd(t);case tt.TEXT:return new Dd(t);case tt.WIDGET:switch(t.data.fieldType){case"Tx":return new Id(t);case"Btn":return t.data.radioButton?new Od(t):t.data.checkBox?new Nd(t):new Bd(t);case"Ch":return new Wd(t);case"Sig":return new Fd(t)}return new Ld(t);case tt.POPUP:return new Hd(t);case tt.FREETEXT:return new Pu(t);case tt.LINE:return new Du(t);case tt.SQUARE:return new Iu(t);case tt.CIRCLE:return new Nu(t);case tt.POLYLINE:return new Bu(t);case tt.CARET:return new zu(t);case tt.INK:return new Uu(t);case tt.POLYGON:return new Wu(t);case tt.HIGHLIGHT:return new qu(t);case tt.UNDERLINE:return new Xu(t);case tt.SQUIGGLY:return new Yu(t);case tt.STRIKEOUT:return new Ku(t);case tt.STAMP:return new Ju(t);case tt.FILEATTACHMENT:return new $u(t);default:return new Ed(t)}}}var yd=new WeakMap,Ad=new WeakMap,_d=new WeakMap,xd=new WeakSet;class Ed{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,xd),o(this,yd,null),o(this,Ad,!1),o(this,_d,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{contentsObj:e,richText:i}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Ed._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var t;const{data:e}=this,i=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(e.id);return i?i.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){var t;const e=null===(t=this.annotationStorage)||void 0===t?void 0:t.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:i,inkLists:n,rect:s}=this.data;let r=-1/0,a=-1/0;if((null===i||void 0===i?void 0:i.length)>=8){for(let t=0;t<i.length;t+=8)i[t+1]>a?(a=i[t+1],r=i[t+2]):i[t+1]===a&&(r=Math.max(r,i[t+2]));return[r,a]}if((null===n||void 0===n?void 0:n.length)>=1){for(const t of n)for(let e=0,i=t.length;e<i;e+=2)t[e+1]>a?(a=t[e+1],r=t[e]):t[e+1]===a&&(r=Math.max(r,t[e]));if(r!==1/0)return[r,a]}return s?[s[2],s[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-s)/i,t[1]=100*(t[1]-r)/n,t}get commentText(){var t,e;const{data:i}=this;return(null===(t=this.annotationStorage.getRawValue("".concat(U).concat(i.id)))||void 0===t||null===(t=t.popup)||void 0===t?void 0:t.contents)||(null===(e=i.contentsObj)||void 0===e?void 0:e.str)||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue("".concat(U).concat(e.id),{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){var t,e;null===(t=(null===(e=c(_d,this))||void 0===e?void 0:e.popup)||this.popup)||void 0===t||t.remove(),d(_d,this,this.popup=null)}updateEdited(t){var e;if(!this.container)return;t.rect&&(c(yd,this)||d(yd,this,{rect:this.data.rect.slice(0)}));const{rect:i,popup:n}=t;i&&l(xd,this,kd).call(this,i);let s=(null===(e=c(_d,this))||void 0===e?void 0:e.popup)||this.popup;!s&&null!==n&&void 0!==n&&n.text&&(this._createPopup(n),s=c(_d,this).popup),s&&(s.updateEdited(t),null!==n&&void 0!==n&&n.deleted&&(s.remove(),d(_d,this,null),this.popup=null))}resetEdited(){var t;c(yd,this)&&(l(xd,this,kd).call(this,c(yd,this).rect),null===(t=c(_d,this))||void 0===t||t.popup.resetEdited(),d(yd,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof Ld||this instanceof Cd||(s.tabIndex=0);const{style:r}=s;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Hd){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){r.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--total-scale-factor)) / calc(").concat(i,"px * var(--total-scale-factor))");r.borderRadius=e}else if(this instanceof Od){const t="calc(".concat(a,"px * var(--total-scale-factor)) / calc(").concat(o,"px * var(--total-scale-factor))");r.borderRadius=t}switch(e.borderStyle.style){case et:r.borderStyle="solid";break;case it:r.borderStyle="dashed";break;case nt:mt("Unimplemented border style: beveled");break;case st:mt("Unimplemented border style: inset");break;case rt:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(d(Ad,this,!0),r.borderColor=Lt.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=Lt.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:c,pageX:u,pageY:p}=n.rawDims;r.left="".concat(100*(l[0]-u)/h,"%"),r.top="".concat(100*(l[1]-p)/c,"%");const{rotation:g}=e;return e.hasOwnCanvas||0===g?(r.width="".concat(100*a/h,"%"),r.height="".concat(100*o/c,"%")):this.setRotation(g,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:s,height:r}=this;t%180!==0&&([s,r]=[r,s]),e.style.width="".concat(100*s/i,"%"),e.style.height="".concat(100*r/n,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],r=n.slice(1);i.target.style[e]=gd["".concat(s,"_HTML")](r),this.annotationStorage.setValue(this.data.id,{[e]:gd["".concat(s,"_rgb")](r)})};return At(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];null===s||void 0===s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];if(r){r({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[r,a,o,l]=t.subarray(2,6);if(n===r&&s===a&&e===o&&i===l)return}const{style:r}=this.container;let a;if(c(Ad,this)){const{borderColor:t,borderWidth:e}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">','<g fill="transparent" stroke="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const u=h.createElement("defs");d.append(u);const p=h.createElement("clipPath"),g="clippath_".concat(this.data.id);p.setAttribute("id",g),p.setAttribute("clipPathUnits","objectBoundingBox"),u.append(p);for(let c=2,m=t.length;c<m;c+=8){var f;const i=t[c],n=t[c+1],r=t[c+2],d=t[c+3],u=h.createElement("rect"),g=(r-e)/o,m=(s-n)/l,v=(i-r)/o,w=(n-d)/l;u.setAttribute("x",g),u.setAttribute("y",m),u.setAttribute("width",v),u.setAttribute("height",w),p.append(u),null===(f=a)||void 0===f||f.push('<rect vector-effect="non-scaling-stroke" x="'.concat(g,'" y="').concat(m,'" width="').concat(v,'" height="').concat(w,'"/>'))}c(Ad,this)&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(g,")")}_createPopup(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const{data:e}=this;let i,n;t?(i={str:t.text},n=t.date):(i=e.contentsObj,n=e.modificationDate);const s=d(_d,this,new Hd({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent._commentManager||this.parent.div.append(s.render())}get hasPopupElement(){return!!(c(_d,this)||this.popup||this.data.popupRef)}get extraPopupElement(){return c(_d,this)}render(){vt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:r}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof r?r:null,a=document.querySelector('[data-element-id="'.concat(s,'"]'));!a||vd.has(a)?i.push({id:s,exportValue:n,domElement:a}):mt("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(vd.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}function kd(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t),e.left="".concat(100*(t[0]-a)/s,"%"),e.top="".concat(100*(r-t[3]+o)/r,"%"),0===n?(e.width="".concat(100*(t[2]-t[0])/s,"%"),e.height="".concat(100*(t[3]-t[1])/r,"%")):this.setRotation(n)}class Md extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}var Sd=new WeakSet;class Cd extends Ed{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),a(this,Sd),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action,t.overlaidText),n=!0):t.attachment?(l(Sd,this,Pd).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),n=!0):t.setOCGState?(l(Sd,this,Rd).call(this,i,t.setOCGState,t.overlaidText),n=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&l(Sd,this,Td).call(this),i&&(t.title=i)}_bindNamedAction(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),i&&(t.title=i),l(Sd,this,Td).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),l(Sd,this,Td).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),l(Sd,this,Td).call(this),!this._fieldObjects)return mt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:n,include:s}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&r.push(i)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const a=this.annotationStorage,o=[];for(const e of r){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(vd.has(i)?i.dispatchEvent(new Event("resetform")):mt("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Td(){this.container.setAttribute("data-internal-link","")}function Pd(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:i&&(t.title=i),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,n),!1},l(Sd,this,Td).call(this)}function Rd(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),i&&(t.title=i),l(Sd,this,Td).call(this)}class Dd extends Ed{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Ld extends Ed{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Rt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{var r;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))})}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,r,a;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":Lt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const a=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(I*n))||1);r=Math.min(n,a(e/I))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/I))}s.fontSize="calc(".concat(r,"px * var(--total-scale-factor))"),s.color=Lt.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Id extends Ld{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var n;const r=t.getValue(e,{value:this.data.fieldValue});let a=r.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let l=r.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const h={userValue:a,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",null!==l&&void 0!==l?l:a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),vd.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:c,datetimeType:d,timeStep:u}=this.data,p=!!d&&this.enableScripting;c&&(i.title=c),this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),h.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=h.userValue=n,h.formattedValue=null});let g=t=>{const{formattedValue:e}=h;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",t=>{var e;if(h.focused)return;const{target:i}=t;if(p&&(i.type=d,u&&(i.step=u)),h.userValue){const t=h.userValue;if(p)if("time"===d){const e=new Date(t),n=[e.getHours(),e.getMinutes(),e.getSeconds()];i.value=n.map(t=>t.toString().padStart(2,"0")).join(":")}else i.value=new Date(t-wd).toISOString().split("date"===d?"T":".",1)[0];else i.value=t}h.lastCommittedValue=i.value,h.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(h.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;h.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",p||t.setValue(e,{value:h.userValue.toString()}),i.target.value=h.userValue},formattedValue(i){const{formattedValue:n}=i.detail;h.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n);const s={formattedValue:n};p&&(s.value=n),t.setValue(e,s)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:r}=i;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let a=h.userValue;!a||a.length<=s||(a=a.slice(0,s),r.value=h.userValue=a,t.setValue(e,{value:a}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{var i;h.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=g;g=null,i.addEventListener("blur",t=>{var i;if(!h.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(h.focused=!1);const{target:s}=t;let{value:r}=s;if(p){if(r&&"time"===d){const t=r.split(":").map(t=>parseInt(t,10));r=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf(),s.step=""}else r.includes("T")||(r="".concat(r,"T00:00")),r=new Date(r).valueOf();s.type="text"}var a;(h.userValue=r,h.lastCommittedValue!==r)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)}),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",t=>{var i;h.lastCommittedValue=null;const{data:n,target:s}=t,{value:r,selectionStart:a,selectionEnd:o}=s;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(i,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(g&&i.addEventListener("blur",g),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--total-scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Fd extends Ld{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Nd extends Ld{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return vd.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=0,s.addEventListener("change",n=>{const{name:s,checked:r}=n.target;for(const a of this._getElementsByName(s,i)){const i=r&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.id,{value:i})}t.setValue(i,{value:r})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Od extends Ld{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(vd.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",e=>{const{name:n,checked:s}=e.target;for(const r of this._getElementsByName(n,i))t.setValue(r.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Bd extends Cd{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class Wd extends Ld{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");vd.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e});for(const h of this.data.options){const t=document.createElement("option");t.textContent=h.displayValue,t.value=h.exportValue,i.value.includes(h.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}let r=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),r=()=>{t.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",i=>{const s={value(i){var s;null===(s=r)||void 0===s||s();const l=i.detail.value,h=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=h.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,r=i.detail.remove;if(s[r].selected=!1,n.remove(r),s.length>0){-1===Array.prototype.findIndex.call(s,t=>t.selected)&&(s[0].selected=!0)}t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:s,displayValue:r,exportValue:h}=i.detail.insert,c=n.children[s],d=document.createElement("option");d.textContent=r,d.value=h,c?c.before(d):n.append(d),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)}),n.addEventListener("input",i=>{var n;const s=a(!0),r=a(!1);t.setValue(e,{value:s}),i.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):n.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}var zd=new WeakSet;class Hd extends Ed{constructor(t){const{data:e,elements:i,parent:n}=t,s=!!n._commentManager;if(super(t,{isRenderable:!s&&Ed._hasPopupData(e)}),a(this,zd),this.elements=i,s&&Ed._hasPopupData(e)){const t=this.popup=l(zd,this,jd).call(this);for(const e of i)e.popup=t}else this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=l(zd,this,jd).call(this),i=[];for(const n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",i.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(t=>"".concat(Wt).concat(t)).join(",")),this.container}}function jd(){return new mu({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}var Vd=new WeakMap,Ud=new WeakMap,Gd=new WeakMap,qd=new WeakMap,Xd=new WeakMap,Yd=new WeakMap,Kd=new WeakMap,Jd=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakMap,iu=new WeakMap,nu=new WeakMap,su=new WeakMap,ru=new WeakMap,au=new WeakMap,ou=new WeakMap,lu=new WeakMap,hu=new WeakMap,cu=new WeakMap,du=new WeakMap,uu=new WeakMap,pu=new WeakMap,gu=new WeakMap,fu=new WeakSet;class mu{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:h,richText:u,parent:p,rect:g,parentRect:f,open:m,commentManager:v=null}=t;a(this,fu),o(this,Vd,null),o(this,Ud,l(fu,this,ku).bind(this)),o(this,Gd,l(fu,this,Tu).bind(this)),o(this,qd,l(fu,this,Cu).bind(this)),o(this,Xd,l(fu,this,Su).bind(this)),o(this,Yd,null),o(this,Kd,null),o(this,Jd,null),o(this,Qd,null),o(this,Zd,null),o(this,$d,null),o(this,tu,null),o(this,eu,!1),o(this,iu,null),o(this,nu,null),o(this,su,null),o(this,ru,null),o(this,au,null),o(this,ou,null),o(this,lu,null),o(this,hu,null),o(this,cu,null),o(this,du,null),o(this,uu,!1),o(this,pu,null),o(this,gu,null),d(Kd,this,e),d(cu,this,s),d(Jd,this,h),d(hu,this,u),d($d,this,p),d(Yd,this,i),d(lu,this,g),d(tu,this,f),d(Zd,this,n),d(Vd,this,v),d(pu,this,n[0]),d(Qd,this,ee.toDateObject(r)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup()),v?this.renderCommentButton():(l(fu,this,vu).call(this),c(Kd,this).hidden=!0,m&&l(fu,this,Su).call(this))}renderCommentButton(){if(c(ru,this))return;if(c(au,this)||l(fu,this,wu).call(this),!c(au,this))return;const{signal:t}=d(nu,this,new AbortController),e=!!c(pu,this).extraPopupElement,i=()=>{c(Vd,this).toggleCommentPopup(this,!0,void 0,!e)},n=()=>{c(Vd,this).toggleCommentPopup(this,!1,!0,!e)},s=()=>{c(Vd,this).toggleCommentPopup(this,!1,!1)};if(e){d(ru,this,c(pu,this).container);for(const e of this.trigger)e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.addEventListener("keydown",c(Ud,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),e.classList.add("popupTriggerArea")}else{const e=d(ru,this,document.createElement("button"));e.className="annotationCommentButton";const r=c(pu,this).container;e.style.zIndex=r.style.zIndex+1,e.tabIndex=0,e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button"),l(fu,this,yu).call(this),l(fu,this,bu).call(this),e.addEventListener("keydown",c(Ud,this),{signal:t}),e.addEventListener("click",i,{signal:t}),e.addEventListener("pointerenter",n,{signal:t}),e.addEventListener("pointerleave",s,{signal:t}),r.after(e)}}get commentButtonColor(){const{color:t,opacity:e}=c(pu,this).commentData;return t?c($d,this)._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{var t;null===(t=c(ru,this))||void 0===t||t.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}=c(pu,this).commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:s}}get elementBeforePopup(){return c(ru,this)}get comment(){return c(gu,this)||d(gu,this,c(pu,this).commentText),c(gu,this)}set comment(t){t!==this.comment&&(c(pu,this).commentText=d(gu,this,t))}get parentBoundingClientRect(){return c(pu,this).layer.getBoundingClientRect()}setCommentButtonStates(t){let{selected:e,hasPopup:i}=t;c(ru,this)&&(c(ru,this).classList.toggle("selected",e),c(ru,this).ariaExpanded=i)}setSelectedCommentButton(t){c(ru,this).classList.toggle("selected",t)}get commentPopupPosition(){if(c(ou,this))return c(ou,this);const{x:t,y:e,height:i}=c(ru,this).getBoundingClientRect(),{x:n,y:s,width:r,height:a}=c(pu,this).layer.getBoundingClientRect();return[(t-n)/r,(e+i-s)/a]}set commentPopupPosition(t){d(ou,this,t)}hasDefaultPopupPosition(){return null===c(ou,this)}get commentButtonPosition(){return c(au,this)}get commentButtonWidth(){return c(ru,this).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=c(ou,this)||this.commentButtonPosition.map(t=>t/100),n=this.parentBoundingClientRect,{x:r,y:a,width:o,height:l}=n;c(Vd,this).showDialog(null,this,r+e*o,a+i*l,(0,s.A)((0,s.A)({},t),{},{parentDimensions:n}))}render(){var t,e;if(c(iu,this))return;const i=d(iu,this,document.createElement("div"));if(i.className="popup",c(Yd,this)){const t=i.style.outlineColor=Lt.makeHexColor(...c(Yd,this));i.style.backgroundColor="color-mix(in srgb, ".concat(t," 30%, white)")}const n=document.createElement("span");if(n.className="header",null!==(t=c(cu,this))&&void 0!==t&&t.str){const t=document.createElement("span");t.className="title",n.append(t),({dir:t.dir,str:t.textContent}=c(cu,this))}if(i.append(n),c(Qd,this)){const t=document.createElement("time");t.className="popupDate",t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:c(Qd,this).valueOf()})),t.dateTime=c(Qd,this).toISOString(),n.append(t)}fe({html:h(fu,this,Au)||c(Jd,this).str,dir:null===(e=c(Jd,this))||void 0===e?void 0:e.dir,className:"popupContent"},i),c(Kd,this).append(i)}updateEdited(t){var e;let{rect:i,popup:n,deleted:s}=t;if(c(Vd,this))return s?(this.remove(),d(gu,this,null)):n&&(n.deleted?this.remove():(l(fu,this,yu).call(this),d(gu,this,n.text))),void(i&&(d(au,this,null),l(fu,this,wu).call(this),l(fu,this,bu).call(this)));s||null!==n&&void 0!==n&&n.deleted?this.remove():(l(fu,this,vu).call(this),c(du,this)||d(du,this,{contentsObj:c(Jd,this),richText:c(hu,this)}),i&&d(su,this,null),n&&n.text&&(d(hu,this,l(fu,this,Eu).call(this,n.text)),d(Qd,this,ee.toDateObject(n.date)),d(Jd,this,null)),null===(e=c(iu,this))||void 0===e||e.remove(),d(iu,this,null))}resetEdited(){var t;c(du,this)&&(({contentsObj:n(d,[Jd,this])._,richText:n(d,[hu,this])._}=c(du,this)),d(du,this,null),null===(t=c(iu,this))||void 0===t||t.remove(),d(iu,this,null),d(su,this,null))}remove(){var t,e,i;if(null===(t=c(nu,this))||void 0===t||t.abort(),d(nu,this,null),null===(e=c(iu,this))||void 0===e||e.remove(),d(iu,this,null),d(uu,this,!1),d(eu,this,!1),null===(i=c(ru,this))||void 0===i||i.remove(),d(ru,this,null),this.trigger)for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){d(uu,this,this.isVisible),c(uu,this)&&(c(Kd,this).hidden=!0)}maybeShow(){c(Vd,this)||(l(fu,this,vu).call(this),c(uu,this)&&(c(iu,this)||l(fu,this,Cu).call(this),d(uu,this,!1),c(Kd,this).hidden=!1))}get isVisible(){return!c(Vd,this)&&!1===c(Kd,this).hidden}}function vu(){if(c(nu,this))return;d(nu,this,new AbortController);const{signal:t}=c(nu,this);for(const i of this.trigger)i.addEventListener("click",c(Xd,this),{signal:t}),i.addEventListener("pointerenter",c(qd,this),{signal:t}),i.addEventListener("pointerleave",c(Gd,this),{signal:t}),i.classList.add("popupTriggerArea");for(const i of c(Zd,this)){var e;null===(e=i.container)||void 0===e||e.addEventListener("keydown",c(Ud,this),{signal:t})}}function wu(){const t=c(Zd,this).find(t=>t.hasCommentButton);t&&d(au,this,t._normalizePoint(t.commentButtonPosition))}function bu(){if(c(pu,this).extraPopupElement&&!c(pu,this).editor)return;this.renderCommentButton();const[t,e]=c(au,this),{style:i}=c(ru,this);i.left="calc(".concat(t,"%)"),i.top="calc(".concat(e,"% - var(--comment-button-dim))")}function yu(){c(pu,this).extraPopupElement||(this.renderCommentButton(),c(ru,this).style.backgroundColor=this.commentButtonColor||"")}function Au(t){const e=c(hu,t),i=c(Jd,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:c(hu,t).html||null}function _u(t){var e;return(null===(e=h(fu,t,Au))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function xu(t){var e;return(null===(e=h(fu,t,Au))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function Eu(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:h(fu,this,xu),fontSize:h(fu,this,_u)?"calc(".concat(h(fu,this,_u),"px * var(--total-scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function ku(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&c(eu,this))&&l(fu,this,Su).call(this)}function Mu(){if(null!==c(su,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=c($d,this);let r=!!c(tu,this),a=c(r?tu:lu,this);for(const d of c(Zd,this))if(!a||null!==Lt.intersect(d.data.rect,a)){a=d.data.rect,r=!0;break}const o=Lt.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=r?a[2]-a[0]+5:0,h=o[0]+l,u=o[1];d(su,this,[100*(h-n)/e,100*(u-s)/i]);const{style:p}=c(Kd,this);p.left="".concat(c(su,this)[0],"%"),p.top="".concat(c(su,this)[1],"%")}function Su(){c(Vd,this)?c(Vd,this).toggleCommentPopup(this,!1):(d(eu,this,!c(eu,this)),c(eu,this)?(l(fu,this,Cu).call(this),c(Kd,this).addEventListener("click",c(Xd,this)),c(Kd,this).addEventListener("keydown",c(Ud,this))):(l(fu,this,Tu).call(this),c(Kd,this).removeEventListener("click",c(Xd,this)),c(Kd,this).removeEventListener("keydown",c(Ud,this))))}function Cu(){c(iu,this)||this.render(),this.isVisible?c(eu,this)&&c(Kd,this).classList.add("focused"):(l(fu,this,Mu).call(this),c(Kd,this).hidden=!1,c(Kd,this).style.zIndex=parseInt(c(Kd,this).style.zIndex)+1e3)}function Tu(){c(Kd,this).classList.remove("focused"),!c(eu,this)&&this.isVisible&&(c(Kd,this).hidden=!0,c(Kd,this).style.zIndex=parseInt(c(Kd,this).style.zIndex)-1e3)}class Pu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=G.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Ru=new WeakMap;class Du extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),o(this,Ru,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=d(Ru,this,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return c(Ru,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Lu=new WeakMap;class Iu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),o(this,Lu,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=d(Lu,this,this.svgFactory.createElement("svg:rect"));return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return c(Lu,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Fu=new WeakMap;class Nu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),o(this,Fu,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=d(Fu,this,this.svgFactory.createElement("svg:ellipse"));return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return c(Fu,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Ou=new WeakMap;class Bu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),o(this,Ou,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n},width:s,height:r}=this;if(!e)return this.container;const a=this.svgFactory.create(s,r,!0);let o=[];for(let h=0,c=e.length;h<c;h+=2){const i=e[h]-t[0],n=t[3]-e[h+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=d(Ou,this,this.svgFactory.createElement(this.svgElementName));return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return c(Ou,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Wu extends Bu{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class zu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Hu=new WeakMap,ju=new WeakMap,Vu=new WeakSet;class Uu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),a(this,Vu),o(this,Hu,null),o(this,ju,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?G.HIGHLIGHT:G.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:i,borderStyle:n,popupRef:s}}=this,{transform:r,width:a,height:o}=l(Vu,this,Gu).call(this,e,t),h=this.svgFactory.create(a,o,!0),u=d(Hu,this,this.svgFactory.createElement("svg:g"));h.append(u),u.setAttribute("stroke-width",n.width||1),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("stroke-miterlimit",10),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),u.setAttribute("transform",r);for(let l=0,d=i.length;l<d;l++){const t=this.svgFactory.createElement(this.svgElementName);c(ju,this).push(t),t.setAttribute("points",i[l].join(",")),u.append(t)}return!s&&this.hasPopupData&&this._createPopup(),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:i,rect:n}=t,s=c(Hu,this);if(e>=0&&s.setAttribute("stroke-width",e||1),i)for(let r=0,a=c(ju,this).length;r<a;r++)c(ju,this)[r].setAttribute("points",i[r].join(","));if(n){const{transform:t,width:e,height:i}=l(Vu,this,Gu).call(this,this.data.rotation,n);s.parentElement.setAttribute("viewBox","0 0 ".concat(e," ").concat(i)),s.setAttribute("transform",t)}}getElementsToTriggerPopup(){return c(ju,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function Gu(t,e){switch(t){case 90:return{transform:"rotate(90) translate(".concat(-e[0],",").concat(e[1],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:"rotate(180) translate(".concat(-e[2],",").concat(e[1],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:"rotate(270) translate(".concat(-e[2],",").concat(e[3],") scale(1,-1)"),width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:"translate(".concat(-e[0],",").concat(e[3],") scale(1,-1)"),width:e[2]-e[0],height:e[3]-e[1]}}}class qu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=G.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class Xu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class Yu extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class Ku extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class Ju extends Ed{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=G.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Qu=new WeakMap,Zu=new WeakSet;class $u extends Ed{constructor(t){var e;super(t,{isRenderable:!0}),a(this,Zu),o(this,Qu,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,s.A)({source:this},i))}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",l(Zu,this,tp).bind(this)),d(Qu,this,i);const{isMac:n}=Rt.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&l(Zu,this,tp).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return c(Qu,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function tp(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var ep=new WeakMap,ip=new WeakMap,np=new WeakMap,sp=new WeakMap,rp=new WeakMap,ap=new WeakMap,op=new WeakSet;class lp{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:l,structTreeLayer:h,commentManager:c,linkService:u,annotationStorage:p}=t;a(this,op),o(this,ep,null),o(this,ip,null),o(this,np,null),o(this,sp,new Map),o(this,rp,null),o(this,ap,null),this.div=e,d(ep,this,i),d(ip,this,n),d(rp,this,h||null),d(ap,this,u||null),d(np,this,p||new yr),this.page=r,this.viewport=l,this.zIndex=0,this._annotationEditorUIManager=s,this._commentManager=c||null}hasEditableAnnotations(){return c(sp,this).size>0}async render(t){const{annotations:e}=t,i=this.div;ae(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:c(ap,this),downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new md,annotationStorage:c(np,this),enableComment:!0===t.enableComment,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const o of e){var r;if(o.noHTML)continue;const t=o.annotationType===tt.POPUP;if(t){const t=n.get(o.id);if(!t)continue;s.elements=t}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;s.data=o;const e=bd.create(s);if(!e.isRenderable)continue;if(!t&&o.popupRef){const t=n.get(o.popupRef);t?t.push(e):n.set(o.popupRef,[e])}const i=e.render();var a;if(o.hidden&&(i.style.visibility="hidden"),await l(op,this,hp).call(this,i,o.id,s.elements),null===(r=e.extraPopupElement)||void 0===r||null===(r=r.popup)||void 0===r||r.renderCommentButton(),e._isEditable)c(sp,this).set(e.data.id,e),null===(a=this._annotationEditorUIManager)||void 0===a||a.renderAnnotationElement(e)}l(op,this,cp).call(this)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:c(ap,this),svgFactory:new md,parent:this};for(const i of t){i.borderStyle||(i.borderStyle=lp._defaultBorderStyle),e.data=i;const t=bd.create(e);if(!t.isRenderable)continue;const n=t.render();await l(op,this,hp).call(this,n,i.id,null)}}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,ae(i,{rotation:e.rotation}),l(op,this,cp).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(c(sp,this).values())}getEditableAnnotation(t){return c(sp,this).get(t)}addFakeAnnotation(t){var e;const{div:i}=this,{id:n,rotation:s}=t,r=new Md({data:{id:n,rect:t.getPDFRect(),rotation:s},editor:t,layer:i,parent:this,enableComment:!!this._commentManager,linkService:c(ap,this),annotationStorage:c(np,this)}),a=r.render();return i.append(a),null===(e=c(ep,this))||void 0===e||e.moveElementInDOM(i,a,a,!1),r.createOrUpdatePopup(),r}static get _defaultBorderStyle(){return At(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:et,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}async function hp(t,e,i){var n;const s=t.firstChild||t,r=s.id="".concat(Wt).concat(e),a=await(null===(n=c(rp,this))||void 0===n?void 0:n.getAriaAttributes(r));if(a)for(const[l,h]of a)s.setAttribute(l,h);var o;i?i.at(-1).container.after(t):(this.div.append(t),null===(o=c(ep,this))||void 0===o||o.moveElementInDOM(this.div,t,s,!1))}function cp(){if(!c(ip,this))return;const t=this.div;for(const[i,n]of c(ip,this)){const s=t.querySelector('[data-annotation-id="'.concat(i,'"]'));if(!s)continue;n.className="annotationContent";const{firstChild:r}=s;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.classList.contains("annotationContent")?r.after(n):r.before(n):s.append(n);const a=c(sp,this).get(i);var e;if(a)if(a._hasNoCanvas)null===(e=this._annotationEditorUIManager)||void 0===e||e.setMissingCanvas(i,s.id,n),a._hasNoCanvas=!1;else a.canvas=n}c(ip,this).clear()}const dp=/\r\n?|\n/g;var up=new WeakMap,pp=new WeakMap,gp=new WeakMap,fp=new WeakMap,mp=new WeakSet;class vp extends Vs{static get _keyboardManager(){const t=vp.prototype,e=t=>t.isEmpty(),i=tn.TRANSLATE_SMALL,n=tn.TRANSLATE_BIG;return At(this,"_keyboardManager",new ei([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}constructor(t){super((0,s.A)((0,s.A)({},t),{},{name:"freeTextEditor"})),a(this,mp),o(this,up,""),o(this,pp,"".concat(this.id,"-editor")),o(this,gp,null),o(this,fp,void 0),(0,P.A)(this,"_colorPicker",null),this.color=t.color||vp._defaultColor||Vs._defaultLineColor,d(fp,this,t.fontSize||vp._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,e){Vs.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case q.FREETEXT_SIZE:vp._defaultFontSize=e;break;case q.FREETEXT_COLOR:vp._defaultColor=e}}updateParams(t,e){switch(t){case q.FREETEXT_SIZE:l(mp,this,wp).call(this,e);break;case q.FREETEXT_COLOR:l(mp,this,bp).call(this,e)}}static get defaultPropertiesToUpdate(){return[[q.FREETEXT_SIZE,vp._defaultFontSize],[q.FREETEXT_COLOR,vp._defaultColor||Vs._defaultLineColor]]}get propertiesToUpdate(){return[[q.FREETEXT_SIZE,c(fp,this)],[q.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new cd(this)),[["colorPicker",this._colorPicker]]}get colorType(){return q.FREETEXT_COLOR}onUpdatedColor(){var t;this.editorDiv.style.color=this.color,null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-vp._internalPadding*t,-(vp._internalPadding+c(fp,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),d(gp,this,new AbortController);const t=this._uiManager.combinedSignal(c(gp,this));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){var t;return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",c(pp,this)),this._isDraggable=!0,null===(t=c(gp,this))||void 0===t||t.abort(),d(gp,this,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){var e;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=c(up,this),e=d(up,this,l(mp,this,yp).call(this).trimEnd());if(t===e)return;const i=t=>{d(up,this,t),t?(l(mp,this,xp).call(this),this._uiManager.rebuild(this),l(mp,this,Ap).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),l(mp,this,Ap).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){vp._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",c(pp,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat(c(fp,this),"px * var(--total-scale-factor))"),i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this._initialData;let[r,a]=this.getInitialTranslation();[r,a]=this.pageTranslationToScreen(r,a);const[o,l]=this.pageDimensions,[h,c]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(s[0]-h)/o,u=e+this.height-(s[1]-c)/l;break;case 90:d=t+(s[0]-h)/o,u=e-(s[1]-c)/l,[r,a]=[a,-r];break;case 180:d=t-this.width+(s[0]-h)/o,u=e-(s[1]-c)/l,[r,a]=[-r,-a];break;case 270:d=t+(s[0]-h-this.height*l)/o,u=e+(s[1]-c-this.width*o)/l,[r,a]=[-a,r]}this.setAt(d*i,u*n,r,a)}else this._moveAfterPaste(t,e);l(mp,this,xp).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=kp.call(vp,e.getData("text")||"").replaceAll(dp,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:o}=r,h=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(dp,"")),t!==this.editorDiv){let e=h;for(const i of this.editorDiv.childNodes)i!==t?e.push(_p.call(vp,i)):e=c}h.push(a.nodeValue.slice(0,o).replaceAll(dp,""))}else if(a===this.editorDiv){let t=h,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(_p.call(vp,i))}d(up,this,"".concat(h.join("\n")).concat(n).concat(c.join("\n"))),l(mp,this,xp).call(this);const u=new Range;let p=Math.sumPrecise(h.map(t=>t.length));for(const{firstChild:l}of this.editorDiv.childNodes)if(l.nodeType===Node.TEXT_NODE){const t=l.nodeValue.length;if(p<=t){u.setStart(l,p),u.setEnd(l,p);break}p-=t}s.removeAllRanges(),s.addRange(u)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=vp._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let n=null;if(t instanceof Pu){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a,popupRef:o,richText:l,contentsObj:h,creationDate:c,modificationDate:d},textContent:u,textPosition:p,parent:{page:{pageNumber:g}}}=t;if(!u||0===u.length)return null;n=t={annotationType:G.FREETEXT,color:Array.from(i),fontSize:e,value:u.join("\n"),position:p,pageIndex:g-1,rect:s.slice(0),rotation:r,annotationElementId:a,id:a,deleted:!1,popupRef:o,comment:(null===h||void 0===h?void 0:h.str)||null,richText:l,creationDate:c,modificationDate:d}}const s=await super.deserialize(t,e,i);return d(fp,s,t.fontSize),s.color=Lt.makeHexColor(...t.color),d(up,s,kp.call(vp,t.value)),s._initialData=n,t.comment&&s.setCommentData(t),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Vs._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:c(fp,this),value:l(mp,this,Ep).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!l(mp,this,Mp).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize="calc(".concat(c(fp,this),"px * var(--total-scale-factor))"),i.color=this.color,e.replaceChildren();for(const n of c(up,this).split("\n")){const t=document.createElement("div");t.append(n?document.createTextNode(n):document.createElement("br")),e.append(t)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:c(up,this)}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function wp(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--total-scale-factor))"),this.translate(0,-(t-c(fp,this))*this.parentScale),d(fp,this,t),l(mp,this,Ap).call(this)},i=c(fp,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function bp(t){const e=t=>{this.color=t,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function yp(){const t=[];this.editorDiv.normalize();let e=null;for(const n of this.editorDiv.childNodes){var i;(null===(i=e)||void 0===i?void 0:i.nodeType)===Node.TEXT_NODE&&"BR"===n.nodeName||(t.push(_p.call(k,n)),e=n)}return t.join("\n")}function Ap(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}function _p(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(dp,"")}function xp(){if(this.editorDiv.replaceChildren(),c(up,this))for(const t of c(up,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function Ep(){return c(up,this).replaceAll("\xa0"," ")}function kp(t){return t.replaceAll(" ","\xa0")}function Mp(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==s}k=vp,(0,P.A)(vp,"_freeTextDefaultContent",""),(0,P.A)(vp,"_internalPadding",0),(0,P.A)(vp,"_defaultColor",null),(0,P.A)(vp,"_defaultFontSize",10),(0,P.A)(vp,"_type","freetext"),(0,P.A)(vp,"_editorType",G.FREETEXT);class Sp{toSVGPath(){vt("Abstract method `toSVGPath` must be implemented.")}get box(){vt("Abstract getter `box` must be implemented.")}serialize(t,e){vt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,n,s,r){r||(r=new Float32Array(t.length));for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r}static _rescaleAndSwap(t,e,i,n,s,r){r||(r=new Float32Array(t.length));for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r}static _translate(t,e,i,n){n||(n=new Float32Array(t.length));for(let s=0,r=t.length;s<r;s+=2)n[s]=e+t[s],n[s+1]=i+t[s+1];return n}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,i,n,s){switch(s){case 90:return[1-e/i,t/n];case 180:return[1-t/i,1-e/n];case 270:return[e/i,1-t/n];default:return[t/i,e/n]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,n,s,r){return[(t+5*i)/6,(e+5*n)/6,(5*i+s)/6,(5*n+r)/6,(i+s)/2,(n+r)/2]}}(0,P.A)(Sp,"PRECISION",1e-4);var Cp=new WeakMap,Tp=new WeakMap,Pp=new WeakMap,Rp=new WeakMap,Dp=new WeakMap,Lp=new WeakMap,Ip=new WeakMap,Fp=new WeakMap,Np=new WeakMap,Op=new WeakMap,Bp=new WeakMap,Wp=new WeakMap,zp=new WeakMap,Hp=new WeakSet;class jp{constructor(t,e,i,n,s){let{x:r,y:l}=t,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;a(this,Hp),o(this,Cp,void 0),o(this,Tp,[]),o(this,Pp,void 0),o(this,Rp,void 0),o(this,Dp,[]),o(this,Lp,new Float32Array(18)),o(this,Ip,void 0),o(this,Fp,void 0),o(this,Np,void 0),o(this,Op,void 0),o(this,Bp,void 0),o(this,Wp,void 0),o(this,zp,[]),d(Cp,this,e),d(Wp,this,n*i),d(Rp,this,s),c(Lp,this).set([NaN,NaN,NaN,NaN,r,l],6),d(Pp,this,h),d(Op,this,Jp._*i),d(Np,this,Qp._*i),d(Bp,this,i),c(zp,this).push(r,l)}isEmpty(){return isNaN(c(Lp,this)[8])}add(t){var e;let{x:i,y:n}=t;d(Ip,this,i),d(Fp,this,n);const[s,r,a,o]=c(Cp,this);let[l,h,u,p]=c(Lp,this).subarray(8,12);const g=i-u,f=n-p,m=Math.hypot(g,f);if(m<c(Np,this))return!1;const v=m-c(Op,this),w=v/m,b=w*g,y=w*f;let A=l,_=h;l=u,h=p,u+=b,p+=y,null===(e=c(zp,this))||void 0===e||e.push(i,n);const x=b/v,E=-y/v*c(Wp,this),k=x*c(Wp,this);if(c(Lp,this).set(c(Lp,this).subarray(2,8),0),c(Lp,this).set([u+E,p+k],4),c(Lp,this).set(c(Lp,this).subarray(14,18),12),c(Lp,this).set([u-E,p-k],16),isNaN(c(Lp,this)[6]))return 0===c(Dp,this).length&&(c(Lp,this).set([l+E,h+k],2),c(Dp,this).push(NaN,NaN,NaN,NaN,(l+E-s)/a,(h+k-r)/o),c(Lp,this).set([l-E,h-k],14),c(Tp,this).push(NaN,NaN,NaN,NaN,(l-E-s)/a,(h-k-r)/o)),c(Lp,this).set([A,_,l,h,u,p],6),!this.isEmpty();c(Lp,this).set([A,_,l,h,u,p],6);return Math.abs(Math.atan2(_-h,A-l)-Math.atan2(y,b))<Math.PI/2?([l,h,u,p]=c(Lp,this).subarray(2,6),c(Dp,this).push(NaN,NaN,NaN,NaN,((l+u)/2-s)/a,((h+p)/2-r)/o),[l,h,A,_]=c(Lp,this).subarray(14,18),c(Tp,this).push(NaN,NaN,NaN,NaN,((A+l)/2-s)/a,((_+h)/2-r)/o),!0):([A,_,l,h,u,p]=c(Lp,this).subarray(0,6),c(Dp,this).push(((A+5*l)/6-s)/a,((_+5*h)/6-r)/o,((5*l+u)/6-s)/a,((5*h+p)/6-r)/o,((l+u)/2-s)/a,((h+p)/2-r)/o),[u,p,l,h,A,_]=c(Lp,this).subarray(12,18),c(Tp,this).push(((A+5*l)/6-s)/a,((_+5*h)/6-r)/o,((5*l+u)/6-s)/a,((5*h+p)/6-r)/o,((l+u)/2-s)/a,((h+p)/2-r)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=c(Dp,this),e=c(Tp,this);if(isNaN(c(Lp,this)[6])&&!this.isEmpty())return l(Hp,this,Up).call(this);const i=[];i.push("M".concat(t[4]," ").concat(t[5]));for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push("L".concat(t[n+4]," ").concat(t[n+5])):i.push("C".concat(t[n]," ").concat(t[n+1]," ").concat(t[n+2]," ").concat(t[n+3]," ").concat(t[n+4]," ").concat(t[n+5]));l(Hp,this,qp).call(this,i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push("L".concat(e[n+4]," ").concat(e[n+5])):i.push("C".concat(e[n]," ").concat(e[n+1]," ").concat(e[n+2]," ").concat(e[n+3]," ").concat(e[n+4]," ").concat(e[n+5]));return l(Hp,this,Gp).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,n,s,r){return new ag(t,e,i,n,s,r)}getOutlines(){var t,e;const i=c(Dp,this),n=c(Tp,this),s=c(Lp,this),[r,a,o,h]=c(Cp,this),d=new Float32Array((null!==(t=null===(e=c(zp,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let l=0,g=d.length-2;l<g;l+=2)d[l]=(c(zp,this)[l]-r)/o,d[l+1]=(c(zp,this)[l+1]-a)/h;if(d[d.length-2]=(c(Ip,this)-r)/o,d[d.length-1]=(c(Fp,this)-a)/h,isNaN(s[6])&&!this.isEmpty())return l(Hp,this,Xp).call(this,d);const u=new Float32Array(c(Dp,this).length+24+c(Tp,this).length);let p=i.length;for(let l=0;l<p;l+=2)isNaN(i[l])?u[l]=u[l+1]=NaN:(u[l]=i[l],u[l+1]=i[l+1]);p=l(Hp,this,Kp).call(this,u,p);for(let l=n.length-6;l>=6;l-=6)for(let t=0;t<6;t+=2)isNaN(n[l+t])?(u[p]=u[p+1]=NaN,p+=2):(u[p]=n[l+t],u[p+1]=n[l+t+1],p+=2);return l(Hp,this,Yp).call(this,u,p),this.newFreeDrawOutline(u,d,c(Cp,this),c(Bp,this),c(Pp,this),c(Rp,this))}}function Vp(){const t=c(Lp,this).subarray(4,6),e=c(Lp,this).subarray(16,18),[i,n,s,r]=c(Cp,this);return[(c(Ip,this)+(t[0]-e[0])/2-i)/s,(c(Fp,this)+(t[1]-e[1])/2-n)/r,(c(Ip,this)+(e[0]-t[0])/2-i)/s,(c(Fp,this)+(e[1]-t[1])/2-n)/r]}function Up(){const[t,e,i,n]=c(Cp,this),[s,r,a,o]=l(Hp,this,Vp).call(this);return"M".concat((c(Lp,this)[2]-t)/i," ").concat((c(Lp,this)[3]-e)/n," L").concat((c(Lp,this)[4]-t)/i," ").concat((c(Lp,this)[5]-e)/n," L").concat(s," ").concat(r," L").concat(a," ").concat(o," L").concat((c(Lp,this)[16]-t)/i," ").concat((c(Lp,this)[17]-e)/n," L").concat((c(Lp,this)[14]-t)/i," ").concat((c(Lp,this)[15]-e)/n," Z")}function Gp(t){const e=c(Tp,this);t.push("L".concat(e[4]," ").concat(e[5]," Z"))}function qp(t){const[e,i,n,s]=c(Cp,this),r=c(Lp,this).subarray(4,6),a=c(Lp,this).subarray(16,18),[o,h,d,u]=l(Hp,this,Vp).call(this);t.push("L".concat((r[0]-e)/n," ").concat((r[1]-i)/s," L").concat(o," ").concat(h," L").concat(d," ").concat(u," L").concat((a[0]-e)/n," ").concat((a[1]-i)/s))}function Xp(t){const e=c(Lp,this),[i,n,s,r]=c(Cp,this),[a,o,h,d]=l(Hp,this,Vp).call(this),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/r,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/r,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/r],0),this.newFreeDrawOutline(u,t,c(Cp,this),c(Bp,this),c(Pp,this),c(Rp,this))}function Yp(t,e){const i=c(Tp,this);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}function Kp(t,e){const i=c(Lp,this).subarray(4,6),n=c(Lp,this).subarray(16,18),[s,r,a,o]=c(Cp,this),[h,d,u,p]=l(Hp,this,Vp).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-r)/o,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-r)/o],e),e+24}var Jp={_:8},Qp={_:Jp._+2},Zp=new WeakMap,$p=new WeakMap,tg=new WeakMap,eg=new WeakMap,ig=new WeakMap,ng=new WeakMap,sg=new WeakMap,rg=new WeakSet;class ag extends Sp{constructor(t,e,i,n,s,r){super(),a(this,rg),o(this,Zp,void 0),o(this,$p,new Float32Array(4)),o(this,tg,void 0),o(this,eg,void 0),o(this,ig,void 0),o(this,ng,void 0),o(this,sg,void 0),d(sg,this,t),d(ig,this,e),d(Zp,this,i),d(ng,this,n),d(tg,this,s),d(eg,this,r),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],l(rg,this,og).call(this,r);const[h,u,p,g]=c($p,this);for(let a=0,o=t.length;a<o;a+=2)t[a]=(t[a]-h)/p,t[a+1]=(t[a+1]-u)/g;for(let a=0,o=e.length;a<o;a+=2)e[a]=(e[a]-h)/p,e[a+1]=(e[a+1]-u)/g}toSVGPath(){const t=["M".concat(c(sg,this)[4]," ").concat(c(sg,this)[5])];for(let e=6,i=c(sg,this).length;e<i;e+=6)isNaN(c(sg,this)[e])?t.push("L".concat(c(sg,this)[e+4]," ").concat(c(sg,this)[e+5])):t.push("C".concat(c(sg,this)[e]," ").concat(c(sg,this)[e+1]," ").concat(c(sg,this)[e+2]," ").concat(c(sg,this)[e+3]," ").concat(c(sg,this)[e+4]," ").concat(c(sg,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=s-i,o=r-n;let l,h;switch(e){case 0:l=Sp._rescale(c(sg,this),i,r,a,-o),h=Sp._rescale(c(ig,this),i,r,a,-o);break;case 90:l=Sp._rescaleAndSwap(c(sg,this),i,n,a,o),h=Sp._rescaleAndSwap(c(ig,this),i,n,a,o);break;case 180:l=Sp._rescale(c(sg,this),s,n,-a,o),h=Sp._rescale(c(ig,this),s,n,-a,o);break;case 270:l=Sp._rescaleAndSwap(c(sg,this),s,r,-a,-o),h=Sp._rescaleAndSwap(c(ig,this),s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(h)]}}get box(){return c($p,this)}newOutliner(t,e,i,n,s){return new jp(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}getNewOutline(t,e){const[i,n,s,r]=c($p,this),[a,o,l,h]=c(Zp,this),d=s*l,u=r*h,p=i*l+a,g=n*h+o,f=this.newOutliner({x:c(ig,this)[0]*d+p,y:c(ig,this)[1]*u+g},c(Zp,this),c(ng,this),t,c(eg,this),null!==e&&void 0!==e?e:c(tg,this));for(let m=2;m<c(ig,this).length;m+=2)f.add({x:c(ig,this)[m]*d+p,y:c(ig,this)[m+1]*u+g});return f.getOutlines()}}function og(t){const e=c(sg,this);let i=e[4],n=e[5];const s=[i,n,i,n];let r=i,a=n,o=i,l=n;const h=t?Math.max:Math.min,d=new Float32Array(4);for(let c=6,p=e.length;c<p;c+=6){const t=e[c+4],u=e[c+5];isNaN(e[c])?(Lt.pointBoundingBox(t,u,s),a>u?(r=t,a=u):a===u&&(r=h(r,t)),l<u?(o=t,l=u):l===u&&(o=h(o,t))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,Lt.bezierBoundingBox(i,n,...e.slice(c,c+6),d),Lt.rectBoundingBox(d[0],d[1],d[2],d[3],s),a>d[1]?(r=d[0],a=d[1]):a===d[1]&&(r=h(r,d[0])),l<d[3]?(o=d[2],l=d[3]):l===d[3]&&(o=h(o,d[2]))),i=t,n=u}const u=c($p,this);u[0]=s[0]-c(tg,this),u[1]=s[1]-c(tg,this),u[2]=s[2]-s[0]+2*c(tg,this),u[3]=s[3]-s[1]+2*c(tg,this),this.firstPoint=[r,a],this.lastPoint=[o,l]}var lg=new WeakMap,hg=new WeakMap,cg=new WeakMap,dg=new WeakMap,ug=new WeakMap,pg=new WeakSet;class gg{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];a(this,pg),o(this,lg,void 0),o(this,hg,void 0),o(this,cg,void 0),o(this,dg,[]),o(this,ug,[]);const s=[1/0,1/0,-1/0,-1/0],r=10**-4;for(const{x:a,y:o,width:d,height:w}of t){const t=Math.floor((a-e)/r)*r,i=Math.ceil((a+d+e)/r)*r,n=Math.floor((o-e)/r)*r,l=Math.ceil((o+w+e)/r)*r,h=[t,n,l,!0],u=[i,n,l,!1];c(dg,this).push(h,u),Lt.rectBoundingBox(t,n,i,l,s)}const l=s[2]-s[0]+2*i,h=s[3]-s[1]+2*i,u=s[0]-i,p=s[1]-i;let g=n?-1/0:1/0,f=1/0;const m=c(dg,this).at(n?-1:-2),v=[m[0],m[2]];for(const a of c(dg,this)){const[t,e,i,s]=a;!s&&n?e<f?(f=e,g=t):e===f&&(g=Math.max(g,t)):s&&!n&&(e<f?(f=e,g=t):e===f&&(g=Math.min(g,t))),a[0]=(t-u)/l,a[1]=(e-p)/h,a[2]=(i-p)/h}d(lg,this,new Float32Array([u,p,l,h])),d(hg,this,[g,f]),d(cg,this,v)}getOutlines(){c(dg,this).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of c(dg,this))e[3]?(t.push(...l(pg,this,bg).call(this,e)),l(pg,this,vg).call(this,e)):(l(pg,this,wg).call(this,e),t.push(...l(pg,this,bg).call(this,e)));return l(pg,this,fg).call(this,t)}}function fg(t){const e=[],i=new Set;for(const r of t){const[t,i,n]=r;e.push([t,i,r],[t,n,r])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let r=0,a=e.length;r<a;r+=2){const t=e[r][2],n=e[r+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,r,a,o,l]=t;i.delete(t);let h=e,c=r;for(s=[e,a],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,r,a,o,l]=t,h!==e&&(s.push(h,c,e,c===r?r:a),h=e),c=c===r?a:r}s.push(h,c)}return new _g(n,c(lg,this),c(hg,this),c(cg,this))}function mg(t){const e=c(ug,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}function vg(t){let[,e,i]=t;const n=l(pg,this,mg).call(this,e);c(ug,this).splice(n,0,[e,i])}function wg(t){let[,e,i]=t;const n=l(pg,this,mg).call(this,e);for(let s=n;s<c(ug,this).length;s++){const[t,n]=c(ug,this)[s];if(t!==e)break;if(t===e&&n===i)return void c(ug,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=c(ug,this)[s];if(t!==e)break;if(t===e&&n===i)return void c(ug,this).splice(s,1)}}function bg(t){const[e,i,n]=t,s=[[e,i,n]],r=l(pg,this,mg).call(this,n);for(let a=0;a<r;a++){const[t,i]=c(ug,this)[a];for(let n=0,r=s.length;n<r;n++){const[,a,o]=s[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)s[n][1]=i;else{if(1===r)return[];s.splice(n,1),n--,r--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}var yg=new WeakMap,Ag=new WeakMap;class _g extends Sp{constructor(t,e,i,n){super(),o(this,yg,void 0),o(this,Ag,void 0),d(Ag,this,t),d(yg,this,e),this.firstPoint=i,this.lastPoint=n}toSVGPath(){const t=[];for(const e of c(Ag,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push("V".concat(a)),n=a):a===n&&(t.push("H".concat(r)),i=r)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=s-i,l=r-n;for(const h of c(Ag,this)){const t=new Array(h.length);for(let e=0;e<h.length;e+=2)t[e]=i+h[e]*o,t[e+1]=r-h[e+1]*l;a.push(t)}return a}get box(){return c(yg,this)}get classNamesForOutlining(){return["highlightOutline"]}}class xg extends jp{newFreeDrawOutline(t,e,i,n,s,r){return new Eg(t,e,i,n,s,r)}}class Eg extends ag{newOutliner(t,e,i,n,s){return new xg(t,e,i,n,s,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}}var kg=new WeakMap,Mg=new WeakMap,Sg=new WeakMap,Cg=new WeakMap,Tg=new WeakMap,Pg=new WeakMap,Rg=new WeakMap,Dg=new WeakMap,Lg=new WeakMap,Ig=new WeakMap,Fg=new WeakMap,Ng=new WeakMap,Og=new WeakMap,Bg=new WeakMap,Wg=new WeakMap,zg=new WeakMap,Hg=new WeakMap,jg=new WeakMap,Vg=new WeakSet;class Ug extends Vs{static get _keyboardManager(){const t=Ug.prototype;return At(this,"_keyboardManager",new ei([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super((0,s.A)((0,s.A)({},t),{},{name:"highlightEditor"})),a(this,Vg),o(this,kg,null),o(this,Mg,0),o(this,Sg,void 0),o(this,Cg,null),o(this,Tg,null),o(this,Pg,null),o(this,Rg,null),o(this,Dg,0),o(this,Lg,null),o(this,Ig,null),o(this,Fg,null),o(this,Ng,!1),o(this,Og,null),o(this,Bg,null),o(this,Wg,null),o(this,zg,""),o(this,Hg,void 0),o(this,jg,""),this.color=t.color||Ug._defaultColor,d(Hg,this,t.thickness||Ug._defaultThickness),this.opacity=t.opacity||Ug._defaultOpacity,d(Sg,this,t.boxes||null),d(jg,this,t.methodOfCreation||""),d(zg,this,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(d(Ng,this,!0),l(Vg,this,qg).call(this,t),l(Vg,this,Qg).call(this)):c(Sg,this)&&(d(kg,this,t.anchorNode),d(Mg,this,t.anchorOffset),d(Rg,this,t.focusNode),d(Dg,this,t.focusOffset),l(Vg,this,Gg).call(this),l(Vg,this,Qg).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:c(Ng,this)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:c(Hg,this),methodOfCreation:c(jg,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Vs.initialize(t,e),Ug._defaultColor||(Ug._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case q.HIGHLIGHT_COLOR:Ug._defaultColor=e;break;case q.HIGHLIGHT_THICKNESS:Ug._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return c(Bg,this)}get commentButtonPosition(){return c(Og,this)}updateParams(t,e){switch(t){case q.HIGHLIGHT_COLOR:l(Vg,this,Xg).call(this,e);break;case q.HIGHLIGHT_THICKNESS:l(Vg,this,Yg).call(this,e)}}static get defaultPropertiesToUpdate(){return[[q.HIGHLIGHT_COLOR,Ug._defaultColor],[q.HIGHLIGHT_THICKNESS,Ug._defaultThickness]]}get propertiesToUpdate(){return[[q.HIGHLIGHT_COLOR,this.color||Ug._defaultColor],[q.HIGHLIGHT_THICKNESS,c(Hg,this)||Ug._defaultThickness],[q.HIGHLIGHT_FREE,c(Ng,this)]]}onUpdatedColor(){var t,e;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(c(Fg,this),{root:{fill:this.color,"fill-opacity":this.opacity}}),null===(e=c(Tg,this))||void 0===e||e.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){if(this._uiManager.highlightColors){return[["colorPicker",d(Tg,this,new $c({editor:this}))]]}return super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(l(Vg,this,ef).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,l(Vg,this,ef).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){l(Vg,this,Jg).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(l(Vg,this,Qg).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)l(Vg,this,Jg).call(this);else if(t){var i;l(Vg,this,Qg).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;c(Ng,this)?(t=(t-this.rotation+360)%360,i=Zg.call(Ug,c(Ig,this).box,t)):i=Zg.call(Ug,[this.x,this.y,this.width,this.height],t),e.updateProperties(c(Fg,this),{bbox:i,root:{"data-main-rotation":t}}),e.updateProperties(c(Wg,this),{bbox:Zg.call(Ug,c(Pg,this).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();c(zg,this)&&(t.setAttribute("aria-label",c(zg,this)),t.setAttribute("role","mark")),c(Ng,this)?t.classList.add("free"):this.div.addEventListener("keydown",l(Vg,this,$g).bind(this),{signal:this._uiManager._signal});const e=d(Lg,this,document.createElement("div"));return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=c(Cg,this),this.setDims(this.width,this.height),ze(this,c(Lg,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(c(Wg,this),{rootClass:{hovered:!0}}))}pointerleave(){var t;this.isSelected||(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(c(Wg,this),{rootClass:{hovered:!1}}))}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:l(Vg,this,tf).call(this,!0);break;case 1:case 3:l(Vg,this,tf).call(this,!1)}}select(){var t;super.select(),c(Wg,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(c(Wg,this),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),c(Wg,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(c(Wg,this),{rootClass:{selected:!1}}),c(Ng,this)||l(Vg,this,tf).call(this,!1))}get _mustFixPosition(){return!c(Ng,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(c(Fg,this),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(c(Wg,this),{rootClass:{hidden:!t}}))}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:h,height:c}=n.getBoundingClientRect(),d=new AbortController,u=t.combinedSignal(d),p=e=>{d.abort(),l(Ug,this,af).call(this,t,e)};window.addEventListener("blur",p,{signal:u}),window.addEventListener("pointerup",p,{signal:u}),window.addEventListener("pointerdown",te,{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",$t,{signal:u}),n.addEventListener("pointermove",l(Ug,this,rf).bind(this,t),{signal:u}),this._freeHighlight=new xg({x:s,y:r},[a,o,h,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static async deserialize(t,e,i){let n=null;if(t instanceof qu){const{data:{quadPoints:e,rect:i,rotation:s,id:r,color:a,opacity:o,popupRef:l,richText:h,contentsObj:c,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:G.HIGHLIGHT,color:Array.from(a),opacity:o,quadPoints:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:h,comment:(null===c||void 0===c?void 0:c.str)||null,creationDate:d,modificationDate:u}}else if(t instanceof Uu){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,borderStyle:{rawWidth:o},popupRef:l,richText:h,contentsObj:c,creationDate:d,modificationDate:u},parent:{page:{pageNumber:p}}}=t;n=t={annotationType:G.HIGHLIGHT,color:Array.from(a),thickness:o,inkLists:e,boxes:null,pageIndex:p-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:l,richText:h,comment:(null===c||void 0===c?void 0:c.str)||null,creationDate:d,modificationDate:u}}const{color:s,quadPoints:r,inkLists:a,opacity:o}=t,h=await super.deserialize(t,e,i);h.color=Lt.makeHexColor(...s),h.opacity=o||1,a&&d(Hg,h,t.thickness),h._initialData=n,t.comment&&h.setCommentData(t);const[u,p]=h.pageDimensions,[g,f]=h.pageTranslation;if(r){const t=d(Sg,h,[]);for(let e=0;e<r.length;e+=8)t.push({x:(r[e]-g)/u,y:1-(r[e+1]-f)/p,width:(r[e+2]-r[e])/u,height:(r[e+1]-r[e+5])/p});l(Vg,h,Gg).call(h),l(Vg,h,Qg).call(h),h.rotate(h.rotation)}else if(a){d(Ng,h,!0);const t=a[0],i={x:t[0]-g,y:p-(t[1]-f)},n=new xg(i,[0,0,u,p],1,c(Hg,h)/2,!0,.001);for(let e=0,a=t.length;e<a;e+=2)i.x=t[e]-g,i.y=p-(t[e+1]-f),n.add(i);const{id:s,clipPathId:r}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:n.toSVGPath()}},!0,!0);l(Vg,h,qg).call(h,{highlightOutlines:n.getOutlines(),highlightId:s,clipPathId:r}),l(Vg,h,Qg).call(h),h.rotate(h.parentRotation)}return h}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=Vs._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:e,opacity:this.opacity,thickness:c(Hg,this),quadPoints:l(Vg,this,nf).call(this),outlines:l(Vg,this,sf).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!l(Vg,this,of).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}function Gg(){const t=new gg(c(Sg,this),.001);d(Ig,this,t.getOutlines()),[this.x,this.y,this.width,this.height]=c(Ig,this).box;const e=new gg(c(Sg,this),.0025,.001,"ltr"===this._uiManager.direction);d(Pg,this,e.getOutlines());const{firstPoint:i}=c(Ig,this);d(Og,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);const{lastPoint:n}=c(Pg,this);d(Bg,this,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])}function qg(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;d(Ig,this,e);if(d(Pg,this,e.getNewOutline(c(Hg,this)/2+1.5,.0025)),i>=0)d(Fg,this,i),d(Cg,this,n),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),d(Wg,this,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:c(Pg,this).box,path:{d:c(Pg,this).toSVGPath()}},!0));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(c(Fg,this),{bbox:Zg.call(M,c(Ig,this).box,(t-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(c(Wg,this),{bbox:Zg.call(M,c(Pg,this).box,t),path:{d:c(Pg,this).toSVGPath()}})}const[s,r,a,o]=e.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*e/t,this.height=o*t/e;break}}const{firstPoint:l}=e;d(Og,this,[(l[0]-s)/a,(l[1]-r)/o]);const{lastPoint:h}=c(Pg,this);d(Bg,this,[(h[0]-s)/a,(h[1]-r)/o])}function Xg(t){const e=(t,e)=>{this.color=t,this.opacity=e,this.onUpdatedColor()},i=this.color,n=this.opacity;this.addCommands({cmd:e.bind(this,t,M._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}function Yg(t){const e=c(Hg,this),i=t=>{d(Hg,this,t),l(Vg,this,Kg).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function Kg(t){c(Ng,this)&&(l(Vg,this,qg).call(this,{highlightOutlines:c(Ig,this).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}function Jg(){null!==c(Fg,this)&&this.parent&&(this.parent.drawLayer.remove(c(Fg,this)),d(Fg,this,null),this.parent.drawLayer.remove(c(Wg,this)),d(Wg,this,null))}function Qg(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===c(Fg,this)&&(({id:n(d,[Fg,this])._,clipPathId:n(d,[Cg,this])._}=t.drawLayer.draw({bbox:c(Ig,this).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:c(Ng,this)},path:{d:c(Ig,this).toSVGPath()}},!1,!0)),d(Wg,this,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:c(Ng,this)},bbox:c(Pg,this).box,path:{d:c(Pg,this).toSVGPath()}},c(Ng,this))),c(Lg,this)&&(c(Lg,this).style.clipPath=c(Cg,this)))}function Zg(t,e){let[i,n,s,r]=t;switch(e){case 90:return[1-n-r,i,r,s];case 180:return[1-i-s,1-n-r,s,r];case 270:return[n,1-i-s,r,s]}return[i,n,s,r]}function $g(t){M._keyboardManager.exec(this,t)}function tf(t){if(!c(kg,this))return;const e=window.getSelection();t?e.setPosition(c(kg,this),c(Mg,this)):e.setPosition(c(Rg,this),c(Dg,this))}function ef(){return c(Ng,this)?this.rotation:0}function nf(){if(c(Ng,this))return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=c(Sg,this),r=new Float32Array(8*s.length);let a=0;for(const{x:o,y:l,width:h,height:c}of s){const s=o*t+i,d=(1-l)*e+n;r[a]=r[a+4]=s,r[a+1]=r[a+3]=d,r[a+2]=r[a+6]=s+h*t,r[a+5]=r[a+7]=d-c*e,a+=8}return r}function sf(t){return c(Ig,this).serialize(t,l(Vg,this,ef).call(this))}function rf(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}function af(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}function of(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((t,i)=>t!==e[i])}M=Ug,(0,P.A)(Ug,"_defaultColor",null),(0,P.A)(Ug,"_defaultOpacity",1),(0,P.A)(Ug,"_defaultThickness",12),(0,P.A)(Ug,"_type","highlight"),(0,P.A)(Ug,"_editorType",G.HIGHLIGHT),(0,P.A)(Ug,"_freeHighlightId",-1),(0,P.A)(Ug,"_freeHighlight",null),(0,P.A)(Ug,"_freeHighlightClipId","");var lf=new WeakMap;class hf{constructor(){o(this,lf,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){c(lf,this)[t]=e}toSVGProperties(){const t=c(lf,this);return d(lf,this,Object.create(null)),{root:t}}reset(){d(lf,this,Object.create(null))}updateAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;this.updateProperties(t)}clone(){vt("Not implemented")}}var cf=new WeakMap,df=new WeakMap,uf=new WeakSet;class pf extends Vs{constructor(t){super(t),a(this,uf),o(this,cf,null),o(this,df,void 0),(0,P.A)(this,"_colorPicker",null),(0,P.A)(this,"_drawId",null),d(df,this,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){var t;null===(t=this._colorPicker)||void 0===t||t.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(l(uf,this,gf).call(this,t),l(uf,this,vf).call(this))}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,s]of Object.entries(e))i.has(n)?Object.assign(t[n],s):t[n]=s;return t}static getDefaultDrawingOptions(t){vt("Not implemented")}static get typesMap(){vt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e),this._currentParent&&(_f._.updateProperty(i,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,s=n[e],r=i=>{var s;n.updateProperty(e,i);const r=c(cf,this).updateProperty(e,i);r&&l(uf,this,yf).call(this,r),null===(s=this.parent)||void 0===s||s.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:r.bind(this,i),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,pf._mergeSVGProperties(c(cf,this).getPathResizingSVGProperties(l(uf,this,bf).call(this)),{bbox:l(uf,this,Af).call(this)}))}_onResized(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,pf._mergeSVGProperties(c(cf,this).getPathResizedSVGProperties(l(uf,this,bf).call(this)),{bbox:l(uf,this,Af).call(this)}))}_onTranslating(t,e){var i;null===(i=this.parent)||void 0===i||i.drawLayer.updateProperties(this._drawId,{bbox:l(uf,this,Af).call(this)})}_onTranslated(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,pf._mergeSVGProperties(c(cf,this).getPathTranslatedSVGProperties(l(uf,this,bf).call(this),this.parentDimensions),{bbox:l(uf,this,Af).call(this)}))}_onStartDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;null===(t=this.parent)||void 0===t||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,c(df,this)&&(d(df,this,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){l(uf,this,mf).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(l(uf,this,vf).call(this),l(uf,this,yf).call(this,c(cf,this).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)this._uiManager.removeShouldRescale(this),l(uf,this,mf).call(this);else if(t){var i;this._uiManager.addShouldRescale(this),l(uf,this,vf).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),e&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,pf._mergeSVGProperties({bbox:l(uf,this,Af).call(this)},c(cf,this).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&l(uf,this,yf).call(this,c(cf,this).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const i=super.render();i.classList.add("draw");const n=document.createElement("div");return i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),i}static createDrawerInstance(t,e,i,n,s){vt("Not implemented")}static startDrawing(t,e,i,n){var s,r;const{target:a,offsetX:o,offsetY:l,pointerId:h,pointerType:c}=n;if(Mf._&&Mf._!==c)return;const{viewport:{rotation:d}}=t,{width:u,height:p}=a.getBoundingClientRect(),g=xf._=new AbortController,f=t.combinedSignal(g);kf._||(kf._=h),null!==(s=Mf._)&&void 0!==s||(Mf._=c),window.addEventListener("pointerup",t=>{var e;kf._===t.pointerId?this._endDraw(t):null===(e=Sf._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointercancel",t=>{var e;kf._===t.pointerId?this._currentParent.endDrawingSession():null===(e=Sf._)||void 0===e||e.delete(t.pointerId)},{signal:f}),window.addEventListener("pointerdown",t=>{Mf._===t.pointerType&&((Sf._||(Sf._=new Set)).add(t.pointerId),_f._.isCancellable()&&(_f._.removeLastElement(),_f._.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",$t,{signal:f}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),a.addEventListener("touchmove",t=>{t.timeStamp===Cf._&&te(t)},{signal:f}),t.toggleDrawing(),null===(r=e._editorUndoBar)||void 0===r||r.hide(),_f._?t.drawLayer.updateProperties(this._currentDrawId,_f._.startNew(o,l,u,p,d)):(e.updateUIForDefaultProperties(this),_f._=this.createDrawerInstance(o,l,u,p,d),Ef._=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Ef._.toSVGProperties(),_f._.defaultSVGProperties),!0,!1)))}static _drawMove(t){var e;if(Cf._=-1,!_f._)return;const{offsetX:i,offsetY:n,pointerId:s}=t;kf._===s&&((null===(e=Sf._)||void 0===e?void 0:e.size)>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,_f._.add(i,n)),Cf._=t.timeStamp,te(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,_f._=null,Ef._=null,Mf._=null,Cf._=NaN),xf._&&(xf._.abort(),xf._=null,kf._=NaN,Sf._=null)}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),(null===t||void 0===t?void 0:t.target)===e.div&&e.drawLayer.updateProperties(this._currentDrawId,_f._.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=_f._,i=this._currentDrawId,n=t.getLastElement();return void e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:q.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(q.DRAW_STEP),!_f._.isEmpty()){const{pageDimensions:[i,n],scale:s}=e,r=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:_f._.getOutlines(i*s,n*s,s,this._INNER_MARGIN),drawingOptions:Ef._,mustBeCommitted:!t});return this._cleanup(!0),r}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,s,r){vt("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:s,pageX:r,pageY:a}}=e.viewport,o=this.deserializeDraw(r,a,n,s,this._INNER_MARGIN,t),h=await super.deserialize(t,e,i);return h.createDrawingOptions(t),l(uf,h,gf).call(h,{drawOutlines:o}),l(uf,h,vf).call(h),h.onScaleChanging(),h.rotate(),h}serializeDraw(t){const[e,i]=this.pageTranslation,[n,s]=this.pageDimensions;return c(cf,this).serialize([e,i,n,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}function gf(t){let{drawOutlines:e,drawId:i,drawingOptions:n}=t;d(cf,this,e),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-".concat(this.editorType,"-added-alert")),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=l(uf,this,ff).call(this,e,this.parent),l(uf,this,yf).call(this,e.box)}function ff(t,e){const{id:i}=e.drawLayer.draw(S._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}function mf(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}function vf(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=l(uf,this,ff).call(this,c(cf,this),t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}function wf(t){let[e,i,n,s]=t;const{parentDimensions:[r,a],rotation:o}=this;switch(o){case 90:return[i,1-e,n*(a/r),s*(r/a)];case 180:return[1-e,1-i,n,s];case 270:return[1-i,e,n*(a/r),s*(r/a)];default:return[e,i,n,s]}}function bf(){const{x:t,y:e,width:i,height:n,parentDimensions:[s,r],rotation:a}=this;switch(a){case 90:return[1-e,t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}function yf(t){[this.x,this.y,this.width,this.height]=l(uf,this,wf).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}function Af(){const{x:t,y:e,width:i,height:n,rotation:s,parentRotation:r,parentDimensions:[a,o]}=this;switch((4*s+r)/90){case 1:return[1-e-n,t,n,i];case 2:return[1-t-i,1-e-n,i,n];case 3:return[e,1-t-i,n,i];case 4:return[t,e-i*(a/o),n*(o/a),i*(a/o)];case 5:return[1-e,t,i*(a/o),n*(o/a)];case 6:return[1-t-n*(o/a),1-e,n*(o/a),i*(a/o)];case 7:return[e-i*(a/o),1-t-n*(o/a),i*(a/o),n*(o/a)];case 8:return[t-i,e-n,i,n];case 9:return[1-e,t-i,n,i];case 10:return[1-t,1-e,i,n];case 11:return[e-n,1-t,n,i];case 12:return[t-n*(o/a),e,n*(o/a),i*(a/o)];case 13:return[1-e-i*(a/o),t-n*(o/a),i*(a/o),n*(o/a)];case 14:return[1-t,1-e-i*(a/o),n*(o/a),i*(a/o)];case 15:return[e,1-t,i*(a/o),n*(o/a)];default:return[t,e,i,n]}}S=pf,(0,P.A)(pf,"_currentDrawId",-1),(0,P.A)(pf,"_currentParent",null);var _f={_:null},xf={_:null},Ef={_:null},kf={_:NaN},Mf={_:null},Sf={_:null},Cf={_:NaN};(0,P.A)(pf,"_INNER_MARGIN",3);var Tf=new WeakMap,Pf=new WeakMap,Rf=new WeakMap,Df=new WeakMap,Lf=new WeakMap,If=new WeakMap,Ff=new WeakMap,Nf=new WeakMap,Of=new WeakMap,Bf=new WeakMap,Wf=new WeakMap,zf=new WeakSet;class Hf{constructor(t,e,i,n,s,r){a(this,zf),o(this,Tf,new Float64Array(6)),o(this,Pf,void 0),o(this,Rf,void 0),o(this,Df,void 0),o(this,Lf,void 0),o(this,If,void 0),o(this,Ff,""),o(this,Nf,0),o(this,Of,new $f),o(this,Bf,void 0),o(this,Wf,void 0),d(Bf,this,i),d(Wf,this,n),d(Df,this,s),d(Lf,this,r),[t,e]=l(zf,this,jf).call(this,t,e);const h=d(Pf,this,[NaN,NaN,NaN,NaN,t,e]);d(If,this,[t,e]),d(Rf,this,[{line:h,points:c(If,this)}]),c(Tf,this).set(h,0)}updateProperty(t,e){"stroke-width"===t&&d(Lf,this,e)}isEmpty(){return!c(Rf,this)||0===c(Rf,this).length}isCancellable(){return c(If,this).length<=10}add(t,e){[t,e]=l(zf,this,jf).call(this,t,e);const[i,n,s,r]=c(Tf,this).subarray(2,6),a=t-s,o=e-r;return Math.hypot(c(Bf,this)*a,c(Wf,this)*o)<=2?null:(c(If,this).push(t,e),isNaN(i)?(c(Tf,this).set([s,r,t,e],2),c(Pf,this).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(c(Tf,this)[0])&&c(Pf,this).splice(6,6),c(Tf,this).set([i,n,s,r,t,e],0),c(Pf,this).push(...Sp.createBezierPoints(i,n,s,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(2===c(If,this).length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,n,s){d(Bf,this,i),d(Wf,this,n),d(Df,this,s),[t,e]=l(zf,this,jf).call(this,t,e);const r=d(Pf,this,[NaN,NaN,NaN,NaN,t,e]);d(If,this,[t,e]);const a=c(Rf,this).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),c(Rf,this).push({line:r,points:c(If,this)}),c(Tf,this).set(r,0),d(Nf,this,0),this.toSVGPath(),null}getLastElement(){return c(Rf,this).at(-1)}setLastElement(t){return c(Rf,this)?(c(Rf,this).push(t),d(Pf,this,t.line),d(If,this,t.points),d(Nf,this,0),{path:{d:this.toSVGPath()}}):c(Of,this).setLastElement(t)}removeLastElement(){if(!c(Rf,this))return c(Of,this).removeLastElement();c(Rf,this).pop(),d(Ff,this,"");for(let t=0,e=c(Rf,this).length;t<e;t++){const{line:e,points:i}=c(Rf,this)[t];d(Pf,this,e),d(If,this,i),d(Nf,this,0),this.toSVGPath()}return{path:{d:c(Ff,this)}}}toSVGPath(){const t=Sp.svgRound(c(Pf,this)[4]),e=Sp.svgRound(c(Pf,this)[5]);if(2===c(If,this).length)return d(Ff,this,"".concat(c(Ff,this)," M ").concat(t," ").concat(e," Z")),c(Ff,this);if(c(If,this).length<=6){const i=c(Ff,this).lastIndexOf("M");d(Ff,this,"".concat(c(Ff,this).slice(0,i)," M ").concat(t," ").concat(e)),d(Nf,this,6)}if(4===c(If,this).length){const t=Sp.svgRound(c(Pf,this)[10]),e=Sp.svgRound(c(Pf,this)[11]);return d(Ff,this,"".concat(c(Ff,this)," L ").concat(t," ").concat(e)),d(Nf,this,12),c(Ff,this)}const i=[];0===c(Nf,this)&&(i.push("M ".concat(t," ").concat(e)),d(Nf,this,6));for(let n=c(Nf,this),s=c(Pf,this).length;n<s;n+=6){const[t,e,s,r,a,o]=c(Pf,this).slice(n,n+6).map(Sp.svgRound);i.push("C".concat(t," ").concat(e," ").concat(s," ").concat(r," ").concat(a," ").concat(o))}return d(Ff,this,c(Ff,this)+i.join(" ")),d(Nf,this,c(Pf,this).length),c(Ff,this)}getOutlines(t,e,i,n){const s=c(Rf,this).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),c(Of,this).build(c(Rf,this),t,e,i,c(Df,this),c(Lf,this),n),d(Tf,this,null),d(Pf,this,null),d(Rf,this,null),d(Ff,this,null),c(Of,this)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}function jf(t,e){return Sp._normalizePoint(t,e,c(Bf,this),c(Wf,this),c(Df,this))}var Vf=new WeakMap,Uf=new WeakMap,Gf=new WeakMap,qf=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Jf=new WeakMap,Qf=new WeakMap,Zf=new WeakSet;class $f extends Sp{constructor(){super(...arguments),a(this,Zf),o(this,Vf,void 0),o(this,Uf,0),o(this,Gf,void 0),o(this,qf,void 0),o(this,Xf,void 0),o(this,Yf,void 0),o(this,Kf,void 0),o(this,Jf,void 0),o(this,Qf,void 0)}build(t,e,i,n,s,r,a){d(Xf,this,e),d(Yf,this,i),d(Kf,this,n),d(Jf,this,s),d(Qf,this,r),d(Gf,this,null!==a&&void 0!==a?a:0),d(qf,this,t),l(Zf,this,im).call(this)}get thickness(){return c(Qf,this)}setLastElement(t){return c(qf,this).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return c(qf,this).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of c(qf,this))if(t.push("M".concat(Sp.svgRound(e[4])," ").concat(Sp.svgRound(e[5]))),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push("L".concat(Sp.svgRound(e[10])," ").concat(Sp.svgRound(e[11])));else for(let i=6,n=e.length;i<n;i+=6){const[n,s,r,a,o,l]=e.subarray(i,i+6).map(Sp.svgRound);t.push("C".concat(n," ").concat(s," ").concat(r," ").concat(a," ").concat(o," ").concat(l))}else t.push("Z");return t.join("")}serialize(t,e){let[i,n,s,r]=t;const a=[],o=[],[h,d,u,p]=l(Zf,this,em).call(this);let g,f,m,v,w,b,y,A,_;switch(c(Jf,this)){case 0:_=Sp._rescale,g=i,f=n+r,m=s,v=-r,w=i+h*s,b=n+(1-d-p)*r,y=i+(h+u)*s,A=n+(1-d)*r;break;case 90:_=Sp._rescaleAndSwap,g=i,f=n,m=s,v=r,w=i+d*s,b=n+h*r,y=i+(d+p)*s,A=n+(h+u)*r;break;case 180:_=Sp._rescale,g=i+s,f=n,m=-s,v=r,w=i+(1-h-u)*s,b=n+d*r,y=i+(1-h)*s,A=n+(d+p)*r;break;case 270:_=Sp._rescaleAndSwap,g=i+s,f=n+r,m=-s,v=-r,w=i+(1-d-p)*s,b=n+(1-h-u)*r,y=i+(1-d)*s,A=n+(1-h)*r}for(const{line:l,points:x}of c(qf,this))a.push(_(l,g,f,m,v,e?new Array(l.length):null)),o.push(_(x,g,f,m,v,e?new Array(x.length):null));return{lines:a,points:o,rect:[w,b,y,A]}}static deserialize(t,e,i,n,s,r){let{paths:{lines:a,points:o},rotation:l,thickness:h}=r;const c=[];let d,u,p,g,f;switch(l){case 0:f=Sp._rescale,d=-t/i,u=e/n+1,p=1/i,g=-1/n;break;case 90:f=Sp._rescaleAndSwap,d=-e/n,u=-t/i,p=1/n,g=1/i;break;case 180:f=Sp._rescale,d=t/i+1,u=-e/n,p=-1/i,g=1/n;break;case 270:f=Sp._rescaleAndSwap,d=e/n+1,u=t/i+1,p=-1/n,g=-1/i}if(!a){a=[];for(const t of o){const e=t.length;if(2===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const i=new Float32Array(3*(e-2));a.push(i);let[n,s,r,o]=t.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,s],0);for(let a=4;a<e;a+=2){const e=t[a],l=t[a+1];i.set(Sp.createBezierPoints(n,s,r,o,e,l),3*(a-2)),[n,s,r,o]=[r,o,e,l]}}}for(let v=0,w=a.length;v<w;v++)c.push({line:f(a[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g),points:f(o[v].map(t=>null!==t&&void 0!==t?t:NaN),d,u,p,g)});const m=new this.prototype.constructor;return m.build(c,i,n,1,l,h,s),m}get box(){return c(Vf,this)}updateProperty(t,e){return"stroke-width"===t?l(Zf,this,nm).call(this,e):null}updateParentDimensions(t,e){let[i,n]=t;const[s,r]=l(Zf,this,tm).call(this);d(Xf,this,i),d(Yf,this,n),d(Kf,this,e);const[a,o]=l(Zf,this,tm).call(this),h=a-s,u=o-r,p=c(Vf,this);return p[0]-=h,p[1]-=u,p[2]+=2*h,p[3]+=2*u,p}updateRotation(t){return d(Uf,this,t),{path:{transform:this.rotationTransform}}}get viewBox(){return c(Vf,this).map(Sp.svgRound).join(" ")}get defaultProperties(){const[t,e]=c(Vf,this);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Sp.svgRound(t)," ").concat(Sp.svgRound(e))}}}get rotationTransform(){const[,,t,e]=c(Vf,this);let i=0,n=0,s=0,r=0,a=0,o=0;switch(c(Uf,this)){case 90:n=e/t,s=-t/e,a=t;break;case 180:i=-1,r=-1,a=t,o=e;break;case 270:n=-e/t,s=t/e,o=e;break;default:return""}return"matrix(".concat(i," ").concat(n," ").concat(s," ").concat(r," ").concat(Sp.svgRound(a)," ").concat(Sp.svgRound(o),")")}getPathResizingSVGProperties(t){let[e,i,n,s]=t;const[r,a]=l(Zf,this,tm).call(this),[o,h,d,u]=c(Vf,this);if(Math.abs(d-r)<=Sp.PRECISION||Math.abs(u-a)<=Sp.PRECISION){const t=e+n/2-(o+d/2),r=i+s/2-(h+u/2);return{path:{"transform-origin":"".concat(Sp.svgRound(e)," ").concat(Sp.svgRound(i)),transform:"".concat(this.rotationTransform," translate(").concat(t," ").concat(r,")")}}}const p=(n-2*r)/(d-2*r),g=(s-2*a)/(u-2*a),f=d/n,m=u/s;return{path:{"transform-origin":"".concat(Sp.svgRound(o)," ").concat(Sp.svgRound(h)),transform:"".concat(this.rotationTransform," scale(").concat(f," ").concat(m,") ")+"translate(".concat(Sp.svgRound(r)," ").concat(Sp.svgRound(a),") scale(").concat(p," ").concat(g,") ")+"translate(".concat(Sp.svgRound(-r)," ").concat(Sp.svgRound(-a),")")}}}getPathResizedSVGProperties(t){let[e,i,n,s]=t;const[r,a]=l(Zf,this,tm).call(this),o=c(Vf,this),[h,d,u,p]=o;if(o[0]=e,o[1]=i,o[2]=n,o[3]=s,Math.abs(u-r)<=Sp.PRECISION||Math.abs(p-a)<=Sp.PRECISION){const t=e+n/2-(h+u/2),r=i+s/2-(d+p/2);for(const{line:e,points:i}of c(qf,this))Sp._translate(e,t,r,e),Sp._translate(i,t,r,i);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Sp.svgRound(e)," ").concat(Sp.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}const g=(n-2*r)/(u-2*r),f=(s-2*a)/(p-2*a),m=-g*(h+r)+e+r,v=-f*(d+a)+i+a;if(1!==g||1!==f||0!==m||0!==v)for(const{line:l,points:w}of c(qf,this))Sp._rescale(l,m,v,g,f,l),Sp._rescale(w,m,v,g,f,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":"".concat(Sp.svgRound(e)," ").concat(Sp.svgRound(i)),transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties(t,e){let[i,n]=t;const[s,r]=e,a=c(Vf,this),o=i-a[0],l=n-a[1];if(c(Xf,this)===s&&c(Yf,this)===r)for(const{line:h,points:d}of c(qf,this))Sp._translate(h,o,l,h),Sp._translate(d,o,l,d);else{const t=c(Xf,this)/s,e=c(Yf,this)/r;d(Xf,this,s),d(Yf,this,r);for(const{line:i,points:n}of c(qf,this))Sp._rescale(i,o,l,t,e,i),Sp._rescale(n,o,l,t,e,n);a[2]*=t,a[3]*=e}return a[0]=i,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":"".concat(Sp.svgRound(i)," ").concat(Sp.svgRound(n))}}}get defaultSVGProperties(){const t=c(Vf,this);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":"".concat(Sp.svgRound(t[0])," ").concat(Sp.svgRound(t[1])),transform:this.rotationTransform||null},bbox:t}}}function tm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c(Qf,this);const e=c(Gf,this)+t/2*c(Kf,this);return c(Jf,this)%180===0?[e/c(Xf,this),e/c(Yf,this)]:[e/c(Yf,this),e/c(Xf,this)]}function em(){const[t,e,i,n]=c(Vf,this),[s,r]=l(Zf,this,tm).call(this,0);return[t+s,e+r,i-2*s,n-2*r]}function im(){const t=d(Vf,this,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:n}of c(qf,this)){if(n.length<=12){for(let e=4,i=n.length;e<i;e+=6)Lt.pointBoundingBox(n[e],n[e+1],t);continue}let e=n[4],i=n[5];for(let s=6,r=n.length;s<r;s+=6){const[r,a,o,l,h,c]=n.subarray(s,s+6);Lt.bezierBoundingBox(e,i,r,a,o,l,h,c,t),e=h,i=c}}const[e,i]=l(Zf,this,tm).call(this);t[0]=zt(t[0]-e,0,1),t[1]=zt(t[1]-i,0,1),t[2]=zt(t[2]+e,0,1),t[3]=zt(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]}function nm(t){const[e,i]=l(Zf,this,tm).call(this);d(Qf,this,t);const[n,s]=l(Zf,this,tm).call(this),[r,a]=[n-e,s-i],o=c(Vf,this);return o[0]-=r,o[1]-=a,o[2]+=2*r,o[3]+=2*a,o}class sm extends hf{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Vs._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(null!==e&&void 0!==e||(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new sm(this._viewParameters);return t.updateAll(this),t}}var rm=new WeakSet;class am extends pf{constructor(t){super((0,s.A)((0,s.A)({},t),{},{name:"inkEditor"})),a(this,rm),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){Vs.initialize(t,e),this._defaultDrawingOptions=new sm(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return At(this,"typesMap",new Map([[q.INK_THICKNESS,"stroke-width"],[q.INK_COLOR,"stroke"],[q.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,i,n,s){return new Hf(t,e,i,n,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,i,n,s,r){return $f.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){let n=null;if(t instanceof Uu){const{data:{inkLists:e,rect:i,rotation:s,id:r,color:a,opacity:o,borderStyle:{rawWidth:l},popupRef:h,richText:c,contentsObj:d,creationDate:u,modificationDate:p},parent:{page:{pageNumber:g}}}=t;n=t={annotationType:G.INK,color:Array.from(a),thickness:l,opacity:o,paths:{points:e},boxes:null,pageIndex:g-1,rect:i.slice(0),rotation:s,annotationElementId:r,id:r,deleted:!1,popupRef:h,richText:c,comment:(null===d||void 0===d?void 0:d.str)||null,creationDate:u,modificationDate:p}}const s=await super.deserialize(t,e,i);return s._initialData=n,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new cd(this)),[["colorPicker",this._colorPicker]]}get colorType(){return q.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:i}=this;e.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions(t){let{color:e,thickness:i,opacity:n}=t;this._drawingOptions=am.getDefaultDrawingOptions({stroke:Lt.makeHexColor(...e),"stroke-width":i,"stroke-opacity":n})}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:n,"stroke-opacity":s,"stroke-width":r}}=this,a=Object.assign(super.serialize(t),{color:Vs._colorManager.convert(n),opacity:s,thickness:r,paths:{lines:e,points:i}});return this.addComment(a),t?(a.isCopy=!0,a):this.annotationElementId&&!l(rm,this,om).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}}function om(t){const{color:e,thickness:i,opacity:n,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((t,i)=>t!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==s}(0,P.A)(am,"_type","ink"),(0,P.A)(am,"_editorType",G.INK),(0,P.A)(am,"_defaultDrawingOptions",null);class lm extends $f{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class hm{static extractContoursFromText(t,e,i,n,s,r){let{fontFamily:a,fontStyle:o,fontWeight:h}=e,c=new OffscreenCanvas(1,1),d=c.getContext("2d",{alpha:!1});const u=d.font="".concat(o," ").concat(h," ").concat(200,"px ").concat(a),{actualBoundingBoxLeft:p,actualBoundingBoxRight:g,actualBoundingBoxAscent:f,actualBoundingBoxDescent:m,fontBoundingBoxAscent:v,fontBoundingBoxDescent:w,width:b}=d.measureText(t),y=1.5,A=Math.ceil(Math.max(Math.abs(p)+Math.abs(g)||0,b)*y),_=Math.ceil(Math.max(Math.abs(f)+Math.abs(m)||200,Math.abs(v)+Math.abs(w)||200)*y);c=new OffscreenCanvas(A,_),d=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=u,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,A,_),d.fillStyle="black",d.fillText(t,.5*A/2,1.5*_/2);const x=l(hm,this,wm).call(this,d.getImageData(0,0,A,_).data),E=l(hm,this,vm).call(this,x),k=l(hm,this,bm).call(this,E),M=l(hm,this,pm).call(this,x,A,_,k);return this.processDrawnLines({lines:{curves:M,width:A,height:_},pageWidth:i,pageHeight:n,rotation:s,innerMargin:r,mustSmooth:!0,areContours:!0})}static process(t,e,i,n,s){const[r,a,o]=l(hm,this,ym).call(this,t),[h,c]=l(hm,this,mm).call(this,r,a,o,Math.hypot(a,o)*l(hm,this,Am)._.sigmaSFactor,l(hm,this,Am)._.sigmaR,l(hm,this,Am)._.kernelSize),d=l(hm,this,bm).call(this,c),u=l(hm,this,pm).call(this,h,a,o,d);return this.processDrawnLines({lines:{curves:u,width:a,height:o},pageWidth:e,pageHeight:i,rotation:n,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines(t){var e;let{lines:i,pageWidth:n,pageHeight:s,rotation:r,innerMargin:a,mustSmooth:o,areContours:h}=t;r%180!==0&&([n,s]=[s,n]);const{curves:c,width:d,height:u}=i,p=null!==(e=i.thickness)&&void 0!==e?e:0,g=[],f=Math.min(n/d,s/u),m=f/n,v=f/s,w=[];for(const{points:y}of c){const t=o?l(hm,this,fm).call(this,y):y;if(!t)continue;w.push(t);const e=t.length,i=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(g.push({line:n,points:i}),2===e){i[0]=t[0]*m,i[1]=t[1]*v,n.set([NaN,NaN,NaN,NaN,i[0],i[1]],0);continue}let[s,r,a,h]=t;s*=m,r*=v,a*=m,h*=v,i.set([s,r,a,h],0),n.set([NaN,NaN,NaN,NaN,s,r],0);for(let o=4;o<e;o+=2){const e=i[o]=t[o]*m,l=i[o+1]=t[o+1]*v;n.set(Sp.createBezierPoints(s,r,a,h,e,l),3*(o-2)),[s,r,a,h]=[a,h,e,l]}}if(0===g.length)return null;const b=h?new lm:new $f;return b.build(g,n,s,1,r,h?0:p,a),{outline:b,newCurves:w,areContours:h,thickness:p,width:d,height:u}}static async compressSignature(t){let e,{outlines:i,areContours:n,thickness:s,width:r,height:a}=t,o=1/0,l=-1/0,h=0;for(const w of i){h+=w.length;for(let t=2,e=w.length;t<e;t++){const e=w[t]-w[t-2];o=Math.min(o,e),l=Math.max(l,e)}}e=o>=-128&&l<=127?Int8Array:o>=-32768&&l<=32767?Int16Array:Int32Array;const c=i.length,d=8+3*c,u=new Uint32Array(d);let p=0;u[p++]=d*Uint32Array.BYTES_PER_ELEMENT+(h-2*c)*e.BYTES_PER_ELEMENT,u[p++]=0,u[p++]=r,u[p++]=a,u[p++]=n?0:1,u[p++]=Math.max(0,Math.floor(null!==s&&void 0!==s?s:0)),u[p++]=c,u[p++]=e.BYTES_PER_ELEMENT;for(const w of i)u[p++]=w.length-2,u[p++]=w[0],u[p++]=w[1];const g=new CompressionStream("deflate-raw"),f=g.writable.getWriter();await f.ready,f.write(u);const m=e.prototype.constructor;for(const w of i){const t=new m(w.length-2);for(let e=2,i=w.length;e<i;e++)t[e-2]=w[e]-w[e-2];f.write(t)}f.close();const v=await new Response(g.readable).arrayBuffer();return Ht(new Uint8Array(v))}static async decompressSignature(t){try{const l=(a=t,Uint8Array.fromBase64?Uint8Array.fromBase64(a):Pt(atob(a))),{readable:h,writable:c}=new DecompressionStream("deflate-raw"),d=c.getWriter();await d.ready,d.write(l).then(async()=>{await d.ready,await d.close()}).catch(()=>{});let u=null,p=0;var e,i=!1,n=!1;try{for(var s,r=(0,R.A)(h);i=!(s=await r.next()).done;i=!1){const t=s.value;u||(u=new Uint8Array(new Uint32Array(t.buffer,0,4)[0])),u.set(t,p),p+=t.length}}catch(o){n=!0,e=o}finally{try{i&&null!=r.return&&await r.return()}finally{if(n)throw e}}const g=new Uint32Array(u.buffer,0,u.length>>2),f=g[1];if(0!==f)throw new Error("Invalid version: ".concat(f));const m=g[2],v=g[3],w=0===g[4],b=g[5],y=g[6],A=g[7],_=[],x=(8+3*y)*Uint32Array.BYTES_PER_ELEMENT;let E;switch(A){case Int8Array.BYTES_PER_ELEMENT:E=new Int8Array(u.buffer,x);break;case Int16Array.BYTES_PER_ELEMENT:E=new Int16Array(u.buffer,x);break;case Int32Array.BYTES_PER_ELEMENT:E=new Int32Array(u.buffer,x)}p=0;for(let t=0;t<y;t++){const e=g[3*t+8],i=new Float32Array(e+2);_.push(i);for(let n=0;n<2;n++)i[n]=g[3*t+8+n+1];for(let t=0;t<e;t++)i[t+2]=i[t]+E[p++]}return{areContours:w,thickness:b,outlines:_,width:m,height:v}}catch(l){return mt("decompressSignature: ".concat(l)),null}var a}}function cm(t,e,i,n){return n-=e,0===(i-=t)?n>0?0:4:1===i?n+6:2-n}function dm(t,e,i,n,s,r,a){const o=l(C,this,cm).call(this,i,n,s,r);for(let h=0;h<8;h++){const s=(-h+o-a+16)%8;if(0!==t[(i+l(C,this,_m)._[2*s])*e+(n+l(C,this,_m)._[2*s+1])])return s}return-1}function um(t,e,i,n,s,r,a){const o=l(C,this,cm).call(this,i,n,s,r);for(let h=0;h<8;h++){const s=(h+o+a+16)%8;if(0!==t[(i+l(C,this,_m)._[2*s])*e+(n+l(C,this,_m)._[2*s+1])])return s}return-1}function pm(t,e,i,n){const s=t.length,r=new Int32Array(s);for(let l=0;l<s;l++)r[l]=t[l]<=n?1:0;for(let l=1;l<i-1;l++)r[l*e]=r[l*e+e-1]=0;for(let l=0;l<e;l++)r[l]=r[e*i-1-l]=0;let a,o=1;const h=[];for(let c=1;c<i-1;c++){a=1;for(let t=1;t<e-1;t++){const i=c*e+t,n=r[i];if(0===n)continue;let s=c,d=t;if(1===n&&0===r[i-1])o+=1,d-=1;else{if(!(n>=1&&0===r[i+1])){1!==n&&(a=Math.abs(n));continue}o+=1,d+=1,n>1&&(a=n)}const u=[t,c],p=d===t+1,g={isHole:p,points:u,id:o,parent:0};let f;h.push(g);for(const t of h)if(t.id===a){f=t;break}f?f.isHole?g.parent=p?f.parent:a:g.parent=p?a:f.parent:g.parent=p?a:0;const m=l(C,this,dm).call(this,r,e,c,t,s,d,0);if(-1===m){r[i]=-o,1!==r[i]&&(a=Math.abs(r[i]));continue}let v=l(C,this,_m)._[2*m],w=l(C,this,_m)._[2*m+1];const b=c+v,y=t+w;s=b,d=y;let A=c,_=t;for(;;){const n=l(C,this,um).call(this,r,e,A,_,s,d,1);v=l(C,this,_m)._[2*n],w=l(C,this,_m)._[2*n+1];const h=A+v,p=_+w;u.push(p,h);const g=A*e+_;if(0===r[g+1]?r[g]=-o:1===r[g]&&(r[g]=o),h===c&&p===t&&A===b&&_===y){1!==r[i]&&(a=Math.abs(r[i]));break}s=A,d=_,A=h,_=p}}}return h}function gm(t,e,i,n){if(i-e<=4){for(let s=e;s<i-2;s+=2)n.push(t[s],t[s+1]);return}const s=t[e],r=t[e+1],a=t[i-4]-s,o=t[i-3]-r,h=Math.hypot(a,o),c=a/h,d=o/h,u=c*r-d*s,p=o/a,g=1/h,f=Math.atan(p),m=Math.cos(f),v=Math.sin(f),w=g*(Math.abs(m)+Math.abs(v)),b=g*(1-w+w**2),y=Math.max(Math.atan(Math.abs(v+m)*b),Math.atan(Math.abs(v-m)*b));let A=0,_=e;for(let l=e+2;l<i-2;l+=2){const e=Math.abs(u-c*t[l+1]+d*t[l]);e>A&&(_=l,A=e)}A>(h*y)**2?(l(C,this,gm).call(this,t,e,_+2,n),l(C,this,gm).call(this,t,_,i,n)):n.push(s,r)}function fm(t){const e=[],i=t.length;return l(C,this,gm).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e}function mm(t,e,i,n,s,r){const a=new Float32Array(r**2),o=-2*n**2,l=r>>1;for(let g=0;g<r;g++){const t=(g-l)**2;for(let e=0;e<r;e++)a[g*r+e]=Math.exp((t+(e-l)**2)/o)}const h=new Float32Array(256),c=-2*s**2;for(let g=0;g<256;g++)h[g]=Math.exp(g**2/c);const d=t.length,u=new Uint8Array(d),p=new Uint32Array(256);for(let g=0;g<i;g++)for(let n=0;n<e;n++){const s=g*e+n,o=t[s];let c=0,d=0;for(let u=0;u<r;u++){const s=g+u-l;if(!(s<0||s>=i))for(let i=0;i<r;i++){const p=n+i-l;if(p<0||p>=e)continue;const g=t[s*e+p],f=a[u*r+i]*h[Math.abs(g-o)];c+=g*f,d+=f}}p[u[s]=Math.round(c/d)]++}return[u,p]}function vm(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}function wm(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,s=1/0;for(let a=0,o=i.length;a<o;a++){const e=i[a]=t[a<<2];n=Math.max(n,e),s=Math.min(s,e)}const r=255/(n-s);for(let a=0,o=i.length;a<o;a++)i[a]=(i[a]-s)*r;return i}function bm(t){let e,i=-1/0,n=-1/0;const s=t.findIndex(t=>0!==t);let r=s,a=s;for(e=s;e<256;e++){const s=t[e];s>i&&(e-r>n&&(n=e-r,a=e-1),i=s,r=e)}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}function ym(t){const e=t,{width:i,height:n}=t,{maxDim:s}=l(C,this,Am)._;let r=i,a=n;if(i>s||n>s){let o=i,l=n,h=Math.log2(Math.max(i,n)/s);const c=Math.floor(h);h=h===c?c-1:c;for(let i=0;i<h;i++){r=Math.ceil(o/2),a=Math.ceil(l/2);const i=new OffscreenCanvas(r,a);i.getContext("2d").drawImage(t,0,0,o,l,0,0,r,a),o=r,l=a,t!==e&&t.close(),t=i.transferToImageBitmap()}const d=Math.min(s/r,s/a);r=Math.round(r*d),a=Math.round(a*d)}const o=new OffscreenCanvas(r,a).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,r,a),o.filter="grayscale(1)",o.drawImage(t,0,0,t.width,t.height,0,0,r,a);const h=o.getImageData(0,0,r,a).data;return[l(C,this,wm).call(this,h),r,a]}C=hm;var Am={_:{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}},_m={_:new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])};class xm extends hf{constructor(){super(),super.updateProperties({fill:Vs._defaultLineColor,"stroke-width":0})}clone(){const t=new xm;return t.updateAll(this),t}}class Em extends sm{constructor(t){super(t),super.updateProperties({stroke:Vs._defaultLineColor,"stroke-width":1})}clone(){const t=new Em(this._viewParameters);return t.updateAll(this),t}}var km=new WeakMap,Mm=new WeakMap,Sm=new WeakMap,Cm=new WeakMap;class Tm extends pf{constructor(t){super((0,s.A)((0,s.A)({},t),{},{mustBeCommitted:!0,name:"signatureEditor"})),o(this,km,!1),o(this,Mm,null),o(this,Sm,null),o(this,Cm,null),this._willKeepAspectRatio=!0,d(Sm,this,t.signatureData||null),d(Mm,this,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){Vs.initialize(t,e),this._defaultDrawingOptions=new xm,this._defaultDrawnSignatureOptions=new Em(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return At(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!c(Mm,this)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasDescription");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),null===this._drawId)if(c(Sm,this)){const{lines:t,mustSmooth:e,areContours:i,description:n,uuid:s,heightInPage:r}=c(Sm,this),{rawDims:{pageWidth:a,pageHeight:o},rotation:l}=this.parent.viewport,h=hm.processDrawnLines({lines:t,pageWidth:a,pageHeight:o,rotation:l,innerMargin:Tm._INNER_MARGIN,mustSmooth:e,areContours:i});this.addSignature(h,r,n,s)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:c(Mm,this)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){d(Cm,this,t),this.addEditToolbar()}getUuid(){return c(Cm,this)}get description(){return c(Mm,this)}set description(t){d(Mm,this,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{null===e||void 0===e||e.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:s}=c(Sm,this),r=Math.max(n,s);return{areContours:e,outline:hm.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:s},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:s,y:r}=this,{outline:a}=d(Sm,this,t);let o;d(km,this,a instanceof lm),this.description=i,c(km,this)?o=Tm.getDefaultDrawingOptions():(o=Tm._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let h=e/l;h=h>=1?.5:h,this.width*=h/this.height,this.width>=1&&(h*=.9/this.width,this.width=.9),this.height=h,this.setDims(),this.x=s,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return hm.process(t,e,i,n,Tm._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:s}=this.parent.viewport;return hm.extractContoursFromText(t,e,i,n,s,Tm._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return hm.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:Tm._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions(t){let{areContours:e,thickness:i}=t;e?this._drawingOptions=Tm.getDefaultDrawingOptions():(this._drawingOptions=Tm._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:c(km,this),color:[0,0,0],thickness:c(km,this)?0:n});return this.addComment(s),t?(s.paths={lines:e,points:i},s.uuid=c(Cm,this),s.isCopy=!0):s.lines=e,c(Mm,this)&&(s.accessibilityData={type:"Figure",alt:c(Mm,this)}),s}static deserializeDraw(t,e,i,n,s,r){return r.areContours?lm.deserialize(t,e,i,n,s,r):$f.deserialize(t,e,i,n,s,r)}static async deserialize(t,e,i){var n;const s=await super.deserialize(t,e,i);return d(km,s,t.areContours),s.description=(null===(n=t.accessibilityData)||void 0===n?void 0:n.alt)||"",d(Cm,s,t.uuid),s}}(0,P.A)(Tm,"_type","signature"),(0,P.A)(Tm,"_editorType",G.SIGNATURE),(0,P.A)(Tm,"_defaultDrawingOptions",null);var Pm=new WeakMap,Rm=new WeakMap,Dm=new WeakMap,Lm=new WeakMap,Im=new WeakMap,Fm=new WeakMap,Nm=new WeakMap,Om=new WeakMap,Bm=new WeakMap,Wm=new WeakMap,zm=new WeakMap,Hm=new WeakSet;class jm extends Vs{constructor(t){super((0,s.A)((0,s.A)({},t),{},{name:"stampEditor"})),a(this,Hm),o(this,Pm,null),o(this,Rm,null),o(this,Dm,null),o(this,Lm,null),o(this,Im,null),o(this,Fm,""),o(this,Nm,null),o(this,Om,!1),o(this,Bm,null),o(this,Wm,!1),o(this,zm,!1),d(Lm,this,t.bitmapUrl),d(Im,this,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){Vs.initialize(t,e)}static isHandlingMimeForPasting(t){return le.includes(t)}static paste(t,e){e.pasteEditor({mode:G.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!(null===(t=this.altTextData)||void 0===t||!t.altText)}}static computeTelemetryFinalData(t){var e,i;const n=t.get("hasAltText");return{hasAltText:null!==(e=n.get(!0))&&void 0!==e?e:0,hasNoAltText:null!==(i=n.get(!1))&&void 0!==i?i:0}}async mlGuessAltText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:s,height:r}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:s,height:r,channels:n.length/(s*r)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}remove(){var t;c(Rm,this)&&(d(Pm,this,null),this._uiManager.imageManager.deleteId(c(Rm,this)),null===(t=c(Nm,this))||void 0===t||t.remove(),d(Nm,this,null),c(Bm,this)&&(clearTimeout(c(Bm,this)),d(Bm,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(c(Rm,this)&&null===c(Nm,this)&&l(Hm,this,Gm).call(this),this.isAttachedToDOM||this.parent.add(this))):c(Rm,this)&&l(Hm,this,Gm).call(this)}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(c(Dm,this)||c(Pm,this)||c(Lm,this)||c(Im,this)||c(Rm,this)||c(Om,this))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),c(Om,this)||(c(Pm,this)?l(Hm,this,qm).call(this):l(Hm,this,Gm).call(this)),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(d(Rm,this,i),n&&d(Pm,this,n),d(Om,this,!1),l(Hm,this,qm).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==c(Bm,this)&&clearTimeout(c(Bm,this));d(Bm,this,setTimeout(()=>{d(Bm,this,null),l(Hm,this,Ym).call(this)},200))}copyCanvas(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=224);const{width:n,height:s}=c(Pm,this),r=new oe;let a=c(Pm,this),o=n,h=s,d=null;if(e){if(n>e||s>e){const t=Math.min(e/n,e/s);o=Math.floor(n*t),h=Math.floor(s*t)}d=document.createElement("canvas");const t=d.width=Math.ceil(o*r.sx),i=d.height=Math.ceil(h*r.sy);c(Wm,this)||(a=l(Hm,this,Xm).call(this,t,i));const u=d.getContext("2d");u.filter=this._uiManager.hcmFilter;let p="white",g="#cfcfd8";"none"!==this._uiManager.hcmFilter?g="black":he.isDarkMode&&(p="#8f8f9d",g="#42414d");const f=15,m=f*r.sx,v=f*r.sy,w=new OffscreenCanvas(2*m,2*v),b=w.getContext("2d");b.fillStyle=p,b.fillRect(0,0,2*m,2*v),b.fillStyle=g,b.fillRect(0,0,m,v),b.fillRect(m,v,m,v),u.fillStyle=u.createPattern(w,"repeat"),u.fillRect(0,0,t,i),u.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let u=null;if(i){let e,i;if(r.symmetric&&a.width<t&&a.height<t)e=a.width,i=a.height;else if(a=c(Pm,this),n>t||s>t){const r=Math.min(t/n,t/s);e=Math.floor(n*r),i=Math.floor(s*r),c(Wm,this)||(a=l(Hm,this,Xm).call(this,e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i),u={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:d,width:o,height:h,imageData:u}}static async deserialize(t,e,i){let n=null,s=!1;if(t instanceof Ju){var r;const{data:{rect:a,rotation:o,id:l,structParent:h,popupRef:c,richText:d,contentsObj:u,creationDate:p,modificationDate:g},container:f,parent:{page:{pageNumber:m}},canvas:v}=t;let w,b;v?(delete t.canvas,({id:w,bitmap:b}=i.imageManager.getFromCanvas(f.id,v)),v.remove()):(s=!0,t._hasNoCanvas=!0);const y=(null===(r=await e._structTree.getAriaAttributes("".concat(Wt).concat(l)))||void 0===r?void 0:r.get("aria-label"))||"";n=t={annotationType:G.STAMP,bitmapId:w,bitmap:b,pageIndex:m-1,rect:a.slice(0),rotation:o,annotationElementId:l,id:l,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:h,popupRef:c,richText:d,comment:(null===u||void 0===u?void 0:u.str)||null,creationDate:p,modificationDate:g}}const a=await super.deserialize(t,e,i),{rect:o,bitmap:l,bitmapUrl:h,bitmapId:c,isSvg:u,accessibilityData:p}=t;s?(i.addMissingCanvas(t.id,a),d(Om,a,!0)):c&&i.imageManager.isValidId(c)?(d(Rm,a,c),l&&d(Pm,a,l)):d(Lm,a,h),d(Wm,a,u);const[g,f]=a.pageDimensions;return a.width=(o[2]-o[0])/g,a.height=(o[3]-o[1])/f,p&&(a.altTextData=p),a._initialData=n,t.comment&&a.setCommentData(t),d(zm,a,!!n),a}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:c(Rm,this),isSvg:c(Wm,this)});if(this.addComment(i),t)return i.bitmapUrl=l(Hm,this,Km).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){const t=l(Hm,this,Jm).call(this,i);if(t.isSame)return null;var r;if(t.isSameAltText)delete i.accessibilityData;else i.accessibilityData.structParent=null!==(r=this._initialData.structParent)&&void 0!==r?r:-1;return i.id=this.annotationElementId,delete i.bitmapId,i}if(null===e)return i;e.stamps||(e.stamps=new Map);const a=c(Wm,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(c(Rm,this))){if(c(Wm,this)){const t=e.stamps.get(c(Rm,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=l(Hm,this,Km).call(this,!1))}}else e.stamps.set(c(Rm,this),{area:a,serialized:i}),i.bitmap=l(Hm,this,Km).call(this,!1);return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}function Vm(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(d(Pm,this,t.bitmap),e||(d(Rm,this,t.id),d(Wm,this,t.isSvg)),t.file&&d(Fm,this,t.file.name),l(Hm,this,qm).call(this)):this.remove()}function Um(){if(d(Dm,this,null),this._uiManager.enableWaiting(!1),c(Nm,this))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&c(Pm,this))this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&c(Pm,this)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(t){}}this.div.focus()}}function Gm(){if(c(Rm,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(c(Rm,this)).then(t=>l(Hm,this,Vm).call(this,t,!0)).finally(()=>l(Hm,this,Um).call(this));if(c(Lm,this)){const t=c(Lm,this);return d(Lm,this,null),this._uiManager.enableWaiting(!0),void d(Dm,this,this._uiManager.imageManager.getFromUrl(t).then(t=>l(Hm,this,Vm).call(this,t)).finally(()=>l(Hm,this,Um).call(this)))}if(c(Im,this)){const t=c(Im,this);return d(Im,this,null),this._uiManager.enableWaiting(!0),void d(Dm,this,this._uiManager.imageManager.getFromFile(t).then(t=>l(Hm,this,Vm).call(this,t)).finally(()=>l(Hm,this,Um).call(this)))}const t=document.createElement("input");t.type="file",t.accept=le.join(",");const e=this._uiManager._signal;d(Dm,this,new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),l(Hm,this,Vm).call(this,e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>l(Hm,this,Um).call(this))),t.click()}function qm(){var t;const{div:e}=this;let{width:i,height:n}=c(Pm,this);const[s,r]=this.pageDimensions,a=.75;if(this.width)i=this.width*s,n=this.height*r;else if(i>a*s||n>a*r){const t=Math.min(a*s/i,a*r/n);i*=t,n*=t}this._uiManager.enableWaiting(!1);const o=d(Nm,this,document.createElement("canvas"));o.setAttribute("role","img"),this.addContainer(o),this.width=i/s,this.height=n/r,this.setDims(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),l(Hm,this,Ym).call(this),c(zm,this)||(this.parent.addUndoableEditor(this),d(zm,this,!0)),this._reportTelemetry({action:"inserted_image"}),c(Fm,this)&&this.div.setAttribute("aria-description",c(Fm,this)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}function Xm(t,e){const{width:i,height:n}=c(Pm,this);let s=i,r=n,a=c(Pm,this);for(;s>2*t||r>2*e;){const i=s,n=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const o=new OffscreenCanvas(s,r);o.getContext("2d").drawImage(a,0,0,i,n,0,0,s,r),a=o.transferToImageBitmap()}return a}function Ym(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,s=new oe,r=Math.ceil(i*t*s.sx),a=Math.ceil(n*e*s.sy),o=c(Nm,this);if(!o||o.width===r&&o.height===a)return;o.width=r,o.height=a;const h=c(Wm,this)?c(Pm,this):l(Hm,this,Xm).call(this,r,a),d=o.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(h,0,0,h.width,h.height,0,0,r,a)}function Km(t){if(t){if(c(Wm,this)){const t=this._uiManager.imageManager.getSvgUrl(c(Rm,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=c(Pm,this));return t.getContext("2d").drawImage(c(Pm,this),0,0),t.toDataURL()}if(c(Wm,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Gt.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Gt.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(c(Pm,this),0,0,c(Pm,this).width,c(Pm,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(c(Pm,this))}function Jm(t){var e;const{pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===i,r=((null===(e=t.accessibilityData)||void 0===e?void 0:e.alt)||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&r,isSameAltText:r}}(0,P.A)(jm,"_type","stamp"),(0,P.A)(jm,"_editorType",G.STAMP);var Qm=new WeakMap,Zm=new WeakMap,$m=new WeakMap,tv=new WeakMap,ev=new WeakMap,iv=new WeakMap,nv=new WeakMap,sv=new WeakMap,rv=new WeakMap,av=new WeakMap,ov=new WeakMap,lv=new WeakMap,hv=new WeakMap,cv=new WeakMap,dv=new WeakMap,uv=new WeakMap,pv=new WeakSet;class gv{constructor(t){let{uiManager:e,pageIndex:i,div:n,structTreeLayer:s,accessibilityManager:r,annotationLayer:l,drawLayer:h,textLayer:u,viewport:p,l10n:g}=t;a(this,pv),o(this,Qm,void 0),o(this,Zm,!1),o(this,$m,null),o(this,tv,null),o(this,ev,null),o(this,iv,new Map),o(this,nv,!1),o(this,sv,!1),o(this,rv,!1),o(this,av,null),o(this,ov,null),o(this,lv,null),o(this,hv,null),o(this,cv,null),o(this,dv,-1),o(this,uv,void 0);const f=[...Av._.values()];if(!gv._initialized){gv._initialized=!0;for(const t of f)t.initialize(g,e)}e.registerEditorTypes(f),d(uv,this,e),this.pageIndex=i,this.div=n,d(Qm,this,r),d($m,this,l),this.viewport=p,d(lv,this,u),this.drawLayer=h,this._structTree=s,c(uv,this).addLayer(this)}get isEmpty(){return 0===c(iv,this).size}get isInvisible(){return this.isEmpty&&c(uv,this).getMode()===G.NONE}updateToolbar(t){c(uv,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c(uv,this).getMode();switch(l(pv,this,yv).call(this),t){case G.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case G.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case G.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===G.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of Av._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=c(lv,this))||void 0===e?void 0:e.div)}setEditingState(t){c(uv,this).setEditingState(t)}addCommands(t){c(uv,this).addCommands(t)}cleanUndoStack(t){c(uv,this).cleanUndoStack(t)}toggleDrawing(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("drawing",!t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=c($m,this))||void 0===t||t.div.classList.toggle("disabled",!e)}async enable(){var t;d(rv,this,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),null===(t=c(cv,this))||void 0===t||t.abort(),d(cv,this,null);const e=new Set;for(const n of h(pv,this,fv))n.enableEditing(),n.show(!0),n.annotationElementId&&(c(uv,this).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));const i=c($m,this);if(i)for(const n of i.getEditableAnnotations()){if(n.hide(),c(uv,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}d(rv,this,!1),c(uv,this)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(d(sv,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),c(lv,this)&&!c(cv,this)){d(cv,this,new AbortController);const t=c(uv,this).combinedSignal(c(cv,this));c(lv,this).div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-c(dv,this)>500)return void d(dv,this,n);d(dv,this,-1);const{classList:s}=this.div;s.toggle("getElements",!0);const r=document.elementsFromPoint(e,i);if(s.toggle("getElements",!1),!this.div.contains(r[0]))return;let a;const o=new RegExp("^".concat(U,"[0-9]+$"));for(const h of r)if(o.test(h.id)){a=h.id;break}if(!a)return;const l=c(iv,this).get(a);null===(null===l||void 0===l?void 0:l.annotationElementId)&&(t.stopPropagation(),t.preventDefault(),l.dblclick(t))},{signal:t,capture:!0})}const t=c($m,this);if(t){const i=new Map,n=new Map;for(const r of h(pv,this,fv)){var e;r.disableEditing(),r.annotationElementId?null===r.serialize()?(n.set(r.annotationElementId,r),null===(e=this.getEditableAnnotation(r.annotationElementId))||void 0===e||e.show(),r.remove()):i.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t)}const s=t.getEditableAnnotations();for(const t of s){const{id:e}=t.data;if(c(uv,this).isDeletedAnnotationElement(e)){t.updateEdited({deleted:!0});continue}let s=n.get(e);s?(s.resetAnnotationElement(t),s.show(!1),t.show()):(s=i.get(e),s&&(c(uv,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(t)&&s.show(!1)),t.show())}}l(pv,this,yv).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of Av._.values())i.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),d(sv,this,!1)}getEditableAnnotation(t){var e;return(null===(e=c($m,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){c(uv,this).getActive()!==t&&c(uv,this).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,null!==(t=c(lv,this))&&void 0!==t&&t.div&&!c(hv,this)){d(hv,this,new AbortController);const t=c(uv,this).combinedSignal(c(hv,this));c(lv,this).div.addEventListener("pointerdown",l(pv,this,mv).bind(this),{signal:t}),c(lv,this).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=c(lv,this))&&void 0!==t&&t.div&&c(hv,this)&&(c(hv,this).abort(),d(hv,this,null),c(lv,this).div.classList.remove("highlighting"))}enableClick(){if(c(tv,this))return;d(tv,this,new AbortController);const t=c(uv,this).combinedSignal(c(tv,this));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;null===(t=c(tv,this))||void 0===t||t.abort(),d(tv,this,null)}attach(t){c(iv,this).set(t.id,t);const{annotationElementId:e}=t;e&&c(uv,this).isDeletedAnnotationElement(e)&&c(uv,this).removeDeletedAnnotationElement(t)}detach(t){var e;c(iv,this).delete(t.id),null===(e=c(Qm,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!c(sv,this)&&t.annotationElementId&&c(uv,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),c(uv,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(c(uv,this).addDeletedAnnotationElement(t.annotationElementId),Vs.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),c(uv,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!c(rv,this)),c(uv,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!c(ev,this)&&(t._focusEventsAllowed=!1,d(ev,this,setTimeout(()=>{d(ev,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:c(uv,this)._signal}),i.focus())},0))),t._structTreeParentId=null===(e=c(Qm,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const e of c(iv,this).values())if(e.uid===t)return e;return null}getNextId(){return c(uv,this).getId()}combinedSignal(t){return c(uv,this).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return null===(t=h(pv,this,vv))||void 0===t?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await c(uv,this).updateMode(t.mode);const{offsetX:i,offsetY:n}=l(pv,this,bv).call(this),r=this.getNextId(),a=l(pv,this,wv).call(this,(0,s.A)({parent:this,id:r,x:i,y:n,uiManager:c(uv,this),isCentered:!0},e));a&&this.add(a)}async deserialize(t){var e,i;return await(null===(e=Av._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,c(uv,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),r=l(pv,this,wv).call(this,(0,s.A)({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:c(uv,this),isCentered:e},i));return r&&this.add(r),r}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.createAndAddNewEditor(l(pv,this,bv).call(this),!0,t)}setSelected(t){c(uv,this).setSelected(t)}toggleSelected(t){c(uv,this).toggleSelected(t)}unselect(t){c(uv,this).unselect(t)}pointerup(t){var e;const{isMac:i}=Rt.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(!c(nv,this))return;if(d(nv,this,!1),null!==(e=h(pv,this,vv))&&void 0!==e&&e.isDrawer&&h(pv,this,vv).supportMultipleDrawings)return;if(!c(Zm,this))return void d(Zm,this,!0);const n=c(uv,this).getMode();n!==G.STAMP&&n!==G.SIGNATURE?this.createAndAddNewEditor(t,!1):c(uv,this).unselectAll()}pointerdown(t){var e;if(c(uv,this).getMode()===G.HIGHLIGHT&&this.enableTextSelection(),c(nv,this))return void d(nv,this,!1);const{isMac:i}=Rt.platform;if(0!==t.button||t.ctrlKey&&i)return;if(t.target!==this.div)return;if(d(nv,this,!0),null!==(e=h(pv,this,vv))&&void 0!==e&&e.isDrawer)return void this.startDrawingSession(t);const n=c(uv,this).getActive();d(Zm,this,!n||n.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),c(av,this))return void h(pv,this,vv).startDrawing(this,c(uv,this),!1,t);c(uv,this).setCurrentDrawingSession(this),d(av,this,new AbortController);const e=c(uv,this).combinedSignal(c(av,this));this.div.addEventListener("blur",t=>{let{relatedTarget:e}=t;e&&!this.div.contains(e)&&(d(ov,this,null),this.commitOrRemove())},{signal:e}),h(pv,this,vv).startDrawing(this,c(uv,this),!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&d(ov,this,t))}c(ov,this)&&setTimeout(()=>{var t;null===(t=c(ov,this))||void 0===t||t.focus(),d(ov,this,null)},0)}endDrawingSession(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return c(av,this)?(c(uv,this).setCurrentDrawingSession(null),c(av,this).abort(),d(av,this,null),d(ov,this,null),h(pv,this,vv).endDrawing(t)):null}findNewParent(t,e,i){const n=c(uv,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}commitOrRemove(){return!!c(av,this)&&(this.endDrawingSession(),!0)}onScaleChanging(){c(av,this)&&h(pv,this,vv).onScaleChangingWhenDrawing(this)}destroy(){var t;this.commitOrRemove(),(null===(t=c(uv,this).getActive())||void 0===t?void 0:t.parent)===this&&(c(uv,this).commitOrRemove(),c(uv,this).setActiveEditor(null)),c(ev,this)&&(clearTimeout(c(ev,this)),d(ev,this,null));for(const i of c(iv,this).values()){var e;null===(e=c(Qm,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,c(iv,this).clear(),c(uv,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,ae(this.div,e);for(const i of c(uv,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;c(uv,this).commitOrRemove(),l(pv,this,yv).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,ae(this.div,{rotation:n}),i!==n)for(const s of c(iv,this).values())s.rotate(n)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return c(uv,this).viewParameters.realScale}}function fv(t){return 0!==c(iv,t).size?c(iv,t).values():c(uv,t).getEditors(t.pageIndex)}function mv(t){c(uv,this).unselectAll();const{target:e}=t;if(e===c(lv,this).div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&c(lv,this).div.contains(e)){const{isMac:e}=Rt.platform;if(0!==t.button||t.ctrlKey&&e)return;c(uv,this).showAllEditors("highlight",!0,!0),c(lv,this).div.classList.add("free"),this.toggleDrawing(),Ug.startHighlighting(this,"ltr"===c(uv,this).direction,{target:c(lv,this).div,x:t.x,y:t.y}),c(lv,this).div.addEventListener("pointerup",()=>{c(lv,this).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:c(uv,this)._signal}),t.preventDefault()}}function vv(t){return Av._.get(c(uv,t).getMode())}function wv(t){const e=h(pv,this,vv);return e?new e.prototype.constructor(t):null}function bv(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,s=Math.max(0,t),r=Math.max(0,e),a=(s+Math.min(window.innerWidth,t+i))/2-t,o=(r+Math.min(window.innerHeight,e+n))/2-e,[l,h]=this.viewport.rotation%180===0?[a,o]:[o,a];return{offsetX:l,offsetY:h}}function yv(){for(const t of c(iv,this).values())t.isEmpty()&&t.remove()}(0,P.A)(gv,"_initialized",!1);var Av={_:new Map([vp,am,jm,Ug,Tm].map(t=>[t._editorType,t]))},_v=new WeakMap,xv=new WeakMap,Ev=new WeakMap,kv=new WeakSet;class Mv{constructor(t){let{pageIndex:e}=t;a(this,kv),o(this,_v,null),o(this,xv,new Map),o(this,Ev,new Map),this.pageIndex=e}setParent(t){if(c(_v,this)){if(c(_v,this)!==t){if(c(xv,this).size>0)for(const e of c(xv,this).values())e.remove(),t.append(e);d(_v,this,t)}}else d(_v,this,t)}static get _svgFactory(){return At(this,"_svgFactory",new md)}draw(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(Rv._=(e=Rv._,i=e++,e),i),a=l(kv,this,Cv).call(this),o=Mv._svgFactory.createElement("defs");a.append(o);const h=Mv._svgFactory.createElement("path");o.append(h);const d="path_p".concat(this.pageIndex,"_").concat(r);h.setAttribute("id",d),h.setAttribute("vector-effect","non-scaling-stroke"),n&&c(Ev,this).set(r,h);const u=s?l(kv,this,Tv).call(this,o,d):null,p=Mv._svgFactory.createElement("use");return a.append(p),p.setAttribute("href","#".concat(d)),this.updateProperties(a,t),c(xv,this).set(r,a),{id:r,clipPathId:"url(#".concat(u,")")}}drawOutline(t,e){var i,n;const s=(Rv._=(i=Rv._,n=i++,i),n),r=l(kv,this,Cv).call(this),a=Mv._svgFactory.createElement("defs");r.append(a);const o=Mv._svgFactory.createElement("path");a.append(o);const h="path_p".concat(this.pageIndex,"_").concat(s);let d;if(o.setAttribute("id",h),o.setAttribute("vector-effect","non-scaling-stroke"),e){const t=Mv._svgFactory.createElement("mask");a.append(t),d="mask_p".concat(this.pageIndex,"_").concat(s),t.setAttribute("id",d),t.setAttribute("maskUnits","objectBoundingBox");const e=Mv._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=Mv._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(h)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const u=Mv._svgFactory.createElement("use");r.append(u),u.setAttribute("href","#".concat(h)),d&&u.setAttribute("mask","url(#".concat(d,")"));const p=u.cloneNode();return r.append(p),u.classList.add("mainOutline"),p.classList.add("secondaryOutline"),this.updateProperties(r,t),c(xv,this).set(s,r),s}finalizeDraw(t,e){c(Ev,this).delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:n,rootClass:s,path:r}=e,a="number"===typeof t?c(xv,this).get(t):t;if(a){if(i&&l(kv,this,Pv).call(this,a,i),n&&Sv.call(Mv,a,n),s){const{classList:t}=a;for(const[e,i]of Object.entries(s))t.toggle(e,i)}if(r){const t=a.firstChild.firstChild;l(kv,this,Pv).call(this,t,r)}}}updateParent(t,e){if(e===this)return;const i=c(xv,this).get(t);i&&(c(_v,e).append(i),c(xv,this).delete(t),c(xv,e).set(t,i))}remove(t){c(Ev,this).delete(t),null!==c(_v,this)&&(c(xv,this).get(t).remove(),c(xv,this).delete(t))}destroy(){d(_v,this,null);for(const t of c(xv,this).values())t.remove();c(xv,this).clear(),c(Ev,this).clear()}}function Sv(t,e){let[i,n,s,r]=e;const{style:a}=t;a.top="".concat(100*n,"%"),a.left="".concat(100*i,"%"),a.width="".concat(100*s,"%"),a.height="".concat(100*r,"%")}function Cv(){const t=T._svgFactory.create(1,1,!0);return c(_v,this).append(t),t.setAttribute("aria-hidden",!0),t}function Tv(t,e){const i=T._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=T._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}function Pv(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}T=Mv;var Rv={_:0};globalThis._pdfjsTestingUtils={HighlightOutliner:gg},globalThis.pdfjsLib={AbortException:Ct,AnnotationEditorLayer:gv,AnnotationEditorParamsType:q,AnnotationEditorType:G,AnnotationEditorUIManager:tn,AnnotationLayer:lp,AnnotationMode:V,AnnotationType:tt,applyOpacity:function(t,e,i,n){const s=255*(1-(n=Math.min(Math.max(null!==n&&void 0!==n?n:1,0),1)));return[t=Math.round(t*n+s),e=Math.round(e*n+s),i=Math.round(i*n+s)]},build:"f56dc8601",ColorPicker:$c,createValidAbsoluteUrl:bt,CSSConstants:class{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:i}=window.getComputedStyle(t);return t.remove(),At(this,"commentForegroundColor",ne(i))}},DOMSVGFactory:md,DrawLayer:Mv,FeatureTest:Rt,fetchData:qt,findContrastColor:function(t,e){const i=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let n=ge.get(i);if(n)return n;const s=new Float32Array(9),r=s.subarray(0,3),a=s.subarray(3,6);ce(t,a);const o=s.subarray(6,9);ce(e,o);const l=o[2]<.5,h=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),pe(a,o,r)<h){let t,e;l?(t=a[2],e=1):(t=0,e=a[2]);const i=.005;for(;e-t>i;){const i=a[2]=(t+e)/2;l===pe(a,o,r)<h?t=i:e=i}a[2]=l?e:t}return de(a,r),n=Lt.makeHexColor(Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])),ge.set(i,n),n},getDocument:ec,getFilenameFromUrl:function(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)},getPdfFilenameFromUrl:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Kt(t))return mt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(t=>{try{return new URL(t)}catch(e){try{return new URL(decodeURIComponent(t))}catch(i){try{return new URL(t,"https://foo.bar")}catch(n){try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch(s){return null}}}}})(t);if(!i)return e;const n=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch(e){return t}},s=/\.pdf$/i,r=i.pathname.split("/").at(-1);if(s.test(r))return n(r);if(i.searchParams.size>0){const t=Array.from(i.searchParams.values()).reverse();for(const i of t)if(s.test(i))return n(i);const e=Array.from(i.searchParams.keys()).reverse();for(const i of e)if(s.test(i))return n(i)}if(i.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(t)return n(t[0])}return e},getRGB:ne,getUuid:Bt,getXfaPageViewport:function(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new Xt({viewBox:a,userUnit:1,scale:i,rotation:n})},GlobalWorkerOptions:Rl,ImageKind:$,InvalidPDFException:kt,isDataScheme:Kt,isPdfFile:Jt,isValidExplicitDest:Pr,MathClamp:zt,noContextMenu:$t,normalizeUnicode:function(t){return Nt||(Nt=/([\xA0\xB5\u037E\u0EB3\u2000-\u200A\u202F\u2126\uFB00-\uFB04\uFB06\uFB20-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBA1\uFBA4-\uFBA9\uFBAE-\uFBB1\uFBD3-\uFBDC\uFBDE-\uFBE7\uFBEA-\uFBF8\uFBFC\uFBFD\uFC00-\uFC5D\uFC64-\uFCF1\uFCF5-\uFD3D\uFD88\uFDF4\uFDFA\uFDFB\uFE71\uFE77\uFE79\uFE7B\uFE7D]+)|(\uFB05+)/g,Ot=new Map([["\ufb05","\u017ft"]])),t.replaceAll(Nt,(t,e,i)=>e?e.normalize("NFKC"):Ot.get(i))},OPS:ot,OutputScale:oe,PasswordResponses:{NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PDFDataRangeTransport:hc,PDFDateString:ee,PDFWorker:yc,PermissionFlag:{PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},PixelsPerInch:Gt,RenderingCancelledException:Yt,renderRichText:fe,ResponseException:Mt,setLayerDimensions:ae,shadow:At,SignatureExtractor:hm,stopEvent:te,SupportedImageMimeTypes:le,TextLayer:jh,TouchManager:us,updateUrlHash:yt,Util:Lt,VerbosityLevel:at,version:"5.4.296",XfaLayer:Vt}},53986:(t,e,i)=>{"use strict";function n(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},54159:(t,e)=>{var i;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t="",e=0;e<arguments.length;e++){var i=arguments[e];i&&(t=a(t,r(i)))}return t}function r(t){if("string"===typeof t||"number"===typeof t)return t;if("object"!==typeof t)return"";if(Array.isArray(t))return s.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var i in t)n.call(t,i)&&t[i]&&(e=a(e,i));return e}function a(t,e){return e?t?t+" "+e:t+e:t}t.exports?(s.default=s,t.exports=s):void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i)}()},56859:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},57325:(t,e,i)=>{var n=i(20907),s=0;t.exports=function(t){var e=++s;return n(t)+e}},58882:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},60591:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(89261);function s(t){let{children:e,type:i}=t;return(0,n.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}},63185:(t,e,i)=>{"use strict";i.d(e,{Bd:()=>r,UT:()=>v,ci:()=>o,h1:()=>w,jA:()=>d,mZ:()=>u,mw:()=>l,qC:()=>g,qf:()=>h,vS:()=>m,xL:()=>f,zL:()=>c});var n=i(64288),s=i(98677);const r="undefined"!==typeof window,a=r&&"file:"===window.location.protocol;function o(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function l(t){return t instanceof ArrayBuffer}function h(t){return(0,n.A)(r,"isBlob can only be used in a browser environment"),t instanceof Blob}function c(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function d(t){(0,n.A)(c(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function u(){return r&&window.devicePixelRatio||1}const p="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function g(){s(!a,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(p))}function f(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function m(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function v(t){return"RenderingCancelledException"===t.name}function w(t){return new Promise((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)})}},64288:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=!0,s="Invariant failed";function r(t,e){if(!t){if(n)throw new Error(s);var i="function"===typeof e?e():e,r=i?"".concat(s,": ").concat(i):s;throw new Error(r)}}},64467:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(20816);function s(t,e,i){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},64579:(t,e,i)=>{var n=i(78913),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},68102:(t,e,i)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},n.apply(null,arguments)}i.d(e,{A:()=>n})},70011:()=>{},74935:(t,e,i)=>{"use strict";var n=i(94922),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function h(t,e,i){var n,r={},h=null,c=null;for(n in void 0!==i&&(h=""+i),void 0!==e.key&&(h=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,n)&&!l.hasOwnProperty(n)&&(r[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===r[n]&&(r[n]=e[n]);return{$$typeof:s,type:t,key:h,ref:c,props:r,_owner:o.current}}e.Fragment=r,e.jsx=h,e.jsxs=h},78678:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(94922);const s=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,n.useRef)(t);return e||(i.current=t),(0,n.useCallback)(function(){return i.current&&i.current(...arguments)},[])}},78805:(t,e,i)=>{"use strict";function n(t){let e=!1;return{promise:new Promise((i,n)=>{t.then(t=>!e&&i(t)).catch(t=>!e&&n(t))}),cancel(){e=!0}}}i.d(e,{A:()=>n})},78913:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},79111:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var a=i(80036);const o=s.forwardRef(function(t,e){return s.createElement(a.A,(0,n.A)({},t,{ref:e,icon:r}))})},79461:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=t=>{const e=[];let i=0;const n=()=>{if(0!==e.length){if(i<t){const t=e.shift();i+=1,t().finally(()=>{i-=1,n()})}}else i=0};return t=>new Promise(i=>{e.push(()=>{const e=Promise.resolve().then(()=>t());return i(e),e}),n()})}},80036:(t,e,i)=>{"use strict";i.d(e,{A:()=>St});var n=i(68102),s=i(3141);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}function o(t,e,i){return(e=a(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n<r.length;n++)i=r[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}var h=i(94922),c=i.n(h),d=i(54159),u=i.n(d);const p=Math.round;function g(t,e){const i=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=i.map(t=>parseFloat(t));for(let s=0;s<3;s+=1)n[s]=e(n[s]||0,i[s]||"",s);return i[3]?n[3]=i[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const f=(t,e,i)=>0===i?t:t/100;function m(t,e){const i=e||255;return t>i?i:t<0?0:t}class v{constructor(t){function e(e){return e[0]in t&&e[1]in t&&e[2]in t}if(o(this,"isValid",!0),o(this,"r",0),o(this,"g",0),o(this,"b",0),o(this,"a",1),o(this,"_h",void 0),o(this,"_s",void 0),o(this,"_l",void 0),o(this,"_v",void 0),o(this,"_max",void 0),o(this,"_min",void 0),o(this,"_brightness",void 0),t)if("string"===typeof t){const i=t.trim();function n(t){return i.startsWith(t)}/^#?[A-F\d]{3,8}$/i.test(i)?this.fromHexString(i):n("rgb")?this.fromRgbString(i):n("hsl")?this.fromHslString(i):(n("hsv")||n("hsb"))&&this.fromHsvString(i)}else if(t instanceof v)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(e("rgb"))this.r=m(t.r),this.g=m(t.g),this.b=m(t.b),this.a="number"===typeof t.a?m(t.a,1):1;else if(e("hsl"))this.fromHsl(t);else{if(!e("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t));this.fromHsv(t)}else;}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const e=this.toHsv();return e.h=t,this._c(e)}getLuminance(){function t(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}return.2126*t(this.r)+.7152*t(this.g)+.0722*t(this.b)}getHue(){if("undefined"===typeof this._h){const t=this.getMax()-this.getMin();this._h=0===t?0:p(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if("undefined"===typeof this._s){const t=this.getMax()-this.getMin();this._s=0===t?0:t/this.getMax()}return this._s}getLightness(){return"undefined"===typeof this._l&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return"undefined"===typeof this._v&&(this._v=this.getMax()/255),this._v}getBrightness(){return"undefined"===typeof this._brightness&&(this._brightness=(299*this.r+587*this.g+114*this.b)/1e3),this._brightness}darken(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.getHue(),i=this.getSaturation();let n=this.getLightness()-t/100;return n<0&&(n=0),this._c({h:e,s:i,l:n,a:this.a})}lighten(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.getHue(),i=this.getSaturation();let n=this.getLightness()+t/100;return n>1&&(n=1),this._c({h:e,s:i,l:n,a:this.a})}mix(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const i=this._c(t),n=e/100,s=t=>(i[t]-this[t])*n+this[t],r={r:p(s("r")),g:p(s("g")),b:p(s("b")),a:p(100*s("a"))/100};return this._c(r)}tint(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:255,g:255,b:255,a:1},t)}shade(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const e=this._c(t),i=this.a+e.a*(1-this.a),n=t=>p((this[t]*this.a+e[t]*e.a*(1-this.a))/i);return this._c({r:n("r"),g:n("g"),b:n("b"),a:i})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const e=(this.r||0).toString(16);t+=2===e.length?e:"0"+e;const i=(this.g||0).toString(16);t+=2===i.length?i:"0"+i;const n=(this.b||0).toString(16);if(t+=2===n.length?n:"0"+n,"number"===typeof this.a&&this.a>=0&&this.a<1){const e=p(255*this.a).toString(16);t+=2===e.length?e:"0"+e}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),e=p(100*this.getSaturation()),i=p(100*this.getLightness());return 1!==this.a?"hsla(".concat(t,",").concat(e,"%,").concat(i,"%,").concat(this.a,")"):"hsl(".concat(t,",").concat(e,"%,").concat(i,"%)")}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}toString(){return this.toRgbString()}_sc(t,e,i){const n=this.clone();return n[t]=m(e,i),n}_c(t){return new this.constructor(t)}getMax(){return"undefined"===typeof this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return"undefined"===typeof this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const e=t.replace("#","");function i(t,i){return parseInt(e[t]+e[i||t],16)}e.length<6?(this.r=i(0),this.g=i(1),this.b=i(2),this.a=e[3]?i(3)/255:1):(this.r=i(0,1),this.g=i(2,3),this.b=i(4,5),this.a=e[6]?i(6,7)/255:1)}fromHsl(t){let{h:e,s:i,l:n,a:s}=t;if(this._h=e%360,this._s=i,this._l=n,this.a="number"===typeof s?s:1,i<=0){const t=p(255*n);this.r=t,this.g=t,this.b=t}let r=0,a=0,o=0;const l=e/60,h=(1-Math.abs(2*n-1))*i,c=h*(1-Math.abs(l%2-1));l>=0&&l<1?(r=h,a=c):l>=1&&l<2?(r=c,a=h):l>=2&&l<3?(a=h,o=c):l>=3&&l<4?(a=c,o=h):l>=4&&l<5?(r=c,o=h):l>=5&&l<6&&(r=h,o=c);const d=n-h/2;this.r=p(255*(r+d)),this.g=p(255*(a+d)),this.b=p(255*(o+d))}fromHsv(t){let{h:e,s:i,v:n,a:s}=t;this._h=e%360,this._s=i,this._v=n,this.a="number"===typeof s?s:1;const r=p(255*n);if(this.r=r,this.g=r,this.b=r,i<=0)return;const a=e/60,o=Math.floor(a),l=a-o,h=p(n*(1-i)*255),c=p(n*(1-i*l)*255),d=p(n*(1-i*(1-l))*255);switch(o){case 0:this.g=d,this.b=h;break;case 1:this.r=c,this.b=h;break;case 2:this.r=h,this.b=d;break;case 3:this.r=h,this.g=c;break;case 4:this.r=d,this.g=h;break;default:this.g=h,this.b=c}}fromHsvString(t){const e=g(t,f);this.fromHsv({h:e[0],s:e[1],v:e[2],a:e[3]})}fromHslString(t){const e=g(t,f);this.fromHsl({h:e[0],s:e[1],l:e[2],a:e[3]})}fromRgbString(t){const e=g(t,(t,e)=>e.includes("%")?p(t/100*255):t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}}var w=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function b(t,e,i){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?i?Math.round(t.h)-2*e:Math.round(t.h)+2*e:i?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?n+=360:n>=360&&(n-=360),n}function y(t,e,i){return 0===t.h&&0===t.s?t.s:((n=i?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(n=1),i&&5===e&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(100*n)/100);var n}function A(t,e,i){var n;return n=i?t.v+.05*e:t.v-.15*e,n=Math.max(0,Math.min(1,n)),Math.round(100*n)/100}var _=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];_.primary=_[5];var x=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];x.primary=x[5];var E=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];E.primary=E[5];var k=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];k.primary=k[5];var M=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];M.primary=M[5];var S=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];S.primary=S[5];var C=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];C.primary=C[5];var T=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];T.primary=T[5];var P=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];P.primary=P[5];var R=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];R.primary=R[5];var D=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];D.primary=D[5];var L=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];L.primary=L[5];var I=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];I.primary=I[5];var F=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];F.primary=F[5];var N=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];N.primary=N[5];var O=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];O.primary=O[5];var B=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];B.primary=B[5];var W=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];W.primary=W[5];var z=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];z.primary=z[5];var H=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];H.primary=H[5];var j=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];j.primary=j[5];var V=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];V.primary=V[5];var U=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];U.primary=U[5];var G=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];G.primary=G[5];var q=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];q.primary=q[5];var X=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];X.primary=X[5];const Y=(0,h.createContext)({});function K(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function J(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?K(Object(i),!0).forEach(function(e){o(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var Q="data-rc-order",Z="data-rc-priority",$=new Map;function tt(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function et(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function it(t){return Array.from(($.get(t)||t).children).filter(function(t){return"STYLE"===t.tagName})}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"===typeof window||!window.document||!window.document.createElement)return null;var i=e.csp,n=e.prepend,s=e.priority,r=void 0===s?0:s,a=function(t){return"queue"===t?"prependQueue":t?"prepend":"append"}(n),o="prependQueue"===a,l=document.createElement("style");l.setAttribute(Q,a),o&&r&&l.setAttribute(Z,"".concat(r)),null!==i&&void 0!==i&&i.nonce&&(l.nonce=null===i||void 0===i?void 0:i.nonce),l.innerHTML=t;var h=et(e),c=h.firstChild;if(n){if(o){var d=(e.styles||it(h)).filter(function(t){if(!["prepend","prependQueue"].includes(t.getAttribute(Q)))return!1;var e=Number(t.getAttribute(Z)||0);return r>=e});if(d.length)return h.insertBefore(l,d[d.length-1].nextSibling),l}h.insertBefore(l,c)}else h.appendChild(l);return l}function st(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=et(e);return(e.styles||it(i)).find(function(i){return i.getAttribute(tt(e))===t})}function rt(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=et(i),s=it(n),r=J(J({},i),{},{styles:s});!function(t,e){var i=$.get(t);if(!i||!function(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1}(document,i)){var n=nt("",e),s=n.parentNode;$.set(t,s),t.removeChild(n)}}(n,r);var a=st(e,r);if(a){var o,l,h;if(null!==(o=r.csp)&&void 0!==o&&o.nonce&&a.nonce!==(null===(l=r.csp)||void 0===l?void 0:l.nonce))a.nonce=null===(h=r.csp)||void 0===h?void 0:h.nonce;return a.innerHTML!==t&&(a.innerHTML=t),a}var c=nt(t,r);return c.setAttribute(tt(r),e),c}function at(t){var e;return null===t||void 0===t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function ot(t){return function(t){return at(t)instanceof ShadowRoot}(t)?at(t):null}var lt={},ht=[];function ct(t,e){}function dt(t,e){}function ut(t,e,i){e||lt[i]||(t(!1,i),lt[i]=!0)}function pt(t,e){ut(ct,t,e)}pt.preMessage=function(t){ht.push(t)},pt.resetWarned=function(){lt={}},pt.noteOnce=function(t,e){ut(dt,t,e)};const gt=pt;function ft(t){return"object"===r(t)&&"string"===typeof t.name&&"string"===typeof t.theme&&("object"===r(t.icon)||"function"===typeof t.icon)}function mt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).reduce(function(e,i){var n,s=t[i];if("class"===i)e.className=s,delete e.class;else delete e[i],e[(n=i,n.replace(/-(.)/g,function(t,e){return e.toUpperCase()}))]=s;return e},{})}function vt(t,e,i){return i?c().createElement(t.tag,J(J({key:e},mt(t.attrs)),i),(t.children||[]).map(function(i,n){return vt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})):c().createElement(t.tag,J({key:e},mt(t.attrs)),(t.children||[]).map(function(i,n){return vt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))}))}function wt(t){return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],n=new v(t),s=n.toHsv(),r=5;r>0;r-=1){var a=new v({h:b(s,r,!0),s:y(s,r,!0),v:A(s,r,!0)});i.push(a)}i.push(n);for(var o=1;o<=4;o+=1){var l=new v({h:b(s,o),s:y(s,o),v:A(s,o)});i.push(l)}return"dark"===e.theme?w.map(function(t){var n=t.index,s=t.amount;return new v(e.backgroundColor||"#141414").mix(i[n],s).toHexString()}):i.map(function(t){return t.toHexString()})}(t)[0]}function bt(t){return t?Array.isArray(t)?t:[t]:[]}var yt=["icon","className","onClick","style","primaryColor","secondaryColor"],At={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var _t=function(t){var e,i,n=t.icon,s=t.className,r=t.onClick,a=t.style,o=t.primaryColor,c=t.secondaryColor,d=l(t,yt),u=h.useRef(),p=At;if(o&&(p={primaryColor:o,secondaryColor:c||wt(o)}),function(t){var e=(0,h.useContext)(Y),i=e.csp,n=e.prefixCls,s=e.layer,r="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";n&&(r=r.replace(/anticon/g,n)),s&&(r="@layer ".concat(s," {\n").concat(r,"\n}")),(0,h.useEffect)(function(){var e=ot(t.current);rt(r,"@ant-design-icons",{prepend:!s,csp:i,attachTo:e})},[])}(u),e=ft(n),i="icon should be icon definiton, but got ".concat(n),gt(e,"[@ant-design/icons] ".concat(i)),!ft(n))return null;var g=n;return g&&"function"===typeof g.icon&&(g=J(J({},g),{},{icon:g.icon(p.primaryColor,p.secondaryColor)})),vt(g.icon,"svg-".concat(g.name),J(J({className:s,onClick:r,style:a,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:u}))};_t.displayName="IconReact",_t.getTwoToneColors=function(){return J({},At)},_t.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;At.primaryColor=e,At.secondaryColor=i||wt(e),At.calculated=!!i};const xt=_t;function Et(t){var e=bt(t),i=(0,s.A)(e,2),n=i[0],r=i[1];return xt.setTwoToneColors({primaryColor:n,secondaryColor:r})}var kt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Et(P.primary);var Mt=h.forwardRef(function(t,e){var i=t.className,r=t.icon,a=t.spin,c=t.rotate,d=t.tabIndex,p=t.onClick,g=t.twoToneColor,f=l(t,kt),m=h.useContext(Y),v=m.prefixCls,w=void 0===v?"anticon":v,b=m.rootClassName,y=u()(b,w,o(o({},"".concat(w,"-").concat(r.name),!!r.name),"".concat(w,"-spin"),!!a||"loading"===r.name),i),A=d;void 0===A&&p&&(A=-1);var _=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,x=bt(g),E=(0,s.A)(x,2),k=E[0],M=E[1];return h.createElement("span",(0,n.A)({role:"img","aria-label":r.name},f,{ref:e,tabIndex:A,onClick:p,className:y}),h.createElement(xt,{icon:r,primaryColor:k,secondaryColor:M,style:_}))});Mt.displayName="AntdIcon",Mt.getTwoToneColor=function(){var t=xt.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},Mt.setTwoToneColor=Et;const St=Mt},82284:(t,e,i)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}i.d(e,{A:()=>n})},87821:()=>{},88406:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(94922),s=i.n(n);function r(){return r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},r.apply(this,arguments)}var a={doc:t=>n.createElement("svg",r({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),docx:t=>n.createElement("svg",r({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),full:t=>n.createElement("svg",r({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u5145\u6ee1"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-145.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u5145\\u6EE1",transform:"translate(145.000000, 1567.000000)"},n.createElement("path",{d:"M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),gif:t=>n.createElement("svg",r({t:1646123917228,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1827,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1828}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1829}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1830}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#CC7598","p-id":1831}),n.createElement("path",{d:"M288 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z m96 80a16 16 0 0 1-16 16 16 16 0 0 1-16-16V560a16 16 0 0 1 16-16 16 16 0 0 1 16 16z m176-208h-96a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h48a16 16 0 0 0 0-32h-48v-64h80a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":1832})),jpg:t=>n.createElement("svg",r({t:1646123877293,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1269,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1270}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1271}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1272}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1273}),n.createElement("path",{d:"M320 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m256 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM208 544a16 16 0 0 0-16 16v144a32 32 0 0 1-64 0v-16a16 16 0 0 0-32 0v16a64 64 0 0 0 128 0V560a16 16 0 0 0-16-16z",fill:"#FFFFFF","p-id":1274})),mp4:t=>n.createElement("svg",r({t:1646123927989,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1966,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1967}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1968}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1969}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#724AE2","p-id":1970}),n.createElement("path",{d:"M537.088 547.84c9.728 0 14.336 4.608 14.336 13.824v132.608h18.944c9.728 0.512 14.336 4.608 14.336 13.312s-5.12 13.312-15.36 13.312h-18.432v37.888c-0.512 9.728-5.12 14.336-13.824 14.336s-13.312-5.12-13.312-15.36v-36.864h-79.36c-12.8-0.512-19.456-4.096-19.456-11.776 0-4.096 1.536-7.68 4.096-11.776l94.208-141.312 0.512-1.024c3.584-4.608 8.192-7.168 13.312-7.168z m-302.592-1.536c7.168 0 11.264 5.12 11.264 15.872v193.536c0 10.752-4.608 15.872-11.264 15.872s-11.264-5.12-11.264-15.872V622.08l-44.544 140.8c-2.048 6.144-8.192 8.704-12.288 8.704s-10.24-3.072-12.288-8.704l-46.08-140.8v133.632c0 10.752-6.144 15.872-12.8 15.872s-12.8-5.12-12.8-15.872V562.176c0-10.752 5.632-15.872 12.8-15.872 4.608 0 10.752 3.072 12.8 8.704L166.4 728.064l56.832-173.056c2.048-6.144 6.144-8.704 11.264-8.704z m121.856 0c35.328 0 63.488 28.672 63.488 64 0 34.816-27.648 62.976-62.464 64h-33.28v79.872c0 8.704-7.168 15.872-15.872 15.872-8.192 0-15.36-6.656-15.872-14.848V562.176c0-8.192 6.656-15.36 14.848-15.872h49.152z m166.912 58.368l-59.904 90.112h59.904v-90.112z m-166.912-26.624h-31.744v64h31.744c17.92 0 31.744-14.848 31.744-32.256s-13.824-31.744-31.744-31.744z",fill:"#FFFFFF","p-id":1971})),pdf:t=>n.createElement("svg",r({t:1646123842588,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1304,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1305}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1306}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1307}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":1308}),n.createElement("path",{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":1309})),png:t=>n.createElement("svg",r({t:1646123868693,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1130,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1131}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1132}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1133}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1134}),n.createElement("path",{d:"M160 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m448 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM400 544a16 16 0 0 0-16 16v137.6l-98.88-146.56a7.36 7.36 0 0 0-2.24-2.24l-2.56-1.6h-16l-2.56 2.24v5.12a13.76 13.76 0 0 0 0 3.52v192a16 16 0 0 0 32 0v-137.6l96 142.08a15.68 15.68 0 0 0 32-3.2v-192A16 16 0 0 0 400 544z",fill:"#FFFFFF","p-id":1135})),ppt:t=>n.createElement("svg",r({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),pptx:t=>n.createElement("svg",r({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),rar:t=>n.createElement("svg",r({t:1646123940344,className:"icon",viewBox:"0 0 1056 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2245,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M1.248 0h1024v1024h-1024z",fillOpacity:0,"p-id":2246}),n.createElement("path",{d:"M849.248 1024h-672c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5F1EC","p-id":2247}),n.createElement("path",{d:"M922.848 313.6h-819.2V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#E0B773","p-id":2248}),n.createElement("path",{d:"M244.448 252.8v-57.6h25.6l25.6 54.4h25.6l-32-54.4c19.2-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m32-73.6h-32v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 3.2 6.4 3.2 16 0 6.4-3.2 9.6-6.4 12.8 0 3.2-6.4 6.4-12.8 6.4z m83.2 73.6l9.6-28.8h48l9.6 28.8h22.4l-48-131.2h-16l-48 131.2h22.4z m54.4-48h-38.4l19.2-57.6 19.2 57.6z m86.4 48v-57.6h25.6l25.6 54.4h22.4l-28.8-54.4c16-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m28.8-73.6h-28.8v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 6.4 6.4 6.4 16 0 6.4-3.2 9.6-6.4 12.8-6.4 3.2-12.8 6.4-19.2 6.4z",fill:"#FFFFFF","p-id":2249}),n.createElement("path",{d:"M922.848 236.8h-150.4c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5F1EC","p-id":2250}),n.createElement("path",{d:"M426.848 464v409.6h172.8V464h-172.8z m150.4 140.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#E0B773","p-id":2251})),rotate:t=>n.createElement("svg",r({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u65cb\u8f6c"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-77.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u65CB\\u8F6C",transform:"translate(77.000000, 1567.000000)"},n.createElement("path",{d:"M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),svg:t=>n.createElement("svg",r({t:1646123950101,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2385,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":2386}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":2387}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":2388}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":2389}),n.createElement("path",{d:"M160 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m246.08-96a16 16 0 0 0-20.8 8.96l-64 155.84-64-155.84a16 16 0 1 0-29.44 11.84l77.76 192a24.96 24.96 0 0 0 3.2 4.8 12.8 12.8 0 0 0 4.8 3.2 12.8 12.8 0 0 0 4.8 0h5.76l3.2-2.24a13.12 13.12 0 0 0 5.44-6.4l77.76-192a15.68 15.68 0 0 0-4.48-20.16zM576 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":2390})),unknow:t=>n.createElement("svg",r({t:1646123889587,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1551,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M914.92 287.344L697.718 81.474v128.338c0 43.554 34.968 79.189 77.706 79.189h141.99l-2.494-1.657z",fill:"#027AFF","p-id":1552}),n.createElement("path",{d:"M768.284 316.733c-54.48 0-99.056-48.997-99.056-108.882V66.223h-373.35c-30.593 0-55.624 27-55.624 60v348.869h490.802c37.476 0 68.137 33.073 68.137 73.496v207.894c0 40.424-30.661 73.497-68.137 73.497H240.254v70.128c0 33 25.031 60 55.625 60h563.637c30.594 0 55.625-27 55.625-60V316.733H768.284z",fill:"#027AFF","p-id":1553}),n.createElement("path",{d:"M699.302 519.057H156.028c-31.109 0-56.561 25.381-56.561 56.403v153.038c0 31.021 25.452 56.402 56.561 56.402h543.274c31.11 0 56.562-25.38 56.562-56.402V575.46c0-31.022-25.453-56.403-56.562-56.403z m-444.857 211.51c-4.902 4.135-10.558 6.203-16.874 6.203-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.451-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.545 11.28-7.636 15.417z m29.884-89.775c-2.263 2.068-9.993 6.957-23.379 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.849 2.82-0.849 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.259-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.918-1.503-10.84-4.605-2.923-2.82-4.431-6.487-4.431-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.874 0 30.637 4.418 41.384 13.349 10.18 8.46 15.271 18.989 15.271 31.68 0 12.69-3.488 22.372-10.652 29.14zM442.7 730.566c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.884-89.774c-2.263 2.068-9.993 6.957-23.38 14.571-3.864 2.256-6.221 4.136-7.07 5.64-0.565 0.846-0.848 2.82-0.848 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.258-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.358 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.919-1.503-10.841-4.605-2.922-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.873 0 30.637 4.418 41.383 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.652 29.14z m158.372 89.774c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.067-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.883-89.774c-2.262 2.068-9.992 6.957-23.378 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.85 2.82-0.85 6.016 0 4.7-1.507 8.367-4.618 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.841-3.29-3.488-2.632-5.185-6.392-5.185-11.28v-10.247c0-7.896 3.582-14.477 10.841-19.553 6.976-3.572 13.763-7.238 20.456-10.81 7.26-3.854 10.841-8.367 10.841-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.571 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.147 6.017-9.05 8.93-14.611 8.93-4.337 0-7.919-1.503-10.841-4.605-2.923-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.909-18.143 16.874 0 30.637 4.418 41.384 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.653 29.14z",fill:"#027AFF","p-id":1554})),xls:t=>n.createElement("svg",r({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),xlsx:t=>n.createElement("svg",r({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),zip:t=>n.createElement("svg",r({t:1646123936994,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2105,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M0 0h1024v1024H0z",fillOpacity:0,"p-id":2106}),n.createElement("path",{d:"M848 1024H176c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5ECEC","p-id":2107}),n.createElement("path",{d:"M921.6 313.6H102.4V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#BC8585","p-id":2108}),n.createElement("path",{d:"M300.8 252.8v-19.2H240l57.6-96v-16h-80v16h57.6l-57.6 96v16h83.2z m70.4 0V121.6H352v131.2h19.2z m80 0v-51.2H480c12.8 0 22.4-3.2 32-12.8 6.4-6.4 9.6-16 9.6-25.6 0-6.4 0-12.8-3.2-19.2-3.2-6.4-6.4-9.6-9.6-12.8-6.4-3.2-9.6-6.4-16-6.4h-64V256h22.4z m28.8-70.4h-28.8v-41.6H480c6.4 0 9.6 0 12.8 3.2 3.2 0 3.2 3.2 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4-3.2 9.6-6.4 12.8-3.2 6.4-9.6 9.6-16 9.6z",fill:"#FFFFFF","p-id":2109}),n.createElement("path",{d:"M921.6 236.8H771.2c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5ECEC","p-id":2110}),n.createElement("path",{d:"M425.6 464v409.6h172.8V464H425.6zM576 604.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#BC8585","p-id":2111}))};const o=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=a[i]||a.unknow;return s().createElement(n,{width:e,height:e})}},88648:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=(0,i(94922).createContext)(null)},89261:(t,e,i)=>{"use strict";t.exports=i(74935)},89379:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(64467);function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function r(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){(0,n.A)(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}},93375:(t,e,i)=>{var n=i(36382);t.exports=function(){return n.Date.now()}},95600:(t,e,i)=>{var n=i(2316),s=i(93375),r=i(2899),a=Math.max,o=Math.min;t.exports=function(t,e,i){var l,h,c,d,u,p,g=0,f=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(e){var i=l,n=h;return l=h=void 0,g=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-g>=c}function y(){var t=s();if(b(t))return A(t);u=setTimeout(y,function(t){var i=e-(t-p);return m?o(i,c-(t-g)):i}(t))}function A(t){return u=void 0,v&&l?w(t):(l=h=void 0,d)}function _(){var t=s(),i=b(t);if(l=arguments,h=this,p=t,i){if(void 0===u)return function(t){return g=t,u=setTimeout(y,e),f?w(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(y,e),w(p)}return void 0===u&&(u=setTimeout(y,e)),d}return e=r(e)||0,n(i)&&(f=!!i.leading,c=(m="maxWait"in i)?a(r(i.maxWait)||0,e):c,v="trailing"in i?!!i.trailing:v),_.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=h=u=void 0},_.flush=function(){return void 0===u?d:A(s())},_}},98677:t=>{"use strict";var e=function(){};t.exports=e},98771:(t,e,i)=>{var n=i(95600),s=i(2316);t.exports=function(t,e,i){var r=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(r="leading"in i?!!i.leading:r,a="trailing"in i?!!i.trailing:a),n(t,e,{leading:r,maxWait:e,trailing:a})}}}]);
|
|
3
|
+
//# sourceMappingURL=441.45ec01c6.chunk.js.map
|