kdpa-components 1.62.3 → 1.62.4

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/dist/index.js CHANGED
@@ -565,7 +565,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
565
565
  * limitations under the License.
566
566
  */(function(t,e){var n;function r(o,a){var s=[],l=0;function c(d){return s.push(d),a}function u(){return s[l++]}return{tokenize:function(d){return d.replace(o,c)},detokenize:function(d){return d.replace(new RegExp("("+a+")","g"),u)}}}function i(){var o="`TMP`",a="`TMPLTR`",s="`TMPRTL`",l="`NOFLIP_SINGLE`",c="`NOFLIP_CLASS`",u="`COMMENT`",d="[^\\u0020-\\u007e]",f="(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)",h="(?:[0-9]*\\.[0-9]+|[0-9]+)",m="(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)",g="direction\\s*:\\s*",v="[!#$%&*-~]",b=`['"]?\\s*`,y="(^|[^a-zA-Z])",x="[^\\}]*?",w="\\/\\*\\!?\\s*@noflip\\s*\\*\\/",C="\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/",E="(?:"+f+"|\\\\[^\\r\\n\\f0-9a-f])",S="(?:[_a-z]|"+d+"|"+E+")",T="(?:[_a-z0-9-]|"+d+"|"+E+")",A="-?"+S+T+"*",R=h+"(?:\\s*"+m+"|"+A+")?",P="((?:-?"+R+")|(?:inherit|auto))",_="(?:-?"+h+"(?:\\s*"+m+")?)",I="(?:\\+|\\-|\\*|\\/)",k="(?:\\(|\\)|\\t| )",F="(?:"+k+"|"+_+"|"+I+"){3,}",L="(?:calc\\((?:"+F+")\\))",$="((?:-?"+R+")|(?:inherit|auto)|"+L+")",N="((?:margin|padding|border-width)\\s*:\\s*)",B="((?:-color|border-style)\\s*:\\s*)",W="(#?"+T+"+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))",Y="(?:"+v+"|"+d+"|"+E+")*?",q="(?![a-zA-Z])",ee="(?!("+T+`|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|"[^"]*"|`+u+")*?{)",Q="(?!"+Y+b+"\\))",J="(?="+Y+b+"\\))",re="(\\s*(?:!important\\s*)?[;}])",ie=/`TMP`/g,he=/`TMPLTR`/g,xe=/`TMPRTL`/g,Se=new RegExp(C,"gi"),ye=new RegExp("("+w+ee+"[^;}]+;?)","gi"),K=new RegExp("("+w+x+"})","gi"),ce=new RegExp("("+g+")ltr","gi"),U=new RegExp("("+g+")rtl","gi"),ue=new RegExp(y+"(left)"+q+Q+ee,"gi"),le=new RegExp(y+"(right)"+q+Q+ee,"gi"),ne=new RegExp(y+"(left)"+J,"gi"),Z=new RegExp(y+"(right)"+J,"gi"),fe=/(:dir\( *)ltr( *\))/g,de=/(:dir\( *)rtl( *\))/g,pe=new RegExp(y+"(ltr)"+J,"gi"),ge=new RegExp(y+"(rtl)"+J,"gi"),se=new RegExp(y+"([ns]?)e-resize","gi"),ae=new RegExp(y+"([ns]?)w-resize","gi"),ve=new RegExp(N+$+"(\\s+)"+$+"(\\s+)"+$+"(\\s+)"+$+re,"gi"),we=new RegExp(B+W+"(\\s+)"+W+"(\\s+)"+W+"(\\s+)"+W+re,"gi"),Me=new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)("+R+")","gi"),Ee=new RegExp("(background-position-x\\s*:\\s*)(-?"+h+"%)","gi"),De=new RegExp("(border-radius\\s*:\\s*)"+P+"(?:(?:\\s+"+P+")(?:\\s+"+P+")?(?:\\s+"+P+")?)?(?:(?:(?:\\s*\\/\\s*)"+P+")(?:\\s+"+P+")?(?:\\s+"+P+")?(?:\\s+"+P+")?)?"+re,"gi"),Re=new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)"+P,"gi"),Ge=new RegExp("(text-shadow\\s*:\\s*)"+P+"(\\s*)"+W,"gi"),Be=new RegExp("(text-shadow\\s*:\\s*)"+W+"(\\s*)"+P,"gi"),Qe=new RegExp("(text-shadow\\s*:\\s*)"+P,"gi"),Ze=new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)"+P+"(\\s*\\))","gi"),ze=new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)"+P+"((?:\\s*,\\s*"+P+"){0,2}\\s*\\))","gi");function je(gt,Oe,me){var Ue,_e;return me.slice(-1)==="%"&&(Ue=me.indexOf("."),Ue!==-1?(_e=me.length-Ue-2,me=100-parseFloat(me),me=me.toFixed(_e)+"%"):me=100-parseFloat(me)+"%"),Oe+me}function at(gt){switch(gt.length){case 4:gt=[gt[1],gt[0],gt[3],gt[2]];break;case 3:gt=[gt[1],gt[0],gt[1],gt[2]];break;case 2:gt=[gt[1],gt[0]];break;case 1:gt=[gt[0]];break}return gt.join(" ")}function yt(gt,Oe){var me,Ue=[].slice.call(arguments),_e=Ue.slice(2,6).filter(function(tt){return tt}),ot=Ue.slice(6,10).filter(function(tt){return tt}),nt=Ue[10]||"";return ot.length?me=at(_e)+" / "+at(ot):me=at(_e),Oe+me+nt}function ft(gt){return parseFloat(gt)===0?gt:gt[0]==="-"?gt.slice(1):"-"+gt}function At(gt,Oe,me){return Oe+ft(me)}function Ft(gt,Oe,me,Ue,_e){return Oe+me+ft(Ue)+_e}function kt(gt,Oe,me,Ue,_e){return Oe+me+Ue+ft(_e)}return{transform:function(gt,Oe){var me=new r(ye,l),Ue=new r(K,c),_e=new r(Se,u);return gt=_e.tokenize(Ue.tokenize(me.tokenize(gt.replace("`","%60")))),Oe.transformDirInUrl&&(gt=gt.replace(fe,"$1"+a+"$2").replace(de,"$1"+s+"$2").replace(pe,"$1"+o).replace(ge,"$1ltr").replace(ie,"rtl").replace(he,"ltr").replace(xe,"rtl")),Oe.transformEdgeInUrl&&(gt=gt.replace(ne,"$1"+o).replace(Z,"$1left").replace(ie,"right")),gt=gt.replace(ce,"$1"+o).replace(U,"$1ltr").replace(ie,"rtl").replace(ue,"$1"+o).replace(le,"$1left").replace(ie,"right").replace(se,"$1$2"+o).replace(ae,"$1$2e-resize").replace(ie,"w-resize").replace(De,yt).replace(Re,At).replace(Ge,kt).replace(Be,kt).replace(Qe,At).replace(Ze,Ft).replace(ze,Ft).replace(ve,"$1$2$3$8$5$6$7$4$9").replace(we,"$1$2$3$8$5$6$7$4$9").replace(Me,je).replace(Ee,je),gt=me.detokenize(Ue.detokenize(_e.detokenize(gt))),gt}}}n=new i,t.exports?e.transform=function(o,a,s){var l;return typeof a=="object"?l=a:(l={},typeof a=="boolean"&&(l.transformDirInUrl=a),typeof s=="boolean"&&(l.transformEdgeInUrl=s)),n.transform(o,l)}:typeof window<"u"&&(window.cssjanus=n)})(pI,pI.exports);var o$e=pI.exports,a$e=di(o$e);function OG(t,e,n){switch(t.type){case H9e:case cI:case lI:return t.return=t.return||t.value;case i1:t.value=Array.isArray(t.props)?t.props.join(","):t.props,Array.isArray(t.children)&&t.children.forEach(function(i){i.type===lI&&(i.children=i.value)})}var r=MG(Array.prototype.concat(t.children),OG);return Mu(r)?t.return=t.value+"{"+r+"}":""}function PG(t,e,n,r){if(t.type===CG||t.type===V9e||t.type===i1&&(!t.parent||t.parent.type===W9e||t.parent.type===i1)){var i=a$e.transform(OG(t));t.children=i?n$e(i)[0].children:[],t.return=""}}Object.defineProperty(PG,"name",{value:"stylisRTLPlugin"});function s$e(t){const e=Rn(()=>GM({key:"style",stylisPlugins:[i$e,PG],container:t?.container}),[]);return M(X9,{value:e,children:t.children})}const l$e=$e.forwardRef((t,e)=>M(RE,{direction:"up",ref:e,...t}));function c$e({children:t,...e}){return M(pd,{TransitionComponent:l$e,fullScreen:!0,...e,children:t})}function u$e(t){return zt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M840 836H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm0-724H184c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h656c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM610.8 378c6 0 9.4-7 5.7-11.7L515.7 238.7a7.14 7.14 0 0 0-11.3 0L403.6 366.3a7.23 7.23 0 0 0 5.7 11.7H476v268h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V378h62.8z"}}]})(t)}function d$e(t){return zt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 0 0-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 0 0 0 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"}}]})(t)}function f$e(t){return zt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M574 665.4a8.03 8.03 0 0 0-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 0 0-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 0 0 0 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 0 0 0 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 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 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"}}]})(t)}function h$e(t){return zt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]})(t)}function p$e(t){return zt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]})(t)}const g$e=Ri("div")();function m$e({children:t,label:e="",maxLength:n=23,expandable:r=!1,defaultOpen:i=!0,color:o,openIcon:a,closeIcon:s,...l}){const c=Math.min(n,e.length)*7,[u,d]=Tt(i??!0),f=fd(),h=o||f.palette?.primary?.main||"var(--bs-primary,#7367AA)",m=o||"#ebe9f1",g=()=>{d(v=>!v)};return M(Hf,{sx:{...l.style,...l.sx,width:"100%"},"aria-type":"SEGMENT",children:ke(Hf,{xs:12,container:!0,sx:{borderStyle:"solid",borderWidth:"1px",borderColor:m,position:"relative",marginLeft:"0.1rem",marginRight:"0.1rem",borderRadius:"0.357rem !important",borderTopWidth:"0px !important",padding:"1rem 0.1rem","::before":{content:'""',backgroundColor:m,position:"absolute",top:0,right:"2px",width:`calc(${c===0?"100%":`90% - ${c}px`})`,height:"0.7px"},"::after":{content:'""',backgroundColor:m,position:"absolute",top:0,right:"2px",width:"20px",height:"0.7px"}},children:[M("span",{style:{position:"absolute",top:"-10px",right:"10px",fontSize:"80%",padding:"0 13px",width:`calc(100px + ${c}px)`},children:M(vd,{title:e,children:M("span",{children:e.length>n?ke(yr,{children:[e.substring(0,n)," ..."]}):e})})}),r&&M(g$e,{sx:{position:"absolute",top:"-8px",right:"20px",fontSize:"80%",padding:"0 16px",width:"20px",color:h},children:M("div",{onClick:g,children:u?a||M(h$e,{size:18}):s||M(p$e,{size:18})})}),M(ij,{in:r?u:!0,style:{width:"100%"},children:M($e.Fragment,{children:t})})]})})}function RG(t){return zt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20h9"}},{tag:"path",attr:{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}}]})(t)}function IG(t){return zt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"}},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"}},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"}}]})(t)}function gI(t){return zt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}},{tag:"polyline",attr:{points:"17 8 12 3 7 8"}},{tag:"line",attr:{x1:"12",y1:"3",x2:"12",y2:"15"}}]})(t)}function v$e({onUpload:t,label:e,multiple:n=!1,...r}){const i=o=>{const a=o.target.files;a&&t(a)};return ke("label",{className:"app-file-uploader",htmlFor:"AppFileUploader",children:[e&&M("span",{className:"app-file-uploader__label",children:e}),M(Hv,{component:"label",htmlFor:"AppFileUploader",sx:{padding:"7px 7px",minWidth:"36px"},children:M(gI,{size:20})}),M("input",{id:"AppFileUploader",type:"file",...r,hidden:!0,multiple:!0,onChange:i})]})}function b$e({style:t,sx:e,children:n,onSubmit:r,loading:i=!1,defaultValues:o,errorHandlingMode:a="onChange"},s){const l=Dpe({mode:a,defaultValues:o});return cu(s,()=>({formState:l})),M(E9,{...l,"aria-type":"FORM_CONTAINER",children:ke("form",{className:"app-form-container",onSubmit:l.handleSubmit(r),style:{...e,...t},children:[n,i&&M("div",{className:"app-form-container__loading",children:M(nl,{})})]})})}var y$e=Ui(b$e);function x$e({name:t="",rules:e={},Component:n,...r}){const{control:i}=Wm(),{field:o,fieldState:{error:a}}=Hm({control:i,name:t,rules:e,shouldUnregister:!0,defaultValue:r?.defaultValue});function s(...l){//! this will change in the future
567
567
  r.autoComplete?o.onChange(l[1]):o.onChange(...l),r?.onChange?.(...l)}return ke("div",{children:[M(n,{...o,...r,onChange:s}),a&&a.message&&M("span",{style:{color:"red"},children:a.message})]})}function w$e({children:t,handleClose:e,open:n,...r}){return M(pd,{open:n,onClose:e,...r,"aria-type":"DIALOG",children:t})}function C$e(t){return zt({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Brightness_Up"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12,17.5A5.5,5.5,0,1,1,17.5,12,5.506,5.506,0,0,1,12,17.5Zm0-10A4.5,4.5,0,1,0,16.5,12,4.505,4.505,0,0,0,12,7.5Z"}},{tag:"circle",attr:{cx:"12",cy:"3.063",r:"1"}},{tag:"circle",attr:{cx:"12",cy:"20.937",r:"1"}},{tag:"circle",attr:{cx:"20.937",cy:"12",r:"1"}},{tag:"circle",attr:{cx:"3.063",cy:"12",r:"1"}},{tag:"circle",attr:{cx:"18.319",cy:"5.681",r:"1"}},{tag:"circle",attr:{cx:"5.681",cy:"18.319",r:"1"}},{tag:"circle",attr:{cx:"18.319",cy:"18.319",r:"1"}},{tag:"circle",attr:{cx:"5.681",cy:"5.681",r:"1"}}]}]}]})(t)}function E$e(t){return zt({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"File_On"},child:[{tag:"path",attr:{d:"M19.485,7.35l-4.97-4.86a1.466,1.466,0,0,0-1.05-.43h-6.9a2.5,2.5,0,0,0-2.5,2.5V19.44a2.507,2.507,0,0,0,2.5,2.5h10.87a2.507,2.507,0,0,0,2.5-2.5V8.42A1.49,1.49,0,0,0,19.485,7.35Zm-1.27.15h-2.34a1.5,1.5,0,0,1-1.5-1.5V3.75Zm.72,11.94a1.5,1.5,0,0,1-1.5,1.5H6.565a1.5,1.5,0,0,1-1.5-1.5V4.56a1.5,1.5,0,0,1,1.5-1.5h6.81V6a2.5,2.5,0,0,0,2.5,2.5h3.06Z"}}]}]})(t)}function S$e(t){return zt({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Image_Off"},child:[{tag:"path",attr:{d:"M19.937,14.218l0,-8.654c0,-0.829 -0.672,-1.5 -1.5,-1.5l-10.628,-0c-0.276,-0 -0.5,-0.225 -0.5,-0.5c0,-0.276 0.224,-0.5 0.5,-0.5l10.628,-0c1.38,-0 2.5,1.118 2.5,2.5l0,10.624c0,0.276 -0.224,0.5 -0.5,0.501c-0.276,-0 -0.5,-0.225 -0.5,-0.5l0,-0.556l-4.583,-4.584c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.162,0.162 2.37,2.37 3.876,3.876Zm-0.121,6.304c-0.395,0.262 -0.869,0.415 -1.379,0.415l-12.874,-0c-1.381,-0 -2.5,-1.119 -2.5,-2.5l0,-12.873c0,-0.51 0.153,-0.984 0.414,-1.38l-0.263,-0.263c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.088,0.088 0.176,0.176 0.263,0.263c0.245,0.245 16.095,16.094 16.339,16.338l0.263,0.263c0.455,0.456 -0.252,1.163 -0.707,0.707c-0.088,-0.087 -0.175,-0.175 -0.263,-0.263Zm-11.104,-11.103l-2.001,-2.001c-0.094,0.196 -0.146,0.415 -0.146,0.647c-0,0.829 0.672,1.5 1.5,1.5c0.232,-0 0.451,-0.052 0.647,-0.146Zm-2.733,-2.733l-1.77,-1.77c-0.093,0.196 -0.146,0.416 -0.146,0.648l0,10.717l1.926,-1.926c0.587,-0.586 1.536,-0.586 2.122,-0l0.555,0.554c0.195,0.196 0.511,0.196 0.706,0l2.415,-2.415l-2.343,-2.343c-0.395,0.262 -0.869,0.414 -1.379,0.414c-1.38,-0 -2.5,-1.119 -2.5,-2.5c-0,-0.509 0.152,-0.983 0.414,-1.379Zm-1.916,11.009l0,0.741c0,0.829 0.671,1.5 1.5,1.5l12.874,0c0.232,0 0.451,-0.052 0.647,-0.145c-0.165,-0.165 -3.264,-3.263 -6.59,-6.59l-2.414,2.415c-0.585,0.586 -1.537,0.586 -2.122,0l-0.554,-0.554c-0.195,-0.196 -0.512,-0.196 -0.708,0l-2.633,2.633Z"}}]}]})(t)}function D$e(t){return zt({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Square_Minus"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M18.438,20.938H5.564a2.5,2.5,0,0,1-2.5-2.5V5.564a2.5,2.5,0,0,1,2.5-2.5H18.438a2.5,2.5,0,0,1,2.5,2.5V18.438A2.5,2.5,0,0,1,18.438,20.938ZM5.564,4.064a1.5,1.5,0,0,0-1.5,1.5V18.438a1.5,1.5,0,0,0,1.5,1.5H18.438a1.5,1.5,0,0,0,1.5-1.5V5.564a1.5,1.5,0,0,0-1.5-1.5Z"}},{tag:"path",attr:{d:"M9,12.5a.5.5,0,0,1,0-1h6a.5.5,0,0,1,0,1Z"}}]}]}]})(t)}function T$e(t){return zt({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Square_Plus"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M18.438,20.938H5.563a2.5,2.5,0,0,1-2.5-2.5V5.564a2.5,2.5,0,0,1,2.5-2.5H18.438a2.5,2.5,0,0,1,2.5,2.5V18.438A2.5,2.5,0,0,1,18.438,20.938ZM5.563,4.064a1.5,1.5,0,0,0-1.5,1.5V18.438a1.5,1.5,0,0,0,1.5,1.5H18.438a1.5,1.5,0,0,0,1.5-1.5V5.564a1.5,1.5,0,0,0-1.5-1.5Z"}},{tag:"path",attr:{d:"M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z"}}]}]}]})(t)}function A$e(t){return ke(Ln,{sx:{position:"relative",display:"inline-flex"},children:[M(nl,{variant:"determinate",...t}),M(Ln,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:M(Wr,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(t.value)}%`})})]})}function mI({progress:t}){return M("div",{className:"app-uploading-file",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:M("div",{className:"parent",style:{position:"relative",borderRadius:"8px"},children:ke("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:[M(E$e,{style:{position:"absolute",height:"100%",width:"100%",opacity:.2}}),M(A$e,{variant:t===0?"indeterminate":"determinate",value:t})]})})})}var s1={};s1.d=(t,e)=>{for(var n in e)s1.o(e,n)&&!s1.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s1.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Mn=globalThis.pdfjsLib={};s1.d(Mn,{AbortException:()=>pg,AnnotationEditorLayer:()=>bf,AnnotationEditorParamsType:()=>kn,AnnotationEditorType:()=>Bn,AnnotationEditorUIManager:()=>dp,AnnotationLayer:()=>DUe,AnnotationMode:()=>oh,ColorPicker:()=>vc,DOMSVGFactory:()=>WI,DrawLayer:()=>Wa,FeatureTest:()=>es,GlobalWorkerOptions:()=>f1,ImageKind:()=>RD,InvalidPDFException:()=>LG,MissingPDFException:()=>hg,OPS:()=>Lc,OutputScale:()=>kI,PDFDataRangeTransport:()=>mX,PDFDateString:()=>UG,PDFWorker:()=>Ko,PasswordResponses:()=>O$e,PermissionFlag:()=>M$e,PixelsPerInch:()=>ab,RenderingCancelledException:()=>DI,TextLayer:()=>UI,UnexpectedResponseException:()=>FD,Util:()=>un,VerbosityLevel:()=>ID,XfaLayer:()=>xX,build:()=>oUe,createValidAbsoluteUrl:()=>N$e,fetchData:()=>$D,getDocument:()=>Kze,getFilenameFromUrl:()=>V$e,getPdfFilenameFromUrl:()=>j$e,getXfaPageViewport:()=>Y$e,isDataScheme:()=>zD,isPdfFile:()=>TI,noContextMenu:()=>Vl,normalizeUnicode:()=>U$e,setLayerDimensions:()=>gg,shadow:()=>ir,version:()=>iUe});const ka=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),NG=[1,0,0,1,0,0],vI=[.001,0,0,.001,0,0],k$e=1e7,bI=1.35,al={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},oh={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},_$e="pdfjs_internal_editor_",Bn={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},kn={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},M$e={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},_a={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},RD={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Mo={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},l1={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ID={ERRORS:0,WARNINGS:1,INFOS:5},Lc={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},O$e={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let ND=ID.WARNINGS;function P$e(t){Number.isInteger(t)&&(ND=t)}function R$e(){return ND}function LD(t){ND>=ID.INFOS&&console.log(`Info: ${t}`)}function Vn(t){ND>=ID.WARNINGS&&console.log(`Warning: ${t}`)}function Si(t){throw new Error(t)}function Oo(t,e){t||Si(e)}function I$e(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function N$e(t,e=null,n=null){if(!t)return null;try{if(n&&typeof t=="string"&&(n.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),n.tryConvertEncoding))try{t=z$e(t)}catch{}const r=e?new URL(t,e):new URL(t);if(I$e(r))return r}catch{}return null}function ir(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const ah=(function(){function e(n,r){this.message=n,this.name=r}return e.prototype=new Error,e.constructor=e,e})();class yI extends ah{constructor(e,n){super(e,"PasswordException"),this.code=n}}class xI extends ah{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class LG extends ah{constructor(e){super(e,"InvalidPDFException")}}class hg extends ah{constructor(e){super(e,"MissingPDFException")}}class FD extends ah{constructor(e,n){super(e,"UnexpectedResponseException"),this.status=n}}class L$e extends ah{constructor(e){super(e,"FormatError")}}class pg extends ah{constructor(e){super(e,"AbortException")}}function FG(t){(typeof t!="object"||t?.length===void 0)&&Si("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let i=0;i<e;i+=n){const o=Math.min(i+n,e),a=t.subarray(i,o);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function BD(t){typeof t!="string"&&Si("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r)&255;return n}function F$e(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function wI(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e}function B$e(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function $$e(){try{return new Function(""),!0}catch{return!1}}class es{static get isLittleEndian(){return ir(this,"isLittleEndian",B$e())}static get isEvalSupported(){return ir(this,"isEvalSupported",$$e())}static get isOffscreenCanvasSupported(){return ir(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?ir(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):ir(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return ir(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const CI=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class un{static makeHexColor(e,n,r){return`#${CI[e]}${CI[n]}${CI[r]}`}static scaleMinMax(e,n){let r;e[0]?(e[0]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[0],n[2]*=e[0],e[3]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[3],n[3]*=e[3]):(r=n[0],n[0]=n[1],n[1]=r,r=n[2],n[2]=n[3],n[3]=r,e[1]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[1],n[3]*=e[1],e[2]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[2],n[2]*=e[2]),n[0]+=e[4],n[1]+=e[5],n[2]+=e[4],n[3]+=e[5]}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static applyTransform(e,n){const r=e[0]*n[0]+e[1]*n[2]+n[4],i=e[0]*n[1]+e[1]*n[3]+n[5];return[r,i]}static applyInverseTransform(e,n){const r=n[0]*n[3]-n[1]*n[2],i=(e[0]*n[3]-e[1]*n[2]+n[2]*n[5]-n[4]*n[3])/r,o=(-e[0]*n[1]+e[1]*n[0]+n[4]*n[1]-n[5]*n[0])/r;return[i,o]}static getAxialAlignedBoundingBox(e,n){const r=this.applyTransform(e,n),i=this.applyTransform(e.slice(2,4),n),o=this.applyTransform([e[0],e[3]],n),a=this.applyTransform([e[2],e[1]],n);return[Math.min(r[0],i[0],o[0],a[0]),Math.min(r[1],i[1],o[1],a[1]),Math.max(r[0],i[0],o[0],a[0]),Math.max(r[1],i[1],o[1],a[1])]}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static singularValueDecompose2dScale(e){const n=[e[0],e[2],e[1],e[3]],r=e[0]*n[0]+e[1]*n[2],i=e[0]*n[1]+e[1]*n[3],o=e[2]*n[0]+e[3]*n[2],a=e[2]*n[1]+e[3]*n[3],s=(r+a)/2,l=Math.sqrt((r+a)**2-4*(r*a-o*i))/2,c=s+l||1,u=s-l||1;return[Math.sqrt(c),Math.sqrt(u)]}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){const r=Math.max(Math.min(e[0],e[2]),Math.min(n[0],n[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(n[0],n[2]));if(r>i)return null;const o=Math.max(Math.min(e[1],e[3]),Math.min(n[1],n[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(n[1],n[3]));return o>a?null:[r,o,i,a]}static#e(e,n,r,i,o,a,s,l,c,u){if(c<=0||c>=1)return;const d=1-c,f=c*c,h=f*c,m=d*(d*(d*e+3*c*n)+3*f*r)+h*i,g=d*(d*(d*o+3*c*a)+3*f*s)+h*l;u[0]=Math.min(u[0],m),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],m),u[3]=Math.max(u[3],g)}static#t(e,n,r,i,o,a,s,l,c,u,d,f){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,n,r,i,o,a,s,l,-d/u,f);return}const h=u**2-4*d*c;if(h<0)return;const m=Math.sqrt(h),g=2*c;this.#e(e,n,r,i,o,a,s,l,(-u+m)/g,f),this.#e(e,n,r,i,o,a,s,l,(-u-m)/g,f)}static bezierBoundingBox(e,n,r,i,o,a,s,l,c){return c?(c[0]=Math.min(c[0],e,s),c[1]=Math.min(c[1],n,l),c[2]=Math.max(c[2],e,s),c[3]=Math.max(c[3],n,l)):c=[Math.min(e,s),Math.min(n,l),Math.max(e,s),Math.max(n,l)],this.#t(e,r,o,s,n,i,a,l,3*(-e+3*(r-o)+s),6*(e-2*r+o),3*(r-e),c),this.#t(e,r,o,s,n,i,a,l,3*(-n+3*(i-a)+l),6*(n-2*i+a),3*(i-n),c),c}}function z$e(t){return decodeURIComponent(escape(t))}let EI=null,BG=null;function U$e(t){return EI||(EI=/([\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,BG=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(EI,(e,n,r)=>n?n.normalize("NFKC"):BG.get(r))}function W$e(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(Math.random()*255);return FG(t)}const SI="pdfjs_internal_id_",Td={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};function H$e(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(FG(t))}const Ad="http://www.w3.org/2000/svg";class ab{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function $D(t,e="text"){if(c1(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":n(i.response);return}n(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}class Uw{constructor({viewBox:e,scale:n,rotation:r,offsetX:i=0,offsetY:o=0,dontFlip:a=!1}){this.viewBox=e,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=o;const s=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,u=0,d=0,f=1;break;case 90:c=0,u=1,d=1,f=0;break;case 270:c=0,u=-1,d=-1,f=0;break;case 0:c=1,u=0,d=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,f=-f);let h,m,g,v;c===0?(h=Math.abs(l-e[1])*n+i,m=Math.abs(s-e[0])*n+o,g=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(h=Math.abs(s-e[0])*n+i,m=Math.abs(l-e[1])*n+o,g=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[c*n,u*n,d*n,f*n,h-c*n*s-d*n*l,m-u*n*s-f*n*l],this.width=g,this.height=v}get rawDims(){const{viewBox:e}=this;return ir(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:o=!1}={}){return new Uw({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:r,offsetY:i,dontFlip:o})}convertToViewportPoint(e,n){return un.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=un.applyTransform([e[0],e[1]],this.transform),r=un.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],r[0],r[1]]}convertToPdfPoint(e,n){return un.applyInverseTransform([e,n],this.transform)}}class DI extends ah{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function zD(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function TI(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function V$e(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function j$e(t,e="document.pdf"){if(typeof t!="string")return e;if(zD(t))return Vn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=n.exec(t);let o=r.exec(i[1])||r.exec(i[2])||r.exec(i[3]);if(o&&(o=o[0],o.includes("%")))try{o=r.exec(decodeURIComponent(o))[0]}catch{}return o||e}class $G{started=Object.create(null);times=[];time(e){e in this.started&&Vn(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Vn(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const{name:r}of this.times)n=Math.max(r.length,n);for(const{name:r,start:i,end:o}of this.times)e.push(`${r.padEnd(n)} ${o-i}ms
568
- `);return e.join("")}}function c1(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return n==="http:"||n==="https:"}catch{return!1}}function Vl(t){t.preventDefault()}function zG(t){console.log("Deprecated API usage: "+t)}class UG{static#e;static toDateObject(e){if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const n=this.#e.exec(e);if(!n)return null;const r=parseInt(n[1],10);let i=parseInt(n[2],10);i=i>=1&&i<=12?i-1:0;let o=parseInt(n[3],10);o=o>=1&&o<=31?o:1;let a=parseInt(n[4],10);a=a>=0&&a<=23?a:0;let s=parseInt(n[5],10);s=s>=0&&s<=59?s:0;let l=parseInt(n[6],10);l=l>=0&&l<=59?l:0;const c=n[7]||"Z";let u=parseInt(n[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(n[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(a+=u,s+=d):c==="+"&&(a-=u,s-=d),new Date(Date.UTC(r,i,o,a,s,l))}}function Y$e(t,{scale:e=1,rotation:n=0}){const{width:r,height:i}=t.attributes.style,o=[0,0,parseInt(r),parseInt(i)];return new Uw({viewBox:o,scale:e,rotation:n})}function AI(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Vn(`Not a valid color format: "${t}"`),[0,0,0])}function q$e(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,AI(r))}e.remove()}function $i(t){const{a:e,b:n,c:r,d:i,e:o,f:a}=t.getTransform();return[e,n,r,i,o,a]}function kd(t){const{a:e,b:n,c:r,d:i,e:o,f:a}=t.getTransform().invertSelf();return[e,n,r,i,o,a]}function gg(t,e,n=!1,r=!0){if(e instanceof Uw){const{pageWidth:i,pageHeight:o}=e.rawDims,{style:a}=t,s=es.isCSSRoundSupported,l=`var(--scale-factor) * ${i}px`,c=`var(--scale-factor) * ${o}px`,u=s?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,d=s?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!n||e.rotation%180===0?(a.width=u,a.height=d):(a.width=d,a.height=u)}r&&t.setAttribute("data-main-rotation",e.rotation)}class kI{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}class Ww{#e=null;#t=null;#n;#r=null;#o=null;static#i=null;constructor(e){this.#n=e,Ww.#i||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const n=this.#n._uiManager._signal;e.addEventListener("contextmenu",Vl,{signal:n}),e.addEventListener("pointerdown",Ww.#s,{signal:n});const r=this.#r=document.createElement("div");r.className="buttons",e.append(r);const i=this.#n.toolbarPosition;if(i){const{style:o}=e,a=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];o.insetInlineEnd=`${100*a}%`,o.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),e}get div(){return this.#e}static#s(e){e.stopPropagation()}#l(e){this.#n._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#c(e){const n=this.#n._uiManager._signal;e.addEventListener("focusin",this.#l.bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",Vl,{signal:n})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#o?.shown()}#d(){const{editorType:e,_uiManager:n}=this.#n,r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",Ww.#i[e]),this.#c(r),r.addEventListener("click",i=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#a(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const n=await e.render();this.#c(n),this.#r.prepend(n,this.#a),this.#o=e}addColorPicker(e){this.#t=e;const n=e.renderButton();this.#c(n),this.#r.prepend(n,this.#a)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class G$e{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Vl,{signal:this.#n._signal});const n=this.#e=document.createElement("div");return n.className="buttons",e.append(n),this.#i(),e}#o(e,n){let r=0,i=0;for(const o of e){const a=o.y+o.height;if(a<r)continue;const s=o.x+(n?o.width:0);if(a>r){i=s,r=a;continue}n?s>i&&(i=s):s<i&&(i=s)}return[n?1-i:i,r]}show(e,n,r){const[i,o]=this.#o(n,r),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*o}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#i(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const n=document.createElement("span");e.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=this.#n._signal;e.addEventListener("contextmenu",Vl,{signal:r}),e.addEventListener("click",()=>{this.#n.highlightSelection("floating_button")},{signal:r}),this.#e.append(e)}}function UD(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}function X$e(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class K$e{#e=0;get id(){return`${_$e}${this.#e++}`}}class t9{#e=W$e();#t=0;#n=null;static get _isSVGFittingCanvas(){const e='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>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const o=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return ir(this,"_isSVGFittingCanvas",o)}async#r(e,n){this.#n||=new Map;let r=this.#n.get(e);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof n=="string"?(r.url=n,i=await $D(n,"blob")):n instanceof File?i=r.file=n:n instanceof Blob&&(i=n),i.type==="image/svg+xml"){const o=t9._isSVGFittingCanvas,a=new FileReader,s=new Image,l=new Promise((c,u)=>{s.onload=()=>{r.bitmap=s,r.isSvg=!0,c()},a.onload=async()=>{const d=r.svgUrl=a.result;s.src=await o?`${d}#svgView(preserveAspectRatio(none))`:d},s.onerror=a.onerror=u});a.readAsDataURL(i),await l}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){console.error(i),r=null}return this.#n.set(e,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){const{lastModified:n,name:r,size:i,type:o}=e;return this.#r(`${n}_${r}_${i}_${o}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,n){const r=await n;return this.#r(e,r)}async getFromId(e){this.#n||=new Map;const n=this.#n.get(e);if(!n)return null;if(n.bitmap)return n.refCounter+=1,n;if(n.file)return this.getFromFile(n.file);if(n.blobPromise){const{blobPromise:r}=n;return delete n.blobPromise,this.getFromBlob(n.id,r)}return this.getFromUrl(n.url)}getFromCanvas(e,n){this.#n||=new Map;let r=this.#n.get(e);if(r?.bitmap)return r.refCounter+=1,r;const i=new OffscreenCanvas(n.width,n.height);return i.getContext("2d").drawImage(n,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,r),this.#n.set(r.id,r),r}getSvgUrl(e){const n=this.#n.get(e);return n?.isSvg?n.svgUrl:null}deleteId(e){this.#n||=new Map;const n=this.#n.get(e);if(!n||(n.refCounter-=1,n.refCounter!==0))return;const{bitmap:r}=n;if(!n.url&&!n.file){const i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),n.blobPromise=i.convertToBlob()}r.close?.(),n.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class Z$e{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:n,post:r,mustExec:i,type:o=NaN,overwriteIfSameType:a=!1,keepUndo:s=!1}){if(i&&e(),this.#t)return;const l={cmd:e,undo:n,post:r,type:o};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(l);return}if(a&&this.#e[this.#r].type===o){s&&(l.undo=this.#e[this.#r].undo),this.#e[this.#r]=l;return}const c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#r===-1)return;this.#t=!0;const{undo:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1,this.#r-=1}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;const{cmd:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}destroy(){this.#e=null}}class u1{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=es.platform;for(const[r,i,o={}]of e)for(const a of r){const s=a.startsWith("mac+");n&&s?(this.callbacks.set(a.slice(4),{callback:i,options:o}),this.allKeys.add(a.split("+").at(-1))):!n&&!s&&(this.callbacks.set(a,{callback:i,options:o}),this.allKeys.add(a.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const n=this.buffer.join("+");return this.buffer.length=0,n}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(this.#e(n));if(!r)return;const{callback:i,options:{bubbles:o=!1,args:a=[],checker:s=null}}=r;s&&!s(e,n)||(i.bind(e,...a,n)(),o||(n.stopPropagation(),n.preventDefault()))}}class n9{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return q$e(e),ir(this,"_colors",e)}convert(e){const n=AI(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,i]of this._colors)if(i.every((o,a)=>o===n[a]))return n9._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?un.makeHexColor(...n):e}}class dp{#e=new AbortController;#t=null;#n=new Map;#r=new Map;#o=null;#i=null;#s=null;#l=new Z$e;#u=null;#c=0;#d=new Set;#a=null;#f=null;#p=new Set;#h=!1;#v=!1;#m=!1;#g=null;#b=null;#x=null;#T=null;#E=!1;#S=null;#N=new K$e;#A=!1;#w=!1;#D=null;#k=null;#_=null;#P=null;#C=Bn.NONE;#y=new Set;#R=null;#I=null;#L=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#$=[0,0];#F=null;#B=null;#U=null;#M=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=dp.prototype,n=a=>a.#B.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:s})=>{if(s instanceof HTMLInputElement){const{type:l}=s;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return ir(this,"_keyboardManager",new u1([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:s})=>!(s instanceof HTMLButtonElement)&&a.#B.contains(s)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:s})=>!(s instanceof HTMLButtonElement)&&a.#B.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:n}]]))}constructor(e,n,r,i,o,a,s,l,c,u,d){const f=this._signal=this.#e.signal;this.#B=e,this.#U=n,this.#o=r,this._eventBus=i,i._on("editingaction",this.onEditingAction.bind(this),{signal:f}),i._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),i._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),i._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),i._on("setpreference",this.onSetPreference.bind(this),{signal:f}),i._on("switchannotationeditorparams",h=>this.updateParams(h.type,h.value),{signal:f}),this.#ee(),this.#ie(),this.#q(),this.#i=o.annotationStorage,this.#g=o.filterFactory,this.#I=a,this.#T=s||null,this.#h=l,this.#v=c,this.#m=u,this.#P=d||null,this.viewParameters={realScale:ab.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#M?.resolve(),this.#M=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#r.values())e.destroy();this.#r.clear(),this.#n.clear(),this.#p.clear(),this.#t=null,this.#y.clear(),this.#l.destroy(),this.#o?.destroy(),this.#S?.hide(),this.#S=null,this.#b&&(clearTimeout(this.#b),this.#b=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#P}get useNewAltTextFlow(){return this.#v}get useNewAltTextWhenAddingImage(){return this.#m}get hcmFilter(){return ir(this,"hcmFilter",this.#I?this.#g.addHCMFilter(this.#I.foreground,this.#I.background):"none")}get direction(){return ir(this,"direction",getComputedStyle(this.#B).direction)}get highlightColors(){return ir(this,"highlightColors",this.#T?new Map(this.#T.split(",").map(e=>e.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return ir(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){this.#_=e}editAltText(e,n=!1){this.#o?.editAltText(this,e,n)}switchToMode(e,n){this._eventBus.on("annotationeditormodechanged",n,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,n){this._eventBus.dispatch("setpreference",{source:this,name:e,value:n})}onSetPreference({name:e,value:n}){switch(e){case"enableNewAltTextWhenAddingImage":this.#m=n;break}}onPageChanging({pageNumber:e}){this.#c=e-1}focusMainContainer(){this.#B.focus()}findParent(e,n){for(const r of this.#r.values()){const{x:i,y:o,width:a,height:s}=r.div.getBoundingClientRect();if(e>=i&&e<=i+a&&n>=o&&n<=o+s)return r}return null}disableUserSelect(e=!1){this.#U.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*ab.PDF_TO_CSS_UNITS;for(const n of this.#p)n.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#V({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Y(e){const{currentLayer:n}=this;if(n.hasTextLayer(e))return n;for(const r of this.#r.values())if(r.hasTextLayer(e))return r;return null}highlightSelection(e=""){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}=n,s=n.toString(),c=this.#V(n).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;n.empty();const d=this.#Y(c),f=this.#C===Bn.NONE,h=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:u,anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a,text:s}),f&&this.showAllEditors("highlight",!0,!0)};if(f){this.switchToMode(Bn.HIGHLIGHT,h);return}h()}#J(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=this.#V(e).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(this.#S||=new G$e(this),this.#S.show(r,i,this.direction==="ltr"))}addToAnnotationStorage(e){!e.isEmpty()&&this.#i&&!this.#i.has(e.id)&&this.#i.setValue(e.id,e)}#Q(){const e=document.getSelection();if(!e||e.isCollapsed){this.#R&&(this.#S?.hide(),this.#R=null,this.#O({hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===this.#R)return;const i=this.#V(e).closest(".textLayer");if(!i){this.#R&&(this.#S?.hide(),this.#R=null,this.#O({hasSelectedText:!1}));return}if(this.#S?.hide(),this.#R=n,this.#O({hasSelectedText:!0}),!(this.#C!==Bn.HIGHLIGHT&&this.#C!==Bn.NONE)&&(this.#C===Bn.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){const o=this.#C===Bn.HIGHLIGHT?this.#Y(i):null;o?.toggleDrawing();const a=new AbortController,s=this.combinedSignal(a),l=c=>{c.type==="pointerup"&&c.button!==0||(a.abort(),o?.toggleDrawing(!0),c.type==="pointerup"&&this.#j("main_toolbar"))};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})}}#j(e=""){this.#C===Bn.HIGHLIGHT?this.highlightSelection(e):this.#h&&this.#J()}#ee(){document.addEventListener("selectionchange",this.#Q.bind(this),{signal:this._signal})}#te(){if(this.#x)return;this.#x=new AbortController;const e=this.combinedSignal(this.#x);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#ne(){this.#x?.abort(),this.#x=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#j("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of this.#y)if(n.div.contains(e)){this.#k=[n,e],n._focusEventsAllowed=!1;break}}focus(){if(!this.#k)return;const[e,n]=this.#k;this.#k=null,n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}#q(){if(this.#D)return;this.#D=new AbortController;const e=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#re(){this.#D?.abort(),this.#D=null}#G(){if(this.#u)return;this.#u=new AbortController;const e=this.combinedSignal(this.#u);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#X(){this.#u?.abort(),this.#u=null}#ie(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#q(),this.#G()}removeEditListeners(){this.#re(),this.#X()}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of this.#f)if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of this.#f)if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const n=[];for(const r of this.#y){const i=r.serialize(!0);i&&n.push(i)}n.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:n}=e;for(const o of n.items)for(const a of this.#f)if(a.isHandlingMimeForPasting(o.type)){a.paste(o,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(o){Vn(`paste: "${o.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const o=[];for(const l of r){const c=await i.deserialize(l);if(!c)return;o.push(c)}const a=()=>{for(const l of o)this.#K(l);this.#Z(o)},s=()=>{for(const l of o)l.remove()};this.addCommands({cmd:a,undo:s,mustExec:!0})}catch(o){Vn(`paste: "${o.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#C!==Bn.NONE&&!this.isEditorHandlingKeyboard&&dp._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#j("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#O(e){Object.entries(e).some(([r,i])=>this.#W[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#W,e)}),this.#C===Bn.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#z([[kn.HIGHLIGHT_FREE,!0]]))}#z(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#te(),this.#G(),this.#O({isEditing:this.#C!==Bn.NONE,isEmpty:this.#H(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#X(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#f){this.#f=e;for(const n of this.#f)this.#z(n.defaultPropertiesToUpdate)}}getId(){return this.#N.id}get currentLayer(){return this.#r.get(this.#c)}getLayer(e){return this.#r.get(e)}get currentPageIndex(){return this.#c}addLayer(e){this.#r.set(e.pageIndex,e),this.#A?e.enable():e.disable()}removeLayer(e){this.#r.delete(e.pageIndex)}async updateMode(e,n=null,r=!1){if(this.#C!==e&&!(this.#M&&(await this.#M.promise,!this.#M))){if(this.#M=Promise.withResolvers(),this.#C=e,e===Bn.NONE){this.setEditingState(!1),this.#ae(),this.#M.resolve();return}this.setEditingState(!0),await this.#oe(),this.unselectAll();for(const i of this.#r.values())i.updateMode(e);if(!n){r&&this.addNewEditorFromKeyboard(),this.#M.resolve();return}for(const i of this.#n.values())i.annotationElementId===n?(this.setSelected(i),i.enterInEditMode()):i.unselect();this.#M.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#C&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,n){if(this.#f){switch(e){case kn.CREATE:this.currentLayer.addNewEditor();return;case kn.HIGHLIGHT_DEFAULT_COLOR:this.#_?.updateColor(n);break;case kn.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(e,n),this.showAllEditors("highlight",n);break}for(const r of this.#y)r.updateParams(e,n);for(const r of this.#f)r.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){for(const o of this.#n.values())o.editorType===e&&o.show(n);(this.#L?.get(kn.HIGHLIGHT_SHOW_ALL)??!0)!==n&&this.#z([[kn.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(this.#w!==e){this.#w=e;for(const n of this.#r.values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}async#oe(){if(!this.#A){this.#A=!0;const e=[];for(const n of this.#r.values())e.push(n.enable());await Promise.all(e);for(const n of this.#n.values())n.enable()}}#ae(){if(this.unselectAll(),this.#A){this.#A=!1;for(const e of this.#r.values())e.disable();for(const e of this.#n.values())e.disable()}}getEditors(e){const n=[];for(const r of this.#n.values())r.pageIndex===e&&n.push(r);return n}getEditor(e){return this.#n.get(e)}addEditor(e){this.#n.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.focusMainContainer(),this.#b=null},0)),this.#n.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#d.has(e.annotationElementId))&&this.#i?.remove(e.id)}addDeletedAnnotationElement(e){this.#d.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#d.has(e)}removeDeletedAnnotationElement(e){this.#d.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#K(e){const n=this.#r.get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#z(e.propertiesToUpdate))}get#se(){let e=null;for(e of this.#y);return e}updateUI(e){this.#se===e&&this.#z(e.propertiesToUpdate)}toggleSelected(e){if(this.#y.has(e)){this.#y.delete(e),e.unselect(),this.#O({hasSelectedEditor:this.hasSelection});return}this.#y.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(e){for(const n of this.#y)n!==e&&n.unselect();this.#y.clear(),this.#y.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(e){return this.#y.has(e)}get firstSelectedEditor(){return this.#y.values().next().value}unselect(e){e.unselect(),this.#y.delete(e),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#y.size!==0}get isEnterHandled(){return this.#y.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#O({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#H()})}redo(){this.#l.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#H()})}addCommands(e){this.#l.add(e),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#H()})}#H(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(const e of this.#n.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#y],n=()=>{for(const i of e)i.remove()},r=()=>{for(const i of e)this.#K(i)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#Z(e){for(const n of this.#y)n.unselect();this.#y.clear();for(const n of e)n.isEmpty()||(this.#y.add(n),n.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#y)e.commit();this.#Z(this.#n.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#C!==Bn.NONE))&&this.hasSelection){for(const e of this.#y)e.unselect();this.#y.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#$[0]+=e,this.#$[1]+=n;const[i,o]=this.#$,a=[...this.#y],s=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#$[0]=this.#$[1]=0,this.addCommands({cmd:()=>{for(const l of a)this.#n.has(l.id)&&l.translateInPage(i,o)},undo:()=>{for(const l of a)this.#n.has(l.id)&&l.translateInPage(-i,-o)},mustExec:!1})},s);for(const l of a)l.translateInPage(e,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#a=new Map;for(const e of this.#y)this.#a.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#a)return!1;this.disableUserSelect(!1);const e=this.#a;this.#a=null;let n=!1;for(const[{x:i,y:o,pageIndex:a},s]of e)s.newX=i,s.newY=o,s.newPageIndex=a,n||=i!==s.savedX||o!==s.savedY||a!==s.savedPageIndex;if(!n)return!1;const r=(i,o,a,s)=>{if(this.#n.has(i.id)){const l=this.#r.get(s);l?i._setParentAndPosition(l,o,a):(i.pageIndex=s,i.x=o,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:o,newY:a,newPageIndex:s}]of e)r(i,o,a,s)},undo:()=>{for(const[i,{savedX:o,savedY:a,savedPageIndex:s}]of e)r(i,o,a,s)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(this.#a)for(const r of this.#a.keys())r.drag(e,n)}rebuild(e){if(e.parent===null){const n=this.getLayer(e.pageIndex);n?(n.changeParent(e),n.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#y.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#C}get imageManager(){return ir(this,"imageManager",new t9)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let c=0,u=n.rangeCount;c<u;c++)if(!e.contains(n.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:i,width:o,height:a}=e.getBoundingClientRect();let s;switch(e.getAttribute("data-main-rotation")){case"90":s=(c,u,d,f)=>({x:(u-i)/a,y:1-(c+d-r)/o,width:f/a,height:d/o});break;case"180":s=(c,u,d,f)=>({x:1-(c+d-r)/o,y:1-(u+f-i)/a,width:d/o,height:f/a});break;case"270":s=(c,u,d,f)=>({x:1-(u+f-i)/a,y:(c-r)/o,width:f/a,height:d/o});break;default:s=(c,u,d,f)=>({x:(c-r)/o,y:(u-i)/a,width:d/o,height:f/a});break}const l=[];for(let c=0,u=n.rangeCount;c<u;c++){const d=n.getRangeAt(c);if(!d.collapsed)for(const{x:f,y:h,width:m,height:g}of d.getClientRects())m===0||g===0||l.push(s(f,h,m,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:n}){(this.#s||=new Map).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){this.#s?.delete(e)}renderAnnotationElement(e){const n=this.#s?.get(e.data.id);if(!n)return;const r=this.#i.getRawValue(n);r&&(this.#C===Bn.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}}class Ju{#e=null;#t=!1;#n=null;#r=null;#o=null;#i=null;#s=!1;#l=null;#u=null;#c=null;#d=null;#a=!1;static#f=null;static _l10n=null;constructor(e){this.#u=e,this.#a=e._uiManager.useNewAltTextFlow,Ju.#f||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Ju._l10n??=e}async render(){const e=this.#n=document.createElement("button");e.className="altText",e.tabIndex="0";const n=this.#r=document.createElement("span");e.append(n),this.#a?(e.classList.add("new"),e.setAttribute("data-l10n-id",Ju.#f.missing),n.setAttribute("data-l10n-id",Ju.#f["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=this.#u._uiManager._signal;e.addEventListener("contextmenu",Vl,{signal:r}),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:r});const i=o=>{o.preventDefault(),this.#u._uiManager.editAltText(this.#u),this.#a&&this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#p}})};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(this.#s=!0,i(o))},{signal:r}),await this.#h(),e}get#p(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#a?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#a?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#d=await Ju._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#h())}toggleAltTextBadge(e=!1){if(!this.#a||this.#e){this.#l?.remove(),this.#l=null;return}if(!this.#l){const n=this.#l=document.createElement("div");n.className="noAltTextBadge",this.#u.div.append(n)}this.#l.classList.toggle("hidden",!e)}serialize(e){let n=this.#e;return!e&&this.#c===n&&(n=this.#d),{altText:n,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#d}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:n,guessedText:r,textWithDisclaimer:i,cancel:o=!1}){r&&(this.#c=r,this.#d=i),!(this.#e===e&&this.#t===n)&&(o||(this.#e=e,this.#t=n),this.#h())}toggle(e=!1){this.#n&&(!e&&this.#i&&(clearTimeout(this.#i),this.#i=null),this.#n.disabled=!e)}shown(){this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#o=null,this.#l?.remove(),this.#l=null}async#h(){const e=this.#n;if(!e)return;if(this.#a){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",Ju.#f[this.#p]),this.#r?.setAttribute("data-l10n-id",Ju.#f[`${this.#p}-label`]),!this.#e){this.#o?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#o?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=this.#o;if(!n){this.#o=n=document.createElement("span"),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${this.#u.id}`;const i=100,o=this.#u._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(this.#i),this.#i=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#i=setTimeout(()=>{this.#i=null,this.#o.classList.add("show"),this.#u._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:o}),e.addEventListener("mouseleave",()=>{this.#i&&(clearTimeout(this.#i),this.#i=null),this.#o?.classList.remove("show")},{signal:o})}this.#t?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=this.#e),n.parentNode||e.append(n),this.#u.getImageForAltText()?.setAttribute("aria-describedby",n.id)}}class _n{#e=null;#t=null;#n=null;#r=!1;#o=!1;#i=null;#s=null;#l=null;#u="";#c=!1;#d=null;#a=!1;#f=!1;#p=!1;#h=null;#v=0;#m=0;#g=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#b=!1;#x=_n._zIndex++;static _borderLineWidth=-1;static _colorManager=new n9;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=_n.prototype._resizeWithKeyboard,n=dp.TRANSLATE_SMALL,r=dp.TRANSLATE_BIG;return ir(this,"_resizerKeyboardManager",new u1([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],_n.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:n,rawDims:{pageWidth:r,pageHeight:i,pageX:o,pageY:a}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[o,a];const[s,l]=this.parentDimensions;this.x=e.x/s,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return ir(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new J$e({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n){if(_n._l10n??=e,_n._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),_n._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);_n._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Si("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#b}set _isDraggable(e){this.#b=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(e*2),this.y+=this.width*e/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(e*2),this.y-=this.width*e/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#x}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#L(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#c?this.#c=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,n,r,i){const[o,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(e+r)/o,this.y=(n+i)/a,this.fixAndSetPosition()}#T([e,n],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/e,this.y+=i/n,this.fixAndSetPosition()}translate(e,n){this.#T(this.parentDimensions,e,n)}translateInPage(e,n){this.#d||=[this.x,this.y],this.#T(this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}drag(e,n){this.#d||=[this.x,this.y];const[r,i]=this.parentDimensions;if(this.x+=e/r,this.y+=n/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:c,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:a}=this;const[s,l]=this.getBaseTranslation();o+=s,a+=l,this.div.style.left=`${(100*o).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#d&&(this.#d[0]!==this.x||this.#d[1]!==this.y)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=_n,i=r/e,o=r/n;switch(this.rotation){case 90:return[-i,o];case 180:return[i,o];case 270:return[i,-o];default:return[-i,-o]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[n,r]=this.pageDimensions;let{x:i,y:o,width:a,height:s}=this;if(a*=n,s*=r,i*=n,o*=r,this._mustFixPosition)switch(e){case 0:i=Math.max(0,Math.min(n-a,i)),o=Math.max(0,Math.min(r-s,o));break;case 90:i=Math.max(0,Math.min(n-s,i)),o=Math.min(r,Math.max(a,o));break;case 180:i=Math.min(n,Math.max(a,i)),o=Math.min(r,Math.max(s,o));break;case 270:i=Math.min(n,Math.max(s,i)),o=Math.max(0,Math.min(r-a,o));break}this.x=i/=n,this.y=o/=r;const[l,c]=this.getBaseTranslation();i+=l,o+=c;const{style:u}=this.div;u.left=`${(100*i).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}static#E(e,n,r){switch(r){case 90:return[n,-e];case 180:return[-e,-n];case 270:return[-n,e];default:return[e,n]}}screenToPageTranslation(e,n){return _n.#E(e,n,this.parentRotation)}pageTranslationToScreen(e,n){return _n.#E(e,n,360-this.parentRotation)}#S(e){switch(e){case 90:{const[n,r]=this.pageDimensions;return[0,-n/r,r/n,0]}case 180:return[-1,0,0,-1];case 270:{const[n,r]=this.pageDimensions;return[0,n/r,-r/n,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:e,pageDimensions:[n,r]}=this;return[n*e,r*e]}setDims(e,n){const[r,i]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,this.#o||(this.div.style.height=`${(100*n/i).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:n,width:r}=e,i=r.endsWith("%"),o=!this.#o&&n.endsWith("%");if(i&&o)return;const[a,s]=this.parentDimensions;i||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!this.#o&&!o&&(e.height=`${(100*parseFloat(n)/s).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#N(){if(this.#i)return;this.#i=document.createElement("div"),this.#i.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],n=this._uiManager._signal;for(const r of e){const i=document.createElement("div");this.#i.append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",this.#A.bind(this,r),{signal:n}),i.addEventListener("contextmenu",Vl,{signal:n}),i.tabIndex=-1}this.div.prepend(this.#i)}#A(e,n){n.preventDefault();const{isMac:r}=es.platform;if(n.button!==0||n.ctrlKey&&r)return;this.#n?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1;const o=new AbortController,a=this._uiManager.combinedSignal(o);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#D.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("contextmenu",Vl,{signal:a});const s=this.x,l=this.y,c=this.width,u=this.height,d=this.parent.div.style.cursor,f=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const h=()=>{o.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=d,this.div.style.cursor=f,this.#w(s,l,c,u)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})}#w(e,n,r,i){const o=this.x,a=this.y,s=this.width,l=this.height;o===e&&a===n&&s===r&&l===i||this.addCommands({cmd:()=>{this.width=s,this.height=l,this.x=o,this.y=a;const[c,u]=this.parentDimensions;this.setDims(c*s,u*l),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=i,this.x=e,this.y=n;const[c,u]=this.parentDimensions;this.setDims(c*r,u*i),this.fixAndSetPosition()},mustExec:!0})}#D(e,n){const[r,i]=this.parentDimensions,o=this.x,a=this.y,s=this.width,l=this.height,c=_n.MIN_SIZE/r,u=_n.MIN_SIZE/i,d=$=>Math.round($*1e4)/1e4,f=this.#S(this.rotation),h=($,N)=>[f[0]*$+f[2]*N,f[1]*$+f[3]*N],m=this.#S(360-this.rotation),g=($,N)=>[m[0]*$+m[2]*N,m[1]*$+m[3]*N];let v,b,y=!1,x=!1;switch(e){case"topLeft":y=!0,v=($,N)=>[0,0],b=($,N)=>[$,N];break;case"topMiddle":v=($,N)=>[$/2,0],b=($,N)=>[$/2,N];break;case"topRight":y=!0,v=($,N)=>[$,0],b=($,N)=>[0,N];break;case"middleRight":x=!0,v=($,N)=>[$,N/2],b=($,N)=>[0,N/2];break;case"bottomRight":y=!0,v=($,N)=>[$,N],b=($,N)=>[0,0];break;case"bottomMiddle":v=($,N)=>[$/2,N],b=($,N)=>[$/2,0];break;case"bottomLeft":y=!0,v=($,N)=>[0,N],b=($,N)=>[$,0];break;case"middleLeft":x=!0,v=($,N)=>[0,N/2],b=($,N)=>[$,N/2];break}const w=v(s,l),C=b(s,l);let E=h(...C);const S=d(o+E[0]),T=d(a+E[1]);let A=1,R=1,[P,_]=this.screenToPageTranslation(n.movementX,n.movementY);if([P,_]=g(P/r,_/i),y){const $=Math.hypot(s,l);A=R=Math.max(Math.min(Math.hypot(C[0]-w[0]-P,C[1]-w[1]-_)/$,1/s,1/l),c/s,u/l)}else x?A=Math.max(c,Math.min(1,Math.abs(C[0]-w[0]-P)))/s:R=Math.max(u,Math.min(1,Math.abs(C[1]-w[1]-_)))/l;const I=d(s*A),k=d(l*R);E=h(...b(I,k));const F=S-E[0],L=T-E[1];this.width=I,this.height=k,this.x=F,this.y=L,this.setDims(r*I,i*k),this.fixAndSetPosition()}altTextFinish(){this.#n?.finish()}async addEditToolbar(){return this._editToolbar||this.#f?this._editToolbar:(this._editToolbar=new Ww(this),this.div.append(this._editToolbar.render()),this.#n&&await this._editToolbar.addAltText(this.#n),this._editToolbar)}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#n?.destroy())}addContainer(e){const n=this._editToolbar?.div;n?n.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#n||(Ju.initialize(_n._l10n),this.#n=new Ju(this),this.#e&&(this.#n.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}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.#r?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#P();const[e,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/n).toFixed(2)}%`);const[r,i]=this.getInitialTranslation();return this.translate(r,i),UD(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:n}=es.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#_(e);return}this.#k(e)}get isSelected(){return this._uiManager.isSelected(this)}#k(e){const{isMac:n}=es.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}#_(e){const{isSelected:n}=this;this._uiManager.setUpDragSession();const r=new AbortController,i=this._uiManager.combinedSignal(r);if(n){this.div.classList.add("moving"),this.#v=e.clientX,this.#m=e.clientY;const a=s=>{const{clientX:l,clientY:c}=s,[u,d]=this.screenToPageTranslation(l-this.#v,c-this.#m);this.#v=l,this.#m=c,this._uiManager.dragSelectedEditors(u,d)};window.addEventListener("pointermove",a,{passive:!0,capture:!0,signal:i})}const o=()=>{r.abort(),n&&this.div.classList.remove("moving"),this.#c=!1,this._uiManager.endDragSession()||this.#k(e)};window.addEventListener("pointerup",o,{signal:i}),window.addEventListener("blur",o,{signal:i})}moveInDOM(){this.#h&&clearTimeout(this.#h),this.#h=setTimeout(()=>{this.#h=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,n,r){e.changeParent(this),this.x=n,this.y=r,this.fixAndSetPosition()}getRect(e,n,r=this.rotation){const i=this.parentScale,[o,a]=this.pageDimensions,[s,l]=this.pageTranslation,c=e/i,u=n/i,d=this.x*o,f=this.y*a,h=this.width*o,m=this.height*a;switch(r){case 0:return[d+c+s,a-f-u-m+l,d+c+h+s,a-f-u+l];case 90:return[d+u+s,a-f+c+l,d+u+m+s,a-f+c+h+l];case 180:return[d-c-h+s,a-f+u+l,d-c+s,a-f+u+m+l];case 270:return[d-u-m+s,a-f-c-h+l,d-u+s,a-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,i,o,a]=e,s=o-r,l=a-i;switch(this.rotation){case 0:return[r,n-a,s,l];case 90:return[r,n-i,l,s];case 180:return[o,n-i,s,l];case 270:return[o,n-a,l,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#p}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#P(){if(this.#l||!this.div)return;this.#l=new AbortController;const e=this._uiManager.combinedSignal(this.#l);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#P()}rotate(e){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,n=null){Si("An editor must be serializable")}static async deserialize(e,n,r){const i=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:r});i.rotation=e.rotation,i.#e=e.accessibilityData;const[o,a]=i.pageDimensions,[s,l,c,u]=i.getRectInCurrentCoords(e.rect,a);return i.x=s/o,i.y=l/a,i.width=c/o,i.height=u/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#l?.abort(),this.#l=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#h&&(clearTimeout(this.#h),this.#h=null),this.#L(),this.removeEditToolbar(),this.#g){for(const e of this.#g.values())clearTimeout(e);this.#g=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#N(),this.#i.classList.remove("hidden"),UD(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#s={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const n=this.#i.children;if(!this.#t){this.#t=Array.from(n);const a=this.#C.bind(this),s=this.#y.bind(this),l=this._uiManager._signal;for(const c of this.#t){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",s,{signal:l}),c.addEventListener("focus",this.#R.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",_n._l10nResizer[u])}}const r=this.#t[0];let i=0;for(const a of n){if(a===r)break;i++}const o=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(o!==i){if(o<i)for(let s=0;s<i-o;s++)this.#i.append(this.#i.firstChild);else if(o>i)for(let s=0;s<o-i;s++)this.#i.firstChild.before(this.#i.lastChild);let a=0;for(const s of n){const c=this.#t[a++].getAttribute("data-resizer-name");s.setAttribute("data-l10n-id",_n._l10nResizer[c])}}this.#I(0),this.#p=!0,this.#i.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#C(e){_n._resizerKeyboardManager.exec(this,e)}#y(e){this.#p&&e.relatedTarget?.parentNode!==this.#i&&this.#L()}#R(e){this.#u=this.#p?e:""}#I(e){if(this.#t)for(const n of this.#t)n.tabIndex=e}_resizeWithKeyboard(e,n){this.#p&&this.#D(this.#u,{movementX:e,movementY:n})}#L(){if(this.#p=!1,this.#I(-1),this.#s){const{savedX:e,savedY:n,savedWidth:r,savedHeight:i}=this.#s;this.#w(e,n,r,i),this.#s=null}}_stopResizingWithKeyboard(){this.#L(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}unselect(){this.#i?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0)}updateParams(e,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#a}set isEditing(e){this.#a=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,n){this.#o=!0;const r=e/n,{style:i}=this.div;i.aspectRatio=r,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,n=!1){if(n){this.#g||=new Map;const{action:r}=e;let i=this.#g.get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#g.delete(r),this.#g.size===0&&(this.#g=null)},_n._telemetryTimeout),this.#g.set(r,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#r=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#r=!0}renderAnnotationElement(e){let n=e.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),e.container.prepend(n);else if(n.nodeName==="CANVAS"){const r=n;n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),r.before(n)}return n}resetAnnotationElement(e){const{firstChild:n}=e.container;n?.nodeName==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}}class J$e extends _n{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const WG=3285377520,jl=4294901760,Ou=65535;class HG{constructor(e){this.h1=e?e&4294967295:WG,this.h2=e?e&4294967295:WG}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let g=0,v=e.length;g<v;g++){const b=e.charCodeAt(g);b<=255?n[r++]=b:(n[r++]=b>>>8,n[r++]=b&255)}}else if(ArrayBuffer.isView(e))n=e.slice(),r=n.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=r>>2,o=r-i*4,a=new Uint32Array(n.buffer,0,i);let s=0,l=0,c=this.h1,u=this.h2;const d=3432918353,f=461845907,h=d&Ou,m=f&Ou;for(let g=0;g<i;g++)g&1?(s=a[g],s=s*d&jl|s*h&Ou,s=s<<15|s>>>17,s=s*f&jl|s*m&Ou,c^=s,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[g],l=l*d&jl|l*h&Ou,l=l<<15|l>>>17,l=l*f&jl|l*m&Ou,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(s=0,o){case 3:s^=n[i*4+2]<<16;case 2:s^=n[i*4+1]<<8;case 1:s^=n[i*4],s=s*d&jl|s*h&Ou,s=s<<15|s>>>17,s=s*f&jl|s*m&Ou,i&1?c^=s:u^=s}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&jl|e*36045&Ou,n=n*4283543511&jl|((n<<16|e>>>16)*2950163797&jl)>>>16,e^=n>>>1,e=e*444984403&jl|e*60499&Ou,n=n*3301882366&jl|((n<<16|e>>>16)*3120437893&jl)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const _I=Object.freeze({map:null,hash:"",transfer:void 0});class MI{#e=!1;#t=null;#n=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const r=this.#n.get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return this.#n.get(e)}remove(e){if(this.#n.delete(e),this.#n.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of this.#n.values())if(n instanceof _n)return;this.onAnnotationEditor(null)}}setValue(e,n){const r=this.#n.get(e);let i=!1;if(r!==void 0)for(const[o,a]of Object.entries(n))r[o]!==a&&(i=!0,r[o]=a);else i=!0,this.#n.set(e,n);i&&this.#r(),n instanceof _n&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(e){return this.#n.has(e)}getAll(){return this.#n.size>0?wI(this.#n):null}setAll(e){for(const[n,r]of Object.entries(e))this.setValue(n,r)}get size(){return this.#n.size}#r(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new VG(this)}get serializable(){if(this.#n.size===0)return _I;const e=new Map,n=new HG,r=[],i=Object.create(null);let o=!1;for(const[a,s]of this.#n){const l=s instanceof _n?s.serialize(!1,i):s;l&&(e.set(a,l),n.update(`${a}:${JSON.stringify(l)}`),o||=!!l.bitmap)}if(o)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:_I}get editorStats(){let e=null;const n=new Map;for(const r of this.#n.values()){if(!(r instanceof _n))continue;const i=r.telemetryFinalData;if(!i)continue;const{type:o}=i;n.has(o)||n.set(o,Object.getPrototypeOf(r).constructor),e||=Object.create(null);const a=e[o]||=new Map;for(const[s,l]of Object.entries(i)){if(s==="type")continue;let c=a.get(s);c||(c=new Map,a.set(s,c));const u=c.get(l)??0;c.set(l,u+1)}}for(const[r,i]of n)e[r]=i.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;const e=[];for(const n of this.#n.values())!(n instanceof _n)||!n.annotationElementId||!n.serialize()||e.push(n.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}}class VG extends MI{#e;constructor(e){super();const{map:n,hash:r,transfer:i}=e.serializable,o=structuredClone(n,i?{transfer:i}:null);this.#e={map:o,hash:r,transfer:i}}get print(){Si("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return ir(this,"modifiedIds",{ids:new Set,hash:""})}}class Q$e{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const n=this.styleElement.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Oo(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:i,style:o}=e,a=new FontFace(r,i,o);this.addNativeFontFace(a);try{await a.load(),this.#e.add(r),n?.(e)}catch{Vn(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Si("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw Vn(`Failed to load font '${r.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return ir(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(ka||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),ir(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for(Oo(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){const o=r.shift();setTimeout(o.callback,0)}}const{loadingRequests:r}=this,i={done:!1,complete:n,callback:e};return r.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ir(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function r(w,C){return w.charCodeAt(C)<<24|w.charCodeAt(C+1)<<16|w.charCodeAt(C+2)<<8|w.charCodeAt(C+3)&255}function i(w,C,E,S){const T=w.substring(0,C),A=w.substring(C+E);return T+S+A}let o,a;const s=this._document.createElement("canvas");s.width=1,s.height=1;const l=s.getContext("2d");let c=0;function u(w,C){if(++c>30){Vn("Load test font never loaded."),C();return}if(l.font="30px "+w,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(u.bind(null,w,C))}const d=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=i(f,976,d.length,d);const m=16,g=1482184792;let v=r(f,m);for(o=0,a=d.length-3;o<a;o+=4)v=v-g+r(d,o)|0;o<d.length&&(v=v-g+r(d+"XXX",o)|0),f=i(f,m,4,F$e(v));const b=`url(data:font/opentype;base64,${btoa(f)});`,y=`@font-face {font-family:"${d}";src:${b}}`;this.insertRule(y);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const w of[e.loadedName,d]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=w,x.append(C)}this._document.body.append(x),u(d,()=>{x.remove(),n.complete()})}}class eze{constructor(e,{disableFontFace:n=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const i in e)this[i]=e[i];this.disableFontFace=n===!0,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${H$e(this.data)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${e}}`}return this._inspectFont?.(this,e),n}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let r;try{r=e.get(this.loadedName+"_path_"+n)}catch(o){Vn(`getPathGenerator - ignoring character: "${o}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[n]=function(o,a){};const i=[];for(let o=0,a=r.length;o<a;)switch(r[o++]){case Td.BEZIER_CURVE_TO:{const[s,l,c,u,d,f]=r.slice(o,o+6);i.push(h=>h.bezierCurveTo(s,l,c,u,d,f)),o+=6}break;case Td.MOVE_TO:{const[s,l]=r.slice(o,o+2);i.push(c=>c.moveTo(s,l)),o+=2}break;case Td.LINE_TO:{const[s,l]=r.slice(o,o+2);i.push(c=>c.lineTo(s,l)),o+=2}break;case Td.QUADRATIC_CURVE_TO:{const[s,l,c,u]=r.slice(o,o+4);i.push(d=>d.quadraticCurveTo(s,l,c,u)),o+=4}break;case Td.RESTORE:i.push(s=>s.restore());break;case Td.SAVE:i.push(s=>s.save());break;case Td.SCALE:Oo(i.length===2,"Scale command is only valid at the third position.");break;case Td.TRANSFORM:{const[s,l,c,u,d,f]=r.slice(o,o+6);i.push(h=>h.transform(s,l,c,u,d,f)),o+=6}break;case Td.TRANSLATE:{const[s,l]=r.slice(o,o+2);i.push(c=>c.translate(s,l)),o+=2}break}return this.compiledGlyphs[n]=function(a,s){i[0](a),i[1](a),a.scale(s,-s);for(let l=2,c=i.length;l<c;l++)i[l](a)}}}class jG{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,n){if(e<=0||n<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,n);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,n,r){if(!e.canvas)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=n,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){Si("Abstract method `_createCanvas` called.")}}class tze extends jG{constructor({ownerDocument:e=globalThis.document,enableHWA:n=!1}){super({enableHWA:n}),this._document=e}_createCanvas(e,n){const r=this._document.createElement("canvas");return r.width=e,r.height=n,r}}class YG{constructor({baseUrl:e=null,isCompressed:n=!0}){this.baseUrl=e,this.isCompressed=n}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(n).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}async _fetch(e){Si("Abstract method `_fetch` called.")}}class qG extends YG{async _fetch(e){const n=await $D(e,this.isCompressed?"arraybuffer":"text");return n instanceof ArrayBuffer?new Uint8Array(n):BD(n)}}class GG{addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,r,i,o){return"none"}destroy(e=!1){}}class nze extends GG{#e;#t;#n;#r;#o;#i;#s=0;constructor({docId:e,ownerDocument:n=globalThis.document}){super(),this.#r=e,this.#o=n}get#l(){return this.#t||=new Map}get#u(){return this.#i||=new Map}get#c(){if(!this.#n){const e=this.#o.createElement("div"),{style:n}=e;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const r=this.#o.createElementNS(Ad,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#n=this.#o.createElementNS(Ad,"defs"),e.append(r),r.append(this.#n),this.#o.body.append(e)}return this.#n}#d(e){if(e.length===1){const l=e[0],c=new Array(256);for(let d=0;d<256;d++)c[d]=l[d]/255;const u=c.join(",");return[u,u,u]}const[n,r,i]=e,o=new Array(256),a=new Array(256),s=new Array(256);for(let l=0;l<256;l++)o[l]=n[l]/255,a[l]=r[l]/255,s[l]=i[l]/255;return[o.join(","),a.join(","),s.join(",")]}#a(e){if(this.#e===void 0){this.#e="";const n=this.#o.URL;n!==this.#o.baseURI&&(zD(n)?Vn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=n.split("#",1)[0])}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let n=this.#l.get(e);if(n)return n;const[r,i,o]=this.#d(e),a=e.length===1?r:`${r}${i}${o}`;if(n=this.#l.get(a),n)return this.#l.set(e,n),n;const s=`g_${this.#r}_transfer_map_${this.#s++}`,l=this.#a(s);this.#l.set(e,l),this.#l.set(a,l);const c=this.#h(s);return this.#m(r,i,o,c),l}addHCMFilter(e,n){const r=`${e}-${n}`,i="base";let o=this.#u.get(i);if(o?.key===r||(o?(o.filter?.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},this.#u.set(i,o)),!e||!n))return o.url;const a=this.#b(e);e=un.makeHexColor(...a);const s=this.#b(n);if(n=un.makeHexColor(...s),this.#c.style.color="",e==="#000000"&&n==="#ffffff"||e===n)return o.url;const l=new Array(256);for(let h=0;h<=255;h++){const m=h/255;l[h]=m<=.03928?m/12.92:((m+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#r}_hcm_filter`,d=o.filter=this.#h(u);this.#m(c,c,c,d),this.#p(d);const f=(h,m)=>{const g=a[h]/255,v=s[h]/255,b=new Array(m+1);for(let y=0;y<=m;y++)b[y]=g+y/m*(v-g);return b.join(",")};return this.#m(f(0,5),f(1,5),f(2,5),d),o.url=this.#a(u),o.url}addAlphaFilter(e){let n=this.#l.get(e);if(n)return n;const[r]=this.#d([e]),i=`alpha_${r}`;if(n=this.#l.get(i),n)return this.#l.set(e,n),n;const o=`g_${this.#r}_alpha_map_${this.#s++}`,a=this.#a(o);this.#l.set(e,a),this.#l.set(i,a);const s=this.#h(o);return this.#g(r,s),a}addLuminosityFilter(e){let n=this.#l.get(e||"luminosity");if(n)return n;let r,i;if(e?([r]=this.#d([e]),i=`luminosity_${r}`):i="luminosity",n=this.#l.get(i),n)return this.#l.set(e,n),n;const o=`g_${this.#r}_luminosity_map_${this.#s++}`,a=this.#a(o);this.#l.set(e,a),this.#l.set(i,a);const s=this.#h(o);return this.#f(s),e&&this.#g(r,s),a}addHighlightHCMFilter(e,n,r,i,o){const a=`${n}-${r}-${i}-${o}`;let s=this.#u.get(e);if(s?.key===a||(s?(s.filter?.remove(),s.key=a,s.url="none",s.filter=null):(s={key:a,url:"none",filter:null},this.#u.set(e,s)),!n||!r))return s.url;const[l,c]=[n,r].map(this.#b.bind(this));let u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,h]=[i,o].map(this.#b.bind(this));d<u&&([u,d,f,h]=[d,u,h,f]),this.#c.style.color="";const m=(b,y,x)=>{const w=new Array(256),C=(d-u)/x,E=b/255,S=(y-b)/(255*x);let T=0;for(let A=0;A<=x;A++){const R=Math.round(u+A*C),P=E+A*S;for(let _=T;_<=R;_++)w[_]=P;T=R+1}for(let A=T;A<256;A++)w[A]=w[T-1];return w.join(",")},g=`g_${this.#r}_hcm_${e}_filter`,v=s.filter=this.#h(g);return this.#p(v),this.#m(m(f[0],h[0],5),m(f[1],h[1],5),m(f[2],h[2],5),v),s.url=this.#a(g),s.url}destroy(e=!1){e&&this.#u.size!==0||(this.#n&&(this.#n.parentNode.parentNode.remove(),this.#n=null),this.#t&&(this.#t.clear(),this.#t=null),this.#s=0)}#f(e){const n=this.#o.createElementNS(Ad,"feColorMatrix");n.setAttribute("type","matrix"),n.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"),e.append(n)}#p(e){const n=this.#o.createElementNS(Ad,"feColorMatrix");n.setAttribute("type","matrix"),n.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"),e.append(n)}#h(e){const n=this.#o.createElementNS(Ad,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",e),this.#c.append(n),n}#v(e,n,r){const i=this.#o.createElementNS(Ad,n);i.setAttribute("type","discrete"),i.setAttribute("tableValues",r),e.append(i)}#m(e,n,r,i){const o=this.#o.createElementNS(Ad,"feComponentTransfer");i.append(o),this.#v(o,"feFuncR",e),this.#v(o,"feFuncG",n),this.#v(o,"feFuncB",r)}#g(e,n){const r=this.#o.createElementNS(Ad,"feComponentTransfer");n.append(r),this.#v(r,"feFuncA",e)}#b(e){return this.#c.style.color=e,AI(getComputedStyle(this.#c).getPropertyValue("color"))}}class XG{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetch(n).catch(r=>{throw new Error(`Unable to load font data at: ${n}`)})}async _fetch(e){Si("Abstract method `_fetch` called.")}}class KG extends XG{async _fetch(e){const n=await $D(e,"arraybuffer");return new Uint8Array(n)}}if(ka){var OI=Promise.withResolvers(),PI=null;(async()=>{const e=await import("./_node-resolve_empty-CdnPYh1m.js"),n=await import("./_node-resolve_empty-CdnPYh1m.js"),r=await import("./_node-resolve_empty-CdnPYh1m.js"),i=await import("./_node-resolve_empty-CdnPYh1m.js");let o,a;return new Map(Object.entries({fs:e,http:n,https:r,url:i,canvas:o,path2d:a}))})().then(e=>{PI=e,OI.resolve()},e=>{Vn(`loadPackages: ${e}`),PI=new Map,OI.resolve()})}class sh{static get promise(){return OI.promise}static get(e){return PI?.get(e)}}async function ZG(t){const n=await sh.get("fs").promises.readFile(t);return new Uint8Array(n)}class rze extends GG{}class ize extends jG{_createCanvas(e,n){return sh.get("canvas").createCanvas(e,n)}}class oze extends YG{async _fetch(e){return ZG(e)}}class aze extends XG{async _fetch(e){return ZG(e)}}const ts={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function RI(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,r),t.clip(i)}class II{getPattern(){Si("Abstract method `getPattern` called.")}}class sze extends II{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)n.addColorStop(r[0],r[1]);return n}getPattern(e,n,r,i){let o;if(i===ts.STROKE||i===ts.FILL){const a=n.current.getClippedPathBoundingBox(i,$i(e))||[0,0,0,0],s=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=n.cachedCanvases.getCanvas("pattern",s,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),r=un.transform(r,[1,0,0,1,a[0],a[1]]),u.transform(...n.baseTransform),this.matrix&&u.transform(...this.matrix),RI(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),o=e.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(r);o.setTransform(d)}else RI(e,this._bbox),o=this._createGradient(e);return o}}function NI(t,e,n,r,i,o,a,s){const l=e.coords,c=e.colors,u=t.data,d=t.width*4;let f;l[n+1]>l[r+1]&&(f=n,n=r,r=f,f=o,o=a,a=f),l[r+1]>l[i+1]&&(f=r,r=i,i=f,f=a,a=s,s=f),l[n+1]>l[r+1]&&(f=n,n=r,r=f,f=o,o=a,a=f);const h=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,v=(l[r+1]+e.offsetY)*e.scaleY,b=(l[i]+e.offsetX)*e.scaleX,y=(l[i+1]+e.offsetY)*e.scaleY;if(m>=y)return;const x=c[o],w=c[o+1],C=c[o+2],E=c[a],S=c[a+1],T=c[a+2],A=c[s],R=c[s+1],P=c[s+2],_=Math.round(m),I=Math.round(y);let k,F,L,$,N,B,W,Y;for(let q=_;q<=I;q++){if(q<v){const ie=q<m?0:(m-q)/(m-v);k=h-(h-g)*ie,F=x-(x-E)*ie,L=w-(w-S)*ie,$=C-(C-T)*ie}else{let ie;q>y?ie=1:v===y?ie=0:ie=(v-q)/(v-y),k=g-(g-b)*ie,F=E-(E-A)*ie,L=S-(S-R)*ie,$=T-(T-P)*ie}let ee;q<m?ee=0:q>y?ee=1:ee=(m-q)/(m-y),N=h-(h-b)*ee,B=x-(x-A)*ee,W=w-(w-R)*ee,Y=C-(C-P)*ee;const Q=Math.round(Math.min(k,N)),J=Math.round(Math.max(k,N));let re=d*q+Q*4;for(let ie=Q;ie<=J;ie++)ee=(k-ie)/(k-N),ee<0?ee=0:ee>1&&(ee=1),u[re++]=F-(F-B)*ee|0,u[re++]=L-(L-W)*ee|0,u[re++]=$-($-Y)*ee|0,u[re++]=255}}function lze(t,e,n){const r=e.coords,i=e.colors;let o,a;switch(e.type){case"lattice":const s=e.verticesPerRow,l=Math.floor(r.length/s)-1,c=s-1;for(o=0;o<l;o++){let u=o*s;for(let d=0;d<c;d++,u++)NI(t,n,r[u],r[u+1],r[u+s],i[u],i[u+1],i[u+s]),NI(t,n,r[u+s+1],r[u+1],r[u+s],i[u+s+1],i[u+1],i[u+s])}break;case"triangles":for(o=0,a=r.length;o<a;o+=3)NI(t,n,r[o],r[o+1],r[o+2],i[o],i[o+1],i[o+2]);break;default:throw new Error("illegal figure")}}class cze extends II{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,n,r){const s=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-s,u=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),h=c/d,m=u/f,g={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-l,scaleX:1/h,scaleY:1/m},v=d+4,b=f+4,y=r.getCanvas("mesh",v,b),x=y.context,w=x.createImageData(d,f);if(n){const E=w.data;for(let S=0,T=E.length;S<T;S+=4)E[S]=n[0],E[S+1]=n[1],E[S+2]=n[2],E[S+3]=255}for(const E of this._figures)lze(w,E,g);return x.putImageData(w,2,2),{canvas:y.canvas,offsetX:s-2*h,offsetY:l-2*m,scaleX:h,scaleY:m}}getPattern(e,n,r,i){RI(e,this._bbox);let o;if(i===ts.SHADING)o=un.singularValueDecompose2dScale($i(e));else if(o=un.singularValueDecompose2dScale(n.baseTransform),this.matrix){const s=un.singularValueDecompose2dScale(this.matrix);o=[o[0]*s[0],o[1]*s[1]]}const a=this._createMeshCanvas(o,i===ts.SHADING?null:this._background,n.cachedCanvases);return i!==ts.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class uze extends II{getPattern(){return"hotpink"}}function dze(t){switch(t[0]){case"RadialAxial":return new sze(t);case"Mesh":return new cze(t);case"Dummy":return new uze}throw new Error(`Unknown IR type: ${t[0]}`)}const JG={COLORED:1,UNCOLORED:2};class r9{static MAX_PATTERN_SIZE=3e3;constructor(e,n,r,i,o){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=n,this.ctx=r,this.canvasGraphicsFactory=i,this.baseTransform=o}createPatternCanvas(e){const{bbox:n,operatorList:r,paintType:i,tilingType:o,color:a,canvasGraphicsFactory:s}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),LD("TilingType: "+o);const u=n[0],d=n[1],f=n[2],h=n[3],m=f-u,g=h-d,v=un.singularValueDecompose2dScale(this.matrix),b=un.singularValueDecompose2dScale(this.baseTransform),y=v[0]*b[0],x=v[1]*b[1];let w=m,C=g,E=!1,S=!1;const T=Math.ceil(l*y),A=Math.ceil(c*x),R=Math.ceil(m*y),P=Math.ceil(g*x);T>=R?w=l:E=!0,A>=P?C=c:S=!0;const _=this.getSizeAndScale(w,this.ctx.canvas.width,y),I=this.getSizeAndScale(C,this.ctx.canvas.height,x),k=e.cachedCanvases.getCanvas("pattern",_.size,I.size),F=k.context,L=s.createCanvasGraphics(F);if(L.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(L,i,a),F.translate(-_.scale*u,-I.scale*d),L.transform(_.scale,0,0,I.scale,0,0),F.save(),this.clipBbox(L,u,d,f,h),L.baseTransform=$i(L.ctx),L.executeOperatorList(r),L.endDrawing(),F.restore(),E||S){const $=k.canvas;E&&(w=l),S&&(C=c);const N=this.getSizeAndScale(w,this.ctx.canvas.width,y),B=this.getSizeAndScale(C,this.ctx.canvas.height,x),W=N.size,Y=B.size,q=e.cachedCanvases.getCanvas("pattern-workaround",W,Y),ee=q.context,Q=E?Math.floor(m/l):0,J=S?Math.floor(g/c):0;for(let re=0;re<=Q;re++)for(let ie=0;ie<=J;ie++)ee.drawImage($,W*re,Y*ie,W,Y,0,0,W,Y);return{canvas:q.canvas,scaleX:N.scale,scaleY:B.scale,offsetX:u,offsetY:d}}return{canvas:k.canvas,scaleX:_.scale,scaleY:I.scale,offsetX:u,offsetY:d}}getSizeAndScale(e,n,r){const i=Math.max(r9.MAX_PATTERN_SIZE,n);let o=Math.ceil(e*r);return o>=i?o=i:r=o/e,{scale:r,size:o}}clipBbox(e,n,r,i,o){const a=i-n,s=o-r;e.ctx.rect(n,r,a,s),e.current.updateRectMinMax($i(e.ctx),[n,r,i,o]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,r){const i=e.ctx,o=e.current;switch(n){case JG.COLORED:const a=this.ctx;i.fillStyle=a.fillStyle,i.strokeStyle=a.strokeStyle,o.fillColor=a.fillStyle,o.strokeColor=a.strokeStyle;break;case JG.UNCOLORED:const s=un.makeHexColor(r[0],r[1],r[2]);i.fillStyle=s,i.strokeStyle=s,o.fillColor=s,o.strokeColor=s;break;default:throw new L$e(`Unsupported paint type: ${n}`)}}getPattern(e,n,r,i){let o=r;i!==ts.SHADING&&(o=un.transform(o,n.baseTransform),this.matrix&&(o=un.transform(o,this.matrix)));const a=this.createPatternCanvas(n);let s=new DOMMatrix(o);s=s.translate(a.offsetX,a.offsetY),s=s.scale(1/a.scaleX,1/a.scaleY);const l=e.createPattern(a.canvas,"repeat");return l.setTransform(s),l}}function fze({src:t,srcPos:e=0,dest:n,width:r,height:i,nonBlackColor:o=4294967295,inverseDecode:a=!1}){const s=es.isLittleEndian?4278190080:255,[l,c]=a?[o,s]:[s,o],u=r>>3,d=r&7,f=t.length;n=new Uint32Array(n.buffer);let h=0;for(let m=0;m<i;m++){for(const v=e+u;e<v;e++){const b=e<f?t[e]:255;n[h++]=b&128?c:l,n[h++]=b&64?c:l,n[h++]=b&32?c:l,n[h++]=b&16?c:l,n[h++]=b&8?c:l,n[h++]=b&4?c:l,n[h++]=b&2?c:l,n[h++]=b&1?c:l}if(d===0)continue;const g=e<f?t[e++]:255;for(let v=0;v<d;v++)n[h++]=g&1<<7-v?c:l}return{srcPos:e,destPos:h}}const QG=16,eX=100,hze=15,tX=10,nX=1e3,_s=16;function pze(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(r,i){e.translate(r,i),this.__originalTranslate(r,i)},t.scale=function(r,i){e.scale(r,i),this.__originalScale(r,i)},t.transform=function(r,i,o,a,s,l){e.transform(r,i,o,a,s,l),this.__originalTransform(r,i,o,a,s,l)},t.setTransform=function(r,i,o,a,s,l){e.setTransform(r,i,o,a,s,l),this.__originalSetTransform(r,i,o,a,s,l)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(r){e.rotate(r),this.__originalRotate(r)},t.clip=function(r){e.clip(r),this.__originalClip(r)},t.moveTo=function(n,r){e.moveTo(n,r),this.__originalMoveTo(n,r)},t.lineTo=function(n,r){e.lineTo(n,r),this.__originalLineTo(n,r)},t.bezierCurveTo=function(n,r,i,o,a,s){e.bezierCurveTo(n,r,i,o,a,s),this.__originalBezierCurveTo(n,r,i,o,a,s)},t.rect=function(n,r,i,o){e.rect(n,r,i,o),this.__originalRect(n,r,i,o)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class gze{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,r){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,n,r)):(i=this.canvasFactory.create(n,r),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function WD(t,e,n,r,i,o,a,s,l,c){const[u,d,f,h,m,g]=$i(t);if(d===0&&f===0){const y=a*u+m,x=Math.round(y),w=s*h+g,C=Math.round(w),E=(a+l)*u+m,S=Math.abs(Math.round(E)-x)||1,T=(s+c)*h+g,A=Math.abs(Math.round(T)-C)||1;return t.setTransform(Math.sign(u),0,0,Math.sign(h),x,C),t.drawImage(e,n,r,i,o,0,0,S,A),t.setTransform(u,d,f,h,m,g),[S,A]}if(u===0&&h===0){const y=s*f+m,x=Math.round(y),w=a*d+g,C=Math.round(w),E=(s+c)*f+m,S=Math.abs(Math.round(E)-x)||1,T=(a+l)*d+g,A=Math.abs(Math.round(T)-C)||1;return t.setTransform(0,Math.sign(d),Math.sign(f),0,x,C),t.drawImage(e,n,r,i,o,0,0,A,S),t.setTransform(u,d,f,h,m,g),[A,S]}t.drawImage(e,n,r,i,o,a,s,l,c);const v=Math.hypot(u,d),b=Math.hypot(f,h);return[v*l,b*c]}function mze(t){const{width:e,height:n}=t;if(e>nX||n>nX)return null;const r=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),o=e+1;let a=new Uint8Array(o*(n+1)),s,l,c;const u=e+7&-8;let d=new Uint8Array(u*n),f=0;for(const b of t.data){let y=128;for(;y>0;)d[f++]=b&y?0:255,y>>=1}let h=0;for(f=0,d[f]!==0&&(a[0]=1,++h),l=1;l<e;l++)d[f]!==d[f+1]&&(a[l]=d[f]?2:1,++h),f++;for(d[f]!==0&&(a[l]=2,++h),s=1;s<n;s++){f=s*u,c=s*o,d[f-u]!==d[f]&&(a[c]=d[f]?1:8,++h);let b=(d[f]?4:0)+(d[f-u]?8:0);for(l=1;l<e;l++)b=(b>>2)+(d[f+1]?4:0)+(d[f-u+1]?8:0),i[b]&&(a[c+l]=i[b],++h),f++;if(d[f-u]!==d[f]&&(a[c+l]=d[f]?2:4,++h),h>r)return null}for(f=u*(n-1),c=s*o,d[f]!==0&&(a[c]=8,++h),l=1;l<e;l++)d[f]!==d[f+1]&&(a[c+l]=d[f]?4:8,++h),f++;if(d[f]!==0&&(a[c+l]=4,++h),h>r)return null;const m=new Int32Array([0,o,-1,0,-o,0,0,0,1]),g=new Path2D;for(s=0;h&&s<=n;s++){let b=s*o;const y=b+e;for(;b<y&&!a[b];)b++;if(b===y)continue;g.moveTo(b%o,s);const x=b;let w=a[b];do{const C=m[w];do b+=C;while(!a[b]);const E=a[b];E!==5&&E!==10?(w=E,a[b]=0):(w=E&51*w>>4,a[b]&=w>>2|w<<2),g.lineTo(b%o,b/o|0),a[b]||--h}while(x!==b);--s}return d=null,a=null,function(b){b.save(),b.scale(1/e,-1/n),b.translate(0,-n),b.fill(g),b.beginPath(),b.restore()}}class rX{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=NG,this.textMatrixScale=1,this.fontMatrix=vI,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=_a.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,n])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,n){this.x=e,this.y=n}updatePathMinMax(e,n,r){[n,r]=un.applyTransform([n,r],e),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,n){const r=un.applyTransform(n,e),i=un.applyTransform(n.slice(2),e),o=un.applyTransform([n[0],n[3]],e),a=un.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,r[0],i[0],o[0],a[0]),this.minY=Math.min(this.minY,r[1],i[1],o[1],a[1]),this.maxX=Math.max(this.maxX,r[0],i[0],o[0],a[0]),this.maxY=Math.max(this.maxY,r[1],i[1],o[1],a[1])}updateScalingPathMinMax(e,n){un.scaleMinMax(e,n),this.minX=Math.min(this.minX,n[0]),this.minY=Math.min(this.minY,n[1]),this.maxX=Math.max(this.maxX,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(e,n,r,i,o,a,s,l,c,u){const d=un.bezierBoundingBox(n,r,i,o,a,s,l,c,u);u||this.updateRectMinMax(e,d)}getPathBoundingBox(e=ts.FILL,n=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===ts.STROKE){n||Si("Stroke bounding box must include transform.");const i=un.singularValueDecompose2dScale(n),o=i[0]*this.lineWidth/2,a=i[1]*this.lineWidth/2;r[0]-=o,r[1]-=a,r[2]+=o,r[3]+=a}return r}updateClipFromPath(){const e=un.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=ts.FILL,n=null){return un.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function iX(t,e){if(typeof ImageData<"u"&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,i=n%_s,o=(n-i)/_s,a=i===0?o:o+1,s=t.createImageData(r,_s);let l=0,c;const u=e.data,d=s.data;let f,h,m,g;if(e.kind===RD.GRAYSCALE_1BPP){const v=u.byteLength,b=new Uint32Array(d.buffer,0,d.byteLength>>2),y=b.length,x=r+7>>3,w=4294967295,C=es.isLittleEndian?4278190080:255;for(f=0;f<a;f++){for(m=f<o?_s:i,c=0,h=0;h<m;h++){const E=v-l;let S=0;const T=E>x?r:E*8-7,A=T&-8;let R=0,P=0;for(;S<A;S+=8)P=u[l++],b[c++]=P&128?w:C,b[c++]=P&64?w:C,b[c++]=P&32?w:C,b[c++]=P&16?w:C,b[c++]=P&8?w:C,b[c++]=P&4?w:C,b[c++]=P&2?w:C,b[c++]=P&1?w:C;for(;S<T;S++)R===0&&(P=u[l++],R=128),b[c++]=P&R?w:C,R>>=1}for(;c<y;)b[c++]=0;t.putImageData(s,0,f*_s)}}else if(e.kind===RD.RGBA_32BPP){for(h=0,g=r*_s*4,f=0;f<o;f++)d.set(u.subarray(l,l+g)),l+=g,t.putImageData(s,0,h),h+=_s;f<a&&(g=r*i*4,d.set(u.subarray(l,l+g)),t.putImageData(s,0,h))}else if(e.kind===RD.RGB_24BPP)for(m=_s,g=r*m,f=0;f<a;f++){for(f>=o&&(m=i,g=r*m),c=0,h=g;h--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;t.putImageData(s,0,f*_s)}else throw new Error(`bad image kind: ${e.kind}`)}function oX(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,i=n%_s,o=(n-i)/_s,a=i===0?o:o+1,s=t.createImageData(r,_s);let l=0;const c=e.data,u=s.data;for(let d=0;d<a;d++){const f=d<o?_s:i;({srcPos:l}=fze({src:c,srcPos:l,dest:u,width:r,height:f,nonBlackColor:0})),t.putImageData(s,0,d*_s)}}function d1(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function HD(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",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!ka){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function aX(t,e){if(e)return!0;const n=un.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*ab.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}const vze=["butt","round","square"],bze=["miter","round","bevel"],yze={},sX={};class Uy{constructor(e,n,r,i,o,{optionalContentConfig:a,markedContentStack:s=null},l,c){this.ctx=e,this.current=new rX(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=r,this.canvasFactory=i,this.filterFactory=o,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=s||[],this.optionalContentConfig=a,this.cachedCanvases=new gze(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,n=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):n}beginDrawing({transform:e,viewport:n,transparency:r=!1,background:i=null}){const o=this.ctx.canvas.width,a=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,o,a),this.ctx.fillStyle=s,r){const l=this.cachedCanvases.getCanvas("transparent",o,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...$i(this.compositeCtx))}this.ctx.save(),HD(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=$i(this.ctx)}executeOperatorList(e,n,r,i){const o=e.argsArray,a=e.fnArray;let s=n||0;const l=o.length;if(l===s)return s;const c=l-s>tX&&typeof r=="function",u=c?Date.now()+hze:0;let d=0;const f=this.commonObjs,h=this.objs;let m;for(;;){if(i!==void 0&&s===i.nextBreakPoint)return i.breakIt(s,r),s;if(m=a[s],m!==Lc.dependency)this[m].apply(this,o[s]);else for(const g of o[s]){const v=g.startsWith("g_")?f:h;if(!v.has(g))return v.get(g,r),s}if(s++,s===l)return s;if(c&&++d>tX){if(Date.now()>u)return r(),s;d=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}}_scaleImage(e,n){const r=e.width??e.displayWidth,i=e.height??e.displayHeight;let o=Math.max(Math.hypot(n[0],n[1]),1),a=Math.max(Math.hypot(n[2],n[3]),1),s=r,l=i,c="prescale1",u,d;for(;o>2&&s>1||a>2&&l>1;){let f=s,h=l;o>2&&s>1&&(f=s>=16384?Math.floor(s/2)-1||1:Math.ceil(s/2),o/=s/f),a>2&&l>1&&(h=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/h),u=this.cachedCanvases.getCanvas(c,f,h),d=u.context,d.clearRect(0,0,f,h),d.drawImage(e,0,0,s,l,0,0,f,h),e=u.canvas,s=f,l=h,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:s,paintHeight:l}}_createMaskCanvas(e){const n=this.ctx,{width:r,height:i}=e,o=this.current.fillColor,a=this.current.patternFill,s=$i(n);let l,c,u,d;if((e.bitmap||e.data)&&e.count>1){const T=e.bitmap||e.data.buffer;c=JSON.stringify(a?s:[s.slice(0,4),o]),l=this._cachedBitmapsMap.get(T),l||(l=new Map,this._cachedBitmapsMap.set(T,l));const A=l.get(c);if(A&&!a){const R=Math.round(Math.min(s[0],s[2])+s[4]),P=Math.round(Math.min(s[1],s[3])+s[5]);return{canvas:A,offsetX:R,offsetY:P}}u=A}u||(d=this.cachedCanvases.getCanvas("maskCanvas",r,i),oX(d.context,e));let f=un.transform(s,[1/r,0,0,-1/i,0,0]);f=un.transform(f,[1,0,0,1,0,-i]);const[h,m,g,v]=un.getAxialAlignedBoundingBox([0,0,r,i],f),b=Math.round(g-h)||1,y=Math.round(v-m)||1,x=this.cachedCanvases.getCanvas("fillCanvas",b,y),w=x.context,C=h,E=m;w.translate(-C,-E),w.transform(...f),u||(u=this._scaleImage(d.canvas,kd(w)),u=u.img,l&&a&&l.set(c,u)),w.imageSmoothingEnabled=aX($i(w),e.interpolate),WD(w,u,0,0,u.width,u.height,0,0,r,i),w.globalCompositeOperation="source-in";const S=un.transform(kd(w),[1,0,0,1,-C,-E]);return w.fillStyle=a?o.getPattern(n,this,S,ts.FILL):o,w.fillRect(0,0,r,i),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,x.canvas)),{canvas:x.canvas,offsetX:Math.round(C),offsetY:Math.round(E)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=vze[e]}setLineJoin(e){this.ctx.lineJoin=bze[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,r]of e)switch(n){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,n);this.suspendedCtx=this.ctx,this.ctx=i.context;const o=this.ctx;o.setTransform(...$i(this.suspendedCtx)),d1(this.suspendedCtx,o),pze(o,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(),d1(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,n,this.ctx,e),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(e,n,r,i){const o=i[0],a=i[1],s=i[2]-o,l=i[3]-a;s===0||l===0||(this.genericComposeSMask(n.context,r,s,l,n.subtype,n.backdrop,n.transferMap,o,a,n.offsetX,n.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,n,r,i,o,a,s,l,c,u,d){let f=e.canvas,h=l-u,m=c-d;if(a){const v=un.makeHexColor(...a);if(h<0||m<0||h+r>f.width||m+i>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",r,i),y=b.context;y.drawImage(f,-h,-m),y.globalCompositeOperation="destination-atop",y.fillStyle=v,y.fillRect(0,0,r,i),y.globalCompositeOperation="source-over",f=b.canvas,h=m=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(h,m,r,i),e.clip(b),e.globalCompositeOperation="destination-atop",e.fillStyle=v,e.fillRect(h,m,r,i),e.restore()}}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),o==="Alpha"&&s?n.filter=this.filterFactory.addAlphaFilter(s):o==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(s));const g=new Path2D;g.rect(l,c,r,i),n.clip(g),n.globalCompositeOperation="destination-in",n.drawImage(f,h,m,r,i,l,c,r,i),n.restore()}save(){this.inSMaskMode?(d1(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),d1(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,r,i,o,a){this.ctx.transform(e,n,r,i,o,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,r){const i=this.ctx,o=this.current;let a=o.x,s=o.y,l,c;const u=$i(i),d=u[0]===0&&u[3]===0||u[1]===0&&u[2]===0,f=d?r.slice(0):null;for(let h=0,m=0,g=e.length;h<g;h++)switch(e[h]|0){case Lc.rectangle:a=n[m++],s=n[m++];const v=n[m++],b=n[m++],y=a+v,x=s+b;i.moveTo(a,s),v===0||b===0?i.lineTo(y,x):(i.lineTo(y,s),i.lineTo(y,x),i.lineTo(a,x)),d||o.updateRectMinMax(u,[a,s,y,x]),i.closePath();break;case Lc.moveTo:a=n[m++],s=n[m++],i.moveTo(a,s),d||o.updatePathMinMax(u,a,s);break;case Lc.lineTo:a=n[m++],s=n[m++],i.lineTo(a,s),d||o.updatePathMinMax(u,a,s);break;case Lc.curveTo:l=a,c=s,a=n[m+4],s=n[m+5],i.bezierCurveTo(n[m],n[m+1],n[m+2],n[m+3],a,s),o.updateCurvePathMinMax(u,l,c,n[m],n[m+1],n[m+2],n[m+3],a,s,f),m+=6;break;case Lc.curveTo2:l=a,c=s,i.bezierCurveTo(a,s,n[m],n[m+1],n[m+2],n[m+3]),o.updateCurvePathMinMax(u,l,c,a,s,n[m],n[m+1],n[m+2],n[m+3],f),a=n[m+2],s=n[m+3],m+=4;break;case Lc.curveTo3:l=a,c=s,a=n[m+2],s=n[m+3],i.bezierCurveTo(n[m],n[m+1],a,s,a,s),o.updateCurvePathMinMax(u,l,c,n[m],n[m+1],a,s,a,s,f),m+=4;break;case Lc.closePath:i.closePath();break}d&&o.updateScalingPathMinMax(u,f),o.setCurrentPoint(a,s)}closePath(){this.ctx.closePath()}stroke(e=!0){const n=this.ctx,r=this.current.strokeColor;n.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&r?.getPattern?(n.save(),n.strokeStyle=r.getPattern(n,this,kd(n),ts.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;let o=!1;i&&(n.save(),n.fillStyle=r.getPattern(n,this,kd(n),ts.FILL),o=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),o&&n.restore(),e&&this.consumePath(a)}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=yze}eoClip(){this.pendingClip=sX}beginText(){this.current.textMatrix=NG,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,n=this.ctx;if(e===void 0){n.beginPath();return}n.save(),n.beginPath();for(const r of e)n.setTransform(...r.transform),n.translate(r.x,r.y),r.addToPath(n,r.fontSize);n.restore(),n.clip(),n.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,n){const r=this.commonObjs.get(e),i=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=r.fontMatrix||vI,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&Vn("Invalid font matrix for font "+e),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;const o=r.loadedName||"sans-serif",a=r.systemFontInfo?.css||`"${o}", ${r.fallbackName}`;let s="normal";r.black?s="900":r.bold&&(s="bold");const l=r.italic?"italic":"normal";let c=n;n<QG?c=QG:n>eX&&(c=eX),this.current.fontSizeScale=n/c,this.ctx.font=`${l} ${s} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,n){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,n){this.setLeading(-n),this.moveText(e,n)}setTextMatrix(e,n,r,i,o,a){this.current.textMatrix=[e,n,r,i,o,a],this.current.textMatrixScale=Math.hypot(e,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,n,r,i){const o=this.ctx,a=this.current,s=a.font,l=a.textRenderingMode,c=a.fontSize/a.fontSizeScale,u=l&_a.FILL_STROKE_MASK,d=!!(l&_a.ADD_TO_PATH_FLAG),f=a.patternFill&&!s.missingFile;let h;(s.disableFontFace||d||f)&&(h=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace||f?(o.save(),o.translate(n,r),o.beginPath(),h(o,c),i&&o.setTransform(...i),(u===_a.FILL||u===_a.FILL_STROKE)&&o.fill(),(u===_a.STROKE||u===_a.FILL_STROKE)&&o.stroke(),o.restore()):((u===_a.FILL||u===_a.FILL_STROKE)&&o.fillText(e,n,r),(u===_a.STROKE||u===_a.FILL_STROKE)&&o.strokeText(e,n,r)),d&&(this.pendingTextPaths||=[]).push({transform:$i(o),x:n,y:r,fontSize:c,addToPath:h})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let r=!1;for(let i=3;i<n.length;i+=4)if(n[i]>0&&n[i]<255){r=!0;break}return ir(this,"isFontSubpixelAAEnabled",r)}showText(e){const n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(e);const i=n.fontSize;if(i===0)return;const o=this.ctx,a=n.fontSizeScale,s=n.charSpacing,l=n.wordSpacing,c=n.fontDirection,u=n.textHScale*c,d=e.length,f=r.vertical,h=f?1:-1,m=r.defaultVMetrics,g=i*n.fontMatrix[0],v=n.textRenderingMode===_a.FILL&&!r.disableFontFace&&!n.patternFill;o.save(),o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),c>0?o.scale(u,-1):o.scale(u,1);let b;if(n.patternFill){o.save();const E=n.fillColor.getPattern(o,this,kd(o),ts.FILL);b=$i(o),o.restore(),o.fillStyle=E}let y=n.lineWidth;const x=n.textMatrixScale;if(x===0||y===0){const E=n.textRenderingMode&_a.FILL_STROKE_MASK;(E===_a.STROKE||E===_a.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=x;if(a!==1&&(o.scale(a,a),y/=a),o.lineWidth=y,r.isInvalidPDFjsFont){const E=[];let S=0;for(const T of e)E.push(T.unicode),S+=T.width;o.fillText(E.join(""),0,0),n.x+=S*g*u,o.restore(),this.compose();return}let w=0,C;for(C=0;C<d;++C){const E=e[C];if(typeof E=="number"){w+=h*E*i/1e3;continue}let S=!1;const T=(E.isSpace?l:0)+s,A=E.fontChar,R=E.accent;let P,_,I=E.width;if(f){const F=E.vmetric||m,L=-(E.vmetric?F[1]:I*.5)*g,$=F[2]*g;I=F?-F[0]:I,P=L/a,_=(w+$)/a}else P=w/a,_=0;if(r.remeasure&&I>0){const F=o.measureText(A).width*1e3/i*a;if(I<F&&this.isFontSubpixelAAEnabled){const L=I/F;S=!0,o.save(),o.scale(L,1),P/=L}else I!==F&&(P+=(I-F)/2e3*i/a)}if(this.contentVisible&&(E.isInFont||r.missingFile)){if(v&&!R)o.fillText(A,P,_);else if(this.paintChar(A,P,_,b),R){const F=P+i*R.offset.x/a,L=_-i*R.offset.y/a;this.paintChar(R.fontChar,F,L,b)}}const k=f?I*g-T*c:I*g+T*c;w+=k,S&&o.restore()}f?n.y-=w:n.x+=w*u,o.restore(),this.compose()}showType3Text(e){const n=this.ctx,r=this.current,i=r.font,o=r.fontSize,a=r.fontDirection,s=i.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,u=r.textHScale*a,d=r.fontMatrix||vI,f=e.length,h=r.textRenderingMode===_a.INVISIBLE;let m,g,v,b;if(!(h||o===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...r.textMatrix),n.translate(r.x,r.y),n.scale(u,a),m=0;m<f;++m){if(g=e[m],typeof g=="number"){b=s*g*o/1e3,this.ctx.translate(b,0),r.x+=b*u;continue}const y=(g.isSpace?c:0)+l,x=i.charProcOperatorList[g.operatorListId];if(!x){Vn(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),n.scale(o,o),n.transform(...d),this.executeOperatorList(x),this.restore()),v=un.applyTransform([g.width,0],d)[0]*o+y,n.translate(v,0),r.x+=v*u}n.restore(),this.processingType3=null}}setCharWidth(e,n){}setCharWidthAndBounds(e,n,r,i,o,a){this.ctx.rect(r,i,o-r,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let n;if(e[0]==="TilingPattern"){const r=e[1],i=this.baseTransform||$i(this.ctx),o={createCanvasGraphics:a=>new Uy(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new r9(e,r,this.ctx,o,i)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,n,r){this.ctx.strokeStyle=this.current.strokeColor=un.makeHexColor(e,n,r)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,n,r){this.ctx.fillStyle=this.current.fillColor=un.makeHexColor(e,n,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,n=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=dze(this.getObject(e)),this.cachedPatterns.set(e,r)),n&&(r.matrix=n),r}shadingFill(e){if(!this.contentVisible)return;const n=this.ctx;this.save();const r=this._getPattern(e);n.fillStyle=r.getPattern(n,this,kd(n),ts.SHADING);const i=kd(n);if(i){const{width:o,height:a}=n.canvas,[s,l,c,u]=un.getAxialAlignedBoundingBox([0,0,o,a],i);this.ctx.fillRect(s,l,c-s,u-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Si("Should not call beginInlineImage")}beginImageData(){Si("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=$i(this.ctx),n)){const r=n[2]-n[0],i=n[3]-n[1];this.ctx.rect(n[0],n[1],r,i),this.current.updateRectMinMax($i(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||LD("TODO: Support non-isolated groups."),e.knockout&&Vn("Knockout groups not supported.");const r=$i(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=un.getAxialAlignedBoundingBox(e.bbox,$i(n));const o=[0,0,n.canvas.width,n.canvas.height];i=un.intersect(i,o)||[0,0,0,0];const a=Math.floor(i[0]),s=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-a,1),c=Math.max(Math.ceil(i[3])-s,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(u,l,c),f=d.context;f.translate(-a,-s),f.transform(...r),e.smask?this.smaskStack.push({canvas:d.canvas,context:f,offsetX:a,offsetY:s,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(a,s),n.save()),d1(n,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const i=$i(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);const o=un.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],i);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(e,n,r,i,o){if(this.#e(),HD(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const a=n[2]-n[0],s=n[3]-n[1];if(o&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=a,n[3]=s;const[l,c]=un.singularValueDecompose2dScale($i(this.ctx)),{viewportScale:u}=this,d=Math.ceil(a*this.outputScaleX*u),f=Math.ceil(s*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(d,f);const{canvas:h,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,s*c),HD(this.ctx)}else HD(this.ctx),this.endPath(),this.ctx.rect(n[0],n[1],a,s),this.ctx.clip(),this.ctx.beginPath()}this.current=new rX(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const n=e.count;e=this.getObject(e.data,e),e.count=n;const r=this.ctx,i=this.processingType3;if(i&&(i.compiled===void 0&&(i.compiled=mze(e)),i.compiled)){i.compiled(r);return}const o=this._createMaskCanvas(e),a=o.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,o.offsetX,o.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,r=0,i=0,o,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const s=this.ctx;s.save();const l=$i(s);s.transform(n,r,i,o,0,0);const c=this._createMaskCanvas(e);s.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,d=a.length;u<d;u+=2){const f=un.transform(l,[n,r,i,o,a[u],a[u+1]]),[h,m]=un.applyTransform([0,0],f);s.drawImage(c.canvas,h,m)}s.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(const o of e){const{data:a,width:s,height:l,transform:c}=o,u=this.cachedCanvases.getCanvas("maskCanvas",s,l),d=u.context;d.save();const f=this.getObject(a,o);oX(d,f),d.globalCompositeOperation="source-in",d.fillStyle=i?r.getPattern(d,this,kd(n),ts.FILL):r,d.fillRect(0,0,s,l),d.restore(),n.save(),n.transform(...c),n.scale(1,-1),WD(n,u.canvas,0,0,s,l,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){Vn("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(e,n,r,i){if(!this.contentVisible)return;const o=this.getObject(e);if(!o){Vn("Dependent image isn't ready yet");return}const a=o.width,s=o.height,l=[];for(let c=0,u=i.length;c<u;c+=2)l.push({transform:[n,0,0,r,i[c],i[c+1]],x:0,y:0,w:a,h:s});this.paintInlineImageXObjectGroup(o,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:n,width:r,height:i}=e,o=this.cachedCanvases.getCanvas("inlineImage",r,i),a=o.context;return a.filter=this.current.transferMaps,a.drawImage(n,0,0),a.filter="none",o.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const n=e.width,r=e.height,i=this.ctx;if(this.save(),!ka){const{filter:s}=i;s!=="none"&&s!==""&&(i.filter="none")}i.scale(1/n,-1/r);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{const l=this.cachedCanvases.getCanvas("inlineImage",n,r).context;iX(l,e),o=this.applyTransferMapsToCanvas(l)}const a=this._scaleImage(o,kd(i));i.imageSmoothingEnabled=aX($i(i),e.interpolate),WD(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,n,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,n){if(!this.contentVisible)return;const r=this.ctx;let i;if(e.bitmap)i=e.bitmap;else{const o=e.width,a=e.height,l=this.cachedCanvases.getCanvas("inlineImage",o,a).context;iX(l,e),i=this.applyTransferMapsToCanvas(l)}for(const o of n)r.save(),r.transform(...o.transform),r.scale(1,-1),WD(r,i,o.x,o.y,o.w,o.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,n){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,n){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(n||(this.pendingClip===sX?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=$i(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:r,c:i,d:o}=this.ctx.getTransform();let a,s;if(r===0&&i===0){const l=Math.abs(n),c=Math.abs(o);if(l===c)if(e===0)a=s=1/l;else{const u=l*e;a=s=u<1?1/u:1}else if(e===0)a=1/l,s=1/c;else{const u=l*e,d=c*e;a=u<1?1/u:1,s=d<1?1/d:1}}else{const l=Math.abs(n*o-r*i),c=Math.hypot(n,r),u=Math.hypot(i,o);if(e===0)a=u/l,s=c/l;else{const d=e*l;a=u>d?u/d:1,s=c>d?c/d:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:n}=this,{lineWidth:r}=this.current,[i,o]=this.getScaleForStroking();if(n.lineWidth=r||1,i===1&&o===1){n.stroke();return}const a=n.getLineDash();if(e&&n.save(),n.scale(i,o),a.length>0){const s=Math.max(i,o);n.setLineDash(a.map(l=>l/s)),n.lineDashOffset/=s}n.stroke(),e&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in Lc)Uy.prototype[t]!==void 0&&(Uy.prototype[Lc[t]]=Uy.prototype[t]);class f1{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}const VD={DATA:1,ERROR:2},wo={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function sl(t){switch(t instanceof Error||typeof t=="object"&&t!==null||Si('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new pg(t.message);case"MissingPDFException":return new hg(t.message);case"PasswordException":return new yI(t.message,t.code);case"UnexpectedResponseException":return new FD(t.message,t.status);case"UnknownErrorException":return new xI(t.message,t.details);default:return new xI(t.message,t.toString())}}class h1{#e=new AbortController;constructor(e,n,r){this.sourceName=e,this.targetName=n,this.comObj=r,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),r.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){const r=e.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===VD.DATA)i.resolve(e.data);else if(e.callback===VD.ERROR)i.reject(sl(e.reason));else throw new Error("Unexpected callback case");return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,i=e.sourceName,o=this.comObj;new Promise(function(a){a(n(e.data))}).then(function(a){o.postMessage({sourceName:r,targetName:i,callback:VD.DATA,callbackId:e.callbackId,data:a})},function(a){o.postMessage({sourceName:r,targetName:i,callback:VD.ERROR,callbackId:e.callbackId,reason:sl(a)})});return}if(e.streamId){this.#n(e);return}n(e.data)}on(e,n){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=n}send(e,n,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},r)}sendWithPromise(e,n,r){const i=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:n},r)}catch(a){o.reject(a)}return o.promise}sendWithStream(e,n,r,i){const o=this.streamId++,a=this.sourceName,s=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[o]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:s,action:e,streamId:o,data:n,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[o].pullCall=u,l.postMessage({sourceName:a,targetName:s,stream:wo.PULL,streamId:o,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Oo(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[o].cancelCall=u,this.streamControllers[o].isClosed=!0,l.postMessage({sourceName:a,targetName:s,stream:wo.CANCEL,streamId:o,reason:sl(c)}),u.promise}},r)}#n(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,o=this.comObj,a=this,s=this.actionHandler[e.action],l={enqueue(c,u=1,d){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:r,targetName:i,stream:wo.ENQUEUE,streamId:n,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:i,stream:wo.CLOSE,streamId:n}),delete a.streamSinks[n])},error(c){Oo(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:i,stream:wo.ERROR,streamId:n,reason:sl(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[n]=l,new Promise(function(c){c(s(e.data,l))}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.START_COMPLETE,streamId:n,success:!0})},function(c){o.postMessage({sourceName:r,targetName:i,stream:wo.START_COMPLETE,streamId:n,reason:sl(c)})})}#r(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,o=this.comObj,a=this.streamControllers[n],s=this.streamSinks[n];switch(e.stream){case wo.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(sl(e.reason));break;case wo.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(sl(e.reason));break;case wo.PULL:if(!s){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,success:!0});break}s.desiredSize<=0&&e.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=e.desiredSize,new Promise(function(l){l(s.onPull?.())}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,success:!0})},function(l){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,reason:sl(l)})});break;case wo.ENQUEUE:if(Oo(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case wo.CLOSE:if(Oo(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#o(a,n);break;case wo.ERROR:Oo(a,"error should have stream controller"),a.controller.error(sl(e.reason)),this.#o(a,n);break;case wo.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(sl(e.reason)),this.#o(a,n);break;case wo.CANCEL:if(!s)break;new Promise(function(l){l(s.onCancel?.(sl(e.reason)))}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.CANCEL_COMPLETE,streamId:n,success:!0})},function(l){o.postMessage({sourceName:r,targetName:i,stream:wo.CANCEL_COMPLETE,streamId:n,reason:sl(l)})}),s.sinkCapability.reject(sl(e.reason)),s.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async#o(e,n){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[n]}destroy(){this.#e?.abort(),this.#e=null}}class xze{#e;#t;constructor({parsedData:e,rawData:n}){this.#e=e,this.#t=n}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return wI(this.#e)}has(e){return this.#e.has(e)}}const sb=Symbol("INTERNAL");class wze{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:n,intent:r,usage:i,rbGroups:o}){this.#e=!!(e&al.DISPLAY),this.#t=!!(e&al.PRINT),this.name=n,this.intent=r,this.usage=i,this.rbGroups=o}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:e,view:n}=this.usage;return this.#e?n?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,n,r=!1){e!==sb&&Si("Internal method `_setVisible` called."),this.#n=r,this.#r=n}}class Cze{#e=null;#t=new Map;#n=null;#r=null;constructor(e,n=al.DISPLAY){if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(const r of e.groups)this.#t.set(r.id,new wze(n,r));if(e.baseState==="OFF")for(const r of this.#t.values())r._setVisible(sb,!1);for(const r of e.on)this.#t.get(r)._setVisible(sb,!0);for(const r of e.off)this.#t.get(r)._setVisible(sb,!1);this.#n=this.getHash()}}#o(e){const n=e.length;if(n<2)return!0;const r=e[0];for(let i=1;i<n;i++){const o=e[i];let a;if(Array.isArray(o))a=this.#o(o);else if(this.#t.has(o))a=this.#t.get(o).visible;else return Vn(`Optional content group not found: ${o}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return LD("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(Vn(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#o(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!1}return!0}return Vn(`Unknown optional content policy ${e.policy}.`),!0}return Vn(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0,r=!0){const i=this.#t.get(e);if(!i){Vn(`Optional content group not found: ${e}`);return}if(r&&n&&i.rbGroups.length)for(const o of i.rbGroups)for(const a of o)a!==e&&this.#t.get(a)?._setVisible(sb,!1,!0);i._setVisible(sb,!!n,!0),this.#e=null}setOCGState({state:e,preserveRB:n}){let r;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}const o=this.#t.get(i);if(o)switch(r){case"ON":this.setVisibility(i,!0,n);break;case"OFF":this.setVisibility(i,!1,n);break;case"Toggle":this.setVisibility(i,!o.visible,n);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?wI(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new HG;for(const[n,r]of this.#t)e.update(`${n}:${r.visible}`);return this.#e=e.hexdigest()}}class Eze{constructor(e,{disableRange:n=!1,disableStream:r=!1}){Oo(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:o,progressiveDone:a,contentDispositionFilename:s}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=s,o?.length>0){const l=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!n,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:n}){const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const i=this._rangeReaders.some(function(o){return o._begin!==e?!1:(o._enqueue(r),!0)});Oo(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){Oo(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new Sze(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new Dze(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}}class Sze{constructor(e,n,r=!1,i=null){this._stream=e,this._done=r||!1,this._filename=TI(i)?i:null,this._queuedChunks=n||[],this._loaded=0;for(const o of this._queuedChunks)this._loaded+=o.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Dze{constructor(e,n,r){this._stream=e,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Tze(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let u=s(n);return u=unescape(u),u=l(u),u=c(u),o(u)}if(n=a(t),n){const u=c(n);return o(u)}if(n=r("filename","i").exec(t),n){n=n[1];let u=s(n);return u=c(u),o(u)}function r(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function i(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const f=new TextDecoder(u,{fatal:!0}),h=BD(d);d=f.decode(h),e=!1}catch{}}return d}function o(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function a(u){const d=[];let f;const h=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=h.exec(u))!==null;){let[,g,v,b]=f;if(g=parseInt(g,10),g in d){if(g===0)break;continue}d[g]=[v,b]}const m=[];for(let g=0;g<d.length&&g in d;++g){let[v,b]=d[g];b=s(b),v&&(b=unescape(b),g===0&&(b=l(b))),m.push(b)}return m.join("")}function s(u){if(u.startsWith('"')){const d=u.slice(1).split('\\"');for(let f=0;f<d.length;++f){const h=d[f].indexOf('"');h!==-1&&(d[f]=d[f].slice(0,h),d.length=f+1),d[f]=d[f].replaceAll(/\\(.)/g,"$1")}u=d.join('"')}return u}function l(u){const d=u.indexOf("'");if(d===-1)return u;const f=u.slice(0,d),m=u.slice(d+1).replace(/^[^']*'/,"");return i(f,m)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,f,h,m){if(h==="q"||h==="Q")return m=m.replaceAll("_"," "),m=m.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,v){return String.fromCharCode(parseInt(v,16))}),i(f,m);try{m=atob(m)}catch{}return i(f,m)})}return""}function LI(t,e){const n=new Headers;if(!t||!e||typeof e!="object")return n;for(const r in e){const i=e[r];i!==void 0&&n.append(r,i)}return n}function FI({responseHeaders:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t.get("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*n)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function BI(t){const e=t.get("Content-Disposition");if(e){let n=Tze(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(TI(n))return n}return null}function jD(t,e){return t===404||t===0&&e.startsWith("file:")?new hg('Missing PDF "'+e+'".'):new FD(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function lX(t){return t===200||t===206}function cX(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function uX(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Vn(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class dX{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=LI(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Oo(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Aze(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new kze(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class Aze{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const n=e.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange;const r=new Headers(e.headers),i=n.url;fetch(i,cX(r,this._withCredentials,this._abortController)).then(o=>{if(!lX(o.status))throw jD(o.status,i);this._reader=o.body.getReader(),this._headersCapability.resolve();const a=o.headers,{allowRangeRequests:s,suggestedLength:l}=FI({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=l||this._contentLength,this._filename=BI(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new pg("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:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:uX(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class kze{constructor(e,n,r){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const o=new Headers(e.headers);o.append("Range",`bytes=${n}-${r-1}`);const a=i.url;fetch(a,cX(o,this._withCredentials,this._abortController)).then(s=>{if(!lX(s.status))throw jD(s.status,a);this._readCapability.resolve(),this._reader=s.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:uX(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const $I=200,zI=206;function _ze(t){const e=t.response;return typeof e!="string"?e:BD(e).buffer}class Mze{constructor({url:e,httpHeaders:n,withCredentials:r}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=LI(this.isHttp,n),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,n,r){const i={begin:e,end:n};for(const o in r)i[o]=r[o];return this.request(i)}requestFull(e){return this.request(e)}request(e){const n=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const[o,a]of this.headers)n.setRequestHeader(o,a);return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=zI):i.expectedStatus=$I,n.responseType="arraybuffer",e.onError&&(n.onerror=function(o){e.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,r),n.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,n.send(null),r}onProgress(e,n){const r=this.pendingRequests[e];r&&r.onProgress?.(n)}onStateChange(e,n){const r=this.pendingRequests[e];if(!r)return;const i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){r.onError?.(i.status);return}const o=i.status||$I;if(!(o===$I&&r.expectedStatus===zI)&&o!==r.expectedStatus){r.onError?.(i.status);return}const s=_ze(i);if(o===zI){const l=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);r.onDone({begin:parseInt(c[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const n=this.pendingRequests[e].xhr;delete this.pendingRequests[e],n.abort()}}class Oze{constructor(e){this._source=e,this._manager=new Mze(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const n=this._rangeRequestReaders.indexOf(e);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return Oo(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Pze(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const r=new Rze(this._manager,e,n);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class Pze{constructor(e,n){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=e.requestFull(r),this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.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 e=this._fullRequestId,n=this._manager.getRequestXhr(e),r=new Headers(n.getAllResponseHeaders().trim().split(/[\r\n]+/).map(a=>{const[s,...l]=a.split(": ");return[s,l.join(": ")]})),{allowRangeRequests:i,suggestedLength:o}=FI({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=BI(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=jD(e,this._url),this._headersCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Rze{constructor(e,n,r){this._manager=e;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(n,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const n=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=jD(e,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Ize=/^[a-z][a-z0-9\-+.]+:/i;function Nze(t){if(Ize.test(t))return new URL(t);const e=sh.get("url");return new URL(e.pathToFileURL(t))}function fX(t,e,n){return t.protocol==="http:"?sh.get("http").request(t,{headers:e},n):sh.get("https").request(t,{headers:e},n)}class Lze{constructor(e){this.source=e,this.url=Nze(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.headers=LI(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Oo(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new $ze(this):new Fze(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=this.isFsUrl?new zze(this,e,n):new Bze(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class hX{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.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 e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new pg("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class pX{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.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 e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class Fze extends hX{constructor(e){super(e);const n=Object.fromEntries(e.headers),r=i=>{if(i.statusCode===404){const l=new hg(`Missing PDF "${this._url}".`);this._storedError=l,this._headersCapability.reject(l);return}this._headersCapability.resolve(),this._setReadableStream(i);const o=new Headers(this._readableStream.headers),{allowRangeRequests:a,suggestedLength:s}=FI({responseHeaders:o,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=s||this._contentLength,this._filename=BI(o)};this._request=fX(this._url,n,r),this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class Bze extends pX{constructor(e,n,r){super(e);const i=Object.fromEntries(e.headers);i.Range=`bytes=${n}-${r-1}`;const o=a=>{if(a.statusCode===404){const s=new hg(`Missing PDF "${this._url}".`);this._storedError=s;return}this._setReadableStream(a)};this._request=fX(this._url,i,o),this._request.on("error",a=>{this._storedError=a}),this._request.end()}}class $ze extends hX{constructor(e){super(e);const n=sh.get("fs");n.promises.lstat(this._url).then(r=>{this._contentLength=r.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},r=>{r.code==="ENOENT"&&(r=new hg(`Missing PDF "${this._url}".`)),this._storedError=r,this._headersCapability.reject(r)})}}class zze extends pX{constructor(e,n,r){super(e);const i=sh.get("fs");this._setReadableStream(i.createReadStream(this._url,{start:n,end:r-1}))}}const Uze=1e5,Ms=30,Wze=.8;let UI=class mc{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#o=null;#i=null;#s=0;#l=0;#u=null;#c=null;#d=0;#a=0;#f=Object.create(null);#p=[];#h=null;#v=[];#m=new WeakMap;#g=null;static#b=new Map;static#x=new Map;static#T=new WeakMap;static#E=null;static#S=new Set;constructor({textContentSource:e,container:n,viewport:r}){if(e instanceof ReadableStream)this.#h=e;else if(typeof e=="object")this.#h=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=n,this.#a=r.scale*(globalThis.devicePixelRatio||1),this.#d=r.rotation,this.#i={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:o,pageX:a,pageY:s}=r.rawDims;this.#g=[1,0,0,-1,-a,s+o],this.#l=i,this.#s=o,mc.#_(),gg(n,r),this.#e.promise.finally(()=>{mc.#S.delete(this),this.#i=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:n}=es.platform;return ir(this,"fontFamilyMap",new Map([["sans-serif",`${e&&n?"Calibri, ":""}sans-serif`],["monospace",`${e&&n?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#u.read().then(({value:n,done:r})=>{if(r){this.#e.resolve();return}this.#o??=n.lang,Object.assign(this.#f,n.styles),this.#N(n.items),e()},this.#e.reject)};return this.#u=this.#h.getReader(),mc.#S.add(this),e(),this.#e.promise}update({viewport:e,onBefore:n=null}){const r=e.scale*(globalThis.devicePixelRatio||1),i=e.rotation;if(i!==this.#d&&(n?.(),this.#d=i,gg(this.#c,{rotation:i})),r!==this.#a){n?.(),this.#a=r;const o={div:null,properties:null,ctx:mc.#D(this.#o)};for(const a of this.#v)o.properties=this.#m.get(a),o.div=a,this.#w(o)}}cancel(){const e=new pg("TextLayer task cancelled.");this.#u?.cancel(e).catch(()=>{}),this.#u=null,this.#e.reject(e)}get textDivs(){return this.#v}get textContentItemsStr(){return this.#p}#N(e){if(this.#n)return;this.#i.ctx??=mc.#D(this.#o);const n=this.#v,r=this.#p;for(const i of e){if(n.length>Uze){Vn("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const o=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id!==null&&this.#t.setAttribute("id",`${i.id}`),o.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}r.push(i.str),this.#A(i)}}#A(e){const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#v.push(n);const i=un.transform(this.#g,e.transform);let o=Math.atan2(i[1],i[0]);const a=this.#f[e.fontName];a.vertical&&(o+=Math.PI/2);let s=this.#r&&a.fontSubstitution||a.fontFamily;s=mc.fontFamilyMap.get(s)||s;const l=Math.hypot(i[2],i[3]),c=l*mc.#P(s,this.#o);let u,d;o===0?(u=i[4],d=i[5]-c):(u=i[4]+c*Math.sin(o),d=i[5]-c*Math.cos(o));const f="calc(var(--scale-factor)*",h=n.style;this.#t===this.#c?(h.left=`${(100*u/this.#l).toFixed(2)}%`,h.top=`${(100*d/this.#s).toFixed(2)}%`):(h.left=`${f}${u.toFixed(2)}px)`,h.top=`${f}${d.toFixed(2)}px)`),h.fontSize=`${f}${(mc.#E*l).toFixed(2)}px)`,h.fontFamily=s,r.fontSize=l,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,this.#r&&(n.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),o!==0&&(r.angle=o*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const g=Math.abs(e.transform[0]),v=Math.abs(e.transform[3]);g!==v&&Math.max(g,v)/Math.min(g,v)>1.5&&(m=!0)}if(m&&(r.canvasWidth=a.vertical?e.height:e.width),this.#m.set(n,r),this.#i.div=n,this.#i.properties=r,this.#w(this.#i),r.hasText&&this.#t.append(n),r.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this.#t.append(g)}}#w(e){const{div:n,properties:r,ctx:i}=e,{style:o}=n;let a="";if(mc.#E>1&&(a=`scale(${1/mc.#E})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:s}=o,{canvasWidth:l,fontSize:c}=r;mc.#k(i,c*this.#a,s);const{width:u}=i.measureText(n.textContent);u>0&&(a=`scaleX(${l*this.#a/u}) ${a}`)}r.angle!==0&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(o.transform=a)}static cleanup(){if(!(this.#S.size>0)){this.#b.clear();for(const{canvas:e}of this.#x.values())e.remove();this.#x.clear()}}static#D(e=null){let n=this.#x.get(e||="");if(!n){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),n=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#x.set(e,n),this.#T.set(n,{size:0,family:""})}return n}static#k(e,n,r){const i=this.#T.get(e);n===i.size&&r===i.family||(e.font=`${n}px ${r}`,i.size=n,i.family=r)}static#_(){if(this.#E!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#E=e.getBoundingClientRect().height,e.remove()}static#P(e,n){const r=this.#b.get(e);if(r)return r;const i=this.#D(n);i.canvas.width=i.canvas.height=Ms,this.#k(i,Ms,e);const o=i.measureText("");let a=o.fontBoundingBoxAscent,s=Math.abs(o.fontBoundingBoxDescent);if(a){const u=a/(a+s);return this.#b.set(e,u),i.canvas.width=i.canvas.height=0,u}i.strokeStyle="red",i.clearRect(0,0,Ms,Ms),i.strokeText("g",0,0);let l=i.getImageData(0,0,Ms,Ms).data;s=0;for(let u=l.length-1-3;u>=0;u-=4)if(l[u]>0){s=Math.ceil(u/4/Ms);break}i.clearRect(0,0,Ms,Ms),i.strokeText("A",0,Ms),l=i.getImageData(0,0,Ms,Ms).data,a=0;for(let u=0,d=l.length;u<d;u+=4)if(l[u]>0){a=Ms-Math.floor(u/4/Ms);break}i.canvas.width=i.canvas.height=0;const c=a?a/(a+s):Wze;return this.#b.set(e,c),c}};class Hw{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function i(o){if(!o)return;let a=null;const s=o.name;if(s==="#text")a=o.value;else if(Hw.shouldBuildText(s))o?.attributes?.textContent?a=o.attributes.textContent:o.value&&(a=o.value);else return;if(a!==null&&n.push({str:a}),!!o.children)for(const l of o.children)i(l)}return i(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const Hze=65536,Vze=100,jze=5e3,Yze=ka?ize:tze,qze=ka?oze:qG,Gze=ka?rze:nze,Xze=ka?aze:KG;function Kze(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new i9,{docId:n}=e,r=t.url?Zze(t.url):null,i=t.data?Jze(t.data):null,o=t.httpHeaders||null,a=t.withCredentials===!0,s=t.password??null,l=t.range instanceof mX?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:Hze;let u=t.worker instanceof Ko?t.worker:null;const d=t.verbosity,f=typeof t.docBaseUrl=="string"&&!zD(t.docBaseUrl)?t.docBaseUrl:null,h=typeof t.cMapUrl=="string"?t.cMapUrl:null,m=t.cMapPacked!==!1,g=t.CMapReaderFactory||qze,v=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||Xze,y=t.stopAtErrors!==!0,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=t.isEvalSupported!==!1,C=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!ka,E=typeof t.isChrome=="boolean"?t.isChrome:!es.platform.isFirefox&&typeof window<"u"&&!!window?.chrome,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,T=typeof t.disableFontFace=="boolean"?t.disableFontFace:ka,A=t.fontExtraProperties===!0,R=t.enableXfa===!0,P=t.ownerDocument||globalThis.document,_=t.disableRange===!0,I=t.disableStream===!0,k=t.disableAutoFetch===!0,F=t.pdfBug===!0,L=t.CanvasFactory||Yze,$=t.FilterFactory||Gze,N=t.enableHWA===!0,B=l?l.length:t.length??NaN,W=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!ka&&!T,Y=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:g===qG&&b===KG&&h&&v&&c1(h,document.baseURI)&&c1(v,document.baseURI);t.canvasFactory&&zG("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&&zG("`filterFactory`-instance option, please use `FilterFactory` instead.");const q=null;P$e(d);const ee={canvasFactory:new L({ownerDocument:P,enableHWA:N}),filterFactory:new $({docId:n,ownerDocument:P}),cMapReaderFactory:Y?null:new g({baseUrl:h,isCompressed:m}),standardFontDataFactory:Y?null:new b({baseUrl:v})};if(!u){const re={verbosity:d,port:f1.workerPort};u=re.port?Ko.fromPort(re):new Ko(re),e._worker=u}const Q={docId:n,apiVersion:"4.8.69",data:i,password:s,disableAutoFetch:k,rangeChunkSize:c,length:B,docBaseUrl:f,enableXfa:R,evaluatorOptions:{maxImageSize:x,disableFontFace:T,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:C,isChrome:E,canvasMaxAreaInBytes:S,fontExtraProperties:A,useSystemFonts:W,cMapUrl:Y?h:null,standardFontDataUrl:Y?v:null}},J={disableFontFace:T,fontExtraProperties:A,ownerDocument:P,pdfBug:F,styleElement:q,loadingParams:{disableAutoFetch:k,enableXfa:R}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const re=u.messageHandler.sendWithPromise("GetDocRequest",Q,i?[i.buffer]:null);let ie;if(l)ie=new Eze(l,{disableRange:_,disableStream:I});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");let he;ka?he=typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&c1(r)?dX:Lze:he=c1(r)?dX:Oze,ie=new he({url:r,length:B,httpHeaders:o,withCredentials:a,rangeChunkSize:c,disableRange:_,disableStream:I})}return re.then(he=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const xe=new h1(n,he,u.port),Se=new nUe(xe,e,ie,J,ee);e._transport=Se,xe.send("Ready",null)})}).catch(e._capability.reject),e}function Zze(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(ka&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Jze(t){if(ka&&typeof Buffer<"u"&&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(typeof t=="string")return BD(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!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.")}function gX(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class i9{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${i9.#e++}`,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(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let mX=class{constructor(e,n,r=!1,i=null){this.length=e,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const r of this._rangeListeners)r(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){Si("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Qze{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return ir(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(n)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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 eUe{#e=null;#t=!1;constructor(e,n,r,i=!1){this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=i?new $G:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new vX,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({scale:e,rotation:n=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:o=!1}={}){return new Uw({viewBox:this.view,scale:e,rotation:n,offsetX:r,offsetY:i,dontFlip:o})}getAnnotations({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ir(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:n,intent:r="display",annotationMode:i=oh.ENABLE,transform:o=null,background:a=null,optionalContentConfigPromise:s=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:d=!1}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:h,cacheKey:m}=f;this.#t=!1,this.#r(),s||=this._transport.getOptionalContentConfig(h);let g=this._intentStates.get(m);g||(g=Object.create(null),this._intentStates.set(m,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const v=!!(h&al.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f));const b=w=>{g.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#t=!0),this.#n(!v),w?(y.capability.reject(w),this._abortOperatorList({intentState:g,reason:w instanceof Error?w:new Error(w)})):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 Wy({callback:b,params:{canvasContext:e,viewport:n,transform:o,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(g.renderTasks||=new Set).add(y);const x=y.task;return Promise.all([g.displayReadyCapability.promise,s]).then(([w,C])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(C.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:w,optionalContentConfig:C}),y.operatorListChanged()}).catch(b),x}getOperatorList({intent:e="display",annotationMode:n=oh.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){function o(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,n,r,i,!0);let s=this._intentStates.get(a.cacheKey);s||(s=Object.create(null),this._intentStates.set(a.cacheKey,s));let l;return s.opListReadCapability||(l=Object.create(null),l.operatorListChanged=o,s.opListReadCapability=Promise.withResolvers(),(s.renderTasks||=new Set).add(l),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>Hw.textContent(r));const n=this.streamTextContent(e);return new Promise(function(r,i){function o(){a.read().then(function({value:l,done:c}){if(c){r(s);return}s.lang??=l.lang,Object.assign(s.styles,l.styles),s.items.push(...l.items),o()},i)}const a=n.getReader(),s={items:[],styles:Object.create(null),lang:null};o()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const n of this._intentStates.values())if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!n.opListReadCapability)for(const r of n.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#t=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#t=!0;const n=this.#n(!1);return e&&n&&(this._stats&&=new $G),n}#n(e=!1){if(this.#r(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#n(!1)},jze),!1;for(const{renderTasks:n,operatorList:r}of this._intentStates.values())if(n.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#r(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(e,n){const r=this._intentStates.get(n);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(e))}_renderPageChunk(e,n){for(let r=0,i=e.length;r<i;r++)n.operatorList.fnArray.push(e.fnArray[r]),n.operatorList.argsArray.push(e.argsArray[r]);n.operatorList.lastChunk=e.lastChunk,n.operatorList.separateAnnots=e.separateAnnots;for(const r of n.renderTasks)r.operatorListChanged();e.lastChunk&&this.#n(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r,modifiedIds:i}){const{map:o,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:o,modifiedIds:i},a).getReader(),c=this._intentStates.get(n);c.streamReader=l;const u=()=>{l.read().then(({value:d,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),u())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();this.#n(!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:e,reason:n,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(n instanceof DI){let i=Vze;n.extraDelay>0&&n.extraDelay<1e3&&(i+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},i);return}}if(e.streamReader.cancel(new pg(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,o]of this._intentStates)if(o===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}class tUe{#e=new Map;#t=Promise.resolve();postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};this.#t.then(()=>{for(const[i]of this.#e)i.call(this,r)})}addEventListener(e,n,r=null){let i=null;if(r?.signal instanceof AbortSignal){const{signal:o}=r;if(o.aborted){Vn("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,n);i=()=>o.removeEventListener("abort",a),o.addEventListener("abort",a)}this.#e.set(n,i)}removeEventListener(e,n){this.#e.get(n)?.(),this.#e.delete(n)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}class Ko{static#e=0;static#t=!1;static#n;static{ka&&(this.#t=!0,f1.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,n)=>{let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const i=new URL(n,r);return r.origin===i.origin},this._createCDNWrapper=e=>{const n=`await import("${e}");`;return URL.createObjectURL(new Blob([n],{type:"text/javascript"}))}}constructor({name:e=null,port:n=null,verbosity:r=R$e()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if(Ko.#n?.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(Ko.#n||=new WeakMap).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return ka?Promise.all([sh.promise,this._readyCapability.promise]):this._readyCapability.promise}#r(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new h1("main","worker",e),this._messageHandler.on("ready",function(){}),this.#r()}_initialize(){if(Ko.#t||Ko.#o){this._setupFakeWorker();return}let{workerSrc:e}=Ko;try{Ko._isSameOrigin(window.location.href,e)||(e=Ko._createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),r=new h1("main","worker",n),i=()=>{o.abort(),r.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},o=new AbortController;n.addEventListener("error",()=>{this._webWorker||i()},{signal:o.signal}),r.on("test",s=>{if(o.abort(),this.destroyed||!s){i();return}this._messageHandler=r,this._port=n,this._webWorker=n,this.#r()}),r.on("ready",s=>{if(o.abort(),this.destroyed){i();return}try{a()}catch{this._setupFakeWorker()}});const a=()=>{const s=new Uint8Array;r.send("test",s,[s.buffer])};a();return}catch{LD("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Ko.#t||(Vn("Setting up fake worker."),Ko.#t=!0),Ko._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new tUe;this._port=n;const r=`fake${Ko.#e++}`,i=new h1(r+"_worker",r,n);e.setup(i,n),this._messageHandler=new h1(r,r+"_worker",n),this.#r()}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Ko.#n?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=this.#n?.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new Ko(e)}static get workerSrc(){if(f1.workerSrc)return f1.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return ir(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class nUe{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#o=null;constructor(e,n,r,i,o){this.messageHandler=e,this.loadingTask=n,this.commonObjs=new vX,this.fontLoader=new Q$e({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=o.canvasFactory,this.filterFactory=o.filterFactory,this.cMapReaderFactory=o.cMapReaderFactory,this.standardFontDataFactory=o.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#i(e,n=null){const r=this.#e.get(e);if(r)return r;const i=this.messageHandler.sendWithPromise(e,n);return this.#e.set(e,i),i}get annotationStorage(){return ir(this,"annotationStorage",new MI)}getRenderingIntent(e,n=oh.ENABLE,r=null,i=!1,o=!1){let a=al.DISPLAY,s=_I;switch(e){case"any":a=al.ANY;break;case"display":break;case"print":a=al.PRINT;break;default:Vn(`getRenderingIntent - invalid intent: ${e}`)}const l=a&al.PRINT&&r instanceof VG?r:this.annotationStorage;switch(n){case oh.DISABLE:a+=al.ANNOTATIONS_DISABLE;break;case oh.ENABLE:break;case oh.ENABLE_FORMS:a+=al.ANNOTATIONS_FORMS;break;case oh.ENABLE_STORAGE:a+=al.ANNOTATIONS_STORAGE,s=l.serializable;break;default:Vn(`getRenderingIntent - invalid annotationMode: ${n}`)}i&&(a+=al.IS_EDITING),o&&(a+=al.OPLIST);const{ids:c,hash:u}=l.modifiedIds,d=[a,s.hash,u];return{renderingIntent:a,cacheKey:d.join("_"),annotationStorageSerializable:s,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const r of this.#t.values())e.push(r._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),UI.cleanup(),this._networkStream?.cancelAllRequests(new pg("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(r,i)=>{Oo(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=o=>{this._lastProgress={loaded:o.loaded,total:o.total}},i.onPull=()=>{this._fullReader.read().then(function({value:o,done:a}){if(a){i.close();return}Oo(o instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{this._fullReader.cancel(o),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:o,contentLength:a}=this._fullReader;return(!i||!o)&&(this._lastProgress&&n.onProgress?.(this._lastProgress),this._fullReader.onProgress=s=>{n.onProgress?.({loaded:s.loaded,total:s.total})}),{isStreamingSupported:i,isRangeSupported:o,contentLength:a}}),e.on("GetRangeReader",(r,i)=>{Oo(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const o=this._networkStream.getRangeReader(r.begin,r.end);if(!o){i.close();return}i.onPull=()=>{o.read().then(function({value:a,done:s}){if(s){i.close();return}Oo(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{o.cancel(a),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new Qze(r,this))}),e.on("DocException",function(r){let i;switch(r.name){case"PasswordException":i=new yI(r.message,r.code);break;case"InvalidPDFException":i=new LG(r.message);break;case"MissingPDFException":i=new hg(r.message);break;case"UnexpectedResponseException":i=new FD(r.message,r.status);break;case"UnknownErrorException":i=new xI(r.message,r.details);break;default:Si("DocException - expected a valid Error.")}n._capability.reject(i)}),e.on("PasswordRequest",r=>{if(this.#o=Promise.withResolvers(),n.onPassword){const i=o=>{o instanceof Error?this.#o.reject(o):this.#o.resolve({password:o})};try{n.onPassword(i,r.code)}catch(o){this.#o.reject(o)}}else this.#o.reject(new yI(r.message,r.code));return this.#o.promise}),e.on("DataLoaded",r=>{n.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;this.#t.get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,i,o])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":const{disableFontFace:a,fontExtraProperties:s,pdfBug:l}=this._params;if("error"in o){const f=o.error;Vn(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}const c=l&&globalThis.FontInspector?.enabled?(f,h)=>globalThis.FontInspector.fontAdded(f,h):null,u=new eze(o,{disableFontFace:a,inspectFont:c});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!s&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:d}=o;Oo(d,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,h]of f.objs)if(h?.ref===d)return h.dataLen?(this.commonObjs.resolve(r,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,o);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([r,i,o,a])=>{if(this.destroyed)return;const s=this.#t.get(i);if(!s.objs.has(r)){if(s._intentStates.size===0){a?.bitmap?.close();return}switch(o){case"Image":s.objs.resolve(r,a),a?.dataLen>k$e&&(s._maybeCleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${o}`)}}}),e.on("DocProgress",r=>{this.destroyed||n.onProgress?.({loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(r)}),e.on("FetchStandardFontData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Vn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=e-1,r=this.#n.get(n);if(r)return r;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(o=>{if(this.destroyed)throw new Error("Transport destroyed");o.refStr&&this.#r.set(o.refStr,e);const a=new eUe(n,o,this,this._params.pdfBug);return this.#t.set(n,a),a});return this.#n.set(n,i),i}getPageIndex(e){return gX(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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.#i("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#i("GetOptionalContentConfig").then(n=>new Cze(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=this.#e.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new xze(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of this.#t.values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),UI.cleanup()}}cachedPageNumber(e){if(!gX(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(n)??null}}const YD=Symbol("INITIAL_DATA");class vX{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:YD}}get(e,n=null){if(n){const i=this.#t(e);return i.promise.then(()=>n(i.data)),null}const r=this.#e[e];if(!r||r.data===YD)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=this.#e[e];return!!n&&n.data!==YD}resolve(e,n=null){const r=this.#t(e);r.data=n,r.resolve()}clear(){for(const e in this.#e){const{data:n}=this.#e[e];n?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:n}=this.#e[e];n!==YD&&(yield[e,n])}}}class rUe{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:n}=this.#e;return e.form||e.canvas&&n?.size>0}}class Wy{#e=null;static#t=new WeakSet;constructor({callback:e,params:n,objs:r,commonObjs:i,annotationCanvasMap:o,operatorList:a,pageIndex:s,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:f=null}){this.callback=e,this.params=n,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=s,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new rUe(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=n.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(Wy.#t.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.");Wy.#t.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:r,viewport:i,transform:o,background:a}=this.params;this.gfx=new Uy(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),Wy.#t.delete(this._canvas),this.callback(e||new DI(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),Wy.#t.delete(this._canvas),this.callback())))}}const iUe="4.8.69",oUe="3634dab10";function bX(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function p1(t){return Math.max(0,Math.min(255,255*t))}class yX{static CMYK_G([e,n,r,i]){return["G",1-Math.min(1,.3*e+.59*r+.11*n+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=p1(e),[e,e,e]}static G_HTML([e]){const n=bX(e);return`#${n}${n}${n}`}static RGB_G([e,n,r]){return["G",.3*e+.59*n+.11*r]}static RGB_rgb(e){return e.map(p1)}static RGB_HTML(e){return`#${e.map(bX).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,r,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,r+i),1-Math.min(1,n+i)]}static CMYK_rgb([e,n,r,i]){return[p1(1-Math.min(1,e+i)),p1(1-Math.min(1,r+i)),p1(1-Math.min(1,n+i))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,r]){const i=1-e,o=1-n,a=1-r,s=Math.min(i,o,a);return["CMYK",i,o,a,s]}}class aUe{create(e,n,r=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${n}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${n}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Si("Abstract method `_createSVG` called.")}}class WI extends aUe{_createSVG(e){return document.createElementNS(Ad,e)}}class xX{static setupStorage(e,n,r,i,o){const a=i.getValue(n,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),o==="print")break;e.addEventListener("input",s=>{i.setValue(n,{value:s.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),o==="print")break;e.addEventListener("change",s=>{i.setValue(n,{value:s.target.checked?s.target.getAttribute("xfaOn"):s.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),o==="print")break;e.addEventListener("input",s=>{i.setValue(n,{value:s.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const s of r.children)s.attributes.value===a.value?s.attributes.selected=!0:s.attributes.hasOwnProperty("selected")&&delete s.attributes.selected}e.addEventListener("input",s=>{const l=s.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(n,{value:c})});break}}static setAttributes({html:e,element:n,storage:r=null,intent:i,linkService:o}){const{attributes:a}=n,s=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!s||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}s&&o.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(e){const n=e.annotationStorage,r=e.linkService,i=e.xfaHtml,o=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:o,linkService:r});const s=o!=="richText",l=e.div;if(l.append(a),e.viewport){const d=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=d}s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const d=document.createTextNode(i.value);a.append(d),s&&Hw.shouldBuildText(i.name)&&c.push(d)}return{textDivs:c}}const u=[[i,-1,a]];for(;u.length>0;){const[d,f,h]=u.at(-1);if(f+1===d.children.length){u.pop();continue}const m=d.children[++u.at(-1)[1]];if(m===null)continue;const{name:g}=m;if(g==="#text"){const b=document.createTextNode(m.value);c.push(b),h.append(b);continue}const v=m?.attributes?.xmlns?document.createElementNS(m.attributes.xmlns,g):document.createElement(g);if(h.append(v),m.attributes&&this.setAttributes({html:v,element:m,storage:n,intent:o,linkService:r}),m.children?.length>0)u.push([m,-1,v]);else if(m.value){const b=document.createTextNode(m.value);s&&Hw.shouldBuildText(g)&&c.push(b),v.append(b)}}for(const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const g1=1e3,sUe=9,mg=new WeakSet;function _d(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class lUe{static create(e){switch(e.data.annotationType){case Mo.LINK:return new wX(e);case Mo.TEXT:return new cUe(e);case Mo.WIDGET:switch(e.data.fieldType){case"Tx":return new uUe(e);case"Btn":return e.data.radioButton?new CX(e):e.data.checkBox?new fUe(e):new hUe(e);case"Ch":return new pUe(e);case"Sig":return new dUe(e)}return new vg(e);case Mo.POPUP:return new HI(e);case Mo.FREETEXT:return new EX(e);case Mo.LINE:return new mUe(e);case Mo.SQUARE:return new vUe(e);case Mo.CIRCLE:return new bUe(e);case Mo.POLYLINE:return new SX(e);case Mo.CARET:return new xUe(e);case Mo.INK:return new VI(e);case Mo.POLYGON:return new yUe(e);case Mo.HIGHLIGHT:return new DX(e);case Mo.UNDERLINE:return new wUe(e);case Mo.SQUIGGLY:return new CUe(e);case Mo.STRIKEOUT:return new EUe(e);case Mo.STAMP:return new TX(e);case Mo.FILEATTACHMENT:return new SUe(e);default:return new uo(e)}}}class uo{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,n&&(this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:n,richText:r}){return!!(e?.str||n?.str||r?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return uo._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:n}=e;n&&this.#r(n),this.#n?.popup.updateEdited(e)}resetEdited(){this.#e&&(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#r(e){const{container:{style:n},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:a,pageX:s,pageY:l}}}}=this;r?.splice(0,4,...e);const{width:c,height:u}=_d(e);n.left=`${100*(e[0]-s)/o}%`,n.top=`${100*(a-e[3]+l)/a}%`,i===0?(n.width=`${100*c/o}%`,n.height=`${100*u/a}%`):this.setRotation(i)}_createContainer(e){const{data:n,parent:{page:r,viewport:i}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",n.id),this instanceof vg||(o.tabIndex=g1);const{style:a}=o;if(a.zIndex=this.parent.zIndex++,n.alternativeText&&(o.title=n.alternativeText),n.noRotate&&o.classList.add("norotate"),!n.rect||this instanceof HI){const{rotation:g}=n;return!n.hasOwnCanvas&&g!==0&&this.setRotation(g,o),o}const{width:s,height:l}=_d(n.rect);if(!e&&n.borderStyle.width>0){a.borderWidth=`${n.borderStyle.width}px`;const g=n.borderStyle.horizontalCornerRadius,v=n.borderStyle.verticalCornerRadius;if(g>0||v>0){const y=`calc(${g}px * var(--scale-factor)) / calc(${v}px * var(--scale-factor))`;a.borderRadius=y}else if(this instanceof CX){const y=`calc(${s}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=y}switch(n.borderStyle.style){case l1.SOLID:a.borderStyle="solid";break;case l1.DASHED:a.borderStyle="dashed";break;case l1.BEVELED:Vn("Unimplemented border style: beveled");break;case l1.INSET:Vn("Unimplemented border style: inset");break;case l1.UNDERLINE:a.borderBottomStyle="solid";break}const b=n.borderColor||null;b?(this.#t=!0,a.borderColor=un.makeHexColor(b[0]|0,b[1]|0,b[2]|0)):a.borderWidth=0}const c=un.normalizeRect([n.rect[0],r.view[3]-n.rect[1]+r.view[1],n.rect[2],r.view[3]-n.rect[3]+r.view[1]]),{pageWidth:u,pageHeight:d,pageX:f,pageY:h}=i.rawDims;a.left=`${100*(c[0]-f)/u}%`,a.top=`${100*(c[1]-h)/d}%`;const{rotation:m}=n;return n.hasOwnCanvas||m===0?(a.width=`${100*s/u}%`,a.height=`${100*l/d}%`):this.setRotation(m,o),o}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims,{width:o,height:a}=_d(this.data.rect);let s,l;e%180===0?(s=100*o/r,l=100*a/i):(s=100*a/r,l=100*o/i),n.style.width=`${s}%`,n.style.height=`${l}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,i)=>{const o=i.detail[n],a=o[0],s=o.slice(1);i.target.style[r]=yX[`${a}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[r]:yX[`${a}_rgb`](s)})};return ir(this,"_commonActions",{display:n=>{const{display:r}=n.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:n=>{this.annotationStorage.setValue(this.data.id,{noPrint:!n.detail.print})},hidden:n=>{const{hidden:r}=n.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:n=>{setTimeout(()=>n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.target.disabled=n.detail.readonly},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{e("bgColor","backgroundColor",n)},fillColor:n=>{e("fillColor","backgroundColor",n)},fgColor:n=>{e("fgColor","color",n)},textColor:n=>{e("textColor","color",n)},borderColor:n=>{e("borderColor","borderColor",n)},strokeColor:n=>{e("strokeColor","borderColor",n)},rotation:n=>{const r=n.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,n){const r=this._commonActions;for(const i of Object.keys(n.detail))(e[i]||r[i])?.(n)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const r=this._commonActions;for(const[i,o]of Object.entries(n)){const a=r[i];if(a){const s={detail:{[i]:o},target:e};a(s),delete n[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,r,i,o]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,v,b,y]=e.subarray(2,6);if(i===g&&o===v&&n===b&&r===y)return}const{style:a}=this.container;let s;if(this.#t){const{borderColor:g,borderWidth:v}=a;a.borderWidth=0,s=["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="${g}" stroke-width="${v}">`],this.container.classList.add("hasBorder")}const l=i-n,c=o-r,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const f=u.createElement("defs");d.append(f);const h=u.createElement("clipPath"),m=`clippath_${this.data.id}`;h.setAttribute("id",m),h.setAttribute("clipPathUnits","objectBoundingBox"),f.append(h);for(let g=2,v=e.length;g<v;g+=8){const b=e[g],y=e[g+1],x=e[g+2],w=e[g+3],C=u.createElement("rect"),E=(x-n)/l,S=(o-y)/c,T=(b-x)/l,A=(y-w)/c;C.setAttribute("x",E),C.setAttribute("y",S),C.setAttribute("width",T),C.setAttribute("height",A),h.append(C),s?.push(`<rect vector-effect="non-scaling-stroke" x="${E}" y="${S}" width="${T}" height="${A}"/>`)}this.#t&&(s.push("</g></svg>')"),a.backgroundImage=s.join("")),this.container.append(d),this.container.style.clipPath=`url(#${m})`}_createPopup(){const{data:e}=this,n=this.#n=new HI({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(n.render())}render(){Si("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:o,id:a,exportValues:s}of i){if(o===-1||a===n)continue;const l=typeof s=="string"?s:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!mg.has(c)){Vn(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:c})}return r}for(const i of document.getElementsByName(e)){const{exportValue:o}=i,a=i.getAttribute("data-element-id");a!==n&&mg.has(i)&&r.push({id:a,exportValue:o,domElement:i})}return r}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 e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const n of e)n.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:n})})}}class wX extends uo{constructor(e,n=null){super(e,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:n}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let i=!1;return e.url?(n.addLinkAttributes(r,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(r,e.action),i=!0):e.attachment?(this.#t(r,e.attachment,e.attachmentDest),i=!0):e.setOCGState?(this.#n(r,e.setOCGState),i=!0):e.dest?(this._bindLink(r,e.dest),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),i=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(r),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,n){e.href=this.linkService.getDestinationHash(n),e.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&this.#e()}_bindNamedAction(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(n),!1),this.#e()}#t(e,n,r=null){e.href=this.linkService.getAnchorUrl(""),n.description&&(e.title=n.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(n.content,n.filename,r),!1),this.#e()}#n(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(n),!1),this.#e()}_bindJSAction(e,n){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(n.actions)){const o=r.get(i);o&&(e[o]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:i}}),!1))}e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,n){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Vn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{r?.();const{fields:i,refs:o,include:a}=n,s=[];if(i.length!==0||o.length!==0){const u=new Set(o);for(const d of i){const f=this._fieldObjects[d]||[];for(const{id:h}of f)u.add(h)}for(const d of Object.values(this._fieldObjects))for(const f of d)u.has(f.id)===a&&s.push(f)}else for(const u of Object.values(this._fieldObjects))s.push(...u);const l=this.annotationStorage,c=[];for(const u of s){const{id:d}=u;switch(c.push(d),u.type){case"text":{const h=u.defaultValue||"";l.setValue(d,{value:h});break}case"checkbox":case"radiobutton":{const h=u.defaultValue===u.exportValues;l.setValue(d,{value:h});break}case"combobox":case"listbox":{const h=u.defaultValue||"";l.setValue(d,{value:h});break}default:continue}const f=document.querySelector(`[data-element-id="${d}"]`);if(f){if(!mg.has(f)){Vn(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class cUe extends uo{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class vg extends uo{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return es.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,i,o){r.includes("mouse")?e.addEventListener(r,a=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{if(r==="blur"){if(!n.focused||!a.relatedTarget)return;n.focused=!1}else if(r==="focus"){if(n.focused)return;n.focused=!0}o&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(a)}})})}_setEventListeners(e,n,r,i){for(const[o,a]of r)(a==="Action"||this.data.actions?.[a])&&((a==="Focus"||a==="Blur")&&(n||={focused:!1}),this._setEventListener(e,n,o,a,i),a==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,n,"blur","Blur",null):a==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":un.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||sUe,o=e.style;let a;const s=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-s),u=Math.round(c/(bI*i))||1,d=c/u;a=Math.min(i,l(d/bI))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-s);a=Math.min(i,l(c/bI))}o.fontSize=`calc(${a}px * var(--scale-factor))`,o.color=un.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(o.textAlign=n[this.data.textAlignment])}_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class uUe extends vg{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,r,i){const o=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[n]=r),o.setValue(a.id,{[i]:r})}render(){const e=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const i=e.getValue(n,{value:this.data.fieldValue});let o=i.value||"";const a=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;a&&o.length>a&&(o=o.slice(0,a));let s=i.formattedValue||this.data.textContent?.join(`
568
+ `);return e.join("")}}function c1(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return n==="http:"||n==="https:"}catch{return!1}}function Vl(t){t.preventDefault()}function zG(t){console.log("Deprecated API usage: "+t)}class UG{static#e;static toDateObject(e){if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const n=this.#e.exec(e);if(!n)return null;const r=parseInt(n[1],10);let i=parseInt(n[2],10);i=i>=1&&i<=12?i-1:0;let o=parseInt(n[3],10);o=o>=1&&o<=31?o:1;let a=parseInt(n[4],10);a=a>=0&&a<=23?a:0;let s=parseInt(n[5],10);s=s>=0&&s<=59?s:0;let l=parseInt(n[6],10);l=l>=0&&l<=59?l:0;const c=n[7]||"Z";let u=parseInt(n[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(n[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(a+=u,s+=d):c==="+"&&(a-=u,s-=d),new Date(Date.UTC(r,i,o,a,s,l))}}function Y$e(t,{scale:e=1,rotation:n=0}){const{width:r,height:i}=t.attributes.style,o=[0,0,parseInt(r),parseInt(i)];return new Uw({viewBox:o,scale:e,rotation:n})}function AI(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Vn(`Not a valid color format: "${t}"`),[0,0,0])}function q$e(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,AI(r))}e.remove()}function $i(t){const{a:e,b:n,c:r,d:i,e:o,f:a}=t.getTransform();return[e,n,r,i,o,a]}function kd(t){const{a:e,b:n,c:r,d:i,e:o,f:a}=t.getTransform().invertSelf();return[e,n,r,i,o,a]}function gg(t,e,n=!1,r=!0){if(e instanceof Uw){const{pageWidth:i,pageHeight:o}=e.rawDims,{style:a}=t,s=es.isCSSRoundSupported,l=`var(--scale-factor) * ${i}px`,c=`var(--scale-factor) * ${o}px`,u=s?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,d=s?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!n||e.rotation%180===0?(a.width=u,a.height=d):(a.width=d,a.height=u)}r&&t.setAttribute("data-main-rotation",e.rotation)}class kI{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}class Ww{#e=null;#t=null;#n;#r=null;#o=null;static#i=null;constructor(e){this.#n=e,Ww.#i||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const n=this.#n._uiManager._signal;e.addEventListener("contextmenu",Vl,{signal:n}),e.addEventListener("pointerdown",Ww.#s,{signal:n});const r=this.#r=document.createElement("div");r.className="buttons",e.append(r);const i=this.#n.toolbarPosition;if(i){const{style:o}=e,a=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];o.insetInlineEnd=`${100*a}%`,o.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),e}get div(){return this.#e}static#s(e){e.stopPropagation()}#l(e){this.#n._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#c(e){const n=this.#n._uiManager._signal;e.addEventListener("focusin",this.#l.bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",Vl,{signal:n})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#o?.shown()}#d(){const{editorType:e,_uiManager:n}=this.#n,r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",Ww.#i[e]),this.#c(r),r.addEventListener("click",i=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#a(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const n=await e.render();this.#c(n),this.#r.prepend(n,this.#a),this.#o=e}addColorPicker(e){this.#t=e;const n=e.renderButton();this.#c(n),this.#r.prepend(n,this.#a)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class G$e{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Vl,{signal:this.#n._signal});const n=this.#e=document.createElement("div");return n.className="buttons",e.append(n),this.#i(),e}#o(e,n){let r=0,i=0;for(const o of e){const a=o.y+o.height;if(a<r)continue;const s=o.x+(n?o.width:0);if(a>r){i=s,r=a;continue}n?s>i&&(i=s):s<i&&(i=s)}return[n?1-i:i,r]}show(e,n,r){const[i,o]=this.#o(n,r),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*o}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#i(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const n=document.createElement("span");e.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=this.#n._signal;e.addEventListener("contextmenu",Vl,{signal:r}),e.addEventListener("click",()=>{this.#n.highlightSelection("floating_button")},{signal:r}),this.#e.append(e)}}function UD(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}function X$e(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class K$e{#e=0;get id(){return`${_$e}${this.#e++}`}}class t9{#e=W$e();#t=0;#n=null;static get _isSVGFittingCanvas(){const e='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>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const o=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return ir(this,"_isSVGFittingCanvas",o)}async#r(e,n){this.#n||=new Map;let r=this.#n.get(e);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let i;if(typeof n=="string"?(r.url=n,i=await $D(n,"blob")):n instanceof File?i=r.file=n:n instanceof Blob&&(i=n),i.type==="image/svg+xml"){const o=t9._isSVGFittingCanvas,a=new FileReader,s=new Image,l=new Promise((c,u)=>{s.onload=()=>{r.bitmap=s,r.isSvg=!0,c()},a.onload=async()=>{const d=r.svgUrl=a.result;s.src=await o?`${d}#svgView(preserveAspectRatio(none))`:d},s.onerror=a.onerror=u});a.readAsDataURL(i),await l}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){console.error(i),r=null}return this.#n.set(e,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){const{lastModified:n,name:r,size:i,type:o}=e;return this.#r(`${n}_${r}_${i}_${o}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,n){const r=await n;return this.#r(e,r)}async getFromId(e){this.#n||=new Map;const n=this.#n.get(e);if(!n)return null;if(n.bitmap)return n.refCounter+=1,n;if(n.file)return this.getFromFile(n.file);if(n.blobPromise){const{blobPromise:r}=n;return delete n.blobPromise,this.getFromBlob(n.id,r)}return this.getFromUrl(n.url)}getFromCanvas(e,n){this.#n||=new Map;let r=this.#n.get(e);if(r?.bitmap)return r.refCounter+=1,r;const i=new OffscreenCanvas(n.width,n.height);return i.getContext("2d").drawImage(n,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,r),this.#n.set(r.id,r),r}getSvgUrl(e){const n=this.#n.get(e);return n?.isSvg?n.svgUrl:null}deleteId(e){this.#n||=new Map;const n=this.#n.get(e);if(!n||(n.refCounter-=1,n.refCounter!==0))return;const{bitmap:r}=n;if(!n.url&&!n.file){const i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),n.blobPromise=i.convertToBlob()}r.close?.(),n.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class Z$e{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:n,post:r,mustExec:i,type:o=NaN,overwriteIfSameType:a=!1,keepUndo:s=!1}){if(i&&e(),this.#t)return;const l={cmd:e,undo:n,post:r,type:o};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(l);return}if(a&&this.#e[this.#r].type===o){s&&(l.undo=this.#e[this.#r].undo),this.#e[this.#r]=l;return}const c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#r===-1)return;this.#t=!0;const{undo:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1,this.#r-=1}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;const{cmd:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}destroy(){this.#e=null}}class u1{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=es.platform;for(const[r,i,o={}]of e)for(const a of r){const s=a.startsWith("mac+");n&&s?(this.callbacks.set(a.slice(4),{callback:i,options:o}),this.allKeys.add(a.split("+").at(-1))):!n&&!s&&(this.callbacks.set(a,{callback:i,options:o}),this.allKeys.add(a.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const n=this.buffer.join("+");return this.buffer.length=0,n}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(this.#e(n));if(!r)return;const{callback:i,options:{bubbles:o=!1,args:a=[],checker:s=null}}=r;s&&!s(e,n)||(i.bind(e,...a,n)(),o||(n.stopPropagation(),n.preventDefault()))}}class n9{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return q$e(e),ir(this,"_colors",e)}convert(e){const n=AI(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,i]of this._colors)if(i.every((o,a)=>o===n[a]))return n9._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?un.makeHexColor(...n):e}}class dp{#e=new AbortController;#t=null;#n=new Map;#r=new Map;#o=null;#i=null;#s=null;#l=new Z$e;#u=null;#c=0;#d=new Set;#a=null;#f=null;#p=new Set;#h=!1;#v=!1;#m=!1;#g=null;#b=null;#x=null;#T=null;#E=!1;#S=null;#N=new K$e;#A=!1;#w=!1;#D=null;#k=null;#_=null;#P=null;#C=Bn.NONE;#y=new Set;#R=null;#I=null;#L=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#$=[0,0];#F=null;#B=null;#U=null;#M=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=dp.prototype,n=a=>a.#B.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:s})=>{if(s instanceof HTMLInputElement){const{type:l}=s;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return ir(this,"_keyboardManager",new u1([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:s})=>!(s instanceof HTMLButtonElement)&&a.#B.contains(s)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:s})=>!(s instanceof HTMLButtonElement)&&a.#B.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:n}]]))}constructor(e,n,r,i,o,a,s,l,c,u,d){const f=this._signal=this.#e.signal;this.#B=e,this.#U=n,this.#o=r,this._eventBus=i,i._on("editingaction",this.onEditingAction.bind(this),{signal:f}),i._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),i._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),i._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),i._on("setpreference",this.onSetPreference.bind(this),{signal:f}),i._on("switchannotationeditorparams",h=>this.updateParams(h.type,h.value),{signal:f}),this.#ee(),this.#ie(),this.#q(),this.#i=o.annotationStorage,this.#g=o.filterFactory,this.#I=a,this.#T=s||null,this.#h=l,this.#v=c,this.#m=u,this.#P=d||null,this.viewParameters={realScale:ab.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#M?.resolve(),this.#M=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#r.values())e.destroy();this.#r.clear(),this.#n.clear(),this.#p.clear(),this.#t=null,this.#y.clear(),this.#l.destroy(),this.#o?.destroy(),this.#S?.hide(),this.#S=null,this.#b&&(clearTimeout(this.#b),this.#b=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#P}get useNewAltTextFlow(){return this.#v}get useNewAltTextWhenAddingImage(){return this.#m}get hcmFilter(){return ir(this,"hcmFilter",this.#I?this.#g.addHCMFilter(this.#I.foreground,this.#I.background):"none")}get direction(){return ir(this,"direction",getComputedStyle(this.#B).direction)}get highlightColors(){return ir(this,"highlightColors",this.#T?new Map(this.#T.split(",").map(e=>e.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return ir(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){this.#_=e}editAltText(e,n=!1){this.#o?.editAltText(this,e,n)}switchToMode(e,n){this._eventBus.on("annotationeditormodechanged",n,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,n){this._eventBus.dispatch("setpreference",{source:this,name:e,value:n})}onSetPreference({name:e,value:n}){switch(e){case"enableNewAltTextWhenAddingImage":this.#m=n;break}}onPageChanging({pageNumber:e}){this.#c=e-1}focusMainContainer(){this.#B.focus()}findParent(e,n){for(const r of this.#r.values()){const{x:i,y:o,width:a,height:s}=r.div.getBoundingClientRect();if(e>=i&&e<=i+a&&n>=o&&n<=o+s)return r}return null}disableUserSelect(e=!1){this.#U.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*ab.PDF_TO_CSS_UNITS;for(const n of this.#p)n.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#V({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Y(e){const{currentLayer:n}=this;if(n.hasTextLayer(e))return n;for(const r of this.#r.values())if(r.hasTextLayer(e))return r;return null}highlightSelection(e=""){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}=n,s=n.toString(),c=this.#V(n).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;n.empty();const d=this.#Y(c),f=this.#C===Bn.NONE,h=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:u,anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a,text:s}),f&&this.showAllEditors("highlight",!0,!0)};if(f){this.switchToMode(Bn.HIGHLIGHT,h);return}h()}#J(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=this.#V(e).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(this.#S||=new G$e(this),this.#S.show(r,i,this.direction==="ltr"))}addToAnnotationStorage(e){!e.isEmpty()&&this.#i&&!this.#i.has(e.id)&&this.#i.setValue(e.id,e)}#Q(){const e=document.getSelection();if(!e||e.isCollapsed){this.#R&&(this.#S?.hide(),this.#R=null,this.#O({hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===this.#R)return;const i=this.#V(e).closest(".textLayer");if(!i){this.#R&&(this.#S?.hide(),this.#R=null,this.#O({hasSelectedText:!1}));return}if(this.#S?.hide(),this.#R=n,this.#O({hasSelectedText:!0}),!(this.#C!==Bn.HIGHLIGHT&&this.#C!==Bn.NONE)&&(this.#C===Bn.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){const o=this.#C===Bn.HIGHLIGHT?this.#Y(i):null;o?.toggleDrawing();const a=new AbortController,s=this.combinedSignal(a),l=c=>{c.type==="pointerup"&&c.button!==0||(a.abort(),o?.toggleDrawing(!0),c.type==="pointerup"&&this.#j("main_toolbar"))};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})}}#j(e=""){this.#C===Bn.HIGHLIGHT?this.highlightSelection(e):this.#h&&this.#J()}#ee(){document.addEventListener("selectionchange",this.#Q.bind(this),{signal:this._signal})}#te(){if(this.#x)return;this.#x=new AbortController;const e=this.combinedSignal(this.#x);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#ne(){this.#x?.abort(),this.#x=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#j("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of this.#y)if(n.div.contains(e)){this.#k=[n,e],n._focusEventsAllowed=!1;break}}focus(){if(!this.#k)return;const[e,n]=this.#k;this.#k=null,n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}#q(){if(this.#D)return;this.#D=new AbortController;const e=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#re(){this.#D?.abort(),this.#D=null}#G(){if(this.#u)return;this.#u=new AbortController;const e=this.combinedSignal(this.#u);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#X(){this.#u?.abort(),this.#u=null}#ie(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#q(),this.#G()}removeEditListeners(){this.#re(),this.#X()}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of this.#f)if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of this.#f)if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const n=[];for(const r of this.#y){const i=r.serialize(!0);i&&n.push(i)}n.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:n}=e;for(const o of n.items)for(const a of this.#f)if(a.isHandlingMimeForPasting(o.type)){a.paste(o,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(o){Vn(`paste: "${o.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const o=[];for(const l of r){const c=await i.deserialize(l);if(!c)return;o.push(c)}const a=()=>{for(const l of o)this.#K(l);this.#Z(o)},s=()=>{for(const l of o)l.remove()};this.addCommands({cmd:a,undo:s,mustExec:!0})}catch(o){Vn(`paste: "${o.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#C!==Bn.NONE&&!this.isEditorHandlingKeyboard&&dp._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#j("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#O(e){Object.entries(e).some(([r,i])=>this.#W[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#W,e)}),this.#C===Bn.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#z([[kn.HIGHLIGHT_FREE,!0]]))}#z(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#te(),this.#G(),this.#O({isEditing:this.#C!==Bn.NONE,isEmpty:this.#H(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#X(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#f){this.#f=e;for(const n of this.#f)this.#z(n.defaultPropertiesToUpdate)}}getId(){return this.#N.id}get currentLayer(){return this.#r.get(this.#c)}getLayer(e){return this.#r.get(e)}get currentPageIndex(){return this.#c}addLayer(e){this.#r.set(e.pageIndex,e),this.#A?e.enable():e.disable()}removeLayer(e){this.#r.delete(e.pageIndex)}async updateMode(e,n=null,r=!1){if(this.#C!==e&&!(this.#M&&(await this.#M.promise,!this.#M))){if(this.#M=Promise.withResolvers(),this.#C=e,e===Bn.NONE){this.setEditingState(!1),this.#ae(),this.#M.resolve();return}this.setEditingState(!0),await this.#oe(),this.unselectAll();for(const i of this.#r.values())i.updateMode(e);if(!n){r&&this.addNewEditorFromKeyboard(),this.#M.resolve();return}for(const i of this.#n.values())i.annotationElementId===n?(this.setSelected(i),i.enterInEditMode()):i.unselect();this.#M.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#C&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,n){if(this.#f){switch(e){case kn.CREATE:this.currentLayer.addNewEditor();return;case kn.HIGHLIGHT_DEFAULT_COLOR:this.#_?.updateColor(n);break;case kn.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#L||=new Map).set(e,n),this.showAllEditors("highlight",n);break}for(const r of this.#y)r.updateParams(e,n);for(const r of this.#f)r.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){for(const o of this.#n.values())o.editorType===e&&o.show(n);(this.#L?.get(kn.HIGHLIGHT_SHOW_ALL)??!0)!==n&&this.#z([[kn.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(this.#w!==e){this.#w=e;for(const n of this.#r.values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}async#oe(){if(!this.#A){this.#A=!0;const e=[];for(const n of this.#r.values())e.push(n.enable());await Promise.all(e);for(const n of this.#n.values())n.enable()}}#ae(){if(this.unselectAll(),this.#A){this.#A=!1;for(const e of this.#r.values())e.disable();for(const e of this.#n.values())e.disable()}}getEditors(e){const n=[];for(const r of this.#n.values())r.pageIndex===e&&n.push(r);return n}getEditor(e){return this.#n.get(e)}addEditor(e){this.#n.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.focusMainContainer(),this.#b=null},0)),this.#n.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#d.has(e.annotationElementId))&&this.#i?.remove(e.id)}addDeletedAnnotationElement(e){this.#d.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#d.has(e)}removeDeletedAnnotationElement(e){this.#d.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#K(e){const n=this.#r.get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#z(e.propertiesToUpdate))}get#se(){let e=null;for(e of this.#y);return e}updateUI(e){this.#se===e&&this.#z(e.propertiesToUpdate)}toggleSelected(e){if(this.#y.has(e)){this.#y.delete(e),e.unselect(),this.#O({hasSelectedEditor:this.hasSelection});return}this.#y.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(e){for(const n of this.#y)n!==e&&n.unselect();this.#y.clear(),this.#y.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(e){return this.#y.has(e)}get firstSelectedEditor(){return this.#y.values().next().value}unselect(e){e.unselect(),this.#y.delete(e),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#y.size!==0}get isEnterHandled(){return this.#y.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#O({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#H()})}redo(){this.#l.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#H()})}addCommands(e){this.#l.add(e),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#H()})}#H(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(const e of this.#n.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#y],n=()=>{for(const i of e)i.remove()},r=()=>{for(const i of e)this.#K(i)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#Z(e){for(const n of this.#y)n.unselect();this.#y.clear();for(const n of e)n.isEmpty()||(this.#y.add(n),n.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#y)e.commit();this.#Z(this.#n.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#C!==Bn.NONE))&&this.hasSelection){for(const e of this.#y)e.unselect();this.#y.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#$[0]+=e,this.#$[1]+=n;const[i,o]=this.#$,a=[...this.#y],s=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#$[0]=this.#$[1]=0,this.addCommands({cmd:()=>{for(const l of a)this.#n.has(l.id)&&l.translateInPage(i,o)},undo:()=>{for(const l of a)this.#n.has(l.id)&&l.translateInPage(-i,-o)},mustExec:!1})},s);for(const l of a)l.translateInPage(e,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#a=new Map;for(const e of this.#y)this.#a.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#a)return!1;this.disableUserSelect(!1);const e=this.#a;this.#a=null;let n=!1;for(const[{x:i,y:o,pageIndex:a},s]of e)s.newX=i,s.newY=o,s.newPageIndex=a,n||=i!==s.savedX||o!==s.savedY||a!==s.savedPageIndex;if(!n)return!1;const r=(i,o,a,s)=>{if(this.#n.has(i.id)){const l=this.#r.get(s);l?i._setParentAndPosition(l,o,a):(i.pageIndex=s,i.x=o,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:o,newY:a,newPageIndex:s}]of e)r(i,o,a,s)},undo:()=>{for(const[i,{savedX:o,savedY:a,savedPageIndex:s}]of e)r(i,o,a,s)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(this.#a)for(const r of this.#a.keys())r.drag(e,n)}rebuild(e){if(e.parent===null){const n=this.getLayer(e.pageIndex);n?(n.changeParent(e),n.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#y.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#C}get imageManager(){return ir(this,"imageManager",new t9)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let c=0,u=n.rangeCount;c<u;c++)if(!e.contains(n.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:i,width:o,height:a}=e.getBoundingClientRect();let s;switch(e.getAttribute("data-main-rotation")){case"90":s=(c,u,d,f)=>({x:(u-i)/a,y:1-(c+d-r)/o,width:f/a,height:d/o});break;case"180":s=(c,u,d,f)=>({x:1-(c+d-r)/o,y:1-(u+f-i)/a,width:d/o,height:f/a});break;case"270":s=(c,u,d,f)=>({x:1-(u+f-i)/a,y:(c-r)/o,width:f/a,height:d/o});break;default:s=(c,u,d,f)=>({x:(c-r)/o,y:(u-i)/a,width:d/o,height:f/a});break}const l=[];for(let c=0,u=n.rangeCount;c<u;c++){const d=n.getRangeAt(c);if(!d.collapsed)for(const{x:f,y:h,width:m,height:g}of d.getClientRects())m===0||g===0||l.push(s(f,h,m,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:n}){(this.#s||=new Map).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){this.#s?.delete(e)}renderAnnotationElement(e){const n=this.#s?.get(e.data.id);if(!n)return;const r=this.#i.getRawValue(n);r&&(this.#C===Bn.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}}class Ju{#e=null;#t=!1;#n=null;#r=null;#o=null;#i=null;#s=!1;#l=null;#u=null;#c=null;#d=null;#a=!1;static#f=null;static _l10n=null;constructor(e){this.#u=e,this.#a=e._uiManager.useNewAltTextFlow,Ju.#f||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Ju._l10n??=e}async render(){const e=this.#n=document.createElement("button");e.className="altText",e.tabIndex="0";const n=this.#r=document.createElement("span");e.append(n),this.#a?(e.classList.add("new"),e.setAttribute("data-l10n-id",Ju.#f.missing),n.setAttribute("data-l10n-id",Ju.#f["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=this.#u._uiManager._signal;e.addEventListener("contextmenu",Vl,{signal:r}),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:r});const i=o=>{o.preventDefault(),this.#u._uiManager.editAltText(this.#u),this.#a&&this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#p}})};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(this.#s=!0,i(o))},{signal:r}),await this.#h(),e}get#p(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#a?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#a?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#d=await Ju._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#h())}toggleAltTextBadge(e=!1){if(!this.#a||this.#e){this.#l?.remove(),this.#l=null;return}if(!this.#l){const n=this.#l=document.createElement("div");n.className="noAltTextBadge",this.#u.div.append(n)}this.#l.classList.toggle("hidden",!e)}serialize(e){let n=this.#e;return!e&&this.#c===n&&(n=this.#d),{altText:n,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#d}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:n,guessedText:r,textWithDisclaimer:i,cancel:o=!1}){r&&(this.#c=r,this.#d=i),!(this.#e===e&&this.#t===n)&&(o||(this.#e=e,this.#t=n),this.#h())}toggle(e=!1){this.#n&&(!e&&this.#i&&(clearTimeout(this.#i),this.#i=null),this.#n.disabled=!e)}shown(){this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#o=null,this.#l?.remove(),this.#l=null}async#h(){const e=this.#n;if(!e)return;if(this.#a){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",Ju.#f[this.#p]),this.#r?.setAttribute("data-l10n-id",Ju.#f[`${this.#p}-label`]),!this.#e){this.#o?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#o?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=this.#o;if(!n){this.#o=n=document.createElement("span"),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${this.#u.id}`;const i=100,o=this.#u._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(this.#i),this.#i=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#i=setTimeout(()=>{this.#i=null,this.#o.classList.add("show"),this.#u._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:o}),e.addEventListener("mouseleave",()=>{this.#i&&(clearTimeout(this.#i),this.#i=null),this.#o?.classList.remove("show")},{signal:o})}this.#t?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=this.#e),n.parentNode||e.append(n),this.#u.getImageForAltText()?.setAttribute("aria-describedby",n.id)}}class _n{#e=null;#t=null;#n=null;#r=!1;#o=!1;#i=null;#s=null;#l=null;#u="";#c=!1;#d=null;#a=!1;#f=!1;#p=!1;#h=null;#v=0;#m=0;#g=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#b=!1;#x=_n._zIndex++;static _borderLineWidth=-1;static _colorManager=new n9;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=_n.prototype._resizeWithKeyboard,n=dp.TRANSLATE_SMALL,r=dp.TRANSLATE_BIG;return ir(this,"_resizerKeyboardManager",new u1([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],_n.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:n,rawDims:{pageWidth:r,pageHeight:i,pageX:o,pageY:a}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[o,a];const[s,l]=this.parentDimensions;this.x=e.x/s,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return ir(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new J$e({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n){if(_n._l10n??=e,_n._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),_n._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);_n._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Si("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#b}set _isDraggable(e){this.#b=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(e*2),this.y+=this.width*e/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(e*2),this.y-=this.width*e/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#x}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#L(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#c?this.#c=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,n,r,i){const[o,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(e+r)/o,this.y=(n+i)/a,this.fixAndSetPosition()}#T([e,n],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/e,this.y+=i/n,this.fixAndSetPosition()}translate(e,n){this.#T(this.parentDimensions,e,n)}translateInPage(e,n){this.#d||=[this.x,this.y],this.#T(this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}drag(e,n){this.#d||=[this.x,this.y];const[r,i]=this.parentDimensions;if(this.x+=e/r,this.y+=n/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:c,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:a}=this;const[s,l]=this.getBaseTranslation();o+=s,a+=l,this.div.style.left=`${(100*o).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#d&&(this.#d[0]!==this.x||this.#d[1]!==this.y)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=_n,i=r/e,o=r/n;switch(this.rotation){case 90:return[-i,o];case 180:return[i,o];case 270:return[i,-o];default:return[-i,-o]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[n,r]=this.pageDimensions;let{x:i,y:o,width:a,height:s}=this;if(a*=n,s*=r,i*=n,o*=r,this._mustFixPosition)switch(e){case 0:i=Math.max(0,Math.min(n-a,i)),o=Math.max(0,Math.min(r-s,o));break;case 90:i=Math.max(0,Math.min(n-s,i)),o=Math.min(r,Math.max(a,o));break;case 180:i=Math.min(n,Math.max(a,i)),o=Math.min(r,Math.max(s,o));break;case 270:i=Math.min(n,Math.max(s,i)),o=Math.max(0,Math.min(r-a,o));break}this.x=i/=n,this.y=o/=r;const[l,c]=this.getBaseTranslation();i+=l,o+=c;const{style:u}=this.div;u.left=`${(100*i).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}static#E(e,n,r){switch(r){case 90:return[n,-e];case 180:return[-e,-n];case 270:return[-n,e];default:return[e,n]}}screenToPageTranslation(e,n){return _n.#E(e,n,this.parentRotation)}pageTranslationToScreen(e,n){return _n.#E(e,n,360-this.parentRotation)}#S(e){switch(e){case 90:{const[n,r]=this.pageDimensions;return[0,-n/r,r/n,0]}case 180:return[-1,0,0,-1];case 270:{const[n,r]=this.pageDimensions;return[0,n/r,-r/n,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:e,pageDimensions:[n,r]}=this;return[n*e,r*e]}setDims(e,n){const[r,i]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,this.#o||(this.div.style.height=`${(100*n/i).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:n,width:r}=e,i=r.endsWith("%"),o=!this.#o&&n.endsWith("%");if(i&&o)return;const[a,s]=this.parentDimensions;i||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),!this.#o&&!o&&(e.height=`${(100*parseFloat(n)/s).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#N(){if(this.#i)return;this.#i=document.createElement("div"),this.#i.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],n=this._uiManager._signal;for(const r of e){const i=document.createElement("div");this.#i.append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",this.#A.bind(this,r),{signal:n}),i.addEventListener("contextmenu",Vl,{signal:n}),i.tabIndex=-1}this.div.prepend(this.#i)}#A(e,n){n.preventDefault();const{isMac:r}=es.platform;if(n.button!==0||n.ctrlKey&&r)return;this.#n?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1;const o=new AbortController,a=this._uiManager.combinedSignal(o);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#D.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("contextmenu",Vl,{signal:a});const s=this.x,l=this.y,c=this.width,u=this.height,d=this.parent.div.style.cursor,f=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const h=()=>{o.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=d,this.div.style.cursor=f,this.#w(s,l,c,u)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})}#w(e,n,r,i){const o=this.x,a=this.y,s=this.width,l=this.height;o===e&&a===n&&s===r&&l===i||this.addCommands({cmd:()=>{this.width=s,this.height=l,this.x=o,this.y=a;const[c,u]=this.parentDimensions;this.setDims(c*s,u*l),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=i,this.x=e,this.y=n;const[c,u]=this.parentDimensions;this.setDims(c*r,u*i),this.fixAndSetPosition()},mustExec:!0})}#D(e,n){const[r,i]=this.parentDimensions,o=this.x,a=this.y,s=this.width,l=this.height,c=_n.MIN_SIZE/r,u=_n.MIN_SIZE/i,d=$=>Math.round($*1e4)/1e4,f=this.#S(this.rotation),h=($,N)=>[f[0]*$+f[2]*N,f[1]*$+f[3]*N],m=this.#S(360-this.rotation),g=($,N)=>[m[0]*$+m[2]*N,m[1]*$+m[3]*N];let v,b,y=!1,x=!1;switch(e){case"topLeft":y=!0,v=($,N)=>[0,0],b=($,N)=>[$,N];break;case"topMiddle":v=($,N)=>[$/2,0],b=($,N)=>[$/2,N];break;case"topRight":y=!0,v=($,N)=>[$,0],b=($,N)=>[0,N];break;case"middleRight":x=!0,v=($,N)=>[$,N/2],b=($,N)=>[0,N/2];break;case"bottomRight":y=!0,v=($,N)=>[$,N],b=($,N)=>[0,0];break;case"bottomMiddle":v=($,N)=>[$/2,N],b=($,N)=>[$/2,0];break;case"bottomLeft":y=!0,v=($,N)=>[0,N],b=($,N)=>[$,0];break;case"middleLeft":x=!0,v=($,N)=>[0,N/2],b=($,N)=>[$,N/2];break}const w=v(s,l),C=b(s,l);let E=h(...C);const S=d(o+E[0]),T=d(a+E[1]);let A=1,R=1,[P,_]=this.screenToPageTranslation(n.movementX,n.movementY);if([P,_]=g(P/r,_/i),y){const $=Math.hypot(s,l);A=R=Math.max(Math.min(Math.hypot(C[0]-w[0]-P,C[1]-w[1]-_)/$,1/s,1/l),c/s,u/l)}else x?A=Math.max(c,Math.min(1,Math.abs(C[0]-w[0]-P)))/s:R=Math.max(u,Math.min(1,Math.abs(C[1]-w[1]-_)))/l;const I=d(s*A),k=d(l*R);E=h(...b(I,k));const F=S-E[0],L=T-E[1];this.width=I,this.height=k,this.x=F,this.y=L,this.setDims(r*I,i*k),this.fixAndSetPosition()}altTextFinish(){this.#n?.finish()}async addEditToolbar(){return this._editToolbar||this.#f?this._editToolbar:(this._editToolbar=new Ww(this),this.div.append(this._editToolbar.render()),this.#n&&await this._editToolbar.addAltText(this.#n),this._editToolbar)}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#n?.destroy())}addContainer(e){const n=this._editToolbar?.div;n?n.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#n||(Ju.initialize(_n._l10n),this.#n=new Ju(this),this.#e&&(this.#n.data=this.#e,this.#e=null),await this.addEditToolbar())}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}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.#r?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#P();const[e,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/n).toFixed(2)}%`);const[r,i]=this.getInitialTranslation();return this.translate(r,i),UD(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:n}=es.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if(this.#c=!0,this._isDraggable){this.#_(e);return}this.#k(e)}get isSelected(){return this._uiManager.isSelected(this)}#k(e){const{isMac:n}=es.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}#_(e){const{isSelected:n}=this;this._uiManager.setUpDragSession();const r=new AbortController,i=this._uiManager.combinedSignal(r);if(n){this.div.classList.add("moving"),this.#v=e.clientX,this.#m=e.clientY;const a=s=>{const{clientX:l,clientY:c}=s,[u,d]=this.screenToPageTranslation(l-this.#v,c-this.#m);this.#v=l,this.#m=c,this._uiManager.dragSelectedEditors(u,d)};window.addEventListener("pointermove",a,{passive:!0,capture:!0,signal:i})}const o=()=>{r.abort(),n&&this.div.classList.remove("moving"),this.#c=!1,this._uiManager.endDragSession()||this.#k(e)};window.addEventListener("pointerup",o,{signal:i}),window.addEventListener("blur",o,{signal:i})}moveInDOM(){this.#h&&clearTimeout(this.#h),this.#h=setTimeout(()=>{this.#h=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,n,r){e.changeParent(this),this.x=n,this.y=r,this.fixAndSetPosition()}getRect(e,n,r=this.rotation){const i=this.parentScale,[o,a]=this.pageDimensions,[s,l]=this.pageTranslation,c=e/i,u=n/i,d=this.x*o,f=this.y*a,h=this.width*o,m=this.height*a;switch(r){case 0:return[d+c+s,a-f-u-m+l,d+c+h+s,a-f-u+l];case 90:return[d+u+s,a-f+c+l,d+u+m+s,a-f+c+h+l];case 180:return[d-c-h+s,a-f+u+l,d-c+s,a-f+u+m+l];case 270:return[d-u-m+s,a-f-c-h+l,d-u+s,a-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,i,o,a]=e,s=o-r,l=a-i;switch(this.rotation){case 0:return[r,n-a,s,l];case 90:return[r,n-i,l,s];case 180:return[o,n-i,s,l];case 270:return[o,n-a,l,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return this.#p}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#P(){if(this.#l||!this.div)return;this.#l=new AbortController;const e=this._uiManager.combinedSignal(this.#l);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#P()}rotate(e){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,n=null){Si("An editor must be serializable")}static async deserialize(e,n,r){const i=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:r});i.rotation=e.rotation,i.#e=e.accessibilityData;const[o,a]=i.pageDimensions,[s,l,c,u]=i.getRectInCurrentCoords(e.rect,a);return i.x=s/o,i.y=l/a,i.width=c/o,i.height=u/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#l?.abort(),this.#l=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#h&&(clearTimeout(this.#h),this.#h=null),this.#L(),this.removeEditToolbar(),this.#g){for(const e of this.#g.values())clearTimeout(e);this.#g=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#N(),this.#i.classList.remove("hidden"),UD(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#s={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const n=this.#i.children;if(!this.#t){this.#t=Array.from(n);const a=this.#C.bind(this),s=this.#y.bind(this),l=this._uiManager._signal;for(const c of this.#t){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",s,{signal:l}),c.addEventListener("focus",this.#R.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",_n._l10nResizer[u])}}const r=this.#t[0];let i=0;for(const a of n){if(a===r)break;i++}const o=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(o!==i){if(o<i)for(let s=0;s<i-o;s++)this.#i.append(this.#i.firstChild);else if(o>i)for(let s=0;s<o-i;s++)this.#i.firstChild.before(this.#i.lastChild);let a=0;for(const s of n){const c=this.#t[a++].getAttribute("data-resizer-name");s.setAttribute("data-l10n-id",_n._l10nResizer[c])}}this.#I(0),this.#p=!0,this.#i.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#C(e){_n._resizerKeyboardManager.exec(this,e)}#y(e){this.#p&&e.relatedTarget?.parentNode!==this.#i&&this.#L()}#R(e){this.#u=this.#p?e:""}#I(e){if(this.#t)for(const n of this.#t)n.tabIndex=e}_resizeWithKeyboard(e,n){this.#p&&this.#D(this.#u,{movementX:e,movementY:n})}#L(){if(this.#p=!1,this.#I(-1),this.#s){const{savedX:e,savedY:n,savedWidth:r,savedHeight:i}=this.#s;this.#w(e,n,r,i),this.#s=null}}_stopResizingWithKeyboard(){this.#L(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}unselect(){this.#i?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0)}updateParams(e,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#a}set isEditing(e){this.#a=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,n){this.#o=!0;const r=e/n,{style:i}=this.div;i.aspectRatio=r,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,n=!1){if(n){this.#g||=new Map;const{action:r}=e;let i=this.#g.get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#g.delete(r),this.#g.size===0&&(this.#g=null)},_n._telemetryTimeout),this.#g.set(r,i);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#r=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#r=!0}renderAnnotationElement(e){let n=e.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),e.container.prepend(n);else if(n.nodeName==="CANVAS"){const r=n;n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),r.before(n)}return n}resetAnnotationElement(e){const{firstChild:n}=e.container;n?.nodeName==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}}class J$e extends _n{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const WG=3285377520,jl=4294901760,Ou=65535;class HG{constructor(e){this.h1=e?e&4294967295:WG,this.h2=e?e&4294967295:WG}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let g=0,v=e.length;g<v;g++){const b=e.charCodeAt(g);b<=255?n[r++]=b:(n[r++]=b>>>8,n[r++]=b&255)}}else if(ArrayBuffer.isView(e))n=e.slice(),r=n.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=r>>2,o=r-i*4,a=new Uint32Array(n.buffer,0,i);let s=0,l=0,c=this.h1,u=this.h2;const d=3432918353,f=461845907,h=d&Ou,m=f&Ou;for(let g=0;g<i;g++)g&1?(s=a[g],s=s*d&jl|s*h&Ou,s=s<<15|s>>>17,s=s*f&jl|s*m&Ou,c^=s,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[g],l=l*d&jl|l*h&Ou,l=l<<15|l>>>17,l=l*f&jl|l*m&Ou,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(s=0,o){case 3:s^=n[i*4+2]<<16;case 2:s^=n[i*4+1]<<8;case 1:s^=n[i*4],s=s*d&jl|s*h&Ou,s=s<<15|s>>>17,s=s*f&jl|s*m&Ou,i&1?c^=s:u^=s}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&jl|e*36045&Ou,n=n*4283543511&jl|((n<<16|e>>>16)*2950163797&jl)>>>16,e^=n>>>1,e=e*444984403&jl|e*60499&Ou,n=n*3301882366&jl|((n<<16|e>>>16)*3120437893&jl)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const _I=Object.freeze({map:null,hash:"",transfer:void 0});class MI{#e=!1;#t=null;#n=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const r=this.#n.get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return this.#n.get(e)}remove(e){if(this.#n.delete(e),this.#n.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of this.#n.values())if(n instanceof _n)return;this.onAnnotationEditor(null)}}setValue(e,n){const r=this.#n.get(e);let i=!1;if(r!==void 0)for(const[o,a]of Object.entries(n))r[o]!==a&&(i=!0,r[o]=a);else i=!0,this.#n.set(e,n);i&&this.#r(),n instanceof _n&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(e){return this.#n.has(e)}getAll(){return this.#n.size>0?wI(this.#n):null}setAll(e){for(const[n,r]of Object.entries(e))this.setValue(n,r)}get size(){return this.#n.size}#r(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new VG(this)}get serializable(){if(this.#n.size===0)return _I;const e=new Map,n=new HG,r=[],i=Object.create(null);let o=!1;for(const[a,s]of this.#n){const l=s instanceof _n?s.serialize(!1,i):s;l&&(e.set(a,l),n.update(`${a}:${JSON.stringify(l)}`),o||=!!l.bitmap)}if(o)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:_I}get editorStats(){let e=null;const n=new Map;for(const r of this.#n.values()){if(!(r instanceof _n))continue;const i=r.telemetryFinalData;if(!i)continue;const{type:o}=i;n.has(o)||n.set(o,Object.getPrototypeOf(r).constructor),e||=Object.create(null);const a=e[o]||=new Map;for(const[s,l]of Object.entries(i)){if(s==="type")continue;let c=a.get(s);c||(c=new Map,a.set(s,c));const u=c.get(l)??0;c.set(l,u+1)}}for(const[r,i]of n)e[r]=i.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;const e=[];for(const n of this.#n.values())!(n instanceof _n)||!n.annotationElementId||!n.serialize()||e.push(n.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}}class VG extends MI{#e;constructor(e){super();const{map:n,hash:r,transfer:i}=e.serializable,o=structuredClone(n,i?{transfer:i}:null);this.#e={map:o,hash:r,transfer:i}}get print(){Si("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return ir(this,"modifiedIds",{ids:new Set,hash:""})}}class Q$e{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const n=this.styleElement.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Oo(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:i,style:o}=e,a=new FontFace(r,i,o);this.addNativeFontFace(a);try{await a.load(),this.#e.add(r),n?.(e)}catch{Vn(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Si("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw Vn(`Failed to load font '${r.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return ir(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(ka||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),ir(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for(Oo(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){const o=r.shift();setTimeout(o.callback,0)}}const{loadingRequests:r}=this,i={done:!1,complete:n,callback:e};return r.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ir(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function r(w,C){return w.charCodeAt(C)<<24|w.charCodeAt(C+1)<<16|w.charCodeAt(C+2)<<8|w.charCodeAt(C+3)&255}function i(w,C,E,S){const T=w.substring(0,C),A=w.substring(C+E);return T+S+A}let o,a;const s=this._document.createElement("canvas");s.width=1,s.height=1;const l=s.getContext("2d");let c=0;function u(w,C){if(++c>30){Vn("Load test font never loaded."),C();return}if(l.font="30px "+w,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(u.bind(null,w,C))}const d=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=i(f,976,d.length,d);const m=16,g=1482184792;let v=r(f,m);for(o=0,a=d.length-3;o<a;o+=4)v=v-g+r(d,o)|0;o<d.length&&(v=v-g+r(d+"XXX",o)|0),f=i(f,m,4,F$e(v));const b=`url(data:font/opentype;base64,${btoa(f)});`,y=`@font-face {font-family:"${d}";src:${b}}`;this.insertRule(y);const x=this._document.createElement("div");x.style.visibility="hidden",x.style.width=x.style.height="10px",x.style.position="absolute",x.style.top=x.style.left="0px";for(const w of[e.loadedName,d]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=w,x.append(C)}this._document.body.append(x),u(d,()=>{x.remove(),n.complete()})}}class eze{constructor(e,{disableFontFace:n=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const i in e)this[i]=e[i];this.disableFontFace=n===!0,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${H$e(this.data)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${e}}`}return this._inspectFont?.(this,e),n}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let r;try{r=e.get(this.loadedName+"_path_"+n)}catch(o){Vn(`getPathGenerator - ignoring character: "${o}".`)}if(!Array.isArray(r)||r.length===0)return this.compiledGlyphs[n]=function(o,a){};const i=[];for(let o=0,a=r.length;o<a;)switch(r[o++]){case Td.BEZIER_CURVE_TO:{const[s,l,c,u,d,f]=r.slice(o,o+6);i.push(h=>h.bezierCurveTo(s,l,c,u,d,f)),o+=6}break;case Td.MOVE_TO:{const[s,l]=r.slice(o,o+2);i.push(c=>c.moveTo(s,l)),o+=2}break;case Td.LINE_TO:{const[s,l]=r.slice(o,o+2);i.push(c=>c.lineTo(s,l)),o+=2}break;case Td.QUADRATIC_CURVE_TO:{const[s,l,c,u]=r.slice(o,o+4);i.push(d=>d.quadraticCurveTo(s,l,c,u)),o+=4}break;case Td.RESTORE:i.push(s=>s.restore());break;case Td.SAVE:i.push(s=>s.save());break;case Td.SCALE:Oo(i.length===2,"Scale command is only valid at the third position.");break;case Td.TRANSFORM:{const[s,l,c,u,d,f]=r.slice(o,o+6);i.push(h=>h.transform(s,l,c,u,d,f)),o+=6}break;case Td.TRANSLATE:{const[s,l]=r.slice(o,o+2);i.push(c=>c.translate(s,l)),o+=2}break}return this.compiledGlyphs[n]=function(a,s){i[0](a),i[1](a),a.scale(s,-s);for(let l=2,c=i.length;l<c;l++)i[l](a)}}}class jG{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,n){if(e<=0||n<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,n);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,n,r){if(!e.canvas)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=n,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){Si("Abstract method `_createCanvas` called.")}}class tze extends jG{constructor({ownerDocument:e=globalThis.document,enableHWA:n=!1}){super({enableHWA:n}),this._document=e}_createCanvas(e,n){const r=this._document.createElement("canvas");return r.width=e,r.height=n,r}}class YG{constructor({baseUrl:e=null,isCompressed:n=!0}){this.baseUrl=e,this.isCompressed=n}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(n).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}async _fetch(e){Si("Abstract method `_fetch` called.")}}class qG extends YG{async _fetch(e){const n=await $D(e,this.isCompressed?"arraybuffer":"text");return n instanceof ArrayBuffer?new Uint8Array(n):BD(n)}}class GG{addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,r,i,o){return"none"}destroy(e=!1){}}class nze extends GG{#e;#t;#n;#r;#o;#i;#s=0;constructor({docId:e,ownerDocument:n=globalThis.document}){super(),this.#r=e,this.#o=n}get#l(){return this.#t||=new Map}get#u(){return this.#i||=new Map}get#c(){if(!this.#n){const e=this.#o.createElement("div"),{style:n}=e;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const r=this.#o.createElementNS(Ad,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#n=this.#o.createElementNS(Ad,"defs"),e.append(r),r.append(this.#n),this.#o.body.append(e)}return this.#n}#d(e){if(e.length===1){const l=e[0],c=new Array(256);for(let d=0;d<256;d++)c[d]=l[d]/255;const u=c.join(",");return[u,u,u]}const[n,r,i]=e,o=new Array(256),a=new Array(256),s=new Array(256);for(let l=0;l<256;l++)o[l]=n[l]/255,a[l]=r[l]/255,s[l]=i[l]/255;return[o.join(","),a.join(","),s.join(",")]}#a(e){if(this.#e===void 0){this.#e="";const n=this.#o.URL;n!==this.#o.baseURI&&(zD(n)?Vn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=n.split("#",1)[0])}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let n=this.#l.get(e);if(n)return n;const[r,i,o]=this.#d(e),a=e.length===1?r:`${r}${i}${o}`;if(n=this.#l.get(a),n)return this.#l.set(e,n),n;const s=`g_${this.#r}_transfer_map_${this.#s++}`,l=this.#a(s);this.#l.set(e,l),this.#l.set(a,l);const c=this.#h(s);return this.#m(r,i,o,c),l}addHCMFilter(e,n){const r=`${e}-${n}`,i="base";let o=this.#u.get(i);if(o?.key===r||(o?(o.filter?.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},this.#u.set(i,o)),!e||!n))return o.url;const a=this.#b(e);e=un.makeHexColor(...a);const s=this.#b(n);if(n=un.makeHexColor(...s),this.#c.style.color="",e==="#000000"&&n==="#ffffff"||e===n)return o.url;const l=new Array(256);for(let h=0;h<=255;h++){const m=h/255;l[h]=m<=.03928?m/12.92:((m+.055)/1.055)**2.4}const c=l.join(","),u=`g_${this.#r}_hcm_filter`,d=o.filter=this.#h(u);this.#m(c,c,c,d),this.#p(d);const f=(h,m)=>{const g=a[h]/255,v=s[h]/255,b=new Array(m+1);for(let y=0;y<=m;y++)b[y]=g+y/m*(v-g);return b.join(",")};return this.#m(f(0,5),f(1,5),f(2,5),d),o.url=this.#a(u),o.url}addAlphaFilter(e){let n=this.#l.get(e);if(n)return n;const[r]=this.#d([e]),i=`alpha_${r}`;if(n=this.#l.get(i),n)return this.#l.set(e,n),n;const o=`g_${this.#r}_alpha_map_${this.#s++}`,a=this.#a(o);this.#l.set(e,a),this.#l.set(i,a);const s=this.#h(o);return this.#g(r,s),a}addLuminosityFilter(e){let n=this.#l.get(e||"luminosity");if(n)return n;let r,i;if(e?([r]=this.#d([e]),i=`luminosity_${r}`):i="luminosity",n=this.#l.get(i),n)return this.#l.set(e,n),n;const o=`g_${this.#r}_luminosity_map_${this.#s++}`,a=this.#a(o);this.#l.set(e,a),this.#l.set(i,a);const s=this.#h(o);return this.#f(s),e&&this.#g(r,s),a}addHighlightHCMFilter(e,n,r,i,o){const a=`${n}-${r}-${i}-${o}`;let s=this.#u.get(e);if(s?.key===a||(s?(s.filter?.remove(),s.key=a,s.url="none",s.filter=null):(s={key:a,url:"none",filter:null},this.#u.set(e,s)),!n||!r))return s.url;const[l,c]=[n,r].map(this.#b.bind(this));let u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,h]=[i,o].map(this.#b.bind(this));d<u&&([u,d,f,h]=[d,u,h,f]),this.#c.style.color="";const m=(b,y,x)=>{const w=new Array(256),C=(d-u)/x,E=b/255,S=(y-b)/(255*x);let T=0;for(let A=0;A<=x;A++){const R=Math.round(u+A*C),P=E+A*S;for(let _=T;_<=R;_++)w[_]=P;T=R+1}for(let A=T;A<256;A++)w[A]=w[T-1];return w.join(",")},g=`g_${this.#r}_hcm_${e}_filter`,v=s.filter=this.#h(g);return this.#p(v),this.#m(m(f[0],h[0],5),m(f[1],h[1],5),m(f[2],h[2],5),v),s.url=this.#a(g),s.url}destroy(e=!1){e&&this.#u.size!==0||(this.#n&&(this.#n.parentNode.parentNode.remove(),this.#n=null),this.#t&&(this.#t.clear(),this.#t=null),this.#s=0)}#f(e){const n=this.#o.createElementNS(Ad,"feColorMatrix");n.setAttribute("type","matrix"),n.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"),e.append(n)}#p(e){const n=this.#o.createElementNS(Ad,"feColorMatrix");n.setAttribute("type","matrix"),n.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"),e.append(n)}#h(e){const n=this.#o.createElementNS(Ad,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",e),this.#c.append(n),n}#v(e,n,r){const i=this.#o.createElementNS(Ad,n);i.setAttribute("type","discrete"),i.setAttribute("tableValues",r),e.append(i)}#m(e,n,r,i){const o=this.#o.createElementNS(Ad,"feComponentTransfer");i.append(o),this.#v(o,"feFuncR",e),this.#v(o,"feFuncG",n),this.#v(o,"feFuncB",r)}#g(e,n){const r=this.#o.createElementNS(Ad,"feComponentTransfer");n.append(r),this.#v(r,"feFuncA",e)}#b(e){return this.#c.style.color=e,AI(getComputedStyle(this.#c).getPropertyValue("color"))}}class XG{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetch(n).catch(r=>{throw new Error(`Unable to load font data at: ${n}`)})}async _fetch(e){Si("Abstract method `_fetch` called.")}}class KG extends XG{async _fetch(e){const n=await $D(e,"arraybuffer");return new Uint8Array(n)}}if(ka){var OI=Promise.withResolvers(),PI=null;(async()=>{const e=await import("./_node-resolve_empty-DLcK68Hd.js"),n=await import("./_node-resolve_empty-DLcK68Hd.js"),r=await import("./_node-resolve_empty-DLcK68Hd.js"),i=await import("./_node-resolve_empty-DLcK68Hd.js");let o,a;return new Map(Object.entries({fs:e,http:n,https:r,url:i,canvas:o,path2d:a}))})().then(e=>{PI=e,OI.resolve()},e=>{Vn(`loadPackages: ${e}`),PI=new Map,OI.resolve()})}class sh{static get promise(){return OI.promise}static get(e){return PI?.get(e)}}async function ZG(t){const n=await sh.get("fs").promises.readFile(t);return new Uint8Array(n)}class rze extends GG{}class ize extends jG{_createCanvas(e,n){return sh.get("canvas").createCanvas(e,n)}}class oze extends YG{async _fetch(e){return ZG(e)}}class aze extends XG{async _fetch(e){return ZG(e)}}const ts={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function RI(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,r),t.clip(i)}class II{getPattern(){Si("Abstract method `getPattern` called.")}}class sze extends II{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)n.addColorStop(r[0],r[1]);return n}getPattern(e,n,r,i){let o;if(i===ts.STROKE||i===ts.FILL){const a=n.current.getClippedPathBoundingBox(i,$i(e))||[0,0,0,0],s=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=n.cachedCanvases.getCanvas("pattern",s,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),r=un.transform(r,[1,0,0,1,a[0],a[1]]),u.transform(...n.baseTransform),this.matrix&&u.transform(...this.matrix),RI(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),o=e.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(r);o.setTransform(d)}else RI(e,this._bbox),o=this._createGradient(e);return o}}function NI(t,e,n,r,i,o,a,s){const l=e.coords,c=e.colors,u=t.data,d=t.width*4;let f;l[n+1]>l[r+1]&&(f=n,n=r,r=f,f=o,o=a,a=f),l[r+1]>l[i+1]&&(f=r,r=i,i=f,f=a,a=s,s=f),l[n+1]>l[r+1]&&(f=n,n=r,r=f,f=o,o=a,a=f);const h=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,v=(l[r+1]+e.offsetY)*e.scaleY,b=(l[i]+e.offsetX)*e.scaleX,y=(l[i+1]+e.offsetY)*e.scaleY;if(m>=y)return;const x=c[o],w=c[o+1],C=c[o+2],E=c[a],S=c[a+1],T=c[a+2],A=c[s],R=c[s+1],P=c[s+2],_=Math.round(m),I=Math.round(y);let k,F,L,$,N,B,W,Y;for(let q=_;q<=I;q++){if(q<v){const ie=q<m?0:(m-q)/(m-v);k=h-(h-g)*ie,F=x-(x-E)*ie,L=w-(w-S)*ie,$=C-(C-T)*ie}else{let ie;q>y?ie=1:v===y?ie=0:ie=(v-q)/(v-y),k=g-(g-b)*ie,F=E-(E-A)*ie,L=S-(S-R)*ie,$=T-(T-P)*ie}let ee;q<m?ee=0:q>y?ee=1:ee=(m-q)/(m-y),N=h-(h-b)*ee,B=x-(x-A)*ee,W=w-(w-R)*ee,Y=C-(C-P)*ee;const Q=Math.round(Math.min(k,N)),J=Math.round(Math.max(k,N));let re=d*q+Q*4;for(let ie=Q;ie<=J;ie++)ee=(k-ie)/(k-N),ee<0?ee=0:ee>1&&(ee=1),u[re++]=F-(F-B)*ee|0,u[re++]=L-(L-W)*ee|0,u[re++]=$-($-Y)*ee|0,u[re++]=255}}function lze(t,e,n){const r=e.coords,i=e.colors;let o,a;switch(e.type){case"lattice":const s=e.verticesPerRow,l=Math.floor(r.length/s)-1,c=s-1;for(o=0;o<l;o++){let u=o*s;for(let d=0;d<c;d++,u++)NI(t,n,r[u],r[u+1],r[u+s],i[u],i[u+1],i[u+s]),NI(t,n,r[u+s+1],r[u+1],r[u+s],i[u+s+1],i[u+1],i[u+s])}break;case"triangles":for(o=0,a=r.length;o<a;o+=3)NI(t,n,r[o],r[o+1],r[o+2],i[o],i[o+1],i[o+2]);break;default:throw new Error("illegal figure")}}class cze extends II{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,n,r){const s=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-s,u=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3),h=c/d,m=u/f,g={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-l,scaleX:1/h,scaleY:1/m},v=d+4,b=f+4,y=r.getCanvas("mesh",v,b),x=y.context,w=x.createImageData(d,f);if(n){const E=w.data;for(let S=0,T=E.length;S<T;S+=4)E[S]=n[0],E[S+1]=n[1],E[S+2]=n[2],E[S+3]=255}for(const E of this._figures)lze(w,E,g);return x.putImageData(w,2,2),{canvas:y.canvas,offsetX:s-2*h,offsetY:l-2*m,scaleX:h,scaleY:m}}getPattern(e,n,r,i){RI(e,this._bbox);let o;if(i===ts.SHADING)o=un.singularValueDecompose2dScale($i(e));else if(o=un.singularValueDecompose2dScale(n.baseTransform),this.matrix){const s=un.singularValueDecompose2dScale(this.matrix);o=[o[0]*s[0],o[1]*s[1]]}const a=this._createMeshCanvas(o,i===ts.SHADING?null:this._background,n.cachedCanvases);return i!==ts.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class uze extends II{getPattern(){return"hotpink"}}function dze(t){switch(t[0]){case"RadialAxial":return new sze(t);case"Mesh":return new cze(t);case"Dummy":return new uze}throw new Error(`Unknown IR type: ${t[0]}`)}const JG={COLORED:1,UNCOLORED:2};class r9{static MAX_PATTERN_SIZE=3e3;constructor(e,n,r,i,o){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=n,this.ctx=r,this.canvasGraphicsFactory=i,this.baseTransform=o}createPatternCanvas(e){const{bbox:n,operatorList:r,paintType:i,tilingType:o,color:a,canvasGraphicsFactory:s}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),LD("TilingType: "+o);const u=n[0],d=n[1],f=n[2],h=n[3],m=f-u,g=h-d,v=un.singularValueDecompose2dScale(this.matrix),b=un.singularValueDecompose2dScale(this.baseTransform),y=v[0]*b[0],x=v[1]*b[1];let w=m,C=g,E=!1,S=!1;const T=Math.ceil(l*y),A=Math.ceil(c*x),R=Math.ceil(m*y),P=Math.ceil(g*x);T>=R?w=l:E=!0,A>=P?C=c:S=!0;const _=this.getSizeAndScale(w,this.ctx.canvas.width,y),I=this.getSizeAndScale(C,this.ctx.canvas.height,x),k=e.cachedCanvases.getCanvas("pattern",_.size,I.size),F=k.context,L=s.createCanvasGraphics(F);if(L.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(L,i,a),F.translate(-_.scale*u,-I.scale*d),L.transform(_.scale,0,0,I.scale,0,0),F.save(),this.clipBbox(L,u,d,f,h),L.baseTransform=$i(L.ctx),L.executeOperatorList(r),L.endDrawing(),F.restore(),E||S){const $=k.canvas;E&&(w=l),S&&(C=c);const N=this.getSizeAndScale(w,this.ctx.canvas.width,y),B=this.getSizeAndScale(C,this.ctx.canvas.height,x),W=N.size,Y=B.size,q=e.cachedCanvases.getCanvas("pattern-workaround",W,Y),ee=q.context,Q=E?Math.floor(m/l):0,J=S?Math.floor(g/c):0;for(let re=0;re<=Q;re++)for(let ie=0;ie<=J;ie++)ee.drawImage($,W*re,Y*ie,W,Y,0,0,W,Y);return{canvas:q.canvas,scaleX:N.scale,scaleY:B.scale,offsetX:u,offsetY:d}}return{canvas:k.canvas,scaleX:_.scale,scaleY:I.scale,offsetX:u,offsetY:d}}getSizeAndScale(e,n,r){const i=Math.max(r9.MAX_PATTERN_SIZE,n);let o=Math.ceil(e*r);return o>=i?o=i:r=o/e,{scale:r,size:o}}clipBbox(e,n,r,i,o){const a=i-n,s=o-r;e.ctx.rect(n,r,a,s),e.current.updateRectMinMax($i(e.ctx),[n,r,i,o]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,r){const i=e.ctx,o=e.current;switch(n){case JG.COLORED:const a=this.ctx;i.fillStyle=a.fillStyle,i.strokeStyle=a.strokeStyle,o.fillColor=a.fillStyle,o.strokeColor=a.strokeStyle;break;case JG.UNCOLORED:const s=un.makeHexColor(r[0],r[1],r[2]);i.fillStyle=s,i.strokeStyle=s,o.fillColor=s,o.strokeColor=s;break;default:throw new L$e(`Unsupported paint type: ${n}`)}}getPattern(e,n,r,i){let o=r;i!==ts.SHADING&&(o=un.transform(o,n.baseTransform),this.matrix&&(o=un.transform(o,this.matrix)));const a=this.createPatternCanvas(n);let s=new DOMMatrix(o);s=s.translate(a.offsetX,a.offsetY),s=s.scale(1/a.scaleX,1/a.scaleY);const l=e.createPattern(a.canvas,"repeat");return l.setTransform(s),l}}function fze({src:t,srcPos:e=0,dest:n,width:r,height:i,nonBlackColor:o=4294967295,inverseDecode:a=!1}){const s=es.isLittleEndian?4278190080:255,[l,c]=a?[o,s]:[s,o],u=r>>3,d=r&7,f=t.length;n=new Uint32Array(n.buffer);let h=0;for(let m=0;m<i;m++){for(const v=e+u;e<v;e++){const b=e<f?t[e]:255;n[h++]=b&128?c:l,n[h++]=b&64?c:l,n[h++]=b&32?c:l,n[h++]=b&16?c:l,n[h++]=b&8?c:l,n[h++]=b&4?c:l,n[h++]=b&2?c:l,n[h++]=b&1?c:l}if(d===0)continue;const g=e<f?t[e++]:255;for(let v=0;v<d;v++)n[h++]=g&1<<7-v?c:l}return{srcPos:e,destPos:h}}const QG=16,eX=100,hze=15,tX=10,nX=1e3,_s=16;function pze(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(r,i){e.translate(r,i),this.__originalTranslate(r,i)},t.scale=function(r,i){e.scale(r,i),this.__originalScale(r,i)},t.transform=function(r,i,o,a,s,l){e.transform(r,i,o,a,s,l),this.__originalTransform(r,i,o,a,s,l)},t.setTransform=function(r,i,o,a,s,l){e.setTransform(r,i,o,a,s,l),this.__originalSetTransform(r,i,o,a,s,l)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(r){e.rotate(r),this.__originalRotate(r)},t.clip=function(r){e.clip(r),this.__originalClip(r)},t.moveTo=function(n,r){e.moveTo(n,r),this.__originalMoveTo(n,r)},t.lineTo=function(n,r){e.lineTo(n,r),this.__originalLineTo(n,r)},t.bezierCurveTo=function(n,r,i,o,a,s){e.bezierCurveTo(n,r,i,o,a,s),this.__originalBezierCurveTo(n,r,i,o,a,s)},t.rect=function(n,r,i,o){e.rect(n,r,i,o),this.__originalRect(n,r,i,o)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class gze{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,r){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,n,r)):(i=this.canvasFactory.create(n,r),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function WD(t,e,n,r,i,o,a,s,l,c){const[u,d,f,h,m,g]=$i(t);if(d===0&&f===0){const y=a*u+m,x=Math.round(y),w=s*h+g,C=Math.round(w),E=(a+l)*u+m,S=Math.abs(Math.round(E)-x)||1,T=(s+c)*h+g,A=Math.abs(Math.round(T)-C)||1;return t.setTransform(Math.sign(u),0,0,Math.sign(h),x,C),t.drawImage(e,n,r,i,o,0,0,S,A),t.setTransform(u,d,f,h,m,g),[S,A]}if(u===0&&h===0){const y=s*f+m,x=Math.round(y),w=a*d+g,C=Math.round(w),E=(s+c)*f+m,S=Math.abs(Math.round(E)-x)||1,T=(a+l)*d+g,A=Math.abs(Math.round(T)-C)||1;return t.setTransform(0,Math.sign(d),Math.sign(f),0,x,C),t.drawImage(e,n,r,i,o,0,0,A,S),t.setTransform(u,d,f,h,m,g),[A,S]}t.drawImage(e,n,r,i,o,a,s,l,c);const v=Math.hypot(u,d),b=Math.hypot(f,h);return[v*l,b*c]}function mze(t){const{width:e,height:n}=t;if(e>nX||n>nX)return null;const r=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),o=e+1;let a=new Uint8Array(o*(n+1)),s,l,c;const u=e+7&-8;let d=new Uint8Array(u*n),f=0;for(const b of t.data){let y=128;for(;y>0;)d[f++]=b&y?0:255,y>>=1}let h=0;for(f=0,d[f]!==0&&(a[0]=1,++h),l=1;l<e;l++)d[f]!==d[f+1]&&(a[l]=d[f]?2:1,++h),f++;for(d[f]!==0&&(a[l]=2,++h),s=1;s<n;s++){f=s*u,c=s*o,d[f-u]!==d[f]&&(a[c]=d[f]?1:8,++h);let b=(d[f]?4:0)+(d[f-u]?8:0);for(l=1;l<e;l++)b=(b>>2)+(d[f+1]?4:0)+(d[f-u+1]?8:0),i[b]&&(a[c+l]=i[b],++h),f++;if(d[f-u]!==d[f]&&(a[c+l]=d[f]?2:4,++h),h>r)return null}for(f=u*(n-1),c=s*o,d[f]!==0&&(a[c]=8,++h),l=1;l<e;l++)d[f]!==d[f+1]&&(a[c+l]=d[f]?4:8,++h),f++;if(d[f]!==0&&(a[c+l]=4,++h),h>r)return null;const m=new Int32Array([0,o,-1,0,-o,0,0,0,1]),g=new Path2D;for(s=0;h&&s<=n;s++){let b=s*o;const y=b+e;for(;b<y&&!a[b];)b++;if(b===y)continue;g.moveTo(b%o,s);const x=b;let w=a[b];do{const C=m[w];do b+=C;while(!a[b]);const E=a[b];E!==5&&E!==10?(w=E,a[b]=0):(w=E&51*w>>4,a[b]&=w>>2|w<<2),g.lineTo(b%o,b/o|0),a[b]||--h}while(x!==b);--s}return d=null,a=null,function(b){b.save(),b.scale(1/e,-1/n),b.translate(0,-n),b.fill(g),b.beginPath(),b.restore()}}class rX{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=NG,this.textMatrixScale=1,this.fontMatrix=vI,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=_a.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,n])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,n){this.x=e,this.y=n}updatePathMinMax(e,n,r){[n,r]=un.applyTransform([n,r],e),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,n){const r=un.applyTransform(n,e),i=un.applyTransform(n.slice(2),e),o=un.applyTransform([n[0],n[3]],e),a=un.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,r[0],i[0],o[0],a[0]),this.minY=Math.min(this.minY,r[1],i[1],o[1],a[1]),this.maxX=Math.max(this.maxX,r[0],i[0],o[0],a[0]),this.maxY=Math.max(this.maxY,r[1],i[1],o[1],a[1])}updateScalingPathMinMax(e,n){un.scaleMinMax(e,n),this.minX=Math.min(this.minX,n[0]),this.minY=Math.min(this.minY,n[1]),this.maxX=Math.max(this.maxX,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(e,n,r,i,o,a,s,l,c,u){const d=un.bezierBoundingBox(n,r,i,o,a,s,l,c,u);u||this.updateRectMinMax(e,d)}getPathBoundingBox(e=ts.FILL,n=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===ts.STROKE){n||Si("Stroke bounding box must include transform.");const i=un.singularValueDecompose2dScale(n),o=i[0]*this.lineWidth/2,a=i[1]*this.lineWidth/2;r[0]-=o,r[1]-=a,r[2]+=o,r[3]+=a}return r}updateClipFromPath(){const e=un.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=ts.FILL,n=null){return un.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function iX(t,e){if(typeof ImageData<"u"&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,i=n%_s,o=(n-i)/_s,a=i===0?o:o+1,s=t.createImageData(r,_s);let l=0,c;const u=e.data,d=s.data;let f,h,m,g;if(e.kind===RD.GRAYSCALE_1BPP){const v=u.byteLength,b=new Uint32Array(d.buffer,0,d.byteLength>>2),y=b.length,x=r+7>>3,w=4294967295,C=es.isLittleEndian?4278190080:255;for(f=0;f<a;f++){for(m=f<o?_s:i,c=0,h=0;h<m;h++){const E=v-l;let S=0;const T=E>x?r:E*8-7,A=T&-8;let R=0,P=0;for(;S<A;S+=8)P=u[l++],b[c++]=P&128?w:C,b[c++]=P&64?w:C,b[c++]=P&32?w:C,b[c++]=P&16?w:C,b[c++]=P&8?w:C,b[c++]=P&4?w:C,b[c++]=P&2?w:C,b[c++]=P&1?w:C;for(;S<T;S++)R===0&&(P=u[l++],R=128),b[c++]=P&R?w:C,R>>=1}for(;c<y;)b[c++]=0;t.putImageData(s,0,f*_s)}}else if(e.kind===RD.RGBA_32BPP){for(h=0,g=r*_s*4,f=0;f<o;f++)d.set(u.subarray(l,l+g)),l+=g,t.putImageData(s,0,h),h+=_s;f<a&&(g=r*i*4,d.set(u.subarray(l,l+g)),t.putImageData(s,0,h))}else if(e.kind===RD.RGB_24BPP)for(m=_s,g=r*m,f=0;f<a;f++){for(f>=o&&(m=i,g=r*m),c=0,h=g;h--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;t.putImageData(s,0,f*_s)}else throw new Error(`bad image kind: ${e.kind}`)}function oX(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,i=n%_s,o=(n-i)/_s,a=i===0?o:o+1,s=t.createImageData(r,_s);let l=0;const c=e.data,u=s.data;for(let d=0;d<a;d++){const f=d<o?_s:i;({srcPos:l}=fze({src:c,srcPos:l,dest:u,width:r,height:f,nonBlackColor:0})),t.putImageData(s,0,d*_s)}}function d1(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function HD(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",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!ka){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function aX(t,e){if(e)return!0;const n=un.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*ab.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}const vze=["butt","round","square"],bze=["miter","round","bevel"],yze={},sX={};class Uy{constructor(e,n,r,i,o,{optionalContentConfig:a,markedContentStack:s=null},l,c){this.ctx=e,this.current=new rX(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=r,this.canvasFactory=i,this.filterFactory=o,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=s||[],this.optionalContentConfig=a,this.cachedCanvases=new gze(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,n=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):n}beginDrawing({transform:e,viewport:n,transparency:r=!1,background:i=null}){const o=this.ctx.canvas.width,a=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,o,a),this.ctx.fillStyle=s,r){const l=this.cachedCanvases.getCanvas("transparent",o,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...$i(this.compositeCtx))}this.ctx.save(),HD(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=$i(this.ctx)}executeOperatorList(e,n,r,i){const o=e.argsArray,a=e.fnArray;let s=n||0;const l=o.length;if(l===s)return s;const c=l-s>tX&&typeof r=="function",u=c?Date.now()+hze:0;let d=0;const f=this.commonObjs,h=this.objs;let m;for(;;){if(i!==void 0&&s===i.nextBreakPoint)return i.breakIt(s,r),s;if(m=a[s],m!==Lc.dependency)this[m].apply(this,o[s]);else for(const g of o[s]){const v=g.startsWith("g_")?f:h;if(!v.has(g))return v.get(g,r),s}if(s++,s===l)return s;if(c&&++d>tX){if(Date.now()>u)return r(),s;d=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}}_scaleImage(e,n){const r=e.width??e.displayWidth,i=e.height??e.displayHeight;let o=Math.max(Math.hypot(n[0],n[1]),1),a=Math.max(Math.hypot(n[2],n[3]),1),s=r,l=i,c="prescale1",u,d;for(;o>2&&s>1||a>2&&l>1;){let f=s,h=l;o>2&&s>1&&(f=s>=16384?Math.floor(s/2)-1||1:Math.ceil(s/2),o/=s/f),a>2&&l>1&&(h=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/h),u=this.cachedCanvases.getCanvas(c,f,h),d=u.context,d.clearRect(0,0,f,h),d.drawImage(e,0,0,s,l,0,0,f,h),e=u.canvas,s=f,l=h,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:s,paintHeight:l}}_createMaskCanvas(e){const n=this.ctx,{width:r,height:i}=e,o=this.current.fillColor,a=this.current.patternFill,s=$i(n);let l,c,u,d;if((e.bitmap||e.data)&&e.count>1){const T=e.bitmap||e.data.buffer;c=JSON.stringify(a?s:[s.slice(0,4),o]),l=this._cachedBitmapsMap.get(T),l||(l=new Map,this._cachedBitmapsMap.set(T,l));const A=l.get(c);if(A&&!a){const R=Math.round(Math.min(s[0],s[2])+s[4]),P=Math.round(Math.min(s[1],s[3])+s[5]);return{canvas:A,offsetX:R,offsetY:P}}u=A}u||(d=this.cachedCanvases.getCanvas("maskCanvas",r,i),oX(d.context,e));let f=un.transform(s,[1/r,0,0,-1/i,0,0]);f=un.transform(f,[1,0,0,1,0,-i]);const[h,m,g,v]=un.getAxialAlignedBoundingBox([0,0,r,i],f),b=Math.round(g-h)||1,y=Math.round(v-m)||1,x=this.cachedCanvases.getCanvas("fillCanvas",b,y),w=x.context,C=h,E=m;w.translate(-C,-E),w.transform(...f),u||(u=this._scaleImage(d.canvas,kd(w)),u=u.img,l&&a&&l.set(c,u)),w.imageSmoothingEnabled=aX($i(w),e.interpolate),WD(w,u,0,0,u.width,u.height,0,0,r,i),w.globalCompositeOperation="source-in";const S=un.transform(kd(w),[1,0,0,1,-C,-E]);return w.fillStyle=a?o.getPattern(n,this,S,ts.FILL):o,w.fillRect(0,0,r,i),l&&!a&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,x.canvas)),{canvas:x.canvas,offsetX:Math.round(C),offsetY:Math.round(E)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=vze[e]}setLineJoin(e){this.ctx.lineJoin=bze[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,r]of e)switch(n){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,n);this.suspendedCtx=this.ctx,this.ctx=i.context;const o=this.ctx;o.setTransform(...$i(this.suspendedCtx)),d1(this.suspendedCtx,o),pze(o,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(),d1(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,n,this.ctx,e),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(e,n,r,i){const o=i[0],a=i[1],s=i[2]-o,l=i[3]-a;s===0||l===0||(this.genericComposeSMask(n.context,r,s,l,n.subtype,n.backdrop,n.transferMap,o,a,n.offsetX,n.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,n,r,i,o,a,s,l,c,u,d){let f=e.canvas,h=l-u,m=c-d;if(a){const v=un.makeHexColor(...a);if(h<0||m<0||h+r>f.width||m+i>f.height){const b=this.cachedCanvases.getCanvas("maskExtension",r,i),y=b.context;y.drawImage(f,-h,-m),y.globalCompositeOperation="destination-atop",y.fillStyle=v,y.fillRect(0,0,r,i),y.globalCompositeOperation="source-over",f=b.canvas,h=m=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(h,m,r,i),e.clip(b),e.globalCompositeOperation="destination-atop",e.fillStyle=v,e.fillRect(h,m,r,i),e.restore()}}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),o==="Alpha"&&s?n.filter=this.filterFactory.addAlphaFilter(s):o==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(s));const g=new Path2D;g.rect(l,c,r,i),n.clip(g),n.globalCompositeOperation="destination-in",n.drawImage(f,h,m,r,i,l,c,r,i),n.restore()}save(){this.inSMaskMode?(d1(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),d1(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,r,i,o,a){this.ctx.transform(e,n,r,i,o,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,r){const i=this.ctx,o=this.current;let a=o.x,s=o.y,l,c;const u=$i(i),d=u[0]===0&&u[3]===0||u[1]===0&&u[2]===0,f=d?r.slice(0):null;for(let h=0,m=0,g=e.length;h<g;h++)switch(e[h]|0){case Lc.rectangle:a=n[m++],s=n[m++];const v=n[m++],b=n[m++],y=a+v,x=s+b;i.moveTo(a,s),v===0||b===0?i.lineTo(y,x):(i.lineTo(y,s),i.lineTo(y,x),i.lineTo(a,x)),d||o.updateRectMinMax(u,[a,s,y,x]),i.closePath();break;case Lc.moveTo:a=n[m++],s=n[m++],i.moveTo(a,s),d||o.updatePathMinMax(u,a,s);break;case Lc.lineTo:a=n[m++],s=n[m++],i.lineTo(a,s),d||o.updatePathMinMax(u,a,s);break;case Lc.curveTo:l=a,c=s,a=n[m+4],s=n[m+5],i.bezierCurveTo(n[m],n[m+1],n[m+2],n[m+3],a,s),o.updateCurvePathMinMax(u,l,c,n[m],n[m+1],n[m+2],n[m+3],a,s,f),m+=6;break;case Lc.curveTo2:l=a,c=s,i.bezierCurveTo(a,s,n[m],n[m+1],n[m+2],n[m+3]),o.updateCurvePathMinMax(u,l,c,a,s,n[m],n[m+1],n[m+2],n[m+3],f),a=n[m+2],s=n[m+3],m+=4;break;case Lc.curveTo3:l=a,c=s,a=n[m+2],s=n[m+3],i.bezierCurveTo(n[m],n[m+1],a,s,a,s),o.updateCurvePathMinMax(u,l,c,n[m],n[m+1],a,s,a,s,f),m+=4;break;case Lc.closePath:i.closePath();break}d&&o.updateScalingPathMinMax(u,f),o.setCurrentPoint(a,s)}closePath(){this.ctx.closePath()}stroke(e=!0){const n=this.ctx,r=this.current.strokeColor;n.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&r?.getPattern?(n.save(),n.strokeStyle=r.getPattern(n,this,kd(n),ts.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;let o=!1;i&&(n.save(),n.fillStyle=r.getPattern(n,this,kd(n),ts.FILL),o=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),o&&n.restore(),e&&this.consumePath(a)}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=yze}eoClip(){this.pendingClip=sX}beginText(){this.current.textMatrix=NG,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,n=this.ctx;if(e===void 0){n.beginPath();return}n.save(),n.beginPath();for(const r of e)n.setTransform(...r.transform),n.translate(r.x,r.y),r.addToPath(n,r.fontSize);n.restore(),n.clip(),n.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,n){const r=this.commonObjs.get(e),i=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=r.fontMatrix||vI,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&Vn("Invalid font matrix for font "+e),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;const o=r.loadedName||"sans-serif",a=r.systemFontInfo?.css||`"${o}", ${r.fallbackName}`;let s="normal";r.black?s="900":r.bold&&(s="bold");const l=r.italic?"italic":"normal";let c=n;n<QG?c=QG:n>eX&&(c=eX),this.current.fontSizeScale=n/c,this.ctx.font=`${l} ${s} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,n){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,n){this.setLeading(-n),this.moveText(e,n)}setTextMatrix(e,n,r,i,o,a){this.current.textMatrix=[e,n,r,i,o,a],this.current.textMatrixScale=Math.hypot(e,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,n,r,i){const o=this.ctx,a=this.current,s=a.font,l=a.textRenderingMode,c=a.fontSize/a.fontSizeScale,u=l&_a.FILL_STROKE_MASK,d=!!(l&_a.ADD_TO_PATH_FLAG),f=a.patternFill&&!s.missingFile;let h;(s.disableFontFace||d||f)&&(h=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace||f?(o.save(),o.translate(n,r),o.beginPath(),h(o,c),i&&o.setTransform(...i),(u===_a.FILL||u===_a.FILL_STROKE)&&o.fill(),(u===_a.STROKE||u===_a.FILL_STROKE)&&o.stroke(),o.restore()):((u===_a.FILL||u===_a.FILL_STROKE)&&o.fillText(e,n,r),(u===_a.STROKE||u===_a.FILL_STROKE)&&o.strokeText(e,n,r)),d&&(this.pendingTextPaths||=[]).push({transform:$i(o),x:n,y:r,fontSize:c,addToPath:h})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let r=!1;for(let i=3;i<n.length;i+=4)if(n[i]>0&&n[i]<255){r=!0;break}return ir(this,"isFontSubpixelAAEnabled",r)}showText(e){const n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(e);const i=n.fontSize;if(i===0)return;const o=this.ctx,a=n.fontSizeScale,s=n.charSpacing,l=n.wordSpacing,c=n.fontDirection,u=n.textHScale*c,d=e.length,f=r.vertical,h=f?1:-1,m=r.defaultVMetrics,g=i*n.fontMatrix[0],v=n.textRenderingMode===_a.FILL&&!r.disableFontFace&&!n.patternFill;o.save(),o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),c>0?o.scale(u,-1):o.scale(u,1);let b;if(n.patternFill){o.save();const E=n.fillColor.getPattern(o,this,kd(o),ts.FILL);b=$i(o),o.restore(),o.fillStyle=E}let y=n.lineWidth;const x=n.textMatrixScale;if(x===0||y===0){const E=n.textRenderingMode&_a.FILL_STROKE_MASK;(E===_a.STROKE||E===_a.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=x;if(a!==1&&(o.scale(a,a),y/=a),o.lineWidth=y,r.isInvalidPDFjsFont){const E=[];let S=0;for(const T of e)E.push(T.unicode),S+=T.width;o.fillText(E.join(""),0,0),n.x+=S*g*u,o.restore(),this.compose();return}let w=0,C;for(C=0;C<d;++C){const E=e[C];if(typeof E=="number"){w+=h*E*i/1e3;continue}let S=!1;const T=(E.isSpace?l:0)+s,A=E.fontChar,R=E.accent;let P,_,I=E.width;if(f){const F=E.vmetric||m,L=-(E.vmetric?F[1]:I*.5)*g,$=F[2]*g;I=F?-F[0]:I,P=L/a,_=(w+$)/a}else P=w/a,_=0;if(r.remeasure&&I>0){const F=o.measureText(A).width*1e3/i*a;if(I<F&&this.isFontSubpixelAAEnabled){const L=I/F;S=!0,o.save(),o.scale(L,1),P/=L}else I!==F&&(P+=(I-F)/2e3*i/a)}if(this.contentVisible&&(E.isInFont||r.missingFile)){if(v&&!R)o.fillText(A,P,_);else if(this.paintChar(A,P,_,b),R){const F=P+i*R.offset.x/a,L=_-i*R.offset.y/a;this.paintChar(R.fontChar,F,L,b)}}const k=f?I*g-T*c:I*g+T*c;w+=k,S&&o.restore()}f?n.y-=w:n.x+=w*u,o.restore(),this.compose()}showType3Text(e){const n=this.ctx,r=this.current,i=r.font,o=r.fontSize,a=r.fontDirection,s=i.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,u=r.textHScale*a,d=r.fontMatrix||vI,f=e.length,h=r.textRenderingMode===_a.INVISIBLE;let m,g,v,b;if(!(h||o===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...r.textMatrix),n.translate(r.x,r.y),n.scale(u,a),m=0;m<f;++m){if(g=e[m],typeof g=="number"){b=s*g*o/1e3,this.ctx.translate(b,0),r.x+=b*u;continue}const y=(g.isSpace?c:0)+l,x=i.charProcOperatorList[g.operatorListId];if(!x){Vn(`Type3 character "${g.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=g,this.save(),n.scale(o,o),n.transform(...d),this.executeOperatorList(x),this.restore()),v=un.applyTransform([g.width,0],d)[0]*o+y,n.translate(v,0),r.x+=v*u}n.restore(),this.processingType3=null}}setCharWidth(e,n){}setCharWidthAndBounds(e,n,r,i,o,a){this.ctx.rect(r,i,o-r,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let n;if(e[0]==="TilingPattern"){const r=e[1],i=this.baseTransform||$i(this.ctx),o={createCanvasGraphics:a=>new Uy(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new r9(e,r,this.ctx,o,i)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,n,r){this.ctx.strokeStyle=this.current.strokeColor=un.makeHexColor(e,n,r)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,n,r){this.ctx.fillStyle=this.current.fillColor=un.makeHexColor(e,n,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,n=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=dze(this.getObject(e)),this.cachedPatterns.set(e,r)),n&&(r.matrix=n),r}shadingFill(e){if(!this.contentVisible)return;const n=this.ctx;this.save();const r=this._getPattern(e);n.fillStyle=r.getPattern(n,this,kd(n),ts.SHADING);const i=kd(n);if(i){const{width:o,height:a}=n.canvas,[s,l,c,u]=un.getAxialAlignedBoundingBox([0,0,o,a],i);this.ctx.fillRect(s,l,c-s,u-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Si("Should not call beginInlineImage")}beginImageData(){Si("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=$i(this.ctx),n)){const r=n[2]-n[0],i=n[3]-n[1];this.ctx.rect(n[0],n[1],r,i),this.current.updateRectMinMax($i(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||LD("TODO: Support non-isolated groups."),e.knockout&&Vn("Knockout groups not supported.");const r=$i(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=un.getAxialAlignedBoundingBox(e.bbox,$i(n));const o=[0,0,n.canvas.width,n.canvas.height];i=un.intersect(i,o)||[0,0,0,0];const a=Math.floor(i[0]),s=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-a,1),c=Math.max(Math.ceil(i[3])-s,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(u,l,c),f=d.context;f.translate(-a,-s),f.transform(...r),e.smask?this.smaskStack.push({canvas:d.canvas,context:f,offsetX:a,offsetY:s,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(a,s),n.save()),d1(n,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const i=$i(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);const o=un.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],i);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(e,n,r,i,o){if(this.#e(),HD(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const a=n[2]-n[0],s=n[3]-n[1];if(o&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=a,n[3]=s;const[l,c]=un.singularValueDecompose2dScale($i(this.ctx)),{viewportScale:u}=this,d=Math.ceil(a*this.outputScaleX*u),f=Math.ceil(s*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(d,f);const{canvas:h,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,s*c),HD(this.ctx)}else HD(this.ctx),this.endPath(),this.ctx.rect(n[0],n[1],a,s),this.ctx.clip(),this.ctx.beginPath()}this.current=new rX(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const n=e.count;e=this.getObject(e.data,e),e.count=n;const r=this.ctx,i=this.processingType3;if(i&&(i.compiled===void 0&&(i.compiled=mze(e)),i.compiled)){i.compiled(r);return}const o=this._createMaskCanvas(e),a=o.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,o.offsetX,o.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,r=0,i=0,o,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const s=this.ctx;s.save();const l=$i(s);s.transform(n,r,i,o,0,0);const c=this._createMaskCanvas(e);s.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,d=a.length;u<d;u+=2){const f=un.transform(l,[n,r,i,o,a[u],a[u+1]]),[h,m]=un.applyTransform([0,0],f);s.drawImage(c.canvas,h,m)}s.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(const o of e){const{data:a,width:s,height:l,transform:c}=o,u=this.cachedCanvases.getCanvas("maskCanvas",s,l),d=u.context;d.save();const f=this.getObject(a,o);oX(d,f),d.globalCompositeOperation="source-in",d.fillStyle=i?r.getPattern(d,this,kd(n),ts.FILL):r,d.fillRect(0,0,s,l),d.restore(),n.save(),n.transform(...c),n.scale(1,-1),WD(n,u.canvas,0,0,s,l,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){Vn("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(e,n,r,i){if(!this.contentVisible)return;const o=this.getObject(e);if(!o){Vn("Dependent image isn't ready yet");return}const a=o.width,s=o.height,l=[];for(let c=0,u=i.length;c<u;c+=2)l.push({transform:[n,0,0,r,i[c],i[c+1]],x:0,y:0,w:a,h:s});this.paintInlineImageXObjectGroup(o,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:n,width:r,height:i}=e,o=this.cachedCanvases.getCanvas("inlineImage",r,i),a=o.context;return a.filter=this.current.transferMaps,a.drawImage(n,0,0),a.filter="none",o.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const n=e.width,r=e.height,i=this.ctx;if(this.save(),!ka){const{filter:s}=i;s!=="none"&&s!==""&&(i.filter="none")}i.scale(1/n,-1/r);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{const l=this.cachedCanvases.getCanvas("inlineImage",n,r).context;iX(l,e),o=this.applyTransferMapsToCanvas(l)}const a=this._scaleImage(o,kd(i));i.imageSmoothingEnabled=aX($i(i),e.interpolate),WD(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,n,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,n){if(!this.contentVisible)return;const r=this.ctx;let i;if(e.bitmap)i=e.bitmap;else{const o=e.width,a=e.height,l=this.cachedCanvases.getCanvas("inlineImage",o,a).context;iX(l,e),i=this.applyTransferMapsToCanvas(l)}for(const o of n)r.save(),r.transform(...o.transform),r.scale(1,-1),WD(r,i,o.x,o.y,o.w,o.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,n){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,n){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(n||(this.pendingClip===sX?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=$i(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:r,c:i,d:o}=this.ctx.getTransform();let a,s;if(r===0&&i===0){const l=Math.abs(n),c=Math.abs(o);if(l===c)if(e===0)a=s=1/l;else{const u=l*e;a=s=u<1?1/u:1}else if(e===0)a=1/l,s=1/c;else{const u=l*e,d=c*e;a=u<1?1/u:1,s=d<1?1/d:1}}else{const l=Math.abs(n*o-r*i),c=Math.hypot(n,r),u=Math.hypot(i,o);if(e===0)a=u/l,s=c/l;else{const d=e*l;a=u>d?u/d:1,s=c>d?c/d:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:n}=this,{lineWidth:r}=this.current,[i,o]=this.getScaleForStroking();if(n.lineWidth=r||1,i===1&&o===1){n.stroke();return}const a=n.getLineDash();if(e&&n.save(),n.scale(i,o),a.length>0){const s=Math.max(i,o);n.setLineDash(a.map(l=>l/s)),n.lineDashOffset/=s}n.stroke(),e&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in Lc)Uy.prototype[t]!==void 0&&(Uy.prototype[Lc[t]]=Uy.prototype[t]);class f1{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}const VD={DATA:1,ERROR:2},wo={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function sl(t){switch(t instanceof Error||typeof t=="object"&&t!==null||Si('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new pg(t.message);case"MissingPDFException":return new hg(t.message);case"PasswordException":return new yI(t.message,t.code);case"UnexpectedResponseException":return new FD(t.message,t.status);case"UnknownErrorException":return new xI(t.message,t.details);default:return new xI(t.message,t.toString())}}class h1{#e=new AbortController;constructor(e,n,r){this.sourceName=e,this.targetName=n,this.comObj=r,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),r.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){const r=e.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===VD.DATA)i.resolve(e.data);else if(e.callback===VD.ERROR)i.reject(sl(e.reason));else throw new Error("Unexpected callback case");return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,i=e.sourceName,o=this.comObj;new Promise(function(a){a(n(e.data))}).then(function(a){o.postMessage({sourceName:r,targetName:i,callback:VD.DATA,callbackId:e.callbackId,data:a})},function(a){o.postMessage({sourceName:r,targetName:i,callback:VD.ERROR,callbackId:e.callbackId,reason:sl(a)})});return}if(e.streamId){this.#n(e);return}n(e.data)}on(e,n){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=n}send(e,n,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},r)}sendWithPromise(e,n,r){const i=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:n},r)}catch(a){o.reject(a)}return o.promise}sendWithStream(e,n,r,i){const o=this.streamId++,a=this.sourceName,s=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[o]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:s,action:e,streamId:o,data:n,desiredSize:c.desiredSize},i),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[o].pullCall=u,l.postMessage({sourceName:a,targetName:s,stream:wo.PULL,streamId:o,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Oo(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[o].cancelCall=u,this.streamControllers[o].isClosed=!0,l.postMessage({sourceName:a,targetName:s,stream:wo.CANCEL,streamId:o,reason:sl(c)}),u.promise}},r)}#n(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,o=this.comObj,a=this,s=this.actionHandler[e.action],l={enqueue(c,u=1,d){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=u,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:r,targetName:i,stream:wo.ENQUEUE,streamId:n,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:i,stream:wo.CLOSE,streamId:n}),delete a.streamSinks[n])},error(c){Oo(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:i,stream:wo.ERROR,streamId:n,reason:sl(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[n]=l,new Promise(function(c){c(s(e.data,l))}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.START_COMPLETE,streamId:n,success:!0})},function(c){o.postMessage({sourceName:r,targetName:i,stream:wo.START_COMPLETE,streamId:n,reason:sl(c)})})}#r(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,o=this.comObj,a=this.streamControllers[n],s=this.streamSinks[n];switch(e.stream){case wo.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(sl(e.reason));break;case wo.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(sl(e.reason));break;case wo.PULL:if(!s){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,success:!0});break}s.desiredSize<=0&&e.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=e.desiredSize,new Promise(function(l){l(s.onPull?.())}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,success:!0})},function(l){o.postMessage({sourceName:r,targetName:i,stream:wo.PULL_COMPLETE,streamId:n,reason:sl(l)})});break;case wo.ENQUEUE:if(Oo(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case wo.CLOSE:if(Oo(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#o(a,n);break;case wo.ERROR:Oo(a,"error should have stream controller"),a.controller.error(sl(e.reason)),this.#o(a,n);break;case wo.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(sl(e.reason)),this.#o(a,n);break;case wo.CANCEL:if(!s)break;new Promise(function(l){l(s.onCancel?.(sl(e.reason)))}).then(function(){o.postMessage({sourceName:r,targetName:i,stream:wo.CANCEL_COMPLETE,streamId:n,success:!0})},function(l){o.postMessage({sourceName:r,targetName:i,stream:wo.CANCEL_COMPLETE,streamId:n,reason:sl(l)})}),s.sinkCapability.reject(sl(e.reason)),s.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async#o(e,n){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[n]}destroy(){this.#e?.abort(),this.#e=null}}class xze{#e;#t;constructor({parsedData:e,rawData:n}){this.#e=e,this.#t=n}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return wI(this.#e)}has(e){return this.#e.has(e)}}const sb=Symbol("INTERNAL");class wze{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:n,intent:r,usage:i,rbGroups:o}){this.#e=!!(e&al.DISPLAY),this.#t=!!(e&al.PRINT),this.name=n,this.intent=r,this.usage=i,this.rbGroups=o}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:e,view:n}=this.usage;return this.#e?n?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,n,r=!1){e!==sb&&Si("Internal method `_setVisible` called."),this.#n=r,this.#r=n}}class Cze{#e=null;#t=new Map;#n=null;#r=null;constructor(e,n=al.DISPLAY){if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(const r of e.groups)this.#t.set(r.id,new wze(n,r));if(e.baseState==="OFF")for(const r of this.#t.values())r._setVisible(sb,!1);for(const r of e.on)this.#t.get(r)._setVisible(sb,!0);for(const r of e.off)this.#t.get(r)._setVisible(sb,!1);this.#n=this.getHash()}}#o(e){const n=e.length;if(n<2)return!0;const r=e[0];for(let i=1;i<n;i++){const o=e[i];let a;if(Array.isArray(o))a=this.#o(o);else if(this.#t.has(o))a=this.#t.get(o).visible;else return Vn(`Optional content group not found: ${o}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return LD("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(Vn(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#o(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!this.#t.has(n))return Vn(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!1}return!0}return Vn(`Unknown optional content policy ${e.policy}.`),!0}return Vn(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0,r=!0){const i=this.#t.get(e);if(!i){Vn(`Optional content group not found: ${e}`);return}if(r&&n&&i.rbGroups.length)for(const o of i.rbGroups)for(const a of o)a!==e&&this.#t.get(a)?._setVisible(sb,!1,!0);i._setVisible(sb,!!n,!0),this.#e=null}setOCGState({state:e,preserveRB:n}){let r;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}const o=this.#t.get(i);if(o)switch(r){case"ON":this.setVisibility(i,!0,n);break;case"OFF":this.setVisibility(i,!1,n);break;case"Toggle":this.setVisibility(i,!o.visible,n);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?wI(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new HG;for(const[n,r]of this.#t)e.update(`${n}:${r.visible}`);return this.#e=e.hexdigest()}}class Eze{constructor(e,{disableRange:n=!1,disableStream:r=!1}){Oo(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:o,progressiveDone:a,contentDispositionFilename:s}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=s,o?.length>0){const l=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!n,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:n}){const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const i=this._rangeReaders.some(function(o){return o._begin!==e?!1:(o._enqueue(r),!0)});Oo(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){Oo(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new Sze(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new Dze(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}}class Sze{constructor(e,n,r=!1,i=null){this._stream=e,this._done=r||!1,this._filename=TI(i)?i:null,this._queuedChunks=n||[],this._loaded=0;for(const o of this._queuedChunks)this._loaded+=o.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Dze{constructor(e,n,r){this._stream=e,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Tze(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let u=s(n);return u=unescape(u),u=l(u),u=c(u),o(u)}if(n=a(t),n){const u=c(n);return o(u)}if(n=r("filename","i").exec(t),n){n=n[1];let u=s(n);return u=c(u),o(u)}function r(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function i(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const f=new TextDecoder(u,{fatal:!0}),h=BD(d);d=f.decode(h),e=!1}catch{}}return d}function o(u){return e&&/[\x80-\xff]/.test(u)&&(u=i("utf-8",u),e&&(u=i("iso-8859-1",u))),u}function a(u){const d=[];let f;const h=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=h.exec(u))!==null;){let[,g,v,b]=f;if(g=parseInt(g,10),g in d){if(g===0)break;continue}d[g]=[v,b]}const m=[];for(let g=0;g<d.length&&g in d;++g){let[v,b]=d[g];b=s(b),v&&(b=unescape(b),g===0&&(b=l(b))),m.push(b)}return m.join("")}function s(u){if(u.startsWith('"')){const d=u.slice(1).split('\\"');for(let f=0;f<d.length;++f){const h=d[f].indexOf('"');h!==-1&&(d[f]=d[f].slice(0,h),d.length=f+1),d[f]=d[f].replaceAll(/\\(.)/g,"$1")}u=d.join('"')}return u}function l(u){const d=u.indexOf("'");if(d===-1)return u;const f=u.slice(0,d),m=u.slice(d+1).replace(/^[^']*'/,"");return i(f,m)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,f,h,m){if(h==="q"||h==="Q")return m=m.replaceAll("_"," "),m=m.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,v){return String.fromCharCode(parseInt(v,16))}),i(f,m);try{m=atob(m)}catch{}return i(f,m)})}return""}function LI(t,e){const n=new Headers;if(!t||!e||typeof e!="object")return n;for(const r in e){const i=e[r];i!==void 0&&n.append(r,i)}return n}function FI({responseHeaders:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(t.get("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*n)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function BI(t){const e=t.get("Content-Disposition");if(e){let n=Tze(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(TI(n))return n}return null}function jD(t,e){return t===404||t===0&&e.startsWith("file:")?new hg('Missing PDF "'+e+'".'):new FD(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function lX(t){return t===200||t===206}function cX(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function uX(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Vn(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class dX{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=LI(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Oo(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Aze(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new kze(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class Aze{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const n=e.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange;const r=new Headers(e.headers),i=n.url;fetch(i,cX(r,this._withCredentials,this._abortController)).then(o=>{if(!lX(o.status))throw jD(o.status,i);this._reader=o.body.getReader(),this._headersCapability.resolve();const a=o.headers,{allowRangeRequests:s,suggestedLength:l}=FI({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=l||this._contentLength,this._filename=BI(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new pg("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:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:uX(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class kze{constructor(e,n,r){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const o=new Headers(e.headers);o.append("Range",`bytes=${n}-${r-1}`);const a=i.url;fetch(a,cX(o,this._withCredentials,this._abortController)).then(s=>{if(!lX(s.status))throw jD(s.status,a);this._readCapability.resolve(),this._reader=s.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:uX(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const $I=200,zI=206;function _ze(t){const e=t.response;return typeof e!="string"?e:BD(e).buffer}class Mze{constructor({url:e,httpHeaders:n,withCredentials:r}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=LI(this.isHttp,n),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,n,r){const i={begin:e,end:n};for(const o in r)i[o]=r[o];return this.request(i)}requestFull(e){return this.request(e)}request(e){const n=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const[o,a]of this.headers)n.setRequestHeader(o,a);return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=zI):i.expectedStatus=$I,n.responseType="arraybuffer",e.onError&&(n.onerror=function(o){e.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,r),n.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,n.send(null),r}onProgress(e,n){const r=this.pendingRequests[e];r&&r.onProgress?.(n)}onStateChange(e,n){const r=this.pendingRequests[e];if(!r)return;const i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){r.onError?.(i.status);return}const o=i.status||$I;if(!(o===$I&&r.expectedStatus===zI)&&o!==r.expectedStatus){r.onError?.(i.status);return}const s=_ze(i);if(o===zI){const l=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);r.onDone({begin:parseInt(c[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const n=this.pendingRequests[e].xhr;delete this.pendingRequests[e],n.abort()}}class Oze{constructor(e){this._source=e,this._manager=new Mze(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const n=this._rangeRequestReaders.indexOf(e);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return Oo(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Pze(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const r=new Rze(this._manager,e,n);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class Pze{constructor(e,n){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=e.requestFull(r),this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.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 e=this._fullRequestId,n=this._manager.getRequestXhr(e),r=new Headers(n.getAllResponseHeaders().trim().split(/[\r\n]+/).map(a=>{const[s,...l]=a.split(": ");return[s,l.join(": ")]})),{allowRangeRequests:i,suggestedLength:o}=FI({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=BI(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=jD(e,this._url),this._headersCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Rze{constructor(e,n,r){this._manager=e;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(n,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const n=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=jD(e,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Ize=/^[a-z][a-z0-9\-+.]+:/i;function Nze(t){if(Ize.test(t))return new URL(t);const e=sh.get("url");return new URL(e.pathToFileURL(t))}function fX(t,e,n){return t.protocol==="http:"?sh.get("http").request(t,{headers:e},n):sh.get("https").request(t,{headers:e},n)}class Lze{constructor(e){this.source=e,this.url=Nze(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.headers=LI(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Oo(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new $ze(this):new Fze(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=this.isFsUrl?new zze(this,e,n):new Bze(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class hX{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.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 e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new pg("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class pX{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.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 e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class Fze extends hX{constructor(e){super(e);const n=Object.fromEntries(e.headers),r=i=>{if(i.statusCode===404){const l=new hg(`Missing PDF "${this._url}".`);this._storedError=l,this._headersCapability.reject(l);return}this._headersCapability.resolve(),this._setReadableStream(i);const o=new Headers(this._readableStream.headers),{allowRangeRequests:a,suggestedLength:s}=FI({responseHeaders:o,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=s||this._contentLength,this._filename=BI(o)};this._request=fX(this._url,n,r),this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class Bze extends pX{constructor(e,n,r){super(e);const i=Object.fromEntries(e.headers);i.Range=`bytes=${n}-${r-1}`;const o=a=>{if(a.statusCode===404){const s=new hg(`Missing PDF "${this._url}".`);this._storedError=s;return}this._setReadableStream(a)};this._request=fX(this._url,i,o),this._request.on("error",a=>{this._storedError=a}),this._request.end()}}class $ze extends hX{constructor(e){super(e);const n=sh.get("fs");n.promises.lstat(this._url).then(r=>{this._contentLength=r.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},r=>{r.code==="ENOENT"&&(r=new hg(`Missing PDF "${this._url}".`)),this._storedError=r,this._headersCapability.reject(r)})}}class zze extends pX{constructor(e,n,r){super(e);const i=sh.get("fs");this._setReadableStream(i.createReadStream(this._url,{start:n,end:r-1}))}}const Uze=1e5,Ms=30,Wze=.8;let UI=class mc{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#o=null;#i=null;#s=0;#l=0;#u=null;#c=null;#d=0;#a=0;#f=Object.create(null);#p=[];#h=null;#v=[];#m=new WeakMap;#g=null;static#b=new Map;static#x=new Map;static#T=new WeakMap;static#E=null;static#S=new Set;constructor({textContentSource:e,container:n,viewport:r}){if(e instanceof ReadableStream)this.#h=e;else if(typeof e=="object")this.#h=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=n,this.#a=r.scale*(globalThis.devicePixelRatio||1),this.#d=r.rotation,this.#i={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:o,pageX:a,pageY:s}=r.rawDims;this.#g=[1,0,0,-1,-a,s+o],this.#l=i,this.#s=o,mc.#_(),gg(n,r),this.#e.promise.finally(()=>{mc.#S.delete(this),this.#i=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:n}=es.platform;return ir(this,"fontFamilyMap",new Map([["sans-serif",`${e&&n?"Calibri, ":""}sans-serif`],["monospace",`${e&&n?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#u.read().then(({value:n,done:r})=>{if(r){this.#e.resolve();return}this.#o??=n.lang,Object.assign(this.#f,n.styles),this.#N(n.items),e()},this.#e.reject)};return this.#u=this.#h.getReader(),mc.#S.add(this),e(),this.#e.promise}update({viewport:e,onBefore:n=null}){const r=e.scale*(globalThis.devicePixelRatio||1),i=e.rotation;if(i!==this.#d&&(n?.(),this.#d=i,gg(this.#c,{rotation:i})),r!==this.#a){n?.(),this.#a=r;const o={div:null,properties:null,ctx:mc.#D(this.#o)};for(const a of this.#v)o.properties=this.#m.get(a),o.div=a,this.#w(o)}}cancel(){const e=new pg("TextLayer task cancelled.");this.#u?.cancel(e).catch(()=>{}),this.#u=null,this.#e.reject(e)}get textDivs(){return this.#v}get textContentItemsStr(){return this.#p}#N(e){if(this.#n)return;this.#i.ctx??=mc.#D(this.#o);const n=this.#v,r=this.#p;for(const i of e){if(n.length>Uze){Vn("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const o=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),i.id!==null&&this.#t.setAttribute("id",`${i.id}`),o.append(this.#t)}else i.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}r.push(i.str),this.#A(i)}}#A(e){const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#v.push(n);const i=un.transform(this.#g,e.transform);let o=Math.atan2(i[1],i[0]);const a=this.#f[e.fontName];a.vertical&&(o+=Math.PI/2);let s=this.#r&&a.fontSubstitution||a.fontFamily;s=mc.fontFamilyMap.get(s)||s;const l=Math.hypot(i[2],i[3]),c=l*mc.#P(s,this.#o);let u,d;o===0?(u=i[4],d=i[5]-c):(u=i[4]+c*Math.sin(o),d=i[5]-c*Math.cos(o));const f="calc(var(--scale-factor)*",h=n.style;this.#t===this.#c?(h.left=`${(100*u/this.#l).toFixed(2)}%`,h.top=`${(100*d/this.#s).toFixed(2)}%`):(h.left=`${f}${u.toFixed(2)}px)`,h.top=`${f}${d.toFixed(2)}px)`),h.fontSize=`${f}${(mc.#E*l).toFixed(2)}px)`,h.fontFamily=s,r.fontSize=l,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,this.#r&&(n.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),o!==0&&(r.angle=o*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const g=Math.abs(e.transform[0]),v=Math.abs(e.transform[3]);g!==v&&Math.max(g,v)/Math.min(g,v)>1.5&&(m=!0)}if(m&&(r.canvasWidth=a.vertical?e.height:e.width),this.#m.set(n,r),this.#i.div=n,this.#i.properties=r,this.#w(this.#i),r.hasText&&this.#t.append(n),r.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this.#t.append(g)}}#w(e){const{div:n,properties:r,ctx:i}=e,{style:o}=n;let a="";if(mc.#E>1&&(a=`scale(${1/mc.#E})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:s}=o,{canvasWidth:l,fontSize:c}=r;mc.#k(i,c*this.#a,s);const{width:u}=i.measureText(n.textContent);u>0&&(a=`scaleX(${l*this.#a/u}) ${a}`)}r.angle!==0&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(o.transform=a)}static cleanup(){if(!(this.#S.size>0)){this.#b.clear();for(const{canvas:e}of this.#x.values())e.remove();this.#x.clear()}}static#D(e=null){let n=this.#x.get(e||="");if(!n){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),n=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#x.set(e,n),this.#T.set(n,{size:0,family:""})}return n}static#k(e,n,r){const i=this.#T.get(e);n===i.size&&r===i.family||(e.font=`${n}px ${r}`,i.size=n,i.family=r)}static#_(){if(this.#E!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#E=e.getBoundingClientRect().height,e.remove()}static#P(e,n){const r=this.#b.get(e);if(r)return r;const i=this.#D(n);i.canvas.width=i.canvas.height=Ms,this.#k(i,Ms,e);const o=i.measureText("");let a=o.fontBoundingBoxAscent,s=Math.abs(o.fontBoundingBoxDescent);if(a){const u=a/(a+s);return this.#b.set(e,u),i.canvas.width=i.canvas.height=0,u}i.strokeStyle="red",i.clearRect(0,0,Ms,Ms),i.strokeText("g",0,0);let l=i.getImageData(0,0,Ms,Ms).data;s=0;for(let u=l.length-1-3;u>=0;u-=4)if(l[u]>0){s=Math.ceil(u/4/Ms);break}i.clearRect(0,0,Ms,Ms),i.strokeText("A",0,Ms),l=i.getImageData(0,0,Ms,Ms).data,a=0;for(let u=0,d=l.length;u<d;u+=4)if(l[u]>0){a=Ms-Math.floor(u/4/Ms);break}i.canvas.width=i.canvas.height=0;const c=a?a/(a+s):Wze;return this.#b.set(e,c),c}};class Hw{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function i(o){if(!o)return;let a=null;const s=o.name;if(s==="#text")a=o.value;else if(Hw.shouldBuildText(s))o?.attributes?.textContent?a=o.attributes.textContent:o.value&&(a=o.value);else return;if(a!==null&&n.push({str:a}),!!o.children)for(const l of o.children)i(l)}return i(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const Hze=65536,Vze=100,jze=5e3,Yze=ka?ize:tze,qze=ka?oze:qG,Gze=ka?rze:nze,Xze=ka?aze:KG;function Kze(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new i9,{docId:n}=e,r=t.url?Zze(t.url):null,i=t.data?Jze(t.data):null,o=t.httpHeaders||null,a=t.withCredentials===!0,s=t.password??null,l=t.range instanceof mX?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:Hze;let u=t.worker instanceof Ko?t.worker:null;const d=t.verbosity,f=typeof t.docBaseUrl=="string"&&!zD(t.docBaseUrl)?t.docBaseUrl:null,h=typeof t.cMapUrl=="string"?t.cMapUrl:null,m=t.cMapPacked!==!1,g=t.CMapReaderFactory||qze,v=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||Xze,y=t.stopAtErrors!==!0,x=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,w=t.isEvalSupported!==!1,C=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!ka,E=typeof t.isChrome=="boolean"?t.isChrome:!es.platform.isFirefox&&typeof window<"u"&&!!window?.chrome,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,T=typeof t.disableFontFace=="boolean"?t.disableFontFace:ka,A=t.fontExtraProperties===!0,R=t.enableXfa===!0,P=t.ownerDocument||globalThis.document,_=t.disableRange===!0,I=t.disableStream===!0,k=t.disableAutoFetch===!0,F=t.pdfBug===!0,L=t.CanvasFactory||Yze,$=t.FilterFactory||Gze,N=t.enableHWA===!0,B=l?l.length:t.length??NaN,W=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!ka&&!T,Y=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:g===qG&&b===KG&&h&&v&&c1(h,document.baseURI)&&c1(v,document.baseURI);t.canvasFactory&&zG("`canvasFactory`-instance option, please use `CanvasFactory` instead."),t.filterFactory&&zG("`filterFactory`-instance option, please use `FilterFactory` instead.");const q=null;P$e(d);const ee={canvasFactory:new L({ownerDocument:P,enableHWA:N}),filterFactory:new $({docId:n,ownerDocument:P}),cMapReaderFactory:Y?null:new g({baseUrl:h,isCompressed:m}),standardFontDataFactory:Y?null:new b({baseUrl:v})};if(!u){const re={verbosity:d,port:f1.workerPort};u=re.port?Ko.fromPort(re):new Ko(re),e._worker=u}const Q={docId:n,apiVersion:"4.8.69",data:i,password:s,disableAutoFetch:k,rangeChunkSize:c,length:B,docBaseUrl:f,enableXfa:R,evaluatorOptions:{maxImageSize:x,disableFontFace:T,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:C,isChrome:E,canvasMaxAreaInBytes:S,fontExtraProperties:A,useSystemFonts:W,cMapUrl:Y?h:null,standardFontDataUrl:Y?v:null}},J={disableFontFace:T,fontExtraProperties:A,ownerDocument:P,pdfBug:F,styleElement:q,loadingParams:{disableAutoFetch:k,enableXfa:R}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const re=u.messageHandler.sendWithPromise("GetDocRequest",Q,i?[i.buffer]:null);let ie;if(l)ie=new Eze(l,{disableRange:_,disableStream:I});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");let he;ka?he=typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&c1(r)?dX:Lze:he=c1(r)?dX:Oze,ie=new he({url:r,length:B,httpHeaders:o,withCredentials:a,rangeChunkSize:c,disableRange:_,disableStream:I})}return re.then(he=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const xe=new h1(n,he,u.port),Se=new nUe(xe,e,ie,J,ee);e._transport=Se,xe.send("Ready",null)})}).catch(e._capability.reject),e}function Zze(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(ka&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Jze(t){if(ka&&typeof Buffer<"u"&&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(typeof t=="string")return BD(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!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.")}function gX(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class i9{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${i9.#e++}`,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(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let mX=class{constructor(e,n,r=!1,i=null){this.length=e,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const r of this._rangeListeners)r(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){Si("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Qze{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return ir(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(n)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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 eUe{#e=null;#t=!1;constructor(e,n,r,i=!1){this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=i?new $G:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new vX,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({scale:e,rotation:n=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:o=!1}={}){return new Uw({viewBox:this.view,scale:e,rotation:n,offsetX:r,offsetY:i,dontFlip:o})}getAnnotations({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ir(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:n,intent:r="display",annotationMode:i=oh.ENABLE,transform:o=null,background:a=null,optionalContentConfigPromise:s=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:d=!1}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:h,cacheKey:m}=f;this.#t=!1,this.#r(),s||=this._transport.getOptionalContentConfig(h);let g=this._intentStates.get(m);g||(g=Object.create(null),this._intentStates.set(m,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const v=!!(h&al.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f));const b=w=>{g.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#t=!0),this.#n(!v),w?(y.capability.reject(w),this._abortOperatorList({intentState:g,reason:w instanceof Error?w:new Error(w)})):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 Wy({callback:b,params:{canvasContext:e,viewport:n,transform:o,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(g.renderTasks||=new Set).add(y);const x=y.task;return Promise.all([g.displayReadyCapability.promise,s]).then(([w,C])=>{if(this.destroyed){b();return}if(this._stats?.time("Rendering"),!(C.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:w,optionalContentConfig:C}),y.operatorListChanged()}).catch(b),x}getOperatorList({intent:e="display",annotationMode:n=oh.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){function o(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,n,r,i,!0);let s=this._intentStates.get(a.cacheKey);s||(s=Object.create(null),this._intentStates.set(a.cacheKey,s));let l;return s.opListReadCapability||(l=Object.create(null),l.operatorListChanged=o,s.opListReadCapability=Promise.withResolvers(),(s.renderTasks||=new Set).add(l),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>Hw.textContent(r));const n=this.streamTextContent(e);return new Promise(function(r,i){function o(){a.read().then(function({value:l,done:c}){if(c){r(s);return}s.lang??=l.lang,Object.assign(s.styles,l.styles),s.items.push(...l.items),o()},i)}const a=n.getReader(),s={items:[],styles:Object.create(null),lang:null};o()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const n of this._intentStates.values())if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!n.opListReadCapability)for(const r of n.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#t=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#t=!0;const n=this.#n(!1);return e&&n&&(this._stats&&=new $G),n}#n(e=!1){if(this.#r(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#n(!1)},jze),!1;for(const{renderTasks:n,operatorList:r}of this._intentStates.values())if(n.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#r(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(e,n){const r=this._intentStates.get(n);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(e))}_renderPageChunk(e,n){for(let r=0,i=e.length;r<i;r++)n.operatorList.fnArray.push(e.fnArray[r]),n.operatorList.argsArray.push(e.argsArray[r]);n.operatorList.lastChunk=e.lastChunk,n.operatorList.separateAnnots=e.separateAnnots;for(const r of n.renderTasks)r.operatorListChanged();e.lastChunk&&this.#n(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r,modifiedIds:i}){const{map:o,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:o,modifiedIds:i},a).getReader(),c=this._intentStates.get(n);c.streamReader=l;const u=()=>{l.read().then(({value:d,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),u())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();this.#n(!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:e,reason:n,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(n instanceof DI){let i=Vze;n.extraDelay>0&&n.extraDelay<1e3&&(i+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},i);return}}if(e.streamReader.cancel(new pg(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,o]of this._intentStates)if(o===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}class tUe{#e=new Map;#t=Promise.resolve();postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};this.#t.then(()=>{for(const[i]of this.#e)i.call(this,r)})}addEventListener(e,n,r=null){let i=null;if(r?.signal instanceof AbortSignal){const{signal:o}=r;if(o.aborted){Vn("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,n);i=()=>o.removeEventListener("abort",a),o.addEventListener("abort",a)}this.#e.set(n,i)}removeEventListener(e,n){this.#e.get(n)?.(),this.#e.delete(n)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}class Ko{static#e=0;static#t=!1;static#n;static{ka&&(this.#t=!0,f1.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,n)=>{let r;try{if(r=new URL(e),!r.origin||r.origin==="null")return!1}catch{return!1}const i=new URL(n,r);return r.origin===i.origin},this._createCDNWrapper=e=>{const n=`await import("${e}");`;return URL.createObjectURL(new Blob([n],{type:"text/javascript"}))}}constructor({name:e=null,port:n=null,verbosity:r=R$e()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if(Ko.#n?.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(Ko.#n||=new WeakMap).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return ka?Promise.all([sh.promise,this._readyCapability.promise]):this._readyCapability.promise}#r(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new h1("main","worker",e),this._messageHandler.on("ready",function(){}),this.#r()}_initialize(){if(Ko.#t||Ko.#o){this._setupFakeWorker();return}let{workerSrc:e}=Ko;try{Ko._isSameOrigin(window.location.href,e)||(e=Ko._createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),r=new h1("main","worker",n),i=()=>{o.abort(),r.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},o=new AbortController;n.addEventListener("error",()=>{this._webWorker||i()},{signal:o.signal}),r.on("test",s=>{if(o.abort(),this.destroyed||!s){i();return}this._messageHandler=r,this._port=n,this._webWorker=n,this.#r()}),r.on("ready",s=>{if(o.abort(),this.destroyed){i();return}try{a()}catch{this._setupFakeWorker()}});const a=()=>{const s=new Uint8Array;r.send("test",s,[s.buffer])};a();return}catch{LD("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Ko.#t||(Vn("Setting up fake worker."),Ko.#t=!0),Ko._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new tUe;this._port=n;const r=`fake${Ko.#e++}`,i=new h1(r+"_worker",r,n);e.setup(i,n),this._messageHandler=new h1(r,r+"_worker",n),this.#r()}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Ko.#n?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=this.#n?.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new Ko(e)}static get workerSrc(){if(f1.workerSrc)return f1.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#o(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return ir(this,"_setupFakeWorkerGlobal",(async()=>this.#o?this.#o:(await import(this.workerSrc)).WorkerMessageHandler)())}}class nUe{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#o=null;constructor(e,n,r,i,o){this.messageHandler=e,this.loadingTask=n,this.commonObjs=new vX,this.fontLoader=new Q$e({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=o.canvasFactory,this.filterFactory=o.filterFactory,this.cMapReaderFactory=o.cMapReaderFactory,this.standardFontDataFactory=o.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#i(e,n=null){const r=this.#e.get(e);if(r)return r;const i=this.messageHandler.sendWithPromise(e,n);return this.#e.set(e,i),i}get annotationStorage(){return ir(this,"annotationStorage",new MI)}getRenderingIntent(e,n=oh.ENABLE,r=null,i=!1,o=!1){let a=al.DISPLAY,s=_I;switch(e){case"any":a=al.ANY;break;case"display":break;case"print":a=al.PRINT;break;default:Vn(`getRenderingIntent - invalid intent: ${e}`)}const l=a&al.PRINT&&r instanceof VG?r:this.annotationStorage;switch(n){case oh.DISABLE:a+=al.ANNOTATIONS_DISABLE;break;case oh.ENABLE:break;case oh.ENABLE_FORMS:a+=al.ANNOTATIONS_FORMS;break;case oh.ENABLE_STORAGE:a+=al.ANNOTATIONS_STORAGE,s=l.serializable;break;default:Vn(`getRenderingIntent - invalid annotationMode: ${n}`)}i&&(a+=al.IS_EDITING),o&&(a+=al.OPLIST);const{ids:c,hash:u}=l.modifiedIds,d=[a,s.hash,u];return{renderingIntent:a,cacheKey:d.join("_"),annotationStorageSerializable:s,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const r of this.#t.values())e.push(r._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),UI.cleanup(),this._networkStream?.cancelAllRequests(new pg("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(r,i)=>{Oo(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=o=>{this._lastProgress={loaded:o.loaded,total:o.total}},i.onPull=()=>{this._fullReader.read().then(function({value:o,done:a}){if(a){i.close();return}Oo(o instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{this._fullReader.cancel(o),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:o,contentLength:a}=this._fullReader;return(!i||!o)&&(this._lastProgress&&n.onProgress?.(this._lastProgress),this._fullReader.onProgress=s=>{n.onProgress?.({loaded:s.loaded,total:s.total})}),{isStreamingSupported:i,isRangeSupported:o,contentLength:a}}),e.on("GetRangeReader",(r,i)=>{Oo(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const o=this._networkStream.getRangeReader(r.begin,r.end);if(!o){i.close();return}i.onPull=()=>{o.read().then(function({value:a,done:s}){if(s){i.close();return}Oo(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{o.cancel(a),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new Qze(r,this))}),e.on("DocException",function(r){let i;switch(r.name){case"PasswordException":i=new yI(r.message,r.code);break;case"InvalidPDFException":i=new LG(r.message);break;case"MissingPDFException":i=new hg(r.message);break;case"UnexpectedResponseException":i=new FD(r.message,r.status);break;case"UnknownErrorException":i=new xI(r.message,r.details);break;default:Si("DocException - expected a valid Error.")}n._capability.reject(i)}),e.on("PasswordRequest",r=>{if(this.#o=Promise.withResolvers(),n.onPassword){const i=o=>{o instanceof Error?this.#o.reject(o):this.#o.resolve({password:o})};try{n.onPassword(i,r.code)}catch(o){this.#o.reject(o)}}else this.#o.reject(new yI(r.message,r.code));return this.#o.promise}),e.on("DataLoaded",r=>{n.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;this.#t.get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,i,o])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":const{disableFontFace:a,fontExtraProperties:s,pdfBug:l}=this._params;if("error"in o){const f=o.error;Vn(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}const c=l&&globalThis.FontInspector?.enabled?(f,h)=>globalThis.FontInspector.fontAdded(f,h):null,u=new eze(o,{disableFontFace:a,inspectFont:c});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!s&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:d}=o;Oo(d,"The imageRef must be defined.");for(const f of this.#t.values())for(const[,h]of f.objs)if(h?.ref===d)return h.dataLen?(this.commonObjs.resolve(r,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,o);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([r,i,o,a])=>{if(this.destroyed)return;const s=this.#t.get(i);if(!s.objs.has(r)){if(s._intentStates.size===0){a?.bitmap?.close();return}switch(o){case"Image":s.objs.resolve(r,a),a?.dataLen>k$e&&(s._maybeCleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${o}`)}}}),e.on("DocProgress",r=>{this.destroyed||n.onProgress?.({loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(r)}),e.on("FetchStandardFontData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Vn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=e-1,r=this.#n.get(n);if(r)return r;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(o=>{if(this.destroyed)throw new Error("Transport destroyed");o.refStr&&this.#r.set(o.refStr,e);const a=new eUe(n,o,this,this._params.pdfBug);return this.#t.set(n,a),a});return this.#n.set(n,i),i}getPageIndex(e){return gX(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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.#i("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#i("GetOptionalContentConfig").then(n=>new Cze(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=this.#e.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new xze(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of this.#t.values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),UI.cleanup()}}cachedPageNumber(e){if(!gX(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(n)??null}}const YD=Symbol("INITIAL_DATA");class vX{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:YD}}get(e,n=null){if(n){const i=this.#t(e);return i.promise.then(()=>n(i.data)),null}const r=this.#e[e];if(!r||r.data===YD)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=this.#e[e];return!!n&&n.data!==YD}resolve(e,n=null){const r=this.#t(e);r.data=n,r.resolve()}clear(){for(const e in this.#e){const{data:n}=this.#e[e];n?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:n}=this.#e[e];n!==YD&&(yield[e,n])}}}class rUe{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:n}=this.#e;return e.form||e.canvas&&n?.size>0}}class Wy{#e=null;static#t=new WeakSet;constructor({callback:e,params:n,objs:r,commonObjs:i,annotationCanvasMap:o,operatorList:a,pageIndex:s,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:f=null}){this.callback=e,this.params=n,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=s,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new rUe(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=n.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(Wy.#t.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.");Wy.#t.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:r,viewport:i,transform:o,background:a}=this.params;this.gfx=new Uy(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),Wy.#t.delete(this._canvas),this.callback(e||new DI(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=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(),Wy.#t.delete(this._canvas),this.callback())))}}const iUe="4.8.69",oUe="3634dab10";function bX(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function p1(t){return Math.max(0,Math.min(255,255*t))}class yX{static CMYK_G([e,n,r,i]){return["G",1-Math.min(1,.3*e+.59*r+.11*n+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=p1(e),[e,e,e]}static G_HTML([e]){const n=bX(e);return`#${n}${n}${n}`}static RGB_G([e,n,r]){return["G",.3*e+.59*n+.11*r]}static RGB_rgb(e){return e.map(p1)}static RGB_HTML(e){return`#${e.map(bX).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,r,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,r+i),1-Math.min(1,n+i)]}static CMYK_rgb([e,n,r,i]){return[p1(1-Math.min(1,e+i)),p1(1-Math.min(1,r+i)),p1(1-Math.min(1,n+i))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,r]){const i=1-e,o=1-n,a=1-r,s=Math.min(i,o,a);return["CMYK",i,o,a,s]}}class aUe{create(e,n,r=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${n}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${n}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Si("Abstract method `_createSVG` called.")}}class WI extends aUe{_createSVG(e){return document.createElementNS(Ad,e)}}class xX{static setupStorage(e,n,r,i,o){const a=i.getValue(n,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),o==="print")break;e.addEventListener("input",s=>{i.setValue(n,{value:s.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),o==="print")break;e.addEventListener("change",s=>{i.setValue(n,{value:s.target.checked?s.target.getAttribute("xfaOn"):s.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),o==="print")break;e.addEventListener("input",s=>{i.setValue(n,{value:s.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const s of r.children)s.attributes.value===a.value?s.attributes.selected=!0:s.attributes.hasOwnProperty("selected")&&delete s.attributes.selected}e.addEventListener("input",s=>{const l=s.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(n,{value:c})});break}}static setAttributes({html:e,element:n,storage:r=null,intent:i,linkService:o}){const{attributes:a}=n,s=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!s||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}s&&o.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(e){const n=e.annotationStorage,r=e.linkService,i=e.xfaHtml,o=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:o,linkService:r});const s=o!=="richText",l=e.div;if(l.append(a),e.viewport){const d=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=d}s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const d=document.createTextNode(i.value);a.append(d),s&&Hw.shouldBuildText(i.name)&&c.push(d)}return{textDivs:c}}const u=[[i,-1,a]];for(;u.length>0;){const[d,f,h]=u.at(-1);if(f+1===d.children.length){u.pop();continue}const m=d.children[++u.at(-1)[1]];if(m===null)continue;const{name:g}=m;if(g==="#text"){const b=document.createTextNode(m.value);c.push(b),h.append(b);continue}const v=m?.attributes?.xmlns?document.createElementNS(m.attributes.xmlns,g):document.createElement(g);if(h.append(v),m.attributes&&this.setAttributes({html:v,element:m,storage:n,intent:o,linkService:r}),m.children?.length>0)u.push([m,-1,v]);else if(m.value){const b=document.createTextNode(m.value);s&&Hw.shouldBuildText(g)&&c.push(b),v.append(b)}}for(const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const g1=1e3,sUe=9,mg=new WeakSet;function _d(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class lUe{static create(e){switch(e.data.annotationType){case Mo.LINK:return new wX(e);case Mo.TEXT:return new cUe(e);case Mo.WIDGET:switch(e.data.fieldType){case"Tx":return new uUe(e);case"Btn":return e.data.radioButton?new CX(e):e.data.checkBox?new fUe(e):new hUe(e);case"Ch":return new pUe(e);case"Sig":return new dUe(e)}return new vg(e);case Mo.POPUP:return new HI(e);case Mo.FREETEXT:return new EX(e);case Mo.LINE:return new mUe(e);case Mo.SQUARE:return new vUe(e);case Mo.CIRCLE:return new bUe(e);case Mo.POLYLINE:return new SX(e);case Mo.CARET:return new xUe(e);case Mo.INK:return new VI(e);case Mo.POLYGON:return new yUe(e);case Mo.HIGHLIGHT:return new DX(e);case Mo.UNDERLINE:return new wUe(e);case Mo.SQUIGGLY:return new CUe(e);case Mo.STRIKEOUT:return new EUe(e);case Mo.STAMP:return new TX(e);case Mo.FILEATTACHMENT:return new SUe(e);default:return new uo(e)}}}class uo{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,n&&(this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:n,richText:r}){return!!(e?.str||n?.str||r?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return uo._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:n}=e;n&&this.#r(n),this.#n?.popup.updateEdited(e)}resetEdited(){this.#e&&(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#r(e){const{container:{style:n},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:a,pageX:s,pageY:l}}}}=this;r?.splice(0,4,...e);const{width:c,height:u}=_d(e);n.left=`${100*(e[0]-s)/o}%`,n.top=`${100*(a-e[3]+l)/a}%`,i===0?(n.width=`${100*c/o}%`,n.height=`${100*u/a}%`):this.setRotation(i)}_createContainer(e){const{data:n,parent:{page:r,viewport:i}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",n.id),this instanceof vg||(o.tabIndex=g1);const{style:a}=o;if(a.zIndex=this.parent.zIndex++,n.alternativeText&&(o.title=n.alternativeText),n.noRotate&&o.classList.add("norotate"),!n.rect||this instanceof HI){const{rotation:g}=n;return!n.hasOwnCanvas&&g!==0&&this.setRotation(g,o),o}const{width:s,height:l}=_d(n.rect);if(!e&&n.borderStyle.width>0){a.borderWidth=`${n.borderStyle.width}px`;const g=n.borderStyle.horizontalCornerRadius,v=n.borderStyle.verticalCornerRadius;if(g>0||v>0){const y=`calc(${g}px * var(--scale-factor)) / calc(${v}px * var(--scale-factor))`;a.borderRadius=y}else if(this instanceof CX){const y=`calc(${s}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=y}switch(n.borderStyle.style){case l1.SOLID:a.borderStyle="solid";break;case l1.DASHED:a.borderStyle="dashed";break;case l1.BEVELED:Vn("Unimplemented border style: beveled");break;case l1.INSET:Vn("Unimplemented border style: inset");break;case l1.UNDERLINE:a.borderBottomStyle="solid";break}const b=n.borderColor||null;b?(this.#t=!0,a.borderColor=un.makeHexColor(b[0]|0,b[1]|0,b[2]|0)):a.borderWidth=0}const c=un.normalizeRect([n.rect[0],r.view[3]-n.rect[1]+r.view[1],n.rect[2],r.view[3]-n.rect[3]+r.view[1]]),{pageWidth:u,pageHeight:d,pageX:f,pageY:h}=i.rawDims;a.left=`${100*(c[0]-f)/u}%`,a.top=`${100*(c[1]-h)/d}%`;const{rotation:m}=n;return n.hasOwnCanvas||m===0?(a.width=`${100*s/u}%`,a.height=`${100*l/d}%`):this.setRotation(m,o),o}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims,{width:o,height:a}=_d(this.data.rect);let s,l;e%180===0?(s=100*o/r,l=100*a/i):(s=100*a/r,l=100*o/i),n.style.width=`${s}%`,n.style.height=`${l}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,i)=>{const o=i.detail[n],a=o[0],s=o.slice(1);i.target.style[r]=yX[`${a}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[r]:yX[`${a}_rgb`](s)})};return ir(this,"_commonActions",{display:n=>{const{display:r}=n.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:n=>{this.annotationStorage.setValue(this.data.id,{noPrint:!n.detail.print})},hidden:n=>{const{hidden:r}=n.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:n=>{setTimeout(()=>n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.target.disabled=n.detail.readonly},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{e("bgColor","backgroundColor",n)},fillColor:n=>{e("fillColor","backgroundColor",n)},fgColor:n=>{e("fgColor","color",n)},textColor:n=>{e("textColor","color",n)},borderColor:n=>{e("borderColor","borderColor",n)},strokeColor:n=>{e("strokeColor","borderColor",n)},rotation:n=>{const r=n.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,n){const r=this._commonActions;for(const i of Object.keys(n.detail))(e[i]||r[i])?.(n)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const r=this._commonActions;for(const[i,o]of Object.entries(n)){const a=r[i];if(a){const s={detail:{[i]:o},target:e};a(s),delete n[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,r,i,o]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,v,b,y]=e.subarray(2,6);if(i===g&&o===v&&n===b&&r===y)return}const{style:a}=this.container;let s;if(this.#t){const{borderColor:g,borderWidth:v}=a;a.borderWidth=0,s=["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="${g}" stroke-width="${v}">`],this.container.classList.add("hasBorder")}const l=i-n,c=o-r,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const f=u.createElement("defs");d.append(f);const h=u.createElement("clipPath"),m=`clippath_${this.data.id}`;h.setAttribute("id",m),h.setAttribute("clipPathUnits","objectBoundingBox"),f.append(h);for(let g=2,v=e.length;g<v;g+=8){const b=e[g],y=e[g+1],x=e[g+2],w=e[g+3],C=u.createElement("rect"),E=(x-n)/l,S=(o-y)/c,T=(b-x)/l,A=(y-w)/c;C.setAttribute("x",E),C.setAttribute("y",S),C.setAttribute("width",T),C.setAttribute("height",A),h.append(C),s?.push(`<rect vector-effect="non-scaling-stroke" x="${E}" y="${S}" width="${T}" height="${A}"/>`)}this.#t&&(s.push("</g></svg>')"),a.backgroundImage=s.join("")),this.container.append(d),this.container.style.clipPath=`url(#${m})`}_createPopup(){const{data:e}=this,n=this.#n=new HI({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(n.render())}render(){Si("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:o,id:a,exportValues:s}of i){if(o===-1||a===n)continue;const l=typeof s=="string"?s:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!mg.has(c)){Vn(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:c})}return r}for(const i of document.getElementsByName(e)){const{exportValue:o}=i,a=i.getAttribute("data-element-id");a!==n&&mg.has(i)&&r.push({id:a,exportValue:o,domElement:i})}return r}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 e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const n of e)n.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:n})})}}class wX extends uo{constructor(e,n=null){super(e,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:n}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let i=!1;return e.url?(n.addLinkAttributes(r,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(r,e.action),i=!0):e.attachment?(this.#t(r,e.attachment,e.attachmentDest),i=!0):e.setOCGState?(this.#n(r,e.setOCGState),i=!0):e.dest?(this._bindLink(r,e.dest),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),i=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(r),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,n){e.href=this.linkService.getDestinationHash(n),e.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&this.#e()}_bindNamedAction(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(n),!1),this.#e()}#t(e,n,r=null){e.href=this.linkService.getAnchorUrl(""),n.description&&(e.title=n.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(n.content,n.filename,r),!1),this.#e()}#n(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(n),!1),this.#e()}_bindJSAction(e,n){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(n.actions)){const o=r.get(i);o&&(e[o]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:i}}),!1))}e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,n){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){Vn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{r?.();const{fields:i,refs:o,include:a}=n,s=[];if(i.length!==0||o.length!==0){const u=new Set(o);for(const d of i){const f=this._fieldObjects[d]||[];for(const{id:h}of f)u.add(h)}for(const d of Object.values(this._fieldObjects))for(const f of d)u.has(f.id)===a&&s.push(f)}else for(const u of Object.values(this._fieldObjects))s.push(...u);const l=this.annotationStorage,c=[];for(const u of s){const{id:d}=u;switch(c.push(d),u.type){case"text":{const h=u.defaultValue||"";l.setValue(d,{value:h});break}case"checkbox":case"radiobutton":{const h=u.defaultValue===u.exportValues;l.setValue(d,{value:h});break}case"combobox":case"listbox":{const h=u.defaultValue||"";l.setValue(d,{value:h});break}default:continue}const f=document.querySelector(`[data-element-id="${d}"]`);if(f){if(!mg.has(f)){Vn(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class cUe extends uo{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class vg extends uo{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return es.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,i,o){r.includes("mouse")?e.addEventListener(r,a=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{if(r==="blur"){if(!n.focused||!a.relatedTarget)return;n.focused=!1}else if(r==="focus"){if(n.focused)return;n.focused=!0}o&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(a)}})})}_setEventListeners(e,n,r,i){for(const[o,a]of r)(a==="Action"||this.data.actions?.[a])&&((a==="Focus"||a==="Blur")&&(n||={focused:!1}),this._setEventListener(e,n,o,a,i),a==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,n,"blur","Blur",null):a==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":un.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||sUe,o=e.style;let a;const s=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-s),u=Math.round(c/(bI*i))||1,d=c/u;a=Math.min(i,l(d/bI))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-s);a=Math.min(i,l(c/bI))}o.fontSize=`calc(${a}px * var(--scale-factor))`,o.color=un.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(o.textAlign=n[this.data.textAlignment])}_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class uUe extends vg{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,r,i){const o=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[n]=r),o.setValue(a.id,{[i]:r})}render(){const e=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const i=e.getValue(n,{value:this.data.fieldValue});let o=i.value||"";const a=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;a&&o.length>a&&(o=o.slice(0,a));let s=i.formattedValue||this.data.textContent?.join(`
569
569
  `)||null;s&&this.data.comb&&(s=s.replaceAll(/\s+/g,""));const l={userValue:o,formattedValue:s,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=s??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",s??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),mg.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=g1,this._setRequired(r,this.data.required),a&&(r.maxLength=a),r.addEventListener("input",u=>{e.setValue(n,{value:u.target.value}),this.setPropertyOnSiblings(r,"value",u.target.value,"value"),l.formattedValue=null}),r.addEventListener("resetform",u=>{const d=this.data.defaultFieldValue??"";r.value=l.userValue=d,l.formattedValue=null});let c=u=>{const{formattedValue:d}=l;d!=null&&(u.target.value=d),u.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",d=>{if(l.focused)return;const{target:f}=d;l.userValue&&(f.value=l.userValue),l.lastCommittedValue=f.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),r.addEventListener("updatefromsandbox",d=>{this.showElementAndHideCanvas(d.target);const f={value(h){l.userValue=h.detail.value??"",e.setValue(n,{value:l.userValue.toString()}),h.target.value=l.userValue},formattedValue(h){const{formattedValue:m}=h.detail;l.formattedValue=m,m!=null&&h.target!==document.activeElement&&(h.target.value=m),e.setValue(n,{formattedValue:m})},selRange(h){h.target.setSelectionRange(...h.detail.selRange)},charLimit:h=>{const{charLimit:m}=h.detail,{target:g}=h;if(m===0){g.removeAttribute("maxLength");return}g.setAttribute("maxLength",m);let v=l.userValue;!v||v.length<=m||(v=v.slice(0,m),g.value=l.userValue=v,e.setValue(n,{value:v}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(f,d)}),r.addEventListener("keydown",d=>{l.commitKey=1;let f=-1;if(d.key==="Escape"?f=0:d.key==="Enter"&&!this.data.multiLine?f=2:d.key==="Tab"&&(l.commitKey=3),f===-1)return;const{value:h}=d.target;l.lastCommittedValue!==h&&(l.lastCommittedValue=h,l.userValue=h,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:h,willCommit:!0,commitKey:f,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}))});const u=c;c=null,r.addEventListener("blur",d=>{if(!l.focused||!d.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{value:f}=d.target;l.userValue=f,l.lastCommittedValue!==f&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:f,willCommit:!0,commitKey:l.commitKey,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}),u(d)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",d=>{l.lastCommittedValue=null;const{data:f,target:h}=d,{value:m,selectionStart:g,selectionEnd:v}=h;let b=g,y=v;switch(d.inputType){case"deleteWordBackward":{const x=m.substring(0,g).match(/\w*[^\w]*$/);x&&(b-=x[0].length);break}case"deleteWordForward":{const x=m.substring(g).match(/^[^\w]*\w*/);x&&(y+=x[0].length);break}case"deleteContentBackward":g===v&&(b-=1);break;case"deleteContentForward":g===v&&(y+=1);break}d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:m,change:f||"",willCommit:!1,selStart:b,selEnd:y}})}),this._setEventListeners(r,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.value)}if(c&&r.addEventListener("blur",c),this.data.comb){const d=(this.data.rect[2]-this.data.rect[0])/a;r.classList.add("comb"),r.style.letterSpacing=`calc(${d}px * var(--scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class dUe extends vg{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class fUe extends vg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,n=this.data,r=n.id;let i=e.getValue(r,{value:n.exportValue===n.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const o=document.createElement("input");return mg.add(o),o.setAttribute("data-element-id",r),o.disabled=n.readOnly,this._setRequired(o,this.data.required),o.type="checkbox",o.name=n.fieldName,i&&o.setAttribute("checked",!0),o.setAttribute("exportValue",n.exportValue),o.tabIndex=g1,o.addEventListener("change",a=>{const{name:s,checked:l}=a.target;for(const c of this._getElementsByName(s,r)){const u=l&&c.exportValue===n.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(r,{value:l})}),o.addEventListener("resetform",a=>{const s=n.defaultFieldValue||"Off";a.target.checked=s===n.exportValue}),this.enableScripting&&this.hasJSActions&&(o.addEventListener("updatefromsandbox",a=>{const s={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(s,a)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class CX extends vg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,n=this.data,r=n.id;let i=e.getValue(r,{value:n.fieldValue===n.buttonValue}).value;if(typeof i=="string"&&(i=i!==n.buttonValue,e.setValue(r,{value:i})),i)for(const a of this._getElementsByName(n.fieldName,r))e.setValue(a.id,{value:!1});const o=document.createElement("input");if(mg.add(o),o.setAttribute("data-element-id",r),o.disabled=n.readOnly,this._setRequired(o,this.data.required),o.type="radio",o.name=n.fieldName,i&&o.setAttribute("checked",!0),o.tabIndex=g1,o.addEventListener("change",a=>{const{name:s,checked:l}=a.target;for(const c of this._getElementsByName(s,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),o.addEventListener("resetform",a=>{const s=n.defaultFieldValue;a.target.checked=s!=null&&s===n.buttonValue}),this.enableScripting&&this.hasJSActions){const a=n.buttonValue;o.addEventListener("updatefromsandbox",s=>{const l={value:c=>{const u=a===c.detail.value;for(const d of this._getElementsByName(c.target.name)){const f=u&&d.id===r;d.domElement&&(d.domElement.checked=f),e.setValue(d.id,{value:f})}}};this._dispatchEventFromSandbox(l,s)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)}return this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class hUe extends wX{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const n=e.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class pUe extends vg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,n=this.data.id,r=e.getValue(n,{value:this.data.fieldValue}),i=document.createElement("select");mg.add(i),i.setAttribute("data-element-id",n),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=g1;let o=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",u=>{const d=this.data.defaultFieldValue;for(const f of i.options)f.selected=f.value===d});for(const u of this.data.options){const d=document.createElement("option");d.textContent=u.displayValue,d.value=u.exportValue,r.value.includes(u.exportValue)&&(d.setAttribute("selected",!0),o=!1),i.append(d)}let a=null;if(o){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),i.prepend(u),a=()=>{u.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const s=u=>{const d=u?"value":"textContent",{options:f,multiple:h}=i;return h?Array.prototype.filter.call(f,m=>m.selected).map(m=>m[d]):f.selectedIndex===-1?null:f[f.selectedIndex][d]};let l=s(!1);const c=u=>{const d=u.target.options;return Array.prototype.map.call(d,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",u=>{const d={value(f){a?.();const h=f.detail.value,m=new Set(Array.isArray(h)?h:[h]);for(const g of i.options)g.selected=m.has(g.value);e.setValue(n,{value:s(!0)}),l=s(!1)},multipleSelection(f){i.multiple=!0},remove(f){const h=i.options,m=f.detail.remove;h[m].selected=!1,i.remove(m),h.length>0&&Array.prototype.findIndex.call(h,v=>v.selected)===-1&&(h[0].selected=!0),e.setValue(n,{value:s(!0),items:c(f)}),l=s(!1)},clear(f){for(;i.length!==0;)i.remove(0);e.setValue(n,{value:null,items:[]}),l=s(!1)},insert(f){const{index:h,displayValue:m,exportValue:g}=f.detail.insert,v=i.children[h],b=document.createElement("option");b.textContent=m,b.value=g,v?v.before(b):i.append(b),e.setValue(n,{value:s(!0),items:c(f)}),l=s(!1)},items(f){const{items:h}=f.detail;for(;i.length!==0;)i.remove(0);for(const m of h){const{displayValue:g,exportValue:v}=m,b=document.createElement("option");b.textContent=g,b.value=v,i.append(b)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(n,{value:s(!0),items:c(f)}),l=s(!1)},indices(f){const h=new Set(f.detail.indices);for(const m of f.target.options)m.selected=h.has(m.index);e.setValue(n,{value:s(!0)}),l=s(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(d,u)}),i.addEventListener("input",u=>{const d=s(!0),f=s(!1);e.setValue(n,{value:d}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:l,change:f,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):i.addEventListener("input",function(u){e.setValue(n,{value:s(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class HI extends uo{constructor(e){const{data:n,elements:r}=e;super(e,{isRenderable:uo._hasPopupData(n)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new gUe({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}),n=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",n.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(r=>`${SI}${r}`).join(",")),this.container}}class gUe{#e=this.#N.bind(this);#t=this.#k.bind(this);#n=this.#D.bind(this);#r=this.#w.bind(this);#o=null;#i=null;#s=null;#l=null;#u=null;#c=null;#d=null;#a=!1;#f=null;#p=null;#h=null;#v=null;#m=null;#g=null;#b=!1;constructor({container:e,color:n,elements:r,titleObj:i,modificationDate:o,contentsObj:a,richText:s,parent:l,rect:c,parentRect:u,open:d}){this.#i=e,this.#m=i,this.#s=a,this.#v=s,this.#c=l,this.#o=n,this.#h=c,this.#d=u,this.#u=r,this.#l=UG.toDateObject(o),this.trigger=r.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",this.#r),f.addEventListener("mouseenter",this.#n),f.addEventListener("mouseleave",this.#t),f.classList.add("popupTriggerArea");for(const f of r)f.container?.addEventListener("keydown",this.#e);this.#i.hidden=!0,d&&this.#w()}render(){if(this.#f)return;const e=this.#f=document.createElement("div");if(e.className="popup",this.#o){const o=e.style.outlineColor=un.makeHexColor(...this.#o);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${o} 30%, white)`:e.style.backgroundColor=un.makeHexColor(...this.#o.map(s=>Math.floor(.7*(255-s)+s)))}const n=document.createElement("span");n.className="header";const r=document.createElement("h1");if(n.append(r),{dir:r.dir,str:r.textContent}=this.#m,e.append(n),this.#l){const o=document.createElement("span");o.classList.add("popupDate"),o.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),o.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#l.valueOf()})),n.append(o)}const i=this.#x;if(i)xX.render({xfaHtml:i,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const o=this._formatContents(this.#s);e.append(o)}this.#i.append(e)}get#x(){const e=this.#v,n=this.#s;return e?.str&&(!n?.str||n.str===e.str)&&this.#v.html||null}get#T(){return this.#x?.attributes?.style?.fontSize||0}get#E(){return this.#x?.attributes?.style?.color||null}#S(e){const n=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},i={style:{color:this.#E,fontSize:this.#T?`calc(${this.#T}px * var(--scale-factor))`:""}};for(const o of e.split(`
570
570
  `))n.push({name:"span",value:o,attributes:i});return r}_formatContents({str:e,dir:n}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const i=e.split(/(?:\r\n?|\n)/);for(let o=0,a=i.length;o<a;++o){const s=i[o];r.append(document.createTextNode(s)),o<a-1&&r.append(document.createElement("br"))}return r}#N(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#a)&&this.#w()}updateEdited({rect:e,popupContent:n}){this.#g||={contentsObj:this.#s,richText:this.#v},e&&(this.#p=null),n&&(this.#v=this.#S(n),this.#s=null),this.#f?.remove(),this.#f=null}resetEdited(){this.#g&&({contentsObj:this.#s,richText:this.#v}=this.#g,this.#g=null,this.#f?.remove(),this.#f=null,this.#p=null)}#A(){if(this.#p!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:o}}}=this.#c;let a=!!this.#d,s=a?this.#d:this.#h;for(const m of this.#u)if(!s||un.intersect(m.data.rect,s)!==null){s=m.data.rect,a=!0;break}const l=un.normalizeRect([s[0],e[3]-s[1]+e[1],s[2],e[3]-s[3]+e[1]]),u=a?s[2]-s[0]+5:0,d=l[0]+u,f=l[1];this.#p=[100*(d-i)/n,100*(f-o)/r];const{style:h}=this.#i;h.left=`${this.#p[0]}%`,h.top=`${this.#p[1]}%`}#w(){this.#a=!this.#a,this.#a?(this.#D(),this.#i.addEventListener("click",this.#r),this.#i.addEventListener("keydown",this.#e)):(this.#k(),this.#i.removeEventListener("click",this.#r),this.#i.removeEventListener("keydown",this.#e))}#D(){this.#f||this.render(),this.isVisible?this.#a&&this.#i.classList.add("focused"):(this.#A(),this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#k(){this.#i.classList.remove("focused"),!(this.#a||!this.isVisible)&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#b=this.isVisible,this.#b&&(this.#i.hidden=!0)}maybeShow(){this.#b&&(this.#f||this.#D(),this.#b=!1,this.#i.hidden=!1)}get isVisible(){return this.#i.hidden===!1}}class EX extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Bn.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const n of this.textContent){const r=document.createElement("span");r.textContent=n,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class mUe extends uo{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:n,height:r}=_d(e.rect),i=this.svgFactory.create(n,r,!0),o=this.#e=this.svgFactory.createElement("svg:line");return o.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),o.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),o.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),o.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),o.setAttribute("stroke-width",e.borderStyle.width||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class vUe extends uo{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:n,height:r}=_d(e.rect),i=this.svgFactory.create(n,r,!0),o=e.borderStyle.width,a=this.#e=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",o/2),a.setAttribute("y",o/2),a.setAttribute("width",n-o),a.setAttribute("height",r-o),a.setAttribute("stroke-width",o||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class bUe extends uo{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:n,height:r}=_d(e.rect),i=this.svgFactory.create(n,r,!0),o=e.borderStyle.width,a=this.#e=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",n/2),a.setAttribute("cy",r/2),a.setAttribute("rx",n/2-o/2),a.setAttribute("ry",r/2-o/2),a.setAttribute("stroke-width",o||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class SX extends uo{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:n,borderStyle:r,popupRef:i}}=this;if(!n)return this.container;const{width:o,height:a}=_d(e),s=this.svgFactory.create(o,a,!0);let l=[];for(let u=0,d=n.length;u<d;u+=2){const f=n[u]-e[0],h=e[3]-n[u+1];l.push(`${f},${h}`)}l=l.join(" ");const c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute("points",l),c.setAttribute("stroke-width",r.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),s.append(c),this.container.append(s),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class yUe extends SX{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class xUe extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class VI extends uo{#e=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Bn.HIGHLIGHT:Bn.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,inkLists:n,borderStyle:r,popupRef:i}}=this,{width:o,height:a}=_d(e),s=this.svgFactory.create(o,a,!0);for(const l of n){let c=[];for(let d=0,f=l.length;d<f;d+=2){const h=l[d]-e[0],m=e[3]-l[d+1];c.push(`${h},${m}`)}c=c.join(" ");const u=this.svgFactory.createElement(this.svgElementName);this.#e.push(u),u.setAttribute("points",c),u.setAttribute("stroke-width",r.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),s.append(u)}return!i&&this.hasPopupData&&this._createPopup(),this.container.append(s),this._editOnDoubleClick(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class DX extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Bn.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class wUe extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class CUe extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class EUe extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class TX extends uo{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Bn.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class SUe extends uo{#e=null;constructor(e){super(e,{isRenderable:!0});const{file:n}=this.data;this.filename=n.filename,this.content=n.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...n})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:n}=this;let r;n.hasAppearance||n.fillAlpha===0?r=document.createElement("div"):(r=document.createElement("img"),r.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name)?"paperclip":"pushpin"}.svg`,n.fillAlpha&&n.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(n.fillAlpha*100)}%);`)),r.addEventListener("dblclick",this.#t.bind(this)),this.#e=r;const{isMac:i}=es.platform;return e.addEventListener("keydown",o=>{o.key==="Enter"&&(i?o.metaKey:o.ctrlKey)&&this.#t()}),!n.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),e.append(r),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let DUe=class{#e=null;#t=null;#n=new Map;#r=null;constructor({div:e,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:i,page:o,viewport:a,structTreeLayer:s}){this.div=e,this.#e=n,this.#t=r,this.#r=s||null,this.page=o,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i}hasEditableAnnotations(){return this.#n.size>0}async#o(e,n){const r=e.firstChild||e,i=r.id=`${SI}${n}`,o=await this.#r?.getAriaAttributes(i);if(o)for(const[a,s]of o)r.setAttribute(a,s);this.div.append(e),this.#e?.moveElementInDOM(this.div,e,r,!1)}async render(e){const{annotations:n}=e,r=this.div;gg(r,this.viewport);const i=new Map,o={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new WI,annotationStorage:e.annotationStorage||new MI,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const a of n){if(a.noHTML)continue;const s=a.annotationType===Mo.POPUP;if(s){const u=i.get(a.id);if(!u)continue;o.elements=u}else{const{width:u,height:d}=_d(a.rect);if(u<=0||d<=0)continue}o.data=a;const l=lUe.create(o);if(!l.isRenderable)continue;if(!s&&a.popupRef){const u=i.get(a.popupRef);u?u.push(l):i.set(a.popupRef,[l])}const c=l.render();a.hidden&&(c.style.visibility="hidden"),await this.#o(c,a.id),l._isEditable&&(this.#n.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}this.#i()}update({viewport:e}){const n=this.div;this.viewport=e,gg(n,{rotation:e.rotation}),this.#i(),n.hidden=!1}#i(){if(!this.#t)return;const e=this.div;for(const[n,r]of this.#t){const i=e.querySelector(`[data-annotation-id="${n}"]`);if(!i)continue;r.className="annotationContent";const{firstChild:o}=i;o?o.nodeName==="CANVAS"?o.replaceWith(r):o.classList.contains("annotationContent")?o.after(r):o.before(r):i.append(r)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(e){return this.#n.get(e)}};const qD=/\r\n?|\n/g;class $o extends _n{#e;#t="";#n=`${this.id}-editor`;#r=null;#o;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=$o.prototype,n=o=>o.isEmpty(),r=dp.TRANSLATE_SMALL,i=dp.TRANSLATE_BIG;return ir(this,"_keyboardManager",new u1([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[r,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,r],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:n}]]))}static _type="freetext";static _editorType=Bn.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#e=e.color||$o._defaultColor||_n._defaultLineColor,this.#o=e.fontSize||$o._defaultFontSize}static initialize(e,n){_n.initialize(e,n);const r=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(r.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,n){switch(e){case kn.FREETEXT_SIZE:$o._defaultFontSize=n;break;case kn.FREETEXT_COLOR:$o._defaultColor=n;break}}updateParams(e,n){switch(e){case kn.FREETEXT_SIZE:this.#i(n);break;case kn.FREETEXT_COLOR:this.#s(n);break}}static get defaultPropertiesToUpdate(){return[[kn.FREETEXT_SIZE,$o._defaultFontSize],[kn.FREETEXT_COLOR,$o._defaultColor||_n._defaultLineColor]]}get propertiesToUpdate(){return[[kn.FREETEXT_SIZE,this.#o],[kn.FREETEXT_COLOR,this.#e]]}#i(e){const n=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-this.#o)*this.parentScale),this.#o=i,this.#u()},r=this.#o;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#s(e){const n=i=>{this.#e=this.editorDiv.style.color=i},r=this.#e;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,n){this._uiManager.translateSelectedEditors(e,n,!0)}getInitialTranslation(){const e=this.parentScale;return[-$o._internalPadding*e,-($o._internalPadding+this.#o)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Bn.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#r=new AbortController;const e=this._uiManager.combinedSignal(this.#r);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#n),this._isDraggable=!0,this.#r?.abort(),this.#r=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.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()}#l(){const e=[];this.editorDiv.normalize();let n=null;for(const r of this.editorDiv.childNodes)n?.nodeType===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push($o.#c(r)),n=r);return e.join(`
571
571
  `)}#u(){const[e,n]=this.parentDimensions;let r;if(this.isAttachedToDOM)r=this.div.getBoundingClientRect();else{const{currentLayer:i,div:o}=this,a=o.style.display,s=o.classList.contains("hidden");o.classList.remove("hidden"),o.style.display="hidden",i.div.append(this.div),r=o.getBoundingClientRect(),o.remove(),o.style.display=a,o.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=r.width/e,this.height=r.height/n):(this.width=r.height/e,this.height=r.width/n),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,n=this.#t=this.#l().trimEnd();if(e===n)return;const r=i=>{if(this.#t=i,!i){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#u()};this.addCommands({cmd:()=>{r(n)},undo:()=>{r(e)},mustExec:!1}),this.#u()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){$o._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,n;this.width&&(e=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#n),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:r}=this.editorDiv;if(r.fontSize=`calc(${this.#o}px * var(--scale-factor))`,r.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),UD(this,this.div,["dblclick","keydown"]),this.width){const[i,o]=this.parentDimensions;if(this.annotationElementId){const{position:a}=this._initialData;let[s,l]=this.getInitialTranslation();[s,l]=this.pageTranslationToScreen(s,l);const[c,u]=this.pageDimensions,[d,f]=this.pageTranslation;let h,m;switch(this.rotation){case 0:h=e+(a[0]-d)/c,m=n+this.height-(a[1]-f)/u;break;case 90:h=e+(a[0]-d)/c,m=n-(a[1]-f)/u,[s,l]=[l,-s];break;case 180:h=e-this.width+(a[0]-d)/c,m=n-(a[1]-f)/u,[s,l]=[-s,-l];break;case 270:h=e+(a[0]-d-this.height*u)/c,m=n+(a[1]-f-this.width*c)/u,[s,l]=[-l,s];break}this.setAt(h*i,m*o,s,l)}else this.setAt(e*i,n*o,this.width*i,this.height*o);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(qD,"")}editorDivPaste(e){const n=e.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]==="text/plain")return;e.preventDefault();const i=$o.#f(n.getData("text")||"").replaceAll(qD,`
@@ -577,7 +577,7 @@ r.autoComplete?o.onChange(l[1]):o.onChange(...l),r?.onChange?.(...l)}return ke("
577
577
  `),position:h,pageIndex:m-1,rect:l.slice(0),rotation:c,id:u,deleted:!1,popupRef:d}}const o=await super.deserialize(e,n,r);return o.#o=e.fontSize,o.#e=un.makeHexColor(...e.color),o.#t=$o.#f(e.value),o.annotationElementId=e.id||null,o._initialData=i,o}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n=$o._internalPadding*this.parentScale,r=this.getRect(n,n),i=_n._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),o={annotationType:Bn.FREETEXT,color:i,fontSize:this.#o,value:this.#a(),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?o:this.annotationElementId&&!this.#p(o)?null:(o.id=this.annotationElementId,o)}#p(e){const{value:n,fontSize:r,color:i,pageIndex:o}=this._initialData;return this._hasBeenMoved||e.value!==n||e.fontSize!==r||e.color.some((a,s)=>a!==i[s])||e.pageIndex!==o}renderAnnotationElement(e){const n=super.renderAnnotationElement(e);if(this.deleted)return n;const{style:r}=n;r.fontSize=`calc(${this.#o}px * var(--scale-factor))`,r.color=this.#e,n.replaceChildren();for(const o of this.#t.split(`
578
578
  `)){const a=document.createElement("div");a.append(o?document.createTextNode(o):document.createElement("br")),n.append(a)}const i=$o._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(i,i),popupContent:this.#t}),n}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class AX{toSVGPath(){Si("Abstract method `toSVGPath` must be implemented.")}get box(){Si("Abstract getter `box` must be implemented.")}serialize(e,n){Si("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){Si("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){Si("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}class Sm{#e;#t=[];#n;#r;#o=[];#i=new Float64Array(18);#s;#l;#u;#c;#d;#a;#f=[];static#p=8;static#h=2;static#v=Sm.#p+Sm.#h;constructor({x:e,y:n},r,i,o,a,s=0){this.#e=r,this.#a=o*i,this.#r=a,this.#i.set([NaN,NaN,NaN,NaN,e,n],6),this.#n=s,this.#c=Sm.#p*i,this.#u=Sm.#v*i,this.#d=i,this.#f.push(e,n)}isEmpty(){return isNaN(this.#i[8])}#m(){const e=this.#i.subarray(4,6),n=this.#i.subarray(16,18),[r,i,o,a]=this.#e;return[(this.#s+(e[0]-n[0])/2-r)/o,(this.#l+(e[1]-n[1])/2-i)/a,(this.#s+(n[0]-e[0])/2-r)/o,(this.#l+(n[1]-e[1])/2-i)/a]}add({x:e,y:n}){this.#s=e,this.#l=n;const[r,i,o,a]=this.#e;let[s,l,c,u]=this.#i.subarray(8,12);const d=e-c,f=n-u,h=Math.hypot(d,f);if(h<this.#u)return!1;const m=h-this.#c,g=m/h,v=g*d,b=g*f;let y=s,x=l;s=c,l=u,c+=v,u+=b,this.#f?.push(e,n);const w=-b/m,C=v/m,E=w*this.#a,S=C*this.#a;return this.#i.set(this.#i.subarray(2,8),0),this.#i.set([c+E,u+S],4),this.#i.set(this.#i.subarray(14,18),12),this.#i.set([c-E,u-S],16),isNaN(this.#i[6])?(this.#o.length===0&&(this.#i.set([s+E,l+S],2),this.#o.push(NaN,NaN,NaN,NaN,(s+E-r)/o,(l+S-i)/a),this.#i.set([s-E,l-S],14),this.#t.push(NaN,NaN,NaN,NaN,(s-E-r)/o,(l-S-i)/a)),this.#i.set([y,x,s,l,c,u],6),!this.isEmpty()):(this.#i.set([y,x,s,l,c,u],6),Math.abs(Math.atan2(x-l,y-s)-Math.atan2(b,v))<Math.PI/2?([s,l,c,u]=this.#i.subarray(2,6),this.#o.push(NaN,NaN,NaN,NaN,((s+c)/2-r)/o,((l+u)/2-i)/a),[s,l,y,x]=this.#i.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((y+s)/2-r)/o,((x+l)/2-i)/a),!0):([y,x,s,l,c,u]=this.#i.subarray(0,6),this.#o.push(((y+5*s)/6-r)/o,((x+5*l)/6-i)/a,((5*s+c)/6-r)/o,((5*l+u)/6-i)/a,((s+c)/2-r)/o,((l+u)/2-i)/a),[c,u,s,l,y,x]=this.#i.subarray(12,18),this.#t.push(((y+5*s)/6-r)/o,((x+5*l)/6-i)/a,((5*s+c)/6-r)/o,((5*l+u)/6-i)/a,((s+c)/2-r)/o,((l+u)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#o,n=this.#t;if(isNaN(this.#i[6])&&!this.isEmpty())return this.#g();const r=[];r.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?r.push(`L${e[i+4]} ${e[i+5]}`):r.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);this.#x(r);for(let i=n.length-6;i>=6;i-=6)isNaN(n[i])?r.push(`L${n[i+4]} ${n[i+5]}`):r.push(`C${n[i]} ${n[i+1]} ${n[i+2]} ${n[i+3]} ${n[i+4]} ${n[i+5]}`);return this.#b(r),r.join(" ")}#g(){const[e,n,r,i]=this.#e,[o,a,s,l]=this.#m();return`M${(this.#i[2]-e)/r} ${(this.#i[3]-n)/i} L${(this.#i[4]-e)/r} ${(this.#i[5]-n)/i} L${o} ${a} L${s} ${l} L${(this.#i[16]-e)/r} ${(this.#i[17]-n)/i} L${(this.#i[14]-e)/r} ${(this.#i[15]-n)/i} Z`}#b(e){const n=this.#t;e.push(`L${n[4]} ${n[5]} Z`)}#x(e){const[n,r,i,o]=this.#e,a=this.#i.subarray(4,6),s=this.#i.subarray(16,18),[l,c,u,d]=this.#m();e.push(`L${(a[0]-n)/i} ${(a[1]-r)/o} L${l} ${c} L${u} ${d} L${(s[0]-n)/i} ${(s[1]-r)/o}`)}newFreeDrawOutline(e,n,r,i,o,a){return new kX(e,n,r,i,o,a)}getOutlines(){const e=this.#o,n=this.#t,r=this.#i,[i,o,a,s]=this.#e,l=new Float64Array((this.#f?.length??0)+2);for(let d=0,f=l.length-2;d<f;d+=2)l[d]=(this.#f[d]-i)/a,l[d+1]=(this.#f[d+1]-o)/s;if(l[l.length-2]=(this.#s-i)/a,l[l.length-1]=(this.#l-o)/s,isNaN(r[6])&&!this.isEmpty())return this.#T(l);const c=new Float64Array(this.#o.length+24+this.#t.length);let u=e.length;for(let d=0;d<u;d+=2){if(isNaN(e[d])){c[d]=c[d+1]=NaN;continue}c[d]=e[d],c[d+1]=e[d+1]}u=this.#S(c,u);for(let d=n.length-6;d>=6;d-=6)for(let f=0;f<6;f+=2){if(isNaN(n[d+f])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=n[d+f],c[u+1]=n[d+f+1],u+=2}return this.#E(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#n,this.#r)}#T(e){const n=this.#i,[r,i,o,a]=this.#e,[s,l,c,u]=this.#m(),d=new Float64Array(36);return d.set([NaN,NaN,NaN,NaN,(n[2]-r)/o,(n[3]-i)/a,NaN,NaN,NaN,NaN,(n[4]-r)/o,(n[5]-i)/a,NaN,NaN,NaN,NaN,s,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(n[16]-r)/o,(n[17]-i)/a,NaN,NaN,NaN,NaN,(n[14]-r)/o,(n[15]-i)/a],0),this.newFreeDrawOutline(d,e,this.#e,this.#d,this.#n,this.#r)}#E(e,n){const r=this.#t;return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],n),n+=6}#S(e,n){const r=this.#i.subarray(4,6),i=this.#i.subarray(16,18),[o,a,s,l]=this.#e,[c,u,d,f]=this.#m();return e.set([NaN,NaN,NaN,NaN,(r[0]-o)/s,(r[1]-a)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,d,f,NaN,NaN,NaN,NaN,(i[0]-o)/s,(i[1]-a)/l],n),n+=24}}class kX extends AX{#e;#t=null;#n;#r;#o;#i;#s;constructor(e,n,r,i,o,a){super(),this.#s=e,this.#o=n,this.#e=r,this.#i=i,this.#n=o,this.#r=a,this.#c(a);const{x:s,y:l,width:c,height:u}=this.#t;for(let d=0,f=e.length;d<f;d+=2)e[d]=(e[d]-s)/c,e[d+1]=(e[d+1]-l)/u;for(let d=0,f=n.length;d<f;d+=2)n[d]=(n[d]-s)/c,n[d+1]=(n[d+1]-l)/u}toSVGPath(){const e=[`M${this.#s[4]} ${this.#s[5]}`];for(let n=6,r=this.#s.length;n<r;n+=6){if(isNaN(this.#s[n])){e.push(`L${this.#s[n+4]} ${this.#s[n+5]}`);continue}e.push(`C${this.#s[n]} ${this.#s[n+1]} ${this.#s[n+2]} ${this.#s[n+3]} ${this.#s[n+4]} ${this.#s[n+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,n,r,i],o){const a=r-e,s=i-n;let l,c;switch(o){case 0:l=this.#l(this.#s,e,i,a,-s),c=this.#l(this.#o,e,i,a,-s);break;case 90:l=this.#u(this.#s,e,n,a,s),c=this.#u(this.#o,e,n,a,s);break;case 180:l=this.#l(this.#s,r,n,-a,s),c=this.#l(this.#o,r,n,-a,s);break;case 270:l=this.#u(this.#s,r,i,-a,-s),c=this.#u(this.#o,r,i,-a,-s);break}return{outline:Array.from(l),points:[Array.from(c)]}}#l(e,n,r,i,o){const a=new Float64Array(e.length);for(let s=0,l=e.length;s<l;s+=2)a[s]=n+e[s]*i,a[s+1]=r+e[s+1]*o;return a}#u(e,n,r,i,o){const a=new Float64Array(e.length);for(let s=0,l=e.length;s<l;s+=2)a[s]=n+e[s+1]*i,a[s+1]=r+e[s]*o;return a}#c(e){const n=this.#s;let r=n[4],i=n[5],o=r,a=i,s=r,l=i,c=r,u=i;const d=e?Math.max:Math.min;for(let v=6,b=n.length;v<b;v+=6){if(isNaN(n[v]))o=Math.min(o,n[v+4]),a=Math.min(a,n[v+5]),s=Math.max(s,n[v+4]),l=Math.max(l,n[v+5]),u<n[v+5]?(c=n[v+4],u=n[v+5]):u===n[v+5]&&(c=d(c,n[v+4]));else{const y=un.bezierBoundingBox(r,i,...n.slice(v,v+6));o=Math.min(o,y[0]),a=Math.min(a,y[1]),s=Math.max(s,y[2]),l=Math.max(l,y[3]),u<y[3]?(c=y[2],u=y[3]):u===y[3]&&(c=d(c,y[2]))}r=n[v+4],i=n[v+5]}const f=o-this.#n,h=a-this.#n,m=s-o+2*this.#n,g=l-a+2*this.#n;this.#t={x:f,y:h,width:m,height:g,lastPoint:[c,u]}}get box(){return this.#t}newOutliner(e,n,r,i,o,a=0){return new Sm(e,n,r,i,o,a)}getNewOutline(e,n){const{x:r,y:i,width:o,height:a}=this.#t,[s,l,c,u]=this.#e,d=o*c,f=a*u,h=r*c+s,m=i*u+l,g=this.newOutliner({x:this.#o[0]*d+h,y:this.#o[1]*f+m},this.#e,this.#i,e,this.#r,n??this.#n);for(let v=2;v<this.#o.length;v+=2)g.add({x:this.#o[v]*d+h,y:this.#o[v+1]*f+m});return g.getOutlines()}get mustRemoveSelfIntersections(){return!0}}class _X{#e;#t=[];#n=[];constructor(e,n=0,r=0,i=!0){let o=1/0,a=-1/0,s=1/0,l=-1/0;const c=10**-4;for(const{x:v,y:b,width:y,height:x}of e){const w=Math.floor((v-n)/c)*c,C=Math.ceil((v+y+n)/c)*c,E=Math.floor((b-n)/c)*c,S=Math.ceil((b+x+n)/c)*c,T=[w,E,S,!0],A=[C,E,S,!1];this.#t.push(T,A),o=Math.min(o,w),a=Math.max(a,C),s=Math.min(s,E),l=Math.max(l,S)}const u=a-o+2*r,d=l-s+2*r,f=o-r,h=s-r,m=this.#t.at(i?-1:-2),g=[m[0],m[2]];for(const v of this.#t){const[b,y,x]=v;v[0]=(b-f)/u,v[1]=(y-h)/d,v[2]=(x-h)/d}this.#e={x:f,y:h,width:u,height:d,lastPoint:g}}getOutlines(){this.#t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of this.#t)n[3]?(e.push(...this.#l(n)),this.#i(n)):(this.#s(n),e.push(...this.#l(n)));return this.#r(e)}#r(e){const n=[],r=new Set;for(const a of e){const[s,l,c]=a;n.push([s,l,a],[s,c,a])}n.sort((a,s)=>a[1]-s[1]||a[0]-s[0]);for(let a=0,s=n.length;a<s;a+=2){const l=n[a][2],c=n[a+1][2];l.push(c),c.push(l),r.add(l),r.add(c)}const i=[];let o;for(;r.size>0;){const a=r.values().next().value;let[s,l,c,u,d]=a;r.delete(a);let f=s,h=l;for(o=[s,c],i.push(o);;){let m;if(r.has(u))m=u;else if(r.has(d))m=d;else break;r.delete(m),[s,l,c,u,d]=m,f!==s&&(o.push(f,h,s,h===l?l:c),f=s),h=h===l?c:l}o.push(f,h)}return new TUe(i,this.#e)}#o(e){const n=this.#n;let r=0,i=n.length-1;for(;r<=i;){const o=r+i>>1,a=n[o][0];if(a===e)return o;a<e?r=o+1:i=o-1}return i+1}#i([,e,n]){const r=this.#o(e);this.#n.splice(r,0,[e,n])}#s([,e,n]){const r=this.#o(e);for(let i=r;i<this.#n.length;i++){const[o,a]=this.#n[i];if(o!==e)break;if(o===e&&a===n){this.#n.splice(i,1);return}}for(let i=r-1;i>=0;i--){const[o,a]=this.#n[i];if(o!==e)break;if(o===e&&a===n){this.#n.splice(i,1);return}}}#l(e){const[n,r,i]=e,o=[[n,r,i]],a=this.#o(i);for(let s=0;s<a;s++){const[l,c]=this.#n[s];for(let u=0,d=o.length;u<d;u++){const[,f,h]=o[u];if(!(c<=f||h<=l)){if(f>=l){if(h>c)o[u][1]=c;else{if(d===1)return[];o.splice(u,1),u--,d--}continue}o[u][2]=l,h>c&&o.push([n,c,h])}}}return o}}class TUe extends AX{#e;#t;constructor(e,n){super(),this.#t=e,this.#e=n}toSVGPath(){const e=[];for(const n of this.#t){let[r,i]=n;e.push(`M${r} ${i}`);for(let o=2;o<n.length;o+=2){const a=n[o],s=n[o+1];a===r?(e.push(`V${s}`),i=s):s===i&&(e.push(`H${a}`),r=a)}e.push("Z")}return e.join(" ")}serialize([e,n,r,i],o){const a=[],s=r-e,l=i-n;for(const c of this.#t){const u=new Array(c.length);for(let d=0;d<c.length;d+=2)u[d]=e+c[d]*s,u[d+1]=i-c[d+1]*l;a.push(u)}return a}get box(){return this.#e}get classNamesForDrawing(){return["highlight"]}get classNamesForOutlining(){return["highlightOutline"]}}class jI extends Sm{newFreeDrawOutline(e,n,r,i,o,a){return new AUe(e,n,r,i,o,a)}get classNamesForDrawing(){return["highlight","free"]}}class AUe extends kX{get classNamesForDrawing(){return["highlight","free"]}get classNamesForOutlining(){return["highlightOutline","free"]}newOutliner(e,n,r,i,o,a=0){return new jI(e,n,r,i,o,a)}}class vc{#e=null;#t=null;#n;#r=null;#o=!1;#i=!1;#s=null;#l;#u=null;#c=null;#d;static#a=null;static get _keyboardManager(){return ir(this,"_keyboardManager",new u1([[["Escape","mac+Escape"],vc.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],vc.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],vc.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],vc.prototype._moveToPrevious],[["Home","mac+Home"],vc.prototype._moveToBeginning],[["End","mac+End"],vc.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:n=null}){e?(this.#i=!1,this.#d=kn.HIGHLIGHT_COLOR,this.#s=e):(this.#i=!0,this.#d=kn.HIGHLIGHT_DEFAULT_COLOR),this.#c=e?._uiManager||n,this.#l=this.#c._eventBus,this.#n=e?.color||this.#c?.highlightColors.values().next().value||"#FFFF98",vc.#a||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const n=this.#c._signal;e.addEventListener("click",this.#v.bind(this),{signal:n}),e.addEventListener("keydown",this.#h.bind(this),{signal:n});const r=this.#t=document.createElement("span");return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=this.#n,e.append(r),e}renderMainDropdown(){const e=this.#r=this.#f();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#f(){const e=document.createElement("div"),n=this.#c._signal;e.addEventListener("contextmenu",Vl,{signal:n}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,i]of this.#c.highlightColors){const o=document.createElement("button");o.tabIndex="0",o.role="option",o.setAttribute("data-color",i),o.title=r,o.setAttribute("data-l10n-id",vc.#a[r]);const a=document.createElement("span");o.append(a),a.className="swatch",a.style.backgroundColor=i,o.setAttribute("aria-selected",i===this.#n),o.addEventListener("click",this.#p.bind(this,i),{signal:n}),e.append(o)}return e.addEventListener("keydown",this.#h.bind(this),{signal:n}),e}#p(e,n){n.stopPropagation(),this.#l.dispatch("switchannotationeditorparams",{source:this,type:this.#d,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#v(e);return}const n=e.target.getAttribute("data-color");n&&this.#p(n,e)}_moveToNext(e){if(!this.#g){this.#v(e);return}if(e.target===this.#e){this.#r.firstChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#r?.firstChild||e.target===this.#e){this.#g&&this._hideDropdownFromKeyboard();return}this.#g||this.#v(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#g){this.#v(e);return}this.#r.firstChild?.focus()}_moveToEnd(e){if(!this.#g){this.#v(e);return}this.#r.lastChild?.focus()}#h(e){vc._keyboardManager.exec(this,e)}#v(e){if(this.#g){this.hideDropdown();return}if(this.#o=e.detail===0,this.#u||(this.#u=new AbortController,window.addEventListener("pointerdown",this.#m.bind(this),{signal:this.#c.combinedSignal(this.#u)})),this.#r){this.#r.classList.remove("hidden");return}const n=this.#r=this.#f();this.#e.append(n)}#m(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add("hidden"),this.#u?.abort(),this.#u=null}get#g(){return this.#r&&!this.#r.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#i){if(!this.#g){this.#s?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#o})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;const n=this.#c.highlightColors.values();for(const r of this.#r.children)r.setAttribute("aria-selected",n.next().value===e)}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}}class fo extends _n{#e=null;#t=0;#n;#r=null;#o=null;#i=null;#s=null;#l=0;#u=null;#c=null;#d=null;#a=!1;#f=null;#p;#h=null;#v="";#m;#g="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Bn.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=fo.prototype;return ir(this,"_keyboardManager",new u1([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||fo._defaultColor,this.#m=e.thickness||fo._defaultThickness,this.#p=e.opacity||fo._defaultOpacity,this.#n=e.boxes||null,this.#g=e.methodOfCreation||"",this.#v=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#a=!0,this.#x(e),this.#A()):this.#n&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#s=e.focusNode,this.#l=e.focusOffset,this.#b(),this.#A(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#a?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#m,methodOfCreation:this.#g}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#b(){const e=new _X(this.#n,.001);this.#c=e.getOutlines(),{x:this.x,y:this.y,width:this.width,height:this.height}=this.#c.box;const n=new _X(this.#n,.0025,.001,this._uiManager.direction==="ltr");this.#i=n.getOutlines();const{lastPoint:r}=this.#i.box;this.#f=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#x({highlightOutlines:e,highlightId:n,clipPathId:r}){this.#c=e;const i=1.5;if(this.#i=e.getNewOutline(this.#m/2+i,.0025),n>=0)this.#d=n,this.#r=r,this.parent.drawLayer.finalizeLine(n,e),this.#h=this.parent.drawLayer.drawOutline(this.#i);else if(this.parent){const u=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#d,e),this.parent.drawLayer.updateBox(this.#d,fo.#w(this.#c.box,(u-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#h,this.#i),this.parent.drawLayer.updateBox(this.#h,fo.#w(this.#i.box,u))}const{x:o,y:a,width:s,height:l}=e.box;switch(this.rotation){case 0:this.x=o,this.y=a,this.width=s,this.height=l;break;case 90:{const[u,d]=this.parentDimensions;this.x=a,this.y=1-o,this.width=s*d/u,this.height=l*u/d;break}case 180:this.x=1-o,this.y=1-a,this.width=s,this.height=l;break;case 270:{const[u,d]=this.parentDimensions;this.x=1-a,this.y=o,this.width=s*d/u,this.height=l*u/d;break}}const{lastPoint:c}=this.#i.box;this.#f=[(c[0]-o)/s,(c[1]-a)/l]}static initialize(e,n){_n.initialize(e,n),fo._defaultColor||=n.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,n){switch(e){case kn.HIGHLIGHT_DEFAULT_COLOR:fo._defaultColor=n;break;case kn.HIGHLIGHT_THICKNESS:fo._defaultThickness=n;break}}translateInPage(e,n){}get toolbarPosition(){return this.#f}updateParams(e,n){switch(e){case kn.HIGHLIGHT_COLOR:this.#T(n);break;case kn.HIGHLIGHT_THICKNESS:this.#E(n);break}}static get defaultPropertiesToUpdate(){return[[kn.HIGHLIGHT_DEFAULT_COLOR,fo._defaultColor],[kn.HIGHLIGHT_THICKNESS,fo._defaultThickness]]}get propertiesToUpdate(){return[[kn.HIGHLIGHT_COLOR,this.color||fo._defaultColor],[kn.HIGHLIGHT_THICKNESS,this.#m||fo._defaultThickness],[kn.HIGHLIGHT_FREE,this.#a]]}#T(e){const n=(o,a)=>{this.color=o,this.parent?.drawLayer.changeColor(this.#d,o),this.#o?.updateColor(o),this.#p=a,this.parent?.drawLayer.changeOpacity(this.#d,a)},r=this.color,i=this.#p;this.addCommands({cmd:n.bind(this,e,fo._defaultOpacity),undo:n.bind(this,r,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#E(e){const n=this.#m,r=i=>{this.#m=i,this.#S(i)};this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#o=new vc({editor:this}),e.addColorPicker(this.#o)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#_())}getBaseTranslation(){return[0,0]}getRect(e,n){return super.getRect(e,n,this.#_())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#N(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#A(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let n=!1;this.parent&&!e?this.#N():e&&(this.#A(e),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),n&&this.select()}#S(e){if(!this.#a)return;this.#x({highlightOutlines:this.#c.getNewOutline(e/2)}),this.fixAndSetPosition();const[n,r]=this.parentDimensions;this.setDims(this.width*n,this.height*r)}#N(){this.#d===null||!this.parent||(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#h),this.#h=null)}#A(e=this.parent){this.#d===null&&({id:this.#d,clipPathId:this.#r}=e.drawLayer.draw(this.#c,this.color,this.#p),this.#h=e.drawLayer.drawOutline(this.#i),this.#u&&(this.#u.style.clipPath=this.#r))}static#w({x:e,y:n,width:r,height:i},o){switch(o){case 90:return{x:1-n-i,y:e,width:i,height:r};case 180:return{x:1-e-r,y:1-n-i,width:r,height:i};case 270:return{x:n,y:1-e-r,width:i,height:r}}return{x:e,y:n,width:r,height:i}}rotate(e){const{drawLayer:n}=this.parent;let r;this.#a?(e=(e-this.rotation+360)%360,r=fo.#w(this.#c.box,e)):r=fo.#w(this,e),n.rotate(this.#d,e),n.rotate(this.#h,e),n.updateBox(this.#d,r),n.updateBox(this.#h,fo.#w(this.#i.box,e))}render(){if(this.div)return this.div;const e=super.render();this.#v&&(e.setAttribute("aria-label",this.#v),e.setAttribute("role","mark")),this.#a?e.classList.add("free"):this.div.addEventListener("keydown",this.#D.bind(this),{signal:this._uiManager._signal});const n=this.#u=document.createElement("div");e.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=this.#r;const[r,i]=this.parentDimensions;return this.setDims(this.width*r,this.height*i),UD(this,this.#u,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#h,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#h,"hovered")}#D(e){fo._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#k(!0);break;case 1:case 3:this.#k(!1);break}}#k(e){if(!this.#e)return;const n=window.getSelection();e?n.setPosition(this.#e,this.#t):n.setPosition(this.#s,this.#l)}select(){super.select(),this.#h&&(this.parent?.drawLayer.removeClass(this.#h,"hovered"),this.parent?.drawLayer.addClass(this.#h,"selected"))}unselect(){super.unselect(),this.#h&&(this.parent?.drawLayer.removeClass(this.#h,"selected"),this.#a||this.#k(!1))}get _mustFixPosition(){return!this.#a}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.show(this.#d,e),this.parent.drawLayer.show(this.#h,e))}#_(){return this.#a?this.rotation:0}#P(){if(this.#a)return null;const[e,n]=this.pageDimensions,[r,i]=this.pageTranslation,o=this.#n,a=new Float32Array(o.length*8);let s=0;for(const{x:l,y:c,width:u,height:d}of o){const f=l*e+r,h=(1-c-d)*n+i;a[s]=a[s+4]=f,a[s+1]=a[s+3]=h,a[s+2]=a[s+6]=f+u*e,a[s+5]=a[s+7]=h+d*n,s+=8}return a}#C(e){return this.#c.serialize(e,this.#_())}static startHighlighting(e,n,{target:r,x:i,y:o}){const{x:a,y:s,width:l,height:c}=r.getBoundingClientRect(),u=new AbortController,d=e.combinedSignal(u),f=m=>{m.preventDefault(),m.stopPropagation()},h=m=>{u.abort(),this.#R(e,m)};window.addEventListener("blur",h,{signal:d}),window.addEventListener("pointerup",h,{signal:d}),window.addEventListener("pointerdown",f,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",Vl,{signal:d}),r.addEventListener("pointermove",this.#y.bind(this,e),{signal:d}),this._freeHighlight=new jI({x:i,y:o},[a,s,l,c],e.scale,this._defaultThickness/2,n,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static#y(e,n){this._freeHighlight.add(n)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#R(e,n){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,n,r){let i=null;if(e instanceof DX){const{data:{quadPoints:m,rect:g,rotation:v,id:b,color:y,opacity:x,popupRef:w},parent:{page:{pageNumber:C}}}=e;i=e={annotationType:Bn.HIGHLIGHT,color:Array.from(y),opacity:x,quadPoints:m,boxes:null,pageIndex:C-1,rect:g.slice(0),rotation:v,id:b,deleted:!1,popupRef:w}}else if(e instanceof VI){const{data:{inkLists:m,rect:g,rotation:v,id:b,color:y,borderStyle:{rawWidth:x},popupRef:w},parent:{page:{pageNumber:C}}}=e;i=e={annotationType:Bn.HIGHLIGHT,color:Array.from(y),thickness:x,inkLists:m,boxes:null,pageIndex:C-1,rect:g.slice(0),rotation:v,id:b,deleted:!1,popupRef:w}}const{color:o,quadPoints:a,inkLists:s,opacity:l}=e,c=await super.deserialize(e,n,r);c.color=un.makeHexColor(...o),c.#p=l||1,s&&(c.#m=e.thickness),c.annotationElementId=e.id||null,c._initialData=i;const[u,d]=c.pageDimensions,[f,h]=c.pageTranslation;if(a){const m=c.#n=[];for(let g=0;g<a.length;g+=8)m.push({x:(a[g]-f)/u,y:1-(a[g+1]-h)/d,width:(a[g+2]-a[g])/u,height:(a[g+1]-a[g+5])/d});c.#b(),c.#A(),c.rotate(c.rotation)}else if(s){c.#a=!0;const m=s[0],g={x:m[0]-f,y:d-(m[1]-h)},v=new jI(g,[0,0,u,d],1,c.#m/2,!0,.001);for(let x=0,w=m.length;x<w;x+=2)g.x=m[x]-f,g.y=d-(m[x+1]-h),v.add(g);const{id:b,clipPathId:y}=n.drawLayer.draw(v,c.color,c._defaultOpacity,!0);c.#x({highlightOutlines:v.getOutlines(),highlightId:b,clipPathId:y}),c.#A()}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const n=this.getRect(0,0),r=_n._colorManager.convert(this.color),i={annotationType:Bn.HIGHLIGHT,color:r,opacity:this.#p,thickness:this.#m,quadPoints:this.#P(),outlines:this.#C(n),pageIndex:this.pageIndex,rect:n,rotation:this.#_(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#I(i)?null:(i.id=this.annotationElementId,i)}#I(e){const{color:n}=this._initialData;return e.color.some((r,i)=>r!==n[i])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class ba extends _n{#e=0;#t=0;#n=null;#r=new Path2D;#o=!1;#i=null;#s=!1;#l=!1;#u=null;#c=null;#d=0;#a=0;#f=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=Bn.INK;constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.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(e,n){_n.initialize(e,n)}static updateDefaultParams(e,n){switch(e){case kn.INK_THICKNESS:ba._defaultThickness=n;break;case kn.INK_COLOR:ba._defaultColor=n;break;case kn.INK_OPACITY:ba._defaultOpacity=n/100;break}}updateParams(e,n){switch(e){case kn.INK_THICKNESS:this.#p(n);break;case kn.INK_COLOR:this.#h(n);break;case kn.INK_OPACITY:this.#v(n);break}}static get defaultPropertiesToUpdate(){return[[kn.INK_THICKNESS,ba._defaultThickness],[kn.INK_COLOR,ba._defaultColor||_n._defaultLineColor],[kn.INK_OPACITY,Math.round(ba._defaultOpacity*100)]]}get propertiesToUpdate(){return[[kn.INK_THICKNESS,this.thickness||ba._defaultThickness],[kn.INK_COLOR,this.color||ba._defaultColor||_n._defaultLineColor],[kn.INK_OPACITY,Math.round(100*(this.opacity??ba._defaultOpacity))]]}#p(e){const n=i=>{this.thickness=i,this.#M()},r=this.thickness;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#h(e){const n=i=>{this.color=i,this.#w()},r=this.color;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#v(e){const n=i=>{this.opacity=i,this.#w()};e/=100;const r=this.opacity;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:kn.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(this.#P(),this.#C()),this.isAttachedToDOM||(this.parent.add(this),this.#y()),this.#M()))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#n&&(clearTimeout(this.#n),this.#n=null),this.#u?.disconnect(),this.#u=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&e===null&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,n]=this.parentDimensions,r=this.width*e,i=this.height*n;this.setDimensions(r,i)}enableEditMode(){this.#o||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.#D())}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#k())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}#m(){const{parentRotation:e,parentDimensions:[n,r]}=this;switch(e){case 90:return[0,r,r,n];case 180:return[n,r,n,r];case 270:return[n,0,r,n];default:return[0,0,n,r]}}#g(){const{ctx:e,color:n,opacity:r,thickness:i,parentScale:o,scaleFactor:a}=this;e.lineWidth=i*o/a,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${n}${X$e(r)}`}#b(e,n){this.canvas.addEventListener("contextmenu",Vl,{signal:this._uiManager._signal}),this.#k(),this.#i=new AbortController;const r=this._uiManager.combinedSignal(this.#i);this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:r}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:r}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:r}),this.isEditing=!0,this.#l||(this.#l=!0,this.#y(),this.thickness||=ba._defaultThickness,this.color||=ba._defaultColor||_n._defaultLineColor,this.opacity??=ba._defaultOpacity),this.currentPath.push([e,n]),this.#s=!1,this.#g(),this.#f=()=>{this.#S(),this.#f&&window.requestAnimationFrame(this.#f)},window.requestAnimationFrame(this.#f)}#x(e,n){const[r,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===r&&n===i)return;const o=this.currentPath;let a=this.#r;if(o.push([e,n]),this.#s=!0,o.length<=2){a.moveTo(...o[0]),a.lineTo(e,n);return}o.length===3&&(this.#r=a=new Path2D,a.moveTo(...o[0])),this.#N(a,...o.at(-3),...o.at(-2),e,n)}#T(){if(this.currentPath.length===0)return;const e=this.currentPath.at(-1);this.#r.lineTo(...e)}#E(e,n){this.#f=null,e=Math.min(Math.max(e,0),this.canvas.width),n=Math.min(Math.max(n,0),this.canvas.height),this.#x(e,n),this.#T();let r;if(this.currentPath.length!==1)r=this.#A();else{const l=[e,n];r=[[l,l.slice(),l.slice(),l]]}const i=this.#r,o=this.currentPath;this.currentPath=[],this.#r=new Path2D;const a=()=>{this.allRawPaths.push(o),this.paths.push(r),this.bezierPath2D.push(i),this._uiManager.rebuild(this)},s=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(this.#P(),this.#C()),this.#M())};this.addCommands({cmd:a,undo:s,mustExec:!0})}#S(){if(!this.#s)return;this.#s=!1;const e=Math.ceil(this.thickness*this.parentScale),n=this.currentPath.slice(-3),r=n.map(a=>a[0]),i=n.map(a=>a[1]);Math.min(...r)-e,Math.max(...r)+e,Math.min(...i)-e,Math.max(...i)+e;const{ctx:o}=this;o.save(),o.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)o.stroke(a);o.stroke(this.#r),o.restore()}#N(e,n,r,i,o,a,s){const l=(n+i)/2,c=(r+o)/2,u=(i+a)/2,d=(o+s)/2;e.bezierCurveTo(l+2*(i-l)/3,c+2*(o-c)/3,u+2*(i-u)/3,d+2*(o-d)/3,u,d)}#A(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const n=[];let r,[i,o]=e[0];for(r=1;r<e.length-2;r++){const[f,h]=e[r],[m,g]=e[r+1],v=(f+m)/2,b=(h+g)/2,y=[i+2*(f-i)/3,o+2*(h-o)/3],x=[v+2*(f-v)/3,b+2*(h-b)/3];n.push([[i,o],y,x,[v,b]]),[i,o]=[v,b]}const[a,s]=e[r],[l,c]=e[r+1],u=[i+2*(a-i)/3,o+2*(s-o)/3],d=[l+2*(a-l)/3,c+2*(s-c)/3];return n.push([[i,o],u,d,[l,c]]),n}#w(){if(this.isEmpty()){this.#I();return}this.#g();const{canvas:e,ctx:n}=this;n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,e.width,e.height),this.#I();for(const r of this.bezierPath2D)n.stroke(r)}commit(){this.#o||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#o=!0,this.div.classList.add("disabled"),this.#M(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}#D(){if(this.#c)return;this.#c=new AbortController;const e=this._uiManager.combinedSignal(this.#c);this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:e})}#k(){this.pointerdownAC?.abort(),this.pointerdownAC=null}canvasPointerdown(e){e.button!==0||!this.isInEditMode()||this.#o||(this.setInForeground(),e.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#b(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#x(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#_(e)}canvasPointerleave(e){this.#_(e)}#_(e){this.#i?.abort(),this.#i=null,this.#D(),this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>{this.#n=null,this.canvas.removeEventListener("contextmenu",Vl)},10),this.#E(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#P(){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")}#C(){this.#u=new ResizeObserver(e=>{const n=e[0].contentRect;n.width&&n.height&&this.setDimensions(n.width,n.height)}),this.#u.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#u?.disconnect(),this.#u=null},{once:!0})}get isResizable(){return!this.isEmpty()&&this.#o}render(){if(this.div)return this.div;let e,n;this.width&&(e=this.x,n=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[r,i,o,a]=this.#m();if(this.setAt(r,i,0,0),this.setDims(o,a),this.#P(),this.width){const[s,l]=this.parentDimensions;this.setAspectRatio(this.width*s,this.height*l),this.setAt(e*s,n*l,this.width*s,this.height*l),this.#l=!0,this.#y(),this.setDims(this.width*s,this.height*l),this.#w(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#C(),this.div}#y(){if(!this.#l)return;const[e,n]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*n),this.#I()}setDimensions(e,n){const r=Math.round(e),i=Math.round(n);if(this.#d===r&&this.#a===i)return;this.#d=r,this.#a=i,this.canvas.style.visibility="hidden";const[o,a]=this.parentDimensions;this.width=e/o,this.height=n/a,this.fixAndSetPosition(),this.#o&&this.#R(e,n),this.#y(),this.#w(),this.canvas.style.visibility="visible",this.fixDims()}#R(e,n){const r=this.#U(),i=(e-r)/this.#t,o=(n-r)/this.#e;this.scaleFactor=Math.min(i,o)}#I(){const e=this.#U()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#L(e){const n=new Path2D;for(let r=0,i=e.length;r<i;r++){const[o,a,s,l]=e[r];r===0&&n.moveTo(...o),n.bezierCurveTo(a[0],a[1],s[0],s[1],l[0],l[1])}return n}static#W(e,n,r){const[i,o,a,s]=n;switch(r){case 0:for(let l=0,c=e.length;l<c;l+=2)e[l]+=i,e[l+1]=s-e[l+1];break;case 90:for(let l=0,c=e.length;l<c;l+=2){const u=e[l];e[l]=e[l+1]+i,e[l+1]=u+o}break;case 180:for(let l=0,c=e.length;l<c;l+=2)e[l]=a-e[l],e[l+1]+=o;break;case 270:for(let l=0,c=e.length;l<c;l+=2){const u=e[l];e[l]=a-e[l+1],e[l+1]=s-u}break;default:throw new Error("Invalid rotation")}return e}static#$(e,n,r){const[i,o,a,s]=n;switch(r){case 0:for(let l=0,c=e.length;l<c;l+=2)e[l]-=i,e[l+1]=s-e[l+1];break;case 90:for(let l=0,c=e.length;l<c;l+=2){const u=e[l];e[l]=e[l+1]-o,e[l+1]=u-i}break;case 180:for(let l=0,c=e.length;l<c;l+=2)e[l]=a-e[l],e[l+1]-=o;break;case 270:for(let l=0,c=e.length;l<c;l+=2){const u=e[l];e[l]=s-e[l+1],e[l+1]=a-u}break;default:throw new Error("Invalid rotation")}return e}#F(e,n,r,i){const o=[],a=this.thickness/2,s=e*n+a,l=e*r+a;for(const c of this.paths){const u=[],d=[];for(let f=0,h=c.length;f<h;f++){const[m,g,v,b]=c[f];if(m[0]===b[0]&&m[1]===b[1]&&h===1){const R=e*m[0]+s,P=e*m[1]+l;u.push(R,P),d.push(R,P);break}const y=e*m[0]+s,x=e*m[1]+l,w=e*g[0]+s,C=e*g[1]+l,E=e*v[0]+s,S=e*v[1]+l,T=e*b[0]+s,A=e*b[1]+l;f===0&&(u.push(y,x),d.push(y,x)),u.push(w,C,E,S,T,A),d.push(w,C),f===h-1&&d.push(T,A)}o.push({bezier:ba.#W(u,i,this.rotation),points:ba.#W(d,i,this.rotation)})}return o}#B(){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const o of this.paths)for(const[a,s,l,c]of o){const u=un.bezierBoundingBox(...a,...s,...l,...c);e=Math.min(e,u[0]),r=Math.min(r,u[1]),n=Math.max(n,u[2]),i=Math.max(i,u[3])}return[e,r,n,i]}#U(){return this.#o?Math.ceil(this.thickness*this.parentScale):0}#M(e=!1){if(this.isEmpty())return;if(!this.#o){this.#w();return}const n=this.#B(),r=this.#U();this.#t=Math.max(_n.MIN_SIZE,n[2]-n[0]),this.#e=Math.max(_n.MIN_SIZE,n[3]-n[1]);const i=Math.ceil(r+this.#t*this.scaleFactor),o=Math.ceil(r+this.#e*this.scaleFactor),[a,s]=this.parentDimensions;this.width=i/a,this.height=o/s,this.setAspectRatio(i,o);const l=this.translationX,c=this.translationY;this.translationX=-n[0],this.translationY=-n[1],this.#y(),this.#w(),this.#d=i,this.#a=o,this.setDims(i,o);const u=e?r/this.scaleFactor/2:0;this.translate(l-this.translationX-u,c-this.translationY-u)}static async deserialize(e,n,r){if(e instanceof VI)return null;const i=await super.deserialize(e,n,r);i.thickness=e.thickness,i.color=un.makeHexColor(...e.color),i.opacity=e.opacity;const[o,a]=i.pageDimensions,s=i.width*o,l=i.height*a,c=i.parentScale,u=e.thickness/2;i.#o=!0,i.#d=Math.round(s),i.#a=Math.round(l);const{paths:d,rect:f,rotation:h}=e;for(let{bezier:g}of d){g=ba.#$(g,f,h);const v=[];i.paths.push(v);let b=c*(g[0]-u),y=c*(g[1]-u);for(let w=2,C=g.length;w<C;w+=6){const E=c*(g[w]-u),S=c*(g[w+1]-u),T=c*(g[w+2]-u),A=c*(g[w+3]-u),R=c*(g[w+4]-u),P=c*(g[w+5]-u);v.push([[b,y],[E,S],[T,A],[R,P]]),b=R,y=P}const x=this.#L(v);i.bezierPath2D.push(x)}const m=i.#B();return i.#t=Math.max(_n.MIN_SIZE,m[2]-m[0]),i.#e=Math.max(_n.MIN_SIZE,m[3]-m[1]),i.#R(s,l),i}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),n=_n._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Bn.INK,color:n,thickness:this.thickness,opacity:this.opacity,paths:this.#F(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class o9 extends _n{#e=null;#t=null;#n=null;#r=null;#o=null;#i="";#s=null;#l=null;#u=null;#c=!1;#d=!1;static _type="stamp";static _editorType=Bn.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#r=e.bitmapUrl,this.#o=e.bitmapFile}static initialize(e,n){_n.initialize(e,n)}static get supportedTypes(){return ir(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(n=>`image/${n}`))}static get supportedTypesStr(){return ir(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,n){n.pasteEditor(Bn.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const n=e.get("hasAltText");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}#a(e,n=!1){if(!e){this.remove();return}this.#e=e.bitmap,n||(this.#t=e.id,this.#c=e.isSvg),e.file&&(this.#i=e.file.name),this.#h()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),!!this.#s){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._editToolbar.hide(),this._uiManager.editAltText(this,!0);return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,n=!0){if(this.hasAltTextData())return null;const{mlManager:r}=this._uiManager;if(!r)throw new Error("No ML.");if(!await r.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:o,height:a}=e||this.copyCanvas(null,null,!0).imageData,s=await r.guess({name:"altText",request:{data:i,width:o,height:a,channels:i.length/(o*a)}});if(!s)throw new Error("No response from the AI service.");if(s.error)throw new Error("Error from the AI service.");if(s.cancel)return null;if(!s.output)throw new Error("No valid response from the AI service.");const l=s.output;return await this.setGuessedAltText(l),n&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(r=>this.#a(r,!0)).finally(()=>this.#f());return}if(this.#r){const r=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(r).then(i=>this.#a(i)).finally(()=>this.#f());return}if(this.#o){const r=this.#o;this.#o=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(r).then(i=>this.#a(i)).finally(()=>this.#f());return}const e=document.createElement("input");e.type="file",e.accept=o9.supportedTypesStr;const n=this._uiManager._signal;this.#n=new Promise(r=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#a(i)}r()},{signal:n}),e.addEventListener("cancel",()=>{this.remove(),r()},{signal:n})}).finally(()=>this.#f()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#s?.remove(),this.#s=null,this.#l?.disconnect(),this.#l=null,this.#u&&(clearTimeout(this.#u),this.#u=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#s===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#o||this.#t)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,n;if(this.width&&(e=this.x,n=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#e?this.#h():this.#p(),this.width&&!this.annotationElementId){const[r,i]=this.parentDimensions;this.setAt(e*r,n*i,this.width*r,this.height*i)}return this.div}#h(){const{div:e}=this;let{width:n,height:r}=this.#e;const[i,o]=this.pageDimensions,a=.75;if(this.width)n=this.width*i,r=this.height*o;else if(n>a*i||r>a*o){const u=Math.min(a*i/n,a*o/r);n*=u,r*=u}const[s,l]=this.parentDimensions;this.setDims(n*s/i,r*l/o),this._uiManager.enableWaiting(!1);const c=this.#s=document.createElement("canvas");c.setAttribute("role","img"),this.addContainer(c),(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#g(n,r),this.#x(),this.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#i&&c.setAttribute("aria-label",this.#i)}copyCanvas(e,n,r=!1){e||(e=224);const{width:i,height:o}=this.#e,a=new kI;let s=this.#e,l=i,c=o,u=null;if(n){if(i>n||o>n){const E=Math.min(n/i,n/o);l=Math.floor(i*E),c=Math.floor(o*E)}u=document.createElement("canvas");const f=u.width=Math.ceil(l*a.sx),h=u.height=Math.ceil(c*a.sy);this.#c||(s=this.#m(f,h));const m=u.getContext("2d");m.filter=this._uiManager.hcmFilter;let g="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(g="#8f8f9d",v="#42414d");const b=15,y=b*a.sx,x=b*a.sy,w=new OffscreenCanvas(y*2,x*2),C=w.getContext("2d");C.fillStyle=g,C.fillRect(0,0,y*2,x*2),C.fillStyle=v,C.fillRect(0,0,y,x),C.fillRect(y,x,y,x),m.fillStyle=m.createPattern(w,"repeat"),m.fillRect(0,0,f,h),m.drawImage(s,0,0,s.width,s.height,0,0,f,h)}let d=null;if(r){let f,h;if(a.symmetric&&s.width<e&&s.height<e)f=s.width,h=s.height;else if(s=this.#e,i>e||o>e){const v=Math.min(e/i,e/o);f=Math.floor(i*v),h=Math.floor(o*v),this.#c||(s=this.#m(f,h))}const g=new OffscreenCanvas(f,h).getContext("2d",{willReadFrequently:!0});g.drawImage(s,0,0,s.width,s.height,0,0,f,h),d={width:f,height:h,data:g.getImageData(0,0,f,h).data}}return{canvas:u,width:l,height:c,imageData:d}}#v(e,n){const[r,i]=this.parentDimensions;this.width=e/r,this.height=n/i,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this.#u!==null&&clearTimeout(this.#u);const o=200;this.#u=setTimeout(()=>{this.#u=null,this.#g(e,n)},o)}#m(e,n){const{width:r,height:i}=this.#e;let o=r,a=i,s=this.#e;for(;o>2*e||a>2*n;){const l=o,c=a;o>2*e&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2)),a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const u=new OffscreenCanvas(o,a);u.getContext("2d").drawImage(s,0,0,l,c,0,0,o,a),s=u.transferToImageBitmap()}return s}#g(e,n){const r=new kI,i=Math.ceil(e*r.sx),o=Math.ceil(n*r.sy),a=this.#s;if(!a||a.width===i&&a.height===o)return;a.width=i,a.height=o;const s=this.#c?this.#e:this.#m(i,o),l=a.getContext("2d");l.filter=this._uiManager.hcmFilter,l.drawImage(s,0,0,s.width,s.height,0,0,i,o)}getImageForAltText(){return this.#s}#b(e){if(e){if(this.#c){const i=this._uiManager.imageManager.getSvgUrl(this.#t);if(i)return i}const n=document.createElement("canvas");return{width:n.width,height:n.height}=this.#e,n.getContext("2d").drawImage(this.#e,0,0),n.toDataURL()}if(this.#c){const[n,r]=this.pageDimensions,i=Math.round(this.width*n*ab.PDF_TO_CSS_UNITS),o=Math.round(this.height*r*ab.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(i,o);return a.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,i,o),a.transferToImageBitmap()}return structuredClone(this.#e)}#x(){this._uiManager._signal&&(this.#l=new ResizeObserver(e=>{const n=e[0].contentRect;n.width&&n.height&&this.#v(n.width,n.height)}),this.#l.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#l?.disconnect(),this.#l=null},{once:!0}))}static async deserialize(e,n,r){let i=null;if(e instanceof TX){const{data:{rect:m,rotation:g,id:v,structParent:b,popupRef:y},container:x,parent:{page:{pageNumber:w}}}=e,C=x.querySelector("canvas"),E=r.imageManager.getFromCanvas(x.id,C);C.remove();const S=(await n._structTree.getAriaAttributes(`${SI}${v}`))?.get("aria-label")||"";i=e={annotationType:Bn.STAMP,bitmapId:E.id,bitmap:E.bitmap,pageIndex:w-1,rect:m.slice(0),rotation:g,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:S},isSvg:!1,structParent:b,popupRef:y}}const o=await super.deserialize(e,n,r),{rect:a,bitmap:s,bitmapUrl:l,bitmapId:c,isSvg:u,accessibilityData:d}=e;c&&r.imageManager.isValidId(c)?(o.#t=c,s&&(o.#e=s)):o.#r=l,o.#c=u;const[f,h]=o.pageDimensions;return o.width=(a[2]-a[0])/f,o.height=(a[3]-a[1])/h,o.annotationElementId=e.id||null,d&&(o.altTextData=d),o._initialData=i,o.#d=!!i,o}serialize(e=!1,n=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r={annotationType:Bn.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(e)return r.bitmapUrl=this.#b(!0),r.accessibilityData=this.serializeAltText(!0),r;const{decorative:i,altText:o}=this.serializeAltText(!1);if(!i&&o&&(r.accessibilityData={type:"Figure",alt:o}),this.annotationElementId){const s=this.#T(r);if(s.isSame)return null;s.isSameAltText?delete r.accessibilityData:r.accessibilityData.structParent=this._initialData.structParent??-1}if(r.id=this.annotationElementId,n===null)return r;n.stamps||=new Map;const a=this.#c?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(!n.stamps.has(this.#t))n.stamps.set(this.#t,{area:a,serialized:r}),r.bitmap=this.#b(!1);else if(this.#c){const s=n.stamps.get(this.#t);a>s.area&&(s.area=a,s.serialized.bitmap.close(),s.serialized.bitmap=this.#b(!1))}return r}#T(e){const{rect:n,pageIndex:r,accessibilityData:{altText:i}}=this._initialData,o=e.rect.every((l,c)=>Math.abs(l-n[c])<1),a=e.pageIndex===r,s=(e.accessibilityData?.alt||"")===i;return{isSame:o&&a&&s,isSameAltText:s}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}}class bf{#e;#t=!1;#n=null;#r=null;#o=null;#i=new Map;#s=!1;#l=!1;#u=!1;#c=null;#d=null;#a;static _initialized=!1;static#f=new Map([$o,ba,o9,fo].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:o,annotationLayer:a,drawLayer:s,textLayer:l,viewport:c,l10n:u}){const d=[...bf.#f.values()];if(!bf._initialized){bf._initialized=!0;for(const f of d)f.initialize(u,e)}e.registerEditorTypes(d),this.#a=e,this.pageIndex=n,this.div=r,this.#e=o,this.#n=a,this.viewport=c,this.#c=l,this.drawLayer=s,this._structTree=i,this.#a.addLayer(this)}get isEmpty(){return this.#i.size===0}get isInvisible(){return this.isEmpty&&this.#a.getMode()===Bn.NONE}updateToolbar(e){this.#a.updateToolbar(e)}updateMode(e=this.#a.getMode()){switch(this.#g(),e){case Bn.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Bn.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Bn.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;for(const r of bf.#f.values())n.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#c?.div}addInkEditorIfNeeded(e){if(this.#a.getMode()!==Bn.INK)return;if(!e){for(const r of this.#i.values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){this.#a.setEditingState(e)}addCommands(e){this.#a.addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.div.classList.toggle("disabled",!e)}async enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of this.#i.values())r.enableEditing(),r.show(!0),r.annotationElementId&&(this.#a.removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!this.#n)return;const n=this.#n.getEditableAnnotations();for(const r of n){if(r.hide(),this.#a.isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const i=await this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){this.#u=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,n=new Map;for(const i of this.#i.values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){e.set(i.annotationElementId,i);continue}else n.set(i.annotationElementId,i);this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()}if(this.#n){const i=this.#n.getEditableAnnotations();for(const o of i){const{id:a}=o.data;if(this.#a.isDeletedAnnotationElement(a))continue;let s=n.get(a);if(s){s.resetAnnotationElement(o),s.show(!1),o.show();continue}s=e.get(a),s&&(this.#a.addChangedExistingAnnotation(s),s.renderAnnotationElement(o)&&s.show(!1)),o.show()}}this.#g(),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of bf.#f.values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#u=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#a.getActive()!==e&&this.#a.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#c?.div&&!this.#d){this.#d=new AbortController;const e=this.#a.combinedSignal(this.#d);this.#c.div.addEventListener("pointerdown",this.#p.bind(this),{signal:e}),this.#c.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#c?.div&&this.#d&&(this.#d.abort(),this.#d=null,this.#c.div.classList.remove("highlighting"))}#p(e){this.#a.unselectAll();const{target:n}=e;if(n===this.#c.div||(n.getAttribute("role")==="img"||n.classList.contains("endOfContent"))&&this.#c.div.contains(n)){const{isMac:r}=es.platform;if(e.button!==0||e.ctrlKey&&r)return;this.#a.showAllEditors("highlight",!0,!0),this.#c.div.classList.add("free"),this.toggleDrawing(),fo.startHighlighting(this,this.#a.direction==="ltr",{target:this.#c.div,x:e.x,y:e.y}),this.#c.div.addEventListener("pointerup",()=>{this.#c.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#a._signal}),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;const e=this.#a.combinedSignal(this.#r);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#i.set(e.id,e);const{annotationElementId:n}=e;n&&this.#a.isDeletedAnnotationElement(n)&&this.#a.removeDeletedAnnotationElement(e)}detach(e){this.#i.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#u&&e.annotationElementId&&this.#a.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#a.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,this.#l||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#a.addDeletedAnnotationElement(e.annotationElementId),_n.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#a.addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),this.#a.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!this.#o&&(e._focusEventsAllowed=!1,this.#o=setTimeout(()=>{this.#o=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#a._signal}),n.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const n=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:n,undo:r,mustExec:!1})}getNextId(){return this.#a.getId()}get#h(){return bf.#f.get(this.#a.getMode())}combinedSignal(e){return this.#a.combinedSignal(e)}#v(e){const n=this.#h;return n?new n.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#h?.canCreateNewEmptyEditor()}pasteEditor(e,n){this.#a.updateToolbar(e),this.#a.updateMode(e);const{offsetX:r,offsetY:i}=this.#m(),o=this.getNextId(),a=this.#v({parent:this,id:o,x:r,y:i,uiManager:this.#a,isCentered:!0,...n});a&&this.add(a)}async deserialize(e){return await bf.#f.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#a)||null}createAndAddNewEditor(e,n,r={}){const i=this.getNextId(),o=this.#v({parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:this.#a,isCentered:n,...r});return o&&this.add(o),o}#m(){const{x:e,y:n,width:r,height:i}=this.div.getBoundingClientRect(),o=Math.max(0,e),a=Math.max(0,n),s=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,n+i),c=(o+s)/2-e,u=(a+l)/2-n,[d,f]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:d,offsetY:f}}addNewEditor(){this.createAndAddNewEditor(this.#m(),!0)}setSelected(e){this.#a.setSelected(e)}toggleSelected(e){this.#a.toggleSelected(e)}unselect(e){this.#a.unselect(e)}pointerup(e){const{isMac:n}=es.platform;if(!(e.button!==0||e.ctrlKey&&n)&&e.target===this.div&&this.#s){if(this.#s=!1,!this.#t){this.#t=!0;return}if(this.#a.getMode()===Bn.STAMP){this.#a.unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(this.#a.getMode()===Bn.HIGHLIGHT&&this.enableTextSelection(),this.#s){this.#s=!1;return}const{isMac:n}=es.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;this.#s=!0;const r=this.#a.getActive();this.#t=!r||r.isEmpty()}findNewParent(e,n,r){const i=this.#a.findParent(n,r);return i===null||i===this?!1:(i.changeParent(e),!0)}destroy(){this.#a.getActive()?.parent===this&&(this.#a.commitOrRemove(),this.#a.setActiveEditor(null)),this.#o&&(clearTimeout(this.#o),this.#o=null);for(const e of this.#i.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#i.clear(),this.#a.removeLayer(this)}#g(){this.#l=!0;for(const e of this.#i.values())e.isEmpty()&&e.remove();this.#l=!1}render({viewport:e}){this.viewport=e,gg(this.div,e);for(const n of this.#a.getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){this.#a.commitOrRemove(),this.#g();const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,gg(this.div,{rotation:r}),n!==r)for(const i of this.#i.values())i.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return this.#a.viewParameters.realScale}}class Wa{#e=null;#t=0;#n=new Map;#r=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#n.size>0)for(const n of this.#n.values())n.remove(),e.append(n);this.#e=e}}static get _svgFactory(){return ir(this,"_svgFactory",new WI)}static#o(e,{x:n=0,y:r=0,width:i=1,height:o=1}={}){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*n}%`,a.width=`${100*i}%`,a.height=`${100*o}%`}#i(e){const n=Wa._svgFactory.create(1,1,!0);return this.#e.append(n),n.setAttribute("aria-hidden",!0),Wa.#o(n,e),n}#s(e,n){const r=Wa._svgFactory.createElement("clipPath");e.append(r);const i=`clip_${n}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");const o=Wa._svgFactory.createElement("use");return r.append(o),o.setAttribute("href",`#${n}`),o.classList.add("clip"),i}draw(e,n,r,i=!1){const o=this.#t++,a=this.#i(e.box);a.classList.add(...e.classNamesForDrawing);const s=Wa._svgFactory.createElement("defs");a.append(s);const l=Wa._svgFactory.createElement("path");s.append(l);const c=`path_p${this.pageIndex}_${o}`;l.setAttribute("id",c),l.setAttribute("d",e.toSVGPath()),i&&this.#r.set(o,l);const u=this.#s(s,c),d=Wa._svgFactory.createElement("use");return a.append(d),a.setAttribute("fill",n),a.setAttribute("fill-opacity",r),d.setAttribute("href",`#${c}`),this.#n.set(o,a),{id:o,clipPathId:`url(#${u})`}}drawOutline(e){const n=this.#t++,r=this.#i(e.box);r.classList.add(...e.classNamesForOutlining);const i=Wa._svgFactory.createElement("defs");r.append(i);const o=Wa._svgFactory.createElement("path");i.append(o);const a=`path_p${this.pageIndex}_${n}`;o.setAttribute("id",a),o.setAttribute("d",e.toSVGPath()),o.setAttribute("vector-effect","non-scaling-stroke");let s;if(e.mustRemoveSelfIntersections){const u=Wa._svgFactory.createElement("mask");i.append(u),s=`mask_p${this.pageIndex}_${n}`,u.setAttribute("id",s),u.setAttribute("maskUnits","objectBoundingBox");const d=Wa._svgFactory.createElement("rect");u.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");const f=Wa._svgFactory.createElement("use");u.append(f),f.setAttribute("href",`#${a}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const l=Wa._svgFactory.createElement("use");r.append(l),l.setAttribute("href",`#${a}`),s&&l.setAttribute("mask",`url(#${s})`);const c=l.cloneNode();return r.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.#n.set(n,r),n}finalizeLine(e,n){const r=this.#r.get(e);this.#r.delete(e),this.updateBox(e,n.box),r.setAttribute("d",n.toSVGPath())}updateLine(e,n){this.#n.get(e).firstChild.firstChild.setAttribute("d",n.toSVGPath())}updatePath(e,n){this.#r.get(e).setAttribute("d",n.toSVGPath())}updateBox(e,n){Wa.#o(this.#n.get(e),n)}show(e,n){this.#n.get(e).classList.toggle("hidden",!n)}rotate(e,n){this.#n.get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){this.#n.get(e).setAttribute("fill",n)}changeOpacity(e,n){this.#n.get(e).setAttribute("fill-opacity",n)}addClass(e,n){this.#n.get(e).classList.add(n)}removeClass(e,n){this.#n.get(e).classList.remove(n)}getSVGRoot(e){return this.#n.get(e)}remove(e){this.#r.delete(e),this.#e!==null&&(this.#n.get(e).remove(),this.#n.delete(e))}destroy(){this.#e=null;for(const e of this.#n.values())e.remove();this.#n.clear(),this.#r.clear()}}var kUe=Mn.AbortException,_Ue=Mn.AnnotationEditorLayer,MUe=Mn.AnnotationEditorParamsType,OUe=Mn.AnnotationEditorType,PUe=Mn.AnnotationEditorUIManager,MX=Mn.AnnotationLayer,OX=Mn.AnnotationMode,RUe=Mn.ColorPicker,IUe=Mn.DOMSVGFactory,NUe=Mn.DrawLayer,LUe=Mn.FeatureTest,GD=Mn.GlobalWorkerOptions,FUe=Mn.ImageKind,BUe=Mn.InvalidPDFException,$Ue=Mn.MissingPDFException,zUe=Mn.OPS,UUe=Mn.OutputScale,WUe=Mn.PDFDataRangeTransport,HUe=Mn.PDFDateString,VUe=Mn.PDFWorker,jUe=Mn.PasswordResponses,YUe=Mn.PermissionFlag,qUe=Mn.PixelsPerInch,GUe=Mn.RenderingCancelledException,PX=Mn.TextLayer,XUe=Mn.UnexpectedResponseException,KUe=Mn.Util,ZUe=Mn.VerbosityLevel,JUe=Mn.XfaLayer,QUe=Mn.build,e7e=Mn.createValidAbsoluteUrl,t7e=Mn.fetchData,RX=Mn.getDocument,n7e=Mn.getFilenameFromUrl,r7e=Mn.getPdfFilenameFromUrl,i7e=Mn.getXfaPageViewport,o7e=Mn.isDataScheme,a7e=Mn.isPdfFile,s7e=Mn.noContextMenu,l7e=Mn.normalizeUnicode,c7e=Mn.setLayerDimensions,u7e=Mn.shadow,d7e=Mn.version,f7e=Object.freeze({__proto__:null,AbortException:kUe,AnnotationEditorLayer:_Ue,AnnotationEditorParamsType:MUe,AnnotationEditorType:OUe,AnnotationEditorUIManager:PUe,AnnotationLayer:MX,AnnotationMode:OX,ColorPicker:RUe,DOMSVGFactory:IUe,DrawLayer:NUe,FeatureTest:LUe,GlobalWorkerOptions:GD,ImageKind:FUe,InvalidPDFException:BUe,MissingPDFException:$Ue,OPS:zUe,OutputScale:UUe,PDFDataRangeTransport:WUe,PDFDateString:HUe,PDFWorker:VUe,PasswordResponses:jUe,PermissionFlag:YUe,PixelsPerInch:qUe,RenderingCancelledException:GUe,TextLayer:PX,UnexpectedResponseException:XUe,Util:KUe,VerbosityLevel:ZUe,XfaLayer:JUe,build:QUe,createValidAbsoluteUrl:e7e,fetchData:t7e,getDocument:RX,getFilenameFromUrl:n7e,getPdfFilenameFromUrl:r7e,getXfaPageViewport:i7e,isDataScheme:o7e,isPdfFile:a7e,noContextMenu:s7e,normalizeUnicode:l7e,setLayerDimensions:c7e,shadow:u7e,version:d7e}),zo=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},h7e=["onCopy","onCut","onPaste"],p7e=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],g7e=["onFocus","onBlur"],m7e=["onInput","onInvalid","onReset","onSubmit"],v7e=["onLoad","onError"],b7e=["onKeyDown","onKeyPress","onKeyUp"],y7e=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],x7e=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],w7e=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],C7e=["onSelect"],E7e=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],S7e=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],D7e=["onScroll"],T7e=["onWheel"],A7e=["onAnimationStart","onAnimationEnd","onAnimationIteration"],k7e=["onTransitionEnd"],_7e=["onToggle"],M7e=["onChange"],O7e=zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo(zo([],h7e,!0),p7e,!0),g7e,!0),m7e,!0),v7e,!0),b7e,!0),y7e,!0),x7e,!0),w7e,!0),C7e,!0),E7e,!0),S7e,!0),D7e,!0),T7e,!0),A7e,!0),k7e,!0),M7e,!0),_7e,!0);function IX(t,e){var n={};return O7e.forEach(function(r){var i=t[r];i&&(e?n[r]=(function(o){return i(o,e(r))}):n[r]=i)}),n}function m1(t){var e=!1,n=new Promise(function(r,i){t.then(function(o){return!e&&r(o)}).catch(function(o){return!e&&i(o)})});return{promise:n,cancel:function(){e=!0}}}var P7e=process.env.NODE_ENV==="production",YI="Invariant failed";function ri(t,e){if(!t){if(P7e)throw new Error(YI);var n=typeof e=="function"?e():e,r=n?"".concat(YI,": ").concat(n):YI;throw new Error(r)}}var R7e=process.env.NODE_ENV!=="production",NX=function(){};if(R7e){var I7e=function(e,n){var r=arguments.length;n=new Array(r>1?r-1:0);for(var i=1;i<r;i++)n[i-1]=arguments[i];var o=0,a="Warning: "+e.replace(/%s/g,function(){return n[o++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}};NX=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||I7e.apply(null,[e].concat(n))}}var N7e=NX,Ma=di(N7e),LX=Object.prototype.hasOwnProperty;function FX(t,e,n){for(n of t.keys())if(lb(n,e))return n}function lb(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&lb(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=FX(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=FX(e,i),!i)||!lb(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(LX.call(t,n)&&++r&&!LX.call(e,n)||!(n in e)||!lb(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const BX=Ap(null);function cb({children:t,type:e}){return M("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}const L7e="noopener noreferrer nofollow";class F7e{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return ri(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(e){ri(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(n=>{ri(this.pdfDocument,"PDF document not loaded."),ri(e,"Destination is not specified."),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{ri(Array.isArray(n),`"${n}" is not a valid destination array.`);const r=n[0];new Promise(i=>{ri(this.pdfDocument,"PDF document not loaded."),r instanceof Object?this.pdfDocument.getPageIndex(r).then(o=>{i(o)}).catch(()=>{ri(!1,`"${r}" is not a valid page reference.`)}):typeof r=="number"?i(r):ri(!1,`"${r}" is not a valid destination reference.`)}).then(i=>{const o=i+1;ri(this.pdfViewer,"PDF viewer is not initialized."),ri(o>=1&&o<=this.pagesCount,`"${o}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:i,pageNumber:o})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const n=e-1;ri(this.pdfViewer,"PDF viewer is not initialized."),ri(e>=1&&e<=this.pagesCount,`"${e}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||L7e,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const $X={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},XD=typeof window<"u",zX=XD&&window.location.protocol==="file:";function B7e(t){return typeof t<"u"}function bg(t){return B7e(t)&&t!==null}function $7e(t){return typeof t=="string"}function z7e(t){return t instanceof ArrayBuffer}function U7e(t){return ri(XD,"isBlob can only be used in a browser environment"),t instanceof Blob}function qI(t){return $7e(t)&&/^data:/.test(t)}function UX(t){ri(qI(t),"Invalid data URI.");const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function W7e(){return XD&&window.devicePixelRatio||1}const WX="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function HX(){Ma(!zX,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${WX}`)}function H7e(){Ma(!zX,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${WX}`)}function yg(t){t?.cancel&&t.cancel()}function GI(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 V7e(t){return t.name==="RenderingCancelledException"}function j7e(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return n(new Error("Error while reading a file."));e(r.result)},r.onerror=i=>{if(!i.target)return n(new Error("Error while reading a file."));const{error:o}=i.target;if(!o)return n(new Error("Error while reading a file."));switch(o.code){case o.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case o.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case o.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},r.readAsArrayBuffer(t)})}function Y7e(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 ub(){return UM(Y7e,{value:void 0,error:void 0})}var q7e=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(d){a(d)}}function l(u){try{c(r.throw(u))}catch(d){a(d)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},VX=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const{PDFDataRangeTransport:G7e}=f7e,X7e=(t,e)=>{switch(e){case $X.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case $X.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function jX(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const K7e=Ui(function(e,n){var{children:r,className:i,error:o="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:s,file:l,inputRef:c,imageResourcesPath:u,loading:d="Loading PDF\u2026",noData:f="No PDF file specified.",onItemClick:h,onLoadError:m,onLoadProgress:g,onLoadSuccess:v,onPassword:b=X7e,onSourceError:y,onSourceSuccess:x,options:w,renderMode:C,rotate:E}=e,S=VX(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[T,A]=ub(),{value:R,error:P}=T,[_,I]=ub(),{value:k,error:F}=_,L=mt(new F7e),$=mt([]),N=mt(void 0),B=mt(void 0);l&&l!==N.current&&jX(l)&&(Ma(!lb(l,N.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.`),N.current=l),w&&w!==B.current&&(Ma(!lb(w,B.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.`),B.current=w);const W=mt({scrollPageIntoView:ce=>{const{dest:U,pageNumber:ue,pageIndex:le=ue-1}=ce;if(h){h({dest:U,pageIndex:le,pageNumber:ue});return}const ne=$.current[le];if(ne){ne.scrollIntoView();return}Ma(!1,`An internal link leading to page ${ue} 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>.`)}});cu(n,()=>({linkService:L,pages:$,viewer:W}),[]);function Y(){x&&x()}function q(){P&&(Ma(!1,P.toString()),y&&y(P))}function ee(){A({type:"RESET"})}_t(ee,[l,A]);const Q=xr(()=>q7e(this,void 0,void 0,function*(){if(!l)return null;if(typeof l=="string")return qI(l)?{data:UX(l)}:(HX(),{url:l});if(l instanceof G7e)return{range:l};if(z7e(l))return{data:l};if(XD&&U7e(l))return{data:yield j7e(l)};if(ri(typeof l=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),ri(jX(l),"Invalid parameter object: need either .data, .range or .url"),"url"in l&&typeof l.url=="string"){if(qI(l.url)){const{url:ce}=l,U=VX(l,["url"]),ue=UX(ce);return Object.assign({data:ue},U)}HX()}return l}),[l]);_t(()=>{const ce=m1(Q());return ce.promise.then(U=>{A({type:"RESOLVE",value:U})}).catch(U=>{A({type:"REJECT",error:U})}),()=>{yg(ce)}},[Q,A]),_t(()=>{if(!(typeof R>"u")){if(R===!1){q();return}Y()}},[R]);function J(){k&&(v&&v(k),$.current=new Array(k.numPages),L.current.setDocument(k))}function re(){F&&(Ma(!1,F.toString()),m&&m(F))}_t(function(){I({type:"RESET"})},[I,R]),_t(function(){if(!R)return;const U=w?Object.assign(Object.assign({},R),w):R,ue=RX(U);g&&(ue.onProgress=g),b&&(ue.onPassword=b);const le=ue,ne=le.promise.then(Z=>{I({type:"RESOLVE",value:Z})}).catch(Z=>{le.destroyed||I({type:"REJECT",error:Z})});return()=>{ne.finally(()=>le.destroy())}},[w,I,R]),_t(()=>{if(!(typeof k>"u")){if(k===!1){re();return}J()}},[k]),_t(function(){L.current.setViewer(W.current),L.current.setExternalLinkRel(a),L.current.setExternalLinkTarget(s)},[a,s]);const ie=xr((ce,U)=>{$.current[ce]=U},[]),he=xr(ce=>{delete $.current[ce]},[]),xe=Rn(()=>({imageResourcesPath:u,linkService:L.current,onItemClick:h,pdf:k,registerPage:ie,renderMode:C,rotate:E,unregisterPage:he}),[u,h,k,ie,C,E,he]),Se=Rn(()=>IX(S,()=>k),[S,k]);function ye(){return M(BX.Provider,{value:xe,children:r})}function K(){return l?k==null?M(cb,{type:"loading",children:typeof d=="function"?d():d}):k===!1?M(cb,{type:"error",children:typeof o=="function"?o():o}):ye():M(cb,{type:"no-data",children:typeof f=="function"?f():f})}return M("div",Object.assign({className:et("react-pdf__Document",i),ref:c,style:{"--scale-factor":"1"}},Se,{children:K()}))});function YX(){return Um(BX)}function qX(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean);if(n.length<=1){var r=n[0];return r||null}return function(o){n.forEach(function(a){typeof a=="function"?a(o):a&&(a.current=o)})}}const GX=Ap(null),XX={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},Z7e=/^H(\d+)$/;function J7e(t){return t in XX}function KD(t){return"children"in t}function KX(t){return KD(t)?t.children.length===1&&0 in t.children&&"id"in t.children[0]:!1}function Q7e(t){const e={};if(KD(t)){const{role:n}=t,r=n.match(Z7e);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if(J7e(n)){const i=XX[n];i&&(e.role=i)}}return e}function ZX(t){const e={};if(KD(t)){if(t.alt!==void 0&&(e["aria-label"]=t.alt),t.lang!==void 0&&(e.lang=t.lang),KX(t)){const[n]=t.children;if(n){const r=ZX(n);return Object.assign(Object.assign({},e),r)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function eWe(t){return t?Object.assign(Object.assign({},Q7e(t)),ZX(t)):null}function JX({className:t,node:e}){const n=Rn(()=>eWe(e),[e]),r=Rn(()=>!KD(e)||KX(e)?null:e.children.map((i,o)=>M(JX,{node:i},o)),[e]);return M("span",Object.assign({className:t},n,{children:r}))}function ZD(){return Um(GX)}function tWe(){const t=ZD();ri(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[r,i]=ub(),{value:o,error:a}=r,{customTextRenderer:s,page:l}=t;function c(){o&&n&&n(o)}function u(){a&&(Ma(!1,a.toString()),e&&e(a))}return _t(function(){i({type:"RESET"})},[i,l]),_t(function(){if(s||!l)return;const f=m1(l.getStructTree()),h=f;return f.promise.then(m=>{i({type:"RESOLVE",value:m})}).catch(m=>{i({type:"REJECT",error:m})}),()=>yg(h)},[s,l,i]),_t(()=>{if(o!==void 0){if(o===!1){u();return}c()}},[o]),o?M(JX,{className:"react-pdf__Page__structTree structTree",node:o}):null}const QX=OX;function nWe(t){const e=ZD();ri(e,"Unable to find Page context.");const n=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:i,devicePixelRatio:o=W7e(),onRenderError:a,onRenderSuccess:s,page:l,renderForms:c,renderTextLayer:u,rotate:d,scale:f}=n,{canvasRef:h}=t;ri(l,"Attempted to render page canvas, but no page was specified.");const m=mt(null);function g(){l&&s&&s(GI(l,f))}function v(w){V7e(w)||(Ma(!1,w.toString()),a&&a(w))}const b=Rn(()=>l.getViewport({scale:f*o,rotation:d}),[o,l,d,f]),y=Rn(()=>l.getViewport({scale:f,rotation:d}),[l,d,f]);_t(function(){if(!l)return;l.cleanup();const{current:C}=m;if(!C)return;C.width=b.width,C.height=b.height,C.style.width=`${Math.floor(y.width)}px`,C.style.height=`${Math.floor(y.height)}px`,C.style.visibility="hidden";const E={annotationMode:c?QX.ENABLE_FORMS:QX.ENABLE,canvasContext:C.getContext("2d",{alpha:!1}),viewport:b};i&&(E.background=i);const S=l.render(E),T=S;return S.promise.then(()=>{C.style.visibility="",g()}).catch(v),()=>yg(T)},[i,l,c,b,y]);const x=xr(()=>{const{current:w}=m;w&&(w.width=0,w.height=0)},[]);return _t(()=>x,[x]),M("canvas",{className:`${r}__canvas`,dir:"ltr",ref:qX(h,m),style:{display:"block",userSelect:"none"},children:u?M(tWe,{}):null})}function rWe(t){return"str"in t}function iWe(){const t=ZD();ri(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:i,onRenderTextLayerSuccess:o,page:a,pageIndex:s,pageNumber:l,rotate:c,scale:u}=t;ri(a,"Attempted to load page text content, but no page was specified.");const[d,f]=ub(),{value:h,error:m}=d,g=mt(null);Ma(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function v(){h&&r&&r(h)}function b(){m&&(Ma(!1,m.toString()),n&&n(m))}_t(function(){f({type:"RESET"})},[a,f]),_t(function(){if(!a)return;const T=m1(a.getTextContent()),A=T;return T.promise.then(R=>{f({type:"RESOLVE",value:R})}).catch(R=>{f({type:"REJECT",error:R})}),()=>yg(A)},[a,f]),_t(()=>{if(h!==void 0){if(h===!1){b();return}v()}},[h]);const y=xr(()=>{o&&o()},[o]),x=xr(S=>{Ma(!1,S.toString()),i&&i(S)},[i]);function w(){const S=g.current;S&&S.classList.add("selecting")}function C(){const S=g.current;S&&S.classList.remove("selecting")}const E=Rn(()=>a.getViewport({scale:u,rotation:c}),[a,c,u]);return Ks(function(){if(!a||!h)return;const{current:T}=g;if(!T)return;T.innerHTML="";const A=a.streamTextContent({includeMarkedContent:!0}),R={container:T,textContentSource:A,viewport:E},P=new PX(R),_=P;return P.render().then(()=>{const I=document.createElement("div");I.className="endOfContent",T.append(I);const k=T.querySelectorAll('[role="presentation"]');if(e){let F=0;h.items.forEach((L,$)=>{if(!rWe(L))return;const N=k[F];if(!N)return;const B=e(Object.assign({pageIndex:s,pageNumber:l,itemIndex:$},L));N.innerHTML=B,F+=L.str&&L.hasEOL?2:1})}y()}).catch(x),()=>yg(_)},[e,x,y,a,s,l,h,E]),M("div",{className:et("react-pdf__Page__textContent","textLayer"),onMouseUp:C,onMouseDown:w,ref:g})}function oWe(){const t=YX(),e=ZD();ri(e,"Unable to find Page context.");const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:i,onGetAnnotationsError:o,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:s,onRenderAnnotationLayerSuccess:l,page:c,pdf:u,renderForms:d,rotate:f,scale:h=1}=n;ri(u,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),ri(c,"Attempted to load page annotations, but no page was specified."),ri(i,"Attempted to load page annotations, but no linkService was specified.");const[m,g]=ub(),{value:v,error:b}=m,y=mt(null);Ma(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function x(){v&&a&&a(v)}function w(){b&&(Ma(!1,b.toString()),o&&o(b))}_t(function(){g({type:"RESET"})},[g,c]),_t(function(){if(!c)return;const A=m1(c.getAnnotations()),R=A;return A.promise.then(P=>{g({type:"RESOLVE",value:P})}).catch(P=>{g({type:"REJECT",error:P})}),()=>{yg(R)}},[g,c]),_t(()=>{if(v!==void 0){if(v===!1){w();return}x()}},[v]);function C(){l&&l()}function E(T){Ma(!1,`${T}`),s&&s(T)}const S=Rn(()=>c.getViewport({scale:h,rotation:f}),[c,f,h]);return _t(function(){if(!u||!c||!i||!v)return;const{current:A}=y;if(!A)return;const R=S.clone({dontFlip:!0}),P={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:A,l10n:null,page:c,structTreeLayer:null,viewport:R},_={annotations:v,annotationStorage:u.annotationStorage,div:A,imageResourcesPath:r,linkService:i,page:c,renderForms:d,viewport:R};A.innerHTML="";try{new MX(P).render(_),C()}catch(I){E(I)}return()=>{}},[v,r,i,c,u,d,S]),M("div",{className:et("react-pdf__Page__annotations","annotationLayer"),ref:y})}var aWe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const eK=1;function sWe(t){const e=YX(),n=Object.assign(Object.assign({},e),t),{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:i=!0,canvasBackground:o,canvasRef:a,children:s,className:l,customRenderer:c,customTextRenderer:u,devicePixelRatio:d,error:f="Failed to load the page.",height:h,inputRef:m,loading:g="Loading page\u2026",noData:v="No page specified.",onGetAnnotationsError:b,onGetAnnotationsSuccess:y,onGetStructTreeError:x,onGetStructTreeSuccess:w,onGetTextError:C,onGetTextSuccess:E,onLoadError:S,onLoadSuccess:T,onRenderAnnotationLayerError:A,onRenderAnnotationLayerSuccess:R,onRenderError:P,onRenderSuccess:_,onRenderTextLayerError:I,onRenderTextLayerSuccess:k,pageIndex:F,pageNumber:L,pdf:$,registerPage:N,renderAnnotationLayer:B=!0,renderForms:W=!1,renderMode:Y="canvas",renderTextLayer:q=!0,rotate:ee,scale:Q=eK,unregisterPage:J,width:re}=n,ie=aWe(n,["_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"]),[he,xe]=ub(),{value:Se,error:ye}=he,K=mt(null);ri($,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ce=bg(L)?L-1:F??null,U=L??(bg(F)?F+1:null),ue=ee??(Se?Se.rotate:null),le=Rn(()=>{if(!Se)return null;let Me=1;const Ee=Q??eK;if(re||h){const De=Se.getViewport({scale:1,rotation:ue});re?Me=re/De.width:h&&(Me=h/De.height)}return Ee*Me},[h,Se,ue,Q,re]);_t(function(){return()=>{bg(ce)&&i&&J&&J(ce)}},[i,$,ce,J]);function ne(){if(T){if(!Se||!le)return;T(GI(Se,le))}if(i&&N){if(!bg(ce)||!K.current)return;N(ce,K.current)}}function Z(){ye&&(Ma(!1,ye.toString()),S&&S(ye))}_t(function(){xe({type:"RESET"})},[xe,$,ce]),_t(function(){if(!$||!U)return;const Ee=m1($.getPage(U)),De=Ee;return Ee.promise.then(Re=>{xe({type:"RESOLVE",value:Re})}).catch(Re=>{xe({type:"REJECT",error:Re})}),()=>yg(De)},[xe,$,U]),_t(()=>{if(Se!==void 0){if(Se===!1){Z();return}ne()}},[Se,le]);const fe=Rn(()=>Se&&bg(ce)&&U&&bg(ue)&&bg(le)?{_className:r,canvasBackground:o,customTextRenderer:u,devicePixelRatio:d,onGetAnnotationsError:b,onGetAnnotationsSuccess:y,onGetStructTreeError:x,onGetStructTreeSuccess:w,onGetTextError:C,onGetTextSuccess:E,onRenderAnnotationLayerError:A,onRenderAnnotationLayerSuccess:R,onRenderError:P,onRenderSuccess:_,onRenderTextLayerError:I,onRenderTextLayerSuccess:k,page:Se,pageIndex:ce,pageNumber:U,renderForms:W,renderTextLayer:q,rotate:ue,scale:le}:null,[r,o,u,d,b,y,x,w,C,E,A,R,P,_,I,k,Se,ce,U,W,q,ue,le]),de=Rn(()=>IX(ie,()=>Se&&(le?GI(Se,le):void 0)),[ie,Se,le]),pe=`${ce}@${le}/${ue}`;function ge(){switch(Y){case"custom":return ri(c,'renderMode was set to "custom", but no customRenderer was passed.'),M(c,{},`${pe}_custom`);case"none":return null;case"canvas":default:return M(nWe,{canvasRef:a},`${pe}_canvas`)}}function se(){return q?M(iWe,{},`${pe}_text`):null}function ae(){return B?M(oWe,{},`${pe}_annotations`):null}function ve(){return ke(GX.Provider,{value:fe,children:[ge(),se(),ae(),s]})}function we(){return U?$===null||Se===void 0||Se===null?M(cb,{type:"loading",children:typeof g=="function"?g():g}):$===!1||Se===!1?M(cb,{type:"error",children:typeof f=="function"?f():f}):ve():M(cb,{type:"no-data",children:typeof v=="function"?v():v})}return M("div",Object.assign({className:et(r,l),"data-page-number":U,ref:qX(m,K),style:{"--scale-factor":`${le}`,backgroundColor:o||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},de,{children:we()}))}H7e(),GD.workerSrc="pdf.worker.mjs",GD.workerSrc=S9,GD.workerSrc=S9;const XI=({fileUrl:t,fileData:e,handleClose:n})=>{const[r,i]=Tt(0),[o,a]=Tt(1),[s,l]=Tt(1),[c,u]=Tt("1"),d=({numPages:S})=>{i(S),a(1),u("1")},f=()=>{l(S=>Math.min(S+.2,3))},h=()=>{l(S=>Math.max(S-.2,.5))},m=()=>{a(S=>{const T=Math.max(S-1,1);return u(String(T)),T})},g=()=>{a(S=>{const T=Math.min(S+1,r);return u(String(T)),T})},v=S=>{u(S.target.value)},b=()=>{const S=parseInt(c,10);!isNaN(S)&&S>=1&&S<=r?a(S):u(String(o))},y=S=>{S.key==="Enter"&&b()},x=()=>{const S=document.getElementById("pdf-container");S&&S.requestFullscreen&&S.requestFullscreen()},w=()=>{if(t){const S=document.createElement("a");S.href=t,S.download="document.pdf",S.click()}else if(e){const S=new Blob([e],{type:"application/pdf"}),T=URL.createObjectURL(S),A=document.createElement("a");A.href=T,A.download="document.pdf",A.click(),URL.revokeObjectURL(T)}},C=()=>{window.print()},E=e||t;return ke("div",{id:"pdf-container",style:{width:"100%",height:"100vh",backgroundColor:"#323639",display:"flex",flexDirection:"column"},children:[ke("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:"20px",height:"60px",backgroundColor:"#1e1e1e",borderBottom:"1px solid #454545"},children:[ke("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[M("button",{onClick:h,style:{background:"transparent",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center"},"aria-label":"Zoom out",children:M(mAe,{size:24})}),ke("span",{style:{color:"white",minWidth:"60px",textAlign:"center"},children:[Math.round(s*100),"%"]}),M("button",{onClick:f,style:{background:"transparent",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center"},"aria-label":"Zoom in",children:M(gAe,{size:24})})]}),ke("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[M("button",{onClick:m,disabled:o<=1,style:{background:"transparent",border:"none",cursor:o<=1?"not-allowed":"pointer",color:o<=1?"#666":"white",display:"flex",alignItems:"center"},"aria-label":"Previous page",children:M(wAe,{size:24})}),M("input",{type:"text",value:c,onChange:v,onBlur:b,onKeyPress:y,style:{width:"50px",textAlign:"center",backgroundColor:"#2c2c2c",border:"1px solid #454545",color:"white",padding:"4px",borderRadius:"4px"},"aria-label":"Current page"}),ke("div",{style:{color:"white"},children:["/ ",r]}),M("button",{onClick:g,disabled:o>=r,style:{background:"transparent",border:"none",cursor:o>=r?"not-allowed":"pointer",color:o>=r?"#666":"white",display:"flex",alignItems:"center"},"aria-label":"Next page",children:M(CAe,{size:24})})]}),ke("div",{style:{display:"flex",gap:"10px"},children:[M("button",{onClick:x,style:{background:"transparent",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center"},"aria-label":"Fullscreen",children:M(TAe,{size:24})}),M("button",{onClick:w,style:{background:"transparent",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center"},"aria-label":"Download",children:M(yAe,{size:24})}),M("button",{onClick:C,style:{background:"transparent",border:"none",cursor:"pointer",color:"white",display:"flex",alignItems:"center"},"aria-label":"Print",children:M(fAe,{size:24})}),M(SAe,{size:24,onClick:n,style:{cursor:"pointer",color:"white"},"aria-label":"Close"})]})]}),M("div",{style:{flex:1,overflow:"auto",display:"flex",justifyContent:"center",padding:"20px"},children:M(K7e,{file:E,onLoadSuccess:d,loading:M("div",{style:{color:"white",padding:"20px"},children:"Loading PDF..."}),error:M("div",{style:{color:"red",padding:"20px"},children:"Failed to load PDF file."}),children:M(sWe,{pageNumber:o,scale:s,renderTextLayer:!0,renderAnnotationLayer:!0,loading:M("div",{style:{color:"white"},children:"Loading page..."})})})})]})};function lWe({name:t="",rules:e={},Component:n,...r}){const{control:i,setValue:o}=Wm(),{field:a,fieldState:{error:s}}=Hm({control:i,name:t,rules:e,shouldUnregister:!0,defaultValue:r?.defaultValue});_t(()=>{(r?.defaultValue!==null||r?.defaultValue!==void 0)&&o(t,r?.defaultValue)},[r?.defaultValue]);function l(...c){a.onChange(...c),r?.onChange?.(...c)}return ke(yr,{children:[M(n,{...a,...r,error:s,onChange:l}),s&&s.message&&M(Ja,{variant:"caption",sx:{color:"red"},children:s.message})]})}var cWe=$e.memo(lWe);function uWe({style:t,sx:e,children:n,onSubmit:r,loading:i=!1,submitLoading:o=!1,formState:a}){return M(E9,{...a,children:ke("form",{noValidate:!0,className:"app-form-container",onSubmit:s=>(s&&(typeof s.preventDefault=="function"&&s.preventDefault(),typeof s.stopPropagation=="function"&&s.stopPropagation()),a?.handleSubmit(async l=>{r?.(l)})(s)),style:{...e,...t},children:[i?M(nl,{}):n,o&&M("div",{className:"app-form-container__loading",children:M(nl,{})})]})})}var tK=$e.memo(uWe);function dWe({name:t="",rules:e={},...n}){const{control:r,setValue:i}=Wm(),o=Rn(()=>n?.defaultValue,[]),{field:a,fieldState:{error:s}}=Hm({control:r,name:t,rules:e,shouldUnregister:!0,defaultValue:o});_t(()=>{(o!==null||o!==void 0)&&i(t,o)},[o]);function l(...c){a.onChange(...c),n?.onChange?.(...c)}return ke(yr,{children:[M(Zj,{...a,...n,onChange:l}),s&&s.message&&M(Ja,{variant:"caption",sx:{color:"red"},children:s.message})]})}var fWe=$e.memo(dWe);function nK({name:t="",rules:e={},options:n,multiple:r=!1,defaultValue:i,valueField:o,labelField:a,loading:s=!1,getOptionValue:l,getOptionImage:c,basePathImages:u,size:d="small",imageSize:f="md",disableSearchable:h,...m}){const{control:g,setValue:v,getValues:b}=Wm(),y=Rn(()=>{if(!i)return r?[]:null;if(r)if(o&&a){const E=i[o],S=i[a];return!S||!E?[]:E?.map((A,R)=>{const P={[a]:S[R],[o]:A};return o==="EnumTitle"&&(P.id=A),P})}else return[];else return i},[]),{field:x,fieldState:{error:w}}=Hm({control:g,name:t,rules:e,shouldUnregister:!0,defaultValue:y});_t(()=>{i&&v(t,y)},[y]);function C(...E){x.onChange(E[1]),m?.onChange?.(E[1])}return ke(yr,{children:[M(Px,{...x,...m,size:d,getOptionKey:l,defaultValue:y,multiple:r,options:n,renderOption:c?(E,S)=>{const T=c(S);return y9("div",{...E,key:l?.(S),style:{padding:"10px",cursor:"pointer",display:"flex",flexDirection:"row",gap:"8px"}},M("img",{src:(u?.basePathStream??"")+T,style:{maxWidth:f==="lg"?"100px":f==="md"?"75px":"50px"}}),m.getOptionLabel?.(S))}:void 0,onChange:C,renderInput:E=>y9(xv,{...E,key:m?.key,placeholder:m?.placeholder,variant:m?.variant,label:m.label,autoComplete:m.autoComplete,error:!!w,required:!!m?.required,helperText:w?void 0:m?.helperText,inputProps:{...E.inputProps,readOnly:h?!0:E.inputProps?.readOnly},InputProps:{...E.InputProps,...m?.InputProps,endAdornment:ke(yr,{children:[s?M(nl,{color:"inherit",size:20}):null,E.InputProps.endAdornment]})}})}),w&&w.message&&M(Ja,{variant:"caption",sx:{color:"red"},children:w.message})]})}function hWe({onScrollEnd:t,onSearch:e,limitCharacterSearch:n=3,delaySearch:r=700,...i}){let o,a;function s(d,f,h){clearTimeout(o),clearTimeout(a),f.length===0&&(a=setTimeout(()=>{e&&e(f)},350)),f.length>=n&&(o=setTimeout(()=>{e&&e(f)},r))}const l=mt(null),c=mt(0),u=d=>{const f=d.target;c.current!==f.scrollTop&&(c.current=f.scrollTop,f.scrollTop+f.clientHeight===f.scrollHeight&&!i?.loading&&t&&t())};return _t(()=>{l.current&&(l.current.scrollTop=c.current)},[i?.options]),M(nK,{...i,onInputChange:s,ListboxComponent:d=>M("ul",{onScroll:u,ref:f=>{l.current=f},...d,style:{maxHeight:"200px"},children:d.children})})}function pWe({name:t="",rules:e={},options:n,multiple:r=!1,defaultValueKey:i="",defaultValue:o="",...a}){const{control:s}=Wm(),l=Rn(()=>r&&Array.isArray(o)?n?.filter(f=>o.includes(f[i])):n?.find(f=>f[i]===o),[n,o]),{field:c,fieldState:{error:u}}=Hm({control:s,name:t,rules:e,shouldUnregister:!0,defaultValue:l});function d(...f){c.onChange(f[1]),a?.onChange?.(f[1])}return ke(yr,{children:[M(jie,{...c,...a,error:!!u,multiple:r,options:n,onChange:d}),u&&u.message&&M(Ja,{variant:"caption",sx:{color:"red"},children:u.message})]})}const gWe=()=>{const t=({data:r,getOptionLabel:i=l=>l.label,getOptionIcon:o=l=>l.icon,getOptionValue:a=l=>l.value,getOptionParent:s=l=>l.parent})=>{const l=[];return r?.forEach(c=>{a(c)&&l.push({value:a(c),label:ke(yr,{children:[o(c),i(c)]}),parent:s(c)})}),l},e=(r=[],i)=>{const o=[];for(const a of r){const s=a;if(!i&&!s?.parent||s?.parent===i){const l=e(r,s.value);l.length>0&&(s.children=l),o.push(s)}}return o},n=(r,i)=>{const o=[];if(!i)return[];const a=r.find(s=>s.value===i);return a&&(o.push(a.value),o.push(...n(r,a.parent))),o};return{renderTreeToSpecificFieldName:t,buildTree:e,findAllExpanded:n}};function mWe({data:t,defaultValue:e=[],onExpand:n,multiSelect:r=!0,getOptionValue:i,getOptionIcon:o,getOptionLabel:a,getOptionParent:s,noDataText:l="no data",...c}){const u=gr(),{buildTree:d,renderTreeToSpecificFieldName:f,findAllExpanded:h}=gWe(),m=f({data:t,getOptionLabel:a,getOptionIcon:o,getOptionValue:i,getOptionParent:s}),g=d(m),[v,b]=Tt([]),[y,x]=Tt([g?.[0]?.value]);_t(()=>{if(e)if(typeof e=="string")x(h(m,e)),b([e]);else{const E=[];e.forEach(S=>{E.push(...h(m,S))}),x(E),b([...e])}},[]),_t(()=>{c?.onChange&&(r?c.onChange(v):c.onChange(v[0]))},[v]);function w(E,S){if(r)b(E);else if(S.isLeaf){const T=!!v.find(A=>A===S.value);b(T?[]:[S.value])}}function C(E,S){n&&n(E,S),x(E)}return M("div",{className:"KdTreeField",children:g?.length>0?M(Qj,{...c,icons:{leaf:M("span",{}),parentOpen:M("span",{}),parentClose:M("span",{}),check:M(mW,{size:24,color:u?.palette?.primary?.main}),expandOpen:M(fW,{size:24}),uncheck:M(gW,{size:24}),expandClose:M(hW,{size:24}),halfCheck:M(vW,{color:u?.palette?.primary?.main,size:24})},nodes:g,onCheck:w,checked:v,expanded:y,onExpand:C,showNodeIcon:!0}):M("div",{style:{width:"100%",textAlign:"center"},children:l})})}function vWe({name:t="",rules:e={},options:n,getOptionValue:r=l=>l.value,defaultValue:i,split:o,size:a="small",...s}){const{control:l,setValue:c}=Wm(),u=Rn(()=>i||null,[i]);if(_t(()=>{c(t,u)},[u]),e?.pattern?.value&&o){const m=e.pattern.value,g=e.pattern.message;e.validate=v=>(v?.split?.(o)??[]).find(x=>!m.test(x))?g:!0,delete e.pattern}const{field:d,fieldState:{error:f}}=Hm({control:l,name:t,rules:e,shouldUnregister:!0,defaultValue:u});function h(...m){if(o&&o?.length>0){const g=m[1]?.join(o);d.onChange(g),s?.onChange?.(g)}else d.onChange(m[1]),s?.onChange?.(m[1])}return ke(yr,{children:[M(Px,{...d,...s,value:o&&o?.length>0&&d?.value?d?.value?.split(o):[],size:a,error:!!f,multiple:!0,freeSolo:!0,options:n?.map(m=>r(m))??[],onChange:h,renderInput:m=>M(xv,{...m,placeholder:s?.placeholder,variant:s?.variant,label:s.label,helperText:s?.error?void 0:s?.helperText,error:s?.error})}),f&&f.message&&M(Ja,{variant:"caption",sx:{color:"red"},children:f.message})]})}/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:rK,setPrototypeOf:iK,isFrozen:bWe,getPrototypeOf:yWe,getOwnPropertyDescriptor:xWe}=Object;let{freeze:ns,seal:Yl,create:oK}=Object,{apply:KI,construct:ZI}=typeof Reflect<"u"&&Reflect;ns||(ns=function(e){return e}),Yl||(Yl=function(e){return e}),KI||(KI=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(n,i)}),ZI||(ZI=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const JD=is(Array.prototype.forEach),wWe=is(Array.prototype.lastIndexOf),aK=is(Array.prototype.pop),v1=is(Array.prototype.push),CWe=is(Array.prototype.splice),QD=is(String.prototype.toLowerCase),JI=is(String.prototype.toString),QI=is(String.prototype.match),b1=is(String.prototype.replace),EWe=is(String.prototype.indexOf),SWe=is(String.prototype.trim),Fc=is(Object.prototype.hasOwnProperty),rs=is(RegExp.prototype.test),y1=DWe(TypeError);function is(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return KI(t,e,r)}}function DWe(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return ZI(t,n)}}function Zn(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:QD;iK&&iK(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(bWe(e)||(e[r]=o),i=o)}t[i]=!0}return t}function TWe(t){for(let e=0;e<t.length;e++)Fc(t,e)||(t[e]=null);return t}function Md(t){const e=oK(null);for(const[n,r]of rK(t))Fc(t,n)&&(Array.isArray(r)?e[n]=TWe(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Md(r):e[n]=r);return e}function x1(t,e){for(;t!==null;){const r=xWe(t,e);if(r){if(r.get)return is(r.get);if(typeof r.value=="function")return is(r.value)}t=yWe(t)}function n(){return null}return n}const sK=ns(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),eN=ns(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),tN=ns(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AWe=ns(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),nN=ns(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),kWe=ns(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lK=ns(["#text"]),cK=ns(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),rN=ns(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),uK=ns(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),eT=ns(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_We=Yl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),MWe=Yl(/<%[\w\W]*|[\w\W]*%>/gm),OWe=Yl(/\$\{[\w\W]*/gm),PWe=Yl(/^data-[\-\w.\u00B7-\uFFFF]+$/),RWe=Yl(/^aria-[\-\w]+$/),dK=Yl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IWe=Yl(/^(?:\w+script|data):/i),NWe=Yl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fK=Yl(/^html$/i),LWe=Yl(/^[a-z][.\w]*(-[.\w]+)+$/i);var hK=Object.freeze({__proto__:null,ARIA_ATTR:RWe,ATTR_WHITESPACE:NWe,CUSTOM_ELEMENT:LWe,DATA_ATTR:PWe,DOCTYPE_NAME:fK,ERB_EXPR:MWe,IS_ALLOWED_URI:dK,IS_SCRIPT_OR_DATA:IWe,MUSTACHE_EXPR:_We,TMPLIT_EXPR:OWe});const w1={element:1,text:3,progressingInstruction:7,comment:8,document:9},FWe=function(){return typeof window>"u"?null:window},BWe=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},pK=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gK(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:FWe();const e=Ke=>gK(Ke);if(e.version="3.2.7",e.removed=[],!t||!t.document||t.document.nodeType!==w1.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:h}=t,m=l.prototype,g=x1(m,"cloneNode"),v=x1(m,"remove"),b=x1(m,"nextSibling"),y=x1(m,"childNodes"),x=x1(m,"parentNode");if(typeof a=="function"){const Ke=n.createElement("template");Ke.content&&Ke.content.ownerDocument&&(n=Ke.content.ownerDocument)}let w,C="";const{implementation:E,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:A}=n,{importNode:R}=r;let P=pK();e.isSupported=typeof rK=="function"&&typeof x=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:_,ERB_EXPR:I,TMPLIT_EXPR:k,DATA_ATTR:F,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:B}=hK;let{IS_ALLOWED_URI:W}=hK,Y=null;const q=Zn({},[...sK,...eN,...tN,...nN,...lK]);let ee=null;const Q=Zn({},[...cK,...rN,...uK,...eT]);let J=Object.seal(oK(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,ie=null,he=!0,xe=!0,Se=!1,ye=!0,K=!1,ce=!0,U=!1,ue=!1,le=!1,ne=!1,Z=!1,fe=!1,de=!0,pe=!1;const ge="user-content-";let se=!0,ae=!1,ve={},we=null;const Me=Zn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ee=null;const De=Zn({},["audio","video","img","source","image","track"]);let Re=null;const Ge=Zn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Be="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let ze=Ze,je=!1,at=null;const yt=Zn({},[Be,Qe,Ze],JI);let ft=Zn({},["mi","mo","mn","ms","mtext"]),At=Zn({},["annotation-xml"]);const Ft=Zn({},["title","style","font","a","script"]);let kt=null;const gt=["application/xhtml+xml","text/html"],Oe="text/html";let me=null,Ue=null;const _e=n.createElement("form"),ot=function(Ce){return Ce instanceof RegExp||Ce instanceof Function},nt=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ue&&Ue===Ce)){if((!Ce||typeof Ce!="object")&&(Ce={}),Ce=Md(Ce),kt=gt.indexOf(Ce.PARSER_MEDIA_TYPE)===-1?Oe:Ce.PARSER_MEDIA_TYPE,me=kt==="application/xhtml+xml"?JI:QD,Y=Fc(Ce,"ALLOWED_TAGS")?Zn({},Ce.ALLOWED_TAGS,me):q,ee=Fc(Ce,"ALLOWED_ATTR")?Zn({},Ce.ALLOWED_ATTR,me):Q,at=Fc(Ce,"ALLOWED_NAMESPACES")?Zn({},Ce.ALLOWED_NAMESPACES,JI):yt,Re=Fc(Ce,"ADD_URI_SAFE_ATTR")?Zn(Md(Ge),Ce.ADD_URI_SAFE_ATTR,me):Ge,Ee=Fc(Ce,"ADD_DATA_URI_TAGS")?Zn(Md(De),Ce.ADD_DATA_URI_TAGS,me):De,we=Fc(Ce,"FORBID_CONTENTS")?Zn({},Ce.FORBID_CONTENTS,me):Me,re=Fc(Ce,"FORBID_TAGS")?Zn({},Ce.FORBID_TAGS,me):Md({}),ie=Fc(Ce,"FORBID_ATTR")?Zn({},Ce.FORBID_ATTR,me):Md({}),ve=Fc(Ce,"USE_PROFILES")?Ce.USE_PROFILES:!1,he=Ce.ALLOW_ARIA_ATTR!==!1,xe=Ce.ALLOW_DATA_ATTR!==!1,Se=Ce.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Ce.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=Ce.SAFE_FOR_TEMPLATES||!1,ce=Ce.SAFE_FOR_XML!==!1,U=Ce.WHOLE_DOCUMENT||!1,ne=Ce.RETURN_DOM||!1,Z=Ce.RETURN_DOM_FRAGMENT||!1,fe=Ce.RETURN_TRUSTED_TYPE||!1,le=Ce.FORCE_BODY||!1,de=Ce.SANITIZE_DOM!==!1,pe=Ce.SANITIZE_NAMED_PROPS||!1,se=Ce.KEEP_CONTENT!==!1,ae=Ce.IN_PLACE||!1,W=Ce.ALLOWED_URI_REGEXP||dK,ze=Ce.NAMESPACE||Ze,ft=Ce.MATHML_TEXT_INTEGRATION_POINTS||ft,At=Ce.HTML_INTEGRATION_POINTS||At,J=Ce.CUSTOM_ELEMENT_HANDLING||{},Ce.CUSTOM_ELEMENT_HANDLING&&ot(Ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=Ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ce.CUSTOM_ELEMENT_HANDLING&&ot(Ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=Ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ce.CUSTOM_ELEMENT_HANDLING&&typeof Ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=Ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(xe=!1),Z&&(ne=!0),ve&&(Y=Zn({},lK),ee=[],ve.html===!0&&(Zn(Y,sK),Zn(ee,cK)),ve.svg===!0&&(Zn(Y,eN),Zn(ee,rN),Zn(ee,eT)),ve.svgFilters===!0&&(Zn(Y,tN),Zn(ee,rN),Zn(ee,eT)),ve.mathMl===!0&&(Zn(Y,nN),Zn(ee,uK),Zn(ee,eT))),Ce.ADD_TAGS&&(Y===q&&(Y=Md(Y)),Zn(Y,Ce.ADD_TAGS,me)),Ce.ADD_ATTR&&(ee===Q&&(ee=Md(ee)),Zn(ee,Ce.ADD_ATTR,me)),Ce.ADD_URI_SAFE_ATTR&&Zn(Re,Ce.ADD_URI_SAFE_ATTR,me),Ce.FORBID_CONTENTS&&(we===Me&&(we=Md(we)),Zn(we,Ce.FORBID_CONTENTS,me)),se&&(Y["#text"]=!0),U&&Zn(Y,["html","head","body"]),Y.table&&(Zn(Y,["tbody"]),delete re.tbody),Ce.TRUSTED_TYPES_POLICY){if(typeof Ce.TRUSTED_TYPES_POLICY.createHTML!="function")throw y1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ce.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw y1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=Ce.TRUSTED_TYPES_POLICY,C=w.createHTML("")}else w===void 0&&(w=BWe(h,i)),w!==null&&typeof C=="string"&&(C=w.createHTML(""));ns&&ns(Ce),Ue=Ce}},tt=Zn({},[...eN,...tN,...AWe]),qe=Zn({},[...nN,...kWe]),Te=function(Ce){let Ye=x(Ce);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:ze,tagName:"template"});const He=QD(Ce.tagName),ut=QD(Ye.tagName);return at[Ce.namespaceURI]?Ce.namespaceURI===Qe?Ye.namespaceURI===Ze?He==="svg":Ye.namespaceURI===Be?He==="svg"&&(ut==="annotation-xml"||ft[ut]):!!tt[He]:Ce.namespaceURI===Be?Ye.namespaceURI===Ze?He==="math":Ye.namespaceURI===Qe?He==="math"&&At[ut]:!!qe[He]:Ce.namespaceURI===Ze?Ye.namespaceURI===Qe&&!At[ut]||Ye.namespaceURI===Be&&!ft[ut]?!1:!qe[He]&&(Ft[He]||!tt[He]):!!(kt==="application/xhtml+xml"&&at[Ce.namespaceURI]):!1},Ie=function(Ce){v1(e.removed,{element:Ce});try{x(Ce).removeChild(Ce)}catch{v(Ce)}},Ve=function(Ce,Ye){try{v1(e.removed,{attribute:Ye.getAttributeNode(Ce),from:Ye})}catch{v1(e.removed,{attribute:null,from:Ye})}if(Ye.removeAttribute(Ce),Ce==="is")if(ne||Z)try{Ie(Ye)}catch{}else try{Ye.setAttribute(Ce,"")}catch{}},rt=function(Ce){let Ye=null,He=null;if(le)Ce="<remove></remove>"+Ce;else{const Et=QI(Ce,/^[\r\n\t ]+/);He=Et&&Et[0]}kt==="application/xhtml+xml"&&ze===Ze&&(Ce='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ce+"</body></html>");const ut=w?w.createHTML(Ce):Ce;if(ze===Ze)try{Ye=new f().parseFromString(ut,kt)}catch{}if(!Ye||!Ye.documentElement){Ye=E.createDocument(ze,"template",null);try{Ye.documentElement.innerHTML=je?C:ut}catch{}}const Lt=Ye.body||Ye.documentElement;return Ce&&He&&Lt.insertBefore(n.createTextNode(He),Lt.childNodes[0]||null),ze===Ze?A.call(Ye,U?"html":"body")[0]:U?Ye.documentElement:Lt},ht=function(Ce){return S.call(Ce.ownerDocument||Ce,Ce,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Bt=function(Ce){return Ce instanceof d&&(typeof Ce.nodeName!="string"||typeof Ce.textContent!="string"||typeof Ce.removeChild!="function"||!(Ce.attributes instanceof u)||typeof Ce.removeAttribute!="function"||typeof Ce.setAttribute!="function"||typeof Ce.namespaceURI!="string"||typeof Ce.insertBefore!="function"||typeof Ce.hasChildNodes!="function")},rn=function(Ce){return typeof s=="function"&&Ce instanceof s};function $t(Ke,Ce,Ye){JD(Ke,He=>{He.call(e,Ce,Ye,Ue)})}const an=function(Ce){let Ye=null;if($t(P.beforeSanitizeElements,Ce,null),Bt(Ce))return Ie(Ce),!0;const He=me(Ce.nodeName);if($t(P.uponSanitizeElement,Ce,{tagName:He,allowedTags:Y}),ce&&Ce.hasChildNodes()&&!rn(Ce.firstElementChild)&&rs(/<[/\w!]/g,Ce.innerHTML)&&rs(/<[/\w!]/g,Ce.textContent)||Ce.nodeType===w1.progressingInstruction||ce&&Ce.nodeType===w1.comment&&rs(/<[/\w]/g,Ce.data))return Ie(Ce),!0;if(!Y[He]||re[He]){if(!re[He]&&Le(He)&&(J.tagNameCheck instanceof RegExp&&rs(J.tagNameCheck,He)||J.tagNameCheck instanceof Function&&J.tagNameCheck(He)))return!1;if(se&&!we[He]){const ut=x(Ce)||Ce.parentNode,Lt=y(Ce)||Ce.childNodes;if(Lt&&ut){const Et=Lt.length;for(let Mt=Et-1;Mt>=0;--Mt){const wn=g(Lt[Mt],!0);wn.__removalCount=(Ce.__removalCount||0)+1,ut.insertBefore(wn,b(Ce))}}}return Ie(Ce),!0}return Ce instanceof l&&!Te(Ce)||(He==="noscript"||He==="noembed"||He==="noframes")&&rs(/<\/no(script|embed|frames)/i,Ce.innerHTML)?(Ie(Ce),!0):(K&&Ce.nodeType===w1.text&&(Ye=Ce.textContent,JD([_,I,k],ut=>{Ye=b1(Ye,ut," ")}),Ce.textContent!==Ye&&(v1(e.removed,{element:Ce.cloneNode()}),Ce.textContent=Ye)),$t(P.afterSanitizeElements,Ce,null),!1)},Ne=function(Ce,Ye,He){if(de&&(Ye==="id"||Ye==="name")&&(He in n||He in _e))return!1;if(!(xe&&!ie[Ye]&&rs(F,Ye))){if(!(he&&rs(L,Ye))){if(!ee[Ye]||ie[Ye]){if(!(Le(Ce)&&(J.tagNameCheck instanceof RegExp&&rs(J.tagNameCheck,Ce)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ce))&&(J.attributeNameCheck instanceof RegExp&&rs(J.attributeNameCheck,Ye)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(Ye,Ce))||Ye==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&rs(J.tagNameCheck,He)||J.tagNameCheck instanceof Function&&J.tagNameCheck(He))))return!1}else if(!Re[Ye]){if(!rs(W,b1(He,N,""))){if(!((Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Ce!=="script"&&EWe(He,"data:")===0&&Ee[Ce])){if(!(Se&&!rs($,b1(He,N,"")))){if(He)return!1}}}}}}return!0},Le=function(Ce){return Ce!=="annotation-xml"&&QI(Ce,B)},st=function(Ce){$t(P.beforeSanitizeAttributes,Ce,null);const{attributes:Ye}=Ce;if(!Ye||Bt(Ce))return;const He={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let ut=Ye.length;for(;ut--;){const Lt=Ye[ut],{name:Et,namespaceURI:Mt,value:wn}=Lt,hn=me(Et),jr=wn;let Yn=Et==="value"?jr:SWe(jr);if(He.attrName=hn,He.attrValue=Yn,He.keepAttr=!0,He.forceKeepAttr=void 0,$t(P.uponSanitizeAttribute,Ce,He),Yn=He.attrValue,pe&&(hn==="id"||hn==="name")&&(Ve(Et,Ce),Yn=ge+Yn),ce&&rs(/((--!?|])>)|<\/(style|title|textarea)/i,Yn)){Ve(Et,Ce);continue}if(hn==="attributename"&&QI(Yn,"href")){Ve(Et,Ce);continue}if(He.forceKeepAttr)continue;if(!He.keepAttr){Ve(Et,Ce);continue}if(!ye&&rs(/\/>/i,Yn)){Ve(Et,Ce);continue}K&&JD([_,I,k],Yr=>{Yn=b1(Yn,Yr," ")});const kr=me(Ce.nodeName);if(!Ne(kr,hn,Yn)){Ve(Et,Ce);continue}if(w&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Mt)switch(h.getAttributeType(kr,hn)){case"TrustedHTML":{Yn=w.createHTML(Yn);break}case"TrustedScriptURL":{Yn=w.createScriptURL(Yn);break}}if(Yn!==jr)try{Mt?Ce.setAttributeNS(Mt,Et,Yn):Ce.setAttribute(Et,Yn),Bt(Ce)?Ie(Ce):aK(e.removed)}catch{Ve(Et,Ce)}}$t(P.afterSanitizeAttributes,Ce,null)},Ot=function Ke(Ce){let Ye=null;const He=ht(Ce);for($t(P.beforeSanitizeShadowDOM,Ce,null);Ye=He.nextNode();)$t(P.uponSanitizeShadowNode,Ye,null),an(Ye),st(Ye),Ye.content instanceof o&&Ke(Ye.content);$t(P.afterSanitizeShadowDOM,Ce,null)};return e.sanitize=function(Ke){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=null,He=null,ut=null,Lt=null;if(je=!Ke,je&&(Ke="<!-->"),typeof Ke!="string"&&!rn(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw y1("dirty is not a string, aborting")}else throw y1("toString is not a function");if(!e.isSupported)return Ke;if(ue||nt(Ce),e.removed=[],typeof Ke=="string"&&(ae=!1),ae){if(Ke.nodeName){const wn=me(Ke.nodeName);if(!Y[wn]||re[wn])throw y1("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof s)Ye=rt("<!---->"),He=Ye.ownerDocument.importNode(Ke,!0),He.nodeType===w1.element&&He.nodeName==="BODY"||He.nodeName==="HTML"?Ye=He:Ye.appendChild(He);else{if(!ne&&!K&&!U&&Ke.indexOf("<")===-1)return w&&fe?w.createHTML(Ke):Ke;if(Ye=rt(Ke),!Ye)return ne?null:fe?C:""}Ye&&le&&Ie(Ye.firstChild);const Et=ht(ae?Ke:Ye);for(;ut=Et.nextNode();)an(ut),st(ut),ut.content instanceof o&&Ot(ut.content);if(ae)return Ke;if(ne){if(Z)for(Lt=T.call(Ye.ownerDocument);Ye.firstChild;)Lt.appendChild(Ye.firstChild);else Lt=Ye;return(ee.shadowroot||ee.shadowrootmode)&&(Lt=R.call(r,Lt,!0)),Lt}let Mt=U?Ye.outerHTML:Ye.innerHTML;return U&&Y["!doctype"]&&Ye.ownerDocument&&Ye.ownerDocument.doctype&&Ye.ownerDocument.doctype.name&&rs(fK,Ye.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+Ye.ownerDocument.doctype.name+`>
579
579
  `+Mt),K&&JD([_,I,k],wn=>{Mt=b1(Mt,wn," ")}),w&&fe?w.createHTML(Mt):Mt},e.setConfig=function(){let Ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nt(Ke),ue=!0},e.clearConfig=function(){Ue=null,ue=!1},e.isValidAttribute=function(Ke,Ce,Ye){Ue||nt({});const He=me(Ke),ut=me(Ce);return Ne(He,ut,Ye)},e.addHook=function(Ke,Ce){typeof Ce=="function"&&v1(P[Ke],Ce)},e.removeHook=function(Ke,Ce){if(Ce!==void 0){const Ye=wWe(P[Ke],Ce);return Ye===-1?void 0:CWe(P[Ke],Ye,1)[0]}return aK(P[Ke])},e.removeHooks=function(Ke){P[Ke]=[]},e.removeAllHooks=function(){P=pK()},e}var iN=gK(),tT={exports:{}};/*! https://mths.be/he v1.2.0 by @mathias | MIT license */tT.exports,(function(t,e){(function(n){var r=e,i=t&&t.exports==r&&t,o=typeof ln=="object"&&ln;(o.global===o||o.window===o)&&(n=o);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,l=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,c=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,u={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},d=/["&'<>`]/g,f={'"':"&quot;","&":"&amp;","'":"&#x27;","<":"&lt;",">":"&gt;","`":"&#x60;"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,m=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,v={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
580
- `,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},b={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},y={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},x=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,C={},E=C.hasOwnProperty,S=function(B,W){return E.call(B,W)},T=function(B,W){for(var Y=-1,q=B.length;++Y<q;)if(B[Y]==W)return!0;return!1},A=function(B,W){if(!B)return W;var Y={},q;for(q in W)Y[q]=S(B,q)?B[q]:W[q];return Y},R=function(B,W){var Y="";return B>=55296&&B<=57343||B>1114111?(W&&I("character reference outside the permissible Unicode range"),"\uFFFD"):S(y,B)?(W&&I("disallowed character reference"),y[B]):(W&&T(x,B)&&I("disallowed character reference"),B>65535&&(B-=65536,Y+=w(B>>>10&1023|55296),B=56320|B&1023),Y+=w(B),Y)},P=function(B){return"&#x"+B.toString(16).toUpperCase()+";"},_=function(B){return"&#"+B+";"},I=function(B){throw Error("Parse error: "+B)},k=function(B,W){W=A(W,k.options);var Y=W.strict;Y&&m.test(B)&&I("forbidden code point");var q=W.encodeEverything,ee=W.useNamedReferences,Q=W.allowUnsafeSymbols,J=W.decimal?_:P,re=function(ie){return J(ie.charCodeAt(0))};return q?(B=B.replace(s,function(ie){return ee&&S(u,ie)?"&"+u[ie]+";":re(ie)}),ee&&(B=B.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),ee&&(B=B.replace(c,function(ie){return"&"+u[ie]+";"}))):ee?(Q||(B=B.replace(d,function(ie){return"&"+u[ie]+";"})),B=B.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),B=B.replace(c,function(ie){return"&"+u[ie]+";"})):Q||(B=B.replace(d,re)),B.replace(a,function(ie){var he=ie.charCodeAt(0),xe=ie.charCodeAt(1),Se=(he-55296)*1024+xe-56320+65536;return J(Se)}).replace(l,re)};k.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var F=function(B,W){W=A(W,F.options);var Y=W.strict;return Y&&h.test(B)&&I("malformed character reference"),B.replace(g,function(q,ee,Q,J,re,ie,he,xe,Se){var ye,K,ce,U,ue,le;return ee?(ue=ee,v[ue]):Q?(ue=Q,le=J,le&&W.isAttributeValue?(Y&&le=="="&&I("`&` did not start a character reference"),q):(Y&&I("named character reference was not terminated by a semicolon"),b[ue]+(le||""))):re?(ce=re,K=ie,Y&&!K&&I("character reference was not terminated by a semicolon"),ye=parseInt(ce,10),R(ye,Y)):he?(U=he,K=xe,Y&&!K&&I("character reference was not terminated by a semicolon"),ye=parseInt(U,16),R(ye,Y)):(Y&&I("named character reference was not terminated by a semicolon"),q)})};F.options={isAttributeValue:!1,strict:!1};var L=function(B){return B.replace(d,function(W){return f[W]})},$={version:"1.2.0",encode:k,decode:F,escape:L,unescape:F};if(r&&!r.nodeType)if(i)i.exports=$;else for(var N in $)S($,N)&&(r[N]=$[N]);else n.he=$})(ln)})(tT,tT.exports);var $We=tT.exports,nT=di($We);const zWe=(t,e)=>{if(!t)return t;switch(e.type){case"string":return UWe(t,e);case"number":return WWe(t,e);case"date":return HWe(t,e);case"time":return VWe(t,e);case"date-time":return jWe(t,e);case"boolean":return YWe(t);case"html":return qWe(t,e);default:return t}},UWe=(t,e)=>e.maxLength&&typeof e.maxLength!="number"?t:C1(nT.unescape(String(t)),"rtl",e.maxLength),C1=(t,e,n)=>n&&t.length>n?e==="rtl"?M(yr,{children:t.substring(0,n)+" ..."}):M(yr,{children:"..."+t.substring(0,n)}):M(yr,{children:t}),WWe=(t,e)=>{switch(e.typeNumber){case"int":return C1(String(parseInt(String(t))),"ltr",e.maxLength);case"float":return C1(String(parseFloat(String(t))),"ltr",e.maxLength);case"cost":{if(Number.isNaN(parseFloat(String(t))))return t;const n=String(t),[r,i]=n.split("."),o=r.replace(/\B(?=(\d{3})+(?!\d))/g,","),a=i?`${o}.${i}`:o;return C1(a,"ltr",e.maxLength)}default:return C1(String(parseFloat(String(t))),"ltr",e.maxLength)}},HWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Date value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Date value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"YYYY/MM/DD",en:"YYYY-MM-DD",ar:"YYYY/MM/DD"},a=e.format||(o[i]??"YYYY/MM/DD");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Date value is not a valid date (jalali moment)"),t}return s},VWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Time value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Time value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"HH:mm:ss",en:"hh:mm:ss a",ar:"hh:mm:ss a"},a=e.formatTime||(o[i]??"HH:mm:ss");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Time value is not a valid date (jalali moment)"),t}return s},jWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Date Time value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Date Time value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"YYYY/MM/DD HH:mm:ss",en:"YYYY-MM-DD hh:mm:ss a",ar:"YYYY/MM/DD hh:mm:ss a"},a=e.formatDateTime||(o[i]??"YYYY/MM/DD HH:mm:ss");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Date Time value is not a valid date (jalali moment)"),t}return s},YWe=t=>t?"true":"false",qWe=(t,e)=>{if(typeof t!="string")return t;const n=iN.sanitize(nT.unescape(t),{USE_PROFILES:{html:!0}});return M("div",{dangerouslySetInnerHTML:{__html:e.ignoreTags?n:t}})},GWe=({type:t="string",...e})=>{const n={type:t,maxLength:e.maxLength,typeNumber:e.typeNumber,format:e.format,formatTime:e.formatTime,formatDateTime:e.formatDateTime,loc:e.loc,ignoreTags:e.ignoreTags??!0};return M(Ja,{...e,sx:{whiteSpace:t==="html"?"normal":"pre-line",...e.sx},children:zWe(e.children,n)})};function XWe(t,e){if(e){let n=[];return t.image&&(t.image==="ALL"?n=n.concat(e.image):n=n.concat(t?.image?.filter(r=>e?.image?.includes(r)))),t.video&&(t.video==="ALL"?n=n.concat(e.video):n=n.concat(t?.video?.filter(r=>e?.video?.includes(r)))),t.text&&(t.text==="ALL"?n=n.concat(e.text):n=n.concat(t?.text?.filter(r=>e?.text?.includes(r)))),t.compress&&(t.compress==="ALL"?n=n.concat(e.compress):n=n.concat(t?.compress?.filter(r=>e?.compress?.includes(r)))),n.map(r=>`.${r}`).join(",")}else return"*"}const Po={image:["jpg","jpeg","gif","png","svg","ico"],font:["ttf","eot","woff","woff2"],text:["doc","pdf","xls","ppt","txt","htm","docx","bmp","xlsx","pptx","tif","xml","epub","bpmn","cmmn","csv"],video:["mp4","wmv","mpg","divx","div","tix","qt","mov","avi","mpa","mpe","m1v","bmp"],compress:["zip","rar","tar","gz","tar.gz","tar.xz"]};function mK(t,e){return{thumbnail_URL:e?.[0]==="$"?`${t}${Od.upload}${xg.thumbnailTempPath}${e}`:`${t}${Od.upload}${xg.thumbnailstreamPath}${e}`,larg_URL:e?.[0]==="$"?`${t}${Od.upload}${xg.tempPath}${e}`:`${t}${Od.upload}${xg.streamPath}${e}`}}async function oN(t,e,n){if(!e||e.length===0)return[];try{const r={method:"POST",headers:{sessionId:n??""},credentials:"include",body:JSON.stringify(e)};return(await(await fetch(`${t}${Od.upload}${e?.[0]?.[0]==="$"?xg.restTempUrlFileListProperty:xg.restStreamUrlFileListProperty}`,r)).json())?.data}catch(r){return console.error("Error:",r),[]}}const aN=(t,e,n)=>{t.filter(i=>i?.subStatusCode===3||i?.subStatusCode===4)?.forEach(i=>{if(i)switch(i?.subStatusCode){case 0:break;case 1:break;case 2:break;case 3:n?.(i?.message??"");break;case 4:e?.(i?.message??"");break}})},Od={upload:"/upload/rest"},xg={streamPath:"/api/v1/fileupload/download/stream/",thumbnailstreamPath:"/api/v1/fileupload/thumbnail/stream/",tempPath:"/api/v1/fileupload/download/temp/",thumbnailTempPath:"/api/v1/fileupload/thumbnail/temp/",restStreamUrlFileListProperty:"/api/v1/fileupload/propertylist/stream",restTempUrlFileListProperty:"/api/v1/fileupload/propertylist/temp",exportPath:"/api/v1/export/download/"},rT={pathFileUpload:"/api/v1/fileupload/",pathForUploadCunk:"/api/v1/fileupload/upload/session/",pathForGetFile:"/api/v1/fileupload/upload/"},KWe=(t,e)=>`/auth/api/v1/BPMSCaptcha/image?name=${t}&rnd=${e}`,ZWe=Ri("div")();function JWe({label:t,defaultValue:e,placeholder:n,multiple:r=!1,accept:i,fileCountLimit:o,fileSizeLimit:a,onError:s,onWarning:l,pathProp:c,inputStyle:u,required:d,downloadSmallSize:f,croppable:h,modal:m,...g}){const{files:v,removeFile:b,uploadingFiles:y,handleFileChange:x,fileExtension:w,APIURL:C}=KF({multiple:r,APIURL:c?.APIURL,sessionId:c?.sessionId,serviceName:Od.upload,onError:s,onWarning:l,fileSizeLimit:a,fileCountLimit:o}),[E,S]=Tt([]),[T,A]=Tt(null);_t(()=>{g?.value===null&&E.length>0&&(E.forEach(k=>b(k.session)),S([]))},[g?.value]),_t(()=>{(async()=>{if(e){const F=Array.isArray(e)?[...e]:[e],L=await oN(C,F,c?.sessionId),$=F.map(N=>({fileName:(L??[]).find(B=>B.guid===N)?.fileName,session:N}));S($),R($)}else S([])})()},[e]),_t(()=>{if(v&&v.length>0)if(r)S(k=>{const F=[...k,...v.filter(L=>!E.find($=>$.session===L.session)).map(L=>({fileName:L.fileName,session:L.session}))??[]];return R(F),F});else{const k=[{fileName:v[0]?.fileName,session:v[0]?.session}];R(k),S(k)}},[v]);function R(k){g.onChange&&(r?g.onChange((k??[]).map(F=>F.session)):k.length>0?g.onChange(k[k.length-1]?.session):g.onChange())}const P=k=>{S(F=>{const L=F.filter($=>$.session!==k);return R(L),L}),v?.find(F=>F.session===k)&&b&&b(k)},_=(k,F)=>{const L={target:{files:[k]}};F&&P(F),x(L,i),T&&A(null)};function I(k){const F=k.target.files?.[0];if(!F)return;const L=F.name.split(".").at(-1)||"",$=["jpg","jpeg","png"].includes(L.toLocaleLowerCase());if(h&&$){const N=new FileReader;N.onload=function(B){const W=B.target?.result;W&&A({src:W,fileName:F.name})},N.readAsDataURL(F)}else x(k,i)}return ke(yr,{children:[ke(ZWe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"10px",alignItems:"center",width:"100%",...g?.style||{},...g?.sx||{}},children:[ke(Ja,{children:[t," ",d&&"*"]}),M("label",{htmlFor:`icon-button-file-${g.name}`,children:ke(Hv,{component:"span",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"5px",...u,...g?.disabled&&{opacity:"0.5"}},color:g?.error?"error":"primary",children:[M(gI,{}),n]})}),M("input",{style:{display:"none"},accept:w&&i?XWe(i,w):"*",id:`icon-button-file-${g.name}`,type:"file",multiple:r,onChange:I,disabled:g?.disabled,value:""}),E&&(r||y.length===0)&&E.map(k=>{const F=mK(C,k.session);return M(g6,{sessionId:k?.session,smallUrl:F.thumbnail_URL,largeUrl:F.larg_URL,fileName:k?.fileName,onDelete:g.disabled?void 0:P,downloadSmallSize:f,modal:m,onCropImage:L=>_(L,k.session),defaultCropHeight:g?.defaultCropHeight,defaultCropWidth:g?.defaultCropWidth,cropResizable:g?.cropResizable,cropStencil:g?.cropStencil,croppable:h,extention:k.fileName?.split(".").pop()})}),y&&y.map(k=>M(mI,{progress:k.progress})),M(um,{open:!!T,src:T?.src||"",fileName:T?.fileName,defaultWidth:g?.defaultCropWidth,defaultHeight:g?.defaultCropHeight,onClose:()=>A(null),onCrop:_,resizable:g?.cropResizable,stencil:g?.cropStencil})]}),!g?.error&&g?.helperText&&M(NE,{children:g?.helperText})]})}function QWe(t,e){if(e){const n={};return t.image&&(t.image==="ALL"?n["image/*"]=e.image.map(r=>`.${r}`):t.image.forEach(r=>{e?.image?.includes(r)&&(n["image/"+r]=["."+r])})),t.video&&(t.video==="ALL"?n["video/*"]=e.video.map(r=>`.${r}`):t.video.forEach(r=>{e?.video?.includes(r)&&(n["video/"+r]=["."+r])})),t.text&&(t.text==="ALL"?n["text/*"]=e.text.map(r=>`.${r}`):t.text.forEach(r=>{e?.text?.includes(r)&&(n["text/"+r]=["."+r])})),t.compress&&(t.compress==="ALL"?n["text/*"]=[...n["text/*"]??[],...e.compress.map(r=>`.${r}`)??[]]:t.compress.forEach(r=>{e?.compress?.includes(r)&&(n["text/"+r]=["."+r])})),n}else return"*"}const eHe=({label:t="\u0641\u0627\u06CC\u0644(\u0647\u0627) \u0631\u0627 \u062F\u0631 \u0627\u06CC\u0646 \u062C\u0639\u0628\u0647 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u0631\u0648\u06CC \u062C\u0639\u0628\u0647 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",defaultValue:e,multiple:n=!1,accept:r,fileCountLimit:i=20,fileSizeLimit:o,onError:a,onWarning:s,required:l,pathProp:c,downloadSmallSize:u,croppable:d,modal:f,...h})=>{const{files:m,removeFile:g,uploadingFiles:v,handleFileChange:b,fileExtension:y,APIURL:x}=KF({multiple:n,APIURL:c?.APIURL,serviceName:Od.upload,sessionId:c?.sessionId,onError:a,onWarning:s,fileSizeLimit:o,fileCountLimit:i}),[w,C]=Tt([]),[E,S]=Tt(null);_t(()=>{h?.value===null&&w.length>0&&(w.forEach(N=>g(N.session)),C([]))},[h?.value]),_t(()=>{(async()=>{if(e){const B=Array.isArray(e)?[...e]:[e],W=await oN(x,B,c?.sessionId),Y=B.map(q=>({fileName:(W??[]).find(ee=>ee.guid===q)?.fileName,session:q}));C(Y),T(Y)}else C([])})()},[e]),_t(()=>{if(m&&m.length>0)if(n)C(N=>{const B=[...N,...m.filter(W=>!w.find(Y=>Y.session===W.session)).map(W=>({fileName:W.fileName,session:W.session}))??[]];return T(B),B});else{const N=[{fileName:m[0]?.fileName,session:m[0]?.session}];T(N),C(N)}},[m]);function T(N){h.onChange&&(n?h.onChange((N??[]).map(B=>B.session)):N.length>0?h.onChange(N[N.length-1].session):h.onChange())}const A=xr(N=>{const B={target:{files:N}};if(N.length+w.length>i){a?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${i} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}else{const W=N?.[0];if(!W)return;const Y=W.name.split(".").at(-1)||"",q=["jpg","jpeg","png"].includes(Y.toLocaleLowerCase());if(d&&q){const ee=new FileReader;ee.onload=function(Q){const J=Q.target?.result;J&&S({src:J,fileName:W.name})},ee.readAsDataURL(W)}else b(B,r)}},[w]),R=N=>{C(B=>{const W=B.filter(Y=>Y.session!==N);return T(W),W}),m?.find(B=>B.session===N)&&g&&g(N)},P=(N,B)=>{const W={target:{files:[N]}};B&&R(B),b(W,r),E&&S(null)},{getRootProps:_,getInputProps:I,isDragAccept:k,isDragReject:F,open:L,inputRef:$}=VS({onDropAccepted:A,accept:r?QWe(r,y??null):void 0,maxFiles:9999,noClick:!0,multiple:n,disabled:h?.disabled,onDropRejected(){a?.("\u0644\u0637\u0641\u0627 \u0641\u0631\u0645\u062A \u0645\u0646\u0627\u0633\u0628 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F.")}});return _t(()=>{if(!$.current)return;const N=async B=>{const W=B.clipboardData?.files;W&&W.length>0&&$.current&&($.current.files=W,$.current.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",N),()=>{document.removeEventListener("paste",N)}},[$]),ke(yr,{children:[ke(Ln,{children:[ke(Ln,{component:"section",sx:{mb:1,border:2,borderStyle:"dashed",borderRadius:3,borderColor:N=>h?.error?N.palette.error.main:N.palette.primary.main,transition:"all 0.3s ease-in-ease-out",...k&&{borderColor:N=>N.palette.success.main},...k&&{bgcolor:N=>N.palette.success.light},...F&&{borderColor:N=>N.palette.warning.main},...F&&{bgcolor:N=>N.palette.warning.light},...h.sx},..._(),children:[M("input",{...I(),...h["aria-id"]&&{"aria-id":h["aria-id"]}}),ke(Ln,{sx:{p:2,display:"flex",flexDirection:"column",justifyContent:"center"},children:[ke(Ja,{sx:{display:"flex",justifyContent:"center"},children:[t," ",l&&"*"]}),M(Ln,{sx:{display:"flex",justifyContent:"center"},children:M(xi,{sx:{color:N=>h?.error?N.palette.error.main:N.palette.primary.main,...k&&{color:N=>N.palette.success.main},...F&&{color:N=>N.palette.warning.main},...h?.disabled&&{opacity:"0.5"}},onClick:L,children:M(sR,{size:45})})}),M($S,{in:w?.length!==0||v?.length!==0,children:ke("div",{style:{display:"flex",flexDirection:"row",gap:"10px",flexWrap:"wrap"},children:[w&&(n||v.length===0)&&w.map(N=>{const B=mK(x,N.session);return M(g6,{sessionId:N.session,smallUrl:B.thumbnail_URL,largeUrl:B.larg_URL,fileName:N.fileName,onDelete:h.disabled?void 0:R,downloadSmallSize:u,modal:f,croppable:d,defaultCropHeight:h?.defaultCropHeight,defaultCropWidth:h?.defaultCropWidth,cropResizable:h?.cropResizable,cropStencil:h?.cropStencil,extention:N.fileName?.split(".").pop(),onCropImage:W=>P(W,N.session)})}),v&&v.map(N=>M(mI,{progress:N.progress}))]})})]})]}),M(um,{open:!!E,src:E?.src||"",fileName:E?.fileName||"",defaultWidth:h?.defaultCropWidth,defaultHeight:h?.defaultCropHeight,onCrop:P,onClose:()=>S(null),stencil:h?.cropStencil,resizable:h?.cropResizable})]}),!h?.error&&h?.helperText&&M(NE,{children:h?.helperText})]})};function tHe(t,e){if(e){let n=[];return t.image&&(t.image==="ALL"?n=n.concat(e.image):n=n.concat(t?.image?.filter(r=>e?.image?.includes(r)))),t.video&&(t.video==="ALL"?n=n.concat(e.video):n=n.concat(t?.video?.filter(r=>e?.video?.includes(r)))),t.text&&(t.text==="ALL"?n=n.concat(e.text):n=n.concat(t?.text?.filter(r=>e?.text?.includes(r)))),t.compress&&(t.compress==="ALL"?n=n.concat(e.compress):n=n.concat(t?.compress?.filter(r=>e?.compress?.includes(r)))),n.map(r=>`.${r}`).join(",")}else return"*"}function nHe({label:t,defaultValue:e,placeholder:n,multiple:r=!1,accept:i,fileSizeLimit:o=2,fileCountLimit:a=20,onError:s,inputStyle:l,style:c,required:u,croppable:d,modal:f,...h}){const[m,g]=Tt([]),[v,b]=Tt(null);_t(()=>{h?.value===null&&m.length>0&&g([])},[h?.value]),_t(()=>{h.onChange&&(r?h.onChange(m):(m.length>0,h.onChange(m.at(-1))))},[m]);function y(E){try{const S=E.target.files||[];if(!r&&S.length>1){s?.("\u062D\u062F\u0627\u06A9\u062B\u0631 1 \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.");return}if(r&&S.length+m.length>a){s?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${a} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}const T=[];for(const A of S){if(A.size===0){s?.("\u0634\u0645\u0627 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0641\u0627\u06CC\u0644 \u062E\u0627\u0644\u06CC \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F");return}A.size/1024/1024>o?s?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0622\u067E\u0644\u0648\u062F ${o} \u0645\u06AF\u0627\u0628\u0627\u06CC\u062A \u0645\u06CC\u200C\u0628\u0627\u0634\u062F.`):T.push(A)}g(A=>[...A,...T])}catch(S){console.error("Error",S)}}const x=E=>{g(S=>S.filter(T=>T.name!==E))},w=E=>{const S={target:{files:[E]}};c0(()=>{x(E.name)}),y(S),v&&b(null)};function C(E){const S=E.target.files?.[0];if(!S)return;const T=S.name.split(".").at(-1)||"",A=["jpg","jpeg","png"].includes(T.toLocaleLowerCase());if(d&&A){const R=new FileReader;R.readAsDataURL(S),R.onload=function(P){const _=P.target?.result;_&&b({src:_,fileName:S.name})}}else y(E)}return ke("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"10px",alignItems:"center",width:"100%",...c},children:[ke(Ja,{children:[t," ",u&&"*"]}),M("label",{htmlFor:`external-file-uploader-${h.name}`,children:ke(Hv,{component:"span",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"5px",...l,...h?.disabled&&{opacity:"0.5"}},children:[M(gI,{}),n]})}),M("input",{style:{display:"none"},accept:Po&&i?tHe(i,Po):"*",id:`external-file-uploader-${h.name}`,type:"file",multiple:r,onChange:C,disabled:h?.disabled}),m&&m.map(E=>M(v6,{file:E,modal:f,onDelete:h.disabled?void 0:x,onCropImage:w,defaultCropHeight:h?.defaultCropHeight,defaultCropWidth:h?.defaultCropWidth,cropResizable:h?.cropResizable,cropStencil:h?.cropStencil,croppable:d},E?.name)),M(um,{open:!!v,src:v?.src||"",fileName:v?.fileName,defaultWidth:h?.defaultCropWidth,defaultHeight:h?.defaultCropHeight,onClose:()=>b(null),onCrop:w,resizable:h?.cropResizable,stencil:h?.cropStencil})]})}function rHe(t,e){if(e){const n={};return t.image&&(t.image==="ALL"?n["image/*"]=e.image.map(r=>`.${r}`):t.image.forEach(r=>{e?.image?.includes(r)&&(n["image/"+r]=["."+r])})),t.video&&(t.video==="ALL"?n["video/*"]=e.video.map(r=>`.${r}`):t.video.forEach(r=>{e?.video?.includes(r)&&(n["video/"+r]=["."+r])})),t.text&&(t.text==="ALL"?n["text/*"]=e.text.map(r=>`.${r}`):t.text.forEach(r=>{e?.text?.includes(r)&&(n["text/"+r]=["."+r])})),t.compress&&(t.compress==="ALL"?n["text/*"]=[...n["text/*"]??[],...e.compress.map(r=>`.${r}`)??[]]:t.compress.forEach(r=>{e?.compress?.includes(r)&&(n["text/"+r]=["."+r])})),n}else return"*"}const iHe=({label:t="\u0641\u0627\u06CC\u0644(\u0647\u0627) \u0631\u0627 \u062F\u0631 \u0627\u06CC\u0646 \u062C\u0639\u0628\u0647 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u0631\u0648\u06CC \u062C\u0639\u0628\u0647 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",multiple:e=!1,accept:n,fileCountLimit:r=20,fileSizeLimit:i=2,onError:o,required:a,croppable:s,modal:l,...c})=>{const[u,d]=Tt([]),[f,h]=Tt(null);_t(()=>{c.onChange&&(e?c.onChange(u):(u.length>0,c.onChange(u.at(-1))))},[u]);function m(T){try{const A=T.target.files||[];if(!e&&A.length>1){o?.("\u062D\u062F\u0627\u06A9\u062B\u0631 1 \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.");return}if(e&&A.length+u.length>r){o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${r} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}const R=[];for(const P of A){if(P.size===0){o?.("\u0634\u0645\u0627 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0641\u0627\u06CC\u0644 \u062E\u0627\u0644\u06CC \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F");return}P.size/1024/1024>i?o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0622\u067E\u0644\u0648\u062F ${i} \u0645\u06AF\u0627\u0628\u0627\u06CC\u062A \u0645\u06CC\u200C\u0628\u0627\u0634\u062F.`):R.push(P)}d(P=>[...P,...R])}catch(A){console.error("Error",A)}}const g=xr(T=>{const A={target:{files:T}};if(T.length+u.length>r){o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${r} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}else{const R=T?.[0];if(!R)return;const P=R.name.split(".").at(-1)||"",_=["jpg","jpeg","png"].includes(P.toLocaleLowerCase());if(s&&_){const I=new FileReader;I.onload=function(k){const F=k.target?.result;F&&h({src:F,fileName:R.name})},I.readAsDataURL(R)}else m(A)}},[u]),v=T=>{d(A=>A.filter(R=>R.name!==T))},b=T=>{const A={target:{files:[T]}};c0(()=>{v(T.name)}),m(A),f&&h(null)},{getRootProps:y,getInputProps:x,isDragAccept:w,isDragReject:C,open:E,inputRef:S}=VS({onDropAccepted:g,accept:n?rHe(n,Po??null):void 0,maxFiles:9999,noClick:!0,multiple:e,disabled:c?.disabled});return _t(()=>{if(!S.current)return;const T=async A=>{const R=A.clipboardData?.files;R&&R.length>0&&S.current&&(S.current.files=R,S.current.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[S]),ke(Ln,{children:[ke(Ln,{component:"section",sx:{mb:1,border:2,borderStyle:"dashed",borderRadius:3,borderColor:T=>T.palette.primary.main,transition:"all 0.3s ease-in-ease-out",...w&&{borderColor:T=>T.palette.success.main},...w&&{bgcolor:T=>T.palette.success.light},...C&&{borderColor:T=>T.palette.warning.main},...C&&{bgcolor:T=>T.palette.warning.light},...c.sx},...y(),children:[M("input",{...x(),...c["aria-id"]&&{"aria-id":c["aria-id"]}}),ke(Ln,{sx:{p:2,display:"flex",flexDirection:"column",justifyContent:"center"},children:[ke(Ja,{sx:{display:"flex",justifyContent:"center"},children:[t," ",a&&"*"]}),M(Ln,{sx:{display:"flex",justifyContent:"center"},children:M(xi,{sx:{color:T=>T.palette.primary.main,...w&&{color:T=>T.palette.success.main},...C&&{color:T=>T.palette.warning.main},...c?.disabled&&{opacity:"0.5"}},onClick:E,children:M(sR,{size:45})})}),M($S,{in:u?.length!==0||u?.length!==0,children:M("div",{style:{display:"flex",flexDirection:"row",gap:"10px",flexWrap:"wrap"},children:u&&u.map(T=>M(v6,{file:T,modal:l,onDelete:c.disabled?void 0:v,onCropImage:b,defaultCropHeight:c?.defaultCropHeight,defaultCropWidth:c?.defaultCropWidth,cropResizable:c?.cropResizable,cropStencil:c?.cropStencil,croppable:s},T?.name))})})]})]}),M(um,{open:!!f,src:f?.src||"",fileName:f?.fileName,defaultWidth:c?.defaultCropWidth,defaultHeight:c?.defaultCropHeight,onClose:()=>h(null),onCrop:b,resizable:c?.cropResizable,stencil:c?.cropStencil})]})};function oHe(t,e,n,r){const i=Array.from(new Set(t.map(s=>s[e])));return i.length===1&&i[0]===void 0?{series:[],uniqueCategoryArray:[]}:{series:Array.from(new Set(t.map(s=>s[n]))).map(s=>({name:s,data:i.map(l=>{const c=t.find(u=>u[n]===s&&u[e]===l);return c&&!Number.isNaN(parseInt(c[r]))?parseInt(c[r]):0})})),uniqueCategoryArray:i}}var vK={};/*!
580
+ `,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},b={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},y={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},x=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,C={},E=C.hasOwnProperty,S=function(B,W){return E.call(B,W)},T=function(B,W){for(var Y=-1,q=B.length;++Y<q;)if(B[Y]==W)return!0;return!1},A=function(B,W){if(!B)return W;var Y={},q;for(q in W)Y[q]=S(B,q)?B[q]:W[q];return Y},R=function(B,W){var Y="";return B>=55296&&B<=57343||B>1114111?(W&&I("character reference outside the permissible Unicode range"),"\uFFFD"):S(y,B)?(W&&I("disallowed character reference"),y[B]):(W&&T(x,B)&&I("disallowed character reference"),B>65535&&(B-=65536,Y+=w(B>>>10&1023|55296),B=56320|B&1023),Y+=w(B),Y)},P=function(B){return"&#x"+B.toString(16).toUpperCase()+";"},_=function(B){return"&#"+B+";"},I=function(B){throw Error("Parse error: "+B)},k=function(B,W){W=A(W,k.options);var Y=W.strict;Y&&m.test(B)&&I("forbidden code point");var q=W.encodeEverything,ee=W.useNamedReferences,Q=W.allowUnsafeSymbols,J=W.decimal?_:P,re=function(ie){return J(ie.charCodeAt(0))};return q?(B=B.replace(s,function(ie){return ee&&S(u,ie)?"&"+u[ie]+";":re(ie)}),ee&&(B=B.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),ee&&(B=B.replace(c,function(ie){return"&"+u[ie]+";"}))):ee?(Q||(B=B.replace(d,function(ie){return"&"+u[ie]+";"})),B=B.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),B=B.replace(c,function(ie){return"&"+u[ie]+";"})):Q||(B=B.replace(d,re)),B.replace(a,function(ie){var he=ie.charCodeAt(0),xe=ie.charCodeAt(1),Se=(he-55296)*1024+xe-56320+65536;return J(Se)}).replace(l,re)};k.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var F=function(B,W){W=A(W,F.options);var Y=W.strict;return Y&&h.test(B)&&I("malformed character reference"),B.replace(g,function(q,ee,Q,J,re,ie,he,xe,Se){var ye,K,ce,U,ue,le;return ee?(ue=ee,v[ue]):Q?(ue=Q,le=J,le&&W.isAttributeValue?(Y&&le=="="&&I("`&` did not start a character reference"),q):(Y&&I("named character reference was not terminated by a semicolon"),b[ue]+(le||""))):re?(ce=re,K=ie,Y&&!K&&I("character reference was not terminated by a semicolon"),ye=parseInt(ce,10),R(ye,Y)):he?(U=he,K=xe,Y&&!K&&I("character reference was not terminated by a semicolon"),ye=parseInt(U,16),R(ye,Y)):(Y&&I("named character reference was not terminated by a semicolon"),q)})};F.options={isAttributeValue:!1,strict:!1};var L=function(B){return B.replace(d,function(W){return f[W]})},$={version:"1.2.0",encode:k,decode:F,escape:L,unescape:F};if(r&&!r.nodeType)if(i)i.exports=$;else for(var N in $)S($,N)&&(r[N]=$[N]);else n.he=$})(ln)})(tT,tT.exports);var $We=tT.exports,nT=di($We);const zWe=(t,e)=>{if(!t)return t;switch(e.type){case"string":return UWe(t,e);case"number":return WWe(t,e);case"date":return HWe(t,e);case"time":return VWe(t,e);case"date-time":return jWe(t,e);case"boolean":return YWe(t);case"html":return qWe(t,e);default:return t}},UWe=(t,e)=>e.maxLength&&typeof e.maxLength!="number"?t:C1(nT.unescape(String(t)),"rtl",e.maxLength),C1=(t,e,n)=>n&&t.length>n?e==="rtl"?M(yr,{children:t.substring(0,n)+" ..."}):M(yr,{children:"..."+t.substring(0,n)}):M(yr,{children:t}),WWe=(t,e)=>{switch(e.typeNumber){case"int":return C1(String(parseInt(String(t))),"ltr",e.maxLength);case"float":return C1(String(parseFloat(String(t))),"ltr",e.maxLength);case"cost":{if(Number.isNaN(parseFloat(String(t))))return t;const n=String(t),[r,i]=n.split("."),o=r.replace(/\B(?=(\d{3})+(?!\d))/g,","),a=i?`${o}.${i}`:o;return C1(a,"ltr",e.maxLength)}default:return C1(String(parseFloat(String(t))),"ltr",e.maxLength)}},HWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Date value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Date value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"YYYY/MM/DD",en:"YYYY-MM-DD",ar:"YYYY/MM/DD"},a=e.format||(o[i]??"YYYY/MM/DD");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Date value is not a valid date (jalali moment)"),t}return s},VWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Time value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Time value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"HH:mm:ss",en:"hh:mm:ss a",ar:"hh:mm:ss a"},a=e.formatTime||(o[i]??"HH:mm:ss");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Time value is not a valid date (jalali moment)"),t}return s},jWe=(t,e)=>{if(typeof t!="string")return console.error("Kdpa Typography error: Date Time value is not a string"),t;const n=new Date(t);if(isNaN(n.getTime()))return console.error("Kdpa Typography error: Date Time value is not a valid date (new Date)"),t;const r=localStorage.getItem("i18nextLng")??"fa",i=e.loc||r,o={fa:"YYYY/MM/DD HH:mm:ss",en:"YYYY-MM-DD hh:mm:ss a",ar:"YYYY/MM/DD hh:mm:ss a"},a=e.formatDateTime||(o[i]??"YYYY/MM/DD HH:mm:ss");let s;try{s=rx(n).locale(i).format(a)}catch{return console.error("Kdpa Typography error: Date Time value is not a valid date (jalali moment)"),t}return s},YWe=t=>t?"true":"false",qWe=(t,e)=>{if(typeof t!="string")return t;const n=iN.sanitize(nT.unescape(t),{USE_PROFILES:{html:!0}});return M("div",{dangerouslySetInnerHTML:{__html:e.ignoreTags?n:t}})},GWe=({type:t="string",...e})=>{const n={type:t,maxLength:e.maxLength,typeNumber:e.typeNumber,format:e.format,formatTime:e.formatTime,formatDateTime:e.formatDateTime,loc:e.loc,ignoreTags:e.ignoreTags??!0};return M(Ja,{...e,sx:{whiteSpace:t==="html"?"normal":"pre-line",...e.sx},children:zWe(e.children,n)})};function XWe(t,e){if(e){let n=[];return t.image&&(t.image==="ALL"?n=n.concat(e.image):n=n.concat(t?.image?.filter(r=>e?.image?.includes(r)))),t.video&&(t.video==="ALL"?n=n.concat(e.video):n=n.concat(t?.video?.filter(r=>e?.video?.includes(r)))),t.text&&(t.text==="ALL"?n=n.concat(e.text):n=n.concat(t?.text?.filter(r=>e?.text?.includes(r)))),t.compress&&(t.compress==="ALL"?n=n.concat(e.compress):n=n.concat(t?.compress?.filter(r=>e?.compress?.includes(r)))),n.map(r=>`.${r}`).join(",")}else return"*"}const Po={image:["jpg","jpeg","gif","png","svg","ico"],font:["ttf","eot","woff","woff2"],text:["doc","pdf","xls","ppt","txt","htm","docx","bmp","xlsx","pptx","tif","xml","epub","bpmn","cmmn","csv"],video:["mp4","wmv","mpg","divx","div","tix","qt","mov","avi","mpa","mpe","m1v","bmp"],compress:["zip","rar","tar","gz","tar.gz","tar.xz"]};function mK(t,e){return{thumbnail_URL:e?.[0]==="$"?`${t}${Od.upload}${xg.thumbnailTempPath}${e}`:`${t}${Od.upload}${xg.thumbnailstreamPath}${e}`,larg_URL:e?.[0]==="$"?`${t}${Od.upload}${xg.tempPath}${e}`:`${t}${Od.upload}${xg.streamPath}${e}`}}async function oN(t,e,n){if(!e||e.length===0)return[];try{const r={method:"POST",headers:{sessionId:n??"",Accept:"application/json","Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)};return(await(await fetch(`${t}${Od.upload}${e?.[0]?.[0]==="$"?xg.restTempUrlFileListProperty:xg.restStreamUrlFileListProperty}`,r)).json())?.data}catch(r){return console.error("Error:",r),[]}}const aN=(t,e,n)=>{t.filter(i=>i?.subStatusCode===3||i?.subStatusCode===4)?.forEach(i=>{if(i)switch(i?.subStatusCode){case 0:break;case 1:break;case 2:break;case 3:n?.(i?.message??"");break;case 4:e?.(i?.message??"");break}})},Od={upload:"/upload/rest"},xg={streamPath:"/api/v1/fileupload/download/stream/",thumbnailstreamPath:"/api/v1/fileupload/thumbnail/stream/",tempPath:"/api/v1/fileupload/download/temp/",thumbnailTempPath:"/api/v1/fileupload/thumbnail/temp/",restStreamUrlFileListProperty:"/api/v1/fileupload/propertylist/stream",restTempUrlFileListProperty:"/api/v1/fileupload/propertylist/temp",exportPath:"/api/v1/export/download/"},rT={pathFileUpload:"/api/v1/fileupload/",pathForUploadCunk:"/api/v1/fileupload/upload/session/",pathForGetFile:"/api/v1/fileupload/upload/"},KWe=(t,e)=>`/auth/api/v1/BPMSCaptcha/image?name=${t}&rnd=${e}`,ZWe=Ri("div")();function JWe({label:t,defaultValue:e,placeholder:n,multiple:r=!1,accept:i,fileCountLimit:o,fileSizeLimit:a,onError:s,onWarning:l,pathProp:c,inputStyle:u,required:d,downloadSmallSize:f,croppable:h,modal:m,...g}){const{files:v,removeFile:b,uploadingFiles:y,handleFileChange:x,fileExtension:w,APIURL:C}=KF({multiple:r,APIURL:c?.APIURL,sessionId:c?.sessionId,serviceName:Od.upload,onError:s,onWarning:l,fileSizeLimit:a,fileCountLimit:o}),[E,S]=Tt([]),[T,A]=Tt(null);_t(()=>{g?.value===null&&E.length>0&&(E.forEach(k=>b(k.session)),S([]))},[g?.value]),_t(()=>{(async()=>{if(e){const F=Array.isArray(e)?[...e]:[e],L=await oN(C,F,c?.sessionId),$=F.map(N=>({fileName:(L??[]).find(B=>B.guid===N)?.fileName,session:N}));S($),R($)}else S([])})()},[e]),_t(()=>{if(v&&v.length>0)if(r)S(k=>{const F=[...k,...v.filter(L=>!E.find($=>$.session===L.session)).map(L=>({fileName:L.fileName,session:L.session}))??[]];return R(F),F});else{const k=[{fileName:v[0]?.fileName,session:v[0]?.session}];R(k),S(k)}},[v]);function R(k){g.onChange&&(r?g.onChange((k??[]).map(F=>F.session)):k.length>0?g.onChange(k[k.length-1]?.session):g.onChange())}const P=k=>{S(F=>{const L=F.filter($=>$.session!==k);return R(L),L}),v?.find(F=>F.session===k)&&b&&b(k)},_=(k,F)=>{const L={target:{files:[k]}};F&&P(F),x(L,i),T&&A(null)};function I(k){const F=k.target.files?.[0];if(!F)return;const L=F.name.split(".").at(-1)||"",$=["jpg","jpeg","png"].includes(L.toLocaleLowerCase());if(h&&$){const N=new FileReader;N.onload=function(B){const W=B.target?.result;W&&A({src:W,fileName:F.name})},N.readAsDataURL(F)}else x(k,i)}return ke(yr,{children:[ke(ZWe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"10px",alignItems:"center",width:"100%",...g?.style||{},...g?.sx||{}},children:[ke(Ja,{children:[t," ",d&&"*"]}),M("label",{htmlFor:`icon-button-file-${g.name}`,children:ke(Hv,{component:"span",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"5px",...u,...g?.disabled&&{opacity:"0.5"}},color:g?.error?"error":"primary",children:[M(gI,{}),n]})}),M("input",{style:{display:"none"},accept:w&&i?XWe(i,w):"*",id:`icon-button-file-${g.name}`,type:"file",multiple:r,onChange:I,disabled:g?.disabled,value:""}),E&&(r||y.length===0)&&E.map(k=>{const F=mK(C,k.session);return M(g6,{sessionId:k?.session,smallUrl:F.thumbnail_URL,largeUrl:F.larg_URL,fileName:k?.fileName,onDelete:g.disabled?void 0:P,downloadSmallSize:f,modal:m,onCropImage:L=>_(L,k.session),defaultCropHeight:g?.defaultCropHeight,defaultCropWidth:g?.defaultCropWidth,cropResizable:g?.cropResizable,cropStencil:g?.cropStencil,croppable:h,extention:k.fileName?.split(".").pop()})}),y&&y.map(k=>M(mI,{progress:k.progress})),M(um,{open:!!T,src:T?.src||"",fileName:T?.fileName,defaultWidth:g?.defaultCropWidth,defaultHeight:g?.defaultCropHeight,onClose:()=>A(null),onCrop:_,resizable:g?.cropResizable,stencil:g?.cropStencil})]}),!g?.error&&g?.helperText&&M(NE,{children:g?.helperText})]})}function QWe(t,e){if(e){const n={};return t.image&&(t.image==="ALL"?n["image/*"]=e.image.map(r=>`.${r}`):t.image.forEach(r=>{e?.image?.includes(r)&&(n["image/"+r]=["."+r])})),t.video&&(t.video==="ALL"?n["video/*"]=e.video.map(r=>`.${r}`):t.video.forEach(r=>{e?.video?.includes(r)&&(n["video/"+r]=["."+r])})),t.text&&(t.text==="ALL"?n["text/*"]=e.text.map(r=>`.${r}`):t.text.forEach(r=>{e?.text?.includes(r)&&(n["text/"+r]=["."+r])})),t.compress&&(t.compress==="ALL"?n["text/*"]=[...n["text/*"]??[],...e.compress.map(r=>`.${r}`)??[]]:t.compress.forEach(r=>{e?.compress?.includes(r)&&(n["text/"+r]=["."+r])})),n}else return"*"}const eHe=({label:t="\u0641\u0627\u06CC\u0644(\u0647\u0627) \u0631\u0627 \u062F\u0631 \u0627\u06CC\u0646 \u062C\u0639\u0628\u0647 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u0631\u0648\u06CC \u062C\u0639\u0628\u0647 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",defaultValue:e,multiple:n=!1,accept:r,fileCountLimit:i=20,fileSizeLimit:o,onError:a,onWarning:s,required:l,pathProp:c,downloadSmallSize:u,croppable:d,modal:f,...h})=>{const{files:m,removeFile:g,uploadingFiles:v,handleFileChange:b,fileExtension:y,APIURL:x}=KF({multiple:n,APIURL:c?.APIURL,serviceName:Od.upload,sessionId:c?.sessionId,onError:a,onWarning:s,fileSizeLimit:o,fileCountLimit:i}),[w,C]=Tt([]),[E,S]=Tt(null);_t(()=>{h?.value===null&&w.length>0&&(w.forEach(N=>g(N.session)),C([]))},[h?.value]),_t(()=>{(async()=>{if(e){const B=Array.isArray(e)?[...e]:[e],W=await oN(x,B,c?.sessionId),Y=B.map(q=>({fileName:(W??[]).find(ee=>ee.guid===q)?.fileName,session:q}));C(Y),T(Y)}else C([])})()},[e]),_t(()=>{if(m&&m.length>0)if(n)C(N=>{const B=[...N,...m.filter(W=>!w.find(Y=>Y.session===W.session)).map(W=>({fileName:W.fileName,session:W.session}))??[]];return T(B),B});else{const N=[{fileName:m[0]?.fileName,session:m[0]?.session}];T(N),C(N)}},[m]);function T(N){h.onChange&&(n?h.onChange((N??[]).map(B=>B.session)):N.length>0?h.onChange(N[N.length-1].session):h.onChange())}const A=xr(N=>{const B={target:{files:N}};if(N.length+w.length>i){a?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${i} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}else{const W=N?.[0];if(!W)return;const Y=W.name.split(".").at(-1)||"",q=["jpg","jpeg","png"].includes(Y.toLocaleLowerCase());if(d&&q){const ee=new FileReader;ee.onload=function(Q){const J=Q.target?.result;J&&S({src:J,fileName:W.name})},ee.readAsDataURL(W)}else b(B,r)}},[w]),R=N=>{C(B=>{const W=B.filter(Y=>Y.session!==N);return T(W),W}),m?.find(B=>B.session===N)&&g&&g(N)},P=(N,B)=>{const W={target:{files:[N]}};B&&R(B),b(W,r),E&&S(null)},{getRootProps:_,getInputProps:I,isDragAccept:k,isDragReject:F,open:L,inputRef:$}=VS({onDropAccepted:A,accept:r?QWe(r,y??null):void 0,maxFiles:9999,noClick:!0,multiple:n,disabled:h?.disabled,onDropRejected(){a?.("\u0644\u0637\u0641\u0627 \u0641\u0631\u0645\u062A \u0645\u0646\u0627\u0633\u0628 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F.")}});return _t(()=>{if(!$.current)return;const N=async B=>{const W=B.clipboardData?.files;W&&W.length>0&&$.current&&($.current.files=W,$.current.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",N),()=>{document.removeEventListener("paste",N)}},[$]),ke(yr,{children:[ke(Ln,{children:[ke(Ln,{component:"section",sx:{mb:1,border:2,borderStyle:"dashed",borderRadius:3,borderColor:N=>h?.error?N.palette.error.main:N.palette.primary.main,transition:"all 0.3s ease-in-ease-out",...k&&{borderColor:N=>N.palette.success.main},...k&&{bgcolor:N=>N.palette.success.light},...F&&{borderColor:N=>N.palette.warning.main},...F&&{bgcolor:N=>N.palette.warning.light},...h.sx},..._(),children:[M("input",{...I(),...h["aria-id"]&&{"aria-id":h["aria-id"]}}),ke(Ln,{sx:{p:2,display:"flex",flexDirection:"column",justifyContent:"center"},children:[ke(Ja,{sx:{display:"flex",justifyContent:"center"},children:[t," ",l&&"*"]}),M(Ln,{sx:{display:"flex",justifyContent:"center"},children:M(xi,{sx:{color:N=>h?.error?N.palette.error.main:N.palette.primary.main,...k&&{color:N=>N.palette.success.main},...F&&{color:N=>N.palette.warning.main},...h?.disabled&&{opacity:"0.5"}},onClick:L,children:M(sR,{size:45})})}),M($S,{in:w?.length!==0||v?.length!==0,children:ke("div",{style:{display:"flex",flexDirection:"row",gap:"10px",flexWrap:"wrap"},children:[w&&(n||v.length===0)&&w.map(N=>{const B=mK(x,N.session);return M(g6,{sessionId:N.session,smallUrl:B.thumbnail_URL,largeUrl:B.larg_URL,fileName:N.fileName,onDelete:h.disabled?void 0:R,downloadSmallSize:u,modal:f,croppable:d,defaultCropHeight:h?.defaultCropHeight,defaultCropWidth:h?.defaultCropWidth,cropResizable:h?.cropResizable,cropStencil:h?.cropStencil,extention:N.fileName?.split(".").pop(),onCropImage:W=>P(W,N.session)})}),v&&v.map(N=>M(mI,{progress:N.progress}))]})})]})]}),M(um,{open:!!E,src:E?.src||"",fileName:E?.fileName||"",defaultWidth:h?.defaultCropWidth,defaultHeight:h?.defaultCropHeight,onCrop:P,onClose:()=>S(null),stencil:h?.cropStencil,resizable:h?.cropResizable})]}),!h?.error&&h?.helperText&&M(NE,{children:h?.helperText})]})};function tHe(t,e){if(e){let n=[];return t.image&&(t.image==="ALL"?n=n.concat(e.image):n=n.concat(t?.image?.filter(r=>e?.image?.includes(r)))),t.video&&(t.video==="ALL"?n=n.concat(e.video):n=n.concat(t?.video?.filter(r=>e?.video?.includes(r)))),t.text&&(t.text==="ALL"?n=n.concat(e.text):n=n.concat(t?.text?.filter(r=>e?.text?.includes(r)))),t.compress&&(t.compress==="ALL"?n=n.concat(e.compress):n=n.concat(t?.compress?.filter(r=>e?.compress?.includes(r)))),n.map(r=>`.${r}`).join(",")}else return"*"}function nHe({label:t,defaultValue:e,placeholder:n,multiple:r=!1,accept:i,fileSizeLimit:o=2,fileCountLimit:a=20,onError:s,inputStyle:l,style:c,required:u,croppable:d,modal:f,...h}){const[m,g]=Tt([]),[v,b]=Tt(null);_t(()=>{h?.value===null&&m.length>0&&g([])},[h?.value]),_t(()=>{h.onChange&&(r?h.onChange(m):(m.length>0,h.onChange(m.at(-1))))},[m]);function y(E){try{const S=E.target.files||[];if(!r&&S.length>1){s?.("\u062D\u062F\u0627\u06A9\u062B\u0631 1 \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.");return}if(r&&S.length+m.length>a){s?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${a} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}const T=[];for(const A of S){if(A.size===0){s?.("\u0634\u0645\u0627 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0641\u0627\u06CC\u0644 \u062E\u0627\u0644\u06CC \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F");return}A.size/1024/1024>o?s?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0622\u067E\u0644\u0648\u062F ${o} \u0645\u06AF\u0627\u0628\u0627\u06CC\u062A \u0645\u06CC\u200C\u0628\u0627\u0634\u062F.`):T.push(A)}g(A=>[...A,...T])}catch(S){console.error("Error",S)}}const x=E=>{g(S=>S.filter(T=>T.name!==E))},w=E=>{const S={target:{files:[E]}};c0(()=>{x(E.name)}),y(S),v&&b(null)};function C(E){const S=E.target.files?.[0];if(!S)return;const T=S.name.split(".").at(-1)||"",A=["jpg","jpeg","png"].includes(T.toLocaleLowerCase());if(d&&A){const R=new FileReader;R.readAsDataURL(S),R.onload=function(P){const _=P.target?.result;_&&b({src:_,fileName:S.name})}}else y(E)}return ke("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"10px",alignItems:"center",width:"100%",...c},children:[ke(Ja,{children:[t," ",u&&"*"]}),M("label",{htmlFor:`external-file-uploader-${h.name}`,children:ke(Hv,{component:"span",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"5px",...l,...h?.disabled&&{opacity:"0.5"}},children:[M(gI,{}),n]})}),M("input",{style:{display:"none"},accept:Po&&i?tHe(i,Po):"*",id:`external-file-uploader-${h.name}`,type:"file",multiple:r,onChange:C,disabled:h?.disabled}),m&&m.map(E=>M(v6,{file:E,modal:f,onDelete:h.disabled?void 0:x,onCropImage:w,defaultCropHeight:h?.defaultCropHeight,defaultCropWidth:h?.defaultCropWidth,cropResizable:h?.cropResizable,cropStencil:h?.cropStencil,croppable:d},E?.name)),M(um,{open:!!v,src:v?.src||"",fileName:v?.fileName,defaultWidth:h?.defaultCropWidth,defaultHeight:h?.defaultCropHeight,onClose:()=>b(null),onCrop:w,resizable:h?.cropResizable,stencil:h?.cropStencil})]})}function rHe(t,e){if(e){const n={};return t.image&&(t.image==="ALL"?n["image/*"]=e.image.map(r=>`.${r}`):t.image.forEach(r=>{e?.image?.includes(r)&&(n["image/"+r]=["."+r])})),t.video&&(t.video==="ALL"?n["video/*"]=e.video.map(r=>`.${r}`):t.video.forEach(r=>{e?.video?.includes(r)&&(n["video/"+r]=["."+r])})),t.text&&(t.text==="ALL"?n["text/*"]=e.text.map(r=>`.${r}`):t.text.forEach(r=>{e?.text?.includes(r)&&(n["text/"+r]=["."+r])})),t.compress&&(t.compress==="ALL"?n["text/*"]=[...n["text/*"]??[],...e.compress.map(r=>`.${r}`)??[]]:t.compress.forEach(r=>{e?.compress?.includes(r)&&(n["text/"+r]=["."+r])})),n}else return"*"}const iHe=({label:t="\u0641\u0627\u06CC\u0644(\u0647\u0627) \u0631\u0627 \u062F\u0631 \u0627\u06CC\u0646 \u062C\u0639\u0628\u0647 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u0631\u0648\u06CC \u062C\u0639\u0628\u0647 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",multiple:e=!1,accept:n,fileCountLimit:r=20,fileSizeLimit:i=2,onError:o,required:a,croppable:s,modal:l,...c})=>{const[u,d]=Tt([]),[f,h]=Tt(null);_t(()=>{c.onChange&&(e?c.onChange(u):(u.length>0,c.onChange(u.at(-1))))},[u]);function m(T){try{const A=T.target.files||[];if(!e&&A.length>1){o?.("\u062D\u062F\u0627\u06A9\u062B\u0631 1 \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.");return}if(e&&A.length+u.length>r){o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${r} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}const R=[];for(const P of A){if(P.size===0){o?.("\u0634\u0645\u0627 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0641\u0627\u06CC\u0644 \u062E\u0627\u0644\u06CC \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F");return}P.size/1024/1024>i?o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0622\u067E\u0644\u0648\u062F ${i} \u0645\u06AF\u0627\u0628\u0627\u06CC\u062A \u0645\u06CC\u200C\u0628\u0627\u0634\u062F.`):R.push(P)}d(P=>[...P,...R])}catch(A){console.error("Error",A)}}const g=xr(T=>{const A={target:{files:T}};if(T.length+u.length>r){o?.(`\u062D\u062F\u0627\u06A9\u062B\u0631 ${r} \u0641\u0627\u06CC\u0644 \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0646\u06CC\u062F.`);return}else{const R=T?.[0];if(!R)return;const P=R.name.split(".").at(-1)||"",_=["jpg","jpeg","png"].includes(P.toLocaleLowerCase());if(s&&_){const I=new FileReader;I.onload=function(k){const F=k.target?.result;F&&h({src:F,fileName:R.name})},I.readAsDataURL(R)}else m(A)}},[u]),v=T=>{d(A=>A.filter(R=>R.name!==T))},b=T=>{const A={target:{files:[T]}};c0(()=>{v(T.name)}),m(A),f&&h(null)},{getRootProps:y,getInputProps:x,isDragAccept:w,isDragReject:C,open:E,inputRef:S}=VS({onDropAccepted:g,accept:n?rHe(n,Po??null):void 0,maxFiles:9999,noClick:!0,multiple:e,disabled:c?.disabled});return _t(()=>{if(!S.current)return;const T=async A=>{const R=A.clipboardData?.files;R&&R.length>0&&S.current&&(S.current.files=R,S.current.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[S]),ke(Ln,{children:[ke(Ln,{component:"section",sx:{mb:1,border:2,borderStyle:"dashed",borderRadius:3,borderColor:T=>T.palette.primary.main,transition:"all 0.3s ease-in-ease-out",...w&&{borderColor:T=>T.palette.success.main},...w&&{bgcolor:T=>T.palette.success.light},...C&&{borderColor:T=>T.palette.warning.main},...C&&{bgcolor:T=>T.palette.warning.light},...c.sx},...y(),children:[M("input",{...x(),...c["aria-id"]&&{"aria-id":c["aria-id"]}}),ke(Ln,{sx:{p:2,display:"flex",flexDirection:"column",justifyContent:"center"},children:[ke(Ja,{sx:{display:"flex",justifyContent:"center"},children:[t," ",a&&"*"]}),M(Ln,{sx:{display:"flex",justifyContent:"center"},children:M(xi,{sx:{color:T=>T.palette.primary.main,...w&&{color:T=>T.palette.success.main},...C&&{color:T=>T.palette.warning.main},...c?.disabled&&{opacity:"0.5"}},onClick:E,children:M(sR,{size:45})})}),M($S,{in:u?.length!==0||u?.length!==0,children:M("div",{style:{display:"flex",flexDirection:"row",gap:"10px",flexWrap:"wrap"},children:u&&u.map(T=>M(v6,{file:T,modal:l,onDelete:c.disabled?void 0:v,onCropImage:b,defaultCropHeight:c?.defaultCropHeight,defaultCropWidth:c?.defaultCropWidth,cropResizable:c?.cropResizable,cropStencil:c?.cropStencil,croppable:s},T?.name))})})]})]}),M(um,{open:!!f,src:f?.src||"",fileName:f?.fileName,defaultWidth:c?.defaultCropWidth,defaultHeight:c?.defaultCropHeight,onClose:()=>h(null),onCrop:b,resizable:c?.cropResizable,stencil:c?.cropStencil})]})};function oHe(t,e,n,r){const i=Array.from(new Set(t.map(s=>s[e])));return i.length===1&&i[0]===void 0?{series:[],uniqueCategoryArray:[]}:{series:Array.from(new Set(t.map(s=>s[n]))).map(s=>({name:s,data:i.map(l=>{const c=t.find(u=>u[n]===s&&u[e]===l);return c&&!Number.isNaN(parseInt(c[r]))?parseInt(c[r]):0})})),uniqueCategoryArray:i}}var vK={};/*!
581
581
  * ApexCharts v5.3.5
582
582
  * (c) 2018-2025 ApexCharts
583
583
  */function sN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function bK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,EK(r.key),r)}}function Jt(t,e,n){return e&&yK(t.prototype,e),n&&yK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function E1(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=cN(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.