@kne-components/react-file 0.1.13 → 0.1.15
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 +12 -12
- package/build/index.html +1 -1
- package/build/remoteEntry.js +1 -1
- package/build/remoteEntry.js.map +1 -1
- package/build/static/js/{268.a014d2e0.chunk.js → 268.352fda3f.chunk.js} +2 -2
- package/build/static/js/{268.a014d2e0.chunk.js.map → 268.352fda3f.chunk.js.map} +1 -1
- package/build/static/js/{414.ec2279a7.chunk.js → 414.291e521d.chunk.js} +2 -2
- package/build/static/js/{414.ec2279a7.chunk.js.map → 414.291e521d.chunk.js.map} +1 -1
- package/build/static/js/689.828c3b13.chunk.js +3 -0
- package/build/static/js/689.828c3b13.chunk.js.map +1 -0
- package/build/static/js/779.2c241d96.chunk.js +2 -0
- package/build/static/js/779.2c241d96.chunk.js.map +1 -0
- package/build/static/js/{main.ba945ed5.js → main.f936a9ef.js} +2 -2
- package/build/static/js/{main.ba945ed5.js.map → main.f936a9ef.js.map} +1 -1
- package/package.json +1 -1
- package/build/static/js/502.5f63d549.chunk.js +0 -3
- package/build/static/js/502.5f63d549.chunk.js.map +0 -1
- package/build/static/js/779.1c0a0eaf.chunk.js +0 -2
- package/build/static/js/779.1c0a0eaf.chunk.js.map +0 -1
- /package/build/static/js/{502.5f63d549.chunk.js.LICENSE.txt → 689.828c3b13.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 689.828c3b13.chunk.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunk_kne_components_react_file=self.webpackChunk_kne_components_react_file||[]).push([[689],{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)}))]}},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}))}))},13073:(t,e,i)=>{"use strict";t.exports=i(47645)},13520:(t,e,i)=>{"use strict";i.d(e,{A:()=>C});var n=i(89261),s=i(94922),r=i(36294),a=i(63697),o=i(47215),l=i(64288),h=i(98677),c=Object.prototype.hasOwnProperty;function d(t,e,i){for(i of t.keys())if(u(i,e))return i}function u(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--&&u(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=d(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=d(e,s)))return!1;if(!u(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(c.call(t,i)&&++n&&!c.call(e,i))return!1;if(!(i in e)||!u(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}var p=i(31079),g=i(85724),f=i(66499);class m{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}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),(0,l.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,l.A)(Array.isArray(t),`"${t}" is not a valid destination array.`);const e=t[0];new Promise((t=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,l.A)(!1,`"${e}" is not a valid page reference.`)})):"number"===typeof e?t(e):(0,l.A)(!1,`"${e}" is not a valid destination reference.`)})).then((e=>{const i=e+1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(i>=1&&i<=this.pagesCount,`"${i}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(t>=1&&t<=this.pagesCount,`"${t}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const v={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=i(42461),y=i(42166),w=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(e){r(e)}}function o(t){try{l(n.throw(t))}catch(e){r(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))},A=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:E}=p,_=(t,e)=>{switch(e){case v.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case v.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function x(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const C=(0,s.forwardRef)((function(t,e){var{children:i,className:c,error:d="Failed to load PDF file.",externalLinkRel:v,externalLinkTarget:C,file:S,inputRef:T,imageResourcesPath:M,loading:P="Loading PDF\u2026",noData:k="No PDF file specified.",onItemClick:L,onLoadError:R,onLoadProgress:I,onLoadSuccess:F,onPassword:D=_,onSourceError:N,onSourceSuccess:O,options:H,renderMode:B,rotate:z}=t,j=A(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[U,V]=(0,y.A)(),{value:G,error:$}=U,[W,q]=(0,y.A)(),{value:X,error:K}=W,Y=(0,s.useRef)(new m),Z=(0,s.useRef)([]),J=(0,s.useRef)(void 0),Q=(0,s.useRef)(void 0);S&&S!==J.current&&x(S)&&(h(!u(S,J.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.'),J.current=S),H&&H!==Q.current&&(h(!u(H,Q.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.'),Q.current=H);const tt=(0,s.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=Z.current[n];s?s.scrollIntoView():h(!1,`An internal link leading to page ${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,s.useImperativeHandle)(e,(()=>({linkService:Y,pages:Z,viewer:tt})),[]),(0,s.useEffect)((function(){V({type:"RESET"})}),[S,V]);const et=(0,s.useCallback)((()=>w(this,void 0,void 0,(function*(){if(!S)return null;if("string"===typeof S){if((0,b.zL)(S)){return{data:(0,b.jA)(S)}}return(0,b.qC)(),{url:S}}if(S instanceof E)return{range:S};if((0,b.mw)(S))return{data:S};if(b.Bd&&(0,b.qf)(S)){return{data:yield(0,b.h1)(S)}}if((0,l.A)("object"===typeof S,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,l.A)(x(S),"Invalid parameter object: need either .data, .range or .url"),"url"in S&&"string"===typeof S.url){if((0,b.zL)(S.url)){const{url:t}=S,e=A(S,["url"]),i=(0,b.jA)(t);return Object.assign({data:i},e)}(0,b.qC)()}return S}))),[S]);(0,s.useEffect)((()=>{const t=(0,a.A)(et());return t.promise.then((t=>{V({type:"RESOLVE",value:t})})).catch((t=>{V({type:"REJECT",error:t})})),()=>{(0,b.xL)(t)}}),[et,V]),(0,s.useEffect)((()=>{"undefined"!==typeof G&&(!1!==G?O&&O():$&&(h(!1,$.toString()),N&&N($)))}),[G]),(0,s.useEffect)((function(){q({type:"RESET"})}),[q,G]),(0,s.useEffect)((function(){if(!G)return;const t=H?Object.assign(Object.assign({},G),H):G,e=p.YE(t);I&&(e.onProgress=I),D&&(e.onPassword=D);const i=e,n=i.promise.then((t=>{q({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||q({type:"REJECT",error:t})}));return()=>{n.finally((()=>i.destroy()))}}),[H,q,G]),(0,s.useEffect)((()=>{"undefined"!==typeof X&&(!1!==X?X&&(F&&F(X),Z.current=new Array(X.numPages),Y.current.setDocument(X)):K&&(h(!1,K.toString()),R&&R(K)))}),[X]),(0,s.useEffect)((function(){Y.current.setViewer(tt.current),Y.current.setExternalLinkRel(v),Y.current.setExternalLinkTarget(C)}),[v,C]);const it=(0,s.useCallback)(((t,e)=>{Z.current[t]=e}),[]),nt=(0,s.useCallback)((t=>{delete Z.current[t]}),[]),st=(0,s.useMemo)((()=>({imageResourcesPath:M,linkService:Y.current,onItemClick:L,pdf:X,registerPage:it,renderMode:B,rotate:z,unregisterPage:nt})),[M,L,X,it,B,z,nt]),rt=(0,s.useMemo)((()=>(0,r.Ay)(j,(()=>X))),[j,X]);return(0,n.jsx)("div",Object.assign({className:(0,o.A)("react-pdf__Document",c),ref:T,style:{"--scale-factor":"1"}},rt,{children:S?void 0===X||null===X?(0,n.jsx)(f.A,{type:"loading",children:"function"===typeof P?P():P}):!1===X?(0,n.jsx)(f.A,{type:"error",children:"function"===typeof d?d():d}):(0,n.jsx)(g.A.Provider,{value:st,children:i}):(0,n.jsx)(f.A,{type:"no-data",children:"function"===typeof k?k():k})}))}))},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);function a(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 o(t,e){if(e||!t){const t=document.getElementById("printWindow");t&&document.body.removeChild(t)}}function l(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:r,print:h,suppressErrors:c}=e;setTimeout((()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),o(r)}if(t.contentWindow.focus(),h)h(t).then(u).catch((t=>{s?s("print",l(t)):a({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 a({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 a({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 c(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 d(t,e,i){const n=c(t),s=c(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,d(a,t,i)}}else a({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const u='\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 p(t,e,i,n){var s,r,o,c,p;const{contentNode:g,clonedContentNode:f,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:b,originalCanvasNodes:y}=i,{bodyClass:w,fonts:A,ignoreGlobalStyles:E,pageStyle:_,nonce:x,suppressErrors:C,copyShadowRoots:S}=n;t.onload=null;const T=null!==(s=t.contentDocument)&&void 0!==s?s:null===(r=t.contentWindow)||void 0===r?void 0:r.document;if(T){const i=T.body.appendChild(f);S&&d(g,i,!!C),A&&((null===(o=t.contentDocument)||void 0===o?void 0:o.fonts)&&(null===(c=t.contentWindow)||void 0===c?void 0:c.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:",l(t)])}))})):(A.forEach((t=>{e(t)})),a({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:C})));const n=null!=_?_:u,s=T.createElement("style");x&&(s.setAttribute("nonce",x),T.head.setAttribute("nonce",x)),s.appendChild(T.createTextNode(n)),T.head.appendChild(s),w&&T.body.classList.add(...w.split(" "));const r=T.querySelectorAll("canvas");for(let t=0;t<y.length;++t){const e=y[t],i=r[t];if(void 0===i){a({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:C});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 h="select",b=g.querySelectorAll(h),M=T.querySelectorAll(h);for(let t=0;t<b.length;t++)M[t].value=b[t].value;if(!E){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=T.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+=`${i.cssRules[e].cssText}\r\n`)}catch(t){a({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: ${l(t).message}`],level:"warning"})}e.setAttribute("id",`react-to-print-${n}`),x&&e.setAttribute("nonce",x),e.appendChild(T.createTextNode(r)),T.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))a({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=T.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!==(p=i.nodeValue)&&void 0!==p?p:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,r,a)=>{e(t,["Failed to load",t,"Error:",a])},x&&t.setAttribute("nonce",x),T.head.appendChild(t)}else a({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===b&&h(t,n)}function g(t,e,i,n){t.onload=()=>{p(t,e,i,n)},document.body.appendChild(t)}function f(t){const{contentRef:e,fonts:i,ignoreGlobalStyles:n,onBeforePrint:s,onPrintError:c,preserveAfterPrint:d,suppressErrors:u}=t,p=(0,r.useCallback)((r=>{o(d,!0);const p=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return i&&(e&&a({level:"warning",messages:['"react-to-print" received a `contentRef` option and a optional-content param passed to its callback. The `contentRef` option will be ignored.']}),"function"==typeof i)?i():e?e.current:void a({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n})}({contentRef:e,optionalContent:r,suppressErrors:u});if(!p)return void a({messages:["There is nothing to print"],suppressErrors:u});const f=p.cloneNode(!0),m=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),v=f.querySelectorAll("img"),b=f.querySelectorAll("video"),y=i?i.length:0,w=(n?0:m.length)+v.length+b.length+y,A=[],E=[],_=function(){const t=document.createElement("iframe");return t.width=`${document.documentElement.clientWidth}px`,t.height=`${document.documentElement.clientHeight}px`,t.style.position="absolute",t.style.top=`-${document.documentElement.clientHeight+100}px`,t.style.left=`-${document.documentElement.clientWidth+100}px`,t.id="printWindow",t.srcdoc="<!DOCTYPE html>",t}(),x=(e,i)=>{A.includes(e)?a({level:"debug",messages:["Tried to mark a resource that has already been handled",e],suppressErrors:u}):(i?(a({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...i],suppressErrors:u}),E.push(e)):A.push(e),A.length+E.length===w&&h(_,t))},C={contentNode:p,clonedContentNode:f,clonedImgNodes:v,clonedVideoNodes:b,numResourcesToLoad:w,originalCanvasNodes:p.querySelectorAll("canvas")};s?s().then((()=>{g(_,x,C,t)})).catch((t=>{null==c||c("onBeforePrint",l(t))})):g(_,x,C,t)}),[t]);return p}return s}())},17666:(t,e,i)=>{"use strict";i.d(e,{ZF:()=>k,lV:()=>A});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:"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 u=n.forwardRef((function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:d}))}));var p=i(54159),g=i.n(p),f=i(60213),m=(i(16052),i(50805));function v(){return v=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},v.apply(null,arguments)}function b(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 y=["onClick","children","loading"],w=t=>{const[e,i]=(0,n.useState)(!1),s=(0,a.A)((function(){return i(!0),Promise.resolve(t&&t(...arguments)).then((()=>{i(!1)}))}));return{isLoading:e,setIsLoading:i,callback:s}},A=t=>{let{onClick:e,children:i,loading:n}=t,a=b(t,y);const{isLoading:o,callback:l}=w(e);return s().createElement(r.Button,v({},a,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var E="_zIHFy",_="_R-IrF",x="_F1kMl",C="_Iee0d",S="_aGBVE",T="_0oW1K";const M={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},P=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],k=(0,f.Fr)("zh-CN",M,"button-group")((t=>{const{formatMessage:e}=(0,f.tz)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:d,cancelText:u,onCancel:p,isModal:m,okText:y,placement:A,children:M,onClick:k,getContainer:L,renderModal:R}=i,I=b(i,P),[F,D]=(0,n.useState)(!1),{isLoading:N,callback:O}=w(k),H=(0,a.A)((()=>{D(!0)})),B=s().createElement(r.Flex,{className:x,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(r.Flex,{align:"flex-start",gap:8,className:C},h&&s().createElement(c,{className:"title-icon"}),o),s().createElement(r.Flex,{align:"flex-start",gap:8,className:g()(S,{[T]:o})},!o&&h?s().createElement(c,{className:"title-icon"}):null,l||e({id:"message"}))),z=()=>"function"===typeof M?M(v({},I,{onClick:H})):s().createElement(r.Button,v({},I,{loading:N,onClick:()=>{H()}}),M);if(m){const t={open:F,onCancel:()=>{D(!1),p&&p()},wrapClassName:_,okText:y||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOk:t=>(D(!1),O(t)),closable:!1,okButtonProps:{danger:h},getContainer:L,children:B};return s().createElement(s().Fragment,null,"function"===typeof R?R(t):s().createElement(r.Modal,t),z())}return s().createElement(r.Popconfirm,{overlayClassName:g()(E),okButtonProps:{danger:h},title:B,open:F,getPopupContainer:L,onCancel:p,placement:A,showCancel:d,okText:y||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOpenChange:D,onConfirm:t=>{O(t)}},z())}));var L=Array.isArray,R="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},I="object"==typeof R&&R&&R.Object===Object&&R,F="object"==typeof self&&self&&self.Object===Object&&self,D=I||F||Function("return this")(),N=D.Symbol,O=Object.prototype,H=O.hasOwnProperty,B=O.toString,z=N?N.toStringTag:void 0;var j=function(t){var e=H.call(t,z),i=t[z];try{t[z]=void 0;var n=!0}catch(r){}var s=B.call(t);return n&&(e?t[z]=i:delete t[z]),s},U=Object.prototype.toString;var V=function(t){return U.call(t)},G=N?N.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":G&&G in Object(t)?j(t):V(t)};var W=function(t){return null!=t&&"object"==typeof t};var q=function(t){return"symbol"==typeof t||W(t)&&"[object Symbol]"==$(t)},X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/;var Y=function(t,e){if(L(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!q(t))||(K.test(t)||!X.test(t)||null!=e&&t in Object(e))};var Z=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var J=function(t){if(!Z(t))return!1;var e=$(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Q=D["__core-js_shared__"],tt=function(){var t=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var et=function(t){return!!tt&&tt in t},it=Function.prototype.toString;var nt=function(t){if(null!=t){try{return it.call(t)}catch(e){}try{return t+""}catch(e){}}return""},st=/^\[object .+?Constructor\]$/,rt=Function.prototype,at=Object.prototype,ot=rt.toString,lt=at.hasOwnProperty,ht=RegExp("^"+ot.call(lt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ct=function(t){return!(!Z(t)||et(t))&&(J(t)?ht:st).test(nt(t))};var dt=function(t,e){return null==t?void 0:t[e]};var ut=function(t,e){var i=dt(t,e);return ct(i)?i:void 0},pt=ut(Object,"create");var gt=function(){this.__data__=pt?pt(null):{},this.size=0};var ft=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},mt=Object.prototype.hasOwnProperty;var vt=function(t){var e=this.__data__;if(pt){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return mt.call(e,t)?e[t]:void 0},bt=Object.prototype.hasOwnProperty;var yt=function(t){var e=this.__data__;return pt?void 0!==e[t]:bt.call(e,t)};var wt=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function At(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=gt,At.prototype.delete=ft,At.prototype.get=vt,At.prototype.has=yt,At.prototype.set=wt;var Et=At;var _t=function(){this.__data__=[],this.size=0};var xt=function(t,e){return t===e||t!==t&&e!==e};var Ct=function(t,e){for(var i=t.length;i--;)if(xt(t[i][0],e))return i;return-1},St=Array.prototype.splice;var Tt=function(t){var e=this.__data__,i=Ct(e,t);return!(i<0)&&(i==e.length-1?e.pop():St.call(e,i,1),--this.size,!0)};var Mt=function(t){var e=this.__data__,i=Ct(e,t);return i<0?void 0:e[i][1]};var Pt=function(t){return Ct(this.__data__,t)>-1};var kt=function(t,e){var i=this.__data__,n=Ct(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function Lt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=_t,Lt.prototype.delete=Tt,Lt.prototype.get=Mt,Lt.prototype.has=Pt,Lt.prototype.set=kt;var Rt=Lt,It=ut(D,"Map");var Ft=function(){this.size=0,this.__data__={hash:new Et,map:new(It||Rt),string:new Et}};var Dt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Nt=function(t,e){var i=t.__data__;return Dt(e)?i["string"==typeof e?"string":"hash"]:i.map};var Ot=function(t){var e=Nt(this,t).delete(t);return this.size-=e?1:0,e};var Ht=function(t){return Nt(this,t).get(t)};var Bt=function(t){return Nt(this,t).has(t)};var zt=function(t,e){var i=Nt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function jt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}jt.prototype.clear=Ft,jt.prototype.delete=Ot,jt.prototype.get=Ht,jt.prototype.has=Bt,jt.prototype.set=zt;var Ut=jt;function Vt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var a=t.apply(this,n);return i.cache=r.set(s,a)||r,a};return i.cache=new(Vt.Cache||Ut),i}Vt.Cache=Ut;var Gt=Vt;var $t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wt=/\\(\\)?/g,qt=function(t){var e=Gt(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace($t,(function(t,i,n,s){e.push(n?s.replace(Wt,"$1"):i||t)})),e}));var Xt=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s},Kt=N?N.prototype:void 0,Yt=Kt?Kt.toString:void 0;var Zt=function t(e){if("string"==typeof e)return e;if(L(e))return Xt(e,t)+"";if(q(e))return Yt?Yt.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i};var Jt=function(t){return null==t?"":Zt(t)};var Qt=function(t,e){return L(t)?t:Y(t,e)?[t]:qt(Jt(t))};var te=function(t){if("string"==typeof t||q(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var ee=function(t,e){for(var i=0,n=(e=Qt(e,t)).length;null!=t&&i<n;)t=t[te(e[i++])];return i&&i==n?t:void 0},ie=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();var ne=function(t,e,i){"__proto__"==e&&ie?ie(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i},se=Object.prototype.hasOwnProperty;var re=function(t,e,i){var n=t[e];se.call(t,e)&&xt(n,i)&&(void 0!==i||e in t)||ne(t,e,i)},ae=/^(?:0|[1-9]\d*)$/;var oe=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&ae.test(t))&&t>-1&&t%1==0&&t<e};var le=function(t,e,i,n){if(!Z(t))return t;for(var s=-1,r=(e=Qt(e,t)).length,a=r-1,o=t;null!=o&&++s<r;){var l=te(e[s]),h=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(s!=a){var c=o[l];void 0===(h=n?n(c,l,o):void 0)&&(h=Z(c)?c:oe(e[s+1])?[]:{})}re(o,l,h),o=o[l]}return t};var he=function(t,e,i){for(var n=-1,s=e.length,r={};++n<s;){var a=e[n],o=ee(t,a);i(o,a)&&le(r,Qt(a,t),o)}return r};var ce=function(t,e){return null!=t&&e in Object(t)};var de=function(t){return W(t)&&"[object Arguments]"==$(t)},ue=Object.prototype,pe=ue.hasOwnProperty,ge=ue.propertyIsEnumerable,fe=de(function(){return arguments}())?de:function(t){return W(t)&&pe.call(t,"callee")&&!ge.call(t,"callee")};var me=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var ve=function(t,e,i){for(var n=-1,s=(e=Qt(e,t)).length,r=!1;++n<s;){var a=te(e[n]);if(!(r=null!=t&&i(t,a)))break;t=t[a]}return r||++n!=s?r:!!(s=null==t?0:t.length)&&me(s)&&oe(a,s)&&(L(t)||fe(t))};var be=function(t,e){return null!=t&&ve(t,e,ce)};var ye=function(t,e){return he(t,e,(function(e,i){return be(t,i)}))};var we=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t},Ae=N?N.isConcatSpreadable:void 0;var Ee=function(t){return L(t)||fe(t)||!!(Ae&&t&&t[Ae])};var _e=function t(e,i,n,s,r){var a=-1,o=e.length;for(n||(n=Ee),r||(r=[]);++a<o;){var l=e[a];i>0&&n(l)?i>1?t(l,i-1,n,s,r):we(r,l):s||(r[r.length]=l)}return r};var xe=function(t){return(null==t?0:t.length)?_e(t,1):[]};var Ce=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},Se=Math.max;var Te=function(t,e,i){return e=Se(void 0===e?t.length-1:e,0),function(){for(var n=arguments,s=-1,r=Se(n.length-e,0),a=Array(r);++s<r;)a[s]=n[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=n[s];return o[e]=i(a),Ce(t,this,o)}};var Me=function(t){return function(){return t}};var Pe=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:Me(e),writable:!0})}:function(t){return t},ke=Date.now;var Le=function(t){var e=0,i=0;return function(){var n=ke(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Pe);var Re=function(t){return Le(Te(t,void 0,xe),t+"")}((function(t,e){return null==t?{}:ye(t,e)}));const Ie=Gt((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`${e}${i}${n.join(",")}${Object.values(s).join(",")}${r&&r.toString()}`}));var Fe="_V58ju",De="_XN3o6",Ne="_-depB",Oe="_juFTd",He="_x6dp-";const Be=["list","more","compact","showLength"],ze=["className","confirm","buttonComponent","tooltipProps"];(0,f.Fr)("zh-CN",M,"button-group")((t=>{const{formatMessage:e}=(0,f.tz)(),i=Object.assign({},{more:s().createElement(r.Button,null,e({id:"more"}),s().createElement(u,null))},t),{list:o,more:l,compact:h,showLength:c}=i,d=b(i,Be),p=Re(d,["size","split","align","style"]),[y,w]=(0,n.useState)(o.length&&1),E=Number.isInteger(c)?c:y,_=(0,a.A)((()=>{const t=C.current,e=S.current,i=x.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=Ie({amountWidth:r,moreBtnWidth:a,buttonWidthList:o,spaceProps:p,compact:h});(0,n.startTransition)((()=>{w(l)}))})),x=(0,m.A)(_),C=(0,m.A)(_),S=(0,m.A)(_),T=o.slice(E),M=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:g()("button-group-item",He),isDropdown:i});const{className:n,confirm:a,buttonComponent:o,tooltipProps:l}=t,h=b(t,ze),c=a||h.message,d=o||(c?k:A),u=s().createElement(d,v({danger:c&&!1!==h.isDelete},Object.assign({},h,c&&(h.isModal||i)?{isModal:!0}:{}),{key:e,className:g()("button-group-item",He,n)}));return l?s().createElement(r.Tooltip,l,u):u},P=h?r.Space.Compact:r.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:Fe,ref:x}),s().createElement("div",{className:De},s().createElement("div",{className:Ne,ref:S},l),s().createElement("div",{className:Ne,ref:C},s().createElement(P,p,o.map(M)))),s().createElement(P,p,o.slice(0,E).map(((t,e)=>M(t,e,!1))),T.length>0&&s().createElement(r.Dropdown,{overlayClassName:Oe,menu:{items:T.map(((t,e)=>({key:e,label:M(t,e,!0)})))}},l)))}))},31079:(t,e,i)=>{"use strict";i.d(e,{D6:()=>_s,EA:()=>As,Tm:()=>Es,YE:()=>xs,dU:()=>ys,ng:()=>ws});var n={d:(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},s=globalThis.pdfjsLib={};n.d(s,{AbortException:()=>mt,AnnotationEditorLayer:()=>vs,AnnotationEditorParamsType:()=>b,AnnotationEditorType:()=>v,AnnotationEditorUIManager:()=>be,AnnotationLayer:()=>rs,AnnotationMode:()=>m,CMapCompressionType:()=>Z,ColorPicker:()=>ps,DOMSVGFactory:()=>Wt,DrawLayer:()=>bs,FeatureTest:()=>wt,GlobalWorkerOptions:()=>hi,ImageKind:()=>S,InvalidPDFException:()=>ut,MissingPDFException:()=>pt,OPS:()=>J,Outliner:()=>ls,PDFDataRangeTransport:()=>un,PDFDateString:()=>se,PDFWorker:()=>vn,PasswordResponses:()=>Q,PermissionFlag:()=>y,PixelsPerInch:()=>Ut,RenderingCancelledException:()=>Xt,TextLayer:()=>Qi,UnexpectedResponseException:()=>gt,Util:()=>Et,VerbosityLevel:()=>Y,XfaLayer:()=>Mn,build:()=>xn,createValidAbsoluteUrl:()=>ot,fetchData:()=>Vt,getDocument:()=>hn,getFilenameFromUrl:()=>Zt,getPdfFilenameFromUrl:()=>Jt,getXfaPageViewport:()=>re,isDataScheme:()=>Kt,isPdfFile:()=>Yt,noContextMenu:()=>ee,normalizeUnicode:()=>Ct,renderTextLayer:()=>tn,setLayerDimensions:()=>he,shadow:()=>lt,updateTextLayer:()=>en,version:()=>_n});const r="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),a=[1,0,0,1,0,0],o=[.001,0,0,.001,0,0],l=1.35,h=1,c=2,d=4,u=16,p=32,g=64,f=256,m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},v={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},b={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_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},y={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},w=0,A=1,E=2,_=3,x=3,C=4,S={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},T=1,M=2,P=3,k=4,L=5,R=6,I=7,F=8,D=9,N=10,O=11,H=12,B=13,z=14,j=15,U=16,V=17,G=20,$=1,W=2,q=3,X=4,K=5,Y={ERRORS:0,WARNINGS:1,INFOS:5},Z={NONE:0,BINARY:1},J={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},Q={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let tt=Y.WARNINGS;function et(t){Number.isInteger(t)&&(tt=t)}function it(){return tt}function nt(t){tt>=Y.INFOS&&console.log(`Info: ${t}`)}function st(t){tt>=Y.WARNINGS&&console.log(`Warning: ${t}`)}function rt(t){throw new Error(t)}function at(t,e){t||rt(e)}function ot(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;try{if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const n=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function lt(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 ht=function(){function t(e,i){this.constructor===t&&rt("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class ct extends ht{constructor(t,e){super(t,"PasswordException"),this.code=e}}class dt extends ht{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class ut extends ht{constructor(t){super(t,"InvalidPDFException")}}class pt extends ht{constructor(t){super(t,"MissingPDFException")}}class gt extends ht{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class ft extends ht{constructor(t){super(t,"FormatError")}}class mt extends ht{constructor(t){super(t,"AbortException")}}function vt(t){"object"===typeof t&&void 0!==t?.length||rt("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 bt(t){"string"!==typeof t&&rt("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}function yt(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class wt{static get isLittleEndian(){return lt(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return lt(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return lt(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){return"undefined"!==typeof navigator&&"string"===typeof navigator?.platform?lt(this,"platform",{isMac:navigator.platform.includes("Mac")}):lt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return lt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const At=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));class Et{static makeHexColor(t,e,i){return`#${At[t]}${At[e]}${At[i]}`}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 applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}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){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,o=Math.sqrt((i+r)**2-4*(i*r-s*n))/2,l=a+o||1,h=a-o||1;return[Math.sqrt(l),Math.sqrt(h)]}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#t(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)}static#e(t,e,i,n,s,r,a,o,l,h,c,d){if(Math.abs(l)<1e-12)return void(Math.abs(h)>=1e-12&&this.#t(t,e,i,n,s,r,a,o,-c/h,d));const u=h**2-4*c*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;this.#t(t,e,i,n,s,r,a,o,(-h+p)/g,d),this.#t(t,e,i,n,s,r,a,o,(-h-p)/g,d)}static bezierBoundingBox(t,e,i,n,s,r,a,o,l){return l?(l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,a),Math.min(e,o),Math.max(t,a),Math.max(e,o)],this.#e(t,i,s,a,e,n,r,o,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),l),this.#e(t,i,s,a,e,n,r,o,3*(3*(n-r)-e+o),6*(e-2*n+r),3*(n-e),l),l}}let _t=null,xt=null;function Ct(t){return _t||(_t=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,xt=new Map([["\ufb05","\u017ft"]])),t.replaceAll(_t,((t,e,i)=>e?e.normalize("NFKC"):xt.get(i)))}const St="pdfjs_internal_id_",Tt=0,Mt=1,Pt=2,kt=3,Lt=4,Rt=5,It=6,Ft=7,Dt=8;class Nt{constructor(){this.constructor===Nt&&rt("Cannot initialize BaseFilterFactory.")}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(){}}class Ot{#i=!1;constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.constructor===Ot&&rt("Cannot initialize BaseCanvasFactory."),this.#i=t}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:!this.#i})}}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){rt("Abstract method `_createCanvas` called.")}}class Ht{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===Ht&&rt("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?Z.BINARY:Z.NONE;return this._fetchData(i,n).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}_fetchData(t,e){rt("Abstract method `_fetchData` called.")}}class Bt{constructor(t){let{baseUrl:e=null}=t;this.constructor===Bt&&rt("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetchData(i).catch((t=>{throw new Error(`Unable to load font data at: ${i}`)}))}_fetchData(t){rt("Abstract method `_fetchData` called.")}}class zt{constructor(){this.constructor===zt&&rt("Cannot initialize BaseSVGFactory.")}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",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){rt("Abstract method `_createSVG` called.")}}const jt="http://www.w3.org/2000/svg";class Ut{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=(()=>this.CSS/this.PDF)()}async function Vt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(te(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)}))}class Gt extends Ht{_fetchData(t,e){return Vt(t,this.isCompressed?"arraybuffer":"text").then((t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):bt(t),compressionType:e})))}}class $t extends Bt{_fetchData(t){return Vt(t,"arraybuffer").then((t=>new Uint8Array(t)))}}class Wt extends zt{_createSVG(t){return document.createElementNS(jt,t)}}class qt{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=r;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let h,c,d,u,p,g,f,m;switch(n%=360,n<0&&(n+=360),n){case 180:h=-1,c=0,d=0,u=1;break;case 90:h=0,c=1,d=1,u=0;break;case 270:h=0,c=-1,d=-1,u=0;break;case 0:h=1,c=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,u=-u),0===h?(p=Math.abs(l-e[1])*i+s,g=Math.abs(o-e[0])*i+r,f=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,g=Math.abs(l-e[1])*i+r,f=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[h*i,c*i,d*i,u*i,p-h*i*o-d*i*l,g-c*i*o-u*i*l],this.width=f,this.height=m}get rawDims(){const{viewBox:t}=this;return lt(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 qt({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return Et.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=Et.applyTransform([t[0],t[1]],this.transform),i=Et.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return Et.applyInverseTransform([t,e],this.transform)}}class Xt extends ht{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 Yt(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function Zt(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function Jt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(Kt(t))return st('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class Qt{started=(()=>Object.create(null))();times=[];time(t){t in this.started&&st(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||st(`Timer has not been started for ${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(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function te(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function ee(t){t.preventDefault()}function ie(t){console.log("Deprecated API usage: "+t)}let ne;class se{static toDateObject(t){if(!t||"string"!==typeof t)return null;ne||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=ne.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 l=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===l?(r+=h,a+=c):"+"===l&&(r-=h,a-=c),new Date(Date.UTC(i,n,s,r,a,o))}}function re(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 qt({viewBox:a,scale:i,rotation:n})}function ae(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):(st(`Not a valid color format: "${t}"`),[0,0,0])}function oe(t){const{a:e,b:i,c:n,d:s,e:r,f:a}=t.getTransform();return[e,i,n,s,r,a]}function le(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 he(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 qt){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:r}=t,a=wt.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${s}px`,h=a?`round(${o}, 1px)`:`calc(${o})`,c=a?`round(${l}, 1px)`:`calc(${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 ce{#n=null;#s=null;#r;#a=null;constructor(t){this.#r=t}render(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const e=this.#r._uiManager._signal;t.addEventListener("contextmenu",ee,{signal:e}),t.addEventListener("pointerdown",ce.#o,{signal:e});const i=this.#a=document.createElement("div");i.className="buttons",t.append(i);const n=this.#r.toolbarPosition;if(n){const{style:e}=t,i="ltr"===this.#r._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#l(),t}static#o(t){t.stopPropagation()}#h(t){this.#r._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#c(t){this.#r._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#d(t){const e=this.#r._uiManager._signal;t.addEventListener("focusin",this.#h.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#c.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ee,{signal:e})}hide(){this.#n.classList.add("hidden"),this.#s?.hideDropdown()}show(){this.#n.classList.remove("hidden")}#l(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#r.editorType}-button`),this.#d(t),t.addEventListener("click",(t=>{this.#r._uiManager.delete()}),{signal:this.#r._uiManager._signal}),this.#a.append(t)}get#u(){const t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#d(t),this.#a.prepend(t,this.#u)}addColorPicker(t){this.#s=t;const e=t.renderButton();this.#d(e),this.#a.prepend(e,this.#u)}remove(){this.#n.remove(),this.#s?.destroy(),this.#s=null}}class de{#a=null;#n=null;#p;constructor(t){this.#p=t}#g(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ee,{signal:this.#p._signal});const e=this.#a=document.createElement("div");return e.className="buttons",t.append(e),this.#f(),t}#m(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]}show(t,e,i){const[n,s]=this.#m(e,i),{style:r}=this.#n||=this.#g();t.append(this.#n),r.insetInlineEnd=100*n+"%",r.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#n.remove()}#f(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#p._signal;t.addEventListener("contextmenu",ee,{signal:i}),t.addEventListener("click",(()=>{this.#p.highlightSelection("floating_button")}),{signal:i}),this.#a.append(t)}}function ue(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}class pe{#v=0;get id(){return"pdfjs_internal_editor_"+this.#v++}}class ge{#b=(()=>function(){if("undefined"!==typeof crypto&&"function"===typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return vt(t)}())();#v=0;#y=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 lt(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#w(t,e){this.#y||=new Map;let i=this.#y.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#b}_${this.#v++}`,refCounter:0,isSvg:!1},"string"===typeof e?(i.url=e,t=await Vt(e,"blob")):t=i.file=e,"image/svg+xml"===t.type){const e=ge._isSVGFittingCanvas,n=new FileReader,s=new Image,r=new Promise(((t,r)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=n.onerror=r}));n.readAsDataURL(t),await r}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(n){console.error(n),i=null}return this.#y.set(t,i),i&&this.#y.set(i.id,i),i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return this.#w(`${e}_${i}_${n}_${s}`,t)}async getFromUrl(t){return this.#w(t,t)}async getFromId(t){this.#y||=new Map;const e=this.#y.get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=this.#y.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#y||=new Map;const e=this.#y.get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#b}_`)}}class fe{#A=[];#E=!1;#_;#x=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;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(),this.#E)return;const l={cmd:e,undo:i,post:n,type:r};if(-1===this.#x)return this.#A.length>0&&(this.#A.length=0),this.#x=0,void this.#A.push(l);if(a&&this.#A[this.#x].type===r)return o&&(l.undo=this.#A[this.#x].undo),void(this.#A[this.#x]=l);const h=this.#x+1;h===this.#_?this.#A.splice(0,1):(this.#x=h,h<this.#A.length&&this.#A.splice(h)),this.#A.push(l)}undo(){if(-1===this.#x)return;this.#E=!0;const{undo:t,post:e}=this.#A[this.#x];t(),e?.(),this.#E=!1,this.#x-=1}redo(){if(this.#x<this.#A.length-1){this.#x+=1,this.#E=!0;const{cmd:t,post:e}=this.#A[this.#x];t(),e?.(),this.#E=!1}}hasSomethingToUndo(){return-1!==this.#x}hasSomethingToRedo(){return this.#x<this.#A.length-1}destroy(){this.#A=null}}class me{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=wt.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)))}}#C(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}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(this.#C(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||(e.stopPropagation(),e.preventDefault()))}}class ve{static _colorsMapping=(()=>new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]))();get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ae(n))}e.remove()}(t),lt(this,"_colors",t)}convert(t){const e=ae(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 ve._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?Et.makeHexColor(...e):t}}class be{#S=(()=>new AbortController)();#T=null;#M=(()=>new Map)();#P=(()=>new Map)();#k=null;#L=null;#R=null;#I=(()=>new fe)();#F=0;#D=(()=>new Set)();#N=null;#O=null;#H=(()=>new Set)();#B=!1;#z=null;#j=null;#U=null;#V=!1;#G=null;#$=(()=>new pe)();#W=!1;#q=!1;#X=null;#K=null;#Y=null;#Z=(()=>v.NONE)();#J=(()=>new Set)();#Q=null;#tt=null;#et=null;#it=this.blur.bind(this);#nt=this.focus.bind(this);#st=this.copy.bind(this);#rt=this.cut.bind(this);#at=this.paste.bind(this);#ot=this.keydown.bind(this);#lt=this.keyup.bind(this);#ht=this.onEditingAction.bind(this);#ct=this.onPageChanging.bind(this);#dt=this.onScaleChanging.bind(this);#ut=this.onRotationChanging.bind(this);#pt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#gt=[0,0];#ft=null;#mt=null;#vt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=be.prototype,e=t=>t.#mt.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 lt(this,"_keyboardManager",new me([[["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)&&t.#mt.contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&t.#mt.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,a,o,l){this._signal=this.#S.signal,this.#mt=t,this.#vt=e,this.#k=i,this._eventBus=n,this._eventBus._on("editingaction",this.#ht),this._eventBus._on("pagechanging",this.#ct),this._eventBus._on("scalechanging",this.#dt),this._eventBus._on("rotationchanging",this.#ut),this.#bt(),this.#yt(),this.#wt(),this.#L=s.annotationStorage,this.#z=s.filterFactory,this.#tt=r,this.#U=a||null,this.#B=o,this.#Y=l||null,this.viewParameters={realScale:Ut.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#S?.abort(),this.#S=null,this._signal=null,this._eventBus._off("editingaction",this.#ht),this._eventBus._off("pagechanging",this.#ct),this._eventBus._off("scalechanging",this.#dt),this._eventBus._off("rotationchanging",this.#ut);for(const t of this.#P.values())t.destroy();this.#P.clear(),this.#M.clear(),this.#H.clear(),this.#T=null,this.#J.clear(),this.#I.destroy(),this.#k?.destroy(),this.#G?.hide(),this.#G=null,this.#j&&(clearTimeout(this.#j),this.#j=null),this.#ft&&(clearTimeout(this.#ft),this.#ft=null)}async mlGuess(t){return this.#Y?.guess(t)||null}get hasMLManager(){return!!this.#Y}get hcmFilter(){return lt(this,"hcmFilter",this.#tt?this.#z.addHCMFilter(this.#tt.foreground,this.#tt.background):"none")}get direction(){return lt(this,"direction",getComputedStyle(this.#mt).direction)}get highlightColors(){return lt(this,"highlightColors",this.#U?new Map(this.#U.split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return lt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){this.#K=t}editAltText(t){this.#k?.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;this.#F=e-1}focusMainContainer(){this.#mt.focus()}findParent(t,e){for(const i of this.#P.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];this.#vt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#H.add(t)}removeShouldRescale(t){this.#H.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*Ut.PDF_TO_CSS_UNITS;for(const i of this.#H)i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}#At(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=e,a=e.toString(),o=this.#At(e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(l){e.empty(),this.#Z===v.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:v.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of this.#P.values())if(e.hasTextLayer(o)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r,text:a});break}}}#Et(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#At(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#G||=new de(this),this.#G.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#L||this.#L.has(t.id)||this.#L.setValue(t.id,t)}#_t(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#Q&&(this.#G?.hide(),this.#Q=null,this.#xt({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#Q)return;if(this.#At(t).closest(".textLayer")){if(this.#G?.hide(),this.#Q=e,this.#xt({hasSelectedText:!0}),(this.#Z===v.HIGHLIGHT||this.#Z===v.NONE)&&(this.#Z===v.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#V=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&this.#Ct("main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else this.#Q&&(this.#G?.hide(),this.#Q=null,this.#xt({hasSelectedText:!1}))}#Ct(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.#Z===v.HIGHLIGHT?this.highlightSelection(t):this.#B&&this.#Et()}#bt(){document.addEventListener("selectionchange",this.#_t.bind(this),{signal:this._signal})}#St(){const t=this._signal;window.addEventListener("focus",this.#nt,{signal:t}),window.addEventListener("blur",this.#it,{signal:t})}#Tt(){window.removeEventListener("focus",this.#nt),window.removeEventListener("blur",this.#it)}blur(){if(this.isShiftKeyDown=!1,this.#V&&(this.#V=!1,this.#Ct("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#J)if(e.div.contains(t)){this.#X=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#X)return;const[t,e]=this.#X;this.#X=null,e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}#wt(){const t=this._signal;window.addEventListener("keydown",this.#ot,{signal:t}),window.addEventListener("keyup",this.#lt,{signal:t})}#Mt(){window.removeEventListener("keydown",this.#ot),window.removeEventListener("keyup",this.#lt)}#Pt(){const t=this._signal;document.addEventListener("copy",this.#st,{signal:t}),document.addEventListener("cut",this.#rt,{signal:t}),document.addEventListener("paste",this.#at,{signal:t})}#kt(){document.removeEventListener("copy",this.#st),document.removeEventListener("cut",this.#rt),document.removeEventListener("paste",this.#at)}#yt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#wt(),this.#Pt()}removeEditListeners(){this.#Mt(),this.#kt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#O)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 this.#O)if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#T?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of this.#J){const t=i.serialize(!0);t&&e.push(t)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const t of this.#O)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 st(`paste: "${s.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const r of i){const e=n.deserialize(r);if(!e)return;t.push(e)}const e=()=>{for(const e of t)this.#Lt(e);this.#Rt(t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){st(`paste: "${s.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#Z===v.NONE||this.isEditorHandlingKeyboard||be._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#V&&(this.#V=!1,this.#Ct("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")}}#xt(t){Object.entries(t).some((t=>{let[e,i]=t;return this.#pt[e]!==i}))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#pt,t)}),this.#Z===v.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#It([[b.HIGHLIGHT_FREE,!0]]))}#It(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#St(),this.#Pt(),this.#xt({isEditing:this.#Z!==v.NONE,isEmpty:this.#Ft(),hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:this.#I.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Tt(),this.#kt(),this.#xt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#O){this.#O=t;for(const t of this.#O)this.#It(t.defaultPropertiesToUpdate)}}getId(){return this.#$.id}get currentLayer(){return this.#P.get(this.#F)}getLayer(t){return this.#P.get(t)}get currentPageIndex(){return this.#F}addLayer(t){this.#P.set(t.pageIndex,t),this.#W?t.enable():t.disable()}removeLayer(t){this.#P.delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.#Z!==t){if(this.#Z=t,t===v.NONE)return this.setEditingState(!1),void this.#Dt();this.setEditingState(!0),this.#Nt(),this.unselectAll();for(const e of this.#P.values())e.updateMode(t);if(e||!i){if(e)for(const t of this.#M.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#Z&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#O){switch(t){case b.CREATE:return void this.currentLayer.addNewEditor();case b.HIGHLIGHT_DEFAULT_COLOR:this.#K?.updateColor(e);break;case b.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#et||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(const i of this.#J)i.updateParams(t,e);for(const i of this.#O)i.updateDefaultParams(t,e)}}showAllEditors(t,e){for(const i of this.#M.values())i.editorType===t&&i.show(e);(this.#et?.get(b.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#It([[b.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#q!==t){this.#q=t;for(const e of this.#P.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}#Nt(){if(!this.#W){this.#W=!0;for(const t of this.#P.values())t.enable();for(const t of this.#M.values())t.enable()}}#Dt(){if(this.unselectAll(),this.#W){this.#W=!1;for(const t of this.#P.values())t.disable();for(const t of this.#M.values())t.disable()}}getEditors(t){const e=[];for(const i of this.#M.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#M.get(t)}addEditor(t){this.#M.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#j&&clearTimeout(this.#j),this.#j=setTimeout((()=>{this.focusMainContainer(),this.#j=null}),0)),this.#M.delete(t.id),this.unselect(t),t.annotationElementId&&this.#D.has(t.annotationElementId)||this.#L?.remove(t.id)}addDeletedAnnotationElement(t){this.#D.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#D.has(t)}removeDeletedAnnotationElement(t){this.#D.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Lt(t){const e=this.#P.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#T!==t&&(this.#T=t,t&&this.#It(t.propertiesToUpdate))}get#Ot(){let t=null;for(t of this.#J);return t}updateUI(t){this.#Ot===t&&this.#It(t.propertiesToUpdate)}toggleSelected(t){if(this.#J.has(t))return this.#J.delete(t),t.unselect(),void this.#xt({hasSelectedEditor:this.hasSelection});this.#J.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#xt({hasSelectedEditor:!0})}setSelected(t){for(const e of this.#J)e!==t&&e.unselect();this.#J.clear(),this.#J.add(t),t.select(),this.#It(t.propertiesToUpdate),this.#xt({hasSelectedEditor:!0})}isSelected(t){return this.#J.has(t)}get firstSelectedEditor(){return this.#J.values().next().value}unselect(t){t.unselect(),this.#J.delete(t),this.#xt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#J.size}get isEnterHandled(){return 1===this.#J.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#I.undo(),this.#xt({hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Ft()})}redo(){this.#I.redo(),this.#xt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#I.hasSomethingToRedo(),isEmpty:this.#Ft()})}addCommands(t){this.#I.add(t),this.#xt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Ft()})}#Ft(){if(0===this.#M.size)return!0;if(1===this.#M.size)for(const t of this.#M.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...this.#J];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Lt(e)},mustExec:!0})}commitOrRemove(){this.#T?.commitOrRemove()}hasSomethingToControl(){return this.#T||this.hasSelection}#Rt(t){for(const e of this.#J)e.unselect();this.#J.clear();for(const e of t)e.isEmpty()||(this.#J.add(e),e.select());this.#xt({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#J)t.commit();this.#Rt(this.#M.values())}unselectAll(){if((!this.#T||(this.#T.commitOrRemove(),this.#Z===v.NONE))&&this.hasSelection){for(const t of this.#J)t.unselect();this.#J.clear(),this.#xt({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;this.#gt[0]+=t,this.#gt[1]+=e;const[i,n]=this.#gt,s=[...this.#J];this.#ft&&clearTimeout(this.#ft),this.#ft=setTimeout((()=>{this.#ft=null,this.#gt[0]=this.#gt[1]=0,this.addCommands({cmd:()=>{for(const t of s)this.#M.has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)this.#M.has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})}),1e3);for(const r of s)r.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#N=new Map;for(const t of this.#J)this.#N.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#N)return!1;this.disableUserSelect(!1);const t=this.#N;this.#N=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||=n!==a.savedX||s!==a.savedY||r!==a.savedPageIndex;if(!e)return!1;const i=(t,e,i,n)=>{if(this.#M.has(t.id)){const s=this.#P.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(this.#N)for(const i of this.#N.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(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#J.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#T===t}getActive(){return this.#T}getMode(){return this.#Z}get imageManager(){return lt(this,"imageManager",new ge)}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;(this.#R||=new Map).set(e,i)}removeChangedExistingAnnotation(t){let{annotationElementId:e}=t;this.#R?.delete(e)}renderAnnotationElement(t){const e=this.#R?.get(t.data.id);if(!e)return;const i=this.#L.getRawValue(e);i&&(this.#Z!==v.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}}class ye{#Ht="";#Bt=!1;#zt=null;#jt=null;#Ut=null;#Vt=!1;#r=null;static _l10nPromise=null;constructor(t){this.#r=t}static initialize(t){ye._l10nPromise||=t}async render(){const t=this.#zt=document.createElement("button");t.className="altText";const e=await ye._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=this.#r._uiManager._signal;t.addEventListener("contextmenu",ee,{signal:i}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:i});const n=t=>{t.preventDefault(),this.#r._uiManager.editAltText(this.#r)};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(this.#Vt=!0,n(e))}),{signal:i}),await this.#Gt(),t}finish(){this.#zt&&(this.#zt.focus({focusVisible:this.#Vt}),this.#Vt=!1)}isEmpty(){return!this.#Ht&&!this.#Bt}get data(){return{altText:this.#Ht,decorative:this.#Bt}}set data(t){let{altText:e,decorative:i}=t;this.#Ht===e&&this.#Bt===i||(this.#Ht=e,this.#Bt=i,this.#Gt())}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#zt&&(!t&&this.#Ut&&(clearTimeout(this.#Ut),this.#Ut=null),this.#zt.disabled=!t)}destroy(){this.#zt?.remove(),this.#zt=null,this.#jt=null}async#Gt(){const t=this.#zt;if(!t)return;if(!this.#Ht&&!this.#Bt)return t.classList.remove("done"),void this.#jt?.remove();t.classList.add("done"),ye._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((e=>{t.setAttribute("aria-label",e)}));let e=this.#jt;if(!e){this.#jt=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");const i=e.id=`alt-text-tooltip-${this.#r.id}`;t.setAttribute("aria-describedby",i);const n=100,s=this.#r._uiManager._signal;s.addEventListener("abort",(()=>{clearTimeout(this.#Ut),this.#Ut=null}),{once:!0}),t.addEventListener("mouseenter",(()=>{this.#Ut=setTimeout((()=>{this.#Ut=null,this.#jt.classList.add("show"),this.#r._reportTelemetry({action:"alt_text_tooltip"})}),n)}),{signal:s}),t.addEventListener("mouseleave",(()=>{this.#Ut&&(clearTimeout(this.#Ut),this.#Ut=null),this.#jt?.classList.remove("show")}),{signal:s})}e.innerText=this.#Bt?await ye._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#Ht,e.parentNode||t.append(e);const i=this.#r.getImageForAltText();i?.setAttribute("aria-describedby",e.id)}}class we{#$t=null;#Wt=null;#Ht=null;#qt=!1;#Xt=!1;#Kt=null;#Yt=null;#Zt=this.focusin.bind(this);#Jt=this.focusout.bind(this);#Qt=null;#te="";#ee=!1;#ie=null;#ne=!1;#se=!1;#re=!1;#ae=null;#oe=0;#le=0;#he=null;_initialOptions=(()=>Object.create(null))();_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#ce=!1;#de=(()=>we._zIndex++)();static _borderLineWidth=-1;static _colorManager=(()=>new ve)();static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=we.prototype._resizeWithKeyboard,e=be.TRANSLATE_SMALL,i=be.TRANSLATE_BIG;return lt(this,"_resizerKeyboardManager",new me([[["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"],we.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===we&&rt("Cannot initialize AnnotationEditor."),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;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[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return lt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Ae({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,i){if(we._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((e=>[e,t.get(e.replaceAll(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)))]))),i?.strings)for(const s of i.strings)we._l10nPromise.set(s,t.get(s));if(-1!==we._borderLineWidth)return;const n=getComputedStyle(document.documentElement);we._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){rt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ce}set _isDraggable(t){this.#ce=t,this.div?.classList.toggle("draggable",t)}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=this.#de}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#ue(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ee?this.#ee=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){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()}#pe(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}translate(t,e){this.#pe(this.parentDimensions,t,e)}translateInPage(t,e){this.#ie||=[this.x,this.y],this.#pe(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#ie||=[this.x,this.y];const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,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:s,y:r}=this;const[a,o]=this.getBaseTranslation();s+=a,r+=o,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*r).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#ie&&(this.#ie[0]!==this.x||this.#ie[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=we,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[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:h}=this.div;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#ge(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return we.#ge(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return we.#ge(t,e,360-this.parentRotation)}#fe(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]}}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,n=e*t,s=i*t;return wt.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#Xt||(this.div.style.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!this.#Xt&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/r).toFixed(2)}%`),this.#Xt||s||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#me(){if(this.#Kt)return;this.#Kt=document.createElement("div"),this.#Kt.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");this.#Kt.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#ve.bind(this,i),{signal:e}),t.addEventListener("contextmenu",ee,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#Kt)}#ve(t,e){e.preventDefault();const{isMac:i}=wt.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#Ht?.toggle(!1);const n=this.#be.bind(this,t),s=this._isDraggable;this._isDraggable=!1;const r=this._uiManager._signal,a={passive:!0,capture:!0,signal:r};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",n,a),window.addEventListener("contextmenu",ee,{signal:r});const o=this.x,l=this.y,h=this.width,c=this.height,d=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const p=()=>{this.parent.togglePointerEvents(!0),this.#Ht?.toggle(!0),this._isDraggable=s,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",n,a),window.removeEventListener("contextmenu",ee),this.parent.div.style.cursor=d,this.div.style.cursor=u,this.#ye(o,l,h,c)};window.addEventListener("pointerup",p,{signal:r}),window.addEventListener("blur",p,{signal:r})}#ye(t,e,i,n){const s=this.x,r=this.y,a=this.width,o=this.height;s===t&&r===e&&a===i&&o===n||this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=r;const[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,r]=this.parentDimensions;this.setDims(s*i,r*n),this.fixAndSetPosition()},mustExec:!0})}#be(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,o=this.height,l=we.MIN_SIZE/i,h=we.MIN_SIZE/n,c=t=>Math.round(1e4*t)/1e4,d=this.#fe(this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=this.#fe(360-this.rotation);let g,f,m=!1,v=!1;switch(t){case"topLeft":m=!0,g=(t,e)=>[0,0],f=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],f=(t,e)=>[t/2,e];break;case"topRight":m=!0,g=(t,e)=>[t,0],f=(t,e)=>[0,e];break;case"middleRight":v=!0,g=(t,e)=>[t,e/2],f=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,g=(t,e)=>[t,e],f=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],f=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,g=(t,e)=>[0,e],f=(t,e)=>[t,0];break;case"middleLeft":v=!0,g=(t,e)=>[0,e/2],f=(t,e)=>[t,e/2]}const b=g(a,o),y=f(a,o);let w=u(...y);const A=c(s+w[0]),E=c(r+w[1]);let _=1,x=1,[C,S]=this.screenToPageTranslation(e.movementX,e.movementY);var T,M;if([C,S]=(T=C/i,M=S/n,[p[0]*T+p[2]*M,p[1]*T+p[3]*M]),m){const t=Math.hypot(a,o);_=x=Math.max(Math.min(Math.hypot(y[0]-b[0]-C,y[1]-b[1]-S)/t,1/a,1/o),l/a,h/o)}else v?_=Math.max(l,Math.min(1,Math.abs(y[0]-b[0]-C)))/a:x=Math.max(h,Math.min(1,Math.abs(y[1]-b[1]-S)))/o;const P=c(a*_),k=c(o*x);w=u(...f(P,k));const L=A-w[0],R=E-w[1];this.width=P,this.height=k,this.x=L,this.y=R,this.setDims(i*P,n*k),this.fixAndSetPosition()}altTextFinish(){this.#Ht?.finish()}async addEditToolbar(){return this.#Qt||this.#se||(this.#Qt=new ce(this),this.div.append(this.#Qt.render()),this.#Ht&&this.#Qt.addAltTextButton(await this.#Ht.render())),this.#Qt}removeEditToolbar(){this.#Qt&&(this.#Qt.remove(),this.#Qt=null,this.#Ht?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#Ht||(ye.initialize(we._l10nPromise),this.#Ht=new ye(this),this.#$t&&(this.#Ht.data=this.#$t,this.#$t=null),await this.addEditToolbar())}get altTextData(){return this.#Ht?.data}set altTextData(t){this.#Ht&&(this.#Ht.data=t)}hasAltText(){return!this.#Ht?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#qt?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",this.#Zt,{signal:t}),this.div.addEventListener("focusout",this.#Jt,{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[n,s]=this.getInitialTranslation();return this.translate(n,s),ue(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=wt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#ee=!0,this._isDraggable?this.#we(t):this.#Ae(t))}#Ae(t){const{isMac:e}=wt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#we(t){const e=this._uiManager.isSelected(this);let i,n;this._uiManager.setUpDragSession();const s=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:s},this.#oe=t.clientX,this.#le=t.clientY,n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-this.#oe,i-this.#le);this.#oe=e,this.#le=i,this._uiManager.dragSelectedEditors(n,s)},window.addEventListener("pointermove",n,i));const r=()=>{window.removeEventListener("pointerup",r),window.removeEventListener("blur",r),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),this.#ee=!1,this._uiManager.endDragSession()||this.#Ae(t)};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}moveInDOM(){this.#ae&&clearTimeout(this.#ae),this.#ae=setTimeout((()=>{this.#ae=null,this.parent?.moveEditorInDOM(this)}),0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}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")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#se=!0}disableEditMode(){this.#se=!1}isInEditMode(){return this.#se}shouldGetKeyboardEvents(){return this.#re}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){const t=this._uiManager._signal;this.div?.addEventListener("focusin",this.#Zt,{signal:t}),this.div?.addEventListener("focusout",this.#Jt,{signal:t})}rotate(t){}serialize(){rt("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,n.#$t=t.accessibilityData;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(){if(this.div.removeEventListener("focusin",this.#Zt),this.div.removeEventListener("focusout",this.#Jt),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#ae&&(clearTimeout(this.#ae),this.#ae=null),this.#ue(),this.removeEditToolbar(),this.#he){for(const t of this.#he.values())clearTimeout(t);this.#he=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#me(),this.#Kt.classList.remove("hidden"),ue(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#Yt={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Kt.children;if(!this.#Wt){this.#Wt=Array.from(e);const t=this.#Ee.bind(this),i=this.#_e.bind(this),n=this._uiManager._signal;for(const e of this.#Wt){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",this.#xe.bind(this,s),{signal:n}),we._l10nPromise.get(`pdfjs-editor-resizer-label-${s}`).then((t=>e.setAttribute("aria-label",t)))}}const i=this.#Wt[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#Wt.length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)this.#Kt.append(this.#Kt.firstChild);else if(s>n)for(let e=0;e<s-n;e++)this.#Kt.firstChild.before(this.#Kt.lastChild);let t=0;for(const i of e){const e=this.#Wt[t++].getAttribute("data-resizer-name");we._l10nPromise.get(`pdfjs-editor-resizer-label-${e}`).then((t=>i.setAttribute("aria-label",t)))}}this.#Ce(0),this.#re=!0,this.#Kt.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#Ee(t){we._resizerKeyboardManager.exec(this,t)}#_e(t){this.#re&&t.relatedTarget?.parentNode!==this.#Kt&&this.#ue()}#xe(t){this.#te=this.#re?t:""}#Ce(t){if(this.#Wt)for(const e of this.#Wt)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#re&&this.#be(this.#te,{movementX:t,movementY:e})}#ue(){if(this.#re=!1,this.#Ce(-1),this.#Yt){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#Yt;this.#ye(t,e,i,n),this.#Yt=null}}_stopResizingWithKeyboard(){this.#ue(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this.#Qt?this.#Qt?.show():this.addEditToolbar().then((()=>{this.div?.classList.contains("selectedEditor")&&this.#Qt?.show()}))}unselect(){this.#Kt?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#Qt?.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#ne}set isEditing(t){this.#ne=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#Xt=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}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]){this.#he||=new Map;const{action:e}=t;let i=this.#he.get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),this.#he.delete(e),0===this.#he.size&&(this.#he=null)}),we._telemetryTimeout),void this.#he.set(e,i)}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),this.#qt=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#qt=!0}renderAnnotationElement(t){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"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class Ae extends we{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const Ee=3285377520,_e=4294901760,xe=65535;class Ce{constructor(t){this.h1=t?4294967295&t:Ee,this.h2=t?4294967295&t:Ee}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&_e|a*u&xe,a=a<<15|a>>>17,a=a*d&_e|a*p&xe,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=r[g],o=o*c&_e|o*u&xe,o=o<<15|o>>>17,o=o*d&_e|o*p&xe,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&_e|a*u&xe,a=a<<15|a>>>17,a=a*d&_e|a*p&xe,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&_e|36045*t&xe,e=4283543511*e&_e|(2950163797*(e<<16|t>>>16)&_e)>>>16,t^=e>>>1,t=444984403*t&_e|60499*t&xe,e=3301882366*e&_e|(3120437893*(e<<16|t>>>16)&_e)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Se=Object.freeze({map:null,hash:"",transfer:void 0});class Te{#Se=!1;#Te=(()=>new Map)();constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#Te.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Te.get(t)}remove(t){if(this.#Te.delete(t),0===this.#Te.size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of this.#Te.values())if(t instanceof we)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#Te.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,this.#Te.set(t,e);n&&this.#Me(),e instanceof we&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#Te.has(t)}getAll(){return this.#Te.size>0?yt(this.#Te):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#Te.size}#Me(){this.#Se||(this.#Se=!0,"function"===typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Se&&(this.#Se=!1,"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new Me(this)}get serializable(){if(0===this.#Te.size)return Se;const t=new Map,e=new Ce,i=[],n=Object.create(null);let s=!1;for(const[r,a]of this.#Te){const i=a instanceof we?a.serialize(!1,n):a;i&&(t.set(r,i),e.update(`${r}:${JSON.stringify(i)}`),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}:Se}get editorStats(){let t=null;const e=new Map;for(const i of this.#Te.values()){if(!(i instanceof we))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const r=t[s]||=new Map;for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=r.get(t);i||(i=new Map,r.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}}class Me extends Te{#Pe;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);this.#Pe={map:s,hash:i,transfer:n}}get print(){rt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Pe}}class Pe{#ke=(()=>new Set)();constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;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(),this.#ke.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!this.#ke.has(e.loadedName))if(at(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:s}=e,r=new FontFace(t,n,s);this.addNativeFontFace(r);try{await r.load(),this.#ke.add(t),i?.(e)}catch{st(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else rt("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 st(`Failed to load font '${e.family}': '${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(){return lt(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return(r||"undefined"!==typeof navigator&&"string"===typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),lt(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(at(!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 lt(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${Date.now()}${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=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(g);const f=this._document.createElement("div");f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px";for(const m of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,f.append(t)}this._document.body.append(f),function t(e,i){if(++l>30)return st("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,(()=>{f.remove(),e.complete()}))}}class ke{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=vt(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),i}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){st(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let r=0,a=i.length;r<a;)switch(i[r++]){case Tt:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push((i=>i.bezierCurveTo(t,e,s,a,o,l))),r+=6}break;case Mt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.moveTo(t,e))),r+=2}break;case Pt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.lineTo(t,e))),r+=2}break;case kt:{const[t,e,s,a]=i.slice(r,r+4);n.push((i=>i.quadraticCurveTo(t,e,s,a))),r+=4}break;case Lt:n.push((t=>t.restore()));break;case Rt:n.push((t=>t.save()));break;case It:at(2===n.length,"Scale command is only valid at the third position.");break;case Ft:{const[t,e,s,a,o,l]=i.slice(r,r+6);n.push((i=>i.transform(t,e,s,a,o,l))),r+=6}break;case Dt:{const[t,e]=i.slice(r,r+2);n.push((i=>i.translate(t,e))),r+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i<s;i++)n[i](t)}}}if(r){var Le=Promise.withResolvers(),Re=null;(async()=>{const t=await i.e(673).then(i.t.bind(i,21673,19)),e=await i.e(688).then(i.t.bind(i,42688,19)),n=await i.e(123).then(i.t.bind(i,40504,19)),s=await i.e(395).then(i.t.bind(i,79395,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then((t=>{Re=t,Le.resolve()}),(t=>{st(`loadPackages: ${t}`),Re=new Map,Le.resolve()}))}class Ie{static get promise(){return Le.promise}static get(t){return Re?.get(t)}}const Fe=function(t){return Ie.get("fs").promises.readFile(t).then((t=>new Uint8Array(t)))};const De="Fill",Ne="Stroke",Oe="Shading";function He(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 Be{constructor(){this.constructor===Be&&rt("Cannot initialize BaseShadingPattern.")}getPattern(){rt("Abstract method `getPattern` called.")}}class ze extends Be{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===Ne||n===De){const r=e.current.getClippedPathBoundingBox(n,oe(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,!0),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=Et.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),He(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 He(t,this._bbox),s=this._createGradient(t);return s}}function je(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,b=(l[s+1]+e.offsetY)*e.scaleY;if(g>=b)return;const y=h[r],w=h[r+1],A=h[r+2],E=h[a],_=h[a+1],x=h[a+2],C=h[o],S=h[o+1],T=h[o+2],M=Math.round(g),P=Math.round(b);let k,L,R,I,F,D,N,O;for(let H=M;H<=P;H++){if(H<m){const t=H<g?0:(g-H)/(g-m);k=p-(p-f)*t,L=y-(y-E)*t,R=w-(w-_)*t,I=A-(A-x)*t}else{let t;t=H>b?1:m===b?0:(m-H)/(m-b),k=f-(f-v)*t,L=E-(E-C)*t,R=_-(_-S)*t,I=x-(x-T)*t}let t;t=H<g?0:H>b?1:(g-H)/(g-b),F=p-(p-v)*t,D=y-(y-C)*t,N=w-(w-S)*t,O=A-(A-T)*t;const e=Math.round(Math.min(k,F)),i=Math.round(Math.max(k,F));let n=d*H+4*e;for(let s=e;s<=i;s++)t=(k-s)/(k-F),t<0?t=0:t>1&&(t=1),c[n++]=L-(L-D)*t|0,c[n++]=R-(R-N)*t|0,c[n++]=I-(I-O)*t|0,c[n++]=255}}function Ue(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++)je(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),je(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)je(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 Ve extends Be{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],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,!1),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)Ue(m,v,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}getPattern(t,e,i,n){let s;if(He(t,this._bbox),n===Oe)s=Et.singularValueDecompose2dScale(oe(t));else if(s=Et.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=Et.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const r=this._createMeshCanvas(s,n===Oe?null:this._background,e.cachedCanvases);return n!==Oe&&(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 Ge extends Be{getPattern(){return"hotpink"}}const $e=1,We=2;class qe{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,n,s){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.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,r=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;nt("TilingType: "+a);const h=i[0],c=i[1],d=i[2],u=i[3],p=Et.singularValueDecompose2dScale(this.matrix),g=Et.singularValueDecompose2dScale(this.baseTransform),f=[p[0]*g[0],p[1]*g[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,f[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,f[1]),b=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),y=b.context,w=l.createCanvasGraphics(y);w.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(w,r,o);let A=h,E=c,_=d,x=u;return h<0&&(A=0,_+=Math.abs(h)),c<0&&(E=0,x+=Math.abs(c)),y.translate(-m.scale*A,-v.scale*E),w.transform(m.scale,0,0,v.scale,0,0),y.save(),this.clipBbox(w,A,E,_,x),w.baseTransform=oe(w.ctx),w.executeOperatorList(e),w.endDrawing(),{canvas:b.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:E}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(qe.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),t.current.updateRectMinMax(oe(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case $e:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case We:const r=Et.makeHexColor(i[0],i[1],i[2]);n.fillStyle=r,n.strokeStyle=r,s.fillColor=r,s.strokeColor=r;break;default:throw new ft(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let s=i;n!==Oe&&(s=Et.transform(s,e.baseTransform),this.matrix&&(s=Et.transform(s,this.matrix)));const r=this.createPatternCanvas(e);let a=new DOMMatrix(s);a=a.translate(r.offsetX,r.offsetY),a=a.scale(1/r.scaleX,1/r.scaleY);const o=t.createPattern(r.canvas,"repeat");return o.setTransform(a),o}}function Xe(t){let{src:e,srcPos:i=0,dest:n,width:s,height:r,nonBlackColor:a=4294967295,inverseDecode:o=!1}=t;const l=wt.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}}const Ke=16;class Ye{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 Ze(t,e,i,n,s,r,a,o,l,h){const[c,d,u,p,g,f]=oe(t);if(0===d&&0===u){const m=a*c+g,v=Math.round(m),b=o*p+f,y=Math.round(b),w=(a+l)*c+g,A=Math.abs(Math.round(w)-v)||1,E=(o+h)*p+f,_=Math.abs(Math.round(E)-y)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,y),t.drawImage(e,i,n,s,r,0,0,A,_),t.setTransform(c,d,u,p,g,f),[A,_]}if(0===c&&0===p){const m=o*u+g,v=Math.round(m),b=a*d+f,y=Math.round(b),w=(o+h)*u+g,A=Math.abs(Math.round(w)-v)||1,E=(a+l)*d+f,_=Math.abs(Math.round(E)-y)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,y),t.drawImage(e,i,n,s,r,0,0,_,A),t.setTransform(c,d,u,p,g,f),[_,A]}t.drawImage(e,i,n,s,r,a,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class Je{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=a,this.textMatrixScale=1,this.fontMatrix=o,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=w,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=Et.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=Et.applyTransform(e,t),n=Et.applyTransform(e.slice(2),t),s=Et.applyTransform([e[0],e[3]],t),r=Et.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){Et.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,o,l,h){const c=Et.bezierBoundingBox(e,i,n,s,r,a,o,l,h);h||this.updateRectMinMax(t,c)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Ne){e||rt("Stroke bounding box must include transform.");const t=Et.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=Et.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Et.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Qe(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Ke,r=(i-s)/Ke,a=0===s?r:r+1,o=t.createImageData(n,Ke);let l,h=0;const c=e.data,d=o.data;let u,p,g,f;if(e.kind===S.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),f=i.length,m=n+7>>3,v=4294967295,b=wt.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(g=u<r?Ke: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:b,i[l++]=64&d?v:b,i[l++]=32&d?v:b,i[l++]=16&d?v:b,i[l++]=8&d?v:b,i[l++]=4&d?v:b,i[l++]=2&d?v:b,i[l++]=1&d?v:b;for(;s<r;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:b,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*Ke)}}else if(e.kind===S.RGBA_32BPP){for(p=0,f=n*Ke*4,u=0;u<r;u++)d.set(c.subarray(h,h+f)),h+=f,t.putImageData(o,0,p),p+=Ke;u<a&&(f=n*s*4,d.set(c.subarray(h,h+f)),t.putImageData(o,0,p))}else{if(e.kind!==S.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(g=Ke,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*Ke)}}}function ti(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Ke,r=(i-s)/Ke,a=0===s?r:r+1,o=t.createImageData(n,Ke);let l=0;const h=e.data,c=o.data;for(let d=0;d<a;d++){const e=d<r?Ke:s;({srcPos:l}=Xe({src:h,srcPos:l,dest:c,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Ke)}}function ei(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 ii(t){if(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),!r){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function ni(t,e){if(e)return!0;const i=Et.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*Ut.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const si=["butt","round","square"],ri=["miter","round","bevel"],ai={},oi={};class li{constructor(t,e,i,n,s,r,a,o){let{optionalContentConfig:l,markedContentStack:h=null}=r;this.ctx=t,this.current=new Je(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.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=h||[],this.optionalContentConfig=l,this.cachedCanvases=new Ye(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}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(...oe(this.compositeCtx))}this.ctx.save(),ii(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=oe(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const o=s.length;if(o===a)return a;const l=o-a>10&&"function"===typeof i,h=l?Date.now()+15:0;let c=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==J.dependency)this[p].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++c>10){if(Date.now()>h)return i(),a;c=0}}}#Le(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Le(),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(),this.#Re()}#Re(){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}}}_scaleImage(t,e){const i=t.width,n=t.height;let s,r,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,h=n,c="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,i=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(i=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/i),s=this.cachedCanvases.getCanvas(c,e,i),r=s.context,r.clearRect(0,0,e,i),r.drawImage(t,0,0,l,h,0,0,e,i),t=s.canvas,l=e,h=i,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=oe(e);let o,l,h,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(r?a:[a.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!r){return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])}}h=i}h||(c=this.cachedCanvases.getCanvas("maskCanvas",i,n),ti(c.context,t));let d=Et.transform(a,[1/i,0,0,-1/n,0,0]);d=Et.transform(d,[1,0,0,1,0,-n]);const[u,p,g,f]=Et.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(g-u)||1,v=Math.round(f-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,v),y=b.context,w=u,A=p;y.translate(-w,-A),y.transform(...d),h||(h=this._scaleImage(c.canvas,le(y)),h=h.img,o&&r&&o.set(l,h)),y.imageSmoothingEnabled=ni(oe(y),t.interpolate),Ze(y,h,0,0,h.width,h.height,0,0,i,n),y.globalCompositeOperation="source-in";const E=Et.transform(le(y),[1,0,0,1,-w,-A]);return y.fillStyle=r?s.getPattern(e,this,E,De):s,y.fillRect(0,0,i,n),o&&!r&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(w),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=si[t]}setLineJoin(t){this.ctx.lineJoin=ri[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...oe(this.suspendedCtx)),ei(this.suspendedCtx,s),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()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),ei(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),r.some((t=>0!==t))&&(e.globalCompositeOperation="destination-atop",e.fillStyle=Et.makeHexColor(...r),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(r.some((t=>0!==t))){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=Et.makeHexColor(...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(){this.inSMaskMode?(ei(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ei(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let r,a,o=s.x,l=s.y;const h=oe(n),c=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],d=c?i.slice(0):null;for(let u=0,p=0,g=t.length;u<g;u++)switch(0|t[u]){case J.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,g=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,g):(n.lineTo(u,l),n.lineTo(u,g),n.lineTo(o,g)),c||s.updateRectMinMax(h,[o,l,u,g]),n.closePath();break;case J.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),c||s.updatePathMinMax(h,o,l);break;case J.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),c||s.updatePathMinMax(h,o,l);break;case J.curveTo:r=o,a=l,o=e[p+4],l=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,l),s.updateCurvePathMinMax(h,r,a,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case J.curveTo2:r=o,a=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(h,r,a,o,l,e[p],e[p+1],e[p+2],e[p+3],d),o=e[p+2],l=e[p+3],p+=4;break;case J.curveTo3:r=o,a=l,o=e[p+2],l=e[p+3],n.bezierCurveTo(e[p],e[p+1],o,l,o,l),s.updateCurvePathMinMax(h,r,a,e[p],e[p+1],o,l,o,l,d),p+=4;break;case J.closePath:n.closePath()}c&&s.updateScalingPathMinMax(h,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,le(e),Ne),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,le(e),De),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=ai}eoClip(){this.pendingClip=oi}beginText(){this.current.textMatrix=a,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||o,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||st("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const s=i.loadedName||"sans-serif",r=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const l=i.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${a} ${h}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,o=r.textRenderingMode,l=r.fontSize/r.fontSizeScale,h=o&x,c=!!(o&C),d=r.patternFill&&!a.missingFile;let u;if((a.disableFontFace||c||d)&&(u=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),h!==w&&h!==E||s.fill(),h!==A&&h!==E||s.stroke(),s.restore()):(h!==w&&h!==E||s.fillText(t,e,i),h!==A&&h!==E||s.strokeText(t,e,i)),c){(this.pendingTextPaths||=[]).push({transform:oe(s),x:e,y:i,fontSize:l,addToPath:u})}}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 lt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,c=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,g=n*e.fontMatrix[0],f=e.textRenderingMode===w&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(h,-1):s.scale(h,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,le(s),De);m=oe(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&x;t!==A&&t!==E||(v=this.getSinglePixelWidth())}else v/=b;if(1!==r&&(s.scale(r,r),v/=r),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*g*h,s.restore(),void this.compose()}let y,_=0;for(y=0;y<c;++y){const e=t[y];if("number"===typeof e){_+=u*e*n/1e3;continue}let h=!1;const c=(e.isSpace?o:0)+a,v=e.fontChar,b=e.accent;let w,A,E=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*E)*g,n=t[2]*g;E=t?-t[0]:E,w=i/r,A=(_+n)/r}else w=_/r,A=0;if(i.remeasure&&E>0){const t=1e3*s.measureText(v).width/n*r;if(E<t&&this.isFontSubpixelAAEnabled){const e=E/t;h=!0,s.save(),s.scale(e,1),w/=e}else E!==t&&(w+=(E-t)/2e3*n/r)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(f&&!b)s.fillText(v,w,A);else if(this.paintChar(v,w,A,m),b){const t=w+n*b.offset.x/r,e=A-n*b.offset.y/r;this.paintChar(b.fontChar,t,e,m)}_+=d?E*g-c*l:E*g+c*l,h&&s.restore()}d?e.y-=_:e.x+=_*h,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,l=i.charSpacing,h=i.wordSpacing,c=i.textHScale*r,d=i.fontMatrix||o,u=t.length;let p,g,f,m;if(!(i.textRenderingMode===_)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,r),p=0;p<u;++p){if(g=t[p],"number"===typeof g){m=a*g*s/1e3,this.ctx.translate(m,0),i.x+=m*c;continue}const r=(g.isSpace?h:0)+l,o=n.charProcOperatorList[g.operatorListId];if(!o){st(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),e.scale(s,s),e.transform(...d),this.executeOperatorList(o),this.restore());f=Et.applyTransform([g.width,0],d)[0]*s+r,e.translate(f,0),i.x+=f*c}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||oe(this.ctx),s={createCanvasGraphics:t=>new li(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new qe(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=Et.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=Et.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new ze(t);case"Mesh":return new Ve(t);case"Dummy":return new Ge}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,le(e),Oe);const n=le(e);if(n){const{width:t,height:i}=e.canvas,[s,r,a,o]=Et.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,r,a-s,o-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){rt("Should not call beginInlineImage")}beginImageData(){rt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=oe(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(oe(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||nt("TODO: Support non-isolated groups."),t.knockout&&st("Knockout groups not supported.");const i=oe(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=Et.getAxialAlignedBoundingBox(t.bbox,oe(e));const s=[0,0,e.canvas.width,e.canvas.height];n=Et.intersect(n,s)||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-r,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(h,o,l),d=c.context;d.translate(-r,-a),d.transform(...i),t.smask?this.smaskStack.push({canvas:c.canvas,context:d,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),ei(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=oe(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=Et.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(this.#Le(),ii(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],r=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=r;const[s,a]=Et.singularValueDecompose2dScale(oe(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),h=Math.ceil(r*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,h);const{canvas:c,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-a,0,r*a),ii(this.ctx)}else ii(this.ctx),this.ctx.rect(e[0],e[1],n,r),this.ctx.clip(),this.endPath()}this.current=new Je(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Re(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let r,a,o,l=new Uint8Array(s*(i+1));const h=e+7&-8;let c=new Uint8Array(h*i),d=0;for(const f of t.data){let t=128;for(;t>0;)c[d++]=f&t?0:255,t>>=1}let u=0;for(d=0,0!==c[d]&&(l[0]=1,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[a]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[a]=2,++u),r=1;r<i;r++){d=r*h,o=r*s,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(a=1;a<e;a++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),n[t]&&(l[o+a]=n[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+a]=c[d]?2:4,++u),u>1e3)return null}for(d=h*(i-1),o=r*s,0!==c[d]&&(l[o]=8,++u),a=1;a<e;a++)c[d]!==c[d+1]&&(l[o+a]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(r=0;u&&r<=i;r++){let t=r*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;g.moveTo(t%s,r);const n=t;let a=l[t];do{const e=p[a];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(a=i,l[t]=0):(a=i&51*a>>4,l[t]&=a>>2|a<<2),g.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--r}return c=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(g),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=oe(a);a.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let h=0,c=r.length;h<c;h+=2){const t=Et.transform(o,[e,i,n,s,r[h],r[h+1]]),[c,d]=Et.applyTransform([0,0],t);a.drawImage(l.canvas,c,d)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:r,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",r,a),h=l.context;h.save();ti(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,le(e),De):i,h.fillRect(0,0,r,a),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),Ze(e,l.canvas,0,0,r,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):st("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void st("Dependent image isn't ready yet");const r=s.width,a=s.height,o=[];for(let l=0,h=n.length;l<h;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,o)}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){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!r){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Qe(n,t),s=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(s,le(n));n.imageSmoothingEnabled=ni(oe(n),t.interpolate),Ze(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Qe(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Ze(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===oi?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=oe(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){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const t=Math.max(n,s);e.setLineDash(r.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const Cs in J)void 0!==li.prototype[Cs]&&(li.prototype[J[Cs]]=li.prototype[Cs]);class hi{static#Ie=null;static#Fe="";static get workerPort(){return this.#Ie}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Ie=t}static get workerSrc(){return this.#Fe}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");this.#Fe=t}}const ci=1,di=2,ui=1,pi=2,gi=3,fi=4,mi=5,vi=6,bi=7,yi=8;function wi(t){switch(t instanceof Error||"object"===typeof t&&null!==t||rt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new mt(t.message);case"MissingPDFException":return new pt(t.message);case"PasswordException":return new ct(t.message,t.code);case"UnexpectedResponseException":return new gt(t.message,t.status);case"UnknownErrorException":return new dt(t.message,t.details);default:return new dt(t.message,t.toString())}}class Ai{constructor(t,e,i){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),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#De(e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===ci)i.resolve(e.data);else{if(e.callback!==di)throw new Error("Unexpected callback case");i.reject(wi(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){i.postMessage({sourceName:t,targetName:s,callback:ci,callbackId:e.callbackId,data:n})}),(function(n){i.postMessage({sourceName:t,targetName:s,callback:di,callbackId:e.callbackId,reason:wi(n)})}))}else e.streamId?this.#Ne(e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${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:vi,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{at(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:ui,streamId:s,reason:wi(t)}),e.promise}},i)}#Ne(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:fi,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:gi,streamId:e}),delete r.streamSinks[e])},error(t){at(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:mi,streamId:e,reason:wi(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,new Promise((function(e){e(a(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:yi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:yi,streamId:e,reason:wi(t)})}))}#De(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 yi:t.success?r.startCall.resolve():r.startCall.reject(wi(t.reason));break;case bi:t.success?r.pullCall.resolve():r.pullCall.reject(wi(t.reason));break;case vi:if(!a){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise((function(t){t(a.onPull?.())})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:bi,streamId:e,reason:wi(t)})}));break;case fi:if(at(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case gi:if(at(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#Oe(r,e);break;case mi:at(r,"error should have stream controller"),r.controller.error(wi(t.reason)),this.#Oe(r,e);break;case pi:t.success?r.cancelCall.resolve():r.cancelCall.reject(wi(t.reason)),this.#Oe(r,e);break;case ui:if(!a)break;new Promise((function(e){e(a.onCancel?.(wi(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:pi,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:pi,streamId:e,reason:wi(t)})})),a.sinkCapability.reject(wi(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#Oe(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class Ei{#He;#Be;constructor(t){let{parsedData:e,rawData:i}=t;this.#He=e,this.#Be=i}getRaw(){return this.#Be}get(t){return this.#He.get(t)??null}getAll(){return yt(this.#He)}has(t){return this.#He.has(t)}}const _i=Symbol("INTERNAL");class xi{#ze=!1;#je=!1;#Ue=!1;#Ve=!0;constructor(t,e){let{name:i,intent:n,usage:s}=e;this.#ze=!!(t&c),this.#je=!!(t&d),this.name=i,this.intent=n,this.usage=s}get visible(){if(this.#Ue)return this.#Ve;if(!this.#Ve)return!1;const{print:t,view:e}=this.usage;return this.#ze?"OFF"!==e?.viewState:!this.#je||"OFF"!==t?.printState}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==_i&&rt("Internal method `_setVisible` called."),this.#Ue=i,this.#Ve=e}}class Ci{#Ge=null;#$e=(()=>new Map)();#We=null;#qe=null;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#qe=t.order;for(const i of t.groups)this.#$e.set(i.id,new xi(e,i));if("OFF"===t.baseState)for(const t of this.#$e.values())t._setVisible(_i,!1);for(const e of t.on)this.#$e.get(e)._setVisible(_i,!0);for(const e of t.off)this.#$e.get(e)._setVisible(_i,!1);this.#We=this.getHash()}}#Xe(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=this.#Xe(e);else{if(!this.#$e.has(e))return st(`Optional content group not found: ${e}`),!0;s=this.#$e.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}isVisible(t){if(0===this.#$e.size)return!0;if(!t)return nt("Optional content group not defined."),!0;if("OCG"===t.type)return this.#$e.has(t.id)?this.#$e.get(t.id).visible:(st(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Xe(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#$e.has(e))return st(`Optional content group not found: ${e}`),!0;if(this.#$e.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#$e.has(e))return st(`Optional content group not found: ${e}`),!0;if(!this.#$e.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#$e.has(e))return st(`Optional content group not found: ${e}`),!0;if(!this.#$e.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#$e.has(e))return st(`Optional content group not found: ${e}`),!0;if(this.#$e.get(e).visible)return!1}return!0}return st(`Unknown optional content policy ${t.policy}.`),!0}return st(`Unknown group type ${t.type}.`),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.#$e.get(t);i?(i._setVisible(_i,!!e,!0),this.#Ge=null):st(`Optional content group not found: ${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=this.#$e.get(s);if(t)switch(e){case"ON":t._setVisible(_i,!0);break;case"OFF":t._setVisible(_i,!1);break;case"Toggle":t._setVisible(_i,!t.visible)}}this.#Ge=null}get hasInitialVisibility(){return null===this.#We||this.getHash()===this.#We}getOrder(){return this.#$e.size?this.#qe?this.#qe.slice():[...this.#$e.keys()]:null}getGroups(){return this.#$e.size>0?yt(this.#$e):null}getGroup(t){return this.#$e.get(t)||null}getHash(){if(null!==this.#Ge)return this.#Ge;const t=new Ce;for(const[e,i]of this.#$e)t.update(`${e}:${i.visible}`);return this.#Ge=t.hexdigest()}}class Si{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;at(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,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{at(this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){at(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Ti(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Mi(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Ti{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=Yt(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 Mi{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 Pi(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("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("Accept-Ranges"))return r;return"identity"!==(e("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function ki(t){const e=t("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=bt(i);i=n.decode(s),e=!1}catch{}}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{}return s(e,n)}))}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(Yt(t))return t}return null}function Li(t,e){return 404===t||0===t&&e.startsWith("file:")?new pt('Missing PDF "'+e+'".'):new gt(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Ri(t){return 200===t||206===t}function Ii(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Fi(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Di(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(st(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class Ni{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return at(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Oi(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Hi(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Oi{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,this._headers=Fi(this._stream.httpHeaders);const i=e.url;fetch(i,Ii(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Ri(t.status))throw Li(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Pi({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=ki(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new mt("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(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Di(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Hi{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,this._headers=Fi(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);const s=n.url;fetch(s,Ii(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Ri(t.status))throw Li(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Di(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Bi{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}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 in this.httpHeaders){const t=this.httpHeaders[s];void 0!==t&&e.setRequestHeader(s,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){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){const i=this.pendingRequests[t];i&&i.onProgress?.(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:bt(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:r})}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 zi{constructor(t){this._source=t,this._manager=new Bi(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),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 at(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ji(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Ui(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class ji{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=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),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=Pi({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=ki(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.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=Li(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({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._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.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 Ui{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(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){this._storedError=Li(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({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 Vi=/^file:\/\/\/[a-zA-Z]:\//;class Gi{constructor(t){this.source=t,this.url=function(t){const e=Ie.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return at(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Yi(this):new Xi(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Zi(this,t,e):new Ki(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class $i{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()}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).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 mt("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Wi{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).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)}}function qi(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class Xi extends $i{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new pt(`Missing PDF "${this._url}".`);return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=Pi({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=ki(i)};if(this._request=null,"http:"===this._url.protocol){const i=Ie.get("http");this._request=i.request(qi(this._url,t.httpHeaders),e)}else{const i=Ie.get("https");this._request=i.request(qi(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class Ki extends Wi{constructor(t,e,i){super(t),this._httpHeaders={};for(const s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new pt(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=Ie.get("http");this._request=t.request(qi(this._url,this._httpHeaders),n)}else{const t=Ie.get("https");this._request=t.request(qi(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class Yi extends $i{constructor(t){super(t);let e=decodeURIComponent(this._url.path);Vi.test(this._url.href)&&(e=e.replace(/^\//,""));const i=Ie.get("fs");i.promises.lstat(e).then((t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new pt(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t)}))}}class Zi extends Wi{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);Vi.test(this._url.href)&&(n=n.replace(/^\//,""));const s=Ie.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const Ji=30;class Qi{#Ke=(()=>Promise.withResolvers())();#mt=null;#Ye=!1;#Ze=(()=>!!globalThis.FontInspector?.enabled)();#Je=null;#Qe=null;#ti=0;#ei=0;#ii=null;#ni=null;#si=0;#ri=0;#ai=(()=>Object.create(null))();#oi=[];#li=null;#hi=[];#ci=(()=>new WeakMap)();#di=null;static#ui=(()=>new Map)();static#pi=(()=>new Map)();static#gi=null;static#fi=(()=>new Set)();constructor(t){let{textContentSource:e,container:i,viewport:n}=t;if(e instanceof ReadableStream)this.#li=e;else{if("object"!==typeof e)throw new Error('No "textContentSource" parameter specified.');this.#li=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#mt=this.#ni=i,this.#ri=n.scale*(globalThis.devicePixelRatio||1),this.#si=n.rotation,this.#Qe={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:s,pageHeight:r,pageX:a,pageY:o}=n.rawDims;this.#di=[1,0,0,-1,-a,o+r],this.#ei=s,this.#ti=r,Qi.#mi(),he(i,n),this.#Ke.promise.catch((()=>{})).then((()=>{Qi.#fi.delete(this),this.#Qe=null,this.#ai=null}))}render(){const t=()=>{this.#ii.read().then((e=>{let{value:i,done:n}=e;n?this.#Ke.resolve():(this.#Je??=i.lang,Object.assign(this.#ai,i.styles),this.#vi(i.items),t())}),this.#Ke.reject)};return this.#ii=this.#li.getReader(),Qi.#fi.add(this),t(),this.#Ke.promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==this.#si&&(i?.(),this.#si=s,he(this.#ni,{rotation:s})),n!==this.#ri){i?.(),this.#ri=n;const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:Qi.#bi(this.#Je)};for(const e of this.#hi)t.properties=this.#ci.get(e),t.div=e,this.#yi(t)}}cancel(){const t=new mt("TextLayer task cancelled.");this.#ii?.cancel(t).catch((()=>{})),this.#ii=null,this.#Ke.reject(t)}get textDivs(){return this.#hi}get textContentItemsStr(){return this.#oi}#vi(t){if(this.#Ye)return;this.#Qe.ctx??=Qi.#bi(this.#Je);const e=this.#hi,i=this.#oi;for(const n of t){if(e.length>1e5)return st("Ignoring additional textDivs for performance reasons."),void(this.#Ye=!0);if(void 0!==n.str)i.push(n.str),this.#wi(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#mt;this.#mt=document.createElement("span"),this.#mt.classList.add("markedContent"),null!==n.id&&this.#mt.setAttribute("id",`${n.id}`),t.append(this.#mt)}else"endMarkedContent"===n.type&&(this.#mt=this.#mt.parentNode)}}#wi(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#hi.push(e);const n=Et.transform(this.#di,t.transform);let s=Math.atan2(n[1],n[0]);const r=this.#ai[t.fontName];r.vertical&&(s+=Math.PI/2);const a=this.#Ze&&r.fontSubstitution||r.fontFamily,o=Math.hypot(n[2],n[3]),l=o*Qi.#Ai(a,this.#Je);let h,c;0===s?(h=n[4],c=n[5]-l):(h=n[4]+l*Math.sin(s),c=n[5]-l*Math.cos(s));const d="calc(var(--scale-factor)*",u=e.style;this.#mt===this.#ni?(u.left=`${(100*h/this.#ei).toFixed(2)}%`,u.top=`${(100*c/this.#ti).toFixed(2)}%`):(u.left=`${d}${h.toFixed(2)}px)`,u.top=`${d}${c.toFixed(2)}px)`),u.fontSize=`${d}${(Qi.#gi*o).toFixed(2)}px)`,u.fontFamily=a,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#Ze&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!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&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),this.#ci.set(e,i),this.#Qe.div=e,this.#Qe.properties=i,this.#yi(this.#Qe),i.hasText&&this.#mt.append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#mt.append(t)}}#yi(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:r}=t,{style:a}=e;let o="";if(Qi.#gi>1&&(o=`scale(${1/Qi.#gi})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=a,{canvasWidth:h,fontSize:c}=i;s===c&&r===l||(n.font=`${c*this.#ri}px ${l}`,t.prevFontSize=c,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o=`scaleX(${h*this.#ri/d}) ${o}`)}0!==i.angle&&(o=`rotate(${i.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#fi.size>0)){this.#ui.clear();for(const{canvas:t}of this.#pi.values())t.remove();this.#pi.clear()}}static#bi(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.#pi.get(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}),this.#pi.set(t,e)}return e}static#mi(){if(null!==this.#gi)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),this.#gi=t.getBoundingClientRect().height,t.remove()}static#Ai(t,e){const i=this.#ui.get(t);if(i)return i;const n=this.#bi(e),s=n.font;n.canvas.width=n.canvas.height=Ji,n.font=`30px ${t}`;const r=n.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){const e=a/(a+o);return this.#ui.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,Ji,Ji),n.strokeText("g",0,0);let l=n.getImageData(0,0,Ji,Ji).data;o=0;for(let c=l.length-1-3;c>=0;c-=4)if(l[c]>0){o=Math.ceil(c/4/Ji);break}n.clearRect(0,0,Ji,Ji),n.strokeText("A",0,Ji),l=n.getImageData(0,0,Ji,Ji).data,a=0;for(let c=0,d=l.length;c<d;c+=4)if(l[c]>0){a=Ji-Math.floor(c/4/Ji);break}n.canvas.width=n.canvas.height=0,n.font=s;const h=a?a/(a+o):.8;return this.#ui.set(t,h),h}}function tn(){ie("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:i,...n}=arguments[0],s=Object.keys(n);s.length>0&&st("Ignoring `renderTextLayer` parameters: "+s.join(", "));const r=new Qi({textContentSource:t,container:e,viewport:i}),{textDivs:a,textContentItemsStr:o}=r;return{promise:r.render(),textDivs:a,textContentItemsStr:o}}function en(){ie("`updateTextLayer`, please use `TextLayer` instead.")}class nn{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){if(!i)return;let n=null;const s=i.name;if("#text"===s)n=i.value;else{if(!nn.shouldBuildText(s))return;i?.attributes?.textContent?n=i.attributes.textContent:i.value&&(n=i.value)}if(null!==n&&e.push({str:n}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const sn=65536,rn=r?class extends Ot{_createCanvas(t,e){return Ie.get("canvas").createCanvas(t,e)}}:class extends Ot{constructor(){let{ownerDocument:t=globalThis.document,enableHWA:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},an=r?class extends Ht{_fetchData(t,e){return Fe(t).then((t=>({cMapData:t,compressionType:e})))}}:Gt,on=r?class extends Nt{}:class extends Nt{#Ei;#_i;#xi;#Ci;#Si;#v=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.#xi=t,this.#Ci=e}get#y(){return this.#Ei||=new Map}get#Ti(){return this.#Si||=new Map}get#Mi(){if(!this.#_i){const t=this.#Ci.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#Ci.createElementNS(jt,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#_i=this.#Ci.createElementNS(jt,"defs"),t.append(i),i.append(this.#_i),this.#Ci.body.append(t)}return this.#_i}#Pi(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(",")]}addFilter(t){if(!t)return"none";let e=this.#y.get(t);if(e)return e;const[i,n,s]=this.#Pi(t),r=1===t.length?i:`${i}${n}${s}`;if(e=this.#y.get(r),e)return this.#y.set(t,e),e;const a=`g_${this.#xi}_transfer_map_${this.#v++}`,o=`url(#${a})`;this.#y.set(t,o),this.#y.set(r,o);const l=this.#ki(a);return this.#Li(i,n,s,l),o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let s=this.#Ti.get(n);if(s?.key===i)return s.url;if(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#Ti.set(n,s)),!t||!e)return s.url;const r=this.#Ri(t);t=Et.makeHexColor(...r);const a=this.#Ri(e);if(e=Et.makeHexColor(...a),this.#Mi.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;const o=new Array(256);for(let u=0;u<=255;u++){const t=u/255;o[u]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),h=`g_${this.#xi}_hcm_filter`,c=s.filter=this.#ki(h);this.#Li(l,l,l,c),this.#Ii(c);const d=(t,e)=>{const i=r[t]/255,n=a[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 this.#Li(d(0,5),d(1,5),d(2,5),c),s.url=`url(#${h})`,s.url}addAlphaFilter(t){let e=this.#y.get(t);if(e)return e;const[i]=this.#Pi([t]),n=`alpha_${i}`;if(e=this.#y.get(n),e)return this.#y.set(t,e),e;const s=`g_${this.#xi}_alpha_map_${this.#v++}`,r=`url(#${s})`;this.#y.set(t,r),this.#y.set(n,r);const a=this.#ki(s);return this.#Fi(i,a),r}addLuminosityFilter(t){let e,i,n=this.#y.get(t||"luminosity");if(n)return n;if(t?([e]=this.#Pi([t]),i=`luminosity_${e}`):i="luminosity",n=this.#y.get(i),n)return this.#y.set(t,n),n;const s=`g_${this.#xi}_luminosity_map_${this.#v++}`,r=`url(#${s})`;this.#y.set(t,r),this.#y.set(i,r);const a=this.#ki(s);return this.#Di(a),t&&this.#Fi(e,a),r}addHighlightHCMFilter(t,e,i,n,s){const r=`${e}-${i}-${n}-${s}`;let a=this.#Ti.get(t);if(a?.key===r)return a.url;if(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#Ti.set(t,a)),!e||!i)return a.url;const[o,l]=[e,i].map(this.#Ri.bind(this));let h=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,s].map(this.#Ri.bind(this));c<h&&([h,c,d,u]=[c,h,u,d]),this.#Mi.style.color="";const p=(t,e,i)=>{const n=new Array(256),s=(c-h)/i,r=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(h+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(",")},g=`g_${this.#xi}_hcm_${t}_filter`,f=a.filter=this.#ki(g);return this.#Ii(f),this.#Li(p(d[0],u[0],5),p(d[1],u[1],5),p(d[2],u[2],5),f),a.url=`url(#${g})`,a.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==this.#Ti.size||(this.#_i&&(this.#_i.parentNode.parentNode.remove(),this.#_i=null),this.#Ei&&(this.#Ei.clear(),this.#Ei=null),this.#v=0)}#Di(t){const e=this.#Ci.createElementNS(jt,"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)}#Ii(t){const e=this.#Ci.createElementNS(jt,"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)}#ki(t){const e=this.#Ci.createElementNS(jt,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#Mi.append(e),e}#Ni(t,e,i){const n=this.#Ci.createElementNS(jt,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#Li(t,e,i,n){const s=this.#Ci.createElementNS(jt,"feComponentTransfer");n.append(s),this.#Ni(s,"feFuncR",t),this.#Ni(s,"feFuncG",e),this.#Ni(s,"feFuncB",i)}#Fi(t,e){const i=this.#Ci.createElementNS(jt,"feComponentTransfer");e.append(i),this.#Ni(i,"feFuncA",t)}#Ri(t){return this.#Mi.style.color=t,ae(getComputedStyle(this.#Mi).getPropertyValue("color"))}},ln=r?class extends Bt{_fetchData(t){return Fe(t)}}:$t;function hn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new dn,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(r&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(r&&"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 bt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(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.")}(t.data):null,a=t.httpHeaders||null,o=!0===t.withCredentials,l=t.password??null,h=t.range instanceof un?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:sn;let d=t.worker instanceof vn?t.worker:null;const u=t.verbosity,p="string"!==typeof t.docBaseUrl||Kt(t.docBaseUrl)?null:t.docBaseUrl,g="string"===typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,m=t.CMapReaderFactory||an,v="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||ln,y=!0!==t.stopAtErrors,w=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,A=!1!==t.isEvalSupported,E="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!r,_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"===typeof t.disableFontFace?t.disableFontFace:r,C=!0===t.fontExtraProperties,S=!0===t.enableXfa,T=t.ownerDocument||globalThis.document,M=!0===t.disableRange,P=!0===t.disableStream,k=!0===t.disableAutoFetch,L=!0===t.pdfBug,R=!0===t.enableHWA,I=h?h.length:t.length??NaN,F="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!r&&!x,D="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:m===Gt&&b===$t&&g&&v&&te(g,document.baseURI)&&te(v,document.baseURI),N=t.canvasFactory||new rn({ownerDocument:T,enableHWA:R}),O=t.filterFactory||new on({docId:i,ownerDocument:T});et(u);const H={canvasFactory:N,filterFactory:O};if(D||(H.cMapReaderFactory=new m({baseUrl:g,isCompressed:f}),H.standardFontDataFactory=new b({baseUrl:v})),!d){const t={verbosity:u,port:hi.workerPort};d=t.port?vn.fromPort(t):new vn(t),e._worker=d}const B={docId:i,apiVersion:"4.4.168",data:s,password:l,disableAutoFetch:k,rangeChunkSize:c,length:I,docBaseUrl:p,enableXfa:S,evaluatorOptions:{maxImageSize:w,disableFontFace:x,ignoreErrors:y,isEvalSupported:A,isOffscreenCanvasSupported:E,canvasMaxAreaInBytes:_,fontExtraProperties:C,useSystemFonts:F,cMapUrl:D?g:null,standardFontDataUrl:D?v:null}},z={disableFontFace:x,fontExtraProperties:C,ownerDocument:T,pdfBug:L,styleElement:null,loadingParams:{disableAutoFetch:k,enableXfa:S}};return d.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const t=d.messageHandler.sendWithPromise("GetDocRequest",B,s?[s.buffer]:null);let l;if(h)l=new Si(h,{disableRange:M,disableStream:P});else if(!s){if(!n)throw new Error("getDocument - no `url` parameter provided.");l=(t=>{if(r){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&te(t.url)?new Ni(t):new Gi(t)}return te(t.url)?new Ni(t):new zi(t)})({url:n,length:I,httpHeaders:a,withCredentials:o,rangeChunkSize:c,disableRange:M,disableStream:P})}return t.then((t=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const n=new Ai(i,t,d.port),s=new bn(n,e,l,z,H);e._transport=s,n.send("Ready",null)}))})).catch(e._capability.reject),e}function cn(t){return"object"===typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class dn{static#xi=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+dn.#xi++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class un{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.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){rt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class pn{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return lt(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()}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()}}class gn{#Oi=null;#Hi=!1;constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];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 wn,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale: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 qt({viewBox:this.view,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 lt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:i,intent:n="display",annotationMode:s=m.ENABLE,transform:r=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:c=null}=t;this._stats?.time("Overall");const u=this._transport.getRenderingIntent(n,s,c),{renderingIntent:p,cacheKey:g}=u;this.#Hi=!1,this.#Bi(),o||=this._transport.getOptionalContentConfig(p);let f=this._intentStates.get(g);f||(f=Object.create(null),this._intentStates.set(g,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const v=!!(p&d);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const b=t=>{f.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#Hi=!0),this.#zi(!v),t?(y.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new En({callback:b,params:{canvasContext:e,viewport:i,transform:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:h});(f.renderTasks||=new Set).add(y);const w=y.task;return Promise.all([f.displayReadyCapability.promise,o]).then((t=>{let[e,i]=t;if(this.destroyed)b();else{if(this._stats?.time("Rendering"),!(i.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:e,optionalContentConfig:i}),y.operatorListChanged()}})).catch(b),w}getOperatorList(){let{intent:t="display",annotationMode:e=m.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(t,e,i,!0);let s,r=this._intentStates.get(n.cacheKey);return r||(r=Object.create(null),this._intentStates.set(n.cacheKey,r)),r.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(s))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),r.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=>nn.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){let{value:n,done:r}=i;r?t(s):(s.lang??=n.lang,Object.assign(s.styles,n.styles),s.items.push(...n.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(),this.#Hi=!1,this.#Bi(),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Hi=!0;const e=this.#zi(!1);return t&&e&&(this._stats&&=new Qt),e}#zi(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#Bi(),!this.#Hi||this.destroyed)return!1;if(t)return this.#Oi=setTimeout((()=>{this.#Oi=null,this.#zi(!1)}),5e3),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Hi=!1,!0}#Bi(){this.#Oi&&(clearTimeout(this.#Oi),this.#Oi=null)}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,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&&this.#zi(!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n}=t;const{map:s,transfer:r}=n,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:s},r).getReader(),o=this._intentStates.get(i);o.streamReader=a;const l=()=>{a.read().then((t=>{let{value:e,done:i}=t;i?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())}),(t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#zi(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};l()}_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 Xt){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 mt(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}}class fn{#ji=(()=>new Set)();#Ui=(()=>Promise.resolve())();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Ui.then((()=>{for(const t of this.#ji)t.call(this,i)}))}addEventListener(t,e){this.#ji.add(e)}removeEventListener(t,e){this.#ji.delete(e)}terminate(){this.#ji.clear()}}const mn={isWorkerDisabled:!1,fakeWorkerId:0};r&&(mn.isWorkerDisabled=!0,hi.workerSrc||="./pdf.worker.mjs"),mn.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},mn.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};class vn{static#Vi;constructor(){let{name:t=null,port:e=null,verbosity:i=it()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(vn.#Vi?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(vn.#Vi||=new WeakMap).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return r?Promise.all([Ie.promise,this._readyCapability.promise]):this._readyCapability.promise}#Gi(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Ai("main","worker",t),this._messageHandler.on("ready",(function(){})),this.#Gi()}_initialize(){if(mn.isWorkerDisabled||vn.#$i)return void this._setupFakeWorker();let{workerSrc:t}=vn;try{mn.isSameOrigin(window.location.href,t)||(t=mn.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Ai("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,this.#Gi()):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}}));const r=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void r()}catch{nt("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){mn.isWorkerDisabled||(st("Setting up fake worker."),mn.isWorkerDisabled=!0),vn._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new fn;this._port=e;const i="fake"+mn.fakeWorkerId++,n=new Ai(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new Ai(i,i+"_worker",e),this.#Gi()})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),vn.#Vi?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#Vi?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new vn(t)}static get workerSrc(){if(hi.workerSrc)return hi.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#$i(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return lt(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#$i)return this.#$i;return(await i(77724)(this.workerSrc)).WorkerMessageHandler})())}}class bn{#Wi=(()=>new Map)();#qi=(()=>new Map)();#Xi=(()=>new Map)();#Ki=(()=>new Map)();#Yi=null;constructor(t,e,i,n,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new wn,this.fontLoader=new Pe({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.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Zi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#Wi.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#Wi.set(t,n),n}get annotationStorage(){return lt(this,"annotationStorage",new Te)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=c,r=Se;switch(t){case"any":s=h;break;case"display":break;case"print":s=d;break;default:st(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case m.DISABLE:s+=g;break;case m.ENABLE:break;case m.ENABLE_FORMS:s+=u;break;case m.ENABLE_STORAGE:s+=p;r=(s&d&&i instanceof Me?i:this.annotationStorage).serializable;break;default:st(`getRenderingIntent - invalid annotationMode: ${e}`)}return n&&(s+=f),{renderingIntent:s,cacheKey:`${s}_${r.hash}`,annotationStorageSerializable:r}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Yi?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#qi.values())t.push(i._destroy());this.#qi.clear(),this.#Xi.clear(),this.#Ki.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Wi.clear(),this.filterFactory.destroy(),Qi.cleanup(),this._networkStream?.cancelAllRequests(new mt("Worker was terminated.")),this.messageHandler&&(this.messageHandler.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)=>{at(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():(at(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",(t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{n.isStreamingSupported&&n.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),n.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{at(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():(at(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 pn(i,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new ct(t.message,t.code);break;case"InvalidPDFException":i=new ut(t.message);break;case"MissingPDFException":i=new pt(t.message);break;case"UnexpectedResponseException":i=new gt(t.message,t.status);break;case"UnknownErrorException":i=new dt(t.message,t.details);break;default:rt("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(this.#Yi=Promise.withResolvers(),e.onPassword){const n=t=>{t instanceof Error?this.#Yi.reject(t):this.#Yi.resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){this.#Yi.reject(i)}}else this.#Yi.reject(new ct(t.message,t.code));return this.#Yi.promise})),t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#qi.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{let[i,n,s]=e;if(this.destroyed)return null;if(this.commonObjs.has(i))return null;switch(n){case"Font":const{disableFontFace:e,fontExtraProperties:r,pdfBug:a}=this._params;if("error"in s){const t=s.error;st(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}const o=a&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new ke(s,{disableFontFace:e,inspectFont:o});this.fontLoader.bind(l).catch((()=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!r&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)}));break;case"CopyLocalImage":const{imageRef:h}=s;at(h,"The imageRef must be defined.");for(const t of this.#qi.values())for(const[,e]of t.objs)if(e?.ref===h)return e.dataLen?(this.commonObjs.resolve(i,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${n}`)}return null})),t.on("obj",(t=>{let[e,i,n,s]=t;if(this.destroyed)return;const r=this.#qi.get(i);if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,s),s?.dataLen>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${n}`)}else s?.bitmap?.close()})),t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&st("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).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=this.#Xi.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&&this.#Ki.set(i.refStr,t);const n=new gn(e,i,this,this._params.pdfBug);return this.#qi.set(e,n),n}));return this.#Xi.set(e,n),n}getPageIndex(t){return cn(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 this.#Zi("GetFieldObjects")}hasJSActions(){return this.#Zi("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)}getDocJSActions(){return this.#Zi("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 this.#Zi("GetOptionalContentConfig").then((e=>new Ci(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#Wi.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new Ei(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));return this.#Wi.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 this.#qi.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Wi.clear(),this.filterFactory.destroy(!0),Qi.cleanup()}}cachedPageNumber(t){if(!cn(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#Ki.get(e)??null}}const yn=Symbol("INITIAL_DATA");class wn{#Ji=(()=>Object.create(null))();#Qi(t){return this.#Ji[t]||={...Promise.withResolvers(),data:yn}}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=this.#Qi(t);return i.promise.then((()=>e(i.data))),null}const i=this.#Ji[t];if(!i||i.data===yn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#Ji[t];return!!e&&e.data!==yn}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=this.#Qi(t);i.data=e,i.resolve()}clear(){for(const t in this.#Ji){const{data:e}=this.#Ji[t];e?.bitmap?.close()}this.#Ji=Object.create(null)}*[Symbol.iterator](){for(const t in this.#Ji){const{data:e}=this.#Ji[t];e!==yn&&(yield[t,e])}}}class An{#tn=null;constructor(t){this.#tn=t,this.onContinue=null}get promise(){return this.#tn.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#tn.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#tn.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#tn;return t.form||t.canvas&&e?.size>0}}class En{#en=null;static#in=(()=>new WeakSet)();constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}=t;this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new An(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.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:i}=t;if(this.cancelled)return;if(this._canvas){if(En.#in.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.");En.#in.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:r,background:a}=this.params;this.gfx=new li(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:s,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#en&&(window.cancelAnimationFrame(this.#en),this.#en=null),En.#in.delete(this._canvas),this.callback(t||new Xt(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#en=window.requestAnimationFrame((()=>{this.#en=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.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),En.#in.delete(this._canvas),this.callback())))}}const _n="4.4.168",xn="19fbc8998";function Cn(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Sn(t){return Math.max(0,Math.min(255,255*t))}class Tn{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=Sn(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=Cn(e);return`#${i}${i}${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(Sn)}static RGB_HTML(t){return`#${t.map(Cn).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[Sn(1-Math.min(1,e+s)),Sn(1-Math.min(1,n+s)),Sn(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 Mn{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=`${a.name}-${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(${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&&nn.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const h=[[n,-1,r]];for(;h.length>0;){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:c}=o;if("#text"===c){const t=document.createTextNode(o.value);l.push(t),r.append(t);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,c):document.createElement(c);if(r.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:s,linkService:i}),o.children?.length>0)h.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);a&&nn.shouldBuildText(c)&&l.push(t),d.append(t)}}for(const c of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))c.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const Pn=1e3,kn=new WeakSet;function Ln(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Rn{static create(t){switch(t.data.annotationType){case M:return new Fn(t);case T:return new Dn(t);case G:switch(t.data.fieldType){case"Tx":return new On(t);case"Btn":return t.data.radioButton?new zn(t):t.data.checkBox?new Bn(t):new jn(t);case"Ch":return new Un(t);case"Sig":return new Hn(t)}return new Nn(t);case U:return new Vn(t);case P:return new $n(t);case k:return new Wn(t);case L:return new qn(t);case R:return new Xn(t);case F:return new Kn(t);case z:return new Zn(t);case j:return new Jn(t);case I:return new Yn(t);case D:return new Qn(t);case N:return new ts(t);case O:return new es(t);case H:return new is(t);case B:return new ns(t);case V:return new ss(t);default:return new In(t)}}}class In{#nn=null;#sn=!1;#rn=null;constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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.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{titleObj:e,contentsObj:i,richText:n}=t;return!!(e?.str||i?.str||n?.str)}get hasPopupData(){return In._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#nn||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#an(e),this.#rn?.popup.updateEdited(t)}resetEdited(){this.#nn&&(this.#an(this.#nn.rect),this.#rn?.popup.resetEdited(),this.#nn=null)}#an(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);const{width:l,height:h}=Ln(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+o)/r+"%",0===n?(e.width=100*l/s+"%",e.height=100*h/r+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof Nn||(s.tabIndex=Pn);const{style:r}=s;if(r.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Vn){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:a,height:o}=Ln(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;r.borderRadius=e}else if(this instanceof zn){const t=`calc(${a}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;r.borderRadius=t}switch(e.borderStyle.style){case $:r.borderStyle="solid";break;case W:r.borderStyle="dashed";break;case q:st("Unimplemented border style: beveled");break;case X:st("Unimplemented border style: inset");break;case K:r.borderBottomStyle="solid"}const n=e.borderColor||null;n?(this.#sn=!0,r.borderColor=Et.makeHexColor(0|n[0],0|n[1],0|n[2])):r.borderWidth=0}const l=Et.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:d,pageY:u}=n.rawDims;r.left=100*(l[0]-d)/h+"%",r.top=100*(l[1]-u)/c+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width=100*a/h+"%",r.height=100*o/c+"%"):this.setRotation(p,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,{width:s,height:r}=Ln(this.data.rect);let a,o;t%180===0?(a=100*s/i,o=100*r/n):(a=100*r/i,o=100*s/n),e.style.width=`${a}%`,e.style.height=`${o}%`,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]=Tn[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[e]:Tn[`${s}_rgb`](r)})};return lt(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];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(this.#sn){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="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:h}=this,c=h.createElement("svg");c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0);const d=h.createElement("defs");c.append(d);const u=h.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(let g=2,f=t.length;g<f;g+=8){const i=t[g],n=t[g+1],r=t[g+2],c=t[g+3],d=h.createElement("rect"),p=(r-e)/o,f=(s-n)/l,m=(i-r)/o,v=(n-c)/l;d.setAttribute("x",p),d.setAttribute("y",f),d.setAttribute("width",m),d.setAttribute("height",v),u.append(d),a?.push(`<rect vector-effect="non-scaling-stroke" x="${p}" y="${f}" width="${m}" height="${v}"/>`)}this.#sn&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(c),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=this.#rn=new Vn({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){rt("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="${s}"]`);!a||kn.has(a)?i.push({id:s,exportValue:n,domElement:a}):st(`_getElementsByName - element not allowed: ${s}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(kn.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}class Fn extends In{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),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),n=!0):t.attachment?(this.#on(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#ln(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),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}#hn(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#hn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#hn()}#on(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#hn()}#ln(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#hn()}_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]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#hn()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#hn(),!this._fieldObjects)return st('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{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="${t}"]`);i&&(kn.has(i)?i.dispatchEvent(new Event("resetform")):st(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Dn extends In{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 Nn extends In{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return wt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{this.linkService.eventBus?.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=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}})}))}_setEventListeners(t,e,i,n){for(const[s,r]of i)("Action"===r||this.data.actions?.[r])&&("Focus"!==r&&"Blur"!==r||(e||={focused:!1}),this._setEventListener(t,e,s,r,n),"Focus"!==r||this.data.actions?.Blur?"Blur"!==r||this.data.actions?.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":Et.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/(l*n))||1);r=Math.min(n,a(e/l))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,a(t/l))}s.fontSize=`calc(${r}px * var(--scale-factor))`,s.color=Et.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 On extends Nn{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){const n=t.getValue(e,{value:this.data.fieldValue});let s=n.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&s.length>r&&(s=s.slice(0,r));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),kn.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Pn,this._setRequired(i,this.data.required),r&&(i.maxLength=r),i.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null})),i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null}));let l=t=>{const{formattedValue:e}=o;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",(t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)})),i.addEventListener("updatefromsandbox",(i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:s}=i;if(0===n)return void s.removeAttribute("maxLength");s.setAttribute("maxLength",n);let r=o.userValue;!r||r.length<=n||(r=r.slice(0,n),s.value=o.userValue=r,t.setValue(e,{value:r}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)})),i.addEventListener("keydown",(t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const n=l;l=null,i.addEventListener("blur",(t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),n(t)})),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",(t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:s,selectionStart:r,selectionEnd:a}=n;let l=r,h=a;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(r).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":r===a&&(l-=1);break;case"deleteContentForward":r===a&&(h+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:h}})})),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(l&&i.addEventListener("blur",l),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/r;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--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 Hn extends Nn{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Bn extends Nn{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 kn.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=Pn,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 zn extends Nn{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(kn.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=Pn,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 jn extends Fn{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 Un extends Nn{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");kn.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=Pn;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){r?.();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of n.options)t.selected=l.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=>{const n=a(!0),s=a(!1);t.setValue(e,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:s,changeEx:n,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}}class Vn extends In{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:In._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Gn({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,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}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>`${St}${t}`)).join(",")),this.container}}class Gn{#cn=this.#dn.bind(this);#un=this.#pn.bind(this);#gn=this.#fn.bind(this);#mn=this.#vn.bind(this);#bn=null;#mt=null;#yn=null;#wn=null;#An=null;#En=null;#_n=null;#xn=!1;#Cn=null;#x=null;#Sn=null;#Tn=null;#Mn=null;#nn=null;#Pn=!1;constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:h,parentRect:c,open:d}=t;this.#mt=e,this.#Mn=s,this.#yn=a,this.#Tn=o,this.#En=l,this.#bn=i,this.#Sn=h,this.#_n=c,this.#An=n,this.#wn=se.toDateObject(r),this.trigger=n.flatMap((t=>t.getElementsToTriggerPopup()));for(const u of this.trigger)u.addEventListener("click",this.#mn),u.addEventListener("mouseenter",this.#gn),u.addEventListener("mouseleave",this.#un),u.classList.add("popupTriggerArea");for(const u of n)u.container?.addEventListener("keydown",this.#cn);this.#mt.hidden=!0,d&&this.#vn()}render(){if(this.#Cn)return;const t=this.#Cn=document.createElement("div");if(t.className="popup",this.#bn){const e=t.style.outlineColor=Et.makeHexColor(...this.#bn);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`;else{const e=.7;t.style.backgroundColor=Et.makeHexColor(...this.#bn.map((t=>Math.floor(e*(255-t)+t))))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#Mn),t.append(e),this.#wn){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:this.#wn.toLocaleDateString(),time:this.#wn.toLocaleTimeString()})),e.append(t)}const n=this.#kn;if(n)Mn.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(this.#yn);t.append(e)}this.#mt.append(t)}get#kn(){const t=this.#Tn,e=this.#yn;return!t?.str||e?.str&&e.str!==t.str?null:this.#Tn.html||null}get#Ln(){return this.#kn?.attributes?.style?.fontSize||0}get#Rn(){return this.#kn?.attributes?.style?.color||null}#In(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#Rn,fontSize:this.#Ln?`calc(${this.#Ln}px * var(--scale-factor))`:""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let r=0,a=s.length;r<a;++r){const t=s[r];n.append(document.createTextNode(t)),r<a-1&&n.append(document.createElement("br"))}return n}#dn(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#xn)&&this.#vn()}updateEdited(t){let{rect:e,popupContent:i}=t;this.#nn||={contentsObj:this.#yn,richText:this.#Tn},e&&(this.#x=null),i&&(this.#Tn=this.#In(i),this.#yn=null),this.#Cn?.remove(),this.#Cn=null}resetEdited(){this.#nn&&(({contentsObj:this.#yn,richText:this.#Tn}=this.#nn),this.#nn=null,this.#Cn?.remove(),this.#Cn=null,this.#x=null)}#Fn(){if(null!==this.#x)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=this.#En;let r=!!this.#_n,a=r?this.#_n:this.#Sn;for(const u of this.#An)if(!a||null!==Et.intersect(u.data.rect,a)){a=u.data.rect,r=!0;break}const o=Et.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,c=o[1];this.#x=[100*(h-n)/e,100*(c-s)/i];const{style:d}=this.#mt;d.left=`${this.#x[0]}%`,d.top=`${this.#x[1]}%`}#vn(){this.#xn=!this.#xn,this.#xn?(this.#fn(),this.#mt.addEventListener("click",this.#mn),this.#mt.addEventListener("keydown",this.#cn)):(this.#pn(),this.#mt.removeEventListener("click",this.#mn),this.#mt.removeEventListener("keydown",this.#cn))}#fn(){this.#Cn||this.render(),this.isVisible?this.#xn&&this.#mt.classList.add("focused"):(this.#Fn(),this.#mt.hidden=!1,this.#mt.style.zIndex=parseInt(this.#mt.style.zIndex)+1e3)}#pn(){this.#mt.classList.remove("focused"),!this.#xn&&this.isVisible&&(this.#mt.hidden=!0,this.#mt.style.zIndex=parseInt(this.#mt.style.zIndex)-1e3)}forceHide(){this.#Pn=this.isVisible,this.#Pn&&(this.#mt.hidden=!0)}maybeShow(){this.#Pn&&(this.#Cn||this.#fn(),this.#Pn=!1,this.#mt.hidden=!1)}get isVisible(){return!1===this.#mt.hidden}}class $n extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=v.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}get _isEditable(){return this.data.hasOwnCanvas}}class Wn extends In{#Dn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Ln(t.rect),n=this.svgFactory.create(e,i,!0),s=this.#Dn=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 this.#Dn}addHighlightArea(){this.container.classList.add("highlightArea")}}class qn extends In{#Nn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Ln(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#Nn=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 this.#Nn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Xn extends In{#On=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Ln(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#On=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 this.#On}addHighlightArea(){this.container.classList.add("highlightArea")}}class Kn extends In{#Hn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:r}=Ln(t),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(`${i},${n}`)}o=o.join(" ");const l=this.#Hn=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 this.#Hn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Yn extends Kn{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Zn extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Jn extends In{#Bn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=v.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=Ln(t),a=this.svgFactory.create(s,r,!0);for(const o of e){let e=[];for(let i=0,n=o.length;i<n;i+=2){const n=o[i]-t[0],s=t[3]-o[i+1];e.push(`${n},${s}`)}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);this.#Bn.push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!n&&this.hasPopupData&&this._createPopup(),a.append(s)}return this.container.append(a),this.container}getElementsToTriggerPopup(){return this.#Bn}addHighlightArea(){this.container.classList.add("highlightArea")}}class Qn extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ts extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class es extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class is extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ns extends In{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class ss extends In{#zn=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}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=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#jn.bind(this)),this.#zn=i;const{isMac:n}=wt.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#jn()})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#zn}addHighlightArea(){this.container.classList.add("highlightArea")}#jn(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class rs{#Un=null;#Vn=null;#Gn=(()=>new Map)();constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:r,viewport:a}=t;this.div=e,this.#Un=i,this.#Vn=n,this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}#$n(t,e){const i=t.firstChild||t;i.id=`${St}${e}`,this.div.append(t),this.#Un?.moveElementInDOM(this.div,t,i,!1)}async render(t){const{annotations:e}=t,i=this.div;he(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Wt,annotationStorage:t.annotationStorage||new Te,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const r of e){if(r.noHTML)continue;const t=r.annotationType===U;if(t){const t=n.get(r.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=Ln(r.rect);if(t<=0||e<=0)continue}s.data=r;const e=Rn.create(s);if(!e.isRenderable)continue;if(!t&&r.popupRef){const t=n.get(r.popupRef);t?t.push(e):n.set(r.popupRef,[e])}const i=e.render();r.hidden&&(i.style.visibility="hidden"),this.#$n(i,r.id),e.annotationEditorType>0&&(this.#Gn.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#Wn()}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,he(i,{rotation:e.rotation}),this.#Wn(),i.hidden=!1}#Wn(){if(!this.#Vn)return;const t=this.div;for(const[e,i]of this.#Vn){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}this.#Vn.clear()}getEditableAnnotations(){return Array.from(this.#Gn.values())}getEditableAnnotation(t){return this.#Gn.get(t)}}const as=/\r\n?|\n/g;class os extends we{#qn=this.editorDivBlur.bind(this);#Xn=this.editorDivFocus.bind(this);#Kn=this.editorDivInput.bind(this);#Yn=this.editorDivKeydown.bind(this);#Zn=this.editorDivPaste.bind(this);#bn;#Jn="";#Qn=`${this.id}-editor`;#Ln;#ts=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=os.prototype,e=t=>t.isEmpty(),i=be.TRANSLATE_SMALL,n=be.TRANSLATE_BIG;return lt(this,"_keyboardManager",new me([[["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}]]))}static _type="freetext";static _editorType=(()=>v.FREETEXT)();constructor(t){super({...t,name:"freeTextEditor"}),this.#bn=t.color||os._defaultColor||we._defaultLineColor,this.#Ln=t.fontSize||os._defaultFontSize}static initialize(t,e){we.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case b.FREETEXT_SIZE:os._defaultFontSize=e;break;case b.FREETEXT_COLOR:os._defaultColor=e}}updateParams(t,e){switch(t){case b.FREETEXT_SIZE:this.#es(e);break;case b.FREETEXT_COLOR:this.#is(e)}}static get defaultPropertiesToUpdate(){return[[b.FREETEXT_SIZE,os._defaultFontSize],[b.FREETEXT_COLOR,os._defaultColor||we._defaultLineColor]]}get propertiesToUpdate(){return[[b.FREETEXT_SIZE,this.#Ln],[b.FREETEXT_COLOR,this.#bn]]}#es(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#Ln)*this.parentScale),this.#Ln=t,this.#ns()},i=this.#Ln;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#is(t){const e=t=>{this.#bn=this.editorDiv.style.color=t},i=this.#bn;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-os._internalPadding*t,-(os._internalPadding+this.#Ln)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(v.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",this.#Yn,{signal:t}),this.editorDiv.addEventListener("focus",this.#Xn,{signal:t}),this.editorDiv.addEventListener("blur",this.#qn,{signal:t}),this.editorDiv.addEventListener("input",this.#Kn,{signal:t}),this.editorDiv.addEventListener("paste",this.#Zn,{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Qn),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#Yn),this.editorDiv.removeEventListener("focus",this.#Xn),this.editorDiv.removeEventListener("blur",this.#qn),this.editorDiv.removeEventListener("input",this.#Kn),this.editorDiv.removeEventListener("paste",this.#Zn),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ss(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(os.#rs(e));return t.join("\n")}#ns(){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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#Jn,e=this.#Jn=this.#ss().trimEnd();if(t===e)return;const i=t=>{this.#Jn=t,t?(this.#as(),this._uiManager.rebuild(this),this.#ns()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#ns()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){os._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)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Qn),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),we._l10nPromise.get("pdfjs-free-text-default-content").then((t=>this.editorDiv?.setAttribute("default-content",t))),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Ln}px * var(--scale-factor))`,i.color=this.#bn,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),ue(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=this.#ts;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.setAt(t*i,e*n,this.width*i,this.height*n);this.#as(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#rs(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(as,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=os.#os(e.getData("text")||"").replaceAll(as,"\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,l=[],h=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(h.push(a.nodeValue.slice(o).replaceAll(as,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(os.#rs(i)):e=h}l.push(a.nodeValue.slice(0,o).replaceAll(as,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=h),t.push(os.#rs(i))}this.#Jn=`${l.join("\n")}${n}${h.join("\n")}`,this.#as();const c=new Range;let d=l.reduce(((t,e)=>t+e.length),0);for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(d<=t){c.setStart(u,d),c.setEnd(u,d);break}d-=t}s.removeAllRanges(),s.addRange(c)}#as(){if(this.editorDiv.replaceChildren(),this.#Jn)for(const t of this.#Jn.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#ls(){return this.#Jn.replaceAll("\xa0"," ")}static#os(t){return t.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof $n){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:r,id:a},textContent:o,textPosition:l,parent:{page:{pageNumber:h}}}=t;if(!o||0===o.length)return null;n=t={annotationType:v.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:h-1,rect:s.slice(0),rotation:r,id:a,deleted:!1}}const s=super.deserialize(t,e,i);return s.#Ln=t.fontSize,s.#bn=Et.makeHexColor(...t.color),s.#Jn=os.#os(t.value),s.annotationElementId=t.id||null,s.#ts=n,s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=os._internalPadding*this.parentScale,i=this.getRect(e,e),n=we._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#bn),s={annotationType:v.FREETEXT,color:n,fontSize:this.#Ln,value:this.#ls(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!this.#hs(s)?null:(s.id=this.annotationElementId,s)}#hs(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this.#ts;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==n[e]))||t.pageIndex!==s}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#Ln}px * var(--scale-factor))`,i.color=this.#bn,e.replaceChildren();for(const s of this.#Jn.split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=os._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#Jn}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class ls{#cs;#ds=[];#us=[];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],s=1/0,r=-1/0,a=1/0,o=-1/0;const l=10**-4;for(const{x:f,y:m,width:v,height:b}of t){const t=Math.floor((f-e)/l)*l,i=Math.ceil((f+v+e)/l)*l,n=Math.floor((m-e)/l)*l,h=Math.ceil((m+b+e)/l)*l,c=[t,n,h,!0],d=[i,n,h,!1];this.#ds.push(c,d),s=Math.min(s,t),r=Math.max(r,i),a=Math.min(a,n),o=Math.max(o,h)}const h=r-s+2*i,c=o-a+2*i,d=s-i,u=a-i,p=this.#ds.at(n?-1:-2),g=[p[0],p[2]];for(const f of this.#ds){const[t,e,i]=f;f[0]=(t-d)/h,f[1]=(e-u)/c,f[2]=(i-u)/c}this.#cs={x:d,y:u,width:h,height:c,lastPoint:g}}getOutlines(){this.#ds.sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of this.#ds)e[3]?(t.push(...this.#ps(e)),this.#gs(e)):(this.#fs(e),t.push(...this.#ps(e)));return this.#ms(t)}#ms(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 cs(n,this.#cs)}#vs(t){const e=this.#us;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}#gs(t){let[,e,i]=t;const n=this.#vs(e);this.#us.splice(n,0,[e,i])}#fs(t){let[,e,i]=t;const n=this.#vs(e);for(let s=n;s<this.#us.length;s++){const[t,n]=this.#us[s];if(t!==e)break;if(t===e&&n===i)return void this.#us.splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=this.#us[s];if(t!==e)break;if(t===e&&n===i)return void this.#us.splice(s,1)}}#ps(t){const[e,i,n]=t,s=[[e,i,n]],r=this.#vs(n);for(let a=0;a<r;a++){const[t,i]=this.#us[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}}class hs{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof us}}class cs extends hs{#cs;#bs;constructor(t,e){super(),this.#bs=t,this.#cs=e}toSVGPath(){const t=[];for(const e of this.#bs){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${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 this.#bs){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 this.#cs}}class ds{#cs;#ys=[];#ws;#As;#Es=[];#_s=(()=>new Float64Array(18))();#xs;#Cs;#Ss;#Ts;#Ms;#Ps;#ks=[];static#Ls=8;static#Rs=2;static#Is=(()=>ds.#Ls+ds.#Rs)();constructor(t,e,i,n,s){let{x:r,y:a}=t,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.#cs=e,this.#Ps=n*i,this.#As=s,this.#_s.set([NaN,NaN,NaN,NaN,r,a],6),this.#ws=o,this.#Ts=ds.#Ls*i,this.#Ss=ds.#Is*i,this.#Ms=i,this.#ks.push(r,a)}get free(){return!0}isEmpty(){return isNaN(this.#_s[8])}#Fs(){const t=this.#_s.subarray(4,6),e=this.#_s.subarray(16,18),[i,n,s,r]=this.#cs;return[(this.#xs+(t[0]-e[0])/2-i)/s,(this.#Cs+(t[1]-e[1])/2-n)/r,(this.#xs+(e[0]-t[0])/2-i)/s,(this.#Cs+(e[1]-t[1])/2-n)/r]}add(t){let{x:e,y:i}=t;this.#xs=e,this.#Cs=i;const[n,s,r,a]=this.#cs;let[o,l,h,c]=this.#_s.subarray(8,12);const d=e-h,u=i-c,p=Math.hypot(d,u);if(p<this.#Ss)return!1;const g=p-this.#Ts,f=g/p,m=f*d,v=f*u;let b=o,y=l;o=h,l=c,h+=m,c+=v,this.#ks?.push(e,i);const w=m/g,A=-v/g*this.#Ps,E=w*this.#Ps;if(this.#_s.set(this.#_s.subarray(2,8),0),this.#_s.set([h+A,c+E],4),this.#_s.set(this.#_s.subarray(14,18),12),this.#_s.set([h-A,c-E],16),isNaN(this.#_s[6]))return 0===this.#Es.length&&(this.#_s.set([o+A,l+E],2),this.#Es.push(NaN,NaN,NaN,NaN,(o+A-n)/r,(l+E-s)/a),this.#_s.set([o-A,l-E],14),this.#ys.push(NaN,NaN,NaN,NaN,(o-A-n)/r,(l-E-s)/a)),this.#_s.set([b,y,o,l,h,c],6),!this.isEmpty();this.#_s.set([b,y,o,l,h,c],6);return Math.abs(Math.atan2(y-l,b-o)-Math.atan2(v,m))<Math.PI/2?([o,l,h,c]=this.#_s.subarray(2,6),this.#Es.push(NaN,NaN,NaN,NaN,((o+h)/2-n)/r,((l+c)/2-s)/a),[o,l,b,y]=this.#_s.subarray(14,18),this.#ys.push(NaN,NaN,NaN,NaN,((b+o)/2-n)/r,((y+l)/2-s)/a),!0):([b,y,o,l,h,c]=this.#_s.subarray(0,6),this.#Es.push(((b+5*o)/6-n)/r,((y+5*l)/6-s)/a,((5*o+h)/6-n)/r,((5*l+c)/6-s)/a,((o+h)/2-n)/r,((l+c)/2-s)/a),[h,c,o,l,b,y]=this.#_s.subarray(12,18),this.#ys.push(((b+5*o)/6-n)/r,((y+5*l)/6-s)/a,((5*o+h)/6-n)/r,((5*l+c)/6-s)/a,((o+h)/2-n)/r,((l+c)/2-s)/a),!0)}toSVGPath(){if(this.isEmpty())return"";const t=this.#Es,e=this.#ys,i=this.#_s.subarray(4,6),n=this.#_s.subarray(16,18),[s,r,a,o]=this.#cs,[l,h,c,d]=this.#Fs();if(isNaN(this.#_s[6])&&!this.isEmpty())return`M${(this.#_s[2]-s)/a} ${(this.#_s[3]-r)/o} L${(this.#_s[4]-s)/a} ${(this.#_s[5]-r)/o} L${l} ${h} L${c} ${d} L${(this.#_s[16]-s)/a} ${(this.#_s[17]-r)/o} L${(this.#_s[14]-s)/a} ${(this.#_s[15]-r)/o} Z`;const u=[];u.push(`M${t[4]} ${t[5]}`);for(let p=6;p<t.length;p+=6)isNaN(t[p])?u.push(`L${t[p+4]} ${t[p+5]}`):u.push(`C${t[p]} ${t[p+1]} ${t[p+2]} ${t[p+3]} ${t[p+4]} ${t[p+5]}`);u.push(`L${(i[0]-s)/a} ${(i[1]-r)/o} L${l} ${h} L${c} ${d} L${(n[0]-s)/a} ${(n[1]-r)/o}`);for(let p=e.length-6;p>=6;p-=6)isNaN(e[p])?u.push(`L${e[p+4]} ${e[p+5]}`):u.push(`C${e[p]} ${e[p+1]} ${e[p+2]} ${e[p+3]} ${e[p+4]} ${e[p+5]}`);return u.push(`L${e[4]} ${e[5]} Z`),u.join(" ")}getOutlines(){const t=this.#Es,e=this.#ys,i=this.#_s,n=i.subarray(4,6),s=i.subarray(16,18),[r,a,o,l]=this.#cs,h=new Float64Array((this.#ks?.length??0)+2);for(let m=0,v=h.length-2;m<v;m+=2)h[m]=(this.#ks[m]-r)/o,h[m+1]=(this.#ks[m+1]-a)/l;h[h.length-2]=(this.#xs-r)/o,h[h.length-1]=(this.#Cs-a)/l;const[c,d,u,p]=this.#Fs();if(isNaN(i[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(i[2]-r)/o,(i[3]-a)/l,NaN,NaN,NaN,NaN,(i[4]-r)/o,(i[5]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,(i[16]-r)/o,(i[17]-a)/l,NaN,NaN,NaN,NaN,(i[14]-r)/o,(i[15]-a)/l],0),new us(t,h,this.#cs,this.#Ms,this.#ws,this.#As)}const g=new Float64Array(this.#Es.length+24+this.#ys.length);let f=t.length;for(let m=0;m<f;m+=2)isNaN(t[m])?g[m]=g[m+1]=NaN:(g[m]=t[m],g[m+1]=t[m+1]);g.set([NaN,NaN,NaN,NaN,(n[0]-r)/o,(n[1]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,u,p,NaN,NaN,NaN,NaN,(s[0]-r)/o,(s[1]-a)/l],f),f+=24;for(let m=e.length-6;m>=6;m-=6)for(let t=0;t<6;t+=2)isNaN(e[m+t])?(g[f]=g[f+1]=NaN,f+=2):(g[f]=e[m+t],g[f+1]=e[m+t+1],f+=2);return g.set([NaN,NaN,NaN,NaN,e[4],e[5]],f),new us(g,h,this.#cs,this.#Ms,this.#ws,this.#As)}}class us extends hs{#cs;#Ds=null;#ws;#As;#ks;#Ms;#Ns;constructor(t,e,i,n,s,r){super(),this.#Ns=t,this.#ks=e,this.#cs=i,this.#Ms=n,this.#ws=s,this.#As=r,this.#Os(r);const{x:a,y:o,width:l,height:h}=this.#Ds;for(let c=0,d=t.length;c<d;c+=2)t[c]=(t[c]-a)/l,t[c+1]=(t[c+1]-o)/h;for(let c=0,d=e.length;c<d;c+=2)e[c]=(e[c]-a)/l,e[c+1]=(e[c+1]-o)/h}toSVGPath(){const t=[`M${this.#Ns[4]} ${this.#Ns[5]}`];for(let e=6,i=this.#Ns.length;e<i;e+=6)isNaN(this.#Ns[e])?t.push(`L${this.#Ns[e+4]} ${this.#Ns[e+5]}`):t.push(`C${this.#Ns[e]} ${this.#Ns[e+1]} ${this.#Ns[e+2]} ${this.#Ns[e+3]} ${this.#Ns[e+4]} ${this.#Ns[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=this.#Hs(this.#Ns,i,r,a,-o),h=this.#Hs(this.#ks,i,r,a,-o);break;case 90:l=this.#Bs(this.#Ns,i,n,a,o),h=this.#Bs(this.#ks,i,n,a,o);break;case 180:l=this.#Hs(this.#Ns,s,n,-a,o),h=this.#Hs(this.#ks,s,n,-a,o);break;case 270:l=this.#Bs(this.#Ns,s,r,-a,-o),h=this.#Bs(this.#ks,s,r,-a,-o)}return{outline:Array.from(l),points:[Array.from(h)]}}#Hs(t,e,i,n,s){const r=new Float64Array(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}#Bs(t,e,i,n,s){const r=new Float64Array(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}#Os(t){const e=this.#Ns;let i=e[4],n=e[5],s=i,r=n,a=i,o=n,l=i,h=n;const c=t?Math.max:Math.min;for(let f=6,m=e.length;f<m;f+=6){if(isNaN(e[f]))s=Math.min(s,e[f+4]),r=Math.min(r,e[f+5]),a=Math.max(a,e[f+4]),o=Math.max(o,e[f+5]),h<e[f+5]?(l=e[f+4],h=e[f+5]):h===e[f+5]&&(l=c(l,e[f+4]));else{const t=Et.bezierBoundingBox(i,n,...e.slice(f,f+6));s=Math.min(s,t[0]),r=Math.min(r,t[1]),a=Math.max(a,t[2]),o=Math.max(o,t[3]),h<t[3]?(l=t[2],h=t[3]):h===t[3]&&(l=c(l,t[2]))}i=e[f+4],n=e[f+5]}const d=s-this.#ws,u=r-this.#ws,p=a-s+2*this.#ws,g=o-r+2*this.#ws;this.#Ds={x:d,y:u,width:p,height:g,lastPoint:[l,h]}}get box(){return this.#Ds}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=this.#Ds,[a,o,l,h]=this.#cs,c=s*l,d=r*h,u=i*l+a,p=n*h+o,g=new ds({x:this.#ks[0]*c+u,y:this.#ks[1]*d+p},this.#cs,this.#Ms,t,this.#As,e??this.#ws);for(let f=2;f<this.#ks.length;f+=2)g.add({x:this.#ks[f]*c+u,y:this.#ks[f+1]*d+p});return g.getOutlines()}}class ps{#cn=this.#dn.bind(this);#zs=this.#o.bind(this);#js=null;#Us=null;#Vs;#Gs=null;#$s=!1;#Ws=!1;#r=null;#qs;#p=null;#Xs;static get _keyboardManager(){return lt(this,"_keyboardManager",new me([[["Escape","mac+Escape"],ps.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ps.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ps.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ps.prototype._moveToPrevious],[["Home","mac+Home"],ps.prototype._moveToBeginning],[["End","mac+End"],ps.prototype._moveToEnd]]))}constructor(t){let{editor:e=null,uiManager:i=null}=t;e?(this.#Ws=!1,this.#Xs=b.HIGHLIGHT_COLOR,this.#r=e):(this.#Ws=!0,this.#Xs=b.HIGHLIGHT_DEFAULT_COLOR),this.#p=e?._uiManager||i,this.#qs=this.#p._eventBus,this.#Vs=e?.color||this.#p?.highlightColors.values().next().value||"#FFFF98"}renderButton(){const t=this.#js=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=this.#p._signal;t.addEventListener("click",this.#Ks.bind(this),{signal:e}),t.addEventListener("keydown",this.#cn,{signal:e});const i=this.#Us=document.createElement("span");return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=this.#Vs,t.append(i),t}renderMainDropdown(){const t=this.#Gs=this.#Ys();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#Ys(){const t=document.createElement("div"),e=this.#p._signal;t.addEventListener("contextmenu",ee,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of this.#p.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",`pdfjs-editor-colorpicker-${i}`);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===this.#Vs),s.addEventListener("click",this.#Zs.bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",this.#cn,{signal:e}),t}#Zs(t,e){e.stopPropagation(),this.#qs.dispatch("switchannotationeditorparams",{source:this,type:this.#Xs,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#js)return void this.#Ks(t);const e=t.target.getAttribute("data-color");e&&this.#Zs(e,t)}_moveToNext(t){this.#Js?t.target!==this.#js?t.target.nextSibling?.focus():this.#Gs.firstChild?.focus():this.#Ks(t)}_moveToPrevious(t){t.target!==this.#Gs?.firstChild&&t.target!==this.#js?(this.#Js||this.#Ks(t),t.target.previousSibling?.focus()):this.#Js&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Js?this.#Gs.firstChild?.focus():this.#Ks(t)}_moveToEnd(t){this.#Js?this.#Gs.lastChild?.focus():this.#Ks(t)}#dn(t){ps._keyboardManager.exec(this,t)}#Ks(t){if(this.#Js)return void this.hideDropdown();if(this.#$s=0===t.detail,window.addEventListener("pointerdown",this.#zs,{signal:this.#p._signal}),this.#Gs)return void this.#Gs.classList.remove("hidden");const e=this.#Gs=this.#Ys();this.#js.append(e)}#o(t){this.#Gs?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Gs?.classList.add("hidden"),window.removeEventListener("pointerdown",this.#zs)}get#Js(){return this.#Gs&&!this.#Gs.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Ws||(this.#Js?(this.hideDropdown(),this.#js.focus({preventScroll:!0,focusVisible:this.#$s})):this.#r?.unselect())}updateColor(t){if(this.#Us&&(this.#Us.style.backgroundColor=t),!this.#Gs)return;const e=this.#p.highlightColors.values();for(const i of this.#Gs.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#js?.remove(),this.#js=null,this.#Us=null,this.#Gs?.remove(),this.#Gs=null}}class gs extends we{#Qs=null;#tr=0;#er;#ir=null;#s=null;#nr=null;#sr=null;#rr=0;#ar=null;#or=null;#v=null;#lr=!1;#ot=this.#hr.bind(this);#cr=null;#dr;#ur=null;#pr="";#Ps;#gr="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _l10nPromise;static _type="highlight";static _editorType=(()=>v.HIGHLIGHT)();static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=gs.prototype;return lt(this,"_keyboardManager",new me([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||gs._defaultColor,this.#Ps=t.thickness||gs._defaultThickness,this.#dr=t.opacity||gs._defaultOpacity,this.#er=t.boxes||null,this.#gr=t.methodOfCreation||"",this.#pr=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#lr=!0,this.#fr(t),this.#mr()):(this.#Qs=t.anchorNode,this.#tr=t.anchorOffset,this.#sr=t.focusNode,this.#rr=t.focusOffset,this.#vr(),this.#mr(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#lr?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#Ps,methodOfCreation:this.#gr}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#vr(){const t=new ls(this.#er,.001);this.#or=t.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#or.box);const e=new ls(this.#er,.0025,.001,"ltr"===this._uiManager.direction);this.#nr=e.getOutlines();const{lastPoint:i}=this.#nr.box;this.#cr=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#fr(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;this.#or=e;if(this.#nr=e.getNewOutline(this.#Ps/2+1.5,.0025),i>=0)this.#v=i,this.#ir=n,this.parent.drawLayer.finalizeLine(i,e),this.#ur=this.parent.drawLayer.highlightOutline(this.#nr);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#v,e),this.parent.drawLayer.updateBox(this.#v,gs.#br(this.#or.box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#ur,this.#nr),this.parent.drawLayer.updateBox(this.#ur,gs.#br(this.#nr.box,t))}const{x:s,y:r,width:a,height: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{lastPoint:l}=this.#nr.box;this.#cr=[(l[0]-s)/a,(l[1]-r)/o]}static initialize(t,e){we.initialize(t,e),gs._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case b.HIGHLIGHT_DEFAULT_COLOR:gs._defaultColor=e;break;case b.HIGHLIGHT_THICKNESS:gs._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#cr}updateParams(t,e){switch(t){case b.HIGHLIGHT_COLOR:this.#is(e);break;case b.HIGHLIGHT_THICKNESS:this.#yr(e)}}static get defaultPropertiesToUpdate(){return[[b.HIGHLIGHT_DEFAULT_COLOR,gs._defaultColor],[b.HIGHLIGHT_THICKNESS,gs._defaultThickness]]}get propertiesToUpdate(){return[[b.HIGHLIGHT_COLOR,this.color||gs._defaultColor],[b.HIGHLIGHT_THICKNESS,this.#Ps||gs._defaultThickness],[b.HIGHLIGHT_FREE,this.#lr]]}#is(t){const e=t=>{this.color=t,this.parent?.drawLayer.changeColor(this.#v,t),this.#s?.updateColor(t)},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:b.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#yr(t){const e=this.#Ps,i=t=>{this.#Ps=t,this.#wr(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#s=new ps({editor:this}),t.addColorPicker(this.#s)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Ar())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#Ar())}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#Er(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#mr(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#Er():t&&(this.#mr(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#wr(t){if(!this.#lr)return;this.#fr({highlightOutlines:this.#or.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#Er(){null!==this.#v&&this.parent&&(this.parent.drawLayer.remove(this.#v),this.#v=null,this.parent.drawLayer.remove(this.#ur),this.#ur=null)}#mr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===this.#v&&(({id:this.#v,clipPathId:this.#ir}=t.drawLayer.highlight(this.#or,this.color,this.#dr)),this.#ur=t.drawLayer.highlightOutline(this.#nr),this.#ar&&(this.#ar.style.clipPath=this.#ir))}static#br(t,e){let{x:i,y:n,width:s,height:r}=t;switch(e){case 90:return{x:1-n-r,y:i,width:r,height:s};case 180:return{x:1-i-s,y:1-n-r,width:s,height:r};case 270:return{x:n,y:1-i-s,width:r,height:s}}return{x:i,y:n,width:s,height:r}}rotate(t){const{drawLayer:e}=this.parent;let i;this.#lr?(t=(t-this.rotation+360)%360,i=gs.#br(this.#or.box,t)):i=gs.#br(this,t),e.rotate(this.#v,t),e.rotate(this.#ur,t),e.updateBox(this.#v,i),e.updateBox(this.#ur,gs.#br(this.#nr.box,t))}render(){if(this.div)return this.div;const t=super.render();this.#pr&&(t.setAttribute("aria-label",this.#pr),t.setAttribute("role","mark")),this.#lr?t.classList.add("free"):this.div.addEventListener("keydown",this.#ot,{signal:this._uiManager._signal});const e=this.#ar=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#ir;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),ue(this,this.#ar,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(this.#ur,"hovered")}pointerleave(){this.parent.drawLayer.removeClass(this.#ur,"hovered")}#hr(t){gs._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#_r(!0);break;case 1:case 3:this.#_r(!1)}}#_r(t){if(!this.#Qs)return;const e=window.getSelection();t?e.setPosition(this.#Qs,this.#tr):e.setPosition(this.#sr,this.#rr)}select(){super.select(),this.#ur&&(this.parent?.drawLayer.removeClass(this.#ur,"hovered"),this.parent?.drawLayer.addClass(this.#ur,"selected"))}unselect(){super.unselect(),this.#ur&&(this.parent?.drawLayer.removeClass(this.#ur,"selected"),this.#lr||this.#_r(!1))}get _mustFixPosition(){return!this.#lr}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show(this.#v,t),this.parent.drawLayer.show(this.#ur,t))}#Ar(){return this.#lr?this.rotation:0}#xr(){if(this.#lr)return null;const[t,e]=this.pageDimensions,i=this.#er,n=new Float32Array(8*i.length);let s=0;for(const{x:r,y:a,width:o,height:l}of i){const i=r*t,h=(1-a-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=h,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=h+l*e,s+=8}return n}#Cr(t){return this.#or.serialize(t,this.#Ar())}static startHighlighting(t,e,i){let{target:n,x:s,y:r}=i;const{x:a,y:o,width:l,height:h}=n.getBoundingClientRect(),c=e=>{this.#Sr(t,e)},d=t._signal,u={capture:!0,passive:!1,signal:d},p=t=>{t.preventDefault(),t.stopPropagation()},g=e=>{n.removeEventListener("pointermove",c),window.removeEventListener("blur",g),window.removeEventListener("pointerup",g),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",ee),this.#Tr(t,e)};window.addEventListener("blur",g,{signal:d}),window.addEventListener("pointerup",g,{signal:d}),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",ee,{signal:d}),n.addEventListener("pointermove",c,{signal:d}),this._freeHighlight=new ds({x:s,y:r},[a,o,l,h],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#Sr(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#Tr(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(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=""}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,r,a,o],color:l,quadPoints:h}=t;n.color=Et.makeHexColor(...l),n.#dr=t.opacity;const[c,d]=n.pageDimensions;n.width=(a-s)/c,n.height=(o-r)/d;const u=n.#er=[];for(let p=0;p<h.length;p+=8)u.push({x:(h[4]-a)/c,y:(o-(1-h[p+5]))/d,width:(h[p+2]-h[p])/c,height:(h[p+5]-h[p+1])/d});return n.#vr(),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=we._colorManager.convert(this.color);return{annotationType:v.HIGHLIGHT,color:i,opacity:this.#dr,thickness:this.#Ps,quadPoints:this.#xr(),outlines:this.#Cr(e),pageIndex:this.pageIndex,rect:e,rotation:this.#Ar(),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}class fs extends we{#Mr=0;#Pr=0;#kr=this.canvasPointermove.bind(this);#Lr=this.canvasPointerleave.bind(this);#Rr=this.canvasPointerup.bind(this);#Ir=this.canvasPointerdown.bind(this);#Fr=null;#Dr=(()=>new Path2D)();#Nr=!1;#Or=!1;#Hr=!1;#Br=null;#zr=0;#jr=0;#Ur=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=(()=>v.INK)();constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){we.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case b.INK_THICKNESS:fs._defaultThickness=e;break;case b.INK_COLOR:fs._defaultColor=e;break;case b.INK_OPACITY:fs._defaultOpacity=e/100}}updateParams(t,e){switch(t){case b.INK_THICKNESS:this.#yr(e);break;case b.INK_COLOR:this.#is(e);break;case b.INK_OPACITY:this.#Vr(e)}}static get defaultPropertiesToUpdate(){return[[b.INK_THICKNESS,fs._defaultThickness],[b.INK_COLOR,fs._defaultColor||we._defaultLineColor],[b.INK_OPACITY,Math.round(100*fs._defaultOpacity)]]}get propertiesToUpdate(){return[[b.INK_THICKNESS,this.thickness||fs._defaultThickness],[b.INK_COLOR,this.color||fs._defaultColor||we._defaultLineColor],[b.INK_OPACITY,Math.round(100*(this.opacity??fs._defaultOpacity))]]}#yr(t){const e=t=>{this.thickness=t,this.#Gr()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#is(t){const e=t=>{this.color=t,this.#$r()},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:b.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vr(t){const e=t=>{this.opacity=t,this.#$r()};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:b.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#Wr(),this.#qr()),this.isAttachedToDOM||(this.parent.add(this),this.#Xr()),this.#Gr()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Fr&&(clearTimeout(this.#Fr),this.#Fr=null),this.#Br?.disconnect(),this.#Br=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){this.#Nr||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ir,{signal:this._uiManager._signal}))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ir))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Kr(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#Yr(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i)}`}#Zr(t,e){const i=this._uiManager._signal;this.canvas.addEventListener("contextmenu",ee,{signal:i}),this.canvas.addEventListener("pointerleave",this.#Lr,{signal:i}),this.canvas.addEventListener("pointermove",this.#kr,{signal:i}),this.canvas.addEventListener("pointerup",this.#Rr,{signal:i}),this.canvas.removeEventListener("pointerdown",this.#Ir),this.isEditing=!0,this.#Hr||(this.#Hr=!0,this.#Xr(),this.thickness||=fs._defaultThickness,this.color||=fs._defaultColor||we._defaultLineColor,this.opacity??=fs._defaultOpacity),this.currentPath.push([t,e]),this.#Or=!1,this.#Yr(),this.#Ur=()=>{this.#Jr(),this.#Ur&&window.requestAnimationFrame(this.#Ur)},window.requestAnimationFrame(this.#Ur)}#Qr(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let r=this.#Dr;if(s.push([t,e]),this.#Or=!0,s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&(this.#Dr=r=new Path2D,r.moveTo(...s[0])),this.#ta(r,...s.at(-3),...s.at(-2),t,e)}#ea(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#Dr.lineTo(...t)}#ia(t,e){let i;if(this.#Ur=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#Qr(t,e),this.#ea(),1!==this.currentPath.length)i=this.#na();else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=this.#Dr,s=this.currentPath;this.currentPath=[],this.#Dr=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Wr(),this.#qr()),this.#Gr())},mustExec:!0})}#Jr(){if(!this.#Or)return;this.#Or=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map((t=>t[0])),n=e.map((t=>t[1])),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const r of this.bezierPath2D)s.stroke(r);s.stroke(this.#Dr),s.restore()}#ta(t,e,i,n,s,r,a){const o=(e+n)/2,l=(i+s)/2,h=(n+r)/2,c=(s+a)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,h+2*(n-h)/3,c+2*(s-c)/3,h,c)}#na(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[r,a]=t[i],[o,l]=t[i+1],h=(r+o)/2,c=(a+l)/2,d=[n+2*(r-n)/3,s+2*(a-s)/3],u=[h+2*(r-h)/3,c+2*(a-c)/3];e.push([[n,s],d,u,[h,c]]),[n,s]=[h,c]}const[r,a]=t[i],[o,l]=t[i+1],h=[n+2*(r-n)/3,s+2*(a-s)/3],c=[o+2*(r-o)/3,l+2*(a-l)/3];return e.push([[n,s],h,c,[o,l]]),e}#$r(){if(this.isEmpty())return void this.#sa();this.#Yr();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#sa();for(const i of this.bezierPath2D)e.stroke(i)}commit(){this.#Nr||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Nr=!0,this.div.classList.add("disabled"),this.#Gr(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#Nr&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#Zr(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#Qr(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#ra(t)}canvasPointerleave(t){this.#ra(t)}#ra(t){this.canvas.removeEventListener("pointerleave",this.#Lr),this.canvas.removeEventListener("pointermove",this.#kr),this.canvas.removeEventListener("pointerup",this.#Rr),this.canvas.addEventListener("pointerdown",this.#Ir,{signal:this._uiManager._signal}),this.#Fr&&clearTimeout(this.#Fr),this.#Fr=setTimeout((()=>{this.#Fr=null,this.canvas.removeEventListener("contextmenu",ee)}),10),this.#ia(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Wr(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#qr(){this.#Br=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),this.#Br.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Br?.disconnect(),this.#Br=null}),{once:!0})}get isResizable(){return!this.isEmpty()&&this.#Nr}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,r]=this.#Kr();if(this.setAt(i,n,0,0),this.setDims(s,r),this.#Wr(),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),this.#Hr=!0,this.#Xr(),this.setDims(this.width*i,this.height*n),this.#$r(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#qr(),this.div}#Xr(){if(!this.#Hr)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#sa()}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(this.#zr===i&&this.#jr===n)return;this.#zr=i,this.#jr=n,this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),this.#Nr&&this.#aa(t,e),this.#Xr(),this.#$r(),this.canvas.style.visibility="visible",this.fixDims()}#aa(t,e){const i=this.#oa(),n=(t-i)/this.#Pr,s=(e-i)/this.#Mr;this.scaleFactor=Math.min(n,s)}#sa(){const t=this.#oa()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#la(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,r,a]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],r[0],r[1],a[0],a[1])}return e}static#ha(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}static#ca(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=r-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}#da(t,e,i,n){const s=[],r=this.thickness/2,a=t*e+r,o=t*i+r;for(const l of this.paths){const e=[],i=[];for(let n=0,s=l.length;n<s;n++){const[r,h,c,d]=l[n];if(r[0]===d[0]&&r[1]===d[1]&&1===s){const n=t*r[0]+a,s=t*r[1]+o;e.push(n,s),i.push(n,s);break}const u=t*r[0]+a,p=t*r[1]+o,g=t*h[0]+a,f=t*h[1]+o,m=t*c[0]+a,v=t*c[1]+o,b=t*d[0]+a,y=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(g,f,m,v,b,y),i.push(g,f),n===s-1&&i.push(b,y)}s.push({bezier:fs.#ha(e,n,this.rotation),points:fs.#ha(i,n,this.rotation)})}return s}#ua(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,o,l]of s){const s=Et.bezierBoundingBox(...r,...a,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}#oa(){return this.#Nr?Math.ceil(this.thickness*this.parentScale):0}#Gr(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#Nr)return void this.#$r();const e=this.#ua(),i=this.#oa();this.#Pr=Math.max(we.MIN_SIZE,e[2]-e[0]),this.#Mr=Math.max(we.MIN_SIZE,e[3]-e[1]);const n=Math.ceil(i+this.#Pr*this.scaleFactor),s=Math.ceil(i+this.#Mr*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r,this.height=s/a,this.setAspectRatio(n,s);const o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#Xr(),this.#$r(),this.#zr=n,this.#jr=s,this.setDims(n,s);const h=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-h,l-this.translationY-h)}static deserialize(t,e,i){if(t instanceof Jn)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=Et.makeHexColor(...t.color),n.opacity=t.opacity;const[s,r]=n.pageDimensions,a=n.width*s,o=n.height*r,l=n.parentScale,h=t.thickness/2;n.#Nr=!0,n.#zr=Math.round(a),n.#jr=Math.round(o);const{paths:c,rect:d,rotation:u}=t;for(let{bezier:g}of c){g=fs.#ca(g,d,u);const t=[];n.paths.push(t);let e=l*(g[0]-h),i=l*(g[1]-h);for(let n=2,r=g.length;n<r;n+=6){const s=l*(g[n]-h),r=l*(g[n+1]-h),a=l*(g[n+2]-h),o=l*(g[n+3]-h),c=l*(g[n+4]-h),d=l*(g[n+5]-h);t.push([[e,i],[s,r],[a,o],[c,d]]),e=c,i=d}const s=this.#la(t);n.bezierPath2D.push(s)}const p=n.#ua();return n.#Pr=Math.max(we.MIN_SIZE,p[2]-p[0]),n.#Mr=Math.max(we.MIN_SIZE,p[3]-p[1]),n.#aa(a,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=we._colorManager.convert(this.ctx.strokeStyle);return{annotationType:v.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#da(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class ms extends we{#pa=null;#ga=null;#fa=null;#ma=null;#va=null;#ba="";#ya=null;#Br=null;#wa=null;#Aa=!1;#Ea=!1;static _type="stamp";static _editorType=(()=>v.STAMP)();constructor(t){super({...t,name:"stampEditor"}),this.#ma=t.bitmapUrl,this.#va=t.bitmapFile}static initialize(t,e){we.initialize(t,e)}static get supportedTypes(){return lt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return lt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(v.STAMP,{bitmapFile:t.getAsFile()})}#_a(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(this.#pa=t.bitmap,e||(this.#ga=t.id,this.#Aa=t.isSvg),t.file&&(this.#ba=t.file.name),this.#Wr()):this.remove()}#xa(){this.#fa=null,this._uiManager.enableWaiting(!1),this.#ya&&this.div.focus()}#Ca(){if(this.#ga)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#ga).then((t=>this.#_a(t,!0))).finally((()=>this.#xa()));if(this.#ma){const t=this.#ma;return this.#ma=null,this._uiManager.enableWaiting(!0),void(this.#fa=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#_a(t))).finally((()=>this.#xa())))}if(this.#va){const t=this.#va;return this.#va=null,this._uiManager.enableWaiting(!0),void(this.#fa=this._uiManager.imageManager.getFromFile(t).then((t=>this.#_a(t))).finally((()=>this.#xa())))}const t=document.createElement("input");t.type="file",t.accept=ms.supportedTypesStr;const e=this._uiManager._signal;this.#fa=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.#_a(e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>this.#xa())),t.click()}remove(){this.#ga&&(this.#pa=null,this._uiManager.imageManager.deleteId(this.#ga),this.#ya?.remove(),this.#ya=null,this.#Br?.disconnect(),this.#Br=null,this.#wa&&(clearTimeout(this.#wa),this.#wa=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#ga&&null===this.#ya&&this.#Ca(),this.isAttachedToDOM||this.parent.add(this))):this.#ga&&this.#Ca()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#fa||this.#pa||this.#ma||this.#va||this.#ga)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#pa?this.#Wr():this.#Ca(),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}#Wr(){const{div:t}=this;let{width:e,height:i}=this.#pa;const[n,s]=this.pageDimensions,r=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>r*n||i>r*s){const t=Math.min(r*n/e,r*s/i);e*=t,i*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/n,i*o/s),this._uiManager.enableWaiting(!1);const l=this.#ya=document.createElement("canvas");t.append(l),t.hidden=!1,this.#Sa(e,i),this.#qr(),this.#Ea||(this.parent.addUndoableEditor(this),this.#Ea=!0),this._reportTelemetry({action:"inserted_image"}),this.#ba&&l.setAttribute("aria-label",this.#ba)}#Ta(t,e){const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#wa&&clearTimeout(this.#wa);this.#wa=setTimeout((()=>{this.#wa=null,this.#Sa(t,e)}),200)}#Ma(t,e){const{width:i,height:n}=this.#pa;let s=i,r=n,a=this.#pa;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}#Sa(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=this.#ya;if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=this.#Aa?this.#pa:this.#Ma(t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=t?.output||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(n,0,0,n.width,n.height,0,0,t,e)}getImageForAltText(){return this.#ya}#Pa(t){if(t){if(this.#Aa){const t=this._uiManager.imageManager.getSvgUrl(this.#ga);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#pa);return t.getContext("2d").drawImage(this.#pa,0,0),t.toDataURL()}if(this.#Aa){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*Ut.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*Ut.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(this.#pa,0,0,this.#pa.width,this.#pa.height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(this.#pa)}#qr(){this._uiManager._signal&&(this.#Br=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.#Ta(e.width,e.height)})),this.#Br.observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{this.#Br?.disconnect(),this.#Br=null}),{once:!0}))}static deserialize(t,e,i){if(t instanceof ns)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:r,bitmapId:a,isSvg:o,accessibilityData:l}=t;a&&i.imageManager.isValidId(a)?n.#ga=a:n.#ma=r,n.#Aa=o;const[h,c]=n.pageDimensions;return n.width=(s[2]-s[0])/h,n.height=(s[3]-s[1])/c,l&&(n.altTextData=l),n}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;const i={annotationType:v.STAMP,bitmapId:this.#ga,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Aa,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#Pa(!0),i.accessibilityData=this.altTextData,i;const{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||=new Map;const r=this.#Aa?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#ga)){if(this.#Aa){const t=e.stamps.get(this.#ga);r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Pa(!1))}}else e.stamps.set(this.#ga,{area:r,serialized:i}),i.bitmap=this.#Pa(!1);return i}}class vs{#Un;#ka=!1;#La=null;#Ra=null;#Ia=null;#Fa=null;#Da=null;#Na=(()=>new Map)();#Oa=!1;#Ha=!1;#Ba=!1;#za=null;#p;static _initialized=!1;static#O=(()=>new Map([os,fs,ms,gs].map((t=>[t._editorType,t]))))();constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:h}=t;const c=[...vs.#O.values()];if(!vs._initialized){vs._initialized=!0;for(const t of c)t.initialize(h,e)}e.registerEditorTypes(c),this.#p=e,this.pageIndex=i,this.div=n,this.#Un=s,this.#La=r,this.viewport=l,this.#za=o,this.drawLayer=a,this.#p.addLayer(this)}get isEmpty(){return 0===this.#Na.size}get isInvisible(){return this.isEmpty&&this.#p.getMode()===v.NONE}updateToolbar(t){this.#p.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#p.getMode();switch(this.#ja(),t){case v.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case v.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case v.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;for(const i of vs.#O.values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#za?.div}addInkEditorIfNeeded(t){if(this.#p.getMode()!==v.INK)return;if(!t)for(const e of this.#Na.values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#p.setEditingState(t)}addCommands(t){this.#p.addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#La?.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of this.#Na.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#p.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#La)return;const e=this.#La.getEditableAnnotations();for(const i of e){if(i.hide(),this.#p.isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){this.#Ba=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const n of this.#Na.values())n.disableEditing(),n.annotationElementId&&(null===n.serialize()?(e.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):t.set(n.annotationElementId,n));if(this.#La){const i=this.#La.getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(this.#p.isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(this.#p.addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}this.#ja(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const n of vs.#O.values())i.remove(`${n._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Ba=!1}getEditableAnnotation(t){return this.#La?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#p.getActive()!==t&&this.#p.setActiveEditor(t)}enableTextSelection(){this.div.tabIndex=-1,this.#za?.div&&!this.#Fa&&(this.#Fa=this.#Ua.bind(this),this.#za.div.addEventListener("pointerdown",this.#Fa,{signal:this.#p._signal}),this.#za.div.classList.add("highlighting"))}disableTextSelection(){this.div.tabIndex=0,this.#za?.div&&this.#Fa&&(this.#za.div.removeEventListener("pointerdown",this.#Fa),this.#Fa=null,this.#za.div.classList.remove("highlighting"))}#Ua(t){if(this.#p.unselectAll(),t.target===this.#za.div){const{isMac:e}=wt.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#p.showAllEditors("highlight",!0,!0),this.#za.div.classList.add("free"),gs.startHighlighting(this,"ltr"===this.#p.direction,t),this.#za.div.addEventListener("pointerup",(()=>{this.#za.div.classList.remove("free")}),{once:!0,signal:this.#p._signal}),t.preventDefault()}}enableClick(){if(this.#Ia)return;const t=this.#p._signal;this.#Ia=this.pointerdown.bind(this),this.#Ra=this.pointerup.bind(this),this.div.addEventListener("pointerdown",this.#Ia,{signal:t}),this.div.addEventListener("pointerup",this.#Ra,{signal:t})}disableClick(){this.#Ia&&(this.div.removeEventListener("pointerdown",this.#Ia),this.div.removeEventListener("pointerup",this.#Ra),this.#Ia=null,this.#Ra=null)}attach(t){this.#Na.set(t.id,t);const{annotationElementId:e}=t;e&&this.#p.isDeletedAnnotationElement(e)&&this.#p.removeDeletedAnnotationElement(t)}detach(t){this.#Na.delete(t.id),this.#Un?.removePointerInTextLayer(t.contentDiv),!this.#Ba&&t.annotationElementId&&this.#p.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#p.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#Ha||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#p.addDeletedAnnotationElement(t.annotationElementId),we.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#p.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#p.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Da&&(t._focusEventsAllowed=!1,this.#Da=setTimeout((()=>{this.#Da=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this.#p._signal}),e.focus())}),0)),t._structTreeParentId=this.#Un?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#p.getId()}get#Va(){return vs.#O.get(this.#p.getMode())}get _signal(){return this.#p._signal}#Ga(t){const e=this.#Va;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Va?.canCreateNewEmptyEditor()}pasteEditor(t,e){this.#p.updateToolbar(t),this.#p.updateMode(t);const{offsetX:i,offsetY:n}=this.#$a(),s=this.getNextId(),r=this.#Ga({parent:this,id:s,x:i,y:n,uiManager:this.#p,isCentered:!0,...e});r&&this.add(r)}deserialize(t){return vs.#O.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#p)||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getNextId(),s=this.#Ga({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#p,isCentered:e,...i});return s&&this.add(s),s}#$a(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),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}}addNewEditor(){this.createAndAddNewEditor(this.#$a(),!0)}setSelected(t){this.#p.setSelected(t)}toggleSelected(t){this.#p.toggleSelected(t)}isSelected(t){return this.#p.isSelected(t)}unselect(t){this.#p.unselect(t)}pointerup(t){const{isMac:e}=wt.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&this.#Oa&&(this.#Oa=!1,this.#ka?this.#p.getMode()!==v.STAMP?this.createAndAddNewEditor(t,!1):this.#p.unselectAll():this.#ka=!0)}pointerdown(t){if(this.#p.getMode()===v.HIGHLIGHT&&this.enableTextSelection(),this.#Oa)return void(this.#Oa=!1);const{isMac:e}=wt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Oa=!0;const i=this.#p.getActive();this.#ka=!i||i.isEmpty()}findNewParent(t,e,i){const n=this.#p.findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){this.#p.getActive()?.parent===this&&(this.#p.commitOrRemove(),this.#p.setActiveEditor(null)),this.#Da&&(clearTimeout(this.#Da),this.#Da=null);for(const t of this.#Na.values())this.#Un?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Na.clear(),this.#p.removeLayer(this)}#ja(){this.#Ha=!0;for(const t of this.#Na.values())t.isEmpty()&&t.remove();this.#Ha=!1}render(t){let{viewport:e}=t;this.viewport=e,he(this.div,e);for(const i of this.#p.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;this.#p.commitOrRemove(),this.#ja();const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,he(this.div,{rotation:n}),i!==n)for(const s of this.#Na.values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#p.viewParameters.realScale}}class bs{#En=null;#v=0;#Wa=(()=>new Map)();#qa=(()=>new Map)();constructor(t){let{pageIndex:e}=t;this.pageIndex=e}setParent(t){if(this.#En){if(this.#En!==t){if(this.#Wa.size>0)for(const e of this.#Wa.values())e.remove(),t.append(e);this.#En=t}}else this.#En=t}static get _svgFactory(){return lt(this,"_svgFactory",new Wt)}static#Xa(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"}#Ka(t){const e=bs._svgFactory.create(1,1,!0);return this.#En.append(e),e.setAttribute("aria-hidden",!0),bs.#Xa(e,t),e}#Ya(t,e){const i=bs._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=bs._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n}highlight(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=this.#v++,r=this.#Ka(t.box);r.classList.add("highlight"),t.free&&r.classList.add("free");const a=bs._svgFactory.createElement("defs");r.append(a);const o=bs._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",l),o.setAttribute("d",t.toSVGPath()),n&&this.#qa.set(s,o);const h=this.#Ya(a,l),c=bs._svgFactory.createElement("use");return r.append(c),r.setAttribute("fill",e),r.setAttribute("fill-opacity",i),c.setAttribute("href",`#${l}`),this.#Wa.set(s,r),{id:s,clipPathId:`url(#${h})`}}highlightOutline(t){const e=this.#v++,i=this.#Ka(t.box);i.classList.add("highlightOutline");const n=bs._svgFactory.createElement("defs");i.append(n);const s=bs._svgFactory.createElement("path");n.append(s);const r=`path_p${this.pageIndex}_${e}`;let a;if(s.setAttribute("id",r),s.setAttribute("d",t.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke"),t.free){i.classList.add("free");const t=bs._svgFactory.createElement("mask");n.append(t),a=`mask_p${this.pageIndex}_${e}`,t.setAttribute("id",a),t.setAttribute("maskUnits","objectBoundingBox");const s=bs._svgFactory.createElement("rect");t.append(s),s.setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","white");const o=bs._svgFactory.createElement("use");t.append(o),o.setAttribute("href",`#${r}`),o.setAttribute("stroke","none"),o.setAttribute("fill","black"),o.setAttribute("fill-rule","nonzero"),o.classList.add("mask")}const o=bs._svgFactory.createElement("use");i.append(o),o.setAttribute("href",`#${r}`),a&&o.setAttribute("mask",`url(#${a})`);const l=o.cloneNode();return i.append(l),o.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#Wa.set(e,i),e}finalizeLine(t,e){const i=this.#qa.get(t);this.#qa.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){this.#Wa.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),this.#qa.delete(t)}updatePath(t,e){this.#qa.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){bs.#Xa(this.#Wa.get(t),e)}show(t,e){this.#Wa.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#Wa.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#Wa.get(t).setAttribute("fill",e)}changeOpacity(t,e){this.#Wa.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#Wa.get(t).classList.add(e)}removeClass(t,e){this.#Wa.get(t).classList.remove(e)}remove(t){null!==this.#En&&(this.#Wa.get(t).remove(),this.#Wa.delete(t))}destroy(){this.#En=null;for(const t of this.#Wa.values())t.remove();this.#Wa.clear()}}var ys=s.AnnotationLayer,ws=s.AnnotationMode,As=s.GlobalWorkerOptions,Es=s.PDFDataRangeTransport,_s=s.TextLayer,xs=s.getDocument},36294:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>r});var n=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},s=n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function r(t,e){var i={};return s.forEach((function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)})),i}},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(){w("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 b(t){return d[t]?d[t].log:r}function y(t,e){A("log",t,e,b(t))}function w(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 E(t){function e(){s("Height"),s("Width"),L((function(){k(E),T(x),g("onResized",E)}),E,"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[x]["max"+t]),i=Number(d[x]["min"+t]),n=t.toLowerCase(),s=Number(E[n]);y(x,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,y(x,"Set "+n+" to min value")),s>e&&(s=e,y(x,"Set "+n+" to max value")),E[n]=""+s}function r(t){return v.slice(v.indexOf(":")+7+t)}function a(t,e){var i,n,s;i=function(){R("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=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 S(x),{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(E.iframe):{x:0,y:0},i={x:Number(E.width)+e.x,y:Number(E.height)+e.y};y(x,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(l=i,u(),y(x,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):w(x,"Unable to scroll to requested position, window.parentIFrame not found")}function u(){!1===g("onScroll",l)?M():T(x)}function p(t){var e={};if(0===Number(E.width)&&0===Number(E.height)){var i=r(9).split(":");e={x:i[1],y:i[0]}}else e={x:E.width,y:E.height};g(t,{iframe:E.iframe,screenX:Number(e.x),screenY:Number(e.y),type:E.type})}function g(t,e){return _(x,t,e)}var v=t.data,E={},x=null;"[iFrameResizerChild]Ready"===v?function(){for(var t in d)R("iFrame requested init",I(t),d[t].iframe,t)}():o===(""+v).slice(0,13)&&v.slice(13).split(":")[0]in d?(E=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]}}(),x=E.id,d[x]&&(d[x].loaded=!0),!function(){var t=E.type in{true:1,false:1,undefined:1};return t&&y(x,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return d[t]||(e=!1,w(E.type+" No settings for "+t+". Message was: "+v)),e}(x)&&(y(x,"Received: "+v),function(){var t=!0;return null===E.iframe&&(w(x,"IFrame ("+E.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=d[x]&&d[x].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(y(x,"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[x]&&d[x].remoteHost;return y(x,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+E.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[x]&&d[x].firstRun&&d[x]&&(d[x].firstRun=!1),E.type){case"close":C(E.iframe);break;case"message":t=r(6),y(x,"onMessage passed: {iframe: "+E.iframe.id+", message: "+t+"}"),g("onMessage",{iframe:E.iframe,message:JSON.parse(t)}),y(x,"--");break;case"mouseenter":p("onMouseEnter");break;case"mouseleave":p("onMouseLeave");break;case"autoResize":d[x].autoResize=JSON.parse(r(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":a(d[x]&&d[x].iframe,x),function(){function t(t,n){function s(){d[i]?a(d[i].iframe,i):e()}["scroll","resize"].forEach((function(e){y(i,t+e+" listener for sendPageInfo"),n(window,e,s)}))}function e(){t("Remove ",m)}var i=x;t("Add ",f),d[i]&&(d[i].stopPageInfo=e)}();break;case"pageInfoStop":d[x]&&d[x].stopPageInfo&&(d[x].stopPageInfo(),delete d[x].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);y(x,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),l={x:t.x,y:t.y},u(),y(x,"--")}():window.top===window.self?y(x,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):y(x,"In page link #"+e+" not found and window.parentIFrame not found")}(r(9));break;case"reset":P(E);break;case"init":e(),g("onInit",E.iframe);break;default:0===Number(E.width)&&0===Number(E.height)?w("Unsupported message received ("+E.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,b(t))}(x,"Ignored: "+v)}function _(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 x(t){var e=t.id;delete d[e]}function C(t){var e=t.id;if(!1!==_(e,"onClose",e)){y(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){w(i)}_(e,"onClosed",e),y(e,"--"),x(t),n&&(n.disconnect(),n=null)}else y(e,"Close iframe cancelled by onClose event")}function S(t){null===l&&y(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 T(t){null!==l&&(window.scrollTo(l.x,l.y),y(t,"Set page position: "+l.x+","+l.y),M())}function M(){l=null}function P(t){y(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),S(t.id),L((function(){k(t),R("reset","reset",t.iframe,t.id)}),t,"reset")}function k(t){function e(e){a||"0"!==t[e]||(a=!0,y(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"))&&R("Visibility change","resize",d[t].iframe,t)}Object.keys(d).forEach((function(e){t(e)}))}function e(e){y("window","Mutation observed: "+e[0].target+" "+e[0].type),D(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",y(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):y("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 L(t,e,i){i!==e.type&&h&&!window.jasmine?(y(e.id,"Requesting animation frame"),h(t)):t()}function R(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;y(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(o+e,s)}():w(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,w(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 I(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 F(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],w(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,y(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);a in d&&"iFrameResizer"in t?w(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(y(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,y(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&&C(t)}))}))}));return i.observe(t.parentNode,{childList:!0}),i}(i)),f(t,"load",(function(){R("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&&P({iframe:t,height:0,width:0,type:"init"})}()})),R("init",e,t,void 0,!0)}(I(a)),d[a]&&(d[a].iframe.iFrameResizer={close:C.bind(null,d[a].iframe),removeListeners:x.bind(null,d[a].iframe),resize:R.bind(null,"Window resize","resize",d[a].iframe),moveToAnchor:function(t){R("Move to anchor","moveToAnchor:"+t,d[a].iframe,a)},sendMessage:function(t){R("Send Message","message:"+(t=JSON.stringify(t)),d[a].iframe,a)}}))}function D(t,e){null===u&&(u=setTimeout((function(){u=null,t()}),e))}var N={};function O(){"hidden"!==document.visibilityState&&(y("document","Trigger event: Visibility change"),D((function(){H("Tab Visible","resize")}),16))}function H(t,e){Object.keys(d).forEach((function(i){(function(t){return d[t]&&"parent"===d[t].resizeFrom&&d[t].autoResize&&!d[t].firstRun})(i)&&R(t,e,d[i].iframe,i)}))}function B(){f(window,"message",E),f(window,"resize",(function(){var t;y("window","Trigger event: "+(t="resize")),D((function(){H("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+">")}(),F(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):y("setup","RequestAnimationFrame not supported")}(),B(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&w("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}}()},41481:()=>{},42166:(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})}},42461:(t,e,i)=>{"use strict";i.d(e,{Bd:()=>r,UT:()=>v,ci:()=>o,h1:()=>b,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. ${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 b(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)}))}},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}},47645:(t,e)=>{"use strict";var i="function"===typeof Symbol&&Symbol.for,n=i?Symbol.for("react.element"):60103,s=i?Symbol.for("react.portal"):60106,r=i?Symbol.for("react.fragment"):60107,a=i?Symbol.for("react.strict_mode"):60108,o=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,h=i?Symbol.for("react.context"):60110,c=i?Symbol.for("react.async_mode"):60111,d=i?Symbol.for("react.concurrent_mode"):60111,u=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,g=i?Symbol.for("react.suspense_list"):60120,f=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116,v=i?Symbol.for("react.block"):60121,b=i?Symbol.for("react.fundamental"):60117,y=i?Symbol.for("react.responder"):60118,w=i?Symbol.for("react.scope"):60119;function A(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case c:case d:case r:case o:case a:case p:return t;default:switch(t=t&&t.$$typeof){case h:case u:case m:case f:case l:return t;default:return e}}case s:return e}}}function E(t){return A(t)===d}e.AsyncMode=c,e.ConcurrentMode=d,e.ContextConsumer=h,e.ContextProvider=l,e.Element=n,e.ForwardRef=u,e.Fragment=r,e.Lazy=m,e.Memo=f,e.Portal=s,e.Profiler=o,e.StrictMode=a,e.Suspense=p,e.isAsyncMode=function(t){return E(t)||A(t)===c},e.isConcurrentMode=E,e.isContextConsumer=function(t){return A(t)===h},e.isContextProvider=function(t){return A(t)===l},e.isElement=function(t){return"object"===typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return A(t)===u},e.isFragment=function(t){return A(t)===r},e.isLazy=function(t){return A(t)===m},e.isMemo=function(t){return A(t)===f},e.isPortal=function(t){return A(t)===s},e.isProfiler=function(t){return A(t)===o},e.isStrictMode=function(t){return A(t)===a},e.isSuspense=function(t){return A(t)===p},e.isValidElementType=function(t){return"string"===typeof t||"function"===typeof t||t===r||t===d||t===o||t===a||t===p||t===g||"object"===typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===f||t.$$typeof===l||t.$$typeof===h||t.$$typeof===u||t.$$typeof===b||t.$$typeof===y||t.$$typeof===w||t.$$typeof===v)},e.typeOf=A},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}},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)}()},54257:(t,e,i)=>{"use strict";var n=i(13073),s={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function l(t){return n.isMemo(t)?a:o[t.$$typeof]||s}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=a;var h=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;t.exports=function t(e,i,n){if("string"!==typeof i){if(g){var s=p(i);s&&s!==g&&t(e,s,n)}var a=c(i);d&&(a=a.concat(d(i)));for(var o=l(e),f=l(i),m=0;m<a.length;++m){var v=a[m];if(!r[v]&&(!n||!n[v])&&(!f||!f[v])&&(!o||!o[v])){var b=u(i,v);try{h(e,v,b)}catch(y){}}}}return e}},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}))}))},60213:(t,e,i)=>{"use strict";i.d(e,{EY:()=>Ue,Vd:()=>ze,Fr:()=>je,tz:()=>Yt});var n=i(94922),s=i.n(n),r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},r(t,e)};function a(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},o.apply(this,arguments)};function l(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}Object.create;function h(t,e,i){if(i||2===arguments.length)for(var n,s=0,r=e.length;s<r;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;function c(t,e){var i=e&&e.cache?e.cache:v,n=e&&e.serializer?e.serializer:f;return(e&&e.strategy?e.strategy:g)(t,{cache:i,serializer:n})}function d(t,e,i,n){var s,r=null==(s=n)||"number"===typeof s||"boolean"===typeof s?n:i(n),a=e.get(r);return"undefined"===typeof a&&(a=t.call(this,n),e.set(r,a)),a}function u(t,e,i){var n=Array.prototype.slice.call(arguments,3),s=i(n),r=e.get(s);return"undefined"===typeof r&&(r=t.apply(this,n),e.set(s,r)),r}function p(t,e,i,n,s){return i.bind(e,t,n,s)}function g(t,e){return p(t,this,1===t.length?d:u,e.cache.create(),e.serializer)}var f=function(){return JSON.stringify(arguments)};function m(){this.cache=Object.create(null)}m.prototype.get=function(t){return this.cache[t]},m.prototype.set=function(t,e){this.cache[t]=e};var v={create:function(){return new m}},b={variadic:function(t,e){return p(t,this,u,e.cache.create(),e.serializer)},monadic:function(t,e){return p(t,this,d,e.cache.create(),e.serializer)}};function y(t,e,i){if(void 0===i&&(i=Error),!t)throw new i(e)}var w,A,E;c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,h([void 0],e,!1)))}),{strategy:b.variadic}),c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,h([void 0],e,!1)))}),{strategy:b.variadic}),c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,h([void 0],e,!1)))}),{strategy:b.variadic}),c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.Locale).bind.apply(t,h([void 0],e,!1)))}),{strategy:b.variadic}),c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.ListFormat).bind.apply(t,h([void 0],e,!1)))}),{strategy:b.variadic});function _(t){return t.type===A.literal}function x(t){return t.type===A.argument}function C(t){return t.type===A.number}function S(t){return t.type===A.date}function T(t){return t.type===A.time}function M(t){return t.type===A.select}function P(t){return t.type===A.plural}function k(t){return t.type===A.pound}function L(t){return t.type===A.tag}function R(t){return!(!t||"object"!==typeof t||t.type!==E.number)}function I(t){return!(!t||"object"!==typeof t||t.type!==E.dateTime)}!function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(w||(w={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(A||(A={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(E||(E={}));var F=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,D=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function N(t){var e={};return t.replace(D,(function(t){var i=t.length;switch(t[0]){case"G":e.era=4===i?"long":5===i?"narrow":"short";break;case"y":e.year=2===i?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===i?"long":5===i?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][i-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][i-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][i-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][i-1];break;case"s":e.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}var O=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var H=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,B=/^(@+)?(\+|#+)?[rs]?$/g,z=/(\*)(0+)|(#+)(0+)|(0+)/g,j=/^(0+)$/;function U(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(B,(function(t,i,n){return"string"!==typeof n?(e.minimumSignificantDigits=i.length,e.maximumSignificantDigits=i.length):"+"===n?e.minimumSignificantDigits=i.length:"#"===i[0]?e.maximumSignificantDigits=i.length:(e.minimumSignificantDigits=i.length,e.maximumSignificantDigits=i.length+("string"===typeof n?n.length:0)),""})),e}function V(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function G(t){var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var i=t.slice(0,2);if("+!"===i?(e.signDisplay="always",t=t.slice(2)):"+?"===i&&(e.signDisplay="exceptZero",t=t.slice(2)),!j.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function $(t){var e=V(t);return e||{}}function W(t){for(var e={},i=0,n=t;i<n.length;i++){var s=n[i];switch(s.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=s.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=s.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=o(o(o({},e),{notation:"scientific"}),s.options.reduce((function(t,e){return o(o({},t),$(e))}),{}));continue;case"engineering":e=o(o(o({},e),{notation:"engineering"}),s.options.reduce((function(t,e){return o(o({},t),$(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(s.options[0]);continue;case"rounding-mode-floor":e.roundingMode="floor";continue;case"rounding-mode-ceiling":e.roundingMode="ceil";continue;case"rounding-mode-down":e.roundingMode="trunc";continue;case"rounding-mode-up":e.roundingMode="expand";continue;case"rounding-mode-half-even":e.roundingMode="halfEven";continue;case"rounding-mode-half-down":e.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":e.roundingMode="halfExpand";continue;case"integer-width":if(s.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");s.options[0].replace(z,(function(t,i,n,s,r,a){if(i)e.minimumIntegerDigits=n.length;else{if(s&&r)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(j.test(s.stem))e.minimumIntegerDigits=s.stem.length;else if(H.test(s.stem)){if(s.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");s.stem.replace(H,(function(t,i,n,s,r,a){return"*"===n?e.minimumFractionDigits=i.length:s&&"#"===s[0]?e.maximumFractionDigits=s.length:r&&a?(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length+a.length):(e.minimumFractionDigits=i.length,e.maximumFractionDigits=i.length),""}));var r=s.options[0];"w"===r?e=o(o({},e),{trailingZeroDisplay:"stripIfInteger"}):r&&(e=o(o({},e),U(r)))}else if(B.test(s.stem))e=o(o({},e),U(s.stem));else{var a=V(s.stem);a&&(e=o(o({},e),a));var l=G(s.stem);l&&(e=o(o({},e),l))}}return e}var q,X={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function K(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var i,n=t.language;return"root"!==n&&(i=t.maximize().region),(X[i||""]||X[n||""]||X["".concat(n,"-001")]||X["001"])[0]}var Y=new RegExp("^".concat(F.source,"*")),Z=new RegExp("".concat(F.source,"*$"));function J(t,e){return{start:t,end:e}}var Q=!!String.prototype.startsWith&&"_a".startsWith("a",1),tt=!!String.fromCodePoint,et=!!Object.fromEntries,it=!!String.prototype.codePointAt,nt=!!String.prototype.trimStart,st=!!String.prototype.trimEnd,rt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},at=!0;try{at="a"===(null===(q=gt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===q?void 0:q[0])}catch(Ve){at=!1}var ot,lt=Q?function(t,e,i){return t.startsWith(e,i)}:function(t,e,i){return t.slice(i,i+e.length)===e},ht=tt?String.fromCodePoint:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i,n="",s=t.length,r=0;s>r;){if((i=t[r++])>1114111)throw RangeError(i+" is not a valid code point");n+=i<65536?String.fromCharCode(i):String.fromCharCode(55296+((i-=65536)>>10),i%1024+56320)}return n},ct=et?Object.fromEntries:function(t){for(var e={},i=0,n=t;i<n.length;i++){var s=n[i],r=s[0],a=s[1];e[r]=a}return e},dt=it?function(t,e){return t.codePointAt(e)}:function(t,e){var i=t.length;if(!(e<0||e>=i)){var n,s=t.charCodeAt(e);return s<55296||s>56319||e+1===i||(n=t.charCodeAt(e+1))<56320||n>57343?s:n-56320+(s-55296<<10)+65536}},ut=nt?function(t){return t.trimStart()}:function(t){return t.replace(Y,"")},pt=st?function(t){return t.trimEnd()}:function(t){return t.replace(Z,"")};function gt(t,e){return new RegExp(t,e)}if(at){var ft=gt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ot=function(t,e){var i;return ft.lastIndex=e,null!==(i=ft.exec(t)[1])&&void 0!==i?i:""}}else ot=function(t,e){for(var i=[];;){var n=dt(t,e);if(void 0===n||bt(n)||yt(n))break;i.push(n),e+=n>=65536?2:1}return ht.apply(void 0,i)};var mt=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,i){for(var n=[];!this.isEOF();){var s=this.char();if(123===s){if((r=this.parseArgument(t,i)).err)return r;n.push(r.val)}else{if(125===s&&t>0)break;if(35!==s||"plural"!==e&&"selectordinal"!==e){if(60===s&&!this.ignoreTag&&47===this.peek()){if(i)break;return this.error(w.UNMATCHED_CLOSING_TAG,J(this.clonePosition(),this.clonePosition()))}if(60===s&&!this.ignoreTag&&vt(this.peek()||0)){if((r=this.parseTag(t,e)).err)return r;n.push(r.val)}else{var r;if((r=this.parseLiteral(t,e)).err)return r;n.push(r.val)}}else{var a=this.clonePosition();this.bump(),n.push({type:A.pound,location:J(a,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var i=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<".concat(n,"/>"),location:J(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,e,!0);if(s.err)return s;var r=s.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!vt(this.char()))return this.error(w.INVALID_TAG,J(a,this.clonePosition()));var o=this.clonePosition();return n!==this.parseTagName()?this.error(w.UNMATCHED_CLOSING_TAG,J(o,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:A.tag,value:n,children:r,location:J(i,this.clonePosition())},err:null}:this.error(w.INVALID_TAG,J(a,this.clonePosition())))}return this.error(w.UNCLOSED_TAG,J(i,this.clonePosition()))}return this.error(w.INVALID_TAG,J(i,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var i=this.clonePosition(),n="";;){var s=this.tryParseQuote(e);if(s)n+=s;else{var r=this.tryParseUnquoted(t,e);if(r)n+=r;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var o=J(i,this.clonePosition());return{val:{type:A.literal,value:n,location:o},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(vt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(i);this.bump()}return ht.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===e||"selectordinal"===e)||125===i&&t>0?null:(this.bump(),ht(i))},t.prototype.parseArgument=function(t,e){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,J(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(w.EMPTY_ARGUMENT,J(i,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(w.MALFORMED_ARGUMENT,J(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,J(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:n,location:J(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,J(i,this.clonePosition())):this.parseArgumentOptions(t,e,n,i);default:return this.error(w.MALFORMED_ARGUMENT,J(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),i=ot(this.message,e),n=e+i.length;return this.bumpTo(n),{value:i,location:J(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,i,n){var s,r=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(w.EXPECT_ARGUMENT_TYPE,J(r,l));case"number":case"date":case"time":this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(g=pt(b.val)).length)return this.error(w.EXPECT_ARGUMENT_STYLE,J(this.clonePosition(),this.clonePosition()));h={style:g,styleLocation:J(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(n)).err)return y;var d=J(n,this.clonePosition());if(h&<(null===h||void 0===h?void 0:h.style,"::",0)){var u=ut(h.style.slice(2));if("number"===a)return(b=this.parseNumberSkeletonFromString(u,h.styleLocation)).err?b:{val:{type:A.number,value:i,location:d,style:b.val},err:null};if(0===u.length)return this.error(w.EXPECT_DATE_TIME_SKELETON,d);var p=u;this.locale&&(p=function(t,e){for(var i="",n=0;n<t.length;n++){var s=t.charAt(n);if("j"===s){for(var r=0;n+1<t.length&&t.charAt(n+1)===s;)r++,n++;var a=1+(1&r),o=r<2?1:3+(r>>1),l=K(e);for("H"!=l&&"k"!=l||(o=0);o-- >0;)i+="a";for(;a-- >0;)i=l+i}else i+="J"===s?"H":s}return i}(u,this.locale));var g={type:E.dateTime,pattern:p,location:h.styleLocation,parsedOptions:this.shouldParseSkeletons?N(p):{}};return{val:{type:"date"===a?A.date:A.time,value:i,location:d,style:g},err:null}}return{val:{type:"number"===a?A.number:"date"===a?A.date:A.time,value:i,location:d,style:null!==(s=null===h||void 0===h?void 0:h.style)&&void 0!==s?s:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(w.EXPECT_SELECT_ARGUMENT_OPTIONS,J(f,o({},f)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(w.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,J(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(w.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,w.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;this.bumpSpace(),m=this.parseIdentifierIfPossible(),v=b.val}var y,_=this.tryParsePluralOrSelectOptions(t,a,e,m);if(_.err)return _;if((y=this.tryParseArgumentClose(n)).err)return y;var x=J(n,this.clonePosition());return"select"===a?{val:{type:A.select,value:i,options:ct(_.val),location:x},err:null}:{val:{type:A.plural,value:i,options:ct(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:x},err:null};default:return this.error(w.INVALID_ARGUMENT_TYPE,J(r,l))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(w.EXPECT_ARGUMENT_CLOSING_BRACE,J(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(w.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,J(i,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var i=[];try{i=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],i=0,n=t.split(O).filter((function(t){return t.length>0}));i<n.length;i++){var s=n[i].split("/");if(0===s.length)throw new Error("Invalid number skeleton");for(var r=s[0],a=s.slice(1),o=0,l=a;o<l.length;o++)if(0===l[o].length)throw new Error("Invalid number skeleton");e.push({stem:r,options:a})}return e}(t)}catch(n){return this.error(w.INVALID_NUMBER_SKELETON,e)}return{val:{type:E.number,tokens:i,location:e,parsedOptions:this.shouldParseSkeletons?W(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,i,n){for(var s,r=!1,a=[],o=new Set,l=n.value,h=n.location;;){if(0===l.length){var c=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(w.EXPECT_PLURAL_ARGUMENT_SELECTOR,w.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;h=J(c,this.clonePosition()),l=this.message.slice(c.offset,this.offset())}if(o.has(l))return this.error("select"===e?w.DUPLICATE_SELECT_ARGUMENT_SELECTOR:w.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===l&&(r=!0),this.bumpSpace();var u=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?w.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:w.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,J(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(t+1,e,i);if(p.err)return p;var g=this.tryParseArgumentClose(u);if(g.err)return g;a.push([l,{value:p.val,location:J(u,this.clonePosition())}]),o.add(l),this.bumpSpace(),l=(s=this.parseIdentifierIfPossible()).value,h=s.location}return 0===a.length?this.error("select"===e?w.EXPECT_SELECT_ARGUMENT_SELECTOR:w.EXPECT_PLURAL_ARGUMENT_SELECTOR,J(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!r?this.error(w.MISSING_OTHER_CLAUSE,J(this.clonePosition(),this.clonePosition())):{val:a,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var i=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var s=!1,r=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;s=!0,r=10*r+(a-48),this.bump()}var o=J(n,this.clonePosition());return s?rt(r*=i)?{val:r,err:null}:this.error(e,o):this.error(t,o)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=dt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(lt(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(t){var e=this.offset(),i=this.message.indexOf(t,e);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&bt(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),i=this.message.charCodeAt(e+(t>=65536?2:1));return null!==i&&void 0!==i?i:null},t}();function vt(t){return t>=97&&t<=122||t>=65&&t<=90}function bt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function yt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function wt(t){t.forEach((function(t){if(delete t.location,M(t)||P(t))for(var e in t.options)delete t.options[e].location,wt(t.options[e].value);else C(t)&&R(t.style)||(S(t)||T(t))&&I(t.style)?delete t.style.location:L(t)&&wt(t.children)}))}function At(t,e){void 0===e&&(e={}),e=o({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var i=new mt(t,e).parse();if(i.err){var n=SyntaxError(w[i.err.kind]);throw n.location=i.err.location,n.originalMessage=i.err.message,n}return(null===e||void 0===e?void 0:e.captureLocation)||wt(i.val),i.val}var Et;!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Et||(Et={}));var _t,xt=function(t){function e(e,i,n){var s=t.call(this,e)||this;return s.code=i,s.originalMessage=n,s}return a(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Ct=function(t){function e(e,i,n,s){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(i,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Et.INVALID_VALUE,s)||this}return a(e,t),e}(xt),St=function(t){function e(e,i,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(i),Et.INVALID_VALUE,n)||this}return a(e,t),e}(xt),Tt=function(t){function e(e,i){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(i,'"'),Et.MISSING_VALUE,i)||this}return a(e,t),e}(xt);function Mt(t){return"function"===typeof t}function Pt(t,e,i,n,s,r,a){if(1===t.length&&_(t[0]))return[{type:_t.literal,value:t[0].value}];for(var o=[],l=0,h=t;l<h.length;l++){var c=h[l];if(_(c))o.push({type:_t.literal,value:c.value});else if(k(c))"number"===typeof r&&o.push({type:_t.literal,value:i.getNumberFormat(e).format(r)});else{var d=c.value;if(!s||!(d in s))throw new Tt(d,a);var u=s[d];if(x(c))u&&"string"!==typeof u&&"number"!==typeof u||(u="string"===typeof u||"number"===typeof u?String(u):""),o.push({type:"string"===typeof u?_t.literal:_t.object,value:u});else if(S(c)){var p="string"===typeof c.style?n.date[c.style]:I(c.style)?c.style.parsedOptions:void 0;o.push({type:_t.literal,value:i.getDateTimeFormat(e,p).format(u)})}else if(T(c)){p="string"===typeof c.style?n.time[c.style]:I(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:_t.literal,value:i.getDateTimeFormat(e,p).format(u)})}else if(C(c)){(p="string"===typeof c.style?n.number[c.style]:R(c.style)?c.style.parsedOptions:void 0)&&p.scale&&(u*=p.scale||1),o.push({type:_t.literal,value:i.getNumberFormat(e,p).format(u)})}else{if(L(c)){var g=c.children,f=c.value,m=s[f];if(!Mt(m))throw new St(f,"function",a);var v=m(Pt(g,e,i,n,s,r).map((function(t){return t.value})));Array.isArray(v)||(v=[v]),o.push.apply(o,v.map((function(t){return{type:"string"===typeof t?_t.literal:_t.object,value:t}})))}if(M(c)){if(!(b=c.options[u]||c.options.other))throw new Ct(c.value,u,Object.keys(c.options),a);o.push.apply(o,Pt(b.value,e,i,n,s))}else if(P(c)){var b;if(!(b=c.options["=".concat(u)])){if(!Intl.PluralRules)throw new xt('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Et.MISSING_INTL_API,a);var y=i.getPluralRules(e,{type:c.pluralType}).select(u-(c.offset||0));b=c.options[y]||c.options.other}if(!b)throw new Ct(c.value,u,Object.keys(c.options),a);o.push.apply(o,Pt(b.value,e,i,n,s,u-(c.offset||0)))}else;}}}return function(t){return t.length<2?t:t.reduce((function(t,e){var i=t[t.length-1];return i&&i.type===_t.literal&&e.type===_t.literal?i.value+=e.value:t.push(e),t}),[])}(o)}function kt(t,e){return e?Object.keys(t).reduce((function(i,n){var s,r;return i[n]=(s=t[n],(r=e[n])?o(o(o({},s||{}),r||{}),Object.keys(s).reduce((function(t,e){return t[e]=o(o({},s[e]),r[e]||{}),t}),{})):s),i}),o({},t)):t}function Lt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,i){t[e]=i}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(_t||(_t={}));var Rt,It=function(){function t(e,i,n,s){void 0===i&&(i=t.defaultLocale);var r,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=a.formatToParts(t);if(1===e.length)return e[0].value;var i=e.reduce((function(t,e){return t.length&&e.type===_t.literal&&"string"===typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return i.length<=1?i[0]||"":i},this.formatToParts=function(t){return Pt(a.ast,a.locales,a.formatters,a.formats,t,void 0,a.message)},this.resolvedOptions=function(){var t;return{locale:(null===(t=a.resolvedLocale)||void 0===t?void 0:t.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=i,this.resolvedLocale=t.resolveLocale(i),"string"===typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var d=s||{},u=(d.formatters,l(d,["formatters"]));this.ast=t.__parse(e,o(o({},u),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=kt(t.formats,n),this.formatters=s&&s.formatters||(void 0===(r=this.formatterCache)&&(r={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,h([void 0],e,!1)))}),{cache:Lt(r.number),strategy:b.variadic}),getDateTimeFormat:c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,h([void 0],e,!1)))}),{cache:Lt(r.dateTime),strategy:b.variadic}),getPluralRules:c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,h([void 0],e,!1)))}),{cache:Lt(r.pluralRules),strategy:b.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){if("undefined"!==typeof Intl.Locale){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"===typeof t?t:t[0])}},t.__parse=At,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(Rt||(Rt={}));var Ft=function(t){function e(i,n,s){var r=this,a=s?s instanceof Error?s:new Error(String(s)):void 0;return(r=t.call(this,"[@formatjs/intl Error ".concat(i,"] ").concat(n,"\n").concat(a?"\n".concat(a.message,"\n").concat(a.stack):""))||this).code=i,"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return a(e,t),e}(Error),Dt=function(t){function e(e,i){return t.call(this,Rt.UNSUPPORTED_FORMATTER,e,i)||this}return a(e,t),e}(Ft),Nt=function(t){function e(e,i){return t.call(this,Rt.INVALID_CONFIG,e,i)||this}return a(e,t),e}(Ft),Ot=function(t){function e(e,i){return t.call(this,Rt.MISSING_DATA,e,i)||this}return a(e,t),e}(Ft),Ht=function(t){function e(e,i,n){var s=t.call(this,Rt.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(i,"\n"),n)||this;return s.locale=i,s}return a(e,t),e}(Ft),Bt=function(t){function e(e,i,n,s){var r=t.call(this,"".concat(e,"\nMessageID: ").concat(null===n||void 0===n?void 0:n.id,"\nDefault Message: ").concat(null===n||void 0===n?void 0:n.defaultMessage,"\nDescription: ").concat(null===n||void 0===n?void 0:n.description,"\n"),i,s)||this;return r.descriptor=n,r.locale=i,r}return a(e,t),e}(Ht),zt=function(t){function e(e,i){var n=t.call(this,Rt.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(i,'", using ').concat(e.defaultMessage?"default message (".concat("string"===typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return n.descriptor=e,n}return a(e,t),e}(Ft);function jt(t,e,i){return void 0===i&&(i={}),e.reduce((function(e,n){return n in t?e[n]=t[n]:n in i&&(e[n]=i[n]),e}),{})}var Ut={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){0},onWarn:function(t){0}};function Vt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,i){t[e]=i}}}}}function Gt(t,e,i,n){var s,r=t&&t[e];if(r&&(s=r[i]),s)return s;n(new Dt("No ".concat(e," format named: ").concat(i)))}function $t(t){y(t,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var Wt=o(o({},Ut),{textComponent:n.Fragment});i(54257);var qt="undefined"===typeof window||window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?n.createContext(null):window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=n.createContext(null)),Xt=(qt.Consumer,qt.Provider),Kt=qt;function Yt(){var t=n.useContext(Kt);return $t(t),t}function Zt(t,e){return Object.keys(t).reduce((function(i,n){return i[n]=o({timeZone:e},t[n]),i}),{})}function Jt(t,e){return Object.keys(o(o({},t),e)).reduce((function(i,n){return i[n]=o(o({},t[n]||{}),e[n]||{}),i}),{})}function Qt(t,e){if(!e)return t;var i=It.formats;return o(o(o({},i),t),{date:Jt(Zt(i.date,e),Zt(t.date||{},e)),time:Jt(Zt(i.time,e),Zt(t.time||{},e))})}var te=function(t,e,i,n,s){var r=t.locale,a=t.formats,l=t.messages,h=t.defaultLocale,c=t.defaultFormats,d=t.fallbackOnEmptyString,u=t.onError,p=t.timeZone,g=t.defaultRichTextElements;void 0===i&&(i={id:""});var f=i.id,m=i.defaultMessage;y(!!f,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var v=String(f),b=l&&Object.prototype.hasOwnProperty.call(l,v)&&l[v];if(Array.isArray(b)&&1===b.length&&b[0].type===A.literal)return b[0].value;if(!n&&b&&"string"===typeof b&&!g)return b.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=o(o({},g),n||{}),a=Qt(a,p),c=Qt(c,p),!b){if(!1===d&&""===b)return b;if((!m||r&&r.toLowerCase()!==h.toLowerCase())&&u(new zt(i,r)),m)try{return e.getMessageFormat(m,h,c,s).format(n)}catch(w){return u(new Bt('Error formatting default message for: "'.concat(v,'", rendering default message verbatim'),r,i,w)),"string"===typeof m?m:v}return v}try{return e.getMessageFormat(b,r,a,o({formatters:e},s||{})).format(n)}catch(w){u(new Bt('Error formatting message: "'.concat(v,'", using ').concat(m?"default message":"id"," as fallback."),r,i,w))}if(m)try{return e.getMessageFormat(m,h,c,s).format(n)}catch(w){u(new Bt('Error formatting the default message for: "'.concat(v,'", rendering message verbatim'),r,i,w))}return"string"===typeof b?b:"string"===typeof m?m:v},ee=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function ie(t,e,i){var n=t.locale,s=t.formats,r=t.onError;void 0===i&&(i={});var a=i.format,o=a&&Gt(s,"number",a,r)||{};return e(n,jt(i,ee,o))}function ne(t,e,i,n){void 0===n&&(n={});try{return ie(t,e,n).format(i)}catch(s){t.onError(new Ht("Error formatting number.",t.locale,s))}return String(i)}function se(t,e,i,n){void 0===n&&(n={});try{return ie(t,e,n).formatToParts(i)}catch(s){t.onError(new Ht("Error formatting number.",t.locale,s))}return[]}var re=["numeric","style"];function ae(t,e,i,n,s){void 0===s&&(s={}),n||(n="second"),Intl.RelativeTimeFormat||t.onError(new xt('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',Et.MISSING_INTL_API));try{return function(t,e,i){var n=t.locale,s=t.formats,r=t.onError;void 0===i&&(i={});var a=i.format,o=!!a&&Gt(s,"relative",a,r)||{};return e(n,jt(i,re,o))}(t,e,s).format(i,n)}catch(r){t.onError(new Ht("Error formatting relative time.",t.locale,r))}return String(i)}var oe=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function le(t,e,i,n){var s=t.locale,r=t.formats,a=t.onError,l=t.timeZone;void 0===n&&(n={});var h=n.format,c=o(o({},l&&{timeZone:l}),h&&Gt(r,e,h,a)),d=jt(n,oe,c);return"time"!==e||d.hour||d.minute||d.second||d.timeStyle||d.dateStyle||(d=o(o({},d),{hour:"numeric",minute:"numeric"})),i(s,d)}function he(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],r=i[1],a=void 0===r?{}:r,o="string"===typeof s?new Date(s||0):s;try{return le(t,"date",e,a).format(o)}catch(l){t.onError(new Ht("Error formatting date.",t.locale,l))}return String(o)}function ce(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],r=i[1],a=void 0===r?{}:r,o="string"===typeof s?new Date(s||0):s;try{return le(t,"time",e,a).format(o)}catch(l){t.onError(new Ht("Error formatting time.",t.locale,l))}return String(o)}function de(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],r=i[1],a=i[2],o=void 0===a?{}:a,l=t.timeZone,h=t.locale,c=t.onError,d=jt(o,oe,l?{timeZone:l}:{});try{return e(h,d).formatRange(s,r)}catch(u){c(new Ht("Error formatting date time range.",t.locale,u))}return String(s)}function ue(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],r=i[1],a=void 0===r?{}:r,o="string"===typeof s?new Date(s||0):s;try{return le(t,"date",e,a).formatToParts(o)}catch(l){t.onError(new Ht("Error formatting date.",t.locale,l))}return[]}function pe(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var s=i[0],r=i[1],a=void 0===r?{}:r,o="string"===typeof s?new Date(s||0):s;try{return le(t,"time",e,a).formatToParts(o)}catch(l){t.onError(new Ht("Error formatting time.",t.locale,l))}return[]}var ge=["type"];function fe(t,e,i,n){var s=t.locale,r=t.onError;void 0===n&&(n={}),Intl.PluralRules||r(new xt('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Et.MISSING_INTL_API));var a=jt(n,ge);try{return e(s,a).select(i)}catch(o){r(new Ht("Error formatting plural.",s,o))}return"other"}var me=["type","style"],ve=Date.now();function be(t,e,i,n){void 0===n&&(n={});var s=ye(t,e,i,n).reduce((function(t,e){var i=e.value;return"string"!==typeof i?t.push(i):"string"===typeof t[t.length-1]?t[t.length-1]+=i:t.push(i),t}),[]);return 1===s.length?s[0]:0===s.length?"":s}function ye(t,e,i,n){var s=t.locale,r=t.onError;void 0===n&&(n={}),Intl.ListFormat||r(new xt('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',Et.MISSING_INTL_API));var a=jt(n,me);try{var l={},h=i.map((function(t,e){if("object"===typeof t){var i=function(t){return"".concat(ve,"_").concat(t,"_").concat(ve)}(e);return l[i]=t,i}return String(t)}));return e(s,a).formatToParts(h).map((function(t){return"literal"===t.type?t:o(o({},t),{value:l[t.value]||t.value})}))}catch(c){r(new Ht("Error formatting list.",s,c))}return i}var we=["style","type","fallback","languageDisplay"];function Ae(t,e,i,n){var s=t.locale,r=t.onError;Intl.DisplayNames||r(new xt('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',Et.MISSING_INTL_API));var a=jt(n,we);try{return e(s,a).of(i)}catch(o){r(new Ht("Error formatting display name.",s,o))}}function Ee(t){var e;t.onWarn&&t.defaultRichTextElements&&"string"===typeof((e=t.messages||{})?e[Object.keys(e)[0]]:void 0)&&t.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution')}function _e(t,e){var i=function(t){void 0===t&&(t={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var e=Intl.RelativeTimeFormat,i=Intl.ListFormat,n=Intl.DisplayNames,s=c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.DateTimeFormat).bind.apply(t,h([void 0],e,!1)))}),{cache:Vt(t.dateTime),strategy:b.variadic}),r=c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.NumberFormat).bind.apply(t,h([void 0],e,!1)))}),{cache:Vt(t.number),strategy:b.variadic}),a=c((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new((t=Intl.PluralRules).bind.apply(t,h([void 0],e,!1)))}),{cache:Vt(t.pluralRules),strategy:b.variadic});return{getDateTimeFormat:s,getNumberFormat:r,getMessageFormat:c((function(t,e,i,n){return new It(t,e,i,o({formatters:{getNumberFormat:r,getDateTimeFormat:s,getPluralRules:a}},n||{}))}),{cache:Vt(t.message),strategy:b.variadic}),getRelativeTimeFormat:c((function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return new(e.bind.apply(e,h([void 0],t,!1)))}),{cache:Vt(t.relativeTime),strategy:b.variadic}),getPluralRules:a,getListFormat:c((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(i.bind.apply(i,h([void 0],t,!1)))}),{cache:Vt(t.list),strategy:b.variadic}),getDisplayNames:c((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(n.bind.apply(n,h([void 0],t,!1)))}),{cache:Vt(t.displayNames),strategy:b.variadic})}}(e),n=o(o({},Ut),t),s=n.locale,r=n.defaultLocale,a=n.onError;return s?!Intl.NumberFormat.supportedLocalesOf(s).length&&a?a(new Ot('Missing locale data for locale: "'.concat(s,'" in Intl.NumberFormat. Using default locale: "').concat(r,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(s).length&&a&&a(new Ot('Missing locale data for locale: "'.concat(s,'" in Intl.DateTimeFormat. Using default locale: "').concat(r,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(a&&a(new Nt('"locale" was not configured, using "'.concat(r,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),Ee(n),o(o({},n),{formatters:i,formatNumber:ne.bind(null,n,i.getNumberFormat),formatNumberToParts:se.bind(null,n,i.getNumberFormat),formatRelativeTime:ae.bind(null,n,i.getRelativeTimeFormat),formatDate:he.bind(null,n,i.getDateTimeFormat),formatDateToParts:ue.bind(null,n,i.getDateTimeFormat),formatTime:ce.bind(null,n,i.getDateTimeFormat),formatDateTimeRange:de.bind(null,n,i.getDateTimeFormat),formatTimeToParts:pe.bind(null,n,i.getDateTimeFormat),formatPlural:fe.bind(null,n,i.getPluralRules),formatMessage:te.bind(null,n,i),$t:te.bind(null,n,i),formatList:be.bind(null,n,i.getListFormat),formatListToParts:ye.bind(null,n,i.getListFormat),formatDisplayName:Ae.bind(null,n,i.getDisplayNames)})}function xe(t){return t?Object.keys(t).reduce((function(e,i){var s,r=t[i];return e[i]=Mt(r)?(s=r,function(t){return s(n.Children.toArray(t))}):r,e}),{}):t}var Ce=function(t,e,i,s){for(var r=[],a=4;a<arguments.length;a++)r[a-4]=arguments[a];var o=xe(s),l=te.apply(void 0,h([t,e,i,o],r,!1));return Array.isArray(l)?n.Children.toArray(l):l},Se=function(t,e){var i=t.defaultRichTextElements,n=l(t,["defaultRichTextElements"]),s=xe(i),r=_e(o(o(o({},Wt),n),{defaultRichTextElements:s}),e),a={locale:r.locale,timeZone:r.timeZone,fallbackOnEmptyString:r.fallbackOnEmptyString,formats:r.formats,defaultLocale:r.defaultLocale,defaultFormats:r.defaultFormats,messages:r.messages,onError:r.onError,defaultRichTextElements:s};return o(o({},r),{formatMessage:Ce.bind(null,a,r.formatters),$t:Ce.bind(null,a,r.formatters)})};function Te(t){return{locale:t.locale,timeZone:t.timeZone,fallbackOnEmptyString:t.fallbackOnEmptyString,formats:t.formats,textComponent:t.textComponent,messages:t.messages,defaultLocale:t.defaultLocale,defaultFormats:t.defaultFormats,onError:t.onError,onWarn:t.onWarn,wrapRichTextChunksInFragment:t.wrapRichTextChunksInFragment,defaultRichTextElements:t.defaultRichTextElements}}var Me=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}},e.state={cache:e.cache,intl:Se(Te(e.props),e.cache),prevConfig:Te(e.props)},e}return a(e,t),e.getDerivedStateFromProps=function(t,e){var i=e.prevConfig,n=e.cache,s=Te(t);return function(t,e){if(t===e)return!0;if(!t||!e)return!1;var i=Object.keys(t),n=Object.keys(e),s=i.length;if(n.length!==s)return!1;for(var r=0;r<s;r++){var a=i[r];if(t[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}(i,s)?null:{intl:Se(s,n),prevConfig:s}},e.prototype.render=function(){return $t(this.state.intl),n.createElement(Xt,{value:this.state.intl},this.props.children)},e.displayName="IntlProvider",e.defaultProps=Wt,e}(n.PureComponent);const Pe=Me;var ke,Le;!function(t){t.formatDate="FormattedDate",t.formatTime="FormattedTime",t.formatNumber="FormattedNumber",t.formatList="FormattedList",t.formatDisplayName="FormattedDisplayName"}(ke||(ke={})),function(t){t.formatDate="FormattedDateParts",t.formatTime="FormattedTimeParts",t.formatNumber="FormattedNumberParts",t.formatList="FormattedListParts"}(Le||(Le={}));var Re=function(t){var e=Yt(),i=t.value,n=t.children,s=l(t,["value","children"]);return n(e.formatNumberToParts(i,s))};Re.displayName="FormattedNumberParts";function Ie(t){var e=function(e){var i=Yt(),n=e.value,s=e.children,r=l(e,["value","children"]),a="string"===typeof n?new Date(n||0):n;return s("formatDate"===t?i.formatDateToParts(a,r):i.formatTimeToParts(a,r))};return e.displayName=Le[t],e}function Fe(t){var e=function(e){var i=Yt(),s=e.value,r=e.children,a=l(e,["value","children"]),o=i[t](s,a);if("function"===typeof r)return r(o);var h=i.textComponent||n.Fragment;return n.createElement(h,null,o)};return e.displayName=ke[t],e}Re.displayName="FormattedNumberParts";Fe("formatDate"),Fe("formatTime"),Fe("formatNumber"),Fe("formatList"),Fe("formatDisplayName"),Ie("formatDate"),Ie("formatTime");var De=i(74946);function Ne(){return Ne=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},Ne.apply(null,arguments)}const Oe={},He=(t,e,i)=>(Oe[t]||(Oe[t]={}),Oe[t][i||"global"]=Object.assign({},Oe[t][i||"global"],e),Oe),Be=["locale"],ze=(t,e,i)=>{He(t,e,i);const n=t=>{let{children:e}=t;return e(Yt())};return e=>{let{locale:r,children:a}=e;var o;const l=(0,De.useContext)(),h=r||(null==l?void 0:l.locale)||t||"zh-CN";return s().createElement(Pe,{messages:null==(o=Oe[h])?void 0:o[i||"global"],locale:h},"function"===typeof a?s().createElement(n,null,a):a)}},je=(t,e,i)=>(He(t,e,i),e=>(0,n.forwardRef)(((n,r)=>{var a;let{locale:o}=n,l=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}(n,Be);const h=(0,De.useContext)(),c=o||(null==h?void 0:h.locale)||t||"zh-CN";return s().createElement(Pe,{messages:null==(a=Oe[c])?void 0:a[i||"global"],locale:c},s().createElement(e,Ne({},l,{ref:r})))}))),Ue=t=>{let{locale:e="zh-CN",message:i,namespace:n}=t;return i&&He(e,i,n),Se({locale:e,message:Oe})}},63697:(t,e,i)=>{"use strict";function n(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}i.d(e,{A:()=>n})},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)}}},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}},66499:(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--${i}`,children:e})}},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})},70041:(t,e,i)=>{"use strict";i.d(e,{A:()=>F});var n=i(89261),s=i(94922),r=i(63697),a=i(36294),o=i(47215);function l(){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){i.forEach((function(e){"function"===typeof e?e(t):e&&(e.current=t)}))}}var h=i(64288),c=i(98677);const d=(0,s.createContext)(null);var u=i(66499),p=i(31079);const g={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},f=/^H(\d+)$/;function m(t){return"children"in t}function v(t){return!!m(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function b(t){const e={};if(m(t)){const{role:i}=t,n=i.match(f);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in g}(i)){const t=g[i];t&&(e.role=t)}}return e}function y(t){const e={};if(m(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),v(t)){const[i]=t.children;if(i){const t=y(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function w(t){return t?Object.assign(Object.assign({},b(t)),y(t)):null}function A(t){let{className:e,node:i}=t;const r=(0,s.useMemo)((()=>w(i)),[i]),a=(0,s.useMemo)((()=>m(i)?v(i)?null:i.children.map(((t,e)=>(0,n.jsx)(A,{node:t},e))):null),[i]);return(0,n.jsx)("span",Object.assign({className:e},r,{children:a}))}function E(){return(0,s.useContext)(d)}var _=i(42166),x=i(42461);function C(){const t=E();(0,h.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[a,o]=(0,_.A)(),{value:l,error:d}=a,{customTextRenderer:u,page:p}=t;return(0,s.useEffect)((function(){o({type:"RESET"})}),[o,p]),(0,s.useEffect)((function(){if(u)return;if(!p)return;const t=(0,r.A)(p.getStructTree()),e=t;return t.promise.then((t=>{o({type:"RESOLVE",value:t})})).catch((t=>{o({type:"REJECT",error:t})})),()=>(0,x.xL)(e)}),[u,p,o]),(0,s.useEffect)((()=>{void 0!==l&&(!1!==l?l&&i&&i(l):d&&(c(!1,d.toString()),e&&e(d)))}),[l]),l?(0,n.jsx)(A,{className:"react-pdf__Page__structTree structTree",node:l}):null}const S=p.ng;function T(t){const e=E();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:a,devicePixelRatio:o=(0,x.mZ)(),onRenderError:d,onRenderSuccess:u,page:p,renderForms:g,renderTextLayer:f,rotate:m,scale:v}=i,{canvasRef:b}=t;(0,h.A)(p,"Attempted to render page canvas, but no page was specified.");const y=(0,s.useRef)(null);function w(t){(0,x.UT)(t)||(c(!1,t.toString()),d&&d(t))}const A=(0,s.useMemo)((()=>p.getViewport({scale:v*o,rotation:m})),[o,p,m,v]),_=(0,s.useMemo)((()=>p.getViewport({scale:v,rotation:m})),[p,m,v]);(0,s.useEffect)((function(){if(!p)return;p.cleanup();const{current:t}=y;if(!t)return;t.width=A.width,t.height=A.height,t.style.width=`${Math.floor(_.width)}px`,t.style.height=`${Math.floor(_.height)}px`,t.style.visibility="hidden";const e={annotationMode:g?S.ENABLE_FORMS:S.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:A};a&&(e.background=a);const i=p.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",p&&u&&u((0,x.vS)(p,v))})).catch(w),()=>(0,x.xL)(n)}),[a,p,g,A,_]);const T=(0,s.useCallback)((()=>{const{current:t}=y;t&&(t.width=0,t.height=0)}),[]);return(0,s.useEffect)((()=>T),[T]),(0,n.jsx)("canvas",{className:`${r}__canvas`,dir:"ltr",ref:l(b,y),style:{display:"block",userSelect:"none"},children:f?(0,n.jsx)(C,{}):null})}function M(){const t=E();(0,h.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:a,onRenderTextLayerError:l,onRenderTextLayerSuccess:d,page:u,pageIndex:g,pageNumber:f,rotate:m,scale:v}=t;(0,h.A)(u,"Attempted to load page text content, but no page was specified.");const[b,y]=(0,_.A)(),{value:w,error:A}=b,C=(0,s.useRef)(null),S=(0,s.useRef)(void 0);c(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,s.useEffect)((function(){y({type:"RESET"})}),[u,y]),(0,s.useEffect)((function(){if(!u)return;const t=(0,r.A)(u.getTextContent()),e=t;return t.promise.then((t=>{y({type:"RESOLVE",value:t})})).catch((t=>{y({type:"REJECT",error:t})})),()=>(0,x.xL)(e)}),[u,y]),(0,s.useEffect)((()=>{void 0!==w&&(!1!==w?w&&a&&a(w):A&&(c(!1,A.toString()),i&&i(A)))}),[w]);const T=(0,s.useCallback)((()=>{d&&d()}),[d]),M=(0,s.useCallback)((t=>{c(!1,t.toString()),l&&l(t)}),[l]);const P=(0,s.useMemo)((()=>u.getViewport({scale:v,rotation:m})),[u,m,v]);return(0,s.useLayoutEffect)((function(){if(!u||!w)return;const{current:t}=C;if(!t)return;t.innerHTML="";const i=u.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:i,viewport:P},s=new p.D6(n),r=s;return s.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),S.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;w.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const r=n[t];if(!r)return;const a=e(Object.assign({pageIndex:g,pageNumber:f,itemIndex:s},i));r.innerHTML=a,t+=i.str&&i.hasEOL?2:1}))}T()})).catch(M),()=>(0,x.xL)(r)}),[e,M,T,u,g,f,w,P]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=S.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=S.current;t&&t.classList.add("active")},ref:C})}var P=i(85724);function k(){return(0,s.useContext)(P.A)}function L(){const t=k(),e=E();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:a,linkService:l,onGetAnnotationsError:d,onGetAnnotationsSuccess:u,onRenderAnnotationLayerError:g,onRenderAnnotationLayerSuccess:f,page:m,pdf:v,renderForms:b,rotate:y,scale:w=1}=i;(0,h.A)(v,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,h.A)(m,"Attempted to load page annotations, but no page was specified."),(0,h.A)(l,"Attempted to load page annotations, but no linkService was specified.");const[A,C]=(0,_.A)(),{value:S,error:T}=A,M=(0,s.useRef)(null);c(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,s.useEffect)((function(){C({type:"RESET"})}),[C,m]),(0,s.useEffect)((function(){if(!m)return;const t=(0,r.A)(m.getAnnotations()),e=t;return t.promise.then((t=>{C({type:"RESOLVE",value:t})})).catch((t=>{C({type:"REJECT",error:t})})),()=>{(0,x.xL)(e)}}),[C,m]),(0,s.useEffect)((()=>{void 0!==S&&(!1!==S?S&&u&&u(S):T&&(c(!1,T.toString()),d&&d(T)))}),[S]);const P=(0,s.useMemo)((()=>m.getViewport({scale:w,rotation:y})),[m,y,w]);return(0,s.useEffect)((function(){if(!v||!m||!l||!S)return;const{current:t}=M;if(!t)return;const e=P.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:m,viewport:e},n={annotations:S,annotationStorage:v.annotationStorage,div:t,imageResourcesPath:a,linkService:l,page:m,renderForms:b,viewport:e};t.innerHTML="";try{new p.dU(i).render(n),f&&f()}catch(s){!function(t){c(!1,`${t}`),g&&g(t)}(s)}return()=>{}}),[S,a,l,m,v,b,P]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:M})}var R=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const I=1;function F(t){const e=k(),i=Object.assign(Object.assign({},e),t),{_className:p="react-pdf__Page",_enableRegisterUnregisterPage:g=!0,canvasBackground:f,canvasRef:m,children:v,className:b,customRenderer:y,customTextRenderer:w,devicePixelRatio:A,error:E="Failed to load the page.",height:C,inputRef:S,loading:P="Loading page\u2026",noData:F="No page specified.",onGetAnnotationsError:D,onGetAnnotationsSuccess:N,onGetStructTreeError:O,onGetStructTreeSuccess:H,onGetTextError:B,onGetTextSuccess:z,onLoadError:j,onLoadSuccess:U,onRenderAnnotationLayerError:V,onRenderAnnotationLayerSuccess:G,onRenderError:$,onRenderSuccess:W,onRenderTextLayerError:q,onRenderTextLayerSuccess:X,pageIndex:K,pageNumber:Y,pdf:Z,registerPage:J,renderAnnotationLayer:Q=!0,renderForms:tt=!1,renderMode:et="canvas",renderTextLayer:it=!0,rotate:nt,scale:st=I,unregisterPage:rt,width:at}=i,ot=R(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"]),[lt,ht]=(0,_.A)(),{value:ct,error:dt}=lt,ut=(0,s.useRef)(null);(0,h.A)(Z,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const pt=(0,x.ci)(Y)?Y-1:null!==K&&void 0!==K?K:null,gt=null!==Y&&void 0!==Y?Y:(0,x.ci)(K)?K+1:null,ft=null!==nt&&void 0!==nt?nt:ct?ct.rotate:null,mt=(0,s.useMemo)((()=>{if(!ct)return null;let t=1;const e=null!==st&&void 0!==st?st:I;if(at||C){const e=ct.getViewport({scale:1,rotation:ft});at?t=at/e.width:C&&(t=C/e.height)}return e*t}),[C,ct,ft,st,at]);(0,s.useEffect)((function(){return()=>{(0,x.ci)(pt)&&g&&rt&&rt(pt)}}),[g,Z,pt,rt]),(0,s.useEffect)((function(){ht({type:"RESET"})}),[ht,Z,pt]),(0,s.useEffect)((function(){if(!Z||!gt)return;const t=(0,r.A)(Z.getPage(gt)),e=t;return t.promise.then((t=>{ht({type:"RESOLVE",value:t})})).catch((t=>{ht({type:"REJECT",error:t})})),()=>(0,x.xL)(e)}),[ht,Z,gt]),(0,s.useEffect)((()=>{void 0!==ct&&(!1!==ct?function(){if(U){if(!ct||!mt)return;U((0,x.vS)(ct,mt))}if(g&&J){if(!(0,x.ci)(pt)||!ut.current)return;J(pt,ut.current)}}():dt&&(c(!1,dt.toString()),j&&j(dt)))}),[ct,mt]);const vt=(0,s.useMemo)((()=>ct&&(0,x.ci)(pt)&>&&(0,x.ci)(ft)&&(0,x.ci)(mt)?{_className:p,canvasBackground:f,customTextRenderer:w,devicePixelRatio:A,onGetAnnotationsError:D,onGetAnnotationsSuccess:N,onGetStructTreeError:O,onGetStructTreeSuccess:H,onGetTextError:B,onGetTextSuccess:z,onRenderAnnotationLayerError:V,onRenderAnnotationLayerSuccess:G,onRenderError:$,onRenderSuccess:W,onRenderTextLayerError:q,onRenderTextLayerSuccess:X,page:ct,pageIndex:pt,pageNumber:gt,renderForms:tt,renderTextLayer:it,rotate:ft,scale:mt}:null),[p,f,w,A,D,N,O,H,B,z,V,G,$,W,q,X,ct,pt,gt,tt,it,ft,mt]),bt=(0,s.useMemo)((()=>(0,a.Ay)(ot,(()=>ct?mt?(0,x.vS)(ct,mt):void 0:ct))),[ot,ct,mt]),yt=`${pt}@${mt}/${ft}`;function wt(){switch(et){case"custom":return(0,h.A)(y,'renderMode was set to "custom", but no customRenderer was passed.'),(0,n.jsx)(y,{},`${yt}_custom`);case"none":return null;default:return(0,n.jsx)(T,{canvasRef:m},`${yt}_canvas`)}}return(0,n.jsx)("div",Object.assign({className:(0,o.A)(p,b),"data-page-number":gt,ref:l(S,ut),style:{"--scale-factor":`${mt}`,backgroundColor:f||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},bt,{children:gt?null===Z||void 0===ct||null===ct?(0,n.jsx)(u.A,{type:"loading",children:"function"===typeof P?P():P}):!1===Z||!1===ct?(0,n.jsx)(u.A,{type:"error",children:"function"===typeof E?E():E}):(0,n.jsxs)(d.Provider,{value:vt,children:[wt(),it?(0,n.jsx)(M,{},`${yt}_text`):null,Q?(0,n.jsx)(L,{},`${yt}_annotations`):null,v]}):(0,n.jsx)(u.A,{type:"no-data",children:"function"===typeof F?F():F})}))}},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.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)}),[])}},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:()=>Tt});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(${t},${e}%,${i}%,${this.a})`:`hsl(${t},${e}%,${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(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${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 b=[{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 y(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 w(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 E=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];E.primary=E[5];var _=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];_.primary=_[5];var x=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];x.primary=x[5];var C=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];C.primary=C[5];var S=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];S.primary=S[5];var T=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];T.primary=T[5];var M=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];M.primary=M[5];var P=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];P.primary=P[5];var k=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];k.primary=k[5];var L=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];L.primary=L[5];var R=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];R.primary=R[5];var I=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];I.primary=I[5];var F=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];F.primary=F[5];var D=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];D.primary=D[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 H=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];H.primary=H[5];var B=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];B.primary=B[5];var z=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];z.primary=z[5];var j=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];j.primary=j[5];var U=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];U.primary=U[5];var V=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];V.primary=V[5];var G=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];G.primary=G[5];var $=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];$.primary=$[5];var W=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];W.primary=W[5];var q=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];q.primary=q[5];const X=(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 Y(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 Z="data-rc-order",J="data-rc-priority",Q=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((Q.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(Z,a),o&&r&&l.setAttribute(J,"".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(Z)))return!1;var e=Number(t.getAttribute(J)||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=Y(Y({},i),{},{styles:s});!function(t,e){var i=Q.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;Q.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,Y(Y({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,Y({key:e},mt(t.attrs)),(t.children||[]).map((function(i,n){return vt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})))}function bt(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:y(s,r,!0),s:w(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:y(s,o),s:w(s,o),v:A(s,o)});i.push(l)}return"dark"===e.theme?b.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 yt(t){return t?Array.isArray(t)?t:[t]:[]}var wt=["icon","className","onClick","style","primaryColor","secondaryColor"],At={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var Et=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,wt),u=h.useRef(),p=At;if(o&&(p={primaryColor:o,secondaryColor:c||bt(o)}),function(t){var e=(0,h.useContext)(X),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=Y(Y({},g),{},{icon:g.icon(p.primaryColor,p.secondaryColor)})),vt(g.icon,"svg-".concat(g.name),Y(Y({className:s,onClick:r,style:a,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:u}))};Et.displayName="IconReact",Et.getTwoToneColors=function(){return Y({},At)},Et.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;At.primaryColor=e,At.secondaryColor=i||bt(e),At.calculated=!!i};const _t=Et;function xt(t){var e=yt(t),i=(0,s.A)(e,2),n=i[0],r=i[1];return _t.setTwoToneColors({primaryColor:n,secondaryColor:r})}var Ct=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];xt(k.primary);var St=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,Ct),m=h.useContext(X),v=m.prefixCls,b=void 0===v?"anticon":v,y=m.rootClassName,w=u()(y,b,o(o({},"".concat(b,"-").concat(r.name),!!r.name),"".concat(b,"-spin"),!!a||"loading"===r.name),i),A=d;void 0===A&&p&&(A=-1);var E=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,_=yt(g),x=(0,s.A)(_,2),C=x[0],S=x[1];return h.createElement("span",(0,n.A)({role:"img","aria-label":r.name},f,{ref:e,tabIndex:A,onClick:p,className:w}),h.createElement(_t,{icon:r,primaryColor:C,secondaryColor:S,style:E}))}));St.displayName="AntdIcon",St.getTwoToneColor=function(){var t=_t.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},St.setTwoToneColor=xt;const Tt=St},85724:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=(0,i(94922).createContext)(null)},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})}},89261:(t,e,i)=>{"use strict";t.exports=i(74935)},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 b(e){var i=l,n=h;return l=h=void 0,g=e,d=t.apply(n,i)}function y(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-g>=c}function w(){var t=s();if(y(t))return A(t);u=setTimeout(w,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?b(t):(l=h=void 0,d)}function E(){var t=s(),i=y(t);if(l=arguments,h=this,p=t,i){if(void 0===u)return function(t){return g=t,u=setTimeout(w,e),f?b(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(w,e),b(p)}return void 0===u&&(u=setTimeout(w,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),E.cancel=function(){void 0!==u&&clearTimeout(u),g=0,l=p=h=u=void 0},E.flush=function(){return void 0===u?d:A(s())},E}},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=689.828c3b13.chunk.js.map
|